aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c139
1 files changed, 65 insertions, 74 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 7cfd12e0d1e2..3f7f92a2f227 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -87,6 +87,7 @@ static int ieee80211_sta_start_scan(struct net_device *dev,
87 u8 *ssid, size_t ssid_len); 87 u8 *ssid, size_t ssid_len);
88static int ieee80211_sta_config_auth(struct net_device *dev, 88static int ieee80211_sta_config_auth(struct net_device *dev,
89 struct ieee80211_if_sta *ifsta); 89 struct ieee80211_if_sta *ifsta);
90static void sta_rx_agg_session_timer_expired(unsigned long data);
90 91
91 92
92void ieee802_11_parse_elems(u8 *start, size_t len, 93void ieee802_11_parse_elems(u8 *start, size_t len,
@@ -256,19 +257,8 @@ static void ieee80211_sta_def_wmm_params(struct net_device *dev,
256 qparam.cw_max = 1023; 257 qparam.cw_max = 1023;
257 qparam.txop = 0; 258 qparam.txop = 0;
258 259
259 for (i = IEEE80211_TX_QUEUE_DATA0; i < NUM_TX_DATA_QUEUES; i++) 260 for (i = 0; i < local_to_hw(local)->queues; i++)
260 local->ops->conf_tx(local_to_hw(local), 261 local->ops->conf_tx(local_to_hw(local), i, &qparam);
261 i + IEEE80211_TX_QUEUE_DATA0,
262 &qparam);
263
264 if (ibss) {
265 /* IBSS uses different parameters for Beacon sending */
266 qparam.cw_min++;
267 qparam.cw_min *= 2;
268 qparam.cw_min--;
269 local->ops->conf_tx(local_to_hw(local),
270 IEEE80211_TX_QUEUE_BEACON, &qparam);
271 }
272 } 262 }
273} 263}
274 264
@@ -282,6 +272,12 @@ static void ieee80211_sta_wmm_params(struct net_device *dev,
282 int count; 272 int count;
283 u8 *pos; 273 u8 *pos;
284 274
275 if (!(ifsta->flags & IEEE80211_STA_WMM_ENABLED))
276 return;
277
278 if (!wmm_param)
279 return;
280
285 if (wmm_param_len < 8 || wmm_param[5] /* version */ != 1) 281 if (wmm_param_len < 8 || wmm_param[5] /* version */ != 1)
286 return; 282 return;
287 count = wmm_param[6] & 0x0f; 283 count = wmm_param[6] & 0x0f;
@@ -305,29 +301,25 @@ static void ieee80211_sta_wmm_params(struct net_device *dev,
305 301
306 switch (aci) { 302 switch (aci) {
307 case 1: 303 case 1:
308 queue = IEEE80211_TX_QUEUE_DATA3; 304 queue = 3;
309 if (acm) { 305 if (acm)
310 local->wmm_acm |= BIT(0) | BIT(3); 306 local->wmm_acm |= BIT(0) | BIT(3);
311 }
312 break; 307 break;
313 case 2: 308 case 2:
314 queue = IEEE80211_TX_QUEUE_DATA1; 309 queue = 1;
315 if (acm) { 310 if (acm)
316 local->wmm_acm |= BIT(4) | BIT(5); 311 local->wmm_acm |= BIT(4) | BIT(5);
317 }
318 break; 312 break;
319 case 3: 313 case 3:
320 queue = IEEE80211_TX_QUEUE_DATA0; 314 queue = 0;
321 if (acm) { 315 if (acm)
322 local->wmm_acm |= BIT(6) | BIT(7); 316 local->wmm_acm |= BIT(6) | BIT(7);
323 }
324 break; 317 break;
325 case 0: 318 case 0:
326 default: 319 default:
327 queue = IEEE80211_TX_QUEUE_DATA2; 320 queue = 2;
328 if (acm) { 321 if (acm)
329 local->wmm_acm |= BIT(1) | BIT(2); 322 local->wmm_acm |= BIT(1) | BIT(2);
330 }
331 break; 323 break;
332 } 324 }
333 325
@@ -727,9 +719,8 @@ static void ieee80211_send_assoc(struct net_device *dev,
727 if (bss) { 719 if (bss) {
728 if (bss->capability & WLAN_CAPABILITY_PRIVACY) 720 if (bss->capability & WLAN_CAPABILITY_PRIVACY)
729 capab |= WLAN_CAPABILITY_PRIVACY; 721 capab |= WLAN_CAPABILITY_PRIVACY;
730 if (bss->wmm_ie) { 722 if (bss->wmm_ie)
731 wmm = 1; 723 wmm = 1;
732 }
733 724
734 /* get all rates supported by the device and the AP as 725 /* get all rates supported by the device and the AP as
735 * some APs don't like getting a superset of their rates 726 * some APs don't like getting a superset of their rates
@@ -821,8 +812,10 @@ static void ieee80211_send_assoc(struct net_device *dev,
821 *pos++ = 1; /* WME ver */ 812 *pos++ = 1; /* WME ver */
822 *pos++ = 0; 813 *pos++ = 0;
823 } 814 }
815
824 /* wmm support is a must to HT */ 816 /* wmm support is a must to HT */
825 if (wmm && sband->ht_info.ht_supported) { 817 if (wmm && (ifsta->flags & IEEE80211_STA_WMM_ENABLED) &&
818 sband->ht_info.ht_supported) {
826 __le16 tmp = cpu_to_le16(sband->ht_info.cap); 819 __le16 tmp = cpu_to_le16(sband->ht_info.cap);
827 pos = skb_put(skb, sizeof(struct ieee80211_ht_cap)+2); 820 pos = skb_put(skb, sizeof(struct ieee80211_ht_cap)+2);
828 *pos++ = WLAN_EID_HT_CAPABILITY; 821 *pos++ = WLAN_EID_HT_CAPABILITY;
@@ -1141,8 +1134,8 @@ static void ieee80211_send_addba_resp(struct net_device *dev, u8 *da, u16 tid,
1141 struct ieee80211_mgmt *mgmt; 1134 struct ieee80211_mgmt *mgmt;
1142 u16 capab; 1135 u16 capab;
1143 1136
1144 skb = dev_alloc_skb(sizeof(*mgmt) + local->hw.extra_tx_headroom + 1 + 1137 skb = dev_alloc_skb(sizeof(*mgmt) + local->hw.extra_tx_headroom);
1145 sizeof(mgmt->u.action.u.addba_resp)); 1138
1146 if (!skb) { 1139 if (!skb) {
1147 printk(KERN_DEBUG "%s: failed to allocate buffer " 1140 printk(KERN_DEBUG "%s: failed to allocate buffer "
1148 "for addba resp frame\n", dev->name); 1141 "for addba resp frame\n", dev->name);
@@ -1190,9 +1183,7 @@ void ieee80211_send_addba_request(struct net_device *dev, const u8 *da,
1190 struct ieee80211_mgmt *mgmt; 1183 struct ieee80211_mgmt *mgmt;
1191 u16 capab; 1184 u16 capab;
1192 1185
1193 skb = dev_alloc_skb(sizeof(*mgmt) + local->hw.extra_tx_headroom + 1 + 1186 skb = dev_alloc_skb(sizeof(*mgmt) + local->hw.extra_tx_headroom);
1194 sizeof(mgmt->u.action.u.addba_req));
1195
1196 1187
1197 if (!skb) { 1188 if (!skb) {
1198 printk(KERN_ERR "%s: failed to allocate buffer " 1189 printk(KERN_ERR "%s: failed to allocate buffer "
@@ -1293,7 +1284,7 @@ static void ieee80211_sta_process_addba_request(struct net_device *dev,
1293 1284
1294 1285
1295 /* examine state machine */ 1286 /* examine state machine */
1296 spin_lock_bh(&sta->ampdu_mlme.ampdu_rx); 1287 spin_lock_bh(&sta->lock);
1297 1288
1298 if (sta->ampdu_mlme.tid_state_rx[tid] != HT_AGG_STATE_IDLE) { 1289 if (sta->ampdu_mlme.tid_state_rx[tid] != HT_AGG_STATE_IDLE) {
1299#ifdef CONFIG_MAC80211_HT_DEBUG 1290#ifdef CONFIG_MAC80211_HT_DEBUG
@@ -1360,7 +1351,7 @@ static void ieee80211_sta_process_addba_request(struct net_device *dev,
1360 tid_agg_rx->stored_mpdu_num = 0; 1351 tid_agg_rx->stored_mpdu_num = 0;
1361 status = WLAN_STATUS_SUCCESS; 1352 status = WLAN_STATUS_SUCCESS;
1362end: 1353end:
1363 spin_unlock_bh(&sta->ampdu_mlme.ampdu_rx); 1354 spin_unlock_bh(&sta->lock);
1364 1355
1365end_no_lock: 1356end_no_lock:
1366 ieee80211_send_addba_resp(sta->sdata->dev, sta->addr, tid, 1357 ieee80211_send_addba_resp(sta->sdata->dev, sta->addr, tid,
@@ -1392,10 +1383,10 @@ static void ieee80211_sta_process_addba_resp(struct net_device *dev,
1392 1383
1393 state = &sta->ampdu_mlme.tid_state_tx[tid]; 1384 state = &sta->ampdu_mlme.tid_state_tx[tid];
1394 1385
1395 spin_lock_bh(&sta->ampdu_mlme.ampdu_tx); 1386 spin_lock_bh(&sta->lock);
1396 1387
1397 if (!(*state & HT_ADDBA_REQUESTED_MSK)) { 1388 if (!(*state & HT_ADDBA_REQUESTED_MSK)) {
1398 spin_unlock_bh(&sta->ampdu_mlme.ampdu_tx); 1389 spin_unlock_bh(&sta->lock);
1399 printk(KERN_DEBUG "state not HT_ADDBA_REQUESTED_MSK:" 1390 printk(KERN_DEBUG "state not HT_ADDBA_REQUESTED_MSK:"
1400 "%d\n", *state); 1391 "%d\n", *state);
1401 goto addba_resp_exit; 1392 goto addba_resp_exit;
@@ -1403,7 +1394,7 @@ static void ieee80211_sta_process_addba_resp(struct net_device *dev,
1403 1394
1404 if (mgmt->u.action.u.addba_resp.dialog_token != 1395 if (mgmt->u.action.u.addba_resp.dialog_token !=
1405 sta->ampdu_mlme.tid_tx[tid]->dialog_token) { 1396 sta->ampdu_mlme.tid_tx[tid]->dialog_token) {
1406 spin_unlock_bh(&sta->ampdu_mlme.ampdu_tx); 1397 spin_unlock_bh(&sta->lock);
1407#ifdef CONFIG_MAC80211_HT_DEBUG 1398#ifdef CONFIG_MAC80211_HT_DEBUG
1408 printk(KERN_DEBUG "wrong addBA response token, tid %d\n", tid); 1399 printk(KERN_DEBUG "wrong addBA response token, tid %d\n", tid);
1409#endif /* CONFIG_MAC80211_HT_DEBUG */ 1400#endif /* CONFIG_MAC80211_HT_DEBUG */
@@ -1427,7 +1418,7 @@ static void ieee80211_sta_process_addba_resp(struct net_device *dev,
1427 ieee80211_wake_queue(hw, sta->tid_to_tx_q[tid]); 1418 ieee80211_wake_queue(hw, sta->tid_to_tx_q[tid]);
1428 } 1419 }
1429 1420
1430 spin_unlock_bh(&sta->ampdu_mlme.ampdu_tx); 1421 spin_unlock_bh(&sta->lock);
1431 printk(KERN_DEBUG "recipient accepted agg: tid %d \n", tid); 1422 printk(KERN_DEBUG "recipient accepted agg: tid %d \n", tid);
1432 } else { 1423 } else {
1433 printk(KERN_DEBUG "recipient rejected agg: tid %d \n", tid); 1424 printk(KERN_DEBUG "recipient rejected agg: tid %d \n", tid);
@@ -1435,7 +1426,7 @@ static void ieee80211_sta_process_addba_resp(struct net_device *dev,
1435 sta->ampdu_mlme.addba_req_num[tid]++; 1426 sta->ampdu_mlme.addba_req_num[tid]++;
1436 /* this will allow the state check in stop_BA_session */ 1427 /* this will allow the state check in stop_BA_session */
1437 *state = HT_AGG_STATE_OPERATIONAL; 1428 *state = HT_AGG_STATE_OPERATIONAL;
1438 spin_unlock_bh(&sta->ampdu_mlme.ampdu_tx); 1429 spin_unlock_bh(&sta->lock);
1439 ieee80211_stop_tx_ba_session(hw, sta->addr, tid, 1430 ieee80211_stop_tx_ba_session(hw, sta->addr, tid,
1440 WLAN_BACK_INITIATOR); 1431 WLAN_BACK_INITIATOR);
1441 } 1432 }
@@ -1454,8 +1445,7 @@ void ieee80211_send_delba(struct net_device *dev, const u8 *da, u16 tid,
1454 struct ieee80211_mgmt *mgmt; 1445 struct ieee80211_mgmt *mgmt;
1455 u16 params; 1446 u16 params;
1456 1447
1457 skb = dev_alloc_skb(sizeof(*mgmt) + local->hw.extra_tx_headroom + 1 + 1448 skb = dev_alloc_skb(sizeof(*mgmt) + local->hw.extra_tx_headroom);
1458 sizeof(mgmt->u.action.u.delba));
1459 1449
1460 if (!skb) { 1450 if (!skb) {
1461 printk(KERN_ERR "%s: failed to allocate buffer " 1451 printk(KERN_ERR "%s: failed to allocate buffer "
@@ -1506,17 +1496,17 @@ void ieee80211_sta_stop_rx_ba_session(struct net_device *dev, u8 *ra, u16 tid,
1506 } 1496 }
1507 1497
1508 /* check if TID is in operational state */ 1498 /* check if TID is in operational state */
1509 spin_lock_bh(&sta->ampdu_mlme.ampdu_rx); 1499 spin_lock_bh(&sta->lock);
1510 if (sta->ampdu_mlme.tid_state_rx[tid] 1500 if (sta->ampdu_mlme.tid_state_rx[tid]
1511 != HT_AGG_STATE_OPERATIONAL) { 1501 != HT_AGG_STATE_OPERATIONAL) {
1512 spin_unlock_bh(&sta->ampdu_mlme.ampdu_rx); 1502 spin_unlock_bh(&sta->lock);
1513 rcu_read_unlock(); 1503 rcu_read_unlock();
1514 return; 1504 return;
1515 } 1505 }
1516 sta->ampdu_mlme.tid_state_rx[tid] = 1506 sta->ampdu_mlme.tid_state_rx[tid] =
1517 HT_AGG_STATE_REQ_STOP_BA_MSK | 1507 HT_AGG_STATE_REQ_STOP_BA_MSK |
1518 (initiator << HT_AGG_STATE_INITIATOR_SHIFT); 1508 (initiator << HT_AGG_STATE_INITIATOR_SHIFT);
1519 spin_unlock_bh(&sta->ampdu_mlme.ampdu_rx); 1509 spin_unlock_bh(&sta->lock);
1520 1510
1521 /* stop HW Rx aggregation. ampdu_action existence 1511 /* stop HW Rx aggregation. ampdu_action existence
1522 * already verified in session init so we add the BUG_ON */ 1512 * already verified in session init so we add the BUG_ON */
@@ -1593,10 +1583,10 @@ static void ieee80211_sta_process_delba(struct net_device *dev,
1593 ieee80211_sta_stop_rx_ba_session(dev, sta->addr, tid, 1583 ieee80211_sta_stop_rx_ba_session(dev, sta->addr, tid,
1594 WLAN_BACK_INITIATOR, 0); 1584 WLAN_BACK_INITIATOR, 0);
1595 else { /* WLAN_BACK_RECIPIENT */ 1585 else { /* WLAN_BACK_RECIPIENT */
1596 spin_lock_bh(&sta->ampdu_mlme.ampdu_tx); 1586 spin_lock_bh(&sta->lock);
1597 sta->ampdu_mlme.tid_state_tx[tid] = 1587 sta->ampdu_mlme.tid_state_tx[tid] =
1598 HT_AGG_STATE_OPERATIONAL; 1588 HT_AGG_STATE_OPERATIONAL;
1599 spin_unlock_bh(&sta->ampdu_mlme.ampdu_tx); 1589 spin_unlock_bh(&sta->lock);
1600 ieee80211_stop_tx_ba_session(&local->hw, sta->addr, tid, 1590 ieee80211_stop_tx_ba_session(&local->hw, sta->addr, tid,
1601 WLAN_BACK_RECIPIENT); 1591 WLAN_BACK_RECIPIENT);
1602 } 1592 }
@@ -1633,9 +1623,9 @@ void sta_addba_resp_timer_expired(unsigned long data)
1633 1623
1634 state = &sta->ampdu_mlme.tid_state_tx[tid]; 1624 state = &sta->ampdu_mlme.tid_state_tx[tid];
1635 /* check if the TID waits for addBA response */ 1625 /* check if the TID waits for addBA response */
1636 spin_lock_bh(&sta->ampdu_mlme.ampdu_tx); 1626 spin_lock_bh(&sta->lock);
1637 if (!(*state & HT_ADDBA_REQUESTED_MSK)) { 1627 if (!(*state & HT_ADDBA_REQUESTED_MSK)) {
1638 spin_unlock_bh(&sta->ampdu_mlme.ampdu_tx); 1628 spin_unlock_bh(&sta->lock);
1639 *state = HT_AGG_STATE_IDLE; 1629 *state = HT_AGG_STATE_IDLE;
1640 printk(KERN_DEBUG "timer expired on tid %d but we are not " 1630 printk(KERN_DEBUG "timer expired on tid %d but we are not "
1641 "expecting addBA response there", tid); 1631 "expecting addBA response there", tid);
@@ -1646,7 +1636,7 @@ void sta_addba_resp_timer_expired(unsigned long data)
1646 1636
1647 /* go through the state check in stop_BA_session */ 1637 /* go through the state check in stop_BA_session */
1648 *state = HT_AGG_STATE_OPERATIONAL; 1638 *state = HT_AGG_STATE_OPERATIONAL;
1649 spin_unlock_bh(&sta->ampdu_mlme.ampdu_tx); 1639 spin_unlock_bh(&sta->lock);
1650 ieee80211_stop_tx_ba_session(hw, temp_sta->addr, tid, 1640 ieee80211_stop_tx_ba_session(hw, temp_sta->addr, tid,
1651 WLAN_BACK_INITIATOR); 1641 WLAN_BACK_INITIATOR);
1652 1642
@@ -1659,7 +1649,7 @@ timer_expired_exit:
1659 * resetting it after each frame that arrives from the originator. 1649 * resetting it after each frame that arrives from the originator.
1660 * if this timer expires ieee80211_sta_stop_rx_ba_session will be executed. 1650 * if this timer expires ieee80211_sta_stop_rx_ba_session will be executed.
1661 */ 1651 */
1662void sta_rx_agg_session_timer_expired(unsigned long data) 1652static void sta_rx_agg_session_timer_expired(unsigned long data)
1663{ 1653{
1664 /* not an elegant detour, but there is no choice as the timer passes 1654 /* not an elegant detour, but there is no choice as the timer passes
1665 * only one argument, and verious sta_info are needed here, so init 1655 * only one argument, and verious sta_info are needed here, so init
@@ -1848,9 +1838,8 @@ static void ieee80211_rx_mgmt_deauth(struct net_device *dev,
1848 " (reason=%d)\n", 1838 " (reason=%d)\n",
1849 dev->name, print_mac(mac, mgmt->sa), reason_code); 1839 dev->name, print_mac(mac, mgmt->sa), reason_code);
1850 1840
1851 if (ifsta->flags & IEEE80211_STA_AUTHENTICATED) { 1841 if (ifsta->flags & IEEE80211_STA_AUTHENTICATED)
1852 printk(KERN_DEBUG "%s: deauthenticated\n", dev->name); 1842 printk(KERN_DEBUG "%s: deauthenticated\n", dev->name);
1853 }
1854 1843
1855 if (ifsta->state == IEEE80211_AUTHENTICATE || 1844 if (ifsta->state == IEEE80211_AUTHENTICATE ||
1856 ifsta->state == IEEE80211_ASSOCIATE || 1845 ifsta->state == IEEE80211_ASSOCIATE ||
@@ -2013,8 +2002,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
2013 local->hw.conf.channel->center_freq, 2002 local->hw.conf.channel->center_freq,
2014 ifsta->ssid, ifsta->ssid_len); 2003 ifsta->ssid, ifsta->ssid_len);
2015 if (bss) { 2004 if (bss) {
2016 sta->last_rssi = bss->rssi;
2017 sta->last_signal = bss->signal; 2005 sta->last_signal = bss->signal;
2006 sta->last_qual = bss->qual;
2018 sta->last_noise = bss->noise; 2007 sta->last_noise = bss->noise;
2019 ieee80211_rx_bss_put(dev, bss); 2008 ieee80211_rx_bss_put(dev, bss);
2020 } 2009 }
@@ -2038,8 +2027,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
2038 * to between the sta_info_alloc() and sta_info_insert() above. 2027 * to between the sta_info_alloc() and sta_info_insert() above.
2039 */ 2028 */
2040 2029
2041 sta->flags |= WLAN_STA_AUTH | WLAN_STA_ASSOC | WLAN_STA_ASSOC_AP | 2030 set_sta_flags(sta, WLAN_STA_AUTH | WLAN_STA_ASSOC | WLAN_STA_ASSOC_AP |
2042 WLAN_STA_AUTHORIZED; 2031 WLAN_STA_AUTHORIZED);
2043 2032
2044 rates = 0; 2033 rates = 0;
2045 basic_rates = 0; 2034 basic_rates = 0;
@@ -2083,7 +2072,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
2083 else 2072 else
2084 sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE; 2073 sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE;
2085 2074
2086 if (elems.ht_cap_elem && elems.ht_info_elem && elems.wmm_param) { 2075 if (elems.ht_cap_elem && elems.ht_info_elem && elems.wmm_param &&
2076 (ifsta->flags & IEEE80211_STA_WMM_ENABLED)) {
2087 struct ieee80211_ht_bss_info bss_info; 2077 struct ieee80211_ht_bss_info bss_info;
2088 ieee80211_ht_cap_ie_to_ht_info( 2078 ieee80211_ht_cap_ie_to_ht_info(
2089 (struct ieee80211_ht_cap *) 2079 (struct ieee80211_ht_cap *)
@@ -2096,8 +2086,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
2096 2086
2097 rate_control_rate_init(sta, local); 2087 rate_control_rate_init(sta, local);
2098 2088
2099 if (elems.wmm_param && (ifsta->flags & IEEE80211_STA_WMM_ENABLED)) { 2089 if (elems.wmm_param) {
2100 sta->flags |= WLAN_STA_WME; 2090 set_sta_flags(sta, WLAN_STA_WME);
2101 rcu_read_unlock(); 2091 rcu_read_unlock();
2102 ieee80211_sta_wmm_params(dev, ifsta, elems.wmm_param, 2092 ieee80211_sta_wmm_params(dev, ifsta, elems.wmm_param,
2103 elems.wmm_param_len); 2093 elems.wmm_param_len);
@@ -2682,9 +2672,9 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
2682 2672
2683 bss->timestamp = beacon_timestamp; 2673 bss->timestamp = beacon_timestamp;
2684 bss->last_update = jiffies; 2674 bss->last_update = jiffies;
2685 bss->rssi = rx_status->ssi;
2686 bss->signal = rx_status->signal; 2675 bss->signal = rx_status->signal;
2687 bss->noise = rx_status->noise; 2676 bss->noise = rx_status->noise;
2677 bss->qual = rx_status->qual;
2688 if (!beacon && !bss->probe_resp) 2678 if (!beacon && !bss->probe_resp)
2689 bss->probe_resp = true; 2679 bss->probe_resp = true;
2690 2680
@@ -2879,10 +2869,8 @@ static void ieee80211_rx_mgmt_beacon(struct net_device *dev,
2879 2869
2880 ieee802_11_parse_elems(mgmt->u.beacon.variable, len - baselen, &elems); 2870 ieee802_11_parse_elems(mgmt->u.beacon.variable, len - baselen, &elems);
2881 2871
2882 if (elems.wmm_param && (ifsta->flags & IEEE80211_STA_WMM_ENABLED)) { 2872 ieee80211_sta_wmm_params(dev, ifsta, elems.wmm_param,
2883 ieee80211_sta_wmm_params(dev, ifsta, elems.wmm_param, 2873 elems.wmm_param_len);
2884 elems.wmm_param_len);
2885 }
2886 2874
2887 /* Do not send changes to driver if we are scanning. This removes 2875 /* Do not send changes to driver if we are scanning. This removes
2888 * requirement that driver's bss_info_changed function needs to be 2876 * requirement that driver's bss_info_changed function needs to be
@@ -3478,9 +3466,9 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
3478 !ieee80211_sta_match_ssid(ifsta, bss->ssid, bss->ssid_len)) 3466 !ieee80211_sta_match_ssid(ifsta, bss->ssid, bss->ssid_len))
3479 continue; 3467 continue;
3480 3468
3481 if (!selected || top_rssi < bss->rssi) { 3469 if (!selected || top_rssi < bss->signal) {
3482 selected = bss; 3470 selected = bss;
3483 top_rssi = bss->rssi; 3471 top_rssi = bss->signal;
3484 } 3472 }
3485 } 3473 }
3486 if (selected) 3474 if (selected)
@@ -3556,10 +3544,12 @@ static int ieee80211_sta_create_ibss(struct net_device *dev,
3556 bss->beacon_int = local->hw.conf.beacon_int; 3544 bss->beacon_int = local->hw.conf.beacon_int;
3557 bss->last_update = jiffies; 3545 bss->last_update = jiffies;
3558 bss->capability = WLAN_CAPABILITY_IBSS; 3546 bss->capability = WLAN_CAPABILITY_IBSS;
3559 if (sdata->default_key) { 3547
3548 if (sdata->default_key)
3560 bss->capability |= WLAN_CAPABILITY_PRIVACY; 3549 bss->capability |= WLAN_CAPABILITY_PRIVACY;
3561 } else 3550 else
3562 sdata->drop_unencrypted = 0; 3551 sdata->drop_unencrypted = 0;
3552
3563 bss->supp_rates_len = sband->n_bitrates; 3553 bss->supp_rates_len = sband->n_bitrates;
3564 pos = bss->supp_rates; 3554 pos = bss->supp_rates;
3565 for (i = 0; i < sband->n_bitrates; i++) { 3555 for (i = 0; i < sband->n_bitrates; i++) {
@@ -4109,8 +4099,8 @@ ieee80211_sta_scan_result(struct net_device *dev,
4109 4099
4110 memset(&iwe, 0, sizeof(iwe)); 4100 memset(&iwe, 0, sizeof(iwe));
4111 iwe.cmd = IWEVQUAL; 4101 iwe.cmd = IWEVQUAL;
4112 iwe.u.qual.qual = bss->signal; 4102 iwe.u.qual.qual = bss->qual;
4113 iwe.u.qual.level = bss->rssi; 4103 iwe.u.qual.level = bss->signal;
4114 iwe.u.qual.noise = bss->noise; 4104 iwe.u.qual.noise = bss->noise;
4115 iwe.u.qual.updated = local->wstats_flags; 4105 iwe.u.qual.updated = local->wstats_flags;
4116 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, 4106 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,
@@ -4242,6 +4232,7 @@ int ieee80211_sta_set_extra_ie(struct net_device *dev, char *ie, size_t len)
4242{ 4232{
4243 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 4233 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
4244 struct ieee80211_if_sta *ifsta = &sdata->u.sta; 4234 struct ieee80211_if_sta *ifsta = &sdata->u.sta;
4235
4245 kfree(ifsta->extra_ie); 4236 kfree(ifsta->extra_ie);
4246 if (len == 0) { 4237 if (len == 0) {
4247 ifsta->extra_ie = NULL; 4238 ifsta->extra_ie = NULL;
@@ -4259,9 +4250,9 @@ int ieee80211_sta_set_extra_ie(struct net_device *dev, char *ie, size_t len)
4259} 4250}
4260 4251
4261 4252
4262struct sta_info * ieee80211_ibss_add_sta(struct net_device *dev, 4253struct sta_info *ieee80211_ibss_add_sta(struct net_device *dev,
4263 struct sk_buff *skb, u8 *bssid, 4254 struct sk_buff *skb, u8 *bssid,
4264 u8 *addr) 4255 u8 *addr)
4265{ 4256{
4266 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 4257 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
4267 struct sta_info *sta; 4258 struct sta_info *sta;
@@ -4285,7 +4276,7 @@ struct sta_info * ieee80211_ibss_add_sta(struct net_device *dev,
4285 if (!sta) 4276 if (!sta)
4286 return NULL; 4277 return NULL;
4287 4278
4288 sta->flags |= WLAN_STA_AUTHORIZED; 4279 set_sta_flags(sta, WLAN_STA_AUTHORIZED);
4289 4280
4290 sta->supp_rates[local->hw.conf.channel->band] = 4281 sta->supp_rates[local->hw.conf.channel->band] =
4291 sdata->u.sta.supp_rates_bits[local->hw.conf.channel->band]; 4282 sdata->u.sta.supp_rates_bits[local->hw.conf.channel->band];