Commit 915006cd authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman

staging:vt6655:device_main: Whitespace cleanups

Neatening only.
git diff -w shows no differences.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 74533af4
......@@ -98,10 +98,10 @@ MODULE_AUTHOR("VIA Networking Technologies, Inc., <lyndonchen@vntek.com.tw>");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("VIA Networking Solomon-A/B/G Wireless LAN Adapter Driver");
static int mlme_kill;
//static struct task_struct * mlme_task;
static int mlme_kill;
//static struct task_struct * mlme_task;
#define DEVICE_PARAM(N,D)
#define DEVICE_PARAM(N, D)
/*
static const int N[MAX_UINTS]=OPTION_DEFAULT;\
MODULE_PARM(N, "1-" __MODULE_STRING(MAX_UINTS) "i");\
......@@ -111,22 +111,22 @@ MODULE_DESCRIPTION("VIA Networking Solomon-A/B/G Wireless LAN Adapter Driver");
#define RX_DESC_MIN0 16
#define RX_DESC_MAX0 128
#define RX_DESC_DEF0 32
DEVICE_PARAM(RxDescriptors0,"Number of receive descriptors0");
DEVICE_PARAM(RxDescriptors0, "Number of receive descriptors0");
#define RX_DESC_MIN1 16
#define RX_DESC_MAX1 128
#define RX_DESC_DEF1 32
DEVICE_PARAM(RxDescriptors1,"Number of receive descriptors1");
DEVICE_PARAM(RxDescriptors1, "Number of receive descriptors1");
#define TX_DESC_MIN0 16
#define TX_DESC_MAX0 128
#define TX_DESC_DEF0 32
DEVICE_PARAM(TxDescriptors0,"Number of transmit descriptors0");
DEVICE_PARAM(TxDescriptors0, "Number of transmit descriptors0");
#define TX_DESC_MIN1 16
#define TX_DESC_MAX1 128
#define TX_DESC_DEF1 64
DEVICE_PARAM(TxDescriptors1,"Number of transmit descriptors1");
DEVICE_PARAM(TxDescriptors1, "Number of transmit descriptors1");
#define IP_ALIG_DEF 0
......@@ -136,14 +136,14 @@ DEVICE_PARAM(TxDescriptors1,"Number of transmit descriptors1");
In some environment, the IP header should be unsigned long byte aligned,
or the packet will be droped when we receive it. (eg: IPVS)
*/
DEVICE_PARAM(IP_byte_align,"Enable IP header dword aligned");
DEVICE_PARAM(IP_byte_align, "Enable IP header dword aligned");
#define INT_WORKS_DEF 20
#define INT_WORKS_MIN 10
#define INT_WORKS_MAX 64
DEVICE_PARAM(int_works,"Number of packets per interrupt services");
DEVICE_PARAM(int_works, "Number of packets per interrupt services");
#define CHANNEL_MIN 1
#define CHANNEL_MAX 14
......@@ -271,14 +271,14 @@ DEVICE_PARAM(bDiversityANTEnable, "ANT diversity mode");
//
static int device_nics =0;
static PSDevice pDevice_Infos =NULL;
static int device_nics = 0;
static PSDevice pDevice_Infos = NULL;
static struct net_device *root_device_dev = NULL;
static CHIP_INFO chip_info_table[]= {
static CHIP_INFO chip_info_table[] = {
{ VT3253, "VIA Networking Solomon-A/B/G Wireless LAN Adapter ",
256, 1, DEVICE_FLAGS_IP_ALIGN|DEVICE_FLAGS_TX_ALIGN },
{0,NULL}
{0, NULL}
};
DEFINE_PCI_DEVICE_TABLE(vt6655_pci_id_table) = {
......@@ -290,15 +290,15 @@ DEFINE_PCI_DEVICE_TABLE(vt6655_pci_id_table) = {
static int vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent);
static void 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 bool device_get_pci_info(PSDevice, struct pci_dev *pcid);
static void device_print_info(PSDevice pDevice);
static struct net_device_stats *device_get_stats(struct net_device *dev);
static void device_init_diversity_timer(PSDevice pDevice);
static int device_open(struct net_device *dev);
static int device_xmit(struct sk_buff *skb, struct net_device *dev);
static irqreturn_t device_intr(int irq, void*dev_instance);
static irqreturn_t device_intr(int irq, void *dev_instance);
static void device_set_multi(struct net_device *dev);
static int device_close(struct net_device *dev);
static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
......@@ -347,7 +347,7 @@ static int Config_FileGetParameter(unsigned char *string,
static char* get_chip_name(int chip_id)
static char *get_chip_name(int chip_id)
{
int i;
for (i = 0; chip_info_table[i].name != NULL; i++)
......@@ -367,8 +367,8 @@ static void vt6655_remove(struct pci_dev *pcid)
}
/*
static void
device_set_int_opt(int *opt, int val, int min, int max, int def,char* name,char* devname) {
static void
device_set_int_opt(int *opt, int val, int min, int max, int def,char* name,char* devname) {
if (val==-1)
*opt=def;
else if (val<min || val>max) {
......@@ -380,10 +380,10 @@ device_set_int_opt(int *opt, int val, int min, int max, int def,char* name,char*
devname, name, val);
*opt=val;
}
}
}
static void
device_set_bool_opt(unsigned int *opt, int val,bool def,u32 flag, char* name,char* devname) {
static void
device_set_bool_opt(unsigned int *opt, int val,bool def,u32 flag, char* name,char* devname) {
(*opt)&=(~flag);
if (val==-1)
*opt|=(def ? flag : 0);
......@@ -396,9 +396,9 @@ device_set_bool_opt(unsigned int *opt, int val,bool def,u32 flag, char* name,cha
devname,name , val ? "true" : "false");
*opt|=(val ? flag : 0);
}
}
}
*/
static void device_get_options(PSDevice pDevice, int index, char* devname)
static void device_get_options(PSDevice pDevice, int index, char *devname)
{
POPTIONS pOpts = &(pDevice->sOpts);
......@@ -455,44 +455,44 @@ device_set_options(PSDevice pDevice) {
pDevice->byAutoFBCtrl = AUTO_FB_0;
//pDevice->byAutoFBCtrl = AUTO_FB_1;
//PLICE_DEBUG<-
pDevice->bUpdateBBVGA = true;
pDevice->bUpdateBBVGA = true;
pDevice->byFOETuning = 0;
pDevice->wCTSDuration = 0;
pDevice->byPreambleType = 0;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" uChannel= %d\n",(int)pDevice->uChannel);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" byOpMode= %d\n",(int)pDevice->byOpMode);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" ePSMode= %d\n",(int)pDevice->ePSMode);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" wRTSThreshold= %d\n",(int)pDevice->wRTSThreshold);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" byShortRetryLimit= %d\n",(int)pDevice->byShortRetryLimit);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" byLongRetryLimit= %d\n",(int)pDevice->byLongRetryLimit);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" byPreambleType= %d\n",(int)pDevice->byPreambleType);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" byShortPreamble= %d\n",(int)pDevice->byShortPreamble);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" uConnectionRate= %d\n",(int)pDevice->uConnectionRate);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" byBBType= %d\n",(int)pDevice->byBBType);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->b11hEnable= %d\n",(int)pDevice->b11hEnable);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" pDevice->bDiversityRegCtlON= %d\n",(int)pDevice->bDiversityRegCtlON);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " uChannel= %d\n", (int)pDevice->uChannel);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " byOpMode= %d\n", (int)pDevice->byOpMode);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " ePSMode= %d\n", (int)pDevice->ePSMode);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " wRTSThreshold= %d\n", (int)pDevice->wRTSThreshold);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " byShortRetryLimit= %d\n", (int)pDevice->byShortRetryLimit);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " byLongRetryLimit= %d\n", (int)pDevice->byLongRetryLimit);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " byPreambleType= %d\n", (int)pDevice->byPreambleType);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " byShortPreamble= %d\n", (int)pDevice->byShortPreamble);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " uConnectionRate= %d\n", (int)pDevice->uConnectionRate);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " byBBType= %d\n", (int)pDevice->byBBType);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " pDevice->b11hEnable= %d\n", (int)pDevice->b11hEnable);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " pDevice->bDiversityRegCtlON= %d\n", (int)pDevice->bDiversityRegCtlON);
}
static void s_vCompleteCurrentMeasure (PSDevice pDevice, unsigned char byResult)
static void s_vCompleteCurrentMeasure(PSDevice pDevice, unsigned char byResult)
{
unsigned int ii;
unsigned long dwDuration = 0;
unsigned char byRPI0 = 0;
for(ii=1;ii<8;ii++) {
for (ii = 1; ii < 8; ii++) {
pDevice->dwRPIs[ii] *= 255;
dwDuration |= *((unsigned short *) (pDevice->pCurrMeasureEID->sReq.abyDuration));
dwDuration |= *((unsigned short *)(pDevice->pCurrMeasureEID->sReq.abyDuration));
dwDuration <<= 10;
pDevice->dwRPIs[ii] /= dwDuration;
pDevice->abyRPIs[ii] = (unsigned char) pDevice->dwRPIs[ii];
pDevice->abyRPIs[ii] = (unsigned char)pDevice->dwRPIs[ii];
byRPI0 += pDevice->abyRPIs[ii];
}
pDevice->abyRPIs[0] = (0xFF - byRPI0);
if (pDevice->uNumOfMeasureEIDs == 0) {
VNTWIFIbMeasureReport( pDevice->pMgmt,
VNTWIFIbMeasureReport(pDevice->pMgmt,
true,
pDevice->pCurrMeasureEID,
byResult,
......@@ -501,7 +501,7 @@ static void s_vCompleteCurrentMeasure (PSDevice pDevice, unsigned char byResult)
pDevice->abyRPIs
);
} else {
VNTWIFIbMeasureReport( pDevice->pMgmt,
VNTWIFIbMeasureReport(pDevice->pMgmt,
false,
pDevice->pCurrMeasureEID,
byResult,
......@@ -509,7 +509,7 @@ static void s_vCompleteCurrentMeasure (PSDevice pDevice, unsigned char byResult)
pDevice->byCCAFraction,
pDevice->abyRPIs
);
CARDbStartMeasure (pDevice, pDevice->pCurrMeasureEID++, pDevice->uNumOfMeasureEIDs);
CARDbStartMeasure(pDevice, pDevice->pCurrMeasureEID++, pDevice->uNumOfMeasureEIDs);
}
}
......@@ -527,7 +527,7 @@ static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType)
unsigned char byValue1;
unsigned char byCCKPwrdBm = 0;
unsigned char byOFDMPwrdBm = 0;
int zonetype=0;
int zonetype = 0;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
MACbShutdown(pDevice->PortOffset);
BBvSoftwareReset(pDevice->PortOffset);
......@@ -555,7 +555,7 @@ static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType)
VNSvInPortB(pDevice->PortOffset + MAC_REG_LOCALID, &(pDevice->byLocalID));
spin_lock_irq(&pDevice->lock);
SROMvReadAllContents(pDevice->PortOffset,pDevice->abyEEPROM);
SROMvReadAllContents(pDevice->PortOffset, pDevice->abyEEPROM);
spin_unlock_irq(&pDevice->lock);
......@@ -597,9 +597,9 @@ static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType)
else
pDevice->byRxAntennaMode = ANT_B;
// chester for antenna
byValue1 = SROMbyReadEmbedded(pDevice->PortOffset, EEP_OFS_ANTENNA);
byValue1 = SROMbyReadEmbedded(pDevice->PortOffset, EEP_OFS_ANTENNA);
// if (pDevice->bDiversityRegCtlON)
if((byValue1&0x08)==0)
if ((byValue1 & 0x08) == 0)
pDevice->bDiversityEnable = false;//SROMbyReadEmbedded(pDevice->PortOffset, 0x50);
else
pDevice->bDiversityEnable = true;
......@@ -629,42 +629,42 @@ byValue1 = SROMbyReadEmbedded(pDevice->PortOffset, EEP_OFS_ANTENNA);
//printk("init registers: TxAntennaMode is %d\n",pDevice->byTxAntennaMode);
#endif
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "bDiversityEnable=[%d],NValue=[%d],MValue=[%d],TMax=[%d],TMax2=[%d]\n",
pDevice->bDiversityEnable,(int)pDevice->ulDiversityNValue,(int)pDevice->ulDiversityMValue,pDevice->byTMax,pDevice->byTMax2);
pDevice->bDiversityEnable, (int)pDevice->ulDiversityNValue, (int)pDevice->ulDiversityMValue, pDevice->byTMax, pDevice->byTMax2);
//#ifdef ZoneType_DefaultSetting
//2008-8-4 <add> by chester
//zonetype initial
pDevice->byOriginalZonetype = pDevice->abyEEPROM[EEP_OFS_ZONETYPE];
zonetype = Config_FileOperation(pDevice,false,NULL);
zonetype = Config_FileOperation(pDevice, false, NULL);
if (zonetype >= 0) { //read zonetype file ok!
if ((zonetype == 0)&&
(pDevice->abyEEPROM[EEP_OFS_ZONETYPE] !=0x00)){ //for USA
if ((zonetype == 0) &&
(pDevice->abyEEPROM[EEP_OFS_ZONETYPE] != 0x00)) { //for USA
pDevice->abyEEPROM[EEP_OFS_ZONETYPE] = 0;
pDevice->abyEEPROM[EEP_OFS_MAXCHANNEL] = 0x0B;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Init Zone Type :USA\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Init Zone Type :USA\n");
}
else if((zonetype == 1)&&
(pDevice->abyEEPROM[EEP_OFS_ZONETYPE]!=0x01)){ //for Japan
else if ((zonetype == 1) &&
(pDevice->abyEEPROM[EEP_OFS_ZONETYPE] != 0x01)) { //for Japan
pDevice->abyEEPROM[EEP_OFS_ZONETYPE] = 0x01;
pDevice->abyEEPROM[EEP_OFS_MAXCHANNEL] = 0x0D;
}
else if((zonetype == 2)&&
(pDevice->abyEEPROM[EEP_OFS_ZONETYPE]!=0x02)){ //for Europe
else if ((zonetype == 2) &&
(pDevice->abyEEPROM[EEP_OFS_ZONETYPE] != 0x02)) { //for Europe
pDevice->abyEEPROM[EEP_OFS_ZONETYPE] = 0x02;
pDevice->abyEEPROM[EEP_OFS_MAXCHANNEL] = 0x0D;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Init Zone Type :Europe\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Init Zone Type :Europe\n");
}
else
{
if(zonetype!=pDevice->abyEEPROM[EEP_OFS_ZONETYPE])
printk("zonetype in file[%02x] mismatch with in EEPROM[%02x]\n",zonetype,pDevice->abyEEPROM[EEP_OFS_ZONETYPE]);
else
printk("Read Zonetype file success,use default zonetype setting[%02x]\n",zonetype);
{
if (zonetype != pDevice->abyEEPROM[EEP_OFS_ZONETYPE])
printk("zonetype in file[%02x] mismatch with in EEPROM[%02x]\n", zonetype, pDevice->abyEEPROM[EEP_OFS_ZONETYPE]);
else
printk("Read Zonetype file success,use default zonetype setting[%02x]\n", zonetype);
}
}
else
printk("Read Zonetype file fail,use default zonetype setting[%02x]\n",SROMbyReadEmbedded(pDevice->PortOffset, EEP_OFS_ZONETYPE));
printk("Read Zonetype file fail,use default zonetype setting[%02x]\n", SROMbyReadEmbedded(pDevice->PortOffset, EEP_OFS_ZONETYPE));
// Get RFType
pDevice->byRFType = SROMbyReadEmbedded(pDevice->PortOffset, EEP_OFS_RFTYPE);
......@@ -696,24 +696,24 @@ else
// Load power Table
for (ii=0;ii<CB_MAX_CHANNEL_24G;ii++) {
pDevice->abyCCKPwrTbl[ii+1] = SROMbyReadEmbedded(pDevice->PortOffset, (unsigned char)(ii + EEP_OFS_CCK_PWR_TBL));
if (pDevice->abyCCKPwrTbl[ii+1] == 0) {
for (ii = 0; ii < CB_MAX_CHANNEL_24G; ii++) {
pDevice->abyCCKPwrTbl[ii + 1] = SROMbyReadEmbedded(pDevice->PortOffset, (unsigned char)(ii + EEP_OFS_CCK_PWR_TBL));
if (pDevice->abyCCKPwrTbl[ii + 1] == 0) {
pDevice->abyCCKPwrTbl[ii+1] = pDevice->byCCKPwr;
}
pDevice->abyOFDMPwrTbl[ii+1] = SROMbyReadEmbedded(pDevice->PortOffset, (unsigned char)(ii + EEP_OFS_OFDM_PWR_TBL));
if (pDevice->abyOFDMPwrTbl[ii+1] == 0) {
pDevice->abyOFDMPwrTbl[ii+1] = pDevice->byOFDMPwrG;
pDevice->abyOFDMPwrTbl[ii + 1] = SROMbyReadEmbedded(pDevice->PortOffset, (unsigned char)(ii + EEP_OFS_OFDM_PWR_TBL));
if (pDevice->abyOFDMPwrTbl[ii + 1] == 0) {
pDevice->abyOFDMPwrTbl[ii + 1] = pDevice->byOFDMPwrG;
}
pDevice->abyCCKDefaultPwr[ii+1] = byCCKPwrdBm;
pDevice->abyOFDMDefaultPwr[ii+1] = byOFDMPwrdBm;
pDevice->abyCCKDefaultPwr[ii + 1] = byCCKPwrdBm;
pDevice->abyOFDMDefaultPwr[ii + 1] = byOFDMPwrdBm;
}
//2008-8-4 <add> by chester
//recover 12,13 ,14channel for EUROPE by 11 channel
if(((pDevice->abyEEPROM[EEP_OFS_ZONETYPE] == ZoneType_Japan) ||
(pDevice->abyEEPROM[EEP_OFS_ZONETYPE] == ZoneType_Europe))&&
if (((pDevice->abyEEPROM[EEP_OFS_ZONETYPE] == ZoneType_Japan) ||
(pDevice->abyEEPROM[EEP_OFS_ZONETYPE] == ZoneType_Europe)) &&
(pDevice->byOriginalZonetype == ZoneType_USA)) {
for(ii=11;ii<14;ii++) {
for (ii = 11; ii < 14; ii++) {
pDevice->abyCCKPwrTbl[ii] = pDevice->abyCCKPwrTbl[10];
pDevice->abyOFDMPwrTbl[ii] = pDevice->abyOFDMPwrTbl[10];
......@@ -722,9 +722,9 @@ else
// Load OFDM A Power Table
for (ii=0;ii<CB_MAX_CHANNEL_5G;ii++) { //RobertYu:20041224, bug using CB_MAX_CHANNEL
pDevice->abyOFDMPwrTbl[ii+CB_MAX_CHANNEL_24G+1] = SROMbyReadEmbedded(pDevice->PortOffset, (unsigned char)(ii + EEP_OFS_OFDMA_PWR_TBL));
pDevice->abyOFDMDefaultPwr[ii+CB_MAX_CHANNEL_24G+1] = SROMbyReadEmbedded(pDevice->PortOffset, (unsigned char)(ii + EEP_OFS_OFDMA_PWR_dBm));
for (ii = 0; ii < CB_MAX_CHANNEL_5G; ii++) { //RobertYu:20041224, bug using CB_MAX_CHANNEL
pDevice->abyOFDMPwrTbl[ii + CB_MAX_CHANNEL_24G + 1] = SROMbyReadEmbedded(pDevice->PortOffset, (unsigned char)(ii + EEP_OFS_OFDMA_PWR_TBL));
pDevice->abyOFDMDefaultPwr[ii + CB_MAX_CHANNEL_24G + 1] = SROMbyReadEmbedded(pDevice->PortOffset, (unsigned char)(ii + EEP_OFS_OFDMA_PWR_dBm));
}
init_channel_table((void *)pDevice);
......@@ -786,18 +786,18 @@ else
// Get GPIO
MACvGPIOIn(pDevice->PortOffset, &pDevice->byGPIO);
//2008-4-14 <add> by chester for led issue
#ifdef FOR_LED_ON_NOTEBOOK
if (pDevice->byGPIO & GPIO0_DATA){pDevice->bHWRadioOff = true;}
if ( !(pDevice->byGPIO & GPIO0_DATA)){pDevice->bHWRadioOff = false;}
#ifdef FOR_LED_ON_NOTEBOOK
if (pDevice->byGPIO & GPIO0_DATA) { pDevice->bHWRadioOff = true; }
if (!(pDevice->byGPIO & GPIO0_DATA)) { pDevice->bHWRadioOff = false; }
}
if ( (pDevice->bRadioControlOff == true)) {
if ((pDevice->bRadioControlOff == true)) {
CARDbRadioPowerOff(pDevice);
}
else CARDbRadioPowerOn(pDevice);
else CARDbRadioPowerOn(pDevice);
#else
if (((pDevice->byGPIO & GPIO0_DATA) && !(pDevice->byRadioCtl & EEP_RADIOCTL_INV)) ||
( !(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV))) {
(!(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV))) {
pDevice->bHWRadioOff = true;
}
}
......@@ -806,32 +806,32 @@ else CARDbRadioPowerOn(pDevice);
}
#endif
}
pMgmt->eScanType = WMAC_SCAN_PASSIVE;
// get Permanent network address
SROMvReadEtherAddress(pDevice->PortOffset, pDevice->abyCurrentNetAddr);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Network address = %pM\n",
}
pMgmt->eScanType = WMAC_SCAN_PASSIVE;
// get Permanent network address
SROMvReadEtherAddress(pDevice->PortOffset, pDevice->abyCurrentNetAddr);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Network address = %pM\n",
pDevice->abyCurrentNetAddr);
// reset Tx pointer
CARDvSafeResetRx(pDevice);
// reset Rx pointer
CARDvSafeResetTx(pDevice);
// reset Tx pointer
CARDvSafeResetRx(pDevice);
// reset Rx pointer
CARDvSafeResetTx(pDevice);
if (pDevice->byLocalID <= REV_ID_VT3253_A1) {
if (pDevice->byLocalID <= REV_ID_VT3253_A1) {
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_RCR, RCR_WPAERR);
}
}
pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
// Turn On Rx DMA
MACvReceive0(pDevice->PortOffset);
MACvReceive1(pDevice->PortOffset);
// Turn On Rx DMA
MACvReceive0(pDevice->PortOffset);
MACvReceive1(pDevice->PortOffset);
// start the adapter
MACvStart(pDevice->PortOffset);
// start the adapter
MACvStart(pDevice->PortOffset);
netif_stop_queue(pDevice->dev);
netif_stop_queue(pDevice->dev);
}
......@@ -862,10 +862,10 @@ static void device_init_diversity_timer(PSDevice pDevice) {
static bool device_release_WPADEV(PSDevice pDevice)
{
viawget_wpa_header *wpahdr;
int ii=0;
int ii = 0;
// wait_queue_head_t Set_wait;
//send device close to wpa_supplicnat layer
if (pDevice->bWPADEVUp==true) {
if (pDevice->bWPADEVUp == true) {
wpahdr = (viawget_wpa_header *)pDevice->skb->data;
wpahdr->type = VIAWGET_DEVICECLOSE_MSG;
wpahdr->resp_ie_len = 0;
......@@ -882,11 +882,11 @@ static bool device_release_WPADEV(PSDevice pDevice)
//wait release WPADEV
// init_waitqueue_head(&Set_wait);
// wait_event_timeout(Set_wait, ((pDevice->wpadev==NULL)&&(pDevice->skb == NULL)),5*HZ); //1s wait
while((pDevice->bWPADEVUp==true)) {
while ((pDevice->bWPADEVUp == true)) {
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout (HZ/20); //wait 50ms
schedule_timeout(HZ / 20); //wait 50ms
ii++;
if(ii>20)
if (ii > 20)
break;
}
}
......@@ -906,11 +906,11 @@ static int
vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
{
static bool bFirst = true;
struct net_device* dev = NULL;
struct net_device *dev = NULL;
PCHIP_INFO pChip_info = (PCHIP_INFO)ent->driver_data;
PSDevice pDevice;
int rc;
if (device_nics ++>= MAX_UINTS) {
if (device_nics++ >= MAX_UINTS) {
printk(KERN_NOTICE DEVICE_NAME ": already found %d NICs\n", device_nics);
return -ENODEV;
}
......@@ -930,9 +930,9 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
SET_NETDEV_DEV(dev, &pcid->dev);
if (bFirst) {
printk(KERN_NOTICE "%s Ver. %s\n",DEVICE_FULL_DRV_NAM, DEVICE_VERSION);
printk(KERN_NOTICE "%s Ver. %s\n", DEVICE_FULL_DRV_NAM, DEVICE_VERSION);
printk(KERN_NOTICE "Copyright (c) 2003 VIA Networking Technologies, Inc.\n");
bFirst=false;
bFirst = false;
}
vt6655_init_info(pcid, &pDevice, pChip_info);
......@@ -947,9 +947,9 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
dev->irq = pcid->irq;
#ifdef DEBUG
printk("Before get pci_info memaddr is %x\n",pDevice->memaddr);
printk("Before get pci_info memaddr is %x\n", pDevice->memaddr);
#endif
if (device_get_pci_info(pDevice,pcid) == false) {
if (device_get_pci_info(pDevice, pcid) == false) {
printk(KERN_ERR DEVICE_NAME ": Failed to find PCI device.\n");
device_free_info(pDevice);
return -ENODEV;
......@@ -960,10 +960,10 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
#ifdef DEBUG
//pci_read_config_byte(pcid, PCI_BASE_ADDRESS_0, &pDevice->byRevId);
printk("after get pci_info memaddr is %x, io addr is %x,io_size is %d\n",pDevice->memaddr,pDevice->ioaddr,pDevice->io_size);
printk("after get pci_info memaddr is %x, io addr is %x,io_size is %d\n", pDevice->memaddr, pDevice->ioaddr, pDevice->io_size);
{
int i;
u32 bar,len;
u32 bar, len;
u32 address[] = {
PCI_BASE_ADDRESS_0,
PCI_BASE_ADDRESS_1,
......@@ -972,14 +972,14 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
PCI_BASE_ADDRESS_4,
PCI_BASE_ADDRESS_5,
0};
for (i=0;address[i];i++)
for (i = 0; address[i]; i++)
{
//pci_write_config_dword(pcid,address[i], 0xFFFFFFFF);
pci_read_config_dword(pcid, address[i], &bar);
printk("bar %d is %x\n",i,bar);
printk("bar %d is %x\n", i, bar);
if (!bar)
{
printk("bar %d not implemented\n",i);
printk("bar %d not implemented\n", i);
continue;
}
if (bar & PCI_BASE_ADDRESS_SPACE_IO) {
......@@ -1005,12 +1005,12 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
#endif
#ifdef DEBUG
//return 0 ;
//return 0;
#endif
pDevice->PortOffset = (unsigned long)ioremap(pDevice->memaddr & PCI_BASE_ADDRESS_MEM_MASK, pDevice->io_size);
//pDevice->PortOffset = (unsigned long)ioremap(pDevice->ioaddr & PCI_BASE_ADDRESS_IO_MASK, pDevice->io_size);
if(pDevice->PortOffset == 0) {
if (pDevice->PortOffset == 0) {
printk(KERN_ERR DEVICE_NAME ": Failed to IO remapping ..\n");
device_free_info(pDevice);
return -ENODEV;
......@@ -1031,11 +1031,11 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
unsigned char value;
VNSvInPortB(pDevice->PortOffset+0x4F, &value);
printk("Before write: value is %x\n",value);
printk("Before write: value is %x\n", value);
//VNSvInPortB(pDevice->PortOffset+0x3F, 0x00);
VNSvOutPortB(pDevice->PortOffset,value);
VNSvOutPortB(pDevice->PortOffset, value);
VNSvInPortB(pDevice->PortOffset+0x4F, &value);
printk("After write: value is %x\n",value);
printk("After write: value is %x\n", value);
#endif
......@@ -1084,33 +1084,33 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
static void device_print_info(PSDevice pDevice)
{
struct net_device* dev=pDevice->dev;
struct net_device *dev = pDevice->dev;
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "%s: %s\n",dev->name, get_chip_name(pDevice->chip_id));
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "%s: %s\n", dev->name, get_chip_name(pDevice->chip_id));
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "%s: MAC=%pM", dev->name, dev->dev_addr);
#ifdef IO_MAP
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO" IO=0x%lx ",(unsigned long) pDevice->ioaddr);
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO" IRQ=%d \n", pDevice->dev->irq);
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO " IO=0x%lx ", (unsigned long)pDevice->ioaddr);
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO " IRQ=%d \n", pDevice->dev->irq);
#else
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO" IO=0x%lx Mem=0x%lx ",
(unsigned long) pDevice->ioaddr,(unsigned long) pDevice->PortOffset);
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO" IRQ=%d \n", pDevice->dev->irq);
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO " IO=0x%lx Mem=0x%lx ",
(unsigned long)pDevice->ioaddr, (unsigned long)pDevice->PortOffset);
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO " IRQ=%d \n", pDevice->dev->irq);
#endif
}
static void vt6655_init_info(struct pci_dev* pcid, PSDevice* ppDevice,
static void vt6655_init_info(struct pci_dev *pcid, PSDevice *ppDevice,
PCHIP_INFO pChip_info) {
PSDevice p;
memset(*ppDevice,0,sizeof(DEVICE_INFO));
memset(*ppDevice, 0, sizeof(DEVICE_INFO));
if (pDevice_Infos == NULL) {
pDevice_Infos =*ppDevice;
pDevice_Infos = *ppDevice;
}
else {
for (p=pDevice_Infos;p->next!=NULL;p=p->next)
for (p = pDevice_Infos; p->next != NULL; p = p->next)
do {} while (0);
p->next = *ppDevice;
(*ppDevice)->prev = p;
......@@ -1120,40 +1120,40 @@ static void vt6655_init_info(struct pci_dev* pcid, PSDevice* ppDevice,
(*ppDevice)->chip_id = pChip_info->chip_id;
(*ppDevice)->io_size = pChip_info->io_size;
(*ppDevice)->nTxQueues = pChip_info->nTxQueue;
(*ppDevice)->multicast_limit =32;
(*ppDevice)->multicast_limit = 32;
spin_lock_init(&((*ppDevice)->lock));
}
static bool device_get_pci_info(PSDevice pDevice, struct pci_dev* pcid) {
static bool device_get_pci_info(PSDevice pDevice, struct pci_dev *pcid) {
u16 pci_cmd;
u8 b;
unsigned int cis_addr;
#ifdef PLICE_DEBUG
unsigned char pci_config[256];
unsigned char value =0x00;
int ii,j;
u16 max_lat=0x0000;
memset(pci_config,0x00,256);
unsigned char value = 0x00;
int ii, j;
u16 max_lat = 0x0000;
memset(pci_config, 0x00, 256);
#endif
pci_read_config_byte(pcid, PCI_REVISION_ID, &pDevice->byRevId);
pci_read_config_word(pcid, PCI_SUBSYSTEM_ID,&pDevice->SubSystemID);
pci_read_config_word(pcid, PCI_SUBSYSTEM_ID, &pDevice->SubSystemID);
pci_read_config_word(pcid, PCI_SUBSYSTEM_VENDOR_ID, &pDevice->SubVendorID);
pci_read_config_word(pcid, PCI_COMMAND, (u16 *) & (pci_cmd));
pci_read_config_word(pcid, PCI_COMMAND, (u16 *)&(pci_cmd));
pci_set_master(pcid);
pDevice->memaddr = pci_resource_start(pcid,0);
pDevice->ioaddr = pci_resource_start(pcid,1);
pDevice->memaddr = pci_resource_start(pcid, 0);
pDevice->ioaddr = pci_resource_start(pcid, 1);
#ifdef DEBUG
// pDevice->ioaddr = pci_resource_start(pcid, 0);
// pDevice->memaddr = pci_resource_start(pcid,1);
#endif
cis_addr = pci_resource_start(pcid,2);
cis_addr = pci_resource_start(pcid, 2);
pDevice->pcid = pcid;
......@@ -1170,21 +1170,21 @@ static bool device_get_pci_info(PSDevice pDevice, struct pci_dev* pcid) {
//pci_read_config_word(pcid,PCI_MAX_LAT,&max_lat);
//printk("max lat is %x\n",max_lat);
for (ii=0;ii<0xFF;ii++)
for (ii = 0; ii < 0xFF; ii++)
{
pci_read_config_byte(pcid,ii,&value);
pci_read_config_byte(pcid, ii, &value);
pci_config[ii] = value;
}
for (ii=0,j=1;ii<0x100;ii++,j++)
for (ii = 0, j = 1; ii < 0x100; ii++, j++)
{
if (j %16 == 0)
if (j % 16 == 0)
{
printk("%x:",pci_config[ii]);
printk("%x:", pci_config[ii]);
printk("\n");
}
else
{
printk("%x:",pci_config[ii]);
printk("%x:", pci_config[ii]);
}
}
#endif
......@@ -1193,28 +1193,28 @@ static bool device_get_pci_info(PSDevice pDevice, struct pci_dev* pcid) {
static void device_free_info(PSDevice pDevice) {
PSDevice ptr;
struct net_device* dev=pDevice->dev;
struct net_device *dev = pDevice->dev;
ASSERT(pDevice);
//2008-0714-01<Add>by chester
device_release_WPADEV(pDevice);
device_release_WPADEV(pDevice);
//2008-07-21-01<Add>by MikeLiu
//unregister wpadev
if(wpa_set_wpadev(pDevice, 0)!=0)
if (wpa_set_wpadev(pDevice, 0) != 0)
printk("unregister wpadev fail?\n");
if (pDevice_Infos==NULL)
if (pDevice_Infos == NULL)
return;
for (ptr=pDevice_Infos;ptr && (ptr!=pDevice);ptr=ptr->next)
for (ptr = pDevice_Infos; ptr && (ptr != pDevice); ptr = ptr->next)
do {} while (0);
if (ptr==pDevice) {
if (ptr==pDevice_Infos)
pDevice_Infos=ptr->next;
if (ptr == pDevice) {
if (ptr == pDevice_Infos)
pDevice_Infos = ptr->next;
else
ptr->prev->next=ptr->next;
ptr->prev->next = ptr->next;
}
else {
DBG_PRT(MSG_LEVEL_ERR, KERN_ERR "info struct not found\n");
......@@ -1236,12 +1236,12 @@ device_release_WPADEV(pDevice);
free_netdev(dev);
if (pDevice->pcid) {
pci_set_drvdata(pDevice->pcid,NULL);
pci_set_drvdata(pDevice->pcid, NULL);
}
}
static bool device_init_rings(PSDevice pDevice) {
void* vir_pool;
void *vir_pool;
/*allocate all RD/TD rings a single pool*/
......@@ -1253,7 +1253,7 @@ static bool device_init_rings(PSDevice pDevice) {
&pDevice->pool_dma);
if (vir_pool == NULL) {
DBG_PRT(MSG_LEVEL_ERR,KERN_ERR "%s : allocate desc dma memory failed\n", pDevice->dev->name);
DBG_PRT(MSG_LEVEL_ERR, KERN_ERR "%s : allocate desc dma memory failed\n", pDevice->dev->name);
return false;
}
......@@ -1281,7 +1281,7 @@ static bool device_init_rings(PSDevice pDevice) {
&pDevice->tx_bufs_dma0);
if (pDevice->tx0_bufs == NULL) {
DBG_PRT(MSG_LEVEL_ERR,KERN_ERR "%s: allocate buf dma memory failed\n", pDevice->dev->name);
DBG_PRT(MSG_LEVEL_ERR, KERN_ERR "%s: allocate buf dma memory failed\n", pDevice->dev->name);
pci_free_consistent(pDevice->pcid,
pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) +
pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) +
......@@ -1370,7 +1370,7 @@ static void device_init_rd0_ring(PSDevice pDevice) {
pDesc->pRDInfo = alloc_rd_info();
ASSERT(pDesc->pRDInfo);
if (!device_alloc_rx_buf(pDevice, pDesc)) {
DBG_PRT(MSG_LEVEL_ERR,KERN_ERR "%s: can not alloc rx bufs\n",
DBG_PRT(MSG_LEVEL_ERR, KERN_ERR "%s: can not alloc rx bufs\n",
pDevice->dev->name);
}
pDesc->next = &(pDevice->aRD0Ring[(i+1) % pDevice->sOpts.nRxDescs0]);
......@@ -1395,7 +1395,7 @@ static void device_init_rd1_ring(PSDevice pDevice) {
pDesc->pRDInfo = alloc_rd_info();
ASSERT(pDesc->pRDInfo);
if (!device_alloc_rx_buf(pDevice, pDesc)) {
DBG_PRT(MSG_LEVEL_ERR,KERN_ERR "%s: can not alloc rx bufs\n",
DBG_PRT(MSG_LEVEL_ERR, KERN_ERR "%s: can not alloc rx bufs\n",
pDevice->dev->name);
}
pDesc->next = &(pDevice->aRD1Ring[(i+1) % pDevice->sOpts.nRxDescs1]);
......@@ -1417,7 +1417,7 @@ static void device_init_defrag_cb(PSDevice pDevice) {
for (i = 0; i < CB_MAX_RX_FRAG; i++) {
pDeF = &(pDevice->sRxDFCB[i]);
if (!device_alloc_frag_buf(pDevice, pDeF)) {
DBG_PRT(MSG_LEVEL_ERR,KERN_ERR "%s: can not alloc frag bufs\n",
DBG_PRT(MSG_LEVEL_ERR, KERN_ERR "%s: can not alloc frag bufs\n",
pDevice->dev->name);
}
}
......@@ -1432,10 +1432,10 @@ static void device_free_rd0_ring(PSDevice pDevice) {
int i;
for (i = 0; i < pDevice->sOpts.nRxDescs0; i++) {
PSRxDesc pDesc =&(pDevice->aRD0Ring[i]);
PDEVICE_RD_INFO pRDInfo =pDesc->pRDInfo;
PSRxDesc pDesc = &(pDevice->aRD0Ring[i]);
PDEVICE_RD_INFO pRDInfo = pDesc->pRDInfo;
pci_unmap_single(pDevice->pcid,pRDInfo->skb_dma,
pci_unmap_single(pDevice->pcid, pRDInfo->skb_dma,
pDevice->rx_buf_sz, PCI_DMA_FROMDEVICE);
dev_kfree_skb(pRDInfo->skb);
......@@ -1450,10 +1450,10 @@ static void device_free_rd1_ring(PSDevice pDevice) {
for (i = 0; i < pDevice->sOpts.nRxDescs1; i++) {
PSRxDesc pDesc=&(pDevice->aRD1Ring[i]);
PDEVICE_RD_INFO pRDInfo=pDesc->pRDInfo;
PSRxDesc pDesc = &(pDevice->aRD1Ring[i]);
PDEVICE_RD_INFO pRDInfo = pDesc->pRDInfo;
pci_unmap_single(pDevice->pcid,pRDInfo->skb_dma,
pci_unmap_single(pDevice->pcid, pRDInfo->skb_dma,
pDevice->rx_buf_sz, PCI_DMA_FROMDEVICE);
dev_kfree_skb(pRDInfo->skb);
......@@ -1492,14 +1492,14 @@ static void device_init_td0_ring(PSDevice pDevice) {
pDesc->pTDInfo->buf = pDevice->tx0_bufs + (i)*PKT_BUF_SZ;
pDesc->pTDInfo->buf_dma = pDevice->tx_bufs_dma0 + (i)*PKT_BUF_SZ;
}
pDesc->next =&(pDevice->apTD0Rings[(i+1) % pDevice->sOpts.nTxDescs[0]]);
pDesc->next = &(pDevice->apTD0Rings[(i+1) % pDevice->sOpts.nTxDescs[0]]);
pDesc->pTDInfo->curr_desc = cpu_to_le32(curr);
pDesc->next_desc = cpu_to_le32(curr+sizeof(STxDesc));
}
if (i > 0)
pDevice->apTD0Rings[i-1].next_desc = cpu_to_le32(pDevice->td0_pool_dma);
pDevice->apTailTD[0] = pDevice->apCurrTD[0] =&(pDevice->apTD0Rings[0]);
pDevice->apTailTD[0] = pDevice->apCurrTD[0] = &(pDevice->apTD0Rings[0]);
}
......@@ -1509,16 +1509,16 @@ static void device_init_td1_ring(PSDevice pDevice) {
PSTxDesc pDesc;
/* Init the TD ring entries */
curr=pDevice->td1_pool_dma;
for (i = 0; i < pDevice->sOpts.nTxDescs[1]; i++, curr+=sizeof(STxDesc)) {
pDesc=&(pDevice->apTD1Rings[i]);
curr = pDevice->td1_pool_dma;
for (i = 0; i < pDevice->sOpts.nTxDescs[1]; i++, curr += sizeof(STxDesc)) {
pDesc = &(pDevice->apTD1Rings[i]);
pDesc->pTDInfo = alloc_td_info();
ASSERT(pDesc->pTDInfo);
if (pDevice->flags & DEVICE_FLAGS_TX_ALIGN) {
pDesc->pTDInfo->buf=pDevice->tx1_bufs+(i)*PKT_BUF_SZ;
pDesc->pTDInfo->buf_dma=pDevice->tx_bufs_dma1+(i)*PKT_BUF_SZ;
pDesc->pTDInfo->buf = pDevice->tx1_bufs + (i) * PKT_BUF_SZ;
pDesc->pTDInfo->buf_dma = pDevice->tx_bufs_dma1 + (i) * PKT_BUF_SZ;
}
pDesc->next=&(pDevice->apTD1Rings[(i+1) % pDevice->sOpts.nTxDescs[1]]);
pDesc->next = &(pDevice->apTD1Rings[(i + 1) % pDevice->sOpts.nTxDescs[1]]);
pDesc->pTDInfo->curr_desc = cpu_to_le32(curr);
pDesc->next_desc = cpu_to_le32(curr+sizeof(STxDesc));
}
......@@ -1533,11 +1533,11 @@ static void device_init_td1_ring(PSDevice pDevice) {
static void device_free_td0_ring(PSDevice pDevice) {
int i;
for (i = 0; i < pDevice->sOpts.nTxDescs[0]; i++) {
PSTxDesc pDesc=&(pDevice->apTD0Rings[i]);
PDEVICE_TD_INFO pTDInfo=pDesc->pTDInfo;
PSTxDesc pDesc = &(pDevice->apTD0Rings[i]);
PDEVICE_TD_INFO pTDInfo = pDesc->pTDInfo;
if (pTDInfo->skb_dma && (pTDInfo->skb_dma != pTDInfo->buf_dma))
pci_unmap_single(pDevice->pcid,pTDInfo->skb_dma,
pci_unmap_single(pDevice->pcid, pTDInfo->skb_dma,
pTDInfo->skb->len, PCI_DMA_TODEVICE);
if (pTDInfo->skb)
......@@ -1551,8 +1551,8 @@ static void device_free_td1_ring(PSDevice pDevice) {
int i;
for (i = 0; i < pDevice->sOpts.nTxDescs[1]; i++) {
PSTxDesc pDesc=&(pDevice->apTD1Rings[i]);
PDEVICE_TD_INFO pTDInfo=pDesc->pTDInfo;
PSTxDesc pDesc = &(pDevice->apTD1Rings[i]);
PDEVICE_TD_INFO pTDInfo = pDesc->pTDInfo;
if (pTDInfo->skb_dma && (pTDInfo->skb_dma != pTDInfo->buf_dma))
pci_unmap_single(pDevice->pcid, pTDInfo->skb_dma,
......@@ -1579,10 +1579,10 @@ static int device_rx_srv(PSDevice pDevice, unsigned int uIdx) {
pRD->m_rd0RD0.f1Owner == OWNED_BY_HOST;
pRD = pRD->next) {
// DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pDevice->pCurrRD = %x, works = %d\n", pRD, works);
if (works++>15)
if (works++ > 15)
break;
if (device_receive_frame(pDevice, pRD)) {
if (!device_alloc_rx_buf(pDevice,pRD)) {
if (!device_alloc_rx_buf(pDevice, pRD)) {
DBG_PRT(MSG_LEVEL_ERR, KERN_ERR
"%s: can not allocate rx buf\n", pDevice->dev->name);
break;
......@@ -1592,7 +1592,7 @@ static int device_rx_srv(PSDevice pDevice, unsigned int uIdx) {
pDevice->dev->last_rx = jiffies;
}
pDevice->pCurrRD[uIdx]=pRD;
pDevice->pCurrRD[uIdx] = pRD;
return works;
}
......@@ -1600,20 +1600,20 @@ static int device_rx_srv(PSDevice pDevice, unsigned int uIdx) {
static bool device_alloc_rx_buf(PSDevice pDevice, PSRxDesc pRD) {
PDEVICE_RD_INFO pRDInfo=pRD->pRDInfo;
PDEVICE_RD_INFO pRDInfo = pRD->pRDInfo;
pRDInfo->skb = dev_alloc_skb((int)pDevice->rx_buf_sz);
#ifdef PLICE_DEBUG
//printk("device_alloc_rx_buf:skb is %x\n",pRDInfo->skb);
#endif
if (pRDInfo->skb==NULL)
if (pRDInfo->skb == NULL)
return false;
ASSERT(pRDInfo->skb);
pRDInfo->skb->dev = pDevice->dev;
pRDInfo->skb_dma = pci_map_single(pDevice->pcid, skb_tail_pointer(pRDInfo->skb),
pDevice->rx_buf_sz, PCI_DMA_FROMDEVICE);
*((unsigned int *) &(pRD->m_rd0RD0)) = 0; /* FIX cast */
*((unsigned int *)&(pRD->m_rd0RD0)) = 0; /* FIX cast */
pRD->m_rd0RD0.wResCount = cpu_to_le16(pDevice->rx_buf_sz);
pRD->m_rd0RD0.f1Owner = OWNED_BY_NIC;
......@@ -1640,23 +1640,23 @@ bool device_alloc_frag_buf(PSDevice pDevice, PSDeFragControlBlock pDeF) {
static int device_tx_srv(PSDevice pDevice, unsigned int uIdx) {
PSTxDesc pTD;
bool bFull=false;
bool bFull = false;
int works = 0;
unsigned char byTsr0;
unsigned char byTsr1;
unsigned int uFrameSize, uFIFOHeaderSize;
PSTxBufHead pTxBufHead;
struct net_device_stats* pStats = &pDevice->stats;
struct sk_buff* skb;
struct net_device_stats *pStats = &pDevice->stats;
struct sk_buff *skb;
unsigned int uNodeIndex;
PSMgmtObject pMgmt = pDevice->pMgmt;
for (pTD = pDevice->apTailTD[uIdx]; pDevice->iTDUsed[uIdx] >0; pTD = pTD->next) {
for (pTD = pDevice->apTailTD[uIdx]; pDevice->iTDUsed[uIdx] > 0; pTD = pTD->next) {
if (pTD->m_td0TD0.f1Owner == OWNED_BY_NIC)
break;
if (works++>15)
if (works++ > 15)
break;
byTsr0 = pTD->m_td0TD0.byTSR0;
......@@ -1684,19 +1684,19 @@ static int device_tx_srv(PSDevice pDevice, unsigned int uIdx) {
uFIFOHeaderSize
);
if ( !(byTsr1 & TSR1_TERR)) {
if (!(byTsr1 & TSR1_TERR)) {
if (byTsr0 != 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Tx[%d] OK but has error. tsr1[%02X] tsr0[%02X].\n",
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " Tx[%d] OK but has error. tsr1[%02X] tsr0[%02X].\n",
(int)uIdx, byTsr1, byTsr0);
}
if ((pTxBufHead->wFragCtl & FRAGCTL_ENDFRAG) != FRAGCTL_NONFRAG) {
pDevice->s802_11Counter.TransmittedFragmentCount ++;
pDevice->s802_11Counter.TransmittedFragmentCount++;
}
pStats->tx_packets++;
pStats->tx_bytes += pTD->pTDInfo->skb->len;
}
else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Tx[%d] dropped & tsr1[%02X] tsr0[%02X].\n",
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " Tx[%d] dropped & tsr1[%02X] tsr0[%02X].\n",
(int)uIdx, byTsr1, byTsr0);
pStats->tx_errors++;
pStats->tx_dropped++;
......@@ -1718,11 +1718,11 @@ static int device_tx_srv(PSDevice pDevice, unsigned int uIdx) {
if (byTsr1 & TSR1_TERR) {
if ((pTD->pTDInfo->byFlags & TD_FLAGS_PRIV_SKB) != 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Tx[%d] fail has error. tsr1[%02X] tsr0[%02X].\n",
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " Tx[%d] fail has error. tsr1[%02X] tsr0[%02X].\n",
(int)uIdx, byTsr1, byTsr0);
}
// DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Tx[%d] fail has error. tsr1[%02X] tsr0[%02X].\n",
// DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " Tx[%d] fail has error. tsr1[%02X] tsr0[%02X].\n",
// (int)uIdx, byTsr1, byTsr0);
if ((pMgmt->eCurrMode == WMAC_MODE_ESS_AP) &&
......@@ -1740,14 +1740,14 @@ static int device_tx_srv(PSDevice pDevice, unsigned int uIdx) {
pMgmt->abyPSTxMap[wAID >> 3] |= byMask[wAID & 7];
pTD->pTDInfo->byFlags &= ~(TD_FLAGS_NETIF_SKB);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "tx_srv:tx fail re-queue sta index= %d, QueCnt= %d\n"
,(int)uNodeIndex, pMgmt->sNodeDBTable[uNodeIndex].wEnQueueCnt);
, (int)uNodeIndex, pMgmt->sNodeDBTable[uNodeIndex].wEnQueueCnt);
pStats->tx_errors--;
pStats->tx_dropped--;
}
}
}
}
device_free_tx_buf(pDevice,pTD);
device_free_tx_buf(pDevice, pTD);
pDevice->iTDUsed[uIdx]--;
}
}
......@@ -1760,7 +1760,7 @@ static int device_tx_srv(PSDevice pDevice, unsigned int uIdx) {
bFull = true;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " AC0DMA is Full = %d\n", pDevice->iTDUsed[uIdx]);
}
if (netif_queue_stopped(pDevice->dev) && (bFull==false)){
if (netif_queue_stopped(pDevice->dev) && (bFull == false)) {
netif_wake_queue(pDevice->dev);
}
}
......@@ -1789,12 +1789,12 @@ static void device_error(PSDevice pDevice, unsigned short status) {
}
static void device_free_tx_buf(PSDevice pDevice, PSTxDesc pDesc) {
PDEVICE_TD_INFO pTDInfo=pDesc->pTDInfo;
struct sk_buff* skb=pTDInfo->skb;
PDEVICE_TD_INFO pTDInfo = pDesc->pTDInfo;
struct sk_buff *skb = pTDInfo->skb;
// pre-allocated buf_dma can't be unmapped.
if (pTDInfo->skb_dma && (pTDInfo->skb_dma != pTDInfo->buf_dma)) {
pci_unmap_single(pDevice->pcid,pTDInfo->skb_dma,skb->len,
pci_unmap_single(pDevice->pcid, pTDInfo->skb_dma, skb->len,
PCI_DMA_TODEVICE);
}
......@@ -1822,11 +1822,11 @@ void InitRxManagementQueue(PSDevice pDevice)
//PLICE_DEBUG ->
int MlmeThread(
void * Context)
void *Context)
{
PSDevice pDevice = (PSDevice) Context;
PSRxMgmtPacket pRxMgmtPacket;
// int i ;
// int i;
//complete(&pDevice->notify);
//printk("Enter MngWorkItem,Queue packet num is %d\n",pDevice->rxManeQueue.packet_num);
......@@ -1841,7 +1841,7 @@ int MlmeThread(
// pRxMgmtPacket = DeQueue(pDevice);
#if 1
spin_lock_irq(&pDevice->lock);
while(pDevice->rxManeQueue.packet_num != 0)
while (pDevice->rxManeQueue.packet_num != 0)
{
pRxMgmtPacket = DeQueue(pDevice);
//pDevice;
......@@ -1871,7 +1871,7 @@ int MlmeThread(
static int device_open(struct net_device *dev) {
PSDevice pDevice=(PSDevice) netdev_priv(dev);
PSDevice pDevice = (PSDevice)netdev_priv(dev);
int i;
#ifdef WPA_SM_Transtatus
extern SWPAResult wpa_Result;
......@@ -1882,20 +1882,20 @@ static int device_open(struct net_device *dev) {
return -ENOMEM;
}
//2008-5-13 <add> by chester
i=request_irq(pDevice->pcid->irq, &device_intr, IRQF_SHARED, dev->name, dev);
i = request_irq(pDevice->pcid->irq, &device_intr, IRQF_SHARED, dev->name, dev);
if (i)
return i;
//printk("DEBUG1\n");
#ifdef WPA_SM_Transtatus
memset(wpa_Result.ifname,0,sizeof(wpa_Result.ifname));
memset(wpa_Result.ifname, 0, sizeof(wpa_Result.ifname));
wpa_Result.proto = 0;
wpa_Result.key_mgmt = 0;
wpa_Result.eap_type = 0;
wpa_Result.authenticated = false;
pDevice->fWPA_Authened = false;
#endif
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "call device init rd0 ring\n");
device_init_rd0_ring(pDevice);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "call device init rd0 ring\n");
device_init_rd0_ring(pDevice);
device_init_rd1_ring(pDevice);
device_init_defrag_cb(pDevice);
device_init_td0_ring(pDevice);
......@@ -1911,12 +1911,12 @@ device_init_rd0_ring(pDevice);
//PLICE_DEBUG->
#ifdef TASK_LET
tasklet_init (&pDevice->RxMngWorkItem,(void *)MngWorkItem,(unsigned long )pDevice);
tasklet_init(&pDevice->RxMngWorkItem, (void *)MngWorkItem, (unsigned long)pDevice);
#endif
#ifdef THREAD
InitRxManagementQueue(pDevice);
mlme_kill = 0;
mlme_task = kthread_run(MlmeThread,(void *) pDevice, "MLME");
mlme_task = kthread_run(MlmeThread, (void *)pDevice, "MLME");
if (IS_ERR(mlme_task)) {
printk("thread create fail\n");
return -1;
......@@ -1934,9 +1934,9 @@ device_init_rd0_ring(pDevice);
// if (( SROMbyReadEmbedded(pDevice->PortOffset, EEP_OFS_RADIOCTL)&0x06)==0x04)
// if ((SROMbyReadEmbedded(pDevice->PortOffset, EEP_OFS_RADIOCTL)&0x06)==0x04)
// return -ENOMEM;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "call device_init_registers\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "call device_init_registers\n");
device_init_registers(pDevice, DEVICE_INIT_COLD);
MACvReadEtherAddress(pDevice->PortOffset, pDevice->abyCurrentNetAddr);
memcpy(pDevice->pMgmt->abyMACAddr, pDevice->abyCurrentNetAddr, ETH_ALEN);
......@@ -1946,14 +1946,14 @@ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "call device_init_registers\n");
KeyvInitTable(&pDevice->sKey, pDevice->PortOffset);
add_timer(&(pDevice->pMgmt->sTimerSecondCallback));
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
/*
pDevice->bwextstep0 = false;
pDevice->bwextstep1 = false;
pDevice->bwextstep2 = false;
pDevice->bwextstep3 = false;
*/
pDevice->bwextcount=0;
pDevice->bwextcount = 0;
pDevice->bWPASuppWextEnabled = false;
#endif
pDevice->byReAssocCount = 0;
......@@ -1975,7 +1975,7 @@ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "call device_init_registers\n");
//printk("DEBUG2\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "call MACvIntEnable\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "call MACvIntEnable\n");
MACvIntEnable(pDevice->PortOffset, IMR_MASK_VALUE);
if (pDevice->pMgmt->eConfigMode == WMAC_CONFIG_AP) {
......@@ -1985,7 +1985,7 @@ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "call MACvIntEnable\n");
bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, NULL);
bScheduleCommand((void *)pDevice, WLAN_CMD_SSID, NULL);
}
pDevice->flags |=DEVICE_FLAGS_OPENED;
pDevice->flags |= DEVICE_FLAGS_OPENED;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_open success.. \n");
return 0;
......@@ -1993,7 +1993,7 @@ DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "call MACvIntEnable\n");
static int device_close(struct net_device *dev) {
PSDevice pDevice=(PSDevice) netdev_priv(dev);
PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = pDevice->pMgmt;
//PLICE_DEBUG->
#ifdef THREAD
......@@ -2036,9 +2036,9 @@ static int device_close(struct net_device *dev) {
device_free_rings(pDevice);
BSSvClearNodeDBTable(pDevice, 0);
free_irq(dev->irq, dev);
pDevice->flags &=(~DEVICE_FLAGS_OPENED);
pDevice->flags &= (~DEVICE_FLAGS_OPENED);
//2008-0714-01<Add>by chester
device_release_WPADEV(pDevice);
device_release_WPADEV(pDevice);
//PLICE_DEBUG->
//tasklet_kill(&pDevice->RxMngWorkItem);
//PLICE_DEBUG<-
......@@ -2049,7 +2049,7 @@ device_release_WPADEV(pDevice);
static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev) {
PSDevice pDevice=netdev_priv(dev);
PSDevice pDevice = netdev_priv(dev);
unsigned char *pbMPDU;
unsigned int cbMPDULen = 0;
......@@ -2129,7 +2129,7 @@ bool device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, unsigned int uNodeI
}
uMACfragNum = cbGetFragCount(pDevice, pTransmitKey, cbFrameBodySize, &pDevice->sTxEthHeader);
if ( uMACfragNum > AVAIL_TD(pDevice, TYPE_TXDMA0)) {
if (uMACfragNum > AVAIL_TD(pDevice, TYPE_TXDMA0)) {
dev_kfree_skb_irq(skb);
return false;
}
......@@ -2210,7 +2210,7 @@ bool device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, unsigned int uNodeI
for (ii = 0; ii < uMACfragNum; ii++) {
// Poll Transmit the adapter
wmb();
pHeadTD->m_td0TD0.f1Owner=OWNED_BY_NIC;
pHeadTD->m_td0TD0.f1Owner = OWNED_BY_NIC;
wmb();
if (ii == (uMACfragNum - 1))
pLastTD = pHeadTD;
......@@ -2233,7 +2233,7 @@ bool device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, unsigned int uNodeI
//TYPE_AC0DMA data tx
static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
PSDevice pDevice=netdev_priv(dev);
PSDevice pDevice = netdev_priv(dev);
PSMgmtObject pMgmt = pDevice->pMgmt;
PSTxDesc pHeadTD, pLastTD;
......@@ -2286,7 +2286,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
spin_unlock_irq(&pDevice->lock);
return 0;
}
}else {
} else {
if (BSSDBbIsSTAInNodeDB(pMgmt, (unsigned char *)(skb->data), &uNodeIndex)) {
if (pMgmt->sNodeDBTable[uNodeIndex].bPSEnable) {
skb_queue_tail(&pMgmt->sNodeDBTable[uNodeIndex].sTxPSQueue, skb);
......@@ -2303,7 +2303,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
if (pMgmt->sNodeDBTable[uNodeIndex].bShortPreamble) {
pDevice->byPreambleType = pDevice->byShortPreamble;
}else {
} else {
pDevice->byPreambleType = PREAMBLE_LONG;
}
bNodeExist = true;
......@@ -2312,7 +2312,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
}
if (bNodeExist == false) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"Unknown STA not found in node DB \n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG "Unknown STA not found in node DB \n");
dev_kfree_skb_irq(skb);
spin_unlock_irq(&pDevice->lock);
return 0;
......@@ -2342,45 +2342,45 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
// get pairwise key
if (KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, PAIRWISE_KEY, &pTransmitKey) == false) {
// get group key
if(KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, GROUP_KEY, &pTransmitKey) == true) {
if (KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, GROUP_KEY, &pTransmitKey) == true) {
bTKIP_UseGTK = true;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"Get GTK.\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG "Get GTK.\n");
break;
}
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"Get PTK.\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG "Get PTK.\n");
break;
}
}else if (pDevice->pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) {
} else if (pDevice->pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) {
pbyBSSID = pDevice->sTxEthHeader.abyDstAddr; //TO_DS = 0 and FROM_DS = 0 --> 802.11 MAC Address1
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"IBSS Serach Key: \n");
for (ii = 0; ii< 6; ii++)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"%x \n", *(pbyBSSID+ii));
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG "IBSS Serach Key: \n");
for (ii = 0; ii < 6; ii++)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG "%x \n", *(pbyBSSID+ii));
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG "\n");
// get pairwise key
if(KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, PAIRWISE_KEY, &pTransmitKey) == true)
if (KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, PAIRWISE_KEY, &pTransmitKey) == true)
break;
}
// get group key
pbyBSSID = pDevice->abyBroadcastAddr;
if(KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, GROUP_KEY, &pTransmitKey) == false) {
if (KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, GROUP_KEY, &pTransmitKey) == false) {
pTransmitKey = NULL;
if (pDevice->pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"IBSS and KEY is NULL. [%d]\n", pDevice->pMgmt->eCurrMode);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG "IBSS and KEY is NULL. [%d]\n", pDevice->pMgmt->eCurrMode);
}
else
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"NOT IBSS and KEY is NULL. [%d]\n", pDevice->pMgmt->eCurrMode);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG "NOT IBSS and KEY is NULL. [%d]\n", pDevice->pMgmt->eCurrMode);
} else {
bTKIP_UseGTK = true;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"Get GTK.\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG "Get GTK.\n");
}
} while(false);
} while (false);
}
if (pDevice->bEnableHostWEP) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"acdma0: STA index %d\n", uNodeIndex);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG "acdma0: STA index %d\n", uNodeIndex);
if (pDevice->bEncryptionEnable == true) {
pTransmitKey = &STempKey;
pTransmitKey->byCipherSuite = pMgmt->sNodeDBTable[uNodeIndex].byCipherSuite;
......@@ -2415,7 +2415,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
if (pDevice->bFixRate) {
#ifdef PLICE_DEBUG
printk("Fix Rate: PhyType is %d,ConnectionRate is %d\n",pDevice->eCurrentPHYType,pDevice->uConnectionRate);
printk("Fix Rate: PhyType is %d,ConnectionRate is %d\n", pDevice->eCurrentPHYType, pDevice->uConnectionRate);
#endif
if (pDevice->eCurrentPHYType == PHY_TYPE_11B) {
......@@ -2456,7 +2456,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
}
}
else {
VNTWIFIvGetTxRate( pDevice->pMgmt,
VNTWIFIvGetTxRate(pDevice->pMgmt,
pDevice->sTxEthHeader.abyDstAddr,
&(pDevice->wCurrentRate),
&(pDevice->byACKRate),
......@@ -2486,20 +2486,20 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
//#endif
if (bNeedEncryption == true) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ntohs Pkt Type=%04x\n", ntohs(pDevice->sTxEthHeader.wType));
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ntohs Pkt Type=%04x\n", ntohs(pDevice->sTxEthHeader.wType));
if ((pDevice->sTxEthHeader.wType) == TYPE_PKT_802_1x) {
bNeedEncryption = false;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Pkt Type=%04x\n", (pDevice->sTxEthHeader.wType));
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Pkt Type=%04x\n", (pDevice->sTxEthHeader.wType));
if ((pDevice->pMgmt->eCurrMode == WMAC_MODE_ESS_STA) && (pDevice->pMgmt->eCurrState == WMAC_STATE_ASSOC)) {
if (pTransmitKey == NULL) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Don't Find TX KEY\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Don't Find TX KEY\n");
}
else {
if (bTKIP_UseGTK == true) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"error: KEY is GTK!!~~\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "error: KEY is GTK!!~~\n");
}
else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Find PTK [%lX]\n", pTransmitKey->dwKeyIndex);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Find PTK [%lX]\n", pTransmitKey->dwKeyIndex);
bNeedEncryption = true;
}
}
......@@ -2513,14 +2513,14 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
if (pDevice->bEnableHostWEP) {
if ((uNodeIndex != 0) &&
(pMgmt->sNodeDBTable[uNodeIndex].dwKeyIndex & PAIRWISE_KEY)) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Find PTK [%lX]\n", pTransmitKey->dwKeyIndex);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Find PTK [%lX]\n", pTransmitKey->dwKeyIndex);
bNeedEncryption = true;
}
}
}
else {
if (pTransmitKey == NULL) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"return no tx key\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "return no tx key\n");
dev_kfree_skb_irq(skb);
spin_unlock_irq(&pDevice->lock);
return 0;
......@@ -2552,7 +2552,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
for (ii = 0; ii < uMACfragNum; ii++) {
// Poll Transmit the adapter
wmb();
pHeadTD->m_td0TD0.f1Owner=OWNED_BY_NIC;
pHeadTD->m_td0TD0.f1Owner = OWNED_BY_NIC;
wmb();
if (ii == uMACfragNum - 1)
pLastTD = pHeadTD;
......@@ -2565,8 +2565,8 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
pLastTD->pTDInfo->byFlags = 0;
pLastTD->pTDInfo->byFlags |= TD_FLAGS_NETIF_SKB;
#ifdef TxInSleep
pDevice->nTxDataTimeCout=0; //2008-8-21 chester <add> for send null packet
#endif
pDevice->nTxDataTimeCout = 0; //2008-8-21 chester <add> for send null packet
#endif
if (AVAIL_TD(pDevice, TYPE_AC0DMA) <= 1) {
netif_stop_queue(dev);
}
......@@ -2575,7 +2575,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
//#ifdef PLICE_DEBUG
if (pDevice->bFixRate)
{
printk("FixRate:Rate is %d,TxPower is %d\n",pDevice->wCurrentRate,pDevice->byCurPwr);
printk("FixRate:Rate is %d,TxPower is %d\n", pDevice->wCurrentRate, pDevice->byCurPwr);
}
else
{
......@@ -2583,25 +2583,25 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
}
//#endif
{
{
unsigned char Protocol_Version; //802.1x Authentication
unsigned char Packet_Type; //802.1x Authentication
unsigned char Descriptor_type;
unsigned short Key_info;
bool bTxeapol_key = false;
bool bTxeapol_key = false;
Protocol_Version = skb->data[ETH_HLEN];
Packet_Type = skb->data[ETH_HLEN+1];
Descriptor_type = skb->data[ETH_HLEN+1+1+2];
Key_info = (skb->data[ETH_HLEN+1+1+2+1] << 8)|(skb->data[ETH_HLEN+1+1+2+2]);
if (pDevice->sTxEthHeader.wType == TYPE_PKT_802_1x) {
if(((Protocol_Version==1) ||(Protocol_Version==2)) &&
(Packet_Type==3)) { //802.1x OR eapol-key challenge frame transfer
if (((Protocol_Version == 1) || (Protocol_Version == 2)) &&
(Packet_Type == 3)) { //802.1x OR eapol-key challenge frame transfer
bTxeapol_key = true;
if((Descriptor_type==254)||(Descriptor_type==2)) { //WPA or RSN
if(!(Key_info & BIT3) && //group-key challenge
if ((Descriptor_type == 254) || (Descriptor_type == 2)) { //WPA or RSN
if (!(Key_info & BIT3) && //group-key challenge
(Key_info & BIT8) && (Key_info & BIT9)) { //send 2/2 key
pDevice->fWPA_Authened = true;
if(Descriptor_type==254)
if (Descriptor_type == 254)
printk("WPA ");
else
printk("WPA2 ");
......@@ -2610,7 +2610,7 @@ bool bTxeapol_key = false;
}
}
}
}
}
MACvTransmitAC0(pDevice->PortOffset);
// DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "acdma0:pDevice->apCurrTD= %p\n", pHeadTD);
......@@ -2623,16 +2623,16 @@ bool bTxeapol_key = false;
}
static irqreturn_t device_intr(int irq, void *dev_instance) {
struct net_device* dev=dev_instance;
PSDevice pDevice=(PSDevice) netdev_priv(dev);
struct net_device *dev = dev_instance;
PSDevice pDevice = (PSDevice)netdev_priv(dev);
int max_count=0;
unsigned long dwMIBCounter=0;
int max_count = 0;
unsigned long dwMIBCounter = 0;
PSMgmtObject pMgmt = pDevice->pMgmt;
unsigned char byOrgPageSel=0;
unsigned char byOrgPageSel = 0;
int handled = 0;
unsigned char byData = 0;
int ii= 0;
int ii = 0;
// unsigned char byRSSI;
......@@ -2680,7 +2680,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
STAvUpdateIsrStatCounter(&pDevice->scStatistic, pDevice->dwIsr);
MACvWriteISR(pDevice->PortOffset, pDevice->dwIsr);
if (pDevice->dwIsr & ISR_FETALERR){
if (pDevice->dwIsr & ISR_FETALERR) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " ISR_FETALERR \n");
VNSvOutPortB(pDevice->PortOffset + MAC_REG_SOFTPWRCTL, 0);
VNSvOutPortW(pDevice->PortOffset + MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPECTI);
......@@ -2707,7 +2707,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
MACvSelectPage0(pDevice->PortOffset);
pDevice->byBasicMap = 0;
pDevice->byCCAFraction = 0;
for(ii=0;ii<8;ii++) {
for (ii = 0; ii < 8; ii++) {
pDevice->dwRPIs[ii] = 0;
}
} else {
......@@ -2786,7 +2786,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
long ldBm;
RFvRSSITodBm(pDevice, (unsigned char) pDevice->uCurrRSSI, &ldBm);
for (ii=0;ii<BB_VGA_LEVEL;ii++) {
for (ii = 0; ii < BB_VGA_LEVEL; ii++) {
if (ldBm < pDevice->ldBmThreshold[ii]) {
pDevice->byBBVGANew = pDevice->abyBBVGA[ii];
break;
......@@ -2797,11 +2797,11 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
if (pDevice->uBBVGADiffCount == 1) {
// first VGA diff gain
BBvSetVGAGainOffset(pDevice, pDevice->byBBVGANew);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"First RSSI[%d] NewGain[%d] OldGain[%d] Count[%d]\n",
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "First RSSI[%d] NewGain[%d] OldGain[%d] Count[%d]\n",
(int)ldBm, pDevice->byBBVGANew, pDevice->byBBVGACurrent, (int)pDevice->uBBVGADiffCount);
}
if (pDevice->uBBVGADiffCount >= BB_VGA_CHANGE_THRESHOLD) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"RSSI[%d] NewGain[%d] OldGain[%d] Count[%d]\n",
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "RSSI[%d] NewGain[%d] OldGain[%d] Count[%d]\n",
(int)ldBm, pDevice->byBBVGANew, pDevice->byBBVGACurrent, (int)pDevice->uBBVGADiffCount);
BBvSetVGAGainOffset(pDevice, pDevice->byBBVGANew);
}
......@@ -2837,12 +2837,12 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
}
if (pDevice->eOPMode == OP_MODE_AP) {
if(pMgmt->byDTIMCount > 0) {
pMgmt->byDTIMCount --;
if (pMgmt->byDTIMCount > 0) {
pMgmt->byDTIMCount--;
pMgmt->sNodeDBTable[0].bRxPSPoll = false;
}
else {
if(pMgmt->byDTIMCount == 0) {
if (pMgmt->byDTIMCount == 0) {
// check if mutltcast tx bufferring
pMgmt->byDTIMCount = pMgmt->byDTIMPeriod - 1;
pMgmt->sNodeDBTable[0].bRxPSPoll = true;
......@@ -2874,10 +2874,10 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
if (pDevice->dwIsr & ISR_RXDMA1) {
max_count += device_rx_srv(pDevice, TYPE_RXDMA1);
}
if (pDevice->dwIsr & ISR_TXDMA0){
if (pDevice->dwIsr & ISR_TXDMA0) {
max_count += device_tx_srv(pDevice, TYPE_TXDMA0);
}
if (pDevice->dwIsr & ISR_AC0DMA){
if (pDevice->dwIsr & ISR_AC0DMA) {
max_count += device_tx_srv(pDevice, TYPE_AC0DMA);
}
if (pDevice->dwIsr & ISR_SOFTTIMER) {
......@@ -2899,7 +2899,7 @@ static irqreturn_t device_intr(int irq, void *dev_instance) {
MACvReceive0(pDevice->PortOffset);
MACvReceive1(pDevice->PortOffset);
if (max_count>pDevice->sOpts.int_works)
if (max_count > pDevice->sOpts.int_works)
break;
}
......@@ -2919,7 +2919,7 @@ static inline u32 ether_crc(int length, unsigned char *data)
{
int crc = -1;
while(--length >= 0) {
while (--length >= 0) {
unsigned char current_octet = *data++;
int bit;
for (bit = 0; bit < 8; bit++, current_octet >>= 1) {
......@@ -2937,25 +2937,25 @@ static int Config_FileGetParameter(unsigned char *string,
unsigned char buf1[100];
int source_len = strlen(source);
memset(buf1,0,100);
memset(buf1, 0, 100);
strcat(buf1, string);
strcat(buf1, "=");
source+=strlen(buf1);
source += strlen(buf1);
memcpy(dest,source,source_len-strlen(buf1));
memcpy(dest, source, source_len - strlen(buf1));
return true;
}
int Config_FileOperation(PSDevice pDevice,bool fwrite,unsigned char *Parameter) {
int Config_FileOperation(PSDevice pDevice, bool fwrite, unsigned char *Parameter) {
unsigned char *config_path = CONFIG_PATH;
unsigned char *buffer = NULL;
unsigned char tmpbuffer[20];
struct file *filp=NULL;
struct file *filp = NULL;
mm_segment_t old_fs = get_fs();
//int oldfsuid=0,oldfsgid=0;
int result=0;
int result = 0;
set_fs (KERNEL_DS);
set_fs(KERNEL_DS);
/* Can't do this anymore, so we rely on correct filesystem permissions:
//Make sure a caller can read or write power as root
......@@ -2969,57 +2969,57 @@ int Config_FileOperation(PSDevice pDevice,bool fwrite,unsigned char *Parameter)
filp = filp_open(config_path, O_RDWR, 0);
if (IS_ERR(filp)) {
printk("Config_FileOperation:open file fail?\n");
result=-1;
result = -1;
goto error2;
}
if(!(filp->f_op) || !(filp->f_op->read) ||!(filp->f_op->write)) {
printk("file %s cann't readable or writable?\n",config_path);
if (!(filp->f_op) || !(filp->f_op->read) || !(filp->f_op->write)) {
printk("file %s cann't readable or writable?\n", config_path);
result = -1;
goto error1;
}
buffer = kmalloc(1024, GFP_KERNEL);
if(buffer==NULL) {
buffer = kmalloc(1024, GFP_KERNEL);
if (buffer == NULL) {
printk("allocate mem for file fail?\n");
result = -1;
goto error1;
}
}
if(filp->f_op->read(filp, buffer, 1024, &filp->f_pos)<0) {
if (filp->f_op->read(filp, buffer, 1024, &filp->f_pos) < 0) {
printk("read file error?\n");
result = -1;
goto error1;
}
}
if(Config_FileGetParameter("ZONETYPE",tmpbuffer,buffer)!=true) {
if (Config_FileGetParameter("ZONETYPE", tmpbuffer, buffer) != true) {
printk("get parameter error?\n");
result = -1;
goto error1;
}
}
if(memcmp(tmpbuffer,"USA",3)==0) {
result=ZoneType_USA;
}
else if(memcmp(tmpbuffer,"JAPAN",5)==0) {
result=ZoneType_Japan;
}
else if(memcmp(tmpbuffer,"EUROPE",5)==0) {
result=ZoneType_Europe;
}
else {
if (memcmp(tmpbuffer, "USA", 3) == 0) {
result = ZoneType_USA;
}
else if (memcmp(tmpbuffer, "JAPAN", 5) == 0) {
result = ZoneType_Japan;
}
else if (memcmp(tmpbuffer, "EUROPE", 5) == 0) {
result = ZoneType_Europe;
}
else {
result = -1;
printk("Unknown Zonetype[%s]?\n",tmpbuffer);
}
printk("Unknown Zonetype[%s]?\n", tmpbuffer);
}
error1:
kfree(buffer);
if(filp_close(filp,NULL))
if (filp_close(filp, NULL))
printk("Config_FileOperation:close file fail\n");
error2:
set_fs (old_fs);
set_fs(old_fs);
/*
current->cred->fsuid=oldfsuid;
......@@ -3032,7 +3032,7 @@ else {
static void device_set_multi(struct net_device *dev) {
PSDevice pDevice = (PSDevice) netdev_priv(dev);
PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = pDevice->pMgmt;
u32 mc_filter[2];
......@@ -3042,7 +3042,7 @@ static void device_set_multi(struct net_device *dev) {
VNSvInPortB(pDevice->PortOffset + MAC_REG_RCR, &(pDevice->byRxMode));
if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
DBG_PRT(MSG_LEVEL_ERR,KERN_NOTICE "%s: Promiscuous mode enabled.\n", dev->name);
DBG_PRT(MSG_LEVEL_ERR, KERN_NOTICE "%s: Promiscuous mode enabled.\n", dev->name);
/* Unconditionally log net taps. */
pDevice->byRxMode |= (RCR_MULTICAST|RCR_BROADCAST|RCR_UNICAST);
}
......@@ -3075,12 +3075,12 @@ static void device_set_multi(struct net_device *dev) {
}
VNSvOutPortB(pDevice->PortOffset + MAC_REG_RCR, pDevice->byRxMode);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pDevice->byRxMode = %x\n", pDevice->byRxMode );
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pDevice->byRxMode = %x\n", pDevice->byRxMode);
}
static struct net_device_stats *device_get_stats(struct net_device *dev) {
PSDevice pDevice=(PSDevice) netdev_priv(dev);
PSDevice pDevice = (PSDevice)netdev_priv(dev);
return &pDevice->stats;
}
......@@ -3090,8 +3090,8 @@ static struct net_device_stats *device_get_stats(struct net_device *dev) {
static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
PSDevice pDevice = (PSDevice)netdev_priv(dev);
struct iwreq *wrq = (struct iwreq *) rq;
int rc =0;
struct iwreq *wrq = (struct iwreq *)rq;
int rc = 0;
PSMgmtObject pMgmt = pDevice->pMgmt;
PSCmdRequest pReq;
......@@ -3101,7 +3101,7 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
return rc;
}
switch(cmd) {
switch (cmd) {
case SIOCGIWNAME:
rc = iwctl_giwname(dev, NULL, (char *)&(wrq->u.name), NULL);
......@@ -3151,7 +3151,7 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
&(wrq->u.essid), essid);
if (copy_to_user(wrq->u.essid.pointer,
essid,
wrq->u.essid.length) )
wrq->u.essid.length))
rc = -EFAULT;
}
break;
......@@ -3300,7 +3300,7 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
{
struct iw_range range;
rc = iwctl_giwrange(dev, NULL, &(wrq->u.data), (char *) &range);
rc = iwctl_giwrange(dev, NULL, &(wrq->u.data), (char *)&range);
if (copy_to_user(wrq->u.data.pointer, &range, sizeof(struct iw_range)))
rc = -EFAULT;
}
......@@ -3368,10 +3368,10 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWPRIV \n");
rc = -EOPNOTSUPP;
/*
if(wrq->u.data.pointer) {
wrq->u.data.length = sizeof(iwctl_private_args) / sizeof( iwctl_private_args[0]);
if (wrq->u.data.pointer) {
wrq->u.data.length = sizeof(iwctl_private_args) / sizeof(iwctl_private_args[0]);
if(copy_to_user(wrq->u.data.pointer,
if (copy_to_user(wrq->u.data.pointer,
(u_char *) iwctl_private_args,
sizeof(iwctl_private_args)))
rc = -EFAULT;
......@@ -3406,17 +3406,17 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
{
char extra[sizeof(struct iw_encode_ext)+MAX_KEY_LEN+1];
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWENCODEEXT \n");
if(wrq->u.encoding.pointer){
memset(extra, 0, sizeof(struct iw_encode_ext)+MAX_KEY_LEN+1);
if(wrq->u.encoding.length > (sizeof(struct iw_encode_ext)+ MAX_KEY_LEN)){
if (wrq->u.encoding.pointer) {
memset(extra, 0, sizeof(struct iw_encode_ext)+MAX_KEY_LEN + 1);
if (wrq->u.encoding.length > (sizeof(struct iw_encode_ext) + MAX_KEY_LEN)) {
rc = -E2BIG;
break;
}
if(copy_from_user(extra, wrq->u.encoding.pointer,wrq->u.encoding.length)){
if (copy_from_user(extra, wrq->u.encoding.pointer, wrq->u.encoding.length)) {
rc = -EFAULT;
break;
}
}else if(wrq->u.encoding.length != 0){
} else if (wrq->u.encoding.length != 0) {
rc = -EINVAL;
break;
}
......@@ -3451,13 +3451,13 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
case IOCTL_CMD_SET:
#ifdef SndEvt_ToAPI
if((((PSCmdRequest)rq)->wCmdCode !=WLAN_CMD_SET_EVT) &&
#ifdef SndEvt_ToAPI
if ((((PSCmdRequest)rq)->wCmdCode != WLAN_CMD_SET_EVT) &&
!(pDevice->flags & DEVICE_FLAGS_OPENED))
#else
#else
if (!(pDevice->flags & DEVICE_FLAGS_OPENED) &&
(((PSCmdRequest)rq)->wCmdCode !=WLAN_CMD_SET_WPA))
#endif
(((PSCmdRequest)rq)->wCmdCode != WLAN_CMD_SET_WPA))
#endif
{
rc = -EFAULT;
break;
......@@ -3465,11 +3465,11 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
rc = 0;
}
if (test_and_set_bit( 0, (void*)&(pMgmt->uCmdBusy))) {
if (test_and_set_bit(0, (void *)&(pMgmt->uCmdBusy))) {
return -EBUSY;
}
rc = private_ioctl(pDevice, rq);
clear_bit( 0, (void*)&(pMgmt->uCmdBusy));
clear_bit(0, (void *)&(pMgmt->uCmdBusy));
break;
case IOCTL_CMD_HOSTAPD:
......@@ -3484,7 +3484,7 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
break;
case SIOCETHTOOL:
return ethtool_ioctl(dev, (void *) rq->ifr_data);
return ethtool_ioctl(dev, (void *)rq->ifr_data);
// All other calls are currently unsupported
default:
......@@ -3508,12 +3508,12 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
memset(pMgmt->abyCurrBSSID, 0, 6);
pMgmt->eCurrState = WMAC_STATE_IDLE;
netif_stop_queue(pDevice->dev);
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
pMgmt->eScanType = WMAC_SCAN_ACTIVE;
if(pDevice->bWPASuppWextEnabled !=true)
#endif
bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID);
bScheduleCommand((void *) pDevice, WLAN_CMD_SSID, NULL);
if (pDevice->bWPASuppWextEnabled != true)
#endif
bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID);
bScheduleCommand((void *)pDevice, WLAN_CMD_SSID, NULL);
spin_unlock_irq(&pDevice->lock);
}
pDevice->bCommit = false;
......@@ -3569,7 +3569,7 @@ static int __init vt6655_init_module(void)
//ret = pcie_port_service_register(&device_driver);
ret = pci_register_driver(&device_driver);
#ifdef CONFIG_PM
if(ret >= 0)
if (ret >= 0)
register_reboot_notifier(&device_notifier);
#endif
......@@ -3596,12 +3596,12 @@ static int
device_notify_reboot(struct notifier_block *nb, unsigned long event, void *p)
{
struct pci_dev *pdev = NULL;
switch(event) {
switch (event) {
case SYS_DOWN:
case SYS_HALT:
case SYS_POWER_OFF:
for_each_pci_dev(pdev) {
if(pci_dev_driver(pdev) == &device_driver) {
if (pci_dev_driver(pdev) == &device_driver) {
if (pci_get_drvdata(pdev))
viawget_suspend(pdev, PMSG_HIBERNATE);
}
......@@ -3615,7 +3615,7 @@ viawget_suspend(struct pci_dev *pcid, pm_message_t state)
{
int power_status; // to silence the compiler
PSDevice pDevice=pci_get_drvdata(pcid);
PSDevice pDevice = pci_get_drvdata(pcid);
PSMgmtObject pMgmt = pDevice->pMgmt;
netif_stop_queue(pDevice->dev);
......@@ -3641,7 +3641,7 @@ viawget_suspend(struct pci_dev *pcid, pm_message_t state)
static int
viawget_resume(struct pci_dev *pcid)
{
PSDevice pDevice=pci_get_drvdata(pcid);
PSDevice pDevice = pci_get_drvdata(pcid);
PSMgmtObject pMgmt = pDevice->pMgmt;
int power_status; // to silence the compiler
......@@ -3656,7 +3656,7 @@ viawget_resume(struct pci_dev *pcid)
if (pMgmt->sNodeDBTable[0].bActive == true) { // Assoc with BSS
pMgmt->sNodeDBTable[0].bActive = false;
pDevice->bLinkPass = false;
if(pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) {
if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) {
// In Adhoc, BSS state set back to started.
pMgmt->eCurrState = WMAC_STATE_STARTED;
}
......@@ -3669,8 +3669,8 @@ viawget_resume(struct pci_dev *pcid)
init_timer(&pDevice->sTimerCommand);
MACvIntEnable(pDevice->PortOffset, IMR_MASK_VALUE);
BSSvClearBSSList((void *)pDevice, pDevice->bLinkPass);
bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, NULL);
bScheduleCommand((void *) pDevice, WLAN_CMD_SSID, NULL);
bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, NULL);
bScheduleCommand((void *)pDevice, WLAN_CMD_SSID, NULL);
spin_unlock_irq(&pDevice->lock);
}
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment