diff options
Diffstat (limited to 'drivers/staging/ath6kl/wlan')
-rw-r--r-- | drivers/staging/ath6kl/wlan/include/ieee80211.h | 76 | ||||
-rw-r--r-- | drivers/staging/ath6kl/wlan/include/ieee80211_node.h | 10 | ||||
-rw-r--r-- | drivers/staging/ath6kl/wlan/src/wlan_node.c | 75 | ||||
-rw-r--r-- | drivers/staging/ath6kl/wlan/src/wlan_recv_beacon.c | 40 | ||||
-rw-r--r-- | drivers/staging/ath6kl/wlan/src/wlan_utils.c | 6 |
5 files changed, 103 insertions, 104 deletions
diff --git a/drivers/staging/ath6kl/wlan/include/ieee80211.h b/drivers/staging/ath6kl/wlan/include/ieee80211.h index c4fd13f..532ab0e 100644 --- a/drivers/staging/ath6kl/wlan/include/ieee80211.h +++ b/drivers/staging/ath6kl/wlan/include/ieee80211.h @@ -68,9 +68,9 @@ #define IEEE80211_ADDR_EQ(addr1, addr2) \ - (A_MEMCMP(addr1, addr2, IEEE80211_ADDR_LEN) == 0) + (memcmp(addr1, addr2, IEEE80211_ADDR_LEN) == 0) -#define IEEE80211_ADDR_COPY(dst,src) A_MEMCPY(dst,src,IEEE80211_ADDR_LEN) +#define IEEE80211_ADDR_COPY(dst,src) memcpy(dst,src,IEEE80211_ADDR_LEN) #define IEEE80211_KEYBUF_SIZE 16 #define IEEE80211_MICBUF_SIZE (8+8) /* space for both tx and rx */ @@ -99,24 +99,24 @@ * generic definitions for IEEE 802.11 frames */ PREPACK struct ieee80211_frame { - A_UINT8 i_fc[2]; - A_UINT8 i_dur[2]; - A_UINT8 i_addr1[IEEE80211_ADDR_LEN]; - A_UINT8 i_addr2[IEEE80211_ADDR_LEN]; - A_UINT8 i_addr3[IEEE80211_ADDR_LEN]; - A_UINT8 i_seq[2]; + u8 i_fc[2]; + u8 i_dur[2]; + u8 i_addr1[IEEE80211_ADDR_LEN]; + u8 i_addr2[IEEE80211_ADDR_LEN]; + u8 i_addr3[IEEE80211_ADDR_LEN]; + u8 i_seq[2]; /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */ /* see below */ } POSTPACK; PREPACK struct ieee80211_qosframe { - A_UINT8 i_fc[2]; - A_UINT8 i_dur[2]; - A_UINT8 i_addr1[IEEE80211_ADDR_LEN]; - A_UINT8 i_addr2[IEEE80211_ADDR_LEN]; - A_UINT8 i_addr3[IEEE80211_ADDR_LEN]; - A_UINT8 i_seq[2]; - A_UINT8 i_qos[2]; + u8 i_fc[2]; + u8 i_dur[2]; + u8 i_addr1[IEEE80211_ADDR_LEN]; + u8 i_addr2[IEEE80211_ADDR_LEN]; + u8 i_addr3[IEEE80211_ADDR_LEN]; + u8 i_seq[2]; + u8 i_qos[2]; } POSTPACK; #define IEEE80211_FC0_VERSION_MASK 0x03 @@ -320,29 +320,29 @@ typedef enum { * WMM/802.11e Tspec Element */ typedef PREPACK struct wmm_tspec_ie_t { - A_UINT8 elementId; - A_UINT8 len; - A_UINT8 oui[3]; - A_UINT8 ouiType; - A_UINT8 ouiSubType; - A_UINT8 version; - A_UINT16 tsInfo_info; - A_UINT8 tsInfo_reserved; - A_UINT16 nominalMSDU; - A_UINT16 maxMSDU; - A_UINT32 minServiceInt; - A_UINT32 maxServiceInt; - A_UINT32 inactivityInt; - A_UINT32 suspensionInt; - A_UINT32 serviceStartTime; - A_UINT32 minDataRate; - A_UINT32 meanDataRate; - A_UINT32 peakDataRate; - A_UINT32 maxBurstSize; - A_UINT32 delayBound; - A_UINT32 minPhyRate; - A_UINT16 sba; - A_UINT16 mediumTime; + u8 elementId; + u8 len; + u8 oui[3]; + u8 ouiType; + u8 ouiSubType; + u8 version; + u16 tsInfo_info; + u8 tsInfo_reserved; + u16 nominalMSDU; + u16 maxMSDU; + u32 minServiceInt; + u32 maxServiceInt; + u32 inactivityInt; + u32 suspensionInt; + u32 serviceStartTime; + u32 minDataRate; + u32 meanDataRate; + u32 peakDataRate; + u32 maxBurstSize; + u32 delayBound; + u32 minPhyRate; + u16 sba; + u16 mediumTime; } POSTPACK WMM_TSPEC_IE; diff --git a/drivers/staging/ath6kl/wlan/include/ieee80211_node.h b/drivers/staging/ath6kl/wlan/include/ieee80211_node.h index 683deec..1cb0167 100644 --- a/drivers/staging/ath6kl/wlan/include/ieee80211_node.h +++ b/drivers/staging/ath6kl/wlan/include/ieee80211_node.h @@ -55,7 +55,7 @@ #define IEEE80211_NODE_HASHSIZE 32 /* simple hash is enough for variation of macaddr */ #define IEEE80211_NODE_HASH(addr) \ - (((const A_UINT8 *)(addr))[IEEE80211_ADDR_LEN - 1] % \ + (((const u8 *)(addr))[IEEE80211_ADDR_LEN - 1] % \ IEEE80211_NODE_HASHSIZE) /* @@ -71,14 +71,14 @@ struct ieee80211_node_table { struct bss *nt_node_last; /* information of all nodes */ struct bss *nt_hash[IEEE80211_NODE_HASHSIZE]; const char *nt_name; /* for debugging */ - A_UINT32 nt_scangen; /* gen# for timeout scan */ + u32 nt_scangen; /* gen# for timeout scan */ #ifdef THREAD_X A_TIMER nt_inact_timer; - A_UINT8 isTimerArmed; /* is the node timer armed */ + u8 isTimerArmed; /* is the node timer armed */ #endif - A_UINT32 nt_nodeAge; /* node aging time */ + u32 nt_nodeAge; /* node aging time */ #ifdef OS_ROAM_MANAGEMENT - A_UINT32 nt_si_gen; /* gen# for scan indication*/ + u32 nt_si_gen; /* gen# for scan indication*/ #endif }; diff --git a/drivers/staging/ath6kl/wlan/src/wlan_node.c b/drivers/staging/ath6kl/wlan/src/wlan_node.c index 6ec4e48..1a3ac7d 100644 --- a/drivers/staging/ath6kl/wlan/src/wlan_node.c +++ b/drivers/staging/ath6kl/wlan/src/wlan_node.c @@ -40,7 +40,7 @@ #ifdef ATH_DEBUG_MODULE -static ATH_DEBUG_MASK_DESCRIPTION wlan_debug_desc[] = { +static struct ath_debug_mask_description wlan_debug_desc[] = { { ATH_DEBUG_WLAN , "General WLAN Node Tracing"}, }; @@ -58,7 +58,7 @@ static void wlan_node_timeout(A_ATH_TIMER arg); #endif static bss_t * _ieee80211_find_node (struct ieee80211_node_table *nt, - const A_UINT8 *macaddr); + const u8 *macaddr); bss_t * wlan_node_alloc(struct ieee80211_node_table *nt, int wh_size) @@ -111,18 +111,18 @@ wlan_node_free(bss_t *ni) void wlan_setup_node(struct ieee80211_node_table *nt, bss_t *ni, - const A_UINT8 *macaddr) + const u8 *macaddr) { int hash; - A_UINT32 timeoutValue = 0; + u32 timeoutValue = 0; - A_MEMCPY(ni->ni_macaddr, macaddr, IEEE80211_ADDR_LEN); + memcpy(ni->ni_macaddr, macaddr, IEEE80211_ADDR_LEN); hash = IEEE80211_NODE_HASH (macaddr); ieee80211_node_initref (ni); /* mark referenced */ timeoutValue = nt->nt_nodeAge; - ni->ni_tstamp = A_GET_MS (timeoutValue); + ni->ni_tstamp = A_GET_MS (0); ni->ni_actcnt = WLAN_NODE_INACT_CNT; IEEE80211_NODE_LOCK_BH(nt); @@ -151,7 +151,7 @@ wlan_setup_node(struct ieee80211_node_table *nt, bss_t *ni, #ifdef THREAD_X if (!nt->isTimerArmed) { A_TIMEOUT_MS(&nt->nt_inact_timer, timeoutValue, 0); - nt->isTimerArmed = TRUE; + nt->isTimerArmed = true; } #endif @@ -160,7 +160,7 @@ wlan_setup_node(struct ieee80211_node_table *nt, bss_t *ni, static bss_t * _ieee80211_find_node(struct ieee80211_node_table *nt, - const A_UINT8 *macaddr) + const u8 *macaddr) { bss_t *ni; int hash; @@ -178,7 +178,7 @@ _ieee80211_find_node(struct ieee80211_node_table *nt, } bss_t * -wlan_find_node(struct ieee80211_node_table *nt, const A_UINT8 *macaddr) +wlan_find_node(struct ieee80211_node_table *nt, const u8 *macaddr) { bss_t *ni; @@ -262,7 +262,7 @@ wlan_iterate_nodes(struct ieee80211_node_table *nt, wlan_node_iter_func *f, void *arg) { bss_t *ni; - A_UINT32 gen; + u32 gen; gen = ++nt->nt_scangen; @@ -299,7 +299,7 @@ wlan_node_table_init(void *wmip, struct ieee80211_node_table *nt) #ifdef THREAD_X A_INIT_TIMER(&nt->nt_inact_timer, wlan_node_timeout, nt); - nt->isTimerArmed = FALSE; + nt->isTimerArmed = false; #endif nt->nt_wmip = wmip; nt->nt_nodeAge = WLAN_NODE_INACT_TIMEOUT_MSEC; @@ -316,7 +316,7 @@ wlan_node_table_init(void *wmip, struct ieee80211_node_table *nt) } void -wlan_set_nodeage(struct ieee80211_node_table *nt, A_UINT32 nodeAge) +wlan_set_nodeage(struct ieee80211_node_table *nt, u32 nodeAge) { nt->nt_nodeAge = nodeAge; return; @@ -326,7 +326,7 @@ wlan_refresh_inactive_nodes (struct ieee80211_node_table *nt) { #ifdef THREAD_X bss_t *bss, *nextBss; - A_UINT8 myBssid[IEEE80211_ADDR_LEN], reArmTimer = FALSE; + u8 myBssid[IEEE80211_ADDR_LEN], reArmTimer = false; wmi_get_current_bssid(nt->nt_wmip, myBssid); @@ -334,7 +334,7 @@ wlan_refresh_inactive_nodes (struct ieee80211_node_table *nt) while (bss != NULL) { nextBss = bss->ni_list_next; - if (A_MEMCMP(myBssid, bss->ni_macaddr, sizeof(myBssid)) != 0) + if (memcmp(myBssid, bss->ni_macaddr, sizeof(myBssid)) != 0) { /* * free up all but the current bss - if set @@ -346,9 +346,9 @@ wlan_refresh_inactive_nodes (struct ieee80211_node_table *nt) } #else bss_t *bss, *nextBss; - A_UINT8 myBssid[IEEE80211_ADDR_LEN]; - A_UINT32 timeoutValue = 0; - A_UINT32 now = A_GET_MS(0); + u8 myBssid[IEEE80211_ADDR_LEN]; + u32 timeoutValue = 0; + u32 now = A_GET_MS(0); timeoutValue = nt->nt_nodeAge; wmi_get_current_bssid(nt->nt_wmip, myBssid); @@ -357,10 +357,10 @@ wlan_refresh_inactive_nodes (struct ieee80211_node_table *nt) while (bss != NULL) { nextBss = bss->ni_list_next; - if (A_MEMCMP(myBssid, bss->ni_macaddr, sizeof(myBssid)) != 0) + if (memcmp(myBssid, bss->ni_macaddr, sizeof(myBssid)) != 0) { - if (bss->ni_tstamp <= now || --bss->ni_actcnt == 0) + if (((now - bss->ni_tstamp) > timeoutValue) || --bss->ni_actcnt == 0) { /* * free up all but the current bss - if set @@ -379,8 +379,9 @@ wlan_node_timeout (A_ATH_TIMER arg) { struct ieee80211_node_table *nt = (struct ieee80211_node_table *)arg; bss_t *bss, *nextBss; - A_UINT8 myBssid[IEEE80211_ADDR_LEN], reArmTimer = FALSE; - A_UINT32 timeoutValue = 0; + u8 myBssid[IEEE80211_ADDR_LEN], reArmTimer = false; + u32 timeoutValue = 0; + u32 now = A_GET_MS(0); timeoutValue = nt->nt_nodeAge; @@ -390,10 +391,10 @@ wlan_node_timeout (A_ATH_TIMER arg) while (bss != NULL) { nextBss = bss->ni_list_next; - if (A_MEMCMP(myBssid, bss->ni_macaddr, sizeof(myBssid)) != 0) + if (memcmp(myBssid, bss->ni_macaddr, sizeof(myBssid)) != 0) { - if (bss->ni_tstamp <= A_GET_MS(0)) + if ((now - bss->ni_tstamp) > timeoutValue) { /* * free up all but the current bss - if set @@ -406,7 +407,7 @@ wlan_node_timeout (A_ATH_TIMER arg) * Re-arm timer, only when we have a bss other than * current bss AND it is not aged-out. */ - reArmTimer = TRUE; + reArmTimer = true; } } bss = nextBss; @@ -431,11 +432,11 @@ wlan_node_table_cleanup(struct ieee80211_node_table *nt) } bss_t * -wlan_find_Ssidnode (struct ieee80211_node_table *nt, A_UCHAR *pSsid, - A_UINT32 ssidLength, A_BOOL bIsWPA2, A_BOOL bMatchSSID) +wlan_find_Ssidnode (struct ieee80211_node_table *nt, u8 *pSsid, + u32 ssidLength, bool bIsWPA2, bool bMatchSSID) { bss_t *ni = NULL; - A_UCHAR *pIESsid = NULL; + u8 *pIESsid = NULL; IEEE80211_NODE_LOCK (nt); @@ -447,22 +448,22 @@ wlan_find_Ssidnode (struct ieee80211_node_table *nt, A_UCHAR *pSsid, if (0x00 == memcmp (pSsid, &pIESsid[2], ssidLength)) { // - // Step 2.1 : Check MatchSSID is TRUE, if so, return Matched SSID + // Step 2.1 : Check MatchSSID is true, if so, return Matched SSID // Profile, otherwise check whether WPA2 or WPA // - if (TRUE == bMatchSSID) { + if (true == bMatchSSID) { ieee80211_node_incref (ni); /* mark referenced */ IEEE80211_NODE_UNLOCK (nt); return ni; } // Step 2 : if SSID matches, check WPA or WPA2 - if (TRUE == bIsWPA2 && NULL != ni->ni_cie.ie_rsn) { + if (true == bIsWPA2 && NULL != ni->ni_cie.ie_rsn) { ieee80211_node_incref (ni); /* mark referenced */ IEEE80211_NODE_UNLOCK (nt); return ni; } - if (FALSE == bIsWPA2 && NULL != ni->ni_cie.ie_wpa) { + if (false == bIsWPA2 && NULL != ni->ni_cie.ie_wpa) { ieee80211_node_incref(ni); /* mark referenced */ IEEE80211_NODE_UNLOCK (nt); return ni; @@ -526,7 +527,7 @@ wlan_node_remove_core (struct ieee80211_node_table *nt, bss_t *ni) } bss_t * -wlan_node_remove(struct ieee80211_node_table *nt, A_UINT8 *bssid) +wlan_node_remove(struct ieee80211_node_table *nt, u8 *bssid) { bss_t *bss, *nextBss; @@ -538,7 +539,7 @@ wlan_node_remove(struct ieee80211_node_table *nt, A_UINT8 *bssid) { nextBss = bss->ni_list_next; - if (A_MEMCMP(bssid, bss->ni_macaddr, 6) == 0) + if (memcmp(bssid, bss->ni_macaddr, 6) == 0) { wlan_node_remove_core (nt, bss); IEEE80211_NODE_UNLOCK(nt); @@ -553,13 +554,13 @@ wlan_node_remove(struct ieee80211_node_table *nt, A_UINT8 *bssid) } bss_t * -wlan_find_matching_Ssidnode (struct ieee80211_node_table *nt, A_UCHAR *pSsid, - A_UINT32 ssidLength, A_UINT32 dot11AuthMode, A_UINT32 authMode, - A_UINT32 pairwiseCryptoType, A_UINT32 grpwiseCryptoTyp) +wlan_find_matching_Ssidnode (struct ieee80211_node_table *nt, u8 *pSsid, + u32 ssidLength, u32 dot11AuthMode, u32 authMode, + u32 pairwiseCryptoType, u32 grpwiseCryptoTyp) { bss_t *ni = NULL; bss_t *best_ni = NULL; - A_UCHAR *pIESsid = NULL; + u8 *pIESsid = NULL; IEEE80211_NODE_LOCK (nt); diff --git a/drivers/staging/ath6kl/wlan/src/wlan_recv_beacon.c b/drivers/staging/ath6kl/wlan/src/wlan_recv_beacon.c index f4926f2..9ebfecf 100644 --- a/drivers/staging/ath6kl/wlan/src/wlan_recv_beacon.c +++ b/drivers/staging/ath6kl/wlan/src/wlan_recv_beacon.c @@ -49,23 +49,23 @@ /* unaligned little endian access */ #define LE_READ_2(p) \ - ((A_UINT16) \ - ((((A_UINT8 *)(p))[0] ) | (((A_UINT8 *)(p))[1] << 8))) + ((u16) \ + ((((u8 *)(p))[0] ) | (((u8 *)(p))[1] << 8))) #define LE_READ_4(p) \ - ((A_UINT32) \ - ((((A_UINT8 *)(p))[0] ) | (((A_UINT8 *)(p))[1] << 8) | \ - (((A_UINT8 *)(p))[2] << 16) | (((A_UINT8 *)(p))[3] << 24))) + ((u32) \ + ((((u8 *)(p))[0] ) | (((u8 *)(p))[1] << 8) | \ + (((u8 *)(p))[2] << 16) | (((u8 *)(p))[3] << 24))) static int __inline -iswpaoui(const A_UINT8 *frm) +iswpaoui(const u8 *frm) { return frm[1] > 3 && LE_READ_4(frm+2) == ((WPA_OUI_TYPE<<24)|WPA_OUI); } static int __inline -iswmmoui(const A_UINT8 *frm) +iswmmoui(const u8 *frm) { return frm[1] > 3 && LE_READ_4(frm+2) == ((WMM_OUI_TYPE<<24)|WMM_OUI); } @@ -73,38 +73,38 @@ iswmmoui(const A_UINT8 *frm) /* unused functions for now */ #if 0 static int __inline -iswmmparam(const A_UINT8 *frm) +iswmmparam(const u8 *frm) { return frm[1] > 5 && frm[6] == WMM_PARAM_OUI_SUBTYPE; } static int __inline -iswmminfo(const A_UINT8 *frm) +iswmminfo(const u8 *frm) { return frm[1] > 5 && frm[6] == WMM_INFO_OUI_SUBTYPE; } #endif static int __inline -isatherosoui(const A_UINT8 *frm) +isatherosoui(const u8 *frm) { return frm[1] > 3 && LE_READ_4(frm+2) == ((ATH_OUI_TYPE<<24)|ATH_OUI); } static int __inline -iswscoui(const A_UINT8 *frm) +iswscoui(const u8 *frm) { return frm[1] > 3 && LE_READ_4(frm+2) == ((0x04<<24)|WPA_OUI); } -A_STATUS -wlan_parse_beacon(A_UINT8 *buf, int framelen, struct ieee80211_common_ie *cie) +int +wlan_parse_beacon(u8 *buf, int framelen, struct ieee80211_common_ie *cie) { - A_UINT8 *frm, *efrm; - A_UINT8 elemid_ssid = FALSE; + u8 *frm, *efrm; + u8 elemid_ssid = false; frm = buf; - efrm = (A_UINT8 *) (frm + framelen); + efrm = (u8 *) (frm + framelen); /* * beacon/probe response frame format @@ -125,8 +125,8 @@ wlan_parse_beacon(A_UINT8 *buf, int framelen, struct ieee80211_common_ie *cie) A_MEMZERO(cie, sizeof(*cie)); cie->ie_tstamp = frm; frm += 8; - cie->ie_beaconInt = A_LE2CPU16(*(A_UINT16 *)frm); frm += 2; - cie->ie_capInfo = A_LE2CPU16(*(A_UINT16 *)frm); frm += 2; + cie->ie_beaconInt = A_LE2CPU16(*(u16 *)frm); frm += 2; + cie->ie_capInfo = A_LE2CPU16(*(u16 *)frm); frm += 2; cie->ie_chan = 0; while (frm < efrm) { @@ -134,7 +134,7 @@ wlan_parse_beacon(A_UINT8 *buf, int framelen, struct ieee80211_common_ie *cie) case IEEE80211_ELEMID_SSID: if (!elemid_ssid) { cie->ie_ssid = frm; - elemid_ssid = TRUE; + elemid_ssid = true; } break; case IEEE80211_ELEMID_RATES: @@ -196,5 +196,5 @@ wlan_parse_beacon(A_UINT8 *buf, int framelen, struct ieee80211_common_ie *cie) IEEE80211_VERIFY_ELEMENT(cie->ie_rates, IEEE80211_RATE_MAXSIZE); IEEE80211_VERIFY_ELEMENT(cie->ie_ssid, IEEE80211_NWID_LEN); - return A_OK; + return 0; } diff --git a/drivers/staging/ath6kl/wlan/src/wlan_utils.c b/drivers/staging/ath6kl/wlan/src/wlan_utils.c index 1eee7ba..fd05e39 100644 --- a/drivers/staging/ath6kl/wlan/src/wlan_utils.c +++ b/drivers/staging/ath6kl/wlan/src/wlan_utils.c @@ -30,8 +30,7 @@ /* * converts ieee channel number to frequency */ -A_UINT16 -wlan_ieee2freq(int chan) +u16 wlan_ieee2freq(int chan) { if (chan == 14) { return 2484; @@ -48,8 +47,7 @@ wlan_ieee2freq(int chan) /* * Converts MHz frequency to IEEE channel number. */ -A_UINT32 -wlan_freq2ieee(A_UINT16 freq) +u32 wlan_freq2ieee(u16 freq) { if (freq == 2484) return 14; |