]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Staging: vt6656: incorporated ETH_ALEN macro instead of custom one
authorAndres More <more.andres@gmail.com>
Wed, 14 Apr 2010 00:54:48 +0000 (21:54 -0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 11 May 2010 18:35:56 +0000 (11:35 -0700)
Replaced custom U_ETHER_ADDR_LEN by ETH_ALEN from <linux/if_ether.h>.
Resolved checkpatch findings on the changed lines, mostly indentation.

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 files changed:
drivers/staging/vt6656/aes_ccmp.c
drivers/staging/vt6656/desc.h
drivers/staging/vt6656/device.h
drivers/staging/vt6656/dpc.c
drivers/staging/vt6656/ioctl.c
drivers/staging/vt6656/key.c
drivers/staging/vt6656/key.h
drivers/staging/vt6656/main_usb.c
drivers/staging/vt6656/mib.c
drivers/staging/vt6656/mib.h
drivers/staging/vt6656/rxtx.c
drivers/staging/vt6656/rxtx.h
drivers/staging/vt6656/tether.c
drivers/staging/vt6656/tether.h
drivers/staging/vt6656/wctl.c
drivers/staging/vt6656/wmgr.c
drivers/staging/vt6656/wpa2.c
drivers/staging/vt6656/wpactl.c

index 401a7d267c907960eb5c01e747376f870cec8c2f..a1beaa93b3333466a0f26e46f6b8ac5490012d40 100644 (file)
@@ -277,7 +277,7 @@ int             ii,jj,kk;
     pbyPayload = pbyIV + 8; //IV-length
 
     abyNonce[0]  = 0x00; //now is 0, if Qos here will be priority
-    memcpy(&(abyNonce[1]), pMACHeader->abyAddr2, U_ETHER_ADDR_LEN);
+    memcpy(&(abyNonce[1]), pMACHeader->abyAddr2, ETH_ALEN);
     abyNonce[7]  = pbyIV[7];
     abyNonce[8]  = pbyIV[6];
     abyNonce[9]  = pbyIV[5];
@@ -299,16 +299,17 @@ int             ii,jj,kk;
     byTmp = (BYTE)(pMACHeader->wFrameCtl >> 8);
     byTmp &= 0x87;
     MIC_HDR1[3] = byTmp | 0x40;
-    memcpy(&(MIC_HDR1[4]), pMACHeader->abyAddr1, U_ETHER_ADDR_LEN);
-    memcpy(&(MIC_HDR1[10]), pMACHeader->abyAddr2, U_ETHER_ADDR_LEN);
+    memcpy(&(MIC_HDR1[4]), pMACHeader->abyAddr1, ETH_ALEN);
+    memcpy(&(MIC_HDR1[10]), pMACHeader->abyAddr2, ETH_ALEN);
 
     //MIC_HDR2
-    memcpy(&(MIC_HDR2[0]), pMACHeader->abyAddr3, U_ETHER_ADDR_LEN);
+    memcpy(&(MIC_HDR2[0]), pMACHeader->abyAddr3, ETH_ALEN);
     byTmp = (BYTE)(pMACHeader->wSeqCtl & 0xff);
     MIC_HDR2[6] = byTmp & 0x0f;
     MIC_HDR2[7] = 0;
+
     if ( bA4 ) {
-        memcpy(&(MIC_HDR2[8]), pMACHeader->abyAddr4, U_ETHER_ADDR_LEN);
+               memcpy(&(MIC_HDR2[8]), pMACHeader->abyAddr4, ETH_ALEN);
     } else {
         MIC_HDR2[8]  = 0x00;
         MIC_HDR2[9]  = 0x00;
index f10530fcc99b3fa4af9c6758dc56de6ecf2460f0..c87ea6b4d86473fe3d7ccf19120f2c612c71dbb5 100644 (file)
@@ -206,8 +206,8 @@ typedef const SRrvTime_atim *PCSRrvTime_atim;
 typedef struct tagSRTSData {
     WORD    wFrameControl;
     WORD    wDurationID;
-    BYTE    abyRA[U_ETHER_ADDR_LEN];
-    BYTE    abyTA[U_ETHER_ADDR_LEN];
+    BYTE    abyRA[ETH_ALEN];
+    BYTE    abyTA[ETH_ALEN];
 }__attribute__ ((__packed__))
 SRTSData, *PSRTSData;
 typedef const SRTSData *PCSRTSData;
@@ -282,7 +282,7 @@ typedef const SRTS_a_FB *PCSRTS_a_FB;
 typedef struct tagSCTSData {
     WORD    wFrameControl;
     WORD    wDurationID;
-    BYTE    abyRA[U_ETHER_ADDR_LEN];
+    BYTE    abyRA[ETH_ALEN];
     WORD    wReserved;
 }__attribute__ ((__packed__))
 SCTSData, *PSCTSData;
index 8b541d1d0e23b15948bdac6944d9b68d45b44975..29bb5977541cab4abce6d31b9771a695fcd833b0 100644 (file)
 #define MAC_MAX_CONTEXT_REG     (256+128)
 
 #define MAX_MULTICAST_ADDRESS_NUM       32
-#define MULTICAST_ADDRESS_LIST_SIZE     (MAX_MULTICAST_ADDRESS_NUM * U_ETHER_ADDR_LEN)
+#define MULTICAST_ADDRESS_LIST_SIZE     (MAX_MULTICAST_ADDRESS_NUM * ETH_ALEN)
 
 
 //#define OP_MODE_INFRASTRUCTURE  0
@@ -369,7 +369,7 @@ typedef struct tagSQuietControl {
 // The receive duplicate detection cache entry
 typedef struct tagSCacheEntry{
     WORD        wFmSequence;
-    BYTE        abyAddr2[U_ETHER_ADDR_LEN];
+    BYTE        abyAddr2[ETH_ALEN];
     WORD        wFrameCtl;
 } SCacheEntry, *PSCacheEntry;
 
@@ -387,7 +387,7 @@ typedef struct tagSDeFragControlBlock
 {
     WORD            wSequence;
     WORD            wFragNum;
-    BYTE            abyAddr2[U_ETHER_ADDR_LEN];
+    BYTE            abyAddr2[ETH_ALEN];
        UINT            uLifetime;
     struct sk_buff* skb;
     PBYTE           pbyRxBuffer;
@@ -547,10 +547,10 @@ typedef struct __device_info {
     BYTE                        byOriginalZonetype;
 
     BOOL                        bLinkPass;          // link status: OK or fail
-    BYTE                        abyCurrentNetAddr[U_ETHER_ADDR_LEN];
-    BYTE                        abyPermanentNetAddr[U_ETHER_ADDR_LEN];
+    BYTE                        abyCurrentNetAddr[ETH_ALEN];
+    BYTE                        abyPermanentNetAddr[ETH_ALEN];
     // SW network address
-//    BYTE                        abySoftwareNetAddr[U_ETHER_ADDR_LEN];
+       /* u8 abySoftwareNetAddr[ETH_ALEN]; */
     BOOL                        bExistSWNetAddr;
 
     // Adapter statistics
@@ -671,8 +671,8 @@ typedef struct __device_info {
     CARD_OP_MODE                eOPMode;
     BOOL                        bBSSIDFilter;
     WORD                        wMaxTransmitMSDULifetime;
-    BYTE                        abyBSSID[U_ETHER_ADDR_LEN];
-    BYTE                        abyDesireBSSID[U_ETHER_ADDR_LEN];
+    BYTE                        abyBSSID[ETH_ALEN];
+    BYTE                        abyDesireBSSID[ETH_ALEN];
     WORD                        wCTSDuration;       // update while speed change
     WORD                        wACKDuration;       // update while speed change
     WORD                        wRTSTransmitLen;    // update while speed change
@@ -826,9 +826,9 @@ typedef struct __device_info {
 
     SEthernetHeader         sTxEthHeader;
     SEthernetHeader         sRxEthHeader;
-    BYTE                    abyBroadcastAddr[U_ETHER_ADDR_LEN];
-    BYTE                    abySNAP_RFC1042[U_ETHER_ADDR_LEN];
-    BYTE                    abySNAP_Bridgetunnel[U_ETHER_ADDR_LEN];
+    BYTE                    abyBroadcastAddr[ETH_ALEN];
+    BYTE                    abySNAP_RFC1042[ETH_ALEN];
+    BYTE                    abySNAP_Bridgetunnel[ETH_ALEN];
 
     // Pre-Authentication & PMK cache
     SPMKID                  gsPMKID;
index 835c6d6967bfcfbab984031acf513d93e8db1fe3..9e833bb08e38fec363756b883073ad126b1e8b0e 100644 (file)
@@ -234,11 +234,11 @@ s_vProcessRxMACHeader (
         }
     }
 
-    cbHeaderSize -= (U_ETHER_ADDR_LEN * 2);
+    cbHeaderSize -= (ETH_ALEN * 2);
     pbyRxBuffer = (PBYTE) (pbyRxBufferAddr + cbHeaderSize);
-    for(ii=0;ii<U_ETHER_ADDR_LEN;ii++)
+    for (ii = 0; ii < ETH_ALEN; ii++)
         *pbyRxBuffer++ = pDevice->sRxEthHeader.abyDstAddr[ii];
-    for(ii=0;ii<U_ETHER_ADDR_LEN;ii++)
+    for (ii = 0; ii < ETH_ALEN; ii++)
         *pbyRxBuffer++ = pDevice->sRxEthHeader.abySrcAddr[ii];
 
     *pcbHeadSize = cbHeaderSize;
@@ -267,43 +267,48 @@ s_vGetDASA (
     OUT PSEthernetHeader psEthHeader
     )
 {
-    UINT            cbHeaderSize = 0;
-    PS802_11Header  pMACHeader;
-    int             ii;
-
-    pMACHeader = (PS802_11Header) (pbyRxBufferAddr + cbHeaderSize);
-
-    if ((pMACHeader->wFrameCtl & FC_TODS) == 0) {
-        if (pMACHeader->wFrameCtl & FC_FROMDS) {
-            for(ii=0;ii<U_ETHER_ADDR_LEN;ii++) {
-                psEthHeader->abyDstAddr[ii] = pMACHeader->abyAddr1[ii];
-                psEthHeader->abySrcAddr[ii] = pMACHeader->abyAddr3[ii];
-            }
-        }
-        else {
-            // IBSS mode
-            for(ii=0;ii<U_ETHER_ADDR_LEN;ii++) {
-                psEthHeader->abyDstAddr[ii] = pMACHeader->abyAddr1[ii];
-                psEthHeader->abySrcAddr[ii] = pMACHeader->abyAddr2[ii];
-            }
-        }
-    }
-    else {
-        // Is AP mode..
-        if (pMACHeader->wFrameCtl & FC_FROMDS) {
-            for(ii=0;ii<U_ETHER_ADDR_LEN;ii++) {
-                psEthHeader->abyDstAddr[ii] = pMACHeader->abyAddr3[ii];
-                psEthHeader->abySrcAddr[ii] = pMACHeader->abyAddr4[ii];
-                cbHeaderSize += 6;
-            }
-        }
-        else {
-            for(ii=0;ii<U_ETHER_ADDR_LEN;ii++) {
-                psEthHeader->abyDstAddr[ii] = pMACHeader->abyAddr3[ii];
-                psEthHeader->abySrcAddr[ii] = pMACHeader->abyAddr2[ii];
-            }
-        }
-    };
+       UINT            cbHeaderSize = 0;
+       PS802_11Header  pMACHeader;
+       int             ii;
+
+       pMACHeader = (PS802_11Header) (pbyRxBufferAddr + cbHeaderSize);
+
+       if ((pMACHeader->wFrameCtl & FC_TODS) == 0) {
+               if (pMACHeader->wFrameCtl & FC_FROMDS) {
+                       for (ii = 0; ii < ETH_ALEN; ii++) {
+                               psEthHeader->abyDstAddr[ii] =
+                                       pMACHeader->abyAddr1[ii];
+                               psEthHeader->abySrcAddr[ii] =
+                                       pMACHeader->abyAddr3[ii];
+                       }
+               } else {
+                       /* IBSS mode */
+                       for (ii = 0; ii < ETH_ALEN; ii++) {
+                               psEthHeader->abyDstAddr[ii] =
+                                       pMACHeader->abyAddr1[ii];
+                               psEthHeader->abySrcAddr[ii] =
+                                       pMACHeader->abyAddr2[ii];
+                       }
+               }
+       } else {
+               /* Is AP mode.. */
+               if (pMACHeader->wFrameCtl & FC_FROMDS) {
+                       for (ii = 0; ii < ETH_ALEN; ii++) {
+                               psEthHeader->abyDstAddr[ii] =
+                                       pMACHeader->abyAddr3[ii];
+                               psEthHeader->abySrcAddr[ii] =
+                                       pMACHeader->abyAddr4[ii];
+                               cbHeaderSize += 6;
+                       }
+               } else {
+                       for (ii = 0; ii < ETH_ALEN; ii++) {
+                               psEthHeader->abyDstAddr[ii] =
+                                       pMACHeader->abyAddr3[ii];
+                               psEthHeader->abySrcAddr[ii] =
+                                       pMACHeader->abyAddr2[ii];
+                       }
+               }
+       };
     *pcbHeaderSize = cbHeaderSize;
 }
 
index 6f33005a615fb31bda7dd221f156b6cc40c3475d..d7a78f2f9f0591b8620727a4749b9c44706d06f3 100644 (file)
@@ -480,7 +480,9 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
                };
                if (sValue.dwValue == 1) {
                      DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "up wpadev\n");
-                  memcpy(pDevice->wpadev->dev_addr, pDevice->dev->dev_addr, U_ETHER_ADDR_LEN);
+                  memcpy(pDevice->wpadev->dev_addr,
+                         pDevice->dev->dev_addr,
+                         ETH_ALEN);
                   pDevice->bWPADEVUp = TRUE;
         }
         else {
index 13fc69a1a0843f1e97dfeff8a73133c0c31d43dd..0cd2751d67d5a6812450a898b626fb99558a1cb7 100644 (file)
@@ -312,7 +312,7 @@ BOOL KeybSetKey (
         }
     }
     if (j < (MAX_KEY_TABLE-1)) {
-        memcpy(pTable->KeyTable[j].abyBSSID,pbyBSSID,U_ETHER_ADDR_LEN);
+       memcpy(pTable->KeyTable[j].abyBSSID, pbyBSSID, ETH_ALEN);
         pTable->KeyTable[j].bInUse = TRUE;
         if ((dwKeyIndex & PAIRWISE_KEY) != 0)  {
             // Pairwise key
@@ -700,7 +700,7 @@ BOOL KeybSetDefaultKey (
     }
 
     pTable->KeyTable[MAX_KEY_TABLE-1].bInUse = TRUE;
-    for(ii=0;ii<U_ETHER_ADDR_LEN;ii++)
+    for (ii = 0; ii < ETH_ALEN; ii++)
         pTable->KeyTable[MAX_KEY_TABLE-1].abyBSSID[ii] = 0xFF;
 
     // Group key
index b15a64cb386879c94a57d85c23c010493cb561c4..da8dfe09cf3c01edc22bffe7cf0ec9226cf146ec 100644 (file)
@@ -71,7 +71,7 @@ typedef struct tagSKeyItem
 
 typedef struct tagSKeyTable
 {
-    BYTE        abyBSSID[U_ETHER_ADDR_LEN];  //6
+    BYTE        abyBSSID[ETH_ALEN];  /* 6 */
     BYTE        byReserved0[2];              //8
     SKeyItem    PairwiseKey;
     SKeyItem    GroupKey[MAX_GROUP_KEY]; //64*5 = 320, 320+8=328
index ea6c94d6a99f038a1643fc91cb224e27ec470462..c0bad4f43ee9661aa509c31ebdb779d8887a08a6 100644 (file)
@@ -295,14 +295,13 @@ static void usb_device_reset(PSDevice pDevice);
 static void
 device_set_options(PSDevice pDevice) {
 
-    BYTE    abyBroadcastAddr[U_ETHER_ADDR_LEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-    BYTE    abySNAP_RFC1042[U_ETHER_ADDR_LEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00};
-    BYTE    abySNAP_Bridgetunnel[U_ETHER_ADDR_LEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0xF8};
+    BYTE    abyBroadcastAddr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+    BYTE    abySNAP_RFC1042[ETH_ALEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00};
+    u8 abySNAP_Bridgetunnel[ETH_ALEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0xF8};
 
-
-    memcpy(pDevice->abyBroadcastAddr, abyBroadcastAddr, U_ETHER_ADDR_LEN);
-    memcpy(pDevice->abySNAP_RFC1042, abySNAP_RFC1042, U_ETHER_ADDR_LEN);
-    memcpy(pDevice->abySNAP_Bridgetunnel, abySNAP_Bridgetunnel, U_ETHER_ADDR_LEN);
+    memcpy(pDevice->abyBroadcastAddr, abyBroadcastAddr, ETH_ALEN);
+    memcpy(pDevice->abySNAP_RFC1042, abySNAP_RFC1042, ETH_ALEN);
+    memcpy(pDevice->abySNAP_Bridgetunnel, abySNAP_Bridgetunnel, ETH_ALEN);
 
     pDevice->cbTD = TX_DESC_DEF0;
     pDevice->cbRD = RX_DESC_DEF0;
@@ -359,9 +358,9 @@ static VOID device_init_diversity_timer(PSDevice pDevice) {
 
 static BOOL device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType)
 {
-    BYTE            abyBroadcastAddr[U_ETHER_ADDR_LEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-    BYTE            abySNAP_RFC1042[U_ETHER_ADDR_LEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00};
-    BYTE            abySNAP_Bridgetunnel[U_ETHER_ADDR_LEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0xF8};
+    u8 abyBroadcastAddr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+    u8 abySNAP_RFC1042[ETH_ALEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00};
+    u8 abySNAP_Bridgetunnel[ETH_ALEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0xF8};
     BYTE            byAntenna;
     UINT            ii;
     CMD_CARD_INIT   sInitCmd;
@@ -375,10 +374,12 @@ static BOOL device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType)
 
     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "---->INIbInitAdapter. [%d][%d]\n", InitType, pDevice->byPacketType);
        spin_lock_irq(&pDevice->lock);
-    if (InitType == DEVICE_INIT_COLD) {
-        memcpy(pDevice->abyBroadcastAddr, abyBroadcastAddr, U_ETHER_ADDR_LEN);
-        memcpy(pDevice->abySNAP_RFC1042, abySNAP_RFC1042, U_ETHER_ADDR_LEN);
-        memcpy(pDevice->abySNAP_Bridgetunnel, abySNAP_Bridgetunnel, U_ETHER_ADDR_LEN);
+       if (InitType == DEVICE_INIT_COLD) {
+               memcpy(pDevice->abyBroadcastAddr, abyBroadcastAddr, ETH_ALEN);
+               memcpy(pDevice->abySNAP_RFC1042, abySNAP_RFC1042, ETH_ALEN);
+               memcpy(pDevice->abySNAP_Bridgetunnel,
+                      abySNAP_Bridgetunnel,
+                      ETH_ALEN);
 
         if ( !FIRMWAREbCheckVersion(pDevice) ) {
             if (FIRMWAREbDownload(pDevice) == TRUE) {
@@ -603,7 +604,9 @@ static BOOL device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType)
 
         // get Permanent network address
         memcpy(pDevice->abyPermanentNetAddr,&(sInitRsp.byNetAddr[0]),6);
-        memcpy(pDevice->abyCurrentNetAddr, pDevice->abyPermanentNetAddr, U_ETHER_ADDR_LEN);
+       memcpy(pDevice->abyCurrentNetAddr,
+              pDevice->abyPermanentNetAddr,
+              ETH_ALEN);
 
         // if exist SW network address, use SW network address.
 
@@ -757,7 +760,7 @@ static const struct net_device_ops device_netdev_ops = {
 static int __devinit
 vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
 {
-   BYTE            fake_mac[U_ETHER_ADDR_LEN] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01};//fake MAC address
+       u8 fake_mac[ETH_ALEN] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01};
        struct usb_device *udev = interface_to_usbdev(intf);
     int         rc = 0;
     struct net_device *netdev = NULL;
@@ -798,7 +801,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
   //2007-0821-01<Add>by MikeLiu
          usb_set_intfdata(intf, pDevice);
        SET_NETDEV_DEV(netdev, &intf->dev);
-    memcpy(pDevice->dev->dev_addr, fake_mac, U_ETHER_ADDR_LEN); //use fake mac address
+    memcpy(pDevice->dev->dev_addr, fake_mac, ETH_ALEN);
     rc = register_netdev(netdev);
     if (rc != 0) {
         printk(KERN_ERR DEVICE_NAME " Failed to register netdev\n");
@@ -1101,8 +1104,8 @@ static int  device_open(struct net_device *dev) {
     // Init for Key Management
 
     KeyvInitTable(pDevice,&pDevice->sKey);
-    memcpy(pDevice->sMgmtObj.abyMACAddr, pDevice->abyCurrentNetAddr, U_ETHER_ADDR_LEN);
-    memcpy(pDevice->dev->dev_addr, pDevice->abyCurrentNetAddr, U_ETHER_ADDR_LEN);
+    memcpy(pDevice->sMgmtObj.abyMACAddr, pDevice->abyCurrentNetAddr, ETH_ALEN);
+    memcpy(pDevice->dev->dev_addr, pDevice->abyCurrentNetAddr, ETH_ALEN);
     pDevice->bStopTx0Pkt = FALSE;
     pDevice->bStopDataPkt = FALSE;
     pDevice->bRoaming = FALSE;  //DavidWang
index 910e610b7cc08a5d4f096c0302a4c80e166d5d67..b6f138efb472cede5ed18348c5638a9f4c69bb52 100644 (file)
@@ -156,18 +156,17 @@ void STAvUpdateRDStatCounter (PSStatCounter pStatistic,
                               BYTE byRSR, BYTE byNewRSR, BYTE byRxSts, BYTE byRxRate,
                               PBYTE pbyBuffer, UINT cbFrameLength)
 {
-    //need change
-    PS802_11Header pHeader = (PS802_11Header)pbyBuffer;
+       /* need change */
+       PS802_11Header pHeader = (PS802_11Header)pbyBuffer;
 
-    if (byRSR & RSR_ADDROK)
-        pStatistic->dwRsrADDROk++;
-    if (byRSR & RSR_CRCOK) {
-        pStatistic->dwRsrCRCOk++;
+       if (byRSR & RSR_ADDROK)
+               pStatistic->dwRsrADDROk++;
+       if (byRSR & RSR_CRCOK) {
+               pStatistic->dwRsrCRCOk++;
+               pStatistic->ullRsrOK++;
 
-        pStatistic->ullRsrOK++;
-
-        if (cbFrameLength >= U_ETHER_ADDR_LEN) {
-            // update counters in case that successful transmit
+               if (cbFrameLength >= ETH_ALEN) {
+                       /* update counters in case of successful transmission */
             if (byRSR & RSR_ADDRBROAD) {
                 pStatistic->ullRxBroadcastFrames++;
                 pStatistic->ullRxBroadcastBytes += (ULONGLONG)cbFrameLength;
index ac996d2cd91134aafeed1a3c5eb25217dab1f50a..d1d781774ca8e52f3083bb9e53731bbfc6aee171 100644 (file)
@@ -91,7 +91,7 @@ typedef struct tagSMib2Counter {
     LONG    ifType;
     LONG    ifMtu;
     DWORD   ifSpeed;
-    BYTE    ifPhysAddress[U_ETHER_ADDR_LEN];
+    BYTE    ifPhysAddress[ETH_ALEN];
     LONG    ifAdminStatus;
     LONG    ifOperStatus;
     DWORD   ifLastChange;
@@ -231,7 +231,7 @@ typedef struct tagSTxPktInfo {
     BYTE    byBroadMultiUni;
     WORD    wLength;
     WORD    wFIFOCtl;
-    BYTE    abyDestAddr[U_ETHER_ADDR_LEN];
+    BYTE    abyDestAddr[ETH_ALEN];
 } STxPktInfo, *PSTxPktInfo;
 
 
index d9fa36c95230da95c61d3fcbd59b5a7680ef259c..03b8b4decf0978df9768dfd2e0676824cb91224f 100644 (file)
@@ -322,7 +322,9 @@ s_vSaveTxPktInfo(PSDevice pDevice, BYTE byPktNum, PBYTE pbyDestAddr, WORD wPktLe
 
     pStatistic->abyTxPktInfo[byPktNum].wLength = wPktLength;
     pStatistic->abyTxPktInfo[byPktNum].wFIFOCtl = wFIFOCtl;
-    memcpy(pStatistic->abyTxPktInfo[byPktNum].abyDestAddr, pbyDestAddr, U_ETHER_ADDR_LEN);
+    memcpy(pStatistic->abyTxPktInfo[byPktNum].abyDestAddr,
+          pbyDestAddr,
+          ETH_ALEN);
 }
 
 
@@ -1026,18 +1028,27 @@ s_vFillRTSHead (
             pBuf->Data.wDurationID = pBuf->wDuration_aa;
             //Get RTS Frame body
             pBuf->Data.wFrameControl = TYPE_CTL_RTS;//0x00B4
-            if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
-                (pDevice->eOPMode == OP_MODE_AP)) {
-                memcpy(&(pBuf->Data.abyRA[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN);
-            }
+
+       if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
+           (pDevice->eOPMode == OP_MODE_AP)) {
+               memcpy(&(pBuf->Data.abyRA[0]),
+                      &(psEthHeader->abyDstAddr[0]),
+                      ETH_ALEN);
+       }
             else {
-                memcpy(&(pBuf->Data.abyRA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
-            }
-            if (pDevice->eOPMode == OP_MODE_AP) {
-                memcpy(&(pBuf->Data.abyTA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
-            }
+                   memcpy(&(pBuf->Data.abyRA[0]),
+                          &(pDevice->abyBSSID[0]),
+                          ETH_ALEN);
+           }
+       if (pDevice->eOPMode == OP_MODE_AP) {
+               memcpy(&(pBuf->Data.abyTA[0]),
+                      &(pDevice->abyBSSID[0]),
+                      ETH_ALEN);
+       }
             else {
-                memcpy(&(pBuf->Data.abyTA[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN);
+                   memcpy(&(pBuf->Data.abyTA[0]),
+                          &(psEthHeader->abySrcAddr[0]),
+                          ETH_ALEN);
             }
         }
         else {
@@ -1063,19 +1074,27 @@ s_vFillRTSHead (
             //Get RTS Frame body
             pBuf->Data.wFrameControl = TYPE_CTL_RTS;//0x00B4
 
-            if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
-                (pDevice->eOPMode == OP_MODE_AP)) {
-                memcpy(&(pBuf->Data.abyRA[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN);
-            }
+       if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
+           (pDevice->eOPMode == OP_MODE_AP)) {
+               memcpy(&(pBuf->Data.abyRA[0]),
+                      &(psEthHeader->abyDstAddr[0]),
+                      ETH_ALEN);
+       }
             else {
-                memcpy(&(pBuf->Data.abyRA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
+               memcpy(&(pBuf->Data.abyRA[0]),
+                      &(pDevice->abyBSSID[0]),
+                      ETH_ALEN);
             }
 
-            if (pDevice->eOPMode == OP_MODE_AP) {
-                memcpy(&(pBuf->Data.abyTA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
-            }
+       if (pDevice->eOPMode == OP_MODE_AP) {
+               memcpy(&(pBuf->Data.abyTA[0]),
+                      &(pDevice->abyBSSID[0]),
+                      ETH_ALEN);
+       }
             else {
-                memcpy(&(pBuf->Data.abyTA[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN);
+                   memcpy(&(pBuf->Data.abyTA[0]),
+                          &(psEthHeader->abySrcAddr[0]),
+                          ETH_ALEN);
             }
 
         } // if (byFBOption == AUTO_FB_NONE)
@@ -1094,20 +1113,26 @@ s_vFillRTSHead (
             //Get RTS Frame body
             pBuf->Data.wFrameControl = TYPE_CTL_RTS;//0x00B4
 
-            if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
-                (pDevice->eOPMode == OP_MODE_AP)) {
-                memcpy(&(pBuf->Data.abyRA[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN);
-            }
-            else {
-                memcpy(&(pBuf->Data.abyRA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
-            }
-
-            if (pDevice->eOPMode == OP_MODE_AP) {
-                memcpy(&(pBuf->Data.abyTA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
-            }
-            else {
-                memcpy(&(pBuf->Data.abyTA[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN);
-            }
+       if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
+           (pDevice->eOPMode == OP_MODE_AP)) {
+               memcpy(&(pBuf->Data.abyRA[0]),
+                      &(psEthHeader->abyDstAddr[0]),
+                      ETH_ALEN);
+       } else {
+               memcpy(&(pBuf->Data.abyRA[0]),
+                      &(pDevice->abyBSSID[0]),
+                      ETH_ALEN);
+       }
+
+       if (pDevice->eOPMode == OP_MODE_AP) {
+               memcpy(&(pBuf->Data.abyTA[0]),
+                      &(pDevice->abyBSSID[0]),
+                      ETH_ALEN);
+       } else {
+               memcpy(&(pBuf->Data.abyTA[0]),
+                      &(psEthHeader->abySrcAddr[0]),
+                      ETH_ALEN);
+       }
 
         }
         else {
@@ -1125,19 +1150,25 @@ s_vFillRTSHead (
            //Get RTS Frame body
             pBuf->Data.wFrameControl = TYPE_CTL_RTS;//0x00B4
 
-            if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
-                (pDevice->eOPMode == OP_MODE_AP)) {
-                memcpy(&(pBuf->Data.abyRA[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN);
-            }
-            else {
-                memcpy(&(pBuf->Data.abyRA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
-            }
-            if (pDevice->eOPMode == OP_MODE_AP) {
-                memcpy(&(pBuf->Data.abyTA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
-            }
-            else {
-                memcpy(&(pBuf->Data.abyTA[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN);
-            }
+       if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
+           (pDevice->eOPMode == OP_MODE_AP)) {
+               memcpy(&(pBuf->Data.abyRA[0]),
+                      &(psEthHeader->abyDstAddr[0]),
+                      ETH_ALEN);
+       } else {
+               memcpy(&(pBuf->Data.abyRA[0]),
+                      &(pDevice->abyBSSID[0]),
+                      ETH_ALEN);
+       }
+       if (pDevice->eOPMode == OP_MODE_AP) {
+               memcpy(&(pBuf->Data.abyTA[0]),
+                      &(pDevice->abyBSSID[0]),
+                      ETH_ALEN);
+       } else {
+               memcpy(&(pBuf->Data.abyTA[0]),
+                      &(psEthHeader->abySrcAddr[0]),
+                      ETH_ALEN);
+       }
         }
     }
     else if (byPktType == PK_TYPE_11B) {
@@ -1153,20 +1184,26 @@ s_vFillRTSHead (
         //Get RTS Frame body
         pBuf->Data.wFrameControl = TYPE_CTL_RTS;//0x00B4
 
-
-        if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
+       if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
             (pDevice->eOPMode == OP_MODE_AP)) {
-            memcpy(&(pBuf->Data.abyRA[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN);
+               memcpy(&(pBuf->Data.abyRA[0]),
+                      &(psEthHeader->abyDstAddr[0]),
+                      ETH_ALEN);
         }
         else {
-            memcpy(&(pBuf->Data.abyRA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
+               memcpy(&(pBuf->Data.abyRA[0]),
+                      &(pDevice->abyBSSID[0]),
+                      ETH_ALEN);
         }
 
         if (pDevice->eOPMode == OP_MODE_AP) {
-            memcpy(&(pBuf->Data.abyTA[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
-        }
-        else {
-            memcpy(&(pBuf->Data.abyTA[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN);
+               memcpy(&(pBuf->Data.abyTA[0]),
+                      &(pDevice->abyBSSID[0]),
+                      ETH_ALEN);
+       } else {
+               memcpy(&(pBuf->Data.abyTA[0]),
+                      &(psEthHeader->abySrcAddr[0]),
+                      ETH_ALEN);
         }
     }
 }
@@ -1222,7 +1259,9 @@ s_vFillCTSHead (
             pBuf->Data.wDurationID = pBuf->wDuration_ba;
             pBuf->Data.wFrameControl = TYPE_CTL_CTS;//0x00C4
             pBuf->Data.wReserved = 0x0000;
-            memcpy(&(pBuf->Data.abyRA[0]), &(pDevice->abyCurrentNetAddr[0]), U_ETHER_ADDR_LEN);
+       memcpy(&(pBuf->Data.abyRA[0]),
+              &(pDevice->abyCurrentNetAddr[0]),
+              ETH_ALEN);
         } else { //if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA)
             PSCTS pBuf = (PSCTS)pvCTS;
             //Get SignalField,ServiceField,Length
@@ -1239,16 +1278,13 @@ s_vFillCTSHead (
             pBuf->Data.wDurationID = pBuf->wDuration_ba;
             pBuf->Data.wFrameControl = TYPE_CTL_CTS;//0x00C4
             pBuf->Data.wReserved = 0x0000;
-            memcpy(&(pBuf->Data.abyRA[0]), &(pDevice->abyCurrentNetAddr[0]), U_ETHER_ADDR_LEN);
+       memcpy(&(pBuf->Data.abyRA[0]),
+              &(pDevice->abyCurrentNetAddr[0]),
+              ETH_ALEN);
         }
     }
 }
 
-
-
-
-
-
 /*+
  *
  * Description:
@@ -1843,21 +1879,35 @@ s_vGenerateMACHeader (
     }
 
     if (pDevice->eOPMode == OP_MODE_AP) {
-        memcpy(&(pMACHeader->abyAddr1[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN);
-        memcpy(&(pMACHeader->abyAddr2[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
-        memcpy(&(pMACHeader->abyAddr3[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN);
+       memcpy(&(pMACHeader->abyAddr1[0]),
+              &(psEthHeader->abyDstAddr[0]),
+              ETH_ALEN);
+       memcpy(&(pMACHeader->abyAddr2[0]), &(pDevice->abyBSSID[0]), ETH_ALEN);
+       memcpy(&(pMACHeader->abyAddr3[0]),
+              &(psEthHeader->abySrcAddr[0]),
+              ETH_ALEN);
         pMACHeader->wFrameCtl |= FC_FROMDS;
-    }
-    else {
-        if (pDevice->eOPMode == OP_MODE_ADHOC) {
-            memcpy(&(pMACHeader->abyAddr1[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN);
-            memcpy(&(pMACHeader->abyAddr2[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN);
-            memcpy(&(pMACHeader->abyAddr3[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
-        }
-        else {
-            memcpy(&(pMACHeader->abyAddr3[0]), &(psEthHeader->abyDstAddr[0]), U_ETHER_ADDR_LEN);
-            memcpy(&(pMACHeader->abyAddr2[0]), &(psEthHeader->abySrcAddr[0]), U_ETHER_ADDR_LEN);
-            memcpy(&(pMACHeader->abyAddr1[0]), &(pDevice->abyBSSID[0]), U_ETHER_ADDR_LEN);
+    } else {
+       if (pDevice->eOPMode == OP_MODE_ADHOC) {
+               memcpy(&(pMACHeader->abyAddr1[0]),
+                      &(psEthHeader->abyDstAddr[0]),
+                      ETH_ALEN);
+               memcpy(&(pMACHeader->abyAddr2[0]),
+                      &(psEthHeader->abySrcAddr[0]),
+                      ETH_ALEN);
+               memcpy(&(pMACHeader->abyAddr3[0]),
+                      &(pDevice->abyBSSID[0]),
+                      ETH_ALEN);
+       } else {
+               memcpy(&(pMACHeader->abyAddr3[0]),
+                      &(psEthHeader->abyDstAddr[0]),
+                      ETH_ALEN);
+               memcpy(&(pMACHeader->abyAddr2[0]),
+                      &(psEthHeader->abySrcAddr[0]),
+                      ETH_ALEN);
+               memcpy(&(pMACHeader->abyAddr1[0]),
+                      &(pDevice->abyBSSID[0]),
+                      ETH_ALEN);
             pMACHeader->wFrameCtl |= FC_TODS;
         }
     }
@@ -2089,8 +2139,12 @@ CMD_STATUS csMgmt_xmit(
 
     memset((PVOID)(pbyTxBufferAddr + wTxBufSize), 0, (cbHeaderSize - wTxBufSize));
 
-    memcpy(&(sEthHeader.abyDstAddr[0]), &(pPacket->p80211Header->sA3.abyAddr1[0]), U_ETHER_ADDR_LEN);
-    memcpy(&(sEthHeader.abySrcAddr[0]), &(pPacket->p80211Header->sA3.abyAddr2[0]), U_ETHER_ADDR_LEN);
+    memcpy(&(sEthHeader.abyDstAddr[0]),
+          &(pPacket->p80211Header->sA3.abyAddr1[0]),
+          ETH_ALEN);
+    memcpy(&(sEthHeader.abySrcAddr[0]),
+          &(pPacket->p80211Header->sA3.abyAddr2[0]),
+          ETH_ALEN);
     //=========================
     //    No Fragmentation
     //=========================
@@ -2521,8 +2575,12 @@ vDMA0_tx_80211(PSDevice  pDevice, struct sk_buff *skb) {
         cbHeaderSize = wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR + sizeof(STxDataHead_ab);
     }
     memset((PVOID)(pbyTxBufferAddr + wTxBufSize), 0, (cbHeaderSize - wTxBufSize));
-    memcpy(&(sEthHeader.abyDstAddr[0]), &(p80211Header->sA3.abyAddr1[0]), U_ETHER_ADDR_LEN);
-    memcpy(&(sEthHeader.abySrcAddr[0]), &(p80211Header->sA3.abyAddr2[0]), U_ETHER_ADDR_LEN);
+    memcpy(&(sEthHeader.abyDstAddr[0]),
+          &(p80211Header->sA3.abyAddr1[0]),
+          ETH_ALEN);
+    memcpy(&(sEthHeader.abySrcAddr[0]),
+          &(p80211Header->sA3.abyAddr2[0]),
+          ETH_ALEN);
     //=========================
     //    No Fragmentation
     //=========================
index 6bc22d371c1e1ef36a95ded209110383ff2e3ee1..133f475206219c0d2e3b933e16d26ce59776653a 100644 (file)
@@ -43,8 +43,8 @@
 typedef struct tagSRTSDataF {
     WORD    wFrameControl;
     WORD    wDurationID;
-    BYTE    abyRA[U_ETHER_ADDR_LEN];
-    BYTE    abyTA[U_ETHER_ADDR_LEN];
+    BYTE    abyRA[ETH_ALEN];
+    BYTE    abyTA[ETH_ALEN];
 } SRTSDataF, *PSRTSDataF;
 
 //
@@ -53,7 +53,7 @@ typedef struct tagSRTSDataF {
 typedef struct tagSCTSDataF {
     WORD    wFrameControl;
     WORD    wDurationID;
-    BYTE    abyRA[U_ETHER_ADDR_LEN];
+    BYTE    abyRA[ETH_ALEN];
     WORD    wReserved;
 } SCTSDataF, *PSCTSDataF;
 
index ab1368a08389bdca0475ab733c556cad7c507faf..a7c716f174daeb5b9d5f491b69a916d4265307b2 100644 (file)
@@ -68,7 +68,7 @@ BYTE ETHbyGetHashIndexByCrc32(PBYTE pbyMultiAddr)
        BYTE    byHash = 0;
 
        /* get the least 6-bits from CRC generator */
-       byTmpHash = (BYTE)(CRCdwCrc32(pbyMultiAddr, U_ETHER_ADDR_LEN,
+       byTmpHash = (BYTE)(CRCdwCrc32(pbyMultiAddr, ETH_ALEN,
                        0xFFFFFFFFL) & 0x3F);
        /* reverse most bit to least bit */
        for (ii = 0; ii < (sizeof(byTmpHash) * 8); ii++) {
index 5a3c326436c62f2cc0bf78fef9b29e73a4119d06..af119dd82b24518864182bb4c0708791200f0eaf 100644 (file)
 #ifndef __TETHER_H__
 #define __TETHER_H__
 
+#include <linux/if_ether.h>
 #include "ttype.h"
 
 /*---------------------  Export Definitions -------------------------*/
 //
 // constants
 //
-#define U_ETHER_ADDR_LEN    6           // Ethernet address length
 #define U_TYPE_LEN          2           //
 #define U_CRC_LEN           4           //
-#define U_HEADER_LEN        (U_ETHER_ADDR_LEN * 2 + U_TYPE_LEN)
-#define U_ETHER_ADDR_STR_LEN (U_ETHER_ADDR_LEN * 2 + 1)
+#define U_HEADER_LEN        (ETH_ALEN * 2 + U_TYPE_LEN)
+#define U_ETHER_ADDR_STR_LEN (ETH_ALEN * 2 + 1)
                                         // Ethernet address string length
 
 #define MIN_DATA_LEN        46          // min data length
 // Ethernet packet
 //
 typedef struct tagSEthernetHeader {
-    BYTE    abyDstAddr[U_ETHER_ADDR_LEN];
-    BYTE    abySrcAddr[U_ETHER_ADDR_LEN];
+    BYTE    abyDstAddr[ETH_ALEN];
+    BYTE    abySrcAddr[ETH_ALEN];
     WORD    wType;
 }__attribute__ ((__packed__))
 SEthernetHeader, *PSEthernetHeader;
@@ -178,8 +178,8 @@ SEthernetHeader, *PSEthernetHeader;
 // 802_3 packet
 //
 typedef struct tagS802_3Header {
-    BYTE    abyDstAddr[U_ETHER_ADDR_LEN];
-    BYTE    abySrcAddr[U_ETHER_ADDR_LEN];
+    BYTE    abyDstAddr[ETH_ALEN];
+    BYTE    abySrcAddr[ETH_ALEN];
     WORD    wLen;
 }__attribute__ ((__packed__))
 S802_3Header, *PS802_3Header;
@@ -190,11 +190,11 @@ S802_3Header, *PS802_3Header;
 typedef struct tagS802_11Header {
     WORD    wFrameCtl;
     WORD    wDurationID;
-    BYTE    abyAddr1[U_ETHER_ADDR_LEN];
-    BYTE    abyAddr2[U_ETHER_ADDR_LEN];
-    BYTE    abyAddr3[U_ETHER_ADDR_LEN];
+    BYTE    abyAddr1[ETH_ALEN];
+    BYTE    abyAddr2[ETH_ALEN];
+    BYTE    abyAddr3[ETH_ALEN];
     WORD    wSeqCtl;
-    BYTE    abyAddr4[U_ETHER_ADDR_LEN];
+    BYTE    abyAddr4[ETH_ALEN];
 }__attribute__ ((__packed__))
 S802_11Header, *PS802_11Header;
 
index 40986da1e4a2c0b7f0fc275434d6f99ad7f1ff6a..956add694227977f5061cc1da2aa0e21712a77c0 100644 (file)
@@ -91,7 +91,7 @@ BOOL WCTLbIsDuplicate (PSCache pCache, PS802_11Header pMACHeader)
     /* Not fount in cache - insert */
     pCacheEntry = &pCache->asCacheEntry[pCache->uInPtr];
     pCacheEntry->wFmSequence = pMACHeader->wSeqCtl;
-    memcpy(&(pCacheEntry->abyAddr2[0]), &(pMACHeader->abyAddr2[0]), U_ETHER_ADDR_LEN);
+    memcpy(&(pCacheEntry->abyAddr2[0]), &(pMACHeader->abyAddr2[0]), ETH_ALEN);
     pCacheEntry->wFrameCtl = pMACHeader->wFrameCtl;
     ADD_ONE_WITH_WRAP_AROUND(pCache->uInPtr, DUPLICATE_RX_CACHE_LENGTH);
     return FALSE;
@@ -154,7 +154,9 @@ UINT ii;
             pDevice->sRxDFCB[ii].bInUse = TRUE;
             pDevice->sRxDFCB[ii].wSequence = (pMACHeader->wSeqCtl >> 4);
             pDevice->sRxDFCB[ii].wFragNum = (pMACHeader->wSeqCtl & 0x000F);
-            memcpy(&(pDevice->sRxDFCB[ii].abyAddr2[0]), &(pMACHeader->abyAddr2[0]), U_ETHER_ADDR_LEN);
+           memcpy(&(pDevice->sRxDFCB[ii].abyAddr2[0]),
+                  &(pMACHeader->abyAddr2[0]),
+                  ETH_ALEN);
             return(ii);
         }
     }
index 330aea69d2312975cf650794ef6cd95ea754382d..9b4ff79912a9401280310df268be5d2ddd000eb3 100644 (file)
@@ -3773,13 +3773,17 @@ s_MgrMakeAssocRequest(
             pwPMKID = (PWORD)pbyRSN; // Point to PMKID count
             *pwPMKID = 0;            // Initialize PMKID count
             pbyRSN += 2;             // Point to PMKID list
-            for (ii = 0; ii < pDevice->gsPMKID.BSSIDInfoCount; ii++) {
-                if ( !memcmp(&pDevice->gsPMKID.BSSIDInfo[ii].BSSID[0], pMgmt->abyCurrBSSID, U_ETHER_ADDR_LEN)) {
-                    (*pwPMKID) ++;
-                    memcpy(pbyRSN, pDevice->gsPMKID.BSSIDInfo[ii].PMKID, 16);
-                    pbyRSN += 16;
-                }
-            }
+       for (ii = 0; ii < pDevice->gsPMKID.BSSIDInfoCount; ii++) {
+               if (!memcmp(&pDevice->gsPMKID.BSSIDInfo[ii].BSSID[0],
+                            pMgmt->abyCurrBSSID,
+                            ETH_ALEN)) {
+                       (*pwPMKID)++;
+                       memcpy(pbyRSN,
+                              pDevice->gsPMKID.BSSIDInfo[ii].PMKID,
+                              16);
+                       pbyRSN += 16;
+               }
+       }
             if (*pwPMKID != 0) {
                 sFrame.pRSN->len += (2 + (*pwPMKID)*16);
             }
@@ -4030,10 +4034,14 @@ s_MgrMakeReAssocRequest(
             *pwPMKID = 0;            // Initialize PMKID count
             pbyRSN += 2;             // Point to PMKID list
             for (ii = 0; ii < pDevice->gsPMKID.BSSIDInfoCount; ii++) {
-                if ( !memcmp(&pDevice->gsPMKID.BSSIDInfo[ii].BSSID[0], pMgmt->abyCurrBSSID, U_ETHER_ADDR_LEN)) {
-                    (*pwPMKID) ++;
-                    memcpy(pbyRSN, pDevice->gsPMKID.BSSIDInfo[ii].PMKID, 16);
-                    pbyRSN += 16;
+               if (!memcmp(&pDevice->gsPMKID.BSSIDInfo[ii].BSSID[0],
+                           pMgmt->abyCurrBSSID,
+                           ETH_ALEN)) {
+                       (*pwPMKID)++;
+                       memcpy(pbyRSN,
+                              pDevice->gsPMKID.BSSIDInfo[ii].PMKID,
+                              16);
+                       pbyRSN += 16;
                 }
             }
             if (*pwPMKID != 0) {
@@ -4057,8 +4065,6 @@ s_MgrMakeReAssocRequest(
     return pTxPacket;
 }
 
-
-
 /*+
  *
  * Routine Description:
@@ -4070,7 +4076,6 @@ s_MgrMakeReAssocRequest(
  *
 -*/
 
-
 PSTxMgmtPacket
 s_MgrMakeAssocResponse(
     IN PSDevice pDevice,
@@ -4745,13 +4750,16 @@ bAdd_PMKID_Candidate (
 
     // Update Old Candidate
     for (ii = 0; ii < pDevice->gsPMKIDCandidate.NumCandidates; ii++) {
-        pCandidateList = &pDevice->gsPMKIDCandidate.CandidateList[ii];
-        if ( !memcmp(pCandidateList->BSSID, pbyBSSID, U_ETHER_ADDR_LEN)) {
-            if ((psRSNCapObj->bRSNCapExist == TRUE) && (psRSNCapObj->wRSNCap & BIT0)) {
-                pCandidateList->Flags |= NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED;
-            } else {
-                pCandidateList->Flags &= ~(NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED);
-            }
+       pCandidateList = &pDevice->gsPMKIDCandidate.CandidateList[ii];
+       if (!memcmp(pCandidateList->BSSID, pbyBSSID, ETH_ALEN)) {
+               if ((psRSNCapObj->bRSNCapExist == TRUE)
+                   && (psRSNCapObj->wRSNCap & BIT0)) {
+                       pCandidateList->Flags |=
+                               NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED;
+               } else {
+                       pCandidateList->Flags &=
+                               ~(NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED);
+               }
             return TRUE;
         }
     }
@@ -4763,7 +4771,7 @@ bAdd_PMKID_Candidate (
     } else {
         pCandidateList->Flags &= ~(NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED);
     }
-    memcpy(pCandidateList->BSSID, pbyBSSID, U_ETHER_ADDR_LEN);
+    memcpy(pCandidateList->BSSID, pbyBSSID, ETH_ALEN);
     pDevice->gsPMKIDCandidate.NumCandidates++;
     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"NumCandidates:%d\n", (int)pDevice->gsPMKIDCandidate.NumCandidates);
     return TRUE;
index fa3aeedfb278606bc65dd9ef662f81a6e31dc532..f8be30df69c07f9952c65187f71bbdbf04640b83 100644 (file)
@@ -337,20 +337,25 @@ WPA2uSetIEs(
         }
         pRSNIEs->len +=2;
 
-        if ((pMgmt->gsPMKIDCache.BSSIDInfoCount > 0) &&
-            (pMgmt->bRoaming == TRUE) &&
+       if ((pMgmt->gsPMKIDCache.BSSIDInfoCount > 0) &&
+           (pMgmt->bRoaming == TRUE) &&
             (pMgmt->eAuthenMode == WMAC_AUTH_WPA2)) {
-            // RSN PMKID
-            pwPMKID = (PWORD)(&pRSNIEs->abyRSN[18]);  // Point to PMKID count
-            *pwPMKID = 0;                               // Initialize PMKID count
-            pbyBuffer = &pRSNIEs->abyRSN[20];           // Point to PMKID list
-            for (ii = 0; ii < pMgmt->gsPMKIDCache.BSSIDInfoCount; ii++) {
-                if ( !memcmp(&pMgmt->gsPMKIDCache.BSSIDInfo[ii].abyBSSID[0], pMgmt->abyCurrBSSID, U_ETHER_ADDR_LEN)) {
-                    (*pwPMKID) ++;
-                    memcpy(pbyBuffer, pMgmt->gsPMKIDCache.BSSIDInfo[ii].abyPMKID, 16);
-                    pbyBuffer += 16;
-                }
-            }
+               /* RSN PMKID, pointer to PMKID count */
+               pwPMKID = (PWORD)(&pRSNIEs->abyRSN[18]);
+               *pwPMKID = 0;                     /* Initialize PMKID count */
+               pbyBuffer = &pRSNIEs->abyRSN[20];    /* Point to PMKID list */
+               for (ii = 0; ii < pMgmt->gsPMKIDCache.BSSIDInfoCount; ii++) {
+                       if (!memcmp(&pMgmt->
+                                   gsPMKIDCache.BSSIDInfo[ii].abyBSSID[0],
+                                   pMgmt->abyCurrBSSID,
+                                   ETH_ALEN)) {
+                               (*pwPMKID)++;
+                               memcpy(pbyBuffer,
+                       pMgmt->gsPMKIDCache.BSSIDInfo[ii].abyPMKID,
+                                      16);
+                               pbyBuffer += 16;
+                       }
+               }
             if (*pwPMKID != 0) {
                 pRSNIEs->len += (2 + (*pwPMKID)*16);
             } else {
index 4555bc0448b957d908350d1e2bcda7bfd4ae9035..25b784c26e8f98ec94baf743993a534884de48a4 100644 (file)
@@ -103,7 +103,7 @@ static int wpa_init_wpadev(PSDevice pDevice)
 
     wpadev_priv = netdev_priv(pDevice->wpadev);
     *wpadev_priv = *pDevice;
-       memcpy(pDevice->wpadev->dev_addr, dev->dev_addr, U_ETHER_ADDR_LEN);
+       memcpy(pDevice->wpadev->dev_addr, dev->dev_addr, ETH_ALEN);
          pDevice->wpadev->base_addr = dev->base_addr;
        pDevice->wpadev->irq = dev->irq;
        pDevice->wpadev->mem_start = dev->mem_start;