diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 18:50:12 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 18:50:12 +0000 |
commit | 8665bd53f2f2e27e5511d90428cb3f60e6d0ce15 (patch) | |
tree | 8d58900dc0ebd4a3011f92c128d2fe45bc7c4bf2 /drivers/staging/rtl8192e/rtllib_softmac.c | |
parent | Adding debian version 6.7.12-1. (diff) | |
download | linux-8665bd53f2f2e27e5511d90428cb3f60e6d0ce15.tar.xz linux-8665bd53f2f2e27e5511d90428cb3f60e6d0ce15.zip |
Merging upstream version 6.8.9.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/staging/rtl8192e/rtllib_softmac.c')
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_softmac.c | 387 |
1 files changed, 60 insertions, 327 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 42d652fe86..b9278b26ac 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -18,7 +18,6 @@ #include <linux/uaccess.h> #include <linux/etherdevice.h> #include <linux/ieee80211.h> -#include "dot11d.h" static void rtllib_sta_wakeup(struct rtllib_device *ieee, short nl); @@ -45,7 +44,7 @@ static unsigned int rtllib_MFIE_rate_len(struct rtllib_device *ieee) * Then it updates the pointer so that * it points after the new MFIE tag added. */ -static void rtllib_MFIE_Brate(struct rtllib_device *ieee, u8 **tag_p) +static void rtllib_mfie_brate(struct rtllib_device *ieee, u8 **tag_p) { u8 *tag = *tag_p; @@ -62,7 +61,7 @@ static void rtllib_MFIE_Brate(struct rtllib_device *ieee, u8 **tag_p) *tag_p = tag; } -static void rtllib_MFIE_Grate(struct rtllib_device *ieee, u8 **tag_p) +static void rtllib_mfie_grate(struct rtllib_device *ieee, u8 **tag_p) { u8 *tag = *tag_p; @@ -83,7 +82,7 @@ static void rtllib_MFIE_Grate(struct rtllib_device *ieee, u8 **tag_p) *tag_p = tag; } -static void rtllib_WMM_Info(struct rtllib_device *ieee, u8 **tag_p) +static void rtllib_wmm_info(struct rtllib_device *ieee, u8 **tag_p) { u8 *tag = *tag_p; @@ -99,7 +98,7 @@ static void rtllib_WMM_Info(struct rtllib_device *ieee, u8 **tag_p) *tag_p = tag; } -static void rtllib_TURBO_Info(struct rtllib_device *ieee, u8 **tag_p) +static void rtllib_turbo_info(struct rtllib_device *ieee, u8 **tag_p) { u8 *tag = *tag_p; @@ -135,32 +134,33 @@ static void enqueue_mgmt(struct rtllib_device *ieee, struct sk_buff *skb) static void init_mgmt_queue(struct rtllib_device *ieee) { - ieee->mgmt_queue_tail = ieee->mgmt_queue_head = 0; + ieee->mgmt_queue_tail = 0; + ieee->mgmt_queue_head = 0; } u8 MgntQuery_TxRateExcludeCCKRates(struct rtllib_device *ieee) { u16 i; - u8 QueryRate = 0; - u8 BasicRate; + u8 query_rate = 0; + u8 basic_rate; for (i = 0; i < ieee->current_network.rates_len; i++) { - BasicRate = ieee->current_network.rates[i] & 0x7F; - if (!rtllib_is_cck_rate(BasicRate)) { - if (QueryRate == 0) { - QueryRate = BasicRate; + basic_rate = ieee->current_network.rates[i] & 0x7F; + if (!rtllib_is_cck_rate(basic_rate)) { + if (query_rate == 0) { + query_rate = basic_rate; } else { - if (BasicRate < QueryRate) - QueryRate = BasicRate; + if (basic_rate < query_rate) + query_rate = basic_rate; } } } - if (QueryRate == 0) { - QueryRate = 12; - netdev_info(ieee->dev, "No BasicRate found!!\n"); + if (query_rate == 0) { + query_rate = 12; + netdev_info(ieee->dev, "No basic_rate found!!\n"); } - return QueryRate; + return query_rate; } static u8 MgntQuery_MgntFrameTxRate(struct rtllib_device *ieee) @@ -173,12 +173,8 @@ static u8 MgntQuery_MgntFrameTxRate(struct rtllib_device *ieee) else rate = ieee->basic_rate & 0x7f; - if (rate == 0) { - if (ieee->mode == WIRELESS_MODE_N_24G && !ht_info->bCurSuppCCK) - rate = 0x0c; - else - rate = 0x02; - } + if (rate == 0) + rate = 0x02; return rate; } @@ -240,7 +236,7 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct rtllib_device *ieee) /* check whether the managed packet queued greater than 5 */ if (!ieee->check_nic_enough_desc(ieee->dev, tcb_desc->queue_index) || - skb_queue_len(&ieee->skb_waitQ[tcb_desc->queue_index]) || + skb_queue_len(&ieee->skb_waitq[tcb_desc->queue_index]) || ieee->queue_stop) { /* insert the skb packet to the management queue * @@ -250,7 +246,7 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct rtllib_device *ieee) netdev_info(ieee->dev, "%s():insert to waitqueue, queue_index:%d!\n", __func__, tcb_desc->queue_index); - skb_queue_tail(&ieee->skb_waitQ[tcb_desc->queue_index], + skb_queue_tail(&ieee->skb_waitq[tcb_desc->queue_index], skb); } else { ieee->softmac_hard_start_xmit(skb, ieee->dev); @@ -345,65 +341,34 @@ static inline struct sk_buff *rtllib_probe_req(struct rtllib_device *ieee) memcpy(tag, ieee->current_network.ssid, len); tag += len; - rtllib_MFIE_Brate(ieee, &tag); - rtllib_MFIE_Grate(ieee, &tag); + rtllib_mfie_brate(ieee, &tag); + rtllib_mfie_grate(ieee, &tag); return skb; } -static struct sk_buff *rtllib_get_beacon_(struct rtllib_device *ieee); - -static void rtllib_send_beacon(struct rtllib_device *ieee) -{ - struct sk_buff *skb; - - if (!ieee->ieee_up) - return; - skb = rtllib_get_beacon_(ieee); - - if (skb) { - softmac_mgmt_xmit(skb, ieee); - ieee->softmac_stats.tx_beacons++; - } - - if (ieee->beacon_txing && ieee->ieee_up) - mod_timer(&ieee->beacon_timer, jiffies + - (msecs_to_jiffies(ieee->current_network.beacon_interval - 5))); -} - -static void rtllib_send_beacon_cb(struct timer_list *t) -{ - struct rtllib_device *ieee = - from_timer(ieee, t, beacon_timer); - unsigned long flags; - - spin_lock_irqsave(&ieee->beacon_lock, flags); - rtllib_send_beacon(ieee); - spin_unlock_irqrestore(&ieee->beacon_lock, flags); -} - /* Enables network monitor mode, all rx packets will be received. */ -void rtllib_EnableNetMonitorMode(struct net_device *dev, - bool bInitState) +void rtllib_enable_net_monitor_mode(struct net_device *dev, + bool init_state) { struct rtllib_device *ieee = netdev_priv_rsl(dev); netdev_info(dev, "========>Enter Monitor Mode\n"); - ieee->AllowAllDestAddrHandler(dev, true, !bInitState); + ieee->AllowAllDestAddrHandler(dev, true, !init_state); } /* Disables network monitor mode. Only packets destinated to * us will be received. */ -void rtllib_DisableNetMonitorMode(struct net_device *dev, - bool bInitState) +void rtllib_disable_net_monitor_mode(struct net_device *dev, + bool init_state) { struct rtllib_device *ieee = netdev_priv_rsl(dev); netdev_info(dev, "========>Exit Monitor Mode\n"); - ieee->AllowAllDestAddrHandler(dev, false, !bInitState); + ieee->AllowAllDestAddrHandler(dev, false, !init_state); } static void rtllib_send_probe(struct rtllib_device *ieee) @@ -425,12 +390,6 @@ static void rtllib_send_probe_requests(struct rtllib_device *ieee) } } -static void rtllib_update_active_chan_map(struct rtllib_device *ieee) -{ - memcpy(ieee->active_channel_map, GET_DOT11D_INFO(ieee)->channel_map, - MAX_CHANNEL_NUMBER + 1); -} - /* this performs syncro scan blocking the caller until all channels * in the allowed channel map has been checked. */ @@ -439,8 +398,6 @@ static void rtllib_softmac_scan_syncro(struct rtllib_device *ieee) union iwreq_data wrqu; short ch = 0; - rtllib_update_active_chan_map(ieee); - ieee->be_scan_inprogress = true; mutex_lock(&ieee->scan_mutex); @@ -492,10 +449,6 @@ out: ieee->actscanning = false; ieee->sync_scan_hurryup = 0; - if (ieee->link_state >= MAC80211_LINKED) { - if (IS_DOT11D_ENABLE(ieee)) - dot11d_scan_complete(ieee); - } mutex_unlock(&ieee->scan_mutex); ieee->be_scan_inprogress = false; @@ -510,8 +463,6 @@ static void rtllib_softmac_scan_wq(void *data) struct rtllib_device, softmac_scan_wq); u8 last_channel = ieee->current_network.channel; - rtllib_update_active_chan_map(ieee); - if (!ieee->ieee_up) return; if (rtllib_act_scanning(ieee, true)) @@ -552,8 +503,6 @@ static void rtllib_softmac_scan_wq(void *data) return; out: - if (IS_DOT11D_ENABLE(ieee)) - dot11d_scan_complete(ieee); ieee->current_network.channel = last_channel; out1: @@ -609,10 +558,6 @@ static void rtllib_start_scan(struct rtllib_device *ieee) { ieee->rtllib_ips_leave_wq(ieee->dev); - if (IS_DOT11D_ENABLE(ieee)) { - if (IS_COUNTRY_IE_VALID(ieee)) - RESET_CIE_WATCHDOG(ieee); - } if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) { if (ieee->scanning_continue == 0) { ieee->actscanning = true; @@ -625,10 +570,6 @@ static void rtllib_start_scan(struct rtllib_device *ieee) /* called with wx_mutex held */ void rtllib_start_scan_syncro(struct rtllib_device *ieee) { - if (IS_DOT11D_ENABLE(ieee)) { - if (IS_COUNTRY_IE_VALID(ieee)) - RESET_CIE_WATCHDOG(ieee); - } ieee->sync_scan_hurryup = 0; if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) rtllib_softmac_scan_syncro(ieee); @@ -677,152 +618,6 @@ rtllib_authentication_req(struct rtllib_network *beacon, return skb; } -static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, - const u8 *dest) -{ - u8 *tag; - int beacon_size; - struct rtllib_probe_response *beacon_buf; - struct sk_buff *skb = NULL; - int encrypt; - int atim_len, erp_len; - struct lib80211_crypt_data *crypt; - - char *ssid = ieee->current_network.ssid; - int ssid_len = ieee->current_network.ssid_len; - int rate_len = ieee->current_network.rates_len + 2; - int rate_ex_len = ieee->current_network.rates_ex_len; - int wpa_ie_len = ieee->wpa_ie_len; - u8 erpinfo_content = 0; - - u8 *tmp_ht_cap_buf = NULL; - u8 tmp_ht_cap_len = 0; - u8 *tmp_ht_info_buf = NULL; - u8 tmp_ht_info_len = 0; - struct rt_hi_throughput *ht_info = ieee->ht_info; - u8 *tmp_generic_ie_buf = NULL; - u8 tmp_generic_ie_len = 0; - - if (rate_ex_len > 0) - rate_ex_len += 2; - - if (ieee->current_network.capability & WLAN_CAPABILITY_IBSS) - atim_len = 4; - else - atim_len = 0; - - if ((ieee->current_network.mode == WIRELESS_MODE_G) || - (ieee->current_network.mode == WIRELESS_MODE_N_24G && - ieee->ht_info->bCurSuppCCK)) { - erp_len = 3; - erpinfo_content = 0; - if (ieee->current_network.buseprotection) - erpinfo_content |= ERP_UseProtection; - } else { - erp_len = 0; - } - - crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; - encrypt = crypt && crypt->ops && - ((strcmp(crypt->ops->name, "R-WEP") == 0 || wpa_ie_len)); - if (ieee->ht_info->current_ht_support) { - tmp_ht_cap_buf = (u8 *)&(ieee->ht_info->SelfHTCap); - tmp_ht_cap_len = sizeof(ieee->ht_info->SelfHTCap); - tmp_ht_info_buf = (u8 *)&(ieee->ht_info->SelfHTInfo); - tmp_ht_info_len = sizeof(ieee->ht_info->SelfHTInfo); - HTConstructCapabilityElement(ieee, tmp_ht_cap_buf, - &tmp_ht_cap_len, encrypt, false); - HTConstructInfoElement(ieee, tmp_ht_info_buf, &tmp_ht_info_len, - encrypt); - - if (ht_info->reg_rt2rt_aggregation) { - tmp_generic_ie_buf = ieee->ht_info->sz_rt2rt_agg_buf; - tmp_generic_ie_len = - sizeof(ieee->ht_info->sz_rt2rt_agg_buf); - HTConstructRT2RTAggElement(ieee, tmp_generic_ie_buf, - &tmp_generic_ie_len); - } - } - - beacon_size = sizeof(struct rtllib_probe_response) + 2 + - ssid_len + 3 + rate_len + rate_ex_len + atim_len + erp_len - + wpa_ie_len + ieee->tx_headroom; - skb = dev_alloc_skb(beacon_size); - if (!skb) - return NULL; - - skb_reserve(skb, ieee->tx_headroom); - - beacon_buf = skb_put(skb, (beacon_size - ieee->tx_headroom)); - ether_addr_copy(beacon_buf->header.addr1, dest); - ether_addr_copy(beacon_buf->header.addr2, ieee->dev->dev_addr); - ether_addr_copy(beacon_buf->header.addr3, ieee->current_network.bssid); - - beacon_buf->header.duration_id = 0; - beacon_buf->beacon_interval = - cpu_to_le16(ieee->current_network.beacon_interval); - beacon_buf->capability = - cpu_to_le16(ieee->current_network.capability & - WLAN_CAPABILITY_IBSS); - beacon_buf->capability |= - cpu_to_le16(ieee->current_network.capability & - WLAN_CAPABILITY_SHORT_PREAMBLE); - - if (ieee->current_network.capability & WLAN_CAPABILITY_SHORT_SLOT_TIME) - beacon_buf->capability |= - cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME); - - crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; - if (encrypt) - beacon_buf->capability |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY); - - beacon_buf->header.frame_control = cpu_to_le16(IEEE80211_STYPE_PROBE_RESP); - beacon_buf->info_element[0].id = MFIE_TYPE_SSID; - beacon_buf->info_element[0].len = ssid_len; - - tag = (u8 *)beacon_buf->info_element[0].data; - - memcpy(tag, ssid, ssid_len); - - tag += ssid_len; - - *(tag++) = MFIE_TYPE_RATES; - *(tag++) = rate_len - 2; - memcpy(tag, ieee->current_network.rates, rate_len - 2); - tag += rate_len - 2; - - *(tag++) = MFIE_TYPE_DS_SET; - *(tag++) = 1; - *(tag++) = ieee->current_network.channel; - - if (atim_len) { - u16 val16; - *(tag++) = MFIE_TYPE_IBSS_SET; - *(tag++) = 2; - val16 = ieee->current_network.atim_window; - memcpy((u8 *)tag, (u8 *)&val16, 2); - tag += 2; - } - - if (erp_len) { - *(tag++) = MFIE_TYPE_ERP; - *(tag++) = 1; - *(tag++) = erpinfo_content; - } - if (rate_ex_len) { - *(tag++) = MFIE_TYPE_RATES_EX; - *(tag++) = rate_ex_len - 2; - memcpy(tag, ieee->current_network.rates_ex, rate_ex_len - 2); - tag += rate_ex_len - 2; - } - - if (wpa_ie_len) { - memcpy(tag, ieee->wpa_ie, ieee->wpa_ie_len); - tag += ieee->wpa_ie_len; - } - return skb; -} - static struct sk_buff *rtllib_null_func(struct rtllib_device *ieee, short pwr) { struct sk_buff *skb; @@ -875,7 +670,7 @@ static inline int SecIsInPMKIDList(struct rtllib_device *ieee, u8 *bssid) int i = 0; do { - if ((ieee->PMKIDList[i].bUsed) && + if ((ieee->PMKIDList[i].used) && (memcmp(ieee->PMKIDList[i].Bssid, bssid, ETH_ALEN) == 0)) break; i++; @@ -933,15 +728,15 @@ rtllib_association_req(struct rtllib_network *beacon, } if (ieee->ht_info->current_ht_support && ieee->ht_info->enable_ht) { - ht_cap_buf = (u8 *)&(ieee->ht_info->SelfHTCap); + ht_cap_buf = (u8 *)&ieee->ht_info->SelfHTCap; ht_cap_len = sizeof(ieee->ht_info->SelfHTCap); - HTConstructCapabilityElement(ieee, ht_cap_buf, &ht_cap_len, + ht_construct_capability_element(ieee, ht_cap_buf, &ht_cap_len, encrypt, true); if (ieee->ht_info->current_rt2rt_aggregation) { realtek_ie_buf = ieee->ht_info->sz_rt2rt_agg_buf; realtek_ie_len = sizeof(ieee->ht_info->sz_rt2rt_agg_buf); - HTConstructRT2RTAggElement(ieee, realtek_ie_buf, + ht_construct_rt2rt_agg_element(ieee, realtek_ie_buf, &realtek_ie_len); } } @@ -1071,7 +866,7 @@ rtllib_association_req(struct rtllib_network *beacon, tag += osCcxVerNum.Length; } if (ieee->ht_info->current_ht_support && ieee->ht_info->enable_ht) { - if (ieee->ht_info->ePeerHTSpecVer != HT_SPEC_VER_EWC) { + if (ieee->ht_info->peer_ht_spec_ver != HT_SPEC_VER_EWC) { tag = skb_put(skb, ht_cap_len); *tag++ = MFIE_TYPE_HT_CAP; *tag++ = ht_cap_len - 2; @@ -1093,7 +888,7 @@ rtllib_association_req(struct rtllib_network *beacon, } if (wmm_info_len) { tag = skb_put(skb, wmm_info_len); - rtllib_WMM_Info(ieee, &tag); + rtllib_wmm_info(ieee, &tag); } if (wps_ie_len && ieee->wps_ie) @@ -1101,11 +896,11 @@ rtllib_association_req(struct rtllib_network *beacon, if (turbo_info_len) { tag = skb_put(skb, turbo_info_len); - rtllib_TURBO_Info(ieee, &tag); + rtllib_turbo_info(ieee, &tag); } if (ieee->ht_info->current_ht_support && ieee->ht_info->enable_ht) { - if (ieee->ht_info->ePeerHTSpecVer == HT_SPEC_VER_EWC) { + if (ieee->ht_info->peer_ht_spec_ver == HT_SPEC_VER_EWC) { tag = skb_put(skb, ht_cap_len); *tag++ = MFIE_TYPE_GENERIC; *tag++ = ht_cap_len - 2; @@ -1123,7 +918,7 @@ rtllib_association_req(struct rtllib_network *beacon, kfree(ieee->assocreq_ies); ieee->assocreq_ies = NULL; - ies = &(hdr->info_element[0].id); + ies = &hdr->info_element[0].id; ieee->assocreq_ies_len = (skb->data + skb->len) - ies; ieee->assocreq_ies = kmemdup(ies, ieee->assocreq_ies_len, GFP_ATOMIC); if (!ieee->assocreq_ies) @@ -1269,7 +1064,7 @@ static void rtllib_associate_complete_wq(void *data) } if (ieee->ht_info->current_ht_support && ieee->ht_info->enable_ht) { netdev_info(ieee->dev, "Successfully associated, ht enabled\n"); - HTOnAssocRsp(ieee); + ht_on_assoc_rsp(ieee); } else { netdev_info(ieee->dev, "Successfully associated, ht not enabled(%d, %d)\n", @@ -1314,7 +1109,7 @@ static void rtllib_associate_procedure_wq(void *data) mutex_lock(&ieee->wx_mutex); rtllib_stop_scan(ieee); - HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); + ht_set_connect_bw_mode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); if (ieee->rf_power_state == rf_off) { ieee->rtllib_ips_leave_wq(ieee->dev); mutex_unlock(&ieee->wx_mutex); @@ -1417,21 +1212,20 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, !(ieee->softmac_features & IEEE_SOFTMAC_SCAN)) rtllib_stop_scan_syncro(ieee); - HTResetIOTSetting(ieee->ht_info); + ht_reset_iot_setting(ieee->ht_info); ieee->wmm_acm = 0; if (ieee->iw_mode == IW_MODE_INFRA) { /* Join the network for the first time */ ieee->AsocRetryCount = 0; if ((ieee->current_network.qos_data.supported == 1) && ieee->current_network.bssht.bd_support_ht) - HTResetSelfAndSavePeerSetting(ieee, + ht_reset_self_and_save_peer_setting(ieee, &(ieee->current_network)); else ieee->ht_info->current_ht_support = false; ieee->link_state = RTLLIB_ASSOCIATING; - schedule_delayed_work( - &ieee->associate_procedure_wq, 0); + schedule_delayed_work(&ieee->associate_procedure_wq, 0); } else { if (rtllib_is_54g(&ieee->current_network)) { ieee->rate = 108; @@ -1825,7 +1619,7 @@ rtllib_rx_assoc_resp(struct rtllib_device *ieee, struct sk_buff *skb, kfree(ieee->assocresp_ies); ieee->assocresp_ies = NULL; - ies = &(assoc_resp->info_element[0].id); + ies = &assoc_resp->info_element[0].id; ieee->assocresp_ies_len = (skb->data + skb->len) - ies; ieee->assocresp_ies = kmemdup(ies, ieee->assocresp_ies_len, @@ -1841,8 +1635,7 @@ rtllib_rx_assoc_resp(struct rtllib_device *ieee, struct sk_buff *skb, "Association response status code 0x%x\n", errcode); if (ieee->AsocRetryCount < RT_ASOC_RETRY_LIMIT) - schedule_delayed_work( - &ieee->associate_procedure_wq, 0); + schedule_delayed_work(&ieee->associate_procedure_wq, 0); else rtllib_associate_abort(ieee); } @@ -1872,7 +1665,7 @@ static void rtllib_rx_auth_resp(struct rtllib_device *ieee, struct sk_buff *skb) ieee->softmac_stats.rx_auth_rs_ok++; if (!(ieee->ht_info->iot_action & HT_IOT_ACT_PURE_N_MODE)) { if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) { - if (IsHTHalfNmodeAPs(ieee)) { + if (is_ht_half_nmode_aps(ieee)) { bSupportNmode = true; bHalfSupportNmode = true; } else { @@ -2030,7 +1823,7 @@ void rtllib_softmac_xmit(struct rtllib_txb *txb, struct rtllib_device *ieee) * the wait queue */ for (i = 0; i < txb->nr_frags; i++) { - queue_len = skb_queue_len(&ieee->skb_waitQ[queue_index]); + queue_len = skb_queue_len(&ieee->skb_waitq[queue_index]); if ((queue_len != 0) || (!ieee->check_nic_enough_desc(ieee->dev, queue_index)) || (ieee->queue_stop)) { @@ -2039,13 +1832,12 @@ void rtllib_softmac_xmit(struct rtllib_txb *txb, struct rtllib_device *ieee) * to check it any more. */ if (queue_len < 200) - skb_queue_tail(&ieee->skb_waitQ[queue_index], + skb_queue_tail(&ieee->skb_waitq[queue_index], txb->fragments[i]); else kfree_skb(txb->fragments[i]); } else { - ieee->softmac_data_hard_start_xmit( - txb->fragments[i], + ieee->softmac_data_hard_start_xmit(txb->fragments[i], ieee->dev, ieee->rate); } } @@ -2090,10 +1882,6 @@ static void rtllib_start_bss(struct rtllib_device *ieee) { unsigned long flags; - if (IS_DOT11D_ENABLE(ieee) && !IS_COUNTRY_IE_VALID(ieee)) { - if (!ieee->global_domain) - return; - } /* check if we have already found the net we * are interested in (if any). * if not (we are disassociated and we are not @@ -2121,6 +1909,7 @@ static void rtllib_link_change_wq(void *data) struct rtllib_device, link_change_wq); ieee->link_change(ieee->dev); } + /* called only in userspace context */ void rtllib_disassociate(struct rtllib_device *ieee) { @@ -2128,8 +1917,6 @@ void rtllib_disassociate(struct rtllib_device *ieee) if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE) rtllib_reset_queue(ieee); - if (IS_DOT11D_ENABLE(ieee)) - dot11d_reset(ieee); ieee->link_state = MAC80211_NOLINK; ieee->is_set_key = false; ieee->wap_set = 0; @@ -2181,46 +1968,6 @@ exit: mutex_unlock(&ieee->wx_mutex); } -static struct sk_buff *rtllib_get_beacon_(struct rtllib_device *ieee) -{ - static const u8 broadcast_addr[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff - }; - struct sk_buff *skb; - struct rtllib_probe_response *b; - - skb = rtllib_probe_resp(ieee, broadcast_addr); - - if (!skb) - return NULL; - - b = (struct rtllib_probe_response *)skb->data; - b->header.frame_control = cpu_to_le16(IEEE80211_STYPE_BEACON); - - return skb; -} - -struct sk_buff *rtllib_get_beacon(struct rtllib_device *ieee) -{ - struct sk_buff *skb; - struct rtllib_probe_response *b; - - skb = rtllib_get_beacon_(ieee); - if (!skb) - return NULL; - - b = (struct rtllib_probe_response *)skb->data; - b->header.seq_ctrl = cpu_to_le16(ieee->seq_ctrl[0] << 4); - - if (ieee->seq_ctrl[0] == 0xFFF) - ieee->seq_ctrl[0] = 0; - else - ieee->seq_ctrl[0]++; - - return skb; -} -EXPORT_SYMBOL(rtllib_get_beacon); - void rtllib_softmac_stop_protocol(struct rtllib_device *ieee) { rtllib_stop_scan_syncro(ieee); @@ -2279,8 +2026,6 @@ void rtllib_start_protocol(struct rtllib_device *ieee) short ch = 0; int i = 0; - rtllib_update_active_chan_map(ieee); - if (ieee->proto_started) return; @@ -2326,18 +2071,15 @@ int rtllib_softmac_init(struct rtllib_device *ieee) ieee->link_state = MAC80211_NOLINK; for (i = 0; i < 5; i++) ieee->seq_ctrl[i] = 0; - ieee->dot11d_info = kzalloc(sizeof(struct rt_dot11d_info), GFP_ATOMIC); - if (!ieee->dot11d_info) - return -ENOMEM; ieee->link_detect_info.SlotIndex = 0; ieee->link_detect_info.SlotNum = 2; ieee->link_detect_info.NumRecvBcnInPeriod = 0; ieee->link_detect_info.NumRecvDataInPeriod = 0; - ieee->link_detect_info.NumTxOkInPeriod = 0; - ieee->link_detect_info.NumRxOkInPeriod = 0; + ieee->link_detect_info.num_tx_ok_in_period = 0; + ieee->link_detect_info.num_rx_ok_in_period = 0; ieee->link_detect_info.NumRxUnicastOkInPeriod = 0; - ieee->bIsAggregateFrame = false; + ieee->is_aggregate_frame = false; ieee->assoc_id = 0; ieee->queue_stop = 0; ieee->scanning_continue = 0; @@ -2369,8 +2111,6 @@ int rtllib_softmac_init(struct rtllib_device *ieee) timer_setup(&ieee->associate_timer, rtllib_associate_abort_cb, 0); - timer_setup(&ieee->beacon_timer, rtllib_send_beacon_cb, 0); - INIT_DELAYED_WORK(&ieee->link_change_wq, (void *)rtllib_link_change_wq); INIT_WORK(&ieee->associate_complete_wq, (void *)rtllib_associate_complete_wq); INIT_DELAYED_WORK(&ieee->associate_procedure_wq, (void *)rtllib_associate_procedure_wq); @@ -2404,9 +2144,6 @@ void rtllib_softmac_free(struct rtllib_device *ieee) cancel_work_sync(&ieee->ips_leave_wq); cancel_work_sync(&ieee->wx_sync_scan_wq); cancel_work_sync(&ieee->ps_task); - - kfree(ieee->dot11d_info); - ieee->dot11d_info = NULL; } static inline struct sk_buff * @@ -2493,7 +2230,7 @@ u8 rtllib_ap_sec_type(struct rtllib_device *ieee) return SEC_ALG_WEP; } else if ((wpa_ie_len != 0)) { if (((ieee->wpa_ie[0] == 0xdd) && - (!memcmp(&(ieee->wpa_ie[14]), ccmp_ie, 4))) || + (!memcmp(&ieee->wpa_ie[14], ccmp_ie, 4))) || ((ieee->wpa_ie[0] == 0x30) && (!memcmp(&ieee->wpa_ie[10], ccmp_rsn_ie, 4)))) return SEC_ALG_CCMP; @@ -2508,7 +2245,7 @@ static void rtllib_MlmeDisassociateRequest(struct rtllib_device *rtllib, u8 *asSta, u8 asRsn) { u8 i; - u8 OpMode; + u8 op_mode; RemovePeerTS(rtllib, asSta); @@ -2517,10 +2254,10 @@ static void rtllib_MlmeDisassociateRequest(struct rtllib_device *rtllib, for (i = 0; i < 6; i++) rtllib->current_network.bssid[i] = 0x22; - OpMode = RT_OP_MODE_NO_LINK; - rtllib->OpMode = RT_OP_MODE_NO_LINK; + op_mode = RT_OP_MODE_NO_LINK; + rtllib->op_mode = RT_OP_MODE_NO_LINK; rtllib->SetHwRegHandler(rtllib->dev, HW_VAR_MEDIA_STATUS, - (u8 *)(&OpMode)); + (u8 *)(&op_mode)); rtllib_disassociate(rtllib); rtllib->SetHwRegHandler(rtllib->dev, HW_VAR_BSSID, @@ -2528,11 +2265,7 @@ static void rtllib_MlmeDisassociateRequest(struct rtllib_device *rtllib, } } -static void -rtllib_MgntDisconnectAP( - struct rtllib_device *rtllib, - u8 asRsn -) +static void rtllib_MgntDisconnectAP(struct rtllib_device *rtllib, u8 asRsn) { bool bFilterOutNonAssociatedBSSID = false; |