diff options
Diffstat (limited to 'drivers/net/wireless/libertas/cfg.c')
-rw-r--r-- | drivers/net/wireless/libertas/cfg.c | 153 |
1 files changed, 101 insertions, 52 deletions
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c index 3e82f1627209..5d637af2d7c3 100644 --- a/drivers/net/wireless/libertas/cfg.c +++ b/drivers/net/wireless/libertas/cfg.c | |||
@@ -6,10 +6,11 @@ | |||
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
10 | |||
9 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
10 | #include <linux/wait.h> | 12 | #include <linux/wait.h> |
11 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
12 | #include <linux/sched.h> | ||
13 | #include <linux/ieee80211.h> | 14 | #include <linux/ieee80211.h> |
14 | #include <net/cfg80211.h> | 15 | #include <net/cfg80211.h> |
15 | #include <asm/unaligned.h> | 16 | #include <asm/unaligned.h> |
@@ -123,8 +124,10 @@ static u8 lbs_auth_to_authtype(enum nl80211_auth_type auth_type) | |||
123 | } | 124 | } |
124 | 125 | ||
125 | 126 | ||
126 | /* Various firmware commands need the list of supported rates, but with | 127 | /* |
127 | the hight-bit set for basic rates */ | 128 | * Various firmware commands need the list of supported rates, but with |
129 | * the hight-bit set for basic rates | ||
130 | */ | ||
128 | static int lbs_add_rates(u8 *rates) | 131 | static int lbs_add_rates(u8 *rates) |
129 | { | 132 | { |
130 | size_t i; | 133 | size_t i; |
@@ -426,7 +429,7 @@ static int lbs_add_wpa_tlv(u8 *tlv, const u8 *ie, u8 ie_len) | |||
426 | return ie_len + 2; | 429 | return ie_len + 2; |
427 | } | 430 | } |
428 | 431 | ||
429 | /*************************************************************************** | 432 | /* |
430 | * Set Channel | 433 | * Set Channel |
431 | */ | 434 | */ |
432 | 435 | ||
@@ -453,7 +456,7 @@ static int lbs_cfg_set_channel(struct wiphy *wiphy, | |||
453 | 456 | ||
454 | 457 | ||
455 | 458 | ||
456 | /*************************************************************************** | 459 | /* |
457 | * Scanning | 460 | * Scanning |
458 | */ | 461 | */ |
459 | 462 | ||
@@ -480,7 +483,6 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy, | |||
480 | struct cmd_ds_802_11_scan_rsp *scanresp = (void *)resp; | 483 | struct cmd_ds_802_11_scan_rsp *scanresp = (void *)resp; |
481 | int bsssize; | 484 | int bsssize; |
482 | const u8 *pos; | 485 | const u8 *pos; |
483 | u16 nr_sets; | ||
484 | const u8 *tsfdesc; | 486 | const u8 *tsfdesc; |
485 | int tsfsize; | 487 | int tsfsize; |
486 | int i; | 488 | int i; |
@@ -489,12 +491,11 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy, | |||
489 | lbs_deb_enter(LBS_DEB_CFG80211); | 491 | lbs_deb_enter(LBS_DEB_CFG80211); |
490 | 492 | ||
491 | bsssize = get_unaligned_le16(&scanresp->bssdescriptsize); | 493 | bsssize = get_unaligned_le16(&scanresp->bssdescriptsize); |
492 | nr_sets = le16_to_cpu(scanresp->nr_sets); | ||
493 | 494 | ||
494 | lbs_deb_scan("scan response: %d BSSs (%d bytes); resp size %d bytes\n", | 495 | lbs_deb_scan("scan response: %d BSSs (%d bytes); resp size %d bytes\n", |
495 | nr_sets, bsssize, le16_to_cpu(resp->size)); | 496 | scanresp->nr_sets, bsssize, le16_to_cpu(resp->size)); |
496 | 497 | ||
497 | if (nr_sets == 0) { | 498 | if (scanresp->nr_sets == 0) { |
498 | ret = 0; | 499 | ret = 0; |
499 | goto done; | 500 | goto done; |
500 | } | 501 | } |
@@ -526,20 +527,33 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy, | |||
526 | 527 | ||
527 | pos = scanresp->bssdesc_and_tlvbuffer; | 528 | pos = scanresp->bssdesc_and_tlvbuffer; |
528 | 529 | ||
530 | lbs_deb_hex(LBS_DEB_SCAN, "SCAN_RSP", scanresp->bssdesc_and_tlvbuffer, | ||
531 | scanresp->bssdescriptsize); | ||
532 | |||
529 | tsfdesc = pos + bsssize; | 533 | tsfdesc = pos + bsssize; |
530 | tsfsize = 4 + 8 * scanresp->nr_sets; | 534 | tsfsize = 4 + 8 * scanresp->nr_sets; |
535 | lbs_deb_hex(LBS_DEB_SCAN, "SCAN_TSF", (u8 *) tsfdesc, tsfsize); | ||
531 | 536 | ||
532 | /* Validity check: we expect a Marvell-Local TLV */ | 537 | /* Validity check: we expect a Marvell-Local TLV */ |
533 | i = get_unaligned_le16(tsfdesc); | 538 | i = get_unaligned_le16(tsfdesc); |
534 | tsfdesc += 2; | 539 | tsfdesc += 2; |
535 | if (i != TLV_TYPE_TSFTIMESTAMP) | 540 | if (i != TLV_TYPE_TSFTIMESTAMP) { |
541 | lbs_deb_scan("scan response: invalid TSF Timestamp %d\n", i); | ||
536 | goto done; | 542 | goto done; |
537 | /* Validity check: the TLV holds TSF values with 8 bytes each, so | 543 | } |
538 | * the size in the TLV must match the nr_sets value */ | 544 | |
545 | /* | ||
546 | * Validity check: the TLV holds TSF values with 8 bytes each, so | ||
547 | * the size in the TLV must match the nr_sets value | ||
548 | */ | ||
539 | i = get_unaligned_le16(tsfdesc); | 549 | i = get_unaligned_le16(tsfdesc); |
540 | tsfdesc += 2; | 550 | tsfdesc += 2; |
541 | if (i / 8 != scanresp->nr_sets) | 551 | if (i / 8 != scanresp->nr_sets) { |
552 | lbs_deb_scan("scan response: invalid number of TSF timestamp " | ||
553 | "sets (expected %d got %d)\n", scanresp->nr_sets, | ||
554 | i / 8); | ||
542 | goto done; | 555 | goto done; |
556 | } | ||
543 | 557 | ||
544 | for (i = 0; i < scanresp->nr_sets; i++) { | 558 | for (i = 0; i < scanresp->nr_sets; i++) { |
545 | const u8 *bssid; | 559 | const u8 *bssid; |
@@ -573,16 +587,21 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy, | |||
573 | 587 | ||
574 | /* To find out the channel, we must parse the IEs */ | 588 | /* To find out the channel, we must parse the IEs */ |
575 | ie = pos; | 589 | ie = pos; |
576 | /* 6+1+8+2+2: size of BSSID, RSSI, time stamp, beacon | 590 | /* |
577 | interval, capabilities */ | 591 | * 6+1+8+2+2: size of BSSID, RSSI, time stamp, beacon |
592 | * interval, capabilities | ||
593 | */ | ||
578 | ielen = left = len - (6 + 1 + 8 + 2 + 2); | 594 | ielen = left = len - (6 + 1 + 8 + 2 + 2); |
579 | while (left >= 2) { | 595 | while (left >= 2) { |
580 | u8 id, elen; | 596 | u8 id, elen; |
581 | id = *pos++; | 597 | id = *pos++; |
582 | elen = *pos++; | 598 | elen = *pos++; |
583 | left -= 2; | 599 | left -= 2; |
584 | if (elen > left || elen == 0) | 600 | if (elen > left || elen == 0) { |
601 | lbs_deb_scan("scan response: invalid IE fmt\n"); | ||
585 | goto done; | 602 | goto done; |
603 | } | ||
604 | |||
586 | if (id == WLAN_EID_DS_PARAMS) | 605 | if (id == WLAN_EID_DS_PARAMS) |
587 | chan_no = *pos; | 606 | chan_no = *pos; |
588 | if (id == WLAN_EID_SSID) { | 607 | if (id == WLAN_EID_SSID) { |
@@ -596,7 +615,8 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy, | |||
596 | /* No channel, no luck */ | 615 | /* No channel, no luck */ |
597 | if (chan_no != -1) { | 616 | if (chan_no != -1) { |
598 | struct wiphy *wiphy = priv->wdev->wiphy; | 617 | struct wiphy *wiphy = priv->wdev->wiphy; |
599 | int freq = ieee80211_channel_to_frequency(chan_no); | 618 | int freq = ieee80211_channel_to_frequency(chan_no, |
619 | IEEE80211_BAND_2GHZ); | ||
600 | struct ieee80211_channel *channel = | 620 | struct ieee80211_channel *channel = |
601 | ieee80211_get_channel(wiphy, freq); | 621 | ieee80211_get_channel(wiphy, freq); |
602 | 622 | ||
@@ -606,14 +626,16 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy, | |||
606 | print_ssid(ssid_buf, ssid, ssid_len), | 626 | print_ssid(ssid_buf, ssid, ssid_len), |
607 | LBS_SCAN_RSSI_TO_MBM(rssi)/100); | 627 | LBS_SCAN_RSSI_TO_MBM(rssi)/100); |
608 | 628 | ||
609 | if (channel || | 629 | if (channel && |
610 | !(channel->flags & IEEE80211_CHAN_DISABLED)) | 630 | !(channel->flags & IEEE80211_CHAN_DISABLED)) |
611 | cfg80211_inform_bss(wiphy, channel, | 631 | cfg80211_inform_bss(wiphy, channel, |
612 | bssid, le64_to_cpu(*(__le64 *)tsfdesc), | 632 | bssid, le64_to_cpu(*(__le64 *)tsfdesc), |
613 | capa, intvl, ie, ielen, | 633 | capa, intvl, ie, ielen, |
614 | LBS_SCAN_RSSI_TO_MBM(rssi), | 634 | LBS_SCAN_RSSI_TO_MBM(rssi), |
615 | GFP_KERNEL); | 635 | GFP_KERNEL); |
616 | } | 636 | } else |
637 | lbs_deb_scan("scan response: missing BSS channel IE\n"); | ||
638 | |||
617 | tsfdesc += 8; | 639 | tsfdesc += 8; |
618 | } | 640 | } |
619 | ret = 0; | 641 | ret = 0; |
@@ -685,8 +707,9 @@ static void lbs_scan_worker(struct work_struct *work) | |||
685 | 707 | ||
686 | if (priv->scan_channel < priv->scan_req->n_channels) { | 708 | if (priv->scan_channel < priv->scan_req->n_channels) { |
687 | cancel_delayed_work(&priv->scan_work); | 709 | cancel_delayed_work(&priv->scan_work); |
688 | queue_delayed_work(priv->work_thread, &priv->scan_work, | 710 | if (!priv->stopping) |
689 | msecs_to_jiffies(300)); | 711 | queue_delayed_work(priv->work_thread, &priv->scan_work, |
712 | msecs_to_jiffies(300)); | ||
690 | } | 713 | } |
691 | 714 | ||
692 | /* This is the final data we are about to send */ | 715 | /* This is the final data we are about to send */ |
@@ -775,7 +798,7 @@ static int lbs_cfg_scan(struct wiphy *wiphy, | |||
775 | 798 | ||
776 | 799 | ||
777 | 800 | ||
778 | /*************************************************************************** | 801 | /* |
779 | * Events | 802 | * Events |
780 | */ | 803 | */ |
781 | 804 | ||
@@ -810,7 +833,7 @@ void lbs_send_mic_failureevent(struct lbs_private *priv, u32 event) | |||
810 | 833 | ||
811 | 834 | ||
812 | 835 | ||
813 | /*************************************************************************** | 836 | /* |
814 | * Connect/disconnect | 837 | * Connect/disconnect |
815 | */ | 838 | */ |
816 | 839 | ||
@@ -935,8 +958,10 @@ static int lbs_enable_rsn(struct lbs_private *priv, int enable) | |||
935 | * Set WPA/WPA key material | 958 | * Set WPA/WPA key material |
936 | */ | 959 | */ |
937 | 960 | ||
938 | /* like "struct cmd_ds_802_11_key_material", but with cmd_header. Once we | 961 | /* |
939 | * get rid of WEXT, this should go into host.h */ | 962 | * like "struct cmd_ds_802_11_key_material", but with cmd_header. Once we |
963 | * get rid of WEXT, this should go into host.h | ||
964 | */ | ||
940 | 965 | ||
941 | struct cmd_key_material { | 966 | struct cmd_key_material { |
942 | struct cmd_header hdr; | 967 | struct cmd_header hdr; |
@@ -1103,7 +1128,7 @@ static int lbs_associate(struct lbs_private *priv, | |||
1103 | lbs_deb_hex(LBS_DEB_ASSOC, "Common Rates", tmp, pos - tmp); | 1128 | lbs_deb_hex(LBS_DEB_ASSOC, "Common Rates", tmp, pos - tmp); |
1104 | 1129 | ||
1105 | /* add auth type TLV */ | 1130 | /* add auth type TLV */ |
1106 | if (priv->fwrelease >= 0x09000000) | 1131 | if (MRVL_FW_MAJOR_REV(priv->fwrelease) >= 9) |
1107 | pos += lbs_add_auth_type_tlv(pos, sme->auth_type); | 1132 | pos += lbs_add_auth_type_tlv(pos, sme->auth_type); |
1108 | 1133 | ||
1109 | /* add WPA/WPA2 TLV */ | 1134 | /* add WPA/WPA2 TLV */ |
@@ -1114,6 +1139,9 @@ static int lbs_associate(struct lbs_private *priv, | |||
1114 | (u16)(pos - (u8 *) &cmd->iebuf); | 1139 | (u16)(pos - (u8 *) &cmd->iebuf); |
1115 | cmd->hdr.size = cpu_to_le16(len); | 1140 | cmd->hdr.size = cpu_to_le16(len); |
1116 | 1141 | ||
1142 | lbs_deb_hex(LBS_DEB_ASSOC, "ASSOC_CMD", (u8 *) cmd, | ||
1143 | le16_to_cpu(cmd->hdr.size)); | ||
1144 | |||
1117 | /* store for later use */ | 1145 | /* store for later use */ |
1118 | memcpy(priv->assoc_bss, bss->bssid, ETH_ALEN); | 1146 | memcpy(priv->assoc_bss, bss->bssid, ETH_ALEN); |
1119 | 1147 | ||
@@ -1121,14 +1149,28 @@ static int lbs_associate(struct lbs_private *priv, | |||
1121 | if (ret) | 1149 | if (ret) |
1122 | goto done; | 1150 | goto done; |
1123 | 1151 | ||
1124 | |||
1125 | /* generate connect message to cfg80211 */ | 1152 | /* generate connect message to cfg80211 */ |
1126 | 1153 | ||
1127 | resp = (void *) cmd; /* recast for easier field access */ | 1154 | resp = (void *) cmd; /* recast for easier field access */ |
1128 | status = le16_to_cpu(resp->statuscode); | 1155 | status = le16_to_cpu(resp->statuscode); |
1129 | 1156 | ||
1130 | /* Convert statis code of old firmware */ | 1157 | /* Older FW versions map the IEEE 802.11 Status Code in the association |
1131 | if (priv->fwrelease < 0x09000000) | 1158 | * response to the following values returned in resp->statuscode: |
1159 | * | ||
1160 | * IEEE Status Code Marvell Status Code | ||
1161 | * 0 -> 0x0000 ASSOC_RESULT_SUCCESS | ||
1162 | * 13 -> 0x0004 ASSOC_RESULT_AUTH_REFUSED | ||
1163 | * 14 -> 0x0004 ASSOC_RESULT_AUTH_REFUSED | ||
1164 | * 15 -> 0x0004 ASSOC_RESULT_AUTH_REFUSED | ||
1165 | * 16 -> 0x0004 ASSOC_RESULT_AUTH_REFUSED | ||
1166 | * others -> 0x0003 ASSOC_RESULT_REFUSED | ||
1167 | * | ||
1168 | * Other response codes: | ||
1169 | * 0x0001 -> ASSOC_RESULT_INVALID_PARAMETERS (unused) | ||
1170 | * 0x0002 -> ASSOC_RESULT_TIMEOUT (internal timer expired waiting for | ||
1171 | * association response from the AP) | ||
1172 | */ | ||
1173 | if (MRVL_FW_MAJOR_REV(priv->fwrelease) <= 8) { | ||
1132 | switch (status) { | 1174 | switch (status) { |
1133 | case 0: | 1175 | case 0: |
1134 | break; | 1176 | break; |
@@ -1150,11 +1192,16 @@ static int lbs_associate(struct lbs_private *priv, | |||
1150 | break; | 1192 | break; |
1151 | default: | 1193 | default: |
1152 | lbs_deb_assoc("association failure %d\n", status); | 1194 | lbs_deb_assoc("association failure %d\n", status); |
1153 | status = WLAN_STATUS_UNSPECIFIED_FAILURE; | 1195 | /* v5 OLPC firmware does return the AP status code if |
1196 | * it's not one of the values above. Let that through. | ||
1197 | */ | ||
1198 | break; | ||
1199 | } | ||
1154 | } | 1200 | } |
1155 | 1201 | ||
1156 | lbs_deb_assoc("status %d, capability 0x%04x\n", status, | 1202 | lbs_deb_assoc("status %d, statuscode 0x%04x, capability 0x%04x, " |
1157 | le16_to_cpu(resp->capability)); | 1203 | "aid 0x%04x\n", status, le16_to_cpu(resp->statuscode), |
1204 | le16_to_cpu(resp->capability), le16_to_cpu(resp->aid)); | ||
1158 | 1205 | ||
1159 | resp_ie_len = le16_to_cpu(resp->hdr.size) | 1206 | resp_ie_len = le16_to_cpu(resp->hdr.size) |
1160 | - sizeof(resp->hdr) | 1207 | - sizeof(resp->hdr) |
@@ -1174,7 +1221,6 @@ static int lbs_associate(struct lbs_private *priv, | |||
1174 | netif_tx_wake_all_queues(priv->dev); | 1221 | netif_tx_wake_all_queues(priv->dev); |
1175 | } | 1222 | } |
1176 | 1223 | ||
1177 | |||
1178 | done: | 1224 | done: |
1179 | lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret); | 1225 | lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret); |
1180 | return ret; | 1226 | return ret; |
@@ -1278,8 +1324,8 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1278 | sme->ssid, sme->ssid_len, | 1324 | sme->ssid, sme->ssid_len, |
1279 | WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); | 1325 | WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); |
1280 | if (!bss) { | 1326 | if (!bss) { |
1281 | lbs_pr_err("assoc: bss %pM not in scan results\n", | 1327 | wiphy_err(wiphy, "assoc: bss %pM not in scan results\n", |
1282 | sme->bssid); | 1328 | sme->bssid); |
1283 | ret = -ENOENT; | 1329 | ret = -ENOENT; |
1284 | goto done; | 1330 | goto done; |
1285 | } | 1331 | } |
@@ -1314,7 +1360,7 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1314 | * we remove all keys like in the WPA/WPA2 setup, | 1360 | * we remove all keys like in the WPA/WPA2 setup, |
1315 | * we just don't set RSN. | 1361 | * we just don't set RSN. |
1316 | * | 1362 | * |
1317 | * Therefore: fall-throught | 1363 | * Therefore: fall-through |
1318 | */ | 1364 | */ |
1319 | case WLAN_CIPHER_SUITE_TKIP: | 1365 | case WLAN_CIPHER_SUITE_TKIP: |
1320 | case WLAN_CIPHER_SUITE_CCMP: | 1366 | case WLAN_CIPHER_SUITE_CCMP: |
@@ -1336,8 +1382,8 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev, | |||
1336 | lbs_enable_rsn(priv, sme->crypto.cipher_group != 0); | 1382 | lbs_enable_rsn(priv, sme->crypto.cipher_group != 0); |
1337 | break; | 1383 | break; |
1338 | default: | 1384 | default: |
1339 | lbs_pr_err("unsupported cipher group 0x%x\n", | 1385 | wiphy_err(wiphy, "unsupported cipher group 0x%x\n", |
1340 | sme->crypto.cipher_group); | 1386 | sme->crypto.cipher_group); |
1341 | ret = -ENOTSUPP; | 1387 | ret = -ENOTSUPP; |
1342 | goto done; | 1388 | goto done; |
1343 | } | 1389 | } |
@@ -1387,7 +1433,8 @@ static int lbs_cfg_disconnect(struct wiphy *wiphy, struct net_device *dev, | |||
1387 | 1433 | ||
1388 | static int lbs_cfg_set_default_key(struct wiphy *wiphy, | 1434 | static int lbs_cfg_set_default_key(struct wiphy *wiphy, |
1389 | struct net_device *netdev, | 1435 | struct net_device *netdev, |
1390 | u8 key_index) | 1436 | u8 key_index, bool unicast, |
1437 | bool multicast) | ||
1391 | { | 1438 | { |
1392 | struct lbs_private *priv = wiphy_priv(wiphy); | 1439 | struct lbs_private *priv = wiphy_priv(wiphy); |
1393 | 1440 | ||
@@ -1404,7 +1451,7 @@ static int lbs_cfg_set_default_key(struct wiphy *wiphy, | |||
1404 | 1451 | ||
1405 | 1452 | ||
1406 | static int lbs_cfg_add_key(struct wiphy *wiphy, struct net_device *netdev, | 1453 | static int lbs_cfg_add_key(struct wiphy *wiphy, struct net_device *netdev, |
1407 | u8 idx, const u8 *mac_addr, | 1454 | u8 idx, bool pairwise, const u8 *mac_addr, |
1408 | struct key_params *params) | 1455 | struct key_params *params) |
1409 | { | 1456 | { |
1410 | struct lbs_private *priv = wiphy_priv(wiphy); | 1457 | struct lbs_private *priv = wiphy_priv(wiphy); |
@@ -1454,7 +1501,7 @@ static int lbs_cfg_add_key(struct wiphy *wiphy, struct net_device *netdev, | |||
1454 | params->key, params->key_len); | 1501 | params->key, params->key_len); |
1455 | break; | 1502 | break; |
1456 | default: | 1503 | default: |
1457 | lbs_pr_err("unhandled cipher 0x%x\n", params->cipher); | 1504 | wiphy_err(wiphy, "unhandled cipher 0x%x\n", params->cipher); |
1458 | ret = -ENOTSUPP; | 1505 | ret = -ENOTSUPP; |
1459 | break; | 1506 | break; |
1460 | } | 1507 | } |
@@ -1464,7 +1511,7 @@ static int lbs_cfg_add_key(struct wiphy *wiphy, struct net_device *netdev, | |||
1464 | 1511 | ||
1465 | 1512 | ||
1466 | static int lbs_cfg_del_key(struct wiphy *wiphy, struct net_device *netdev, | 1513 | static int lbs_cfg_del_key(struct wiphy *wiphy, struct net_device *netdev, |
1467 | u8 key_index, const u8 *mac_addr) | 1514 | u8 key_index, bool pairwise, const u8 *mac_addr) |
1468 | { | 1515 | { |
1469 | 1516 | ||
1470 | lbs_deb_enter(LBS_DEB_CFG80211); | 1517 | lbs_deb_enter(LBS_DEB_CFG80211); |
@@ -1499,7 +1546,7 @@ static int lbs_cfg_del_key(struct wiphy *wiphy, struct net_device *netdev, | |||
1499 | } | 1546 | } |
1500 | 1547 | ||
1501 | 1548 | ||
1502 | /*************************************************************************** | 1549 | /* |
1503 | * Get station | 1550 | * Get station |
1504 | */ | 1551 | */ |
1505 | 1552 | ||
@@ -1544,7 +1591,7 @@ static int lbs_cfg_get_station(struct wiphy *wiphy, struct net_device *dev, | |||
1544 | 1591 | ||
1545 | 1592 | ||
1546 | 1593 | ||
1547 | /*************************************************************************** | 1594 | /* |
1548 | * "Site survey", here just current channel and noise level | 1595 | * "Site survey", here just current channel and noise level |
1549 | */ | 1596 | */ |
1550 | 1597 | ||
@@ -1561,7 +1608,8 @@ static int lbs_get_survey(struct wiphy *wiphy, struct net_device *dev, | |||
1561 | lbs_deb_enter(LBS_DEB_CFG80211); | 1608 | lbs_deb_enter(LBS_DEB_CFG80211); |
1562 | 1609 | ||
1563 | survey->channel = ieee80211_get_channel(wiphy, | 1610 | survey->channel = ieee80211_get_channel(wiphy, |
1564 | ieee80211_channel_to_frequency(priv->channel)); | 1611 | ieee80211_channel_to_frequency(priv->channel, |
1612 | IEEE80211_BAND_2GHZ)); | ||
1565 | 1613 | ||
1566 | ret = lbs_get_rssi(priv, &signal, &noise); | 1614 | ret = lbs_get_rssi(priv, &signal, &noise); |
1567 | if (ret == 0) { | 1615 | if (ret == 0) { |
@@ -1576,7 +1624,7 @@ static int lbs_get_survey(struct wiphy *wiphy, struct net_device *dev, | |||
1576 | 1624 | ||
1577 | 1625 | ||
1578 | 1626 | ||
1579 | /*************************************************************************** | 1627 | /* |
1580 | * Change interface | 1628 | * Change interface |
1581 | */ | 1629 | */ |
1582 | 1630 | ||
@@ -1618,11 +1666,12 @@ static int lbs_change_intf(struct wiphy *wiphy, struct net_device *dev, | |||
1618 | 1666 | ||
1619 | 1667 | ||
1620 | 1668 | ||
1621 | /*************************************************************************** | 1669 | /* |
1622 | * IBSS (Ad-Hoc) | 1670 | * IBSS (Ad-Hoc) |
1623 | */ | 1671 | */ |
1624 | 1672 | ||
1625 | /* The firmware needs the following bits masked out of the beacon-derived | 1673 | /* |
1674 | * The firmware needs the following bits masked out of the beacon-derived | ||
1626 | * capability field when associating/joining to a BSS: | 1675 | * capability field when associating/joining to a BSS: |
1627 | * 9 (QoS), 11 (APSD), 12 (unused), 14 (unused), 15 (unused) | 1676 | * 9 (QoS), 11 (APSD), 12 (unused), 14 (unused), 15 (unused) |
1628 | */ | 1677 | */ |
@@ -1961,7 +2010,7 @@ static int lbs_leave_ibss(struct wiphy *wiphy, struct net_device *dev) | |||
1961 | 2010 | ||
1962 | 2011 | ||
1963 | 2012 | ||
1964 | /*************************************************************************** | 2013 | /* |
1965 | * Initialization | 2014 | * Initialization |
1966 | */ | 2015 | */ |
1967 | 2016 | ||
@@ -2025,7 +2074,7 @@ static void lbs_cfg_set_regulatory_hint(struct lbs_private *priv) | |||
2025 | }; | 2074 | }; |
2026 | 2075 | ||
2027 | /* Section 5.17.2 */ | 2076 | /* Section 5.17.2 */ |
2028 | static struct region_code_mapping regmap[] = { | 2077 | static const struct region_code_mapping regmap[] = { |
2029 | {"US ", 0x10}, /* US FCC */ | 2078 | {"US ", 0x10}, /* US FCC */ |
2030 | {"CA ", 0x20}, /* Canada */ | 2079 | {"CA ", 0x20}, /* Canada */ |
2031 | {"EU ", 0x30}, /* ETSI */ | 2080 | {"EU ", 0x30}, /* ETSI */ |
@@ -2080,13 +2129,13 @@ int lbs_cfg_register(struct lbs_private *priv) | |||
2080 | 2129 | ||
2081 | ret = wiphy_register(wdev->wiphy); | 2130 | ret = wiphy_register(wdev->wiphy); |
2082 | if (ret < 0) | 2131 | if (ret < 0) |
2083 | lbs_pr_err("cannot register wiphy device\n"); | 2132 | pr_err("cannot register wiphy device\n"); |
2084 | 2133 | ||
2085 | priv->wiphy_registered = true; | 2134 | priv->wiphy_registered = true; |
2086 | 2135 | ||
2087 | ret = register_netdev(priv->dev); | 2136 | ret = register_netdev(priv->dev); |
2088 | if (ret) | 2137 | if (ret) |
2089 | lbs_pr_err("cannot register network device\n"); | 2138 | pr_err("cannot register network device\n"); |
2090 | 2139 | ||
2091 | INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker); | 2140 | INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker); |
2092 | 2141 | ||