diff options
Diffstat (limited to 'drivers/staging/vt6655')
-rw-r--r-- | drivers/staging/vt6655/80211hdr.h | 2 | ||||
-rw-r--r-- | drivers/staging/vt6655/80211mgr.c | 72 | ||||
-rw-r--r-- | drivers/staging/vt6655/80211mgr.h | 107 | ||||
-rw-r--r-- | drivers/staging/vt6655/aes_ccmp.c | 37 | ||||
-rw-r--r-- | drivers/staging/vt6655/aes_ccmp.h | 2 | ||||
-rw-r--r-- | drivers/staging/vt6655/hostap.c | 6 | ||||
-rw-r--r-- | drivers/staging/vt6655/ioctl.c | 9 |
7 files changed, 114 insertions, 121 deletions
diff --git a/drivers/staging/vt6655/80211hdr.h b/drivers/staging/vt6655/80211hdr.h index 28078a1..ba53340 100644 --- a/drivers/staging/vt6655/80211hdr.h +++ b/drivers/staging/vt6655/80211hdr.h @@ -68,7 +68,7 @@ #define BIT30 0x40000000 #define BIT31 0x80000000 -// 802.11 frame related, defined as 802.11 spec +/* 802.11 frame related, defined as 802.11 spec */ #define WLAN_ADDR_LEN 6 #define WLAN_CRC_LEN 4 #define WLAN_CRC32_LEN 4 diff --git a/drivers/staging/vt6655/80211mgr.c b/drivers/staging/vt6655/80211mgr.c index 4cb26f3..76c8490 100644 --- a/drivers/staging/vt6655/80211mgr.c +++ b/drivers/staging/vt6655/80211mgr.c @@ -66,7 +66,7 @@ /*--------------------- Static Variables --------------------------*/ static int msglevel = MSG_LEVEL_INFO; -//static int msglevel =MSG_LEVEL_DEBUG; +/* static int msglevel =MSG_LEVEL_DEBUG; */ /*--------------------- Static Functions --------------------------*/ /*--------------------- Export Variables --------------------------*/ @@ -90,7 +90,7 @@ vMgrEncodeBeacon( { pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; - // Fixed Fields + /* Fixed Fields */ pFrame->pqwTimestamp = (PQWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_BEACON_OFF_TS); pFrame->pwBeaconInterval = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) @@ -123,7 +123,7 @@ vMgrDecodeBeacon( pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; - // Fixed Fields + /* Fixed Fields */ pFrame->pqwTimestamp = (PQWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_BEACON_OFF_TS); pFrame->pwBeaconInterval = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) @@ -131,7 +131,7 @@ vMgrDecodeBeacon( pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_BEACON_OFF_CAPINFO); - // Information elements + /* Information elements */ 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)) { @@ -145,7 +145,7 @@ vMgrDecodeBeacon( pFrame->pSuppRates = (PWLAN_IE_SUPP_RATES)pItem; break; case WLAN_EID_FH_PARMS: - //pFrame->pFHParms = (PWLAN_IE_FH_PARMS)pItem; + /* pFrame->pFHParms = (PWLAN_IE_FH_PARMS)pItem; */ break; case WLAN_EID_DS_PARMS: if (pFrame->pDSParms == NULL) @@ -185,22 +185,22 @@ vMgrDecodeBeacon( pFrame->pExtSuppRates = (PWLAN_IE_SUPP_RATES)pItem; break; - case WLAN_EID_COUNTRY: //7 + case WLAN_EID_COUNTRY: /* 7 */ if (pFrame->pIE_Country == NULL) pFrame->pIE_Country = (PWLAN_IE_COUNTRY)pItem; break; - case WLAN_EID_PWR_CONSTRAINT: //32 + case WLAN_EID_PWR_CONSTRAINT: /* 32 */ if (pFrame->pIE_PowerConstraint == NULL) pFrame->pIE_PowerConstraint = (PWLAN_IE_PW_CONST)pItem; break; - case WLAN_EID_CH_SWITCH: //37 + case WLAN_EID_CH_SWITCH: /* 37 */ if (pFrame->pIE_CHSW == NULL) pFrame->pIE_CHSW = (PWLAN_IE_CH_SW)pItem; break; - case WLAN_EID_QUIET: //40 + case WLAN_EID_QUIET: /* 40 */ if (pFrame->pIE_Quiet == NULL) pFrame->pIE_Quiet = (PWLAN_IE_QUIET)pItem; break; @@ -282,7 +282,7 @@ vMgrEncodeDisassociation( { pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; - // Fixed Fields + /* Fixed Fields */ pFrame->pwReason = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_DISASSOC_OFF_REASON); pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_DISASSOC_OFF_REASON + sizeof(*(pFrame->pwReason)); @@ -308,7 +308,7 @@ vMgrDecodeDisassociation( { pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; - // Fixed Fields + /* Fixed Fields */ pFrame->pwReason = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_DISASSOC_OFF_REASON); @@ -332,7 +332,7 @@ vMgrEncodeAssocRequest( ) { pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; - // Fixed Fields + /* Fixed Fields */ pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_ASSOCREQ_OFF_CAP_INFO); pFrame->pwListenInterval = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) @@ -360,13 +360,13 @@ vMgrDecodeAssocRequest( PWLAN_IE pItem; pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; - // Fixed Fields + /* Fixed Fields */ pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_ASSOCREQ_OFF_CAP_INFO); pFrame->pwListenInterval = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_ASSOCREQ_OFF_LISTEN_INT); - // Information elements + /* Information elements */ pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_ASSOCREQ_OFF_SSID); @@ -425,7 +425,7 @@ vMgrEncodeAssocResponse( { pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; - // Fixed Fields + /* Fixed Fields */ pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_ASSOCRESP_OFF_CAP_INFO); pFrame->pwStatus = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) @@ -458,7 +458,7 @@ vMgrDecodeAssocResponse( pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; - // Fixed Fields + /* Fixed Fields */ pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_ASSOCRESP_OFF_CAP_INFO); pFrame->pwStatus = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) @@ -466,7 +466,7 @@ vMgrDecodeAssocResponse( pFrame->pwAid = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_ASSOCRESP_OFF_AID); - // Information elements + /* Information elements */ pFrame->pSuppRates = (PWLAN_IE_SUPP_RATES)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_ASSOCRESP_OFF_SUPP_RATES); @@ -501,7 +501,7 @@ vMgrEncodeReassocRequest( { pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; - // Fixed Fields + /* Fixed Fields */ pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCREQ_OFF_CAP_INFO); pFrame->pwListenInterval = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) @@ -532,7 +532,7 @@ vMgrDecodeReassocRequest( PWLAN_IE pItem; pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; - // Fixed Fields + /* Fixed Fields */ pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCREQ_OFF_CAP_INFO); pFrame->pwListenInterval = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) @@ -540,7 +540,7 @@ vMgrDecodeReassocRequest( pFrame->pAddrCurrAP = (PIEEE_ADDR)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCREQ_OFF_CURR_AP); - // Information elements + /* Information elements */ pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCREQ_OFF_SSID); @@ -622,7 +622,7 @@ vMgrDecodeProbeRequest( pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; - // Information elements + /* Information elements */ pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))); while (((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len)) { @@ -670,7 +670,7 @@ vMgrEncodeProbeResponse( { pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; - // Fixed Fields + /* Fixed Fields */ pFrame->pqwTimestamp = (PQWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_PROBERESP_OFF_TS); pFrame->pwBeaconInterval = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) @@ -704,7 +704,7 @@ vMgrDecodeProbeResponse( pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; - // Fixed Fields + /* Fixed Fields */ pFrame->pqwTimestamp = (PQWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_PROBERESP_OFF_TS); pFrame->pwBeaconInterval = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) @@ -712,7 +712,7 @@ vMgrDecodeProbeResponse( pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_PROBERESP_OFF_CAP_INFO); - // Information elements + /* Information elements */ pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_PROBERESP_OFF_SSID); @@ -761,22 +761,22 @@ vMgrDecodeProbeResponse( pFrame->pExtSuppRates = (PWLAN_IE_SUPP_RATES)pItem; break; - case WLAN_EID_COUNTRY: //7 + case WLAN_EID_COUNTRY: /* 7 */ if (pFrame->pIE_Country == NULL) pFrame->pIE_Country = (PWLAN_IE_COUNTRY)pItem; break; - case WLAN_EID_PWR_CONSTRAINT: //32 + case WLAN_EID_PWR_CONSTRAINT: /* 32 */ if (pFrame->pIE_PowerConstraint == NULL) pFrame->pIE_PowerConstraint = (PWLAN_IE_PW_CONST)pItem; break; - case WLAN_EID_CH_SWITCH: //37 + case WLAN_EID_CH_SWITCH: /* 37 */ if (pFrame->pIE_CHSW == NULL) pFrame->pIE_CHSW = (PWLAN_IE_CH_SW)pItem; break; - case WLAN_EID_QUIET: //40 + case WLAN_EID_QUIET: /* 40 */ if (pFrame->pIE_Quiet == NULL) pFrame->pIE_Quiet = (PWLAN_IE_QUIET)pItem; break; @@ -814,7 +814,7 @@ vMgrEncodeAuthen( { pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; - // Fixed Fields + /* Fixed Fields */ pFrame->pwAuthAlgorithm = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_AUTHEN_OFF_AUTH_ALG); pFrame->pwAuthSequence = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) @@ -846,7 +846,7 @@ vMgrDecodeAuthen( pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; - // Fixed Fields + /* Fixed Fields */ pFrame->pwAuthAlgorithm = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_AUTHEN_OFF_AUTH_ALG); pFrame->pwAuthSequence = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) @@ -854,7 +854,7 @@ vMgrDecodeAuthen( pFrame->pwStatus = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_AUTHEN_OFF_STATUS); - // Information elements + /* Information elements */ pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_AUTHEN_OFF_CHALLENGE); @@ -883,7 +883,7 @@ vMgrEncodeDeauthen( { pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; - // Fixed Fields + /* Fixed Fields */ pFrame->pwReason = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_DEAUTHEN_OFF_REASON); pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_DEAUTHEN_OFF_REASON + sizeof(*(pFrame->pwReason)); @@ -909,7 +909,7 @@ vMgrDecodeDeauthen( { pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; - // Fixed Fields + /* Fixed Fields */ pFrame->pwReason = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_DEAUTHEN_OFF_REASON); @@ -934,7 +934,7 @@ vMgrEncodeReassocResponse( { pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; - // Fixed Fields + /* Fixed Fields */ pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCRESP_OFF_CAP_INFO); pFrame->pwStatus = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) @@ -967,7 +967,7 @@ vMgrDecodeReassocResponse( pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; - // Fixed Fields + /* Fixed Fields */ pFrame->pwCapInfo = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCRESP_OFF_CAP_INFO); pFrame->pwStatus = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) @@ -975,7 +975,7 @@ vMgrDecodeReassocResponse( pFrame->pwAid = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCRESP_OFF_AID); - //Information elements + /* Information elements */ pFrame->pSuppRates = (PWLAN_IE_SUPP_RATES)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_REASSOCRESP_OFF_SUPP_RATES); diff --git a/drivers/staging/vt6655/80211mgr.h b/drivers/staging/vt6655/80211mgr.h index 16402cf..065238b 100644 --- a/drivers/staging/vt6655/80211mgr.h +++ b/drivers/staging/vt6655/80211mgr.h @@ -38,7 +38,7 @@ #define WLAN_MIN_ARRAY 1 -// Information Element ID value +/* Information Element ID value */ #define WLAN_EID_SSID 0 #define WLAN_EID_SUPP_RATES 1 #define WLAN_EID_FH_PARMS 2 @@ -59,17 +59,17 @@ #define WLAN_EID_QUIET 40 #define WLAN_EID_IBSS_DFS 41 #define WLAN_EID_ERP 42 -// reference 802.11i 7.3.2 table 20 +/* reference 802.11i 7.3.2 table 20 */ #define WLAN_EID_RSN 48 #define WLAN_EID_EXTSUPP_RATES 50 -// reference WiFi WPA spec. +/* 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 -// Reason Codes +/* Reason Codes */ #define WLAN_MGMT_REASON_RSVD 0 #define WLAN_MGMT_REASON_UNSPEC 1 #define WLAN_MGMT_REASON_PRIOR_AUTH_INVALID 2 @@ -94,7 +94,7 @@ #define WLAN_MGMT_REASON_RSNE_CAP_INVALID 22 #define WLAN_MGMT_REASON_80211X_AUTH_FAILED 23 -// Status Codes +/* Status Codes */ #define WLAN_MGMT_STATUS_SUCCESS 0 #define WLAN_MGMT_STATUS_UNSPEC_FAILURE 1 #define WLAN_MGMT_STATUS_CAPS_UNSUPPORTED 10 @@ -110,19 +110,14 @@ #define WLAN_MGMT_STATUS_ASSOC_DENIED_PBCC 20 #define WLAN_MGMT_STATUS_ASSOC_DENIED_AGILITY 21 -// reference 802.11h 7.3.1.9 -// +/* reference 802.11h 7.3.1.9 */ #define WLAN_MGMT_STATUS_ASSOC_REJECT_BCS_SPECTRUM_MNG 22 #define WLAN_MGMT_STATUS_ASSOC_REJECT_BCS_PWR_CAP 23 #define WLAN_MGMT_STATUS_ASSOC_REJECT_BCS_SUPP_CH 24 -// -// reference 802.11g 7.3.1.9 -// +/* reference 802.11g 7.3.1.9 */ #define WLAN_MGMT_STATUS_SHORTSLOTTIME_UNSUPPORTED 25 #define WLAN_MGMT_STATUS_DSSSOFDM_UNSUPPORTED 26 -// -// reference 802.11i 7.3.1.9 table 19 -// +/* reference 802.11i 3.7.1.9 table 19 */ #define WLAN_MGMT_STATUS_INVALID_IE 40 #define WLAN_MGMT_STATUS_GROUP_CIPHER_INVALID 41 #define WLAN_MGMT_STATUS_PAIRWISE_CIPHER_INVALID 42 @@ -131,13 +126,13 @@ #define WLAN_MGMT_STATUS_INVALID_RSN_IE_CAP 45 #define WLAN_MGMT_STATUS_CIPHER_REJECT 46 -// Auth Algorithm +/* 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 +/* 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 */ #define WLAN_BEACON_OFF_TS 0 #define WLAN_BEACON_OFF_BCN_INT 8 @@ -179,9 +174,7 @@ #define WLAN_DEAUTHEN_OFF_REASON 0 -// -// Cipher Suite Selectors defined in 802.11i -// +/* Cipher Suite Selectors defined in 802.11i */ #define WLAN_11i_CSS_USE_GROUP 0 #define WLAN_11i_CSS_WEP40 1 #define WLAN_11i_CSS_TKIP 2 @@ -189,24 +182,22 @@ #define WLAN_11i_CSS_WEP104 5 #define WLAN_11i_CSS_UNKNOWN 255 -// -// Authentication and Key Management Suite Selectors defined in 802.11i -// +/* Authentication and Key Management Suite Selectors defined in 802.11i */ #define WLAN_11i_AKMSS_802_1X 1 #define WLAN_11i_AKMSS_PSK 2 #define WLAN_11i_AKMSS_UNKNOWN 255 -// Measurement type definitions reference ieee 802.11h Table 20b +/* Measurement type definitions reference ieee 802.11h Table 20b */ #define MEASURE_TYPE_BASIC 0 #define MEASURE_TYPE_CCA 1 #define MEASURE_TYPE_RPI 2 -// Measurement request mode definitions reference ieee 802.11h Figure 46h +/* Measurement request mode definitions reference ieee 802.11h Figure 46h */ #define MEASURE_MODE_ENABLE 0x02 #define MEASURE_MODE_REQ 0x04 #define MEASURE_MODE_REP 0x08 -// Measurement report mode definitions reference ieee 802.11h Figure 46m +/* Measurement report mode definitions reference ieee 802.11h Figure 46m */ #define MEASURE_MODE_LATE 0x01 #define MEASURE_MODE_INCAPABLE 0x02 #define MEASURE_MODE_REFUSED 0x04 @@ -217,7 +208,7 @@ /*--------------------- Export Types ------------------------------*/ -// Information Element Types +/* Information Element Types */ #pragma pack(1) typedef struct tagWLAN_IE { @@ -226,7 +217,7 @@ typedef struct tagWLAN_IE { } __attribute__ ((__packed__)) WLAN_IE, *PWLAN_IE; -// Service Set Identity (SSID) +/* Service Set Identity (SSID) */ #pragma pack(1) typedef struct tagWLAN_IE_SSID { unsigned char byElementID; @@ -235,7 +226,7 @@ typedef struct tagWLAN_IE_SSID { } __attribute__ ((__packed__)) WLAN_IE_SSID, *PWLAN_IE_SSID; -// Supported Rates +/* Supported Rates */ #pragma pack(1) typedef struct tagWLAN_IE_SUPP_RATES { unsigned char byElementID; @@ -244,7 +235,7 @@ typedef struct tagWLAN_IE_SUPP_RATES { } __attribute__ ((__packed__)) WLAN_IE_SUPP_RATES, *PWLAN_IE_SUPP_RATES; -// FH Parameter Set +/* FH Parameter Set */ #pragma pack(1) typedef struct _WLAN_IE_FH_PARMS { unsigned char byElementID; @@ -255,7 +246,7 @@ typedef struct _WLAN_IE_FH_PARMS { unsigned char byHopIndex; } WLAN_IE_FH_PARMS, *PWLAN_IE_FH_PARMS; -// DS Parameter Set +/* DS Parameter Set */ #pragma pack(1) typedef struct tagWLAN_IE_DS_PARMS { unsigned char byElementID; @@ -264,7 +255,7 @@ typedef struct tagWLAN_IE_DS_PARMS { } __attribute__ ((__packed__)) WLAN_IE_DS_PARMS, *PWLAN_IE_DS_PARMS; -// CF Parameter Set +/* CF Parameter Set */ #pragma pack(1) typedef struct tagWLAN_IE_CF_PARMS { unsigned char byElementID; @@ -276,7 +267,7 @@ typedef struct tagWLAN_IE_CF_PARMS { } __attribute__ ((__packed__)) WLAN_IE_CF_PARMS, *PWLAN_IE_CF_PARMS; -// TIM +/* TIM */ #pragma pack(1) typedef struct tagWLAN_IE_TIM { unsigned char byElementID; @@ -288,7 +279,7 @@ typedef struct tagWLAN_IE_TIM { } __attribute__ ((__packed__)) WLAN_IE_TIM, *PWLAN_IE_TIM; -// IBSS Parameter Set +/* IBSS Parameter Set */ #pragma pack(1) typedef struct tagWLAN_IE_IBSS_PARMS { unsigned char byElementID; @@ -297,7 +288,7 @@ typedef struct tagWLAN_IE_IBSS_PARMS { } __attribute__ ((__packed__)) WLAN_IE_IBSS_PARMS, *PWLAN_IE_IBSS_PARMS; -// Challenge Text +/* Challenge Text */ #pragma pack(1) typedef struct tagWLAN_IE_CHALLENGE { unsigned char byElementID; @@ -316,8 +307,8 @@ typedef struct tagWLAN_IE_RSN_EXT { unsigned short wPKCount; struct { unsigned char abyOUI[4]; - } PKSList[1]; // the rest is variable so need to - // overlay ieauth structure + } PKSList[1]; /* the rest is variable so need to */ + /* overlay ieauth structure */ } WLAN_IE_RSN_EXT, *PWLAN_IE_RSN_EXT; #pragma pack(1) @@ -328,7 +319,7 @@ typedef struct tagWLAN_IE_RSN_AUTH { } AuthKSList[1]; } WLAN_IE_RSN_AUTH, *PWLAN_IE_RSN_AUTH; -// RSN Identity +/* RSN Identity */ #pragma pack(1) typedef struct tagWLAN_IE_RSN { unsigned char byElementID; @@ -337,7 +328,7 @@ typedef struct tagWLAN_IE_RSN { unsigned char abyRSN[WLAN_MIN_ARRAY]; } WLAN_IE_RSN, *PWLAN_IE_RSN; -// ERP +/* ERP */ #pragma pack(1) typedef struct tagWLAN_IE_ERP { unsigned char byElementID; @@ -466,8 +457,8 @@ typedef struct _WLAN_IE_IBSS_DFS { #pragma pack() -// Frame Types -// prototype structure, all mgmt frame types will start with these members +/* Frame Types */ +/* prototype structure, all mgmt frame types will start with these members */ typedef struct tagWLAN_FR_MGMT { unsigned int uType; unsigned int len; @@ -475,20 +466,20 @@ typedef struct tagWLAN_FR_MGMT { PUWLAN_80211HDR pHdr; } WLAN_FR_MGMT, *PWLAN_FR_MGMT; -// Beacon frame +/* Beacon frame */ typedef struct tagWLAN_FR_BEACON { unsigned int uType; unsigned int len; unsigned char *pBuf; PUWLAN_80211HDR pHdr; - // fixed fields + /* fixed fields */ PQWORD pqwTimestamp; unsigned short *pwBeaconInterval; unsigned short *pwCapInfo; /*-- info elements ----------*/ PWLAN_IE_SSID pSSID; PWLAN_IE_SUPP_RATES pSuppRates; -// PWLAN_IE_FH_PARMS pFHParms; +/* PWLAN_IE_FH_PARMS pFHParms; */ PWLAN_IE_DS_PARMS pDSParms; PWLAN_IE_CF_PARMS pCFParms; PWLAN_IE_TIM pTIM; @@ -504,19 +495,19 @@ typedef struct tagWLAN_FR_BEACON { PWLAN_IE_QUIET pIE_Quiet; } WLAN_FR_BEACON, *PWLAN_FR_BEACON; -// IBSS ATIM frame +/* IBSS ATIM frame */ typedef struct tagWLAN_FR_IBSSATIM { unsigned int uType; unsigned int len; unsigned char *pBuf; PUWLAN_80211HDR pHdr; - // fixed fields - // info elements - // this frame type has a null body + /* fixed fields */ + /* info elements */ + /* this frame type has a null body */ } WLAN_FR_IBSSATIM, *PWLAN_FR_IBSSATIM; -// Disassociation +/* Disassociation */ typedef struct tagWLAN_FR_DISASSOC { unsigned int uType; unsigned int len; @@ -527,7 +518,7 @@ typedef struct tagWLAN_FR_DISASSOC { /*-- info elements ----------*/ } WLAN_FR_DISASSOC, *PWLAN_FR_DISASSOC; -// Association Request +/* Association Request */ typedef struct tagWLAN_FR_ASSOCREQ { unsigned int uType; unsigned int len; @@ -546,7 +537,7 @@ typedef struct tagWLAN_FR_ASSOCREQ { PWLAN_IE_SUPP_CH pCurrSuppCh; } WLAN_FR_ASSOCREQ, *PWLAN_FR_ASSOCREQ; -// Association Response +/* Association Response */ typedef struct tagWLAN_FR_ASSOCRESP { unsigned int uType; unsigned int len; @@ -561,7 +552,7 @@ typedef struct tagWLAN_FR_ASSOCRESP { PWLAN_IE_SUPP_RATES pExtSuppRates; } WLAN_FR_ASSOCRESP, *PWLAN_FR_ASSOCRESP; -// Reassociation Request +/* Reassociation Request */ typedef struct tagWLAN_FR_REASSOCREQ { unsigned int uType; unsigned int len; @@ -581,7 +572,7 @@ typedef struct tagWLAN_FR_REASSOCREQ { PWLAN_IE_SUPP_RATES pExtSuppRates; } WLAN_FR_REASSOCREQ, *PWLAN_FR_REASSOCREQ; -// Reassociation Response +/* Reassociation Response */ typedef struct tagWLAN_FR_REASSOCRESP { unsigned int uType; unsigned int len; @@ -596,7 +587,7 @@ typedef struct tagWLAN_FR_REASSOCRESP { PWLAN_IE_SUPP_RATES pExtSuppRates; } WLAN_FR_REASSOCRESP, *PWLAN_FR_REASSOCRESP; -// Probe Request +/* Probe Request */ typedef struct tagWLAN_FR_PROBEREQ { unsigned int uType; unsigned int len; @@ -609,7 +600,7 @@ typedef struct tagWLAN_FR_PROBEREQ { PWLAN_IE_SUPP_RATES pExtSuppRates; } WLAN_FR_PROBEREQ, *PWLAN_FR_PROBEREQ; -// Probe Response +/* Probe Response */ typedef struct tagWLAN_FR_PROBERESP { unsigned int uType; unsigned int len; @@ -636,7 +627,7 @@ typedef struct tagWLAN_FR_PROBERESP { PWLAN_IE_QUIET pIE_Quiet; } WLAN_FR_PROBERESP, *PWLAN_FR_PROBERESP; -// Authentication +/* Authentication */ typedef struct tagWLAN_FR_AUTHEN { unsigned int uType; unsigned int len; @@ -650,7 +641,7 @@ typedef struct tagWLAN_FR_AUTHEN { PWLAN_IE_CHALLENGE pChallenge; } WLAN_FR_AUTHEN, *PWLAN_FR_AUTHEN; -// Deauthenication +/* Deauthenication */ typedef struct tagWLAN_FR_DEAUTHEN { unsigned int uType; unsigned int len; @@ -774,4 +765,4 @@ vMgrDecodeReassocResponse( PWLAN_FR_REASSOCRESP pFrame ); -#endif// __80211MGR_H__ +#endif/* __80211MGR_H__ */ diff --git a/drivers/staging/vt6655/aes_ccmp.c b/drivers/staging/vt6655/aes_ccmp.c index 3608148..fc056fc 100644 --- a/drivers/staging/vt6655/aes_ccmp.c +++ b/drivers/staging/vt6655/aes_ccmp.c @@ -205,7 +205,7 @@ void AESv128(unsigned char *key, unsigned char *data, unsigned char *ciphertext) SubBytes(ciphertext, TmpdataA); ShiftRows(TmpdataA, TmpdataB); xor_128(TmpdataB, abyRoundKey, ciphertext); - } else // round 1 ~ 9 + } else /* round 1 ~ 9 */ { SubBytes(ciphertext, TmpdataA); ShiftRows(TmpdataA, TmpdataB); @@ -249,7 +249,7 @@ bool AESbGenCCMP(unsigned char *pbyRxKey, unsigned char *pbyFrame, unsigned shor unsigned char *pbyIV; unsigned char *pbyPayload; unsigned short wHLen = 22; - unsigned short wPayloadSize = wFrameSize - 8 - 8 - 4 - WLAN_HDR_ADDR3_LEN;//8 is IV, 8 is MIC, 4 is CRC + unsigned short wPayloadSize = wFrameSize - 8 - 8 - 4 - WLAN_HDR_ADDR3_LEN;/* 8 is IV, 8 is MIC, 4 is CRC */ bool bA4 = false; unsigned char byTmp; unsigned short wCnt; @@ -259,13 +259,13 @@ bool AESbGenCCMP(unsigned char *pbyRxKey, unsigned char *pbyFrame, unsigned shor if (WLAN_GET_FC_TODS(*(unsigned short *)pbyFrame) && WLAN_GET_FC_FROMDS(*(unsigned short *)pbyFrame)) { bA4 = true; - pbyIV += 6; // 6 is 802.11 address4 + pbyIV += 6; /* 6 is 802.11 address4 */ wHLen += 6; wPayloadSize -= 6; } - pbyPayload = pbyIV + 8; //IV-length + pbyPayload = pbyIV + 8; /* IV-length */ - abyNonce[0] = 0x00; //now is 0, if Qos here will be priority + abyNonce[0] = 0x00; /* now is 0, if Qos here will be priority */ memcpy(&(abyNonce[1]), pMACHeader->abyAddr2, ETH_ALEN); abyNonce[7] = pbyIV[7]; abyNonce[8] = pbyIV[6]; @@ -274,13 +274,13 @@ bool AESbGenCCMP(unsigned char *pbyRxKey, unsigned char *pbyFrame, unsigned shor abyNonce[11] = pbyIV[1]; abyNonce[12] = pbyIV[0]; - //MIC_IV + /* MIC_IV */ MIC_IV[0] = 0x59; memcpy(&(MIC_IV[1]), &(abyNonce[0]), 13); MIC_IV[14] = (unsigned char)(wPayloadSize >> 8); MIC_IV[15] = (unsigned char)(wPayloadSize & 0xff); - //MIC_HDR1 + /* MIC_HDR1 */ MIC_HDR1[0] = (unsigned char)(wHLen >> 8); MIC_HDR1[1] = (unsigned char)(wHLen & 0xff); byTmp = (unsigned char)(pMACHeader->wFrameCtl & 0xff); @@ -291,7 +291,7 @@ bool AESbGenCCMP(unsigned char *pbyRxKey, unsigned char *pbyFrame, unsigned shor memcpy(&(MIC_HDR1[4]), pMACHeader->abyAddr1, ETH_ALEN); memcpy(&(MIC_HDR1[10]), pMACHeader->abyAddr2, ETH_ALEN); - //MIC_HDR2 + /* MIC_HDR2 */ memcpy(&(MIC_HDR2[0]), pMACHeader->abyAddr3, ETH_ALEN); byTmp = (unsigned char)(pMACHeader->wSeqCtl & 0xff); MIC_HDR2[6] = byTmp & 0x0f; @@ -309,7 +309,7 @@ bool AESbGenCCMP(unsigned char *pbyRxKey, unsigned char *pbyFrame, unsigned shor MIC_HDR2[14] = 0x00; MIC_HDR2[15] = 0x00; - //CCMP + /* CCMP */ AESv128(pbyRxKey, MIC_IV, abyMIC); for (kk = 0; kk < 16; kk++) { abyTmp[kk] = MIC_HDR1[kk] ^ abyMIC[kk]; @@ -341,9 +341,9 @@ bool AESbGenCCMP(unsigned char *pbyRxKey, unsigned char *pbyFrame, unsigned shor memcpy(pbyPayload, abyPlainText, 16); wCnt++; pbyPayload += 16; - } //for wPayloadSize + } /* for wPayloadSize */ - //last payload + /* last payload */ memcpy(&(abyLastCipher[0]), pbyPayload, jj); for (ii = jj; ii < 16; ii++) { abyLastCipher[ii] = 0x00; @@ -359,7 +359,7 @@ bool AESbGenCCMP(unsigned char *pbyRxKey, unsigned char *pbyFrame, unsigned shor memcpy(pbyPayload, abyPlainText, jj); pbyPayload += jj; - //for MIC calculation + /* for MIC calculation */ for (ii = jj; ii < 16; ii++) { abyPlainText[ii] = 0x00; } @@ -368,8 +368,8 @@ bool AESbGenCCMP(unsigned char *pbyRxKey, unsigned char *pbyFrame, unsigned shor } AESv128(pbyRxKey, abyTmp, abyMIC); - //=>above is the calculate MIC - //-------------------------------------------- + /* =>above is the calculate MIC */ + /* -------------------------------------------- */ wCnt = 0; abyCTRPLD[14] = (unsigned char)(wCnt >> 8); @@ -378,12 +378,11 @@ bool AESbGenCCMP(unsigned char *pbyRxKey, unsigned char *pbyFrame, unsigned shor for (kk = 0; kk < 8; kk++) { abyTmp[kk] = abyTmp[kk] ^ pbyPayload[kk]; } - //=>above is the dec-MIC from packet - //-------------------------------------------- + /* =>above is the dec-MIC from packet */ + /* -------------------------------------------- */ - if (!memcmp(abyMIC, abyTmp, 8)) { + if (!memcmp(abyMIC, abyTmp, 8)) return true; - } else { + else return false; - } } diff --git a/drivers/staging/vt6655/aes_ccmp.h b/drivers/staging/vt6655/aes_ccmp.h index c8b28b0..cc02e64 100644 --- a/drivers/staging/vt6655/aes_ccmp.h +++ b/drivers/staging/vt6655/aes_ccmp.h @@ -43,4 +43,4 @@ /*--------------------- Export Functions --------------------------*/ bool AESbGenCCMP(unsigned char *pbyRxKey, unsigned char *pbyFrame, unsigned short wFrameSize); -#endif //__AES_H__ +#endif /* __AES_H__ */ diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c index 8417c2f..57a08c5 100644 --- a/drivers/staging/vt6655/hostap.c +++ b/drivers/staging/vt6655/hostap.c @@ -80,7 +80,7 @@ static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked) DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Enabling hostapd mode\n", dev->name); - pDevice->apdev = kzalloc(sizeof(struct net_device), GFP_KERNEL); + pDevice->apdev = alloc_etherdev(sizeof(*apdev_priv)); if (pDevice->apdev == NULL) return -ENOMEM; @@ -104,6 +104,8 @@ static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked) if (ret) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: register_netdevice(AP) failed!\n", dev->name); + free_netdev(pDevice->apdev); + pDevice->apdev = NULL; return -1; } @@ -141,7 +143,7 @@ static int hostap_disable_hostapd(PSDevice pDevice, int rtnl_locked) DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Netdevice %s unregistered\n", pDevice->dev->name, pDevice->apdev->name); } - kfree(pDevice->apdev); + free_netdev(pDevice->apdev); pDevice->apdev = NULL; pDevice->bEnable8021x = false; pDevice->bEnableHostWEP = false; diff --git a/drivers/staging/vt6655/ioctl.c b/drivers/staging/vt6655/ioctl.c index 2ae8116..46e0e41 100644 --- a/drivers/staging/vt6655/ioctl.c +++ b/drivers/staging/vt6655/ioctl.c @@ -64,7 +64,6 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) PKnownBSS pBSS; PKnownNodeDB pNode; unsigned int ii, jj; - SCmdLinkStatus sLinkStatus; unsigned char abySuppRates[] = {WLAN_EID_SUPP_RATES, 4, 0x02, 0x04, 0x0B, 0x16}; unsigned char abyNullAddr[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; unsigned long dwKeyIndex = 0; @@ -245,10 +244,12 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled; break; - case WLAN_CMD_GET_LINK: + case WLAN_CMD_GET_LINK: { + SCmdLinkStatus sLinkStatus; + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WLAN_CMD_GET_LINK status.\n"); - memset(sLinkStatus.abySSID, 0 , WLAN_SSID_MAXLEN + 1); + memset(&sLinkStatus, 0, sizeof(sLinkStatus)); if (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) sLinkStatus.wBSSType = ADHOC; @@ -277,7 +278,7 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) break; } break; - + } case WLAN_CMD_GET_LISTLEN: cbListCount = 0; pBSS = &(pMgmt->sBSSList[0]); |