diff options
Diffstat (limited to 'drivers/staging/vt6655/device_main.c')
-rw-r--r-- | drivers/staging/vt6655/device_main.c | 104 |
1 files changed, 48 insertions, 56 deletions
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index 89d1c22695a0..9e3b3f2bbe53 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -290,7 +290,7 @@ DEFINE_PCI_DEVICE_TABLE(vt6655_pci_id_table) = { static int vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent); -static bool vt6655_init_info(struct pci_dev* pcid, PSDevice* ppDevice, PCHIP_INFO); +static void vt6655_init_info(struct pci_dev* pcid, PSDevice* ppDevice, PCHIP_INFO); static void device_free_info(PSDevice pDevice); static bool device_get_pci_info(PSDevice, struct pci_dev* pcid); static void device_print_info(PSDevice pDevice); @@ -347,21 +347,22 @@ static int Config_FileGetParameter(unsigned char *string, -static char* get_chip_name(int chip_id) { - int i; - for (i=0;chip_info_table[i].name!=NULL;i++) - if (chip_info_table[i].chip_id==chip_id) - break; - return chip_info_table[i].name; +static char* get_chip_name(int chip_id) +{ + int i; + for (i = 0; chip_info_table[i].name != NULL; i++) + if (chip_info_table[i].chip_id == chip_id) + break; + return chip_info_table[i].name; } static void __devexit vt6655_remove(struct pci_dev *pcid) { - PSDevice pDevice=pci_get_drvdata(pcid); + PSDevice pDevice = pci_get_drvdata(pcid); - if (pDevice==NULL) - return; - device_free_info(pDevice); + if (pDevice == NULL) + return; + device_free_info(pDevice); } @@ -397,31 +398,29 @@ device_set_bool_opt(unsigned int *opt, int val,bool def,u32 flag, char* name,cha } } */ -static void -device_get_options(PSDevice pDevice, int index, char* devname) { - - POPTIONS pOpts = &(pDevice->sOpts); - pOpts->nRxDescs0=RX_DESC_DEF0; - pOpts->nRxDescs1=RX_DESC_DEF1; - pOpts->nTxDescs[0]=TX_DESC_DEF0; - pOpts->nTxDescs[1]=TX_DESC_DEF1; -pOpts->flags|=DEVICE_FLAGS_IP_ALIGN; - pOpts->int_works=INT_WORKS_DEF; - pOpts->rts_thresh=RTS_THRESH_DEF; - pOpts->frag_thresh=FRAG_THRESH_DEF; - pOpts->data_rate=DATA_RATE_DEF; - pOpts->channel_num=CHANNEL_DEF; - -pOpts->flags|=DEVICE_FLAGS_PREAMBLE_TYPE; -pOpts->flags|=DEVICE_FLAGS_OP_MODE; -//pOpts->flags|=DEVICE_FLAGS_PS_MODE; - pOpts->short_retry=SHORT_RETRY_DEF; - pOpts->long_retry=LONG_RETRY_DEF; - pOpts->bbp_type=BBP_TYPE_DEF; -pOpts->flags|=DEVICE_FLAGS_80211h_MODE; -pOpts->flags|=DEVICE_FLAGS_DiversityANT; - - +static void device_get_options(PSDevice pDevice, int index, char* devname) +{ + POPTIONS pOpts = &(pDevice->sOpts); + + pOpts->nRxDescs0 = RX_DESC_DEF0; + pOpts->nRxDescs1 = RX_DESC_DEF1; + pOpts->nTxDescs[0] = TX_DESC_DEF0; + pOpts->nTxDescs[1] = TX_DESC_DEF1; + pOpts->flags |= DEVICE_FLAGS_IP_ALIGN; + pOpts->int_works = INT_WORKS_DEF; + pOpts->rts_thresh = RTS_THRESH_DEF; + pOpts->frag_thresh = FRAG_THRESH_DEF; + pOpts->data_rate = DATA_RATE_DEF; + pOpts->channel_num = CHANNEL_DEF; + + pOpts->flags |= DEVICE_FLAGS_PREAMBLE_TYPE; + pOpts->flags |= DEVICE_FLAGS_OP_MODE; + //pOpts->flags|=DEVICE_FLAGS_PS_MODE; + pOpts->short_retry = SHORT_RETRY_DEF; + pOpts->long_retry = LONG_RETRY_DEF; + pOpts->bbp_type = BBP_TYPE_DEF; + pOpts->flags |= DEVICE_FLAGS_80211h_MODE; + pOpts->flags |= DEVICE_FLAGS_DiversityANT; } static void @@ -518,7 +517,7 @@ static void s_vCompleteCurrentMeasure (PSDevice pDevice, unsigned char byResult) // -// Initialiation of MAC & BBP registers +// Initialisation of MAC & BBP registers // static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType) @@ -894,18 +893,15 @@ static bool device_release_WPADEV(PSDevice pDevice) return true; } - static const struct net_device_ops device_netdev_ops = { - .ndo_open = device_open, - .ndo_stop = device_close, - .ndo_do_ioctl = device_ioctl, - .ndo_get_stats = device_get_stats, - .ndo_start_xmit = device_xmit, - .ndo_set_rx_mode = device_set_multi, + .ndo_open = device_open, + .ndo_stop = device_close, + .ndo_do_ioctl = device_ioctl, + .ndo_get_stats = device_get_stats, + .ndo_start_xmit = device_xmit, + .ndo_set_rx_mode = device_set_multi, }; - - static int __devinit vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent) { @@ -926,7 +922,7 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent) if (dev == NULL) { printk(KERN_ERR DEVICE_NAME ": allocate net device failed \n"); - return -ENODEV; + return -ENOMEM; } // Chain it all together @@ -939,9 +935,7 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent) bFirst=false; } - if (!vt6655_init_info(pcid, &pDevice, pChip_info)) { - return -ENOMEM; - } + vt6655_init_info(pcid, &pDevice, pChip_info); pDevice->dev = dev; pDevice->next_module = root_device_dev; root_device_dev = dev; @@ -1064,7 +1058,7 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent) //Mask out the options cannot be set to the chip pDevice->sOpts.flags &= pChip_info->flags; - //Enable the chip specified capbilities + //Enable the chip specified capabilities pDevice->flags = pDevice->sOpts.flags | (pChip_info->flags & 0xFF000000UL); pDevice->tx_80211 = device_dma0_tx_80211; pDevice->sMgmtObj.pAdapter = (void *)pDevice; @@ -1105,7 +1099,7 @@ static void device_print_info(PSDevice pDevice) } -static bool __devinit vt6655_init_info(struct pci_dev* pcid, PSDevice* ppDevice, +static void __devinit vt6655_init_info(struct pci_dev* pcid, PSDevice* ppDevice, PCHIP_INFO pChip_info) { PSDevice p; @@ -1129,8 +1123,6 @@ static bool __devinit vt6655_init_info(struct pci_dev* pcid, PSDevice* ppDevice, (*ppDevice)->multicast_limit =32; spin_lock_init(&((*ppDevice)->lock)); - - return true; } static bool device_get_pci_info(PSDevice pDevice, struct pci_dev* pcid) { @@ -1678,7 +1670,7 @@ static int device_tx_srv(PSDevice pDevice, unsigned int uIdx) { uFrameSize = pTD->pTDInfo->dwReqCount - uFIFOHeaderSize; pTxBufHead = (PSTxBufHead) (pTD->pTDInfo->buf); // Update the statistics based on the Transmit status - // now, we DO'NT check TSR0_CDH + // now, we DONT check TSR0_CDH STAvUpdateTDStatCounter(&pDevice->scStatistic, byTsr0, byTsr1, @@ -2660,7 +2652,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { (pDevice->byLocalID != REV_ID_VT3253_B0) && (pDevice->bBSSIDFilter == true)) { // update RSSI - //BBbReadEmbeded(pDevice->PortOffset, 0x3E, &byRSSI); + //BBbReadEmbedded(pDevice->PortOffset, 0x3E, &byRSSI); //pDevice->uCurrRSSI = byRSSI; } */ |