From 96d69e201bbdb05c363e899138f9f42bc8ad8f88 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Mon, 18 Mar 2013 20:55:41 -0700 Subject: [PATCH] staging: vt6655: Remove unnecessary blank lines Remove a bunch of useless vertical whitespace. Convert 3 or more consecutive newlines to 2. Remove blank lines after open brace and before close brace. Signed-off-by: Joe Perches Signed-off-by: Greg Kroah-Hartman --- drivers/staging/vt6655/80211hdr.h | 27 ----- drivers/staging/vt6655/80211mgr.c | 37 ------ drivers/staging/vt6655/80211mgr.h | 50 -------- drivers/staging/vt6655/IEEE11h.c | 7 -- drivers/staging/vt6655/aes_ccmp.c | 7 -- drivers/staging/vt6655/baseband.c | 35 ------ drivers/staging/vt6655/baseband.h | 4 - drivers/staging/vt6655/bssdb.c | 78 ------------- drivers/staging/vt6655/bssdb.h | 15 --- drivers/staging/vt6655/card.c | 60 ---------- drivers/staging/vt6655/card.h | 7 -- drivers/staging/vt6655/channel.c | 8 -- drivers/staging/vt6655/channel.h | 2 - drivers/staging/vt6655/datarate.c | 19 ---- drivers/staging/vt6655/datarate.h | 7 -- drivers/staging/vt6655/desc.h | 22 ---- drivers/staging/vt6655/device.h | 57 ---------- drivers/staging/vt6655/device_cfg.h | 6 - drivers/staging/vt6655/device_main.c | 163 --------------------------- drivers/staging/vt6655/dpc.c | 53 --------- drivers/staging/vt6655/dpc.h | 3 - drivers/staging/vt6655/hostap.c | 26 ----- drivers/staging/vt6655/hostap.h | 4 - drivers/staging/vt6655/iocmd.h | 46 -------- drivers/staging/vt6655/ioctl.h | 4 - drivers/staging/vt6655/iowpa.h | 12 -- drivers/staging/vt6655/iwctl.c | 65 ----------- drivers/staging/vt6655/iwctl.h | 8 -- drivers/staging/vt6655/key.c | 16 --- drivers/staging/vt6655/key.h | 3 - drivers/staging/vt6655/mac.c | 33 ------ drivers/staging/vt6655/mac.h | 8 -- drivers/staging/vt6655/mib.c | 15 --- drivers/staging/vt6655/mib.h | 11 -- drivers/staging/vt6655/michael.c | 2 - drivers/staging/vt6655/michael.h | 2 - drivers/staging/vt6655/power.c | 26 ----- drivers/staging/vt6655/power.h | 3 - drivers/staging/vt6655/rf.c | 28 ----- drivers/staging/vt6655/rf.h | 4 - drivers/staging/vt6655/rxtx.c | 112 ------------------ drivers/staging/vt6655/rxtx.h | 4 - drivers/staging/vt6655/srom.c | 15 --- drivers/staging/vt6655/srom.h | 2 - drivers/staging/vt6655/tcrc.c | 7 -- drivers/staging/vt6655/tcrc.h | 3 - drivers/staging/vt6655/tether.c | 4 - drivers/staging/vt6655/tether.h | 8 -- drivers/staging/vt6655/tkip.c | 3 - drivers/staging/vt6655/tkip.h | 3 - drivers/staging/vt6655/tmacro.h | 2 - drivers/staging/vt6655/ttype.h | 2 - drivers/staging/vt6655/upc.h | 10 -- drivers/staging/vt6655/vntwifi.c | 27 ----- drivers/staging/vt6655/vntwifi.h | 20 ---- drivers/staging/vt6655/wcmd.c | 48 -------- drivers/staging/vt6655/wcmd.h | 10 -- drivers/staging/vt6655/wctl.c | 9 -- drivers/staging/vt6655/wctl.h | 5 - drivers/staging/vt6655/wmgr.c | 163 --------------------------- drivers/staging/vt6655/wmgr.h | 48 -------- drivers/staging/vt6655/wpa.c | 5 - drivers/staging/vt6655/wpa.h | 1 - drivers/staging/vt6655/wpa2.c | 4 - drivers/staging/vt6655/wpa2.h | 1 - drivers/staging/vt6655/wpactl.c | 41 ------- drivers/staging/vt6655/wpactl.h | 6 - drivers/staging/vt6655/wroute.c | 8 -- drivers/staging/vt6655/wroute.h | 3 - 69 files changed, 1557 deletions(-) diff --git a/drivers/staging/vt6655/80211hdr.h b/drivers/staging/vt6655/80211hdr.h index 0295a0444257..28078a114d4f 100644 --- a/drivers/staging/vt6655/80211hdr.h +++ b/drivers/staging/vt6655/80211hdr.h @@ -86,7 +86,6 @@ #define WLAN_DATA_MAXLEN 2312 #define WLAN_A3FR_MAXLEN (WLAN_HDR_ADDR3_LEN + WLAN_DATA_MAXLEN + WLAN_CRC_LEN) - #define WLAN_BEACON_FR_MAXLEN WLAN_A3FR_MAXLEN #define WLAN_ATIM_FR_MAXLEN (WLAN_HDR_ADDR3_LEN + 0) #define WLAN_NULLDATA_FR_MAXLEN (WLAN_HDR_ADDR3_LEN + 0) @@ -100,7 +99,6 @@ #define WLAN_AUTHEN_FR_MAXLEN WLAN_A3FR_MAXLEN #define WLAN_DEAUTHEN_FR_MAXLEN (WLAN_HDR_ADDR3_LEN + 2) - #define WLAN_WEP_NKEYS 4 #define WLAN_WEP40_KEYLEN 5 #define WLAN_WEP104_KEYLEN 13 @@ -122,7 +120,6 @@ #define WLAN_FTYPE_CTL 0x01 #define WLAN_FTYPE_DATA 0x02 - /* Frame Subtypes */ #define WLAN_FSTYPE_ASSOCREQ 0x00 #define WLAN_FSTYPE_ASSOCRESP 0x01 @@ -155,7 +152,6 @@ #define WLAN_FSTYPE_CFPOLL 0x06 #define WLAN_FSTYPE_CFACK_CFPOLL 0x07 - #ifdef __BIG_ENDIAN /* GET & SET Frame Control bit */ @@ -175,7 +171,6 @@ #define WLAN_GET_SEQ_FRGNUM(n) (((unsigned short)(n) >> 8) & (BIT0|BIT1|BIT2|BIT3)) #define WLAN_GET_SEQ_SEQNUM(n) ((((unsigned short)(n) >> 8) & (~(BIT0|BIT1|BIT2|BIT3))) >> 4) - /* Capability Field bit */ #define WLAN_GET_CAP_INFO_ESS(n) (((n) >> 8) & BIT0) #define WLAN_GET_CAP_INFO_IBSS(n) ((((n) >> 8) & BIT1) >> 1) @@ -190,7 +185,6 @@ #define WLAN_GET_CAP_INFO_DSSSOFDM(n) ((((n)) & BIT13) >> 13) #define WLAN_GET_CAP_INFO_GRPACK(n) ((((n)) & BIT14) >> 14) - #else /* GET & SET Frame Control bit */ @@ -206,12 +200,10 @@ #define WLAN_GET_FC_ISWEP(n) ((((unsigned short)(n)) & (BIT14)) >> 14) #define WLAN_GET_FC_ORDER(n) ((((unsigned short)(n)) & (BIT15)) >> 15) - /* Sequence Field bit */ #define WLAN_GET_SEQ_FRGNUM(n) (((unsigned short)(n)) & (BIT0|BIT1|BIT2|BIT3)) #define WLAN_GET_SEQ_SEQNUM(n) ((((unsigned short)(n)) & (~(BIT0|BIT1|BIT2|BIT3))) >> 4) - /* Capability Field bit */ #define WLAN_GET_CAP_INFO_ESS(n) ((n) & BIT0) #define WLAN_GET_CAP_INFO_IBSS(n) (((n) & BIT1) >> 1) @@ -226,10 +218,8 @@ #define WLAN_GET_CAP_INFO_DSSSOFDM(n) (((n) & BIT13) >> 13) #define WLAN_GET_CAP_INFO_GRPACK(n) (((n) & BIT14) >> 14) - #endif /*#ifdef __BIG_ENDIAN */ - #define WLAN_SET_CAP_INFO_ESS(n) (n) #define WLAN_SET_CAP_INFO_IBSS(n) ((n) << 1) #define WLAN_SET_CAP_INFO_CFPOLLABLE(n) ((n) << 2) @@ -243,7 +233,6 @@ #define WLAN_SET_CAP_INFO_DSSSOFDM(n) ((n) << 13) #define WLAN_SET_CAP_INFO_GRPACK(n) ((n) << 14) - #define WLAN_SET_FC_PRVER(n) ((unsigned short)(n)) #define WLAN_SET_FC_FTYPE(n) (((unsigned short)(n)) << 2) #define WLAN_SET_FC_FSTYPE(n) (((unsigned short)(n)) << 4) @@ -269,8 +258,6 @@ #define WLAN_SET_ERP_USE_PROTECTION(n) ((n) << 1) #define WLAN_SET_ERP_BARKER_MODE(n) ((n) << 2) - - /* Support & Basic Rates field */ #define WLAN_MGMT_IS_BASICRATE(b) ((b) & BIT7) #define WLAN_MGMT_GET_RATE(b) ((b) & ~BIT7) @@ -294,29 +281,24 @@ typedef struct { /* 802.11 Header Format */ typedef struct tagWLAN_80211HDR_A2 { - unsigned short wFrameCtl; unsigned short wDurationID; unsigned char abyAddr1[WLAN_ADDR_LEN]; unsigned char abyAddr2[WLAN_ADDR_LEN]; - } __attribute__ ((__packed__)) WLAN_80211HDR_A2, *PWLAN_80211HDR_A2; typedef struct tagWLAN_80211HDR_A3 { - unsigned short wFrameCtl; unsigned short wDurationID; unsigned char abyAddr1[WLAN_ADDR_LEN]; unsigned char abyAddr2[WLAN_ADDR_LEN]; unsigned char abyAddr3[WLAN_ADDR_LEN]; unsigned short wSeqCtl; - } __attribute__ ((__packed__)) WLAN_80211HDR_A3, *PWLAN_80211HDR_A3; typedef struct tagWLAN_80211HDR_A4 { - unsigned short wFrameCtl; unsigned short wDurationID; unsigned char abyAddr1[WLAN_ADDR_LEN]; @@ -324,28 +306,19 @@ typedef struct tagWLAN_80211HDR_A4 { unsigned char abyAddr3[WLAN_ADDR_LEN]; unsigned short wSeqCtl; unsigned char abyAddr4[WLAN_ADDR_LEN]; - } __attribute__ ((__packed__)) WLAN_80211HDR_A4, *PWLAN_80211HDR_A4; - typedef union tagUWLAN_80211HDR { - WLAN_80211HDR_A2 sA2; WLAN_80211HDR_A3 sA3; WLAN_80211HDR_A4 sA4; - } UWLAN_80211HDR, *PUWLAN_80211HDR; - /*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Variables --------------------------*/ /*--------------------- Export Functions --------------------------*/ - - #endif /* __80211HDR_H__ */ - - diff --git a/drivers/staging/vt6655/80211mgr.c b/drivers/staging/vt6655/80211mgr.c index 9e397aff80c6..4cb26f3faf26 100644 --- a/drivers/staging/vt6655/80211mgr.c +++ b/drivers/staging/vt6655/80211mgr.c @@ -61,8 +61,6 @@ /*--------------------- Static Definitions -------------------------*/ - - /*--------------------- Static Classes ----------------------------*/ /*--------------------- Static Variables --------------------------*/ @@ -71,14 +69,10 @@ static int msglevel = MSG_LEVEL_INFO; //static int msglevel =MSG_LEVEL_DEBUG; /*--------------------- Static Functions --------------------------*/ - - /*--------------------- Export Variables --------------------------*/ - /*--------------------- Export Functions --------------------------*/ - /*+ * * Routine Description: @@ -120,7 +114,6 @@ vMgrEncodeBeacon( * -*/ - void vMgrDecodeBeacon( PWLAN_FR_BEACON pFrame @@ -142,7 +135,6 @@ vMgrDecodeBeacon( pItem = (PWLAN_IE)((unsigned char *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))) + WLAN_BEACON_OFF_SSID); while (((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len)) { - switch (pItem->byElementID) { case WLAN_EID_SSID: if (pFrame->pSSID == NULL) @@ -229,7 +221,6 @@ vMgrDecodeBeacon( return; } - /*+ * * Routine Description: @@ -241,7 +232,6 @@ vMgrDecodeBeacon( * -*/ - void vMgrEncodeIBSSATIM( PWLAN_FR_IBSSATIM pFrame @@ -253,7 +243,6 @@ vMgrEncodeIBSSATIM( return; } - /*+ * * Routine Description: @@ -275,7 +264,6 @@ vMgrDecodeIBSSATIM( return; } - /*+ * * Routine Description: @@ -294,7 +282,6 @@ vMgrEncodeDisassociation( { pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; - // Fixed Fields pFrame->pwReason = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_DISASSOC_OFF_REASON); @@ -303,7 +290,6 @@ vMgrEncodeDisassociation( return; } - /*+ * * Routine Description: @@ -340,7 +326,6 @@ vMgrDecodeDisassociation( * -*/ - void vMgrEncodeAssocRequest( PWLAN_FR_ASSOCREQ pFrame @@ -356,7 +341,6 @@ vMgrEncodeAssocRequest( return; } - /*+ * * Routine Description: (AP) @@ -454,7 +438,6 @@ vMgrEncodeAssocResponse( return; } - /*+ * * Routine Description: @@ -500,7 +483,6 @@ vMgrDecodeAssocResponse( return; } - /*+ * * Routine Description: @@ -531,7 +513,6 @@ vMgrEncodeReassocRequest( return; } - /*+ * * Routine Description: (AP) @@ -543,7 +524,6 @@ vMgrEncodeReassocRequest( * -*/ - void vMgrDecodeReassocRequest( PWLAN_FR_REASSOCREQ pFrame @@ -565,7 +545,6 @@ vMgrDecodeReassocRequest( + WLAN_REASSOCREQ_OFF_SSID); while (((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len)) { - switch (pItem->byElementID) { case WLAN_EID_SSID: if (pFrame->pSSID == NULL) @@ -602,8 +581,6 @@ vMgrDecodeReassocRequest( return; } - - /*+ * * Routine Description: @@ -615,7 +592,6 @@ vMgrDecodeReassocRequest( * -*/ - void vMgrEncodeProbeRequest( PWLAN_FR_PROBEREQ pFrame @@ -650,7 +626,6 @@ vMgrDecodeProbeRequest( pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))); while (((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len)) { - switch (pItem->byElementID) { case WLAN_EID_SSID: if (pFrame->pSSID == NULL) @@ -677,7 +652,6 @@ vMgrDecodeProbeRequest( return; } - /*+ * * Routine Description: @@ -689,7 +663,6 @@ vMgrDecodeProbeRequest( * -*/ - void vMgrEncodeProbeResponse( PWLAN_FR_PROBERESP pFrame @@ -711,8 +684,6 @@ vMgrEncodeProbeResponse( return; } - - /*+ * * Routine Description: @@ -731,7 +702,6 @@ vMgrDecodeProbeResponse( { PWLAN_IE pItem; - pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; // Fixed Fields @@ -826,7 +796,6 @@ vMgrDecodeProbeResponse( return; } - /*+ * * Routine Description: @@ -857,7 +826,6 @@ vMgrEncodeAuthen( return; } - /*+ * * Routine Description: @@ -897,7 +865,6 @@ vMgrDecodeAuthen( return; } - /*+ * * Routine Description: @@ -924,7 +891,6 @@ vMgrEncodeDeauthen( return; } - /*+ * * Routine Description: @@ -950,7 +916,6 @@ vMgrDecodeDeauthen( return; } - /*+ * * Routine Description: (AP) @@ -982,7 +947,6 @@ vMgrEncodeReassocResponse( return; } - /*+ * * Routine Description: @@ -994,7 +958,6 @@ vMgrEncodeReassocResponse( * -*/ - void vMgrDecodeReassocResponse( PWLAN_FR_REASSOCRESP pFrame diff --git a/drivers/staging/vt6655/80211mgr.h b/drivers/staging/vt6655/80211mgr.h index 8429b261c27b..16402cf5d25e 100644 --- a/drivers/staging/vt6655/80211mgr.h +++ b/drivers/staging/vt6655/80211mgr.h @@ -65,7 +65,6 @@ // reference WiFi WPA spec. #define WLAN_EID_RSN_WPA 221 - #define WLAN_EID_ERP_NONERP_PRESENT 0x01 #define WLAN_EID_ERP_USE_PROTECTION 0x02 #define WLAN_EID_ERP_BARKER_MODE 0x04 @@ -132,14 +131,10 @@ #define WLAN_MGMT_STATUS_INVALID_RSN_IE_CAP 45 #define WLAN_MGMT_STATUS_CIPHER_REJECT 46 - - // Auth Algorithm #define WLAN_AUTH_ALG_OPENSYSTEM 0 #define WLAN_AUTH_ALG_SHAREDKEY 1 - - // Management Frame Field Offsets // Note: Not all fields are listed because of variable lengths. // Note: These offsets are from the start of the frame data @@ -184,7 +179,6 @@ #define WLAN_DEAUTHEN_OFF_REASON 0 - // // Cipher Suite Selectors defined in 802.11i // @@ -217,15 +211,12 @@ #define MEASURE_MODE_INCAPABLE 0x02 #define MEASURE_MODE_REFUSED 0x04 - - /*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Variables --------------------------*/ /*--------------------- Export Types ------------------------------*/ - // Information Element Types #pragma pack(1) @@ -235,7 +226,6 @@ typedef struct tagWLAN_IE { } __attribute__ ((__packed__)) WLAN_IE, *PWLAN_IE; - // Service Set Identity (SSID) #pragma pack(1) typedef struct tagWLAN_IE_SSID { @@ -245,7 +235,6 @@ typedef struct tagWLAN_IE_SSID { } __attribute__ ((__packed__)) WLAN_IE_SSID, *PWLAN_IE_SSID; - // Supported Rates #pragma pack(1) typedef struct tagWLAN_IE_SUPP_RATES { @@ -255,8 +244,6 @@ typedef struct tagWLAN_IE_SUPP_RATES { } __attribute__ ((__packed__)) WLAN_IE_SUPP_RATES, *PWLAN_IE_SUPP_RATES; - - // FH Parameter Set #pragma pack(1) typedef struct _WLAN_IE_FH_PARMS { @@ -277,7 +264,6 @@ typedef struct tagWLAN_IE_DS_PARMS { } __attribute__ ((__packed__)) WLAN_IE_DS_PARMS, *PWLAN_IE_DS_PARMS; - // CF Parameter Set #pragma pack(1) typedef struct tagWLAN_IE_CF_PARMS { @@ -290,7 +276,6 @@ typedef struct tagWLAN_IE_CF_PARMS { } __attribute__ ((__packed__)) WLAN_IE_CF_PARMS, *PWLAN_IE_CF_PARMS; - // TIM #pragma pack(1) typedef struct tagWLAN_IE_TIM { @@ -303,7 +288,6 @@ typedef struct tagWLAN_IE_TIM { } __attribute__ ((__packed__)) WLAN_IE_TIM, *PWLAN_IE_TIM; - // IBSS Parameter Set #pragma pack(1) typedef struct tagWLAN_IE_IBSS_PARMS { @@ -313,7 +297,6 @@ typedef struct tagWLAN_IE_IBSS_PARMS { } __attribute__ ((__packed__)) WLAN_IE_IBSS_PARMS, *PWLAN_IE_IBSS_PARMS; - // Challenge Text #pragma pack(1) typedef struct tagWLAN_IE_CHALLENGE { @@ -323,7 +306,6 @@ typedef struct tagWLAN_IE_CHALLENGE { } __attribute__ ((__packed__)) WLAN_IE_CHALLENGE, *PWLAN_IE_CHALLENGE; - #pragma pack(1) typedef struct tagWLAN_IE_RSN_EXT { unsigned char byElementID; @@ -355,7 +337,6 @@ typedef struct tagWLAN_IE_RSN { unsigned char abyRSN[WLAN_MIN_ARRAY]; } WLAN_IE_RSN, *PWLAN_IE_RSN; - // ERP #pragma pack(1) typedef struct tagWLAN_IE_ERP { @@ -365,7 +346,6 @@ typedef struct tagWLAN_IE_ERP { } __attribute__ ((__packed__)) WLAN_IE_ERP, *PWLAN_IE_ERP; - #pragma pack(1) typedef struct _MEASEURE_REQ { unsigned char byChannel; @@ -398,11 +378,9 @@ typedef struct _MEASEURE_REP_RPI { } MEASEURE_REP_RPI, *PMEASEURE_REP_RPI; typedef union _MEASEURE_REP { - MEASEURE_REP_BASIC sBasic; MEASEURE_REP_CCA sCCA; MEASEURE_REP_RPI sRPI; - } MEASEURE_REP, *PMEASEURE_REP; typedef struct _WLAN_IE_MEASURE_REQ { @@ -478,7 +456,6 @@ typedef struct _WLAN_IE_TPC_REP { unsigned char byLinkMargin; } WLAN_IE_TPC_REP, *PWLAN_IE_TPC_REP; - typedef struct _WLAN_IE_IBSS_DFS { unsigned char byElementID; unsigned char len; @@ -489,22 +466,17 @@ typedef struct _WLAN_IE_IBSS_DFS { #pragma pack() - - // Frame Types // prototype structure, all mgmt frame types will start with these members typedef struct tagWLAN_FR_MGMT { - unsigned int uType; unsigned int len; unsigned char *pBuf; PUWLAN_80211HDR pHdr; - } WLAN_FR_MGMT, *PWLAN_FR_MGMT; // Beacon frame typedef struct tagWLAN_FR_BEACON { - unsigned int uType; unsigned int len; unsigned char *pBuf; @@ -530,13 +502,10 @@ typedef struct tagWLAN_FR_BEACON { PWLAN_IE_CH_SW pIE_CHSW; PWLAN_IE_IBSS_DFS pIE_IBSSDFS; PWLAN_IE_QUIET pIE_Quiet; - } WLAN_FR_BEACON, *PWLAN_FR_BEACON; - // IBSS ATIM frame typedef struct tagWLAN_FR_IBSSATIM { - unsigned int uType; unsigned int len; unsigned char *pBuf; @@ -545,12 +514,10 @@ typedef struct tagWLAN_FR_IBSSATIM { // fixed fields // info elements // this frame type has a null body - } WLAN_FR_IBSSATIM, *PWLAN_FR_IBSSATIM; // Disassociation typedef struct tagWLAN_FR_DISASSOC { - unsigned int uType; unsigned int len; unsigned char *pBuf; @@ -558,12 +525,10 @@ typedef struct tagWLAN_FR_DISASSOC { /*-- fixed fields -----------*/ unsigned short *pwReason; /*-- info elements ----------*/ - } WLAN_FR_DISASSOC, *PWLAN_FR_DISASSOC; // Association Request typedef struct tagWLAN_FR_ASSOCREQ { - unsigned int uType; unsigned int len; unsigned char *pBuf; @@ -579,12 +544,10 @@ typedef struct tagWLAN_FR_ASSOCREQ { PWLAN_IE_SUPP_RATES pExtSuppRates; PWLAN_IE_PW_CAP pCurrPowerCap; PWLAN_IE_SUPP_CH pCurrSuppCh; - } WLAN_FR_ASSOCREQ, *PWLAN_FR_ASSOCREQ; // Association Response typedef struct tagWLAN_FR_ASSOCRESP { - unsigned int uType; unsigned int len; unsigned char *pBuf; @@ -596,12 +559,10 @@ typedef struct tagWLAN_FR_ASSOCRESP { /*-- info elements ----------*/ PWLAN_IE_SUPP_RATES pSuppRates; PWLAN_IE_SUPP_RATES pExtSuppRates; - } WLAN_FR_ASSOCRESP, *PWLAN_FR_ASSOCRESP; // Reassociation Request typedef struct tagWLAN_FR_REASSOCREQ { - unsigned int uType; unsigned int len; unsigned char *pBuf; @@ -618,12 +579,10 @@ typedef struct tagWLAN_FR_REASSOCREQ { PWLAN_IE_RSN pRSN; PWLAN_IE_RSN_EXT pRSNWPA; PWLAN_IE_SUPP_RATES pExtSuppRates; - } WLAN_FR_REASSOCREQ, *PWLAN_FR_REASSOCREQ; // Reassociation Response typedef struct tagWLAN_FR_REASSOCRESP { - unsigned int uType; unsigned int len; unsigned char *pBuf; @@ -635,12 +594,10 @@ typedef struct tagWLAN_FR_REASSOCRESP { /*-- info elements ----------*/ PWLAN_IE_SUPP_RATES pSuppRates; PWLAN_IE_SUPP_RATES pExtSuppRates; - } WLAN_FR_REASSOCRESP, *PWLAN_FR_REASSOCRESP; // Probe Request typedef struct tagWLAN_FR_PROBEREQ { - unsigned int uType; unsigned int len; unsigned char *pBuf; @@ -650,12 +607,10 @@ typedef struct tagWLAN_FR_PROBEREQ { PWLAN_IE_SSID pSSID; PWLAN_IE_SUPP_RATES pSuppRates; PWLAN_IE_SUPP_RATES pExtSuppRates; - } WLAN_FR_PROBEREQ, *PWLAN_FR_PROBEREQ; // Probe Response typedef struct tagWLAN_FR_PROBERESP { - unsigned int uType; unsigned int len; unsigned char *pBuf; @@ -679,12 +634,10 @@ typedef struct tagWLAN_FR_PROBERESP { PWLAN_IE_CH_SW pIE_CHSW; PWLAN_IE_IBSS_DFS pIE_IBSSDFS; PWLAN_IE_QUIET pIE_Quiet; - } WLAN_FR_PROBERESP, *PWLAN_FR_PROBERESP; // Authentication typedef struct tagWLAN_FR_AUTHEN { - unsigned int uType; unsigned int len; unsigned char *pBuf; @@ -695,12 +648,10 @@ typedef struct tagWLAN_FR_AUTHEN { unsigned short *pwStatus; /*-- info elements ----------*/ PWLAN_IE_CHALLENGE pChallenge; - } WLAN_FR_AUTHEN, *PWLAN_FR_AUTHEN; // Deauthenication typedef struct tagWLAN_FR_DEAUTHEN { - unsigned int uType; unsigned int len; unsigned char *pBuf; @@ -709,7 +660,6 @@ typedef struct tagWLAN_FR_DEAUTHEN { unsigned short *pwReason; /*-- info elements ----------*/ - } WLAN_FR_DEAUTHEN, *PWLAN_FR_DEAUTHEN; /*--------------------- Export Functions --------------------------*/ diff --git a/drivers/staging/vt6655/IEEE11h.c b/drivers/staging/vt6655/IEEE11h.c index 802db8e6dd70..dfda3c82906c 100644 --- a/drivers/staging/vt6655/IEEE11h.c +++ b/drivers/staging/vt6655/IEEE11h.c @@ -120,7 +120,6 @@ static bool s_bRxMSRReq(PSMgmtObject pMgmt, PWLAN_FRAME_MSRREQ pMSRReq, return bResult; } - static bool s_bRxTPCReq(PSMgmtObject pMgmt, PWLAN_FRAME_TPCREQ pTPCReq, unsigned char byRate, @@ -195,15 +194,12 @@ static bool s_bRxTPCReq(PSMgmtObject pMgmt, return true; /* return CARDbSendPacket(pMgmt->pAdapter, pFrame, PKT_TYPE_802_11_MNG, sizeof(WLAN_FRAME_TPCREP)); */ - } - /*--------------------- Export Variables --------------------------*/ /*--------------------- Export Functions --------------------------*/ - /*+ * * Description: @@ -285,7 +281,6 @@ IEEE11hbMgrRxAction(void *pMgmtHandle, void *pRxPacket) return true; } - bool IEEE11hbMSRRepTx(void *pMgmtHandle) { PSMgmtObject pMgmt = (PSMgmtObject) pMgmtHandle; @@ -324,6 +319,4 @@ bool IEEE11hbMSRRepTx(void *pMgmtHandle) return true; /* return CARDbSendPacket(pMgmt->pAdapter, pMSRRep, PKT_TYPE_802_11_MNG, uLength); */ - } - diff --git a/drivers/staging/vt6655/aes_ccmp.c b/drivers/staging/vt6655/aes_ccmp.c index 2808e6bfe322..36081481c6d1 100644 --- a/drivers/staging/vt6655/aes_ccmp.c +++ b/drivers/staging/vt6655/aes_ccmp.c @@ -122,7 +122,6 @@ void xor_128(unsigned char *a, unsigned char *b, unsigned char *out) (*dwPtrOut++) = (*dwPtrA++) ^ (*dwPtrB++); } - void xor_32(unsigned char *a, unsigned char *b, unsigned char *out) { unsigned long *dwPtrA = (unsigned long *)a; @@ -181,14 +180,12 @@ void ShiftRows(unsigned char *in, unsigned char *out) void MixColumns(unsigned char *in, unsigned char *out) { - out[0] = dot2_table[in[0]] ^ dot3_table[in[1]] ^ in[2] ^ in[3]; out[1] = in[0] ^ dot2_table[in[1]] ^ dot3_table[in[2]] ^ in[3]; out[2] = in[0] ^ in[1] ^ dot2_table[in[2]] ^ dot3_table[in[3]]; out[3] = dot3_table[in[0]] ^ in[1] ^ in[2] ^ dot2_table[in[3]]; } - void AESv128(unsigned char *key, unsigned char *data, unsigned char *ciphertext) { int i; @@ -220,7 +217,6 @@ void AESv128(unsigned char *key, unsigned char *data, unsigned char *ciphertext) AddRoundKey(abyRoundKey, round); } } - } /* @@ -259,7 +255,6 @@ bool AESbGenCCMP(unsigned char *pbyRxKey, unsigned char *pbyFrame, unsigned shor unsigned short wCnt; int ii, jj, kk; - pbyIV = pbyFrame + WLAN_HDR_ADDR3_LEN; if (WLAN_GET_FC_TODS(*(unsigned short *)pbyFrame) && WLAN_GET_FC_FROMDS(*(unsigned short *)pbyFrame)) { @@ -330,7 +325,6 @@ bool AESbGenCCMP(unsigned char *pbyRxKey, unsigned char *pbyFrame, unsigned shor memcpy(&(abyCTRPLD[1]), &(abyNonce[0]), 13); for (jj = wPayloadSize; jj > 16; jj = jj - 16) { - abyCTRPLD[14] = (unsigned char)(wCnt >> 8); abyCTRPLD[15] = (unsigned char)(wCnt & 0xff); @@ -392,5 +386,4 @@ bool AESbGenCCMP(unsigned char *pbyRxKey, unsigned char *pbyFrame, unsigned shor } else { return false; } - } diff --git a/drivers/staging/vt6655/baseband.c b/drivers/staging/vt6655/baseband.c index 8df3973dd262..c26418d806fb 100644 --- a/drivers/staging/vt6655/baseband.c +++ b/drivers/staging/vt6655/baseband.c @@ -74,8 +74,6 @@ static int msglevel = MSG_LEVEL_INFO; /*--------------------- Static Variables --------------------------*/ - - #define CB_VT3253_INIT_FOR_RFMD 446 unsigned char byVT3253InitTab_RFMD[CB_VT3253_INIT_FOR_RFMD][2] = { {0x00, 0x30}, @@ -1248,8 +1246,6 @@ unsigned char byVT3253B0_AIROHA2230[CB_VT3253B0_INIT_FOR_AIROHA2230][2] = { {0xff, 0x00}, }; - - #define CB_VT3253B0_INIT_FOR_UW2451 256 //For UW2451 unsigned char byVT3253B0_UW2451[CB_VT3253B0_INIT_FOR_UW2451][2] = { @@ -1713,7 +1709,6 @@ unsigned char byVT3253B0_AGC[CB_VT3253B0_AGC][2] = { const unsigned short awcFrameTime[MAX_RATE] = {10, 20, 55, 110, 24, 36, 48, 72, 96, 144, 192, 216}; - /*--------------------- Static Functions --------------------------*/ static @@ -1754,7 +1749,6 @@ s_vChangeAntenna( } } - /*--------------------- Export Variables --------------------------*/ /* * Description: Calculate data frame transmitting time @@ -1784,7 +1778,6 @@ BBuGetFrameTime( unsigned int uRateIdx = (unsigned int) wRate; unsigned int uRate = 0; - if (uRateIdx > RATE_54M) { ASSERT(0); return 0; @@ -2026,7 +2019,6 @@ bool BBbReadEmbedded(unsigned long dwIoBase, unsigned char byBBAddr, unsigned ch return true; } - /* * Description: Write a Byte to BASEBAND, by embedded programming * @@ -2068,7 +2060,6 @@ bool BBbWriteEmbedded(unsigned long dwIoBase, unsigned char byBBAddr, unsigned c return true; } - /* * Description: Test if all bits are set for the Baseband register * @@ -2091,7 +2082,6 @@ bool BBbIsRegBitsOn(unsigned long dwIoBase, unsigned char byBBAddr, unsigned cha return (byOrgData & byTestBits) == byTestBits; } - /* * Description: Test if all bits are clear for the Baseband register * @@ -2289,8 +2279,6 @@ bool BBbVT3253Init(PSDevice pDevice) return bResult; } - - /* * Description: Read All Baseband Registers * @@ -2328,7 +2316,6 @@ void BBvReadAllRegs(unsigned long dwIoBase, unsigned char *pbyBBRegs) * */ - void BBvLoopbackOn(PSDevice pDevice) { unsigned char byData; @@ -2402,11 +2389,8 @@ void BBvLoopbackOff(PSDevice pDevice) } BBbReadEmbedded(dwIoBase, 0x0E, &byData);//CR14 BBbWriteEmbedded(dwIoBase, 0x0E, (unsigned char)(byData | 0x80));//CR14 - } - - /* * Description: Set ShortSlotTime mode * @@ -2440,7 +2424,6 @@ BBvSetShortSlotTime(PSDevice pDevice) } BBbWriteEmbedded(pDevice->PortOffset, 0x0A, byBBRxConf);//CR10 - } void BBvSetVGAGainOffset(PSDevice pDevice, unsigned char byData) @@ -2462,7 +2445,6 @@ void BBvSetVGAGainOffset(PSDevice pDevice, unsigned char byData) BBbWriteEmbedded(pDevice->PortOffset, 0x0A, byBBRxConf);//CR10 } - /* * Description: Baseband SoftwareReset * @@ -2561,9 +2543,6 @@ BBvSetTxAntennaMode(unsigned long dwIoBase, unsigned char byAntennaMode) BBbWriteEmbedded(dwIoBase, 0x09, byBBTxConf);//CR09 } - - - /* * Description: Set Rx Antenna mode * @@ -2596,7 +2575,6 @@ BBvSetRxAntennaMode(unsigned long dwIoBase, unsigned char byAntennaMode) BBbWriteEmbedded(dwIoBase, 0x0A, byBBRxConf);//CR10 } - /* * Description: BBvSetDeepSleep * @@ -2623,8 +2601,6 @@ BBvExitDeepSleep(unsigned long dwIoBase, unsigned char byLocalID) BBbWriteEmbedded(dwIoBase, 0x0D, 0x01);//CR13 } - - static unsigned long s_ulGetRatio(PSDevice pDevice) @@ -2733,7 +2709,6 @@ s_ulGetRatio(PSDevice pDevice) return ulRatio; } - void BBvClearAntDivSQ3Value(PSDevice pDevice) { @@ -2745,7 +2720,6 @@ BBvClearAntDivSQ3Value(PSDevice pDevice) } } - /* * Description: Antenna Diversity * @@ -2764,7 +2738,6 @@ BBvClearAntDivSQ3Value(PSDevice pDevice) void BBvAntennaDiversity(PSDevice pDevice, unsigned char byRxRate, unsigned char bySQ3) { - if ((byRxRate >= MAX_RATE) || (pDevice->wAntDiversityMaxRate >= MAX_RATE)) { return; } @@ -2774,13 +2747,11 @@ BBvAntennaDiversity(PSDevice pDevice, unsigned char byRxRate, unsigned char bySQ pDevice->uNumSQ3[byRxRate]++; if (pDevice->byAntennaState == 0) { - if (pDevice->uDiversityCnt > pDevice->ulDiversityNValue) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ulDiversityNValue=[%d],54M-[%d]\n", (int)pDevice->ulDiversityNValue, (int)pDevice->uNumSQ3[(int)pDevice->wAntDiversityMaxRate]); if (pDevice->uNumSQ3[pDevice->wAntDiversityMaxRate] < pDevice->uDiversityCnt/2) { - pDevice->ulRatio_State0 = s_ulGetRatio(pDevice); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "SQ3_State0, rate = [%08x]\n", (int)pDevice->ulRatio_State0); @@ -2798,7 +2769,6 @@ BBvAntennaDiversity(PSDevice pDevice, unsigned char byRxRate, unsigned char bySQ add_timer(&pDevice->TimerSQ3Tmax1); } else { - pDevice->TimerSQ3Tmax3.expires = RUN_AT(pDevice->byTMax3 * HZ); add_timer(&pDevice->TimerSQ3Tmax3); } @@ -2808,7 +2778,6 @@ BBvAntennaDiversity(PSDevice pDevice, unsigned char byRxRate, unsigned char bySQ } else { //byAntennaState == 1 if (pDevice->uDiversityCnt > pDevice->ulDiversityMValue) { - del_timer(&pDevice->TimerSQ3Tmax1); pDevice->ulRatio_State1 = s_ulGetRatio(pDevice); @@ -2868,12 +2837,10 @@ TimerSQ3CallBack( add_timer(&pDevice->TimerSQ3Tmax3); add_timer(&pDevice->TimerSQ3Tmax2); - spin_unlock_irq(&pDevice->lock); return; } - /*+ * * Description: @@ -2903,7 +2870,6 @@ TimerState1CallBack( spin_lock_irq(&pDevice->lock); if (pDevice->uDiversityCnt < pDevice->ulDiversityMValue/100) { - s_vChangeAntenna(pDevice); pDevice->TimerSQ3Tmax3.expires = RUN_AT(pDevice->byTMax3 * HZ); pDevice->TimerSQ3Tmax2.expires = RUN_AT(pDevice->byTMax2 * HZ); @@ -2934,4 +2900,3 @@ TimerState1CallBack( return; } - diff --git a/drivers/staging/vt6655/baseband.h b/drivers/staging/vt6655/baseband.h index 96f257b02952..e31bb7600673 100644 --- a/drivers/staging/vt6655/baseband.h +++ b/drivers/staging/vt6655/baseband.h @@ -41,7 +41,6 @@ // #define BB_MAX_CONTEXT_SIZE 256 - // // Baseband RF pair definition in eeprom (Bits 6..0) // @@ -49,7 +48,6 @@ #define PREAMBLE_LONG 0 #define PREAMBLE_SHORT 1 - #define F5G 0 #define F2_4G 1 @@ -66,7 +64,6 @@ #define TOP_RATE_2M 0x00200000 #define TOP_RATE_1M 0x00100000 - /*--------------------- Export Types ------------------------------*/ /*--------------------- Export Macros ------------------------------*/ @@ -77,7 +74,6 @@ #define BBvSetFOE(dwIoBase) \ BBbWriteEmbedded(dwIoBase, 0xB1, 0x0C) - /*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Variables --------------------------*/ diff --git a/drivers/staging/vt6655/bssdb.c b/drivers/staging/vt6655/bssdb.c index 9470ed548bd0..f983915168b7 100644 --- a/drivers/staging/vt6655/bssdb.c +++ b/drivers/staging/vt6655/bssdb.c @@ -60,17 +60,12 @@ /*--------------------- Static Definitions -------------------------*/ - - - /*--------------------- Static Classes ----------------------------*/ /*--------------------- Static Variables --------------------------*/ static int msglevel = MSG_LEVEL_INFO; //static int msglevel =MSG_LEVEL_DEBUG; - - const unsigned short awHWRetry0[5][5] = { {RATE_18M, RATE_18M, RATE_12M, RATE_12M, RATE_12M}, {RATE_24M, RATE_24M, RATE_18M, RATE_12M, RATE_12M}, @@ -86,8 +81,6 @@ const unsigned short awHWRetry1[5][5] = { {RATE_54M, RATE_54M, RATE_36M, RATE_18M, RATE_18M} }; - - /*--------------------- Static Functions --------------------------*/ void s_vCheckSensitivity( @@ -100,19 +93,13 @@ void s_uCalculateLinkQual( ); #endif - void s_vCheckPreEDThreshold( void *hDeviceContext ); /*--------------------- Export Variables --------------------------*/ - /*--------------------- Export Functions --------------------------*/ - - - - /*+ * * Routine Description: @@ -194,7 +181,6 @@ BSSpSearchBSSList( //2007-0721-01by MikeLiu pCurrBSS->bSelected = false; if (pCurrBSS->bActive) { - if (pSSID != NULL) { // matched SSID if (!!memcmp(pSSID->abySSID, @@ -264,10 +250,8 @@ BSSpSearchBSSList( } } return NULL; - } - /*+ * * Routine Description: @@ -278,7 +262,6 @@ BSSpSearchBSSList( * -*/ - void BSSvClearBSSList( void *hDeviceContext, @@ -311,8 +294,6 @@ BSSvClearBSSList( return; } - - /*+ * * Routine Description: @@ -351,8 +332,6 @@ BSSpAddrIsInBSSList( return NULL; }; - - /*+ * * Routine Description: @@ -384,7 +363,6 @@ BSSbInsertToBSSList( void *pRxPacketContext ) { - PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; PSRxMgmtPacket pRxPacket = (PSRxMgmtPacket)pRxPacketContext; @@ -393,8 +371,6 @@ BSSbInsertToBSSList( bool bParsingQuiet = false; PWLAN_IE_QUIET pQuiet = NULL; - - pBSSList = (PKnownBSS)&(pMgmt->sBSSList[0]); for (ii = 0; ii < MAX_BSS_NUM; ii++) { @@ -486,7 +462,6 @@ BSSbInsertToBSSList( } if ((pMgmt->eAuthenMode == WMAC_AUTH_WPA2) || (pBSSList->bWPA2Valid == true)) { - PSKeyItem pTransmitKey = NULL; bool bIs802_1x = false; @@ -498,7 +473,6 @@ BSSbInsertToBSSList( } if ((bIs802_1x == true) && (pSSID->len == ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->len) && (!memcmp(pSSID->abySSID, ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySSID, pSSID->len))) { - bAdd_PMKID_Candidate((void *)pDevice, pBSSList->abyBSSID, &pBSSList->sRSNCapObj); if ((pDevice->bLinkPass == true) && (pMgmt->eCurrState == WMAC_STATE_ASSOC)) { @@ -567,7 +541,6 @@ BSSbInsertToBSSList( return true; } - /*+ * * Routine Description: @@ -609,12 +582,9 @@ BSSbUpdateToBSSList( bool bParsingQuiet = false; PWLAN_IE_QUIET pQuiet = NULL; - - if (pBSSList == NULL) return false; - HIDWORD(pBSSList->qwBSSTimestamp) = cpu_to_le32(HIDWORD(qwTimestamp)); LODWORD(pBSSList->qwBSSTimestamp) = cpu_to_le32(LODWORD(qwTimestamp)); pBSSList->wBeaconInterval = cpu_to_le16(wBeaconInterval); @@ -743,10 +713,6 @@ BSSbUpdateToBSSList( return true; } - - - - /*+ * * Routine Description: @@ -777,8 +743,6 @@ BSSDBbIsSTAInNodeDB(void *pMgmtObject, unsigned char *abyDstAddr, return false; }; - - /*+ * * Routine Description: @@ -792,7 +756,6 @@ BSSDBbIsSTAInNodeDB(void *pMgmtObject, unsigned char *abyDstAddr, void BSSvCreateOneNode(void *hDeviceContext, unsigned int *puNodeIndex) { - PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; unsigned int ii; @@ -837,8 +800,6 @@ BSSvCreateOneNode(void *hDeviceContext, unsigned int *puNodeIndex) return; }; - - /*+ * * Routine Description: @@ -855,13 +816,11 @@ BSSvRemoveOneNode( unsigned int uNodeIndex ) { - PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; unsigned char byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80}; struct sk_buff *skb; - while ((skb = skb_dequeue(&pMgmt->sNodeDBTable[uNodeIndex].sTxPSQueue)) != NULL) dev_kfree_skb(skb); // clear context @@ -926,13 +885,8 @@ BSSvUpdateAPNode( // Auto rate fallback function initiation. // RATEbInit(pDevice); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pMgmt->sNodeDBTable[0].wTxDataRate = %d \n", pMgmt->sNodeDBTable[0].wTxDataRate); - }; - - - - /*+ * * Routine Description: @@ -944,7 +898,6 @@ BSSvUpdateAPNode( * -*/ - void BSSvAddMulticastNode( void *hDeviceContext @@ -974,13 +927,8 @@ BSSvAddMulticastNode( printk("BSSvAddMultiCastNode:pMgmt->sNodeDBTable[0].wTxDataRate is %d\n", pMgmt->sNodeDBTable[0].wTxDataRate); #endif pMgmt->sNodeDBTable[0].uRatePollTimeout = FALLBACK_POLL_SECOND; - }; - - - - /*+ * * Routine Description: @@ -1024,7 +972,6 @@ BSSvSecondCallBack( if (((!(pDevice->byGPIO & GPIO0_DATA) && (pDevice->bHWRadioOff == false)) || ((pDevice->byGPIO & GPIO0_DATA) && (pDevice->bHWRadioOff == true))) && (cc == false)) { cc = true; } else if (cc == true) { - if (pDevice->bHWRadioOff == true) { if (!(pDevice->byGPIO & GPIO0_DATA)) //||(!(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV))) @@ -1072,7 +1019,6 @@ BSSvSecondCallBack( start: #endif - if (pDevice->wUseProtectCntDown > 0) { pDevice->wUseProtectCntDown--; } else { @@ -1103,7 +1049,6 @@ start: #endif for (ii = 0; ii < (MAX_NODE_NUM + 1); ii++) { - if (pMgmt->sNodeDBTable[ii].bActive) { // Increase in-activity counter pMgmt->sNodeDBTable[ii].uInActiveCount++; @@ -1117,7 +1062,6 @@ start: } if (pMgmt->sNodeDBTable[ii].eNodeState >= NODE_ASSOC) { - pDevice->uAssocCount++; // check if Non ERP exist @@ -1139,7 +1083,6 @@ start: if (pMgmt->sNodeDBTable[ii].bPSEnable) uSleepySTACnt++; - } // Rate fallback check @@ -1180,9 +1123,7 @@ start: } - if ((pMgmt->eCurrMode == WMAC_MODE_ESS_AP) && (pDevice->eCurrentPHYType == PHY_TYPE_11G)) { - // on/off protect mode if (WLAN_GET_ERP_USE_PROTECTION(pDevice->byERPFlag)) { if (!pDevice->bProtectMode) { @@ -1227,7 +1168,6 @@ start: } - // Check if any STA in PS mode, enable DTIM multicast deliver if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { if (uSleepySTACnt > 0) @@ -1241,7 +1181,6 @@ start: if ((pMgmt->eCurrMode == WMAC_MODE_STANDBY) || (pMgmt->eCurrMode == WMAC_MODE_ESS_STA)) { - if (pMgmt->sNodeDBTable[0].bActive) { // Assoc with BSS if (pDevice->bUpdateBBVGA) { // s_vCheckSensitivity((void *) pDevice); @@ -1323,7 +1262,6 @@ start: }; } if (pMgmt->eCurrState == WMAC_STATE_JOINTED) { - if (pDevice->bUpdateBBVGA) { //s_vCheckSensitivity((void *) pDevice); s_vCheckPreEDThreshold((void *)pDevice); @@ -1345,9 +1283,6 @@ start: return; } - - - /*+ * * Routine Description: @@ -1361,8 +1296,6 @@ start: * -*/ - - void BSSvUpdateNodeTxCounter( void *hDeviceContext, @@ -1438,7 +1371,6 @@ BSSvUpdateNodeTxCounter( //for (ii=0;iieCurrMode == WMAC_MODE_IBSS_STA) || (pMgmt->eCurrMode == WMAC_MODE_ESS_AP)) { - pMACHeader = (PS802_11Header)(pbyBuffer + uFIFOHeaderSize); if (BSSDBbIsSTAInNodeDB((void *)pMgmt, &(pMACHeader->abyAddr1[0]), &uNodeIndex)) { @@ -1517,13 +1448,8 @@ BSSvUpdateNodeTxCounter( } return; - - } - - - /*+ * * Routine Description: @@ -1542,7 +1468,6 @@ BSSvUpdateNodeTxCounter( * -*/ - void BSSvClearNodeDBTable( void *hDeviceContext, @@ -1571,7 +1496,6 @@ BSSvClearNodeDBTable( return; }; - void s_vCheckSensitivity( void *hDeviceContext ) @@ -1620,7 +1544,6 @@ void s_vCheckSensitivity( } } - void BSSvClearAnyBSSJoinRecord( void *hDeviceContext @@ -1697,4 +1620,3 @@ void s_vCheckPreEDThreshold( } return; } - diff --git a/drivers/staging/vt6655/bssdb.h b/drivers/staging/vt6655/bssdb.h index 178748d0dad4..5c77677251ed 100644 --- a/drivers/staging/vt6655/bssdb.h +++ b/drivers/staging/vt6655/bssdb.h @@ -67,12 +67,10 @@ #define MAX_WPA_IE_LEN 64 - /*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Variables --------------------------*/ - /*--------------------- Export Types ------------------------------*/ // @@ -88,13 +86,11 @@ typedef enum _NDIS_802_11_NETWORK_TYPE Ndis802_11NetworkTypeMax // not a real type, defined as an upper bound } NDIS_802_11_NETWORK_TYPE, *PNDIS_802_11_NETWORK_TYPE; - typedef struct tagSERPObject { bool bERPExist; unsigned char byERP; } ERPObject, *PERPObject; - typedef struct tagSRSNCapObject { bool bRSNCapExist; unsigned short wRSNCap; @@ -162,7 +158,6 @@ typedef struct tagKnownBSS { ERPObject sERP; SRSNCapObject sRSNCapObj; unsigned char abyIEs[1024]; // don't move this field !! - } __attribute__ ((__packed__)) KnownBSS , *PKnownBSS; @@ -177,7 +172,6 @@ typedef enum tagNODE_STATE { NODE_ASSOC } NODE_STATE, *PNODE_STATE; - // STA node info typedef struct tagKnownNodeDB { // STA info @@ -234,14 +228,10 @@ typedef struct tagKnownNodeDB { unsigned int uTxOk[MAX_RATE+1]; unsigned int uTxFail[MAX_RATE+1]; unsigned int uTimeCount; - } KnownNodeDB, *PKnownNodeDB; - /*--------------------- Export Functions --------------------------*/ - - PKnownBSS BSSpSearchBSSList( void *hDeviceContext, @@ -284,7 +274,6 @@ BSSbInsertToBSSList( void *pRxPacketContext ); - bool BSSbUpdateToBSSList( void *hDeviceContext, @@ -307,7 +296,6 @@ BSSbUpdateToBSSList( void *pRxPacketContext ); - bool BSSDBbIsSTAInNodeDB(void *hDeviceContext, unsigned char *abyDstAddr, unsigned int *puNodeIndex); @@ -323,13 +311,11 @@ BSSvUpdateAPNode( PWLAN_IE_SUPP_RATES pExtSuppRates ); - void BSSvSecondCallBack( void *hDeviceContext ); - void BSSvUpdateNodeTxCounter( void *hDeviceContext, @@ -350,7 +336,6 @@ BSSvAddMulticastNode( void *hDeviceContext ); - void BSSvClearNodeDBTable( void *hDeviceContext, diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c index 9541b68de99d..fbf18e23e78e 100644 --- a/drivers/staging/vt6655/card.c +++ b/drivers/staging/vt6655/card.c @@ -68,7 +68,6 @@ static int msglevel = MSG_LEVEL_INFO; #define C_EIFS 80 // micro sec. - #define C_SLOT_SHORT 9 // micro sec. #define C_SLOT_LONG 20 @@ -88,14 +87,11 @@ static unsigned char abyDefaultSuppRatesA[] = {WLAN_EID_SUPP_RATES, 8, 0x0C, 0x1 //1M, 2M, 5M, 11M, static unsigned char abyDefaultSuppRatesB[] = {WLAN_EID_SUPP_RATES, 4, 0x02, 0x04, 0x0B, 0x16}; - /*--------------------- Static Variables --------------------------*/ - const unsigned short cwRXBCNTSFOff[MAX_RATE] = {17, 17, 17, 17, 34, 23, 17, 11, 8, 5, 4, 3}; - /*--------------------- Static Functions --------------------------*/ static @@ -107,7 +103,6 @@ s_vCalculateOFDMRParameter( unsigned char *pbyRsvTime ); - /*--------------------- Export Functions --------------------------*/ /* @@ -217,8 +212,6 @@ s_vCalculateOFDMRParameter( } } - - /* * Description: Set RSPINF * @@ -375,7 +368,6 @@ s_vSetRSPINF(PSDevice pDevice, CARD_PHY_TYPE ePHYType, void *pvSupportRateIEs, v } */ - /* * Description: Get Card short preamble option value * @@ -415,7 +407,6 @@ bool CARDbIsShorSlotTime(void *pDeviceHandler) return pDevice->bShortSlotTime; } - /* * Description: Update IFS * @@ -440,7 +431,6 @@ bool CARDbSetPhyParameter(void *pDeviceHandler, CARD_PHY_TYPE ePHYType, unsigned PWLAN_IE_SUPP_RATES pSupportRates = (PWLAN_IE_SUPP_RATES) pvSupportRateIEs; PWLAN_IE_SUPP_RATES pExtSupportRates = (PWLAN_IE_SUPP_RATES) pvExtSupportRateIEs; - //Set SIFS, DIFS, EIFS, SlotTime, CwMin if (ePHYType == PHY_TYPE_11A) { if (pSupportRates == NULL) { @@ -635,7 +625,6 @@ bool CARDbUpdateTSF(void *pDeviceHandler, unsigned char byRxRate, QWORD qwBSSTim return true; } - /* * Description: Set NIC TSF counter for first Beacon time * Get NEXTTBTT from adjusted TSF and Beacon Interval @@ -689,8 +678,6 @@ bool CARDbSetBeaconPeriod(void *pDeviceHandler, unsigned short wBeaconInterval) return true; } - - /* * Description: Card Stop Hardware Tx * @@ -708,7 +695,6 @@ bool CARDbStopTxPacket(void *pDeviceHandler, CARD_PKT_TYPE ePktType) { PSDevice pDevice = (PSDevice) pDeviceHandler; - if (ePktType == PKT_TYPE_802_11_ALL) { pDevice->bStopBeacon = true; pDevice->bStopTx0Pkt = true; @@ -748,7 +734,6 @@ bool CARDbStopTxPacket(void *pDeviceHandler, CARD_PKT_TYPE ePktType) return true; } - /* * Description: Card Start Hardware Tx * @@ -766,7 +751,6 @@ bool CARDbStartTxPacket(void *pDeviceHandler, CARD_PKT_TYPE ePktType) { PSDevice pDevice = (PSDevice) pDeviceHandler; - if (ePktType == PKT_TYPE_802_11_ALL) { pDevice->bStopBeacon = false; pDevice->bStopTx0Pkt = false; @@ -788,8 +772,6 @@ bool CARDbStartTxPacket(void *pDeviceHandler, CARD_PKT_TYPE ePktType) return true; } - - /* * Description: Card Set BSSID value * @@ -838,7 +820,6 @@ bool CARDbSetBSSID(void *pDeviceHandler, unsigned char *pbyBSSID, CARD_OP_MODE e return true; } - /* * Description: Card indicate status * @@ -853,9 +834,6 @@ bool CARDbSetBSSID(void *pDeviceHandler, unsigned char *pbyBSSID, CARD_OP_MODE e * */ - - - /* * Description: Save Assoc info. contain in assoc. response frame * @@ -945,9 +923,7 @@ bool CARDbRadioPowerOff(void *pDeviceHandler) if (pDevice->bRadioOff == true) return true; - switch (pDevice->byRFType) { - case RF_RFMD2959: MACvWordRegBitsOff(pDevice->PortOffset, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_TXPEINV); MACvWordRegBitsOn(pDevice->PortOffset, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE1); @@ -973,7 +949,6 @@ bool CARDbRadioPowerOff(void *pDeviceHandler) return bResult; } - /* * Description: Turn on Radio power * @@ -1005,7 +980,6 @@ bool CARDbRadioPowerOn(void *pDeviceHandler) MACvRegBitsOn(pDevice->PortOffset, MAC_REG_HOSTCR, HOSTCR_RXON); switch (pDevice->byRFType) { - case RF_RFMD2959: MACvWordRegBitsOn(pDevice->PortOffset, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_TXPEINV); MACvWordRegBitsOff(pDevice->PortOffset, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE1); @@ -1027,8 +1001,6 @@ bool CARDbRadioPowerOn(void *pDeviceHandler) return bResult; } - - bool CARDbRemoveKey(void *pDeviceHandler, unsigned char *pbyBSSID) { PSDevice pDevice = (PSDevice) pDeviceHandler; @@ -1037,7 +1009,6 @@ bool CARDbRemoveKey(void *pDeviceHandler, unsigned char *pbyBSSID) return true; } - /* * * Description: @@ -1078,7 +1049,6 @@ CARDbAdd_PMKID_Candidate( } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n"); - // Update Old Candidate for (ii = 0; ii < pDevice->gsPMKIDCandidate.NumCandidates; ii++) { pCandidateList = &pDevice->gsPMKIDCandidate.CandidateList[ii]; @@ -1241,7 +1211,6 @@ CARDbStartMeasure( return true; } - /* * * Description: @@ -1284,7 +1253,6 @@ CARDbChannelSwitch( return bResult; } - /* * * Description: @@ -1340,7 +1308,6 @@ CARDbSetQuiet( return true; } - /* * * Description: @@ -1476,7 +1443,6 @@ CARDvSetPowerConstraint( } } - /* * * Description: @@ -1574,11 +1540,8 @@ CARDvSafeResetTx( // set MAC Beacon TX pointer MACvSetCurrBCNTxDescAddr(pDevice->PortOffset, (pDevice->tx_beacon_dma)); - } - - /*+ * * Description: @@ -1602,8 +1565,6 @@ CARDvSafeResetRx( unsigned int uu; PSRxDesc pDesc; - - // initialize RD index pDevice->pCurrRD[0] = &(pDevice->aRD0Ring[0]); pDevice->pCurrRD[1] = &(pDevice->aRD1Ring[0]); @@ -1638,9 +1599,6 @@ CARDvSafeResetRx( pDevice->rd1_pool_dma); } - - - /* * Description: Get response Control frame rate in CCK mode * @@ -1705,7 +1663,6 @@ unsigned short CARDwGetOFDMControlRate(void *pDeviceHandler, unsigned short wRat return (unsigned short)RATE_24M; } - /* * Description: Set RSPINF * @@ -1920,7 +1877,6 @@ void CARDvUpdateBasicTopRate(void *pDeviceHandler) pDevice->byTopCCKBasicRate = byTopCCK; } - /* * Description: Set NIC Tx Basic Rate * @@ -2001,7 +1957,6 @@ void CARDvSetLoopbackMode(unsigned long dwIoBase, unsigned short wLoopbackMode) // set Baseband loopback } - /* * Description: Software Reset NIC * @@ -2025,7 +1980,6 @@ bool CARDbSoftwareReset(void *pDeviceHandler) return true; } - /* * Description: Calculate TSF offset of two TSF input * Get TSF Offset from RxBCN's TSF and local TSF @@ -2063,7 +2017,6 @@ QWORD CARDqGetTSFOffset(unsigned char byRxRate, QWORD qwTSF1, QWORD qwTSF2) return qwTSFOffset; } - /* * Description: Read NIC TSF counter * Get local TSF counter @@ -2096,7 +2049,6 @@ bool CARDbGetCurrentTSF(unsigned long dwIoBase, PQWORD pqwCurrTSF) return true; } - /* * Description: Read NIC TSF counter * Get NEXTTBTT from adjusted TSF and Beacon Interval @@ -2113,7 +2065,6 @@ bool CARDbGetCurrentTSF(unsigned long dwIoBase, PQWORD pqwCurrTSF) */ QWORD CARDqGetNextTBTT(QWORD qwTSF, unsigned short wBeaconInterval) { - unsigned int uLowNextTBTT; unsigned int uHighRemain, uLowRemain; unsigned int uBeaconInterval; @@ -2140,7 +2091,6 @@ QWORD CARDqGetNextTBTT(QWORD qwTSF, unsigned short wBeaconInterval) return qwTSF; } - /* * Description: Set NIC TSF counter for first Beacon time * Get NEXTTBTT from adjusted TSF and Beacon Interval @@ -2157,7 +2107,6 @@ QWORD CARDqGetNextTBTT(QWORD qwTSF, unsigned short wBeaconInterval) */ void CARDvSetFirstNextTBTT(unsigned long dwIoBase, unsigned short wBeaconInterval) { - QWORD qwNextTBTT; HIDWORD(qwNextTBTT) = 0; @@ -2172,7 +2121,6 @@ void CARDvSetFirstNextTBTT(unsigned long dwIoBase, unsigned short wBeaconInterva return; } - /* * Description: Sync NIC TSF counter for Beacon time * Get NEXTTBTT and write to HW @@ -2190,7 +2138,6 @@ void CARDvSetFirstNextTBTT(unsigned long dwIoBase, unsigned short wBeaconInterva */ void CARDvUpdateNextTBTT(unsigned long dwIoBase, QWORD qwTSF, unsigned short wBeaconInterval) { - qwTSF = CARDqGetNextTBTT(qwTSF, wBeaconInterval); // Set NextTBTT VNSvOutPortD(dwIoBase + MAC_REG_NEXTTBTT, LODWORD(qwTSF)); @@ -2201,10 +2148,3 @@ void CARDvUpdateNextTBTT(unsigned long dwIoBase, QWORD qwTSF, unsigned short wBe return; } - - - - - - - diff --git a/drivers/staging/vt6655/card.h b/drivers/staging/vt6655/card.h index e45b2ce58cbe..ac6e2b4d0fd0 100644 --- a/drivers/staging/vt6655/card.h +++ b/drivers/staging/vt6655/card.h @@ -41,7 +41,6 @@ #define CARD_LB_MAC MAKEWORD(MAC_LB_INTERNAL, 0) // PHY must ISO, avoid MAC loopback packet go out #define CARD_LB_PHY MAKEWORD(MAC_LB_EXT, 0) - #define DEFAULT_MSDU_LIFETIME 512 // ms #define DEFAULT_MSDU_LIFETIME_RES_64us 8000 // 64us @@ -79,8 +78,6 @@ typedef enum _CARD_OP_MODE { OP_MODE_UNKNOWN } CARD_OP_MODE, *PCARD_OP_MODE; - - /*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Variables --------------------------*/ @@ -127,7 +124,6 @@ bool CARDbSetTxDataRate( unsigned short wDataRate ); - bool CARDbRemoveKey(void *pDeviceHandler, unsigned char *pbyBSSID); bool @@ -193,6 +189,3 @@ CARDbyGetTransmitPower( ); #endif // __CARD_H__ - - - diff --git a/drivers/staging/vt6655/channel.c b/drivers/staging/vt6655/channel.c index ca852ddfeb06..ba9481fa654f 100644 --- a/drivers/staging/vt6655/channel.c +++ b/drivers/staging/vt6655/channel.c @@ -391,7 +391,6 @@ bool is_channel_valid(unsigned int ChannelIndex) exit: return bValid; - } /** @@ -528,7 +527,6 @@ bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel) PSDevice pDevice = (PSDevice) pDeviceHandler; bool bResult = true; - if (pDevice->byCurrentCh == uConnectionChannel) { return bResult; } @@ -555,7 +553,6 @@ bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel) } //}} RobertYu - pDevice->byCurrentCh = (unsigned char)uConnectionChannel; bResult &= RFbSelectChannel(pDevice->PortOffset, pDevice->byRFType, (unsigned char)uConnectionChannel); @@ -563,7 +560,6 @@ bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel) if (pDevice->bEnablePSMode == true) RFvWriteWakeProgSyn(pDevice->PortOffset, pDevice->byRFType, uConnectionChannel); - //DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "CARDbSetMediaChannel: %d\n", (unsigned char)uConnectionChannel); BBvSoftwareReset(pDevice->PortOffset); @@ -603,7 +599,6 @@ void set_country_info(void *pDeviceHandler, CARD_PHY_TYPE ePHYType, void *pIE) unsigned char byCh = 0; PWLAN_IE_COUNTRY pIE_Country = (PWLAN_IE_COUNTRY) pIE; - uNumOfCountryInfo = (pIE_Country->len - 3); uNumOfCountryInfo /= 3; @@ -652,7 +647,6 @@ unsigned char set_support_channels(void *pDeviceHandler, unsigned char *pbyIEs) unsigned char *pbyChTupple; unsigned char byLen = 0; - pIE->byElementID = WLAN_EID_SUPP_CH; pIE->len = 0; pbyChTupple = pIE->abyChannelTuple; @@ -739,7 +733,6 @@ void set_country_IE(void *pDeviceHandler, void *pIE) bool get_channel_map_info(void *pDeviceHandler, unsigned int uChannelIndex, unsigned char *pbyChannelNumber, unsigned char *pbyMap) { - if (uChannelIndex > CB_MAX_CHANNEL) return false; @@ -751,7 +744,6 @@ bool get_channel_map_info(void *pDeviceHandler, unsigned int uChannelIndex, void set_channel_map_info(void *pDeviceHandler, unsigned int uChannelIndex, unsigned char byMap) { - if (uChannelIndex > CB_MAX_CHANNEL) return; diff --git a/drivers/staging/vt6655/channel.h b/drivers/staging/vt6655/channel.h index f4435a33d44f..c9931d7f6653 100644 --- a/drivers/staging/vt6655/channel.h +++ b/drivers/staging/vt6655/channel.h @@ -35,7 +35,6 @@ typedef struct tagSChannelTblElement { unsigned char byMAP; } SChannelTblElement, *PSChannelTblElement; - /*--------------------- Export Functions --------------------------*/ bool is_channel_valid(unsigned int CountryCode); @@ -54,5 +53,4 @@ void set_channel_map_info(void *pDeviceHandler, unsigned int uChannelIndex, void clear_channel_map_info(void *pDeviceHandler); unsigned char auto_channel_select(void *pDeviceHandler, CARD_PHY_TYPE ePHYType); - #endif /* _CHANNEL_H_ */ diff --git a/drivers/staging/vt6655/datarate.c b/drivers/staging/vt6655/datarate.c index 32e4d4a116eb..e7b6bc7de4ac 100644 --- a/drivers/staging/vt6655/datarate.c +++ b/drivers/staging/vt6655/datarate.c @@ -45,12 +45,8 @@ /*--------------------- Static Definitions -------------------------*/ - - - /*--------------------- Static Classes ----------------------------*/ - extern unsigned short TxRate_iwconfig; //2008-5-8 by chester /*--------------------- Static Variables --------------------------*/ //static int msglevel =MSG_LEVEL_DEBUG; @@ -68,8 +64,6 @@ void s_vResetCounter( PKnownNodeDB psNodeDBTable ); - - void s_vResetCounter( PKnownNodeDB psNodeDBTable @@ -86,10 +80,8 @@ s_vResetCounter( /*--------------------- Export Variables --------------------------*/ - /*--------------------- Export Functions --------------------------*/ - /*+ * * Description: @@ -121,8 +113,6 @@ DATARATEbyGetRateIdx( return 0; } - - /*+ * * Routine Description: @@ -141,9 +131,6 @@ DATARATEbyGetRateIdx( #define AUTORATE_TXCNT_THRESHOLD 20 #define AUTORATE_INC_THRESHOLD 30 - - - /*+ * * Description: @@ -214,7 +201,6 @@ RATEvParseMaxRate( unsigned short wOldBasicRate = pDevice->wBasicRate; unsigned int uRateLen; - if (pItemRates == NULL) return; @@ -247,7 +233,6 @@ RATEvParseMaxRate( } if ((pItemExtRates != NULL) && (pItemExtRates->byElementID == WLAN_EID_EXTSUPP_RATES) && (pDevice->eCurrentPHYType != PHY_TYPE_11B)) { - unsigned int uExtRateLen = pItemExtRates->len; if (uExtRateLen > WLAN_RATES_MAXLEN) @@ -288,7 +273,6 @@ RATEvParseMaxRate( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Exit ParseMaxRate\n"); } - /*+ * * Routine Description: @@ -343,7 +327,6 @@ RATEvTxRateFallBack( psNodeDBTable->uTimeCount = 0; } - for (ii = 0; ii < MAX_RATE; ii++) { if (psNodeDBTable->wSuppRate & (0x0001<wTxDataRate, wIdxUpRate, wIdxDownRate); return; - } /*+ @@ -434,4 +416,3 @@ RATEuSetIE( } return (unsigned char)uRateCnt; } - diff --git a/drivers/staging/vt6655/datarate.h b/drivers/staging/vt6655/datarate.h index d508f56e6699..e4fad05ad859 100644 --- a/drivers/staging/vt6655/datarate.h +++ b/drivers/staging/vt6655/datarate.h @@ -41,19 +41,14 @@ #define RETRY_TIMES_THRD_H 2 // times #define RETRY_TIMES_THRD_L 1 // times - /*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Variables --------------------------*/ - /*--------------------- Export Types ------------------------------*/ - /*--------------------- Export Functions --------------------------*/ - - void RATEvParseMaxRate( void *pDeviceHandler, @@ -85,11 +80,9 @@ wGetRateIdx( unsigned char byRate ); - unsigned char DATARATEbyGetRateIdx( unsigned char byRate ); - #endif //__DATARATE_H__ diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h index 0358386c42f3..32d808ec502a 100644 --- a/drivers/staging/vt6655/desc.h +++ b/drivers/staging/vt6655/desc.h @@ -110,7 +110,6 @@ #define CB_RD_NUM 32 // default # of RD #define CB_TD_NUM 32 // default # of TD - // max number of physical segments // in a single NDIS packet. Above this threshold, the packet // is copied into a single physically contiguous buffer @@ -121,8 +120,6 @@ #define CB_PROTOCOL_RESERVED_SECTION 16 - - // if retrys excess 15 times , tx will abort, and // if tx fifo underflow, tx will fail // we should try to resend it @@ -199,8 +196,6 @@ #define TYPE_RXDMA1 1 #define TYPE_MAXRD 2 - - // TD_INFO flags control bit #define TD_FLAGS_NETIF_SKB 0x01 // check if need release skb #define TD_FLAGS_PRIV_SKB 0x02 // check if called from private skb(hostap) @@ -265,7 +260,6 @@ typedef struct tagRDES0 { } __attribute__ ((__packed__)) SRDES0; - #endif typedef struct tagRDES1 { @@ -328,7 +322,6 @@ STDES0; #endif - typedef struct tagTDES1 { volatile unsigned short wReqCount; volatile unsigned char byTCR; @@ -336,7 +329,6 @@ typedef struct tagTDES1 { } __attribute__ ((__packed__)) STDES1; - typedef struct tagDEVICE_TD_INFO { struct sk_buff *skb; unsigned char *buf; @@ -376,7 +368,6 @@ typedef struct tagSTxDesc { STxDesc, *PSTxDesc; typedef const STxDesc *PCSTxDesc; - typedef struct tagSTxSyncDesc { volatile STDES0 m_td0TD0; volatile STDES1 m_td1TD1; @@ -391,7 +382,6 @@ typedef struct tagSTxSyncDesc { STxSyncDesc, *PSTxSyncDesc; typedef const STxSyncDesc *PCSTxSyncDesc; - // // RsvTime buffer header // @@ -457,7 +447,6 @@ typedef struct tagSRTS_g { SRTS_g, *PSRTS_g; typedef const SRTS_g *PCSRTS_g; - typedef struct tagSRTS_g_FB { unsigned char bySignalField_b; unsigned char byServiceField_b; @@ -478,7 +467,6 @@ typedef struct tagSRTS_g_FB { SRTS_g_FB, *PSRTS_g_FB; typedef const SRTS_g_FB *PCSRTS_g_FB; - typedef struct tagSRTS_ab { unsigned char bySignalField; unsigned char byServiceField; @@ -490,7 +478,6 @@ typedef struct tagSRTS_ab { SRTS_ab, *PSRTS_ab; typedef const SRTS_ab *PCSRTS_ab; - typedef struct tagSRTS_a_FB { unsigned char bySignalField; unsigned char byServiceField; @@ -504,7 +491,6 @@ typedef struct tagSRTS_a_FB { SRTS_a_FB, *PSRTS_a_FB; typedef const SRTS_a_FB *PCSRTS_a_FB; - // // CTS buffer header // @@ -540,7 +526,6 @@ typedef struct tagSCTS_FB { SCTS_FB, *PSCTS_FB; typedef const SCTS_FB *PCSCTS_FB; - // // Tx FIFO header // @@ -597,7 +582,6 @@ typedef struct tagSTxDataHead_g_FB { STxDataHead_g_FB, *PSTxDataHead_g_FB; typedef const STxDataHead_g_FB *PCSTxDataHead_g_FB; - typedef struct tagSTxDataHead_ab { unsigned char bySignalField; unsigned char byServiceField; @@ -608,7 +592,6 @@ typedef struct tagSTxDataHead_ab { STxDataHead_ab, *PSTxDataHead_ab; typedef const STxDataHead_ab *PCSTxDataHead_ab; - typedef struct tagSTxDataHead_a_FB { unsigned char bySignalField; unsigned char byServiceField; @@ -640,7 +623,6 @@ typedef struct tagSBEACONCtl { } __attribute__ ((__packed__)) SBEACONCtl; - typedef struct tagSSecretKey { u32 dwLowDword; unsigned char byHighByte; @@ -666,8 +648,4 @@ SKeyEntry; /*--------------------- Export Functions --------------------------*/ - - - #endif // __DESC_H__ - diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h index 07f5af9740a7..ca1b8578cf79 100644 --- a/drivers/staging/vt6655/device.h +++ b/drivers/staging/vt6655/device.h @@ -87,7 +87,6 @@ #include "key.h" #include "mac.h" - /*--------------------- Export Definitions -------------------------*/ #define MAC_MAX_CONTEXT_REG (256+128) @@ -111,8 +110,6 @@ #define KEYSEL_TKIP 2 #define KEYSEL_CCMP 3 - - #define AUTO_FB_NONE 0 #define AUTO_FB_0 1 #define AUTO_FB_1 2 @@ -133,8 +130,6 @@ #define BB_VGA_LEVEL 4 #define BB_VGA_CHANGE_THRESHOLD 16 - - #ifndef RUN_AT #define RUN_AT(x) (jiffies+(x)) #endif @@ -142,23 +137,18 @@ // DMA related #define RESERV_AC0DMA 4 - // BUILD OBJ mode - #define AVAIL_TD(p, q) ((p)->sOpts.nTxDescs[(q)] - ((p)->iTDUsed[(q)])) //PLICE_DEBUG -> #define NUM 64 //PLICE_DEUBG <- - - #define PRIVATE_Message 0 /*--------------------- Export Types ------------------------------*/ - #define DBG_PRT(l, p, args...) { if (l <= msglevel) printk(p, ##args); } #define PRINT_K(p, args...) { if (PRIVATE_Message) printk(p, ##args); } @@ -179,7 +169,6 @@ typedef enum _VIA_PKT_TYPE PK_TYPE_11GA } VIA_PKT_TYPE, *PVIA_PKT_TYPE; - typedef enum __device_msg_level { MSG_LEVEL_ERR = 0, //Errors that will cause abnormal operation. MSG_LEVEL_NOTICE = 1, //Some errors need users to be notified. @@ -194,7 +183,6 @@ typedef enum __device_init_type { DEVICE_INIT_DXPL // Dx to D0 power lost init } DEVICE_INIT_TYPE, *PDEVICE_INIT_TYPE; - //++ NDIS related #define MAX_BSSIDINFO_4_PMKID 16 @@ -205,7 +193,6 @@ typedef enum __device_init_type { // PMKID Structures typedef unsigned char NDIS_802_11_PMKID_VALUE[16]; - typedef enum _NDIS_802_11_WEP_STATUS { Ndis802_11WEPEnabled, @@ -223,7 +210,6 @@ typedef enum _NDIS_802_11_WEP_STATUS } NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS, NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS; - typedef enum _NDIS_802_11_STATUS_TYPE { Ndis802_11StatusType_Authentication, @@ -238,7 +224,6 @@ typedef struct _PMKID_CANDIDATE { unsigned long Flags; } PMKID_CANDIDATE, *PPMKID_CANDIDATE; - typedef struct _BSSID_INFO { NDIS_802_11_MAC_ADDRESS BSSID; @@ -279,13 +264,11 @@ typedef struct __chip_info_tbl { u32 flags; } CHIP_INFO, *PCHIP_INFO; - typedef enum { OWNED_BY_HOST = 0, OWNED_BY_NIC = 1 } DEVICE_OWNER_TYPE, *PDEVICE_OWNER_TYPE; - // The receive duplicate detection cache entry typedef struct tagSCacheEntry { unsigned short wFmSequence; @@ -314,8 +297,6 @@ typedef struct tagSDeFragControlBlock bool bInUse; } SDeFragControlBlock, *PSDeFragControlBlock; - - //flags for options #define DEVICE_FLAGS_IP_ALIGN 0x00000001UL #define DEVICE_FLAGS_PREAMBLE_TYPE 0x00000002UL @@ -343,10 +324,8 @@ typedef struct tagSDeFragControlBlock //for device_set_media_duplex #define DEVICE_LINK_CHANGE 0x00000001UL - //PLICE_DEBUG-> - typedef struct _RxManagementQueue { int packet_num; @@ -354,11 +333,8 @@ typedef struct _RxManagementQueue PSRxMgmtPacket Q[NUM]; } RxManagementQueue, *PSRxManagementQueue; - - //PLICE_DEBUG<- - typedef struct __device_opt { int nRxDescs0; //Number of RX descriptors0 int nRxDescs1; //Number of RX descriptors1 @@ -374,7 +350,6 @@ typedef struct __device_opt { u32 flags; } OPTIONS, *POPTIONS; - typedef struct __device_info { struct __device_info *next; struct __device_info *prev; @@ -456,7 +431,6 @@ typedef struct __device_info { struct semaphore mlme_semaphore; //PLICE_DEBUG <- - u32 rx_bytes; // Version control @@ -476,7 +450,6 @@ typedef struct __device_info { // 802.11 counter SDot11Counters s802_11Counter; - // 802.11 management PSMgmtObject pMgmt; SMgmtObject sMgmtObj; @@ -507,7 +480,6 @@ typedef struct __device_info { unsigned char byCWMaxMin; CARD_PHY_TYPE eCurrentPHYType; - VIA_BB_TYPE byBBType; //0: 11A, 1:11B, 2:11G VIA_PKT_TYPE byPacketType; //0:11a,1:11b,2:11gb(only CCK in BasicRate),3:11ga(OFDM in Basic Rate) unsigned short wBasicRate; @@ -559,7 +531,6 @@ typedef struct __device_info { bool bPWBitOn; WMAC_POWER_MODE ePSMode; - // GPIO Radio Control unsigned char byRadioCtl; unsigned char byGPIO; @@ -597,8 +568,6 @@ typedef struct __device_info { bool bCmdRunning; bool bCmdClear; - - bool bRoaming; //WOW unsigned char abyIPAddr[4]; @@ -635,16 +604,13 @@ typedef struct __device_info { // for OID_802_11_ASSOCIATION_INFORMATION bool bAssocInfoSet; - unsigned char byAutoFBCtrl; bool bTxMICFail; bool bRxMICFail; - unsigned int uRATEIdx; - // For Update BaseBand VGA Gain Offset bool bUpdateBBVGA; unsigned int uBBVGADiffCount; @@ -656,7 +622,6 @@ typedef struct __device_info { unsigned char byBBPreEDRSSI; unsigned char byBBPreEDIndex; - bool bRadioCmd; unsigned long dwDiagRefCount; @@ -686,7 +651,6 @@ typedef struct __device_info { char abyRegPwr[CB_MAX_CHANNEL+1]; char abyLocalPwr[CB_MAX_CHANNEL+1]; - // BaseBand Loopback Use unsigned char byBBCR4d; unsigned char byBBCRc9; @@ -708,7 +672,6 @@ typedef struct __device_info { unsigned char byReAssocCount; //mike add:re-association retry times! unsigned char byLinkWaitCount; - unsigned char abyNodeName[17]; bool bDiversityRegCtlON; @@ -731,11 +694,9 @@ typedef struct __device_info { struct timer_list TimerSQ3Tmax2; struct timer_list TimerSQ3Tmax3; - unsigned long uNumSQ3[MAX_RATE]; unsigned short wAntDiversityMaxRate; - SEthernetHeader sTxEthHeader; SEthernetHeader sRxEthHeader; unsigned char abyBroadcastAddr[ETH_ALEN]; @@ -746,7 +707,6 @@ typedef struct __device_info { SPMKID gsPMKID; SPMKIDCandidateEvent gsPMKIDCandidate; - // for 802.11h bool b11hEnable; unsigned char abyCountryCode[3]; @@ -806,13 +766,10 @@ typedef struct __device_info { struct iw_statistics wstats; // wireless stats bool bCommit; - } DEVICE_INFO, *PSDevice; - //PLICE_DEBUG-> - inline static void EnQueue(PSDevice pDevice, PSRxMgmtPacket pRxMgmtPacket) { if ((pDevice->rxManeQueue.tail+1) % NUM == pDevice->rxManeQueue.head) { @@ -824,9 +781,6 @@ inline static void EnQueue(PSDevice pDevice, PSRxMgmtPacket pRxMgmtPacket) } } - - - inline static PSRxMgmtPacket DeQueue(PSDevice pDevice) { PSRxMgmtPacket pRxMgmtPacket; @@ -846,15 +800,8 @@ inline static PSRxMgmtPacket DeQueue(PSDevice pDevice) void InitRxManagementQueue(PSDevice pDevice); - - //PLICE_DEBUG<- - - - - - inline static bool device_get_ip(PSDevice pInfo) { struct in_device *in_dev = (struct in_device *)pInfo->dev->ip_ptr; struct in_ifaddr *ifa; @@ -869,8 +816,6 @@ inline static bool device_get_ip(PSDevice pInfo) { return false; } - - static inline PDEVICE_RD_INFO alloc_rd_info(void) { return kzalloc(sizeof(DEVICE_RD_INFO), GFP_ATOMIC); @@ -887,5 +832,3 @@ bool device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, unsigned int uNodeI bool device_alloc_frag_buf(PSDevice pDevice, PSDeFragControlBlock pDeF); int Config_FileOperation(PSDevice pDevice, bool fwrite, unsigned char *Parameter); #endif - - diff --git a/drivers/staging/vt6655/device_cfg.h b/drivers/staging/vt6655/device_cfg.h index c567db0f6f0d..1137adede9ee 100644 --- a/drivers/staging/vt6655/device_cfg.h +++ b/drivers/staging/vt6655/device_cfg.h @@ -70,18 +70,13 @@ struct _version { //Max: 2378=2312Payload + 30HD +4CRC + 2Padding + 4Len + 8TSF + 4RSR #define PKT_BUF_SZ 2390 - #define MAX_UINTS 8 #define OPTION_DEFAULT { [0 ... MAX_UINTS-1] = -1} - - typedef enum _chip_type { VT3253 = 1 } CHIP_TYPE, *PCHIP_TYPE; - - #ifdef VIAWET_DEBUG #define ASSERT(x) \ do { \ @@ -97,5 +92,4 @@ do { \ #define DBG_PORT80(value) #endif - #endif diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index 143d050a5dfb..be4f6c2ca3ff 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -128,7 +128,6 @@ DEVICE_PARAM(TxDescriptors0, "Number of transmit descriptors0"); #define TX_DESC_DEF1 64 DEVICE_PARAM(TxDescriptors1, "Number of transmit descriptors1"); - #define IP_ALIG_DEF 0 /* IP_byte_align[] is used for IP header unsigned long byte aligned 0: indicate the IP header won't be unsigned long byte aligned.(Default) . @@ -138,7 +137,6 @@ DEVICE_PARAM(TxDescriptors1, "Number of transmit descriptors1"); */ 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 @@ -151,7 +149,6 @@ DEVICE_PARAM(int_works, "Number of packets per interrupt services"); DEVICE_PARAM(Channel, "Channel number"); - /* PreambleType[] is the preamble length used for transmit. 0: indicate allows long preamble type 1: indicate allows short preamble type @@ -161,21 +158,18 @@ DEVICE_PARAM(Channel, "Channel number"); DEVICE_PARAM(PreambleType, "Preamble Type"); - #define RTS_THRESH_MIN 512 #define RTS_THRESH_MAX 2347 #define RTS_THRESH_DEF 2347 DEVICE_PARAM(RTSThreshold, "RTS threshold"); - #define FRAG_THRESH_MIN 256 #define FRAG_THRESH_MAX 2346 #define FRAG_THRESH_DEF 2346 DEVICE_PARAM(FragThreshold, "Fragmentation threshold"); - #define DATA_RATE_MIN 0 #define DATA_RATE_MAX 13 #define DATA_RATE_DEF 13 @@ -208,7 +202,6 @@ DEVICE_PARAM(OPMode, "Infrastruct, adhoc, AP mode "); 2: indicate AP mode used */ - /* PSMode[] 0: indicate disable power saving mode 1: indicate enable power saving mode @@ -218,22 +211,18 @@ DEVICE_PARAM(OPMode, "Infrastruct, adhoc, AP mode "); DEVICE_PARAM(PSMode, "Power saving mode"); - #define SHORT_RETRY_MIN 0 #define SHORT_RETRY_MAX 31 #define SHORT_RETRY_DEF 8 - DEVICE_PARAM(ShortRetryLimit, "Short frame retry limits"); #define LONG_RETRY_MIN 0 #define LONG_RETRY_MAX 15 #define LONG_RETRY_DEF 4 - DEVICE_PARAM(LongRetryLimit, "long frame retry limits"); - /* BasebandType[] baseband type selected 0: indicate 802.11a type 1: indicate 802.11b type @@ -245,8 +234,6 @@ DEVICE_PARAM(LongRetryLimit, "long frame retry limits"); DEVICE_PARAM(BasebandType, "baseband type"); - - /* 80211hEnable[] 0: indicate disable 802.11h 1: indicate enable 802.11h @@ -265,12 +252,10 @@ DEVICE_PARAM(b80211hEnable, "802.11h mode"); DEVICE_PARAM(bDiversityANTEnable, "ANT diversity mode"); - // // Static vars definitions // - static int device_nics = 0; static PSDevice pDevice_Infos = NULL; static struct net_device *root_device_dev = NULL; @@ -288,7 +273,6 @@ DEFINE_PCI_DEVICE_TABLE(vt6655_pci_id_table) = { /*--------------------- Static Functions --------------------------*/ - 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 device_free_info(PSDevice pDevice); @@ -314,7 +298,6 @@ struct notifier_block device_notifier = { }; #endif - static void device_init_rd0_ring(PSDevice pDevice); static void device_init_rd1_ring(PSDevice pDevice); static void device_init_defrag_cb(PSDevice pDevice); @@ -340,13 +323,10 @@ static void device_free_frag_buf(PSDevice pDevice); static int Config_FileGetParameter(unsigned char *string, unsigned char *dest, unsigned char *source); - /*--------------------- Export Variables --------------------------*/ /*--------------------- Export Functions --------------------------*/ - - static char *get_chip_name(int chip_id) { int i; @@ -363,7 +343,6 @@ static void vt6655_remove(struct pci_dev *pcid) if (pDevice == NULL) return; device_free_info(pDevice); - } /* @@ -425,12 +404,10 @@ static void device_get_options(PSDevice pDevice, int index, char *devname) static void device_set_options(PSDevice pDevice) { - unsigned char abyBroadcastAddr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; unsigned char abySNAP_RFC1042[ETH_ALEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00}; unsigned char abySNAP_Bridgetunnel[ETH_ALEN] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0xF8}; - memcpy(pDevice->abyBroadcastAddr, abyBroadcastAddr, ETH_ALEN); memcpy(pDevice->abySNAP_RFC1042, abySNAP_RFC1042, ETH_ALEN); memcpy(pDevice->abySNAP_Bridgetunnel, abySNAP_Bridgetunnel, ETH_ALEN); @@ -460,7 +437,6 @@ device_set_options(PSDevice pDevice) { 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); @@ -511,11 +487,8 @@ static void s_vCompleteCurrentMeasure(PSDevice pDevice, unsigned char byResult) ); CARDbStartMeasure(pDevice, pDevice->pCurrMeasureEID++, pDevice->uNumOfMeasureEIDs); } - } - - // // Initialisation of MAC & BBP registers // @@ -679,7 +652,6 @@ static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType) // 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) { @@ -704,7 +676,6 @@ static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType) } } - // 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)); @@ -712,14 +683,12 @@ static void device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType) } init_channel_table((void *)pDevice); - if (pDevice->byLocalID > REV_ID_VT3253_B1) { MACvSelectPage1(pDevice->PortOffset); VNSvOutPortB(pDevice->PortOffset + MAC_REG_MSRCTL + 1, (MSRCTL1_TXPWR | MSRCTL1_CSAPAREN)); MACvSelectPage0(pDevice->PortOffset); } - // use relative tx timeout and 802.11i D4 MACvWordRegBitsOn(pDevice->PortOffset, MAC_REG_CFG, (CFG_TKIPOPT | CFG_NOTXTIMEOUT)); @@ -812,14 +781,9 @@ MACvReceive1(pDevice->PortOffset); MACvStart(pDevice->PortOffset); netif_stop_queue(pDevice->dev); - - } - - static void device_init_diversity_timer(PSDevice pDevice) { - init_timer(&pDevice->TimerSQ3Tmax1); pDevice->TimerSQ3Tmax1.data = (unsigned long) pDevice; pDevice->TimerSQ3Tmax1.function = (TimerFunction)TimerSQ3CallBack; @@ -838,7 +802,6 @@ static void device_init_diversity_timer(PSDevice pDevice) { return; } - static bool device_release_WPADEV(PSDevice pDevice) { viawget_wpa_header *wpahdr; @@ -895,7 +858,6 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent) return -ENODEV; } - dev = alloc_etherdev(sizeof(DEVICE_INFO)); pDevice = (PSDevice) netdev_priv(dev); @@ -977,7 +939,6 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent) } #endif - #endif #ifdef DEBUG @@ -992,9 +953,6 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent) return -ENODEV; } - - - rc = pci_request_regions(pcid, DEVICE_NAME); if (rc) { printk(KERN_ERR DEVICE_NAME ": Failed to find PCI device\n"); @@ -1014,8 +972,6 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent) printk("After write: value is %x\n", value); #endif - - #ifdef IO_MAP pDevice->PortOffset = pDevice->ioaddr; #endif @@ -1054,7 +1010,6 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent) device_print_info(pDevice); pci_set_drvdata(pcid, pDevice); return 0; - } static void device_print_info(PSDevice pDevice) @@ -1071,12 +1026,10 @@ static void device_print_info(PSDevice pDevice) (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, PCHIP_INFO pChip_info) { - PSDevice p; memset(*ppDevice, 0, sizeof(DEVICE_INFO)); @@ -1100,7 +1053,6 @@ static void vt6655_init_info(struct pci_dev *pcid, PSDevice *ppDevice, } static bool device_get_pci_info(PSDevice pDevice, struct pci_dev *pcid) { - u16 pci_cmd; u8 b; unsigned int cis_addr; @@ -1209,7 +1161,6 @@ static void device_free_info(PSDevice pDevice) { static bool device_init_rings(PSDevice pDevice) { void *vir_pool; - /*allocate all RD/TD rings a single pool*/ vir_pool = pci_alloc_consistent(pDevice->pcid, pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) + @@ -1234,7 +1185,6 @@ static bool device_init_rings(PSDevice pDevice) { pDevice->aRD1Ring = vir_pool + pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc); - pDevice->rd0_pool_dma = pDevice->pool_dma; pDevice->rd1_pool_dma = pDevice->rd0_pool_dma + pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc); @@ -1271,7 +1221,6 @@ static bool device_init_rings(PSDevice pDevice) { pDevice->td1_pool_dma = pDevice->td0_pool_dma + pDevice->sOpts.nTxDescs[0] * sizeof(STxDesc); - // vir_pool: pvoid type pDevice->apTD0Rings = vir_pool + pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) @@ -1282,11 +1231,9 @@ static bool device_init_rings(PSDevice pDevice) { + pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) + pDevice->sOpts.nTxDescs[0] * sizeof(STxDesc); - pDevice->tx1_bufs = pDevice->tx0_bufs + pDevice->sOpts.nTxDescs[0] * PKT_BUF_SZ; - pDevice->tx_beacon_bufs = pDevice->tx1_bufs + pDevice->sOpts.nTxDescs[1] * PKT_BUF_SZ; @@ -1296,16 +1243,13 @@ static bool device_init_rings(PSDevice pDevice) { pDevice->tx_bufs_dma1 = pDevice->tx_bufs_dma0 + pDevice->sOpts.nTxDescs[0] * PKT_BUF_SZ; - pDevice->tx_beacon_dma = pDevice->tx_bufs_dma1 + pDevice->sOpts.nTxDescs[1] * PKT_BUF_SZ; - return true; } static void device_free_rings(PSDevice pDevice) { - pci_free_consistent(pDevice->pcid, pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) + pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) + @@ -1349,7 +1293,6 @@ static void device_init_rd0_ring(PSDevice pDevice) { pDevice->pCurrRD[0] = &(pDevice->aRD0Ring[0]); } - static void device_init_rd1_ring(PSDevice pDevice) { int i; dma_addr_t curr = pDevice->rd1_pool_dma; @@ -1374,7 +1317,6 @@ static void device_init_rd1_ring(PSDevice pDevice) { pDevice->pCurrRD[1] = &(pDevice->aRD1Ring[0]); } - static void device_init_defrag_cb(PSDevice pDevice) { int i; PSDeFragControlBlock pDeF; @@ -1391,9 +1333,6 @@ static void device_init_defrag_cb(PSDevice pDevice) { pDevice->cbFreeDFCB = pDevice->cbDFCB; } - - - static void device_free_rd0_ring(PSDevice pDevice) { int i; @@ -1408,13 +1347,11 @@ static void device_free_rd0_ring(PSDevice pDevice) { kfree((void *)pDesc->pRDInfo); } - } static void device_free_rd1_ring(PSDevice pDevice) { int i; - for (i = 0; i < pDevice->sOpts.nRxDescs1; i++) { PSRxDesc pDesc = &(pDevice->aRD1Ring[i]); PDEVICE_RD_INFO pRDInfo = pDesc->pRDInfo; @@ -1426,7 +1363,6 @@ static void device_free_rd1_ring(PSDevice pDevice) { kfree((void *)pDesc->pRDInfo); } - } static void device_free_frag_buf(PSDevice pDevice) { @@ -1434,14 +1370,12 @@ static void device_free_frag_buf(PSDevice pDevice) { int i; for (i = 0; i < CB_MAX_RX_FRAG; i++) { - pDeF = &(pDevice->sRxDFCB[i]); if (pDeF->skb) dev_kfree_skb(pDeF->skb); } - } static void device_init_td0_ring(PSDevice pDevice) { @@ -1466,7 +1400,6 @@ static void device_init_td0_ring(PSDevice pDevice) { 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]); - } static void device_init_td1_ring(PSDevice pDevice) { @@ -1494,8 +1427,6 @@ static void device_init_td1_ring(PSDevice pDevice) { pDevice->apTailTD[1] = pDevice->apCurrTD[1] = &(pDevice->apTD1Rings[0]); } - - static void device_free_td0_ring(PSDevice pDevice) { int i; for (i = 0; i < pDevice->sOpts.nTxDescs[0]; i++) { @@ -1529,18 +1460,14 @@ static void device_free_td1_ring(PSDevice pDevice) { kfree((void *)pDesc->pTDInfo); } - } - - /*-----------------------------------------------------------------*/ static int device_rx_srv(PSDevice pDevice, unsigned int uIdx) { PSRxDesc pRD; int works = 0; - for (pRD = pDevice->pCurrRD[uIdx]; pRD->m_rd0RD0.f1Owner == OWNED_BY_HOST; pRD = pRD->next) { @@ -1563,12 +1490,9 @@ static int device_rx_srv(PSDevice pDevice, unsigned int uIdx) { return works; } - static bool device_alloc_rx_buf(PSDevice pDevice, PSRxDesc pRD) { - PDEVICE_RD_INFO pRDInfo = pRD->pRDInfo; - pRDInfo->skb = dev_alloc_skb((int)pDevice->rx_buf_sz); if (pRDInfo->skb == NULL) return false; @@ -1586,10 +1510,7 @@ static bool device_alloc_rx_buf(PSDevice pDevice, PSRxDesc pRD) { return true; } - - bool device_alloc_frag_buf(PSDevice pDevice, PSDeFragControlBlock pDeF) { - pDeF->skb = dev_alloc_skb((int)pDevice->rx_buf_sz); if (pDeF->skb == NULL) return false; @@ -1599,8 +1520,6 @@ bool device_alloc_frag_buf(PSDevice pDevice, PSDeFragControlBlock pDeF) { return true; } - - static int device_tx_srv(PSDevice pDevice, unsigned int uIdx) { PSTxDesc pTD; bool bFull = false; @@ -1614,9 +1533,7 @@ static int device_tx_srv(PSDevice pDevice, unsigned int uIdx) { unsigned int uNodeIndex; PSMgmtObject pMgmt = pDevice->pMgmt; - for (pTD = pDevice->apTailTD[uIdx]; pDevice->iTDUsed[uIdx] > 0; pTD = pTD->next) { - if (pTD->m_td0TD0.f1Owner == OWNED_BY_NIC) break; if (works++ > 15) @@ -1627,7 +1544,6 @@ static int device_tx_srv(PSDevice pDevice, unsigned int uIdx) { //Only the status of first TD in the chain is correct if (pTD->m_td1TD1.byTCR & TCR_STP) { - if ((pTD->pTDInfo->byFlags & TD_FLAGS_NETIF_SKB) != 0) { uFIFOHeaderSize = pTD->pTDInfo->dwHeaderLength; uFrameSize = pTD->pTDInfo->dwReqCount - uFIFOHeaderSize; @@ -1640,7 +1556,6 @@ static int device_tx_srv(PSDevice pDevice, unsigned int uIdx) { (unsigned char *)(pTD->pTDInfo->buf + uFIFOHeaderSize), uFrameSize, uIdx); - BSSvUpdateNodeTxCounter(pDevice, byTsr0, byTsr1, (unsigned char *)(pTD->pTDInfo->buf), @@ -1714,7 +1629,6 @@ static int device_tx_srv(PSDevice pDevice, unsigned int uIdx) { } } - if (uIdx == TYPE_AC0DMA) { // RESERV_AC0DMA reserved for relay @@ -1727,15 +1641,12 @@ static int device_tx_srv(PSDevice pDevice, unsigned int uIdx) { } } - pDevice->apTailTD[uIdx] = pTD; return works; } - static void device_error(PSDevice pDevice, unsigned short status) { - if (status & ISR_FETALERR) { DBG_PRT(MSG_LEVEL_ERR, KERN_ERR "%s: Hardware fatal error.\n", @@ -1747,7 +1658,6 @@ static void device_error(PSDevice pDevice, unsigned short status) { MACbShutdown(pDevice->PortOffset); return; } - } static void device_free_tx_buf(PSDevice pDevice, PSTxDesc pDesc) { @@ -1768,8 +1678,6 @@ static void device_free_tx_buf(PSDevice pDevice, PSTxDesc pDesc) { pTDInfo->byFlags = 0; } - - //PLICE_DEBUG -> void InitRxManagementQueue(PSDevice pDevice) { @@ -1778,10 +1686,6 @@ void InitRxManagementQueue(PSDevice pDevice) } //PLICE_DEBUG<- - - - - //PLICE_DEBUG -> int MlmeThread( void *Context) @@ -1794,7 +1698,6 @@ int MlmeThread( //i = 0; #if 1 while (1) { - //down(&pDevice->mlme_semaphore); // pRxMgmtPacket = DeQueue(pDevice); #if 1 @@ -1817,11 +1720,8 @@ int MlmeThread( #endif return 0; - } - - static int device_open(struct net_device *dev) { PSDevice pDevice = (PSDevice)netdev_priv(dev); int i; @@ -1854,7 +1754,6 @@ static int device_open(struct net_device *dev) { device_init_td1_ring(pDevice); // VNTWIFIvSet11h(pDevice->pMgmt, pDevice->b11hEnable); - if (pDevice->bDiversityRegCtlON) { device_init_diversity_timer(pDevice); } @@ -1877,13 +1776,8 @@ static int device_open(struct net_device *dev) { mlme_kill = 1; #endif - - //wait_for_completion(&pDevice->notify); - - - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "call device_init_registers\n"); device_init_registers(pDevice, DEVICE_INIT_COLD); MACvReadEtherAddress(pDevice->PortOffset, pDevice->abyCurrentNetAddr); @@ -1935,7 +1829,6 @@ static int device_open(struct net_device *dev) { return 0; } - static int device_close(struct net_device *dev) { PSDevice pDevice = (PSDevice)netdev_priv(dev); PSMgmtObject pMgmt = pDevice->pMgmt; @@ -1990,14 +1883,11 @@ static int device_close(struct net_device *dev) { return 0; } - - static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev) { PSDevice pDevice = netdev_priv(dev); unsigned char *pbMPDU; unsigned int cbMPDULen = 0; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_dma0_tx_80211\n"); spin_lock_irq(&pDevice->lock); @@ -2022,11 +1912,8 @@ static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev) { spin_unlock_irq(&pDevice->lock); return 0; - } - - bool device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, unsigned int uNodeIndex) { PSMgmtObject pMgmt = pDevice->pMgmt; PSTxDesc pHeadTD, pLastTD; @@ -2040,7 +1927,6 @@ bool device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, unsigned int uNodeI SKeyItem STempKey; // unsigned char byKeyIndex = 0; - if (pDevice->bStopTx0Pkt == true) { dev_kfree_skb_irq(skb); return false; @@ -2079,7 +1965,6 @@ bool device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, unsigned int uNodeI } byPktType = (unsigned char)pDevice->byPacketType; - if (pDevice->bFixRate) { if (pDevice->eCurrentPHYType == PHY_TYPE_11B) { if (pDevice->uConnectionRate >= RATE_11M) { @@ -2106,7 +1991,6 @@ bool device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, unsigned int uNodeI DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dma0: pDevice->wCurrentRate = %d \n", pDevice->wCurrentRate); - if (pDevice->wCurrentRate <= RATE_11M) { byPktType = PK_TYPE_11B; } else if (pDevice->eCurrentPHYType == PHY_TYPE_11A) { @@ -2169,7 +2053,6 @@ bool device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, unsigned int uNodeI MACvTransmit0(pDevice->PortOffset); - return true; } @@ -2195,8 +2078,6 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { unsigned char *pbyBSSID; bool bNodeExist = false; - - spin_lock_irq(&pDevice->lock); if (pDevice->bLinkPass == false) { dev_kfree_skb_irq(skb); @@ -2210,7 +2091,6 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { return 0; } - if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { if (pDevice->uAssocCount == 0) { dev_kfree_skb_irq(skb); @@ -2265,7 +2145,6 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { pHeadTD->m_td1TD1.byTCR = (TCR_EDP|TCR_STP); - memcpy(pDevice->sTxEthHeader.abyDstAddr, (unsigned char *)(skb->data), ETH_HLEN); cbFrameBodySize = skb->len - ETH_HLEN; // 802.1H @@ -2273,7 +2152,6 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { cbFrameBodySize += 8; } - if (pDevice->bEncryptionEnable == true) { bNeedEncryption = true; // get Transmit key @@ -2294,7 +2172,6 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { break; } } 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++) @@ -2402,7 +2279,6 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { &(pDevice->byTopCCKBasicRate), &(pDevice->byTopOFDMBasicRate)); - } } @@ -2464,7 +2340,6 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { } } - vGenerateFIFOHeader(pDevice, byPktType, pDevice->pbyTmpBuff, bNeedEncryption, cbFrameBodySize, TYPE_AC0DMA, pHeadTD, &pDevice->sTxEthHeader, (unsigned char *)skb->data, pTransmitKey, uNodeIndex, @@ -2545,7 +2420,6 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) { spin_unlock_irq(&pDevice->lock); return 0; - } static irqreturn_t device_intr(int irq, void *dev_instance) { @@ -2561,7 +2435,6 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { int ii = 0; // unsigned char byRSSI; - MACvReadISR(pDevice->PortOffset, &pDevice->dwIsr); if (pDevice->dwIsr == 0) @@ -2601,7 +2474,6 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { // update ISR counter STAvUpdate802_11Counter(&pDevice->s802_11Counter, &pDevice->scStatistic , dwMIBCounter); while (pDevice->dwIsr != 0) { - STAvUpdateIsrStatCounter(&pDevice->scStatistic, pDevice->dwIsr); MACvWriteISR(pDevice->PortOffset, pDevice->dwIsr); @@ -2613,7 +2485,6 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { } if (pDevice->byLocalID > REV_ID_VT3253_B1) { - if (pDevice->dwIsr & ISR_MEASURESTART) { // 802.11h measure start pDevice->byOrgChannel = pDevice->byCurrentCh; @@ -2743,7 +2614,6 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { if ((pDevice->eOPMode == OP_MODE_AP) || (pDevice->eOPMode == OP_MODE_ADHOC)) { - MACvOneShotTimer1MicroSec(pDevice->PortOffset, (pMgmt->wIBSSBeaconPeriod - MAKE_BEACON_RESERVED) << 10); } @@ -2755,7 +2625,6 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { } if (pDevice->dwIsr & ISR_BNTX) { - if (pDevice->eOPMode == OP_MODE_ADHOC) { pDevice->bIsBeaconBufReadySet = false; pDevice->cbBeaconBufReadySetCnt = 0; @@ -2805,7 +2674,6 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { max_count += device_tx_srv(pDevice, TYPE_AC0DMA); } if (pDevice->dwIsr & ISR_SOFTTIMER) { - } if (pDevice->dwIsr & ISR_SOFTTIMER1) { if (pDevice->eOPMode == OP_MODE_AP) { @@ -2837,7 +2705,6 @@ static irqreturn_t device_intr(int irq, void *dev_instance) { return IRQ_RETVAL(handled); } - static unsigned const ethernet_polynomial = 0x04c11db7U; static inline u32 ether_crc(int length, unsigned char *data) { @@ -2950,8 +2817,6 @@ error2: return result; } - - static void device_set_multi(struct net_device *dev) { PSDevice pDevice = (PSDevice)netdev_priv(dev); @@ -2959,7 +2824,6 @@ static void device_set_multi(struct net_device *dev) { u32 mc_filter[2]; struct netdev_hw_addr *ha; - VNSvInPortB(pDevice->PortOffset + MAC_REG_RCR, &(pDevice->byRxMode)); if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ @@ -2997,15 +2861,12 @@ static void device_set_multi(struct net_device *dev) { 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); return &pDevice->stats; } - - static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { PSDevice pDevice = (PSDevice)netdev_priv(dev); @@ -3014,14 +2875,12 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { PSMgmtObject pMgmt = pDevice->pMgmt; PSCmdRequest pReq; - if (pMgmt == NULL) { rc = -EFAULT; return rc; } switch (cmd) { - case SIOCGIWNAME: rc = iwctl_giwname(dev, NULL, (char *)&(wrq->u.name), NULL); break; @@ -3059,7 +2918,6 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { } break; - // Get current network name (ESSID) case SIOCGIWESSID: @@ -3080,13 +2938,11 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { rc = iwctl_siwap(dev, NULL, &(wrq->u.ap_addr), NULL); break; - // Get current Access Point (BSSID) case SIOCGIWAP: rc = iwctl_giwap(dev, NULL, &(wrq->u.ap_addr), NULL); break; - // Set desired station name case SIOCSIWNICKN: DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWNICKN \n"); @@ -3149,8 +3005,6 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { char abyKey[WLAN_WEP232_KEYLEN]; if (wrq->u.encoding.pointer) { - - if (wrq->u.encoding.length > WLAN_WEP232_KEYLEN) { rc = -E2BIG; break; @@ -3230,13 +3084,11 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { rc = iwctl_giwpower(dev, NULL, &(wrq->u.power), NULL); break; - case SIOCSIWPOWER: rc = iwctl_siwpower(dev, NULL, &(wrq->u.power), NULL); break; - case SIOCGIWSENS: rc = iwctl_giwsens(dev, NULL, &(wrq->u.sens), NULL); @@ -3263,7 +3115,6 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { } break; - #ifdef WIRELESS_SPY // Set the spy list case SIOCSIWSPY: @@ -3296,7 +3147,6 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { */ break; - //2008-0409-07, by Einsn Liu #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT case SIOCSIWAUTH: @@ -3390,7 +3240,6 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { case IOCTL_CMD_HOSTAPD: - rc = vt6655_hostap_ioctl(pDevice, &wrq->u.data); break; @@ -3407,7 +3256,6 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { rc = -EOPNOTSUPP; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Ioctl command not support..%x\n", cmd); - } if (pDevice->bCommit) { @@ -3437,7 +3285,6 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { return rc; } - static int ethtool_ioctl(struct net_device *dev, void *useraddr) { u32 ethcmd; @@ -3479,7 +3326,6 @@ static int __init vt6655_init_module(void) { int ret; - // ret=pci_module_init(&device_driver); //ret = pcie_port_service_register(&device_driver); ret = pci_register_driver(&device_driver); @@ -3493,19 +3339,15 @@ static int __init vt6655_init_module(void) static void __exit vt6655_cleanup_module(void) { - - #ifdef CONFIG_PM unregister_reboot_notifier(&device_notifier); #endif pci_unregister_driver(&device_driver); - } module_init(vt6655_init_module); module_exit(vt6655_cleanup_module); - #ifdef CONFIG_PM static int device_notify_reboot(struct notifier_block *nb, unsigned long event, void *p) @@ -3560,7 +3402,6 @@ viawget_resume(struct pci_dev *pcid) PSMgmtObject pMgmt = pDevice->pMgmt; int power_status; // to silence the compiler - power_status = pci_set_power_state(pcid, 0); power_status = pci_enable_wake(pcid, 0, 0); pci_restore_state(pcid); @@ -3591,7 +3432,3 @@ viawget_resume(struct pci_dev *pcid) } #endif - - - - diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c index e078aa314d05..a9533f3f2529 100644 --- a/drivers/staging/vt6655/dpc.c +++ b/drivers/staging/vt6655/dpc.c @@ -55,8 +55,6 @@ #include "iowpa.h" #include "aes_ccmp.h" - - /*--------------------- Static Definitions -------------------------*/ /*--------------------- Static Classes ----------------------------*/ @@ -68,7 +66,6 @@ static int msglevel = MSG_LEVEL_INFO; const unsigned char acbyRxRate[MAX_RATE] = {2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108}; - /*--------------------- Static Functions --------------------------*/ /*--------------------- Static Definitions -------------------------*/ @@ -77,7 +74,6 @@ const unsigned char acbyRxRate[MAX_RATE] = static unsigned char s_byGetRateIdx(unsigned char byRate); - static void s_vGetDASA(unsigned char *pbyRxBufferAddr, unsigned int *pcbHeaderSize, PSEthernetHeader psEthHeader); @@ -93,8 +89,6 @@ static bool s_bAPModeRxCtl( int iSANodeIndex ); - - static bool s_bAPModeRxData( PSDevice pDevice, struct sk_buff *skb, @@ -104,7 +98,6 @@ static bool s_bAPModeRxData( int iDANodeIndex ); - static bool s_bHandleRxEncryption( PSDevice pDevice, unsigned char *pbyFrame, @@ -162,7 +155,6 @@ s_vProcessRxMACHeader(PSDevice pDevice, unsigned char *pbyRxBufferAddr, PS802_11Header pMACHeader; int ii; - pMACHeader = (PS802_11Header) (pbyRxBufferAddr + cbHeaderSize); s_vGetDASA((unsigned char *)pMACHeader, &cbHeaderSize, &pDevice->sRxEthHeader); @@ -223,9 +215,6 @@ s_vProcessRxMACHeader(PSDevice pDevice, unsigned char *pbyRxBufferAddr, *pcbHeadSize = cbHeaderSize; } - - - static unsigned char s_byGetRateIdx(unsigned char byRate) { unsigned char byRateIdx; @@ -237,7 +226,6 @@ static unsigned char s_byGetRateIdx(unsigned char byRate) return 0; } - static void s_vGetDASA(unsigned char *pbyRxBufferAddr, unsigned int *pcbHeaderSize, PSEthernetHeader psEthHeader) @@ -279,9 +267,6 @@ s_vGetDASA(unsigned char *pbyRxBufferAddr, unsigned int *pcbHeaderSize, *pcbHeaderSize = cbHeaderSize; } - - - //PLICE_DEBUG -> void MngWorkItem(void *Context) @@ -297,18 +282,14 @@ void MngWorkItem(void *Context) spin_unlock_irq(&pDevice->lock); } - //PLICE_DEBUG<- - - bool device_receive_frame( PSDevice pDevice, PSRxDesc pCurrRD ) { - PDEVICE_RD_INFO pRDInfo = pCurrRD->pRDInfo; struct net_device_stats *pStats = &pDevice->stats; struct sk_buff *skb; @@ -350,7 +331,6 @@ device_receive_frame( skb = pRDInfo->skb; - //PLICE_DEBUG-> #if 1 pci_unmap_single(pDevice->pcid, pRDInfo->skb_dma, @@ -436,7 +416,6 @@ device_receive_frame( } } - // Use for TKIP MIC s_vGetDASA(skb->data+4, &cbHeaderSize, &pDevice->sRxEthHeader); @@ -461,7 +440,6 @@ device_receive_frame( } } - if (IS_FC_WEP(pbyFrame)) { bool bRxDecryOK = false; @@ -509,7 +487,6 @@ device_receive_frame( (pDevice->pMgmt->eAuthenMode == WMAC_AUTH_WPANONE) || (pDevice->pMgmt->eAuthenMode == WMAC_AUTH_WPA2) || (pDevice->pMgmt->eAuthenMode == WMAC_AUTH_WPA2PSK)) { - if ((pKey != NULL) && (pKey->byCipherSuite == KEY_CTL_TKIP)) { pDevice->s802_11Counter.TKIPICVErrors++; } else if ((pKey != NULL) && (pKey->byCipherSuite == KEY_CTL_CCMP)) { @@ -530,7 +507,6 @@ device_receive_frame( FrameSize -= 4; // 4 is ICV } - // // RX OK // @@ -553,7 +529,6 @@ device_receive_frame( } } - // Management & Control frame Handle if ((IS_TYPE_DATA((skb->data+4))) == false) { // Handle Control & Manage Frame @@ -665,10 +640,8 @@ device_receive_frame( } } - // Data frame Handle - if (pDevice->bEnablePSMode) { if (IS_FC_MOREDATA((skb->data+4))) { if (*pbyRsr & RSR_ADDROK) { @@ -688,7 +661,6 @@ device_receive_frame( BBvAntennaDiversity(pDevice, s_byGetRateIdx(*pbyRxRate), 0); } - if (pDevice->byLocalID != REV_ID_VT3253_B1) { pDevice->uCurrRSSI = *pbyRSSI; } @@ -747,7 +719,6 @@ device_receive_frame( return false; } - if ((pKey != NULL) && (pKey->byCipherSuite == KEY_CTL_TKIP)) { if (bIsWEP) { FrameSize -= 8; //MIC @@ -766,7 +737,6 @@ device_receive_frame( unsigned long dwLocalMIC_R = 0; viawget_wpa_header *wpahdr; - if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { dwMICKey0 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[24])); dwMICKey1 = cpu_to_le32(*(unsigned long *)(&pKey->abyKey[28])); @@ -799,7 +769,6 @@ device_receive_frame( //DBG_PRN_GRP12(("LocalL: %lx, LocalR: %lx\n", dwLocalMIC_L, dwLocalMIC_R)); //DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dwMICKey0= %lx,dwMICKey1= %lx \n", dwMICKey0, dwMICKey1); - if ((cpu_to_le32(*pdwMIC_L) != dwLocalMIC_L) || (cpu_to_le32(*pdwMIC_R) != dwLocalMIC_R) || (pDevice->bRxMICFail == true)) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MIC comparison is fail!\n"); @@ -838,7 +807,6 @@ device_receive_frame( } #endif - if ((pDevice->bWPADEVUp) && (pDevice->skb != NULL)) { wpahdr = (viawget_wpa_header *)pDevice->skb->data; if ((pDevice->pMgmt->eCurrMode == WMAC_MODE_ESS_STA) && @@ -912,13 +880,10 @@ device_receive_frame( } } // ----- End of Reply Counter Check -------------------------- - - if ((pKey != NULL) && (bIsWEP)) { // pDevice->s802_11Counter.DecryptSuccessCount.QuadPart++; } - s_vProcessRxMACHeader(pDevice, (unsigned char *)(skb->data+4), FrameSize, bIsWEP, bExtIV, &cbHeaderOffset); FrameSize -= cbHeaderOffset; cbHeaderOffset += 4; // 4 is Rcv buffer header @@ -935,7 +900,6 @@ device_receive_frame( iSANodeIndex, iDANodeIndex ) == false) { - if (bDeFragRx) { if (!device_alloc_frag_buf(pDevice, &pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx])) { DBG_PRT(MSG_LEVEL_ERR, KERN_ERR "%s: can not alloc more frag bufs\n", @@ -951,7 +915,6 @@ device_receive_frame( skb_put(skb, FrameSize); skb->protocol = eth_type_trans(skb, skb->dev); - //drop frame not met IEEE 802.3 /* if (pDevice->flags & DEVICE_FLAGS_VAL_PKT_LEN) { @@ -986,7 +949,6 @@ device_receive_frame( return true; } - static bool s_bAPModeRxCtl( PSDevice pDevice, unsigned char *pbyFrame, @@ -997,12 +959,9 @@ static bool s_bAPModeRxCtl( CMD_STATUS Status; PSMgmtObject pMgmt = pDevice->pMgmt; - if (IS_CTL_PSPOLL(pbyFrame) || !IS_TYPE_CONTROL(pbyFrame)) { - p802_11Header = (PS802_11Header)(pbyFrame); if (!IS_TYPE_MGMT(pbyFrame)) { - // Data & PS-Poll packet // check frame class if (iSANodeIndex > 0) { @@ -1086,7 +1045,6 @@ static bool s_bAPModeRxCtl( } } return false; - } static bool s_bHandleRxEncryption( @@ -1108,7 +1066,6 @@ static bool s_bHandleRxEncryption( unsigned char byDecMode = KEY_CTL_WEP; PSMgmtObject pMgmt = pDevice->pMgmt; - *pwRxTSC15_0 = 0; *pdwRxTSC47_16 = 0; @@ -1234,7 +1191,6 @@ static bool s_bHandleRxEncryption( return true; } - static bool s_bHostWepRxEncryption( PSDevice pDevice, unsigned char *pbyFrame, @@ -1254,8 +1210,6 @@ static bool s_bHostWepRxEncryption( unsigned char byDecMode = KEY_CTL_WEP; PS802_11Header pMACHeader; - - *pwRxTSC15_0 = 0; *pdwRxTSC47_16 = 0; @@ -1269,7 +1223,6 @@ static bool s_bHostWepRxEncryption( byKeyIdx >>= 6; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\nKeyIdx: %d\n", byKeyIdx); - if (pDevice->pMgmt->byCSSGK == KEY_CTL_TKIP) byDecMode = KEY_CTL_TKIP; else if (pDevice->pMgmt->byCSSGK == KEY_CTL_CCMP) @@ -1323,7 +1276,6 @@ static bool s_bHostWepRxEncryption( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "TSC0_15: %x\n", *pwRxTSC15_0); if (byDecMode == KEY_CTL_TKIP) { - if ((pDevice->byLocalID <= REV_ID_VT3253_A1) || (bOnFly == false)) { // Software TKIP // 1. 3253 A @@ -1364,8 +1316,6 @@ static bool s_bHostWepRxEncryption( return true; } - - static bool s_bAPModeRxData( PSDevice pDevice, struct sk_buff *skb, @@ -1381,7 +1331,6 @@ static bool s_bAPModeRxData( unsigned char byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80}; unsigned short wAID; - struct sk_buff *skbcpy = NULL; if (FrameSize > CB_MAX_BUF_SIZE) @@ -1389,7 +1338,6 @@ static bool s_bAPModeRxData( // check DA if (is_multicast_ether_addr((unsigned char *)(skb->data+cbHeaderOffset))) { if (pMgmt->sNodeDBTable[0].bPSEnable) { - skbcpy = dev_alloc_skb((int)pDevice->rx_buf_sz); // if any node in PS mode, buffer packet until DTIM. @@ -1450,4 +1398,3 @@ static bool s_bAPModeRxData( return true; } - diff --git a/drivers/staging/vt6655/dpc.h b/drivers/staging/vt6655/dpc.h index 9b34176d9c12..0ce31557d5da 100644 --- a/drivers/staging/vt6655/dpc.h +++ b/drivers/staging/vt6655/dpc.h @@ -50,6 +50,3 @@ device_receive_frame( void MngWorkItem(void *Context); #endif // __RXTX_H__ - - - diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c index 71e50568f1d3..8417c2f2c6cf 100644 --- a/drivers/staging/vt6655/hostap.c +++ b/drivers/staging/vt6655/hostap.c @@ -53,12 +53,8 @@ static int msglevel = MSG_LEVEL_INFO; /*--------------------- Static Functions --------------------------*/ - - - /*--------------------- Export Variables --------------------------*/ - /* * Description: * register net_device (AP) for hostap deamon @@ -135,7 +131,6 @@ static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked) static int hostap_disable_hostapd(PSDevice pDevice, int rtnl_locked) { - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: disabling hostapd mode\n", pDevice->dev->name); if (pDevice->apdev && pDevice->apdev->name && pDevice->apdev->name[0]) { @@ -161,7 +156,6 @@ static int hostap_disable_hostapd(PSDevice pDevice, int rtnl_locked) return 0; } - /* * Description: * Set enable/disable hostapd mode @@ -192,7 +186,6 @@ int vt6655_hostap_set_hostapd(PSDevice pDevice, int val, int rtnl_locked) return hostap_disable_hostapd(pDevice, rtnl_locked); } - /* * Description: * remove station function supported for hostap deamon @@ -211,7 +204,6 @@ static int hostap_remove_sta(PSDevice pDevice, { unsigned int uNodeIndex; - if (BSSDBbIsSTAInNodeDB(pDevice->pMgmt, param->sta_addr, &uNodeIndex)) { BSSvRemoveOneNode(pDevice, uNodeIndex); } else { @@ -239,7 +231,6 @@ static int hostap_add_sta(PSDevice pDevice, PSMgmtObject pMgmt = pDevice->pMgmt; unsigned int uNodeIndex; - if (!BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &uNodeIndex)) { BSSvCreateOneNode((PSDevice)pDevice, &uNodeIndex); } @@ -373,8 +364,6 @@ static int hostap_set_flags_sta(PSDevice pDevice, return 0; } - - /* * Description: * set generic element (wpa ie) @@ -393,8 +382,6 @@ static int hostap_set_generic_element(PSDevice pDevice, { PSMgmtObject pMgmt = pDevice->pMgmt; - - memcpy(pMgmt->abyWPAIE, param->u.generic_elem.data, param->u.generic_elem.len @@ -472,7 +459,6 @@ static int hostap_set_encryption(PSDevice pDevice, bool bKeyTableFull = false; unsigned short wKeyCtl = 0; - param->u.crypt.err = 0; /* if (param_len != @@ -484,7 +470,6 @@ static int hostap_set_encryption(PSDevice pDevice, if (param->u.crypt.alg > WPA_ALG_CCMP) return -EINVAL; - if ((param->u.crypt.idx > 3) || (param->u.crypt.key_len > MAX_KEY_LEN)) { param->u.crypt.err = HOSTAP_CRYPT_ERR_KEY_SET_FAILED; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " HOSTAP_CRYPT_ERR_KEY_SET_FAILED\n"); @@ -507,7 +492,6 @@ static int hostap_set_encryption(PSDevice pDevice, DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " hostap_set_encryption: alg %d \n", param->u.crypt.alg); if (param->u.crypt.alg == WPA_ALG_NONE) { - if (pMgmt->sNodeDBTable[iNodeIndex].bOnFly == true) { if (KeybRemoveKey(&(pDevice->sKey), param->sta_addr, @@ -549,7 +533,6 @@ static int hostap_set_encryption(PSDevice pDevice, } if (param->u.crypt.alg == WPA_ALG_WEP) { - if ((pDevice->bEnable8021x == false) || (iNodeIndex == 0)) { KeybSetDefaultKey(&(pDevice->sKey), dwKeyIndex & ~(BIT30 | USE_KEYRSC), @@ -572,7 +555,6 @@ static int hostap_set_encryption(PSDevice pDevice, KEY_CTL_WEP, pDevice->PortOffset, pDevice->byLocalID) == true) { - pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true; } else { @@ -618,7 +600,6 @@ static int hostap_set_encryption(PSDevice pDevice, pMgmt->byCSSGK = KEY_CTL_CCMP; } - if (iNodeIndex == 0) { KeybSetDefaultKey(&(pDevice->sKey), dwKeyIndex, @@ -641,7 +622,6 @@ static int hostap_set_encryption(PSDevice pDevice, byKeyDecMode, pDevice->PortOffset, pDevice->byLocalID) == true) { - pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true; } else { @@ -683,8 +663,6 @@ static int hostap_set_encryption(PSDevice pDevice, return ret; } - - /* * Description: * get each stations encryption key @@ -707,7 +685,6 @@ static int hostap_get_encryption(PSDevice pDevice, int ii; int iNodeIndex = 0; - param->u.crypt.err = 0; if (is_broadcast_ether_addr(param->sta_addr)) { @@ -728,7 +705,6 @@ static int hostap_get_encryption(PSDevice pDevice, return ret; } - /* * Description: * vt6655_hostap_ioctl main function supported for hostap deamon. @@ -837,7 +813,6 @@ int vt6655_hostap_ioctl(PSDevice pDevice, struct iw_point *p) break; } - if ((ret == 0) && ap_ioctl) { if (copy_to_user(p->pointer, param, p->length)) { ret = -EFAULT; @@ -850,4 +825,3 @@ out: return ret; } - diff --git a/drivers/staging/vt6655/hostap.h b/drivers/staging/vt6655/hostap.h index 55db55524d96..f1a4f2eff058 100644 --- a/drivers/staging/vt6655/hostap.h +++ b/drivers/staging/vt6655/hostap.h @@ -46,7 +46,6 @@ #define WLAN_RATE_48M BIT10 #define WLAN_RATE_54M BIT11 - /*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Variables --------------------------*/ @@ -65,6 +64,3 @@ int vt6655_hostap_set_hostapd(PSDevice pDevice, int val, int rtnl_locked); int vt6655_hostap_ioctl(PSDevice pDevice, struct iw_point *p); #endif // __HOSTAP_H__ - - - diff --git a/drivers/staging/vt6655/iocmd.h b/drivers/staging/vt6655/iocmd.h index 68df79131c97..e499f1b6f531 100644 --- a/drivers/staging/vt6655/iocmd.h +++ b/drivers/staging/vt6655/iocmd.h @@ -37,7 +37,6 @@ //typedef uint16_t u16; //typedef uint8_t u8; - // ioctl Command code #define MAGIC_CODE 0x3142 #define IOCTL_CMD_TEST (SIOCDEVPRIVATE + 0) @@ -45,9 +44,7 @@ #define IOCTL_CMD_HOSTAPD (SIOCDEVPRIVATE + 2) #define IOCTL_CMD_WPA (SIOCDEVPRIVATE + 3) - typedef enum tagWMAC_CMD { - WLAN_CMD_BSS_SCAN, WLAN_CMD_BSS_JOIN, WLAN_CMD_DISASSOC, @@ -68,7 +65,6 @@ typedef enum tagWMAC_CMD { WLAN_CMD_GET_NODE_CNT, WLAN_CMD_ZONETYPE_SET, WLAN_CMD_GET_NODE_LIST - } WMAC_CMD, *PWMAC_CMD; typedef enum tagWZONETYPE { @@ -85,7 +81,6 @@ typedef enum tagWZONETYPE { #define ADHOC_STARTED 1 #define ADHOC_JOINTED 2 - #define PHY80211a 0 #define PHY80211b 1 #define PHY80211g 2 @@ -115,25 +110,20 @@ typedef struct tagSCmdRequest { // typedef struct tagSCmdScan { - u8 ssid[SSID_MAXLEN + 2]; - } SCmdScan, *PSCmdScan; - // // BSS Join // typedef struct tagSCmdBSSJoin { - u16 wBSSType; u16 wBBPType; u8 ssid[SSID_MAXLEN + 2]; u32 uChannel; bool bPSEnable; bool bShareKeyAuth; - } SCmdBSSJoin, *PSCmdBSSJoin; // @@ -141,10 +131,8 @@ typedef struct tagSCmdBSSJoin { // typedef struct tagSCmdZoneTypeSet { - bool bWrite; WZONETYPE ZoneType; - } SCmdZoneTypeSet, *PSCmdZoneTypeSet; #ifdef WPA_SM_Transtatus @@ -158,7 +146,6 @@ typedef struct tagSWPAResult { #endif typedef struct tagSCmdStartAP { - u16 wBSSType; u16 wBBPType; u8 ssid[SSID_MAXLEN + 2]; @@ -166,24 +153,17 @@ typedef struct tagSCmdStartAP { u32 uBeaconInt; bool bShareKeyAuth; u8 byBasicRate; - } SCmdStartAP, *PSCmdStartAP; - typedef struct tagSCmdSetWEP { - bool bEnableWep; u8 byKeyIndex; u8 abyWepKey[WEP_NKEYS][WEP_KEYMAXLEN]; bool bWepKeyAvailable[WEP_NKEYS]; u32 auWepKeyLength[WEP_NKEYS]; - } SCmdSetWEP, *PSCmdSetWEP; - - typedef struct tagSBSSIDItem { - u32 uChannel; u8 abyBSSID[BSSID_LEN]; u8 abySSID[SSID_MAXLEN + 1]; @@ -197,19 +177,14 @@ typedef struct tagSBSSIDItem { bool bWEPOn; u32 uRSSI; - } SBSSIDItem; - typedef struct tagSBSSIDList { - u32 uItem; SBSSIDItem sBSSIDList[0]; } SBSSIDList, *PSBSSIDList; - typedef struct tagSCmdLinkStatus { - bool bLink; u16 wBSSType; u8 byState; @@ -217,7 +192,6 @@ typedef struct tagSCmdLinkStatus { u8 abySSID[SSID_MAXLEN + 2]; u32 uChannel; u32 uLinkRate; - } SCmdLinkStatus, *PSCmdLinkStatus; // @@ -238,8 +212,6 @@ typedef struct tagSDot11MIBCount { u32 FCSErrorCount; } SDot11MIBCount, *PSDot11MIBCount; - - // // statistic counter // @@ -345,7 +317,6 @@ typedef struct tagSStatMIBCount { u32 ullTxDirectedBytes[2]; } SStatMIBCount, *PSStatMIBCount; - typedef struct tagSNodeItem { // STA info u16 wAID; @@ -363,31 +334,21 @@ typedef struct tagSNodeItem { u32 uTxFailures; u32 uTxAttempts; u16 wFailureRatio; - } SNodeItem; - typedef struct tagSNodeList { - u32 uItem; SNodeItem sNodeList[0]; - } SNodeList, *PSNodeList; - - typedef struct tagSCmdValue { - u32 dwValue; - } SCmdValue, *PSCmdValue; - // // hostapd & viawget ioctl related // - // VIAGWET_IOCTL_HOSTAPD ioctl() cmd: enum { VIAWGET_HOSTAPD_FLUSH = 1, @@ -404,14 +365,11 @@ enum { VIAWGET_HOSTAPD_STA_CLEAR_STATS = 12, }; - #define VIAWGET_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \ ((int)(&((struct viawget_hostapd_param *)0)->u.generic_elem.data)) // Maximum length for algorithm names (-1 for nul termination) used in ioctl() - - struct viawget_hostapd_param { u32 cmd; u8 sta_addr[6]; @@ -464,12 +422,8 @@ struct viawget_hostapd_param { /*--------------------- Export Variables --------------------------*/ - /*--------------------- Export Types ------------------------------*/ - /*--------------------- Export Functions --------------------------*/ - - #endif //__IOCMD_H__ diff --git a/drivers/staging/vt6655/ioctl.h b/drivers/staging/vt6655/ioctl.h index d26a8daa3111..ae240fd71a15 100644 --- a/drivers/staging/vt6655/ioctl.h +++ b/drivers/staging/vt6655/ioctl.h @@ -33,7 +33,6 @@ /*--------------------- Export Definitions -------------------------*/ - /*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Variables --------------------------*/ @@ -52,6 +51,3 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq); */ #endif // __IOCTL_H__ - - - diff --git a/drivers/staging/vt6655/iowpa.h b/drivers/staging/vt6655/iowpa.h index 1e260022d36a..bfea01f5e00a 100644 --- a/drivers/staging/vt6655/iowpa.h +++ b/drivers/staging/vt6655/iowpa.h @@ -31,10 +31,8 @@ /*--------------------- Export Definitions -------------------------*/ - #define WPA_IE_LEN 64 - //WPA related /* typedef enum { WPA_ALG_NONE, WPA_ALG_WEP, WPA_ALG_TKIP, WPA_ALG_CCMP } wpa_alg; @@ -57,7 +55,6 @@ enum { VIAWGET_SET_DISASSOCIATE = 10 }; - enum { VIAWGET_ASSOC_MSG = 1, VIAWGET_DISASSOC_MSG = 2, @@ -67,8 +64,6 @@ enum { VIAWGET_DEVICECLOSE_MSG = 6 }; - - #pragma pack(1) typedef struct viawget_wpa_header { u8 type; @@ -76,8 +71,6 @@ typedef struct viawget_wpa_header { u16 resp_ie_len; } viawget_wpa_header; - - struct viawget_wpa_param { u32 cmd; u8 addr[6]; @@ -122,7 +115,6 @@ struct viawget_wpa_param { } scan_results; } u; - }; #pragma pack(1) @@ -148,12 +140,8 @@ struct viawget_scan_result { /*--------------------- Export Variables --------------------------*/ - /*--------------------- Export Types ------------------------------*/ - /*--------------------- Export Functions --------------------------*/ - - #endif //__IOWPA_H__ diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c index 3e590262a5b2..9de698ef25f5 100644 --- a/drivers/staging/vt6655/iwctl.c +++ b/drivers/staging/vt6655/iwctl.c @@ -64,14 +64,11 @@ static const long frequency_list[] = { 5700, 5745, 5765, 5785, 5805, 5825 }; - /*--------------------- Static Classes ----------------------------*/ - //static int msglevel =MSG_LEVEL_DEBUG; static int msglevel = MSG_LEVEL_INFO; - /*--------------------- Static Variables --------------------------*/ /*--------------------- Static Functions --------------------------*/ @@ -105,11 +102,8 @@ struct iw_statistics *iwctl_get_wireless_stats(struct net_device *dev) return &pDevice->wstats; } - - /*------------------------------------------------------------------*/ - static int iwctl_commit(struct net_device *dev, struct iw_request_info *info, void *wrq, @@ -118,7 +112,6 @@ static int iwctl_commit(struct net_device *dev, DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWCOMMIT \n"); return 0; - } /* * Wireless Handler : get protocol name @@ -149,7 +142,6 @@ int iwctl_siwscan(struct net_device *dev, PWLAN_IE_SSID pItemSSID = NULL; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWSCAN \n"); - if (pDevice->byReAssocCount > 0) { //reject scan when re-associating! //send scan event to wpa_Supplicant union iwreq_data wrqu; @@ -195,7 +187,6 @@ int iwctl_siwscan(struct net_device *dev, return 0; } - /* * Wireless Handler : get scan results */ @@ -218,7 +209,6 @@ int iwctl_giwscan(struct net_device *dev, long ldBm; char buf[MAX_WPA_IE_LEN * 2 + 30]; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWSCAN \n"); if (pMgmt->eScanState == WMAC_IS_SCANNING) { @@ -348,10 +338,8 @@ int iwctl_giwscan(struct net_device *dev, wrq->length = current_ev - extra; return 0; - } - /* * Wireless Handler : set frequency or channel */ @@ -449,7 +437,6 @@ int iwctl_siwmode(struct net_device *dev, } switch (*wmode) { - case IW_MODE_ADHOC: if (pMgmt->eConfigMode != WMAC_CONFIG_IBSS_STA) { pMgmt->eConfigMode = WMAC_CONFIG_IBSS_STA; @@ -507,7 +494,6 @@ int iwctl_giwmode(struct net_device *dev, PSDevice pDevice = (PSDevice)netdev_priv(dev); PSMgmtObject pMgmt = &(pDevice->sMgmtObj); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWMODE \n"); // If not managed, assume it's ad-hoc switch (pMgmt->eConfigMode) { @@ -530,7 +516,6 @@ int iwctl_giwmode(struct net_device *dev, return 0; } - /* * Wireless Handler : get capability range */ @@ -544,7 +529,6 @@ int iwctl_giwrange(struct net_device *dev, int i, k; unsigned char abySupportedRates[13] = {0x02, 0x04, 0x0B, 0x16, 0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C, 0x90}; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWRANGE \n"); if (wrq->pointer) { wrq->length = sizeof(struct iw_range); @@ -591,7 +575,6 @@ int iwctl_giwrange(struct net_device *dev, range->min_frag = 256; range->max_frag = 2312; - // the encoding capabilities range->num_encoding_sizes = 3; // 64(40) bits WEP @@ -636,11 +619,9 @@ int iwctl_giwrange(struct net_device *dev, range->avg_qual.noise = 0; } - return 0; } - /* * Wireless Handler : set ap mac address */ @@ -711,7 +692,6 @@ int iwctl_giwap(struct net_device *dev, PSDevice pDevice = (PSDevice)netdev_priv(dev); PSMgmtObject pMgmt = &(pDevice->sMgmtObj); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWAP \n"); memcpy(wrq->sa_data, pMgmt->abyCurrBSSID, 6); @@ -726,10 +706,8 @@ int iwctl_giwap(struct net_device *dev, wrq->sa_family = ARPHRD_ETHER; return 0; - } - /* * Wireless Handler : get ap list */ @@ -745,7 +723,6 @@ int iwctl_giwaplist(struct net_device *dev, PSDevice pDevice = (PSDevice)netdev_priv(dev); PSMgmtObject pMgmt = &(pDevice->sMgmtObj); - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWAPLIST \n"); // Only super-user can see AP list @@ -755,7 +732,6 @@ int iwctl_giwaplist(struct net_device *dev, } if (wrq->pointer) { - PKnownBSS pBSS = &(pMgmt->sBSSList[0]); for (ii = 0, jj = 0; ii < MAX_BSS_NUM; ii++) { @@ -781,7 +757,6 @@ int iwctl_giwaplist(struct net_device *dev, return rc; } - /* * Wireless Handler : set essid */ @@ -797,7 +772,6 @@ int iwctl_siwessid(struct net_device *dev, //2008-0409-05, by Einsn Liu unsigned char len; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWESSID \n"); pDevice->fWPA_Authened = false; if (pMgmt->eScanState == WMAC_IS_SCANNING) { @@ -890,11 +864,9 @@ int iwctl_siwessid(struct net_device *dev, pDevice->bCommit = true; } - return 0; } - /* * Wireless Handler : get essid */ @@ -904,7 +876,6 @@ int iwctl_giwessid(struct net_device *dev, struct iw_point *wrq, char *extra) { - PSDevice pDevice = (PSDevice)netdev_priv(dev); PSMgmtObject pMgmt = &(pDevice->sMgmtObj); PWLAN_IE_SSID pItemSSID; @@ -924,7 +895,6 @@ int iwctl_giwessid(struct net_device *dev, wrq->length = pItemSSID->len; wrq->flags = 1; // active - return 0; } @@ -943,7 +913,6 @@ int iwctl_siwrate(struct net_device *dev, int i; unsigned char abySupportedRates[13] = {0x02, 0x04, 0x0B, 0x16, 0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C, 0x90}; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWRATE \n"); if (!(pDevice->flags & DEVICE_FLAGS_OPENED)) { rc = -EINVAL; @@ -1042,7 +1011,6 @@ int iwctl_giwrate(struct net_device *dev, brate = 0x6C; } } else { - brate = abySupportedRates[TxRate_iwconfig]; } } else brate = 0; @@ -1067,12 +1035,9 @@ int iwctl_giwrate(struct net_device *dev, wrq->fixed = true; } - return 0; } - - /* * Wireless Handler : set rts threshold */ @@ -1133,10 +1098,8 @@ int iwctl_siwfrag(struct net_device *dev, int rc = 0; int fthr = wrq->value; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWFRAG \n"); - if (wrq->disabled) fthr = 2312; if ((fthr < 256) || (fthr > 2312)) { @@ -1168,8 +1131,6 @@ int iwctl_giwfrag(struct net_device *dev, return 0; } - - /* * Wireless Handler : set retry threshold */ @@ -1181,7 +1142,6 @@ int iwctl_siwretry(struct net_device *dev, PSDevice pDevice = (PSDevice)netdev_priv(dev); int rc = 0; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWRETRY \n"); if (wrq->disabled) { @@ -1204,7 +1164,6 @@ int iwctl_siwretry(struct net_device *dev, pDevice->wMaxTransmitMSDULifetime = wrq->value; } - return rc; } @@ -1234,11 +1193,9 @@ int iwctl_giwretry(struct net_device *dev, wrq->flags |= IW_RETRY_MIN; } - return 0; } - /* * Wireless Handler : set encode mode */ @@ -1280,7 +1237,6 @@ int iwctl_siwencode(struct net_device *dev, } else dwKeyIndex = 0; } else dwKeyIndex--; - // Check the size of the key if (wrq->length > WLAN_WEP232_KEYLEN) { rc = -EINVAL; @@ -1380,7 +1336,6 @@ int iwctl_siwencode(struct net_device *dev, // Send the key to the card if (wrq->length > 0) { - if (wrq->length == WLAN_WEP232_KEYLEN) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Set 232 bit wep key\n"); } else if (wrq->length == WLAN_WEP104_KEYLEN) { @@ -1425,7 +1380,6 @@ int iwctl_siwencode(struct net_device *dev, } // Read the flags if (wrq->flags & IW_ENCODE_DISABLED) { - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Disable WEP function\n"); pMgmt->bShareKeyAlgorithm = false; pDevice->bEncryptionEnable = false; @@ -1513,7 +1467,6 @@ memcpy(extra, abyKey, WLAN_WEP232_KEYLEN); // return rc; // } - //End Modify,Einsn return 0; @@ -1580,7 +1533,6 @@ int iwctl_giwencode(struct net_device *dev, return 0; } - /* * Wireless Handler : set power mode */ @@ -1643,10 +1595,8 @@ int iwctl_giwpower(struct net_device *dev, PSMgmtObject pMgmt = &(pDevice->sMgmtObj); int mode = pDevice->ePSMode; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWPOWER \n"); - wrq->disabled = (mode == WMAC_POWER_CAM); if (wrq->disabled) return 0; @@ -1663,7 +1613,6 @@ int iwctl_giwpower(struct net_device *dev, return 0; } - /* * Wireless Handler : get Sensitivity */ @@ -1685,7 +1634,6 @@ int iwctl_giwsens(struct net_device *dev, wrq->disabled = (wrq->value == 0); wrq->fixed = 1; - return 0; } @@ -1803,7 +1751,6 @@ int iwctl_siwauth(struct net_device *dev, return ret; } - int iwctl_giwauth(struct net_device *dev, struct iw_request_info *info, struct iw_param *wrq, @@ -1812,8 +1759,6 @@ int iwctl_giwauth(struct net_device *dev, return -EOPNOTSUPP; } - - int iwctl_siwgenie(struct net_device *dev, struct iw_request_info *info, struct iw_point *wrq, @@ -1871,7 +1816,6 @@ int iwctl_giwgenie(struct net_device *dev, return ret; } - int iwctl_siwencodeext(struct net_device *dev, struct iw_request_info *info, struct iw_point *wrq, @@ -1992,8 +1936,6 @@ error: return ret; } - - int iwctl_giwencodeext(struct net_device *dev, struct iw_request_info *info, struct iw_point *wrq, @@ -2036,18 +1978,15 @@ int iwctl_siwmlme(struct net_device *dev, } return ret; - } #endif - /*------------------------------------------------------------------*/ /* * Structures to export the Wireless Handlers */ - /* static const iw_handler iwctl_handler[] = { @@ -2173,21 +2112,17 @@ static const iw_handler iwctl_handler[] = (iw_handler) NULL, // -- hole -- }; - static const iw_handler iwctl_private_handler[] = { NULL, // SIOCIWFIRSTPRIV }; - struct iw_priv_args iwctl_private_args[] = { { IOCTL_CMD_SET, IW_PRIV_TYPE_CHAR | 1024, 0, "set"}, }; - - const struct iw_handler_def iwctl_handler_def = { .get_wireless_stats = &iwctl_get_wireless_stats, diff --git a/drivers/staging/vt6655/iwctl.h b/drivers/staging/vt6655/iwctl.h index c36dd748f521..871bd7c4e716 100644 --- a/drivers/staging/vt6655/iwctl.h +++ b/drivers/staging/vt6655/iwctl.h @@ -33,7 +33,6 @@ /*--------------------- Export Definitions -------------------------*/ - /*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Variables --------------------------*/ @@ -42,7 +41,6 @@ struct iw_statistics *iwctl_get_wireless_stats(struct net_device *dev); - int iwctl_siwap(struct net_device *dev, struct iw_request_info *info, struct sockaddr *wrq, @@ -53,7 +51,6 @@ int iwctl_giwrange(struct net_device *dev, struct iw_point *wrq, char *extra); - int iwctl_giwmode(struct net_device *dev, struct iw_request_info *info, __u32 *wmode, @@ -119,7 +116,6 @@ int iwctl_siwrts(struct net_device *dev, struct iw_param *wrq, char *extra); - int iwctl_giwrts(struct net_device *dev, struct iw_request_info *info, struct iw_param *wrq, @@ -214,11 +210,7 @@ int iwctl_siwmlme(struct net_device *dev, #endif // #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT //End Add -- //2008-0409-07, by Einsn Liu - extern const struct iw_handler_def iwctl_handler_def; extern const struct iw_priv_args iwctl_private_args; #endif // __IWCTL_H__ - - - diff --git a/drivers/staging/vt6655/key.c b/drivers/staging/vt6655/key.c index d2b5d625293b..92b84b5ea115 100644 --- a/drivers/staging/vt6655/key.c +++ b/drivers/staging/vt6655/key.c @@ -71,7 +71,6 @@ s_vCheckKeyTableValid(PSKeyManagement pTable, unsigned long dwIoBase) (pTable->KeyTable[i].GroupKey[2].bKeyValid == false) && (pTable->KeyTable[i].GroupKey[3].bKeyValid == false) ) { - pTable->KeyTable[i].bInUse = false; pTable->KeyTable[i].wKeyCtl = 0; pTable->KeyTable[i].bSoftWEP = false; @@ -80,10 +79,8 @@ s_vCheckKeyTableValid(PSKeyManagement pTable, unsigned long dwIoBase) } } - /*--------------------- Export Functions --------------------------*/ - /* * Description: Init Key management table * @@ -116,7 +113,6 @@ void KeyvInitTable(PSKeyManagement pTable, unsigned long dwIoBase) } } - /* * Description: Get Key from table * @@ -168,7 +164,6 @@ bool KeybGetKey( return false; } - /* * Description: Set Key to table * @@ -342,7 +337,6 @@ bool KeybSetKey( return false; } - /* * Description: Remove Key from table * @@ -412,7 +406,6 @@ bool KeybRemoveKey( return false; } - /* * Description: Remove Key from table * @@ -467,7 +460,6 @@ void KeyvRemoveWEPKey( unsigned long dwIoBase ) { - if ((dwKeyIndex & 0x000000FF) < MAX_GROUP_KEY) { if (pTable->KeyTable[MAX_KEY_TABLE-1].bInUse == true) { if (pTable->KeyTable[MAX_KEY_TABLE-1].GroupKey[dwKeyIndex & 0x000000FF].byCipherSuite == KEY_CTL_WEP) { @@ -521,9 +513,7 @@ bool KeybGetTransmitKey( for (i = 0; i < MAX_KEY_TABLE; i++) { if ((pTable->KeyTable[i].bInUse == true) && !compare_ether_addr(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { - if (dwKeyType == PAIRWISE_KEY) { - if (pTable->KeyTable[i].PairwiseKey.bKeyValid == true) { *pKey = &(pTable->KeyTable[i].PairwiseKey); @@ -534,7 +524,6 @@ bool KeybGetTransmitKey( } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "\n"); - return true; } else { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "PairwiseKey.bKeyValid == false\n"); @@ -573,7 +562,6 @@ bool KeybGetTransmitKey( return false; } - /* * Description: Check Pairewise Key * @@ -637,7 +625,6 @@ bool KeybSetDefaultKey( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enter KeybSetDefaultKey: %1x, %d \n", (int)dwKeyIndex, (int)uKeyLength); - if ((dwKeyIndex & PAIRWISE_KEY) != 0) { // Pairwise key return false; } else if ((dwKeyIndex & 0x000000FF) >= MAX_GROUP_KEY) { @@ -696,7 +683,6 @@ bool KeybSetDefaultKey( pKey->dwTSC47_16 = 0; pKey->wTSC15_0 = 0; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybSetKey(R): \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->bKeyValid: %d\n", pKey->bKeyValid); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey->uKeyLength: %d\n", (int)pKey->uKeyLength); @@ -713,7 +699,6 @@ bool KeybSetDefaultKey( return true; } - /* * Description: Set Key to table * @@ -748,7 +733,6 @@ bool KeybSetAllGroupKey( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Enter KeybSetAllGroupKey: %lX\n", dwKeyIndex); - if ((dwKeyIndex & PAIRWISE_KEY) != 0) { // Pairwise key return false; } else if ((dwKeyIndex & 0x000000FF) >= MAX_GROUP_KEY) { diff --git a/drivers/staging/vt6655/key.h b/drivers/staging/vt6655/key.h index f09cdb1885fb..356e6de8f87f 100644 --- a/drivers/staging/vt6655/key.h +++ b/drivers/staging/vt6655/key.h @@ -40,7 +40,6 @@ #define MAX_KEY_LEN 32 #define AES_KEY_LEN 16 - #define AUTHENTICATOR_KEY 0x10000000 #define USE_KEYRSC 0x20000000 #define PAIRWISE_KEY 0x40000000 @@ -54,7 +53,6 @@ #define KEY_CTL_CCMP 0x03 #define KEY_CTL_INVALID 0xFF - typedef struct tagSKeyItem { bool bKeyValid; @@ -181,4 +179,3 @@ bool KeybSetAllGroupKey( ); #endif // __KEY_H__ - diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c index 32bc2345e7ae..001d15c0fa40 100644 --- a/drivers/staging/vt6655/mac.c +++ b/drivers/staging/vt6655/mac.c @@ -86,10 +86,6 @@ static int msglevel = MSG_LEVEL_INFO; /*--------------------- Export Functions --------------------------*/ - - - - /* * Description: * Read All MAC Registers to buffer @@ -122,7 +118,6 @@ void MACvReadAllRegs(unsigned long dwIoBase, unsigned char *pbyMacRegs) } MACvSelectPage0(dwIoBase); - } /* @@ -608,7 +603,6 @@ void MACvSetPacketFilter(unsigned long dwIoBase, unsigned short wFilterType) } if (wFilterType & PKT_TYPE_PROMISCUOUS) { - byNewRCR |= (RCR_RXALLTYPE | RCR_UNICAST | RCR_MULTICAST | RCR_BROADCAST); byNewRCR &= ~RCR_BSSID; @@ -707,11 +701,9 @@ void MACvRestoreContext(unsigned long dwIoBase, unsigned char *pbyCxtBuf) VNSvOutPortD(dwIoBase + MAC_REG_AC0DMAPTR, *(unsigned long *)(pbyCxtBuf + MAC_REG_AC0DMAPTR)); VNSvOutPortD(dwIoBase + MAC_REG_BCNDMAPTR, *(unsigned long *)(pbyCxtBuf + MAC_REG_BCNDMAPTR)); - VNSvOutPortD(dwIoBase + MAC_REG_RXDMAPTR0, *(unsigned long *)(pbyCxtBuf + MAC_REG_RXDMAPTR0)); VNSvOutPortD(dwIoBase + MAC_REG_RXDMAPTR1, *(unsigned long *)(pbyCxtBuf + MAC_REG_RXDMAPTR1)); - } /* @@ -756,7 +748,6 @@ bool MACbCompareContext(unsigned long dwIoBase, unsigned char *pbyCxtBuf) return false; } - return true; } @@ -790,7 +781,6 @@ bool MACbSoftwareReset(unsigned long dwIoBase) if (ww == W_MAX_TIMEOUT) return false; return true; - } /* @@ -912,7 +902,6 @@ bool MACbSafeTxOff(unsigned long dwIoBase) //AC0 VNSvOutPortD(dwIoBase + MAC_REG_AC0DMACTL, DMACTL_CLRRUN); - for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { VNSvInPortD(dwIoBase + MAC_REG_TXDMACTL0, &dwData); if (!(dwData & DMACTL_RUN)) @@ -1047,12 +1036,10 @@ void MACvInitialize(unsigned long dwIoBase) // enable TSF counter VNSvOutPortB(dwIoBase + MAC_REG_TFTCTL, TFTCTL_TSFCNTREN); - // set packet filter // receive directed and broadcast address MACvSetPacketFilter(dwIoBase, PKT_TYPE_DIRECTED | PKT_TYPE_BROADCAST); - } /* @@ -1209,8 +1196,6 @@ void MACvSetCurrAC0DescAddrEx(unsigned long dwIoBase, unsigned long dwCurrDescAd } } - - void MACvSetCurrTXDescAddr(int iTxType, unsigned long dwIoBase, unsigned long dwCurrDescAddr) { if (iTxType == TYPE_AC0DMA) { @@ -1253,7 +1238,6 @@ void MACvTimer0MicroSDelay(unsigned long dwIoBase, unsigned int uDelay) } } VNSvOutPortB(dwIoBase + MAC_REG_TMCTL0, 0); - } /* @@ -1298,7 +1282,6 @@ void MACvOneShotTimer1MicroSec(unsigned long dwIoBase, unsigned int uDelayTime) VNSvOutPortB(dwIoBase + MAC_REG_TMCTL1, (TMCTL_TMD | TMCTL_TE)); } - void MACvSetMISCFifo(unsigned long dwIoBase, unsigned short wOffset, unsigned long dwData) { if (wOffset > 273) @@ -1308,7 +1291,6 @@ void MACvSetMISCFifo(unsigned long dwIoBase, unsigned short wOffset, unsigned lo VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE); } - bool MACbTxDMAOff(unsigned long dwIoBase, unsigned int idx) { unsigned char byData; @@ -1455,7 +1437,6 @@ void MACvSetKeyEntry(unsigned long dwIoBase, unsigned short wKeyCtl, unsigned in if (byLocalID <= 1) return; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MACvSetKeyEntry\n"); wOffset = MISCFIFO_KEYETRY0; wOffset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE); @@ -1496,8 +1477,6 @@ void MACvSetKeyEntry(unsigned long dwIoBase, unsigned short wKeyCtl, unsigned in } } - - /* * Description: * Disable the Key Entry by MISCFIFO @@ -1524,7 +1503,6 @@ void MACvDisableKeyEntry(unsigned long dwIoBase, unsigned int uEntryIdx) VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE); } - /* * Description: * Set the default Key (KeyEntry[10]) by MISCFIFO @@ -1572,10 +1550,8 @@ void MACvSetDefaultKeyEntry(unsigned long dwIoBase, unsigned int uKeyLen, VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData); VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "End. wOffset: %d, Data: %lX\n", wOffset+3, dwData); - } - /* * Description: * Enable default Key (KeyEntry[10]) by MISCFIFO @@ -1596,7 +1572,6 @@ void MACvSetDefaultKeyEntry(unsigned long dwIoBase, unsigned int uKeyLen, unsigned short wOffset; unsigned long dwData; - if (byLocalID <= 1) return; @@ -1631,7 +1606,6 @@ void MACvDisableDefaultKey(unsigned long dwIoBase) unsigned short wOffset; unsigned long dwData; - wOffset = MISCFIFO_KEYETRY0; wOffset += (10 * MISCFIFO_KEYENTRYSIZE); @@ -1666,7 +1640,6 @@ void MACvSetDefaultTKIPKeyEntry(unsigned long dwIoBase, unsigned int uKeyLen, if (byLocalID <= 1) return; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MACvSetDefaultTKIPKeyEntry\n"); wOffset = MISCFIFO_KEYETRY0; // Kyle test : change offset from 10 -> 0 @@ -1693,11 +1666,8 @@ void MACvSetDefaultTKIPKeyEntry(unsigned long dwIoBase, unsigned int uKeyLen, VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, *pdwKey++); VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE); } - } - - /* * Description: * Set the Key Control by MISCFIFO @@ -1721,7 +1691,6 @@ void MACvSetDefaultKeyCtl(unsigned long dwIoBase, unsigned short wKeyCtl, unsign if (byLocalID <= 1) return; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MACvSetKeyEntry\n"); wOffset = MISCFIFO_KEYETRY0; wOffset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE); @@ -1735,6 +1704,4 @@ void MACvSetDefaultKeyCtl(unsigned long dwIoBase, unsigned short wKeyCtl, unsign VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset); VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData); VNSvOutPortW(dwIoBase + MAC_REG_MISCFFCTL, MISCFFCTL_WRITE); - } - diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h index dc09a505a4cf..3f177f7c581c 100644 --- a/drivers/staging/vt6655/mac.h +++ b/drivers/staging/vt6655/mac.h @@ -197,7 +197,6 @@ #define MAC_REG_PWRCCK 0x73 #define MAC_REG_PWROFDM 0x7C - // // Bits in the BCFG0 register // @@ -398,7 +397,6 @@ #define IMR_AC0DMA 0x00000002 // #define IMR_TXDMA0 0x00000001 // - // // Bits in the ISR register // @@ -422,7 +420,6 @@ #define ISR_AC0DMA 0x00000002 // #define ISR_TXDMA0 0x00000001 // - // // Bits in the PSCFG register // @@ -513,7 +510,6 @@ // #define MISCFFCTL_WRITE 0x0001 // - // // Bits in WAKEUPEN0 // @@ -557,7 +553,6 @@ #define GPIO1_MD 0x10 // #define GPIO1_DATA 0x20 // - // // Bits in the MSRCTL register // @@ -576,7 +571,6 @@ #define MSRCTL1_CSAPAREN 0x04 #define MSRCTL1_TXPAUSE 0x01 - // Loopback mode #define MAC_LB_EXT 0x02 // #define MAC_LB_INTERNAL 0x01 // @@ -595,7 +589,6 @@ #define Default_BI 0x200 - // MiscFIFO Offset #define MISCFIFO_KEYETRY0 32 #define MISCFIFO_KEYENTRYSIZE 22 @@ -1056,4 +1049,3 @@ void MACvSetDefaultTKIPKeyEntry(unsigned long dwIoBase, unsigned int uKeyLen, void MACvSetDefaultKeyCtl(unsigned long dwIoBase, unsigned short wKeyCtl, unsigned int uEntryIdx, unsigned char byLocalID); #endif // __MAC_H__ - diff --git a/drivers/staging/vt6655/mib.c b/drivers/staging/vt6655/mib.c index f63440e8f271..6a59652052b6 100644 --- a/drivers/staging/vt6655/mib.c +++ b/drivers/staging/vt6655/mib.c @@ -56,8 +56,6 @@ static int msglevel = MSG_LEVEL_INFO; /*--------------------- Export Functions --------------------------*/ - - /* * Description: Clear All Statistic Counter * @@ -76,7 +74,6 @@ void STAvClearAllCounter(PSStatCounter pStatistic) memset(pStatistic, 0, sizeof(SStatCounter)); } - /* * Description: Update Isr Statistic Counter * @@ -141,10 +138,8 @@ void STAvUpdateIsrStatCounter(PSStatCounter pStatistic, unsigned long dwIsr) if (dwIsr & ISR_SOFTTIMER1) // ISR, bit21 pStatistic->ISRStat.dwIsrSTIMER1Int++; - } - /* * Description: Update Rx Statistic Counter * @@ -293,7 +288,6 @@ void STAvUpdateRDStatCounter(PSStatCounter pStatistic, pStatistic->dwRsrRxPacket++; pStatistic->dwRsrRxOctet += cbFrameLength; - if (IS_TYPE_DATA(pbyBuffer)) { pStatistic->dwRsrRxData++; } else if (IS_TYPE_MGMT(pbyBuffer)) { @@ -329,11 +323,8 @@ void STAvUpdateRDStatCounter(PSStatCounter pStatistic, } else if (cbFrameLength > ETH_FRAME_LEN + 4) { pStatistic->dwRsrLong++; } - } - - /* * Description: Update Rx Statistic Counter and copy Rx buffer * @@ -376,7 +367,6 @@ STAvUpdateRDStatCounterEx( memcpy(pStatistic->abyCntRxPattern, (unsigned char *)pbyBuffer, 10); } - /* * Description: Update Tx Statistic Counter * @@ -408,8 +398,6 @@ STAvUpdateTDStatCounter( unsigned char *pbyDestAddr; unsigned char byTSR0_NCR = byTSR0 & TSR0_NCR; - - pHeader = (PWLAN_80211HDR_A4) pbyBuffer; if (WLAN_GET_FC_TODS(pHeader->wFrameCtl) == 0) { pbyDestAddr = &(pHeader->abyAddr1[0]); @@ -462,10 +450,8 @@ STAvUpdateTDStatCounter( pStatistic->dwTsrMulticast[uIdx]++; else pStatistic->dwTsrDirected[uIdx]++; - } - /* * Description: Update Tx Statistic Counter and copy Tx buffer * @@ -497,7 +483,6 @@ STAvUpdateTDStatCounterEx( memcpy(pStatistic->abyCntTxPattern, pbyBuffer, 16); } - /* * Description: Update 802.11 mib counter * diff --git a/drivers/staging/vt6655/mib.h b/drivers/staging/vt6655/mib.h index c2740e0bb059..6b99c119b78f 100644 --- a/drivers/staging/vt6655/mib.h +++ b/drivers/staging/vt6655/mib.h @@ -67,7 +67,6 @@ typedef struct tagSDot11Counters { // unsigned long long DecryptFailureCount; } SDot11Counters, *PSDot11Counters; - // // MIB2 counter // @@ -105,7 +104,6 @@ typedef struct tagSMib2Counter { #define DOWN 2 // #define TESTING 3 // - // // RMON counter // @@ -168,10 +166,8 @@ typedef struct tagSCustomCounters { unsigned long long ullRsr12MCRCOk; unsigned long long ullRsr9MCRCOk; unsigned long long ullRsr6MCRCOk; - } SCustomCounters, *PSCustomCounters; - // // Custom counter // @@ -202,7 +198,6 @@ typedef struct tagSISRCounters { ///////////////////////////////////// } SISRCounters, *PSISRCounters; - // Value in the etherStatsStatus entry #define VALID 1 // #define CREATE_REQUEST 2 // @@ -217,7 +212,6 @@ typedef struct tagSStatCounter { // ISR status count // - // RSR status count // unsigned long dwRsrFrmAlgnErr; @@ -293,8 +287,6 @@ typedef struct tagSStatCounter { unsigned char abyCntRxPattern[16]; unsigned char abyCntTxPattern[16]; - - // Software check.... unsigned long dwCntRxDataErr; // rx buffer data software compare CRC err count unsigned long dwCntDecryptErr; // rx buffer data software compare CRC err count @@ -370,6 +362,3 @@ void STAvUpdate802_11Counter( void STAvClear802_11Counter(PSDot11Counters p802_11Counter); #endif // __MIB_H__ - - - diff --git a/drivers/staging/vt6655/michael.c b/drivers/staging/vt6655/michael.c index 3b00887f7000..7ea5f7f82f43 100644 --- a/drivers/staging/vt6655/michael.c +++ b/drivers/staging/vt6655/michael.c @@ -135,7 +135,6 @@ void MIC_vInit(unsigned long dwK0, unsigned long dwK1) s_vSetKey(dwK0, dwK1); } - void MIC_vUnInit(void) { // Wipe the key material @@ -174,4 +173,3 @@ void MIC_vGetMIC(unsigned long *pdwL, unsigned long *pdwR) // Reset to the empty message. s_vClear(); } - diff --git a/drivers/staging/vt6655/michael.h b/drivers/staging/vt6655/michael.h index 03936eec72ff..0828d18ad528 100644 --- a/drivers/staging/vt6655/michael.h +++ b/drivers/staging/vt6655/michael.h @@ -54,5 +54,3 @@ void MIC_vGetMIC(unsigned long *pdwL, unsigned long *pdwR); #define ROR32(A, n) ROL32((A), 32-(n)) #endif //__MICHAEL_H__ - - diff --git a/drivers/staging/vt6655/power.c b/drivers/staging/vt6655/power.c index ae2ad92f0272..2340d2f0399b 100644 --- a/drivers/staging/vt6655/power.c +++ b/drivers/staging/vt6655/power.c @@ -48,19 +48,14 @@ /*--------------------- Static Definitions -------------------------*/ - - - /*--------------------- Static Classes ----------------------------*/ /*--------------------- Static Variables --------------------------*/ static int msglevel = MSG_LEVEL_INFO; /*--------------------- Static Functions --------------------------*/ - /*--------------------- Export Variables --------------------------*/ - /*--------------------- Export Functions --------------------------*/ /*+ @@ -73,7 +68,6 @@ static int msglevel = MSG_LEVEL_INFO; * -*/ - void PSvEnablePowerSaving( void *hDeviceContext, @@ -128,11 +122,6 @@ PSvEnablePowerSaving( return; } - - - - - /*+ * * Routine Description: @@ -169,7 +158,6 @@ PSvDisablePowerSaving( return; } - /*+ * * Routine Description: @@ -180,7 +168,6 @@ PSvDisablePowerSaving( * false, if fail -*/ - bool PSbConsiderPowerDown( void *hDeviceContext, @@ -235,8 +222,6 @@ PSbConsiderPowerDown( return true; } - - /*+ * * Routine Description: @@ -247,8 +232,6 @@ PSbConsiderPowerDown( * -*/ - - void PSvSendPSPOLL( void *hDeviceContext @@ -258,7 +241,6 @@ PSvSendPSPOLL( PSMgmtObject pMgmt = pDevice->pMgmt; PSTxMgmtPacket pTxPacket = NULL; - memset(pMgmt->pbyPSPacketPool, 0, sizeof(STxMgmtPacket) + WLAN_HDR_ADDR2_LEN); pTxPacket = (PSTxMgmtPacket)pMgmt->pbyPSPacketPool; pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); @@ -283,8 +265,6 @@ PSvSendPSPOLL( return; } - - /*+ * * Routine Description: @@ -304,7 +284,6 @@ PSbSendNullPacket( PSMgmtObject pMgmt = pDevice->pMgmt; unsigned int uIdx; - if (pDevice->bLinkPass == false) { return false; } @@ -330,7 +309,6 @@ PSbSendNullPacket( pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); if (pDevice->bEnablePSMode) { - pTxPacket->p80211Header->sA3.wFrameCtl = cpu_to_le16( ( WLAN_SET_FC_FTYPE(WLAN_TYPE_DATA) | @@ -360,11 +338,9 @@ PSbSendNullPacket( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Send Null Packet failed !\n"); return false; } else { - // DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Send Null Packet success....\n"); } - return true; } @@ -383,7 +359,6 @@ PSbIsNextTBTTWakeUp( void *hDeviceContext ) { - PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; bool bWakeUp = false; @@ -405,4 +380,3 @@ PSbIsNextTBTTWakeUp( return bWakeUp; } - diff --git a/drivers/staging/vt6655/power.h b/drivers/staging/vt6655/power.h index 0d1d372b1c48..337dd659f12f 100644 --- a/drivers/staging/vt6655/power.h +++ b/drivers/staging/vt6655/power.h @@ -29,7 +29,6 @@ #ifndef __POWER_H__ #define __POWER_H__ - /*--------------------- Export Definitions -------------------------*/ #define C_PWBT 1000 // micro sec. power up before TBTT #define PS_FAST_INTERVAL 1 // Fast power saving listen interval @@ -39,10 +38,8 @@ /*--------------------- Export Variables --------------------------*/ - /*--------------------- Export Types ------------------------------*/ - /*--------------------- Export Functions --------------------------*/ // PSDevice pDevice diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c index fc2766e4bad7..6948984a25ab 100644 --- a/drivers/staging/vt6655/rf.c +++ b/drivers/staging/vt6655/rf.c @@ -46,7 +46,6 @@ #define SWITCH_CHANNEL_DELAY_AL2230 200 //us #define AL2230_PWR_IDX_LEN 64 - #define BY_AL7230_REG_LEN 23 //24bit #define CB_AL7230_INIT_SEQ 16 #define SWITCH_CHANNEL_DELAY_AL7230 200 //us @@ -56,8 +55,6 @@ /*--------------------- Static Variables --------------------------*/ - - const unsigned long dwAL2230InitTable[CB_AL2230_INIT_SEQ] = { 0x03F79000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // 0x03333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // @@ -222,7 +219,6 @@ const unsigned long dwAL7230InitTableAMode[CB_AL7230_INIT_SEQ] = { 0x12BACF00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW // Need modify for 11b/g }; - const unsigned long dwAL7230ChannelTable0[CB_MAX_CHANNEL] = { 0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 1, Tf = 2412MHz 0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 2, Tf = 2417MHz @@ -418,14 +414,8 @@ const unsigned long dwAL7230ChannelTable2[CB_MAX_CHANNEL] = { }; //}} RobertYu - - - /*--------------------- Static Functions --------------------------*/ - - - /* * Description: AIROHA IFRF chip init function * @@ -520,7 +510,6 @@ bool s_bAL7230SelectChannel(unsigned long dwIoBase, unsigned char byChannel) * */ - //{{ RobertYu: 20041210 /* * Description: UW2452 IFRF chip init function @@ -535,8 +524,6 @@ bool s_bAL7230SelectChannel(unsigned long dwIoBase, unsigned char byChannel) * */ - - //}} RobertYu //////////////////////////////////////////////////////////////////////////////// @@ -567,8 +554,6 @@ bool s_bAL7230SelectChannel(unsigned long dwIoBase, unsigned char byChannel) * */ - - /*--------------------- Export Variables --------------------------*/ /*--------------------- Export Functions --------------------------*/ @@ -607,8 +592,6 @@ bool IFRFbWriteEmbedded(unsigned long dwIoBase, unsigned long dwData) return true; } - - /* * Description: RFMD RF2959 IFRF chip init function * @@ -665,13 +648,10 @@ bool RFbAL2230Init(unsigned long dwIoBase) MACvWordRegBitsOff(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3); - - //patch abnormal AL2230 frequency output //2008-8-21 chester IFRFbWriteEmbedded(dwIoBase, (0x07168700+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW)); - for (ii = 0; ii < CB_AL2230_INIT_SEQ; ii++) bResult &= IFRFbWriteEmbedded(dwIoBase, dwAL2230InitTable[ii]); //2008-8-21 chester @@ -729,7 +709,6 @@ bool RFbAL2230SelectChannel(unsigned long dwIoBase, unsigned char byChannel) * */ - /* * Description: Select channel with UW2451 chip * @@ -843,7 +822,6 @@ bool RFbSelectChannel(unsigned long dwIoBase, unsigned char byRFType, unsigned c { bool bResult = true; switch (byRFType) { - case RF_AIROHA: case RF_AL2230S: bResult = RFbAL2230SelectChannel(dwIoBase, byChannel); @@ -1061,7 +1039,6 @@ bool RFbRawSetPower( return false; } switch (pDevice->byRFType) { - case RF_AIROHA: bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, dwAL2230PowerTable[byPwr]); if (uRATE <= RATE_11M) { @@ -1071,7 +1048,6 @@ bool RFbRawSetPower( } break; - case RF_AL2230S: bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, dwAL2230PowerTable[byPwr]); if (uRATE <= RATE_11M) { @@ -1092,7 +1068,6 @@ bool RFbRawSetPower( bResult &= IFRFbWriteEmbedded(pDevice->PortOffset, dwMax7230Pwr); break; - default: break; } @@ -1142,7 +1117,6 @@ RFvRSSITodBm( //////////////////////////////////////////////////////////////////////////////// //{{ RobertYu: 20050104 - // Post processing for the 11b/g and 11a. // for save time on changing Reg2,3,5,7,10,12,15 bool RFbAL7230SelectChannelPostProcess(unsigned long dwIoBase, unsigned char byOldChannel, unsigned char byNewChannel) @@ -1177,7 +1151,5 @@ bool RFbAL7230SelectChannelPostProcess(unsigned long dwIoBase, unsigned char byO return bResult; } - //}} RobertYu //////////////////////////////////////////////////////////////////////////////// - diff --git a/drivers/staging/vt6655/rf.h b/drivers/staging/vt6655/rf.h index e671ab0b64fa..ef3c6de09fec 100644 --- a/drivers/staging/vt6655/rf.h +++ b/drivers/staging/vt6655/rf.h @@ -68,7 +68,6 @@ #define CB_MAXIM2829_CHANNEL_5G_HIGH 41 //Index41: channel = 100, Tf = 5500MHz, set the (A3:A0=0101) D6=1 #define CB_UW2452_CHANNEL_5G_HIGH 41 //[20041210] Index41: channel = 100, Tf = 5500MHz, change VCO2->VCO3 - /*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Variables --------------------------*/ @@ -100,6 +99,3 @@ bool RFbAL7230SelectChannelPostProcess(unsigned long dwIoBase, unsigned char byO //}} RobertYu #endif // __RF_H__ - - - diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c index 16953ef43bda..3a2661e2b27c 100644 --- a/drivers/staging/vt6655/rxtx.c +++ b/drivers/staging/vt6655/rxtx.c @@ -73,7 +73,6 @@ static int msglevel = MSG_LEVEL_INFO; #define PLICE_DEBUG - /*--------------------- Static Functions --------------------------*/ /*--------------------- Static Definitions -------------------------*/ @@ -94,7 +93,6 @@ const unsigned short wFB_Opt1[2][5] = { {RATE_6M , RATE_6M, RATE_12M, RATE_12M, RATE_18M}, // fallback_rate1 }; - #define RTSDUR_BB 0 #define RTSDUR_BA 1 #define RTSDUR_AA 2 @@ -112,8 +110,6 @@ const unsigned short wFB_Opt1[2][5] = { /*--------------------- Static Functions --------------------------*/ - - static void s_vFillTxKey( @@ -126,8 +122,6 @@ s_vFillTxKey( unsigned char *pMICHDR ); - - static void s_vFillRTSHead( @@ -158,8 +152,6 @@ s_vGenerateTxParameter( unsigned short wCurrentRate ); - - static void s_vFillFragParameter( PSDevice pDevice, unsigned char *pbyBuffer, @@ -169,14 +161,12 @@ static void s_vFillFragParameter( unsigned int cbReqCount ); - static unsigned int s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyTxBufferAddr, unsigned int cbFrameBodySize, unsigned int uDMAIdx, PSTxDesc pHeadTD, PSEthernetHeader psEthHeader, unsigned char *pPacket, bool bNeedEncrypt, PSKeyItem pTransmitKey, unsigned int uNodeIndex, unsigned int *puMACfragNum); - static unsigned int s_uFillDataHead( @@ -193,11 +183,8 @@ s_uFillDataHead( unsigned short wCurrentRate ); - /*--------------------- Export Variables --------------------------*/ - - static void s_vFillTxKey( @@ -217,8 +204,6 @@ s_vFillTxKey( unsigned long dwRevIVCounter; unsigned char byKeyIndex = 0; - - //Fill TXKEY if (pTransmitKey == NULL) return; @@ -315,7 +300,6 @@ s_vFillTxKey( } } - static void s_vSWencryption( @@ -357,9 +341,6 @@ s_vSWencryption( } } - - - /*byPktType : PK_TYPE_11A 0 PK_TYPE_11B 1 PK_TYPE_11GB 2 @@ -406,7 +387,6 @@ s_uGetRTSCTSRsvTime( uRrvTime = uRTSTime = uCTSTime = uAckTime = uDataTime = 0; - uDataTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, cbFrameLength, wCurrentRate); if (byRTSRsvType == 0) { //RTSTxRrvTime_bb uRTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 20, pDevice->byTopCCKBasicRate); @@ -449,15 +429,11 @@ s_uGetDataDuration( bool bLastFrag = 0; unsigned int uAckTime = 0, uNextPktTime = 0; - - if (uFragIdx == (uMACfragNum-1)) { bLastFrag = 1; } - switch (byDurType) { - case DATADUR_B: //DATADUR_B if (((uMACfragNum == 1)) || (bLastFrag == 1)) {//Non Frag or Last Frag if (bNeedAck) { @@ -596,7 +572,6 @@ s_uGetDataDuration( return 0; } - //byFreqType: 0=>5GHZ 1=>2.4GHZ static unsigned int @@ -612,9 +587,7 @@ s_uGetRTSCTSDuration( { unsigned int uCTSTime = 0, uDurTime = 0; - switch (byDurType) { - case RTSDUR_BB: //RTSDuration_bb uCTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate); uDurTime = uCTSTime + 2*pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck); @@ -691,11 +664,8 @@ s_uGetRTSCTSDuration( } return uDurTime; - } - - static unsigned int s_uFillDataHead( @@ -825,7 +795,6 @@ s_uFillDataHead( return 0; } - static void s_vFillRTSHead( @@ -990,7 +959,6 @@ 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]), ETH_ALEN); @@ -1042,7 +1010,6 @@ s_vFillCTSHead( (unsigned short *)&(wLen), (unsigned char *)&(pBuf->byServiceField_b), (unsigned char *)&(pBuf->bySignalField_b) ); - pBuf->wTransmitLength_b = cpu_to_le16(wLen); pBuf->wDuration_ba = (unsigned short)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA, cbFrameLength, byPktType, wCurrentRate, bNeedAck, byFBOption); //3:CTSDuration_ba, 1:2.4G, 2,3:2.4G OFDM Data @@ -1083,11 +1050,6 @@ s_vFillCTSHead( } } - - - - - /*+ * * Description: @@ -1152,7 +1114,6 @@ s_vGenerateTxParameter( cbMACHdLen = WLAN_HDR_ADDR3_LEN + 6; if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) { - if (pvRTS != NULL) { //RTS_need //Fill RsvTime if (pvRrvTime) { @@ -1175,12 +1136,10 @@ s_vGenerateTxParameter( pBuf->wCTSTxRrvTime_ba = cpu_to_le16((unsigned short)s_uGetRTSCTSRsvTime(pDevice, 3, byPktType, cbFrameSize, wCurrentRate));//3:CTSTxRrvTime_Ba, 1:2.4GHz } - //Fill CTS s_vFillCTSHead(pDevice, uDMAIdx, byPktType, pvCTS, cbFrameSize, bNeedACK, bDisCRC, wCurrentRate, byFBOption); } } else if (byPktType == PK_TYPE_11A) { - if (pvRTS != NULL) {//RTS_need, non PCF mode //Fill RsvTime if (pvRrvTime) { @@ -1198,7 +1157,6 @@ s_vGenerateTxParameter( } } } else if (byPktType == PK_TYPE_11B) { - if ((pvRTS != NULL)) {//RTS_need, non PCF mode //Fill RsvTime if (pvRrvTime) { @@ -1329,13 +1287,11 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT bool bIsWEP256 = false; PSMgmtObject pMgmt = pDevice->pMgmt; - pvRrvTime = pMICHDR = pvRTS = pvCTS = pvTxDataHd = NULL; //DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "s_cbFillTxBufHead...\n"); if ((pDevice->eOPMode == OP_MODE_ADHOC) || (pDevice->eOPMode == OP_MODE_AP)) { - if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0]))) bNeedACK = false; else @@ -1352,7 +1308,6 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT else cbMACHdLen = WLAN_HDR_ADDR3_LEN; - if ((bNeedEncrypt == true) && (pTransmitKey != NULL)) { if (pTransmitKey->byCipherSuite == KEY_CTL_WEP) { cbIVlen = 4; @@ -1378,7 +1333,6 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT } } - cbFrameSize = cbMACHdLen + cbIVlen + (cbFrameBodySize + cbMIClen) + cbICVlen + cbFCSlen; if ((bNeedACK == false) || @@ -1527,7 +1481,6 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Start Fragmentation...\n"); wFragType = FRAGCTL_STAFRAG; - //Fill FIFO,RrvTime,RTS,and CTS s_vGenerateTxParameter(pDevice, byPktType, (void *)psTxBufHd, pvRrvTime, pvRTS, pvCTS, cbFragmentSize, bNeedACK, uDMAIdx, psEthHeader, pDevice->wCurrentRate); @@ -1549,7 +1502,6 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT } } - // 802.1H if (ntohs(psEthHeader->wType) > ETH_DATA_LEN) { if ((psEthHeader->wType == TYPE_PKT_IPX) || @@ -1576,7 +1528,6 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT // Copy the Packet into a tx Buffer memcpy((pbyBuffer + uLength), (pPacket + 14), (cbFragPayloadSize - cb802_1_H_len)); - uTotalCopyLength += cbFragPayloadSize - cb802_1_H_len; if ((bNeedEncrypt == true) && (pTransmitKey != NULL) && (pTransmitKey->byCipherSuite == KEY_CTL_TKIP)) { @@ -1643,14 +1594,11 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT } - cbReqCount = cbHeaderLength + cbMACHdLen + uPadding + cbIVlen + cbLastFragPayloadSize; //--------------------------- // S/W or H/W Encryption //--------------------------- - - pbyBuffer = (unsigned char *)pHeadTD->pTDInfo->buf; //pbyBuffer = (unsigned char *)pDevice->aamTxBuf[uDMAIdx][tmpDescIdx].pbyVAddr; @@ -1661,7 +1609,6 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT // Copy the Packet into a tx Buffer if (bMIC2Frag == false) { - memcpy((pbyBuffer + uLength), (pPacket + 14 + uTotalCopyLength), (cbLastFragPayloadSize - cbMIClen) @@ -1709,7 +1656,6 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT ASSERT(uTmpLen == (cbLastFragPayloadSize - cbMIClen)); } - //--------------------------- // S/W Encryption //--------------------------- @@ -1730,7 +1676,6 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT //5.Get S/W generate FCS //-------------------- - s_vFillFragParameter(pDevice, pbyBuffer, uDMAIdx, (void *)ptdCurr, wFragType, cbReqCount); ptdCurr->pTDInfo->dwReqCount = cbReqCount - uPadding; @@ -1760,7 +1705,6 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT vGenerateMACHeader(pDevice, pbyMacHdr, (unsigned short)uDuration, psEthHeader, bNeedEncrypt, wFragType, uDMAIdx, uFragIdx); - if (bNeedEncrypt == true) { //Fill TXKEY s_vFillTxKey(pDevice, (unsigned char *)(psTxBufHd->adwTxKey), pbyIVHead, pTransmitKey, @@ -1793,7 +1737,6 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT uTotalCopyLength += uTmpLen; if ((bNeedEncrypt == true) && (pTransmitKey != NULL) && (pTransmitKey->byCipherSuite == KEY_CTL_TKIP)) { - MIC_vAppend((pbyBuffer + uLength), uTmpLen); if (uTmpLen < cbFragPayloadSize) { @@ -1920,7 +1863,6 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT ); if ((bNeedEncrypt == true) && (pTransmitKey != NULL) && (pTransmitKey->byCipherSuite == KEY_CTL_TKIP)) { - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Length:%d, %d\n", cbFrameBodySize - cb802_1_H_len, uLength); /* for (ii = 0; ii < (cbFrameBodySize - cb802_1_H_len); ii++) { @@ -1937,7 +1879,6 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT MIC_vGetMIC(pdwMIC_L, pdwMIC_R); MIC_vUnInit(); - if (pDevice->bTxMICFail == true) { *pdwMIC_L = 0; *pdwMIC_R = 0; @@ -1956,7 +1897,6 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT } - if ((pDevice->byLocalID <= REV_ID_VT3253_A1)) { if (bNeedEncrypt) { s_vSWencryption(pDevice, pTransmitKey, (pbyBuffer + uLength - cb802_1_H_len), @@ -1965,7 +1905,6 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT } } - ptdCurr = (PSTxDesc)pHeadTD; ptdCurr->pTDInfo->dwReqCount = cbReqCount - uPadding; @@ -1978,7 +1917,6 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT pDevice->iTDUsed[uDMAIdx]++; - // DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " ptdCurr->m_dwReserved0[%d] ptdCurr->m_dwReserved1[%d].\n", ptdCurr->pTDInfo->dwReqCount, ptdCurr->pTDInfo->dwHeaderLength); // DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " cbHeaderLength[%d]\n", cbHeaderLength); @@ -1988,7 +1926,6 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT return cbHeaderLength; } - void vGenerateFIFOHeader(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyTxBufferAddr, bool bNeedEncrypt, unsigned int cbPayloadSize, unsigned int uDMAIdx, @@ -2024,7 +1961,6 @@ vGenerateFIFOHeader(PSDevice pDevice, unsigned char byPktType, unsigned char *pb bIsAdhoc = false; } - pTxBufHead->wFIFOCtl |= FIFOCTL_TMOEN; pTxBufHead->wTimeStamp = cpu_to_le16(DEFAULT_MSDU_LIFETIME_RES_64us); @@ -2036,7 +1972,6 @@ vGenerateFIFOHeader(PSDevice pDevice, unsigned char byPktType, unsigned char *pb pTxBufHead->wFIFOCtl |= FIFOCTL_GENINT; - //Set FIFOCTL_ISDMA0 if (TYPE_TXDMA0 == uDMAIdx) { pTxBufHead->wFIFOCtl |= FIFOCTL_ISDMA0; @@ -2096,9 +2031,6 @@ vGenerateFIFOHeader(PSDevice pDevice, unsigned char byPktType, unsigned char *pb #endif pTxBufHead->byTxPower = pDevice->byCurPwr; - - - /* if (pDevice->bEnableHostWEP) pTxBufHead->wFragCtl &= ~(FRAGCTL_TKIP | FRAGCTL_LEGACY |FRAGCTL_AES); @@ -2110,9 +2042,6 @@ vGenerateFIFOHeader(PSDevice pDevice, unsigned char byPktType, unsigned char *pb return; } - - - /*+ * * Description: @@ -2198,13 +2127,7 @@ vGenerateMACHeader( } } - - - - - CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { - PSTxDesc pFrstTD; unsigned char byPktType; unsigned char *pbyTxBufferAddr; @@ -2233,7 +2156,6 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { PSMgmtObject pMgmt = pDevice->pMgmt; unsigned short wCurrentRate = RATE_1M; - if (AVAIL_TD(pDevice, TYPE_TXDMA0) <= 0) { return CMD_STATUS_RESOURCES; } @@ -2258,7 +2180,6 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { // And cmd timer will wait data pkt TX finish before scanning so it's OK // to set power here. if (pDevice->pMgmt->eScanState != WMAC_NO_SCANNING) { - RFbSetPower(pDevice, wCurrentRate, pDevice->byCurrentCh); } else { RFbSetPower(pDevice, wCurrentRate, pMgmt->uCurrChannel); @@ -2286,7 +2207,6 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { pTxBufHead->wFIFOCtl |= FIFOCTL_TMOEN; pTxBufHead->wTimeStamp = cpu_to_le16(DEFAULT_MGN_LIFETIME_RES_64us); - if (is_multicast_ether_addr(&(pPacket->p80211Header->sA3.abyAddr1[0]))) bNeedACK = false; else { @@ -2296,7 +2216,6 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { if ((pMgmt->eCurrMode == WMAC_MODE_ESS_AP) || (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA)) { - pTxBufHead->wFIFOCtl |= FIFOCTL_LRETRY; } @@ -2376,7 +2295,6 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { //========================= pTxBufHead->wFragCtl |= (unsigned short)FRAGCTL_NONFRAG; - //Fill FIFO,RrvTime,RTS,and CTS s_vGenerateTxParameter(pDevice, byPktType, pbyTxBufferAddr, pvRrvTime, pvRTS, pCTS, cbFrameSize, bNeedACK, TYPE_TXDMA0, &sEthHeader, wCurrentRate); @@ -2463,7 +2381,6 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { } } - // first TD is the only TD //Set TSR1 & ReqCount in TxDescHead pFrstTD->m_td1TD1.byTCR = (TCR_STP | TCR_EDP | EDMSDU); @@ -2498,12 +2415,9 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { MACvTransmit0(pDevice->PortOffset); return CMD_STATUS_PENDING; - } - CMD_STATUS csBeacon_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { - unsigned char byPktType; unsigned char *pbyBuffer = (unsigned char *)pDevice->tx_beacon_bufs; unsigned int cbFrameSize = pPacket->cbMPDULen + WLAN_FCS_LEN; @@ -2515,7 +2429,6 @@ CMD_STATUS csBeacon_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { unsigned short wCurrentRate; unsigned short wLen = 0x0000; - memset(pTxBufHead, 0, wTxBufSize); if (pDevice->eCurrentPHYType == PHY_TYPE_11A) { @@ -2533,7 +2446,6 @@ CMD_STATUS csBeacon_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { pTxBufHead->wFIFOCtl |= FIFOCTL_GENINT; - //Set packet type & Get Duration if (byPktType == PK_TYPE_11A) {//0000 0000 0000 0000 pTxDataHead->wDuration = cpu_to_le16((unsigned short)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameSize, byPktType, @@ -2576,8 +2488,6 @@ CMD_STATUS csBeacon_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) { return CMD_STATUS_PENDING; } - - unsigned int cbGetFragCount( PSDevice pDevice, @@ -2598,8 +2508,6 @@ cbGetFragCount( unsigned int uMACfragNum = 1; bool bNeedACK; - - if ((pDevice->eOPMode == OP_MODE_ADHOC) || (pDevice->eOPMode == OP_MODE_AP)) { if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0]))) @@ -2616,9 +2524,7 @@ cbGetFragCount( else cbMACHdLen = WLAN_HDR_ADDR3_LEN; - if (pDevice->bEncryptionEnable == true) { - if (pTransmitKey == NULL) { if ((pDevice->eEncryptionStatus == Ndis802_11Encryption1Enabled) || (pDevice->pMgmt->eAuthenMode < WMAC_AUTH_WPA)) { @@ -2662,10 +2568,8 @@ cbGetFragCount( return uMACfragNum; } - void vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, unsigned int cbMPDULen) { - PSTxDesc pFrstTD; unsigned char byPktType; unsigned char *pbyTxBufferAddr; @@ -2711,7 +2615,6 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un unsigned int cbExtSuppRate = 0; // PWLAN_IE pItem; - pvRrvTime = pMICHDR = pvRTS = pvCTS = pvTxDataHd = NULL; if (cbMPDULen <= WLAN_HDR_ADDR3_LEN) { @@ -2721,7 +2624,6 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un } p80211Header = (PUWLAN_80211HDR)pbMPDU; - pFrstTD = pDevice->apCurrTD[TYPE_TXDMA0]; pbyTxBufferAddr = (unsigned char *)pFrstTD->pTDInfo->buf; pTxBufHead = (PSTxBufHead) pbyTxBufferAddr; @@ -2771,7 +2673,6 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un pTxBufHead->wFIFOCtl |= FIFOCTL_TMOEN; pTxBufHead->wTimeStamp = cpu_to_le16(DEFAULT_MGN_LIFETIME_RES_64us); - if (is_multicast_ether_addr(&(p80211Header->sA3.abyAddr1[0]))) { bNeedACK = false; if (pDevice->bEnableHostWEP) { @@ -2789,7 +2690,6 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un if ((pMgmt->eCurrMode == WMAC_MODE_ESS_AP) || (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA)) { - pTxBufHead->wFIFOCtl |= FIFOCTL_LRETRY; } @@ -2804,7 +2704,6 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un // hostapd deamon ext support rate patch if (WLAN_GET_FC_FSTYPE(p80211Header->sA4.wFrameCtl) == WLAN_FSTYPE_ASSOCRESP) { - if (((PWLAN_IE_SUPP_RATES)pMgmt->abyCurrSuppRates)->len != 0) { cbExtSuppRate += ((PWLAN_IE_SUPP_RATES)pMgmt->abyCurrSuppRates)->len + WLAN_IEHDR_LEN; } @@ -2818,7 +2717,6 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un } } - //Set FRAGCTL_MACHDCNT pTxBufHead->wFragCtl |= cpu_to_le16((unsigned short)cbMacHdLen << 10); @@ -2827,7 +2725,6 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un // no one will send a MMPDU under fragmentation. With RTS may occur. pDevice->bAES = false; //Set FRAGCTL_WEPTYP - if (WLAN_GET_FC_ISWEP(p80211Header->sA4.wFrameCtl) != 0) { if (pDevice->eEncryptionStatus == Ndis802_11Encryption1Enabled) { cbIVlen = 4; @@ -2861,7 +2758,6 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un } //the rest of pTxBufHead->wFragCtl:FragTyp will be set later in s_vFillFragParameter() - if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {//802.11g packet pvRrvTime = (PSRrvTime_gCTS) (pbyTxBufferAddr + wTxBufSize); @@ -2890,7 +2786,6 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un //========================= pTxBufHead->wFragCtl |= (unsigned short)FRAGCTL_NONFRAG; - //Fill FIFO,RrvTime,RTS,and CTS s_vGenerateTxParameter(pDevice, byPktType, pbyTxBufferAddr, pvRrvTime, pvRTS, pvCTS, cbFrameSize, bNeedACK, TYPE_TXDMA0, &sEthHeader, wCurrentRate); @@ -2932,7 +2827,6 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un // Set wep if (WLAN_GET_FC_ISWEP(p80211Header->sA4.wFrameCtl) != 0) { - if (pDevice->bEnableHostWEP) { pTransmitKey = &STempKey; pTransmitKey->byCipherSuite = pMgmt->sNodeDBTable[uNodeIndex].byCipherSuite; @@ -2947,7 +2841,6 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un } if ((pTransmitKey != NULL) && (pTransmitKey->byCipherSuite == KEY_CTL_TKIP)) { - dwMICKey0 = *(unsigned long *)(&pTransmitKey->abyKey[16]); dwMICKey1 = *(unsigned long *)(&pTransmitKey->abyKey[20]); @@ -2980,7 +2873,6 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un } - s_vFillTxKey(pDevice, (unsigned char *)(pTxBufHead->adwTxKey), pbyIVHead, pTransmitKey, pbyMacHdr, (unsigned short)cbFrameBodySize, (unsigned char *)pMICHDR); @@ -2999,7 +2891,6 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un if (pDevice->wSeqCounter > 0x0fff) pDevice->wSeqCounter = 0; - if (bIsPSPOLL) { // The MAC will automatically replace the Duration-field of MAC header by Duration-field // of FIFO control header. @@ -3014,7 +2905,6 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un } } - // first TD is the only TD //Set TSR1 & ReqCount in TxDescHead pFrstTD->pTDInfo->skb = skb; @@ -3048,5 +2938,3 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un return; } - - diff --git a/drivers/staging/vt6655/rxtx.h b/drivers/staging/vt6655/rxtx.h index b5f0f56216cb..4f2cf34dc39f 100644 --- a/drivers/staging/vt6655/rxtx.h +++ b/drivers/staging/vt6655/rxtx.h @@ -50,7 +50,6 @@ bool bIsWEP, unsigned int *pcbHeadSize); */ - void vGenerateMACHeader( PSDevice pDevice, @@ -63,7 +62,6 @@ vGenerateMACHeader( unsigned int uFragIdx ); - unsigned int cbGetFragCount( PSDevice pDevice, @@ -72,14 +70,12 @@ cbGetFragCount( PSEthernetHeader psEthHeader ); - void vGenerateFIFOHeader(PSDevice pDevice, unsigned char byPktTyp, unsigned char *pbyTxBufferAddr, bool bNeedEncrypt, unsigned int cbPayloadSize, unsigned int uDMAIdx, PSTxDesc pHeadTD, PSEthernetHeader psEthHeader, unsigned char *pPacket, PSKeyItem pTransmitKey, unsigned int uNodeIndex, unsigned int *puMACfragNum, unsigned int *pcbHeaderSize); - void vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, unsigned int cbMPDULen); CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket); CMD_STATUS csBeacon_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket); diff --git a/drivers/staging/vt6655/srom.c b/drivers/staging/vt6655/srom.c index 8c95d1b35967..eaddc33c9d2d 100644 --- a/drivers/staging/vt6655/srom.c +++ b/drivers/staging/vt6655/srom.c @@ -60,9 +60,6 @@ /*--------------------- Export Functions --------------------------*/ - - - /* * Description: Read a byte from EEPROM, by MAC I2C * @@ -110,7 +107,6 @@ unsigned char SROMbyReadEmbedded(unsigned long dwIoBase, unsigned char byContntO return byData; } - /* * Description: Write a byte to EEPROM, by MAC I2C * @@ -163,7 +159,6 @@ bool SROMbWriteEmbedded(unsigned long dwIoBase, unsigned char byContntOffset, un return true; } - /* * Description: Turn bits on in eeprom * @@ -186,7 +181,6 @@ void SROMvRegBitsOn(unsigned long dwIoBase, unsigned char byContntOffset, unsign SROMbWriteEmbedded(dwIoBase, byContntOffset, (unsigned char)(byOrgData | byBits)); } - /* * Description: Turn bits off in eeprom * @@ -207,7 +201,6 @@ void SROMvRegBitsOff(unsigned long dwIoBase, unsigned char byContntOffset, unsig SROMbWriteEmbedded(dwIoBase, byContntOffset, (unsigned char)(byOrgData & (~byBits))); } - /* * Description: Test if bits on in eeprom * @@ -230,7 +223,6 @@ bool SROMbIsRegBitsOn(unsigned long dwIoBase, unsigned char byContntOffset, unsi return (byOrgData & byTestBits) == byTestBits; } - /* * Description: Test if bits off in eeprom * @@ -253,7 +245,6 @@ bool SROMbIsRegBitsOff(unsigned long dwIoBase, unsigned char byContntOffset, uns return !(byOrgData & byTestBits); } - /* * Description: Read all contents of eeprom to buffer * @@ -277,7 +268,6 @@ void SROMvReadAllContents(unsigned long dwIoBase, unsigned char *pbyEepromRegs) } } - /* * Description: Write all contents of buffer to eeprom * @@ -302,7 +292,6 @@ void SROMvWriteAllContents(unsigned long dwIoBase, unsigned char *pbyEepromRegs) } } - /* * Description: Read Ethernet Address from eeprom to buffer * @@ -326,7 +315,6 @@ void SROMvReadEtherAddress(unsigned long dwIoBase, unsigned char *pbyEtherAddres } } - /* * Description: Write Ethernet Address from buffer to eeprom * @@ -351,7 +339,6 @@ void SROMvWriteEtherAddress(unsigned long dwIoBase, unsigned char *pbyEtherAddre } } - /* * Description: Read Sub_VID and Sub_SysId from eeprom to buffer * @@ -416,5 +403,3 @@ bool SROMbAutoLoad(unsigned long dwIoBase) return false; return true; } - - diff --git a/drivers/staging/vt6655/srom.h b/drivers/staging/vt6655/srom.h index 32cf1093f4f7..1df58c516ddc 100644 --- a/drivers/staging/vt6655/srom.h +++ b/drivers/staging/vt6655/srom.h @@ -69,7 +69,6 @@ //}} #define EEP_OFS_OFDMA_PWR_dBm 0xD2 - //----------need to remove -------------------- #define EEP_OFS_BBTAB_LEN 0x70 // BB Table Length #define EEP_OFS_BBTAB_ADR 0x71 // BB Table Offset @@ -77,7 +76,6 @@ #define EEP_I2C_DEV_ID 0x50 // EEPROM device address on the I2C bus - // // Bits in EEP_OFS_ANTENNA // diff --git a/drivers/staging/vt6655/tcrc.c b/drivers/staging/vt6655/tcrc.c index ec14033b0116..ed6868a9c16e 100644 --- a/drivers/staging/vt6655/tcrc.c +++ b/drivers/staging/vt6655/tcrc.c @@ -113,9 +113,6 @@ static const unsigned long s_adwCrc32Table[256] = { /*--------------------- Export Variables --------------------------*/ - - - /*+ * * Description: @@ -145,7 +142,6 @@ unsigned long CRCdwCrc32(unsigned char *pbyData, unsigned int cbByte, unsigned l return dwCrc; } - /*+ * * Description: @@ -169,7 +165,6 @@ unsigned long CRCdwGetCrc32(unsigned char *pbyData, unsigned int cbByte) return ~CRCdwCrc32(pbyData, cbByte, 0xFFFFFFFFL); } - /*+ * * Description: @@ -194,5 +189,3 @@ unsigned long CRCdwGetCrc32Ex(unsigned char *pbyData, unsigned int cbByte, unsig { return CRCdwCrc32(pbyData, cbByte, dwPreCRC); } - - diff --git a/drivers/staging/vt6655/tcrc.h b/drivers/staging/vt6655/tcrc.h index a2044212d1c9..82b5ddafae55 100644 --- a/drivers/staging/vt6655/tcrc.h +++ b/drivers/staging/vt6655/tcrc.h @@ -48,6 +48,3 @@ unsigned long CRCdwGetCrc32(unsigned char *pbyData, unsigned int cbByte); unsigned long CRCdwGetCrc32Ex(unsigned char *pbyData, unsigned int cbByte, unsigned long dwPreCRC); #endif // __TCRC_H__ - - - diff --git a/drivers/staging/vt6655/tether.c b/drivers/staging/vt6655/tether.c index bb47d3b4318f..a5dc3c09cfd7 100644 --- a/drivers/staging/vt6655/tether.c +++ b/drivers/staging/vt6655/tether.c @@ -47,8 +47,6 @@ /*--------------------- Export Variables --------------------------*/ - - /* * Description: Calculate multicast hash value by CRC32 * @@ -82,7 +80,6 @@ unsigned char ETHbyGetHashIndexByCrc32(unsigned char *pbyMultiAddr) return byHash >> 2; } - /* * Description: Check CRC value of the buffer if Ok or not * @@ -106,4 +103,3 @@ bool ETHbIsBufferCrc32Ok(unsigned char *pbyBuffer, unsigned int cbFrameLength) } return true; } - diff --git a/drivers/staging/vt6655/tether.h b/drivers/staging/vt6655/tether.h index 0c0a625e9c80..94cc8830d8cc 100644 --- a/drivers/staging/vt6655/tether.h +++ b/drivers/staging/vt6655/tether.h @@ -43,7 +43,6 @@ #define U_MULTI_ADDR_LEN 8 // multicast address length - #ifdef __BIG_ENDIAN #define TYPE_PKT_IP 0x0800 // @@ -89,7 +88,6 @@ #define TYPE_CTL_CTS 0xc400 #define TYPE_CTL_ACK 0xd400 - #else //if LITTLE_ENDIAN // // wType field in the SEthernetHeader @@ -140,8 +138,6 @@ #define TYPE_CTL_CTS 0x00c4 #define TYPE_CTL_ACK 0x00d4 - - #endif //#ifdef __BIG_ENDIAN #define WEP_IV_MASK 0x00FFFFFF @@ -157,7 +153,6 @@ typedef struct tagSEthernetHeader { } __attribute__ ((__packed__)) SEthernetHeader, *PSEthernetHeader; - // // 802_3 packet // @@ -195,6 +190,3 @@ unsigned char ETHbyGetHashIndexByCrc32(unsigned char *pbyMultiAddr); bool ETHbIsBufferCrc32Ok(unsigned char *pbyBuffer, unsigned int cbFrameLength); #endif // __TETHER_H__ - - - diff --git a/drivers/staging/vt6655/tkip.c b/drivers/staging/vt6655/tkip.c index 83f9a410144d..b3e087e19034 100644 --- a/drivers/staging/vt6655/tkip.c +++ b/drivers/staging/vt6655/tkip.c @@ -125,7 +125,6 @@ const unsigned char TKIP_Sbox_Upper[256] = { 0x82, 0x29, 0x5A, 0x1E, 0x7B, 0xA8, 0x6D, 0x2C }; - //STKIPKeyManagement sTKIPKeyTable[MAX_TKIP_KEY]; /*--------------------- Static Functions --------------------------*/ @@ -154,7 +153,6 @@ unsigned int tkip_sbox(unsigned int index) return left ^ right; }; - unsigned int rotr1(unsigned int a) { unsigned int b; @@ -168,7 +166,6 @@ unsigned int rotr1(unsigned int a) return b; } - /* * Description: Calculate RC4Key fom TK, TA, and TSC * diff --git a/drivers/staging/vt6655/tkip.h b/drivers/staging/vt6655/tkip.h index b7191fac753d..3b6357ac6dee 100644 --- a/drivers/staging/vt6655/tkip.h +++ b/drivers/staging/vt6655/tkip.h @@ -55,6 +55,3 @@ void TKIPvMixKey( ); #endif // __TKIP_H__ - - - diff --git a/drivers/staging/vt6655/tmacro.h b/drivers/staging/vt6655/tmacro.h index e8b177d4128b..59c6e72f993a 100644 --- a/drivers/staging/vt6655/tmacro.h +++ b/drivers/staging/vt6655/tmacro.h @@ -58,5 +58,3 @@ #endif #endif // __TMACRO_H__ - - diff --git a/drivers/staging/vt6655/ttype.h b/drivers/staging/vt6655/ttype.h index 114ac3024e4e..b1d8ae732774 100644 --- a/drivers/staging/vt6655/ttype.h +++ b/drivers/staging/vt6655/ttype.h @@ -26,11 +26,9 @@ * */ - #ifndef __TTYPE_H__ #define __TTYPE_H__ - /******* Common definitions and typedefs ***********************************/ #ifndef TxInSleep diff --git a/drivers/staging/vt6655/upc.h b/drivers/staging/vt6655/upc.h index 6aabb0df747b..155e66439073 100644 --- a/drivers/staging/vt6655/upc.h +++ b/drivers/staging/vt6655/upc.h @@ -34,7 +34,6 @@ /*--------------------- Export Definitions -------------------------*/ - // // For IO mapped // @@ -71,14 +70,12 @@ do { \ // For memory mapped IO // - #define VNSvInPortB(dwIOAddress, pbyData) \ do { \ volatile unsigned char *pbyAddr = (unsigned char *)(dwIOAddress); \ *(pbyData) = readb(pbyAddr); \ } while (0) - #define VNSvInPortW(dwIOAddress, pwData) \ do { \ volatile unsigned short *pwAddr = (unsigned short *)(dwIOAddress); \ @@ -97,7 +94,6 @@ do { \ writeb((unsigned char)byData, pbyAddr); \ } while (0) - #define VNSvOutPortW(dwIOAddress, wData) \ do { \ volatile unsigned short *pwAddr = ((unsigned short *)(dwIOAddress)); \ @@ -112,7 +108,6 @@ do { \ #endif - // // ALWAYS IO-Mapped IO when in 16-bit/32-bit environment // @@ -153,15 +148,10 @@ do { \ } \ } while (0) - /*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Variables --------------------------*/ /*--------------------- Export Functions --------------------------*/ - - - #endif // __UPC_H__ - diff --git a/drivers/staging/vt6655/vntwifi.c b/drivers/staging/vt6655/vntwifi.c index 64d43efe9f14..d8f4f8e7d05e 100644 --- a/drivers/staging/vt6655/vntwifi.c +++ b/drivers/staging/vt6655/vntwifi.c @@ -78,7 +78,6 @@ VNTWIFIvSetOPMode( pMgmt->eConfigMode = eOPMode; } - /*+ * * Description: @@ -183,8 +182,6 @@ VNTWIFIwGetAssocID( return pMgmt->wCurrAID; } - - /*+ * * Description: @@ -354,8 +351,6 @@ VNTWIFIvSetEncryptionMode( } } - - bool VNTWIFIbConfigPhyMode( void *pMgmtHandle, @@ -376,7 +371,6 @@ VNTWIFIbConfigPhyMode( return true; } - void VNTWIFIbGetConfigPhyMode( void *pMgmtHandle, @@ -405,7 +399,6 @@ VNTWIFIbGetConfigPhyMode( * -*/ - /*+ * * Description: @@ -445,9 +438,6 @@ VNTWIFIvQueryBSSList(void *pMgmtHandle, unsigned int *puBSSCount, void **pvFirst *puBSSCount = uCount; } - - - void VNTWIFIvGetNextBSS( void *pMgmtHandle, @@ -472,10 +462,6 @@ VNTWIFIvGetNextBSS( } } - - - - /*+ * * Description: @@ -522,7 +508,6 @@ VNTWIFIvUpdateNodeTxCounter( return; } - void VNTWIFIvGetTxRate( void *pMgmtHandle, @@ -542,7 +527,6 @@ VNTWIFIvGetTxRate( PWLAN_IE_SUPP_RATES pSupportRateIEs = NULL; PWLAN_IE_SUPP_RATES pExtSupportRateIEs = NULL; - if ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) || (pMgmt->eCurrMode == WMAC_MODE_ESS_AP)) { // Adhoc Tx rate decided from node DB @@ -567,7 +551,6 @@ VNTWIFIvGetTxRate( pMgmt->sNodeDBTable[0].abyMACAddr, wTxDataRate); #endif - pSupportRateIEs = (PWLAN_IE_SUPP_RATES) pMgmt->abyCurrSuppRates; pExtSupportRateIEs = (PWLAN_IE_SUPP_RATES) pMgmt->abyCurrExtSuppRates; } @@ -608,18 +591,15 @@ VNTWIFIbyGetKeyCypher( } } - /* bool VNTWIFIbInit( void *pAdapterHandler, void **pMgmtHandler ) { - PSMgmtObject pMgmt = NULL; unsigned int ii; - pMgmt = (PSMgmtObject)kmalloc(sizeof(SMgmtObject), (int)GFP_ATOMIC); if (pMgmt == NULL) { *pMgmtHandler = NULL; @@ -651,8 +631,6 @@ VNTWIFIbyGetKeyCypher( } */ - - bool VNTWIFIbSetPMKIDCache( void *pMgmtObject, @@ -670,8 +648,6 @@ VNTWIFIbSetPMKIDCache( return true; } - - unsigned short VNTWIFIwGetMaxSupportRate( void *pMgmtObject @@ -692,7 +668,6 @@ VNTWIFIwGetMaxSupportRate( } } - void VNTWIFIvSet11h( void *pMgmtObject, @@ -763,7 +738,6 @@ VNTWIFIbMeasureReport( return true; } - bool VNTWIFIbChannelSwitch( void *pMgmtObject, @@ -800,4 +774,3 @@ VNTWIFIbChannelSwitch( return true; } */ - diff --git a/drivers/staging/vt6655/vntwifi.h b/drivers/staging/vt6655/vntwifi.h index 49a0a02fe14c..4b01ebd7299a 100644 --- a/drivers/staging/vt6655/vntwifi.h +++ b/drivers/staging/vt6655/vntwifi.h @@ -64,7 +64,6 @@ // Pre-configured Authenticaiton Mode (from XP) typedef enum tagWMAC_AUTHENTICATION_MODE { - WMAC_AUTH_OPEN, WMAC_AUTH_SHAREKEY, WMAC_AUTH_AUTO, @@ -74,11 +73,9 @@ typedef enum tagWMAC_AUTHENTICATION_MODE { WMAC_AUTH_WPA2, WMAC_AUTH_WPA2PSK, WMAC_AUTH_MAX // Not a real mode, defined as upper bound - } WMAC_AUTHENTICATION_MODE, *PWMAC_AUTHENTICATION_MODE; typedef enum tagWMAC_ENCRYPTION_MODE { - WMAC_ENCRYPTION_WEPEnabled, WMAC_ENCRYPTION_WEPDisabled, WMAC_ENCRYPTION_WEPKeyAbsent, @@ -87,28 +84,21 @@ typedef enum tagWMAC_ENCRYPTION_MODE { WMAC_ENCRYPTION_TKIPKeyAbsent, WMAC_ENCRYPTION_AESEnabled, WMAC_ENCRYPTION_AESKeyAbsent - } WMAC_ENCRYPTION_MODE, *PWMAC_ENCRYPTION_MODE; // Pre-configured Mode (from XP) typedef enum tagWMAC_CONFIG_MODE { - WMAC_CONFIG_ESS_STA = 0, WMAC_CONFIG_IBSS_STA, WMAC_CONFIG_AUTO, WMAC_CONFIG_AP - } WMAC_CONFIG_MODE, *PWMAC_CONFIG_MODE; - - typedef enum tagWMAC_POWER_MODE { - WMAC_POWER_CAM, WMAC_POWER_FAST, WMAC_POWER_MAX - } WMAC_POWER_MODE, *PWMAC_POWER_MODE; #define VNTWIFIbIsShortSlotTime(wCapInfo) \ @@ -129,15 +119,12 @@ typedef enum tagWMAC_POWER_MODE { #define VNTWIFIbIsESS(wCapInfo) \ WLAN_GET_CAP_INFO_ESS(wCapInfo) \ - /*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Variables --------------------------*/ - /*--------------------- Export Types ------------------------------*/ - /*--------------------- Export Functions --------------------------*/ void @@ -194,7 +181,6 @@ VNTWIFIvSetEncryptionMode( WMAC_ENCRYPTION_MODE eEncryptionMode ); - bool VNTWIFIbConfigPhyMode( void *pMgmtHandle, @@ -218,8 +204,6 @@ VNTWIFIvGetNextBSS( void **pvNextBSS ); - - void VNTWIFIvUpdateNodeTxCounter( void *pMgmtHandle, @@ -229,7 +213,6 @@ VNTWIFIvUpdateNodeTxCounter( unsigned char *pbyTxFailCount ); - void VNTWIFIvGetTxRate( void *pMgmtHandle, @@ -253,9 +236,6 @@ VNTWIFIbyGetKeyCypher( bool bGroupKey ); - - - bool VNTWIFIbSetPMKIDCache( void *pMgmtObject, diff --git a/drivers/staging/vt6655/wcmd.c b/drivers/staging/vt6655/wcmd.c index 817f3c3386e3..d551653537b4 100644 --- a/drivers/staging/vt6655/wcmd.c +++ b/drivers/staging/vt6655/wcmd.c @@ -56,9 +56,6 @@ /*--------------------- Static Definitions -------------------------*/ - - - /*--------------------- Static Classes ----------------------------*/ /*--------------------- Static Variables --------------------------*/ @@ -72,7 +69,6 @@ s_vProbeChannel( PSDevice pDevice ); - static PSTxMgmtPacket s_MgrMakeProbeRequest( @@ -84,7 +80,6 @@ s_MgrMakeProbeRequest( PWLAN_IE_SUPP_RATES pCurrExtSuppRates ); - static bool s_bCommandComplete( @@ -93,11 +88,8 @@ s_bCommandComplete( /*--------------------- Export Variables --------------------------*/ - /*--------------------- Export Functions --------------------------*/ - - /* * Description: * Stop AdHoc beacon during scan process @@ -115,7 +107,6 @@ static void vAdHocBeaconStop(PSDevice pDevice) { - PSMgmtObject pMgmt = &(pDevice->sMgmtObj); bool bStop; @@ -145,10 +136,8 @@ vAdHocBeaconStop(PSDevice pDevice) if (bStop) { MACvRegBitsOff(pDevice->PortOffset, MAC_REG_TCR, TCR_AUTOBCNTX); } - } /* vAdHocBeaconStop */ - /* * Description: * Restart AdHoc beacon after scan process complete @@ -178,14 +167,8 @@ vAdHocBeaconRestart(PSDevice pDevice) (pMgmt->eCurrState >= WMAC_STATE_STARTED)) { MACvRegBitsOn(pDevice->PortOffset, MAC_REG_TCR, TCR_AUTOBCNTX); } - } - - - - - /*+ * * Routine Description: @@ -214,7 +197,6 @@ s_vProbeChannel( PSMgmtObject pMgmt = pDevice->pMgmt; unsigned int ii; - if (pDevice->eCurrentPHYType == PHY_TYPE_11A) { pbyRate = &abyCurrSuppRatesA[0]; } else if (pDevice->eCurrentPHYType == PHY_TYPE_11B) { @@ -242,12 +224,8 @@ s_vProbeChannel( } } } - } - - - /*+ * * Routine Description: @@ -259,7 +237,6 @@ s_vProbeChannel( * -*/ - PSTxMgmtPacket s_MgrMakeProbeRequest( PSDevice pDevice, @@ -274,7 +251,6 @@ s_MgrMakeProbeRequest( PSTxMgmtPacket pTxPacket = NULL; WLAN_FR_PROBEREQ sFrame; - pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_PROBEREQ_FR_MAXLEN); pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); @@ -308,10 +284,6 @@ s_MgrMakeProbeRequest( return pTxPacket; } - - - - void vCommandTimerWait( void *hDeviceContext, @@ -329,9 +301,6 @@ vCommandTimerWait( return; } - - - void vCommandTimer( void *hDeviceContext @@ -346,7 +315,6 @@ vCommandTimer( unsigned char byMask[8] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80}; struct sk_buff *skb; - if (pDevice->dwDiagRefCount != 0) return; if (pDevice->bCmdRunning != true) @@ -355,7 +323,6 @@ vCommandTimer( spin_lock_irq(&pDevice->lock); switch (pDevice->eCommandState) { - case WLAN_CMD_SCAN_START: pDevice->byReAssocCount = 0; @@ -441,7 +408,6 @@ vCommandTimer( } - if ((pMgmt->b11hEnable == false) || (pMgmt->uScanChannel < CB_MAX_CHANNEL_24G)) { s_vProbeChannel(pDevice); @@ -555,7 +521,6 @@ vCommandTimer( if ((pMgmt->eCurrState == WMAC_STATE_ASSOC) || ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) && (pMgmt->eCurrState == WMAC_STATE_JOINTED))) { - if (pItemSSID->len == pItemSSIDCurr->len) { if (memcmp(pItemSSID->abySSID, pItemSSIDCurr->abySSID, pItemSSID->len) == 0) { s_bCommandComplete(pDevice); @@ -576,7 +541,6 @@ vCommandTimer( vMgrJoinBSSBegin((void *)pDevice, &Status); // if Infra mode if ((pMgmt->eCurrMode == WMAC_MODE_ESS_STA) && (pMgmt->eCurrState == WMAC_STATE_JOINTED)) { - // Call mgr to begin the deauthentication // reason = (3) because sta has left ESS if (pMgmt->eCurrState >= WMAC_STATE_AUTH) { @@ -810,7 +774,6 @@ vCommandTimer( s_bCommandComplete(pDevice); break; - case WLAN_CMD_RADIO_START: DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "eCommandState == WLAN_CMD_RADIO_START\n"); if (pDevice->bRadioCmd == true) @@ -821,7 +784,6 @@ vCommandTimer( s_bCommandComplete(pDevice); break; - case WLAN_CMD_CHECK_BBSENSITIVITY_CHANGE: //DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "eCommandState == WLAN_CMD_CHECK_BBSENSITIVITY_START\n"); // wait all TD complete @@ -848,10 +810,8 @@ vCommandTimer( } //switch spin_unlock_irq(&pDevice->lock); return; - } - static bool s_bCommandComplete( @@ -864,7 +824,6 @@ s_bCommandComplete( bool bForceSCAN = true; PSMgmtObject pMgmt = pDevice->pMgmt; - pDevice->eCommandState = WLAN_CMD_IDLE; if (pDevice->cbFreeCmdQueue == CMD_Q_SIZE) { //Command Queue Empty @@ -933,8 +892,6 @@ s_bCommandComplete( return true; } - - bool bScheduleCommand( void *hDeviceContext, CMD_CODE eCommand, @@ -943,7 +900,6 @@ bool bScheduleCommand( { PSDevice pDevice = (PSDevice)hDeviceContext; - if (pDevice->cbFreeCmdQueue == 0) { return false; } @@ -953,7 +909,6 @@ bool bScheduleCommand( if (pbyItem0 != NULL) { switch (eCommand) { - case WLAN_CMD_BSSID_SCAN: memcpy(pDevice->eCmdQueue[pDevice->uCmdEnqueueIdx].abyCmdDesireSSID, pbyItem0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1); @@ -998,7 +953,6 @@ bool bScheduleCommand( } else { } return true; - } /* @@ -1058,7 +1012,6 @@ vResetCommandTimer( pDevice->bCmdClear = false; } - #ifdef TxInSleep void BSSvSecondTxData( @@ -1094,4 +1047,3 @@ BSSvSecondTxData( return; } #endif - diff --git a/drivers/staging/vt6655/wcmd.h b/drivers/staging/vt6655/wcmd.h index 4dc943531c93..2844476d5dc9 100644 --- a/drivers/staging/vt6655/wcmd.h +++ b/drivers/staging/vt6655/wcmd.h @@ -35,12 +35,9 @@ /*--------------------- Export Definitions -------------------------*/ - - #define AUTHENTICATE_TIMEOUT 1000 //ms #define ASSOCIATE_TIMEOUT 1000 //ms - // Command code typedef enum tagCMD_CODE { WLAN_CMD_BSSID_SCAN, @@ -63,16 +60,13 @@ typedef enum tagCMD_CODE { #define CMD_Q_SIZE 32 typedef enum tagCMD_STATUS { - CMD_STATUS_SUCCESS = 0, CMD_STATUS_FAILURE, CMD_STATUS_RESOURCES, CMD_STATUS_TIMEOUT, CMD_STATUS_PENDING - } CMD_STATUS, *PCMD_STATUS; - typedef struct tagCMD_ITEM { CMD_CODE eCmd; unsigned char abyCmdDesireSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1]; @@ -98,16 +92,12 @@ typedef enum tagCMD_STATE { WLAN_CMD_IDLE } CMD_STATE, *PCMD_STATE; - - /*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Variables --------------------------*/ - /*--------------------- Export Types ------------------------------*/ - /*--------------------- Export Functions --------------------------*/ void vResetCommandTimer( diff --git a/drivers/staging/vt6655/wctl.c b/drivers/staging/vt6655/wctl.c index 0bf5e9226d52..9eb81b4eee80 100644 --- a/drivers/staging/vt6655/wctl.c +++ b/drivers/staging/vt6655/wctl.c @@ -48,8 +48,6 @@ /*--------------------- Export Variables --------------------------*/ - - /* * Description: * Scan Rx cache. Return true if packet is duplicate, else @@ -73,7 +71,6 @@ bool WCTLbIsDuplicate(PSCache pCache, PS802_11Header pMACHeader) PSCacheEntry pCacheEntry; if (IS_FC_RETRY(pMACHeader)) { - uIndex = pCache->uInPtr; for (ii = 0; ii < DUPLICATE_RX_CACHE_LENGTH; ii++) { pCacheEntry = &(pCache->asCacheEntry[uIndex]); @@ -123,7 +120,6 @@ unsigned int WCTLuSearchDFCB(PSDevice pDevice, PS802_11Header pMACHeader) return pDevice->cbDFCB; } - /* * Description: * Insert received fragment packet in Defragment Database @@ -158,7 +154,6 @@ unsigned int WCTLuInsertDFCB(PSDevice pDevice, PS802_11Header pMACHeader) return pDevice->cbDFCB; } - /* * Description: * Handle received fragment packet @@ -179,7 +174,6 @@ bool WCTLbHandleFragment(PSDevice pDevice, PS802_11Header pMACHeader, unsigned i { unsigned int uHeaderSize; - if (bWEP == true) { uHeaderSize = 28; if (bExtIV) @@ -216,7 +210,6 @@ bool WCTLbHandleFragment(PSDevice pDevice, PS802_11Header pMACHeader, unsigned i if ((pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].wSequence == (pMACHeader->wSeqCtl >> 4)) && (pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].wFragNum == (pMACHeader->wSeqCtl & 0x000F)) && ((pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].cbFrameLength + cbFrameLength - uHeaderSize) < 2346)) { - memcpy(pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].pbyRxBuffer, ((unsigned char *)(pMACHeader) + uHeaderSize), (cbFrameLength - uHeaderSize)); pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].cbFrameLength += (cbFrameLength - uHeaderSize); pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx].pbyRxBuffer += (cbFrameLength - uHeaderSize); @@ -241,5 +234,3 @@ bool WCTLbHandleFragment(PSDevice pDevice, PS802_11Header pMACHeader, unsigned i return false; } } - - diff --git a/drivers/staging/vt6655/wctl.h b/drivers/staging/vt6655/wctl.h index 3b042f08ba06..1ffb2734cfae 100644 --- a/drivers/staging/vt6655/wctl.h +++ b/drivers/staging/vt6655/wctl.h @@ -82,7 +82,6 @@ #define IS_CTL_PSPOLL(pMACHeader) \ ((((PS802_11Header) pMACHeader)->wFrameCtl & TYPE_SUBTYPE_MASK) == TYPE_CTL_PSPOLL) - #define ADD_ONE_WITH_WRAP_AROUND(uVar, uModulo) \ do { \ if ((uVar) >= ((uModulo) - 1)) \ @@ -91,7 +90,6 @@ do { \ (uVar)++; \ } while (0) - /*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Variables --------------------------*/ @@ -105,6 +103,3 @@ unsigned int WCTLuSearchDFCB(PSDevice pDevice, PS802_11Header pMACHeader); unsigned int WCTLuInsertDFCB(PSDevice pDevice, PS802_11Header pMACHeader); #endif // __WCTL_H__ - - - diff --git a/drivers/staging/vt6655/wmgr.c b/drivers/staging/vt6655/wmgr.c index 3836dbfd28f5..9938813f997a 100644 --- a/drivers/staging/vt6655/wmgr.c +++ b/drivers/staging/vt6655/wmgr.c @@ -84,8 +84,6 @@ /*--------------------- Static Definitions -------------------------*/ - - /*--------------------- Static Classes ----------------------------*/ /*--------------------- Static Variables --------------------------*/ @@ -251,7 +249,6 @@ s_MgrMakeBeacon( PWLAN_IE_SUPP_RATES pCurrExtSuppRates ); - // Association response static PSTxMgmtPacket @@ -306,7 +303,6 @@ s_vMgrLogStatus( unsigned short wStatus ); - static void s_vMgrSynchBSS( @@ -316,7 +312,6 @@ s_vMgrSynchBSS( PCMD_STATUS pStatus ); - static bool s_bCipherMatch( PKnownBSS pBSSNode, @@ -330,14 +325,10 @@ static void Encyption_Rebuild( PKnownBSS pCurr ); - - /*--------------------- Export Variables --------------------------*/ - /*--------------------- Export Functions --------------------------*/ - /*+ * * Routine Description: @@ -357,7 +348,6 @@ vMgrObjectInit( PSMgmtObject pMgmt = pDevice->pMgmt; int ii; - pMgmt->pbyPSPacketPool = &pMgmt->byPSPacketPool[0]; pMgmt->pbyMgmtPacketPool = &pMgmt->byMgmtPacketPool[0]; pMgmt->uCurrChannel = pDevice->uChannel; @@ -392,7 +382,6 @@ vMgrTimerInit( PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; - init_timer(&pMgmt->sTimerSecondCallback); pMgmt->sTimerSecondCallback.data = (unsigned long) pDevice; pMgmt->sTimerSecondCallback.function = (TimerFunction)BSSvSecondCallBack; @@ -420,8 +409,6 @@ vMgrTimerInit( return; } - - /*+ * * Routine Description: @@ -448,7 +435,6 @@ vMgrObjectReset( return; } - /*+ * * Routine Description: @@ -460,7 +446,6 @@ vMgrObjectReset( * -*/ - void vMgrAssocBeginSta( void *hDeviceContext, @@ -471,7 +456,6 @@ vMgrAssocBeginSta( PSDevice pDevice = (PSDevice)hDeviceContext; PSTxMgmtPacket pTxPacket; - pMgmt->wCurrCapInfo = 0; pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_ESS(1); if (pDevice->bEncryptionEnable) { @@ -521,7 +505,6 @@ vMgrAssocBeginSta( return; } - /*+ * * Routine Description: @@ -542,8 +525,6 @@ vMgrReAssocBeginSta( PSDevice pDevice = (PSDevice)hDeviceContext; PSTxMgmtPacket pTxPacket; - - pMgmt->wCurrCapInfo = 0; pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_ESS(1); if (pDevice->bEncryptionEnable) { @@ -555,7 +536,6 @@ vMgrReAssocBeginSta( if (pMgmt->wListenInterval == 0) pMgmt->wListenInterval = 1; // at least one. - // ERP Phy (802.11g) should support short preamble. if (pMgmt->eCurrentPHYMode == PHY_TYPE_11G) { pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_SHORTPREAMBLE(1); @@ -570,7 +550,6 @@ vMgrReAssocBeginSta( if (pMgmt->b11hEnable == true) pMgmt->wCurrCapInfo |= WLAN_SET_CAP_INFO_SPECTRUMMNG(1); - pTxPacket = s_MgrMakeReAssocRequest ( pDevice, @@ -593,7 +572,6 @@ vMgrReAssocBeginSta( } } - return; } @@ -657,8 +635,6 @@ vMgrDisassocBeginSta( return; } - - /*+ * * Routine Description:(AP function) @@ -687,7 +663,6 @@ s_vMgrRxAssocRequest( unsigned char abyCurrSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; unsigned char abyCurrExtSuppRates[WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1]; - if (pMgmt->eCurrMode != WMAC_MODE_ESS_AP) return; // node index not found @@ -727,7 +702,6 @@ s_vMgrRxAssocRequest( abyCurrExtSuppRates[1] = 0; } - RATEvParseMaxRate((void *)pDevice, (PWLAN_IE_SUPP_RATES)abyCurrSuppRates, (PWLAN_IE_SUPP_RATES)abyCurrExtSuppRates, @@ -782,7 +756,6 @@ s_vMgrRxAssocRequest( return; } - // assoc response reply.. pTxPacket = s_MgrMakeAssocResponse ( @@ -796,7 +769,6 @@ s_vMgrRxAssocRequest( (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrExtSuppRates ); if (pTxPacket != NULL) { - if (pDevice->bEnableHostapd) { return; } @@ -813,7 +785,6 @@ s_vMgrRxAssocRequest( return; } - /*+ * * Description:(AP function) @@ -885,7 +856,6 @@ s_vMgrRxReAssocRequest( abyCurrExtSuppRates[1] = 0; } - RATEvParseMaxRate((void *)pDevice, (PWLAN_IE_SUPP_RATES)abyCurrSuppRates, (PWLAN_IE_SUPP_RATES)abyCurrExtSuppRates, @@ -939,7 +909,6 @@ s_vMgrRxReAssocRequest( } - // assoc response reply.. pTxPacket = s_MgrMakeReAssocResponse ( @@ -968,7 +937,6 @@ s_vMgrRxReAssocRequest( return; } - /*+ * * Routine Description: @@ -993,11 +961,8 @@ s_vMgrRxAssocResponse( unsigned char *pbyIEs; viawget_wpa_header *wpahdr; - - if (pMgmt->eCurrState == WMAC_STATE_ASSOCPENDING || pMgmt->eCurrState == WMAC_STATE_ASSOC) { - sFrame.len = pRxPacket->cbMPDULen; sFrame.pBuf = (unsigned char *)pRxPacket->p80211Header; // decode the frame @@ -1090,7 +1055,6 @@ s_vMgrRxAssocResponse( wireless_send_event(pDevice->dev, we_event, &wrqu, buf); } - memset(&wrqu, 0, sizeof(wrqu)); memcpy(wrqu.ap_addr.sa_data, &pMgmt->abyCurrBSSID[0], ETH_ALEN); wrqu.ap_addr.sa_family = ARPHRD_ETHER; @@ -1117,14 +1081,11 @@ s_vMgrRxAssocResponse( pDevice->bWPASuppWextEnabled = false; #endif - if (pMgmt->eCurrState == WMAC_STATE_ASSOC) timer_expire(pDevice->sTimerCommand, 0); return; } - - /*+ * * Routine Description: @@ -1181,8 +1142,6 @@ vMgrAuthenBeginSta( return; } - - /*+ * * Routine Description: @@ -1207,7 +1166,6 @@ vMgrDeAuthenBeginSta( WLAN_FR_DEAUTHEN sFrame; PSTxMgmtPacket pTxPacket = NULL; - pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_DEAUTHEN_FR_MAXLEN); pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); @@ -1235,11 +1193,9 @@ vMgrDeAuthenBeginSta( *pStatus = CMD_STATUS_SUCCESS; } - return; } - /*+ * * Routine Description: @@ -1293,8 +1249,6 @@ s_vMgrRxAuthentication( return; } - - /*+ * * Routine Description: @@ -1307,7 +1261,6 @@ s_vMgrRxAuthentication( * -*/ - static void s_vMgrRxAuthenSequence_1( @@ -1370,7 +1323,6 @@ s_vMgrRxAuthenSequence_1( if (pMgmt->bShareKeyAlgorithm && (cpu_to_le16(*(sFrame.pwStatus)) == WLAN_MGMT_STATUS_SUCCESS)) { - sFrame.pChallenge = (PWLAN_IE_CHALLENGE)(sFrame.pBuf + sFrame.len); sFrame.len += WLAN_CHALLENGE_IE_LEN; sFrame.pChallenge->byElementID = WLAN_EID_CHALLENGE; @@ -1398,8 +1350,6 @@ s_vMgrRxAuthenSequence_1( return; } - - /*+ * * Routine Description: @@ -1423,7 +1373,6 @@ s_vMgrRxAuthenSequence_2( WLAN_FR_AUTHEN sFrame; PSTxMgmtPacket pTxPacket = NULL; - switch (cpu_to_le16((*(pFrame->pwAuthAlgorithm)))) { case WLAN_AUTH_ALG_OPENSYSTEM: if (cpu_to_le16((*(pFrame->pwStatus))) == WLAN_MGMT_STATUS_SUCCESS) { @@ -1496,8 +1445,6 @@ s_vMgrRxAuthenSequence_2( return; } - - /*+ * * Routine Description: @@ -1583,11 +1530,8 @@ reply: DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Mgt:Authreq_reply sequence_4 tx failed.\n"); } return; - } - - /*+ * * Routine Description: @@ -1606,7 +1550,6 @@ s_vMgrRxAuthenSequence_4( PWLAN_FR_AUTHEN pFrame ) { - if (cpu_to_le16((*(pFrame->pwStatus))) == WLAN_MGMT_STATUS_SUCCESS) { DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "802.11 Authen (SHAREDKEY) Successful.\n"); pMgmt->eCurrState = WMAC_STATE_AUTH; @@ -1622,7 +1565,6 @@ s_vMgrRxAuthenSequence_4( // vCommandTimerWait((void *)pDevice, 0); // spin_lock_irq(&pDevice->lock); } - } /*+ @@ -1697,7 +1639,6 @@ s_vMgrRxDisassociation( return; } - /*+ * * Routine Description: @@ -1721,7 +1662,6 @@ s_vMgrRxDeauthentication( unsigned int uNodeIndex = 0; viawget_wpa_header *wpahdr; - if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { //Todo: // if is acting an AP.. @@ -1782,7 +1722,6 @@ s_vMgrRxDeauthentication( return; } - //2008-8-4 by chester /*+ * @@ -1820,7 +1759,6 @@ ChannelExceedZoneType( return exceed; } - /*+ * * Routine Description: @@ -1841,7 +1779,6 @@ s_vMgrRxBeacon( bool bInScan ) { - PKnownBSS pBSSList; WLAN_FR_BEACON sFrame; QWORD qwTSFOffset; @@ -1867,7 +1804,6 @@ s_vMgrRxBeacon( bool bUpdatePhyParameter = false; unsigned char byIEChannel = 0; - memset(&sFrame, 0, sizeof(WLAN_FR_BEACON)); sFrame.len = pRxPacket->cbMPDULen; sFrame.pBuf = (unsigned char *)pRxPacket->p80211Header; @@ -1883,7 +1819,6 @@ s_vMgrRxBeacon( return; } - if (sFrame.pDSParms != NULL) { if (byCurrChannel > CB_MAX_CHANNEL_24G) { // channel remapping to @@ -1966,7 +1901,6 @@ s_vMgrRxBeacon( bIsChannelEqual = true; if (bIsChannelEqual && (pMgmt->eCurrMode == WMAC_MODE_ESS_AP)) { - // if rx beacon without ERP field if (sERP.bERPExist) { if (WLAN_GET_ERP_USE_PROTECTION(sERP.byERP)) { @@ -1994,7 +1928,6 @@ s_vMgrRxBeacon( } } - if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) return; @@ -2002,7 +1935,6 @@ s_vMgrRxBeacon( if (memcmp(sFrame.pHdr->sA3.abyAddr3, pMgmt->abyCurrBSSID, WLAN_BSSID_LEN) == 0) { - bIsBSSIDEqual = true; // 2008-05-21 by Richardtai @@ -2034,7 +1966,6 @@ s_vMgrRxBeacon( bIsAPBeacon = true; if (pBSSList != NULL) { - // Compare PHY parameter setting if (pMgmt->wCurrCapInfo != pBSSList->wCapInfo) { bUpdatePhyParameter = true; @@ -2134,16 +2065,13 @@ s_vMgrRxBeacon( bTSFLargeDiff = true; } - // if infra mode if (bIsAPBeacon == true) { - // Infra mode: Local TSF always follow AP's TSF if Difference huge. if (bTSFLargeDiff) bUpdateTSF = true; if ((pDevice->bEnablePSMode == true) && (sFrame.pTIM != 0)) { - // deal with DTIM, analysis TIM pMgmt->bMulticastTIM = WLAN_MGMT_IS_MULTICAST_TIM(sFrame.pTIM->byBitMapCtl) ? true : false; pMgmt->byDTIMCount = sFrame.pTIM->byDTIMCount; @@ -2208,7 +2136,6 @@ s_vMgrRxBeacon( // During dpc, already in spinlocked. if (BSSDBbIsSTAInNodeDB(pMgmt, sFrame.pHdr->sA3.abyAddr2, &uNodeIndex)) { - // Update the STA, (Technically the Beacons of all the IBSS nodes // should be identical, but that's not happening in practice. pMgmt->abyCurrSuppRates[1] = RATEuSetIE((PWLAN_IE_SUPP_RATES)sFrame.pSuppRates, @@ -2273,7 +2200,6 @@ s_vMgrRxBeacon( } } else if (bIsSSIDEqual) { - // See other adhoc sta with the same SSID but BSSID is different. // adpot this vars only when TSF larger then us. if (bTSFLargeDiff && bTSFOffsetPostive) { @@ -2303,7 +2229,6 @@ s_vMgrRxBeacon( pMgmt->abyCurrSuppRates, pMgmt->abyCurrExtSuppRates); - // MACvRegBitsOff(pDevice->PortOffset, MAC_REG_RCR, RCR_BSSID); // set highest basic rate // s_vSetHighestBasicRate(pDevice, (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrSuppRates); @@ -2325,8 +2250,6 @@ if (bUpdateTSF) { return; } - - /*+ * * Routine Description: @@ -2396,7 +2319,6 @@ vMgrCreateOwnIBSS( pMgmt->abyCurrSuppRates[2+ii] = abyRATE[ii]; } - if (pMgmt->eCurrentPHYMode == PHY_TYPE_11G) { pMgmt->abyCurrSuppRates[1] = 8; pMgmt->abyCurrExtSuppRates[1] = 4; @@ -2408,7 +2330,6 @@ vMgrCreateOwnIBSS( pMgmt->abyCurrExtSuppRates[2+ii] = abyOFDM_RATE[ii+4]; } - // Disable Protect Mode pDevice->bProtectMode = 0; MACvDisableProtectMD(pDevice->PortOffset); @@ -2422,7 +2343,6 @@ vMgrCreateOwnIBSS( if (pMgmt->wIBSSBeaconPeriod == 0) pMgmt->wIBSSBeaconPeriod = DEFAULT_IBSS_BI; - CARDbGetCurrentTSF(pDevice->PortOffset, &qwCurrTSF); // clear TSF counter VNSvOutPortB(pDevice->PortOffset + MAC_REG_TFTCTL, TFTCTL_TSFCNTRST); @@ -2437,7 +2357,6 @@ vMgrCreateOwnIBSS( if (pMgmt->uIBSSChannel == 0) pMgmt->uIBSSChannel = DEFAULT_IBSS_CHANNEL; - // set basic rate RATEvParseMaxRate((void *)pDevice, (PWLAN_IE_SUPP_RATES)pMgmt->abyCurrSuppRates, @@ -2445,7 +2364,6 @@ vMgrCreateOwnIBSS( &wMaxBasicRate, &wMaxSuppRate, &wSuppRate, &byTopCCKBasicRate, &byTopOFDMBasicRate); - if (pMgmt->eConfigMode == WMAC_CONFIG_AP) { pMgmt->eCurrMode = WMAC_MODE_ESS_AP; } @@ -2480,7 +2398,6 @@ vMgrCreateOwnIBSS( } if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) { - // BSSID selected must be randomized as spec 11.1.3 pMgmt->abyCurrBSSID[5] = (unsigned char) (LODWORD(qwCurrTSF) & 0x000000ff); pMgmt->abyCurrBSSID[4] = (unsigned char)((LODWORD(qwCurrTSF) & 0x0000ff00) >> 8); @@ -2497,7 +2414,6 @@ vMgrCreateOwnIBSS( pMgmt->abyCurrBSSID[0] &= ~IEEE_ADDR_GROUP; pMgmt->abyCurrBSSID[0] |= IEEE_ADDR_UNIVERSAL; - DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "Adhoc beacon created bssid:%pM\n", pMgmt->abyCurrBSSID); } @@ -2579,8 +2495,6 @@ vMgrCreateOwnIBSS( return; } - - /*+ * * Routine Description: @@ -2600,7 +2514,6 @@ vMgrJoinBSSBegin( PCMD_STATUS pStatus ) { - PSDevice pDevice = (PSDevice)hDeviceContext; PSMgmtObject pMgmt = pDevice->pMgmt; PKnownBSS pCurr = NULL; @@ -2615,7 +2528,6 @@ vMgrJoinBSSBegin( unsigned char byTopCCKBasicRate = RATE_1M; unsigned char byTopOFDMBasicRate = RATE_1M; - for (ii = 0; ii < MAX_BSS_NUM; ii++) { if (pMgmt->sBSSList[ii].bActive == true) break; @@ -2645,9 +2557,7 @@ vMgrJoinBSSBegin( DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "AP(BSS) finding:Found a AP(BSS)..\n"); if (WLAN_GET_CAP_INFO_ESS(cpu_to_le16(pCurr->wCapInfo))) { - if ((pMgmt->eAuthenMode == WMAC_AUTH_WPA) || (pMgmt->eAuthenMode == WMAC_AUTH_WPAPSK)) { - // patch for CISCO migration mode /* if (pDevice->eEncryptionStatus == Ndis802_11Encryption2Enabled) { @@ -2679,7 +2589,6 @@ vMgrJoinBSSBegin( ); if (*pStatus == CMD_STATUS_SUCCESS) { - // Adopt this BSS state vars in Mgmt Object pMgmt->uCurrChannel = pCurr->uChannel; @@ -2758,18 +2667,14 @@ vMgrJoinBSSBegin( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Join ESS\n"); - - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "End of Join AP -- A/B/G Action\n"); } else { pMgmt->eCurrState = WMAC_STATE_IDLE; }; - } else { // ad-hoc mode BSS if (pMgmt->eAuthenMode == WMAC_AUTH_WPANONE) { - if (pDevice->eEncryptionStatus == Ndis802_11Encryption2Enabled) { if (WPA_SearchRSN(0, WPA_TKIP, pCurr) == false) { // encryption mode error @@ -2800,7 +2705,6 @@ vMgrJoinBSSBegin( // TODO: check if CapInfo privacy on, but we don't.. pMgmt->uCurrChannel = pCurr->uChannel; - // Parse Support Rate IE pMgmt->abyCurrSuppRates[0] = WLAN_EID_SUPP_RATES; pMgmt->abyCurrSuppRates[1] = RATEuSetIE((PWLAN_IE_SUPP_RATES)pCurr->abySuppRates, @@ -2840,8 +2744,6 @@ vMgrJoinBSSBegin( return; } - - /*+ * * Routine Description: @@ -2871,7 +2773,6 @@ s_vMgrSynchBSS( unsigned char abyCurrSuppRatesA[] = {WLAN_EID_SUPP_RATES, 8, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C}; unsigned char abyCurrSuppRatesB[] = {WLAN_EID_SUPP_RATES, 4, 0x02, 0x04, 0x0B, 0x16}; - *pStatus = CMD_STATUS_FAILURE; if (s_bCipherMatch(pCurr, @@ -2956,7 +2857,6 @@ s_vMgrSynchBSS( memcpy(pMgmt->abyCurrExtSuppRates, &abyCurrExtSuppRatesG[0], sizeof(abyCurrExtSuppRatesG)); } - if (WLAN_GET_CAP_INFO_ESS(pCurr->wCapInfo)) { CARDbSetBSSID(pMgmt->pAdapter, pCurr->abyBSSID, OP_MODE_INFRASTRUCTURE); // Add current BSS to Candidate list @@ -3007,10 +2907,8 @@ s_vMgrSynchBSS( pMgmt->byERPContext = pCurr->sERP.byERP; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Sync:Set to channel = [%d]\n", (int)pCurr->uChannel); - *pStatus = CMD_STATUS_SUCCESS; - return; }; @@ -3049,7 +2947,6 @@ static void Encyption_Rebuild( return; } - /*+ * * Routine Description: @@ -3076,7 +2973,6 @@ s_vMgrFormatTIM( unsigned short wStartIndex = 0; unsigned short wEndIndex = 0; - // Find size of partial virtual bitmap for (ii = 0; ii < (MAX_NODE_NUM + 1); ii++) { byMap = pMgmt->abyPSTxMap[ii]; @@ -3097,7 +2993,6 @@ s_vMgrFormatTIM( } } - // Round start index down to nearest even number wStartIndex &= ~BIT0; @@ -3124,7 +3019,6 @@ s_vMgrFormatTIM( pTIM->byVirtBitMap[0] &= ~BIT0; } - /*+ * * Routine Description: @@ -3214,7 +3108,6 @@ s_MgrMakeBeacon( } if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) { - // IBSS parameter sFrame.pIBSSParms = (PWLAN_IE_IBSS_PARMS)(sFrame.pBuf + sFrame.len); sFrame.len += (2) + WLAN_IEHDR_LEN; @@ -3348,10 +3241,6 @@ s_MgrMakeBeacon( return pTxPacket; } - - - - /*+ * * Routine Description: @@ -3363,9 +3252,6 @@ s_MgrMakeBeacon( * -*/ - - - PSTxMgmtPacket s_MgrMakeProbeResponse( PSDevice pDevice, @@ -3389,7 +3275,6 @@ s_MgrMakeProbeResponse( PWLAN_IE_IBSS_DFS pIBSSDFS = NULL; unsigned int ii; - pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_PROBERESP_FR_MAXLEN); pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); @@ -3513,7 +3398,6 @@ s_MgrMakeProbeResponse( sFrame.len += uLength; } - if (((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len != 0) { sFrame.pExtSuppRates = (PWLAN_IE_SUPP_RATES)(sFrame.pBuf + sFrame.len); sFrame.len += ((PWLAN_IE_SUPP_RATES)pCurrExtSuppRates)->len + WLAN_IEHDR_LEN; @@ -3541,8 +3425,6 @@ s_MgrMakeProbeResponse( return pTxPacket; } - - /*+ * * Routine Description: @@ -3554,7 +3436,6 @@ s_MgrMakeProbeResponse( * -*/ - PSTxMgmtPacket s_MgrMakeAssocRequest( PSDevice pDevice, @@ -3572,7 +3453,6 @@ s_MgrMakeAssocRequest( unsigned char *pbyIEs; unsigned char *pbyRSN; - pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_ASSOCREQ_FR_MAXLEN); pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); @@ -3802,20 +3682,12 @@ s_MgrMakeAssocRequest( pbyIEs += sFrame.pRSN->len + WLAN_IEHDR_LEN; } - // Adjust the length fields pTxPacket->cbMPDULen = sFrame.len; pTxPacket->cbPayloadLen = sFrame.len - WLAN_HDR_ADDR3_LEN; return pTxPacket; } - - - - - - - /*+ * * Routine Description: @@ -3827,7 +3699,6 @@ s_MgrMakeAssocRequest( * -*/ - PSTxMgmtPacket s_MgrMakeReAssocRequest( PSDevice pDevice, @@ -3845,7 +3716,6 @@ s_MgrMakeReAssocRequest( unsigned char *pbyIEs; unsigned char *pbyRSN; - pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_REASSOCREQ_FR_MAXLEN); pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); @@ -4058,7 +3928,6 @@ s_MgrMakeReAssocRequest( pbyIEs += sFrame.pRSN->len + WLAN_IEHDR_LEN; } - /* Adjust the length fields */ pTxPacket->cbMPDULen = sFrame.len; pTxPacket->cbPayloadLen = sFrame.len - WLAN_HDR_ADDR3_LEN; @@ -4066,8 +3935,6 @@ s_MgrMakeReAssocRequest( return pTxPacket; } - - /*+ * * Routine Description: @@ -4079,7 +3946,6 @@ s_MgrMakeReAssocRequest( * -*/ - PSTxMgmtPacket s_MgrMakeAssocResponse( PSDevice pDevice, @@ -4095,7 +3961,6 @@ s_MgrMakeAssocResponse( PSTxMgmtPacket pTxPacket = NULL; WLAN_FR_ASSOCRESP sFrame; - pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_ASSOCREQ_FR_MAXLEN); pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); @@ -4141,7 +4006,6 @@ s_MgrMakeAssocResponse( return pTxPacket; } - /*+ * * Routine Description: @@ -4153,7 +4017,6 @@ s_MgrMakeAssocResponse( * -*/ - PSTxMgmtPacket s_MgrMakeReAssocResponse( PSDevice pDevice, @@ -4169,7 +4032,6 @@ s_MgrMakeReAssocResponse( PSTxMgmtPacket pTxPacket = NULL; WLAN_FR_REASSOCRESP sFrame; - pTxPacket = (PSTxMgmtPacket)pMgmt->pbyMgmtPacketPool; memset(pTxPacket, 0, sizeof(STxMgmtPacket) + WLAN_ASSOCREQ_FR_MAXLEN); pTxPacket->p80211Header = (PUWLAN_80211HDR)((unsigned char *)pTxPacket + sizeof(STxMgmtPacket)); @@ -4215,7 +4077,6 @@ s_MgrMakeReAssocResponse( return pTxPacket; } - /*+ * * Routine Description: @@ -4242,7 +4103,6 @@ s_vMgrRxProbeResponse( unsigned char byIEChannel = 0; bool bChannelHit = true; - memset(&sFrame, 0, sizeof(WLAN_FR_PROBERESP)); // decode the frame sFrame.len = pRxPacket->cbMPDULen; @@ -4291,7 +4151,6 @@ s_vMgrRxProbeResponse( sERP.byERP = 0; } - // update or insert the bss pBSSList = BSSpAddrIsInBSSList((void *)pDevice, sFrame.pHdr->sA3.abyAddr3, sFrame.pSSID); if (pBSSList) { @@ -4336,7 +4195,6 @@ s_vMgrRxProbeResponse( ); } return; - } /*+ @@ -4350,7 +4208,6 @@ s_vMgrRxProbeResponse( * -*/ - static void s_vMgrRxProbeRequest( @@ -4368,7 +4225,6 @@ s_vMgrRxProbeRequest( // STA have to response this request. if ((pMgmt->eCurrMode == WMAC_MODE_ESS_AP) || ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) && pDevice->bBeaconSent)) { - memset(&sFrame, 0, sizeof(WLAN_FR_PROBEREQ)); // decode the frame sFrame.len = pRxPacket->cbMPDULen; @@ -4422,10 +4278,6 @@ s_vMgrRxProbeRequest( return; } - - - - /*+ * * Routine Description: @@ -4440,7 +4292,6 @@ s_vMgrRxProbeRequest( * -*/ - void vMgrRxManagePacket( void *hDeviceContext, @@ -4454,14 +4305,12 @@ vMgrRxManagePacket( NODE_STATE eNodeState = 0; CMD_STATUS Status; - if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { if (BSSDBbIsSTAInNodeDB(pMgmt, pRxPacket->p80211Header->sA3.abyAddr2, &uNodeIndex)) eNodeState = pMgmt->sNodeDBTable[uNodeIndex].eNodeState; } switch (WLAN_GET_FC_FSTYPE((pRxPacket->p80211Header->sA3.wFrameCtl))) { - case WLAN_FSTYPE_ASSOCREQ: // Frame Clase = 2 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "rx assocreq\n"); @@ -4575,9 +4424,6 @@ vMgrRxManagePacket( return; } - - - /*+ * * Routine Description: @@ -4627,9 +4473,6 @@ bMgrPrepareBeaconToSend( return true; } - - - /*+ * * Routine Description: @@ -4695,7 +4538,6 @@ s_vMgrLogStatus( } } - /* * * Description: @@ -4731,8 +4573,6 @@ bAdd_PMKID_Candidate( if (pDevice->gsPMKIDCandidate.NumCandidates >= MAX_PMKIDLIST) return false; - - // Update Old Candidate for (ii = 0; ii < pDevice->gsPMKIDCandidate.NumCandidates; ii++) { pCandidateList = &pDevice->gsPMKIDCandidate.CandidateList[ii]; @@ -4877,7 +4717,6 @@ s_bCipherMatch( // mask our cap. with BSS if (EncStatus == Ndis802_11Encryption1Enabled) { - // For supporting Cisco migration mode, don't care pairwise key cipher if ((byMulticastCipher == KEY_CTL_WEP) && (byCipherMask == 0)) { @@ -4933,5 +4772,3 @@ s_bCipherMatch( } return true; } - - diff --git a/drivers/staging/vt6655/wmgr.h b/drivers/staging/vt6655/wmgr.h index d50f80d7669c..b91f1f89ed05 100644 --- a/drivers/staging/vt6655/wmgr.h +++ b/drivers/staging/vt6655/wmgr.h @@ -45,8 +45,6 @@ /*--------------------- Export Definitions -------------------------*/ - - // Scan time #define PROBE_DELAY 100 // (us) #define SWITCH_CHANNEL_DELAY 200 // (us) @@ -58,7 +56,6 @@ #define WCMD_ACTIVE_SCAN_TIME 50 //(ms) #define WCMD_PASSIVE_SCAN_TIME 100 //(ms) - #define DEFAULT_MSDU_LIFETIME 512 // ms #define DEFAULT_MSDU_LIFETIME_RES_64us 8000 // 64us @@ -67,7 +64,6 @@ #define MAKE_BEACON_RESERVED 10 //(us) - #define TIM_MULTICAST_MASK 0x01 #define TIM_BITMAPOFFSET_MASK 0xFE #define DEFAULT_DTIM_PERIOD 1 @@ -76,7 +72,6 @@ #define DEFAULT_IBSS_CHANNEL 6 //2.4G - /*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Variables --------------------------*/ @@ -85,7 +80,6 @@ #define timer_expire(timer, next_tick) mod_timer(&timer, RUN_AT(next_tick)) typedef void (*TimerFunction)(unsigned long); - //+++ NDIS related typedef unsigned char NDIS_802_11_MAC_ADDRESS[6]; @@ -116,8 +110,6 @@ typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION unsigned long OffsetResponseIEs; } NDIS_802_11_ASSOCIATION_INFORMATION, *PNDIS_802_11_ASSOCIATION_INFORMATION; - - typedef struct tagSAssocInfo { NDIS_802_11_ASSOCIATION_INFORMATION AssocInfo; unsigned char abyIEs[WLAN_BEACON_FR_MAXLEN+WLAN_BEACON_FR_MAXLEN]; @@ -127,11 +119,8 @@ typedef struct tagSAssocInfo { } SAssocInfo, *PSAssocInfo; //--- - /* typedef enum tagWMAC_AUTHENTICATION_MODE { - - WMAC_AUTH_OPEN, WMAC_AUTH_SHAREKEY, WMAC_AUTH_AUTO, @@ -142,11 +131,9 @@ typedef struct tagSAssocInfo { WMAC_AUTH_WPA2PSK, WMAC_AUTH_MAX // Not a real mode, defined as upper bound - } WMAC_AUTHENTICATION_MODE, *PWMAC_AUTHENTICATION_MODE; */ - // Pre-configured Mode (from XP) /* typedef enum tagWMAC_CONFIG_MODE { @@ -159,24 +146,17 @@ typedef struct tagSAssocInfo { */ typedef enum tagWMAC_SCAN_TYPE { - WMAC_SCAN_ACTIVE, WMAC_SCAN_PASSIVE, WMAC_SCAN_HYBRID - } WMAC_SCAN_TYPE, *PWMAC_SCAN_TYPE; - typedef enum tagWMAC_SCAN_STATE { - WMAC_NO_SCANNING, WMAC_IS_SCANNING, WMAC_IS_PROBEPENDING - } WMAC_SCAN_STATE, *PWMAC_SCAN_STATE; - - // Notes: // Basic Service Set state explained as following: // WMAC_STATE_IDLE : no BSS is selected (Adhoc or Infra) @@ -188,7 +168,6 @@ typedef enum tagWMAC_SCAN_STATE { // WMAC_STATE_ASSOC : Associated (Infra) typedef enum tagWMAC_BSS_STATE { - WMAC_STATE_IDLE, WMAC_STATE_STARTED, WMAC_STATE_JOINTED, @@ -196,22 +175,18 @@ typedef enum tagWMAC_BSS_STATE { WMAC_STATE_AUTH, WMAC_STATE_ASSOCPENDING, WMAC_STATE_ASSOC - } WMAC_BSS_STATE, *PWMAC_BSS_STATE; // WMAC selected running mode typedef enum tagWMAC_CURRENT_MODE { - WMAC_MODE_STANDBY, WMAC_MODE_ESS_STA, WMAC_MODE_IBSS_STA, WMAC_MODE_ESS_AP - } WMAC_CURRENT_MODE, *PWMAC_CURRENT_MODE; /* typedef enum tagWMAC_POWER_MODE { - WMAC_POWER_CAM, WMAC_POWER_FAST, WMAC_POWER_MAX @@ -219,20 +194,15 @@ typedef enum tagWMAC_CURRENT_MODE { } WMAC_POWER_MODE, *PWMAC_POWER_MODE; */ - // Tx Management Packet descriptor typedef struct tagSTxMgmtPacket { - PUWLAN_80211HDR p80211Header; unsigned int cbMPDULen; unsigned int cbPayloadLen; - } STxMgmtPacket, *PSTxMgmtPacket; - // Rx Management Packet descriptor typedef struct tagSRxMgmtPacket { - PUWLAN_80211HDR p80211Header; QWORD qwLocalTSF; unsigned int cbMPDULen; @@ -241,14 +211,10 @@ typedef struct tagSRxMgmtPacket { unsigned char bySQ; unsigned char byRxRate; unsigned char byRxChannel; - } SRxMgmtPacket, *PSRxMgmtPacket; - - typedef struct tagSMgmtObject { - void *pAdapter; // MAC address unsigned char abyMACAddr[WLAN_ADDR_LEN]; @@ -258,7 +224,6 @@ typedef struct tagSMgmtObject CARD_PHY_TYPE eCurrentPHYMode; CARD_PHY_TYPE eConfigPHYMode; - // Operation state variables WMAC_CURRENT_MODE eCurrMode; // MAC current connection mode WMAC_BSS_STATE eCurrState; // MAC current BSS state @@ -345,7 +310,6 @@ typedef struct tagSMgmtObject unsigned char *pbyMgmtPacketPool; unsigned char byMgmtPacketPool[sizeof(STxMgmtPacket) + WLAN_A3FR_MAXLEN]; - // One second callback timer struct timer_list sTimerSecondCallback; @@ -355,27 +319,20 @@ typedef struct tagSMgmtObject // link list of known bss's (scan results) KnownBSS sBSSList[MAX_BSS_NUM]; - - // table list of known node // sNodeDBList[0] is reserved for AP under Infra mode // sNodeDBList[0] is reserved for Multicast under adhoc/AP mode KnownNodeDB sNodeDBTable[MAX_NODE_NUM + 1]; - - // WPA2 PMKID Cache SPMKIDCache gsPMKIDCache; bool bRoaming; // rate fall back vars - - // associate info SAssocInfo sAssocInfo; - // for 802.11h bool b11hEnable; bool bSwitchChannel; @@ -389,16 +346,12 @@ typedef struct tagSMgmtObject unsigned char byIBSSDFSRecovery; struct sk_buff skb; - } SMgmtObject, *PSMgmtObject; - /*--------------------- Export Macros ------------------------------*/ - /*--------------------- Export Functions --------------------------*/ - void vMgrObjectInit( void *hDeviceContext @@ -486,7 +439,6 @@ bMgrPrepareBeaconToSend( PSMgmtObject pMgmt ); - bool bAdd_PMKID_Candidate( void *hDeviceContext, diff --git a/drivers/staging/vt6655/wpa.c b/drivers/staging/vt6655/wpa.c index df6cc2f08233..c5293bbcdab5 100644 --- a/drivers/staging/vt6655/wpa.c +++ b/drivers/staging/vt6655/wpa.c @@ -52,7 +52,6 @@ const unsigned char abyOUI03[4] = { 0x00, 0x50, 0xf2, 0x03 }; const unsigned char abyOUI04[4] = { 0x00, 0x50, 0xf2, 0x04 }; const unsigned char abyOUI05[4] = { 0x00, 0x50, 0xf2, 0x05 }; - /*+ * * Description: @@ -88,7 +87,6 @@ WPA_ClearRSN( pBSSList->bWPAValid = false; } - /*+ * * Description: @@ -122,7 +120,6 @@ WPA_ParseRSN( if ((pRSN->len >= 6) // oui1(4)+ver(2) && (pRSN->byElementID == WLAN_EID_RSN_WPA) && !memcmp(pRSN->abyOUI, abyOUI01, 4) && (pRSN->wVersion == 1)) { - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Legal RSN\n"); // update each variable if pRSN is long enough to contain the variable if (pRSN->len >= 10) //oui1(4)+ver(2)+GKSuite(4) @@ -198,7 +195,6 @@ WPA_ParseRSN( } if (pIE_RSN_Auth != NULL) { - n = pIE_RSN_Auth->wAuthCount; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "n: %d\n", n); @@ -306,4 +302,3 @@ WPAb_Is_RSN( } else return false; } - diff --git a/drivers/staging/vt6655/wpa.h b/drivers/staging/vt6655/wpa.h index 48a66704e214..1d1918a12641 100644 --- a/drivers/staging/vt6655/wpa.h +++ b/drivers/staging/vt6655/wpa.h @@ -55,7 +55,6 @@ /*--------------------- Export Types ------------------------------*/ - /*--------------------- Export Functions --------------------------*/ void diff --git a/drivers/staging/vt6655/wpa2.c b/drivers/staging/vt6655/wpa2.c index 98a2160c7548..089788dfba63 100644 --- a/drivers/staging/vt6655/wpa2.c +++ b/drivers/staging/vt6655/wpa2.c @@ -51,7 +51,6 @@ const unsigned char abyOUICCMP[4] = { 0x00, 0x0F, 0xAC, 0x04 }; const unsigned char abyOUI8021X[4] = { 0x00, 0x0F, 0xAC, 0x01 }; const unsigned char abyOUIPSK[4] = { 0x00, 0x0F, 0xAC, 0x02 }; - /*--------------------- Static Functions --------------------------*/ /*--------------------- Export Variables --------------------------*/ @@ -137,7 +136,6 @@ WPA2vParseRSN( // information element header makes sense if ((pRSN->byElementID == WLAN_EID_RSN) && (pRSN->wVersion == 1)) { - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Legal 802.11i RSN\n"); pbyOUI = &(pRSN->abyRSN[0]); @@ -169,7 +167,6 @@ WPA2vParseRSN( pbyOUI = &(pRSN->abyRSN[6]); for (i = 0; (i < pBSSNode->wCSSPKCount) && (j < sizeof(pBSSNode->abyCSSPK)/sizeof(unsigned char)); i++) { - if (pRSN->len >= 8+i*4+4) { // ver(2)+GK(4)+PKCnt(2)+PKS(4*i) if (!memcmp(pbyOUI, abyOUIGK, 4)) { pBSSNode->abyCSSPK[j++] = WLAN_11i_CSS_USE_GROUP; @@ -246,7 +243,6 @@ WPA2vParseRSN( } } - /*+ * * Description: diff --git a/drivers/staging/vt6655/wpa2.h b/drivers/staging/vt6655/wpa2.h index 34c92f46d6f0..2d0bd2e515f3 100644 --- a/drivers/staging/vt6655/wpa2.h +++ b/drivers/staging/vt6655/wpa2.h @@ -49,7 +49,6 @@ typedef struct tagSPMKIDCache { PMKIDInfo BSSIDInfo[MAX_PMKID_CACHE]; } SPMKIDCache, *PSPMKIDCache; - /*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Variables --------------------------*/ diff --git a/drivers/staging/vt6655/wpactl.c b/drivers/staging/vt6655/wpactl.c index 96324cda5123..869f62c678e6 100644 --- a/drivers/staging/vt6655/wpactl.c +++ b/drivers/staging/vt6655/wpactl.c @@ -44,8 +44,6 @@ #define VIAWGET_WPA_MAX_BUF_SIZE 1024 - - static const int frequency_list[] = { 2412, 2417, 2422, 2427, 2432, 2437, 2442, 2447, 2452, 2457, 2462, 2467, 2472, 2484 @@ -58,9 +56,6 @@ static int msglevel = MSG_LEVEL_INFO; /*--------------------- Static Functions --------------------------*/ - - - /*--------------------- Export Variables --------------------------*/ static void wpadev_setup(struct net_device *dev) { @@ -126,7 +121,6 @@ static int wpa_init_wpadev(PSDevice pDevice) return 0; } - /* * Description: * unregister net_device (wpadev) @@ -158,10 +152,6 @@ static int wpa_release_wpadev(PSDevice pDevice) return 0; } - - - - /* * Description: * Set enable/disable dev for wpa supplicant daemon @@ -184,7 +174,6 @@ int wpa_set_wpadev(PSDevice pDevice, int val) return wpa_release_wpadev(pDevice); } - /* * Description: * Set WPA algorithm & keys @@ -212,7 +201,6 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel) int ret = 0; int uu, ii; - if (param->u.wpa_key.alg_name > WPA_ALG_CCMP || param->u.wpa_key.key_len >= MAX_KEY_LEN || param->u.wpa_key.seq_len >= MAX_KEY_LEN) @@ -310,7 +298,6 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel) if (param->u.wpa_key.set_tx) dwKeyIndex |= (1 << 31); - if (pDevice->eEncryptionStatus == Ndis802_11Encryption3Enabled) byKeyDecMode = KEY_CTL_CCMP; else if (pDevice->eEncryptionStatus == Ndis802_11Encryption2Enabled) @@ -438,10 +425,8 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel) */ return ret; - } - /* * Description: * enable wpa auth & mode @@ -459,7 +444,6 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel) static int wpa_set_wpa(PSDevice pDevice, struct viawget_wpa_param *param) { - PSMgmtObject pMgmt = pDevice->pMgmt; int ret = 0; @@ -469,9 +453,6 @@ static int wpa_set_wpa(PSDevice pDevice, return ret; } - - - /* * Description: * set disassociate @@ -502,8 +483,6 @@ static int wpa_set_disassociate(PSDevice pDevice, return ret; } - - /* * Description: * enable scan process @@ -531,8 +510,6 @@ static int wpa_set_scan(PSDevice pDevice, return ret; } - - /* * Description: * get bssid @@ -556,10 +533,8 @@ static int wpa_get_bssid(PSDevice pDevice, memcpy(param->u.wpa_associate.bssid, pMgmt->abyCurrBSSID , 6); return ret; - } - /* * Description: * get bssid @@ -589,8 +564,6 @@ static int wpa_get_ssid(PSDevice pDevice, return ret; } - - /* * Description: * get scan results @@ -620,12 +593,9 @@ static int wpa_get_scan(PSDevice pDevice, unsigned char *ptempBSS; - - ptempBSS = kmalloc(sizeof(KnownBSS), (int)GFP_ATOMIC); if (ptempBSS == NULL) { - printk("bubble sort kmalloc memory fail@@@\n"); ret = -ENOMEM; @@ -635,13 +605,10 @@ static int wpa_get_scan(PSDevice pDevice, } for (ii = 0; ii < MAX_BSS_NUM; ii++) { - for (jj = 0; jj < MAX_BSS_NUM - ii - 1; jj++) { - if ((pMgmt->sBSSList[jj].bActive != true) || ((pMgmt->sBSSList[jj].uRSSI > pMgmt->sBSSList[jj + 1].uRSSI) && (pMgmt->sBSSList[jj + 1].bActive != false))) { - memcpy(ptempBSS, &pMgmt->sBSSList[jj], sizeof(KnownBSS)); memcpy(&pMgmt->sBSSList[jj], &pMgmt->sBSSList[jj + 1], sizeof(KnownBSS)); @@ -659,9 +626,6 @@ static int wpa_get_scan(PSDevice pDevice, //******mike:bubble sort by stronger RSSI*****// - - - count = 0; pBSS = &(pMgmt->sBSSList[0]); for (ii = 0; ii < MAX_BSS_NUM; ii++) { @@ -721,8 +685,6 @@ static int wpa_get_scan(PSDevice pDevice, return ret; } - - /* * Description: * set associate with AP @@ -755,7 +717,6 @@ static int wpa_set_associate(PSDevice pDevice, DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "mode = %d\n", param->u.wpa_associate.mode); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wpa_ie_len = %d\n", param->u.wpa_associate.wpa_ie_len); - if (param->u.wpa_associate.wpa_ie_len) { if (!param->u.wpa_associate.wpa_ie) return -EINVAL; @@ -872,7 +833,6 @@ static int wpa_set_associate(PSDevice pDevice, return ret; } - /* * Description: * wpa_ioctl main function supported for wpa supplicant @@ -979,4 +939,3 @@ out: return ret; } - diff --git a/drivers/staging/vt6655/wpactl.h b/drivers/staging/vt6655/wpactl.h index 2b7a05a2902e..b9e2ab231f1b 100644 --- a/drivers/staging/vt6655/wpactl.h +++ b/drivers/staging/vt6655/wpactl.h @@ -36,7 +36,6 @@ /*--------------------- Export Definitions -------------------------*/ - //WPA related typedef enum { WPA_ALG_NONE, WPA_ALG_WEP, WPA_ALG_TKIP, WPA_ALG_CCMP } wpa_alg; @@ -52,8 +51,6 @@ typedef enum { KEY_MGMT_802_1X, KEY_MGMT_CCKM, KEY_MGMT_PSK, KEY_MGMT_NONE, #define GENERIC_INFO_ELEM 0xdd #define RSN_INFO_ELEM 0x30 - - typedef unsigned long long NDIS_802_11_KEY_RSC; /*--------------------- Export Classes ----------------------------*/ @@ -67,6 +64,3 @@ int wpa_ioctl(PSDevice pDevice, struct iw_point *p); int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel); #endif // __WPACL_H__ - - - diff --git a/drivers/staging/vt6655/wroute.c b/drivers/staging/vt6655/wroute.c index 227ac3119a60..b61328fbee87 100644 --- a/drivers/staging/vt6655/wroute.c +++ b/drivers/staging/vt6655/wroute.c @@ -49,8 +49,6 @@ static int msglevel = MSG_LEVEL_INFO; /*--------------------- Export Variables --------------------------*/ - - /* * Description: * Relay packet. Return true if packet is copy to DMA1 @@ -79,9 +77,6 @@ bool ROUTEbRelay(PSDevice pDevice, unsigned char *pbySkbData, unsigned int uData unsigned int ii; unsigned char *pbyBSSID; - - - if (AVAIL_TD(pDevice, TYPE_AC0DMA) <= 0) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Relay can't allocate TD1..\n"); return false; @@ -193,6 +188,3 @@ bool ROUTEbRelay(PSDevice pDevice, unsigned char *pbySkbData, unsigned int uData return true; } - - - diff --git a/drivers/staging/vt6655/wroute.h b/drivers/staging/vt6655/wroute.h index ddaec1f58e32..5ecc190ae775 100644 --- a/drivers/staging/vt6655/wroute.h +++ b/drivers/staging/vt6655/wroute.h @@ -42,6 +42,3 @@ bool ROUTEbRelay(PSDevice pDevice, unsigned char *pbySkbData, unsigned int uDataLen, unsigned int uNodeIndex); #endif // __WROUTE_H__ - - - -- 2.34.1