diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-09-14 13:53:49 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-09-14 13:53:49 -0400 |
commit | 9316f0e3c6ba524d8fa14bfded048b252891931a (patch) | |
tree | 60326e5943997bb72aaf2a375f8a20c61ec7bbcd | |
parent | 7f2e6a5d8608d0353b017a0fe15502307593734e (diff) | |
parent | 7a5f799becc51c842ec1a3aeb8dd82651aea7036 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
130 files changed, 3664 insertions, 918 deletions
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c index a8f570d69075..432aeeedfd5e 100644 --- a/drivers/bcma/main.c +++ b/drivers/bcma/main.c | |||
@@ -227,7 +227,17 @@ int __devinit bcma_bus_register(struct bcma_bus *bus) | |||
227 | 227 | ||
228 | void bcma_bus_unregister(struct bcma_bus *bus) | 228 | void bcma_bus_unregister(struct bcma_bus *bus) |
229 | { | 229 | { |
230 | struct bcma_device *cores[3]; | ||
231 | |||
232 | cores[0] = bcma_find_core(bus, BCMA_CORE_MIPS_74K); | ||
233 | cores[1] = bcma_find_core(bus, BCMA_CORE_PCIE); | ||
234 | cores[2] = bcma_find_core(bus, BCMA_CORE_4706_MAC_GBIT_COMMON); | ||
235 | |||
230 | bcma_unregister_cores(bus); | 236 | bcma_unregister_cores(bus); |
237 | |||
238 | kfree(cores[2]); | ||
239 | kfree(cores[1]); | ||
240 | kfree(cores[0]); | ||
231 | } | 241 | } |
232 | 242 | ||
233 | int __init bcma_bus_early_register(struct bcma_bus *bus, | 243 | int __init bcma_bus_early_register(struct bcma_bus *bus, |
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c index 11f36e502136..fc2de5528dcc 100644 --- a/drivers/bluetooth/ath3k.c +++ b/drivers/bluetooth/ath3k.c | |||
@@ -86,6 +86,7 @@ static struct usb_device_id ath3k_table[] = { | |||
86 | 86 | ||
87 | /* Atheros AR5BBU22 with sflash firmware */ | 87 | /* Atheros AR5BBU22 with sflash firmware */ |
88 | { USB_DEVICE(0x0489, 0xE03C) }, | 88 | { USB_DEVICE(0x0489, 0xE03C) }, |
89 | { USB_DEVICE(0x0489, 0xE036) }, | ||
89 | 90 | ||
90 | { } /* Terminating entry */ | 91 | { } /* Terminating entry */ |
91 | }; | 92 | }; |
@@ -109,6 +110,7 @@ static struct usb_device_id ath3k_blist_tbl[] = { | |||
109 | 110 | ||
110 | /* Atheros AR5BBU22 with sflash firmware */ | 111 | /* Atheros AR5BBU22 with sflash firmware */ |
111 | { USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 }, | 112 | { USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 }, |
113 | { USB_DEVICE(0x0489, 0xE036), .driver_info = BTUSB_ATH3012 }, | ||
112 | 114 | ||
113 | { } /* Terminating entry */ | 115 | { } /* Terminating entry */ |
114 | }; | 116 | }; |
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index fa2a7d5a6b43..e5921d681ddb 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
@@ -52,6 +52,9 @@ static struct usb_device_id btusb_table[] = { | |||
52 | /* Generic Bluetooth USB device */ | 52 | /* Generic Bluetooth USB device */ |
53 | { USB_DEVICE_INFO(0xe0, 0x01, 0x01) }, | 53 | { USB_DEVICE_INFO(0xe0, 0x01, 0x01) }, |
54 | 54 | ||
55 | /* Apple-specific (Broadcom) devices */ | ||
56 | { USB_VENDOR_AND_INTERFACE_INFO(0x05ac, 0xff, 0x01, 0x01) }, | ||
57 | |||
55 | /* Broadcom SoftSailing reporting vendor specific */ | 58 | /* Broadcom SoftSailing reporting vendor specific */ |
56 | { USB_DEVICE(0x0a5c, 0x21e1) }, | 59 | { USB_DEVICE(0x0a5c, 0x21e1) }, |
57 | 60 | ||
@@ -94,16 +97,14 @@ static struct usb_device_id btusb_table[] = { | |||
94 | 97 | ||
95 | /* Broadcom BCM20702A0 */ | 98 | /* Broadcom BCM20702A0 */ |
96 | { USB_DEVICE(0x0489, 0xe042) }, | 99 | { USB_DEVICE(0x0489, 0xe042) }, |
97 | { USB_DEVICE(0x0a5c, 0x21e3) }, | ||
98 | { USB_DEVICE(0x0a5c, 0x21e6) }, | ||
99 | { USB_DEVICE(0x0a5c, 0x21e8) }, | ||
100 | { USB_DEVICE(0x0a5c, 0x21f3) }, | ||
101 | { USB_DEVICE(0x0a5c, 0x21f4) }, | ||
102 | { USB_DEVICE(0x413c, 0x8197) }, | 100 | { USB_DEVICE(0x413c, 0x8197) }, |
103 | 101 | ||
104 | /* Foxconn - Hon Hai */ | 102 | /* Foxconn - Hon Hai */ |
105 | { USB_DEVICE(0x0489, 0xe033) }, | 103 | { USB_DEVICE(0x0489, 0xe033) }, |
106 | 104 | ||
105 | /*Broadcom devices with vendor specific id */ | ||
106 | { USB_VENDOR_AND_INTERFACE_INFO(0x0a5c, 0xff, 0x01, 0x01) }, | ||
107 | |||
107 | { } /* Terminating entry */ | 108 | { } /* Terminating entry */ |
108 | }; | 109 | }; |
109 | 110 | ||
@@ -141,6 +142,7 @@ static struct usb_device_id blacklist_table[] = { | |||
141 | 142 | ||
142 | /* Atheros AR5BBU12 with sflash firmware */ | 143 | /* Atheros AR5BBU12 with sflash firmware */ |
143 | { USB_DEVICE(0x0489, 0xe03c), .driver_info = BTUSB_ATH3012 }, | 144 | { USB_DEVICE(0x0489, 0xe03c), .driver_info = BTUSB_ATH3012 }, |
145 | { USB_DEVICE(0x0489, 0xe036), .driver_info = BTUSB_ATH3012 }, | ||
144 | 146 | ||
145 | /* Broadcom BCM2035 */ | 147 | /* Broadcom BCM2035 */ |
146 | { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU }, | 148 | { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU }, |
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index c586f78c307f..3cd05a7173f6 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -87,7 +87,6 @@ static struct pci_driver airo_driver = { | |||
87 | /* Include Wireless Extension definition and check version - Jean II */ | 87 | /* Include Wireless Extension definition and check version - Jean II */ |
88 | #include <linux/wireless.h> | 88 | #include <linux/wireless.h> |
89 | #define WIRELESS_SPY /* enable iwspy support */ | 89 | #define WIRELESS_SPY /* enable iwspy support */ |
90 | #include <net/iw_handler.h> /* New driver API */ | ||
91 | 90 | ||
92 | #define CISCO_EXT /* enable Cisco extensions */ | 91 | #define CISCO_EXT /* enable Cisco extensions */ |
93 | #ifdef CISCO_EXT | 92 | #ifdef CISCO_EXT |
@@ -5984,13 +5983,11 @@ static int airo_set_wap(struct net_device *dev, | |||
5984 | Cmd cmd; | 5983 | Cmd cmd; |
5985 | Resp rsp; | 5984 | Resp rsp; |
5986 | APListRid APList_rid; | 5985 | APListRid APList_rid; |
5987 | static const u8 any[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; | ||
5988 | static const u8 off[ETH_ALEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; | ||
5989 | 5986 | ||
5990 | if (awrq->sa_family != ARPHRD_ETHER) | 5987 | if (awrq->sa_family != ARPHRD_ETHER) |
5991 | return -EINVAL; | 5988 | return -EINVAL; |
5992 | else if (!memcmp(any, awrq->sa_data, ETH_ALEN) || | 5989 | else if (is_broadcast_ether_addr(awrq->sa_data) || |
5993 | !memcmp(off, awrq->sa_data, ETH_ALEN)) { | 5990 | is_zero_ether_addr(awrq->sa_data)) { |
5994 | memset(&cmd, 0, sizeof(cmd)); | 5991 | memset(&cmd, 0, sizeof(cmd)); |
5995 | cmd.cmd=CMD_LOSE_SYNC; | 5992 | cmd.cmd=CMD_LOSE_SYNC; |
5996 | if (down_interruptible(&local->sem)) | 5993 | if (down_interruptible(&local->sem)) |
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c index e361afed99ff..99b9ddf21273 100644 --- a/drivers/net/wireless/at76c50x-usb.c +++ b/drivers/net/wireless/at76c50x-usb.c | |||
@@ -498,36 +498,6 @@ exit: | |||
498 | return ret; | 498 | return ret; |
499 | } | 499 | } |
500 | 500 | ||
501 | #define HEX2STR_BUFFERS 4 | ||
502 | #define HEX2STR_MAX_LEN 64 | ||
503 | |||
504 | /* Convert binary data into hex string */ | ||
505 | static char *hex2str(void *buf, size_t len) | ||
506 | { | ||
507 | static atomic_t a = ATOMIC_INIT(0); | ||
508 | static char bufs[HEX2STR_BUFFERS][3 * HEX2STR_MAX_LEN + 1]; | ||
509 | char *ret = bufs[atomic_inc_return(&a) & (HEX2STR_BUFFERS - 1)]; | ||
510 | char *obuf = ret; | ||
511 | u8 *ibuf = buf; | ||
512 | |||
513 | if (len > HEX2STR_MAX_LEN) | ||
514 | len = HEX2STR_MAX_LEN; | ||
515 | |||
516 | if (len == 0) | ||
517 | goto exit; | ||
518 | |||
519 | while (len--) { | ||
520 | obuf = hex_byte_pack(obuf, *ibuf++); | ||
521 | *obuf++ = '-'; | ||
522 | } | ||
523 | obuf--; | ||
524 | |||
525 | exit: | ||
526 | *obuf = '\0'; | ||
527 | |||
528 | return ret; | ||
529 | } | ||
530 | |||
531 | /* LED trigger */ | 501 | /* LED trigger */ |
532 | static int tx_activity; | 502 | static int tx_activity; |
533 | static void at76_ledtrig_tx_timerfunc(unsigned long data); | 503 | static void at76_ledtrig_tx_timerfunc(unsigned long data); |
@@ -1004,9 +974,9 @@ static void at76_dump_mib_mac_wep(struct at76_priv *priv) | |||
1004 | WEP_SMALL_KEY_LEN : WEP_LARGE_KEY_LEN; | 974 | WEP_SMALL_KEY_LEN : WEP_LARGE_KEY_LEN; |
1005 | 975 | ||
1006 | for (i = 0; i < WEP_KEYS; i++) | 976 | for (i = 0; i < WEP_KEYS; i++) |
1007 | at76_dbg(DBG_MIB, "%s: MIB MAC_WEP: key %d: %s", | 977 | at76_dbg(DBG_MIB, "%s: MIB MAC_WEP: key %d: %*phD", |
1008 | wiphy_name(priv->hw->wiphy), i, | 978 | wiphy_name(priv->hw->wiphy), i, |
1009 | hex2str(m->wep_default_keyvalue[i], key_len)); | 979 | key_len, m->wep_default_keyvalue[i]); |
1010 | exit: | 980 | exit: |
1011 | kfree(m); | 981 | kfree(m); |
1012 | } | 982 | } |
@@ -1031,7 +1001,7 @@ static void at76_dump_mib_mac_mgmt(struct at76_priv *priv) | |||
1031 | at76_dbg(DBG_MIB, "%s: MIB MAC_MGMT: beacon_period %d CFP_max_duration " | 1001 | at76_dbg(DBG_MIB, "%s: MIB MAC_MGMT: beacon_period %d CFP_max_duration " |
1032 | "%d medium_occupancy_limit %d station_id 0x%x ATIM_window %d " | 1002 | "%d medium_occupancy_limit %d station_id 0x%x ATIM_window %d " |
1033 | "CFP_mode %d privacy_opt_impl %d DTIM_period %d CFP_period %d " | 1003 | "CFP_mode %d privacy_opt_impl %d DTIM_period %d CFP_period %d " |
1034 | "current_bssid %pM current_essid %s current_bss_type %d " | 1004 | "current_bssid %pM current_essid %*phD current_bss_type %d " |
1035 | "pm_mode %d ibss_change %d res %d " | 1005 | "pm_mode %d ibss_change %d res %d " |
1036 | "multi_domain_capability_implemented %d " | 1006 | "multi_domain_capability_implemented %d " |
1037 | "international_roaming %d country_string %.3s", | 1007 | "international_roaming %d country_string %.3s", |
@@ -1041,7 +1011,7 @@ static void at76_dump_mib_mac_mgmt(struct at76_priv *priv) | |||
1041 | le16_to_cpu(m->station_id), le16_to_cpu(m->ATIM_window), | 1011 | le16_to_cpu(m->station_id), le16_to_cpu(m->ATIM_window), |
1042 | m->CFP_mode, m->privacy_option_implemented, m->DTIM_period, | 1012 | m->CFP_mode, m->privacy_option_implemented, m->DTIM_period, |
1043 | m->CFP_period, m->current_bssid, | 1013 | m->CFP_period, m->current_bssid, |
1044 | hex2str(m->current_essid, IW_ESSID_MAX_SIZE), | 1014 | IW_ESSID_MAX_SIZE, m->current_essid, |
1045 | m->current_bss_type, m->power_mgmt_mode, m->ibss_change, | 1015 | m->current_bss_type, m->power_mgmt_mode, m->ibss_change, |
1046 | m->res, m->multi_domain_capability_implemented, | 1016 | m->res, m->multi_domain_capability_implemented, |
1047 | m->multi_domain_capability_enabled, m->country_string); | 1017 | m->multi_domain_capability_enabled, m->country_string); |
@@ -1069,7 +1039,7 @@ static void at76_dump_mib_mac(struct at76_priv *priv) | |||
1069 | "cwmin %d cwmax %d short_retry_time %d long_retry_time %d " | 1039 | "cwmin %d cwmax %d short_retry_time %d long_retry_time %d " |
1070 | "scan_type %d scan_channel %d probe_delay %u " | 1040 | "scan_type %d scan_channel %d probe_delay %u " |
1071 | "min_channel_time %d max_channel_time %d listen_int %d " | 1041 | "min_channel_time %d max_channel_time %d listen_int %d " |
1072 | "desired_ssid %s desired_bssid %pM desired_bsstype %d", | 1042 | "desired_ssid %*phD desired_bssid %pM desired_bsstype %d", |
1073 | wiphy_name(priv->hw->wiphy), | 1043 | wiphy_name(priv->hw->wiphy), |
1074 | le32_to_cpu(m->max_tx_msdu_lifetime), | 1044 | le32_to_cpu(m->max_tx_msdu_lifetime), |
1075 | le32_to_cpu(m->max_rx_lifetime), | 1045 | le32_to_cpu(m->max_rx_lifetime), |
@@ -1080,7 +1050,7 @@ static void at76_dump_mib_mac(struct at76_priv *priv) | |||
1080 | le16_to_cpu(m->min_channel_time), | 1050 | le16_to_cpu(m->min_channel_time), |
1081 | le16_to_cpu(m->max_channel_time), | 1051 | le16_to_cpu(m->max_channel_time), |
1082 | le16_to_cpu(m->listen_interval), | 1052 | le16_to_cpu(m->listen_interval), |
1083 | hex2str(m->desired_ssid, IW_ESSID_MAX_SIZE), | 1053 | IW_ESSID_MAX_SIZE, m->desired_ssid, |
1084 | m->desired_bssid, m->desired_bsstype); | 1054 | m->desired_bssid, m->desired_bsstype); |
1085 | exit: | 1055 | exit: |
1086 | kfree(m); | 1056 | kfree(m); |
@@ -1160,13 +1130,13 @@ static void at76_dump_mib_mdomain(struct at76_priv *priv) | |||
1160 | goto exit; | 1130 | goto exit; |
1161 | } | 1131 | } |
1162 | 1132 | ||
1163 | at76_dbg(DBG_MIB, "%s: MIB MDOMAIN: channel_list %s", | 1133 | at76_dbg(DBG_MIB, "%s: MIB MDOMAIN: channel_list %*phD", |
1164 | wiphy_name(priv->hw->wiphy), | 1134 | wiphy_name(priv->hw->wiphy), |
1165 | hex2str(m->channel_list, sizeof(m->channel_list))); | 1135 | (int)sizeof(m->channel_list), m->channel_list); |
1166 | 1136 | ||
1167 | at76_dbg(DBG_MIB, "%s: MIB MDOMAIN: tx_powerlevel %s", | 1137 | at76_dbg(DBG_MIB, "%s: MIB MDOMAIN: tx_powerlevel %*phD", |
1168 | wiphy_name(priv->hw->wiphy), | 1138 | wiphy_name(priv->hw->wiphy), |
1169 | hex2str(m->tx_powerlevel, sizeof(m->tx_powerlevel))); | 1139 | (int)sizeof(m->tx_powerlevel), m->tx_powerlevel); |
1170 | exit: | 1140 | exit: |
1171 | kfree(m); | 1141 | kfree(m); |
1172 | } | 1142 | } |
@@ -1369,9 +1339,9 @@ static int at76_startup_device(struct at76_priv *priv) | |||
1369 | int ret; | 1339 | int ret; |
1370 | 1340 | ||
1371 | at76_dbg(DBG_PARAMS, | 1341 | at76_dbg(DBG_PARAMS, |
1372 | "%s param: ssid %.*s (%s) mode %s ch %d wep %s key %d " | 1342 | "%s param: ssid %.*s (%*phD) mode %s ch %d wep %s key %d " |
1373 | "keylen %d", wiphy_name(priv->hw->wiphy), priv->essid_size, | 1343 | "keylen %d", wiphy_name(priv->hw->wiphy), priv->essid_size, |
1374 | priv->essid, hex2str(priv->essid, IW_ESSID_MAX_SIZE), | 1344 | priv->essid, IW_ESSID_MAX_SIZE, priv->essid, |
1375 | priv->iw_mode == IW_MODE_ADHOC ? "adhoc" : "infra", | 1345 | priv->iw_mode == IW_MODE_ADHOC ? "adhoc" : "infra", |
1376 | priv->channel, priv->wep_enabled ? "enabled" : "disabled", | 1346 | priv->channel, priv->wep_enabled ? "enabled" : "disabled", |
1377 | priv->wep_key_id, priv->wep_keys_len[priv->wep_key_id]); | 1347 | priv->wep_key_id, priv->wep_keys_len[priv->wep_key_id]); |
diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c index ff007f500feb..e09ec40ce71a 100644 --- a/drivers/net/wireless/ath/ath9k/ani.c +++ b/drivers/net/wireless/ath/ath9k/ani.c | |||
@@ -237,7 +237,7 @@ static void ath9k_hw_set_cck_nil(struct ath_hw *ah, u_int8_t immunityLevel, | |||
237 | entry_cck->fir_step_level); | 237 | entry_cck->fir_step_level); |
238 | 238 | ||
239 | /* Skip MRC CCK for pre AR9003 families */ | 239 | /* Skip MRC CCK for pre AR9003 families */ |
240 | if (!AR_SREV_9300_20_OR_LATER(ah) || AR_SREV_9485(ah)) | 240 | if (!AR_SREV_9300_20_OR_LATER(ah) || AR_SREV_9485(ah) || AR_SREV_9565(ah)) |
241 | return; | 241 | return; |
242 | 242 | ||
243 | if (aniState->mrcCCK != entry_cck->mrc_cck_on) | 243 | if (aniState->mrcCCK != entry_cck->mrc_cck_on) |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index c37fe9620e41..b5659cb688fe 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | |||
@@ -138,7 +138,8 @@ static const struct ar9300_eeprom ar9300_default = { | |||
138 | }, | 138 | }, |
139 | .base_ext1 = { | 139 | .base_ext1 = { |
140 | .ant_div_control = 0, | 140 | .ant_div_control = 0, |
141 | .future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} | 141 | .future = {0, 0, 0}, |
142 | .tempslopextension = {0, 0, 0, 0, 0, 0, 0, 0} | ||
142 | }, | 143 | }, |
143 | .calFreqPier2G = { | 144 | .calFreqPier2G = { |
144 | FREQ2FBIN(2412, 1), | 145 | FREQ2FBIN(2412, 1), |
@@ -713,7 +714,8 @@ static const struct ar9300_eeprom ar9300_x113 = { | |||
713 | }, | 714 | }, |
714 | .base_ext1 = { | 715 | .base_ext1 = { |
715 | .ant_div_control = 0, | 716 | .ant_div_control = 0, |
716 | .future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} | 717 | .future = {0, 0, 0}, |
718 | .tempslopextension = {0, 0, 0, 0, 0, 0, 0, 0} | ||
717 | }, | 719 | }, |
718 | .calFreqPier2G = { | 720 | .calFreqPier2G = { |
719 | FREQ2FBIN(2412, 1), | 721 | FREQ2FBIN(2412, 1), |
@@ -1289,7 +1291,8 @@ static const struct ar9300_eeprom ar9300_h112 = { | |||
1289 | }, | 1291 | }, |
1290 | .base_ext1 = { | 1292 | .base_ext1 = { |
1291 | .ant_div_control = 0, | 1293 | .ant_div_control = 0, |
1292 | .future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} | 1294 | .future = {0, 0, 0}, |
1295 | .tempslopextension = {0, 0, 0, 0, 0, 0, 0, 0} | ||
1293 | }, | 1296 | }, |
1294 | .calFreqPier2G = { | 1297 | .calFreqPier2G = { |
1295 | FREQ2FBIN(2412, 1), | 1298 | FREQ2FBIN(2412, 1), |
@@ -1865,7 +1868,8 @@ static const struct ar9300_eeprom ar9300_x112 = { | |||
1865 | }, | 1868 | }, |
1866 | .base_ext1 = { | 1869 | .base_ext1 = { |
1867 | .ant_div_control = 0, | 1870 | .ant_div_control = 0, |
1868 | .future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} | 1871 | .future = {0, 0, 0}, |
1872 | .tempslopextension = {0, 0, 0, 0, 0, 0, 0, 0} | ||
1869 | }, | 1873 | }, |
1870 | .calFreqPier2G = { | 1874 | .calFreqPier2G = { |
1871 | FREQ2FBIN(2412, 1), | 1875 | FREQ2FBIN(2412, 1), |
@@ -2440,7 +2444,8 @@ static const struct ar9300_eeprom ar9300_h116 = { | |||
2440 | }, | 2444 | }, |
2441 | .base_ext1 = { | 2445 | .base_ext1 = { |
2442 | .ant_div_control = 0, | 2446 | .ant_div_control = 0, |
2443 | .future = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} | 2447 | .future = {0, 0, 0}, |
2448 | .tempslopextension = {0, 0, 0, 0, 0, 0, 0, 0} | ||
2444 | }, | 2449 | }, |
2445 | .calFreqPier2G = { | 2450 | .calFreqPier2G = { |
2446 | FREQ2FBIN(2412, 1), | 2451 | FREQ2FBIN(2412, 1), |
@@ -3520,7 +3525,7 @@ static void ar9003_hw_xpa_bias_level_apply(struct ath_hw *ah, bool is2ghz) | |||
3520 | 3525 | ||
3521 | if (AR_SREV_9485(ah) || AR_SREV_9330(ah) || AR_SREV_9340(ah)) | 3526 | if (AR_SREV_9485(ah) || AR_SREV_9330(ah) || AR_SREV_9340(ah)) |
3522 | REG_RMW_FIELD(ah, AR_CH0_TOP2, AR_CH0_TOP2_XPABIASLVL, bias); | 3527 | REG_RMW_FIELD(ah, AR_CH0_TOP2, AR_CH0_TOP2_XPABIASLVL, bias); |
3523 | else if (AR_SREV_9462(ah) || AR_SREV_9550(ah)) | 3528 | else if (AR_SREV_9462(ah) || AR_SREV_9550(ah) || AR_SREV_9565(ah)) |
3524 | REG_RMW_FIELD(ah, AR_CH0_TOP, AR_CH0_TOP_XPABIASLVL, bias); | 3529 | REG_RMW_FIELD(ah, AR_CH0_TOP, AR_CH0_TOP_XPABIASLVL, bias); |
3525 | else { | 3530 | else { |
3526 | REG_RMW_FIELD(ah, AR_CH0_TOP, AR_CH0_TOP_XPABIASLVL, bias); | 3531 | REG_RMW_FIELD(ah, AR_CH0_TOP, AR_CH0_TOP_XPABIASLVL, bias); |
@@ -3568,7 +3573,7 @@ static void ar9003_hw_ant_ctrl_apply(struct ath_hw *ah, bool is2ghz) | |||
3568 | 3573 | ||
3569 | u32 value = ar9003_hw_ant_ctrl_common_get(ah, is2ghz); | 3574 | u32 value = ar9003_hw_ant_ctrl_common_get(ah, is2ghz); |
3570 | 3575 | ||
3571 | if (AR_SREV_9462(ah)) { | 3576 | if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) { |
3572 | REG_RMW_FIELD(ah, AR_PHY_SWITCH_COM, | 3577 | REG_RMW_FIELD(ah, AR_PHY_SWITCH_COM, |
3573 | AR_SWITCH_TABLE_COM_AR9462_ALL, value); | 3578 | AR_SWITCH_TABLE_COM_AR9462_ALL, value); |
3574 | } else if (AR_SREV_9550(ah)) { | 3579 | } else if (AR_SREV_9550(ah)) { |
@@ -3612,7 +3617,7 @@ static void ar9003_hw_ant_ctrl_apply(struct ath_hw *ah, bool is2ghz) | |||
3612 | } | 3617 | } |
3613 | } | 3618 | } |
3614 | 3619 | ||
3615 | if (AR_SREV_9330(ah) || AR_SREV_9485(ah)) { | 3620 | if (AR_SREV_9330(ah) || AR_SREV_9485(ah) || AR_SREV_9565(ah)) { |
3616 | value = ath9k_hw_ar9300_get_eeprom(ah, EEP_ANT_DIV_CTL1); | 3621 | value = ath9k_hw_ar9300_get_eeprom(ah, EEP_ANT_DIV_CTL1); |
3617 | /* | 3622 | /* |
3618 | * main_lnaconf, alt_lnaconf, main_tb, alt_tb | 3623 | * main_lnaconf, alt_lnaconf, main_tb, alt_tb |
@@ -3622,19 +3627,16 @@ static void ar9003_hw_ant_ctrl_apply(struct ath_hw *ah, bool is2ghz) | |||
3622 | regval &= (~AR_ANT_DIV_CTRL_ALL); | 3627 | regval &= (~AR_ANT_DIV_CTRL_ALL); |
3623 | regval |= (value & 0x3f) << AR_ANT_DIV_CTRL_ALL_S; | 3628 | regval |= (value & 0x3f) << AR_ANT_DIV_CTRL_ALL_S; |
3624 | /* enable_lnadiv */ | 3629 | /* enable_lnadiv */ |
3625 | regval &= (~AR_PHY_9485_ANT_DIV_LNADIV); | 3630 | regval &= (~AR_PHY_ANT_DIV_LNADIV); |
3626 | regval |= ((value >> 6) & 0x1) << | 3631 | regval |= ((value >> 6) & 0x1) << AR_PHY_ANT_DIV_LNADIV_S; |
3627 | AR_PHY_9485_ANT_DIV_LNADIV_S; | ||
3628 | REG_WRITE(ah, AR_PHY_MC_GAIN_CTRL, regval); | 3632 | REG_WRITE(ah, AR_PHY_MC_GAIN_CTRL, regval); |
3629 | 3633 | ||
3630 | /*enable fast_div */ | 3634 | /*enable fast_div */ |
3631 | regval = REG_READ(ah, AR_PHY_CCK_DETECT); | 3635 | regval = REG_READ(ah, AR_PHY_CCK_DETECT); |
3632 | regval &= (~AR_FAST_DIV_ENABLE); | 3636 | regval &= (~AR_FAST_DIV_ENABLE); |
3633 | regval |= ((value >> 7) & 0x1) << | 3637 | regval |= ((value >> 7) & 0x1) << AR_FAST_DIV_ENABLE_S; |
3634 | AR_FAST_DIV_ENABLE_S; | ||
3635 | REG_WRITE(ah, AR_PHY_CCK_DETECT, regval); | 3638 | REG_WRITE(ah, AR_PHY_CCK_DETECT, regval); |
3636 | ant_div_ctl1 = | 3639 | ant_div_ctl1 = ah->eep_ops->get_eeprom(ah, EEP_ANT_DIV_CTL1); |
3637 | ah->eep_ops->get_eeprom(ah, EEP_ANT_DIV_CTL1); | ||
3638 | /* check whether antenna diversity is enabled */ | 3640 | /* check whether antenna diversity is enabled */ |
3639 | if ((ant_div_ctl1 >> 0x6) == 0x3) { | 3641 | if ((ant_div_ctl1 >> 0x6) == 0x3) { |
3640 | regval = REG_READ(ah, AR_PHY_MC_GAIN_CTRL); | 3642 | regval = REG_READ(ah, AR_PHY_MC_GAIN_CTRL); |
@@ -3642,15 +3644,15 @@ static void ar9003_hw_ant_ctrl_apply(struct ath_hw *ah, bool is2ghz) | |||
3642 | * clear bits 25-30 main_lnaconf, alt_lnaconf, | 3644 | * clear bits 25-30 main_lnaconf, alt_lnaconf, |
3643 | * main_tb, alt_tb | 3645 | * main_tb, alt_tb |
3644 | */ | 3646 | */ |
3645 | regval &= (~(AR_PHY_9485_ANT_DIV_MAIN_LNACONF | | 3647 | regval &= (~(AR_PHY_ANT_DIV_MAIN_LNACONF | |
3646 | AR_PHY_9485_ANT_DIV_ALT_LNACONF | | 3648 | AR_PHY_ANT_DIV_ALT_LNACONF | |
3647 | AR_PHY_9485_ANT_DIV_ALT_GAINTB | | 3649 | AR_PHY_ANT_DIV_ALT_GAINTB | |
3648 | AR_PHY_9485_ANT_DIV_MAIN_GAINTB)); | 3650 | AR_PHY_ANT_DIV_MAIN_GAINTB)); |
3649 | /* by default use LNA1 for the main antenna */ | 3651 | /* by default use LNA1 for the main antenna */ |
3650 | regval |= (AR_PHY_9485_ANT_DIV_LNA1 << | 3652 | regval |= (AR_PHY_ANT_DIV_LNA1 << |
3651 | AR_PHY_9485_ANT_DIV_MAIN_LNACONF_S); | 3653 | AR_PHY_ANT_DIV_MAIN_LNACONF_S); |
3652 | regval |= (AR_PHY_9485_ANT_DIV_LNA2 << | 3654 | regval |= (AR_PHY_ANT_DIV_LNA2 << |
3653 | AR_PHY_9485_ANT_DIV_ALT_LNACONF_S); | 3655 | AR_PHY_ANT_DIV_ALT_LNACONF_S); |
3654 | REG_WRITE(ah, AR_PHY_MC_GAIN_CTRL, regval); | 3656 | REG_WRITE(ah, AR_PHY_MC_GAIN_CTRL, regval); |
3655 | } | 3657 | } |
3656 | 3658 | ||
@@ -3843,7 +3845,7 @@ void ar9003_hw_internal_regulator_apply(struct ath_hw *ah) | |||
3843 | REG_WRITE(ah, AR_PHY_PMU2, reg_pmu_set); | 3845 | REG_WRITE(ah, AR_PHY_PMU2, reg_pmu_set); |
3844 | if (!is_pmu_set(ah, AR_PHY_PMU2, reg_pmu_set)) | 3846 | if (!is_pmu_set(ah, AR_PHY_PMU2, reg_pmu_set)) |
3845 | return; | 3847 | return; |
3846 | } else if (AR_SREV_9462(ah)) { | 3848 | } else if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) { |
3847 | reg_val = le32_to_cpu(pBase->swreg); | 3849 | reg_val = le32_to_cpu(pBase->swreg); |
3848 | REG_WRITE(ah, AR_PHY_PMU1, reg_val); | 3850 | REG_WRITE(ah, AR_PHY_PMU1, reg_val); |
3849 | } else { | 3851 | } else { |
@@ -3874,7 +3876,7 @@ void ar9003_hw_internal_regulator_apply(struct ath_hw *ah) | |||
3874 | while (!REG_READ_FIELD(ah, AR_PHY_PMU2, | 3876 | while (!REG_READ_FIELD(ah, AR_PHY_PMU2, |
3875 | AR_PHY_PMU2_PGM)) | 3877 | AR_PHY_PMU2_PGM)) |
3876 | udelay(10); | 3878 | udelay(10); |
3877 | } else if (AR_SREV_9462(ah)) | 3879 | } else if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) |
3878 | REG_RMW_FIELD(ah, AR_PHY_PMU1, AR_PHY_PMU1_PWD, 0x1); | 3880 | REG_RMW_FIELD(ah, AR_PHY_PMU1, AR_PHY_PMU1_PWD, 0x1); |
3879 | else { | 3881 | else { |
3880 | reg_val = REG_READ(ah, AR_RTC_SLEEP_CLK) | | 3882 | reg_val = REG_READ(ah, AR_RTC_SLEEP_CLK) | |
@@ -3977,6 +3979,62 @@ static void ar9003_hw_xlna_bias_strength_apply(struct ath_hw *ah, bool is2ghz) | |||
3977 | bias & 0x3); | 3979 | bias & 0x3); |
3978 | } | 3980 | } |
3979 | 3981 | ||
3982 | static int ar9003_hw_get_thermometer(struct ath_hw *ah) | ||
3983 | { | ||
3984 | struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep; | ||
3985 | struct ar9300_base_eep_hdr *pBase = &eep->baseEepHeader; | ||
3986 | int thermometer = (pBase->miscConfiguration >> 1) & 0x3; | ||
3987 | |||
3988 | return --thermometer; | ||
3989 | } | ||
3990 | |||
3991 | static void ar9003_hw_thermometer_apply(struct ath_hw *ah) | ||
3992 | { | ||
3993 | int thermometer = ar9003_hw_get_thermometer(ah); | ||
3994 | u8 therm_on = (thermometer < 0) ? 0 : 1; | ||
3995 | |||
3996 | REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_RXTX4, | ||
3997 | AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR, therm_on); | ||
3998 | if (ah->caps.tx_chainmask & BIT(1)) | ||
3999 | REG_RMW_FIELD(ah, AR_PHY_65NM_CH1_RXTX4, | ||
4000 | AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR, therm_on); | ||
4001 | if (ah->caps.tx_chainmask & BIT(2)) | ||
4002 | REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX4, | ||
4003 | AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR, therm_on); | ||
4004 | |||
4005 | therm_on = (thermometer < 0) ? 0 : (thermometer == 0); | ||
4006 | REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_RXTX4, | ||
4007 | AR_PHY_65NM_CH0_RXTX4_THERM_ON, therm_on); | ||
4008 | if (ah->caps.tx_chainmask & BIT(1)) { | ||
4009 | therm_on = (thermometer < 0) ? 0 : (thermometer == 1); | ||
4010 | REG_RMW_FIELD(ah, AR_PHY_65NM_CH1_RXTX4, | ||
4011 | AR_PHY_65NM_CH0_RXTX4_THERM_ON, therm_on); | ||
4012 | } | ||
4013 | if (ah->caps.tx_chainmask & BIT(2)) { | ||
4014 | therm_on = (thermometer < 0) ? 0 : (thermometer == 2); | ||
4015 | REG_RMW_FIELD(ah, AR_PHY_65NM_CH2_RXTX4, | ||
4016 | AR_PHY_65NM_CH0_RXTX4_THERM_ON, therm_on); | ||
4017 | } | ||
4018 | } | ||
4019 | |||
4020 | static void ar9003_hw_thermo_cal_apply(struct ath_hw *ah) | ||
4021 | { | ||
4022 | u32 data, ko, kg; | ||
4023 | |||
4024 | if (!AR_SREV_9462_20(ah)) | ||
4025 | return; | ||
4026 | ar9300_otp_read_word(ah, 1, &data); | ||
4027 | ko = data & 0xff; | ||
4028 | kg = (data >> 8) & 0xff; | ||
4029 | if (ko || kg) { | ||
4030 | REG_RMW_FIELD(ah, AR_PHY_BB_THERM_ADC_3, | ||
4031 | AR_PHY_BB_THERM_ADC_3_THERM_ADC_OFFSET, ko); | ||
4032 | REG_RMW_FIELD(ah, AR_PHY_BB_THERM_ADC_3, | ||
4033 | AR_PHY_BB_THERM_ADC_3_THERM_ADC_SCALE_GAIN, | ||
4034 | kg + 256); | ||
4035 | } | ||
4036 | } | ||
4037 | |||
3980 | static void ath9k_hw_ar9300_set_board_values(struct ath_hw *ah, | 4038 | static void ath9k_hw_ar9300_set_board_values(struct ath_hw *ah, |
3981 | struct ath9k_channel *chan) | 4039 | struct ath9k_channel *chan) |
3982 | { | 4040 | { |
@@ -3992,6 +4050,8 @@ static void ath9k_hw_ar9300_set_board_values(struct ath_hw *ah, | |||
3992 | ar9003_hw_internal_regulator_apply(ah); | 4050 | ar9003_hw_internal_regulator_apply(ah); |
3993 | ar9003_hw_apply_tuning_caps(ah); | 4051 | ar9003_hw_apply_tuning_caps(ah); |
3994 | ar9003_hw_txend_to_xpa_off_apply(ah, is2ghz); | 4052 | ar9003_hw_txend_to_xpa_off_apply(ah, is2ghz); |
4053 | ar9003_hw_thermometer_apply(ah); | ||
4054 | ar9003_hw_thermo_cal_apply(ah); | ||
3995 | } | 4055 | } |
3996 | 4056 | ||
3997 | static void ath9k_hw_ar9300_set_addac(struct ath_hw *ah, | 4057 | static void ath9k_hw_ar9300_set_addac(struct ath_hw *ah, |
@@ -4528,7 +4588,7 @@ static int ar9003_hw_power_control_override(struct ath_hw *ah, | |||
4528 | { | 4588 | { |
4529 | int tempSlope = 0; | 4589 | int tempSlope = 0; |
4530 | struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep; | 4590 | struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep; |
4531 | int f[3], t[3]; | 4591 | int f[8], t[8], i; |
4532 | 4592 | ||
4533 | REG_RMW(ah, AR_PHY_TPC_11_B0, | 4593 | REG_RMW(ah, AR_PHY_TPC_11_B0, |
4534 | (correction[0] << AR_PHY_TPC_OLPC_GAIN_DELTA_S), | 4594 | (correction[0] << AR_PHY_TPC_OLPC_GAIN_DELTA_S), |
@@ -4561,7 +4621,14 @@ static int ar9003_hw_power_control_override(struct ath_hw *ah, | |||
4561 | */ | 4621 | */ |
4562 | if (frequency < 4000) | 4622 | if (frequency < 4000) |
4563 | tempSlope = eep->modalHeader2G.tempSlope; | 4623 | tempSlope = eep->modalHeader2G.tempSlope; |
4564 | else if (eep->base_ext2.tempSlopeLow != 0) { | 4624 | else if ((eep->baseEepHeader.miscConfiguration & 0x20) != 0) { |
4625 | for (i = 0; i < 8; i++) { | ||
4626 | t[i] = eep->base_ext1.tempslopextension[i]; | ||
4627 | f[i] = FBIN2FREQ(eep->calFreqPier5G[i], 0); | ||
4628 | } | ||
4629 | tempSlope = ar9003_hw_power_interpolate((s32) frequency, | ||
4630 | f, t, 8); | ||
4631 | } else if (eep->base_ext2.tempSlopeLow != 0) { | ||
4565 | t[0] = eep->base_ext2.tempSlopeLow; | 4632 | t[0] = eep->base_ext2.tempSlopeLow; |
4566 | f[0] = 5180; | 4633 | f[0] = 5180; |
4567 | t[1] = eep->modalHeader5G.tempSlope; | 4634 | t[1] = eep->modalHeader5G.tempSlope; |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h index 3a1ff55bceb9..41b1a75e6bec 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h | |||
@@ -267,7 +267,8 @@ struct cal_ctl_data_5g { | |||
267 | 267 | ||
268 | struct ar9300_BaseExtension_1 { | 268 | struct ar9300_BaseExtension_1 { |
269 | u8 ant_div_control; | 269 | u8 ant_div_control; |
270 | u8 future[11]; | 270 | u8 future[3]; |
271 | u8 tempslopextension[8]; | ||
271 | int8_t quick_drop_low; | 272 | int8_t quick_drop_low; |
272 | int8_t quick_drop_high; | 273 | int8_t quick_drop_high; |
273 | } __packed; | 274 | } __packed; |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_hw.c b/drivers/net/wireless/ath/ath9k/ar9003_hw.c index 1e8a4da5952f..1a36fa262639 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_hw.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_hw.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include "ar955x_1p0_initvals.h" | 24 | #include "ar955x_1p0_initvals.h" |
25 | #include "ar9580_1p0_initvals.h" | 25 | #include "ar9580_1p0_initvals.h" |
26 | #include "ar9462_2p0_initvals.h" | 26 | #include "ar9462_2p0_initvals.h" |
27 | #include "ar9565_1p0_initvals.h" | ||
27 | 28 | ||
28 | /* General hardware code for the AR9003 hadware family */ | 29 | /* General hardware code for the AR9003 hadware family */ |
29 | 30 | ||
@@ -34,14 +35,12 @@ | |||
34 | */ | 35 | */ |
35 | static void ar9003_hw_init_mode_regs(struct ath_hw *ah) | 36 | static void ar9003_hw_init_mode_regs(struct ath_hw *ah) |
36 | { | 37 | { |
37 | #define PCIE_PLL_ON_CREQ_DIS_L1_2P0 \ | ||
38 | ar9462_pciephy_pll_on_clkreq_disable_L1_2p0 | ||
39 | |||
40 | #define AR9462_BB_CTX_COEFJ(x) \ | 38 | #define AR9462_BB_CTX_COEFJ(x) \ |
41 | ar9462_##x##_baseband_core_txfir_coeff_japan_2484 | 39 | ar9462_##x##_baseband_core_txfir_coeff_japan_2484 |
42 | 40 | ||
43 | #define AR9462_BBC_TXIFR_COEFFJ \ | 41 | #define AR9462_BBC_TXIFR_COEFFJ \ |
44 | ar9462_2p0_baseband_core_txfir_coeff_japan_2484 | 42 | ar9462_2p0_baseband_core_txfir_coeff_japan_2484 |
43 | |||
45 | if (AR_SREV_9330_11(ah)) { | 44 | if (AR_SREV_9330_11(ah)) { |
46 | /* mac */ | 45 | /* mac */ |
47 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], | 46 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], |
@@ -220,10 +219,10 @@ static void ar9003_hw_init_mode_regs(struct ath_hw *ah) | |||
220 | 219 | ||
221 | /* Awake -> Sleep Setting */ | 220 | /* Awake -> Sleep Setting */ |
222 | INIT_INI_ARRAY(&ah->iniPcieSerdes, | 221 | INIT_INI_ARRAY(&ah->iniPcieSerdes, |
223 | PCIE_PLL_ON_CREQ_DIS_L1_2P0); | 222 | ar9462_pciephy_pll_on_clkreq_disable_L1_2p0); |
224 | /* Sleep -> Awake Setting */ | 223 | /* Sleep -> Awake Setting */ |
225 | INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower, | 224 | INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower, |
226 | PCIE_PLL_ON_CREQ_DIS_L1_2P0); | 225 | ar9462_pciephy_pll_on_clkreq_disable_L1_2p0); |
227 | 226 | ||
228 | /* Fast clock modal settings */ | 227 | /* Fast clock modal settings */ |
229 | INIT_INI_ARRAY(&ah->iniModesFastClock, | 228 | INIT_INI_ARRAY(&ah->iniModesFastClock, |
@@ -302,6 +301,39 @@ static void ar9003_hw_init_mode_regs(struct ath_hw *ah) | |||
302 | 301 | ||
303 | INIT_INI_ARRAY(&ah->iniModesFastClock, | 302 | INIT_INI_ARRAY(&ah->iniModesFastClock, |
304 | ar9580_1p0_modes_fast_clock); | 303 | ar9580_1p0_modes_fast_clock); |
304 | } else if (AR_SREV_9565(ah)) { | ||
305 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], | ||
306 | ar9565_1p0_mac_core); | ||
307 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_POST], | ||
308 | ar9565_1p0_mac_postamble); | ||
309 | |||
310 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_CORE], | ||
311 | ar9565_1p0_baseband_core); | ||
312 | INIT_INI_ARRAY(&ah->iniBB[ATH_INI_POST], | ||
313 | ar9565_1p0_baseband_postamble); | ||
314 | |||
315 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_CORE], | ||
316 | ar9565_1p0_radio_core); | ||
317 | INIT_INI_ARRAY(&ah->iniRadio[ATH_INI_POST], | ||
318 | ar9565_1p0_radio_postamble); | ||
319 | |||
320 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_PRE], | ||
321 | ar9565_1p0_soc_preamble); | ||
322 | INIT_INI_ARRAY(&ah->iniSOC[ATH_INI_POST], | ||
323 | ar9565_1p0_soc_postamble); | ||
324 | |||
325 | INIT_INI_ARRAY(&ah->iniModesRxGain, | ||
326 | ar9565_1p0_Common_rx_gain_table); | ||
327 | INIT_INI_ARRAY(&ah->iniModesTxGain, | ||
328 | ar9565_1p0_Modes_lowest_ob_db_tx_gain_table); | ||
329 | |||
330 | INIT_INI_ARRAY(&ah->iniPcieSerdes, | ||
331 | ar9565_1p0_pciephy_pll_on_clkreq_disable_L1); | ||
332 | INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower, | ||
333 | ar9565_1p0_pciephy_pll_on_clkreq_disable_L1); | ||
334 | |||
335 | INIT_INI_ARRAY(&ah->iniModesFastClock, | ||
336 | ar9565_1p0_modes_fast_clock); | ||
305 | } else { | 337 | } else { |
306 | /* mac */ | 338 | /* mac */ |
307 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], | 339 | INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE], |
@@ -374,6 +406,9 @@ static void ar9003_tx_gain_table_mode0(struct ath_hw *ah) | |||
374 | else if (AR_SREV_9462_20(ah)) | 406 | else if (AR_SREV_9462_20(ah)) |
375 | INIT_INI_ARRAY(&ah->iniModesTxGain, | 407 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
376 | ar9462_modes_low_ob_db_tx_gain_table_2p0); | 408 | ar9462_modes_low_ob_db_tx_gain_table_2p0); |
409 | else if (AR_SREV_9565(ah)) | ||
410 | INIT_INI_ARRAY(&ah->iniModesTxGain, | ||
411 | ar9565_1p0_modes_low_ob_db_tx_gain_table); | ||
377 | else | 412 | else |
378 | INIT_INI_ARRAY(&ah->iniModesTxGain, | 413 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
379 | ar9300Modes_lowest_ob_db_tx_gain_table_2p2); | 414 | ar9300Modes_lowest_ob_db_tx_gain_table_2p2); |
@@ -402,6 +437,9 @@ static void ar9003_tx_gain_table_mode1(struct ath_hw *ah) | |||
402 | else if (AR_SREV_9462_20(ah)) | 437 | else if (AR_SREV_9462_20(ah)) |
403 | INIT_INI_ARRAY(&ah->iniModesTxGain, | 438 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
404 | ar9462_modes_high_ob_db_tx_gain_table_2p0); | 439 | ar9462_modes_high_ob_db_tx_gain_table_2p0); |
440 | else if (AR_SREV_9565(ah)) | ||
441 | INIT_INI_ARRAY(&ah->iniModesTxGain, | ||
442 | ar9565_1p0_modes_high_ob_db_tx_gain_table); | ||
405 | else | 443 | else |
406 | INIT_INI_ARRAY(&ah->iniModesTxGain, | 444 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
407 | ar9300Modes_high_ob_db_tx_gain_table_2p2); | 445 | ar9300Modes_high_ob_db_tx_gain_table_2p2); |
@@ -424,6 +462,9 @@ static void ar9003_tx_gain_table_mode2(struct ath_hw *ah) | |||
424 | else if (AR_SREV_9580(ah)) | 462 | else if (AR_SREV_9580(ah)) |
425 | INIT_INI_ARRAY(&ah->iniModesTxGain, | 463 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
426 | ar9580_1p0_low_ob_db_tx_gain_table); | 464 | ar9580_1p0_low_ob_db_tx_gain_table); |
465 | else if (AR_SREV_9565(ah)) | ||
466 | INIT_INI_ARRAY(&ah->iniModesTxGain, | ||
467 | ar9565_1p0_modes_low_ob_db_tx_gain_table); | ||
427 | else | 468 | else |
428 | INIT_INI_ARRAY(&ah->iniModesTxGain, | 469 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
429 | ar9300Modes_low_ob_db_tx_gain_table_2p2); | 470 | ar9300Modes_low_ob_db_tx_gain_table_2p2); |
@@ -446,6 +487,9 @@ static void ar9003_tx_gain_table_mode3(struct ath_hw *ah) | |||
446 | else if (AR_SREV_9580(ah)) | 487 | else if (AR_SREV_9580(ah)) |
447 | INIT_INI_ARRAY(&ah->iniModesTxGain, | 488 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
448 | ar9580_1p0_high_power_tx_gain_table); | 489 | ar9580_1p0_high_power_tx_gain_table); |
490 | else if (AR_SREV_9565(ah)) | ||
491 | INIT_INI_ARRAY(&ah->iniModesTxGain, | ||
492 | ar9565_1p0_modes_high_power_tx_gain_table); | ||
449 | else | 493 | else |
450 | INIT_INI_ARRAY(&ah->iniModesTxGain, | 494 | INIT_INI_ARRAY(&ah->iniModesTxGain, |
451 | ar9300Modes_high_power_tx_gain_table_2p2); | 495 | ar9300Modes_high_power_tx_gain_table_2p2); |
@@ -538,6 +582,9 @@ static void ar9003_rx_gain_table_mode1(struct ath_hw *ah) | |||
538 | } else if (AR_SREV_9580(ah)) | 582 | } else if (AR_SREV_9580(ah)) |
539 | INIT_INI_ARRAY(&ah->iniModesRxGain, | 583 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
540 | ar9580_1p0_wo_xlna_rx_gain_table); | 584 | ar9580_1p0_wo_xlna_rx_gain_table); |
585 | else if (AR_SREV_9565(ah)) | ||
586 | INIT_INI_ARRAY(&ah->iniModesRxGain, | ||
587 | ar9565_1p0_common_wo_xlna_rx_gain_table); | ||
541 | else | 588 | else |
542 | INIT_INI_ARRAY(&ah->iniModesRxGain, | 589 | INIT_INI_ARRAY(&ah->iniModesRxGain, |
543 | ar9300Common_wo_xlna_rx_gain_table_2p2); | 590 | ar9300Common_wo_xlna_rx_gain_table_2p2); |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c index 78816b8b2173..d5b2e0ecc21c 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c | |||
@@ -31,7 +31,7 @@ ar9003_set_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_info *i) | |||
31 | u32 val, ctl12, ctl17; | 31 | u32 val, ctl12, ctl17; |
32 | u8 desc_len; | 32 | u8 desc_len; |
33 | 33 | ||
34 | desc_len = (AR_SREV_9462(ah) ? 0x18 : 0x17); | 34 | desc_len = ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x18 : 0x17); |
35 | 35 | ||
36 | val = (ATHEROS_VENDOR_ID << AR_DescId_S) | | 36 | val = (ATHEROS_VENDOR_ID << AR_DescId_S) | |
37 | (1 << AR_TxRxDesc_S) | | 37 | (1 << AR_TxRxDesc_S) | |
@@ -531,7 +531,7 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs, | |||
531 | rxs->rs_status |= ATH9K_RXERR_PHY; | 531 | rxs->rs_status |= ATH9K_RXERR_PHY; |
532 | rxs->rs_phyerr = phyerr; | 532 | rxs->rs_phyerr = phyerr; |
533 | } | 533 | } |
534 | }; | 534 | } |
535 | } | 535 | } |
536 | 536 | ||
537 | if (rxsp->status11 & AR_KeyMiss) | 537 | if (rxsp->status11 & AR_KeyMiss) |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.c b/drivers/net/wireless/ath/ath9k/ar9003_mci.c index 9a34fcaae3ff..b2e39e8a21b5 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_mci.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.c | |||
@@ -714,6 +714,7 @@ bool ar9003_mci_start_reset(struct ath_hw *ah, struct ath9k_channel *chan) | |||
714 | 714 | ||
715 | return true; | 715 | return true; |
716 | } | 716 | } |
717 | EXPORT_SYMBOL(ar9003_mci_start_reset); | ||
717 | 718 | ||
718 | int ar9003_mci_end_reset(struct ath_hw *ah, struct ath9k_channel *chan, | 719 | int ar9003_mci_end_reset(struct ath_hw *ah, struct ath9k_channel *chan, |
719 | struct ath9k_hw_cal_data *caldata) | 720 | struct ath9k_hw_cal_data *caldata) |
@@ -1201,12 +1202,6 @@ u32 ar9003_mci_state(struct ath_hw *ah, u32 state_type) | |||
1201 | 1202 | ||
1202 | ar9003_mci_2g5g_switch(ah, false); | 1203 | ar9003_mci_2g5g_switch(ah, false); |
1203 | break; | 1204 | break; |
1204 | case MCI_STATE_SET_BT_CAL_START: | ||
1205 | mci->bt_state = MCI_BT_CAL_START; | ||
1206 | break; | ||
1207 | case MCI_STATE_SET_BT_CAL: | ||
1208 | mci->bt_state = MCI_BT_CAL; | ||
1209 | break; | ||
1210 | case MCI_STATE_RESET_REQ_WAKE: | 1205 | case MCI_STATE_RESET_REQ_WAKE: |
1211 | ar9003_mci_reset_req_wakeup(ah); | 1206 | ar9003_mci_reset_req_wakeup(ah); |
1212 | mci->update_2g5g = true; | 1207 | mci->update_2g5g = true; |
@@ -1327,6 +1322,10 @@ u32 ar9003_mci_get_next_gpm_offset(struct ath_hw *ah, bool first, u32 *more) | |||
1327 | 1322 | ||
1328 | if (first) { | 1323 | if (first) { |
1329 | gpm_ptr = MS(REG_READ(ah, AR_MCI_GPM_1), AR_MCI_GPM_WRITE_PTR); | 1324 | gpm_ptr = MS(REG_READ(ah, AR_MCI_GPM_1), AR_MCI_GPM_WRITE_PTR); |
1325 | |||
1326 | if (gpm_ptr >= mci->gpm_len) | ||
1327 | gpm_ptr = 0; | ||
1328 | |||
1330 | mci->gpm_idx = gpm_ptr; | 1329 | mci->gpm_idx = gpm_ptr; |
1331 | return gpm_ptr; | 1330 | return gpm_ptr; |
1332 | } | 1331 | } |
@@ -1371,6 +1370,10 @@ u32 ar9003_mci_get_next_gpm_offset(struct ath_hw *ah, bool first, u32 *more) | |||
1371 | more_gpm = MCI_GPM_NOMORE; | 1370 | more_gpm = MCI_GPM_NOMORE; |
1372 | 1371 | ||
1373 | temp_index = mci->gpm_idx; | 1372 | temp_index = mci->gpm_idx; |
1373 | |||
1374 | if (temp_index >= mci->gpm_len) | ||
1375 | temp_index = 0; | ||
1376 | |||
1374 | mci->gpm_idx++; | 1377 | mci->gpm_idx++; |
1375 | 1378 | ||
1376 | if (mci->gpm_idx >= mci->gpm_len) | 1379 | if (mci->gpm_idx >= mci->gpm_len) |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mci.h b/drivers/net/wireless/ath/ath9k/ar9003_mci.h index d33b8e128855..f3bef8d69edd 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_mci.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.h | |||
@@ -190,8 +190,6 @@ enum mci_bt_state { | |||
190 | enum mci_state_type { | 190 | enum mci_state_type { |
191 | MCI_STATE_ENABLE, | 191 | MCI_STATE_ENABLE, |
192 | MCI_STATE_SET_BT_AWAKE, | 192 | MCI_STATE_SET_BT_AWAKE, |
193 | MCI_STATE_SET_BT_CAL_START, | ||
194 | MCI_STATE_SET_BT_CAL, | ||
195 | MCI_STATE_LAST_SCHD_MSG_OFFSET, | 193 | MCI_STATE_LAST_SCHD_MSG_OFFSET, |
196 | MCI_STATE_REMOTE_SLEEP, | 194 | MCI_STATE_REMOTE_SLEEP, |
197 | MCI_STATE_RESET_REQ_WAKE, | 195 | MCI_STATE_RESET_REQ_WAKE, |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c index 2c9f7d7ed4cc..0ed3846f9cbb 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c | |||
@@ -142,6 +142,7 @@ static int ar9003_paprd_setup_single_table(struct ath_hw *ah) | |||
142 | }; | 142 | }; |
143 | int training_power; | 143 | int training_power; |
144 | int i, val; | 144 | int i, val; |
145 | u32 am2pm_mask = ah->paprd_ratemask; | ||
145 | 146 | ||
146 | if (IS_CHAN_2GHZ(ah->curchan)) | 147 | if (IS_CHAN_2GHZ(ah->curchan)) |
147 | training_power = ar9003_get_training_power_2g(ah); | 148 | training_power = ar9003_get_training_power_2g(ah); |
@@ -158,10 +159,13 @@ static int ar9003_paprd_setup_single_table(struct ath_hw *ah) | |||
158 | } | 159 | } |
159 | ah->paprd_training_power = training_power; | 160 | ah->paprd_training_power = training_power; |
160 | 161 | ||
162 | if (AR_SREV_9330(ah)) | ||
163 | am2pm_mask = 0; | ||
164 | |||
161 | REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2AM, AR_PHY_PAPRD_AM2AM_MASK, | 165 | REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2AM, AR_PHY_PAPRD_AM2AM_MASK, |
162 | ah->paprd_ratemask); | 166 | ah->paprd_ratemask); |
163 | REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2PM, AR_PHY_PAPRD_AM2PM_MASK, | 167 | REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2PM, AR_PHY_PAPRD_AM2PM_MASK, |
164 | ah->paprd_ratemask); | 168 | am2pm_mask); |
165 | REG_RMW_FIELD(ah, AR_PHY_PAPRD_HT40, AR_PHY_PAPRD_HT40_MASK, | 169 | REG_RMW_FIELD(ah, AR_PHY_PAPRD_HT40, AR_PHY_PAPRD_HT40_MASK, |
166 | ah->paprd_ratemask_ht40); | 170 | ah->paprd_ratemask_ht40); |
167 | 171 | ||
@@ -782,6 +786,102 @@ int ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain) | |||
782 | } | 786 | } |
783 | EXPORT_SYMBOL(ar9003_paprd_setup_gain_table); | 787 | EXPORT_SYMBOL(ar9003_paprd_setup_gain_table); |
784 | 788 | ||
789 | static bool ar9003_paprd_retrain_pa_in(struct ath_hw *ah, | ||
790 | struct ath9k_hw_cal_data *caldata, | ||
791 | int chain) | ||
792 | { | ||
793 | u32 *pa_in = caldata->pa_table[chain]; | ||
794 | int capdiv_offset, quick_drop_offset; | ||
795 | int capdiv2g, quick_drop; | ||
796 | int count = 0; | ||
797 | int i; | ||
798 | |||
799 | if (!AR_SREV_9485(ah) && !AR_SREV_9330(ah)) | ||
800 | return false; | ||
801 | |||
802 | capdiv2g = REG_READ_FIELD(ah, AR_PHY_65NM_CH0_TXRF3, | ||
803 | AR_PHY_65NM_CH0_TXRF3_CAPDIV2G); | ||
804 | |||
805 | quick_drop = REG_READ_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3, | ||
806 | AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP); | ||
807 | |||
808 | if (quick_drop) | ||
809 | quick_drop -= 0x40; | ||
810 | |||
811 | for (i = 0; i < NUM_BIN + 1; i++) { | ||
812 | if (pa_in[i] == 1400) | ||
813 | count++; | ||
814 | } | ||
815 | |||
816 | if (AR_SREV_9485(ah)) { | ||
817 | if (pa_in[23] < 800) { | ||
818 | capdiv_offset = (int)((1000 - pa_in[23] + 75) / 150); | ||
819 | capdiv2g += capdiv_offset; | ||
820 | if (capdiv2g > 7) { | ||
821 | capdiv2g = 7; | ||
822 | if (pa_in[23] < 600) { | ||
823 | quick_drop++; | ||
824 | if (quick_drop > 0) | ||
825 | quick_drop = 0; | ||
826 | } | ||
827 | } | ||
828 | } else if (pa_in[23] == 1400) { | ||
829 | quick_drop_offset = min_t(int, count / 3, 2); | ||
830 | quick_drop += quick_drop_offset; | ||
831 | capdiv2g += quick_drop_offset / 2; | ||
832 | |||
833 | if (capdiv2g > 7) | ||
834 | capdiv2g = 7; | ||
835 | |||
836 | if (quick_drop > 0) { | ||
837 | quick_drop = 0; | ||
838 | capdiv2g -= quick_drop_offset; | ||
839 | if (capdiv2g < 0) | ||
840 | capdiv2g = 0; | ||
841 | } | ||
842 | } else { | ||
843 | return false; | ||
844 | } | ||
845 | } else if (AR_SREV_9330(ah)) { | ||
846 | if (pa_in[23] < 1000) { | ||
847 | capdiv_offset = (1000 - pa_in[23]) / 100; | ||
848 | capdiv2g += capdiv_offset; | ||
849 | if (capdiv_offset > 3) { | ||
850 | capdiv_offset = 1; | ||
851 | quick_drop--; | ||
852 | } | ||
853 | |||
854 | capdiv2g += capdiv_offset; | ||
855 | if (capdiv2g > 6) | ||
856 | capdiv2g = 6; | ||
857 | if (quick_drop < -4) | ||
858 | quick_drop = -4; | ||
859 | } else if (pa_in[23] == 1400) { | ||
860 | if (count > 3) { | ||
861 | quick_drop++; | ||
862 | capdiv2g -= count / 4; | ||
863 | if (quick_drop > -2) | ||
864 | quick_drop = -2; | ||
865 | } else { | ||
866 | capdiv2g--; | ||
867 | } | ||
868 | |||
869 | if (capdiv2g < 0) | ||
870 | capdiv2g = 0; | ||
871 | } else { | ||
872 | return false; | ||
873 | } | ||
874 | } | ||
875 | |||
876 | REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_TXRF3, | ||
877 | AR_PHY_65NM_CH0_TXRF3_CAPDIV2G, capdiv2g); | ||
878 | REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3, | ||
879 | AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP, | ||
880 | quick_drop); | ||
881 | |||
882 | return true; | ||
883 | } | ||
884 | |||
785 | int ar9003_paprd_create_curve(struct ath_hw *ah, | 885 | int ar9003_paprd_create_curve(struct ath_hw *ah, |
786 | struct ath9k_hw_cal_data *caldata, int chain) | 886 | struct ath9k_hw_cal_data *caldata, int chain) |
787 | { | 887 | { |
@@ -817,6 +917,9 @@ int ar9003_paprd_create_curve(struct ath_hw *ah, | |||
817 | if (!create_pa_curve(data_L, data_U, pa_table, small_signal_gain)) | 917 | if (!create_pa_curve(data_L, data_U, pa_table, small_signal_gain)) |
818 | status = -2; | 918 | status = -2; |
819 | 919 | ||
920 | if (ar9003_paprd_retrain_pa_in(ah, caldata, chain)) | ||
921 | status = -EINPROGRESS; | ||
922 | |||
820 | REG_CLR_BIT(ah, AR_PHY_PAPRD_TRAINER_STAT1, | 923 | REG_CLR_BIT(ah, AR_PHY_PAPRD_TRAINER_STAT1, |
821 | AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE); | 924 | AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE); |
822 | 925 | ||
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c index e476f9f92ce3..0d800c62e227 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c | |||
@@ -88,7 +88,7 @@ static int ar9003_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan) | |||
88 | channelSel = (freq * 4) / div; | 88 | channelSel = (freq * 4) / div; |
89 | chan_frac = (((freq * 4) % div) * 0x20000) / div; | 89 | chan_frac = (((freq * 4) % div) * 0x20000) / div; |
90 | channelSel = (channelSel << 17) | chan_frac; | 90 | channelSel = (channelSel << 17) | chan_frac; |
91 | } else if (AR_SREV_9485(ah)) { | 91 | } else if (AR_SREV_9485(ah) || AR_SREV_9565(ah)) { |
92 | u32 chan_frac; | 92 | u32 chan_frac; |
93 | 93 | ||
94 | /* | 94 | /* |
@@ -206,6 +206,7 @@ static void ar9003_hw_spur_mitigate_mrc_cck(struct ath_hw *ah, | |||
206 | for (i = 0; i < max_spur_cnts; i++) { | 206 | for (i = 0; i < max_spur_cnts; i++) { |
207 | if (AR_SREV_9462(ah) && (i == 0 || i == 3)) | 207 | if (AR_SREV_9462(ah) && (i == 0 || i == 3)) |
208 | continue; | 208 | continue; |
209 | |||
209 | negative = 0; | 210 | negative = 0; |
210 | if (AR_SREV_9485(ah) || AR_SREV_9340(ah) || AR_SREV_9330(ah) || | 211 | if (AR_SREV_9485(ah) || AR_SREV_9340(ah) || AR_SREV_9330(ah) || |
211 | AR_SREV_9550(ah)) | 212 | AR_SREV_9550(ah)) |
@@ -301,7 +302,9 @@ static void ar9003_hw_spur_ofdm(struct ath_hw *ah, | |||
301 | int freq_offset, | 302 | int freq_offset, |
302 | int spur_freq_sd, | 303 | int spur_freq_sd, |
303 | int spur_delta_phase, | 304 | int spur_delta_phase, |
304 | int spur_subchannel_sd) | 305 | int spur_subchannel_sd, |
306 | int range, | ||
307 | int synth_freq) | ||
305 | { | 308 | { |
306 | int mask_index = 0; | 309 | int mask_index = 0; |
307 | 310 | ||
@@ -316,8 +319,11 @@ static void ar9003_hw_spur_ofdm(struct ath_hw *ah, | |||
316 | AR_PHY_SFCORR_EXT_SPUR_SUBCHANNEL_SD, spur_subchannel_sd); | 319 | AR_PHY_SFCORR_EXT_SPUR_SUBCHANNEL_SD, spur_subchannel_sd); |
317 | REG_RMW_FIELD(ah, AR_PHY_TIMING11, | 320 | REG_RMW_FIELD(ah, AR_PHY_TIMING11, |
318 | AR_PHY_TIMING11_USE_SPUR_FILTER_IN_AGC, 0x1); | 321 | AR_PHY_TIMING11_USE_SPUR_FILTER_IN_AGC, 0x1); |
319 | REG_RMW_FIELD(ah, AR_PHY_TIMING11, | 322 | |
320 | AR_PHY_TIMING11_USE_SPUR_FILTER_IN_SELFCOR, 0x1); | 323 | if (!(AR_SREV_9565(ah) && range == 10 && synth_freq == 2437)) |
324 | REG_RMW_FIELD(ah, AR_PHY_TIMING11, | ||
325 | AR_PHY_TIMING11_USE_SPUR_FILTER_IN_SELFCOR, 0x1); | ||
326 | |||
321 | REG_RMW_FIELD(ah, AR_PHY_TIMING4, | 327 | REG_RMW_FIELD(ah, AR_PHY_TIMING4, |
322 | AR_PHY_TIMING4_ENABLE_SPUR_RSSI, 0x1); | 328 | AR_PHY_TIMING4_ENABLE_SPUR_RSSI, 0x1); |
323 | REG_RMW_FIELD(ah, AR_PHY_SPUR_REG, | 329 | REG_RMW_FIELD(ah, AR_PHY_SPUR_REG, |
@@ -358,9 +364,44 @@ static void ar9003_hw_spur_ofdm(struct ath_hw *ah, | |||
358 | AR_PHY_SPUR_REG_MASK_RATE_CNTL, 0xff); | 364 | AR_PHY_SPUR_REG_MASK_RATE_CNTL, 0xff); |
359 | } | 365 | } |
360 | 366 | ||
367 | static void ar9003_hw_spur_ofdm_9565(struct ath_hw *ah, | ||
368 | int freq_offset) | ||
369 | { | ||
370 | int mask_index = 0; | ||
371 | |||
372 | mask_index = (freq_offset << 4) / 5; | ||
373 | if (mask_index < 0) | ||
374 | mask_index = mask_index - 1; | ||
375 | |||
376 | mask_index = mask_index & 0x7f; | ||
377 | |||
378 | REG_RMW_FIELD(ah, AR_PHY_PILOT_SPUR_MASK, | ||
379 | AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_B, | ||
380 | mask_index); | ||
381 | |||
382 | /* A == B */ | ||
383 | REG_RMW_FIELD(ah, AR_PHY_SPUR_MASK_B, | ||
384 | AR_PHY_SPUR_MASK_A_CF_PUNC_MASK_IDX_A, | ||
385 | mask_index); | ||
386 | |||
387 | REG_RMW_FIELD(ah, AR_PHY_CHAN_SPUR_MASK, | ||
388 | AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_B, | ||
389 | mask_index); | ||
390 | REG_RMW_FIELD(ah, AR_PHY_PILOT_SPUR_MASK, | ||
391 | AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_B, 0xe); | ||
392 | REG_RMW_FIELD(ah, AR_PHY_CHAN_SPUR_MASK, | ||
393 | AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_B, 0xe); | ||
394 | |||
395 | /* A == B */ | ||
396 | REG_RMW_FIELD(ah, AR_PHY_SPUR_MASK_B, | ||
397 | AR_PHY_SPUR_MASK_A_CF_PUNC_MASK_A, 0xa0); | ||
398 | } | ||
399 | |||
361 | static void ar9003_hw_spur_ofdm_work(struct ath_hw *ah, | 400 | static void ar9003_hw_spur_ofdm_work(struct ath_hw *ah, |
362 | struct ath9k_channel *chan, | 401 | struct ath9k_channel *chan, |
363 | int freq_offset) | 402 | int freq_offset, |
403 | int range, | ||
404 | int synth_freq) | ||
364 | { | 405 | { |
365 | int spur_freq_sd = 0; | 406 | int spur_freq_sd = 0; |
366 | int spur_subchannel_sd = 0; | 407 | int spur_subchannel_sd = 0; |
@@ -402,7 +443,8 @@ static void ar9003_hw_spur_ofdm_work(struct ath_hw *ah, | |||
402 | freq_offset, | 443 | freq_offset, |
403 | spur_freq_sd, | 444 | spur_freq_sd, |
404 | spur_delta_phase, | 445 | spur_delta_phase, |
405 | spur_subchannel_sd); | 446 | spur_subchannel_sd, |
447 | range, synth_freq); | ||
406 | } | 448 | } |
407 | 449 | ||
408 | /* Spur mitigation for OFDM */ | 450 | /* Spur mitigation for OFDM */ |
@@ -447,7 +489,17 @@ static void ar9003_hw_spur_mitigate_ofdm(struct ath_hw *ah, | |||
447 | freq_offset = ath9k_hw_fbin2freq(spurChansPtr[i], mode); | 489 | freq_offset = ath9k_hw_fbin2freq(spurChansPtr[i], mode); |
448 | freq_offset -= synth_freq; | 490 | freq_offset -= synth_freq; |
449 | if (abs(freq_offset) < range) { | 491 | if (abs(freq_offset) < range) { |
450 | ar9003_hw_spur_ofdm_work(ah, chan, freq_offset); | 492 | ar9003_hw_spur_ofdm_work(ah, chan, freq_offset, |
493 | range, synth_freq); | ||
494 | |||
495 | if (AR_SREV_9565(ah) && (i < 4)) { | ||
496 | freq_offset = ath9k_hw_fbin2freq(spurChansPtr[i + 1], | ||
497 | mode); | ||
498 | freq_offset -= synth_freq; | ||
499 | if (abs(freq_offset) < range) | ||
500 | ar9003_hw_spur_ofdm_9565(ah, freq_offset); | ||
501 | } | ||
502 | |||
451 | break; | 503 | break; |
452 | } | 504 | } |
453 | } | 505 | } |
@@ -456,7 +508,8 @@ static void ar9003_hw_spur_mitigate_ofdm(struct ath_hw *ah, | |||
456 | static void ar9003_hw_spur_mitigate(struct ath_hw *ah, | 508 | static void ar9003_hw_spur_mitigate(struct ath_hw *ah, |
457 | struct ath9k_channel *chan) | 509 | struct ath9k_channel *chan) |
458 | { | 510 | { |
459 | ar9003_hw_spur_mitigate_mrc_cck(ah, chan); | 511 | if (!AR_SREV_9565(ah)) |
512 | ar9003_hw_spur_mitigate_mrc_cck(ah, chan); | ||
460 | ar9003_hw_spur_mitigate_ofdm(ah, chan); | 513 | ar9003_hw_spur_mitigate_ofdm(ah, chan); |
461 | } | 514 | } |
462 | 515 | ||
@@ -736,7 +789,7 @@ static int ar9003_hw_process_ini(struct ath_hw *ah, | |||
736 | if (chan->channel == 2484) | 789 | if (chan->channel == 2484) |
737 | ar9003_hw_prog_ini(ah, &ah->ini_japan2484, 1); | 790 | ar9003_hw_prog_ini(ah, &ah->ini_japan2484, 1); |
738 | 791 | ||
739 | if (AR_SREV_9462(ah)) | 792 | if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) |
740 | REG_WRITE(ah, AR_GLB_SWREG_DISCONT_MODE, | 793 | REG_WRITE(ah, AR_GLB_SWREG_DISCONT_MODE, |
741 | AR_GLB_SWREG_DISCONT_EN_BT_WLAN); | 794 | AR_GLB_SWREG_DISCONT_EN_BT_WLAN); |
742 | 795 | ||
@@ -746,9 +799,9 @@ static int ar9003_hw_process_ini(struct ath_hw *ah, | |||
746 | ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask); | 799 | ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask); |
747 | ath9k_hw_apply_txpower(ah, chan, false); | 800 | ath9k_hw_apply_txpower(ah, chan, false); |
748 | 801 | ||
749 | if (AR_SREV_9462(ah)) { | 802 | if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) { |
750 | if (REG_READ_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_0, | 803 | if (REG_READ_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_0, |
751 | AR_PHY_TX_IQCAL_CONTROL_0_ENABLE_TXIQ_CAL)) | 804 | AR_PHY_TX_IQCAL_CONTROL_0_ENABLE_TXIQ_CAL)) |
752 | ah->enabled_cals |= TX_IQ_CAL; | 805 | ah->enabled_cals |= TX_IQ_CAL; |
753 | else | 806 | else |
754 | ah->enabled_cals &= ~TX_IQ_CAL; | 807 | ah->enabled_cals &= ~TX_IQ_CAL; |
@@ -1111,7 +1164,7 @@ static void ar9003_hw_set_nf_limits(struct ath_hw *ah) | |||
1111 | if (AR_SREV_9330(ah)) | 1164 | if (AR_SREV_9330(ah)) |
1112 | ah->nf_2g.nominal = AR_PHY_CCA_NOM_VAL_9330_2GHZ; | 1165 | ah->nf_2g.nominal = AR_PHY_CCA_NOM_VAL_9330_2GHZ; |
1113 | 1166 | ||
1114 | if (AR_SREV_9462(ah)) { | 1167 | if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) { |
1115 | ah->nf_2g.min = AR_PHY_CCA_MIN_GOOD_VAL_9462_2GHZ; | 1168 | ah->nf_2g.min = AR_PHY_CCA_MIN_GOOD_VAL_9462_2GHZ; |
1116 | ah->nf_2g.nominal = AR_PHY_CCA_NOM_VAL_9462_2GHZ; | 1169 | ah->nf_2g.nominal = AR_PHY_CCA_NOM_VAL_9462_2GHZ; |
1117 | ah->nf_5g.min = AR_PHY_CCA_MIN_GOOD_VAL_9462_5GHZ; | 1170 | ah->nf_5g.min = AR_PHY_CCA_MIN_GOOD_VAL_9462_5GHZ; |
@@ -1223,17 +1276,17 @@ static void ar9003_hw_set_radar_conf(struct ath_hw *ah) | |||
1223 | } | 1276 | } |
1224 | 1277 | ||
1225 | static void ar9003_hw_antdiv_comb_conf_get(struct ath_hw *ah, | 1278 | static void ar9003_hw_antdiv_comb_conf_get(struct ath_hw *ah, |
1226 | struct ath_hw_antcomb_conf *antconf) | 1279 | struct ath_hw_antcomb_conf *antconf) |
1227 | { | 1280 | { |
1228 | u32 regval; | 1281 | u32 regval; |
1229 | 1282 | ||
1230 | regval = REG_READ(ah, AR_PHY_MC_GAIN_CTRL); | 1283 | regval = REG_READ(ah, AR_PHY_MC_GAIN_CTRL); |
1231 | antconf->main_lna_conf = (regval & AR_PHY_9485_ANT_DIV_MAIN_LNACONF) >> | 1284 | antconf->main_lna_conf = (regval & AR_PHY_ANT_DIV_MAIN_LNACONF) >> |
1232 | AR_PHY_9485_ANT_DIV_MAIN_LNACONF_S; | 1285 | AR_PHY_ANT_DIV_MAIN_LNACONF_S; |
1233 | antconf->alt_lna_conf = (regval & AR_PHY_9485_ANT_DIV_ALT_LNACONF) >> | 1286 | antconf->alt_lna_conf = (regval & AR_PHY_ANT_DIV_ALT_LNACONF) >> |
1234 | AR_PHY_9485_ANT_DIV_ALT_LNACONF_S; | 1287 | AR_PHY_ANT_DIV_ALT_LNACONF_S; |
1235 | antconf->fast_div_bias = (regval & AR_PHY_9485_ANT_FAST_DIV_BIAS) >> | 1288 | antconf->fast_div_bias = (regval & AR_PHY_ANT_FAST_DIV_BIAS) >> |
1236 | AR_PHY_9485_ANT_FAST_DIV_BIAS_S; | 1289 | AR_PHY_ANT_FAST_DIV_BIAS_S; |
1237 | 1290 | ||
1238 | if (AR_SREV_9330_11(ah)) { | 1291 | if (AR_SREV_9330_11(ah)) { |
1239 | antconf->lna1_lna2_delta = -9; | 1292 | antconf->lna1_lna2_delta = -9; |
@@ -1253,22 +1306,21 @@ static void ar9003_hw_antdiv_comb_conf_set(struct ath_hw *ah, | |||
1253 | u32 regval; | 1306 | u32 regval; |
1254 | 1307 | ||
1255 | regval = REG_READ(ah, AR_PHY_MC_GAIN_CTRL); | 1308 | regval = REG_READ(ah, AR_PHY_MC_GAIN_CTRL); |
1256 | regval &= ~(AR_PHY_9485_ANT_DIV_MAIN_LNACONF | | 1309 | regval &= ~(AR_PHY_ANT_DIV_MAIN_LNACONF | |
1257 | AR_PHY_9485_ANT_DIV_ALT_LNACONF | | 1310 | AR_PHY_ANT_DIV_ALT_LNACONF | |
1258 | AR_PHY_9485_ANT_FAST_DIV_BIAS | | 1311 | AR_PHY_ANT_FAST_DIV_BIAS | |
1259 | AR_PHY_9485_ANT_DIV_MAIN_GAINTB | | 1312 | AR_PHY_ANT_DIV_MAIN_GAINTB | |
1260 | AR_PHY_9485_ANT_DIV_ALT_GAINTB); | 1313 | AR_PHY_ANT_DIV_ALT_GAINTB); |
1261 | regval |= ((antconf->main_lna_conf << | 1314 | regval |= ((antconf->main_lna_conf << AR_PHY_ANT_DIV_MAIN_LNACONF_S) |
1262 | AR_PHY_9485_ANT_DIV_MAIN_LNACONF_S) | 1315 | & AR_PHY_ANT_DIV_MAIN_LNACONF); |
1263 | & AR_PHY_9485_ANT_DIV_MAIN_LNACONF); | 1316 | regval |= ((antconf->alt_lna_conf << AR_PHY_ANT_DIV_ALT_LNACONF_S) |
1264 | regval |= ((antconf->alt_lna_conf << AR_PHY_9485_ANT_DIV_ALT_LNACONF_S) | 1317 | & AR_PHY_ANT_DIV_ALT_LNACONF); |
1265 | & AR_PHY_9485_ANT_DIV_ALT_LNACONF); | 1318 | regval |= ((antconf->fast_div_bias << AR_PHY_ANT_FAST_DIV_BIAS_S) |
1266 | regval |= ((antconf->fast_div_bias << AR_PHY_9485_ANT_FAST_DIV_BIAS_S) | 1319 | & AR_PHY_ANT_FAST_DIV_BIAS); |
1267 | & AR_PHY_9485_ANT_FAST_DIV_BIAS); | 1320 | regval |= ((antconf->main_gaintb << AR_PHY_ANT_DIV_MAIN_GAINTB_S) |
1268 | regval |= ((antconf->main_gaintb << AR_PHY_9485_ANT_DIV_MAIN_GAINTB_S) | 1321 | & AR_PHY_ANT_DIV_MAIN_GAINTB); |
1269 | & AR_PHY_9485_ANT_DIV_MAIN_GAINTB); | 1322 | regval |= ((antconf->alt_gaintb << AR_PHY_ANT_DIV_ALT_GAINTB_S) |
1270 | regval |= ((antconf->alt_gaintb << AR_PHY_9485_ANT_DIV_ALT_GAINTB_S) | 1323 | & AR_PHY_ANT_DIV_ALT_GAINTB); |
1271 | & AR_PHY_9485_ANT_DIV_ALT_GAINTB); | ||
1272 | 1324 | ||
1273 | REG_WRITE(ah, AR_PHY_MC_GAIN_CTRL, regval); | 1325 | REG_WRITE(ah, AR_PHY_MC_GAIN_CTRL, regval); |
1274 | } | 1326 | } |
@@ -1312,10 +1364,10 @@ static int ar9003_hw_fast_chan_change(struct ath_hw *ah, | |||
1312 | ar9003_hw_prog_ini(ah, &ah->iniMac[ATH_INI_POST], modesIndex); | 1364 | ar9003_hw_prog_ini(ah, &ah->iniMac[ATH_INI_POST], modesIndex); |
1313 | ar9003_hw_prog_ini(ah, &ah->iniBB[ATH_INI_POST], modesIndex); | 1365 | ar9003_hw_prog_ini(ah, &ah->iniBB[ATH_INI_POST], modesIndex); |
1314 | ar9003_hw_prog_ini(ah, &ah->iniRadio[ATH_INI_POST], modesIndex); | 1366 | ar9003_hw_prog_ini(ah, &ah->iniRadio[ATH_INI_POST], modesIndex); |
1367 | |||
1315 | if (AR_SREV_9462_20(ah)) | 1368 | if (AR_SREV_9462_20(ah)) |
1316 | ar9003_hw_prog_ini(ah, | 1369 | ar9003_hw_prog_ini(ah, &ah->ini_radio_post_sys2ant, |
1317 | &ah->ini_radio_post_sys2ant, | 1370 | modesIndex); |
1318 | modesIndex); | ||
1319 | 1371 | ||
1320 | REG_WRITE_ARRAY(&ah->iniModesTxGain, modesIndex, regWrites); | 1372 | REG_WRITE_ARRAY(&ah->iniModesTxGain, modesIndex, regWrites); |
1321 | 1373 | ||
@@ -1326,6 +1378,9 @@ static int ar9003_hw_fast_chan_change(struct ath_hw *ah, | |||
1326 | if (IS_CHAN_A_FAST_CLOCK(ah, chan)) | 1378 | if (IS_CHAN_A_FAST_CLOCK(ah, chan)) |
1327 | REG_WRITE_ARRAY(&ah->iniModesFastClock, modesIndex, regWrites); | 1379 | REG_WRITE_ARRAY(&ah->iniModesFastClock, modesIndex, regWrites); |
1328 | 1380 | ||
1381 | if (AR_SREV_9565(ah)) | ||
1382 | REG_WRITE_ARRAY(&ah->iniModesFastClock, 1, regWrites); | ||
1383 | |||
1329 | REG_WRITE_ARRAY(&ah->iniAdditional, 1, regWrites); | 1384 | REG_WRITE_ARRAY(&ah->iniAdditional, 1, regWrites); |
1330 | 1385 | ||
1331 | ah->modes_index = modesIndex; | 1386 | ah->modes_index = modesIndex; |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.h b/drivers/net/wireless/ath/ath9k/ar9003_phy.h index 7bfbaf065a43..fdabc9a28a96 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h | |||
@@ -223,15 +223,24 @@ | |||
223 | #define AR_PHY_ML_CNTL_2 (AR_MRC_BASE + 0x1c) | 223 | #define AR_PHY_ML_CNTL_2 (AR_MRC_BASE + 0x1c) |
224 | #define AR_PHY_TST_ADC (AR_MRC_BASE + 0x20) | 224 | #define AR_PHY_TST_ADC (AR_MRC_BASE + 0x20) |
225 | 225 | ||
226 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_A 0x00000FE0 | 226 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_A 0x00000FE0 |
227 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_A_S 5 | 227 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_A_S 5 |
228 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_A 0x1F | 228 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_A 0x1F |
229 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_A_S 0 | 229 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_A_S 0 |
230 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_B 0x00FE0000 | ||
231 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_IDX_B_S 17 | ||
232 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_B 0x0001F000 | ||
233 | #define AR_PHY_PILOT_SPUR_MASK_CF_PILOT_MASK_B_S 12 | ||
230 | 234 | ||
231 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_A 0x00000FE0 | 235 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_A 0x00000FE0 |
232 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_A_S 5 | 236 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_A_S 5 |
233 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_A 0x1F | 237 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_A 0x1F |
234 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_A_S 0 | 238 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_A_S 0 |
239 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_B 0x00FE0000 | ||
240 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_IDX_B_S 17 | ||
241 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_B 0x0001F000 | ||
242 | #define AR_PHY_CHAN_SPUR_MASK_CF_CHAN_MASK_B_S 12 | ||
243 | |||
235 | 244 | ||
236 | /* | 245 | /* |
237 | * MRC Feild Definitions | 246 | * MRC Feild Definitions |
@@ -271,23 +280,23 @@ | |||
271 | #define AR_ANT_DIV_ENABLE_S 24 | 280 | #define AR_ANT_DIV_ENABLE_S 24 |
272 | 281 | ||
273 | 282 | ||
274 | #define AR_PHY_9485_ANT_FAST_DIV_BIAS 0x00007e00 | 283 | #define AR_PHY_ANT_FAST_DIV_BIAS 0x00007e00 |
275 | #define AR_PHY_9485_ANT_FAST_DIV_BIAS_S 9 | 284 | #define AR_PHY_ANT_FAST_DIV_BIAS_S 9 |
276 | #define AR_PHY_9485_ANT_DIV_LNADIV 0x01000000 | 285 | #define AR_PHY_ANT_DIV_LNADIV 0x01000000 |
277 | #define AR_PHY_9485_ANT_DIV_LNADIV_S 24 | 286 | #define AR_PHY_ANT_DIV_LNADIV_S 24 |
278 | #define AR_PHY_9485_ANT_DIV_ALT_LNACONF 0x06000000 | 287 | #define AR_PHY_ANT_DIV_ALT_LNACONF 0x06000000 |
279 | #define AR_PHY_9485_ANT_DIV_ALT_LNACONF_S 25 | 288 | #define AR_PHY_ANT_DIV_ALT_LNACONF_S 25 |
280 | #define AR_PHY_9485_ANT_DIV_MAIN_LNACONF 0x18000000 | 289 | #define AR_PHY_ANT_DIV_MAIN_LNACONF 0x18000000 |
281 | #define AR_PHY_9485_ANT_DIV_MAIN_LNACONF_S 27 | 290 | #define AR_PHY_ANT_DIV_MAIN_LNACONF_S 27 |
282 | #define AR_PHY_9485_ANT_DIV_ALT_GAINTB 0x20000000 | 291 | #define AR_PHY_ANT_DIV_ALT_GAINTB 0x20000000 |
283 | #define AR_PHY_9485_ANT_DIV_ALT_GAINTB_S 29 | 292 | #define AR_PHY_ANT_DIV_ALT_GAINTB_S 29 |
284 | #define AR_PHY_9485_ANT_DIV_MAIN_GAINTB 0x40000000 | 293 | #define AR_PHY_ANT_DIV_MAIN_GAINTB 0x40000000 |
285 | #define AR_PHY_9485_ANT_DIV_MAIN_GAINTB_S 30 | 294 | #define AR_PHY_ANT_DIV_MAIN_GAINTB_S 30 |
286 | 295 | ||
287 | #define AR_PHY_9485_ANT_DIV_LNA1_MINUS_LNA2 0x0 | 296 | #define AR_PHY_ANT_DIV_LNA1_MINUS_LNA2 0x0 |
288 | #define AR_PHY_9485_ANT_DIV_LNA2 0x1 | 297 | #define AR_PHY_ANT_DIV_LNA2 0x1 |
289 | #define AR_PHY_9485_ANT_DIV_LNA1 0x2 | 298 | #define AR_PHY_ANT_DIV_LNA1 0x2 |
290 | #define AR_PHY_9485_ANT_DIV_LNA1_PLUS_LNA2 0x3 | 299 | #define AR_PHY_ANT_DIV_LNA1_PLUS_LNA2 0x3 |
291 | 300 | ||
292 | #define AR_PHY_EXTCHN_PWRTHR1 (AR_AGC_BASE + 0x2c) | 301 | #define AR_PHY_EXTCHN_PWRTHR1 (AR_AGC_BASE + 0x2c) |
293 | #define AR_PHY_EXT_CHN_WIN (AR_AGC_BASE + 0x30) | 302 | #define AR_PHY_EXT_CHN_WIN (AR_AGC_BASE + 0x30) |
@@ -609,6 +618,12 @@ | |||
609 | #define AR_PHY_BB_THERM_ADC_1_INIT_THERM 0x000000ff | 618 | #define AR_PHY_BB_THERM_ADC_1_INIT_THERM 0x000000ff |
610 | #define AR_PHY_BB_THERM_ADC_1_INIT_THERM_S 0 | 619 | #define AR_PHY_BB_THERM_ADC_1_INIT_THERM_S 0 |
611 | 620 | ||
621 | #define AR_PHY_BB_THERM_ADC_3 (AR_SM_BASE + 0x250) | ||
622 | #define AR_PHY_BB_THERM_ADC_3_THERM_ADC_SCALE_GAIN 0x0001ff00 | ||
623 | #define AR_PHY_BB_THERM_ADC_3_THERM_ADC_SCALE_GAIN_S 8 | ||
624 | #define AR_PHY_BB_THERM_ADC_3_THERM_ADC_OFFSET 0x000000ff | ||
625 | #define AR_PHY_BB_THERM_ADC_3_THERM_ADC_OFFSET_S 0 | ||
626 | |||
612 | #define AR_PHY_BB_THERM_ADC_4 (AR_SM_BASE + 0x254) | 627 | #define AR_PHY_BB_THERM_ADC_4 (AR_SM_BASE + 0x254) |
613 | #define AR_PHY_BB_THERM_ADC_4_LATEST_THERM_VALUE 0x000000ff | 628 | #define AR_PHY_BB_THERM_ADC_4_LATEST_THERM_VALUE 0x000000ff |
614 | #define AR_PHY_BB_THERM_ADC_4_LATEST_THERM_VALUE_S 0 | 629 | #define AR_PHY_BB_THERM_ADC_4_LATEST_THERM_VALUE_S 0 |
@@ -625,9 +640,13 @@ | |||
625 | #define AR_PHY_AIC_CTRL_4_B0 (AR_SM_BASE + 0x4c0) | 640 | #define AR_PHY_AIC_CTRL_4_B0 (AR_SM_BASE + 0x4c0) |
626 | #define AR_PHY_AIC_STAT_2_B0 (AR_SM_BASE + 0x4cc) | 641 | #define AR_PHY_AIC_STAT_2_B0 (AR_SM_BASE + 0x4cc) |
627 | 642 | ||
643 | #define AR_PHY_65NM_CH0_TXRF3 0x16048 | ||
644 | #define AR_PHY_65NM_CH0_TXRF3_CAPDIV2G 0x0000001e | ||
645 | #define AR_PHY_65NM_CH0_TXRF3_CAPDIV2G_S 1 | ||
646 | |||
628 | #define AR_PHY_65NM_CH0_SYNTH4 0x1608c | 647 | #define AR_PHY_65NM_CH0_SYNTH4 0x1608c |
629 | #define AR_PHY_SYNTH4_LONG_SHIFT_SELECT (AR_SREV_9462(ah) ? 0x00000001 : 0x00000002) | 648 | #define AR_PHY_SYNTH4_LONG_SHIFT_SELECT ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x00000001 : 0x00000002) |
630 | #define AR_PHY_SYNTH4_LONG_SHIFT_SELECT_S (AR_SREV_9462(ah) ? 0 : 1) | 649 | #define AR_PHY_SYNTH4_LONG_SHIFT_SELECT_S ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0 : 1) |
631 | #define AR_PHY_65NM_CH0_SYNTH7 0x16098 | 650 | #define AR_PHY_65NM_CH0_SYNTH7 0x16098 |
632 | #define AR_PHY_65NM_CH0_BIAS1 0x160c0 | 651 | #define AR_PHY_65NM_CH0_BIAS1 0x160c0 |
633 | #define AR_PHY_65NM_CH0_BIAS2 0x160c4 | 652 | #define AR_PHY_65NM_CH0_BIAS2 0x160c4 |
@@ -637,7 +656,7 @@ | |||
637 | #define AR_PHY_65NM_CH2_RXTX4 0x1690c | 656 | #define AR_PHY_65NM_CH2_RXTX4 0x1690c |
638 | 657 | ||
639 | #define AR_CH0_TOP (AR_SREV_9300(ah) ? 0x16288 : \ | 658 | #define AR_CH0_TOP (AR_SREV_9300(ah) ? 0x16288 : \ |
640 | ((AR_SREV_9462(ah) ? 0x1628c : 0x16280))) | 659 | (((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x1628c : 0x16280))) |
641 | #define AR_CH0_TOP_XPABIASLVL (AR_SREV_9550(ah) ? 0x3c0 : 0x300) | 660 | #define AR_CH0_TOP_XPABIASLVL (AR_SREV_9550(ah) ? 0x3c0 : 0x300) |
642 | #define AR_CH0_TOP_XPABIASLVL_S (AR_SREV_9550(ah) ? 6 : 8) | 661 | #define AR_CH0_TOP_XPABIASLVL_S (AR_SREV_9550(ah) ? 6 : 8) |
643 | 662 | ||
@@ -665,7 +684,7 @@ | |||
665 | #define AR_SWITCH_TABLE_ALL_S (0) | 684 | #define AR_SWITCH_TABLE_ALL_S (0) |
666 | 685 | ||
667 | #define AR_PHY_65NM_CH0_THERM (AR_SREV_9300(ah) ? 0x16290 :\ | 686 | #define AR_PHY_65NM_CH0_THERM (AR_SREV_9300(ah) ? 0x16290 :\ |
668 | (AR_SREV_9462(ah) ? 0x16294 : 0x1628c)) | 687 | ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x16294 : 0x1628c)) |
669 | 688 | ||
670 | #define AR_PHY_65NM_CH0_THERM_LOCAL 0x80000000 | 689 | #define AR_PHY_65NM_CH0_THERM_LOCAL 0x80000000 |
671 | #define AR_PHY_65NM_CH0_THERM_LOCAL_S 31 | 690 | #define AR_PHY_65NM_CH0_THERM_LOCAL_S 31 |
@@ -687,17 +706,17 @@ | |||
687 | #define AR_CH0_TOP2_XPABIASLVL_S 12 | 706 | #define AR_CH0_TOP2_XPABIASLVL_S 12 |
688 | 707 | ||
689 | #define AR_CH0_XTAL (AR_SREV_9300(ah) ? 0x16294 : \ | 708 | #define AR_CH0_XTAL (AR_SREV_9300(ah) ? 0x16294 : \ |
690 | (AR_SREV_9462(ah) ? 0x16298 : 0x16290)) | 709 | ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x16298 : 0x16290)) |
691 | #define AR_CH0_XTAL_CAPINDAC 0x7f000000 | 710 | #define AR_CH0_XTAL_CAPINDAC 0x7f000000 |
692 | #define AR_CH0_XTAL_CAPINDAC_S 24 | 711 | #define AR_CH0_XTAL_CAPINDAC_S 24 |
693 | #define AR_CH0_XTAL_CAPOUTDAC 0x00fe0000 | 712 | #define AR_CH0_XTAL_CAPOUTDAC 0x00fe0000 |
694 | #define AR_CH0_XTAL_CAPOUTDAC_S 17 | 713 | #define AR_CH0_XTAL_CAPOUTDAC_S 17 |
695 | 714 | ||
696 | #define AR_PHY_PMU1 (AR_SREV_9462(ah) ? 0x16340 : 0x16c40) | 715 | #define AR_PHY_PMU1 ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x16340 : 0x16c40) |
697 | #define AR_PHY_PMU1_PWD 0x1 | 716 | #define AR_PHY_PMU1_PWD 0x1 |
698 | #define AR_PHY_PMU1_PWD_S 0 | 717 | #define AR_PHY_PMU1_PWD_S 0 |
699 | 718 | ||
700 | #define AR_PHY_PMU2 (AR_SREV_9462(ah) ? 0x16344 : 0x16c44) | 719 | #define AR_PHY_PMU2 ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x16344 : 0x16c44) |
701 | #define AR_PHY_PMU2_PGM 0x00200000 | 720 | #define AR_PHY_PMU2_PGM 0x00200000 |
702 | #define AR_PHY_PMU2_PGM_S 21 | 721 | #define AR_PHY_PMU2_PGM_S 21 |
703 | 722 | ||
@@ -877,6 +896,8 @@ | |||
877 | 896 | ||
878 | #define AR_PHY_65NM_CH0_RXTX4_THERM_ON 0x10000000 | 897 | #define AR_PHY_65NM_CH0_RXTX4_THERM_ON 0x10000000 |
879 | #define AR_PHY_65NM_CH0_RXTX4_THERM_ON_S 28 | 898 | #define AR_PHY_65NM_CH0_RXTX4_THERM_ON_S 28 |
899 | #define AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR 0x20000000 | ||
900 | #define AR_PHY_65NM_CH0_RXTX4_THERM_ON_OVR_S 29 | ||
880 | 901 | ||
881 | #define AR_PHY_65NM_RXTX4_XLNA_BIAS 0xC0000000 | 902 | #define AR_PHY_65NM_RXTX4_XLNA_BIAS 0xC0000000 |
882 | #define AR_PHY_65NM_RXTX4_XLNA_BIAS_S 30 | 903 | #define AR_PHY_65NM_RXTX4_XLNA_BIAS_S 30 |
diff --git a/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h b/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h index 4ef7dcccaa2f..58f30f65c6b6 100644 --- a/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h +++ b/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h | |||
@@ -58,7 +58,7 @@ static const u32 ar9462_2p0_baseband_postamble[][5] = { | |||
58 | {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c}, | 58 | {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c}, |
59 | {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce}, | 59 | {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce}, |
60 | {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021}, | 60 | {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021}, |
61 | {0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c282}, | 61 | {0x00009e3c, 0xcf946222, 0xcf946222, 0xcfd5c782, 0xcfd5c282}, |
62 | {0x00009e44, 0x62321e27, 0x62321e27, 0xfe291e27, 0xfe291e27}, | 62 | {0x00009e44, 0x62321e27, 0x62321e27, 0xfe291e27, 0xfe291e27}, |
63 | {0x00009e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012}, | 63 | {0x00009e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012}, |
64 | {0x00009fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000}, | 64 | {0x00009fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000}, |
diff --git a/drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h b/drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h new file mode 100644 index 000000000000..fa9e0932769c --- /dev/null +++ b/drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h | |||
@@ -0,0 +1,1233 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2010-2011 Atheros Communications Inc. | ||
3 | * Copyright (c) 2011-2012 Qualcomm Atheros Inc. | ||
4 | * | ||
5 | * Permission to use, copy, modify, and/or distribute this software for any | ||
6 | * purpose with or without fee is hereby granted, provided that the above | ||
7 | * copyright notice and this permission notice appear in all copies. | ||
8 | * | ||
9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
16 | */ | ||
17 | |||
18 | #ifndef INITVALS_9565_1P0_H | ||
19 | #define INITVALS_9565_1P0_H | ||
20 | |||
21 | /* AR9565 1.0 */ | ||
22 | |||
23 | static const u32 ar9565_1p0_mac_core[][2] = { | ||
24 | /* Addr allmodes */ | ||
25 | {0x00000008, 0x00000000}, | ||
26 | {0x00000030, 0x000a0085}, | ||
27 | {0x00000034, 0x00000005}, | ||
28 | {0x00000040, 0x00000000}, | ||
29 | {0x00000044, 0x00000000}, | ||
30 | {0x00000048, 0x00000008}, | ||
31 | {0x0000004c, 0x00000010}, | ||
32 | {0x00000050, 0x00000000}, | ||
33 | {0x00001040, 0x002ffc0f}, | ||
34 | {0x00001044, 0x002ffc0f}, | ||
35 | {0x00001048, 0x002ffc0f}, | ||
36 | {0x0000104c, 0x002ffc0f}, | ||
37 | {0x00001050, 0x002ffc0f}, | ||
38 | {0x00001054, 0x002ffc0f}, | ||
39 | {0x00001058, 0x002ffc0f}, | ||
40 | {0x0000105c, 0x002ffc0f}, | ||
41 | {0x00001060, 0x002ffc0f}, | ||
42 | {0x00001064, 0x002ffc0f}, | ||
43 | {0x000010f0, 0x00000100}, | ||
44 | {0x00001270, 0x00000000}, | ||
45 | {0x000012b0, 0x00000000}, | ||
46 | {0x000012f0, 0x00000000}, | ||
47 | {0x0000143c, 0x00000000}, | ||
48 | {0x0000147c, 0x00000000}, | ||
49 | {0x00001810, 0x0f000003}, | ||
50 | {0x00008000, 0x00000000}, | ||
51 | {0x00008004, 0x00000000}, | ||
52 | {0x00008008, 0x00000000}, | ||
53 | {0x0000800c, 0x00000000}, | ||
54 | {0x00008018, 0x00000000}, | ||
55 | {0x00008020, 0x00000000}, | ||
56 | {0x00008038, 0x00000000}, | ||
57 | {0x0000803c, 0x00000000}, | ||
58 | {0x00008040, 0x00000000}, | ||
59 | {0x00008044, 0x00000000}, | ||
60 | {0x00008048, 0x00000000}, | ||
61 | {0x0000804c, 0xffffffff}, | ||
62 | {0x00008050, 0xffffffff}, | ||
63 | {0x00008054, 0x00000000}, | ||
64 | {0x00008058, 0x00000000}, | ||
65 | {0x0000805c, 0x000fc78f}, | ||
66 | {0x00008060, 0x0000000f}, | ||
67 | {0x00008064, 0x00000000}, | ||
68 | {0x00008070, 0x00000310}, | ||
69 | {0x00008074, 0x00000020}, | ||
70 | {0x00008078, 0x00000000}, | ||
71 | {0x0000809c, 0x0000000f}, | ||
72 | {0x000080a0, 0x00000000}, | ||
73 | {0x000080a4, 0x02ff0000}, | ||
74 | {0x000080a8, 0x0e070605}, | ||
75 | {0x000080ac, 0x0000000d}, | ||
76 | {0x000080b0, 0x00000000}, | ||
77 | {0x000080b4, 0x00000000}, | ||
78 | {0x000080b8, 0x00000000}, | ||
79 | {0x000080bc, 0x00000000}, | ||
80 | {0x000080c0, 0x2a800000}, | ||
81 | {0x000080c4, 0x06900168}, | ||
82 | {0x000080c8, 0x13881c20}, | ||
83 | {0x000080cc, 0x01f40000}, | ||
84 | {0x000080d0, 0x00252500}, | ||
85 | {0x000080d4, 0x00b00005}, | ||
86 | {0x000080d8, 0x00400002}, | ||
87 | {0x000080dc, 0x00000000}, | ||
88 | {0x000080e0, 0xffffffff}, | ||
89 | {0x000080e4, 0x0000ffff}, | ||
90 | {0x000080e8, 0x3f3f3f3f}, | ||
91 | {0x000080ec, 0x00000000}, | ||
92 | {0x000080f0, 0x00000000}, | ||
93 | {0x000080f4, 0x00000000}, | ||
94 | {0x000080fc, 0x00020000}, | ||
95 | {0x00008100, 0x00000000}, | ||
96 | {0x00008108, 0x00000052}, | ||
97 | {0x0000810c, 0x00000000}, | ||
98 | {0x00008110, 0x00000000}, | ||
99 | {0x00008114, 0x000007ff}, | ||
100 | {0x00008118, 0x000000aa}, | ||
101 | {0x0000811c, 0x00003210}, | ||
102 | {0x00008124, 0x00000000}, | ||
103 | {0x00008128, 0x00000000}, | ||
104 | {0x0000812c, 0x00000000}, | ||
105 | {0x00008130, 0x00000000}, | ||
106 | {0x00008134, 0x00000000}, | ||
107 | {0x00008138, 0x00000000}, | ||
108 | {0x0000813c, 0x0000ffff}, | ||
109 | {0x00008144, 0xffffffff}, | ||
110 | {0x00008168, 0x00000000}, | ||
111 | {0x0000816c, 0x00000000}, | ||
112 | {0x00008170, 0x18486200}, | ||
113 | {0x00008174, 0x33332210}, | ||
114 | {0x00008178, 0x00000000}, | ||
115 | {0x0000817c, 0x00020000}, | ||
116 | {0x000081c4, 0x33332210}, | ||
117 | {0x000081c8, 0x00000000}, | ||
118 | {0x000081cc, 0x00000000}, | ||
119 | {0x000081d4, 0x00000000}, | ||
120 | {0x000081ec, 0x00000000}, | ||
121 | {0x000081f0, 0x00000000}, | ||
122 | {0x000081f4, 0x00000000}, | ||
123 | {0x000081f8, 0x00000000}, | ||
124 | {0x000081fc, 0x00000000}, | ||
125 | {0x00008240, 0x00100000}, | ||
126 | {0x00008244, 0x0010f424}, | ||
127 | {0x00008248, 0x00000800}, | ||
128 | {0x0000824c, 0x0001e848}, | ||
129 | {0x00008250, 0x00000000}, | ||
130 | {0x00008254, 0x00000000}, | ||
131 | {0x00008258, 0x00000000}, | ||
132 | {0x0000825c, 0x40000000}, | ||
133 | {0x00008260, 0x00080922}, | ||
134 | {0x00008264, 0x9d400010}, | ||
135 | {0x00008268, 0xffffffff}, | ||
136 | {0x0000826c, 0x0000ffff}, | ||
137 | {0x00008270, 0x00000000}, | ||
138 | {0x00008274, 0x40000000}, | ||
139 | {0x00008278, 0x003e4180}, | ||
140 | {0x0000827c, 0x00000004}, | ||
141 | {0x00008284, 0x0000002c}, | ||
142 | {0x00008288, 0x0000002c}, | ||
143 | {0x0000828c, 0x000000ff}, | ||
144 | {0x00008294, 0x00000000}, | ||
145 | {0x00008298, 0x00000000}, | ||
146 | {0x0000829c, 0x00000000}, | ||
147 | {0x00008300, 0x00000140}, | ||
148 | {0x00008314, 0x00000000}, | ||
149 | {0x0000831c, 0x0000010d}, | ||
150 | {0x00008328, 0x00000000}, | ||
151 | {0x0000832c, 0x0000001f}, | ||
152 | {0x00008330, 0x00000302}, | ||
153 | {0x00008334, 0x00000700}, | ||
154 | {0x00008338, 0xffff0000}, | ||
155 | {0x0000833c, 0x02400000}, | ||
156 | {0x00008340, 0x000107ff}, | ||
157 | {0x00008344, 0xaa48105b}, | ||
158 | {0x00008348, 0x008f0000}, | ||
159 | {0x0000835c, 0x00000000}, | ||
160 | {0x00008360, 0xffffffff}, | ||
161 | {0x00008364, 0xffffffff}, | ||
162 | {0x00008368, 0x00000000}, | ||
163 | {0x00008370, 0x00000000}, | ||
164 | {0x00008374, 0x000000ff}, | ||
165 | {0x00008378, 0x00000000}, | ||
166 | {0x0000837c, 0x00000000}, | ||
167 | {0x00008380, 0xffffffff}, | ||
168 | {0x00008384, 0xffffffff}, | ||
169 | {0x00008390, 0xffffffff}, | ||
170 | {0x00008394, 0xffffffff}, | ||
171 | {0x00008398, 0x00000000}, | ||
172 | {0x0000839c, 0x00000000}, | ||
173 | {0x000083a4, 0x0000fa14}, | ||
174 | {0x000083a8, 0x000f0c00}, | ||
175 | {0x000083ac, 0x33332210}, | ||
176 | {0x000083b0, 0x33332210}, | ||
177 | {0x000083b4, 0x33332210}, | ||
178 | {0x000083b8, 0x33332210}, | ||
179 | {0x000083bc, 0x00000000}, | ||
180 | {0x000083c0, 0x00000000}, | ||
181 | {0x000083c4, 0x00000000}, | ||
182 | {0x000083c8, 0x00000000}, | ||
183 | {0x000083cc, 0x00000200}, | ||
184 | {0x000083d0, 0x800301ff}, | ||
185 | }; | ||
186 | |||
187 | static const u32 ar9565_1p0_mac_postamble[][5] = { | ||
188 | /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ | ||
189 | {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160}, | ||
190 | {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c}, | ||
191 | {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38}, | ||
192 | {0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00}, | ||
193 | {0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b}, | ||
194 | {0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810}, | ||
195 | {0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a}, | ||
196 | {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440}, | ||
197 | }; | ||
198 | |||
199 | static const u32 ar9565_1p0_baseband_core[][2] = { | ||
200 | /* Addr allmodes */ | ||
201 | {0x00009800, 0xafe68e30}, | ||
202 | {0x00009804, 0xfd14e000}, | ||
203 | {0x00009808, 0x9c0a8f6b}, | ||
204 | {0x0000980c, 0x04800000}, | ||
205 | {0x00009814, 0x9280c00a}, | ||
206 | {0x00009818, 0x00000000}, | ||
207 | {0x0000981c, 0x00020028}, | ||
208 | {0x00009834, 0x6400a290}, | ||
209 | {0x00009838, 0x0108ecff}, | ||
210 | {0x0000983c, 0x0d000600}, | ||
211 | {0x00009880, 0x201fff00}, | ||
212 | {0x00009884, 0x00001042}, | ||
213 | {0x000098a4, 0x00200400}, | ||
214 | {0x000098b0, 0x32840bbe}, | ||
215 | {0x000098d0, 0x004b6a8e}, | ||
216 | {0x000098d4, 0x00000820}, | ||
217 | {0x000098dc, 0x00000000}, | ||
218 | {0x000098e4, 0x01ffffff}, | ||
219 | {0x000098e8, 0x01ffffff}, | ||
220 | {0x000098ec, 0x01ffffff}, | ||
221 | {0x000098f0, 0x00000000}, | ||
222 | {0x000098f4, 0x00000000}, | ||
223 | {0x00009bf0, 0x80000000}, | ||
224 | {0x00009c04, 0xff55ff55}, | ||
225 | {0x00009c08, 0x0320ff55}, | ||
226 | {0x00009c0c, 0x00000000}, | ||
227 | {0x00009c10, 0x00000000}, | ||
228 | {0x00009c14, 0x00046384}, | ||
229 | {0x00009c18, 0x05b6b440}, | ||
230 | {0x00009c1c, 0x00b6b440}, | ||
231 | {0x00009d00, 0xc080a333}, | ||
232 | {0x00009d04, 0x40206c10}, | ||
233 | {0x00009d08, 0x009c4060}, | ||
234 | {0x00009d0c, 0x1883800a}, | ||
235 | {0x00009d10, 0x01834061}, | ||
236 | {0x00009d14, 0x00c00400}, | ||
237 | {0x00009d18, 0x00000000}, | ||
238 | {0x00009e08, 0x0078230c}, | ||
239 | {0x00009e24, 0x990bb515}, | ||
240 | {0x00009e28, 0x126f0000}, | ||
241 | {0x00009e30, 0x06336f77}, | ||
242 | {0x00009e34, 0x6af6532f}, | ||
243 | {0x00009e38, 0x0cc80c00}, | ||
244 | {0x00009e40, 0x0d261820}, | ||
245 | {0x00009e4c, 0x00001004}, | ||
246 | {0x00009e50, 0x00ff03f1}, | ||
247 | {0x00009e54, 0xe4c355c7}, | ||
248 | {0x00009e5c, 0xe9198724}, | ||
249 | {0x00009fc0, 0x823e4788}, | ||
250 | {0x00009fc4, 0x0001efb5}, | ||
251 | {0x00009fcc, 0x40000014}, | ||
252 | {0x0000a20c, 0x00000000}, | ||
253 | {0x0000a220, 0x00000000}, | ||
254 | {0x0000a224, 0x00000000}, | ||
255 | {0x0000a228, 0x10002310}, | ||
256 | {0x0000a23c, 0x00000000}, | ||
257 | {0x0000a244, 0x0c000000}, | ||
258 | {0x0000a2a0, 0x00000001}, | ||
259 | {0x0000a2c0, 0x00000001}, | ||
260 | {0x0000a2c8, 0x00000000}, | ||
261 | {0x0000a2cc, 0x18c43433}, | ||
262 | {0x0000a2d4, 0x00000000}, | ||
263 | {0x0000a2ec, 0x00000000}, | ||
264 | {0x0000a2f0, 0x00000000}, | ||
265 | {0x0000a2f4, 0x00000000}, | ||
266 | {0x0000a2f8, 0x00000000}, | ||
267 | {0x0000a344, 0x00000000}, | ||
268 | {0x0000a34c, 0x00000000}, | ||
269 | {0x0000a350, 0x0000a000}, | ||
270 | {0x0000a364, 0x00000000}, | ||
271 | {0x0000a370, 0x00000000}, | ||
272 | {0x0000a390, 0x00000001}, | ||
273 | {0x0000a394, 0x00000444}, | ||
274 | {0x0000a398, 0x001f0e0f}, | ||
275 | {0x0000a39c, 0x0075393f}, | ||
276 | {0x0000a3a0, 0xb79f6427}, | ||
277 | {0x0000a3a4, 0x00000000}, | ||
278 | {0x0000a3a8, 0xaaaaaaaa}, | ||
279 | {0x0000a3ac, 0x3c466478}, | ||
280 | {0x0000a3c0, 0x20202020}, | ||
281 | {0x0000a3c4, 0x22222220}, | ||
282 | {0x0000a3c8, 0x20200020}, | ||
283 | {0x0000a3cc, 0x20202020}, | ||
284 | {0x0000a3d0, 0x20202020}, | ||
285 | {0x0000a3d4, 0x20202020}, | ||
286 | {0x0000a3d8, 0x20202020}, | ||
287 | {0x0000a3dc, 0x20202020}, | ||
288 | {0x0000a3e0, 0x20202020}, | ||
289 | {0x0000a3e4, 0x20202020}, | ||
290 | {0x0000a3e8, 0x20202020}, | ||
291 | {0x0000a3ec, 0x20202020}, | ||
292 | {0x0000a3f0, 0x00000000}, | ||
293 | {0x0000a3f4, 0x00000006}, | ||
294 | {0x0000a3f8, 0x0cdbd380}, | ||
295 | {0x0000a3fc, 0x000f0f01}, | ||
296 | {0x0000a400, 0x8fa91f01}, | ||
297 | {0x0000a404, 0x00000000}, | ||
298 | {0x0000a408, 0x0e79e5c6}, | ||
299 | {0x0000a40c, 0x00820820}, | ||
300 | {0x0000a414, 0x1ce739ce}, | ||
301 | {0x0000a418, 0x2d001dce}, | ||
302 | {0x0000a41c, 0x1ce739ce}, | ||
303 | {0x0000a420, 0x000001ce}, | ||
304 | {0x0000a424, 0x1ce739ce}, | ||
305 | {0x0000a428, 0x000001ce}, | ||
306 | {0x0000a42c, 0x1ce739ce}, | ||
307 | {0x0000a430, 0x1ce739ce}, | ||
308 | {0x0000a434, 0x00000000}, | ||
309 | {0x0000a438, 0x00001801}, | ||
310 | {0x0000a43c, 0x00000000}, | ||
311 | {0x0000a440, 0x00000000}, | ||
312 | {0x0000a444, 0x00000000}, | ||
313 | {0x0000a448, 0x05000096}, | ||
314 | {0x0000a44c, 0x00000001}, | ||
315 | {0x0000a450, 0x00010000}, | ||
316 | {0x0000a454, 0x03000000}, | ||
317 | {0x0000a458, 0x00000000}, | ||
318 | {0x0000a644, 0xbfad9d74}, | ||
319 | {0x0000a648, 0x0048060a}, | ||
320 | {0x0000a64c, 0x00003c37}, | ||
321 | {0x0000a670, 0x03020100}, | ||
322 | {0x0000a674, 0x09080504}, | ||
323 | {0x0000a678, 0x0d0c0b0a}, | ||
324 | {0x0000a67c, 0x13121110}, | ||
325 | {0x0000a680, 0x31301514}, | ||
326 | {0x0000a684, 0x35343332}, | ||
327 | {0x0000a688, 0x00000036}, | ||
328 | {0x0000a690, 0x00000838}, | ||
329 | {0x0000a6b4, 0x00512c01}, | ||
330 | {0x0000a7c0, 0x00000000}, | ||
331 | {0x0000a7c4, 0xfffffffc}, | ||
332 | {0x0000a7c8, 0x00000000}, | ||
333 | {0x0000a7cc, 0x00000000}, | ||
334 | {0x0000a7d0, 0x00000000}, | ||
335 | {0x0000a7d4, 0x00000004}, | ||
336 | {0x0000a7dc, 0x00000001}, | ||
337 | {0x0000a7f0, 0x80000000}, | ||
338 | }; | ||
339 | |||
340 | static const u32 ar9565_1p0_baseband_postamble[][5] = { | ||
341 | /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ | ||
342 | {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8005, 0xd00a800d}, | ||
343 | {0x00009820, 0x206a022e, 0x206a022e, 0x206a012e, 0x206a01ae}, | ||
344 | {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x63c640da}, | ||
345 | {0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x09143c81}, | ||
346 | {0x0000982c, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4}, | ||
347 | {0x00009830, 0x0000059c, 0x0000059c, 0x0000059c, 0x0000059c}, | ||
348 | {0x00009c00, 0x000000c4, 0x000000c4, 0x000000c4, 0x000000c4}, | ||
349 | {0x00009e00, 0x0372111a, 0x0372111a, 0x037216a0, 0x037216a0}, | ||
350 | {0x00009e04, 0x00802020, 0x00802020, 0x00802020, 0x00802020}, | ||
351 | {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000d8}, | ||
352 | {0x00009e10, 0x7ec88d2e, 0x7ec88d2e, 0x7ec84d2e, 0x7ec86d2e}, | ||
353 | {0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3379605e, 0x33795d5e}, | ||
354 | {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
355 | {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c}, | ||
356 | {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce}, | ||
357 | {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021}, | ||
358 | {0x00009e3c, 0xcf946220, 0xcf946220, 0xcf946222, 0xcf946222}, | ||
359 | {0x00009e44, 0xfe321e27, 0xfe321e27, 0xfe291e27, 0xfe291e27}, | ||
360 | {0x00009e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012}, | ||
361 | {0x00009fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000}, | ||
362 | {0x0000a204, 0x033187c0, 0x033187c4, 0x033187c4, 0x033187c0}, | ||
363 | {0x0000a208, 0x00000104, 0x00000104, 0x00000004, 0x00000004}, | ||
364 | {0x0000a22c, 0x01026a2f, 0x01026a27, 0x01026a2f, 0x01026a2f}, | ||
365 | {0x0000a230, 0x0000400a, 0x00004014, 0x00004016, 0x0000400b}, | ||
366 | {0x0000a234, 0x00000fff, 0x10000fff, 0x10000fff, 0x00000fff}, | ||
367 | {0x0000a238, 0xffb81018, 0xffb81018, 0xffb81018, 0xffb81018}, | ||
368 | {0x0000a250, 0x00000000, 0x00000000, 0x00000210, 0x00000108}, | ||
369 | {0x0000a254, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898}, | ||
370 | {0x0000a258, 0x02020002, 0x02020002, 0x02020002, 0x02020002}, | ||
371 | {0x0000a25c, 0x01000e0e, 0x01000e0e, 0x01000e0e, 0x01000e0e}, | ||
372 | {0x0000a260, 0x0a021501, 0x0a021501, 0x3a021501, 0x3a021501}, | ||
373 | {0x0000a264, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e}, | ||
374 | {0x0000a280, 0x00000007, 0x00000007, 0x0000000b, 0x0000000b}, | ||
375 | {0x0000a284, 0x00000000, 0x00000000, 0x00000150, 0x00000150}, | ||
376 | {0x0000a288, 0x00100510, 0x00100510, 0x00100510, 0x00100510}, | ||
377 | {0x0000a28c, 0x00021551, 0x00021551, 0x00021551, 0x00021551}, | ||
378 | {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18}, | ||
379 | {0x0000a2d0, 0x00071982, 0x00071982, 0x00071982, 0x00071982}, | ||
380 | {0x0000a2d8, 0x7999a83a, 0x7999a83a, 0x7999a83a, 0x7999a83a}, | ||
381 | {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
382 | {0x0000ae04, 0x00800000, 0x00800000, 0x00800000, 0x00800000}, | ||
383 | {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
384 | }; | ||
385 | |||
386 | static const u32 ar9565_1p0_radio_core[][2] = { | ||
387 | /* Addr allmodes */ | ||
388 | {0x00016000, 0x36db6db6}, | ||
389 | {0x00016004, 0x6db6db40}, | ||
390 | {0x00016008, 0x73f00000}, | ||
391 | {0x0001600c, 0x00000000}, | ||
392 | {0x00016010, 0x6d823601}, | ||
393 | {0x00016040, 0x7f80fff8}, | ||
394 | {0x0001604c, 0x1c99e04f}, | ||
395 | {0x00016050, 0x6db6db6c}, | ||
396 | {0x00016058, 0x6c200000}, | ||
397 | {0x00016080, 0x000c0000}, | ||
398 | {0x00016084, 0x9a68048c}, | ||
399 | {0x00016088, 0x54214514}, | ||
400 | {0x0001608c, 0x1203040b}, | ||
401 | {0x00016090, 0x24926490}, | ||
402 | {0x00016098, 0xd28b3330}, | ||
403 | {0x000160a0, 0x0a108ffe}, | ||
404 | {0x000160a4, 0x812fc491}, | ||
405 | {0x000160a8, 0x423c8000}, | ||
406 | {0x000160b4, 0x92000000}, | ||
407 | {0x000160b8, 0x0285dddc}, | ||
408 | {0x000160bc, 0x02908888}, | ||
409 | {0x000160c0, 0x006db6d0}, | ||
410 | {0x000160c4, 0x6dd6db60}, | ||
411 | {0x000160c8, 0x6db6db6c}, | ||
412 | {0x000160cc, 0x6de6c1b0}, | ||
413 | {0x00016100, 0x3fffbe04}, | ||
414 | {0x00016104, 0xfff80000}, | ||
415 | {0x00016108, 0x00200400}, | ||
416 | {0x00016110, 0x00000000}, | ||
417 | {0x00016144, 0x02084080}, | ||
418 | {0x00016148, 0x000080c0}, | ||
419 | {0x00016280, 0x050a0001}, | ||
420 | {0x00016284, 0x3d841400}, | ||
421 | {0x00016288, 0x00000000}, | ||
422 | {0x0001628c, 0xe3000000}, | ||
423 | {0x00016290, 0xa1004080}, | ||
424 | {0x00016294, 0x40000028}, | ||
425 | {0x00016298, 0x55aa2900}, | ||
426 | {0x00016340, 0x131c827a}, | ||
427 | {0x00016344, 0x00300000}, | ||
428 | }; | ||
429 | |||
430 | static const u32 ar9565_1p0_radio_postamble[][5] = { | ||
431 | /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ | ||
432 | {0x0001609c, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524, 0x0b8ee524}, | ||
433 | {0x000160ac, 0xa4646c08, 0xa4646c08, 0xa4646c08, 0xa4646c08}, | ||
434 | {0x000160b0, 0x01d67f70, 0x01d67f70, 0x01d67f70, 0x01d67f70}, | ||
435 | {0x0001610c, 0x40000000, 0x40000000, 0x40000000, 0x40000000}, | ||
436 | {0x00016140, 0x10804008, 0x10804008, 0x50804008, 0x50804008}, | ||
437 | }; | ||
438 | |||
439 | static const u32 ar9565_1p0_soc_preamble[][2] = { | ||
440 | /* Addr allmodes */ | ||
441 | {0x00004078, 0x00000002}, | ||
442 | {0x000040a4, 0x00a0c9c9}, | ||
443 | {0x00007020, 0x00000000}, | ||
444 | {0x00007034, 0x00000002}, | ||
445 | {0x00007038, 0x000004c2}, | ||
446 | }; | ||
447 | |||
448 | static const u32 ar9565_1p0_soc_postamble[][5] = { | ||
449 | /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ | ||
450 | {0x00007010, 0x00002233, 0x00002233, 0x00002233, 0x00002233}, | ||
451 | }; | ||
452 | |||
453 | static const u32 ar9565_1p0_Common_rx_gain_table[][2] = { | ||
454 | /* Addr allmodes */ | ||
455 | {0x0000a000, 0x00010000}, | ||
456 | {0x0000a004, 0x00030002}, | ||
457 | {0x0000a008, 0x00050004}, | ||
458 | {0x0000a00c, 0x00810080}, | ||
459 | {0x0000a010, 0x00830082}, | ||
460 | {0x0000a014, 0x01810180}, | ||
461 | {0x0000a018, 0x01830182}, | ||
462 | {0x0000a01c, 0x01850184}, | ||
463 | {0x0000a020, 0x01890188}, | ||
464 | {0x0000a024, 0x018b018a}, | ||
465 | {0x0000a028, 0x018d018c}, | ||
466 | {0x0000a02c, 0x01910190}, | ||
467 | {0x0000a030, 0x01930192}, | ||
468 | {0x0000a034, 0x01950194}, | ||
469 | {0x0000a038, 0x038a0196}, | ||
470 | {0x0000a03c, 0x038c038b}, | ||
471 | {0x0000a040, 0x0390038d}, | ||
472 | {0x0000a044, 0x03920391}, | ||
473 | {0x0000a048, 0x03940393}, | ||
474 | {0x0000a04c, 0x03960395}, | ||
475 | {0x0000a050, 0x00000000}, | ||
476 | {0x0000a054, 0x00000000}, | ||
477 | {0x0000a058, 0x00000000}, | ||
478 | {0x0000a05c, 0x00000000}, | ||
479 | {0x0000a060, 0x00000000}, | ||
480 | {0x0000a064, 0x00000000}, | ||
481 | {0x0000a068, 0x00000000}, | ||
482 | {0x0000a06c, 0x00000000}, | ||
483 | {0x0000a070, 0x00000000}, | ||
484 | {0x0000a074, 0x00000000}, | ||
485 | {0x0000a078, 0x00000000}, | ||
486 | {0x0000a07c, 0x00000000}, | ||
487 | {0x0000a080, 0x22222229}, | ||
488 | {0x0000a084, 0x1d1d1d1d}, | ||
489 | {0x0000a088, 0x1d1d1d1d}, | ||
490 | {0x0000a08c, 0x1d1d1d1d}, | ||
491 | {0x0000a090, 0x171d1d1d}, | ||
492 | {0x0000a094, 0x11111717}, | ||
493 | {0x0000a098, 0x00030311}, | ||
494 | {0x0000a09c, 0x00000000}, | ||
495 | {0x0000a0a0, 0x00000000}, | ||
496 | {0x0000a0a4, 0x00000000}, | ||
497 | {0x0000a0a8, 0x00000000}, | ||
498 | {0x0000a0ac, 0x00000000}, | ||
499 | {0x0000a0b0, 0x00000000}, | ||
500 | {0x0000a0b4, 0x00000000}, | ||
501 | {0x0000a0b8, 0x00000000}, | ||
502 | {0x0000a0bc, 0x00000000}, | ||
503 | {0x0000a0c0, 0x001f0000}, | ||
504 | {0x0000a0c4, 0x01000101}, | ||
505 | {0x0000a0c8, 0x011e011f}, | ||
506 | {0x0000a0cc, 0x011c011d}, | ||
507 | {0x0000a0d0, 0x02030204}, | ||
508 | {0x0000a0d4, 0x02010202}, | ||
509 | {0x0000a0d8, 0x021f0200}, | ||
510 | {0x0000a0dc, 0x0302021e}, | ||
511 | {0x0000a0e0, 0x03000301}, | ||
512 | {0x0000a0e4, 0x031e031f}, | ||
513 | {0x0000a0e8, 0x0402031d}, | ||
514 | {0x0000a0ec, 0x04000401}, | ||
515 | {0x0000a0f0, 0x041e041f}, | ||
516 | {0x0000a0f4, 0x0502041d}, | ||
517 | {0x0000a0f8, 0x05000501}, | ||
518 | {0x0000a0fc, 0x051e051f}, | ||
519 | {0x0000a100, 0x06010602}, | ||
520 | {0x0000a104, 0x061f0600}, | ||
521 | {0x0000a108, 0x061d061e}, | ||
522 | {0x0000a10c, 0x07020703}, | ||
523 | {0x0000a110, 0x07000701}, | ||
524 | {0x0000a114, 0x00000000}, | ||
525 | {0x0000a118, 0x00000000}, | ||
526 | {0x0000a11c, 0x00000000}, | ||
527 | {0x0000a120, 0x00000000}, | ||
528 | {0x0000a124, 0x00000000}, | ||
529 | {0x0000a128, 0x00000000}, | ||
530 | {0x0000a12c, 0x00000000}, | ||
531 | {0x0000a130, 0x00000000}, | ||
532 | {0x0000a134, 0x00000000}, | ||
533 | {0x0000a138, 0x00000000}, | ||
534 | {0x0000a13c, 0x00000000}, | ||
535 | {0x0000a140, 0x001f0000}, | ||
536 | {0x0000a144, 0x01000101}, | ||
537 | {0x0000a148, 0x011e011f}, | ||
538 | {0x0000a14c, 0x011c011d}, | ||
539 | {0x0000a150, 0x02030204}, | ||
540 | {0x0000a154, 0x02010202}, | ||
541 | {0x0000a158, 0x021f0200}, | ||
542 | {0x0000a15c, 0x0302021e}, | ||
543 | {0x0000a160, 0x03000301}, | ||
544 | {0x0000a164, 0x031e031f}, | ||
545 | {0x0000a168, 0x0402031d}, | ||
546 | {0x0000a16c, 0x04000401}, | ||
547 | {0x0000a170, 0x041e041f}, | ||
548 | {0x0000a174, 0x0502041d}, | ||
549 | {0x0000a178, 0x05000501}, | ||
550 | {0x0000a17c, 0x051e051f}, | ||
551 | {0x0000a180, 0x06010602}, | ||
552 | {0x0000a184, 0x061f0600}, | ||
553 | {0x0000a188, 0x061d061e}, | ||
554 | {0x0000a18c, 0x07020703}, | ||
555 | {0x0000a190, 0x07000701}, | ||
556 | {0x0000a194, 0x00000000}, | ||
557 | {0x0000a198, 0x00000000}, | ||
558 | {0x0000a19c, 0x00000000}, | ||
559 | {0x0000a1a0, 0x00000000}, | ||
560 | {0x0000a1a4, 0x00000000}, | ||
561 | {0x0000a1a8, 0x00000000}, | ||
562 | {0x0000a1ac, 0x00000000}, | ||
563 | {0x0000a1b0, 0x00000000}, | ||
564 | {0x0000a1b4, 0x00000000}, | ||
565 | {0x0000a1b8, 0x00000000}, | ||
566 | {0x0000a1bc, 0x00000000}, | ||
567 | {0x0000a1c0, 0x00000000}, | ||
568 | {0x0000a1c4, 0x00000000}, | ||
569 | {0x0000a1c8, 0x00000000}, | ||
570 | {0x0000a1cc, 0x00000000}, | ||
571 | {0x0000a1d0, 0x00000000}, | ||
572 | {0x0000a1d4, 0x00000000}, | ||
573 | {0x0000a1d8, 0x00000000}, | ||
574 | {0x0000a1dc, 0x00000000}, | ||
575 | {0x0000a1e0, 0x00000000}, | ||
576 | {0x0000a1e4, 0x00000000}, | ||
577 | {0x0000a1e8, 0x00000000}, | ||
578 | {0x0000a1ec, 0x00000000}, | ||
579 | {0x0000a1f0, 0x00000396}, | ||
580 | {0x0000a1f4, 0x00000396}, | ||
581 | {0x0000a1f8, 0x00000396}, | ||
582 | {0x0000a1fc, 0x00000196}, | ||
583 | {0x0000b000, 0x00010000}, | ||
584 | {0x0000b004, 0x00030002}, | ||
585 | {0x0000b008, 0x00050004}, | ||
586 | {0x0000b00c, 0x00810080}, | ||
587 | {0x0000b010, 0x00830082}, | ||
588 | {0x0000b014, 0x01810180}, | ||
589 | {0x0000b018, 0x01830182}, | ||
590 | {0x0000b01c, 0x01850184}, | ||
591 | {0x0000b020, 0x02810280}, | ||
592 | {0x0000b024, 0x02830282}, | ||
593 | {0x0000b028, 0x02850284}, | ||
594 | {0x0000b02c, 0x02890288}, | ||
595 | {0x0000b030, 0x028b028a}, | ||
596 | {0x0000b034, 0x0388028c}, | ||
597 | {0x0000b038, 0x038a0389}, | ||
598 | {0x0000b03c, 0x038c038b}, | ||
599 | {0x0000b040, 0x0390038d}, | ||
600 | {0x0000b044, 0x03920391}, | ||
601 | {0x0000b048, 0x03940393}, | ||
602 | {0x0000b04c, 0x03960395}, | ||
603 | {0x0000b050, 0x00000000}, | ||
604 | {0x0000b054, 0x00000000}, | ||
605 | {0x0000b058, 0x00000000}, | ||
606 | {0x0000b05c, 0x00000000}, | ||
607 | {0x0000b060, 0x00000000}, | ||
608 | {0x0000b064, 0x00000000}, | ||
609 | {0x0000b068, 0x00000000}, | ||
610 | {0x0000b06c, 0x00000000}, | ||
611 | {0x0000b070, 0x00000000}, | ||
612 | {0x0000b074, 0x00000000}, | ||
613 | {0x0000b078, 0x00000000}, | ||
614 | {0x0000b07c, 0x00000000}, | ||
615 | {0x0000b080, 0x32323232}, | ||
616 | {0x0000b084, 0x2f2f3232}, | ||
617 | {0x0000b088, 0x23282a2d}, | ||
618 | {0x0000b08c, 0x1c1e2123}, | ||
619 | {0x0000b090, 0x14171919}, | ||
620 | {0x0000b094, 0x0e0e1214}, | ||
621 | {0x0000b098, 0x03050707}, | ||
622 | {0x0000b09c, 0x00030303}, | ||
623 | {0x0000b0a0, 0x00000000}, | ||
624 | {0x0000b0a4, 0x00000000}, | ||
625 | {0x0000b0a8, 0x00000000}, | ||
626 | {0x0000b0ac, 0x00000000}, | ||
627 | {0x0000b0b0, 0x00000000}, | ||
628 | {0x0000b0b4, 0x00000000}, | ||
629 | {0x0000b0b8, 0x00000000}, | ||
630 | {0x0000b0bc, 0x00000000}, | ||
631 | {0x0000b0c0, 0x003f0020}, | ||
632 | {0x0000b0c4, 0x00400041}, | ||
633 | {0x0000b0c8, 0x0140005f}, | ||
634 | {0x0000b0cc, 0x0160015f}, | ||
635 | {0x0000b0d0, 0x017e017f}, | ||
636 | {0x0000b0d4, 0x02410242}, | ||
637 | {0x0000b0d8, 0x025f0240}, | ||
638 | {0x0000b0dc, 0x027f0260}, | ||
639 | {0x0000b0e0, 0x0341027e}, | ||
640 | {0x0000b0e4, 0x035f0340}, | ||
641 | {0x0000b0e8, 0x037f0360}, | ||
642 | {0x0000b0ec, 0x04400441}, | ||
643 | {0x0000b0f0, 0x0460045f}, | ||
644 | {0x0000b0f4, 0x0541047f}, | ||
645 | {0x0000b0f8, 0x055f0540}, | ||
646 | {0x0000b0fc, 0x057f0560}, | ||
647 | {0x0000b100, 0x06400641}, | ||
648 | {0x0000b104, 0x0660065f}, | ||
649 | {0x0000b108, 0x067e067f}, | ||
650 | {0x0000b10c, 0x07410742}, | ||
651 | {0x0000b110, 0x075f0740}, | ||
652 | {0x0000b114, 0x077f0760}, | ||
653 | {0x0000b118, 0x07800781}, | ||
654 | {0x0000b11c, 0x07a0079f}, | ||
655 | {0x0000b120, 0x07c107bf}, | ||
656 | {0x0000b124, 0x000007c0}, | ||
657 | {0x0000b128, 0x00000000}, | ||
658 | {0x0000b12c, 0x00000000}, | ||
659 | {0x0000b130, 0x00000000}, | ||
660 | {0x0000b134, 0x00000000}, | ||
661 | {0x0000b138, 0x00000000}, | ||
662 | {0x0000b13c, 0x00000000}, | ||
663 | {0x0000b140, 0x003f0020}, | ||
664 | {0x0000b144, 0x00400041}, | ||
665 | {0x0000b148, 0x0140005f}, | ||
666 | {0x0000b14c, 0x0160015f}, | ||
667 | {0x0000b150, 0x017e017f}, | ||
668 | {0x0000b154, 0x02410242}, | ||
669 | {0x0000b158, 0x025f0240}, | ||
670 | {0x0000b15c, 0x027f0260}, | ||
671 | {0x0000b160, 0x0341027e}, | ||
672 | {0x0000b164, 0x035f0340}, | ||
673 | {0x0000b168, 0x037f0360}, | ||
674 | {0x0000b16c, 0x04400441}, | ||
675 | {0x0000b170, 0x0460045f}, | ||
676 | {0x0000b174, 0x0541047f}, | ||
677 | {0x0000b178, 0x055f0540}, | ||
678 | {0x0000b17c, 0x057f0560}, | ||
679 | {0x0000b180, 0x06400641}, | ||
680 | {0x0000b184, 0x0660065f}, | ||
681 | {0x0000b188, 0x067e067f}, | ||
682 | {0x0000b18c, 0x07410742}, | ||
683 | {0x0000b190, 0x075f0740}, | ||
684 | {0x0000b194, 0x077f0760}, | ||
685 | {0x0000b198, 0x07800781}, | ||
686 | {0x0000b19c, 0x07a0079f}, | ||
687 | {0x0000b1a0, 0x07c107bf}, | ||
688 | {0x0000b1a4, 0x000007c0}, | ||
689 | {0x0000b1a8, 0x00000000}, | ||
690 | {0x0000b1ac, 0x00000000}, | ||
691 | {0x0000b1b0, 0x00000000}, | ||
692 | {0x0000b1b4, 0x00000000}, | ||
693 | {0x0000b1b8, 0x00000000}, | ||
694 | {0x0000b1bc, 0x00000000}, | ||
695 | {0x0000b1c0, 0x00000000}, | ||
696 | {0x0000b1c4, 0x00000000}, | ||
697 | {0x0000b1c8, 0x00000000}, | ||
698 | {0x0000b1cc, 0x00000000}, | ||
699 | {0x0000b1d0, 0x00000000}, | ||
700 | {0x0000b1d4, 0x00000000}, | ||
701 | {0x0000b1d8, 0x00000000}, | ||
702 | {0x0000b1dc, 0x00000000}, | ||
703 | {0x0000b1e0, 0x00000000}, | ||
704 | {0x0000b1e4, 0x00000000}, | ||
705 | {0x0000b1e8, 0x00000000}, | ||
706 | {0x0000b1ec, 0x00000000}, | ||
707 | {0x0000b1f0, 0x00000396}, | ||
708 | {0x0000b1f4, 0x00000396}, | ||
709 | {0x0000b1f8, 0x00000396}, | ||
710 | {0x0000b1fc, 0x00000196}, | ||
711 | }; | ||
712 | |||
713 | static const u32 ar9565_1p0_Modes_lowest_ob_db_tx_gain_table[][5] = { | ||
714 | /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ | ||
715 | {0x0000a2dc, 0xfc0a9380, 0xfc0a9380, 0xfdab5b52, 0xfdab5b52}, | ||
716 | {0x0000a2e0, 0xffecec00, 0xffecec00, 0xfd339c84, 0xfd339c84}, | ||
717 | {0x0000a2e4, 0xfc0f0000, 0xfc0f0000, 0xfec3e000, 0xfec3e000}, | ||
718 | {0x0000a2e8, 0xfc100000, 0xfc100000, 0xfffc0000, 0xfffc0000}, | ||
719 | {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9}, | ||
720 | {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
721 | {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002}, | ||
722 | {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004}, | ||
723 | {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200}, | ||
724 | {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202}, | ||
725 | {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400}, | ||
726 | {0x0000a518, 0x21020220, 0x21020220, 0x16000402, 0x16000402}, | ||
727 | {0x0000a51c, 0x27020223, 0x27020223, 0x19000404, 0x19000404}, | ||
728 | {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603}, | ||
729 | {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02}, | ||
730 | {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04}, | ||
731 | {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20}, | ||
732 | {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20}, | ||
733 | {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22}, | ||
734 | {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24}, | ||
735 | {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640}, | ||
736 | {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660}, | ||
737 | {0x0000a544, 0x5302266c, 0x5302266c, 0x3f001861, 0x3f001861}, | ||
738 | {0x0000a548, 0x5702286c, 0x5702286c, 0x43001a81, 0x43001a81}, | ||
739 | {0x0000a54c, 0x5c04286b, 0x5c04286b, 0x47001a83, 0x47001a83}, | ||
740 | {0x0000a550, 0x61042a6c, 0x61042a6c, 0x4a001c84, 0x4a001c84}, | ||
741 | {0x0000a554, 0x66062a6c, 0x66062a6c, 0x4e001ce3, 0x4e001ce3}, | ||
742 | {0x0000a558, 0x6b062e6c, 0x6b062e6c, 0x52001ce5, 0x52001ce5}, | ||
743 | {0x0000a55c, 0x7006308c, 0x7006308c, 0x56001ce9, 0x56001ce9}, | ||
744 | {0x0000a560, 0x730a308a, 0x730a308a, 0x5a001ceb, 0x5a001ceb}, | ||
745 | {0x0000a564, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, | ||
746 | {0x0000a568, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, | ||
747 | {0x0000a56c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, | ||
748 | {0x0000a570, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, | ||
749 | {0x0000a574, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, | ||
750 | {0x0000a578, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, | ||
751 | {0x0000a57c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, | ||
752 | {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
753 | {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
754 | {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
755 | {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
756 | {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
757 | {0x0000a614, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
758 | {0x0000a618, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
759 | {0x0000a61c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
760 | {0x0000a620, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
761 | {0x0000a624, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
762 | {0x0000a628, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
763 | {0x0000a62c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
764 | {0x0000a630, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
765 | {0x0000a634, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
766 | {0x0000a638, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
767 | {0x0000a63c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
768 | {0x00016044, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4}, | ||
769 | {0x00016048, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
770 | {0x00016054, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
771 | }; | ||
772 | |||
773 | static const u32 ar9565_1p0_pciephy_pll_on_clkreq_disable_L1[][2] = { | ||
774 | /* Addr allmodes */ | ||
775 | {0x00018c00, 0x18212ede}, | ||
776 | {0x00018c04, 0x000801d8}, | ||
777 | {0x00018c08, 0x0003780c}, | ||
778 | }; | ||
779 | |||
780 | static const u32 ar9565_1p0_modes_fast_clock[][3] = { | ||
781 | /* Addr 5G_HT20 5G_HT40 */ | ||
782 | {0x00001030, 0x00000268, 0x000004d0}, | ||
783 | {0x00001070, 0x0000018c, 0x00000318}, | ||
784 | {0x000010b0, 0x00000fd0, 0x00001fa0}, | ||
785 | {0x00008014, 0x044c044c, 0x08980898}, | ||
786 | {0x0000801c, 0x148ec02b, 0x148ec057}, | ||
787 | {0x00008318, 0x000044c0, 0x00008980}, | ||
788 | {0x00009e00, 0x03721821, 0x03721821}, | ||
789 | {0x0000a230, 0x0000400b, 0x00004016}, | ||
790 | {0x0000a254, 0x00000898, 0x00001130}, | ||
791 | }; | ||
792 | |||
793 | static const u32 ar9565_1p0_common_wo_xlna_rx_gain_table[][2] = { | ||
794 | /* Addr allmodes */ | ||
795 | {0x0000a000, 0x00010000}, | ||
796 | {0x0000a004, 0x00030002}, | ||
797 | {0x0000a008, 0x00050004}, | ||
798 | {0x0000a00c, 0x00810080}, | ||
799 | {0x0000a010, 0x00830082}, | ||
800 | {0x0000a014, 0x01810180}, | ||
801 | {0x0000a018, 0x01830182}, | ||
802 | {0x0000a01c, 0x01850184}, | ||
803 | {0x0000a020, 0x01890188}, | ||
804 | {0x0000a024, 0x018b018a}, | ||
805 | {0x0000a028, 0x018d018c}, | ||
806 | {0x0000a02c, 0x03820190}, | ||
807 | {0x0000a030, 0x03840383}, | ||
808 | {0x0000a034, 0x03880385}, | ||
809 | {0x0000a038, 0x038a0389}, | ||
810 | {0x0000a03c, 0x038c038b}, | ||
811 | {0x0000a040, 0x0390038d}, | ||
812 | {0x0000a044, 0x03920391}, | ||
813 | {0x0000a048, 0x03940393}, | ||
814 | {0x0000a04c, 0x03960395}, | ||
815 | {0x0000a050, 0x00000000}, | ||
816 | {0x0000a054, 0x00000000}, | ||
817 | {0x0000a058, 0x00000000}, | ||
818 | {0x0000a05c, 0x00000000}, | ||
819 | {0x0000a060, 0x00000000}, | ||
820 | {0x0000a064, 0x00000000}, | ||
821 | {0x0000a068, 0x00000000}, | ||
822 | {0x0000a06c, 0x00000000}, | ||
823 | {0x0000a070, 0x00000000}, | ||
824 | {0x0000a074, 0x00000000}, | ||
825 | {0x0000a078, 0x00000000}, | ||
826 | {0x0000a07c, 0x00000000}, | ||
827 | {0x0000a080, 0x29292929}, | ||
828 | {0x0000a084, 0x29292929}, | ||
829 | {0x0000a088, 0x29292929}, | ||
830 | {0x0000a08c, 0x29292929}, | ||
831 | {0x0000a090, 0x22292929}, | ||
832 | {0x0000a094, 0x1d1d2222}, | ||
833 | {0x0000a098, 0x0c111117}, | ||
834 | {0x0000a09c, 0x00030303}, | ||
835 | {0x0000a0a0, 0x00000000}, | ||
836 | {0x0000a0a4, 0x00000000}, | ||
837 | {0x0000a0a8, 0x00000000}, | ||
838 | {0x0000a0ac, 0x00000000}, | ||
839 | {0x0000a0b0, 0x00000000}, | ||
840 | {0x0000a0b4, 0x00000000}, | ||
841 | {0x0000a0b8, 0x00000000}, | ||
842 | {0x0000a0bc, 0x00000000}, | ||
843 | {0x0000a0c0, 0x301f3000}, | ||
844 | {0x0000a0c4, 0x41004101}, | ||
845 | {0x0000a0c8, 0x411e411f}, | ||
846 | {0x0000a0cc, 0x411c411d}, | ||
847 | {0x0000a0d0, 0x42434244}, | ||
848 | {0x0000a0d4, 0x42414242}, | ||
849 | {0x0000a0d8, 0x425f4240}, | ||
850 | {0x0000a0dc, 0x5342425e}, | ||
851 | {0x0000a0e0, 0x53405341}, | ||
852 | {0x0000a0e4, 0x535e535f}, | ||
853 | {0x0000a0e8, 0x7402535d}, | ||
854 | {0x0000a0ec, 0x74007401}, | ||
855 | {0x0000a0f0, 0x741e741f}, | ||
856 | {0x0000a0f4, 0x7522741d}, | ||
857 | {0x0000a0f8, 0x75207521}, | ||
858 | {0x0000a0fc, 0x753e753f}, | ||
859 | {0x0000a100, 0x76617662}, | ||
860 | {0x0000a104, 0x767f7660}, | ||
861 | {0x0000a108, 0x767d767e}, | ||
862 | {0x0000a10c, 0x77e277e3}, | ||
863 | {0x0000a110, 0x77e077e1}, | ||
864 | {0x0000a114, 0x00000000}, | ||
865 | {0x0000a118, 0x00000000}, | ||
866 | {0x0000a11c, 0x00000000}, | ||
867 | {0x0000a120, 0x00000000}, | ||
868 | {0x0000a124, 0x00000000}, | ||
869 | {0x0000a128, 0x00000000}, | ||
870 | {0x0000a12c, 0x00000000}, | ||
871 | {0x0000a130, 0x00000000}, | ||
872 | {0x0000a134, 0x00000000}, | ||
873 | {0x0000a138, 0x00000000}, | ||
874 | {0x0000a13c, 0x00000000}, | ||
875 | {0x0000a140, 0x301f3000}, | ||
876 | {0x0000a144, 0x41004101}, | ||
877 | {0x0000a148, 0x411e411f}, | ||
878 | {0x0000a14c, 0x411c411d}, | ||
879 | {0x0000a150, 0x42434244}, | ||
880 | {0x0000a154, 0x42414242}, | ||
881 | {0x0000a158, 0x425f4240}, | ||
882 | {0x0000a15c, 0x5342425e}, | ||
883 | {0x0000a160, 0x53405341}, | ||
884 | {0x0000a164, 0x535e535f}, | ||
885 | {0x0000a168, 0x7402535d}, | ||
886 | {0x0000a16c, 0x74007401}, | ||
887 | {0x0000a170, 0x741e741f}, | ||
888 | {0x0000a174, 0x7522741d}, | ||
889 | {0x0000a178, 0x75207521}, | ||
890 | {0x0000a17c, 0x753e753f}, | ||
891 | {0x0000a180, 0x76617662}, | ||
892 | {0x0000a184, 0x767f7660}, | ||
893 | {0x0000a188, 0x767d767e}, | ||
894 | {0x0000a18c, 0x77e277e3}, | ||
895 | {0x0000a190, 0x77e077e1}, | ||
896 | {0x0000a194, 0x00000000}, | ||
897 | {0x0000a198, 0x00000000}, | ||
898 | {0x0000a19c, 0x00000000}, | ||
899 | {0x0000a1a0, 0x00000000}, | ||
900 | {0x0000a1a4, 0x00000000}, | ||
901 | {0x0000a1a8, 0x00000000}, | ||
902 | {0x0000a1ac, 0x00000000}, | ||
903 | {0x0000a1b0, 0x00000000}, | ||
904 | {0x0000a1b4, 0x00000000}, | ||
905 | {0x0000a1b8, 0x00000000}, | ||
906 | {0x0000a1bc, 0x00000000}, | ||
907 | {0x0000a1c0, 0x00000000}, | ||
908 | {0x0000a1c4, 0x00000000}, | ||
909 | {0x0000a1c8, 0x00000000}, | ||
910 | {0x0000a1cc, 0x00000000}, | ||
911 | {0x0000a1d0, 0x00000000}, | ||
912 | {0x0000a1d4, 0x00000000}, | ||
913 | {0x0000a1d8, 0x00000000}, | ||
914 | {0x0000a1dc, 0x00000000}, | ||
915 | {0x0000a1e0, 0x00000000}, | ||
916 | {0x0000a1e4, 0x00000000}, | ||
917 | {0x0000a1e8, 0x00000000}, | ||
918 | {0x0000a1ec, 0x00000000}, | ||
919 | {0x0000a1f0, 0x00000396}, | ||
920 | {0x0000a1f4, 0x00000396}, | ||
921 | {0x0000a1f8, 0x00000396}, | ||
922 | {0x0000a1fc, 0x00000196}, | ||
923 | {0x0000b000, 0x00010000}, | ||
924 | {0x0000b004, 0x00030002}, | ||
925 | {0x0000b008, 0x00050004}, | ||
926 | {0x0000b00c, 0x00810080}, | ||
927 | {0x0000b010, 0x00830082}, | ||
928 | {0x0000b014, 0x01810180}, | ||
929 | {0x0000b018, 0x01830182}, | ||
930 | {0x0000b01c, 0x01850184}, | ||
931 | {0x0000b020, 0x02810280}, | ||
932 | {0x0000b024, 0x02830282}, | ||
933 | {0x0000b028, 0x02850284}, | ||
934 | {0x0000b02c, 0x02890288}, | ||
935 | {0x0000b030, 0x028b028a}, | ||
936 | {0x0000b034, 0x0388028c}, | ||
937 | {0x0000b038, 0x038a0389}, | ||
938 | {0x0000b03c, 0x038c038b}, | ||
939 | {0x0000b040, 0x0390038d}, | ||
940 | {0x0000b044, 0x03920391}, | ||
941 | {0x0000b048, 0x03940393}, | ||
942 | {0x0000b04c, 0x03960395}, | ||
943 | {0x0000b050, 0x00000000}, | ||
944 | {0x0000b054, 0x00000000}, | ||
945 | {0x0000b058, 0x00000000}, | ||
946 | {0x0000b05c, 0x00000000}, | ||
947 | {0x0000b060, 0x00000000}, | ||
948 | {0x0000b064, 0x00000000}, | ||
949 | {0x0000b068, 0x00000000}, | ||
950 | {0x0000b06c, 0x00000000}, | ||
951 | {0x0000b070, 0x00000000}, | ||
952 | {0x0000b074, 0x00000000}, | ||
953 | {0x0000b078, 0x00000000}, | ||
954 | {0x0000b07c, 0x00000000}, | ||
955 | {0x0000b080, 0x32323232}, | ||
956 | {0x0000b084, 0x2f2f3232}, | ||
957 | {0x0000b088, 0x23282a2d}, | ||
958 | {0x0000b08c, 0x1c1e2123}, | ||
959 | {0x0000b090, 0x14171919}, | ||
960 | {0x0000b094, 0x0e0e1214}, | ||
961 | {0x0000b098, 0x03050707}, | ||
962 | {0x0000b09c, 0x00030303}, | ||
963 | {0x0000b0a0, 0x00000000}, | ||
964 | {0x0000b0a4, 0x00000000}, | ||
965 | {0x0000b0a8, 0x00000000}, | ||
966 | {0x0000b0ac, 0x00000000}, | ||
967 | {0x0000b0b0, 0x00000000}, | ||
968 | {0x0000b0b4, 0x00000000}, | ||
969 | {0x0000b0b8, 0x00000000}, | ||
970 | {0x0000b0bc, 0x00000000}, | ||
971 | {0x0000b0c0, 0x003f0020}, | ||
972 | {0x0000b0c4, 0x00400041}, | ||
973 | {0x0000b0c8, 0x0140005f}, | ||
974 | {0x0000b0cc, 0x0160015f}, | ||
975 | {0x0000b0d0, 0x017e017f}, | ||
976 | {0x0000b0d4, 0x02410242}, | ||
977 | {0x0000b0d8, 0x025f0240}, | ||
978 | {0x0000b0dc, 0x027f0260}, | ||
979 | {0x0000b0e0, 0x0341027e}, | ||
980 | {0x0000b0e4, 0x035f0340}, | ||
981 | {0x0000b0e8, 0x037f0360}, | ||
982 | {0x0000b0ec, 0x04400441}, | ||
983 | {0x0000b0f0, 0x0460045f}, | ||
984 | {0x0000b0f4, 0x0541047f}, | ||
985 | {0x0000b0f8, 0x055f0540}, | ||
986 | {0x0000b0fc, 0x057f0560}, | ||
987 | {0x0000b100, 0x06400641}, | ||
988 | {0x0000b104, 0x0660065f}, | ||
989 | {0x0000b108, 0x067e067f}, | ||
990 | {0x0000b10c, 0x07410742}, | ||
991 | {0x0000b110, 0x075f0740}, | ||
992 | {0x0000b114, 0x077f0760}, | ||
993 | {0x0000b118, 0x07800781}, | ||
994 | {0x0000b11c, 0x07a0079f}, | ||
995 | {0x0000b120, 0x07c107bf}, | ||
996 | {0x0000b124, 0x000007c0}, | ||
997 | {0x0000b128, 0x00000000}, | ||
998 | {0x0000b12c, 0x00000000}, | ||
999 | {0x0000b130, 0x00000000}, | ||
1000 | {0x0000b134, 0x00000000}, | ||
1001 | {0x0000b138, 0x00000000}, | ||
1002 | {0x0000b13c, 0x00000000}, | ||
1003 | {0x0000b140, 0x003f0020}, | ||
1004 | {0x0000b144, 0x00400041}, | ||
1005 | {0x0000b148, 0x0140005f}, | ||
1006 | {0x0000b14c, 0x0160015f}, | ||
1007 | {0x0000b150, 0x017e017f}, | ||
1008 | {0x0000b154, 0x02410242}, | ||
1009 | {0x0000b158, 0x025f0240}, | ||
1010 | {0x0000b15c, 0x027f0260}, | ||
1011 | {0x0000b160, 0x0341027e}, | ||
1012 | {0x0000b164, 0x035f0340}, | ||
1013 | {0x0000b168, 0x037f0360}, | ||
1014 | {0x0000b16c, 0x04400441}, | ||
1015 | {0x0000b170, 0x0460045f}, | ||
1016 | {0x0000b174, 0x0541047f}, | ||
1017 | {0x0000b178, 0x055f0540}, | ||
1018 | {0x0000b17c, 0x057f0560}, | ||
1019 | {0x0000b180, 0x06400641}, | ||
1020 | {0x0000b184, 0x0660065f}, | ||
1021 | {0x0000b188, 0x067e067f}, | ||
1022 | {0x0000b18c, 0x07410742}, | ||
1023 | {0x0000b190, 0x075f0740}, | ||
1024 | {0x0000b194, 0x077f0760}, | ||
1025 | {0x0000b198, 0x07800781}, | ||
1026 | {0x0000b19c, 0x07a0079f}, | ||
1027 | {0x0000b1a0, 0x07c107bf}, | ||
1028 | {0x0000b1a4, 0x000007c0}, | ||
1029 | {0x0000b1a8, 0x00000000}, | ||
1030 | {0x0000b1ac, 0x00000000}, | ||
1031 | {0x0000b1b0, 0x00000000}, | ||
1032 | {0x0000b1b4, 0x00000000}, | ||
1033 | {0x0000b1b8, 0x00000000}, | ||
1034 | {0x0000b1bc, 0x00000000}, | ||
1035 | {0x0000b1c0, 0x00000000}, | ||
1036 | {0x0000b1c4, 0x00000000}, | ||
1037 | {0x0000b1c8, 0x00000000}, | ||
1038 | {0x0000b1cc, 0x00000000}, | ||
1039 | {0x0000b1d0, 0x00000000}, | ||
1040 | {0x0000b1d4, 0x00000000}, | ||
1041 | {0x0000b1d8, 0x00000000}, | ||
1042 | {0x0000b1dc, 0x00000000}, | ||
1043 | {0x0000b1e0, 0x00000000}, | ||
1044 | {0x0000b1e4, 0x00000000}, | ||
1045 | {0x0000b1e8, 0x00000000}, | ||
1046 | {0x0000b1ec, 0x00000000}, | ||
1047 | {0x0000b1f0, 0x00000396}, | ||
1048 | {0x0000b1f4, 0x00000396}, | ||
1049 | {0x0000b1f8, 0x00000396}, | ||
1050 | {0x0000b1fc, 0x00000196}, | ||
1051 | }; | ||
1052 | |||
1053 | static const u32 ar9565_1p0_modes_low_ob_db_tx_gain_table[][5] = { | ||
1054 | /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ | ||
1055 | {0x0000a2dc, 0xfc0a9380, 0xfc0a9380, 0xfdab5b52, 0xfdab5b52}, | ||
1056 | {0x0000a2e0, 0xffecec00, 0xffecec00, 0xfd339c84, 0xfd339c84}, | ||
1057 | {0x0000a2e4, 0xfc0f0000, 0xfc0f0000, 0xfec3e000, 0xfec3e000}, | ||
1058 | {0x0000a2e8, 0xfc100000, 0xfc100000, 0xfffc0000, 0xfffc0000}, | ||
1059 | {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9}, | ||
1060 | {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1061 | {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002}, | ||
1062 | {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004}, | ||
1063 | {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200}, | ||
1064 | {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202}, | ||
1065 | {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400}, | ||
1066 | {0x0000a518, 0x21020220, 0x21020220, 0x16000402, 0x16000402}, | ||
1067 | {0x0000a51c, 0x27020223, 0x27020223, 0x19000404, 0x19000404}, | ||
1068 | {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603}, | ||
1069 | {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02}, | ||
1070 | {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04}, | ||
1071 | {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20}, | ||
1072 | {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20}, | ||
1073 | {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22}, | ||
1074 | {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24}, | ||
1075 | {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640}, | ||
1076 | {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660}, | ||
1077 | {0x0000a544, 0x5302266c, 0x5302266c, 0x3f001861, 0x3f001861}, | ||
1078 | {0x0000a548, 0x5702286c, 0x5702286c, 0x43001a81, 0x43001a81}, | ||
1079 | {0x0000a54c, 0x5c04286b, 0x5c04286b, 0x47001a83, 0x47001a83}, | ||
1080 | {0x0000a550, 0x61042a6c, 0x61042a6c, 0x4a001c84, 0x4a001c84}, | ||
1081 | {0x0000a554, 0x66062a6c, 0x66062a6c, 0x4e001ce3, 0x4e001ce3}, | ||
1082 | {0x0000a558, 0x6b062e6c, 0x6b062e6c, 0x52001ce5, 0x52001ce5}, | ||
1083 | {0x0000a55c, 0x7006308c, 0x7006308c, 0x56001ce9, 0x56001ce9}, | ||
1084 | {0x0000a560, 0x730a308a, 0x730a308a, 0x5a001ceb, 0x5a001ceb}, | ||
1085 | {0x0000a564, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, | ||
1086 | {0x0000a568, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, | ||
1087 | {0x0000a56c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, | ||
1088 | {0x0000a570, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, | ||
1089 | {0x0000a574, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, | ||
1090 | {0x0000a578, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, | ||
1091 | {0x0000a57c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, | ||
1092 | {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1093 | {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1094 | {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1095 | {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1096 | {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1097 | {0x0000a614, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1098 | {0x0000a618, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1099 | {0x0000a61c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1100 | {0x0000a620, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1101 | {0x0000a624, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1102 | {0x0000a628, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1103 | {0x0000a62c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1104 | {0x0000a630, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1105 | {0x0000a634, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1106 | {0x0000a638, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1107 | {0x0000a63c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1108 | {0x00016044, 0x012482d4, 0x012482d4, 0x012482d4, 0x012482d4}, | ||
1109 | {0x00016048, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1110 | {0x00016054, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1111 | }; | ||
1112 | |||
1113 | static const u32 ar9565_1p0_modes_high_ob_db_tx_gain_table[][5] = { | ||
1114 | /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ | ||
1115 | {0x0000a2dc, 0xfc0a9380, 0xfc0a9380, 0xfdab5b52, 0xfdab5b52}, | ||
1116 | {0x0000a2e0, 0xffecec00, 0xffecec00, 0xfd339c84, 0xfd339c84}, | ||
1117 | {0x0000a2e4, 0xfc0f0000, 0xfc0f0000, 0xfec3e000, 0xfec3e000}, | ||
1118 | {0x0000a2e8, 0xfc100000, 0xfc100000, 0xfffc0000, 0xfffc0000}, | ||
1119 | {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9}, | ||
1120 | {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000}, | ||
1121 | {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002}, | ||
1122 | {0x0000a508, 0x0b022220, 0x0b022220, 0x08000004, 0x08000004}, | ||
1123 | {0x0000a50c, 0x10022223, 0x10022223, 0x0c000200, 0x0c000200}, | ||
1124 | {0x0000a510, 0x15022620, 0x15022620, 0x10000202, 0x10000202}, | ||
1125 | {0x0000a514, 0x19022622, 0x19022622, 0x13000400, 0x13000400}, | ||
1126 | {0x0000a518, 0x1c022822, 0x1c022822, 0x17000402, 0x17000402}, | ||
1127 | {0x0000a51c, 0x21022842, 0x21022842, 0x1b000404, 0x1b000404}, | ||
1128 | {0x0000a520, 0x24022c41, 0x24022c41, 0x1e000603, 0x1e000603}, | ||
1129 | {0x0000a524, 0x29023042, 0x29023042, 0x23000a02, 0x23000a02}, | ||
1130 | {0x0000a528, 0x2d023044, 0x2d023044, 0x27000a04, 0x27000a04}, | ||
1131 | {0x0000a52c, 0x31023644, 0x31023644, 0x2a000a20, 0x2a000a20}, | ||
1132 | {0x0000a530, 0x36025643, 0x36025643, 0x2e000e20, 0x2e000e20}, | ||
1133 | {0x0000a534, 0x3a025a44, 0x3a025a44, 0x32000e22, 0x32000e22}, | ||
1134 | {0x0000a538, 0x3d025e45, 0x3d025e45, 0x36000e24, 0x36000e24}, | ||
1135 | {0x0000a53c, 0x43025e4a, 0x43025e4a, 0x3a001640, 0x3a001640}, | ||
1136 | {0x0000a540, 0x4a025e6c, 0x4a025e6c, 0x3e001660, 0x3e001660}, | ||
1137 | {0x0000a544, 0x50025e8e, 0x50025e8e, 0x41001861, 0x41001861}, | ||
1138 | {0x0000a548, 0x56025eb2, 0x56025eb2, 0x45001a81, 0x45001a81}, | ||
1139 | {0x0000a54c, 0x5c025eb5, 0x5c025eb5, 0x49001a83, 0x49001a83}, | ||
1140 | {0x0000a550, 0x62025ef6, 0x62025ef6, 0x4c001c84, 0x4c001c84}, | ||
1141 | {0x0000a554, 0x65025f56, 0x65025f56, 0x4f001ce3, 0x4f001ce3}, | ||
1142 | {0x0000a558, 0x69027f56, 0x69027f56, 0x53001ce5, 0x53001ce5}, | ||
1143 | {0x0000a55c, 0x6d029f56, 0x6d029f56, 0x57001ce9, 0x57001ce9}, | ||
1144 | {0x0000a560, 0x73049f56, 0x73049f56, 0x5b001ceb, 0x5b001ceb}, | ||
1145 | {0x0000a564, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, | ||
1146 | {0x0000a568, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, | ||
1147 | {0x0000a56c, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, | ||
1148 | {0x0000a570, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, | ||
1149 | {0x0000a574, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, | ||
1150 | {0x0000a578, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, | ||
1151 | {0x0000a57c, 0x7804ff56, 0x7804ff56, 0x5d001eec, 0x5d001eec}, | ||
1152 | {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1153 | {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1154 | {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1155 | {0x0000a60c, 0x00804000, 0x00804000, 0x00000000, 0x00000000}, | ||
1156 | {0x0000a610, 0x00804201, 0x00804201, 0x00000000, 0x00000000}, | ||
1157 | {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000}, | ||
1158 | {0x0000a618, 0x00804201, 0x00804201, 0x01404501, 0x01404501}, | ||
1159 | {0x0000a61c, 0x02008201, 0x02008201, 0x02008501, 0x02008501}, | ||
1160 | {0x0000a620, 0x02c10a03, 0x02c10a03, 0x0280ca03, 0x0280ca03}, | ||
1161 | {0x0000a624, 0x04815205, 0x04815205, 0x02c10b04, 0x02c10b04}, | ||
1162 | {0x0000a628, 0x0581d406, 0x0581d406, 0x03814b04, 0x03814b04}, | ||
1163 | {0x0000a62c, 0x0581d607, 0x0581d607, 0x05018e05, 0x05018e05}, | ||
1164 | {0x0000a630, 0x0581d607, 0x0581d607, 0x05019406, 0x05019406}, | ||
1165 | {0x0000a634, 0x0581d607, 0x0581d607, 0x05019406, 0x05019406}, | ||
1166 | {0x0000a638, 0x0581d607, 0x0581d607, 0x05019406, 0x05019406}, | ||
1167 | {0x0000a63c, 0x0581d607, 0x0581d607, 0x05019406, 0x05019406}, | ||
1168 | {0x00016044, 0x056d82e4, 0x056d82e4, 0x056d82e4, 0x056d82e4}, | ||
1169 | {0x00016048, 0x8db49060, 0x8db49060, 0x8db49060, 0x8db49060}, | ||
1170 | {0x00016054, 0x6db60000, 0x6db60000, 0x6db60000, 0x6db60000}, | ||
1171 | }; | ||
1172 | |||
1173 | static const u32 ar9565_1p0_modes_high_power_tx_gain_table[][5] = { | ||
1174 | /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ | ||
1175 | {0x0000a2dc, 0xfc0a9380, 0xfc0a9380, 0xfdab5b52, 0xfdab5b52}, | ||
1176 | {0x0000a2e0, 0xffecec00, 0xffecec00, 0xfd339c84, 0xfd339c84}, | ||
1177 | {0x0000a2e4, 0xfc0f0000, 0xfc0f0000, 0xfec3e000, 0xfec3e000}, | ||
1178 | {0x0000a2e8, 0xfc100000, 0xfc100000, 0xfffc0000, 0xfffc0000}, | ||
1179 | {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9}, | ||
1180 | {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000}, | ||
1181 | {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002}, | ||
1182 | {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004}, | ||
1183 | {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200}, | ||
1184 | {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202}, | ||
1185 | {0x0000a514, 0x18022622, 0x18022622, 0x11000400, 0x11000400}, | ||
1186 | {0x0000a518, 0x1b022822, 0x1b022822, 0x15000402, 0x15000402}, | ||
1187 | {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404}, | ||
1188 | {0x0000a520, 0x22022c41, 0x22022c41, 0x1b000603, 0x1b000603}, | ||
1189 | {0x0000a524, 0x28023042, 0x28023042, 0x1f000a02, 0x1f000a02}, | ||
1190 | {0x0000a528, 0x2c023044, 0x2c023044, 0x23000a04, 0x23000a04}, | ||
1191 | {0x0000a52c, 0x2f023644, 0x2f023644, 0x26000a20, 0x26000a20}, | ||
1192 | {0x0000a530, 0x34025643, 0x34025643, 0x2a000e20, 0x2a000e20}, | ||
1193 | {0x0000a534, 0x38025a44, 0x38025a44, 0x2e000e22, 0x2e000e22}, | ||
1194 | {0x0000a538, 0x3b025e45, 0x3b025e45, 0x31000e24, 0x31000e24}, | ||
1195 | {0x0000a53c, 0x41025e4a, 0x41025e4a, 0x34001640, 0x34001640}, | ||
1196 | {0x0000a540, 0x48025e6c, 0x48025e6c, 0x38001660, 0x38001660}, | ||
1197 | {0x0000a544, 0x4e025e8e, 0x4e025e8e, 0x3b001861, 0x3b001861}, | ||
1198 | {0x0000a548, 0x53025eb2, 0x53025eb2, 0x3e001a81, 0x3e001a81}, | ||
1199 | {0x0000a54c, 0x59025eb5, 0x59025eb5, 0x42001a83, 0x42001a83}, | ||
1200 | {0x0000a550, 0x5f025ef6, 0x5f025ef6, 0x44001c84, 0x44001c84}, | ||
1201 | {0x0000a554, 0x62025f56, 0x62025f56, 0x48001ce3, 0x48001ce3}, | ||
1202 | {0x0000a558, 0x66027f56, 0x66027f56, 0x4c001ce5, 0x4c001ce5}, | ||
1203 | {0x0000a55c, 0x6a029f56, 0x6a029f56, 0x50001ce9, 0x50001ce9}, | ||
1204 | {0x0000a560, 0x70049f56, 0x70049f56, 0x54001ceb, 0x54001ceb}, | ||
1205 | {0x0000a564, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, | ||
1206 | {0x0000a568, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, | ||
1207 | {0x0000a56c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, | ||
1208 | {0x0000a570, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, | ||
1209 | {0x0000a574, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, | ||
1210 | {0x0000a578, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, | ||
1211 | {0x0000a57c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, | ||
1212 | {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1213 | {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1214 | {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1215 | {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1216 | {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1217 | {0x0000a614, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1218 | {0x0000a618, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1219 | {0x0000a61c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1220 | {0x0000a620, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1221 | {0x0000a624, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1222 | {0x0000a628, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1223 | {0x0000a62c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1224 | {0x0000a630, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1225 | {0x0000a634, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1226 | {0x0000a638, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1227 | {0x0000a63c, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1228 | {0x00016044, 0x056d82e6, 0x056d82e6, 0x056d82e6, 0x056d82e6}, | ||
1229 | {0x00016048, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1230 | {0x00016054, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, | ||
1231 | }; | ||
1232 | |||
1233 | #endif /* INITVALS_9565_1P0_H */ | ||
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 7373e4b92c92..96b8331ef9e7 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -423,7 +423,6 @@ void ath9k_beacon_assign_slot(struct ath_softc *sc, struct ieee80211_vif *vif); | |||
423 | void ath9k_beacon_remove_slot(struct ath_softc *sc, struct ieee80211_vif *vif); | 423 | void ath9k_beacon_remove_slot(struct ath_softc *sc, struct ieee80211_vif *vif); |
424 | void ath9k_set_tsfadjust(struct ath_softc *sc, struct ieee80211_vif *vif); | 424 | void ath9k_set_tsfadjust(struct ath_softc *sc, struct ieee80211_vif *vif); |
425 | void ath9k_set_beacon(struct ath_softc *sc); | 425 | void ath9k_set_beacon(struct ath_softc *sc); |
426 | void ath9k_set_beaconing_status(struct ath_softc *sc, bool status); | ||
427 | 426 | ||
428 | /*******************/ | 427 | /*******************/ |
429 | /* Link Monitoring */ | 428 | /* Link Monitoring */ |
@@ -473,7 +472,7 @@ struct ath_btcoex { | |||
473 | unsigned long op_flags; | 472 | unsigned long op_flags; |
474 | int bt_stomp_type; /* Types of BT stomping */ | 473 | int bt_stomp_type; /* Types of BT stomping */ |
475 | u32 btcoex_no_stomp; /* in usec */ | 474 | u32 btcoex_no_stomp; /* in usec */ |
476 | u32 btcoex_period; /* in usec */ | 475 | u32 btcoex_period; /* in msec */ |
477 | u32 btscan_no_stomp; /* in usec */ | 476 | u32 btscan_no_stomp; /* in usec */ |
478 | u32 duty_cycle; | 477 | u32 duty_cycle; |
479 | u32 bt_wait_time; | 478 | u32 bt_wait_time; |
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index 68b643c8943c..ab3bc85a1f8a 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c | |||
@@ -373,6 +373,8 @@ void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status) | |||
373 | sc->debug.stats.istats.tsfoor++; | 373 | sc->debug.stats.istats.tsfoor++; |
374 | if (status & ATH9K_INT_MCI) | 374 | if (status & ATH9K_INT_MCI) |
375 | sc->debug.stats.istats.mci++; | 375 | sc->debug.stats.istats.mci++; |
376 | if (status & ATH9K_INT_GENTIMER) | ||
377 | sc->debug.stats.istats.gen_timer++; | ||
376 | } | 378 | } |
377 | 379 | ||
378 | static ssize_t read_file_interrupt(struct file *file, char __user *user_buf, | 380 | static ssize_t read_file_interrupt(struct file *file, char __user *user_buf, |
@@ -418,6 +420,7 @@ static ssize_t read_file_interrupt(struct file *file, char __user *user_buf, | |||
418 | PR_IS("DTIM", dtim); | 420 | PR_IS("DTIM", dtim); |
419 | PR_IS("TSFOOR", tsfoor); | 421 | PR_IS("TSFOOR", tsfoor); |
420 | PR_IS("MCI", mci); | 422 | PR_IS("MCI", mci); |
423 | PR_IS("GENTIMER", gen_timer); | ||
421 | PR_IS("TOTAL", total); | 424 | PR_IS("TOTAL", total); |
422 | 425 | ||
423 | len += snprintf(buf + len, mxlen - len, | 426 | len += snprintf(buf + len, mxlen - len, |
diff --git a/drivers/net/wireless/ath/ath9k/debug.h b/drivers/net/wireless/ath/ath9k/debug.h index 8b9d080d89da..2ed9785a38fa 100644 --- a/drivers/net/wireless/ath/ath9k/debug.h +++ b/drivers/net/wireless/ath/ath9k/debug.h | |||
@@ -41,7 +41,6 @@ enum ath_reset_type { | |||
41 | RESET_TYPE_PLL_HANG, | 41 | RESET_TYPE_PLL_HANG, |
42 | RESET_TYPE_MAC_HANG, | 42 | RESET_TYPE_MAC_HANG, |
43 | RESET_TYPE_BEACON_STUCK, | 43 | RESET_TYPE_BEACON_STUCK, |
44 | RESET_TYPE_MCI, | ||
45 | __RESET_TYPE_MAX | 44 | __RESET_TYPE_MAX |
46 | }; | 45 | }; |
47 | 46 | ||
@@ -74,6 +73,8 @@ enum ath_reset_type { | |||
74 | * from a beacon differs from the PCU's internal TSF by more than a | 73 | * from a beacon differs from the PCU's internal TSF by more than a |
75 | * (programmable) threshold | 74 | * (programmable) threshold |
76 | * @local_timeout: Internal bus timeout. | 75 | * @local_timeout: Internal bus timeout. |
76 | * @mci: MCI interrupt, specific to MCI based BTCOEX chipsets | ||
77 | * @gen_timer: Generic hardware timer interrupt | ||
77 | */ | 78 | */ |
78 | struct ath_interrupt_stats { | 79 | struct ath_interrupt_stats { |
79 | u32 total; | 80 | u32 total; |
@@ -100,6 +101,7 @@ struct ath_interrupt_stats { | |||
100 | u32 bb_watchdog; | 101 | u32 bb_watchdog; |
101 | u32 tsfoor; | 102 | u32 tsfoor; |
102 | u32 mci; | 103 | u32 mci; |
104 | u32 gen_timer; | ||
103 | 105 | ||
104 | /* Sync-cause stats */ | 106 | /* Sync-cause stats */ |
105 | u32 sync_cause_all; | 107 | u32 sync_cause_all; |
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.h b/drivers/net/wireless/ath/ath9k/eeprom.h index 484b31305906..319c651fa6c5 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom.h +++ b/drivers/net/wireless/ath/ath9k/eeprom.h | |||
@@ -96,6 +96,7 @@ | |||
96 | 96 | ||
97 | #define ATH9K_POW_SM(_r, _s) (((_r) & 0x3f) << (_s)) | 97 | #define ATH9K_POW_SM(_r, _s) (((_r) & 0x3f) << (_s)) |
98 | #define FREQ2FBIN(x, y) ((y) ? ((x) - 2300) : (((x) - 4800) / 5)) | 98 | #define FREQ2FBIN(x, y) ((y) ? ((x) - 2300) : (((x) - 4800) / 5)) |
99 | #define FBIN2FREQ(x, y) ((y) ? (2300 + x) : (4800 + 5 * x)) | ||
99 | #define ath9k_hw_use_flash(_ah) (!(_ah->ah_flags & AH_USE_EEPROM)) | 100 | #define ath9k_hw_use_flash(_ah) (!(_ah->ah_flags & AH_USE_EEPROM)) |
100 | 101 | ||
101 | #define AR5416_VER_MASK (eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) | 102 | #define AR5416_VER_MASK (eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) |
@@ -108,7 +109,7 @@ | |||
108 | #define EEP_RFSILENT_ENABLED_S 0 | 109 | #define EEP_RFSILENT_ENABLED_S 0 |
109 | #define EEP_RFSILENT_POLARITY 0x0002 | 110 | #define EEP_RFSILENT_POLARITY 0x0002 |
110 | #define EEP_RFSILENT_POLARITY_S 1 | 111 | #define EEP_RFSILENT_POLARITY_S 1 |
111 | #define EEP_RFSILENT_GPIO_SEL (AR_SREV_9462(ah) ? 0x00fc : 0x001c) | 112 | #define EEP_RFSILENT_GPIO_SEL ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x00fc : 0x001c) |
112 | #define EEP_RFSILENT_GPIO_SEL_S 2 | 113 | #define EEP_RFSILENT_GPIO_SEL_S 2 |
113 | 114 | ||
114 | #define AR5416_OPFLAGS_11A 0x01 | 115 | #define AR5416_OPFLAGS_11A 0x01 |
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c index bacdb8fb4ef4..45f24220b16e 100644 --- a/drivers/net/wireless/ath/ath9k/gpio.c +++ b/drivers/net/wireless/ath/ath9k/gpio.c | |||
@@ -51,7 +51,7 @@ void ath_init_leds(struct ath_softc *sc) | |||
51 | sc->sc_ah->led_pin = ATH_LED_PIN_9485; | 51 | sc->sc_ah->led_pin = ATH_LED_PIN_9485; |
52 | else if (AR_SREV_9300(sc->sc_ah)) | 52 | else if (AR_SREV_9300(sc->sc_ah)) |
53 | sc->sc_ah->led_pin = ATH_LED_PIN_9300; | 53 | sc->sc_ah->led_pin = ATH_LED_PIN_9300; |
54 | else if (AR_SREV_9462(sc->sc_ah)) | 54 | else if (AR_SREV_9462(sc->sc_ah) || AR_SREV_9565(sc->sc_ah)) |
55 | sc->sc_ah->led_pin = ATH_LED_PIN_9462; | 55 | sc->sc_ah->led_pin = ATH_LED_PIN_9462; |
56 | else | 56 | else |
57 | sc->sc_ah->led_pin = ATH_LED_PIN_DEF; | 57 | sc->sc_ah->led_pin = ATH_LED_PIN_DEF; |
@@ -228,7 +228,12 @@ static void ath_btcoex_period_timer(unsigned long data) | |||
228 | ath9k_hw_btcoex_enable(ah); | 228 | ath9k_hw_btcoex_enable(ah); |
229 | spin_unlock_bh(&btcoex->btcoex_lock); | 229 | spin_unlock_bh(&btcoex->btcoex_lock); |
230 | 230 | ||
231 | if (btcoex->btcoex_period != btcoex->btcoex_no_stomp) { | 231 | /* |
232 | * btcoex_period is in msec while (btocex/btscan_)no_stomp are in usec, | ||
233 | * ensure that we properly convert btcoex_period to usec | ||
234 | * for any comparision with (btcoex/btscan_)no_stomp. | ||
235 | */ | ||
236 | if (btcoex->btcoex_period * 1000 != btcoex->btcoex_no_stomp) { | ||
232 | if (btcoex->hw_timer_enabled) | 237 | if (btcoex->hw_timer_enabled) |
233 | ath9k_gen_timer_stop(ah, btcoex->no_stomp_timer); | 238 | ath9k_gen_timer_stop(ah, btcoex->no_stomp_timer); |
234 | 239 | ||
@@ -341,7 +346,8 @@ void ath9k_btcoex_stop_gen_timer(struct ath_softc *sc) | |||
341 | { | 346 | { |
342 | struct ath_btcoex *btcoex = &sc->btcoex; | 347 | struct ath_btcoex *btcoex = &sc->btcoex; |
343 | 348 | ||
344 | ath9k_gen_timer_stop(sc->sc_ah, btcoex->no_stomp_timer); | 349 | if (btcoex->hw_timer_enabled) |
350 | ath9k_gen_timer_stop(sc->sc_ah, btcoex->no_stomp_timer); | ||
345 | } | 351 | } |
346 | 352 | ||
347 | u16 ath9k_btcoex_aggr_limit(struct ath_softc *sc, u32 max_4ms_framelen) | 353 | u16 ath9k_btcoex_aggr_limit(struct ath_softc *sc, u32 max_4ms_framelen) |
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index aa327adcc3d8..ee6e50aebf8d 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c | |||
@@ -973,8 +973,8 @@ static void ath9k_hif_usb_dealloc_urbs(struct hif_device_usb *hif_dev) | |||
973 | static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev) | 973 | static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev) |
974 | { | 974 | { |
975 | int transfer, err; | 975 | int transfer, err; |
976 | const void *data = hif_dev->firmware->data; | 976 | const void *data = hif_dev->fw_data; |
977 | size_t len = hif_dev->firmware->size; | 977 | size_t len = hif_dev->fw_size; |
978 | u32 addr = AR9271_FIRMWARE; | 978 | u32 addr = AR9271_FIRMWARE; |
979 | u8 *buf = kzalloc(4096, GFP_KERNEL); | 979 | u8 *buf = kzalloc(4096, GFP_KERNEL); |
980 | u32 firm_offset; | 980 | u32 firm_offset; |
@@ -1017,7 +1017,7 @@ static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev) | |||
1017 | return -EIO; | 1017 | return -EIO; |
1018 | 1018 | ||
1019 | dev_info(&hif_dev->udev->dev, "ath9k_htc: Transferred FW: %s, size: %ld\n", | 1019 | dev_info(&hif_dev->udev->dev, "ath9k_htc: Transferred FW: %s, size: %ld\n", |
1020 | hif_dev->fw_name, (unsigned long) hif_dev->firmware->size); | 1020 | hif_dev->fw_name, (unsigned long) hif_dev->fw_size); |
1021 | 1021 | ||
1022 | return 0; | 1022 | return 0; |
1023 | } | 1023 | } |
@@ -1099,11 +1099,11 @@ static void ath9k_hif_usb_firmware_cb(const struct firmware *fw, void *context) | |||
1099 | 1099 | ||
1100 | hif_dev->htc_handle = ath9k_htc_hw_alloc(hif_dev, &hif_usb, | 1100 | hif_dev->htc_handle = ath9k_htc_hw_alloc(hif_dev, &hif_usb, |
1101 | &hif_dev->udev->dev); | 1101 | &hif_dev->udev->dev); |
1102 | if (hif_dev->htc_handle == NULL) { | 1102 | if (hif_dev->htc_handle == NULL) |
1103 | goto err_fw; | 1103 | goto err_dev_alloc; |
1104 | } | ||
1105 | 1104 | ||
1106 | hif_dev->firmware = fw; | 1105 | hif_dev->fw_data = fw->data; |
1106 | hif_dev->fw_size = fw->size; | ||
1107 | 1107 | ||
1108 | /* Proceed with initialization */ | 1108 | /* Proceed with initialization */ |
1109 | 1109 | ||
@@ -1121,6 +1121,8 @@ static void ath9k_hif_usb_firmware_cb(const struct firmware *fw, void *context) | |||
1121 | goto err_htc_hw_init; | 1121 | goto err_htc_hw_init; |
1122 | } | 1122 | } |
1123 | 1123 | ||
1124 | release_firmware(fw); | ||
1125 | hif_dev->flags |= HIF_USB_READY; | ||
1124 | complete(&hif_dev->fw_done); | 1126 | complete(&hif_dev->fw_done); |
1125 | 1127 | ||
1126 | return; | 1128 | return; |
@@ -1129,8 +1131,8 @@ err_htc_hw_init: | |||
1129 | ath9k_hif_usb_dev_deinit(hif_dev); | 1131 | ath9k_hif_usb_dev_deinit(hif_dev); |
1130 | err_dev_init: | 1132 | err_dev_init: |
1131 | ath9k_htc_hw_free(hif_dev->htc_handle); | 1133 | ath9k_htc_hw_free(hif_dev->htc_handle); |
1134 | err_dev_alloc: | ||
1132 | release_firmware(fw); | 1135 | release_firmware(fw); |
1133 | hif_dev->firmware = NULL; | ||
1134 | err_fw: | 1136 | err_fw: |
1135 | ath9k_hif_usb_firmware_fail(hif_dev); | 1137 | ath9k_hif_usb_firmware_fail(hif_dev); |
1136 | } | 1138 | } |
@@ -1277,11 +1279,10 @@ static void ath9k_hif_usb_disconnect(struct usb_interface *interface) | |||
1277 | 1279 | ||
1278 | wait_for_completion(&hif_dev->fw_done); | 1280 | wait_for_completion(&hif_dev->fw_done); |
1279 | 1281 | ||
1280 | if (hif_dev->firmware) { | 1282 | if (hif_dev->flags & HIF_USB_READY) { |
1281 | ath9k_htc_hw_deinit(hif_dev->htc_handle, unplugged); | 1283 | ath9k_htc_hw_deinit(hif_dev->htc_handle, unplugged); |
1282 | ath9k_htc_hw_free(hif_dev->htc_handle); | 1284 | ath9k_htc_hw_free(hif_dev->htc_handle); |
1283 | ath9k_hif_usb_dev_deinit(hif_dev); | 1285 | ath9k_hif_usb_dev_deinit(hif_dev); |
1284 | release_firmware(hif_dev->firmware); | ||
1285 | } | 1286 | } |
1286 | 1287 | ||
1287 | usb_set_intfdata(interface, NULL); | 1288 | usb_set_intfdata(interface, NULL); |
@@ -1317,13 +1318,23 @@ static int ath9k_hif_usb_resume(struct usb_interface *interface) | |||
1317 | struct hif_device_usb *hif_dev = usb_get_intfdata(interface); | 1318 | struct hif_device_usb *hif_dev = usb_get_intfdata(interface); |
1318 | struct htc_target *htc_handle = hif_dev->htc_handle; | 1319 | struct htc_target *htc_handle = hif_dev->htc_handle; |
1319 | int ret; | 1320 | int ret; |
1321 | const struct firmware *fw; | ||
1320 | 1322 | ||
1321 | ret = ath9k_hif_usb_alloc_urbs(hif_dev); | 1323 | ret = ath9k_hif_usb_alloc_urbs(hif_dev); |
1322 | if (ret) | 1324 | if (ret) |
1323 | return ret; | 1325 | return ret; |
1324 | 1326 | ||
1325 | if (hif_dev->firmware) { | 1327 | if (hif_dev->flags & HIF_USB_READY) { |
1328 | /* request cached firmware during suspend/resume cycle */ | ||
1329 | ret = request_firmware(&fw, hif_dev->fw_name, | ||
1330 | &hif_dev->udev->dev); | ||
1331 | if (ret) | ||
1332 | goto fail_resume; | ||
1333 | |||
1334 | hif_dev->fw_data = fw->data; | ||
1335 | hif_dev->fw_size = fw->size; | ||
1326 | ret = ath9k_hif_usb_download_fw(hif_dev); | 1336 | ret = ath9k_hif_usb_download_fw(hif_dev); |
1337 | release_firmware(fw); | ||
1327 | if (ret) | 1338 | if (ret) |
1328 | goto fail_resume; | 1339 | goto fail_resume; |
1329 | } else { | 1340 | } else { |
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.h b/drivers/net/wireless/ath/ath9k/hif_usb.h index 487ff658b4c1..51496e74b83e 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.h +++ b/drivers/net/wireless/ath/ath9k/hif_usb.h | |||
@@ -85,12 +85,14 @@ struct cmd_buf { | |||
85 | }; | 85 | }; |
86 | 86 | ||
87 | #define HIF_USB_START BIT(0) | 87 | #define HIF_USB_START BIT(0) |
88 | #define HIF_USB_READY BIT(1) | ||
88 | 89 | ||
89 | struct hif_device_usb { | 90 | struct hif_device_usb { |
90 | struct usb_device *udev; | 91 | struct usb_device *udev; |
91 | struct usb_interface *interface; | 92 | struct usb_interface *interface; |
92 | const struct usb_device_id *usb_device_id; | 93 | const struct usb_device_id *usb_device_id; |
93 | const struct firmware *firmware; | 94 | const void *fw_data; |
95 | size_t fw_size; | ||
94 | struct completion fw_done; | 96 | struct completion fw_done; |
95 | struct htc_target *htc_handle; | 97 | struct htc_target *htc_handle; |
96 | struct hif_usb_tx tx; | 98 | struct hif_usb_tx tx; |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c index 07df279c8d46..8fd64a6f0eb9 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c | |||
@@ -173,17 +173,26 @@ void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv) | |||
173 | 173 | ||
174 | if (ah->btcoex_hw.enabled && | 174 | if (ah->btcoex_hw.enabled && |
175 | ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) { | 175 | ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) { |
176 | ath9k_hw_btcoex_disable(ah); | ||
177 | if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE) | 176 | if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE) |
178 | ath_htc_cancel_btcoex_work(priv); | 177 | ath_htc_cancel_btcoex_work(priv); |
178 | ath9k_hw_btcoex_disable(ah); | ||
179 | } | 179 | } |
180 | } | 180 | } |
181 | 181 | ||
182 | void ath9k_htc_init_btcoex(struct ath9k_htc_priv *priv, char *product) | 182 | void ath9k_htc_init_btcoex(struct ath9k_htc_priv *priv, char *product) |
183 | { | 183 | { |
184 | struct ath_hw *ah = priv->ah; | 184 | struct ath_hw *ah = priv->ah; |
185 | struct ath_common *common = ath9k_hw_common(ah); | ||
185 | int qnum; | 186 | int qnum; |
186 | 187 | ||
188 | /* | ||
189 | * Check if BTCOEX is globally disabled. | ||
190 | */ | ||
191 | if (!common->btcoex_enabled) { | ||
192 | ah->btcoex_hw.scheme = ATH_BTCOEX_CFG_NONE; | ||
193 | return; | ||
194 | } | ||
195 | |||
187 | if (product && strncmp(product, ATH_HTC_BTCOEX_PRODUCT_ID, 5) == 0) { | 196 | if (product && strncmp(product, ATH_HTC_BTCOEX_PRODUCT_ID, 5) == 0) { |
188 | ah->btcoex_hw.scheme = ATH_BTCOEX_CFG_3WIRE; | 197 | ah->btcoex_hw.scheme = ATH_BTCOEX_CFG_3WIRE; |
189 | } | 198 | } |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index a035a380d669..d98255eb1b9a 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c | |||
@@ -30,6 +30,10 @@ int htc_modparam_nohwcrypt; | |||
30 | module_param_named(nohwcrypt, htc_modparam_nohwcrypt, int, 0444); | 30 | module_param_named(nohwcrypt, htc_modparam_nohwcrypt, int, 0444); |
31 | MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption"); | 31 | MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption"); |
32 | 32 | ||
33 | static int ath9k_htc_btcoex_enable; | ||
34 | module_param_named(btcoex_enable, ath9k_htc_btcoex_enable, int, 0444); | ||
35 | MODULE_PARM_DESC(btcoex_enable, "Enable wifi-BT coexistence"); | ||
36 | |||
33 | #define CHAN2G(_freq, _idx) { \ | 37 | #define CHAN2G(_freq, _idx) { \ |
34 | .center_freq = (_freq), \ | 38 | .center_freq = (_freq), \ |
35 | .hw_value = (_idx), \ | 39 | .hw_value = (_idx), \ |
@@ -635,6 +639,7 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv, | |||
635 | common->hw = priv->hw; | 639 | common->hw = priv->hw; |
636 | common->priv = priv; | 640 | common->priv = priv; |
637 | common->debug_mask = ath9k_debug; | 641 | common->debug_mask = ath9k_debug; |
642 | common->btcoex_enabled = ath9k_htc_btcoex_enable == 1; | ||
638 | 643 | ||
639 | spin_lock_init(&priv->beacon_lock); | 644 | spin_lock_init(&priv->beacon_lock); |
640 | spin_lock_init(&priv->tx.tx_lock); | 645 | spin_lock_init(&priv->tx.tx_lock); |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index c32f6e3ffb18..61d096e3596f 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c | |||
@@ -489,24 +489,20 @@ static int ath9k_htc_add_station(struct ath9k_htc_priv *priv, | |||
489 | ista = (struct ath9k_htc_sta *) sta->drv_priv; | 489 | ista = (struct ath9k_htc_sta *) sta->drv_priv; |
490 | memcpy(&tsta.macaddr, sta->addr, ETH_ALEN); | 490 | memcpy(&tsta.macaddr, sta->addr, ETH_ALEN); |
491 | memcpy(&tsta.bssid, common->curbssid, ETH_ALEN); | 491 | memcpy(&tsta.bssid, common->curbssid, ETH_ALEN); |
492 | tsta.is_vif_sta = 0; | ||
493 | ista->index = sta_idx; | 492 | ista->index = sta_idx; |
493 | tsta.is_vif_sta = 0; | ||
494 | maxampdu = 1 << (IEEE80211_HT_MAX_AMPDU_FACTOR + | ||
495 | sta->ht_cap.ampdu_factor); | ||
496 | tsta.maxampdu = cpu_to_be16(maxampdu); | ||
494 | } else { | 497 | } else { |
495 | memcpy(&tsta.macaddr, vif->addr, ETH_ALEN); | 498 | memcpy(&tsta.macaddr, vif->addr, ETH_ALEN); |
496 | tsta.is_vif_sta = 1; | 499 | tsta.is_vif_sta = 1; |
500 | tsta.maxampdu = cpu_to_be16(0xffff); | ||
497 | } | 501 | } |
498 | 502 | ||
499 | tsta.sta_index = sta_idx; | 503 | tsta.sta_index = sta_idx; |
500 | tsta.vif_index = avp->index; | 504 | tsta.vif_index = avp->index; |
501 | 505 | ||
502 | if (!sta) { | ||
503 | tsta.maxampdu = cpu_to_be16(0xffff); | ||
504 | } else { | ||
505 | maxampdu = 1 << (IEEE80211_HT_MAX_AMPDU_FACTOR + | ||
506 | sta->ht_cap.ampdu_factor); | ||
507 | tsta.maxampdu = cpu_to_be16(maxampdu); | ||
508 | } | ||
509 | |||
510 | WMI_CMD_BUF(WMI_NODE_CREATE_CMDID, &tsta); | 506 | WMI_CMD_BUF(WMI_NODE_CREATE_CMDID, &tsta); |
511 | if (ret) { | 507 | if (ret) { |
512 | if (sta) | 508 | if (sta) |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 60b6a9daff7e..99cab44d2312 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -355,7 +355,7 @@ static void ath9k_hw_read_revisions(struct ath_hw *ah) | |||
355 | (val & AR_SREV_VERSION2) >> AR_SREV_TYPE2_S; | 355 | (val & AR_SREV_VERSION2) >> AR_SREV_TYPE2_S; |
356 | ah->hw_version.macRev = MS(val, AR_SREV_REVISION2); | 356 | ah->hw_version.macRev = MS(val, AR_SREV_REVISION2); |
357 | 357 | ||
358 | if (AR_SREV_9462(ah)) | 358 | if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) |
359 | ah->is_pciexpress = true; | 359 | ah->is_pciexpress = true; |
360 | else | 360 | else |
361 | ah->is_pciexpress = (val & | 361 | ah->is_pciexpress = (val & |
@@ -463,9 +463,6 @@ static void ath9k_hw_init_config(struct ath_hw *ah) | |||
463 | ah->config.spurchans[i][1] = AR_NO_SPUR; | 463 | ah->config.spurchans[i][1] = AR_NO_SPUR; |
464 | } | 464 | } |
465 | 465 | ||
466 | /* PAPRD needs some more work to be enabled */ | ||
467 | ah->config.paprd_disable = 1; | ||
468 | |||
469 | ah->config.rx_intr_mitigation = true; | 466 | ah->config.rx_intr_mitigation = true; |
470 | ah->config.pcieSerDesWrite = true; | 467 | ah->config.pcieSerDesWrite = true; |
471 | 468 | ||
@@ -605,6 +602,11 @@ static int __ath9k_hw_init(struct ath_hw *ah) | |||
605 | if (AR_SREV_9462(ah)) | 602 | if (AR_SREV_9462(ah)) |
606 | ah->WARegVal &= ~AR_WA_D3_L1_DISABLE; | 603 | ah->WARegVal &= ~AR_WA_D3_L1_DISABLE; |
607 | 604 | ||
605 | if (AR_SREV_9565(ah)) { | ||
606 | ah->WARegVal |= AR_WA_BIT22; | ||
607 | REG_WRITE(ah, AR_WA, ah->WARegVal); | ||
608 | } | ||
609 | |||
608 | ath9k_hw_init_defaults(ah); | 610 | ath9k_hw_init_defaults(ah); |
609 | ath9k_hw_init_config(ah); | 611 | ath9k_hw_init_config(ah); |
610 | 612 | ||
@@ -650,6 +652,7 @@ static int __ath9k_hw_init(struct ath_hw *ah) | |||
650 | case AR_SREV_VERSION_9340: | 652 | case AR_SREV_VERSION_9340: |
651 | case AR_SREV_VERSION_9462: | 653 | case AR_SREV_VERSION_9462: |
652 | case AR_SREV_VERSION_9550: | 654 | case AR_SREV_VERSION_9550: |
655 | case AR_SREV_VERSION_9565: | ||
653 | break; | 656 | break; |
654 | default: | 657 | default: |
655 | ath_err(common, | 658 | ath_err(common, |
@@ -711,7 +714,7 @@ int ath9k_hw_init(struct ath_hw *ah) | |||
711 | int ret; | 714 | int ret; |
712 | struct ath_common *common = ath9k_hw_common(ah); | 715 | struct ath_common *common = ath9k_hw_common(ah); |
713 | 716 | ||
714 | /* These are all the AR5008/AR9001/AR9002 hardware family of chipsets */ | 717 | /* These are all the AR5008/AR9001/AR9002/AR9003 hardware family of chipsets */ |
715 | switch (ah->hw_version.devid) { | 718 | switch (ah->hw_version.devid) { |
716 | case AR5416_DEVID_PCI: | 719 | case AR5416_DEVID_PCI: |
717 | case AR5416_DEVID_PCIE: | 720 | case AR5416_DEVID_PCIE: |
@@ -731,6 +734,7 @@ int ath9k_hw_init(struct ath_hw *ah) | |||
731 | case AR9300_DEVID_AR9580: | 734 | case AR9300_DEVID_AR9580: |
732 | case AR9300_DEVID_AR9462: | 735 | case AR9300_DEVID_AR9462: |
733 | case AR9485_DEVID_AR1111: | 736 | case AR9485_DEVID_AR1111: |
737 | case AR9300_DEVID_AR9565: | ||
734 | break; | 738 | break; |
735 | default: | 739 | default: |
736 | if (common->bus_ops->ath_bus_type == ATH_USB) | 740 | if (common->bus_ops->ath_bus_type == ATH_USB) |
@@ -803,8 +807,7 @@ static void ath9k_hw_init_pll(struct ath_hw *ah, | |||
803 | { | 807 | { |
804 | u32 pll; | 808 | u32 pll; |
805 | 809 | ||
806 | if (AR_SREV_9485(ah)) { | 810 | if (AR_SREV_9485(ah) || AR_SREV_9565(ah)) { |
807 | |||
808 | /* program BB PLL ki and kd value, ki=0x4, kd=0x40 */ | 811 | /* program BB PLL ki and kd value, ki=0x4, kd=0x40 */ |
809 | REG_RMW_FIELD(ah, AR_CH0_BB_DPLL2, | 812 | REG_RMW_FIELD(ah, AR_CH0_BB_DPLL2, |
810 | AR_CH0_BB_DPLL2_PLL_PWD, 0x1); | 813 | AR_CH0_BB_DPLL2_PLL_PWD, 0x1); |
@@ -915,7 +918,8 @@ static void ath9k_hw_init_pll(struct ath_hw *ah, | |||
915 | } | 918 | } |
916 | 919 | ||
917 | pll = ath9k_hw_compute_pll_control(ah, chan); | 920 | pll = ath9k_hw_compute_pll_control(ah, chan); |
918 | 921 | if (AR_SREV_9565(ah)) | |
922 | pll |= 0x40000; | ||
919 | REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll); | 923 | REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll); |
920 | 924 | ||
921 | if (AR_SREV_9485(ah) || AR_SREV_9340(ah) || AR_SREV_9330(ah) || | 925 | if (AR_SREV_9485(ah) || AR_SREV_9340(ah) || AR_SREV_9330(ah) || |
@@ -978,9 +982,6 @@ static void ath9k_hw_init_interrupt_masks(struct ath_hw *ah, | |||
978 | else | 982 | else |
979 | imr_reg |= AR_IMR_TXOK; | 983 | imr_reg |= AR_IMR_TXOK; |
980 | 984 | ||
981 | if (opmode == NL80211_IFTYPE_AP) | ||
982 | imr_reg |= AR_IMR_MIB; | ||
983 | |||
984 | ENABLE_REGWRITE_BUFFER(ah); | 985 | ENABLE_REGWRITE_BUFFER(ah); |
985 | 986 | ||
986 | REG_WRITE(ah, AR_IMR, imr_reg); | 987 | REG_WRITE(ah, AR_IMR, imr_reg); |
@@ -1778,6 +1779,8 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, | |||
1778 | /* Operating channel changed, reset channel calibration data */ | 1779 | /* Operating channel changed, reset channel calibration data */ |
1779 | memset(caldata, 0, sizeof(*caldata)); | 1780 | memset(caldata, 0, sizeof(*caldata)); |
1780 | ath9k_init_nfcal_hist_buffer(ah, chan); | 1781 | ath9k_init_nfcal_hist_buffer(ah, chan); |
1782 | } else if (caldata) { | ||
1783 | caldata->paprd_packet_sent = false; | ||
1781 | } | 1784 | } |
1782 | ah->noise = ath9k_hw_getchan_noise(ah, chan); | 1785 | ah->noise = ath9k_hw_getchan_noise(ah, chan); |
1783 | 1786 | ||
@@ -2038,7 +2041,7 @@ static void ath9k_set_power_sleep(struct ath_hw *ah) | |||
2038 | { | 2041 | { |
2039 | REG_SET_BIT(ah, AR_STA_ID1, AR_STA_ID1_PWR_SAV); | 2042 | REG_SET_BIT(ah, AR_STA_ID1, AR_STA_ID1_PWR_SAV); |
2040 | 2043 | ||
2041 | if (AR_SREV_9462(ah)) { | 2044 | if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) { |
2042 | REG_CLR_BIT(ah, AR_TIMER_MODE, 0xff); | 2045 | REG_CLR_BIT(ah, AR_TIMER_MODE, 0xff); |
2043 | REG_CLR_BIT(ah, AR_NDP2_TIMER_MODE, 0xff); | 2046 | REG_CLR_BIT(ah, AR_NDP2_TIMER_MODE, 0xff); |
2044 | REG_CLR_BIT(ah, AR_SLP32_INC, 0xfffff); | 2047 | REG_CLR_BIT(ah, AR_SLP32_INC, 0xfffff); |
@@ -2405,7 +2408,10 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) | |||
2405 | if (eeval & AR5416_OPFLAGS_11G) | 2408 | if (eeval & AR5416_OPFLAGS_11G) |
2406 | pCap->hw_caps |= ATH9K_HW_CAP_2GHZ; | 2409 | pCap->hw_caps |= ATH9K_HW_CAP_2GHZ; |
2407 | 2410 | ||
2408 | if (AR_SREV_9485(ah) || AR_SREV_9285(ah) || AR_SREV_9330(ah)) | 2411 | if (AR_SREV_9485(ah) || |
2412 | AR_SREV_9285(ah) || | ||
2413 | AR_SREV_9330(ah) || | ||
2414 | AR_SREV_9565(ah)) | ||
2409 | chip_chainmask = 1; | 2415 | chip_chainmask = 1; |
2410 | else if (AR_SREV_9462(ah)) | 2416 | else if (AR_SREV_9462(ah)) |
2411 | chip_chainmask = 3; | 2417 | chip_chainmask = 3; |
@@ -2493,7 +2499,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) | |||
2493 | 2499 | ||
2494 | if (AR_SREV_9300_20_OR_LATER(ah)) { | 2500 | if (AR_SREV_9300_20_OR_LATER(ah)) { |
2495 | pCap->hw_caps |= ATH9K_HW_CAP_EDMA | ATH9K_HW_CAP_FASTCLOCK; | 2501 | pCap->hw_caps |= ATH9K_HW_CAP_EDMA | ATH9K_HW_CAP_FASTCLOCK; |
2496 | if (!AR_SREV_9330(ah) && !AR_SREV_9485(ah)) | 2502 | if (!AR_SREV_9330(ah) && !AR_SREV_9485(ah) && !AR_SREV_9565(ah)) |
2497 | pCap->hw_caps |= ATH9K_HW_CAP_LDPC; | 2503 | pCap->hw_caps |= ATH9K_HW_CAP_LDPC; |
2498 | 2504 | ||
2499 | pCap->rx_hp_qdepth = ATH9K_HW_RX_HP_QDEPTH; | 2505 | pCap->rx_hp_qdepth = ATH9K_HW_RX_HP_QDEPTH; |
@@ -2502,7 +2508,8 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) | |||
2502 | pCap->tx_desc_len = sizeof(struct ar9003_txc); | 2508 | pCap->tx_desc_len = sizeof(struct ar9003_txc); |
2503 | pCap->txs_len = sizeof(struct ar9003_txs); | 2509 | pCap->txs_len = sizeof(struct ar9003_txs); |
2504 | if (!ah->config.paprd_disable && | 2510 | if (!ah->config.paprd_disable && |
2505 | ah->eep_ops->get_eeprom(ah, EEP_PAPRD)) | 2511 | ah->eep_ops->get_eeprom(ah, EEP_PAPRD) && |
2512 | !AR_SREV_9462(ah)) | ||
2506 | pCap->hw_caps |= ATH9K_HW_CAP_PAPRD; | 2513 | pCap->hw_caps |= ATH9K_HW_CAP_PAPRD; |
2507 | } else { | 2514 | } else { |
2508 | pCap->tx_desc_len = sizeof(struct ath_desc); | 2515 | pCap->tx_desc_len = sizeof(struct ath_desc); |
@@ -2575,14 +2582,12 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) | |||
2575 | ah->enabled_cals |= TX_IQ_ON_AGC_CAL; | 2582 | ah->enabled_cals |= TX_IQ_ON_AGC_CAL; |
2576 | } | 2583 | } |
2577 | 2584 | ||
2578 | if (AR_SREV_9462(ah)) { | 2585 | if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) { |
2579 | |||
2580 | if (!(ah->ent_mode & AR_ENT_OTP_49GHZ_DISABLE)) | 2586 | if (!(ah->ent_mode & AR_ENT_OTP_49GHZ_DISABLE)) |
2581 | pCap->hw_caps |= ATH9K_HW_CAP_MCI; | 2587 | pCap->hw_caps |= ATH9K_HW_CAP_MCI; |
2582 | 2588 | ||
2583 | if (AR_SREV_9462_20(ah)) | 2589 | if (AR_SREV_9462_20(ah)) |
2584 | pCap->hw_caps |= ATH9K_HW_CAP_RTT; | 2590 | pCap->hw_caps |= ATH9K_HW_CAP_RTT; |
2585 | |||
2586 | } | 2591 | } |
2587 | 2592 | ||
2588 | 2593 | ||
@@ -2748,7 +2753,7 @@ void ath9k_hw_setrxfilter(struct ath_hw *ah, u32 bits) | |||
2748 | 2753 | ||
2749 | ENABLE_REGWRITE_BUFFER(ah); | 2754 | ENABLE_REGWRITE_BUFFER(ah); |
2750 | 2755 | ||
2751 | if (AR_SREV_9462(ah)) | 2756 | if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) |
2752 | bits |= ATH9K_RX_FILTER_CONTROL_WRAPPER; | 2757 | bits |= ATH9K_RX_FILTER_CONTROL_WRAPPER; |
2753 | 2758 | ||
2754 | REG_WRITE(ah, AR_RX_FILTER, bits); | 2759 | REG_WRITE(ah, AR_RX_FILTER, bits); |
@@ -3045,7 +3050,7 @@ void ath9k_hw_gen_timer_start(struct ath_hw *ah, | |||
3045 | REG_SET_BIT(ah, gen_tmr_configuration[timer->index].mode_addr, | 3050 | REG_SET_BIT(ah, gen_tmr_configuration[timer->index].mode_addr, |
3046 | gen_tmr_configuration[timer->index].mode_mask); | 3051 | gen_tmr_configuration[timer->index].mode_mask); |
3047 | 3052 | ||
3048 | if (AR_SREV_9462(ah)) { | 3053 | if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) { |
3049 | /* | 3054 | /* |
3050 | * Starting from AR9462, each generic timer can select which tsf | 3055 | * Starting from AR9462, each generic timer can select which tsf |
3051 | * to use. But we still follow the old rule, 0 - 7 use tsf and | 3056 | * to use. But we still follow the old rule, 0 - 7 use tsf and |
@@ -3079,6 +3084,16 @@ void ath9k_hw_gen_timer_stop(struct ath_hw *ah, struct ath_gen_timer *timer) | |||
3079 | REG_CLR_BIT(ah, gen_tmr_configuration[timer->index].mode_addr, | 3084 | REG_CLR_BIT(ah, gen_tmr_configuration[timer->index].mode_addr, |
3080 | gen_tmr_configuration[timer->index].mode_mask); | 3085 | gen_tmr_configuration[timer->index].mode_mask); |
3081 | 3086 | ||
3087 | if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) { | ||
3088 | /* | ||
3089 | * Need to switch back to TSF if it was using TSF2. | ||
3090 | */ | ||
3091 | if ((timer->index >= AR_GEN_TIMER_BANK_1_LEN)) { | ||
3092 | REG_CLR_BIT(ah, AR_MAC_PCU_GEN_TIMER_TSF_SEL, | ||
3093 | (1 << timer->index)); | ||
3094 | } | ||
3095 | } | ||
3096 | |||
3082 | /* Disable both trigger and thresh interrupt masks */ | 3097 | /* Disable both trigger and thresh interrupt masks */ |
3083 | REG_CLR_BIT(ah, AR_IMR_S5, | 3098 | REG_CLR_BIT(ah, AR_IMR_S5, |
3084 | (SM(AR_GENTMR_BIT(timer->index), AR_IMR_S5_GENTIMER_THRESH) | | 3099 | (SM(AR_GENTMR_BIT(timer->index), AR_IMR_S5_GENTIMER_THRESH) | |
@@ -3160,6 +3175,7 @@ static struct { | |||
3160 | { AR_SREV_VERSION_9485, "9485" }, | 3175 | { AR_SREV_VERSION_9485, "9485" }, |
3161 | { AR_SREV_VERSION_9462, "9462" }, | 3176 | { AR_SREV_VERSION_9462, "9462" }, |
3162 | { AR_SREV_VERSION_9550, "9550" }, | 3177 | { AR_SREV_VERSION_9550, "9550" }, |
3178 | { AR_SREV_VERSION_9565, "9565" }, | ||
3163 | }; | 3179 | }; |
3164 | 3180 | ||
3165 | /* For devices with external radios */ | 3181 | /* For devices with external radios */ |
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index ce7332c64efb..0d17ce0b0ff4 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -50,6 +50,7 @@ | |||
50 | #define AR9300_DEVID_AR9330 0x0035 | 50 | #define AR9300_DEVID_AR9330 0x0035 |
51 | #define AR9300_DEVID_QCA955X 0x0038 | 51 | #define AR9300_DEVID_QCA955X 0x0038 |
52 | #define AR9485_DEVID_AR1111 0x0037 | 52 | #define AR9485_DEVID_AR1111 0x0037 |
53 | #define AR9300_DEVID_AR9565 0x0036 | ||
53 | 54 | ||
54 | #define AR5416_AR9100_DEVID 0x000b | 55 | #define AR5416_AR9100_DEVID 0x000b |
55 | 56 | ||
@@ -405,6 +406,7 @@ struct ath9k_hw_cal_data { | |||
405 | int8_t iCoff; | 406 | int8_t iCoff; |
406 | int8_t qCoff; | 407 | int8_t qCoff; |
407 | bool rtt_done; | 408 | bool rtt_done; |
409 | bool paprd_packet_sent; | ||
408 | bool paprd_done; | 410 | bool paprd_done; |
409 | bool nfcal_pending; | 411 | bool nfcal_pending; |
410 | bool nfcal_interference; | 412 | bool nfcal_interference; |
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index f33712140fa5..f3ce5ca2f1d3 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c | |||
@@ -258,7 +258,7 @@ static void setup_ht_cap(struct ath_softc *sc, | |||
258 | ht_info->ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K; | 258 | ht_info->ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K; |
259 | ht_info->ampdu_density = IEEE80211_HT_MPDU_DENSITY_8; | 259 | ht_info->ampdu_density = IEEE80211_HT_MPDU_DENSITY_8; |
260 | 260 | ||
261 | if (AR_SREV_9330(ah) || AR_SREV_9485(ah)) | 261 | if (AR_SREV_9330(ah) || AR_SREV_9485(ah) || AR_SREV_9565(ah)) |
262 | max_streams = 1; | 262 | max_streams = 1; |
263 | else if (AR_SREV_9462(ah)) | 263 | else if (AR_SREV_9462(ah)) |
264 | max_streams = 2; | 264 | max_streams = 2; |
diff --git a/drivers/net/wireless/ath/ath9k/link.c b/drivers/net/wireless/ath/ath9k/link.c index d4549e9aac5c..825a29cc9313 100644 --- a/drivers/net/wireless/ath/ath9k/link.c +++ b/drivers/net/wireless/ath/ath9k/link.c | |||
@@ -254,8 +254,9 @@ void ath_paprd_calibrate(struct work_struct *work) | |||
254 | int chain_ok = 0; | 254 | int chain_ok = 0; |
255 | int chain; | 255 | int chain; |
256 | int len = 1800; | 256 | int len = 1800; |
257 | int ret; | ||
257 | 258 | ||
258 | if (!caldata) | 259 | if (!caldata || !caldata->paprd_packet_sent || caldata->paprd_done) |
259 | return; | 260 | return; |
260 | 261 | ||
261 | ath9k_ps_wakeup(sc); | 262 | ath9k_ps_wakeup(sc); |
@@ -282,13 +283,6 @@ void ath_paprd_calibrate(struct work_struct *work) | |||
282 | continue; | 283 | continue; |
283 | 284 | ||
284 | chain_ok = 0; | 285 | chain_ok = 0; |
285 | |||
286 | ath_dbg(common, CALIBRATE, | ||
287 | "Sending PAPRD frame for thermal measurement on chain %d\n", | ||
288 | chain); | ||
289 | if (!ath_paprd_send_frame(sc, skb, chain)) | ||
290 | goto fail_paprd; | ||
291 | |||
292 | ar9003_paprd_setup_gain_table(ah, chain); | 286 | ar9003_paprd_setup_gain_table(ah, chain); |
293 | 287 | ||
294 | ath_dbg(common, CALIBRATE, | 288 | ath_dbg(common, CALIBRATE, |
@@ -302,7 +296,13 @@ void ath_paprd_calibrate(struct work_struct *work) | |||
302 | break; | 296 | break; |
303 | } | 297 | } |
304 | 298 | ||
305 | if (ar9003_paprd_create_curve(ah, caldata, chain)) { | 299 | ret = ar9003_paprd_create_curve(ah, caldata, chain); |
300 | if (ret == -EINPROGRESS) { | ||
301 | ath_dbg(common, CALIBRATE, | ||
302 | "PAPRD curve on chain %d needs to be re-trained\n", | ||
303 | chain); | ||
304 | break; | ||
305 | } else if (ret) { | ||
306 | ath_dbg(common, CALIBRATE, | 306 | ath_dbg(common, CALIBRATE, |
307 | "PAPRD create curve failed on chain %d\n", | 307 | "PAPRD create curve failed on chain %d\n", |
308 | chain); | 308 | chain); |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 8a2b04d5922f..3923ad933aef 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -986,47 +986,21 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, | |||
986 | struct ath_softc *sc = hw->priv; | 986 | struct ath_softc *sc = hw->priv; |
987 | struct ath_hw *ah = sc->sc_ah; | 987 | struct ath_hw *ah = sc->sc_ah; |
988 | struct ath_common *common = ath9k_hw_common(ah); | 988 | struct ath_common *common = ath9k_hw_common(ah); |
989 | int ret = 0; | ||
990 | 989 | ||
991 | ath9k_ps_wakeup(sc); | ||
992 | mutex_lock(&sc->mutex); | 990 | mutex_lock(&sc->mutex); |
993 | 991 | ||
994 | switch (vif->type) { | ||
995 | case NL80211_IFTYPE_STATION: | ||
996 | case NL80211_IFTYPE_WDS: | ||
997 | case NL80211_IFTYPE_ADHOC: | ||
998 | case NL80211_IFTYPE_AP: | ||
999 | case NL80211_IFTYPE_MESH_POINT: | ||
1000 | break; | ||
1001 | default: | ||
1002 | ath_err(common, "Interface type %d not yet supported\n", | ||
1003 | vif->type); | ||
1004 | ret = -EOPNOTSUPP; | ||
1005 | goto out; | ||
1006 | } | ||
1007 | |||
1008 | if (ath9k_uses_beacons(vif->type)) { | ||
1009 | if (sc->nbcnvifs >= ATH_BCBUF) { | ||
1010 | ath_err(common, "Not enough beacon buffers when adding" | ||
1011 | " new interface of type: %i\n", | ||
1012 | vif->type); | ||
1013 | ret = -ENOBUFS; | ||
1014 | goto out; | ||
1015 | } | ||
1016 | } | ||
1017 | |||
1018 | ath_dbg(common, CONFIG, "Attach a VIF of type: %d\n", vif->type); | 992 | ath_dbg(common, CONFIG, "Attach a VIF of type: %d\n", vif->type); |
1019 | |||
1020 | sc->nvifs++; | 993 | sc->nvifs++; |
1021 | 994 | ||
995 | ath9k_ps_wakeup(sc); | ||
1022 | ath9k_calculate_summary_state(hw, vif); | 996 | ath9k_calculate_summary_state(hw, vif); |
997 | ath9k_ps_restore(sc); | ||
998 | |||
1023 | if (ath9k_uses_beacons(vif->type)) | 999 | if (ath9k_uses_beacons(vif->type)) |
1024 | ath9k_beacon_assign_slot(sc, vif); | 1000 | ath9k_beacon_assign_slot(sc, vif); |
1025 | 1001 | ||
1026 | out: | ||
1027 | mutex_unlock(&sc->mutex); | 1002 | mutex_unlock(&sc->mutex); |
1028 | ath9k_ps_restore(sc); | 1003 | return 0; |
1029 | return ret; | ||
1030 | } | 1004 | } |
1031 | 1005 | ||
1032 | static int ath9k_change_interface(struct ieee80211_hw *hw, | 1006 | static int ath9k_change_interface(struct ieee80211_hw *hw, |
@@ -1036,21 +1010,9 @@ static int ath9k_change_interface(struct ieee80211_hw *hw, | |||
1036 | { | 1010 | { |
1037 | struct ath_softc *sc = hw->priv; | 1011 | struct ath_softc *sc = hw->priv; |
1038 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | 1012 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); |
1039 | int ret = 0; | ||
1040 | 1013 | ||
1041 | ath_dbg(common, CONFIG, "Change Interface\n"); | 1014 | ath_dbg(common, CONFIG, "Change Interface\n"); |
1042 | |||
1043 | mutex_lock(&sc->mutex); | 1015 | mutex_lock(&sc->mutex); |
1044 | ath9k_ps_wakeup(sc); | ||
1045 | |||
1046 | if (ath9k_uses_beacons(new_type) && | ||
1047 | !ath9k_uses_beacons(vif->type)) { | ||
1048 | if (sc->nbcnvifs >= ATH_BCBUF) { | ||
1049 | ath_err(common, "No beacon slot available\n"); | ||
1050 | ret = -ENOBUFS; | ||
1051 | goto out; | ||
1052 | } | ||
1053 | } | ||
1054 | 1016 | ||
1055 | if (ath9k_uses_beacons(vif->type)) | 1017 | if (ath9k_uses_beacons(vif->type)) |
1056 | ath9k_beacon_remove_slot(sc, vif); | 1018 | ath9k_beacon_remove_slot(sc, vif); |
@@ -1058,14 +1020,15 @@ static int ath9k_change_interface(struct ieee80211_hw *hw, | |||
1058 | vif->type = new_type; | 1020 | vif->type = new_type; |
1059 | vif->p2p = p2p; | 1021 | vif->p2p = p2p; |
1060 | 1022 | ||
1023 | ath9k_ps_wakeup(sc); | ||
1061 | ath9k_calculate_summary_state(hw, vif); | 1024 | ath9k_calculate_summary_state(hw, vif); |
1025 | ath9k_ps_restore(sc); | ||
1026 | |||
1062 | if (ath9k_uses_beacons(vif->type)) | 1027 | if (ath9k_uses_beacons(vif->type)) |
1063 | ath9k_beacon_assign_slot(sc, vif); | 1028 | ath9k_beacon_assign_slot(sc, vif); |
1064 | 1029 | ||
1065 | out: | ||
1066 | ath9k_ps_restore(sc); | ||
1067 | mutex_unlock(&sc->mutex); | 1030 | mutex_unlock(&sc->mutex); |
1068 | return ret; | 1031 | return 0; |
1069 | } | 1032 | } |
1070 | 1033 | ||
1071 | static void ath9k_remove_interface(struct ieee80211_hw *hw, | 1034 | static void ath9k_remove_interface(struct ieee80211_hw *hw, |
@@ -1076,7 +1039,6 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, | |||
1076 | 1039 | ||
1077 | ath_dbg(common, CONFIG, "Detach Interface\n"); | 1040 | ath_dbg(common, CONFIG, "Detach Interface\n"); |
1078 | 1041 | ||
1079 | ath9k_ps_wakeup(sc); | ||
1080 | mutex_lock(&sc->mutex); | 1042 | mutex_lock(&sc->mutex); |
1081 | 1043 | ||
1082 | sc->nvifs--; | 1044 | sc->nvifs--; |
@@ -1084,10 +1046,11 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, | |||
1084 | if (ath9k_uses_beacons(vif->type)) | 1046 | if (ath9k_uses_beacons(vif->type)) |
1085 | ath9k_beacon_remove_slot(sc, vif); | 1047 | ath9k_beacon_remove_slot(sc, vif); |
1086 | 1048 | ||
1049 | ath9k_ps_wakeup(sc); | ||
1087 | ath9k_calculate_summary_state(hw, NULL); | 1050 | ath9k_calculate_summary_state(hw, NULL); |
1051 | ath9k_ps_restore(sc); | ||
1088 | 1052 | ||
1089 | mutex_unlock(&sc->mutex); | 1053 | mutex_unlock(&sc->mutex); |
1090 | ath9k_ps_restore(sc); | ||
1091 | } | 1054 | } |
1092 | 1055 | ||
1093 | static void ath9k_enable_ps(struct ath_softc *sc) | 1056 | static void ath9k_enable_ps(struct ath_softc *sc) |
@@ -2260,7 +2223,7 @@ static int ath9k_suspend(struct ieee80211_hw *hw, | |||
2260 | mutex_lock(&sc->mutex); | 2223 | mutex_lock(&sc->mutex); |
2261 | 2224 | ||
2262 | ath_cancel_work(sc); | 2225 | ath_cancel_work(sc); |
2263 | del_timer_sync(&common->ani.timer); | 2226 | ath_stop_ani(sc); |
2264 | del_timer_sync(&sc->rx_poll_timer); | 2227 | del_timer_sync(&sc->rx_poll_timer); |
2265 | 2228 | ||
2266 | if (test_bit(SC_OP_INVALID, &sc->sc_flags)) { | 2229 | if (test_bit(SC_OP_INVALID, &sc->sc_flags)) { |
diff --git a/drivers/net/wireless/ath/ath9k/mci.c b/drivers/net/wireless/ath/ath9k/mci.c index fb536e7e661b..8f0e8d9c2054 100644 --- a/drivers/net/wireless/ath/ath9k/mci.c +++ b/drivers/net/wireless/ath/ath9k/mci.c | |||
@@ -191,6 +191,23 @@ skip_tuning: | |||
191 | ath9k_btcoex_timer_resume(sc); | 191 | ath9k_btcoex_timer_resume(sc); |
192 | } | 192 | } |
193 | 193 | ||
194 | static void ath_mci_wait_btcal_done(struct ath_softc *sc) | ||
195 | { | ||
196 | struct ath_hw *ah = sc->sc_ah; | ||
197 | |||
198 | /* Stop tx & rx */ | ||
199 | ieee80211_stop_queues(sc->hw); | ||
200 | ath_stoprecv(sc); | ||
201 | ath_drain_all_txq(sc, false); | ||
202 | |||
203 | /* Wait for cal done */ | ||
204 | ar9003_mci_start_reset(ah, ah->curchan); | ||
205 | |||
206 | /* Resume tx & rx */ | ||
207 | ath_startrecv(sc); | ||
208 | ieee80211_wake_queues(sc->hw); | ||
209 | } | ||
210 | |||
194 | static void ath_mci_cal_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload) | 211 | static void ath_mci_cal_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload) |
195 | { | 212 | { |
196 | struct ath_hw *ah = sc->sc_ah; | 213 | struct ath_hw *ah = sc->sc_ah; |
@@ -201,8 +218,8 @@ static void ath_mci_cal_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload) | |||
201 | switch (opcode) { | 218 | switch (opcode) { |
202 | case MCI_GPM_BT_CAL_REQ: | 219 | case MCI_GPM_BT_CAL_REQ: |
203 | if (mci_hw->bt_state == MCI_BT_AWAKE) { | 220 | if (mci_hw->bt_state == MCI_BT_AWAKE) { |
204 | ar9003_mci_state(ah, MCI_STATE_SET_BT_CAL_START); | 221 | mci_hw->bt_state = MCI_BT_CAL_START; |
205 | ath9k_queue_reset(sc, RESET_TYPE_MCI); | 222 | ath_mci_wait_btcal_done(sc); |
206 | } | 223 | } |
207 | ath_dbg(common, MCI, "MCI State : %d\n", mci_hw->bt_state); | 224 | ath_dbg(common, MCI, "MCI State : %d\n", mci_hw->bt_state); |
208 | break; | 225 | break; |
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c index a978984d78a5..a8f6126f6b2d 100644 --- a/drivers/net/wireless/ath/ath9k/pci.c +++ b/drivers/net/wireless/ath/ath9k/pci.c | |||
@@ -38,6 +38,7 @@ static DEFINE_PCI_DEVICE_TABLE(ath_pci_id_table) = { | |||
38 | { PCI_VDEVICE(ATHEROS, 0x0033) }, /* PCI-E AR9580 */ | 38 | { PCI_VDEVICE(ATHEROS, 0x0033) }, /* PCI-E AR9580 */ |
39 | { PCI_VDEVICE(ATHEROS, 0x0034) }, /* PCI-E AR9462 */ | 39 | { PCI_VDEVICE(ATHEROS, 0x0034) }, /* PCI-E AR9462 */ |
40 | { PCI_VDEVICE(ATHEROS, 0x0037) }, /* PCI-E AR1111/AR9485 */ | 40 | { PCI_VDEVICE(ATHEROS, 0x0037) }, /* PCI-E AR1111/AR9485 */ |
41 | { PCI_VDEVICE(ATHEROS, 0x0036) }, /* PCI-E AR9565 */ | ||
41 | { 0 } | 42 | { 0 } |
42 | }; | 43 | }; |
43 | 44 | ||
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h index 87cac8eb7834..4e6760f8596d 100644 --- a/drivers/net/wireless/ath/ath9k/reg.h +++ b/drivers/net/wireless/ath/ath9k/reg.h | |||
@@ -801,6 +801,8 @@ | |||
801 | #define AR_SREV_REVISION_9580_10 4 /* AR9580 1.0 */ | 801 | #define AR_SREV_REVISION_9580_10 4 /* AR9580 1.0 */ |
802 | #define AR_SREV_VERSION_9462 0x280 | 802 | #define AR_SREV_VERSION_9462 0x280 |
803 | #define AR_SREV_REVISION_9462_20 2 | 803 | #define AR_SREV_REVISION_9462_20 2 |
804 | #define AR_SREV_VERSION_9565 0x2C0 | ||
805 | #define AR_SREV_REVISION_9565_10 0 | ||
804 | #define AR_SREV_VERSION_9550 0x400 | 806 | #define AR_SREV_VERSION_9550 0x400 |
805 | 807 | ||
806 | #define AR_SREV_5416(_ah) \ | 808 | #define AR_SREV_5416(_ah) \ |
@@ -909,6 +911,13 @@ | |||
909 | (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9462) && \ | 911 | (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9462) && \ |
910 | ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9462_20)) | 912 | ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9462_20)) |
911 | 913 | ||
914 | #define AR_SREV_9565(_ah) \ | ||
915 | (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565)) | ||
916 | |||
917 | #define AR_SREV_9565_10(_ah) \ | ||
918 | (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9565) && \ | ||
919 | ((_ah)->hw_version.macRev == AR_SREV_REVISION_9565_10)) | ||
920 | |||
912 | #define AR_SREV_9550(_ah) \ | 921 | #define AR_SREV_9550(_ah) \ |
913 | (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9550)) | 922 | (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9550)) |
914 | 923 | ||
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index ef91f6cc2d79..b088fa0eb022 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -568,7 +568,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
568 | if (!an->sleeping) { | 568 | if (!an->sleeping) { |
569 | ath_tx_queue_tid(txq, tid); | 569 | ath_tx_queue_tid(txq, tid); |
570 | 570 | ||
571 | if (ts->ts_status & ATH9K_TXERR_FILT) | 571 | if (ts->ts_status & (ATH9K_TXERR_FILT | ATH9K_TXERR_XRETRY)) |
572 | tid->ac->clear_ps_filter = true; | 572 | tid->ac->clear_ps_filter = true; |
573 | } | 573 | } |
574 | } | 574 | } |
@@ -2019,6 +2019,9 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, | |||
2019 | 2019 | ||
2020 | ath_dbg(common, XMIT, "TX complete: skb: %p\n", skb); | 2020 | ath_dbg(common, XMIT, "TX complete: skb: %p\n", skb); |
2021 | 2021 | ||
2022 | if (sc->sc_ah->caldata) | ||
2023 | sc->sc_ah->caldata->paprd_packet_sent = true; | ||
2024 | |||
2022 | if (!(tx_flags & ATH_TX_ERROR)) | 2025 | if (!(tx_flags & ATH_TX_ERROR)) |
2023 | /* Frame was ACKed */ | 2026 | /* Frame was ACKed */ |
2024 | tx_info->flags |= IEEE80211_TX_STAT_ACK; | 2027 | tx_info->flags |= IEEE80211_TX_STAT_ACK; |
diff --git a/drivers/net/wireless/brcm80211/Kconfig b/drivers/net/wireless/brcm80211/Kconfig index b480088b3dbe..c9d811eb6556 100644 --- a/drivers/net/wireless/brcm80211/Kconfig +++ b/drivers/net/wireless/brcm80211/Kconfig | |||
@@ -55,6 +55,14 @@ config BRCMFMAC_USB | |||
55 | IEEE802.11n embedded FullMAC WLAN driver. Say Y if you want to | 55 | IEEE802.11n embedded FullMAC WLAN driver. Say Y if you want to |
56 | use the driver for an USB wireless card. | 56 | use the driver for an USB wireless card. |
57 | 57 | ||
58 | config BRCMISCAN | ||
59 | bool "Broadcom I-Scan (OBSOLETE)" | ||
60 | depends on BRCMFMAC | ||
61 | ---help--- | ||
62 | This option enables the I-Scan method. By default fullmac uses the | ||
63 | new E-Scan method which uses less memory in firmware and gives no | ||
64 | limitation on the number of scan results. | ||
65 | |||
58 | config BRCMDBG | 66 | config BRCMDBG |
59 | bool "Broadcom driver debug functions" | 67 | bool "Broadcom driver debug functions" |
60 | depends on BRCMSMAC || BRCMFMAC | 68 | depends on BRCMSMAC || BRCMFMAC |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c index 49765d34b4e0..e0b313c7f5ce 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c | |||
@@ -42,6 +42,7 @@ | |||
42 | 42 | ||
43 | #define DMA_ALIGN_MASK 0x03 | 43 | #define DMA_ALIGN_MASK 0x03 |
44 | 44 | ||
45 | #define SDIO_DEVICE_ID_BROADCOM_43241 0x4324 | ||
45 | #define SDIO_DEVICE_ID_BROADCOM_4329 0x4329 | 46 | #define SDIO_DEVICE_ID_BROADCOM_4329 0x4329 |
46 | #define SDIO_DEVICE_ID_BROADCOM_4330 0x4330 | 47 | #define SDIO_DEVICE_ID_BROADCOM_4330 0x4330 |
47 | #define SDIO_DEVICE_ID_BROADCOM_4334 0x4334 | 48 | #define SDIO_DEVICE_ID_BROADCOM_4334 0x4334 |
@@ -51,6 +52,7 @@ | |||
51 | 52 | ||
52 | /* devices we support, null terminated */ | 53 | /* devices we support, null terminated */ |
53 | static const struct sdio_device_id brcmf_sdmmc_ids[] = { | 54 | static const struct sdio_device_id brcmf_sdmmc_ids[] = { |
55 | {SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_43241)}, | ||
54 | {SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4329)}, | 56 | {SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4329)}, |
55 | {SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4330)}, | 57 | {SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4330)}, |
56 | {SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4334)}, | 58 | {SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4334)}, |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h index a11fe54f5950..4766d9f35696 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h | |||
@@ -130,6 +130,10 @@ | |||
130 | #define BRCMF_EVENT_MSG_FLUSHTXQ 0x02 | 130 | #define BRCMF_EVENT_MSG_FLUSHTXQ 0x02 |
131 | #define BRCMF_EVENT_MSG_GROUP 0x04 | 131 | #define BRCMF_EVENT_MSG_GROUP 0x04 |
132 | 132 | ||
133 | #define BRCMF_ESCAN_REQ_VERSION 1 | ||
134 | |||
135 | #define WLC_BSS_RSSI_ON_CHANNEL 0x0002 | ||
136 | |||
133 | struct brcmf_event_msg { | 137 | struct brcmf_event_msg { |
134 | __be16 version; | 138 | __be16 version; |
135 | __be16 flags; | 139 | __be16 flags; |
@@ -140,6 +144,8 @@ struct brcmf_event_msg { | |||
140 | __be32 datalen; | 144 | __be32 datalen; |
141 | u8 addr[ETH_ALEN]; | 145 | u8 addr[ETH_ALEN]; |
142 | char ifname[IFNAMSIZ]; | 146 | char ifname[IFNAMSIZ]; |
147 | u8 ifidx; | ||
148 | u8 bsscfgidx; | ||
143 | } __packed; | 149 | } __packed; |
144 | 150 | ||
145 | struct brcm_ethhdr { | 151 | struct brcm_ethhdr { |
@@ -454,6 +460,24 @@ struct brcmf_scan_results_le { | |||
454 | __le32 count; | 460 | __le32 count; |
455 | }; | 461 | }; |
456 | 462 | ||
463 | struct brcmf_escan_params_le { | ||
464 | __le32 version; | ||
465 | __le16 action; | ||
466 | __le16 sync_id; | ||
467 | struct brcmf_scan_params_le params_le; | ||
468 | }; | ||
469 | |||
470 | struct brcmf_escan_result_le { | ||
471 | __le32 buflen; | ||
472 | __le32 version; | ||
473 | __le16 sync_id; | ||
474 | __le16 bss_count; | ||
475 | struct brcmf_bss_info_le bss_info_le; | ||
476 | }; | ||
477 | |||
478 | #define WL_ESCAN_RESULTS_FIXED_SIZE (sizeof(struct brcmf_escan_result_le) - \ | ||
479 | sizeof(struct brcmf_bss_info_le)) | ||
480 | |||
457 | /* used for association with a specific BSSID and chanspec list */ | 481 | /* used for association with a specific BSSID and chanspec list */ |
458 | struct brcmf_assoc_params_le { | 482 | struct brcmf_assoc_params_le { |
459 | /* 00:00:00:00:00:00: broadcast scan */ | 483 | /* 00:00:00:00:00:00: broadcast scan */ |
@@ -638,6 +662,7 @@ extern uint brcmf_c_mkiovar(char *name, char *data, uint datalen, | |||
638 | extern int brcmf_netdev_wait_pend8021x(struct net_device *ndev); | 662 | extern int brcmf_netdev_wait_pend8021x(struct net_device *ndev); |
639 | 663 | ||
640 | extern s32 brcmf_exec_dcmd(struct net_device *dev, u32 cmd, void *arg, u32 len); | 664 | extern s32 brcmf_exec_dcmd(struct net_device *dev, u32 cmd, void *arg, u32 len); |
665 | extern int brcmf_netlink_dcmd(struct net_device *ndev, struct brcmf_dcmd *dcmd); | ||
641 | 666 | ||
642 | /* Return pointer to interface name */ | 667 | /* Return pointer to interface name */ |
643 | extern char *brcmf_ifname(struct brcmf_pub *drvr, int idx); | 668 | extern char *brcmf_ifname(struct brcmf_pub *drvr, int idx); |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h index 537f499cc5d2..9b8ee19ea55d 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h | |||
@@ -103,7 +103,7 @@ extern int brcmf_attach(uint bus_hdrlen, struct device *dev); | |||
103 | extern void brcmf_detach(struct device *dev); | 103 | extern void brcmf_detach(struct device *dev); |
104 | 104 | ||
105 | /* Indication from bus module to change flow-control state */ | 105 | /* Indication from bus module to change flow-control state */ |
106 | extern void brcmf_txflowcontrol(struct device *dev, int ifidx, bool on); | 106 | extern void brcmf_txflowblock(struct device *dev, bool state); |
107 | 107 | ||
108 | /* Notify tx completion */ | 108 | /* Notify tx completion */ |
109 | extern void brcmf_txcomplete(struct device *dev, struct sk_buff *txp, | 109 | extern void brcmf_txcomplete(struct device *dev, struct sk_buff *txp, |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c index 2621dd3d7dcd..f6b862d77986 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c | |||
@@ -205,7 +205,8 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data) | |||
205 | BRCMF_E_ACTION_FRAME_COMPLETE, "ACTION FRAME TX COMPLETE"}, { | 205 | BRCMF_E_ACTION_FRAME_COMPLETE, "ACTION FRAME TX COMPLETE"}, { |
206 | BRCMF_E_IF, "IF"}, { | 206 | BRCMF_E_IF, "IF"}, { |
207 | BRCMF_E_RSSI, "RSSI"}, { | 207 | BRCMF_E_RSSI, "RSSI"}, { |
208 | BRCMF_E_PFN_SCAN_COMPLETE, "SCAN_COMPLETE"} | 208 | BRCMF_E_PFN_SCAN_COMPLETE, "SCAN_COMPLETE"}, { |
209 | BRCMF_E_ESCAN_RESULT, "ESCAN_RESULT"} | ||
209 | }; | 210 | }; |
210 | uint event_type, flags, auth_type, datalen; | 211 | uint event_type, flags, auth_type, datalen; |
211 | static u32 seqnum_prev; | 212 | static u32 seqnum_prev; |
@@ -350,6 +351,11 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data) | |||
350 | brcmf_dbg(EVENT, "MACEVENT: %s\n", event_name); | 351 | brcmf_dbg(EVENT, "MACEVENT: %s\n", event_name); |
351 | break; | 352 | break; |
352 | 353 | ||
354 | case BRCMF_E_ESCAN_RESULT: | ||
355 | brcmf_dbg(EVENT, "MACEVENT: %s\n", event_name); | ||
356 | datalen = 0; | ||
357 | break; | ||
358 | |||
353 | case BRCMF_E_PFN_NET_FOUND: | 359 | case BRCMF_E_PFN_NET_FOUND: |
354 | case BRCMF_E_PFN_NET_LOST: | 360 | case BRCMF_E_PFN_NET_LOST: |
355 | case BRCMF_E_PFN_SCAN_COMPLETE: | 361 | case BRCMF_E_PFN_SCAN_COMPLETE: |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c index 9ab24528f9b9..b08f3474d8e7 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c | |||
@@ -350,19 +350,23 @@ done: | |||
350 | return 0; | 350 | return 0; |
351 | } | 351 | } |
352 | 352 | ||
353 | void brcmf_txflowcontrol(struct device *dev, int ifidx, bool state) | 353 | void brcmf_txflowblock(struct device *dev, bool state) |
354 | { | 354 | { |
355 | struct net_device *ndev; | 355 | struct net_device *ndev; |
356 | struct brcmf_bus *bus_if = dev_get_drvdata(dev); | 356 | struct brcmf_bus *bus_if = dev_get_drvdata(dev); |
357 | struct brcmf_pub *drvr = bus_if->drvr; | 357 | struct brcmf_pub *drvr = bus_if->drvr; |
358 | int i; | ||
358 | 359 | ||
359 | brcmf_dbg(TRACE, "Enter\n"); | 360 | brcmf_dbg(TRACE, "Enter\n"); |
360 | 361 | ||
361 | ndev = drvr->iflist[ifidx]->ndev; | 362 | for (i = 0; i < BRCMF_MAX_IFS; i++) |
362 | if (state == ON) | 363 | if (drvr->iflist[i]) { |
363 | netif_stop_queue(ndev); | 364 | ndev = drvr->iflist[i]->ndev; |
364 | else | 365 | if (state) |
365 | netif_wake_queue(ndev); | 366 | netif_stop_queue(ndev); |
367 | else | ||
368 | netif_wake_queue(ndev); | ||
369 | } | ||
366 | } | 370 | } |
367 | 371 | ||
368 | static int brcmf_host_event(struct brcmf_pub *drvr, int *ifidx, | 372 | static int brcmf_host_event(struct brcmf_pub *drvr, int *ifidx, |
@@ -775,6 +779,14 @@ done: | |||
775 | return err; | 779 | return err; |
776 | } | 780 | } |
777 | 781 | ||
782 | int brcmf_netlink_dcmd(struct net_device *ndev, struct brcmf_dcmd *dcmd) | ||
783 | { | ||
784 | brcmf_dbg(TRACE, "enter: cmd %x buf %p len %d\n", | ||
785 | dcmd->cmd, dcmd->buf, dcmd->len); | ||
786 | |||
787 | return brcmf_exec_dcmd(ndev, dcmd->cmd, dcmd->buf, dcmd->len); | ||
788 | } | ||
789 | |||
778 | static int brcmf_netdev_stop(struct net_device *ndev) | 790 | static int brcmf_netdev_stop(struct net_device *ndev) |
779 | { | 791 | { |
780 | struct brcmf_if *ifp = netdev_priv(ndev); | 792 | struct brcmf_if *ifp = netdev_priv(ndev); |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c index 472f2ef5c652..4580ff34c2d0 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | |||
@@ -2235,8 +2235,8 @@ static uint brcmf_sdbrcm_sendfromq(struct brcmf_sdio *bus, uint maxframes) | |||
2235 | if (bus->sdiodev->bus_if->drvr_up && | 2235 | if (bus->sdiodev->bus_if->drvr_up && |
2236 | (bus->sdiodev->bus_if->state == BRCMF_BUS_DATA) && | 2236 | (bus->sdiodev->bus_if->state == BRCMF_BUS_DATA) && |
2237 | bus->txoff && (pktq_len(&bus->txq) < TXLOW)) { | 2237 | bus->txoff && (pktq_len(&bus->txq) < TXLOW)) { |
2238 | bus->txoff = OFF; | 2238 | bus->txoff = false; |
2239 | brcmf_txflowcontrol(bus->sdiodev->dev, 0, OFF); | 2239 | brcmf_txflowblock(bus->sdiodev->dev, false); |
2240 | } | 2240 | } |
2241 | 2241 | ||
2242 | return cnt; | 2242 | return cnt; |
@@ -2672,8 +2672,8 @@ static int brcmf_sdbrcm_bus_txdata(struct device *dev, struct sk_buff *pkt) | |||
2672 | spin_unlock_bh(&bus->txqlock); | 2672 | spin_unlock_bh(&bus->txqlock); |
2673 | 2673 | ||
2674 | if (pktq_len(&bus->txq) >= TXHI) { | 2674 | if (pktq_len(&bus->txq) >= TXHI) { |
2675 | bus->txoff = ON; | 2675 | bus->txoff = true; |
2676 | brcmf_txflowcontrol(bus->sdiodev->dev, 0, ON); | 2676 | brcmf_txflowblock(bus->sdiodev->dev, true); |
2677 | } | 2677 | } |
2678 | 2678 | ||
2679 | #ifdef DEBUG | 2679 | #ifdef DEBUG |
@@ -3881,6 +3881,8 @@ static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_sdio *bus) | |||
3881 | 3881 | ||
3882 | static bool brcmf_sdbrcm_chipmatch(u16 chipid) | 3882 | static bool brcmf_sdbrcm_chipmatch(u16 chipid) |
3883 | { | 3883 | { |
3884 | if (chipid == BCM43241_CHIP_ID) | ||
3885 | return true; | ||
3884 | if (chipid == BCM4329_CHIP_ID) | 3886 | if (chipid == BCM4329_CHIP_ID) |
3885 | return true; | 3887 | return true; |
3886 | if (chipid == BCM4330_CHIP_ID) | 3888 | if (chipid == BCM4330_CHIP_ID) |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c b/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c index 58155e23d220..9434440bbc65 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c | |||
@@ -377,6 +377,23 @@ static int brcmf_sdio_chip_recognition(struct brcmf_sdio_dev *sdiodev, | |||
377 | 377 | ||
378 | /* Address of cores for new chips should be added here */ | 378 | /* Address of cores for new chips should be added here */ |
379 | switch (ci->chip) { | 379 | switch (ci->chip) { |
380 | case BCM43241_CHIP_ID: | ||
381 | ci->c_inf[0].wrapbase = 0x18100000; | ||
382 | ci->c_inf[0].cib = 0x2a084411; | ||
383 | ci->c_inf[1].id = BCMA_CORE_SDIO_DEV; | ||
384 | ci->c_inf[1].base = 0x18002000; | ||
385 | ci->c_inf[1].wrapbase = 0x18102000; | ||
386 | ci->c_inf[1].cib = 0x0e004211; | ||
387 | ci->c_inf[2].id = BCMA_CORE_INTERNAL_MEM; | ||
388 | ci->c_inf[2].base = 0x18004000; | ||
389 | ci->c_inf[2].wrapbase = 0x18104000; | ||
390 | ci->c_inf[2].cib = 0x14080401; | ||
391 | ci->c_inf[3].id = BCMA_CORE_ARM_CM3; | ||
392 | ci->c_inf[3].base = 0x18003000; | ||
393 | ci->c_inf[3].wrapbase = 0x18103000; | ||
394 | ci->c_inf[3].cib = 0x07004211; | ||
395 | ci->ramsize = 0x90000; | ||
396 | break; | ||
380 | case BCM4329_CHIP_ID: | 397 | case BCM4329_CHIP_ID: |
381 | ci->c_inf[1].id = BCMA_CORE_SDIO_DEV; | 398 | ci->c_inf[1].id = BCMA_CORE_SDIO_DEV; |
382 | ci->c_inf[1].base = BCM4329_CORE_BUS_BASE; | 399 | ci->c_inf[1].base = BCM4329_CORE_BUS_BASE; |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/brcm80211/brcmfmac/usb.c index a299d42da8e7..c6d5aeb27a02 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c | |||
@@ -66,7 +66,9 @@ | |||
66 | #define BRCMF_USB_CBCTL_READ 1 | 66 | #define BRCMF_USB_CBCTL_READ 1 |
67 | #define BRCMF_USB_MAX_PKT_SIZE 1600 | 67 | #define BRCMF_USB_MAX_PKT_SIZE 1600 |
68 | 68 | ||
69 | #define BRCMF_USB_43143_FW_NAME "brcm/brcmfmac43143.bin" | ||
69 | #define BRCMF_USB_43236_FW_NAME "brcm/brcmfmac43236b.bin" | 70 | #define BRCMF_USB_43236_FW_NAME "brcm/brcmfmac43236b.bin" |
71 | #define BRCMF_USB_43242_FW_NAME "brcm/brcmfmac43242a.bin" | ||
70 | 72 | ||
71 | enum usbdev_suspend_state { | 73 | enum usbdev_suspend_state { |
72 | USBOS_SUSPEND_STATE_DEVICE_ACTIVE = 0, /* Device is busy, won't allow | 74 | USBOS_SUSPEND_STATE_DEVICE_ACTIVE = 0, /* Device is busy, won't allow |
@@ -78,20 +80,6 @@ enum usbdev_suspend_state { | |||
78 | USBOS_SUSPEND_STATE_SUSPENDED /* Device suspended */ | 80 | USBOS_SUSPEND_STATE_SUSPENDED /* Device suspended */ |
79 | }; | 81 | }; |
80 | 82 | ||
81 | struct brcmf_usb_probe_info { | ||
82 | void *usbdev_info; | ||
83 | struct usb_device *usb; /* USB device pointer from OS */ | ||
84 | uint rx_pipe, tx_pipe, intr_pipe, rx_pipe2; | ||
85 | int intr_size; /* Size of interrupt message */ | ||
86 | int interval; /* Interrupt polling interval */ | ||
87 | int vid; | ||
88 | int pid; | ||
89 | enum usb_device_speed device_speed; | ||
90 | enum usbdev_suspend_state suspend_state; | ||
91 | struct usb_interface *intf; | ||
92 | }; | ||
93 | static struct brcmf_usb_probe_info usbdev_probe_info; | ||
94 | |||
95 | struct brcmf_usb_image { | 83 | struct brcmf_usb_image { |
96 | void *data; | 84 | void *data; |
97 | u32 len; | 85 | u32 len; |
@@ -117,9 +105,8 @@ struct brcmf_usbdev_info { | |||
117 | int rx_low_watermark; | 105 | int rx_low_watermark; |
118 | int tx_low_watermark; | 106 | int tx_low_watermark; |
119 | int tx_high_watermark; | 107 | int tx_high_watermark; |
120 | bool txoff; | 108 | int tx_freecount; |
121 | bool rxoff; | 109 | bool tx_flowblock; |
122 | bool txoverride; | ||
123 | 110 | ||
124 | struct brcmf_usbreq *tx_reqs; | 111 | struct brcmf_usbreq *tx_reqs; |
125 | struct brcmf_usbreq *rx_reqs; | 112 | struct brcmf_usbreq *rx_reqs; |
@@ -133,7 +120,6 @@ struct brcmf_usbdev_info { | |||
133 | 120 | ||
134 | struct usb_device *usbdev; | 121 | struct usb_device *usbdev; |
135 | struct device *dev; | 122 | struct device *dev; |
136 | enum usb_device_speed device_speed; | ||
137 | 123 | ||
138 | int ctl_in_pipe, ctl_out_pipe; | 124 | int ctl_in_pipe, ctl_out_pipe; |
139 | struct urb *ctl_urb; /* URB for control endpoint */ | 125 | struct urb *ctl_urb; /* URB for control endpoint */ |
@@ -153,9 +139,6 @@ struct brcmf_usbdev_info { | |||
153 | int intr_size; /* Size of interrupt message */ | 139 | int intr_size; /* Size of interrupt message */ |
154 | int interval; /* Interrupt polling interval */ | 140 | int interval; /* Interrupt polling interval */ |
155 | struct intr_transfer_buf intr; /* Data buffer for interrupt endpoint */ | 141 | struct intr_transfer_buf intr; /* Data buffer for interrupt endpoint */ |
156 | |||
157 | struct brcmf_usb_probe_info probe_info; | ||
158 | |||
159 | }; | 142 | }; |
160 | 143 | ||
161 | static void brcmf_usb_rx_refill(struct brcmf_usbdev_info *devinfo, | 144 | static void brcmf_usb_rx_refill(struct brcmf_usbdev_info *devinfo, |
@@ -177,14 +160,6 @@ static struct brcmf_usbdev_info *brcmf_usb_get_businfo(struct device *dev) | |||
177 | return brcmf_usb_get_buspub(dev)->devinfo; | 160 | return brcmf_usb_get_buspub(dev)->devinfo; |
178 | } | 161 | } |
179 | 162 | ||
180 | #if 0 | ||
181 | static void | ||
182 | brcmf_usb_txflowcontrol(struct brcmf_usbdev_info *devinfo, bool onoff) | ||
183 | { | ||
184 | dhd_txflowcontrol(devinfo->bus_pub.netdev, 0, onoff); | ||
185 | } | ||
186 | #endif | ||
187 | |||
188 | static int brcmf_usb_ioctl_resp_wait(struct brcmf_usbdev_info *devinfo, | 163 | static int brcmf_usb_ioctl_resp_wait(struct brcmf_usbdev_info *devinfo, |
189 | uint *condition, bool *pending) | 164 | uint *condition, bool *pending) |
190 | { | 165 | { |
@@ -366,13 +341,13 @@ static int brcmf_usb_tx_ctlpkt(struct device *dev, u8 *buf, u32 len) | |||
366 | if (test_and_set_bit(0, &devinfo->ctl_op)) | 341 | if (test_and_set_bit(0, &devinfo->ctl_op)) |
367 | return -EIO; | 342 | return -EIO; |
368 | 343 | ||
344 | devinfo->ctl_completed = false; | ||
369 | err = brcmf_usb_send_ctl(devinfo, buf, len); | 345 | err = brcmf_usb_send_ctl(devinfo, buf, len); |
370 | if (err) { | 346 | if (err) { |
371 | brcmf_dbg(ERROR, "fail %d bytes: %d\n", err, len); | 347 | brcmf_dbg(ERROR, "fail %d bytes: %d\n", err, len); |
372 | return err; | 348 | return err; |
373 | } | 349 | } |
374 | 350 | ||
375 | devinfo->ctl_completed = false; | ||
376 | timeout = brcmf_usb_ioctl_resp_wait(devinfo, &devinfo->ctl_completed, | 351 | timeout = brcmf_usb_ioctl_resp_wait(devinfo, &devinfo->ctl_completed, |
377 | &pending); | 352 | &pending); |
378 | clear_bit(0, &devinfo->ctl_op); | 353 | clear_bit(0, &devinfo->ctl_op); |
@@ -418,7 +393,7 @@ static int brcmf_usb_rx_ctlpkt(struct device *dev, u8 *buf, u32 len) | |||
418 | } | 393 | } |
419 | 394 | ||
420 | static struct brcmf_usbreq *brcmf_usb_deq(struct brcmf_usbdev_info *devinfo, | 395 | static struct brcmf_usbreq *brcmf_usb_deq(struct brcmf_usbdev_info *devinfo, |
421 | struct list_head *q) | 396 | struct list_head *q, int *counter) |
422 | { | 397 | { |
423 | unsigned long flags; | 398 | unsigned long flags; |
424 | struct brcmf_usbreq *req; | 399 | struct brcmf_usbreq *req; |
@@ -429,17 +404,22 @@ static struct brcmf_usbreq *brcmf_usb_deq(struct brcmf_usbdev_info *devinfo, | |||
429 | } | 404 | } |
430 | req = list_entry(q->next, struct brcmf_usbreq, list); | 405 | req = list_entry(q->next, struct brcmf_usbreq, list); |
431 | list_del_init(q->next); | 406 | list_del_init(q->next); |
407 | if (counter) | ||
408 | (*counter)--; | ||
432 | spin_unlock_irqrestore(&devinfo->qlock, flags); | 409 | spin_unlock_irqrestore(&devinfo->qlock, flags); |
433 | return req; | 410 | return req; |
434 | 411 | ||
435 | } | 412 | } |
436 | 413 | ||
437 | static void brcmf_usb_enq(struct brcmf_usbdev_info *devinfo, | 414 | static void brcmf_usb_enq(struct brcmf_usbdev_info *devinfo, |
438 | struct list_head *q, struct brcmf_usbreq *req) | 415 | struct list_head *q, struct brcmf_usbreq *req, |
416 | int *counter) | ||
439 | { | 417 | { |
440 | unsigned long flags; | 418 | unsigned long flags; |
441 | spin_lock_irqsave(&devinfo->qlock, flags); | 419 | spin_lock_irqsave(&devinfo->qlock, flags); |
442 | list_add_tail(&req->list, q); | 420 | list_add_tail(&req->list, q); |
421 | if (counter) | ||
422 | (*counter)++; | ||
443 | spin_unlock_irqrestore(&devinfo->qlock, flags); | 423 | spin_unlock_irqrestore(&devinfo->qlock, flags); |
444 | } | 424 | } |
445 | 425 | ||
@@ -519,10 +499,14 @@ static void brcmf_usb_tx_complete(struct urb *urb) | |||
519 | else | 499 | else |
520 | devinfo->bus_pub.bus->dstats.tx_errors++; | 500 | devinfo->bus_pub.bus->dstats.tx_errors++; |
521 | 501 | ||
522 | dev_kfree_skb(req->skb); | 502 | brcmu_pkt_buf_free_skb(req->skb); |
523 | req->skb = NULL; | 503 | req->skb = NULL; |
524 | brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req); | 504 | brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req, &devinfo->tx_freecount); |
525 | 505 | if (devinfo->tx_freecount > devinfo->tx_high_watermark && | |
506 | devinfo->tx_flowblock) { | ||
507 | brcmf_txflowblock(devinfo->dev, false); | ||
508 | devinfo->tx_flowblock = false; | ||
509 | } | ||
526 | } | 510 | } |
527 | 511 | ||
528 | static void brcmf_usb_rx_complete(struct urb *urb) | 512 | static void brcmf_usb_rx_complete(struct urb *urb) |
@@ -540,8 +524,8 @@ static void brcmf_usb_rx_complete(struct urb *urb) | |||
540 | devinfo->bus_pub.bus->dstats.rx_packets++; | 524 | devinfo->bus_pub.bus->dstats.rx_packets++; |
541 | } else { | 525 | } else { |
542 | devinfo->bus_pub.bus->dstats.rx_errors++; | 526 | devinfo->bus_pub.bus->dstats.rx_errors++; |
543 | dev_kfree_skb(skb); | 527 | brcmu_pkt_buf_free_skb(skb); |
544 | brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req); | 528 | brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req, NULL); |
545 | return; | 529 | return; |
546 | } | 530 | } |
547 | 531 | ||
@@ -551,12 +535,12 @@ static void brcmf_usb_rx_complete(struct urb *urb) | |||
551 | brcmf_dbg(ERROR, "rx protocol error\n"); | 535 | brcmf_dbg(ERROR, "rx protocol error\n"); |
552 | brcmu_pkt_buf_free_skb(skb); | 536 | brcmu_pkt_buf_free_skb(skb); |
553 | devinfo->bus_pub.bus->dstats.rx_errors++; | 537 | devinfo->bus_pub.bus->dstats.rx_errors++; |
554 | } else { | 538 | } else |
555 | brcmf_rx_packet(devinfo->dev, ifidx, skb); | 539 | brcmf_rx_packet(devinfo->dev, ifidx, skb); |
556 | brcmf_usb_rx_refill(devinfo, req); | 540 | brcmf_usb_rx_refill(devinfo, req); |
557 | } | ||
558 | } else { | 541 | } else { |
559 | dev_kfree_skb(skb); | 542 | brcmu_pkt_buf_free_skb(skb); |
543 | brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req, NULL); | ||
560 | } | 544 | } |
561 | return; | 545 | return; |
562 | 546 | ||
@@ -573,7 +557,7 @@ static void brcmf_usb_rx_refill(struct brcmf_usbdev_info *devinfo, | |||
573 | 557 | ||
574 | skb = dev_alloc_skb(devinfo->bus_pub.bus_mtu); | 558 | skb = dev_alloc_skb(devinfo->bus_pub.bus_mtu); |
575 | if (!skb) { | 559 | if (!skb) { |
576 | brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req); | 560 | brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req, NULL); |
577 | return; | 561 | return; |
578 | } | 562 | } |
579 | req->skb = skb; | 563 | req->skb = skb; |
@@ -581,16 +565,15 @@ static void brcmf_usb_rx_refill(struct brcmf_usbdev_info *devinfo, | |||
581 | usb_fill_bulk_urb(req->urb, devinfo->usbdev, devinfo->rx_pipe, | 565 | usb_fill_bulk_urb(req->urb, devinfo->usbdev, devinfo->rx_pipe, |
582 | skb->data, skb_tailroom(skb), brcmf_usb_rx_complete, | 566 | skb->data, skb_tailroom(skb), brcmf_usb_rx_complete, |
583 | req); | 567 | req); |
584 | req->urb->transfer_flags |= URB_ZERO_PACKET; | ||
585 | req->devinfo = devinfo; | 568 | req->devinfo = devinfo; |
569 | brcmf_usb_enq(devinfo, &devinfo->rx_postq, req, NULL); | ||
586 | 570 | ||
587 | ret = usb_submit_urb(req->urb, GFP_ATOMIC); | 571 | ret = usb_submit_urb(req->urb, GFP_ATOMIC); |
588 | if (ret == 0) { | 572 | if (ret) { |
589 | brcmf_usb_enq(devinfo, &devinfo->rx_postq, req); | 573 | brcmf_usb_del_fromq(devinfo, req); |
590 | } else { | 574 | brcmu_pkt_buf_free_skb(req->skb); |
591 | dev_kfree_skb(req->skb); | ||
592 | req->skb = NULL; | 575 | req->skb = NULL; |
593 | brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req); | 576 | brcmf_usb_enq(devinfo, &devinfo->rx_freeq, req, NULL); |
594 | } | 577 | } |
595 | return; | 578 | return; |
596 | } | 579 | } |
@@ -603,7 +586,7 @@ static void brcmf_usb_rx_fill_all(struct brcmf_usbdev_info *devinfo) | |||
603 | brcmf_dbg(ERROR, "bus is not up\n"); | 586 | brcmf_dbg(ERROR, "bus is not up\n"); |
604 | return; | 587 | return; |
605 | } | 588 | } |
606 | while ((req = brcmf_usb_deq(devinfo, &devinfo->rx_freeq)) != NULL) | 589 | while ((req = brcmf_usb_deq(devinfo, &devinfo->rx_freeq, NULL)) != NULL) |
607 | brcmf_usb_rx_refill(devinfo, req); | 590 | brcmf_usb_rx_refill(devinfo, req); |
608 | } | 591 | } |
609 | 592 | ||
@@ -681,27 +664,34 @@ static int brcmf_usb_tx(struct device *dev, struct sk_buff *skb) | |||
681 | return -EIO; | 664 | return -EIO; |
682 | } | 665 | } |
683 | 666 | ||
684 | req = brcmf_usb_deq(devinfo, &devinfo->tx_freeq); | 667 | req = brcmf_usb_deq(devinfo, &devinfo->tx_freeq, |
668 | &devinfo->tx_freecount); | ||
685 | if (!req) { | 669 | if (!req) { |
670 | brcmu_pkt_buf_free_skb(skb); | ||
686 | brcmf_dbg(ERROR, "no req to send\n"); | 671 | brcmf_dbg(ERROR, "no req to send\n"); |
687 | return -ENOMEM; | 672 | return -ENOMEM; |
688 | } | 673 | } |
689 | if (!req->urb) { | ||
690 | brcmf_dbg(ERROR, "no urb for req %p\n", req); | ||
691 | return -ENOBUFS; | ||
692 | } | ||
693 | 674 | ||
694 | req->skb = skb; | 675 | req->skb = skb; |
695 | req->devinfo = devinfo; | 676 | req->devinfo = devinfo; |
696 | usb_fill_bulk_urb(req->urb, devinfo->usbdev, devinfo->tx_pipe, | 677 | usb_fill_bulk_urb(req->urb, devinfo->usbdev, devinfo->tx_pipe, |
697 | skb->data, skb->len, brcmf_usb_tx_complete, req); | 678 | skb->data, skb->len, brcmf_usb_tx_complete, req); |
698 | req->urb->transfer_flags |= URB_ZERO_PACKET; | 679 | req->urb->transfer_flags |= URB_ZERO_PACKET; |
680 | brcmf_usb_enq(devinfo, &devinfo->tx_postq, req, NULL); | ||
699 | ret = usb_submit_urb(req->urb, GFP_ATOMIC); | 681 | ret = usb_submit_urb(req->urb, GFP_ATOMIC); |
700 | if (!ret) { | 682 | if (ret) { |
701 | brcmf_usb_enq(devinfo, &devinfo->tx_postq, req); | 683 | brcmf_dbg(ERROR, "brcmf_usb_tx usb_submit_urb FAILED\n"); |
702 | } else { | 684 | brcmf_usb_del_fromq(devinfo, req); |
685 | brcmu_pkt_buf_free_skb(req->skb); | ||
703 | req->skb = NULL; | 686 | req->skb = NULL; |
704 | brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req); | 687 | brcmf_usb_enq(devinfo, &devinfo->tx_freeq, req, |
688 | &devinfo->tx_freecount); | ||
689 | } else { | ||
690 | if (devinfo->tx_freecount < devinfo->tx_low_watermark && | ||
691 | !devinfo->tx_flowblock) { | ||
692 | brcmf_txflowblock(dev, true); | ||
693 | devinfo->tx_flowblock = true; | ||
694 | } | ||
705 | } | 695 | } |
706 | 696 | ||
707 | return ret; | 697 | return ret; |
@@ -1112,10 +1102,14 @@ static int brcmf_usb_dlrun(struct brcmf_usbdev_info *devinfo) | |||
1112 | static bool brcmf_usb_chip_support(int chipid, int chiprev) | 1102 | static bool brcmf_usb_chip_support(int chipid, int chiprev) |
1113 | { | 1103 | { |
1114 | switch(chipid) { | 1104 | switch(chipid) { |
1105 | case 43143: | ||
1106 | return true; | ||
1115 | case 43235: | 1107 | case 43235: |
1116 | case 43236: | 1108 | case 43236: |
1117 | case 43238: | 1109 | case 43238: |
1118 | return (chiprev == 3); | 1110 | return (chiprev == 3); |
1111 | case 43242: | ||
1112 | return true; | ||
1119 | default: | 1113 | default: |
1120 | break; | 1114 | break; |
1121 | } | 1115 | } |
@@ -1154,11 +1148,8 @@ brcmf_usb_fw_download(struct brcmf_usbdev_info *devinfo) | |||
1154 | } | 1148 | } |
1155 | 1149 | ||
1156 | 1150 | ||
1157 | static void brcmf_usb_detach(const struct brcmf_usbdev *bus_pub) | 1151 | static void brcmf_usb_detach(struct brcmf_usbdev_info *devinfo) |
1158 | { | 1152 | { |
1159 | struct brcmf_usbdev_info *devinfo = | ||
1160 | (struct brcmf_usbdev_info *)bus_pub; | ||
1161 | |||
1162 | brcmf_dbg(TRACE, "devinfo %p\n", devinfo); | 1153 | brcmf_dbg(TRACE, "devinfo %p\n", devinfo); |
1163 | 1154 | ||
1164 | /* store the image globally */ | 1155 | /* store the image globally */ |
@@ -1175,7 +1166,6 @@ static void brcmf_usb_detach(const struct brcmf_usbdev *bus_pub) | |||
1175 | 1166 | ||
1176 | kfree(devinfo->tx_reqs); | 1167 | kfree(devinfo->tx_reqs); |
1177 | kfree(devinfo->rx_reqs); | 1168 | kfree(devinfo->rx_reqs); |
1178 | kfree(devinfo); | ||
1179 | } | 1169 | } |
1180 | 1170 | ||
1181 | #define TRX_MAGIC 0x30524448 /* "HDR0" */ | 1171 | #define TRX_MAGIC 0x30524448 /* "HDR0" */ |
@@ -1228,7 +1218,22 @@ static int brcmf_usb_get_fw(struct brcmf_usbdev_info *devinfo) | |||
1228 | if (devinfo->image) | 1218 | if (devinfo->image) |
1229 | return 0; | 1219 | return 0; |
1230 | 1220 | ||
1231 | fwname = BRCMF_USB_43236_FW_NAME; | 1221 | switch (devinfo->bus_pub.devid) { |
1222 | case 43143: | ||
1223 | fwname = BRCMF_USB_43143_FW_NAME; | ||
1224 | break; | ||
1225 | case 43235: | ||
1226 | case 43236: | ||
1227 | case 43238: | ||
1228 | fwname = BRCMF_USB_43236_FW_NAME; | ||
1229 | break; | ||
1230 | case 43242: | ||
1231 | fwname = BRCMF_USB_43242_FW_NAME; | ||
1232 | break; | ||
1233 | default: | ||
1234 | return -EINVAL; | ||
1235 | break; | ||
1236 | } | ||
1232 | 1237 | ||
1233 | err = request_firmware(&fw, fwname, devinfo->dev); | 1238 | err = request_firmware(&fw, fwname, devinfo->dev); |
1234 | if (!fw) { | 1239 | if (!fw) { |
@@ -1253,14 +1258,9 @@ static int brcmf_usb_get_fw(struct brcmf_usbdev_info *devinfo) | |||
1253 | 1258 | ||
1254 | 1259 | ||
1255 | static | 1260 | static |
1256 | struct brcmf_usbdev *brcmf_usb_attach(int nrxq, int ntxq, struct device *dev) | 1261 | struct brcmf_usbdev *brcmf_usb_attach(struct brcmf_usbdev_info *devinfo, |
1262 | int nrxq, int ntxq) | ||
1257 | { | 1263 | { |
1258 | struct brcmf_usbdev_info *devinfo; | ||
1259 | |||
1260 | devinfo = kzalloc(sizeof(struct brcmf_usbdev_info), GFP_ATOMIC); | ||
1261 | if (devinfo == NULL) | ||
1262 | return NULL; | ||
1263 | |||
1264 | devinfo->bus_pub.nrxq = nrxq; | 1264 | devinfo->bus_pub.nrxq = nrxq; |
1265 | devinfo->rx_low_watermark = nrxq / 2; | 1265 | devinfo->rx_low_watermark = nrxq / 2; |
1266 | devinfo->bus_pub.devinfo = devinfo; | 1266 | devinfo->bus_pub.devinfo = devinfo; |
@@ -1269,18 +1269,6 @@ struct brcmf_usbdev *brcmf_usb_attach(int nrxq, int ntxq, struct device *dev) | |||
1269 | /* flow control when too many tx urbs posted */ | 1269 | /* flow control when too many tx urbs posted */ |
1270 | devinfo->tx_low_watermark = ntxq / 4; | 1270 | devinfo->tx_low_watermark = ntxq / 4; |
1271 | devinfo->tx_high_watermark = devinfo->tx_low_watermark * 3; | 1271 | devinfo->tx_high_watermark = devinfo->tx_low_watermark * 3; |
1272 | devinfo->dev = dev; | ||
1273 | devinfo->usbdev = usbdev_probe_info.usb; | ||
1274 | devinfo->tx_pipe = usbdev_probe_info.tx_pipe; | ||
1275 | devinfo->rx_pipe = usbdev_probe_info.rx_pipe; | ||
1276 | devinfo->rx_pipe2 = usbdev_probe_info.rx_pipe2; | ||
1277 | devinfo->intr_pipe = usbdev_probe_info.intr_pipe; | ||
1278 | |||
1279 | devinfo->interval = usbdev_probe_info.interval; | ||
1280 | devinfo->intr_size = usbdev_probe_info.intr_size; | ||
1281 | |||
1282 | memcpy(&devinfo->probe_info, &usbdev_probe_info, | ||
1283 | sizeof(struct brcmf_usb_probe_info)); | ||
1284 | devinfo->bus_pub.bus_mtu = BRCMF_USB_MAX_PKT_SIZE; | 1272 | devinfo->bus_pub.bus_mtu = BRCMF_USB_MAX_PKT_SIZE; |
1285 | 1273 | ||
1286 | /* Initialize other structure content */ | 1274 | /* Initialize other structure content */ |
@@ -1295,6 +1283,8 @@ struct brcmf_usbdev *brcmf_usb_attach(int nrxq, int ntxq, struct device *dev) | |||
1295 | INIT_LIST_HEAD(&devinfo->tx_freeq); | 1283 | INIT_LIST_HEAD(&devinfo->tx_freeq); |
1296 | INIT_LIST_HEAD(&devinfo->tx_postq); | 1284 | INIT_LIST_HEAD(&devinfo->tx_postq); |
1297 | 1285 | ||
1286 | devinfo->tx_flowblock = false; | ||
1287 | |||
1298 | devinfo->rx_reqs = brcmf_usbdev_qinit(&devinfo->rx_freeq, nrxq); | 1288 | devinfo->rx_reqs = brcmf_usbdev_qinit(&devinfo->rx_freeq, nrxq); |
1299 | if (!devinfo->rx_reqs) | 1289 | if (!devinfo->rx_reqs) |
1300 | goto error; | 1290 | goto error; |
@@ -1302,6 +1292,7 @@ struct brcmf_usbdev *brcmf_usb_attach(int nrxq, int ntxq, struct device *dev) | |||
1302 | devinfo->tx_reqs = brcmf_usbdev_qinit(&devinfo->tx_freeq, ntxq); | 1292 | devinfo->tx_reqs = brcmf_usbdev_qinit(&devinfo->tx_freeq, ntxq); |
1303 | if (!devinfo->tx_reqs) | 1293 | if (!devinfo->tx_reqs) |
1304 | goto error; | 1294 | goto error; |
1295 | devinfo->tx_freecount = ntxq; | ||
1305 | 1296 | ||
1306 | devinfo->intr_urb = usb_alloc_urb(0, GFP_ATOMIC); | 1297 | devinfo->intr_urb = usb_alloc_urb(0, GFP_ATOMIC); |
1307 | if (!devinfo->intr_urb) { | 1298 | if (!devinfo->intr_urb) { |
@@ -1336,19 +1327,19 @@ struct brcmf_usbdev *brcmf_usb_attach(int nrxq, int ntxq, struct device *dev) | |||
1336 | 1327 | ||
1337 | error: | 1328 | error: |
1338 | brcmf_dbg(ERROR, "failed!\n"); | 1329 | brcmf_dbg(ERROR, "failed!\n"); |
1339 | brcmf_usb_detach(&devinfo->bus_pub); | 1330 | brcmf_usb_detach(devinfo); |
1340 | return NULL; | 1331 | return NULL; |
1341 | } | 1332 | } |
1342 | 1333 | ||
1343 | static int brcmf_usb_probe_cb(struct device *dev, const char *desc, | 1334 | static int brcmf_usb_probe_cb(struct brcmf_usbdev_info *devinfo, |
1344 | u32 bustype, u32 hdrlen) | 1335 | const char *desc, u32 bustype, u32 hdrlen) |
1345 | { | 1336 | { |
1346 | struct brcmf_bus *bus = NULL; | 1337 | struct brcmf_bus *bus = NULL; |
1347 | struct brcmf_usbdev *bus_pub = NULL; | 1338 | struct brcmf_usbdev *bus_pub = NULL; |
1348 | int ret; | 1339 | int ret; |
1340 | struct device *dev = devinfo->dev; | ||
1349 | 1341 | ||
1350 | 1342 | bus_pub = brcmf_usb_attach(devinfo, BRCMF_USB_NRXQ, BRCMF_USB_NTXQ); | |
1351 | bus_pub = brcmf_usb_attach(BRCMF_USB_NRXQ, BRCMF_USB_NTXQ, dev); | ||
1352 | if (!bus_pub) { | 1343 | if (!bus_pub) { |
1353 | ret = -ENODEV; | 1344 | ret = -ENODEV; |
1354 | goto fail; | 1345 | goto fail; |
@@ -1387,23 +1378,21 @@ static int brcmf_usb_probe_cb(struct device *dev, const char *desc, | |||
1387 | return 0; | 1378 | return 0; |
1388 | fail: | 1379 | fail: |
1389 | /* Release resources in reverse order */ | 1380 | /* Release resources in reverse order */ |
1390 | if (bus_pub) | ||
1391 | brcmf_usb_detach(bus_pub); | ||
1392 | kfree(bus); | 1381 | kfree(bus); |
1382 | brcmf_usb_detach(devinfo); | ||
1393 | return ret; | 1383 | return ret; |
1394 | } | 1384 | } |
1395 | 1385 | ||
1396 | static void | 1386 | static void |
1397 | brcmf_usb_disconnect_cb(struct brcmf_usbdev *bus_pub) | 1387 | brcmf_usb_disconnect_cb(struct brcmf_usbdev_info *devinfo) |
1398 | { | 1388 | { |
1399 | if (!bus_pub) | 1389 | if (!devinfo) |
1400 | return; | 1390 | return; |
1401 | brcmf_dbg(TRACE, "enter: bus_pub %p\n", bus_pub); | 1391 | brcmf_dbg(TRACE, "enter: bus_pub %p\n", devinfo); |
1402 | |||
1403 | brcmf_detach(bus_pub->devinfo->dev); | ||
1404 | kfree(bus_pub->bus); | ||
1405 | brcmf_usb_detach(bus_pub); | ||
1406 | 1392 | ||
1393 | brcmf_detach(devinfo->dev); | ||
1394 | kfree(devinfo->bus_pub.bus); | ||
1395 | brcmf_usb_detach(devinfo); | ||
1407 | } | 1396 | } |
1408 | 1397 | ||
1409 | static int | 1398 | static int |
@@ -1415,18 +1404,18 @@ brcmf_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1415 | struct usb_device *usb = interface_to_usbdev(intf); | 1404 | struct usb_device *usb = interface_to_usbdev(intf); |
1416 | int num_of_eps; | 1405 | int num_of_eps; |
1417 | u8 endpoint_num; | 1406 | u8 endpoint_num; |
1407 | struct brcmf_usbdev_info *devinfo; | ||
1418 | 1408 | ||
1419 | brcmf_dbg(TRACE, "enter\n"); | 1409 | brcmf_dbg(TRACE, "enter\n"); |
1420 | 1410 | ||
1421 | usbdev_probe_info.usb = usb; | 1411 | devinfo = kzalloc(sizeof(*devinfo), GFP_ATOMIC); |
1422 | usbdev_probe_info.intf = intf; | 1412 | if (devinfo == NULL) |
1413 | return -ENOMEM; | ||
1423 | 1414 | ||
1424 | if (id != NULL) { | 1415 | devinfo->usbdev = usb; |
1425 | usbdev_probe_info.vid = id->idVendor; | 1416 | devinfo->dev = &usb->dev; |
1426 | usbdev_probe_info.pid = id->idProduct; | ||
1427 | } | ||
1428 | 1417 | ||
1429 | usb_set_intfdata(intf, &usbdev_probe_info); | 1418 | usb_set_intfdata(intf, devinfo); |
1430 | 1419 | ||
1431 | /* Check that the device supports only one configuration */ | 1420 | /* Check that the device supports only one configuration */ |
1432 | if (usb->descriptor.bNumConfigurations != 1) { | 1421 | if (usb->descriptor.bNumConfigurations != 1) { |
@@ -1475,11 +1464,11 @@ brcmf_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1475 | } | 1464 | } |
1476 | 1465 | ||
1477 | endpoint_num = endpoint->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; | 1466 | endpoint_num = endpoint->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; |
1478 | usbdev_probe_info.intr_pipe = usb_rcvintpipe(usb, endpoint_num); | 1467 | devinfo->intr_pipe = usb_rcvintpipe(usb, endpoint_num); |
1479 | 1468 | ||
1480 | usbdev_probe_info.rx_pipe = 0; | 1469 | devinfo->rx_pipe = 0; |
1481 | usbdev_probe_info.rx_pipe2 = 0; | 1470 | devinfo->rx_pipe2 = 0; |
1482 | usbdev_probe_info.tx_pipe = 0; | 1471 | devinfo->tx_pipe = 0; |
1483 | num_of_eps = IFDESC(usb, BULK_IF).bNumEndpoints - 1; | 1472 | num_of_eps = IFDESC(usb, BULK_IF).bNumEndpoints - 1; |
1484 | 1473 | ||
1485 | /* Check data endpoints and get pipes */ | 1474 | /* Check data endpoints and get pipes */ |
@@ -1496,35 +1485,33 @@ brcmf_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1496 | USB_ENDPOINT_NUMBER_MASK; | 1485 | USB_ENDPOINT_NUMBER_MASK; |
1497 | if ((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) | 1486 | if ((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) |
1498 | == USB_DIR_IN) { | 1487 | == USB_DIR_IN) { |
1499 | if (!usbdev_probe_info.rx_pipe) { | 1488 | if (!devinfo->rx_pipe) { |
1500 | usbdev_probe_info.rx_pipe = | 1489 | devinfo->rx_pipe = |
1501 | usb_rcvbulkpipe(usb, endpoint_num); | 1490 | usb_rcvbulkpipe(usb, endpoint_num); |
1502 | } else { | 1491 | } else { |
1503 | usbdev_probe_info.rx_pipe2 = | 1492 | devinfo->rx_pipe2 = |
1504 | usb_rcvbulkpipe(usb, endpoint_num); | 1493 | usb_rcvbulkpipe(usb, endpoint_num); |
1505 | } | 1494 | } |
1506 | } else { | 1495 | } else { |
1507 | usbdev_probe_info.tx_pipe = | 1496 | devinfo->tx_pipe = usb_sndbulkpipe(usb, endpoint_num); |
1508 | usb_sndbulkpipe(usb, endpoint_num); | ||
1509 | } | 1497 | } |
1510 | } | 1498 | } |
1511 | 1499 | ||
1512 | /* Allocate interrupt URB and data buffer */ | 1500 | /* Allocate interrupt URB and data buffer */ |
1513 | /* RNDIS says 8-byte intr, our old drivers used 4-byte */ | 1501 | /* RNDIS says 8-byte intr, our old drivers used 4-byte */ |
1514 | if (IFEPDESC(usb, CONTROL_IF, 0).wMaxPacketSize == cpu_to_le16(16)) | 1502 | if (IFEPDESC(usb, CONTROL_IF, 0).wMaxPacketSize == cpu_to_le16(16)) |
1515 | usbdev_probe_info.intr_size = 8; | 1503 | devinfo->intr_size = 8; |
1516 | else | 1504 | else |
1517 | usbdev_probe_info.intr_size = 4; | 1505 | devinfo->intr_size = 4; |
1518 | 1506 | ||
1519 | usbdev_probe_info.interval = IFEPDESC(usb, CONTROL_IF, 0).bInterval; | 1507 | devinfo->interval = IFEPDESC(usb, CONTROL_IF, 0).bInterval; |
1520 | 1508 | ||
1521 | usbdev_probe_info.device_speed = usb->speed; | ||
1522 | if (usb->speed == USB_SPEED_HIGH) | 1509 | if (usb->speed == USB_SPEED_HIGH) |
1523 | brcmf_dbg(INFO, "Broadcom high speed USB wireless device detected\n"); | 1510 | brcmf_dbg(INFO, "Broadcom high speed USB wireless device detected\n"); |
1524 | else | 1511 | else |
1525 | brcmf_dbg(INFO, "Broadcom full speed USB wireless device detected\n"); | 1512 | brcmf_dbg(INFO, "Broadcom full speed USB wireless device detected\n"); |
1526 | 1513 | ||
1527 | ret = brcmf_usb_probe_cb(&usb->dev, "", USB_BUS, 0); | 1514 | ret = brcmf_usb_probe_cb(devinfo, "", USB_BUS, 0); |
1528 | if (ret) | 1515 | if (ret) |
1529 | goto fail; | 1516 | goto fail; |
1530 | 1517 | ||
@@ -1533,6 +1520,7 @@ brcmf_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1533 | 1520 | ||
1534 | fail: | 1521 | fail: |
1535 | brcmf_dbg(ERROR, "failed with errno %d\n", ret); | 1522 | brcmf_dbg(ERROR, "failed with errno %d\n", ret); |
1523 | kfree(devinfo); | ||
1536 | usb_set_intfdata(intf, NULL); | 1524 | usb_set_intfdata(intf, NULL); |
1537 | return ret; | 1525 | return ret; |
1538 | 1526 | ||
@@ -1541,11 +1529,12 @@ fail: | |||
1541 | static void | 1529 | static void |
1542 | brcmf_usb_disconnect(struct usb_interface *intf) | 1530 | brcmf_usb_disconnect(struct usb_interface *intf) |
1543 | { | 1531 | { |
1544 | struct usb_device *usb = interface_to_usbdev(intf); | 1532 | struct brcmf_usbdev_info *devinfo; |
1545 | 1533 | ||
1546 | brcmf_dbg(TRACE, "enter\n"); | 1534 | brcmf_dbg(TRACE, "enter\n"); |
1547 | brcmf_usb_disconnect_cb(brcmf_usb_get_buspub(&usb->dev)); | 1535 | devinfo = (struct brcmf_usbdev_info *)usb_get_intfdata(intf); |
1548 | usb_set_intfdata(intf, NULL); | 1536 | brcmf_usb_disconnect_cb(devinfo); |
1537 | kfree(devinfo); | ||
1549 | } | 1538 | } |
1550 | 1539 | ||
1551 | /* | 1540 | /* |
@@ -1577,17 +1566,23 @@ static int brcmf_usb_resume(struct usb_interface *intf) | |||
1577 | } | 1566 | } |
1578 | 1567 | ||
1579 | #define BRCMF_USB_VENDOR_ID_BROADCOM 0x0a5c | 1568 | #define BRCMF_USB_VENDOR_ID_BROADCOM 0x0a5c |
1569 | #define BRCMF_USB_DEVICE_ID_43143 0xbd1e | ||
1580 | #define BRCMF_USB_DEVICE_ID_43236 0xbd17 | 1570 | #define BRCMF_USB_DEVICE_ID_43236 0xbd17 |
1571 | #define BRCMF_USB_DEVICE_ID_43242 0xbd1f | ||
1581 | #define BRCMF_USB_DEVICE_ID_BCMFW 0x0bdc | 1572 | #define BRCMF_USB_DEVICE_ID_BCMFW 0x0bdc |
1582 | 1573 | ||
1583 | static struct usb_device_id brcmf_usb_devid_table[] = { | 1574 | static struct usb_device_id brcmf_usb_devid_table[] = { |
1575 | { USB_DEVICE(BRCMF_USB_VENDOR_ID_BROADCOM, BRCMF_USB_DEVICE_ID_43143) }, | ||
1584 | { USB_DEVICE(BRCMF_USB_VENDOR_ID_BROADCOM, BRCMF_USB_DEVICE_ID_43236) }, | 1576 | { USB_DEVICE(BRCMF_USB_VENDOR_ID_BROADCOM, BRCMF_USB_DEVICE_ID_43236) }, |
1577 | { USB_DEVICE(BRCMF_USB_VENDOR_ID_BROADCOM, BRCMF_USB_DEVICE_ID_43242) }, | ||
1585 | /* special entry for device with firmware loaded and running */ | 1578 | /* special entry for device with firmware loaded and running */ |
1586 | { USB_DEVICE(BRCMF_USB_VENDOR_ID_BROADCOM, BRCMF_USB_DEVICE_ID_BCMFW) }, | 1579 | { USB_DEVICE(BRCMF_USB_VENDOR_ID_BROADCOM, BRCMF_USB_DEVICE_ID_BCMFW) }, |
1587 | { } | 1580 | { } |
1588 | }; | 1581 | }; |
1589 | MODULE_DEVICE_TABLE(usb, brcmf_usb_devid_table); | 1582 | MODULE_DEVICE_TABLE(usb, brcmf_usb_devid_table); |
1583 | MODULE_FIRMWARE(BRCMF_USB_43143_FW_NAME); | ||
1590 | MODULE_FIRMWARE(BRCMF_USB_43236_FW_NAME); | 1584 | MODULE_FIRMWARE(BRCMF_USB_43236_FW_NAME); |
1585 | MODULE_FIRMWARE(BRCMF_USB_43242_FW_NAME); | ||
1591 | 1586 | ||
1592 | /* TODO: suspend and resume entries */ | 1587 | /* TODO: suspend and resume entries */ |
1593 | static struct usb_driver brcmf_usbdrvr = { | 1588 | static struct usb_driver brcmf_usbdrvr = { |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index 28c5fbb4af26..65cf8f92cb3e 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/ieee80211.h> | 28 | #include <linux/ieee80211.h> |
29 | #include <linux/uaccess.h> | 29 | #include <linux/uaccess.h> |
30 | #include <net/cfg80211.h> | 30 | #include <net/cfg80211.h> |
31 | #include <net/netlink.h> | ||
31 | 32 | ||
32 | #include <brcmu_utils.h> | 33 | #include <brcmu_utils.h> |
33 | #include <defs.h> | 34 | #include <defs.h> |
@@ -489,8 +490,8 @@ static void brcmf_set_mpc(struct net_device *ndev, int mpc) | |||
489 | } | 490 | } |
490 | } | 491 | } |
491 | 492 | ||
492 | static void wl_iscan_prep(struct brcmf_scan_params_le *params_le, | 493 | static void brcmf_iscan_prep(struct brcmf_scan_params_le *params_le, |
493 | struct brcmf_ssid *ssid) | 494 | struct brcmf_ssid *ssid) |
494 | { | 495 | { |
495 | memcpy(params_le->bssid, ether_bcast, ETH_ALEN); | 496 | memcpy(params_le->bssid, ether_bcast, ETH_ALEN); |
496 | params_le->bss_type = DOT11_BSSTYPE_ANY; | 497 | params_le->bss_type = DOT11_BSSTYPE_ANY; |
@@ -544,7 +545,7 @@ brcmf_run_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan, | |||
544 | return -ENOMEM; | 545 | return -ENOMEM; |
545 | BUG_ON(params_size >= BRCMF_DCMD_SMLEN); | 546 | BUG_ON(params_size >= BRCMF_DCMD_SMLEN); |
546 | 547 | ||
547 | wl_iscan_prep(¶ms->params_le, ssid); | 548 | brcmf_iscan_prep(¶ms->params_le, ssid); |
548 | 549 | ||
549 | params->version = cpu_to_le32(BRCMF_ISCAN_REQ_VERSION); | 550 | params->version = cpu_to_le32(BRCMF_ISCAN_REQ_VERSION); |
550 | params->action = cpu_to_le16(action); | 551 | params->action = cpu_to_le16(action); |
@@ -597,9 +598,9 @@ static s32 brcmf_do_iscan(struct brcmf_cfg80211_priv *cfg_priv) | |||
597 | } | 598 | } |
598 | 599 | ||
599 | static s32 | 600 | static s32 |
600 | __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev, | 601 | brcmf_cfg80211_iscan(struct wiphy *wiphy, struct net_device *ndev, |
601 | struct cfg80211_scan_request *request, | 602 | struct cfg80211_scan_request *request, |
602 | struct cfg80211_ssid *this_ssid) | 603 | struct cfg80211_ssid *this_ssid) |
603 | { | 604 | { |
604 | struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev); | 605 | struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev); |
605 | struct cfg80211_ssid *ssids; | 606 | struct cfg80211_ssid *ssids; |
@@ -690,11 +691,342 @@ scan_out: | |||
690 | return err; | 691 | return err; |
691 | } | 692 | } |
692 | 693 | ||
694 | static void brcmf_escan_prep(struct brcmf_scan_params_le *params_le, | ||
695 | struct cfg80211_scan_request *request) | ||
696 | { | ||
697 | u32 n_ssids; | ||
698 | u32 n_channels; | ||
699 | s32 i; | ||
700 | s32 offset; | ||
701 | __le16 chanspec; | ||
702 | u16 channel; | ||
703 | struct ieee80211_channel *req_channel; | ||
704 | char *ptr; | ||
705 | struct brcmf_ssid ssid; | ||
706 | |||
707 | memcpy(params_le->bssid, ether_bcast, ETH_ALEN); | ||
708 | params_le->bss_type = DOT11_BSSTYPE_ANY; | ||
709 | params_le->scan_type = 0; | ||
710 | params_le->channel_num = 0; | ||
711 | params_le->nprobes = cpu_to_le32(-1); | ||
712 | params_le->active_time = cpu_to_le32(-1); | ||
713 | params_le->passive_time = cpu_to_le32(-1); | ||
714 | params_le->home_time = cpu_to_le32(-1); | ||
715 | memset(¶ms_le->ssid_le, 0, sizeof(params_le->ssid_le)); | ||
716 | |||
717 | /* if request is null exit so it will be all channel broadcast scan */ | ||
718 | if (!request) | ||
719 | return; | ||
720 | |||
721 | n_ssids = request->n_ssids; | ||
722 | n_channels = request->n_channels; | ||
723 | /* Copy channel array if applicable */ | ||
724 | WL_SCAN("### List of channelspecs to scan ### %d\n", n_channels); | ||
725 | if (n_channels > 0) { | ||
726 | for (i = 0; i < n_channels; i++) { | ||
727 | chanspec = 0; | ||
728 | req_channel = request->channels[i]; | ||
729 | channel = ieee80211_frequency_to_channel( | ||
730 | req_channel->center_freq); | ||
731 | if (req_channel->band == IEEE80211_BAND_2GHZ) | ||
732 | chanspec |= WL_CHANSPEC_BAND_2G; | ||
733 | else | ||
734 | chanspec |= WL_CHANSPEC_BAND_5G; | ||
735 | |||
736 | if (req_channel->flags & IEEE80211_CHAN_NO_HT40) { | ||
737 | chanspec |= WL_CHANSPEC_BW_20; | ||
738 | chanspec |= WL_CHANSPEC_CTL_SB_NONE; | ||
739 | } else { | ||
740 | chanspec |= WL_CHANSPEC_BW_40; | ||
741 | if (req_channel->flags & | ||
742 | IEEE80211_CHAN_NO_HT40PLUS) | ||
743 | chanspec |= WL_CHANSPEC_CTL_SB_LOWER; | ||
744 | else | ||
745 | chanspec |= WL_CHANSPEC_CTL_SB_UPPER; | ||
746 | } | ||
747 | |||
748 | params_le->channel_list[i] = | ||
749 | (channel & WL_CHANSPEC_CHAN_MASK) | | ||
750 | chanspec; | ||
751 | WL_SCAN("Chan : %d, Channel spec: %x\n", | ||
752 | channel, params_le->channel_list[i]); | ||
753 | params_le->channel_list[i] = | ||
754 | cpu_to_le16(params_le->channel_list[i]); | ||
755 | } | ||
756 | } else { | ||
757 | WL_SCAN("Scanning all channels\n"); | ||
758 | } | ||
759 | /* Copy ssid array if applicable */ | ||
760 | WL_SCAN("### List of SSIDs to scan ### %d\n", n_ssids); | ||
761 | if (n_ssids > 0) { | ||
762 | offset = offsetof(struct brcmf_scan_params_le, channel_list) + | ||
763 | n_channels * sizeof(u16); | ||
764 | offset = roundup(offset, sizeof(u32)); | ||
765 | ptr = (char *)params_le + offset; | ||
766 | for (i = 0; i < n_ssids; i++) { | ||
767 | memset(&ssid, 0, sizeof(ssid)); | ||
768 | ssid.SSID_len = cpu_to_le32(request->ssids[i].ssid_len); | ||
769 | memcpy(ssid.SSID, request->ssids[i].ssid, | ||
770 | request->ssids[i].ssid_len); | ||
771 | if (!ssid.SSID_len) | ||
772 | WL_SCAN("%d: Broadcast scan\n", i); | ||
773 | else | ||
774 | WL_SCAN("%d: scan for %s size =%d\n", i, | ||
775 | ssid.SSID, ssid.SSID_len); | ||
776 | memcpy(ptr, &ssid, sizeof(ssid)); | ||
777 | ptr += sizeof(ssid); | ||
778 | } | ||
779 | } else { | ||
780 | WL_SCAN("Broadcast scan %p\n", request->ssids); | ||
781 | if ((request->ssids) && request->ssids->ssid_len) { | ||
782 | WL_SCAN("SSID %s len=%d\n", params_le->ssid_le.SSID, | ||
783 | request->ssids->ssid_len); | ||
784 | params_le->ssid_le.SSID_len = | ||
785 | cpu_to_le32(request->ssids->ssid_len); | ||
786 | memcpy(¶ms_le->ssid_le.SSID, request->ssids->ssid, | ||
787 | request->ssids->ssid_len); | ||
788 | } | ||
789 | } | ||
790 | /* Adding mask to channel numbers */ | ||
791 | params_le->channel_num = | ||
792 | cpu_to_le32((n_ssids << BRCMF_SCAN_PARAMS_NSSID_SHIFT) | | ||
793 | (n_channels & BRCMF_SCAN_PARAMS_COUNT_MASK)); | ||
794 | } | ||
795 | |||
796 | static s32 | ||
797 | brcmf_notify_escan_complete(struct brcmf_cfg80211_priv *cfg_priv, | ||
798 | struct net_device *ndev, | ||
799 | bool aborted, bool fw_abort) | ||
800 | { | ||
801 | struct brcmf_scan_params_le params_le; | ||
802 | struct cfg80211_scan_request *scan_request; | ||
803 | s32 err = 0; | ||
804 | |||
805 | WL_SCAN("Enter\n"); | ||
806 | |||
807 | /* clear scan request, because the FW abort can cause a second call */ | ||
808 | /* to this functon and might cause a double cfg80211_scan_done */ | ||
809 | scan_request = cfg_priv->scan_request; | ||
810 | cfg_priv->scan_request = NULL; | ||
811 | |||
812 | if (timer_pending(&cfg_priv->escan_timeout)) | ||
813 | del_timer_sync(&cfg_priv->escan_timeout); | ||
814 | |||
815 | if (fw_abort) { | ||
816 | /* Do a scan abort to stop the driver's scan engine */ | ||
817 | WL_SCAN("ABORT scan in firmware\n"); | ||
818 | memset(¶ms_le, 0, sizeof(params_le)); | ||
819 | memcpy(params_le.bssid, ether_bcast, ETH_ALEN); | ||
820 | params_le.bss_type = DOT11_BSSTYPE_ANY; | ||
821 | params_le.scan_type = 0; | ||
822 | params_le.channel_num = cpu_to_le32(1); | ||
823 | params_le.nprobes = cpu_to_le32(1); | ||
824 | params_le.active_time = cpu_to_le32(-1); | ||
825 | params_le.passive_time = cpu_to_le32(-1); | ||
826 | params_le.home_time = cpu_to_le32(-1); | ||
827 | /* Scan is aborted by setting channel_list[0] to -1 */ | ||
828 | params_le.channel_list[0] = cpu_to_le16(-1); | ||
829 | /* E-Scan (or anyother type) can be aborted by SCAN */ | ||
830 | err = brcmf_exec_dcmd(ndev, BRCMF_C_SCAN, ¶ms_le, | ||
831 | sizeof(params_le)); | ||
832 | if (err) | ||
833 | WL_ERR("Scan abort failed\n"); | ||
834 | } | ||
835 | if (scan_request) { | ||
836 | WL_SCAN("ESCAN Completed scan: %s\n", | ||
837 | aborted ? "Aborted" : "Done"); | ||
838 | cfg80211_scan_done(scan_request, aborted); | ||
839 | brcmf_set_mpc(ndev, 1); | ||
840 | } | ||
841 | if (!test_and_clear_bit(WL_STATUS_SCANNING, &cfg_priv->status)) { | ||
842 | WL_ERR("Scan complete while device not scanning\n"); | ||
843 | return -EPERM; | ||
844 | } | ||
845 | |||
846 | return err; | ||
847 | } | ||
848 | |||
849 | static s32 | ||
850 | brcmf_run_escan(struct brcmf_cfg80211_priv *cfg_priv, struct net_device *ndev, | ||
851 | struct cfg80211_scan_request *request, u16 action) | ||
852 | { | ||
853 | s32 params_size = BRCMF_SCAN_PARAMS_FIXED_SIZE + | ||
854 | offsetof(struct brcmf_escan_params_le, params_le); | ||
855 | struct brcmf_escan_params_le *params; | ||
856 | s32 err = 0; | ||
857 | |||
858 | WL_SCAN("E-SCAN START\n"); | ||
859 | |||
860 | if (request != NULL) { | ||
861 | /* Allocate space for populating ssids in struct */ | ||
862 | params_size += sizeof(u32) * ((request->n_channels + 1) / 2); | ||
863 | |||
864 | /* Allocate space for populating ssids in struct */ | ||
865 | params_size += sizeof(struct brcmf_ssid) * request->n_ssids; | ||
866 | } | ||
867 | |||
868 | params = kzalloc(params_size, GFP_KERNEL); | ||
869 | if (!params) { | ||
870 | err = -ENOMEM; | ||
871 | goto exit; | ||
872 | } | ||
873 | BUG_ON(params_size + sizeof("escan") >= BRCMF_DCMD_MEDLEN); | ||
874 | brcmf_escan_prep(¶ms->params_le, request); | ||
875 | params->version = cpu_to_le32(BRCMF_ESCAN_REQ_VERSION); | ||
876 | params->action = cpu_to_le16(action); | ||
877 | params->sync_id = cpu_to_le16(0x1234); | ||
878 | |||
879 | err = brcmf_dev_iovar_setbuf(ndev, "escan", params, params_size, | ||
880 | cfg_priv->escan_ioctl_buf, BRCMF_DCMD_MEDLEN); | ||
881 | if (err) { | ||
882 | if (err == -EBUSY) | ||
883 | WL_INFO("system busy : escan canceled\n"); | ||
884 | else | ||
885 | WL_ERR("error (%d)\n", err); | ||
886 | } | ||
887 | |||
888 | kfree(params); | ||
889 | exit: | ||
890 | return err; | ||
891 | } | ||
892 | |||
893 | static s32 | ||
894 | brcmf_do_escan(struct brcmf_cfg80211_priv *cfg_priv, struct wiphy *wiphy, | ||
895 | struct net_device *ndev, struct cfg80211_scan_request *request) | ||
896 | { | ||
897 | s32 err; | ||
898 | __le32 passive_scan; | ||
899 | struct brcmf_scan_results *results; | ||
900 | |||
901 | WL_SCAN("Enter\n"); | ||
902 | cfg_priv->escan_info.ndev = ndev; | ||
903 | cfg_priv->escan_info.wiphy = wiphy; | ||
904 | cfg_priv->escan_info.escan_state = WL_ESCAN_STATE_SCANNING; | ||
905 | passive_scan = cfg_priv->active_scan ? 0 : cpu_to_le32(1); | ||
906 | err = brcmf_exec_dcmd(ndev, BRCMF_C_SET_PASSIVE_SCAN, | ||
907 | &passive_scan, sizeof(passive_scan)); | ||
908 | if (err) { | ||
909 | WL_ERR("error (%d)\n", err); | ||
910 | return err; | ||
911 | } | ||
912 | brcmf_set_mpc(ndev, 0); | ||
913 | results = (struct brcmf_scan_results *)cfg_priv->escan_info.escan_buf; | ||
914 | results->version = 0; | ||
915 | results->count = 0; | ||
916 | results->buflen = WL_ESCAN_RESULTS_FIXED_SIZE; | ||
917 | |||
918 | err = brcmf_run_escan(cfg_priv, ndev, request, WL_ESCAN_ACTION_START); | ||
919 | if (err) | ||
920 | brcmf_set_mpc(ndev, 1); | ||
921 | return err; | ||
922 | } | ||
923 | |||
924 | static s32 | ||
925 | brcmf_cfg80211_escan(struct wiphy *wiphy, struct net_device *ndev, | ||
926 | struct cfg80211_scan_request *request, | ||
927 | struct cfg80211_ssid *this_ssid) | ||
928 | { | ||
929 | struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev); | ||
930 | struct cfg80211_ssid *ssids; | ||
931 | struct brcmf_cfg80211_scan_req *sr = cfg_priv->scan_req_int; | ||
932 | __le32 passive_scan; | ||
933 | bool escan_req; | ||
934 | bool spec_scan; | ||
935 | s32 err; | ||
936 | u32 SSID_len; | ||
937 | |||
938 | WL_SCAN("START ESCAN\n"); | ||
939 | |||
940 | if (test_bit(WL_STATUS_SCANNING, &cfg_priv->status)) { | ||
941 | WL_ERR("Scanning already : status (%lu)\n", cfg_priv->status); | ||
942 | return -EAGAIN; | ||
943 | } | ||
944 | if (test_bit(WL_STATUS_SCAN_ABORTING, &cfg_priv->status)) { | ||
945 | WL_ERR("Scanning being aborted : status (%lu)\n", | ||
946 | cfg_priv->status); | ||
947 | return -EAGAIN; | ||
948 | } | ||
949 | if (test_bit(WL_STATUS_CONNECTING, &cfg_priv->status)) { | ||
950 | WL_ERR("Connecting : status (%lu)\n", | ||
951 | cfg_priv->status); | ||
952 | return -EAGAIN; | ||
953 | } | ||
954 | |||
955 | /* Arm scan timeout timer */ | ||
956 | mod_timer(&cfg_priv->escan_timeout, jiffies + | ||
957 | WL_ESCAN_TIMER_INTERVAL_MS * HZ / 1000); | ||
958 | |||
959 | escan_req = false; | ||
960 | if (request) { | ||
961 | /* scan bss */ | ||
962 | ssids = request->ssids; | ||
963 | escan_req = true; | ||
964 | } else { | ||
965 | /* scan in ibss */ | ||
966 | /* we don't do escan in ibss */ | ||
967 | ssids = this_ssid; | ||
968 | } | ||
969 | |||
970 | cfg_priv->scan_request = request; | ||
971 | set_bit(WL_STATUS_SCANNING, &cfg_priv->status); | ||
972 | if (escan_req) { | ||
973 | err = brcmf_do_escan(cfg_priv, wiphy, ndev, request); | ||
974 | if (!err) | ||
975 | return err; | ||
976 | else | ||
977 | goto scan_out; | ||
978 | } else { | ||
979 | WL_SCAN("ssid \"%s\", ssid_len (%d)\n", | ||
980 | ssids->ssid, ssids->ssid_len); | ||
981 | memset(&sr->ssid_le, 0, sizeof(sr->ssid_le)); | ||
982 | SSID_len = min_t(u8, sizeof(sr->ssid_le.SSID), ssids->ssid_len); | ||
983 | sr->ssid_le.SSID_len = cpu_to_le32(0); | ||
984 | spec_scan = false; | ||
985 | if (SSID_len) { | ||
986 | memcpy(sr->ssid_le.SSID, ssids->ssid, SSID_len); | ||
987 | sr->ssid_le.SSID_len = cpu_to_le32(SSID_len); | ||
988 | spec_scan = true; | ||
989 | } else | ||
990 | WL_SCAN("Broadcast scan\n"); | ||
991 | |||
992 | passive_scan = cfg_priv->active_scan ? 0 : cpu_to_le32(1); | ||
993 | err = brcmf_exec_dcmd(ndev, BRCMF_C_SET_PASSIVE_SCAN, | ||
994 | &passive_scan, sizeof(passive_scan)); | ||
995 | if (err) { | ||
996 | WL_ERR("WLC_SET_PASSIVE_SCAN error (%d)\n", err); | ||
997 | goto scan_out; | ||
998 | } | ||
999 | brcmf_set_mpc(ndev, 0); | ||
1000 | err = brcmf_exec_dcmd(ndev, BRCMF_C_SCAN, &sr->ssid_le, | ||
1001 | sizeof(sr->ssid_le)); | ||
1002 | if (err) { | ||
1003 | if (err == -EBUSY) | ||
1004 | WL_INFO("BUSY: scan for \"%s\" canceled\n", | ||
1005 | sr->ssid_le.SSID); | ||
1006 | else | ||
1007 | WL_ERR("WLC_SCAN error (%d)\n", err); | ||
1008 | |||
1009 | brcmf_set_mpc(ndev, 1); | ||
1010 | goto scan_out; | ||
1011 | } | ||
1012 | } | ||
1013 | |||
1014 | return 0; | ||
1015 | |||
1016 | scan_out: | ||
1017 | clear_bit(WL_STATUS_SCANNING, &cfg_priv->status); | ||
1018 | if (timer_pending(&cfg_priv->escan_timeout)) | ||
1019 | del_timer_sync(&cfg_priv->escan_timeout); | ||
1020 | cfg_priv->scan_request = NULL; | ||
1021 | return err; | ||
1022 | } | ||
1023 | |||
693 | static s32 | 1024 | static s32 |
694 | brcmf_cfg80211_scan(struct wiphy *wiphy, | 1025 | brcmf_cfg80211_scan(struct wiphy *wiphy, |
695 | struct cfg80211_scan_request *request) | 1026 | struct cfg80211_scan_request *request) |
696 | { | 1027 | { |
697 | struct net_device *ndev = request->wdev->netdev; | 1028 | struct net_device *ndev = request->wdev->netdev; |
1029 | struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev); | ||
698 | s32 err = 0; | 1030 | s32 err = 0; |
699 | 1031 | ||
700 | WL_TRACE("Enter\n"); | 1032 | WL_TRACE("Enter\n"); |
@@ -702,7 +1034,11 @@ brcmf_cfg80211_scan(struct wiphy *wiphy, | |||
702 | if (!check_sys_up(wiphy)) | 1034 | if (!check_sys_up(wiphy)) |
703 | return -EIO; | 1035 | return -EIO; |
704 | 1036 | ||
705 | err = __brcmf_cfg80211_scan(wiphy, ndev, request, NULL); | 1037 | if (cfg_priv->iscan_on) |
1038 | err = brcmf_cfg80211_iscan(wiphy, ndev, request, NULL); | ||
1039 | else if (cfg_priv->escan_on) | ||
1040 | err = brcmf_cfg80211_escan(wiphy, ndev, request, NULL); | ||
1041 | |||
706 | if (err) | 1042 | if (err) |
707 | WL_ERR("scan error (%d)\n", err); | 1043 | WL_ERR("scan error (%d)\n", err); |
708 | 1044 | ||
@@ -1876,16 +2212,17 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev, | |||
1876 | } | 2212 | } |
1877 | 2213 | ||
1878 | if (test_bit(WL_STATUS_CONNECTED, &cfg_priv->status)) { | 2214 | if (test_bit(WL_STATUS_CONNECTED, &cfg_priv->status)) { |
1879 | scb_val.val = cpu_to_le32(0); | 2215 | memset(&scb_val, 0, sizeof(scb_val)); |
1880 | err = brcmf_exec_dcmd(ndev, BRCMF_C_GET_RSSI, &scb_val, | 2216 | err = brcmf_exec_dcmd(ndev, BRCMF_C_GET_RSSI, &scb_val, |
1881 | sizeof(struct brcmf_scb_val_le)); | 2217 | sizeof(struct brcmf_scb_val_le)); |
1882 | if (err) | 2218 | if (err) { |
1883 | WL_ERR("Could not get rssi (%d)\n", err); | 2219 | WL_ERR("Could not get rssi (%d)\n", err); |
1884 | 2220 | } else { | |
1885 | rssi = le32_to_cpu(scb_val.val); | 2221 | rssi = le32_to_cpu(scb_val.val); |
1886 | sinfo->filled |= STATION_INFO_SIGNAL; | 2222 | sinfo->filled |= STATION_INFO_SIGNAL; |
1887 | sinfo->signal = rssi; | 2223 | sinfo->signal = rssi; |
1888 | WL_CONN("RSSI %d dBm\n", rssi); | 2224 | WL_CONN("RSSI %d dBm\n", rssi); |
2225 | } | ||
1889 | } | 2226 | } |
1890 | 2227 | ||
1891 | done: | 2228 | done: |
@@ -2470,6 +2807,175 @@ static s32 brcmf_init_iscan(struct brcmf_cfg80211_priv *cfg_priv) | |||
2470 | return err; | 2807 | return err; |
2471 | } | 2808 | } |
2472 | 2809 | ||
2810 | static void brcmf_cfg80211_escan_timeout_worker(struct work_struct *work) | ||
2811 | { | ||
2812 | struct brcmf_cfg80211_priv *cfg_priv = | ||
2813 | container_of(work, struct brcmf_cfg80211_priv, | ||
2814 | escan_timeout_work); | ||
2815 | |||
2816 | brcmf_notify_escan_complete(cfg_priv, | ||
2817 | cfg_priv->escan_info.ndev, true, true); | ||
2818 | } | ||
2819 | |||
2820 | static void brcmf_escan_timeout(unsigned long data) | ||
2821 | { | ||
2822 | struct brcmf_cfg80211_priv *cfg_priv = | ||
2823 | (struct brcmf_cfg80211_priv *)data; | ||
2824 | |||
2825 | if (cfg_priv->scan_request) { | ||
2826 | WL_ERR("timer expired\n"); | ||
2827 | if (cfg_priv->escan_on) | ||
2828 | schedule_work(&cfg_priv->escan_timeout_work); | ||
2829 | } | ||
2830 | } | ||
2831 | |||
2832 | static s32 | ||
2833 | brcmf_compare_update_same_bss(struct brcmf_bss_info_le *bss, | ||
2834 | struct brcmf_bss_info_le *bss_info_le) | ||
2835 | { | ||
2836 | if (!memcmp(&bss_info_le->BSSID, &bss->BSSID, ETH_ALEN) && | ||
2837 | (CHSPEC_BAND(le16_to_cpu(bss_info_le->chanspec)) == | ||
2838 | CHSPEC_BAND(le16_to_cpu(bss->chanspec))) && | ||
2839 | bss_info_le->SSID_len == bss->SSID_len && | ||
2840 | !memcmp(bss_info_le->SSID, bss->SSID, bss_info_le->SSID_len)) { | ||
2841 | if ((bss->flags & WLC_BSS_RSSI_ON_CHANNEL) == | ||
2842 | (bss_info_le->flags & WLC_BSS_RSSI_ON_CHANNEL)) { | ||
2843 | /* preserve max RSSI if the measurements are | ||
2844 | * both on-channel or both off-channel | ||
2845 | */ | ||
2846 | if (bss_info_le->RSSI > bss->RSSI) | ||
2847 | bss->RSSI = bss_info_le->RSSI; | ||
2848 | } else if ((bss->flags & WLC_BSS_RSSI_ON_CHANNEL) && | ||
2849 | (bss_info_le->flags & WLC_BSS_RSSI_ON_CHANNEL) == 0) { | ||
2850 | /* preserve the on-channel rssi measurement | ||
2851 | * if the new measurement is off channel | ||
2852 | */ | ||
2853 | bss->RSSI = bss_info_le->RSSI; | ||
2854 | bss->flags |= WLC_BSS_RSSI_ON_CHANNEL; | ||
2855 | } | ||
2856 | return 1; | ||
2857 | } | ||
2858 | return 0; | ||
2859 | } | ||
2860 | |||
2861 | static s32 | ||
2862 | brcmf_cfg80211_escan_handler(struct brcmf_cfg80211_priv *cfg_priv, | ||
2863 | struct net_device *ndev, | ||
2864 | const struct brcmf_event_msg *e, void *data) | ||
2865 | { | ||
2866 | s32 status; | ||
2867 | s32 err = 0; | ||
2868 | struct brcmf_escan_result_le *escan_result_le; | ||
2869 | struct brcmf_bss_info_le *bss_info_le; | ||
2870 | struct brcmf_bss_info_le *bss = NULL; | ||
2871 | u32 bi_length; | ||
2872 | struct brcmf_scan_results *list; | ||
2873 | u32 i; | ||
2874 | |||
2875 | status = be32_to_cpu(e->status); | ||
2876 | |||
2877 | if (!ndev || !cfg_priv->escan_on || | ||
2878 | !test_bit(WL_STATUS_SCANNING, &cfg_priv->status)) { | ||
2879 | WL_ERR("scan not ready ndev %p wl->escan_on %d drv_status %x\n", | ||
2880 | ndev, cfg_priv->escan_on, | ||
2881 | !test_bit(WL_STATUS_SCANNING, &cfg_priv->status)); | ||
2882 | return -EPERM; | ||
2883 | } | ||
2884 | |||
2885 | if (status == BRCMF_E_STATUS_PARTIAL) { | ||
2886 | WL_SCAN("ESCAN Partial result\n"); | ||
2887 | escan_result_le = (struct brcmf_escan_result_le *) data; | ||
2888 | if (!escan_result_le) { | ||
2889 | WL_ERR("Invalid escan result (NULL pointer)\n"); | ||
2890 | goto exit; | ||
2891 | } | ||
2892 | if (!cfg_priv->scan_request) { | ||
2893 | WL_SCAN("result without cfg80211 request\n"); | ||
2894 | goto exit; | ||
2895 | } | ||
2896 | |||
2897 | if (le16_to_cpu(escan_result_le->bss_count) != 1) { | ||
2898 | WL_ERR("Invalid bss_count %d: ignoring\n", | ||
2899 | escan_result_le->bss_count); | ||
2900 | goto exit; | ||
2901 | } | ||
2902 | bss_info_le = &escan_result_le->bss_info_le; | ||
2903 | |||
2904 | bi_length = le32_to_cpu(bss_info_le->length); | ||
2905 | if (bi_length != (le32_to_cpu(escan_result_le->buflen) - | ||
2906 | WL_ESCAN_RESULTS_FIXED_SIZE)) { | ||
2907 | WL_ERR("Invalid bss_info length %d: ignoring\n", | ||
2908 | bi_length); | ||
2909 | goto exit; | ||
2910 | } | ||
2911 | |||
2912 | if (!(cfg_to_wiphy(cfg_priv)->interface_modes & | ||
2913 | BIT(NL80211_IFTYPE_ADHOC))) { | ||
2914 | if (le16_to_cpu(bss_info_le->capability) & | ||
2915 | WLAN_CAPABILITY_IBSS) { | ||
2916 | WL_ERR("Ignoring IBSS result\n"); | ||
2917 | goto exit; | ||
2918 | } | ||
2919 | } | ||
2920 | |||
2921 | list = (struct brcmf_scan_results *) | ||
2922 | cfg_priv->escan_info.escan_buf; | ||
2923 | if (bi_length > WL_ESCAN_BUF_SIZE - list->buflen) { | ||
2924 | WL_ERR("Buffer is too small: ignoring\n"); | ||
2925 | goto exit; | ||
2926 | } | ||
2927 | |||
2928 | for (i = 0; i < list->count; i++) { | ||
2929 | bss = bss ? (struct brcmf_bss_info_le *) | ||
2930 | ((unsigned char *)bss + | ||
2931 | le32_to_cpu(bss->length)) : list->bss_info_le; | ||
2932 | if (brcmf_compare_update_same_bss(bss, bss_info_le)) | ||
2933 | goto exit; | ||
2934 | } | ||
2935 | memcpy(&(cfg_priv->escan_info.escan_buf[list->buflen]), | ||
2936 | bss_info_le, bi_length); | ||
2937 | list->version = le32_to_cpu(bss_info_le->version); | ||
2938 | list->buflen += bi_length; | ||
2939 | list->count++; | ||
2940 | } else { | ||
2941 | cfg_priv->escan_info.escan_state = WL_ESCAN_STATE_IDLE; | ||
2942 | if (cfg_priv->scan_request) { | ||
2943 | cfg_priv->bss_list = (struct brcmf_scan_results *) | ||
2944 | cfg_priv->escan_info.escan_buf; | ||
2945 | brcmf_inform_bss(cfg_priv); | ||
2946 | if (status == BRCMF_E_STATUS_SUCCESS) { | ||
2947 | WL_SCAN("ESCAN Completed\n"); | ||
2948 | brcmf_notify_escan_complete(cfg_priv, ndev, | ||
2949 | false, false); | ||
2950 | } else { | ||
2951 | WL_ERR("ESCAN Aborted, Event 0x%x\n", status); | ||
2952 | brcmf_notify_escan_complete(cfg_priv, ndev, | ||
2953 | true, false); | ||
2954 | } | ||
2955 | brcmf_set_mpc(ndev, 1); | ||
2956 | } else | ||
2957 | WL_ERR("Unexpected scan result 0x%x\n", status); | ||
2958 | } | ||
2959 | exit: | ||
2960 | return err; | ||
2961 | } | ||
2962 | |||
2963 | static void brcmf_init_escan(struct brcmf_cfg80211_priv *cfg_priv) | ||
2964 | { | ||
2965 | |||
2966 | if (cfg_priv->escan_on) { | ||
2967 | cfg_priv->el.handler[BRCMF_E_ESCAN_RESULT] = | ||
2968 | brcmf_cfg80211_escan_handler; | ||
2969 | cfg_priv->escan_info.escan_state = WL_ESCAN_STATE_IDLE; | ||
2970 | /* Init scan_timeout timer */ | ||
2971 | init_timer(&cfg_priv->escan_timeout); | ||
2972 | cfg_priv->escan_timeout.data = (unsigned long) cfg_priv; | ||
2973 | cfg_priv->escan_timeout.function = brcmf_escan_timeout; | ||
2974 | INIT_WORK(&cfg_priv->escan_timeout_work, | ||
2975 | brcmf_cfg80211_escan_timeout_worker); | ||
2976 | } | ||
2977 | } | ||
2978 | |||
2473 | static __always_inline void brcmf_delay(u32 ms) | 2979 | static __always_inline void brcmf_delay(u32 ms) |
2474 | { | 2980 | { |
2475 | if (ms < 1000 / HZ) { | 2981 | if (ms < 1000 / HZ) { |
@@ -2545,10 +3051,8 @@ static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy, | |||
2545 | clear_bit(WL_STATUS_SCAN_ABORTING, &cfg_priv->status); | 3051 | clear_bit(WL_STATUS_SCAN_ABORTING, &cfg_priv->status); |
2546 | 3052 | ||
2547 | /* Turn off watchdog timer */ | 3053 | /* Turn off watchdog timer */ |
2548 | if (test_bit(WL_STATUS_READY, &cfg_priv->status)) { | 3054 | if (test_bit(WL_STATUS_READY, &cfg_priv->status)) |
2549 | WL_INFO("Enable MPC\n"); | ||
2550 | brcmf_set_mpc(ndev, 1); | 3055 | brcmf_set_mpc(ndev, 1); |
2551 | } | ||
2552 | 3056 | ||
2553 | WL_TRACE("Exit\n"); | 3057 | WL_TRACE("Exit\n"); |
2554 | 3058 | ||
@@ -2723,6 +3227,25 @@ brcmf_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *ndev) | |||
2723 | 3227 | ||
2724 | } | 3228 | } |
2725 | 3229 | ||
3230 | #ifdef CONFIG_NL80211_TESTMODE | ||
3231 | static int brcmf_cfg80211_testmode(struct wiphy *wiphy, void *data, int len) | ||
3232 | { | ||
3233 | struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy); | ||
3234 | struct net_device *ndev = cfg_priv->wdev->netdev; | ||
3235 | struct brcmf_dcmd *dcmd = data; | ||
3236 | struct sk_buff *reply; | ||
3237 | int ret; | ||
3238 | |||
3239 | ret = brcmf_netlink_dcmd(ndev, dcmd); | ||
3240 | if (ret == 0) { | ||
3241 | reply = cfg80211_testmode_alloc_reply_skb(wiphy, sizeof(*dcmd)); | ||
3242 | nla_put(reply, NL80211_ATTR_TESTDATA, sizeof(*dcmd), dcmd); | ||
3243 | ret = cfg80211_testmode_reply(reply); | ||
3244 | } | ||
3245 | return ret; | ||
3246 | } | ||
3247 | #endif | ||
3248 | |||
2726 | static struct cfg80211_ops wl_cfg80211_ops = { | 3249 | static struct cfg80211_ops wl_cfg80211_ops = { |
2727 | .change_virtual_intf = brcmf_cfg80211_change_iface, | 3250 | .change_virtual_intf = brcmf_cfg80211_change_iface, |
2728 | .scan = brcmf_cfg80211_scan, | 3251 | .scan = brcmf_cfg80211_scan, |
@@ -2745,7 +3268,10 @@ static struct cfg80211_ops wl_cfg80211_ops = { | |||
2745 | .resume = brcmf_cfg80211_resume, | 3268 | .resume = brcmf_cfg80211_resume, |
2746 | .set_pmksa = brcmf_cfg80211_set_pmksa, | 3269 | .set_pmksa = brcmf_cfg80211_set_pmksa, |
2747 | .del_pmksa = brcmf_cfg80211_del_pmksa, | 3270 | .del_pmksa = brcmf_cfg80211_del_pmksa, |
2748 | .flush_pmksa = brcmf_cfg80211_flush_pmksa | 3271 | .flush_pmksa = brcmf_cfg80211_flush_pmksa, |
3272 | #ifdef CONFIG_NL80211_TESTMODE | ||
3273 | .testmode_cmd = brcmf_cfg80211_testmode | ||
3274 | #endif | ||
2749 | }; | 3275 | }; |
2750 | 3276 | ||
2751 | static s32 brcmf_mode_to_nl80211_iftype(s32 mode) | 3277 | static s32 brcmf_mode_to_nl80211_iftype(s32 mode) |
@@ -3170,10 +3696,8 @@ brcmf_notify_scan_status(struct brcmf_cfg80211_priv *cfg_priv, | |||
3170 | cfg_priv->scan_results->count = le32_to_cpu(bss_list_le->count); | 3696 | cfg_priv->scan_results->count = le32_to_cpu(bss_list_le->count); |
3171 | 3697 | ||
3172 | err = brcmf_inform_bss(cfg_priv); | 3698 | err = brcmf_inform_bss(cfg_priv); |
3173 | if (err) { | 3699 | if (err) |
3174 | scan_abort = true; | 3700 | scan_abort = true; |
3175 | goto scan_done_out; | ||
3176 | } | ||
3177 | 3701 | ||
3178 | scan_done_out: | 3702 | scan_done_out: |
3179 | if (cfg_priv->scan_request) { | 3703 | if (cfg_priv->scan_request) { |
@@ -3220,6 +3744,8 @@ static void brcmf_deinit_priv_mem(struct brcmf_cfg80211_priv *cfg_priv) | |||
3220 | cfg_priv->profile = NULL; | 3744 | cfg_priv->profile = NULL; |
3221 | kfree(cfg_priv->scan_req_int); | 3745 | kfree(cfg_priv->scan_req_int); |
3222 | cfg_priv->scan_req_int = NULL; | 3746 | cfg_priv->scan_req_int = NULL; |
3747 | kfree(cfg_priv->escan_ioctl_buf); | ||
3748 | cfg_priv->escan_ioctl_buf = NULL; | ||
3223 | kfree(cfg_priv->dcmd_buf); | 3749 | kfree(cfg_priv->dcmd_buf); |
3224 | cfg_priv->dcmd_buf = NULL; | 3750 | cfg_priv->dcmd_buf = NULL; |
3225 | kfree(cfg_priv->extra_buf); | 3751 | kfree(cfg_priv->extra_buf); |
@@ -3248,6 +3774,9 @@ static s32 brcmf_init_priv_mem(struct brcmf_cfg80211_priv *cfg_priv) | |||
3248 | GFP_KERNEL); | 3774 | GFP_KERNEL); |
3249 | if (!cfg_priv->scan_req_int) | 3775 | if (!cfg_priv->scan_req_int) |
3250 | goto init_priv_mem_out; | 3776 | goto init_priv_mem_out; |
3777 | cfg_priv->escan_ioctl_buf = kzalloc(BRCMF_DCMD_MEDLEN, GFP_KERNEL); | ||
3778 | if (!cfg_priv->escan_ioctl_buf) | ||
3779 | goto init_priv_mem_out; | ||
3251 | cfg_priv->dcmd_buf = kzalloc(WL_DCMD_LEN_MAX, GFP_KERNEL); | 3780 | cfg_priv->dcmd_buf = kzalloc(WL_DCMD_LEN_MAX, GFP_KERNEL); |
3252 | if (!cfg_priv->dcmd_buf) | 3781 | if (!cfg_priv->dcmd_buf) |
3253 | goto init_priv_mem_out; | 3782 | goto init_priv_mem_out; |
@@ -3297,18 +3826,28 @@ static struct brcmf_cfg80211_event_q *brcmf_deq_event( | |||
3297 | 3826 | ||
3298 | static s32 | 3827 | static s32 |
3299 | brcmf_enq_event(struct brcmf_cfg80211_priv *cfg_priv, u32 event, | 3828 | brcmf_enq_event(struct brcmf_cfg80211_priv *cfg_priv, u32 event, |
3300 | const struct brcmf_event_msg *msg) | 3829 | const struct brcmf_event_msg *msg, void *data) |
3301 | { | 3830 | { |
3302 | struct brcmf_cfg80211_event_q *e; | 3831 | struct brcmf_cfg80211_event_q *e; |
3303 | s32 err = 0; | 3832 | s32 err = 0; |
3304 | ulong flags; | 3833 | ulong flags; |
3834 | u32 data_len; | ||
3835 | u32 total_len; | ||
3305 | 3836 | ||
3306 | e = kzalloc(sizeof(struct brcmf_cfg80211_event_q), GFP_ATOMIC); | 3837 | total_len = sizeof(struct brcmf_cfg80211_event_q); |
3838 | if (data) | ||
3839 | data_len = be32_to_cpu(msg->datalen); | ||
3840 | else | ||
3841 | data_len = 0; | ||
3842 | total_len += data_len; | ||
3843 | e = kzalloc(total_len, GFP_ATOMIC); | ||
3307 | if (!e) | 3844 | if (!e) |
3308 | return -ENOMEM; | 3845 | return -ENOMEM; |
3309 | 3846 | ||
3310 | e->etype = event; | 3847 | e->etype = event; |
3311 | memcpy(&e->emsg, msg, sizeof(struct brcmf_event_msg)); | 3848 | memcpy(&e->emsg, msg, sizeof(struct brcmf_event_msg)); |
3849 | if (data) | ||
3850 | memcpy(&e->edata, data, data_len); | ||
3312 | 3851 | ||
3313 | spin_lock_irqsave(&cfg_priv->evt_q_lock, flags); | 3852 | spin_lock_irqsave(&cfg_priv->evt_q_lock, flags); |
3314 | list_add_tail(&e->evt_q_list, &cfg_priv->evt_q_list); | 3853 | list_add_tail(&e->evt_q_list, &cfg_priv->evt_q_list); |
@@ -3374,8 +3913,17 @@ static s32 wl_init_priv(struct brcmf_cfg80211_priv *cfg_priv) | |||
3374 | 3913 | ||
3375 | cfg_priv->scan_request = NULL; | 3914 | cfg_priv->scan_request = NULL; |
3376 | cfg_priv->pwr_save = true; | 3915 | cfg_priv->pwr_save = true; |
3916 | #ifdef CONFIG_BRCMISCAN | ||
3377 | cfg_priv->iscan_on = true; /* iscan on & off switch. | 3917 | cfg_priv->iscan_on = true; /* iscan on & off switch. |
3378 | we enable iscan per default */ | 3918 | we enable iscan per default */ |
3919 | cfg_priv->escan_on = false; /* escan on & off switch. | ||
3920 | we disable escan per default */ | ||
3921 | #else | ||
3922 | cfg_priv->iscan_on = false; /* iscan on & off switch. | ||
3923 | we disable iscan per default */ | ||
3924 | cfg_priv->escan_on = true; /* escan on & off switch. | ||
3925 | we enable escan per default */ | ||
3926 | #endif | ||
3379 | cfg_priv->roam_on = true; /* roam on & off switch. | 3927 | cfg_priv->roam_on = true; /* roam on & off switch. |
3380 | we enable roam per default */ | 3928 | we enable roam per default */ |
3381 | 3929 | ||
@@ -3393,6 +3941,7 @@ static s32 wl_init_priv(struct brcmf_cfg80211_priv *cfg_priv) | |||
3393 | err = brcmf_init_iscan(cfg_priv); | 3941 | err = brcmf_init_iscan(cfg_priv); |
3394 | if (err) | 3942 | if (err) |
3395 | return err; | 3943 | return err; |
3944 | brcmf_init_escan(cfg_priv); | ||
3396 | brcmf_init_conf(cfg_priv->conf); | 3945 | brcmf_init_conf(cfg_priv->conf); |
3397 | brcmf_init_prof(cfg_priv->profile); | 3946 | brcmf_init_prof(cfg_priv->profile); |
3398 | brcmf_link_down(cfg_priv); | 3947 | brcmf_link_down(cfg_priv); |
@@ -3477,7 +4026,7 @@ brcmf_cfg80211_event(struct net_device *ndev, | |||
3477 | u32 event_type = be32_to_cpu(e->event_type); | 4026 | u32 event_type = be32_to_cpu(e->event_type); |
3478 | struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev); | 4027 | struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev); |
3479 | 4028 | ||
3480 | if (!brcmf_enq_event(cfg_priv, event_type, e)) | 4029 | if (!brcmf_enq_event(cfg_priv, event_type, e, data)) |
3481 | schedule_work(&cfg_priv->event_work); | 4030 | schedule_work(&cfg_priv->event_work); |
3482 | } | 4031 | } |
3483 | 4032 | ||
@@ -3551,6 +4100,7 @@ static s32 brcmf_dongle_eventmsg(struct net_device *ndev) | |||
3551 | setbit(eventmask, BRCMF_E_TXFAIL); | 4100 | setbit(eventmask, BRCMF_E_TXFAIL); |
3552 | setbit(eventmask, BRCMF_E_JOIN_START); | 4101 | setbit(eventmask, BRCMF_E_JOIN_START); |
3553 | setbit(eventmask, BRCMF_E_SCAN_COMPLETE); | 4102 | setbit(eventmask, BRCMF_E_SCAN_COMPLETE); |
4103 | setbit(eventmask, BRCMF_E_ESCAN_RESULT); | ||
3554 | 4104 | ||
3555 | brcmf_c_mkiovar("event_msgs", eventmask, BRCMF_EVENTING_MASK_LEN, | 4105 | brcmf_c_mkiovar("event_msgs", eventmask, BRCMF_EVENTING_MASK_LEN, |
3556 | iovbuf, sizeof(iovbuf)); | 4106 | iovbuf, sizeof(iovbuf)); |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h index b5d9b36df3d0..3b2129738d30 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h | |||
@@ -123,6 +123,13 @@ do { \ | |||
123 | #define WL_SCAN_UNASSOC_TIME 40 | 123 | #define WL_SCAN_UNASSOC_TIME 40 |
124 | #define WL_SCAN_PASSIVE_TIME 120 | 124 | #define WL_SCAN_PASSIVE_TIME 120 |
125 | 125 | ||
126 | #define WL_ESCAN_BUF_SIZE (1024 * 64) | ||
127 | #define WL_ESCAN_TIMER_INTERVAL_MS 8000 /* E-Scan timeout */ | ||
128 | |||
129 | #define WL_ESCAN_ACTION_START 1 | ||
130 | #define WL_ESCAN_ACTION_CONTINUE 2 | ||
131 | #define WL_ESCAN_ACTION_ABORT 3 | ||
132 | |||
126 | /* dongle status */ | 133 | /* dongle status */ |
127 | enum wl_status { | 134 | enum wl_status { |
128 | WL_STATUS_READY, | 135 | WL_STATUS_READY, |
@@ -275,6 +282,19 @@ struct brcmf_cfg80211_pmk_list { | |||
275 | struct pmkid foo[MAXPMKID - 1]; | 282 | struct pmkid foo[MAXPMKID - 1]; |
276 | }; | 283 | }; |
277 | 284 | ||
285 | /* dongle escan state */ | ||
286 | enum wl_escan_state { | ||
287 | WL_ESCAN_STATE_IDLE, | ||
288 | WL_ESCAN_STATE_SCANNING | ||
289 | }; | ||
290 | |||
291 | struct escan_info { | ||
292 | u32 escan_state; | ||
293 | u8 escan_buf[WL_ESCAN_BUF_SIZE]; | ||
294 | struct wiphy *wiphy; | ||
295 | struct net_device *ndev; | ||
296 | }; | ||
297 | |||
278 | /* dongle private data of cfg80211 interface */ | 298 | /* dongle private data of cfg80211 interface */ |
279 | struct brcmf_cfg80211_priv { | 299 | struct brcmf_cfg80211_priv { |
280 | struct wireless_dev *wdev; /* representing wl cfg80211 device */ | 300 | struct wireless_dev *wdev; /* representing wl cfg80211 device */ |
@@ -315,6 +335,11 @@ struct brcmf_cfg80211_priv { | |||
315 | u8 *dcmd_buf; /* dcmd buffer */ | 335 | u8 *dcmd_buf; /* dcmd buffer */ |
316 | u8 *extra_buf; /* maily to grab assoc information */ | 336 | u8 *extra_buf; /* maily to grab assoc information */ |
317 | struct dentry *debugfsdir; | 337 | struct dentry *debugfsdir; |
338 | bool escan_on; /* escan on/off switch */ | ||
339 | struct escan_info escan_info; /* escan information */ | ||
340 | struct timer_list escan_timeout; /* Timer for catch scan timeout */ | ||
341 | struct work_struct escan_timeout_work; /* scan timeout worker */ | ||
342 | u8 *escan_ioctl_buf; | ||
318 | u8 ci[0] __aligned(NETDEV_ALIGN); | 343 | u8 ci[0] __aligned(NETDEV_ALIGN); |
319 | }; | 344 | }; |
320 | 345 | ||
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c index 8c9345dd37d2..b89f1272b93f 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c | |||
@@ -535,9 +535,6 @@ void ai_detach(struct si_pub *sih) | |||
535 | { | 535 | { |
536 | struct si_info *sii; | 536 | struct si_info *sii; |
537 | 537 | ||
538 | struct si_pub *si_local = NULL; | ||
539 | memcpy(&si_local, &sih, sizeof(struct si_pub **)); | ||
540 | |||
541 | sii = container_of(sih, struct si_info, pub); | 538 | sii = container_of(sih, struct si_info, pub); |
542 | 539 | ||
543 | if (sii == NULL) | 540 | if (sii == NULL) |
diff --git a/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h b/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h index bcc79b4e3267..e8682855b73a 100644 --- a/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +++ b/drivers/net/wireless/brcm80211/include/brcm_hw_ids.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #define BCM43235_CHIP_ID 43235 | 34 | #define BCM43235_CHIP_ID 43235 |
35 | #define BCM43236_CHIP_ID 43236 | 35 | #define BCM43236_CHIP_ID 43236 |
36 | #define BCM43238_CHIP_ID 43238 | 36 | #define BCM43238_CHIP_ID 43238 |
37 | #define BCM43241_CHIP_ID 0x4324 | ||
37 | #define BCM4329_CHIP_ID 0x4329 | 38 | #define BCM4329_CHIP_ID 0x4329 |
38 | #define BCM4330_CHIP_ID 0x4330 | 39 | #define BCM4330_CHIP_ID 0x4330 |
39 | #define BCM4331_CHIP_ID 0x4331 | 40 | #define BCM4331_CHIP_ID 0x4331 |
diff --git a/drivers/net/wireless/hostap/hostap_info.c b/drivers/net/wireless/hostap/hostap_info.c index 47932b28aac1..970a48baaf80 100644 --- a/drivers/net/wireless/hostap/hostap_info.c +++ b/drivers/net/wireless/hostap/hostap_info.c | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/sched.h> | 4 | #include <linux/sched.h> |
5 | #include <linux/slab.h> | 5 | #include <linux/slab.h> |
6 | #include <linux/export.h> | 6 | #include <linux/export.h> |
7 | #include <linux/etherdevice.h> | ||
7 | #include "hostap_wlan.h" | 8 | #include "hostap_wlan.h" |
8 | #include "hostap.h" | 9 | #include "hostap.h" |
9 | #include "hostap_ap.h" | 10 | #include "hostap_ap.h" |
@@ -463,8 +464,7 @@ static void handle_info_queue_scanresults(local_info_t *local) | |||
463 | prism2_host_roaming(local); | 464 | prism2_host_roaming(local); |
464 | 465 | ||
465 | if (local->host_roaming == 2 && local->iw_mode == IW_MODE_INFRA && | 466 | if (local->host_roaming == 2 && local->iw_mode == IW_MODE_INFRA && |
466 | memcmp(local->preferred_ap, "\x00\x00\x00\x00\x00\x00", | 467 | !is_zero_ether_addr(local->preferred_ap)) { |
467 | ETH_ALEN) != 0) { | ||
468 | /* | 468 | /* |
469 | * Firmware seems to be getting into odd state in host_roaming | 469 | * Firmware seems to be getting into odd state in host_roaming |
470 | * mode 2 when hostscan is used without join command, so try | 470 | * mode 2 when hostscan is used without join command, so try |
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c index 18054d9c6688..ac074731335a 100644 --- a/drivers/net/wireless/hostap/hostap_ioctl.c +++ b/drivers/net/wireless/hostap/hostap_ioctl.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/ethtool.h> | 6 | #include <linux/ethtool.h> |
7 | #include <linux/if_arp.h> | 7 | #include <linux/if_arp.h> |
8 | #include <linux/module.h> | 8 | #include <linux/module.h> |
9 | #include <linux/etherdevice.h> | ||
9 | #include <net/lib80211.h> | 10 | #include <net/lib80211.h> |
10 | 11 | ||
11 | #include "hostap_wlan.h" | 12 | #include "hostap_wlan.h" |
@@ -3221,8 +3222,7 @@ static int prism2_ioctl_siwencodeext(struct net_device *dev, | |||
3221 | return -EINVAL; | 3222 | return -EINVAL; |
3222 | 3223 | ||
3223 | addr = ext->addr.sa_data; | 3224 | addr = ext->addr.sa_data; |
3224 | if (addr[0] == 0xff && addr[1] == 0xff && addr[2] == 0xff && | 3225 | if (is_broadcast_ether_addr(addr)) { |
3225 | addr[3] == 0xff && addr[4] == 0xff && addr[5] == 0xff) { | ||
3226 | sta_ptr = NULL; | 3226 | sta_ptr = NULL; |
3227 | crypt = &local->crypt_info.crypt[i]; | 3227 | crypt = &local->crypt_info.crypt[i]; |
3228 | } else { | 3228 | } else { |
@@ -3394,8 +3394,7 @@ static int prism2_ioctl_giwencodeext(struct net_device *dev, | |||
3394 | i--; | 3394 | i--; |
3395 | 3395 | ||
3396 | addr = ext->addr.sa_data; | 3396 | addr = ext->addr.sa_data; |
3397 | if (addr[0] == 0xff && addr[1] == 0xff && addr[2] == 0xff && | 3397 | if (is_broadcast_ether_addr(addr)) { |
3398 | addr[3] == 0xff && addr[4] == 0xff && addr[5] == 0xff) { | ||
3399 | sta_ptr = NULL; | 3398 | sta_ptr = NULL; |
3400 | crypt = &local->crypt_info.crypt[i]; | 3399 | crypt = &local->crypt_info.crypt[i]; |
3401 | } else { | 3400 | } else { |
@@ -3458,9 +3457,7 @@ static int prism2_ioctl_set_encryption(local_info_t *local, | |||
3458 | param->u.crypt.key_len) | 3457 | param->u.crypt.key_len) |
3459 | return -EINVAL; | 3458 | return -EINVAL; |
3460 | 3459 | ||
3461 | if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff && | 3460 | if (is_broadcast_ether_addr(param->sta_addr)) { |
3462 | param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff && | ||
3463 | param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) { | ||
3464 | if (param->u.crypt.idx >= WEP_KEYS) | 3461 | if (param->u.crypt.idx >= WEP_KEYS) |
3465 | return -EINVAL; | 3462 | return -EINVAL; |
3466 | sta_ptr = NULL; | 3463 | sta_ptr = NULL; |
@@ -3593,9 +3590,7 @@ static int prism2_ioctl_get_encryption(local_info_t *local, | |||
3593 | if (max_key_len < 0) | 3590 | if (max_key_len < 0) |
3594 | return -EINVAL; | 3591 | return -EINVAL; |
3595 | 3592 | ||
3596 | if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff && | 3593 | if (is_broadcast_ether_addr(param->sta_addr)) { |
3597 | param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff && | ||
3598 | param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) { | ||
3599 | sta_ptr = NULL; | 3594 | sta_ptr = NULL; |
3600 | if (param->u.crypt.idx >= WEP_KEYS) | 3595 | if (param->u.crypt.idx >= WEP_KEYS) |
3601 | param->u.crypt.idx = local->crypt_info.tx_keyidx; | 3596 | param->u.crypt.idx = local->crypt_info.tx_keyidx; |
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c index 627bc12074c7..15f0fad39add 100644 --- a/drivers/net/wireless/hostap/hostap_main.c +++ b/drivers/net/wireless/hostap/hostap_main.c | |||
@@ -1084,7 +1084,7 @@ int prism2_sta_deauth(local_info_t *local, u16 reason) | |||
1084 | __le16 val = cpu_to_le16(reason); | 1084 | __le16 val = cpu_to_le16(reason); |
1085 | 1085 | ||
1086 | if (local->iw_mode != IW_MODE_INFRA || | 1086 | if (local->iw_mode != IW_MODE_INFRA || |
1087 | memcmp(local->bssid, "\x00\x00\x00\x00\x00\x00", ETH_ALEN) == 0 || | 1087 | is_zero_ether_addr(local->bssid) || |
1088 | memcmp(local->bssid, "\x44\x44\x44\x44\x44\x44", ETH_ALEN) == 0) | 1088 | memcmp(local->bssid, "\x44\x44\x44\x44\x44\x44", ETH_ALEN) == 0) |
1089 | return 0; | 1089 | return 0; |
1090 | 1090 | ||
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c index 83324b321652..4d30cd18c3b0 100644 --- a/drivers/net/wireless/ipw2x00/ipw2100.c +++ b/drivers/net/wireless/ipw2x00/ipw2100.c | |||
@@ -6964,13 +6964,6 @@ static int ipw2100_wx_set_wap(struct net_device *dev, | |||
6964 | struct ipw2100_priv *priv = libipw_priv(dev); | 6964 | struct ipw2100_priv *priv = libipw_priv(dev); |
6965 | int err = 0; | 6965 | int err = 0; |
6966 | 6966 | ||
6967 | static const unsigned char any[] = { | ||
6968 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff | ||
6969 | }; | ||
6970 | static const unsigned char off[] = { | ||
6971 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
6972 | }; | ||
6973 | |||
6974 | // sanity checks | 6967 | // sanity checks |
6975 | if (wrqu->ap_addr.sa_family != ARPHRD_ETHER) | 6968 | if (wrqu->ap_addr.sa_family != ARPHRD_ETHER) |
6976 | return -EINVAL; | 6969 | return -EINVAL; |
@@ -6981,8 +6974,8 @@ static int ipw2100_wx_set_wap(struct net_device *dev, | |||
6981 | goto done; | 6974 | goto done; |
6982 | } | 6975 | } |
6983 | 6976 | ||
6984 | if (!memcmp(any, wrqu->ap_addr.sa_data, ETH_ALEN) || | 6977 | if (is_broadcast_ether_addr(wrqu->ap_addr.sa_data) || |
6985 | !memcmp(off, wrqu->ap_addr.sa_data, ETH_ALEN)) { | 6978 | is_zero_ether_addr(wrqu->ap_addr.sa_data)) { |
6986 | /* we disable mandatory BSSID association */ | 6979 | /* we disable mandatory BSSID association */ |
6987 | IPW_DEBUG_WX("exit - disable mandatory BSSID\n"); | 6980 | IPW_DEBUG_WX("exit - disable mandatory BSSID\n"); |
6988 | priv->config &= ~CFG_STATIC_BSSID; | 6981 | priv->config &= ~CFG_STATIC_BSSID; |
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index 0df459147394..935120fc8c93 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c | |||
@@ -9037,18 +9037,11 @@ static int ipw_wx_set_wap(struct net_device *dev, | |||
9037 | { | 9037 | { |
9038 | struct ipw_priv *priv = libipw_priv(dev); | 9038 | struct ipw_priv *priv = libipw_priv(dev); |
9039 | 9039 | ||
9040 | static const unsigned char any[] = { | ||
9041 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff | ||
9042 | }; | ||
9043 | static const unsigned char off[] = { | ||
9044 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
9045 | }; | ||
9046 | |||
9047 | if (wrqu->ap_addr.sa_family != ARPHRD_ETHER) | 9040 | if (wrqu->ap_addr.sa_family != ARPHRD_ETHER) |
9048 | return -EINVAL; | 9041 | return -EINVAL; |
9049 | mutex_lock(&priv->mutex); | 9042 | mutex_lock(&priv->mutex); |
9050 | if (!memcmp(any, wrqu->ap_addr.sa_data, ETH_ALEN) || | 9043 | if (is_broadcast_ether_addr(wrqu->ap_addr.sa_data) || |
9051 | !memcmp(off, wrqu->ap_addr.sa_data, ETH_ALEN)) { | 9044 | is_zero_ether_addr(wrqu->ap_addr.sa_data)) { |
9052 | /* we disable mandatory BSSID association */ | 9045 | /* we disable mandatory BSSID association */ |
9053 | IPW_DEBUG_WX("Setting AP BSSID to ANY\n"); | 9046 | IPW_DEBUG_WX("Setting AP BSSID to ANY\n"); |
9054 | priv->config &= ~CFG_STATIC_BSSID; | 9047 | priv->config &= ~CFG_STATIC_BSSID; |
diff --git a/drivers/net/wireless/iwlwifi/dvm/commands.h b/drivers/net/wireless/iwlwifi/dvm/commands.h index 4a361c55c543..01128c96b5d8 100644 --- a/drivers/net/wireless/iwlwifi/dvm/commands.h +++ b/drivers/net/wireless/iwlwifi/dvm/commands.h | |||
@@ -1055,8 +1055,9 @@ struct iwl_wep_cmd { | |||
1055 | #define RX_RES_PHY_FLAGS_MOD_CCK_MSK cpu_to_le16(1 << 1) | 1055 | #define RX_RES_PHY_FLAGS_MOD_CCK_MSK cpu_to_le16(1 << 1) |
1056 | #define RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK cpu_to_le16(1 << 2) | 1056 | #define RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK cpu_to_le16(1 << 2) |
1057 | #define RX_RES_PHY_FLAGS_NARROW_BAND_MSK cpu_to_le16(1 << 3) | 1057 | #define RX_RES_PHY_FLAGS_NARROW_BAND_MSK cpu_to_le16(1 << 3) |
1058 | #define RX_RES_PHY_FLAGS_ANTENNA_MSK 0xf0 | 1058 | #define RX_RES_PHY_FLAGS_ANTENNA_MSK 0x70 |
1059 | #define RX_RES_PHY_FLAGS_ANTENNA_POS 4 | 1059 | #define RX_RES_PHY_FLAGS_ANTENNA_POS 4 |
1060 | #define RX_RES_PHY_FLAGS_AGG_MSK cpu_to_le16(1 << 7) | ||
1060 | 1061 | ||
1061 | #define RX_RES_STATUS_SEC_TYPE_MSK (0x7 << 8) | 1062 | #define RX_RES_STATUS_SEC_TYPE_MSK (0x7 << 8) |
1062 | #define RX_RES_STATUS_SEC_TYPE_NONE (0x0 << 8) | 1063 | #define RX_RES_STATUS_SEC_TYPE_NONE (0x0 << 8) |
diff --git a/drivers/net/wireless/iwlwifi/dvm/dev.h b/drivers/net/wireless/iwlwifi/dvm/dev.h index 054f728f6266..8141f91c3725 100644 --- a/drivers/net/wireless/iwlwifi/dvm/dev.h +++ b/drivers/net/wireless/iwlwifi/dvm/dev.h | |||
@@ -771,6 +771,7 @@ struct iwl_priv { | |||
771 | u8 agg_tids_count; | 771 | u8 agg_tids_count; |
772 | 772 | ||
773 | struct iwl_rx_phy_res last_phy_res; | 773 | struct iwl_rx_phy_res last_phy_res; |
774 | u32 ampdu_ref; | ||
774 | bool last_phy_res_valid; | 775 | bool last_phy_res_valid; |
775 | 776 | ||
776 | /* | 777 | /* |
diff --git a/drivers/net/wireless/iwlwifi/dvm/rx.c b/drivers/net/wireless/iwlwifi/dvm/rx.c index fee5cffa1669..5a9c325804f6 100644 --- a/drivers/net/wireless/iwlwifi/dvm/rx.c +++ b/drivers/net/wireless/iwlwifi/dvm/rx.c | |||
@@ -667,6 +667,7 @@ static int iwlagn_rx_reply_rx_phy(struct iwl_priv *priv, | |||
667 | struct iwl_rx_packet *pkt = rxb_addr(rxb); | 667 | struct iwl_rx_packet *pkt = rxb_addr(rxb); |
668 | 668 | ||
669 | priv->last_phy_res_valid = true; | 669 | priv->last_phy_res_valid = true; |
670 | priv->ampdu_ref++; | ||
670 | memcpy(&priv->last_phy_res, pkt->data, | 671 | memcpy(&priv->last_phy_res, pkt->data, |
671 | sizeof(struct iwl_rx_phy_res)); | 672 | sizeof(struct iwl_rx_phy_res)); |
672 | return 0; | 673 | return 0; |
@@ -981,6 +982,16 @@ static int iwlagn_rx_reply_rx(struct iwl_priv *priv, | |||
981 | if (phy_res->phy_flags & RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK) | 982 | if (phy_res->phy_flags & RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK) |
982 | rx_status.flag |= RX_FLAG_SHORTPRE; | 983 | rx_status.flag |= RX_FLAG_SHORTPRE; |
983 | 984 | ||
985 | if (phy_res->phy_flags & RX_RES_PHY_FLAGS_AGG_MSK) { | ||
986 | /* | ||
987 | * We know which subframes of an A-MPDU belong | ||
988 | * together since we get a single PHY response | ||
989 | * from the firmware for all of them | ||
990 | */ | ||
991 | rx_status.flag |= RX_FLAG_AMPDU_DETAILS; | ||
992 | rx_status.ampdu_reference = priv->ampdu_ref; | ||
993 | } | ||
994 | |||
984 | /* Set up the HT phy flags */ | 995 | /* Set up the HT phy flags */ |
985 | if (rate_n_flags & RATE_MCS_HT_MSK) | 996 | if (rate_n_flags & RATE_MCS_HT_MSK) |
986 | rx_status.flag |= RX_FLAG_HT; | 997 | rx_status.flag |= RX_FLAG_HT; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace.h b/drivers/net/wireless/iwlwifi/iwl-devtrace.h index 06ca505bb2cc..59a5f78402fc 100644 --- a/drivers/net/wireless/iwlwifi/iwl-devtrace.h +++ b/drivers/net/wireless/iwlwifi/iwl-devtrace.h | |||
@@ -29,6 +29,7 @@ | |||
29 | 29 | ||
30 | #include <linux/tracepoint.h> | 30 | #include <linux/tracepoint.h> |
31 | #include <linux/device.h> | 31 | #include <linux/device.h> |
32 | #include "iwl-trans.h" | ||
32 | 33 | ||
33 | 34 | ||
34 | #if !defined(CONFIG_IWLWIFI_DEVICE_TRACING) || defined(__CHECKER__) | 35 | #if !defined(CONFIG_IWLWIFI_DEVICE_TRACING) || defined(__CHECKER__) |
@@ -237,27 +238,34 @@ TRACE_EVENT(iwlwifi_dbg, | |||
237 | #define TRACE_SYSTEM iwlwifi | 238 | #define TRACE_SYSTEM iwlwifi |
238 | 239 | ||
239 | TRACE_EVENT(iwlwifi_dev_hcmd, | 240 | TRACE_EVENT(iwlwifi_dev_hcmd, |
240 | TP_PROTO(const struct device *dev, u32 flags, | 241 | TP_PROTO(const struct device *dev, |
241 | const void *hcmd0, size_t len0, | 242 | struct iwl_host_cmd *cmd, u16 total_size, |
242 | const void *hcmd1, size_t len1, | 243 | const void *hdr, size_t hdr_len), |
243 | const void *hcmd2, size_t len2), | 244 | TP_ARGS(dev, cmd, total_size, hdr, hdr_len), |
244 | TP_ARGS(dev, flags, hcmd0, len0, hcmd1, len1, hcmd2, len2), | ||
245 | TP_STRUCT__entry( | 245 | TP_STRUCT__entry( |
246 | DEV_ENTRY | 246 | DEV_ENTRY |
247 | __dynamic_array(u8, hcmd0, len0) | 247 | __dynamic_array(u8, hcmd, total_size) |
248 | __dynamic_array(u8, hcmd1, len1) | ||
249 | __dynamic_array(u8, hcmd2, len2) | ||
250 | __field(u32, flags) | 248 | __field(u32, flags) |
251 | ), | 249 | ), |
252 | TP_fast_assign( | 250 | TP_fast_assign( |
251 | int i, offset = hdr_len; | ||
252 | |||
253 | DEV_ASSIGN; | 253 | DEV_ASSIGN; |
254 | memcpy(__get_dynamic_array(hcmd0), hcmd0, len0); | 254 | __entry->flags = cmd->flags; |
255 | memcpy(__get_dynamic_array(hcmd1), hcmd1, len1); | 255 | memcpy(__get_dynamic_array(hcmd), hdr, hdr_len); |
256 | memcpy(__get_dynamic_array(hcmd2), hcmd2, len2); | 256 | |
257 | __entry->flags = flags; | 257 | for (i = 0; i < IWL_MAX_CMD_TFDS; i++) { |
258 | if (!cmd->len[i]) | ||
259 | continue; | ||
260 | if (!(cmd->dataflags[i] & IWL_HCMD_DFL_NOCOPY)) | ||
261 | continue; | ||
262 | memcpy((u8 *)__get_dynamic_array(hcmd) + offset, | ||
263 | cmd->data[i], cmd->len[i]); | ||
264 | offset += cmd->len[i]; | ||
265 | } | ||
258 | ), | 266 | ), |
259 | TP_printk("[%s] hcmd %#.2x (%ssync)", | 267 | TP_printk("[%s] hcmd %#.2x (%ssync)", |
260 | __get_str(dev), ((u8 *)__get_dynamic_array(hcmd0))[0], | 268 | __get_str(dev), ((u8 *)__get_dynamic_array(hcmd))[0], |
261 | __entry->flags & CMD_ASYNC ? "a" : "") | 269 | __entry->flags & CMD_ASYNC ? "a" : "") |
262 | ); | 270 | ); |
263 | 271 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.h b/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.h index 9c07c670a1ce..a5e425718f56 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.h +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.h | |||
@@ -85,8 +85,6 @@ struct iwl_eeprom_data { | |||
85 | int n_hw_addrs; | 85 | int n_hw_addrs; |
86 | u8 hw_addr[ETH_ALEN]; | 86 | u8 hw_addr[ETH_ALEN]; |
87 | 87 | ||
88 | u16 radio_config; | ||
89 | |||
90 | u8 calib_version; | 88 | u8 calib_version; |
91 | __le16 calib_voltage; | 89 | __le16 calib_voltage; |
92 | 90 | ||
diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c index 392d2bc5e357..105e3af3c621 100644 --- a/drivers/net/wireless/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/iwlwifi/pcie/tx.c | |||
@@ -522,11 +522,6 @@ static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd) | |||
522 | bool had_nocopy = false; | 522 | bool had_nocopy = false; |
523 | int i; | 523 | int i; |
524 | u32 cmd_pos; | 524 | u32 cmd_pos; |
525 | #ifdef CONFIG_IWLWIFI_DEVICE_TRACING | ||
526 | const void *trace_bufs[IWL_MAX_CMD_TFDS + 1] = {}; | ||
527 | int trace_lens[IWL_MAX_CMD_TFDS + 1] = {}; | ||
528 | int trace_idx; | ||
529 | #endif | ||
530 | 525 | ||
531 | copy_size = sizeof(out_cmd->hdr); | 526 | copy_size = sizeof(out_cmd->hdr); |
532 | cmd_size = sizeof(out_cmd->hdr); | 527 | cmd_size = sizeof(out_cmd->hdr); |
@@ -628,11 +623,6 @@ static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd) | |||
628 | dma_unmap_len_set(out_meta, len, copy_size); | 623 | dma_unmap_len_set(out_meta, len, copy_size); |
629 | 624 | ||
630 | iwlagn_txq_attach_buf_to_tfd(trans, txq, phys_addr, copy_size, 1); | 625 | iwlagn_txq_attach_buf_to_tfd(trans, txq, phys_addr, copy_size, 1); |
631 | #ifdef CONFIG_IWLWIFI_DEVICE_TRACING | ||
632 | trace_bufs[0] = &out_cmd->hdr; | ||
633 | trace_lens[0] = copy_size; | ||
634 | trace_idx = 1; | ||
635 | #endif | ||
636 | 626 | ||
637 | for (i = 0; i < IWL_MAX_CMD_TFDS; i++) { | 627 | for (i = 0; i < IWL_MAX_CMD_TFDS; i++) { |
638 | if (!cmd->len[i]) | 628 | if (!cmd->len[i]) |
@@ -651,25 +641,14 @@ static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd) | |||
651 | 641 | ||
652 | iwlagn_txq_attach_buf_to_tfd(trans, txq, phys_addr, | 642 | iwlagn_txq_attach_buf_to_tfd(trans, txq, phys_addr, |
653 | cmd->len[i], 0); | 643 | cmd->len[i], 0); |
654 | #ifdef CONFIG_IWLWIFI_DEVICE_TRACING | ||
655 | trace_bufs[trace_idx] = cmd->data[i]; | ||
656 | trace_lens[trace_idx] = cmd->len[i]; | ||
657 | trace_idx++; | ||
658 | #endif | ||
659 | } | 644 | } |
660 | 645 | ||
661 | out_meta->flags = cmd->flags; | 646 | out_meta->flags = cmd->flags; |
662 | 647 | ||
663 | txq->need_update = 1; | 648 | txq->need_update = 1; |
664 | 649 | ||
665 | /* check that tracing gets all possible blocks */ | 650 | trace_iwlwifi_dev_hcmd(trans->dev, cmd, cmd_size, |
666 | BUILD_BUG_ON(IWL_MAX_CMD_TFDS + 1 != 3); | 651 | &out_cmd->hdr, copy_size); |
667 | #ifdef CONFIG_IWLWIFI_DEVICE_TRACING | ||
668 | trace_iwlwifi_dev_hcmd(trans->dev, cmd->flags, | ||
669 | trace_bufs[0], trace_lens[0], | ||
670 | trace_bufs[1], trace_lens[1], | ||
671 | trace_bufs[2], trace_lens[2]); | ||
672 | #endif | ||
673 | 652 | ||
674 | /* start timer if queue currently empty */ | 653 | /* start timer if queue currently empty */ |
675 | if (q->read_ptr == q->write_ptr && trans_pcie->wd_timeout) | 654 | if (q->read_ptr == q->write_ptr && trans_pcie->wd_timeout) |
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index 26e68326710b..aaa297315c47 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -1159,6 +1159,22 @@ void lbs_set_mac_control(struct lbs_private *priv) | |||
1159 | lbs_deb_leave(LBS_DEB_CMD); | 1159 | lbs_deb_leave(LBS_DEB_CMD); |
1160 | } | 1160 | } |
1161 | 1161 | ||
1162 | int lbs_set_mac_control_sync(struct lbs_private *priv) | ||
1163 | { | ||
1164 | struct cmd_ds_mac_control cmd; | ||
1165 | int ret = 0; | ||
1166 | |||
1167 | lbs_deb_enter(LBS_DEB_CMD); | ||
1168 | |||
1169 | cmd.hdr.size = cpu_to_le16(sizeof(cmd)); | ||
1170 | cmd.action = cpu_to_le16(priv->mac_control); | ||
1171 | cmd.reserved = 0; | ||
1172 | ret = lbs_cmd_with_response(priv, CMD_MAC_CONTROL, &cmd); | ||
1173 | |||
1174 | lbs_deb_leave(LBS_DEB_CMD); | ||
1175 | return ret; | ||
1176 | } | ||
1177 | |||
1162 | /** | 1178 | /** |
1163 | * lbs_allocate_cmd_buffer - allocates the command buffer and links | 1179 | * lbs_allocate_cmd_buffer - allocates the command buffer and links |
1164 | * it to command free queue | 1180 | * it to command free queue |
diff --git a/drivers/net/wireless/libertas/cmd.h b/drivers/net/wireless/libertas/cmd.h index ab07608e13d0..4279e8ab95f2 100644 --- a/drivers/net/wireless/libertas/cmd.h +++ b/drivers/net/wireless/libertas/cmd.h | |||
@@ -96,6 +96,7 @@ void lbs_ps_confirm_sleep(struct lbs_private *priv); | |||
96 | int lbs_set_radio(struct lbs_private *priv, u8 preamble, u8 radio_on); | 96 | int lbs_set_radio(struct lbs_private *priv, u8 preamble, u8 radio_on); |
97 | 97 | ||
98 | void lbs_set_mac_control(struct lbs_private *priv); | 98 | void lbs_set_mac_control(struct lbs_private *priv); |
99 | int lbs_set_mac_control_sync(struct lbs_private *priv); | ||
99 | 100 | ||
100 | int lbs_get_tx_power(struct lbs_private *priv, s16 *curlevel, s16 *minlevel, | 101 | int lbs_get_tx_power(struct lbs_private *priv, s16 *curlevel, s16 *minlevel, |
101 | s16 *maxlevel); | 102 | s16 *maxlevel); |
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c index e970897f6ab5..4cb234349fbf 100644 --- a/drivers/net/wireless/libertas/if_sdio.c +++ b/drivers/net/wireless/libertas/if_sdio.c | |||
@@ -1326,6 +1326,11 @@ static int if_sdio_suspend(struct device *dev) | |||
1326 | 1326 | ||
1327 | mmc_pm_flag_t flags = sdio_get_host_pm_caps(func); | 1327 | mmc_pm_flag_t flags = sdio_get_host_pm_caps(func); |
1328 | 1328 | ||
1329 | /* If we're powered off anyway, just let the mmc layer remove the | ||
1330 | * card. */ | ||
1331 | if (!lbs_iface_active(card->priv)) | ||
1332 | return -ENOSYS; | ||
1333 | |||
1329 | dev_info(dev, "%s: suspend: PM flags = 0x%x\n", | 1334 | dev_info(dev, "%s: suspend: PM flags = 0x%x\n", |
1330 | sdio_func_id(func), flags); | 1335 | sdio_func_id(func), flags); |
1331 | 1336 | ||
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index fe1ea43c5149..0c02f0483d1f 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -682,8 +682,10 @@ static int lbs_setup_firmware(struct lbs_private *priv) | |||
682 | 682 | ||
683 | /* Send cmd to FW to enable 11D function */ | 683 | /* Send cmd to FW to enable 11D function */ |
684 | ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_11D_ENABLE, 1); | 684 | ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_11D_ENABLE, 1); |
685 | if (ret) | ||
686 | goto done; | ||
685 | 687 | ||
686 | lbs_set_mac_control(priv); | 688 | ret = lbs_set_mac_control_sync(priv); |
687 | done: | 689 | done: |
688 | lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret); | 690 | lbs_deb_leave_args(LBS_DEB_FW, "ret %d", ret); |
689 | return ret; | 691 | return ret; |
diff --git a/drivers/net/wireless/mwifiex/11n.c b/drivers/net/wireless/mwifiex/11n.c index d2732736f864..245a371f1a43 100644 --- a/drivers/net/wireless/mwifiex/11n.c +++ b/drivers/net/wireless/mwifiex/11n.c | |||
@@ -176,23 +176,6 @@ int mwifiex_ret_11n_addba_req(struct mwifiex_private *priv, | |||
176 | } | 176 | } |
177 | 177 | ||
178 | /* | 178 | /* |
179 | * This function handles the command response of 11n configuration request. | ||
180 | * | ||
181 | * Handling includes changing the header fields into CPU format. | ||
182 | */ | ||
183 | int mwifiex_ret_11n_cfg(struct host_cmd_ds_command *resp, | ||
184 | struct mwifiex_ds_11n_tx_cfg *tx_cfg) | ||
185 | { | ||
186 | struct host_cmd_ds_11n_cfg *htcfg = &resp->params.htcfg; | ||
187 | |||
188 | if (tx_cfg) { | ||
189 | tx_cfg->tx_htcap = le16_to_cpu(htcfg->ht_tx_cap); | ||
190 | tx_cfg->tx_htinfo = le16_to_cpu(htcfg->ht_tx_info); | ||
191 | } | ||
192 | return 0; | ||
193 | } | ||
194 | |||
195 | /* | ||
196 | * This function prepares command of reconfigure Tx buffer. | 179 | * This function prepares command of reconfigure Tx buffer. |
197 | * | 180 | * |
198 | * Preparation includes - | 181 | * Preparation includes - |
@@ -258,27 +241,6 @@ int mwifiex_cmd_amsdu_aggr_ctrl(struct host_cmd_ds_command *cmd, | |||
258 | } | 241 | } |
259 | 242 | ||
260 | /* | 243 | /* |
261 | * This function handles the command response of AMSDU aggregation | ||
262 | * control request. | ||
263 | * | ||
264 | * Handling includes changing the header fields into CPU format. | ||
265 | */ | ||
266 | int mwifiex_ret_amsdu_aggr_ctrl(struct host_cmd_ds_command *resp, | ||
267 | struct mwifiex_ds_11n_amsdu_aggr_ctrl | ||
268 | *amsdu_aggr_ctrl) | ||
269 | { | ||
270 | struct host_cmd_ds_amsdu_aggr_ctrl *amsdu_ctrl = | ||
271 | &resp->params.amsdu_aggr_ctrl; | ||
272 | |||
273 | if (amsdu_aggr_ctrl) { | ||
274 | amsdu_aggr_ctrl->enable = le16_to_cpu(amsdu_ctrl->enable); | ||
275 | amsdu_aggr_ctrl->curr_buf_size = | ||
276 | le16_to_cpu(amsdu_ctrl->curr_buf_size); | ||
277 | } | ||
278 | return 0; | ||
279 | } | ||
280 | |||
281 | /* | ||
282 | * This function prepares 11n configuration command. | 244 | * This function prepares 11n configuration command. |
283 | * | 245 | * |
284 | * Preparation includes - | 246 | * Preparation includes - |
diff --git a/drivers/net/wireless/mwifiex/11n.h b/drivers/net/wireless/mwifiex/11n.h index 67c087cf9dc7..46006a54a656 100644 --- a/drivers/net/wireless/mwifiex/11n.h +++ b/drivers/net/wireless/mwifiex/11n.h | |||
@@ -28,8 +28,6 @@ int mwifiex_ret_11n_delba(struct mwifiex_private *priv, | |||
28 | struct host_cmd_ds_command *resp); | 28 | struct host_cmd_ds_command *resp); |
29 | int mwifiex_ret_11n_addba_req(struct mwifiex_private *priv, | 29 | int mwifiex_ret_11n_addba_req(struct mwifiex_private *priv, |
30 | struct host_cmd_ds_command *resp); | 30 | struct host_cmd_ds_command *resp); |
31 | int mwifiex_ret_11n_cfg(struct host_cmd_ds_command *resp, | ||
32 | struct mwifiex_ds_11n_tx_cfg *tx_cfg); | ||
33 | int mwifiex_cmd_11n_cfg(struct host_cmd_ds_command *cmd, u16 cmd_action, | 31 | int mwifiex_cmd_11n_cfg(struct host_cmd_ds_command *cmd, u16 cmd_action, |
34 | struct mwifiex_ds_11n_tx_cfg *txcfg); | 32 | struct mwifiex_ds_11n_tx_cfg *txcfg); |
35 | 33 | ||
@@ -60,9 +58,6 @@ int mwifiex_get_rx_reorder_tbl(struct mwifiex_private *priv, | |||
60 | struct mwifiex_ds_rx_reorder_tbl *buf); | 58 | struct mwifiex_ds_rx_reorder_tbl *buf); |
61 | int mwifiex_get_tx_ba_stream_tbl(struct mwifiex_private *priv, | 59 | int mwifiex_get_tx_ba_stream_tbl(struct mwifiex_private *priv, |
62 | struct mwifiex_ds_tx_ba_stream_tbl *buf); | 60 | struct mwifiex_ds_tx_ba_stream_tbl *buf); |
63 | int mwifiex_ret_amsdu_aggr_ctrl(struct host_cmd_ds_command *resp, | ||
64 | struct mwifiex_ds_11n_amsdu_aggr_ctrl | ||
65 | *amsdu_aggr_ctrl); | ||
66 | int mwifiex_cmd_recfg_tx_buf(struct mwifiex_private *priv, | 61 | int mwifiex_cmd_recfg_tx_buf(struct mwifiex_private *priv, |
67 | struct host_cmd_ds_command *cmd, | 62 | struct host_cmd_ds_command *cmd, |
68 | int cmd_action, u16 *buf_size); | 63 | int cmd_action, u16 *buf_size); |
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index e57f543413de..b9f7b3e6912d 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -37,6 +37,36 @@ static const struct ieee80211_iface_combination mwifiex_iface_comb_ap_sta = { | |||
37 | .beacon_int_infra_match = true, | 37 | .beacon_int_infra_match = true, |
38 | }; | 38 | }; |
39 | 39 | ||
40 | static const struct ieee80211_regdomain mwifiex_world_regdom_custom = { | ||
41 | .n_reg_rules = 7, | ||
42 | .alpha2 = "99", | ||
43 | .reg_rules = { | ||
44 | /* Channel 1 - 11 */ | ||
45 | REG_RULE(2412-10, 2462+10, 40, 3, 20, 0), | ||
46 | /* Channel 12 - 13 */ | ||
47 | REG_RULE(2467-10, 2472+10, 20, 3, 20, | ||
48 | NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS), | ||
49 | /* Channel 14 */ | ||
50 | REG_RULE(2484-10, 2484+10, 20, 3, 20, | ||
51 | NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS | | ||
52 | NL80211_RRF_NO_OFDM), | ||
53 | /* Channel 36 - 48 */ | ||
54 | REG_RULE(5180-10, 5240+10, 40, 3, 20, | ||
55 | NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS), | ||
56 | /* Channel 149 - 165 */ | ||
57 | REG_RULE(5745-10, 5825+10, 40, 3, 20, | ||
58 | NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS), | ||
59 | /* Channel 52 - 64 */ | ||
60 | REG_RULE(5260-10, 5320+10, 40, 3, 30, | ||
61 | NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS | | ||
62 | NL80211_RRF_DFS), | ||
63 | /* Channel 100 - 140 */ | ||
64 | REG_RULE(5500-10, 5700+10, 40, 3, 30, | ||
65 | NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS | | ||
66 | NL80211_RRF_DFS), | ||
67 | } | ||
68 | }; | ||
69 | |||
40 | /* | 70 | /* |
41 | * This function maps the nl802.11 channel type into driver channel type. | 71 | * This function maps the nl802.11 channel type into driver channel type. |
42 | * | 72 | * |
@@ -969,15 +999,18 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy, | |||
969 | 999 | ||
970 | bss_cfg->channel = | 1000 | bss_cfg->channel = |
971 | (u8)ieee80211_frequency_to_channel(params->channel->center_freq); | 1001 | (u8)ieee80211_frequency_to_channel(params->channel->center_freq); |
972 | bss_cfg->band_cfg = BAND_CONFIG_MANUAL; | ||
973 | 1002 | ||
974 | /* Set appropriate bands */ | 1003 | /* Set appropriate bands */ |
975 | if (params->channel->band == IEEE80211_BAND_2GHZ) { | 1004 | if (params->channel->band == IEEE80211_BAND_2GHZ) { |
1005 | bss_cfg->band_cfg = BAND_CONFIG_BG; | ||
1006 | |||
976 | if (params->channel_type == NL80211_CHAN_NO_HT) | 1007 | if (params->channel_type == NL80211_CHAN_NO_HT) |
977 | config_bands = BAND_B | BAND_G; | 1008 | config_bands = BAND_B | BAND_G; |
978 | else | 1009 | else |
979 | config_bands = BAND_B | BAND_G | BAND_GN; | 1010 | config_bands = BAND_B | BAND_G | BAND_GN; |
980 | } else { | 1011 | } else { |
1012 | bss_cfg->band_cfg = BAND_CONFIG_A; | ||
1013 | |||
981 | if (params->channel_type == NL80211_CHAN_NO_HT) | 1014 | if (params->channel_type == NL80211_CHAN_NO_HT) |
982 | config_bands = BAND_A; | 1015 | config_bands = BAND_A; |
983 | else | 1016 | else |
@@ -988,6 +1021,7 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy, | |||
988 | ~priv->adapter->fw_bands)) | 1021 | ~priv->adapter->fw_bands)) |
989 | priv->adapter->config_bands = config_bands; | 1022 | priv->adapter->config_bands = config_bands; |
990 | 1023 | ||
1024 | mwifiex_set_uap_rates(bss_cfg, params); | ||
991 | mwifiex_send_domain_info_cmd_fw(wiphy); | 1025 | mwifiex_send_domain_info_cmd_fw(wiphy); |
992 | 1026 | ||
993 | if (mwifiex_set_secure_params(priv, bss_cfg, params)) { | 1027 | if (mwifiex_set_secure_params(priv, bss_cfg, params)) { |
@@ -1153,7 +1187,6 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid, | |||
1153 | ~priv->adapter->fw_bands)) | 1187 | ~priv->adapter->fw_bands)) |
1154 | priv->adapter->config_bands = config_bands; | 1188 | priv->adapter->config_bands = config_bands; |
1155 | } | 1189 | } |
1156 | mwifiex_send_domain_info_cmd_fw(priv->wdev->wiphy); | ||
1157 | } | 1190 | } |
1158 | 1191 | ||
1159 | /* As this is new association, clear locally stored | 1192 | /* As this is new association, clear locally stored |
@@ -1637,7 +1670,7 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
1637 | 1670 | ||
1638 | priv->bss_type = MWIFIEX_BSS_TYPE_STA; | 1671 | priv->bss_type = MWIFIEX_BSS_TYPE_STA; |
1639 | priv->frame_type = MWIFIEX_DATA_FRAME_TYPE_ETH_II; | 1672 | priv->frame_type = MWIFIEX_DATA_FRAME_TYPE_ETH_II; |
1640 | priv->bss_priority = MWIFIEX_BSS_ROLE_STA; | 1673 | priv->bss_priority = 0; |
1641 | priv->bss_role = MWIFIEX_BSS_ROLE_STA; | 1674 | priv->bss_role = MWIFIEX_BSS_ROLE_STA; |
1642 | priv->bss_num = 0; | 1675 | priv->bss_num = 0; |
1643 | 1676 | ||
@@ -1660,7 +1693,7 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
1660 | 1693 | ||
1661 | priv->bss_type = MWIFIEX_BSS_TYPE_UAP; | 1694 | priv->bss_type = MWIFIEX_BSS_TYPE_UAP; |
1662 | priv->frame_type = MWIFIEX_DATA_FRAME_TYPE_ETH_II; | 1695 | priv->frame_type = MWIFIEX_DATA_FRAME_TYPE_ETH_II; |
1663 | priv->bss_priority = MWIFIEX_BSS_ROLE_UAP; | 1696 | priv->bss_priority = 0; |
1664 | priv->bss_role = MWIFIEX_BSS_ROLE_UAP; | 1697 | priv->bss_role = MWIFIEX_BSS_ROLE_UAP; |
1665 | priv->bss_started = 0; | 1698 | priv->bss_started = 0; |
1666 | priv->bss_num = 0; | 1699 | priv->bss_num = 0; |
@@ -1830,7 +1863,10 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter) | |||
1830 | memcpy(wiphy->perm_addr, priv->curr_addr, ETH_ALEN); | 1863 | memcpy(wiphy->perm_addr, priv->curr_addr, ETH_ALEN); |
1831 | wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; | 1864 | wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; |
1832 | wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME | | 1865 | wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME | |
1833 | WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD; | 1866 | WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD | |
1867 | WIPHY_FLAG_CUSTOM_REGULATORY; | ||
1868 | |||
1869 | wiphy_apply_custom_regulatory(wiphy, &mwifiex_world_regdom_custom); | ||
1834 | 1870 | ||
1835 | wiphy->probe_resp_offload = NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS | | 1871 | wiphy->probe_resp_offload = NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS | |
1836 | NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2; | 1872 | NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2; |
@@ -1859,8 +1895,9 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter) | |||
1859 | return ret; | 1895 | return ret; |
1860 | } | 1896 | } |
1861 | country_code = mwifiex_11d_code_2_region(priv->adapter->region_code); | 1897 | country_code = mwifiex_11d_code_2_region(priv->adapter->region_code); |
1862 | if (country_code && regulatory_hint(wiphy, country_code)) | 1898 | if (country_code) |
1863 | dev_err(adapter->dev, "regulatory_hint() failed\n"); | 1899 | dev_info(adapter->dev, |
1900 | "ignoring F/W country code %2.2s\n", country_code); | ||
1864 | 1901 | ||
1865 | adapter->wiphy = wiphy; | 1902 | adapter->wiphy = wiphy; |
1866 | return ret; | 1903 | return ret; |
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c index c229dddcf1c2..225c1a4feeba 100644 --- a/drivers/net/wireless/mwifiex/cmdevt.c +++ b/drivers/net/wireless/mwifiex/cmdevt.c | |||
@@ -170,7 +170,20 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv, | |||
170 | cmd_code = le16_to_cpu(host_cmd->command); | 170 | cmd_code = le16_to_cpu(host_cmd->command); |
171 | cmd_size = le16_to_cpu(host_cmd->size); | 171 | cmd_size = le16_to_cpu(host_cmd->size); |
172 | 172 | ||
173 | skb_trim(cmd_node->cmd_skb, cmd_size); | 173 | /* Adjust skb length */ |
174 | if (cmd_node->cmd_skb->len > cmd_size) | ||
175 | /* | ||
176 | * cmd_size is less than sizeof(struct host_cmd_ds_command). | ||
177 | * Trim off the unused portion. | ||
178 | */ | ||
179 | skb_trim(cmd_node->cmd_skb, cmd_size); | ||
180 | else if (cmd_node->cmd_skb->len < cmd_size) | ||
181 | /* | ||
182 | * cmd_size is larger than sizeof(struct host_cmd_ds_command) | ||
183 | * because we have appended custom IE TLV. Increase skb length | ||
184 | * accordingly. | ||
185 | */ | ||
186 | skb_put(cmd_node->cmd_skb, cmd_size - cmd_node->cmd_skb->len); | ||
174 | 187 | ||
175 | do_gettimeofday(&tstamp); | 188 | do_gettimeofday(&tstamp); |
176 | dev_dbg(adapter->dev, "cmd: DNLD_CMD: (%lu.%lu): %#x, act %#x, len %d," | 189 | dev_dbg(adapter->dev, "cmd: DNLD_CMD: (%lu.%lu): %#x, act %#x, len %d," |
diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h index ae06f31c6838..b8ce78e2ba47 100644 --- a/drivers/net/wireless/mwifiex/fw.h +++ b/drivers/net/wireless/mwifiex/fw.h | |||
@@ -108,6 +108,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER { | |||
108 | #define MGMT_MASK_BEACON 0x100 | 108 | #define MGMT_MASK_BEACON 0x100 |
109 | 109 | ||
110 | #define TLV_TYPE_UAP_SSID 0x0000 | 110 | #define TLV_TYPE_UAP_SSID 0x0000 |
111 | #define TLV_TYPE_UAP_RATES 0x0001 | ||
111 | 112 | ||
112 | #define PROPRIETARY_TLV_BASE_ID 0x0100 | 113 | #define PROPRIETARY_TLV_BASE_ID 0x0100 |
113 | #define TLV_TYPE_KEY_MATERIAL (PROPRIETARY_TLV_BASE_ID + 0) | 114 | #define TLV_TYPE_KEY_MATERIAL (PROPRIETARY_TLV_BASE_ID + 0) |
@@ -309,7 +310,7 @@ enum ENH_PS_MODES { | |||
309 | #define HostCmd_SCAN_RADIO_TYPE_A 1 | 310 | #define HostCmd_SCAN_RADIO_TYPE_A 1 |
310 | 311 | ||
311 | #define HOST_SLEEP_CFG_CANCEL 0xffffffff | 312 | #define HOST_SLEEP_CFG_CANCEL 0xffffffff |
312 | #define HOST_SLEEP_CFG_COND_DEF 0x0000000f | 313 | #define HOST_SLEEP_CFG_COND_DEF 0x00000000 |
313 | #define HOST_SLEEP_CFG_GPIO_DEF 0xff | 314 | #define HOST_SLEEP_CFG_GPIO_DEF 0xff |
314 | #define HOST_SLEEP_CFG_GAP_DEF 0 | 315 | #define HOST_SLEEP_CFG_GAP_DEF 0 |
315 | 316 | ||
@@ -1284,6 +1285,11 @@ struct host_cmd_tlv_ssid { | |||
1284 | u8 ssid[0]; | 1285 | u8 ssid[0]; |
1285 | } __packed; | 1286 | } __packed; |
1286 | 1287 | ||
1288 | struct host_cmd_tlv_rates { | ||
1289 | struct host_cmd_tlv tlv; | ||
1290 | u8 rates[0]; | ||
1291 | } __packed; | ||
1292 | |||
1287 | struct host_cmd_tlv_bcast_ssid { | 1293 | struct host_cmd_tlv_bcast_ssid { |
1288 | struct host_cmd_tlv tlv; | 1294 | struct host_cmd_tlv tlv; |
1289 | u8 bcast_ctl; | 1295 | u8 bcast_ctl; |
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c index fad2c8d2bdde..9c1549ee4c09 100644 --- a/drivers/net/wireless/mwifiex/init.c +++ b/drivers/net/wireless/mwifiex/init.c | |||
@@ -73,7 +73,6 @@ static void scan_delay_timer_fn(unsigned long data) | |||
73 | list_for_each_entry_safe(cmd_node, tmp_node, | 73 | list_for_each_entry_safe(cmd_node, tmp_node, |
74 | &adapter->scan_pending_q, list) { | 74 | &adapter->scan_pending_q, list) { |
75 | list_del(&cmd_node->list); | 75 | list_del(&cmd_node->list); |
76 | cmd_node->wait_q_enabled = false; | ||
77 | mwifiex_insert_cmd_to_free_q(adapter, cmd_node); | 76 | mwifiex_insert_cmd_to_free_q(adapter, cmd_node); |
78 | } | 77 | } |
79 | spin_unlock_irqrestore(&adapter->scan_pending_q_lock, flags); | 78 | spin_unlock_irqrestore(&adapter->scan_pending_q_lock, flags); |
@@ -92,6 +91,11 @@ static void scan_delay_timer_fn(unsigned long data) | |||
92 | kfree(priv->user_scan_cfg); | 91 | kfree(priv->user_scan_cfg); |
93 | priv->user_scan_cfg = NULL; | 92 | priv->user_scan_cfg = NULL; |
94 | } | 93 | } |
94 | |||
95 | if (priv->scan_pending_on_block) { | ||
96 | priv->scan_pending_on_block = false; | ||
97 | up(&priv->async_sem); | ||
98 | } | ||
95 | goto done; | 99 | goto done; |
96 | } | 100 | } |
97 | 101 | ||
diff --git a/drivers/net/wireless/mwifiex/ioctl.h b/drivers/net/wireless/mwifiex/ioctl.h index 6a5eded3be10..8688535e95eb 100644 --- a/drivers/net/wireless/mwifiex/ioctl.h +++ b/drivers/net/wireless/mwifiex/ioctl.h | |||
@@ -81,7 +81,11 @@ struct wep_key { | |||
81 | 81 | ||
82 | #define KEY_MGMT_ON_HOST 0x03 | 82 | #define KEY_MGMT_ON_HOST 0x03 |
83 | #define MWIFIEX_AUTH_MODE_AUTO 0xFF | 83 | #define MWIFIEX_AUTH_MODE_AUTO 0xFF |
84 | #define BAND_CONFIG_MANUAL 0x00 | 84 | #define BAND_CONFIG_BG 0x00 |
85 | #define BAND_CONFIG_A 0x01 | ||
86 | #define MWIFIEX_SUPPORTED_RATES 14 | ||
87 | #define MWIFIEX_SUPPORTED_RATES_EXT 32 | ||
88 | |||
85 | struct mwifiex_uap_bss_param { | 89 | struct mwifiex_uap_bss_param { |
86 | u8 channel; | 90 | u8 channel; |
87 | u8 band_cfg; | 91 | u8 band_cfg; |
@@ -100,6 +104,7 @@ struct mwifiex_uap_bss_param { | |||
100 | struct wpa_param wpa_cfg; | 104 | struct wpa_param wpa_cfg; |
101 | struct wep_key wep_cfg[NUM_WEP_KEYS]; | 105 | struct wep_key wep_cfg[NUM_WEP_KEYS]; |
102 | struct ieee80211_ht_cap ht_cap; | 106 | struct ieee80211_ht_cap ht_cap; |
107 | u8 rates[MWIFIEX_SUPPORTED_RATES]; | ||
103 | }; | 108 | }; |
104 | 109 | ||
105 | enum { | 110 | enum { |
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index cb1155286e0f..bfd6667be01e 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c | |||
@@ -72,7 +72,6 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops, | |||
72 | goto error; | 72 | goto error; |
73 | 73 | ||
74 | adapter->priv[i]->adapter = adapter; | 74 | adapter->priv[i]->adapter = adapter; |
75 | adapter->priv[i]->bss_priority = i; | ||
76 | adapter->priv_num++; | 75 | adapter->priv_num++; |
77 | } | 76 | } |
78 | mwifiex_init_lock_list(adapter); | 77 | mwifiex_init_lock_list(adapter); |
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h index 994bc4fc263e..12ceea47b4b4 100644 --- a/drivers/net/wireless/mwifiex/main.h +++ b/drivers/net/wireless/mwifiex/main.h | |||
@@ -116,6 +116,7 @@ enum { | |||
116 | #define MAX_BITMAP_RATES_SIZE 10 | 116 | #define MAX_BITMAP_RATES_SIZE 10 |
117 | 117 | ||
118 | #define MAX_CHANNEL_BAND_BG 14 | 118 | #define MAX_CHANNEL_BAND_BG 14 |
119 | #define MAX_CHANNEL_BAND_A 165 | ||
119 | 120 | ||
120 | #define MAX_FREQUENCY_BAND_BG 2484 | 121 | #define MAX_FREQUENCY_BAND_BG 2484 |
121 | 122 | ||
@@ -249,10 +250,6 @@ struct ieee_types_header { | |||
249 | u8 len; | 250 | u8 len; |
250 | } __packed; | 251 | } __packed; |
251 | 252 | ||
252 | #define MWIFIEX_SUPPORTED_RATES 14 | ||
253 | |||
254 | #define MWIFIEX_SUPPORTED_RATES_EXT 32 | ||
255 | |||
256 | struct ieee_types_vendor_specific { | 253 | struct ieee_types_vendor_specific { |
257 | struct ieee_types_vendor_header vend_hdr; | 254 | struct ieee_types_vendor_header vend_hdr; |
258 | u8 data[IEEE_MAX_IE_SIZE - sizeof(struct ieee_types_vendor_header)]; | 255 | u8 data[IEEE_MAX_IE_SIZE - sizeof(struct ieee_types_vendor_header)]; |
@@ -487,6 +484,7 @@ struct mwifiex_private { | |||
487 | s32 cqm_rssi_thold; | 484 | s32 cqm_rssi_thold; |
488 | u32 cqm_rssi_hyst; | 485 | u32 cqm_rssi_hyst; |
489 | u8 subsc_evt_rssi_state; | 486 | u8 subsc_evt_rssi_state; |
487 | struct mwifiex_ds_misc_subsc_evt async_subsc_evt_storage; | ||
490 | struct mwifiex_ie mgmt_ie[MAX_MGMT_IE_INDEX]; | 488 | struct mwifiex_ie mgmt_ie[MAX_MGMT_IE_INDEX]; |
491 | u16 beacon_idx; | 489 | u16 beacon_idx; |
492 | u16 proberesp_idx; | 490 | u16 proberesp_idx; |
@@ -814,6 +812,7 @@ struct mwifiex_sta_node * | |||
814 | mwifiex_get_sta_entry(struct mwifiex_private *priv, u8 *mac); | 812 | mwifiex_get_sta_entry(struct mwifiex_private *priv, u8 *mac); |
815 | void mwifiex_delete_all_station_list(struct mwifiex_private *priv); | 813 | void mwifiex_delete_all_station_list(struct mwifiex_private *priv); |
816 | void *mwifiex_process_sta_txpd(struct mwifiex_private *, struct sk_buff *skb); | 814 | void *mwifiex_process_sta_txpd(struct mwifiex_private *, struct sk_buff *skb); |
815 | void *mwifiex_process_uap_txpd(struct mwifiex_private *, struct sk_buff *skb); | ||
817 | int mwifiex_sta_init_cmd(struct mwifiex_private *, u8 first_sta); | 816 | int mwifiex_sta_init_cmd(struct mwifiex_private *, u8 first_sta); |
818 | int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd, | 817 | int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd, |
819 | struct mwifiex_scan_cmd_config *scan_cfg); | 818 | struct mwifiex_scan_cmd_config *scan_cfg); |
@@ -872,6 +871,8 @@ int mwifiex_set_secure_params(struct mwifiex_private *priv, | |||
872 | void mwifiex_set_ht_params(struct mwifiex_private *priv, | 871 | void mwifiex_set_ht_params(struct mwifiex_private *priv, |
873 | struct mwifiex_uap_bss_param *bss_cfg, | 872 | struct mwifiex_uap_bss_param *bss_cfg, |
874 | struct cfg80211_ap_settings *params); | 873 | struct cfg80211_ap_settings *params); |
874 | void mwifiex_set_uap_rates(struct mwifiex_uap_bss_param *bss_cfg, | ||
875 | struct cfg80211_ap_settings *params); | ||
875 | 876 | ||
876 | /* | 877 | /* |
877 | * This function checks if the queuing is RA based or not. | 878 | * This function checks if the queuing is RA based or not. |
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c index 215d07e6c462..9e077e5fc64a 100644 --- a/drivers/net/wireless/mwifiex/scan.c +++ b/drivers/net/wireless/mwifiex/scan.c | |||
@@ -726,7 +726,6 @@ mwifiex_config_scan(struct mwifiex_private *priv, | |||
726 | struct mwifiex_ie_types_num_probes *num_probes_tlv; | 726 | struct mwifiex_ie_types_num_probes *num_probes_tlv; |
727 | struct mwifiex_ie_types_wildcard_ssid_params *wildcard_ssid_tlv; | 727 | struct mwifiex_ie_types_wildcard_ssid_params *wildcard_ssid_tlv; |
728 | struct mwifiex_ie_types_rates_param_set *rates_tlv; | 728 | struct mwifiex_ie_types_rates_param_set *rates_tlv; |
729 | const u8 zero_mac[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 }; | ||
730 | u8 *tlv_pos; | 729 | u8 *tlv_pos; |
731 | u32 num_probes; | 730 | u32 num_probes; |
732 | u32 ssid_len; | 731 | u32 ssid_len; |
@@ -840,8 +839,7 @@ mwifiex_config_scan(struct mwifiex_private *priv, | |||
840 | * or BSSID filter applied to the scan results in the firmware. | 839 | * or BSSID filter applied to the scan results in the firmware. |
841 | */ | 840 | */ |
842 | if ((i && ssid_filter) || | 841 | if ((i && ssid_filter) || |
843 | memcmp(scan_cfg_out->specific_bssid, &zero_mac, | 842 | !is_zero_ether_addr(scan_cfg_out->specific_bssid)) |
844 | sizeof(zero_mac))) | ||
845 | *filtered_scan = true; | 843 | *filtered_scan = true; |
846 | } else { | 844 | } else { |
847 | scan_cfg_out->bss_mode = (u8) adapter->scan_mode; | 845 | scan_cfg_out->bss_mode = (u8) adapter->scan_mode; |
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c index 0cc3406050dc..3a4161cfeed7 100644 --- a/drivers/net/wireless/mwifiex/sta_cmd.c +++ b/drivers/net/wireless/mwifiex/sta_cmd.c | |||
@@ -551,7 +551,6 @@ mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv, | |||
551 | struct host_cmd_tlv_mac_addr *tlv_mac; | 551 | struct host_cmd_tlv_mac_addr *tlv_mac; |
552 | u16 key_param_len = 0, cmd_size; | 552 | u16 key_param_len = 0, cmd_size; |
553 | int ret = 0; | 553 | int ret = 0; |
554 | const u8 bc_mac[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; | ||
555 | 554 | ||
556 | cmd->command = cpu_to_le16(HostCmd_CMD_802_11_KEY_MATERIAL); | 555 | cmd->command = cpu_to_le16(HostCmd_CMD_802_11_KEY_MATERIAL); |
557 | key_material->action = cpu_to_le16(cmd_action); | 556 | key_material->action = cpu_to_le16(cmd_action); |
@@ -593,7 +592,7 @@ mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv, | |||
593 | /* set 0 when re-key */ | 592 | /* set 0 when re-key */ |
594 | key_material->key_param_set.key[1] = 0; | 593 | key_material->key_param_set.key[1] = 0; |
595 | 594 | ||
596 | if (0 != memcmp(enc_key->mac_addr, bc_mac, sizeof(bc_mac))) { | 595 | if (!is_broadcast_ether_addr(enc_key->mac_addr)) { |
597 | /* WAPI pairwise key: unicast */ | 596 | /* WAPI pairwise key: unicast */ |
598 | key_material->key_param_set.key_info |= | 597 | key_material->key_param_set.key_info |= |
599 | cpu_to_le16(KEY_UNICAST); | 598 | cpu_to_le16(KEY_UNICAST); |
diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c index 0b09004ebb25..31f80e10e29e 100644 --- a/drivers/net/wireless/mwifiex/sta_cmdresp.c +++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c | |||
@@ -123,7 +123,8 @@ static int mwifiex_ret_802_11_rssi_info(struct mwifiex_private *priv, | |||
123 | { | 123 | { |
124 | struct host_cmd_ds_802_11_rssi_info_rsp *rssi_info_rsp = | 124 | struct host_cmd_ds_802_11_rssi_info_rsp *rssi_info_rsp = |
125 | &resp->params.rssi_info_rsp; | 125 | &resp->params.rssi_info_rsp; |
126 | struct mwifiex_ds_misc_subsc_evt subsc_evt; | 126 | struct mwifiex_ds_misc_subsc_evt *subsc_evt = |
127 | &priv->async_subsc_evt_storage; | ||
127 | 128 | ||
128 | priv->data_rssi_last = le16_to_cpu(rssi_info_rsp->data_rssi_last); | 129 | priv->data_rssi_last = le16_to_cpu(rssi_info_rsp->data_rssi_last); |
129 | priv->data_nf_last = le16_to_cpu(rssi_info_rsp->data_nf_last); | 130 | priv->data_nf_last = le16_to_cpu(rssi_info_rsp->data_nf_last); |
@@ -140,26 +141,27 @@ static int mwifiex_ret_802_11_rssi_info(struct mwifiex_private *priv, | |||
140 | if (priv->subsc_evt_rssi_state == EVENT_HANDLED) | 141 | if (priv->subsc_evt_rssi_state == EVENT_HANDLED) |
141 | return 0; | 142 | return 0; |
142 | 143 | ||
144 | memset(subsc_evt, 0x00, sizeof(struct mwifiex_ds_misc_subsc_evt)); | ||
145 | |||
143 | /* Resubscribe low and high rssi events with new thresholds */ | 146 | /* Resubscribe low and high rssi events with new thresholds */ |
144 | memset(&subsc_evt, 0x00, sizeof(struct mwifiex_ds_misc_subsc_evt)); | 147 | subsc_evt->events = BITMASK_BCN_RSSI_LOW | BITMASK_BCN_RSSI_HIGH; |
145 | subsc_evt.events = BITMASK_BCN_RSSI_LOW | BITMASK_BCN_RSSI_HIGH; | 148 | subsc_evt->action = HostCmd_ACT_BITWISE_SET; |
146 | subsc_evt.action = HostCmd_ACT_BITWISE_SET; | ||
147 | if (priv->subsc_evt_rssi_state == RSSI_LOW_RECVD) { | 149 | if (priv->subsc_evt_rssi_state == RSSI_LOW_RECVD) { |
148 | subsc_evt.bcn_l_rssi_cfg.abs_value = abs(priv->bcn_rssi_avg - | 150 | subsc_evt->bcn_l_rssi_cfg.abs_value = abs(priv->bcn_rssi_avg - |
149 | priv->cqm_rssi_hyst); | 151 | priv->cqm_rssi_hyst); |
150 | subsc_evt.bcn_h_rssi_cfg.abs_value = abs(priv->cqm_rssi_thold); | 152 | subsc_evt->bcn_h_rssi_cfg.abs_value = abs(priv->cqm_rssi_thold); |
151 | } else if (priv->subsc_evt_rssi_state == RSSI_HIGH_RECVD) { | 153 | } else if (priv->subsc_evt_rssi_state == RSSI_HIGH_RECVD) { |
152 | subsc_evt.bcn_l_rssi_cfg.abs_value = abs(priv->cqm_rssi_thold); | 154 | subsc_evt->bcn_l_rssi_cfg.abs_value = abs(priv->cqm_rssi_thold); |
153 | subsc_evt.bcn_h_rssi_cfg.abs_value = abs(priv->bcn_rssi_avg + | 155 | subsc_evt->bcn_h_rssi_cfg.abs_value = abs(priv->bcn_rssi_avg + |
154 | priv->cqm_rssi_hyst); | 156 | priv->cqm_rssi_hyst); |
155 | } | 157 | } |
156 | subsc_evt.bcn_l_rssi_cfg.evt_freq = 1; | 158 | subsc_evt->bcn_l_rssi_cfg.evt_freq = 1; |
157 | subsc_evt.bcn_h_rssi_cfg.evt_freq = 1; | 159 | subsc_evt->bcn_h_rssi_cfg.evt_freq = 1; |
158 | 160 | ||
159 | priv->subsc_evt_rssi_state = EVENT_HANDLED; | 161 | priv->subsc_evt_rssi_state = EVENT_HANDLED; |
160 | 162 | ||
161 | mwifiex_send_cmd_async(priv, HostCmd_CMD_802_11_SUBSCRIBE_EVENT, | 163 | mwifiex_send_cmd_async(priv, HostCmd_CMD_802_11_SUBSCRIBE_EVENT, |
162 | 0, 0, &subsc_evt); | 164 | 0, 0, subsc_evt); |
163 | 165 | ||
164 | return 0; | 166 | return 0; |
165 | } | 167 | } |
@@ -736,7 +738,6 @@ static int mwifiex_ret_ibss_coalescing_status(struct mwifiex_private *priv, | |||
736 | { | 738 | { |
737 | struct host_cmd_ds_802_11_ibss_status *ibss_coal_resp = | 739 | struct host_cmd_ds_802_11_ibss_status *ibss_coal_resp = |
738 | &(resp->params.ibss_coalescing); | 740 | &(resp->params.ibss_coalescing); |
739 | u8 zero_mac[ETH_ALEN] = { 0, 0, 0, 0, 0, 0 }; | ||
740 | 741 | ||
741 | if (le16_to_cpu(ibss_coal_resp->action) == HostCmd_ACT_GEN_SET) | 742 | if (le16_to_cpu(ibss_coal_resp->action) == HostCmd_ACT_GEN_SET) |
742 | return 0; | 743 | return 0; |
@@ -745,7 +746,7 @@ static int mwifiex_ret_ibss_coalescing_status(struct mwifiex_private *priv, | |||
745 | "info: new BSSID %pM\n", ibss_coal_resp->bssid); | 746 | "info: new BSSID %pM\n", ibss_coal_resp->bssid); |
746 | 747 | ||
747 | /* If rsp has NULL BSSID, Just return..... No Action */ | 748 | /* If rsp has NULL BSSID, Just return..... No Action */ |
748 | if (!memcmp(ibss_coal_resp->bssid, zero_mac, ETH_ALEN)) { | 749 | if (is_zero_ether_addr(ibss_coal_resp->bssid)) { |
749 | dev_warn(priv->adapter->dev, "new BSSID is NULL\n"); | 750 | dev_warn(priv->adapter->dev, "new BSSID is NULL\n"); |
750 | return 0; | 751 | return 0; |
751 | } | 752 | } |
@@ -775,8 +776,7 @@ static int mwifiex_ret_ibss_coalescing_status(struct mwifiex_private *priv, | |||
775 | * This function handles the command response for subscribe event command. | 776 | * This function handles the command response for subscribe event command. |
776 | */ | 777 | */ |
777 | static int mwifiex_ret_subsc_evt(struct mwifiex_private *priv, | 778 | static int mwifiex_ret_subsc_evt(struct mwifiex_private *priv, |
778 | struct host_cmd_ds_command *resp, | 779 | struct host_cmd_ds_command *resp) |
779 | struct mwifiex_ds_misc_subsc_evt *sub_event) | ||
780 | { | 780 | { |
781 | struct host_cmd_ds_802_11_subsc_evt *cmd_sub_event = | 781 | struct host_cmd_ds_802_11_subsc_evt *cmd_sub_event = |
782 | &resp->params.subsc_evt; | 782 | &resp->params.subsc_evt; |
@@ -786,10 +786,6 @@ static int mwifiex_ret_subsc_evt(struct mwifiex_private *priv, | |||
786 | dev_dbg(priv->adapter->dev, "Bitmap of currently subscribed events: %16x\n", | 786 | dev_dbg(priv->adapter->dev, "Bitmap of currently subscribed events: %16x\n", |
787 | le16_to_cpu(cmd_sub_event->events)); | 787 | le16_to_cpu(cmd_sub_event->events)); |
788 | 788 | ||
789 | /*Return the subscribed event info for a Get request*/ | ||
790 | if (sub_event) | ||
791 | sub_event->events = le16_to_cpu(cmd_sub_event->events); | ||
792 | |||
793 | return 0; | 789 | return 0; |
794 | } | 790 | } |
795 | 791 | ||
@@ -913,7 +909,6 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no, | |||
913 | le16_to_cpu(resp->params.tx_buf.mp_end_port)); | 909 | le16_to_cpu(resp->params.tx_buf.mp_end_port)); |
914 | break; | 910 | break; |
915 | case HostCmd_CMD_AMSDU_AGGR_CTRL: | 911 | case HostCmd_CMD_AMSDU_AGGR_CTRL: |
916 | ret = mwifiex_ret_amsdu_aggr_ctrl(resp, data_buf); | ||
917 | break; | 912 | break; |
918 | case HostCmd_CMD_WMM_GET_STATUS: | 913 | case HostCmd_CMD_WMM_GET_STATUS: |
919 | ret = mwifiex_ret_wmm_get_status(priv, resp); | 914 | ret = mwifiex_ret_wmm_get_status(priv, resp); |
@@ -932,12 +927,11 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no, | |||
932 | case HostCmd_CMD_SET_BSS_MODE: | 927 | case HostCmd_CMD_SET_BSS_MODE: |
933 | break; | 928 | break; |
934 | case HostCmd_CMD_11N_CFG: | 929 | case HostCmd_CMD_11N_CFG: |
935 | ret = mwifiex_ret_11n_cfg(resp, data_buf); | ||
936 | break; | 930 | break; |
937 | case HostCmd_CMD_PCIE_DESC_DETAILS: | 931 | case HostCmd_CMD_PCIE_DESC_DETAILS: |
938 | break; | 932 | break; |
939 | case HostCmd_CMD_802_11_SUBSCRIBE_EVENT: | 933 | case HostCmd_CMD_802_11_SUBSCRIBE_EVENT: |
940 | ret = mwifiex_ret_subsc_evt(priv, resp, data_buf); | 934 | ret = mwifiex_ret_subsc_evt(priv, resp); |
941 | break; | 935 | break; |
942 | case HostCmd_CMD_UAP_SYS_CONFIG: | 936 | case HostCmd_CMD_UAP_SYS_CONFIG: |
943 | break; | 937 | break; |
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c index 3f025976f79a..d7ad2d4a069f 100644 --- a/drivers/net/wireless/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/mwifiex/sta_ioctl.c | |||
@@ -192,6 +192,44 @@ int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv, | |||
192 | return ret; | 192 | return ret; |
193 | } | 193 | } |
194 | 194 | ||
195 | static int mwifiex_process_country_ie(struct mwifiex_private *priv, | ||
196 | struct cfg80211_bss *bss) | ||
197 | { | ||
198 | u8 *country_ie, country_ie_len; | ||
199 | struct mwifiex_802_11d_domain_reg *domain_info = | ||
200 | &priv->adapter->domain_reg; | ||
201 | |||
202 | country_ie = (u8 *)ieee80211_bss_get_ie(bss, WLAN_EID_COUNTRY); | ||
203 | |||
204 | if (!country_ie) | ||
205 | return 0; | ||
206 | |||
207 | country_ie_len = country_ie[1]; | ||
208 | if (country_ie_len < IEEE80211_COUNTRY_IE_MIN_LEN) | ||
209 | return 0; | ||
210 | |||
211 | domain_info->country_code[0] = country_ie[2]; | ||
212 | domain_info->country_code[1] = country_ie[3]; | ||
213 | domain_info->country_code[2] = ' '; | ||
214 | |||
215 | country_ie_len -= IEEE80211_COUNTRY_STRING_LEN; | ||
216 | |||
217 | domain_info->no_of_triplet = | ||
218 | country_ie_len / sizeof(struct ieee80211_country_ie_triplet); | ||
219 | |||
220 | memcpy((u8 *)domain_info->triplet, | ||
221 | &country_ie[2] + IEEE80211_COUNTRY_STRING_LEN, country_ie_len); | ||
222 | |||
223 | if (mwifiex_send_cmd_async(priv, HostCmd_CMD_802_11D_DOMAIN_INFO, | ||
224 | HostCmd_ACT_GEN_SET, 0, NULL)) { | ||
225 | wiphy_err(priv->adapter->wiphy, | ||
226 | "11D: setting domain info in FW\n"); | ||
227 | return -1; | ||
228 | } | ||
229 | |||
230 | return 0; | ||
231 | } | ||
232 | |||
195 | /* | 233 | /* |
196 | * In Ad-Hoc mode, the IBSS is created if not found in scan list. | 234 | * In Ad-Hoc mode, the IBSS is created if not found in scan list. |
197 | * In both Ad-Hoc and infra mode, an deauthentication is performed | 235 | * In both Ad-Hoc and infra mode, an deauthentication is performed |
@@ -207,6 +245,8 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, | |||
207 | priv->scan_block = false; | 245 | priv->scan_block = false; |
208 | 246 | ||
209 | if (bss) { | 247 | if (bss) { |
248 | mwifiex_process_country_ie(priv, bss); | ||
249 | |||
210 | /* Allocate and fill new bss descriptor */ | 250 | /* Allocate and fill new bss descriptor */ |
211 | bss_desc = kzalloc(sizeof(struct mwifiex_bssdescriptor), | 251 | bss_desc = kzalloc(sizeof(struct mwifiex_bssdescriptor), |
212 | GFP_KERNEL); | 252 | GFP_KERNEL); |
diff --git a/drivers/net/wireless/mwifiex/txrx.c b/drivers/net/wireless/mwifiex/txrx.c index 985073d0df1a..2af263992e83 100644 --- a/drivers/net/wireless/mwifiex/txrx.c +++ b/drivers/net/wireless/mwifiex/txrx.c | |||
@@ -75,7 +75,11 @@ int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb, | |||
75 | u8 *head_ptr; | 75 | u8 *head_ptr; |
76 | struct txpd *local_tx_pd = NULL; | 76 | struct txpd *local_tx_pd = NULL; |
77 | 77 | ||
78 | head_ptr = mwifiex_process_sta_txpd(priv, skb); | 78 | if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP) |
79 | head_ptr = mwifiex_process_uap_txpd(priv, skb); | ||
80 | else | ||
81 | head_ptr = mwifiex_process_sta_txpd(priv, skb); | ||
82 | |||
79 | if (head_ptr) { | 83 | if (head_ptr) { |
80 | if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA) | 84 | if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA) |
81 | local_tx_pd = | 85 | local_tx_pd = |
diff --git a/drivers/net/wireless/mwifiex/uap_cmd.c b/drivers/net/wireless/mwifiex/uap_cmd.c index c10aac04be6a..8a627d856d18 100644 --- a/drivers/net/wireless/mwifiex/uap_cmd.c +++ b/drivers/net/wireless/mwifiex/uap_cmd.c | |||
@@ -177,6 +177,25 @@ mwifiex_set_ht_params(struct mwifiex_private *priv, | |||
177 | return; | 177 | return; |
178 | } | 178 | } |
179 | 179 | ||
180 | /* This function finds supported rates IE from beacon parameter and sets | ||
181 | * these rates into bss_config structure. | ||
182 | */ | ||
183 | void | ||
184 | mwifiex_set_uap_rates(struct mwifiex_uap_bss_param *bss_cfg, | ||
185 | struct cfg80211_ap_settings *params) | ||
186 | { | ||
187 | struct ieee_types_header *rate_ie; | ||
188 | int var_offset = offsetof(struct ieee80211_mgmt, u.beacon.variable); | ||
189 | const u8 *var_pos = params->beacon.head + var_offset; | ||
190 | int len = params->beacon.head_len - var_offset; | ||
191 | |||
192 | rate_ie = (void *)cfg80211_find_ie(WLAN_EID_SUPP_RATES, var_pos, len); | ||
193 | if (rate_ie) | ||
194 | memcpy(bss_cfg->rates, rate_ie + 1, rate_ie->len); | ||
195 | |||
196 | return; | ||
197 | } | ||
198 | |||
180 | /* This function initializes some of mwifiex_uap_bss_param variables. | 199 | /* This function initializes some of mwifiex_uap_bss_param variables. |
181 | * This helps FW in ignoring invalid values. These values may or may not | 200 | * This helps FW in ignoring invalid values. These values may or may not |
182 | * be get updated to valid ones at later stage. | 201 | * be get updated to valid ones at later stage. |
@@ -323,8 +342,10 @@ mwifiex_uap_bss_param_prepare(u8 *tlv, void *cmd_buf, u16 *param_size) | |||
323 | struct host_cmd_tlv_retry_limit *retry_limit; | 342 | struct host_cmd_tlv_retry_limit *retry_limit; |
324 | struct host_cmd_tlv_encrypt_protocol *encrypt_protocol; | 343 | struct host_cmd_tlv_encrypt_protocol *encrypt_protocol; |
325 | struct host_cmd_tlv_auth_type *auth_type; | 344 | struct host_cmd_tlv_auth_type *auth_type; |
345 | struct host_cmd_tlv_rates *tlv_rates; | ||
326 | struct mwifiex_ie_types_htcap *htcap; | 346 | struct mwifiex_ie_types_htcap *htcap; |
327 | struct mwifiex_uap_bss_param *bss_cfg = cmd_buf; | 347 | struct mwifiex_uap_bss_param *bss_cfg = cmd_buf; |
348 | int i; | ||
328 | u16 cmd_size = *param_size; | 349 | u16 cmd_size = *param_size; |
329 | 350 | ||
330 | if (bss_cfg->ssid.ssid_len) { | 351 | if (bss_cfg->ssid.ssid_len) { |
@@ -344,7 +365,23 @@ mwifiex_uap_bss_param_prepare(u8 *tlv, void *cmd_buf, u16 *param_size) | |||
344 | cmd_size += sizeof(struct host_cmd_tlv_bcast_ssid); | 365 | cmd_size += sizeof(struct host_cmd_tlv_bcast_ssid); |
345 | tlv += sizeof(struct host_cmd_tlv_bcast_ssid); | 366 | tlv += sizeof(struct host_cmd_tlv_bcast_ssid); |
346 | } | 367 | } |
347 | if (bss_cfg->channel && bss_cfg->channel <= MAX_CHANNEL_BAND_BG) { | 368 | if (bss_cfg->rates[0]) { |
369 | tlv_rates = (struct host_cmd_tlv_rates *)tlv; | ||
370 | tlv_rates->tlv.type = cpu_to_le16(TLV_TYPE_UAP_RATES); | ||
371 | |||
372 | for (i = 0; i < MWIFIEX_SUPPORTED_RATES && bss_cfg->rates[i]; | ||
373 | i++) | ||
374 | tlv_rates->rates[i] = bss_cfg->rates[i]; | ||
375 | |||
376 | tlv_rates->tlv.len = cpu_to_le16(i); | ||
377 | cmd_size += sizeof(struct host_cmd_tlv_rates) + i; | ||
378 | tlv += sizeof(struct host_cmd_tlv_rates) + i; | ||
379 | } | ||
380 | if (bss_cfg->channel && | ||
381 | ((bss_cfg->band_cfg == BAND_CONFIG_BG && | ||
382 | bss_cfg->channel <= MAX_CHANNEL_BAND_BG) || | ||
383 | (bss_cfg->band_cfg == BAND_CONFIG_A && | ||
384 | bss_cfg->channel <= MAX_CHANNEL_BAND_A))) { | ||
348 | chan_band = (struct host_cmd_tlv_channel_band *)tlv; | 385 | chan_band = (struct host_cmd_tlv_channel_band *)tlv; |
349 | chan_band->tlv.type = cpu_to_le16(TLV_TYPE_CHANNELBANDLIST); | 386 | chan_band->tlv.type = cpu_to_le16(TLV_TYPE_CHANNELBANDLIST); |
350 | chan_band->tlv.len = | 387 | chan_band->tlv.len = |
diff --git a/drivers/net/wireless/mwifiex/uap_txrx.c b/drivers/net/wireless/mwifiex/uap_txrx.c index 6d814f0f07f2..df17d08715fe 100644 --- a/drivers/net/wireless/mwifiex/uap_txrx.c +++ b/drivers/net/wireless/mwifiex/uap_txrx.c | |||
@@ -253,3 +253,73 @@ int mwifiex_process_uap_rx_packet(struct mwifiex_adapter *adapter, | |||
253 | 253 | ||
254 | return ret; | 254 | return ret; |
255 | } | 255 | } |
256 | |||
257 | /* | ||
258 | * This function fills the TxPD for AP tx packets. | ||
259 | * | ||
260 | * The Tx buffer received by this function should already have the | ||
261 | * header space allocated for TxPD. | ||
262 | * | ||
263 | * This function inserts the TxPD in between interface header and actual | ||
264 | * data and adjusts the buffer pointers accordingly. | ||
265 | * | ||
266 | * The following TxPD fields are set by this function, as required - | ||
267 | * - BSS number | ||
268 | * - Tx packet length and offset | ||
269 | * - Priority | ||
270 | * - Packet delay | ||
271 | * - Priority specific Tx control | ||
272 | * - Flags | ||
273 | */ | ||
274 | void *mwifiex_process_uap_txpd(struct mwifiex_private *priv, | ||
275 | struct sk_buff *skb) | ||
276 | { | ||
277 | struct mwifiex_adapter *adapter = priv->adapter; | ||
278 | struct uap_txpd *txpd; | ||
279 | struct mwifiex_txinfo *tx_info = MWIFIEX_SKB_TXCB(skb); | ||
280 | int pad, len; | ||
281 | |||
282 | if (!skb->len) { | ||
283 | dev_err(adapter->dev, "Tx: bad packet length: %d\n", skb->len); | ||
284 | tx_info->status_code = -1; | ||
285 | return skb->data; | ||
286 | } | ||
287 | |||
288 | /* If skb->data is not aligned, add padding */ | ||
289 | pad = (4 - (((void *)skb->data - NULL) & 0x3)) % 4; | ||
290 | |||
291 | len = sizeof(*txpd) + pad; | ||
292 | |||
293 | BUG_ON(skb_headroom(skb) < len + INTF_HEADER_LEN); | ||
294 | |||
295 | skb_push(skb, len); | ||
296 | |||
297 | txpd = (struct uap_txpd *)skb->data; | ||
298 | memset(txpd, 0, sizeof(*txpd)); | ||
299 | txpd->bss_num = priv->bss_num; | ||
300 | txpd->bss_type = priv->bss_type; | ||
301 | txpd->tx_pkt_length = cpu_to_le16((u16)(skb->len - len)); | ||
302 | |||
303 | txpd->priority = (u8)skb->priority; | ||
304 | txpd->pkt_delay_2ms = mwifiex_wmm_compute_drv_pkt_delay(priv, skb); | ||
305 | |||
306 | if (txpd->priority < ARRAY_SIZE(priv->wmm.user_pri_pkt_tx_ctrl)) | ||
307 | /* | ||
308 | * Set the priority specific tx_control field, setting of 0 will | ||
309 | * cause the default value to be used later in this function. | ||
310 | */ | ||
311 | txpd->tx_control = | ||
312 | cpu_to_le32(priv->wmm.user_pri_pkt_tx_ctrl[txpd->priority]); | ||
313 | |||
314 | /* Offset of actual data */ | ||
315 | txpd->tx_pkt_offset = cpu_to_le16(len); | ||
316 | |||
317 | /* make space for INTF_HEADER_LEN */ | ||
318 | skb_push(skb, INTF_HEADER_LEN); | ||
319 | |||
320 | if (!txpd->tx_control) | ||
321 | /* TxCtrl set by user or default */ | ||
322 | txpd->tx_control = cpu_to_le32(priv->pkt_tx_ctrl); | ||
323 | |||
324 | return skb->data; | ||
325 | } | ||
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c index 8ccd6999fa9f..766d45294c86 100644 --- a/drivers/net/wireless/mwifiex/wmm.c +++ b/drivers/net/wireless/mwifiex/wmm.c | |||
@@ -907,17 +907,16 @@ mwifiex_wmm_get_highest_priolist_ptr(struct mwifiex_adapter *adapter, | |||
907 | if (adapter->bss_prio_tbl[j].bss_prio_cur == | 907 | if (adapter->bss_prio_tbl[j].bss_prio_cur == |
908 | (struct mwifiex_bss_prio_node *) | 908 | (struct mwifiex_bss_prio_node *) |
909 | &adapter->bss_prio_tbl[j].bss_prio_head) { | 909 | &adapter->bss_prio_tbl[j].bss_prio_head) { |
910 | bssprio_node = | 910 | adapter->bss_prio_tbl[j].bss_prio_cur = |
911 | list_first_entry(&adapter->bss_prio_tbl[j] | 911 | list_first_entry(&adapter->bss_prio_tbl[j] |
912 | .bss_prio_head, | 912 | .bss_prio_head, |
913 | struct mwifiex_bss_prio_node, | 913 | struct mwifiex_bss_prio_node, |
914 | list); | 914 | list); |
915 | bssprio_head = bssprio_node; | ||
916 | } else { | ||
917 | bssprio_node = adapter->bss_prio_tbl[j].bss_prio_cur; | ||
918 | bssprio_head = bssprio_node; | ||
919 | } | 915 | } |
920 | 916 | ||
917 | bssprio_node = adapter->bss_prio_tbl[j].bss_prio_cur; | ||
918 | bssprio_head = bssprio_node; | ||
919 | |||
921 | do { | 920 | do { |
922 | priv_tmp = bssprio_node->priv; | 921 | priv_tmp = bssprio_node->priv; |
923 | hqp = &priv_tmp->wmm.highest_queued_prio; | 922 | hqp = &priv_tmp->wmm.highest_queued_prio; |
diff --git a/drivers/net/wireless/orinoco/wext.c b/drivers/net/wireless/orinoco/wext.c index 33747e131a96..3b5508f982e8 100644 --- a/drivers/net/wireless/orinoco/wext.c +++ b/drivers/net/wireless/orinoco/wext.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/if_arp.h> | 7 | #include <linux/if_arp.h> |
8 | #include <linux/wireless.h> | 8 | #include <linux/wireless.h> |
9 | #include <linux/ieee80211.h> | 9 | #include <linux/ieee80211.h> |
10 | #include <linux/etherdevice.h> | ||
10 | #include <net/iw_handler.h> | 11 | #include <net/iw_handler.h> |
11 | #include <net/cfg80211.h> | 12 | #include <net/cfg80211.h> |
12 | #include <net/cfg80211-wext.h> | 13 | #include <net/cfg80211-wext.h> |
@@ -159,15 +160,13 @@ static int orinoco_ioctl_setwap(struct net_device *dev, | |||
159 | struct orinoco_private *priv = ndev_priv(dev); | 160 | struct orinoco_private *priv = ndev_priv(dev); |
160 | int err = -EINPROGRESS; /* Call commit handler */ | 161 | int err = -EINPROGRESS; /* Call commit handler */ |
161 | unsigned long flags; | 162 | unsigned long flags; |
162 | static const u8 off_addr[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; | ||
163 | static const u8 any_addr[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; | ||
164 | 163 | ||
165 | if (orinoco_lock(priv, &flags) != 0) | 164 | if (orinoco_lock(priv, &flags) != 0) |
166 | return -EBUSY; | 165 | return -EBUSY; |
167 | 166 | ||
168 | /* Enable automatic roaming - no sanity checks are needed */ | 167 | /* Enable automatic roaming - no sanity checks are needed */ |
169 | if (memcmp(&ap_addr->sa_data, off_addr, ETH_ALEN) == 0 || | 168 | if (is_zero_ether_addr(ap_addr->sa_data) || |
170 | memcmp(&ap_addr->sa_data, any_addr, ETH_ALEN) == 0) { | 169 | is_broadcast_ether_addr(ap_addr->sa_data)) { |
171 | priv->bssid_fixed = 0; | 170 | priv->bssid_fixed = 0; |
172 | memset(priv->desired_bssid, 0, ETH_ALEN); | 171 | memset(priv->desired_bssid, 0, ETH_ALEN); |
173 | 172 | ||
diff --git a/drivers/net/wireless/p54/main.c b/drivers/net/wireless/p54/main.c index 5e91ad06dd5d..2969d5321ca6 100644 --- a/drivers/net/wireless/p54/main.c +++ b/drivers/net/wireless/p54/main.c | |||
@@ -139,6 +139,7 @@ static int p54_beacon_format_ie_tim(struct sk_buff *skb) | |||
139 | static int p54_beacon_update(struct p54_common *priv, | 139 | static int p54_beacon_update(struct p54_common *priv, |
140 | struct ieee80211_vif *vif) | 140 | struct ieee80211_vif *vif) |
141 | { | 141 | { |
142 | struct ieee80211_tx_control control = { }; | ||
142 | struct sk_buff *beacon; | 143 | struct sk_buff *beacon; |
143 | int ret; | 144 | int ret; |
144 | 145 | ||
@@ -158,7 +159,7 @@ static int p54_beacon_update(struct p54_common *priv, | |||
158 | * to cancel the old beacon template by hand, instead the firmware | 159 | * to cancel the old beacon template by hand, instead the firmware |
159 | * will release the previous one through the feedback mechanism. | 160 | * will release the previous one through the feedback mechanism. |
160 | */ | 161 | */ |
161 | p54_tx_80211(priv->hw, NULL, beacon); | 162 | p54_tx_80211(priv->hw, &control, beacon); |
162 | priv->tsf_high32 = 0; | 163 | priv->tsf_high32 = 0; |
163 | priv->tsf_low32 = 0; | 164 | priv->tsf_low32 = 0; |
164 | 165 | ||
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index 7a4ae9ee1c63..bd1f0cb56085 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
@@ -1959,9 +1959,6 @@ static int rndis_scan(struct wiphy *wiphy, | |||
1959 | */ | 1959 | */ |
1960 | rndis_check_bssid_list(usbdev, NULL, NULL); | 1960 | rndis_check_bssid_list(usbdev, NULL, NULL); |
1961 | 1961 | ||
1962 | if (!request) | ||
1963 | return -EINVAL; | ||
1964 | |||
1965 | if (priv->scan_request && priv->scan_request != request) | 1962 | if (priv->scan_request && priv->scan_request != request) |
1966 | return -EBUSY; | 1963 | return -EBUSY; |
1967 | 1964 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 8b9dbd76a252..6458ab87717b 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -205,7 +205,7 @@ static int rt2400pci_rfkill_poll(struct rt2x00_dev *rt2x00dev) | |||
205 | u32 reg; | 205 | u32 reg; |
206 | 206 | ||
207 | rt2x00pci_register_read(rt2x00dev, GPIOCSR, ®); | 207 | rt2x00pci_register_read(rt2x00dev, GPIOCSR, ®); |
208 | return rt2x00_get_field32(reg, GPIOCSR_BIT0); | 208 | return rt2x00_get_field32(reg, GPIOCSR_VAL0); |
209 | } | 209 | } |
210 | 210 | ||
211 | #ifdef CONFIG_RT2X00_LIB_LEDS | 211 | #ifdef CONFIG_RT2X00_LIB_LEDS |
@@ -1611,6 +1611,7 @@ static int rt2400pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
1611 | static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev) | 1611 | static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev) |
1612 | { | 1612 | { |
1613 | int retval; | 1613 | int retval; |
1614 | u32 reg; | ||
1614 | 1615 | ||
1615 | /* | 1616 | /* |
1616 | * Allocate eeprom data. | 1617 | * Allocate eeprom data. |
@@ -1624,6 +1625,14 @@ static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
1624 | return retval; | 1625 | return retval; |
1625 | 1626 | ||
1626 | /* | 1627 | /* |
1628 | * Enable rfkill polling by setting GPIO direction of the | ||
1629 | * rfkill switch GPIO pin correctly. | ||
1630 | */ | ||
1631 | rt2x00pci_register_read(rt2x00dev, GPIOCSR, ®); | ||
1632 | rt2x00_set_field32(®, GPIOCSR_DIR0, 1); | ||
1633 | rt2x00pci_register_write(rt2x00dev, GPIOCSR, reg); | ||
1634 | |||
1635 | /* | ||
1627 | * Initialize hw specifications. | 1636 | * Initialize hw specifications. |
1628 | */ | 1637 | */ |
1629 | retval = rt2400pci_probe_hw_mode(rt2x00dev); | 1638 | retval = rt2400pci_probe_hw_mode(rt2x00dev); |
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.h b/drivers/net/wireless/rt2x00/rt2400pci.h index d3a4a68cc439..e4b07f0aa3cc 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.h +++ b/drivers/net/wireless/rt2x00/rt2400pci.h | |||
@@ -660,16 +660,26 @@ | |||
660 | 660 | ||
661 | /* | 661 | /* |
662 | * GPIOCSR: GPIO control register. | 662 | * GPIOCSR: GPIO control register. |
663 | * GPIOCSR_VALx: Actual GPIO pin x value | ||
664 | * GPIOCSR_DIRx: GPIO direction: 0 = output; 1 = input | ||
663 | */ | 665 | */ |
664 | #define GPIOCSR 0x0120 | 666 | #define GPIOCSR 0x0120 |
665 | #define GPIOCSR_BIT0 FIELD32(0x00000001) | 667 | #define GPIOCSR_VAL0 FIELD32(0x00000001) |
666 | #define GPIOCSR_BIT1 FIELD32(0x00000002) | 668 | #define GPIOCSR_VAL1 FIELD32(0x00000002) |
667 | #define GPIOCSR_BIT2 FIELD32(0x00000004) | 669 | #define GPIOCSR_VAL2 FIELD32(0x00000004) |
668 | #define GPIOCSR_BIT3 FIELD32(0x00000008) | 670 | #define GPIOCSR_VAL3 FIELD32(0x00000008) |
669 | #define GPIOCSR_BIT4 FIELD32(0x00000010) | 671 | #define GPIOCSR_VAL4 FIELD32(0x00000010) |
670 | #define GPIOCSR_BIT5 FIELD32(0x00000020) | 672 | #define GPIOCSR_VAL5 FIELD32(0x00000020) |
671 | #define GPIOCSR_BIT6 FIELD32(0x00000040) | 673 | #define GPIOCSR_VAL6 FIELD32(0x00000040) |
672 | #define GPIOCSR_BIT7 FIELD32(0x00000080) | 674 | #define GPIOCSR_VAL7 FIELD32(0x00000080) |
675 | #define GPIOCSR_DIR0 FIELD32(0x00000100) | ||
676 | #define GPIOCSR_DIR1 FIELD32(0x00000200) | ||
677 | #define GPIOCSR_DIR2 FIELD32(0x00000400) | ||
678 | #define GPIOCSR_DIR3 FIELD32(0x00000800) | ||
679 | #define GPIOCSR_DIR4 FIELD32(0x00001000) | ||
680 | #define GPIOCSR_DIR5 FIELD32(0x00002000) | ||
681 | #define GPIOCSR_DIR6 FIELD32(0x00004000) | ||
682 | #define GPIOCSR_DIR7 FIELD32(0x00008000) | ||
673 | 683 | ||
674 | /* | 684 | /* |
675 | * BBPPCSR: BBP Pin control register. | 685 | * BBPPCSR: BBP Pin control register. |
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index d2cf8a4bc8b5..68bca1456cda 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/rt2x00/rt2500pci.c | |||
@@ -205,7 +205,7 @@ static int rt2500pci_rfkill_poll(struct rt2x00_dev *rt2x00dev) | |||
205 | u32 reg; | 205 | u32 reg; |
206 | 206 | ||
207 | rt2x00pci_register_read(rt2x00dev, GPIOCSR, ®); | 207 | rt2x00pci_register_read(rt2x00dev, GPIOCSR, ®); |
208 | return rt2x00_get_field32(reg, GPIOCSR_BIT0); | 208 | return rt2x00_get_field32(reg, GPIOCSR_VAL0); |
209 | } | 209 | } |
210 | 210 | ||
211 | #ifdef CONFIG_RT2X00_LIB_LEDS | 211 | #ifdef CONFIG_RT2X00_LIB_LEDS |
@@ -1929,6 +1929,7 @@ static int rt2500pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
1929 | static int rt2500pci_probe_hw(struct rt2x00_dev *rt2x00dev) | 1929 | static int rt2500pci_probe_hw(struct rt2x00_dev *rt2x00dev) |
1930 | { | 1930 | { |
1931 | int retval; | 1931 | int retval; |
1932 | u32 reg; | ||
1932 | 1933 | ||
1933 | /* | 1934 | /* |
1934 | * Allocate eeprom data. | 1935 | * Allocate eeprom data. |
@@ -1942,6 +1943,14 @@ static int rt2500pci_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
1942 | return retval; | 1943 | return retval; |
1943 | 1944 | ||
1944 | /* | 1945 | /* |
1946 | * Enable rfkill polling by setting GPIO direction of the | ||
1947 | * rfkill switch GPIO pin correctly. | ||
1948 | */ | ||
1949 | rt2x00pci_register_read(rt2x00dev, GPIOCSR, ®); | ||
1950 | rt2x00_set_field32(®, GPIOCSR_DIR0, 1); | ||
1951 | rt2x00pci_register_write(rt2x00dev, GPIOCSR, reg); | ||
1952 | |||
1953 | /* | ||
1945 | * Initialize hw specifications. | 1954 | * Initialize hw specifications. |
1946 | */ | 1955 | */ |
1947 | retval = rt2500pci_probe_hw_mode(rt2x00dev); | 1956 | retval = rt2500pci_probe_hw_mode(rt2x00dev); |
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.h b/drivers/net/wireless/rt2x00/rt2500pci.h index 2aad7ba8a100..9c10068e4987 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.h +++ b/drivers/net/wireless/rt2x00/rt2500pci.h | |||
@@ -789,16 +789,18 @@ | |||
789 | 789 | ||
790 | /* | 790 | /* |
791 | * GPIOCSR: GPIO control register. | 791 | * GPIOCSR: GPIO control register. |
792 | * GPIOCSR_VALx: GPIO value | ||
793 | * GPIOCSR_DIRx: GPIO direction: 0 = output; 1 = input | ||
792 | */ | 794 | */ |
793 | #define GPIOCSR 0x0120 | 795 | #define GPIOCSR 0x0120 |
794 | #define GPIOCSR_BIT0 FIELD32(0x00000001) | 796 | #define GPIOCSR_VAL0 FIELD32(0x00000001) |
795 | #define GPIOCSR_BIT1 FIELD32(0x00000002) | 797 | #define GPIOCSR_VAL1 FIELD32(0x00000002) |
796 | #define GPIOCSR_BIT2 FIELD32(0x00000004) | 798 | #define GPIOCSR_VAL2 FIELD32(0x00000004) |
797 | #define GPIOCSR_BIT3 FIELD32(0x00000008) | 799 | #define GPIOCSR_VAL3 FIELD32(0x00000008) |
798 | #define GPIOCSR_BIT4 FIELD32(0x00000010) | 800 | #define GPIOCSR_VAL4 FIELD32(0x00000010) |
799 | #define GPIOCSR_BIT5 FIELD32(0x00000020) | 801 | #define GPIOCSR_VAL5 FIELD32(0x00000020) |
800 | #define GPIOCSR_BIT6 FIELD32(0x00000040) | 802 | #define GPIOCSR_VAL6 FIELD32(0x00000040) |
801 | #define GPIOCSR_BIT7 FIELD32(0x00000080) | 803 | #define GPIOCSR_VAL7 FIELD32(0x00000080) |
802 | #define GPIOCSR_DIR0 FIELD32(0x00000100) | 804 | #define GPIOCSR_DIR0 FIELD32(0x00000100) |
803 | #define GPIOCSR_DIR1 FIELD32(0x00000200) | 805 | #define GPIOCSR_DIR1 FIELD32(0x00000200) |
804 | #define GPIOCSR_DIR2 FIELD32(0x00000400) | 806 | #define GPIOCSR_DIR2 FIELD32(0x00000400) |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 3aae36bb0a9e..f95b5516c50a 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -283,7 +283,7 @@ static int rt2500usb_rfkill_poll(struct rt2x00_dev *rt2x00dev) | |||
283 | u16 reg; | 283 | u16 reg; |
284 | 284 | ||
285 | rt2500usb_register_read(rt2x00dev, MAC_CSR19, ®); | 285 | rt2500usb_register_read(rt2x00dev, MAC_CSR19, ®); |
286 | return rt2x00_get_field32(reg, MAC_CSR19_BIT7); | 286 | return rt2x00_get_field16(reg, MAC_CSR19_VAL7); |
287 | } | 287 | } |
288 | 288 | ||
289 | #ifdef CONFIG_RT2X00_LIB_LEDS | 289 | #ifdef CONFIG_RT2X00_LIB_LEDS |
@@ -1768,6 +1768,7 @@ static int rt2500usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
1768 | static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev) | 1768 | static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev) |
1769 | { | 1769 | { |
1770 | int retval; | 1770 | int retval; |
1771 | u16 reg; | ||
1771 | 1772 | ||
1772 | /* | 1773 | /* |
1773 | * Allocate eeprom data. | 1774 | * Allocate eeprom data. |
@@ -1781,6 +1782,14 @@ static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
1781 | return retval; | 1782 | return retval; |
1782 | 1783 | ||
1783 | /* | 1784 | /* |
1785 | * Enable rfkill polling by setting GPIO direction of the | ||
1786 | * rfkill switch GPIO pin correctly. | ||
1787 | */ | ||
1788 | rt2500usb_register_read(rt2x00dev, MAC_CSR19, ®); | ||
1789 | rt2x00_set_field16(®, MAC_CSR19_DIR0, 0); | ||
1790 | rt2500usb_register_write(rt2x00dev, MAC_CSR19, reg); | ||
1791 | |||
1792 | /* | ||
1784 | * Initialize hw specifications. | 1793 | * Initialize hw specifications. |
1785 | */ | 1794 | */ |
1786 | retval = rt2500usb_probe_hw_mode(rt2x00dev); | 1795 | retval = rt2500usb_probe_hw_mode(rt2x00dev); |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.h b/drivers/net/wireless/rt2x00/rt2500usb.h index b493306a7eed..1b91a4cef965 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.h +++ b/drivers/net/wireless/rt2x00/rt2500usb.h | |||
@@ -187,16 +187,26 @@ | |||
187 | 187 | ||
188 | /* | 188 | /* |
189 | * MAC_CSR19: GPIO control register. | 189 | * MAC_CSR19: GPIO control register. |
190 | * MAC_CSR19_VALx: GPIO value | ||
191 | * MAC_CSR19_DIRx: GPIO direction: 0 = input; 1 = output | ||
190 | */ | 192 | */ |
191 | #define MAC_CSR19 0x0426 | 193 | #define MAC_CSR19 0x0426 |
192 | #define MAC_CSR19_BIT0 FIELD32(0x0001) | 194 | #define MAC_CSR19_VAL0 FIELD16(0x0001) |
193 | #define MAC_CSR19_BIT1 FIELD32(0x0002) | 195 | #define MAC_CSR19_VAL1 FIELD16(0x0002) |
194 | #define MAC_CSR19_BIT2 FIELD32(0x0004) | 196 | #define MAC_CSR19_VAL2 FIELD16(0x0004) |
195 | #define MAC_CSR19_BIT3 FIELD32(0x0008) | 197 | #define MAC_CSR19_VAL3 FIELD16(0x0008) |
196 | #define MAC_CSR19_BIT4 FIELD32(0x0010) | 198 | #define MAC_CSR19_VAL4 FIELD16(0x0010) |
197 | #define MAC_CSR19_BIT5 FIELD32(0x0020) | 199 | #define MAC_CSR19_VAL5 FIELD16(0x0020) |
198 | #define MAC_CSR19_BIT6 FIELD32(0x0040) | 200 | #define MAC_CSR19_VAL6 FIELD16(0x0040) |
199 | #define MAC_CSR19_BIT7 FIELD32(0x0080) | 201 | #define MAC_CSR19_VAL7 FIELD16(0x0080) |
202 | #define MAC_CSR19_DIR0 FIELD16(0x0100) | ||
203 | #define MAC_CSR19_DIR1 FIELD16(0x0200) | ||
204 | #define MAC_CSR19_DIR2 FIELD16(0x0400) | ||
205 | #define MAC_CSR19_DIR3 FIELD16(0x0800) | ||
206 | #define MAC_CSR19_DIR4 FIELD16(0x1000) | ||
207 | #define MAC_CSR19_DIR5 FIELD16(0x2000) | ||
208 | #define MAC_CSR19_DIR6 FIELD16(0x4000) | ||
209 | #define MAC_CSR19_DIR7 FIELD16(0x8000) | ||
200 | 210 | ||
201 | /* | 211 | /* |
202 | * MAC_CSR20: LED control register. | 212 | * MAC_CSR20: LED control register. |
diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h index e252e9bafd0e..6d67c3ede651 100644 --- a/drivers/net/wireless/rt2x00/rt2800.h +++ b/drivers/net/wireless/rt2x00/rt2800.h | |||
@@ -439,26 +439,33 @@ | |||
439 | #define WMM_TXOP1_CFG_AC3TXOP FIELD32(0xffff0000) | 439 | #define WMM_TXOP1_CFG_AC3TXOP FIELD32(0xffff0000) |
440 | 440 | ||
441 | /* | 441 | /* |
442 | * GPIO_CTRL_CFG: | 442 | * GPIO_CTRL: |
443 | * GPIOD: GPIO direction, 0: Output, 1: Input | 443 | * GPIO_CTRL_VALx: GPIO value |
444 | */ | 444 | * GPIO_CTRL_DIRx: GPIO direction: 0 = output; 1 = input |
445 | #define GPIO_CTRL_CFG 0x0228 | 445 | */ |
446 | #define GPIO_CTRL_CFG_BIT0 FIELD32(0x00000001) | 446 | #define GPIO_CTRL 0x0228 |
447 | #define GPIO_CTRL_CFG_BIT1 FIELD32(0x00000002) | 447 | #define GPIO_CTRL_VAL0 FIELD32(0x00000001) |
448 | #define GPIO_CTRL_CFG_BIT2 FIELD32(0x00000004) | 448 | #define GPIO_CTRL_VAL1 FIELD32(0x00000002) |
449 | #define GPIO_CTRL_CFG_BIT3 FIELD32(0x00000008) | 449 | #define GPIO_CTRL_VAL2 FIELD32(0x00000004) |
450 | #define GPIO_CTRL_CFG_BIT4 FIELD32(0x00000010) | 450 | #define GPIO_CTRL_VAL3 FIELD32(0x00000008) |
451 | #define GPIO_CTRL_CFG_BIT5 FIELD32(0x00000020) | 451 | #define GPIO_CTRL_VAL4 FIELD32(0x00000010) |
452 | #define GPIO_CTRL_CFG_BIT6 FIELD32(0x00000040) | 452 | #define GPIO_CTRL_VAL5 FIELD32(0x00000020) |
453 | #define GPIO_CTRL_CFG_BIT7 FIELD32(0x00000080) | 453 | #define GPIO_CTRL_VAL6 FIELD32(0x00000040) |
454 | #define GPIO_CTRL_CFG_GPIOD_BIT0 FIELD32(0x00000100) | 454 | #define GPIO_CTRL_VAL7 FIELD32(0x00000080) |
455 | #define GPIO_CTRL_CFG_GPIOD_BIT1 FIELD32(0x00000200) | 455 | #define GPIO_CTRL_DIR0 FIELD32(0x00000100) |
456 | #define GPIO_CTRL_CFG_GPIOD_BIT2 FIELD32(0x00000400) | 456 | #define GPIO_CTRL_DIR1 FIELD32(0x00000200) |
457 | #define GPIO_CTRL_CFG_GPIOD_BIT3 FIELD32(0x00000800) | 457 | #define GPIO_CTRL_DIR2 FIELD32(0x00000400) |
458 | #define GPIO_CTRL_CFG_GPIOD_BIT4 FIELD32(0x00001000) | 458 | #define GPIO_CTRL_DIR3 FIELD32(0x00000800) |
459 | #define GPIO_CTRL_CFG_GPIOD_BIT5 FIELD32(0x00002000) | 459 | #define GPIO_CTRL_DIR4 FIELD32(0x00001000) |
460 | #define GPIO_CTRL_CFG_GPIOD_BIT6 FIELD32(0x00004000) | 460 | #define GPIO_CTRL_DIR5 FIELD32(0x00002000) |
461 | #define GPIO_CTRL_CFG_GPIOD_BIT7 FIELD32(0x00008000) | 461 | #define GPIO_CTRL_DIR6 FIELD32(0x00004000) |
462 | #define GPIO_CTRL_DIR7 FIELD32(0x00008000) | ||
463 | #define GPIO_CTRL_VAL8 FIELD32(0x00010000) | ||
464 | #define GPIO_CTRL_VAL9 FIELD32(0x00020000) | ||
465 | #define GPIO_CTRL_VAL10 FIELD32(0x00040000) | ||
466 | #define GPIO_CTRL_DIR8 FIELD32(0x01000000) | ||
467 | #define GPIO_CTRL_DIR9 FIELD32(0x02000000) | ||
468 | #define GPIO_CTRL_DIR10 FIELD32(0x04000000) | ||
462 | 469 | ||
463 | /* | 470 | /* |
464 | * MCU_CMD_CFG | 471 | * MCU_CMD_CFG |
@@ -1936,6 +1943,11 @@ struct mac_iveiv_entry { | |||
1936 | #define BBP47_TSSI_ADC6 FIELD8(0x80) | 1943 | #define BBP47_TSSI_ADC6 FIELD8(0x80) |
1937 | 1944 | ||
1938 | /* | 1945 | /* |
1946 | * BBP 49 | ||
1947 | */ | ||
1948 | #define BBP49_UPDATE_FLAG FIELD8(0x01) | ||
1949 | |||
1950 | /* | ||
1939 | * BBP 109 | 1951 | * BBP 109 |
1940 | */ | 1952 | */ |
1941 | #define BBP109_TX0_POWER FIELD8(0x0f) | 1953 | #define BBP109_TX0_POWER FIELD8(0x0f) |
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index cb8c2aca54e4..9e09367c9739 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -923,8 +923,8 @@ int rt2800_rfkill_poll(struct rt2x00_dev *rt2x00dev) | |||
923 | rt2800_register_read(rt2x00dev, WLAN_FUN_CTRL, ®); | 923 | rt2800_register_read(rt2x00dev, WLAN_FUN_CTRL, ®); |
924 | return rt2x00_get_field32(reg, WLAN_GPIO_IN_BIT0); | 924 | return rt2x00_get_field32(reg, WLAN_GPIO_IN_BIT0); |
925 | } else { | 925 | } else { |
926 | rt2800_register_read(rt2x00dev, GPIO_CTRL_CFG, ®); | 926 | rt2800_register_read(rt2x00dev, GPIO_CTRL, ®); |
927 | return rt2x00_get_field32(reg, GPIO_CTRL_CFG_BIT2); | 927 | return rt2x00_get_field32(reg, GPIO_CTRL_VAL2); |
928 | } | 928 | } |
929 | } | 929 | } |
930 | EXPORT_SYMBOL_GPL(rt2800_rfkill_poll); | 930 | EXPORT_SYMBOL_GPL(rt2800_rfkill_poll); |
@@ -1570,10 +1570,10 @@ static void rt2800_set_ant_diversity(struct rt2x00_dev *rt2x00dev, | |||
1570 | rt2800_mcu_request(rt2x00dev, MCU_ANT_SELECT, 0xff, | 1570 | rt2800_mcu_request(rt2x00dev, MCU_ANT_SELECT, 0xff, |
1571 | eesk_pin, 0); | 1571 | eesk_pin, 0); |
1572 | 1572 | ||
1573 | rt2800_register_read(rt2x00dev, GPIO_CTRL_CFG, ®); | 1573 | rt2800_register_read(rt2x00dev, GPIO_CTRL, ®); |
1574 | rt2x00_set_field32(®, GPIO_CTRL_CFG_GPIOD_BIT3, 0); | 1574 | rt2x00_set_field32(®, GPIO_CTRL_DIR3, 0); |
1575 | rt2x00_set_field32(®, GPIO_CTRL_CFG_BIT3, gpio_bit3); | 1575 | rt2x00_set_field32(®, GPIO_CTRL_VAL3, gpio_bit3); |
1576 | rt2800_register_write(rt2x00dev, GPIO_CTRL_CFG, reg); | 1576 | rt2800_register_write(rt2x00dev, GPIO_CTRL, reg); |
1577 | } | 1577 | } |
1578 | 1578 | ||
1579 | void rt2800_config_ant(struct rt2x00_dev *rt2x00dev, struct antenna_setup *ant) | 1579 | void rt2800_config_ant(struct rt2x00_dev *rt2x00dev, struct antenna_setup *ant) |
@@ -1615,6 +1615,7 @@ void rt2800_config_ant(struct rt2x00_dev *rt2x00dev, struct antenna_setup *ant) | |||
1615 | case 1: | 1615 | case 1: |
1616 | if (rt2x00_rt(rt2x00dev, RT3070) || | 1616 | if (rt2x00_rt(rt2x00dev, RT3070) || |
1617 | rt2x00_rt(rt2x00dev, RT3090) || | 1617 | rt2x00_rt(rt2x00dev, RT3090) || |
1618 | rt2x00_rt(rt2x00dev, RT3352) || | ||
1618 | rt2x00_rt(rt2x00dev, RT3390)) { | 1619 | rt2x00_rt(rt2x00dev, RT3390)) { |
1619 | rt2x00_eeprom_read(rt2x00dev, | 1620 | rt2x00_eeprom_read(rt2x00dev, |
1620 | EEPROM_NIC_CONF1, &eeprom); | 1621 | EEPROM_NIC_CONF1, &eeprom); |
@@ -1995,13 +1996,13 @@ static void rt2800_config_channel_rf3052(struct rt2x00_dev *rt2x00dev, | |||
1995 | rt2800_rfcsr_write(rt2x00dev, 29, 0x9f); | 1996 | rt2800_rfcsr_write(rt2x00dev, 29, 0x9f); |
1996 | } | 1997 | } |
1997 | 1998 | ||
1998 | rt2800_register_read(rt2x00dev, GPIO_CTRL_CFG, ®); | 1999 | rt2800_register_read(rt2x00dev, GPIO_CTRL, ®); |
1999 | rt2x00_set_field32(®, GPIO_CTRL_CFG_GPIOD_BIT7, 0); | 2000 | rt2x00_set_field32(®, GPIO_CTRL_DIR7, 0); |
2000 | if (rf->channel <= 14) | 2001 | if (rf->channel <= 14) |
2001 | rt2x00_set_field32(®, GPIO_CTRL_CFG_BIT7, 1); | 2002 | rt2x00_set_field32(®, GPIO_CTRL_VAL7, 1); |
2002 | else | 2003 | else |
2003 | rt2x00_set_field32(®, GPIO_CTRL_CFG_BIT7, 0); | 2004 | rt2x00_set_field32(®, GPIO_CTRL_VAL7, 0); |
2004 | rt2800_register_write(rt2x00dev, GPIO_CTRL_CFG, reg); | 2005 | rt2800_register_write(rt2x00dev, GPIO_CTRL, reg); |
2005 | 2006 | ||
2006 | rt2800_rfcsr_read(rt2x00dev, 7, &rfcsr); | 2007 | rt2800_rfcsr_read(rt2x00dev, 7, &rfcsr); |
2007 | rt2x00_set_field8(&rfcsr, RFCSR7_RF_TUNING, 1); | 2008 | rt2x00_set_field8(&rfcsr, RFCSR7_RF_TUNING, 1); |
@@ -2053,6 +2054,60 @@ static void rt2800_config_channel_rf3290(struct rt2x00_dev *rt2x00dev, | |||
2053 | } | 2054 | } |
2054 | } | 2055 | } |
2055 | 2056 | ||
2057 | static void rt2800_config_channel_rf3322(struct rt2x00_dev *rt2x00dev, | ||
2058 | struct ieee80211_conf *conf, | ||
2059 | struct rf_channel *rf, | ||
2060 | struct channel_info *info) | ||
2061 | { | ||
2062 | u8 rfcsr; | ||
2063 | |||
2064 | rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1); | ||
2065 | rt2800_rfcsr_write(rt2x00dev, 9, rf->rf3); | ||
2066 | |||
2067 | rt2800_rfcsr_write(rt2x00dev, 11, 0x42); | ||
2068 | rt2800_rfcsr_write(rt2x00dev, 12, 0x1c); | ||
2069 | rt2800_rfcsr_write(rt2x00dev, 13, 0x00); | ||
2070 | |||
2071 | if (info->default_power1 > POWER_BOUND) | ||
2072 | rt2800_rfcsr_write(rt2x00dev, 47, POWER_BOUND); | ||
2073 | else | ||
2074 | rt2800_rfcsr_write(rt2x00dev, 47, info->default_power1); | ||
2075 | |||
2076 | if (info->default_power2 > POWER_BOUND) | ||
2077 | rt2800_rfcsr_write(rt2x00dev, 48, POWER_BOUND); | ||
2078 | else | ||
2079 | rt2800_rfcsr_write(rt2x00dev, 48, info->default_power2); | ||
2080 | |||
2081 | rt2800_rfcsr_read(rt2x00dev, 17, &rfcsr); | ||
2082 | if (rt2x00dev->freq_offset > FREQ_OFFSET_BOUND) | ||
2083 | rt2x00_set_field8(&rfcsr, RFCSR17_CODE, FREQ_OFFSET_BOUND); | ||
2084 | else | ||
2085 | rt2x00_set_field8(&rfcsr, RFCSR17_CODE, rt2x00dev->freq_offset); | ||
2086 | |||
2087 | rt2800_rfcsr_write(rt2x00dev, 17, rfcsr); | ||
2088 | |||
2089 | rt2800_rfcsr_read(rt2x00dev, 1, &rfcsr); | ||
2090 | rt2x00_set_field8(&rfcsr, RFCSR1_RX0_PD, 1); | ||
2091 | rt2x00_set_field8(&rfcsr, RFCSR1_TX0_PD, 1); | ||
2092 | |||
2093 | if ( rt2x00dev->default_ant.tx_chain_num == 2 ) | ||
2094 | rt2x00_set_field8(&rfcsr, RFCSR1_TX1_PD, 1); | ||
2095 | else | ||
2096 | rt2x00_set_field8(&rfcsr, RFCSR1_TX1_PD, 0); | ||
2097 | |||
2098 | if ( rt2x00dev->default_ant.rx_chain_num == 2 ) | ||
2099 | rt2x00_set_field8(&rfcsr, RFCSR1_RX1_PD, 1); | ||
2100 | else | ||
2101 | rt2x00_set_field8(&rfcsr, RFCSR1_RX1_PD, 0); | ||
2102 | |||
2103 | rt2x00_set_field8(&rfcsr, RFCSR1_RX2_PD, 0); | ||
2104 | rt2x00_set_field8(&rfcsr, RFCSR1_TX2_PD, 0); | ||
2105 | |||
2106 | rt2800_rfcsr_write(rt2x00dev, 1, rfcsr); | ||
2107 | |||
2108 | rt2800_rfcsr_write(rt2x00dev, 31, 80); | ||
2109 | } | ||
2110 | |||
2056 | static void rt2800_config_channel_rf53xx(struct rt2x00_dev *rt2x00dev, | 2111 | static void rt2800_config_channel_rf53xx(struct rt2x00_dev *rt2x00dev, |
2057 | struct ieee80211_conf *conf, | 2112 | struct ieee80211_conf *conf, |
2058 | struct rf_channel *rf, | 2113 | struct rf_channel *rf, |
@@ -2182,6 +2237,9 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, | |||
2182 | case RF3290: | 2237 | case RF3290: |
2183 | rt2800_config_channel_rf3290(rt2x00dev, conf, rf, info); | 2238 | rt2800_config_channel_rf3290(rt2x00dev, conf, rf, info); |
2184 | break; | 2239 | break; |
2240 | case RF3322: | ||
2241 | rt2800_config_channel_rf3322(rt2x00dev, conf, rf, info); | ||
2242 | break; | ||
2185 | case RF5360: | 2243 | case RF5360: |
2186 | case RF5370: | 2244 | case RF5370: |
2187 | case RF5372: | 2245 | case RF5372: |
@@ -2194,6 +2252,7 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, | |||
2194 | } | 2252 | } |
2195 | 2253 | ||
2196 | if (rt2x00_rf(rt2x00dev, RF3290) || | 2254 | if (rt2x00_rf(rt2x00dev, RF3290) || |
2255 | rt2x00_rf(rt2x00dev, RF3322) || | ||
2197 | rt2x00_rf(rt2x00dev, RF5360) || | 2256 | rt2x00_rf(rt2x00dev, RF5360) || |
2198 | rt2x00_rf(rt2x00dev, RF5370) || | 2257 | rt2x00_rf(rt2x00dev, RF5370) || |
2199 | rt2x00_rf(rt2x00dev, RF5372) || | 2258 | rt2x00_rf(rt2x00dev, RF5372) || |
@@ -2212,10 +2271,17 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, | |||
2212 | /* | 2271 | /* |
2213 | * Change BBP settings | 2272 | * Change BBP settings |
2214 | */ | 2273 | */ |
2215 | rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain); | 2274 | if (rt2x00_rt(rt2x00dev, RT3352)) { |
2216 | rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain); | 2275 | rt2800_bbp_write(rt2x00dev, 27, 0x0); |
2217 | rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain); | 2276 | rt2800_bbp_write(rt2x00dev, 62, 0x26 + rt2x00dev->lna_gain); |
2218 | rt2800_bbp_write(rt2x00dev, 86, 0); | 2277 | rt2800_bbp_write(rt2x00dev, 27, 0x20); |
2278 | rt2800_bbp_write(rt2x00dev, 62, 0x26 + rt2x00dev->lna_gain); | ||
2279 | } else { | ||
2280 | rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain); | ||
2281 | rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain); | ||
2282 | rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain); | ||
2283 | rt2800_bbp_write(rt2x00dev, 86, 0); | ||
2284 | } | ||
2219 | 2285 | ||
2220 | if (rf->channel <= 14) { | 2286 | if (rf->channel <= 14) { |
2221 | if (!rt2x00_rt(rt2x00dev, RT5390) && | 2287 | if (!rt2x00_rt(rt2x00dev, RT5390) && |
@@ -2310,6 +2376,15 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, | |||
2310 | rt2800_register_read(rt2x00dev, CH_IDLE_STA, ®); | 2376 | rt2800_register_read(rt2x00dev, CH_IDLE_STA, ®); |
2311 | rt2800_register_read(rt2x00dev, CH_BUSY_STA, ®); | 2377 | rt2800_register_read(rt2x00dev, CH_BUSY_STA, ®); |
2312 | rt2800_register_read(rt2x00dev, CH_BUSY_STA_SEC, ®); | 2378 | rt2800_register_read(rt2x00dev, CH_BUSY_STA_SEC, ®); |
2379 | |||
2380 | /* | ||
2381 | * Clear update flag | ||
2382 | */ | ||
2383 | if (rt2x00_rt(rt2x00dev, RT3352)) { | ||
2384 | rt2800_bbp_read(rt2x00dev, 49, &bbp); | ||
2385 | rt2x00_set_field8(&bbp, BBP49_UPDATE_FLAG, 0); | ||
2386 | rt2800_bbp_write(rt2x00dev, 49, bbp); | ||
2387 | } | ||
2313 | } | 2388 | } |
2314 | 2389 | ||
2315 | static int rt2800_get_gain_calibration_delta(struct rt2x00_dev *rt2x00dev) | 2390 | static int rt2800_get_gain_calibration_delta(struct rt2x00_dev *rt2x00dev) |
@@ -2998,6 +3073,10 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev) | |||
2998 | rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000400); | 3073 | rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000400); |
2999 | rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00000000); | 3074 | rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00000000); |
3000 | rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000030); | 3075 | rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000030); |
3076 | } else if (rt2x00_rt(rt2x00dev, RT3352)) { | ||
3077 | rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000402); | ||
3078 | rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606); | ||
3079 | rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000); | ||
3001 | } else if (rt2x00_rt(rt2x00dev, RT3572)) { | 3080 | } else if (rt2x00_rt(rt2x00dev, RT3572)) { |
3002 | rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000400); | 3081 | rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000400); |
3003 | rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606); | 3082 | rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606); |
@@ -3378,6 +3457,11 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) | |||
3378 | rt2800_wait_bbp_ready(rt2x00dev))) | 3457 | rt2800_wait_bbp_ready(rt2x00dev))) |
3379 | return -EACCES; | 3458 | return -EACCES; |
3380 | 3459 | ||
3460 | if (rt2x00_rt(rt2x00dev, RT3352)) { | ||
3461 | rt2800_bbp_write(rt2x00dev, 3, 0x00); | ||
3462 | rt2800_bbp_write(rt2x00dev, 4, 0x50); | ||
3463 | } | ||
3464 | |||
3381 | if (rt2x00_rt(rt2x00dev, RT3290) || | 3465 | if (rt2x00_rt(rt2x00dev, RT3290) || |
3382 | rt2x00_rt(rt2x00dev, RT5390) || | 3466 | rt2x00_rt(rt2x00dev, RT5390) || |
3383 | rt2x00_rt(rt2x00dev, RT5392)) { | 3467 | rt2x00_rt(rt2x00dev, RT5392)) { |
@@ -3388,15 +3472,20 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) | |||
3388 | 3472 | ||
3389 | if (rt2800_is_305x_soc(rt2x00dev) || | 3473 | if (rt2800_is_305x_soc(rt2x00dev) || |
3390 | rt2x00_rt(rt2x00dev, RT3290) || | 3474 | rt2x00_rt(rt2x00dev, RT3290) || |
3475 | rt2x00_rt(rt2x00dev, RT3352) || | ||
3391 | rt2x00_rt(rt2x00dev, RT3572) || | 3476 | rt2x00_rt(rt2x00dev, RT3572) || |
3392 | rt2x00_rt(rt2x00dev, RT5390) || | 3477 | rt2x00_rt(rt2x00dev, RT5390) || |
3393 | rt2x00_rt(rt2x00dev, RT5392)) | 3478 | rt2x00_rt(rt2x00dev, RT5392)) |
3394 | rt2800_bbp_write(rt2x00dev, 31, 0x08); | 3479 | rt2800_bbp_write(rt2x00dev, 31, 0x08); |
3395 | 3480 | ||
3481 | if (rt2x00_rt(rt2x00dev, RT3352)) | ||
3482 | rt2800_bbp_write(rt2x00dev, 47, 0x48); | ||
3483 | |||
3396 | rt2800_bbp_write(rt2x00dev, 65, 0x2c); | 3484 | rt2800_bbp_write(rt2x00dev, 65, 0x2c); |
3397 | rt2800_bbp_write(rt2x00dev, 66, 0x38); | 3485 | rt2800_bbp_write(rt2x00dev, 66, 0x38); |
3398 | 3486 | ||
3399 | if (rt2x00_rt(rt2x00dev, RT3290) || | 3487 | if (rt2x00_rt(rt2x00dev, RT3290) || |
3488 | rt2x00_rt(rt2x00dev, RT3352) || | ||
3400 | rt2x00_rt(rt2x00dev, RT5390) || | 3489 | rt2x00_rt(rt2x00dev, RT5390) || |
3401 | rt2x00_rt(rt2x00dev, RT5392)) | 3490 | rt2x00_rt(rt2x00dev, RT5392)) |
3402 | rt2800_bbp_write(rt2x00dev, 68, 0x0b); | 3491 | rt2800_bbp_write(rt2x00dev, 68, 0x0b); |
@@ -3405,6 +3494,7 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) | |||
3405 | rt2800_bbp_write(rt2x00dev, 69, 0x16); | 3494 | rt2800_bbp_write(rt2x00dev, 69, 0x16); |
3406 | rt2800_bbp_write(rt2x00dev, 73, 0x12); | 3495 | rt2800_bbp_write(rt2x00dev, 73, 0x12); |
3407 | } else if (rt2x00_rt(rt2x00dev, RT3290) || | 3496 | } else if (rt2x00_rt(rt2x00dev, RT3290) || |
3497 | rt2x00_rt(rt2x00dev, RT3352) || | ||
3408 | rt2x00_rt(rt2x00dev, RT5390) || | 3498 | rt2x00_rt(rt2x00dev, RT5390) || |
3409 | rt2x00_rt(rt2x00dev, RT5392)) { | 3499 | rt2x00_rt(rt2x00dev, RT5392)) { |
3410 | rt2800_bbp_write(rt2x00dev, 69, 0x12); | 3500 | rt2800_bbp_write(rt2x00dev, 69, 0x12); |
@@ -3436,6 +3526,10 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) | |||
3436 | } else if (rt2800_is_305x_soc(rt2x00dev)) { | 3526 | } else if (rt2800_is_305x_soc(rt2x00dev)) { |
3437 | rt2800_bbp_write(rt2x00dev, 78, 0x0e); | 3527 | rt2800_bbp_write(rt2x00dev, 78, 0x0e); |
3438 | rt2800_bbp_write(rt2x00dev, 80, 0x08); | 3528 | rt2800_bbp_write(rt2x00dev, 80, 0x08); |
3529 | } else if (rt2x00_rt(rt2x00dev, RT3352)) { | ||
3530 | rt2800_bbp_write(rt2x00dev, 78, 0x0e); | ||
3531 | rt2800_bbp_write(rt2x00dev, 80, 0x08); | ||
3532 | rt2800_bbp_write(rt2x00dev, 81, 0x37); | ||
3439 | } else { | 3533 | } else { |
3440 | rt2800_bbp_write(rt2x00dev, 81, 0x37); | 3534 | rt2800_bbp_write(rt2x00dev, 81, 0x37); |
3441 | } | 3535 | } |
@@ -3465,18 +3559,21 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) | |||
3465 | rt2800_bbp_write(rt2x00dev, 84, 0x99); | 3559 | rt2800_bbp_write(rt2x00dev, 84, 0x99); |
3466 | 3560 | ||
3467 | if (rt2x00_rt(rt2x00dev, RT3290) || | 3561 | if (rt2x00_rt(rt2x00dev, RT3290) || |
3562 | rt2x00_rt(rt2x00dev, RT3352) || | ||
3468 | rt2x00_rt(rt2x00dev, RT5390) || | 3563 | rt2x00_rt(rt2x00dev, RT5390) || |
3469 | rt2x00_rt(rt2x00dev, RT5392)) | 3564 | rt2x00_rt(rt2x00dev, RT5392)) |
3470 | rt2800_bbp_write(rt2x00dev, 86, 0x38); | 3565 | rt2800_bbp_write(rt2x00dev, 86, 0x38); |
3471 | else | 3566 | else |
3472 | rt2800_bbp_write(rt2x00dev, 86, 0x00); | 3567 | rt2800_bbp_write(rt2x00dev, 86, 0x00); |
3473 | 3568 | ||
3474 | if (rt2x00_rt(rt2x00dev, RT5392)) | 3569 | if (rt2x00_rt(rt2x00dev, RT3352) || |
3570 | rt2x00_rt(rt2x00dev, RT5392)) | ||
3475 | rt2800_bbp_write(rt2x00dev, 88, 0x90); | 3571 | rt2800_bbp_write(rt2x00dev, 88, 0x90); |
3476 | 3572 | ||
3477 | rt2800_bbp_write(rt2x00dev, 91, 0x04); | 3573 | rt2800_bbp_write(rt2x00dev, 91, 0x04); |
3478 | 3574 | ||
3479 | if (rt2x00_rt(rt2x00dev, RT3290) || | 3575 | if (rt2x00_rt(rt2x00dev, RT3290) || |
3576 | rt2x00_rt(rt2x00dev, RT3352) || | ||
3480 | rt2x00_rt(rt2x00dev, RT5390) || | 3577 | rt2x00_rt(rt2x00dev, RT5390) || |
3481 | rt2x00_rt(rt2x00dev, RT5392)) | 3578 | rt2x00_rt(rt2x00dev, RT5392)) |
3482 | rt2800_bbp_write(rt2x00dev, 92, 0x02); | 3579 | rt2800_bbp_write(rt2x00dev, 92, 0x02); |
@@ -3493,6 +3590,7 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) | |||
3493 | rt2x00_rt_rev_gte(rt2x00dev, RT3090, REV_RT3090E) || | 3590 | rt2x00_rt_rev_gte(rt2x00dev, RT3090, REV_RT3090E) || |
3494 | rt2x00_rt_rev_gte(rt2x00dev, RT3390, REV_RT3390E) || | 3591 | rt2x00_rt_rev_gte(rt2x00dev, RT3390, REV_RT3390E) || |
3495 | rt2x00_rt(rt2x00dev, RT3290) || | 3592 | rt2x00_rt(rt2x00dev, RT3290) || |
3593 | rt2x00_rt(rt2x00dev, RT3352) || | ||
3496 | rt2x00_rt(rt2x00dev, RT3572) || | 3594 | rt2x00_rt(rt2x00dev, RT3572) || |
3497 | rt2x00_rt(rt2x00dev, RT5390) || | 3595 | rt2x00_rt(rt2x00dev, RT5390) || |
3498 | rt2x00_rt(rt2x00dev, RT5392) || | 3596 | rt2x00_rt(rt2x00dev, RT5392) || |
@@ -3502,6 +3600,7 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) | |||
3502 | rt2800_bbp_write(rt2x00dev, 103, 0x00); | 3600 | rt2800_bbp_write(rt2x00dev, 103, 0x00); |
3503 | 3601 | ||
3504 | if (rt2x00_rt(rt2x00dev, RT3290) || | 3602 | if (rt2x00_rt(rt2x00dev, RT3290) || |
3603 | rt2x00_rt(rt2x00dev, RT3352) || | ||
3505 | rt2x00_rt(rt2x00dev, RT5390) || | 3604 | rt2x00_rt(rt2x00dev, RT5390) || |
3506 | rt2x00_rt(rt2x00dev, RT5392)) | 3605 | rt2x00_rt(rt2x00dev, RT5392)) |
3507 | rt2800_bbp_write(rt2x00dev, 104, 0x92); | 3606 | rt2800_bbp_write(rt2x00dev, 104, 0x92); |
@@ -3510,6 +3609,8 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) | |||
3510 | rt2800_bbp_write(rt2x00dev, 105, 0x01); | 3609 | rt2800_bbp_write(rt2x00dev, 105, 0x01); |
3511 | else if (rt2x00_rt(rt2x00dev, RT3290)) | 3610 | else if (rt2x00_rt(rt2x00dev, RT3290)) |
3512 | rt2800_bbp_write(rt2x00dev, 105, 0x1c); | 3611 | rt2800_bbp_write(rt2x00dev, 105, 0x1c); |
3612 | else if (rt2x00_rt(rt2x00dev, RT3352)) | ||
3613 | rt2800_bbp_write(rt2x00dev, 105, 0x34); | ||
3513 | else if (rt2x00_rt(rt2x00dev, RT5390) || | 3614 | else if (rt2x00_rt(rt2x00dev, RT5390) || |
3514 | rt2x00_rt(rt2x00dev, RT5392)) | 3615 | rt2x00_rt(rt2x00dev, RT5392)) |
3515 | rt2800_bbp_write(rt2x00dev, 105, 0x3c); | 3616 | rt2800_bbp_write(rt2x00dev, 105, 0x3c); |
@@ -3519,11 +3620,16 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) | |||
3519 | if (rt2x00_rt(rt2x00dev, RT3290) || | 3620 | if (rt2x00_rt(rt2x00dev, RT3290) || |
3520 | rt2x00_rt(rt2x00dev, RT5390)) | 3621 | rt2x00_rt(rt2x00dev, RT5390)) |
3521 | rt2800_bbp_write(rt2x00dev, 106, 0x03); | 3622 | rt2800_bbp_write(rt2x00dev, 106, 0x03); |
3623 | else if (rt2x00_rt(rt2x00dev, RT3352)) | ||
3624 | rt2800_bbp_write(rt2x00dev, 106, 0x05); | ||
3522 | else if (rt2x00_rt(rt2x00dev, RT5392)) | 3625 | else if (rt2x00_rt(rt2x00dev, RT5392)) |
3523 | rt2800_bbp_write(rt2x00dev, 106, 0x12); | 3626 | rt2800_bbp_write(rt2x00dev, 106, 0x12); |
3524 | else | 3627 | else |
3525 | rt2800_bbp_write(rt2x00dev, 106, 0x35); | 3628 | rt2800_bbp_write(rt2x00dev, 106, 0x35); |
3526 | 3629 | ||
3630 | if (rt2x00_rt(rt2x00dev, RT3352)) | ||
3631 | rt2800_bbp_write(rt2x00dev, 120, 0x50); | ||
3632 | |||
3527 | if (rt2x00_rt(rt2x00dev, RT3290) || | 3633 | if (rt2x00_rt(rt2x00dev, RT3290) || |
3528 | rt2x00_rt(rt2x00dev, RT5390) || | 3634 | rt2x00_rt(rt2x00dev, RT5390) || |
3529 | rt2x00_rt(rt2x00dev, RT5392)) | 3635 | rt2x00_rt(rt2x00dev, RT5392)) |
@@ -3534,6 +3640,9 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) | |||
3534 | rt2800_bbp_write(rt2x00dev, 135, 0xf6); | 3640 | rt2800_bbp_write(rt2x00dev, 135, 0xf6); |
3535 | } | 3641 | } |
3536 | 3642 | ||
3643 | if (rt2x00_rt(rt2x00dev, RT3352)) | ||
3644 | rt2800_bbp_write(rt2x00dev, 137, 0x0f); | ||
3645 | |||
3537 | if (rt2x00_rt(rt2x00dev, RT3071) || | 3646 | if (rt2x00_rt(rt2x00dev, RT3071) || |
3538 | rt2x00_rt(rt2x00dev, RT3090) || | 3647 | rt2x00_rt(rt2x00dev, RT3090) || |
3539 | rt2x00_rt(rt2x00dev, RT3390) || | 3648 | rt2x00_rt(rt2x00dev, RT3390) || |
@@ -3574,6 +3683,28 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) | |||
3574 | rt2800_bbp_write(rt2x00dev, 3, value); | 3683 | rt2800_bbp_write(rt2x00dev, 3, value); |
3575 | } | 3684 | } |
3576 | 3685 | ||
3686 | if (rt2x00_rt(rt2x00dev, RT3352)) { | ||
3687 | rt2800_bbp_write(rt2x00dev, 163, 0xbd); | ||
3688 | /* Set ITxBF timeout to 0x9c40=1000msec */ | ||
3689 | rt2800_bbp_write(rt2x00dev, 179, 0x02); | ||
3690 | rt2800_bbp_write(rt2x00dev, 180, 0x00); | ||
3691 | rt2800_bbp_write(rt2x00dev, 182, 0x40); | ||
3692 | rt2800_bbp_write(rt2x00dev, 180, 0x01); | ||
3693 | rt2800_bbp_write(rt2x00dev, 182, 0x9c); | ||
3694 | rt2800_bbp_write(rt2x00dev, 179, 0x00); | ||
3695 | /* Reprogram the inband interface to put right values in RXWI */ | ||
3696 | rt2800_bbp_write(rt2x00dev, 142, 0x04); | ||
3697 | rt2800_bbp_write(rt2x00dev, 143, 0x3b); | ||
3698 | rt2800_bbp_write(rt2x00dev, 142, 0x06); | ||
3699 | rt2800_bbp_write(rt2x00dev, 143, 0xa0); | ||
3700 | rt2800_bbp_write(rt2x00dev, 142, 0x07); | ||
3701 | rt2800_bbp_write(rt2x00dev, 143, 0xa1); | ||
3702 | rt2800_bbp_write(rt2x00dev, 142, 0x08); | ||
3703 | rt2800_bbp_write(rt2x00dev, 143, 0xa2); | ||
3704 | |||
3705 | rt2800_bbp_write(rt2x00dev, 148, 0xc8); | ||
3706 | } | ||
3707 | |||
3577 | if (rt2x00_rt(rt2x00dev, RT5390) || | 3708 | if (rt2x00_rt(rt2x00dev, RT5390) || |
3578 | rt2x00_rt(rt2x00dev, RT5392)) { | 3709 | rt2x00_rt(rt2x00dev, RT5392)) { |
3579 | int ant, div_mode; | 3710 | int ant, div_mode; |
@@ -3587,16 +3718,16 @@ static int rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) | |||
3587 | if (test_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags)) { | 3718 | if (test_bit(CAPABILITY_BT_COEXIST, &rt2x00dev->cap_flags)) { |
3588 | u32 reg; | 3719 | u32 reg; |
3589 | 3720 | ||
3590 | rt2800_register_read(rt2x00dev, GPIO_CTRL_CFG, ®); | 3721 | rt2800_register_read(rt2x00dev, GPIO_CTRL, ®); |
3591 | rt2x00_set_field32(®, GPIO_CTRL_CFG_GPIOD_BIT3, 0); | 3722 | rt2x00_set_field32(®, GPIO_CTRL_DIR3, 0); |
3592 | rt2x00_set_field32(®, GPIO_CTRL_CFG_GPIOD_BIT6, 0); | 3723 | rt2x00_set_field32(®, GPIO_CTRL_DIR6, 0); |
3593 | rt2x00_set_field32(®, GPIO_CTRL_CFG_BIT3, 0); | 3724 | rt2x00_set_field32(®, GPIO_CTRL_VAL3, 0); |
3594 | rt2x00_set_field32(®, GPIO_CTRL_CFG_BIT6, 0); | 3725 | rt2x00_set_field32(®, GPIO_CTRL_VAL6, 0); |
3595 | if (ant == 0) | 3726 | if (ant == 0) |
3596 | rt2x00_set_field32(®, GPIO_CTRL_CFG_BIT3, 1); | 3727 | rt2x00_set_field32(®, GPIO_CTRL_VAL3, 1); |
3597 | else if (ant == 1) | 3728 | else if (ant == 1) |
3598 | rt2x00_set_field32(®, GPIO_CTRL_CFG_BIT6, 1); | 3729 | rt2x00_set_field32(®, GPIO_CTRL_VAL6, 1); |
3599 | rt2800_register_write(rt2x00dev, GPIO_CTRL_CFG, reg); | 3730 | rt2800_register_write(rt2x00dev, GPIO_CTRL, reg); |
3600 | } | 3731 | } |
3601 | 3732 | ||
3602 | /* This chip has hardware antenna diversity*/ | 3733 | /* This chip has hardware antenna diversity*/ |
@@ -3707,6 +3838,7 @@ static int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev) | |||
3707 | !rt2x00_rt(rt2x00dev, RT3071) && | 3838 | !rt2x00_rt(rt2x00dev, RT3071) && |
3708 | !rt2x00_rt(rt2x00dev, RT3090) && | 3839 | !rt2x00_rt(rt2x00dev, RT3090) && |
3709 | !rt2x00_rt(rt2x00dev, RT3290) && | 3840 | !rt2x00_rt(rt2x00dev, RT3290) && |
3841 | !rt2x00_rt(rt2x00dev, RT3352) && | ||
3710 | !rt2x00_rt(rt2x00dev, RT3390) && | 3842 | !rt2x00_rt(rt2x00dev, RT3390) && |
3711 | !rt2x00_rt(rt2x00dev, RT3572) && | 3843 | !rt2x00_rt(rt2x00dev, RT3572) && |
3712 | !rt2x00_rt(rt2x00dev, RT5390) && | 3844 | !rt2x00_rt(rt2x00dev, RT5390) && |
@@ -3903,6 +4035,70 @@ static int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev) | |||
3903 | rt2800_rfcsr_write(rt2x00dev, 30, 0x00); | 4035 | rt2800_rfcsr_write(rt2x00dev, 30, 0x00); |
3904 | rt2800_rfcsr_write(rt2x00dev, 31, 0x00); | 4036 | rt2800_rfcsr_write(rt2x00dev, 31, 0x00); |
3905 | return 0; | 4037 | return 0; |
4038 | } else if (rt2x00_rt(rt2x00dev, RT3352)) { | ||
4039 | rt2800_rfcsr_write(rt2x00dev, 0, 0xf0); | ||
4040 | rt2800_rfcsr_write(rt2x00dev, 1, 0x23); | ||
4041 | rt2800_rfcsr_write(rt2x00dev, 2, 0x50); | ||
4042 | rt2800_rfcsr_write(rt2x00dev, 3, 0x18); | ||
4043 | rt2800_rfcsr_write(rt2x00dev, 4, 0x00); | ||
4044 | rt2800_rfcsr_write(rt2x00dev, 5, 0x00); | ||
4045 | rt2800_rfcsr_write(rt2x00dev, 6, 0x33); | ||
4046 | rt2800_rfcsr_write(rt2x00dev, 7, 0x00); | ||
4047 | rt2800_rfcsr_write(rt2x00dev, 8, 0xf1); | ||
4048 | rt2800_rfcsr_write(rt2x00dev, 9, 0x02); | ||
4049 | rt2800_rfcsr_write(rt2x00dev, 10, 0xd2); | ||
4050 | rt2800_rfcsr_write(rt2x00dev, 11, 0x42); | ||
4051 | rt2800_rfcsr_write(rt2x00dev, 12, 0x1c); | ||
4052 | rt2800_rfcsr_write(rt2x00dev, 13, 0x00); | ||
4053 | rt2800_rfcsr_write(rt2x00dev, 14, 0x5a); | ||
4054 | rt2800_rfcsr_write(rt2x00dev, 15, 0x00); | ||
4055 | rt2800_rfcsr_write(rt2x00dev, 16, 0x01); | ||
4056 | rt2800_rfcsr_write(rt2x00dev, 18, 0x45); | ||
4057 | rt2800_rfcsr_write(rt2x00dev, 19, 0x02); | ||
4058 | rt2800_rfcsr_write(rt2x00dev, 20, 0x00); | ||
4059 | rt2800_rfcsr_write(rt2x00dev, 21, 0x00); | ||
4060 | rt2800_rfcsr_write(rt2x00dev, 22, 0x00); | ||
4061 | rt2800_rfcsr_write(rt2x00dev, 23, 0x00); | ||
4062 | rt2800_rfcsr_write(rt2x00dev, 24, 0x00); | ||
4063 | rt2800_rfcsr_write(rt2x00dev, 25, 0x80); | ||
4064 | rt2800_rfcsr_write(rt2x00dev, 26, 0x00); | ||
4065 | rt2800_rfcsr_write(rt2x00dev, 27, 0x03); | ||
4066 | rt2800_rfcsr_write(rt2x00dev, 28, 0x03); | ||
4067 | rt2800_rfcsr_write(rt2x00dev, 29, 0x00); | ||
4068 | rt2800_rfcsr_write(rt2x00dev, 30, 0x10); | ||
4069 | rt2800_rfcsr_write(rt2x00dev, 31, 0x80); | ||
4070 | rt2800_rfcsr_write(rt2x00dev, 32, 0x80); | ||
4071 | rt2800_rfcsr_write(rt2x00dev, 33, 0x00); | ||
4072 | rt2800_rfcsr_write(rt2x00dev, 34, 0x01); | ||
4073 | rt2800_rfcsr_write(rt2x00dev, 35, 0x03); | ||
4074 | rt2800_rfcsr_write(rt2x00dev, 36, 0xbd); | ||
4075 | rt2800_rfcsr_write(rt2x00dev, 37, 0x3c); | ||
4076 | rt2800_rfcsr_write(rt2x00dev, 38, 0x5f); | ||
4077 | rt2800_rfcsr_write(rt2x00dev, 39, 0xc5); | ||
4078 | rt2800_rfcsr_write(rt2x00dev, 40, 0x33); | ||
4079 | rt2800_rfcsr_write(rt2x00dev, 41, 0x5b); | ||
4080 | rt2800_rfcsr_write(rt2x00dev, 42, 0x5b); | ||
4081 | rt2800_rfcsr_write(rt2x00dev, 43, 0xdb); | ||
4082 | rt2800_rfcsr_write(rt2x00dev, 44, 0xdb); | ||
4083 | rt2800_rfcsr_write(rt2x00dev, 45, 0xdb); | ||
4084 | rt2800_rfcsr_write(rt2x00dev, 46, 0xdd); | ||
4085 | rt2800_rfcsr_write(rt2x00dev, 47, 0x0d); | ||
4086 | rt2800_rfcsr_write(rt2x00dev, 48, 0x14); | ||
4087 | rt2800_rfcsr_write(rt2x00dev, 49, 0x00); | ||
4088 | rt2800_rfcsr_write(rt2x00dev, 50, 0x2d); | ||
4089 | rt2800_rfcsr_write(rt2x00dev, 51, 0x7f); | ||
4090 | rt2800_rfcsr_write(rt2x00dev, 52, 0x00); | ||
4091 | rt2800_rfcsr_write(rt2x00dev, 53, 0x52); | ||
4092 | rt2800_rfcsr_write(rt2x00dev, 54, 0x1b); | ||
4093 | rt2800_rfcsr_write(rt2x00dev, 55, 0x7f); | ||
4094 | rt2800_rfcsr_write(rt2x00dev, 56, 0x00); | ||
4095 | rt2800_rfcsr_write(rt2x00dev, 57, 0x52); | ||
4096 | rt2800_rfcsr_write(rt2x00dev, 58, 0x1b); | ||
4097 | rt2800_rfcsr_write(rt2x00dev, 59, 0x00); | ||
4098 | rt2800_rfcsr_write(rt2x00dev, 60, 0x00); | ||
4099 | rt2800_rfcsr_write(rt2x00dev, 61, 0x00); | ||
4100 | rt2800_rfcsr_write(rt2x00dev, 62, 0x00); | ||
4101 | rt2800_rfcsr_write(rt2x00dev, 63, 0x00); | ||
3906 | } else if (rt2x00_rt(rt2x00dev, RT5390)) { | 4102 | } else if (rt2x00_rt(rt2x00dev, RT5390)) { |
3907 | rt2800_rfcsr_write(rt2x00dev, 1, 0x0f); | 4103 | rt2800_rfcsr_write(rt2x00dev, 1, 0x0f); |
3908 | rt2800_rfcsr_write(rt2x00dev, 2, 0x80); | 4104 | rt2800_rfcsr_write(rt2x00dev, 2, 0x80); |
@@ -4089,6 +4285,7 @@ static int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev) | |||
4089 | rt2800_register_write(rt2x00dev, LDO_CFG0, reg); | 4285 | rt2800_register_write(rt2x00dev, LDO_CFG0, reg); |
4090 | msleep(1); | 4286 | msleep(1); |
4091 | rt2800_register_read(rt2x00dev, LDO_CFG0, ®); | 4287 | rt2800_register_read(rt2x00dev, LDO_CFG0, ®); |
4288 | rt2x00_set_field32(®, LDO_CFG0_LDO_CORE_VLEVEL, 0); | ||
4092 | rt2x00_set_field32(®, LDO_CFG0_BGSEL, 1); | 4289 | rt2x00_set_field32(®, LDO_CFG0_BGSEL, 1); |
4093 | rt2800_register_write(rt2x00dev, LDO_CFG0, reg); | 4290 | rt2800_register_write(rt2x00dev, LDO_CFG0, reg); |
4094 | } | 4291 | } |
@@ -4103,6 +4300,7 @@ static int rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev) | |||
4103 | rt2800_init_rx_filter(rt2x00dev, true, 0x27, 0x19); | 4300 | rt2800_init_rx_filter(rt2x00dev, true, 0x27, 0x19); |
4104 | } else if (rt2x00_rt(rt2x00dev, RT3071) || | 4301 | } else if (rt2x00_rt(rt2x00dev, RT3071) || |
4105 | rt2x00_rt(rt2x00dev, RT3090) || | 4302 | rt2x00_rt(rt2x00dev, RT3090) || |
4303 | rt2x00_rt(rt2x00dev, RT3352) || | ||
4106 | rt2x00_rt(rt2x00dev, RT3390) || | 4304 | rt2x00_rt(rt2x00dev, RT3390) || |
4107 | rt2x00_rt(rt2x00dev, RT3572)) { | 4305 | rt2x00_rt(rt2x00dev, RT3572)) { |
4108 | drv_data->calibration_bw20 = | 4306 | drv_data->calibration_bw20 = |
@@ -4391,7 +4589,7 @@ void rt2800_read_eeprom_efuse(struct rt2x00_dev *rt2x00dev) | |||
4391 | } | 4589 | } |
4392 | EXPORT_SYMBOL_GPL(rt2800_read_eeprom_efuse); | 4590 | EXPORT_SYMBOL_GPL(rt2800_read_eeprom_efuse); |
4393 | 4591 | ||
4394 | int rt2800_validate_eeprom(struct rt2x00_dev *rt2x00dev) | 4592 | static int rt2800_validate_eeprom(struct rt2x00_dev *rt2x00dev) |
4395 | { | 4593 | { |
4396 | struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; | 4594 | struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; |
4397 | u16 word; | 4595 | u16 word; |
@@ -4399,6 +4597,11 @@ int rt2800_validate_eeprom(struct rt2x00_dev *rt2x00dev) | |||
4399 | u8 default_lna_gain; | 4597 | u8 default_lna_gain; |
4400 | 4598 | ||
4401 | /* | 4599 | /* |
4600 | * Read the EEPROM. | ||
4601 | */ | ||
4602 | rt2800_read_eeprom(rt2x00dev); | ||
4603 | |||
4604 | /* | ||
4402 | * Start validation of the data that has been read. | 4605 | * Start validation of the data that has been read. |
4403 | */ | 4606 | */ |
4404 | mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0); | 4607 | mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0); |
@@ -4520,9 +4723,8 @@ int rt2800_validate_eeprom(struct rt2x00_dev *rt2x00dev) | |||
4520 | 4723 | ||
4521 | return 0; | 4724 | return 0; |
4522 | } | 4725 | } |
4523 | EXPORT_SYMBOL_GPL(rt2800_validate_eeprom); | ||
4524 | 4726 | ||
4525 | int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev) | 4727 | static int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev) |
4526 | { | 4728 | { |
4527 | u32 reg; | 4729 | u32 reg; |
4528 | u16 value; | 4730 | u16 value; |
@@ -4561,6 +4763,7 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
4561 | case RT3071: | 4763 | case RT3071: |
4562 | case RT3090: | 4764 | case RT3090: |
4563 | case RT3290: | 4765 | case RT3290: |
4766 | case RT3352: | ||
4564 | case RT3390: | 4767 | case RT3390: |
4565 | case RT3572: | 4768 | case RT3572: |
4566 | case RT5390: | 4769 | case RT5390: |
@@ -4583,6 +4786,7 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
4583 | case RF3052: | 4786 | case RF3052: |
4584 | case RF3290: | 4787 | case RF3290: |
4585 | case RF3320: | 4788 | case RF3320: |
4789 | case RF3322: | ||
4586 | case RF5360: | 4790 | case RF5360: |
4587 | case RF5370: | 4791 | case RF5370: |
4588 | case RF5372: | 4792 | case RF5372: |
@@ -4607,6 +4811,7 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
4607 | 4811 | ||
4608 | if (rt2x00_rt(rt2x00dev, RT3070) || | 4812 | if (rt2x00_rt(rt2x00dev, RT3070) || |
4609 | rt2x00_rt(rt2x00dev, RT3090) || | 4813 | rt2x00_rt(rt2x00dev, RT3090) || |
4814 | rt2x00_rt(rt2x00dev, RT3352) || | ||
4610 | rt2x00_rt(rt2x00dev, RT3390)) { | 4815 | rt2x00_rt(rt2x00dev, RT3390)) { |
4611 | value = rt2x00_get_field16(eeprom, | 4816 | value = rt2x00_get_field16(eeprom, |
4612 | EEPROM_NIC_CONF1_ANT_DIVERSITY); | 4817 | EEPROM_NIC_CONF1_ANT_DIVERSITY); |
@@ -4680,7 +4885,6 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
4680 | 4885 | ||
4681 | return 0; | 4886 | return 0; |
4682 | } | 4887 | } |
4683 | EXPORT_SYMBOL_GPL(rt2800_init_eeprom); | ||
4684 | 4888 | ||
4685 | /* | 4889 | /* |
4686 | * RF value list for rt28xx | 4890 | * RF value list for rt28xx |
@@ -4823,7 +5027,7 @@ static const struct rf_channel rf_vals_3x[] = { | |||
4823 | {173, 0x61, 0, 9}, | 5027 | {173, 0x61, 0, 9}, |
4824 | }; | 5028 | }; |
4825 | 5029 | ||
4826 | int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | 5030 | static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev) |
4827 | { | 5031 | { |
4828 | struct hw_mode_spec *spec = &rt2x00dev->spec; | 5032 | struct hw_mode_spec *spec = &rt2x00dev->spec; |
4829 | struct channel_info *info; | 5033 | struct channel_info *info; |
@@ -4900,6 +5104,7 @@ int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
4900 | rt2x00_rf(rt2x00dev, RF3022) || | 5104 | rt2x00_rf(rt2x00dev, RF3022) || |
4901 | rt2x00_rf(rt2x00dev, RF3290) || | 5105 | rt2x00_rf(rt2x00dev, RF3290) || |
4902 | rt2x00_rf(rt2x00dev, RF3320) || | 5106 | rt2x00_rf(rt2x00dev, RF3320) || |
5107 | rt2x00_rf(rt2x00dev, RF3322) || | ||
4903 | rt2x00_rf(rt2x00dev, RF5360) || | 5108 | rt2x00_rf(rt2x00dev, RF5360) || |
4904 | rt2x00_rf(rt2x00dev, RF5370) || | 5109 | rt2x00_rf(rt2x00dev, RF5370) || |
4905 | rt2x00_rf(rt2x00dev, RF5372) || | 5110 | rt2x00_rf(rt2x00dev, RF5372) || |
@@ -4999,7 +5204,72 @@ int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
4999 | 5204 | ||
5000 | return 0; | 5205 | return 0; |
5001 | } | 5206 | } |
5002 | EXPORT_SYMBOL_GPL(rt2800_probe_hw_mode); | 5207 | |
5208 | int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev) | ||
5209 | { | ||
5210 | int retval; | ||
5211 | u32 reg; | ||
5212 | |||
5213 | /* | ||
5214 | * Allocate eeprom data. | ||
5215 | */ | ||
5216 | retval = rt2800_validate_eeprom(rt2x00dev); | ||
5217 | if (retval) | ||
5218 | return retval; | ||
5219 | |||
5220 | retval = rt2800_init_eeprom(rt2x00dev); | ||
5221 | if (retval) | ||
5222 | return retval; | ||
5223 | |||
5224 | /* | ||
5225 | * Enable rfkill polling by setting GPIO direction of the | ||
5226 | * rfkill switch GPIO pin correctly. | ||
5227 | */ | ||
5228 | rt2800_register_read(rt2x00dev, GPIO_CTRL, ®); | ||
5229 | rt2x00_set_field32(®, GPIO_CTRL_DIR2, 1); | ||
5230 | rt2800_register_write(rt2x00dev, GPIO_CTRL, reg); | ||
5231 | |||
5232 | /* | ||
5233 | * Initialize hw specifications. | ||
5234 | */ | ||
5235 | retval = rt2800_probe_hw_mode(rt2x00dev); | ||
5236 | if (retval) | ||
5237 | return retval; | ||
5238 | |||
5239 | /* | ||
5240 | * Set device capabilities. | ||
5241 | */ | ||
5242 | __set_bit(CAPABILITY_CONTROL_FILTERS, &rt2x00dev->cap_flags); | ||
5243 | __set_bit(CAPABILITY_CONTROL_FILTER_PSPOLL, &rt2x00dev->cap_flags); | ||
5244 | if (!rt2x00_is_usb(rt2x00dev)) | ||
5245 | __set_bit(CAPABILITY_PRE_TBTT_INTERRUPT, &rt2x00dev->cap_flags); | ||
5246 | |||
5247 | /* | ||
5248 | * Set device requirements. | ||
5249 | */ | ||
5250 | if (!rt2x00_is_soc(rt2x00dev)) | ||
5251 | __set_bit(REQUIRE_FIRMWARE, &rt2x00dev->cap_flags); | ||
5252 | __set_bit(REQUIRE_L2PAD, &rt2x00dev->cap_flags); | ||
5253 | __set_bit(REQUIRE_TXSTATUS_FIFO, &rt2x00dev->cap_flags); | ||
5254 | if (!rt2800_hwcrypt_disabled(rt2x00dev)) | ||
5255 | __set_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags); | ||
5256 | __set_bit(CAPABILITY_LINK_TUNING, &rt2x00dev->cap_flags); | ||
5257 | __set_bit(REQUIRE_HT_TX_DESC, &rt2x00dev->cap_flags); | ||
5258 | if (rt2x00_is_usb(rt2x00dev)) | ||
5259 | __set_bit(REQUIRE_PS_AUTOWAKE, &rt2x00dev->cap_flags); | ||
5260 | else { | ||
5261 | __set_bit(REQUIRE_DMA, &rt2x00dev->cap_flags); | ||
5262 | __set_bit(REQUIRE_TASKLET_CONTEXT, &rt2x00dev->cap_flags); | ||
5263 | } | ||
5264 | |||
5265 | /* | ||
5266 | * Set the rssi offset. | ||
5267 | */ | ||
5268 | rt2x00dev->rssi_offset = DEFAULT_RSSI_OFFSET; | ||
5269 | |||
5270 | return 0; | ||
5271 | } | ||
5272 | EXPORT_SYMBOL_GPL(rt2800_probe_hw); | ||
5003 | 5273 | ||
5004 | /* | 5274 | /* |
5005 | * IEEE80211 stack callback functions. | 5275 | * IEEE80211 stack callback functions. |
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.h b/drivers/net/wireless/rt2x00/rt2800lib.h index 18a0b67b4c68..a128ceadcb3e 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.h +++ b/drivers/net/wireless/rt2x00/rt2800lib.h | |||
@@ -43,6 +43,9 @@ struct rt2800_ops { | |||
43 | const unsigned int offset, | 43 | const unsigned int offset, |
44 | const struct rt2x00_field32 field, u32 *reg); | 44 | const struct rt2x00_field32 field, u32 *reg); |
45 | 45 | ||
46 | void (*read_eeprom)(struct rt2x00_dev *rt2x00dev); | ||
47 | bool (*hwcrypt_disabled)(struct rt2x00_dev *rt2x00dev); | ||
48 | |||
46 | int (*drv_write_firmware)(struct rt2x00_dev *rt2x00dev, | 49 | int (*drv_write_firmware)(struct rt2x00_dev *rt2x00dev, |
47 | const u8 *data, const size_t len); | 50 | const u8 *data, const size_t len); |
48 | int (*drv_init_registers)(struct rt2x00_dev *rt2x00dev); | 51 | int (*drv_init_registers)(struct rt2x00_dev *rt2x00dev); |
@@ -114,6 +117,20 @@ static inline int rt2800_regbusy_read(struct rt2x00_dev *rt2x00dev, | |||
114 | return rt2800ops->regbusy_read(rt2x00dev, offset, field, reg); | 117 | return rt2800ops->regbusy_read(rt2x00dev, offset, field, reg); |
115 | } | 118 | } |
116 | 119 | ||
120 | static inline void rt2800_read_eeprom(struct rt2x00_dev *rt2x00dev) | ||
121 | { | ||
122 | const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv; | ||
123 | |||
124 | rt2800ops->read_eeprom(rt2x00dev); | ||
125 | } | ||
126 | |||
127 | static inline bool rt2800_hwcrypt_disabled(struct rt2x00_dev *rt2x00dev) | ||
128 | { | ||
129 | const struct rt2800_ops *rt2800ops = rt2x00dev->ops->drv; | ||
130 | |||
131 | return rt2800ops->hwcrypt_disabled(rt2x00dev); | ||
132 | } | ||
133 | |||
117 | static inline int rt2800_drv_write_firmware(struct rt2x00_dev *rt2x00dev, | 134 | static inline int rt2800_drv_write_firmware(struct rt2x00_dev *rt2x00dev, |
118 | const u8 *data, const size_t len) | 135 | const u8 *data, const size_t len) |
119 | { | 136 | { |
@@ -191,9 +208,8 @@ void rt2800_disable_radio(struct rt2x00_dev *rt2x00dev); | |||
191 | 208 | ||
192 | int rt2800_efuse_detect(struct rt2x00_dev *rt2x00dev); | 209 | int rt2800_efuse_detect(struct rt2x00_dev *rt2x00dev); |
193 | void rt2800_read_eeprom_efuse(struct rt2x00_dev *rt2x00dev); | 210 | void rt2800_read_eeprom_efuse(struct rt2x00_dev *rt2x00dev); |
194 | int rt2800_validate_eeprom(struct rt2x00_dev *rt2x00dev); | 211 | |
195 | int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev); | 212 | int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev); |
196 | int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev); | ||
197 | 213 | ||
198 | void rt2800_get_tkip_seq(struct ieee80211_hw *hw, u8 hw_key_idx, u32 *iv32, | 214 | void rt2800_get_tkip_seq(struct ieee80211_hw *hw, u8 hw_key_idx, u32 *iv32, |
199 | u16 *iv16); | 215 | u16 *iv16); |
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index 98aa426a3564..391e08fa054b 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c | |||
@@ -54,6 +54,11 @@ static bool modparam_nohwcrypt = false; | |||
54 | module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO); | 54 | module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO); |
55 | MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption."); | 55 | MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption."); |
56 | 56 | ||
57 | static bool rt2800pci_hwcrypt_disabled(struct rt2x00_dev *rt2x00dev) | ||
58 | { | ||
59 | return modparam_nohwcrypt; | ||
60 | } | ||
61 | |||
57 | static void rt2800pci_mcu_status(struct rt2x00_dev *rt2x00dev, const u8 token) | 62 | static void rt2800pci_mcu_status(struct rt2x00_dev *rt2x00dev, const u8 token) |
58 | { | 63 | { |
59 | unsigned int i; | 64 | unsigned int i; |
@@ -965,76 +970,14 @@ static irqreturn_t rt2800pci_interrupt(int irq, void *dev_instance) | |||
965 | /* | 970 | /* |
966 | * Device probe functions. | 971 | * Device probe functions. |
967 | */ | 972 | */ |
968 | static int rt2800pci_validate_eeprom(struct rt2x00_dev *rt2x00dev) | 973 | static void rt2800pci_read_eeprom(struct rt2x00_dev *rt2x00dev) |
969 | { | 974 | { |
970 | /* | ||
971 | * Read EEPROM into buffer | ||
972 | */ | ||
973 | if (rt2x00_is_soc(rt2x00dev)) | 975 | if (rt2x00_is_soc(rt2x00dev)) |
974 | rt2800pci_read_eeprom_soc(rt2x00dev); | 976 | rt2800pci_read_eeprom_soc(rt2x00dev); |
975 | else if (rt2800pci_efuse_detect(rt2x00dev)) | 977 | else if (rt2800pci_efuse_detect(rt2x00dev)) |
976 | rt2800pci_read_eeprom_efuse(rt2x00dev); | 978 | rt2800pci_read_eeprom_efuse(rt2x00dev); |
977 | else | 979 | else |
978 | rt2800pci_read_eeprom_pci(rt2x00dev); | 980 | rt2800pci_read_eeprom_pci(rt2x00dev); |
979 | |||
980 | return rt2800_validate_eeprom(rt2x00dev); | ||
981 | } | ||
982 | |||
983 | static int rt2800pci_probe_hw(struct rt2x00_dev *rt2x00dev) | ||
984 | { | ||
985 | int retval; | ||
986 | |||
987 | /* | ||
988 | * Allocate eeprom data. | ||
989 | */ | ||
990 | retval = rt2800pci_validate_eeprom(rt2x00dev); | ||
991 | if (retval) | ||
992 | return retval; | ||
993 | |||
994 | retval = rt2800_init_eeprom(rt2x00dev); | ||
995 | if (retval) | ||
996 | return retval; | ||
997 | |||
998 | /* | ||
999 | * Initialize hw specifications. | ||
1000 | */ | ||
1001 | retval = rt2800_probe_hw_mode(rt2x00dev); | ||
1002 | if (retval) | ||
1003 | return retval; | ||
1004 | |||
1005 | /* | ||
1006 | * This device has multiple filters for control frames | ||
1007 | * and has a separate filter for PS Poll frames. | ||
1008 | */ | ||
1009 | __set_bit(CAPABILITY_CONTROL_FILTERS, &rt2x00dev->cap_flags); | ||
1010 | __set_bit(CAPABILITY_CONTROL_FILTER_PSPOLL, &rt2x00dev->cap_flags); | ||
1011 | |||
1012 | /* | ||
1013 | * This device has a pre tbtt interrupt and thus fetches | ||
1014 | * a new beacon directly prior to transmission. | ||
1015 | */ | ||
1016 | __set_bit(CAPABILITY_PRE_TBTT_INTERRUPT, &rt2x00dev->cap_flags); | ||
1017 | |||
1018 | /* | ||
1019 | * This device requires firmware. | ||
1020 | */ | ||
1021 | if (!rt2x00_is_soc(rt2x00dev)) | ||
1022 | __set_bit(REQUIRE_FIRMWARE, &rt2x00dev->cap_flags); | ||
1023 | __set_bit(REQUIRE_DMA, &rt2x00dev->cap_flags); | ||
1024 | __set_bit(REQUIRE_L2PAD, &rt2x00dev->cap_flags); | ||
1025 | __set_bit(REQUIRE_TXSTATUS_FIFO, &rt2x00dev->cap_flags); | ||
1026 | __set_bit(REQUIRE_TASKLET_CONTEXT, &rt2x00dev->cap_flags); | ||
1027 | if (!modparam_nohwcrypt) | ||
1028 | __set_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags); | ||
1029 | __set_bit(CAPABILITY_LINK_TUNING, &rt2x00dev->cap_flags); | ||
1030 | __set_bit(REQUIRE_HT_TX_DESC, &rt2x00dev->cap_flags); | ||
1031 | |||
1032 | /* | ||
1033 | * Set the rssi offset. | ||
1034 | */ | ||
1035 | rt2x00dev->rssi_offset = DEFAULT_RSSI_OFFSET; | ||
1036 | |||
1037 | return 0; | ||
1038 | } | 981 | } |
1039 | 982 | ||
1040 | static const struct ieee80211_ops rt2800pci_mac80211_ops = { | 983 | static const struct ieee80211_ops rt2800pci_mac80211_ops = { |
@@ -1072,6 +1015,8 @@ static const struct rt2800_ops rt2800pci_rt2800_ops = { | |||
1072 | .register_multiread = rt2x00pci_register_multiread, | 1015 | .register_multiread = rt2x00pci_register_multiread, |
1073 | .register_multiwrite = rt2x00pci_register_multiwrite, | 1016 | .register_multiwrite = rt2x00pci_register_multiwrite, |
1074 | .regbusy_read = rt2x00pci_regbusy_read, | 1017 | .regbusy_read = rt2x00pci_regbusy_read, |
1018 | .read_eeprom = rt2800pci_read_eeprom, | ||
1019 | .hwcrypt_disabled = rt2800pci_hwcrypt_disabled, | ||
1075 | .drv_write_firmware = rt2800pci_write_firmware, | 1020 | .drv_write_firmware = rt2800pci_write_firmware, |
1076 | .drv_init_registers = rt2800pci_init_registers, | 1021 | .drv_init_registers = rt2800pci_init_registers, |
1077 | .drv_get_txwi = rt2800pci_get_txwi, | 1022 | .drv_get_txwi = rt2800pci_get_txwi, |
@@ -1084,7 +1029,7 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = { | |||
1084 | .tbtt_tasklet = rt2800pci_tbtt_tasklet, | 1029 | .tbtt_tasklet = rt2800pci_tbtt_tasklet, |
1085 | .rxdone_tasklet = rt2800pci_rxdone_tasklet, | 1030 | .rxdone_tasklet = rt2800pci_rxdone_tasklet, |
1086 | .autowake_tasklet = rt2800pci_autowake_tasklet, | 1031 | .autowake_tasklet = rt2800pci_autowake_tasklet, |
1087 | .probe_hw = rt2800pci_probe_hw, | 1032 | .probe_hw = rt2800_probe_hw, |
1088 | .get_firmware_name = rt2800pci_get_firmware_name, | 1033 | .get_firmware_name = rt2800pci_get_firmware_name, |
1089 | .check_firmware = rt2800_check_firmware, | 1034 | .check_firmware = rt2800_check_firmware, |
1090 | .load_firmware = rt2800_load_firmware, | 1035 | .load_firmware = rt2800_load_firmware, |
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index 6cf336595e25..603b65d6f28b 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | |||
@@ -49,6 +49,11 @@ static bool modparam_nohwcrypt; | |||
49 | module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO); | 49 | module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO); |
50 | MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption."); | 50 | MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption."); |
51 | 51 | ||
52 | static bool rt2800usb_hwcrypt_disabled(struct rt2x00_dev *rt2x00dev) | ||
53 | { | ||
54 | return modparam_nohwcrypt; | ||
55 | } | ||
56 | |||
52 | /* | 57 | /* |
53 | * Queue handlers. | 58 | * Queue handlers. |
54 | */ | 59 | */ |
@@ -667,8 +672,16 @@ static void rt2800usb_fill_rxdone(struct queue_entry *entry, | |||
667 | skb_pull(entry->skb, RXINFO_DESC_SIZE); | 672 | skb_pull(entry->skb, RXINFO_DESC_SIZE); |
668 | 673 | ||
669 | /* | 674 | /* |
670 | * FIXME: we need to check for rx_pkt_len validity | 675 | * Check for rx_pkt_len validity. Return if invalid, leaving |
676 | * rxdesc->size zeroed out by the upper level. | ||
671 | */ | 677 | */ |
678 | if (unlikely(rx_pkt_len == 0 || | ||
679 | rx_pkt_len > entry->queue->data_size)) { | ||
680 | ERROR(entry->queue->rt2x00dev, | ||
681 | "Bad frame size %d, forcing to 0\n", rx_pkt_len); | ||
682 | return; | ||
683 | } | ||
684 | |||
672 | rxd = (__le32 *)(entry->skb->data + rx_pkt_len); | 685 | rxd = (__le32 *)(entry->skb->data + rx_pkt_len); |
673 | 686 | ||
674 | /* | 687 | /* |
@@ -722,64 +735,27 @@ static void rt2800usb_fill_rxdone(struct queue_entry *entry, | |||
722 | /* | 735 | /* |
723 | * Device probe functions. | 736 | * Device probe functions. |
724 | */ | 737 | */ |
725 | static int rt2800usb_validate_eeprom(struct rt2x00_dev *rt2x00dev) | 738 | static void rt2800usb_read_eeprom(struct rt2x00_dev *rt2x00dev) |
726 | { | 739 | { |
727 | if (rt2800_efuse_detect(rt2x00dev)) | 740 | if (rt2800_efuse_detect(rt2x00dev)) |
728 | rt2800_read_eeprom_efuse(rt2x00dev); | 741 | rt2800_read_eeprom_efuse(rt2x00dev); |
729 | else | 742 | else |
730 | rt2x00usb_eeprom_read(rt2x00dev, rt2x00dev->eeprom, | 743 | rt2x00usb_eeprom_read(rt2x00dev, rt2x00dev->eeprom, |
731 | EEPROM_SIZE); | 744 | EEPROM_SIZE); |
732 | |||
733 | return rt2800_validate_eeprom(rt2x00dev); | ||
734 | } | 745 | } |
735 | 746 | ||
736 | static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00dev) | 747 | static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00dev) |
737 | { | 748 | { |
738 | int retval; | 749 | int retval; |
739 | 750 | ||
740 | /* | 751 | retval = rt2800_probe_hw(rt2x00dev); |
741 | * Allocate eeprom data. | ||
742 | */ | ||
743 | retval = rt2800usb_validate_eeprom(rt2x00dev); | ||
744 | if (retval) | ||
745 | return retval; | ||
746 | |||
747 | retval = rt2800_init_eeprom(rt2x00dev); | ||
748 | if (retval) | 752 | if (retval) |
749 | return retval; | 753 | return retval; |
750 | 754 | ||
751 | /* | 755 | /* |
752 | * Initialize hw specifications. | 756 | * Set txstatus timer function. |
753 | */ | 757 | */ |
754 | retval = rt2800_probe_hw_mode(rt2x00dev); | 758 | rt2x00dev->txstatus_timer.function = rt2800usb_tx_sta_fifo_timeout; |
755 | if (retval) | ||
756 | return retval; | ||
757 | |||
758 | /* | ||
759 | * This device has multiple filters for control frames | ||
760 | * and has a separate filter for PS Poll frames. | ||
761 | */ | ||
762 | __set_bit(CAPABILITY_CONTROL_FILTERS, &rt2x00dev->cap_flags); | ||
763 | __set_bit(CAPABILITY_CONTROL_FILTER_PSPOLL, &rt2x00dev->cap_flags); | ||
764 | |||
765 | /* | ||
766 | * This device requires firmware. | ||
767 | */ | ||
768 | __set_bit(REQUIRE_FIRMWARE, &rt2x00dev->cap_flags); | ||
769 | __set_bit(REQUIRE_L2PAD, &rt2x00dev->cap_flags); | ||
770 | if (!modparam_nohwcrypt) | ||
771 | __set_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags); | ||
772 | __set_bit(CAPABILITY_LINK_TUNING, &rt2x00dev->cap_flags); | ||
773 | __set_bit(REQUIRE_HT_TX_DESC, &rt2x00dev->cap_flags); | ||
774 | __set_bit(REQUIRE_TXSTATUS_FIFO, &rt2x00dev->cap_flags); | ||
775 | __set_bit(REQUIRE_PS_AUTOWAKE, &rt2x00dev->cap_flags); | ||
776 | |||
777 | rt2x00dev->txstatus_timer.function = rt2800usb_tx_sta_fifo_timeout, | ||
778 | |||
779 | /* | ||
780 | * Set the rssi offset. | ||
781 | */ | ||
782 | rt2x00dev->rssi_offset = DEFAULT_RSSI_OFFSET; | ||
783 | 759 | ||
784 | /* | 760 | /* |
785 | * Overwrite TX done handler | 761 | * Overwrite TX done handler |
@@ -825,6 +801,8 @@ static const struct rt2800_ops rt2800usb_rt2800_ops = { | |||
825 | .register_multiread = rt2x00usb_register_multiread, | 801 | .register_multiread = rt2x00usb_register_multiread, |
826 | .register_multiwrite = rt2x00usb_register_multiwrite, | 802 | .register_multiwrite = rt2x00usb_register_multiwrite, |
827 | .regbusy_read = rt2x00usb_regbusy_read, | 803 | .regbusy_read = rt2x00usb_regbusy_read, |
804 | .read_eeprom = rt2800usb_read_eeprom, | ||
805 | .hwcrypt_disabled = rt2800usb_hwcrypt_disabled, | ||
828 | .drv_write_firmware = rt2800usb_write_firmware, | 806 | .drv_write_firmware = rt2800usb_write_firmware, |
829 | .drv_init_registers = rt2800usb_init_registers, | 807 | .drv_init_registers = rt2800usb_init_registers, |
830 | .drv_get_txwi = rt2800usb_get_txwi, | 808 | .drv_get_txwi = rt2800usb_get_txwi, |
@@ -1157,6 +1135,8 @@ static struct usb_device_id rt2800usb_device_table[] = { | |||
1157 | { USB_DEVICE(0x1690, 0x0744) }, | 1135 | { USB_DEVICE(0x1690, 0x0744) }, |
1158 | { USB_DEVICE(0x1690, 0x0761) }, | 1136 | { USB_DEVICE(0x1690, 0x0761) }, |
1159 | { USB_DEVICE(0x1690, 0x0764) }, | 1137 | { USB_DEVICE(0x1690, 0x0764) }, |
1138 | /* ASUS */ | ||
1139 | { USB_DEVICE(0x0b05, 0x179d) }, | ||
1160 | /* Cisco */ | 1140 | /* Cisco */ |
1161 | { USB_DEVICE(0x167b, 0x4001) }, | 1141 | { USB_DEVICE(0x167b, 0x4001) }, |
1162 | /* EnGenius */ | 1142 | /* EnGenius */ |
@@ -1222,7 +1202,6 @@ static struct usb_device_id rt2800usb_device_table[] = { | |||
1222 | { USB_DEVICE(0x0b05, 0x1760) }, | 1202 | { USB_DEVICE(0x0b05, 0x1760) }, |
1223 | { USB_DEVICE(0x0b05, 0x1761) }, | 1203 | { USB_DEVICE(0x0b05, 0x1761) }, |
1224 | { USB_DEVICE(0x0b05, 0x1790) }, | 1204 | { USB_DEVICE(0x0b05, 0x1790) }, |
1225 | { USB_DEVICE(0x0b05, 0x179d) }, | ||
1226 | /* AzureWave */ | 1205 | /* AzureWave */ |
1227 | { USB_DEVICE(0x13d3, 0x3262) }, | 1206 | { USB_DEVICE(0x13d3, 0x3262) }, |
1228 | { USB_DEVICE(0x13d3, 0x3284) }, | 1207 | { USB_DEVICE(0x13d3, 0x3284) }, |
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index f991e8bedc70..49375c86c334 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -188,6 +188,7 @@ struct rt2x00_chip { | |||
188 | #define RT3071 0x3071 | 188 | #define RT3071 0x3071 |
189 | #define RT3090 0x3090 /* 2.4GHz PCIe */ | 189 | #define RT3090 0x3090 /* 2.4GHz PCIe */ |
190 | #define RT3290 0x3290 | 190 | #define RT3290 0x3290 |
191 | #define RT3352 0x3352 /* WSOC */ | ||
191 | #define RT3390 0x3390 | 192 | #define RT3390 0x3390 |
192 | #define RT3572 0x3572 | 193 | #define RT3572 0x3572 |
193 | #define RT3593 0x3593 | 194 | #define RT3593 0x3593 |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index a59048ffa092..10cf67267775 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -629,7 +629,7 @@ void rt2x00lib_rxdone(struct queue_entry *entry, gfp_t gfp) | |||
629 | */ | 629 | */ |
630 | if (unlikely(rxdesc.size == 0 || | 630 | if (unlikely(rxdesc.size == 0 || |
631 | rxdesc.size > entry->queue->data_size)) { | 631 | rxdesc.size > entry->queue->data_size)) { |
632 | WARNING(rt2x00dev, "Wrong frame size %d max %d.\n", | 632 | ERROR(rt2x00dev, "Wrong frame size %d max %d.\n", |
633 | rxdesc.size, entry->queue->data_size); | 633 | rxdesc.size, entry->queue->data_size); |
634 | dev_kfree_skb(entry->skb); | 634 | dev_kfree_skb(entry->skb); |
635 | goto renew_skb; | 635 | goto renew_skb; |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index 3f7bc5cadf9a..2673e058caaf 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -243,7 +243,7 @@ static int rt61pci_rfkill_poll(struct rt2x00_dev *rt2x00dev) | |||
243 | u32 reg; | 243 | u32 reg; |
244 | 244 | ||
245 | rt2x00pci_register_read(rt2x00dev, MAC_CSR13, ®); | 245 | rt2x00pci_register_read(rt2x00dev, MAC_CSR13, ®); |
246 | return rt2x00_get_field32(reg, MAC_CSR13_BIT5); | 246 | return rt2x00_get_field32(reg, MAC_CSR13_VAL5); |
247 | } | 247 | } |
248 | 248 | ||
249 | #ifdef CONFIG_RT2X00_LIB_LEDS | 249 | #ifdef CONFIG_RT2X00_LIB_LEDS |
@@ -715,11 +715,11 @@ static void rt61pci_config_antenna_2529_rx(struct rt2x00_dev *rt2x00dev, | |||
715 | 715 | ||
716 | rt2x00pci_register_read(rt2x00dev, MAC_CSR13, ®); | 716 | rt2x00pci_register_read(rt2x00dev, MAC_CSR13, ®); |
717 | 717 | ||
718 | rt2x00_set_field32(®, MAC_CSR13_BIT4, p1); | 718 | rt2x00_set_field32(®, MAC_CSR13_DIR4, 0); |
719 | rt2x00_set_field32(®, MAC_CSR13_BIT12, 0); | 719 | rt2x00_set_field32(®, MAC_CSR13_VAL4, p1); |
720 | 720 | ||
721 | rt2x00_set_field32(®, MAC_CSR13_BIT3, !p2); | 721 | rt2x00_set_field32(®, MAC_CSR13_DIR3, 0); |
722 | rt2x00_set_field32(®, MAC_CSR13_BIT11, 0); | 722 | rt2x00_set_field32(®, MAC_CSR13_VAL3, !p2); |
723 | 723 | ||
724 | rt2x00pci_register_write(rt2x00dev, MAC_CSR13, reg); | 724 | rt2x00pci_register_write(rt2x00dev, MAC_CSR13, reg); |
725 | } | 725 | } |
@@ -2832,6 +2832,7 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
2832 | static int rt61pci_probe_hw(struct rt2x00_dev *rt2x00dev) | 2832 | static int rt61pci_probe_hw(struct rt2x00_dev *rt2x00dev) |
2833 | { | 2833 | { |
2834 | int retval; | 2834 | int retval; |
2835 | u32 reg; | ||
2835 | 2836 | ||
2836 | /* | 2837 | /* |
2837 | * Disable power saving. | 2838 | * Disable power saving. |
@@ -2850,6 +2851,14 @@ static int rt61pci_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
2850 | return retval; | 2851 | return retval; |
2851 | 2852 | ||
2852 | /* | 2853 | /* |
2854 | * Enable rfkill polling by setting GPIO direction of the | ||
2855 | * rfkill switch GPIO pin correctly. | ||
2856 | */ | ||
2857 | rt2x00pci_register_read(rt2x00dev, MAC_CSR13, ®); | ||
2858 | rt2x00_set_field32(®, MAC_CSR13_DIR5, 1); | ||
2859 | rt2x00pci_register_write(rt2x00dev, MAC_CSR13, reg); | ||
2860 | |||
2861 | /* | ||
2853 | * Initialize hw specifications. | 2862 | * Initialize hw specifications. |
2854 | */ | 2863 | */ |
2855 | retval = rt61pci_probe_hw_mode(rt2x00dev); | 2864 | retval = rt61pci_probe_hw_mode(rt2x00dev); |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.h b/drivers/net/wireless/rt2x00/rt61pci.h index e3cd6db76b0e..9bc6b6044e34 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.h +++ b/drivers/net/wireless/rt2x00/rt61pci.h | |||
@@ -357,21 +357,22 @@ struct hw_pairwise_ta_entry { | |||
357 | 357 | ||
358 | /* | 358 | /* |
359 | * MAC_CSR13: GPIO. | 359 | * MAC_CSR13: GPIO. |
360 | * MAC_CSR13_VALx: GPIO value | ||
361 | * MAC_CSR13_DIRx: GPIO direction: 0 = output; 1 = input | ||
360 | */ | 362 | */ |
361 | #define MAC_CSR13 0x3034 | 363 | #define MAC_CSR13 0x3034 |
362 | #define MAC_CSR13_BIT0 FIELD32(0x00000001) | 364 | #define MAC_CSR13_VAL0 FIELD32(0x00000001) |
363 | #define MAC_CSR13_BIT1 FIELD32(0x00000002) | 365 | #define MAC_CSR13_VAL1 FIELD32(0x00000002) |
364 | #define MAC_CSR13_BIT2 FIELD32(0x00000004) | 366 | #define MAC_CSR13_VAL2 FIELD32(0x00000004) |
365 | #define MAC_CSR13_BIT3 FIELD32(0x00000008) | 367 | #define MAC_CSR13_VAL3 FIELD32(0x00000008) |
366 | #define MAC_CSR13_BIT4 FIELD32(0x00000010) | 368 | #define MAC_CSR13_VAL4 FIELD32(0x00000010) |
367 | #define MAC_CSR13_BIT5 FIELD32(0x00000020) | 369 | #define MAC_CSR13_VAL5 FIELD32(0x00000020) |
368 | #define MAC_CSR13_BIT6 FIELD32(0x00000040) | 370 | #define MAC_CSR13_DIR0 FIELD32(0x00000100) |
369 | #define MAC_CSR13_BIT7 FIELD32(0x00000080) | 371 | #define MAC_CSR13_DIR1 FIELD32(0x00000200) |
370 | #define MAC_CSR13_BIT8 FIELD32(0x00000100) | 372 | #define MAC_CSR13_DIR2 FIELD32(0x00000400) |
371 | #define MAC_CSR13_BIT9 FIELD32(0x00000200) | 373 | #define MAC_CSR13_DIR3 FIELD32(0x00000800) |
372 | #define MAC_CSR13_BIT10 FIELD32(0x00000400) | 374 | #define MAC_CSR13_DIR4 FIELD32(0x00001000) |
373 | #define MAC_CSR13_BIT11 FIELD32(0x00000800) | 375 | #define MAC_CSR13_DIR5 FIELD32(0x00002000) |
374 | #define MAC_CSR13_BIT12 FIELD32(0x00001000) | ||
375 | 376 | ||
376 | /* | 377 | /* |
377 | * MAC_CSR14: LED control register. | 378 | * MAC_CSR14: LED control register. |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index ba6e434b859d..cfa9f37cccc2 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -189,7 +189,7 @@ static int rt73usb_rfkill_poll(struct rt2x00_dev *rt2x00dev) | |||
189 | u32 reg; | 189 | u32 reg; |
190 | 190 | ||
191 | rt2x00usb_register_read(rt2x00dev, MAC_CSR13, ®); | 191 | rt2x00usb_register_read(rt2x00dev, MAC_CSR13, ®); |
192 | return rt2x00_get_field32(reg, MAC_CSR13_BIT7); | 192 | return rt2x00_get_field32(reg, MAC_CSR13_VAL7); |
193 | } | 193 | } |
194 | 194 | ||
195 | #ifdef CONFIG_RT2X00_LIB_LEDS | 195 | #ifdef CONFIG_RT2X00_LIB_LEDS |
@@ -2177,6 +2177,7 @@ static int rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
2177 | static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev) | 2177 | static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev) |
2178 | { | 2178 | { |
2179 | int retval; | 2179 | int retval; |
2180 | u32 reg; | ||
2180 | 2181 | ||
2181 | /* | 2182 | /* |
2182 | * Allocate eeprom data. | 2183 | * Allocate eeprom data. |
@@ -2190,6 +2191,14 @@ static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
2190 | return retval; | 2191 | return retval; |
2191 | 2192 | ||
2192 | /* | 2193 | /* |
2194 | * Enable rfkill polling by setting GPIO direction of the | ||
2195 | * rfkill switch GPIO pin correctly. | ||
2196 | */ | ||
2197 | rt2x00usb_register_read(rt2x00dev, MAC_CSR13, ®); | ||
2198 | rt2x00_set_field32(®, MAC_CSR13_DIR7, 0); | ||
2199 | rt2x00usb_register_write(rt2x00dev, MAC_CSR13, reg); | ||
2200 | |||
2201 | /* | ||
2193 | * Initialize hw specifications. | 2202 | * Initialize hw specifications. |
2194 | */ | 2203 | */ |
2195 | retval = rt73usb_probe_hw_mode(rt2x00dev); | 2204 | retval = rt73usb_probe_hw_mode(rt2x00dev); |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.h b/drivers/net/wireless/rt2x00/rt73usb.h index 9f6b470414d3..7577e0ba3877 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.h +++ b/drivers/net/wireless/rt2x00/rt73usb.h | |||
@@ -267,21 +267,26 @@ struct hw_pairwise_ta_entry { | |||
267 | 267 | ||
268 | /* | 268 | /* |
269 | * MAC_CSR13: GPIO. | 269 | * MAC_CSR13: GPIO. |
270 | * MAC_CSR13_VALx: GPIO value | ||
271 | * MAC_CSR13_DIRx: GPIO direction: 0 = input; 1 = output | ||
270 | */ | 272 | */ |
271 | #define MAC_CSR13 0x3034 | 273 | #define MAC_CSR13 0x3034 |
272 | #define MAC_CSR13_BIT0 FIELD32(0x00000001) | 274 | #define MAC_CSR13_VAL0 FIELD32(0x00000001) |
273 | #define MAC_CSR13_BIT1 FIELD32(0x00000002) | 275 | #define MAC_CSR13_VAL1 FIELD32(0x00000002) |
274 | #define MAC_CSR13_BIT2 FIELD32(0x00000004) | 276 | #define MAC_CSR13_VAL2 FIELD32(0x00000004) |
275 | #define MAC_CSR13_BIT3 FIELD32(0x00000008) | 277 | #define MAC_CSR13_VAL3 FIELD32(0x00000008) |
276 | #define MAC_CSR13_BIT4 FIELD32(0x00000010) | 278 | #define MAC_CSR13_VAL4 FIELD32(0x00000010) |
277 | #define MAC_CSR13_BIT5 FIELD32(0x00000020) | 279 | #define MAC_CSR13_VAL5 FIELD32(0x00000020) |
278 | #define MAC_CSR13_BIT6 FIELD32(0x00000040) | 280 | #define MAC_CSR13_VAL6 FIELD32(0x00000040) |
279 | #define MAC_CSR13_BIT7 FIELD32(0x00000080) | 281 | #define MAC_CSR13_VAL7 FIELD32(0x00000080) |
280 | #define MAC_CSR13_BIT8 FIELD32(0x00000100) | 282 | #define MAC_CSR13_DIR0 FIELD32(0x00000100) |
281 | #define MAC_CSR13_BIT9 FIELD32(0x00000200) | 283 | #define MAC_CSR13_DIR1 FIELD32(0x00000200) |
282 | #define MAC_CSR13_BIT10 FIELD32(0x00000400) | 284 | #define MAC_CSR13_DIR2 FIELD32(0x00000400) |
283 | #define MAC_CSR13_BIT11 FIELD32(0x00000800) | 285 | #define MAC_CSR13_DIR3 FIELD32(0x00000800) |
284 | #define MAC_CSR13_BIT12 FIELD32(0x00001000) | 286 | #define MAC_CSR13_DIR4 FIELD32(0x00001000) |
287 | #define MAC_CSR13_DIR5 FIELD32(0x00002000) | ||
288 | #define MAC_CSR13_DIR6 FIELD32(0x00004000) | ||
289 | #define MAC_CSR13_DIR7 FIELD32(0x00008000) | ||
285 | 290 | ||
286 | /* | 291 | /* |
287 | * MAC_CSR14: LED control register. | 292 | * MAC_CSR14: LED control register. |
diff --git a/drivers/net/wireless/rtlwifi/Kconfig b/drivers/net/wireless/rtlwifi/Kconfig index cefac6a43601..6b28e92d1d21 100644 --- a/drivers/net/wireless/rtlwifi/Kconfig +++ b/drivers/net/wireless/rtlwifi/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config RTL8192CE | 1 | config RTL8192CE |
2 | tristate "Realtek RTL8192CE/RTL8188CE Wireless Network Adapter" | 2 | tristate "Realtek RTL8192CE/RTL8188CE Wireless Network Adapter" |
3 | depends on MAC80211 && PCI && EXPERIMENTAL | 3 | depends on MAC80211 && PCI |
4 | select FW_LOADER | 4 | select FW_LOADER |
5 | select RTLWIFI | 5 | select RTLWIFI |
6 | select RTL8192C_COMMON | 6 | select RTL8192C_COMMON |
@@ -12,7 +12,7 @@ config RTL8192CE | |||
12 | 12 | ||
13 | config RTL8192SE | 13 | config RTL8192SE |
14 | tristate "Realtek RTL8192SE/RTL8191SE PCIe Wireless Network Adapter" | 14 | tristate "Realtek RTL8192SE/RTL8191SE PCIe Wireless Network Adapter" |
15 | depends on MAC80211 && EXPERIMENTAL && PCI | 15 | depends on MAC80211 && PCI |
16 | select FW_LOADER | 16 | select FW_LOADER |
17 | select RTLWIFI | 17 | select RTLWIFI |
18 | ---help--- | 18 | ---help--- |
@@ -23,7 +23,7 @@ config RTL8192SE | |||
23 | 23 | ||
24 | config RTL8192DE | 24 | config RTL8192DE |
25 | tristate "Realtek RTL8192DE/RTL8188DE PCIe Wireless Network Adapter" | 25 | tristate "Realtek RTL8192DE/RTL8188DE PCIe Wireless Network Adapter" |
26 | depends on MAC80211 && EXPERIMENTAL && PCI | 26 | depends on MAC80211 && PCI |
27 | select FW_LOADER | 27 | select FW_LOADER |
28 | select RTLWIFI | 28 | select RTLWIFI |
29 | ---help--- | 29 | ---help--- |
@@ -34,7 +34,7 @@ config RTL8192DE | |||
34 | 34 | ||
35 | config RTL8192CU | 35 | config RTL8192CU |
36 | tristate "Realtek RTL8192CU/RTL8188CU USB Wireless Network Adapter" | 36 | tristate "Realtek RTL8192CU/RTL8188CU USB Wireless Network Adapter" |
37 | depends on MAC80211 && USB && EXPERIMENTAL | 37 | depends on MAC80211 && USB |
38 | select FW_LOADER | 38 | select FW_LOADER |
39 | select RTLWIFI | 39 | select RTLWIFI |
40 | select RTL8192C_COMMON | 40 | select RTL8192C_COMMON |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c index a45afda8259c..1ca4e25c143b 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c +++ b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c | |||
@@ -167,7 +167,7 @@ static void rtl92c_dm_diginit(struct ieee80211_hw *hw) | |||
167 | dm_digtable->dig_ext_port_stage = DIG_EXT_PORT_STAGE_MAX; | 167 | dm_digtable->dig_ext_port_stage = DIG_EXT_PORT_STAGE_MAX; |
168 | dm_digtable->cur_igvalue = 0x20; | 168 | dm_digtable->cur_igvalue = 0x20; |
169 | dm_digtable->pre_igvalue = 0x0; | 169 | dm_digtable->pre_igvalue = 0x0; |
170 | dm_digtable->cursta_connectctate = DIG_STA_DISCONNECT; | 170 | dm_digtable->cursta_connectstate = DIG_STA_DISCONNECT; |
171 | dm_digtable->presta_connectstate = DIG_STA_DISCONNECT; | 171 | dm_digtable->presta_connectstate = DIG_STA_DISCONNECT; |
172 | dm_digtable->curmultista_connectstate = DIG_MULTISTA_DISCONNECT; | 172 | dm_digtable->curmultista_connectstate = DIG_MULTISTA_DISCONNECT; |
173 | dm_digtable->rssi_lowthresh = DM_DIG_THRESH_LOW; | 173 | dm_digtable->rssi_lowthresh = DM_DIG_THRESH_LOW; |
@@ -190,7 +190,7 @@ static u8 rtl92c_dm_initial_gain_min_pwdb(struct ieee80211_hw *hw) | |||
190 | long rssi_val_min = 0; | 190 | long rssi_val_min = 0; |
191 | 191 | ||
192 | if ((dm_digtable->curmultista_connectstate == DIG_MULTISTA_CONNECT) && | 192 | if ((dm_digtable->curmultista_connectstate == DIG_MULTISTA_CONNECT) && |
193 | (dm_digtable->cursta_connectctate == DIG_STA_CONNECT)) { | 193 | (dm_digtable->cursta_connectstate == DIG_STA_CONNECT)) { |
194 | if (rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb != 0) | 194 | if (rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb != 0) |
195 | rssi_val_min = | 195 | rssi_val_min = |
196 | (rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb > | 196 | (rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb > |
@@ -199,8 +199,8 @@ static u8 rtl92c_dm_initial_gain_min_pwdb(struct ieee80211_hw *hw) | |||
199 | rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb; | 199 | rtlpriv->dm.entry_min_undecoratedsmoothed_pwdb; |
200 | else | 200 | else |
201 | rssi_val_min = rtlpriv->dm.undecorated_smoothed_pwdb; | 201 | rssi_val_min = rtlpriv->dm.undecorated_smoothed_pwdb; |
202 | } else if (dm_digtable->cursta_connectctate == DIG_STA_CONNECT || | 202 | } else if (dm_digtable->cursta_connectstate == DIG_STA_CONNECT || |
203 | dm_digtable->cursta_connectctate == DIG_STA_BEFORE_CONNECT) { | 203 | dm_digtable->cursta_connectstate == DIG_STA_BEFORE_CONNECT) { |
204 | rssi_val_min = rtlpriv->dm.undecorated_smoothed_pwdb; | 204 | rssi_val_min = rtlpriv->dm.undecorated_smoothed_pwdb; |
205 | } else if (dm_digtable->curmultista_connectstate == | 205 | } else if (dm_digtable->curmultista_connectstate == |
206 | DIG_MULTISTA_CONNECT) { | 206 | DIG_MULTISTA_CONNECT) { |
@@ -334,7 +334,7 @@ static void rtl92c_dm_initial_gain_multi_sta(struct ieee80211_hw *hw) | |||
334 | multi_sta = true; | 334 | multi_sta = true; |
335 | 335 | ||
336 | if (!multi_sta || | 336 | if (!multi_sta || |
337 | dm_digtable->cursta_connectctate != DIG_STA_DISCONNECT) { | 337 | dm_digtable->cursta_connectstate != DIG_STA_DISCONNECT) { |
338 | initialized = false; | 338 | initialized = false; |
339 | dm_digtable->dig_ext_port_stage = DIG_EXT_PORT_STAGE_MAX; | 339 | dm_digtable->dig_ext_port_stage = DIG_EXT_PORT_STAGE_MAX; |
340 | return; | 340 | return; |
@@ -378,15 +378,15 @@ static void rtl92c_dm_initial_gain_sta(struct ieee80211_hw *hw) | |||
378 | struct dig_t *dm_digtable = &rtlpriv->dm_digtable; | 378 | struct dig_t *dm_digtable = &rtlpriv->dm_digtable; |
379 | 379 | ||
380 | RT_TRACE(rtlpriv, COMP_DIG, DBG_TRACE, | 380 | RT_TRACE(rtlpriv, COMP_DIG, DBG_TRACE, |
381 | "presta_connectstate = %x, cursta_connectctate = %x\n", | 381 | "presta_connectstate = %x, cursta_connectstate = %x\n", |
382 | dm_digtable->presta_connectstate, | 382 | dm_digtable->presta_connectstate, |
383 | dm_digtable->cursta_connectctate); | 383 | dm_digtable->cursta_connectstate); |
384 | 384 | ||
385 | if (dm_digtable->presta_connectstate == dm_digtable->cursta_connectctate | 385 | if (dm_digtable->presta_connectstate == dm_digtable->cursta_connectstate |
386 | || dm_digtable->cursta_connectctate == DIG_STA_BEFORE_CONNECT | 386 | || dm_digtable->cursta_connectstate == DIG_STA_BEFORE_CONNECT |
387 | || dm_digtable->cursta_connectctate == DIG_STA_CONNECT) { | 387 | || dm_digtable->cursta_connectstate == DIG_STA_CONNECT) { |
388 | 388 | ||
389 | if (dm_digtable->cursta_connectctate != DIG_STA_DISCONNECT) { | 389 | if (dm_digtable->cursta_connectstate != DIG_STA_DISCONNECT) { |
390 | dm_digtable->rssi_val_min = | 390 | dm_digtable->rssi_val_min = |
391 | rtl92c_dm_initial_gain_min_pwdb(hw); | 391 | rtl92c_dm_initial_gain_min_pwdb(hw); |
392 | rtl92c_dm_ctrl_initgain_by_rssi(hw); | 392 | rtl92c_dm_ctrl_initgain_by_rssi(hw); |
@@ -407,7 +407,7 @@ static void rtl92c_dm_cck_packet_detection_thresh(struct ieee80211_hw *hw) | |||
407 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); | 407 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); |
408 | struct dig_t *dm_digtable = &rtlpriv->dm_digtable; | 408 | struct dig_t *dm_digtable = &rtlpriv->dm_digtable; |
409 | 409 | ||
410 | if (dm_digtable->cursta_connectctate == DIG_STA_CONNECT) { | 410 | if (dm_digtable->cursta_connectstate == DIG_STA_CONNECT) { |
411 | dm_digtable->rssi_val_min = rtl92c_dm_initial_gain_min_pwdb(hw); | 411 | dm_digtable->rssi_val_min = rtl92c_dm_initial_gain_min_pwdb(hw); |
412 | 412 | ||
413 | if (dm_digtable->pre_cck_pd_state == CCK_PD_STAGE_LowRssi) { | 413 | if (dm_digtable->pre_cck_pd_state == CCK_PD_STAGE_LowRssi) { |
@@ -484,15 +484,15 @@ static void rtl92c_dm_ctrl_initgain_by_twoport(struct ieee80211_hw *hw) | |||
484 | return; | 484 | return; |
485 | 485 | ||
486 | if (mac->link_state >= MAC80211_LINKED) | 486 | if (mac->link_state >= MAC80211_LINKED) |
487 | dm_digtable->cursta_connectctate = DIG_STA_CONNECT; | 487 | dm_digtable->cursta_connectstate = DIG_STA_CONNECT; |
488 | else | 488 | else |
489 | dm_digtable->cursta_connectctate = DIG_STA_DISCONNECT; | 489 | dm_digtable->cursta_connectstate = DIG_STA_DISCONNECT; |
490 | 490 | ||
491 | rtl92c_dm_initial_gain_sta(hw); | 491 | rtl92c_dm_initial_gain_sta(hw); |
492 | rtl92c_dm_initial_gain_multi_sta(hw); | 492 | rtl92c_dm_initial_gain_multi_sta(hw); |
493 | rtl92c_dm_cck_packet_detection_thresh(hw); | 493 | rtl92c_dm_cck_packet_detection_thresh(hw); |
494 | 494 | ||
495 | dm_digtable->presta_connectstate = dm_digtable->cursta_connectctate; | 495 | dm_digtable->presta_connectstate = dm_digtable->cursta_connectstate; |
496 | 496 | ||
497 | } | 497 | } |
498 | 498 | ||
@@ -1214,18 +1214,13 @@ static void rtl92c_dm_refresh_rate_adaptive_mask(struct ieee80211_hw *hw) | |||
1214 | "PreState = %d, CurState = %d\n", | 1214 | "PreState = %d, CurState = %d\n", |
1215 | p_ra->pre_ratr_state, p_ra->ratr_state); | 1215 | p_ra->pre_ratr_state, p_ra->ratr_state); |
1216 | 1216 | ||
1217 | /* Only the PCI card uses sta in the update rate table | 1217 | rcu_read_lock(); |
1218 | * callback routine */ | 1218 | sta = ieee80211_find_sta(mac->vif, mac->bssid); |
1219 | if (rtlhal->interface == INTF_PCI) { | ||
1220 | rcu_read_lock(); | ||
1221 | sta = ieee80211_find_sta(mac->vif, mac->bssid); | ||
1222 | } | ||
1223 | rtlpriv->cfg->ops->update_rate_tbl(hw, sta, | 1219 | rtlpriv->cfg->ops->update_rate_tbl(hw, sta, |
1224 | p_ra->ratr_state); | 1220 | p_ra->ratr_state); |
1225 | 1221 | ||
1226 | p_ra->pre_ratr_state = p_ra->ratr_state; | 1222 | p_ra->pre_ratr_state = p_ra->ratr_state; |
1227 | if (rtlhal->interface == INTF_PCI) | 1223 | rcu_read_unlock(); |
1228 | rcu_read_unlock(); | ||
1229 | } | 1224 | } |
1230 | } | 1225 | } |
1231 | } | 1226 | } |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c index 44febfde9493..b627151d06bb 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c +++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c | |||
@@ -577,8 +577,7 @@ static bool _rtl92c_cmd_send_packet(struct ieee80211_hw *hw, | |||
577 | ring = &rtlpci->tx_ring[BEACON_QUEUE]; | 577 | ring = &rtlpci->tx_ring[BEACON_QUEUE]; |
578 | 578 | ||
579 | pskb = __skb_dequeue(&ring->queue); | 579 | pskb = __skb_dequeue(&ring->queue); |
580 | if (pskb) | 580 | kfree_skb(pskb); |
581 | kfree_skb(pskb); | ||
582 | 581 | ||
583 | spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags); | 582 | spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags); |
584 | 583 | ||
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c index bd0da7ef290b..cc895828c0ea 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | |||
@@ -1906,8 +1906,8 @@ static void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw, | |||
1906 | } | 1906 | } |
1907 | RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, | 1907 | RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, |
1908 | "ratr_bitmap :%x\n", ratr_bitmap); | 1908 | "ratr_bitmap :%x\n", ratr_bitmap); |
1909 | *(u32 *)&rate_mask = EF4BYTE((ratr_bitmap & 0x0fffffff) | | 1909 | *(u32 *)&rate_mask = (ratr_bitmap & 0x0fffffff) | |
1910 | (ratr_index << 28)); | 1910 | (ratr_index << 28); |
1911 | rate_mask[4] = macid | (shortgi ? 0x20 : 0x00) | 0x80; | 1911 | rate_mask[4] = macid | (shortgi ? 0x20 : 0x00) | 0x80; |
1912 | RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, | 1912 | RT_TRACE(rtlpriv, COMP_RATR, DBG_DMESG, |
1913 | "Rate_index:%x, ratr_val:%x, %x:%x:%x:%x:%x\n", | 1913 | "Rate_index:%x, ratr_val:%x, %x:%x:%x:%x:%x\n", |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c index 3aa927f8b9b9..60451eea4d82 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | |||
@@ -342,7 +342,7 @@ static struct rtl_hal_cfg rtl92ce_hal_cfg = { | |||
342 | .maps[RTL_RC_HT_RATEMCS15] = DESC92_RATEMCS15, | 342 | .maps[RTL_RC_HT_RATEMCS15] = DESC92_RATEMCS15, |
343 | }; | 343 | }; |
344 | 344 | ||
345 | DEFINE_PCI_DEVICE_TABLE(rtl92ce_pci_ids) = { | 345 | static DEFINE_PCI_DEVICE_TABLE(rtl92ce_pci_ids) = { |
346 | {RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8191, rtl92ce_hal_cfg)}, | 346 | {RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8191, rtl92ce_hal_cfg)}, |
347 | {RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8178, rtl92ce_hal_cfg)}, | 347 | {RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8178, rtl92ce_hal_cfg)}, |
348 | {RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8177, rtl92ce_hal_cfg)}, | 348 | {RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8177, rtl92ce_hal_cfg)}, |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c index 27863d773790..6e66f04c363f 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c | |||
@@ -491,7 +491,7 @@ static void _rtl_tx_desc_checksum(u8 *txdesc) | |||
491 | SET_TX_DESC_TX_DESC_CHECKSUM(txdesc, 0); | 491 | SET_TX_DESC_TX_DESC_CHECKSUM(txdesc, 0); |
492 | for (index = 0; index < 16; index++) | 492 | for (index = 0; index < 16; index++) |
493 | checksum = checksum ^ (*(ptr + index)); | 493 | checksum = checksum ^ (*(ptr + index)); |
494 | SET_TX_DESC_TX_DESC_CHECKSUM(txdesc, cpu_to_le16(checksum)); | 494 | SET_TX_DESC_TX_DESC_CHECKSUM(txdesc, checksum); |
495 | } | 495 | } |
496 | 496 | ||
497 | void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw, | 497 | void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw, |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/dm.c b/drivers/net/wireless/rtlwifi/rtl8192de/dm.c index c0201ed69dd7..ed868c396c25 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/dm.c +++ b/drivers/net/wireless/rtlwifi/rtl8192de/dm.c | |||
@@ -164,7 +164,7 @@ static void rtl92d_dm_diginit(struct ieee80211_hw *hw) | |||
164 | de_digtable->dig_ext_port_stage = DIG_EXT_PORT_STAGE_MAX; | 164 | de_digtable->dig_ext_port_stage = DIG_EXT_PORT_STAGE_MAX; |
165 | de_digtable->cur_igvalue = 0x20; | 165 | de_digtable->cur_igvalue = 0x20; |
166 | de_digtable->pre_igvalue = 0x0; | 166 | de_digtable->pre_igvalue = 0x0; |
167 | de_digtable->cursta_connectctate = DIG_STA_DISCONNECT; | 167 | de_digtable->cursta_connectstate = DIG_STA_DISCONNECT; |
168 | de_digtable->presta_connectstate = DIG_STA_DISCONNECT; | 168 | de_digtable->presta_connectstate = DIG_STA_DISCONNECT; |
169 | de_digtable->curmultista_connectstate = DIG_MULTISTA_DISCONNECT; | 169 | de_digtable->curmultista_connectstate = DIG_MULTISTA_DISCONNECT; |
170 | de_digtable->rssi_lowthresh = DM_DIG_THRESH_LOW; | 170 | de_digtable->rssi_lowthresh = DM_DIG_THRESH_LOW; |
@@ -310,7 +310,7 @@ static void rtl92d_dm_cck_packet_detection_thresh(struct ieee80211_hw *hw) | |||
310 | struct dig_t *de_digtable = &rtlpriv->dm_digtable; | 310 | struct dig_t *de_digtable = &rtlpriv->dm_digtable; |
311 | unsigned long flag = 0; | 311 | unsigned long flag = 0; |
312 | 312 | ||
313 | if (de_digtable->cursta_connectctate == DIG_STA_CONNECT) { | 313 | if (de_digtable->cursta_connectstate == DIG_STA_CONNECT) { |
314 | if (de_digtable->pre_cck_pd_state == CCK_PD_STAGE_LOWRSSI) { | 314 | if (de_digtable->pre_cck_pd_state == CCK_PD_STAGE_LOWRSSI) { |
315 | if (de_digtable->min_undecorated_pwdb_for_dm <= 25) | 315 | if (de_digtable->min_undecorated_pwdb_for_dm <= 25) |
316 | de_digtable->cur_cck_pd_state = | 316 | de_digtable->cur_cck_pd_state = |
@@ -342,7 +342,7 @@ static void rtl92d_dm_cck_packet_detection_thresh(struct ieee80211_hw *hw) | |||
342 | de_digtable->pre_cck_pd_state = de_digtable->cur_cck_pd_state; | 342 | de_digtable->pre_cck_pd_state = de_digtable->cur_cck_pd_state; |
343 | } | 343 | } |
344 | RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "CurSTAConnectState=%s\n", | 344 | RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "CurSTAConnectState=%s\n", |
345 | de_digtable->cursta_connectctate == DIG_STA_CONNECT ? | 345 | de_digtable->cursta_connectstate == DIG_STA_CONNECT ? |
346 | "DIG_STA_CONNECT " : "DIG_STA_DISCONNECT"); | 346 | "DIG_STA_CONNECT " : "DIG_STA_DISCONNECT"); |
347 | RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "CCKPDStage=%s\n", | 347 | RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "CCKPDStage=%s\n", |
348 | de_digtable->cur_cck_pd_state == CCK_PD_STAGE_LOWRSSI ? | 348 | de_digtable->cur_cck_pd_state == CCK_PD_STAGE_LOWRSSI ? |
@@ -428,9 +428,9 @@ static void rtl92d_dm_dig(struct ieee80211_hw *hw) | |||
428 | RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "progress\n"); | 428 | RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "progress\n"); |
429 | /* Decide the current status and if modify initial gain or not */ | 429 | /* Decide the current status and if modify initial gain or not */ |
430 | if (rtlpriv->mac80211.link_state >= MAC80211_LINKED) | 430 | if (rtlpriv->mac80211.link_state >= MAC80211_LINKED) |
431 | de_digtable->cursta_connectctate = DIG_STA_CONNECT; | 431 | de_digtable->cursta_connectstate = DIG_STA_CONNECT; |
432 | else | 432 | else |
433 | de_digtable->cursta_connectctate = DIG_STA_DISCONNECT; | 433 | de_digtable->cursta_connectstate = DIG_STA_DISCONNECT; |
434 | 434 | ||
435 | /* adjust initial gain according to false alarm counter */ | 435 | /* adjust initial gain according to false alarm counter */ |
436 | if (falsealm_cnt->cnt_all < DM_DIG_FA_TH0) | 436 | if (falsealm_cnt->cnt_all < DM_DIG_FA_TH0) |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/fw.c b/drivers/net/wireless/rtlwifi/rtl8192de/fw.c index 895ae6c1f354..a3aede0a72fa 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/fw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192de/fw.c | |||
@@ -570,8 +570,7 @@ static bool _rtl92d_cmd_send_packet(struct ieee80211_hw *hw, | |||
570 | 570 | ||
571 | ring = &rtlpci->tx_ring[BEACON_QUEUE]; | 571 | ring = &rtlpci->tx_ring[BEACON_QUEUE]; |
572 | pskb = __skb_dequeue(&ring->queue); | 572 | pskb = __skb_dequeue(&ring->queue); |
573 | if (pskb) | 573 | kfree_skb(pskb); |
574 | kfree_skb(pskb); | ||
575 | spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags); | 574 | spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags); |
576 | pdesc = &ring->desc[idx]; | 575 | pdesc = &ring->desc[idx]; |
577 | /* discard output from call below */ | 576 | /* discard output from call below */ |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/rtlwifi/rtl8192de/phy.c index 442031256bce..db0086062d05 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/phy.c +++ b/drivers/net/wireless/rtlwifi/rtl8192de/phy.c | |||
@@ -1314,7 +1314,7 @@ static void _rtl92d_phy_restore_rf_env(struct ieee80211_hw *hw, u8 rfpath, | |||
1314 | struct bb_reg_def *pphyreg = &rtlphy->phyreg_def[rfpath]; | 1314 | struct bb_reg_def *pphyreg = &rtlphy->phyreg_def[rfpath]; |
1315 | 1315 | ||
1316 | RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, "=====>\n"); | 1316 | RT_TRACE(rtlpriv, COMP_RF, DBG_LOUD, "=====>\n"); |
1317 | /*----Restore RFENV control type----*/ ; | 1317 | /*----Restore RFENV control type----*/ |
1318 | switch (rfpath) { | 1318 | switch (rfpath) { |
1319 | case RF90_PATH_A: | 1319 | case RF90_PATH_A: |
1320 | case RF90_PATH_C: | 1320 | case RF90_PATH_C: |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c index 28c53fb12aeb..e3cf4c02122a 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c | |||
@@ -756,7 +756,7 @@ void rtl92se_tx_fill_desc(struct ieee80211_hw *hw, | |||
756 | SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16) skb->len); | 756 | SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16) skb->len); |
757 | 757 | ||
758 | /* DOWRD 8 */ | 758 | /* DOWRD 8 */ |
759 | SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, cpu_to_le32(mapping)); | 759 | SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, mapping); |
760 | 760 | ||
761 | RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, "\n"); | 761 | RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE, "\n"); |
762 | } | 762 | } |
@@ -786,7 +786,7 @@ void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc, | |||
786 | /* 92SE need not to set TX packet size when firmware download */ | 786 | /* 92SE need not to set TX packet size when firmware download */ |
787 | SET_TX_DESC_PKT_SIZE(pdesc, (u16)(skb->len)); | 787 | SET_TX_DESC_PKT_SIZE(pdesc, (u16)(skb->len)); |
788 | SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16)(skb->len)); | 788 | SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16)(skb->len)); |
789 | SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, cpu_to_le32(mapping)); | 789 | SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, mapping); |
790 | 790 | ||
791 | wmb(); | 791 | wmb(); |
792 | SET_TX_DESC_OWN(pdesc, 1); | 792 | SET_TX_DESC_OWN(pdesc, 1); |
@@ -805,7 +805,7 @@ void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc, | |||
805 | SET_BITS_TO_LE_4BYTE(skb->data, 24, 7, rtlhal->h2c_txcmd_seq); | 805 | SET_BITS_TO_LE_4BYTE(skb->data, 24, 7, rtlhal->h2c_txcmd_seq); |
806 | 806 | ||
807 | SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16)(skb->len)); | 807 | SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16)(skb->len)); |
808 | SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, cpu_to_le32(mapping)); | 808 | SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, mapping); |
809 | 809 | ||
810 | wmb(); | 810 | wmb(); |
811 | SET_TX_DESC_OWN(pdesc, 1); | 811 | SET_TX_DESC_OWN(pdesc, 1); |
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c index 914046903cfd..030beb45d8b0 100644 --- a/drivers/net/wireless/rtlwifi/usb.c +++ b/drivers/net/wireless/rtlwifi/usb.c | |||
@@ -120,7 +120,7 @@ static int _usbctrl_vendorreq_sync_read(struct usb_device *udev, u8 request, | |||
120 | 120 | ||
121 | if (status < 0 && count++ < 4) | 121 | if (status < 0 && count++ < 4) |
122 | pr_err("reg 0x%x, usbctrl_vendorreq TimeOut! status:0x%x value=0x%x\n", | 122 | pr_err("reg 0x%x, usbctrl_vendorreq TimeOut! status:0x%x value=0x%x\n", |
123 | value, status, le32_to_cpu(*(u32 *)pdata)); | 123 | value, status, *(u32 *)pdata); |
124 | return status; | 124 | return status; |
125 | } | 125 | } |
126 | 126 | ||
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h index 40153e7bf702..f1b6bc693b0a 100644 --- a/drivers/net/wireless/rtlwifi/wifi.h +++ b/drivers/net/wireless/rtlwifi/wifi.h | |||
@@ -135,7 +135,7 @@ enum hardware_type { | |||
135 | HARDWARE_TYPE_RTL8192CU, | 135 | HARDWARE_TYPE_RTL8192CU, |
136 | HARDWARE_TYPE_RTL8192DE, | 136 | HARDWARE_TYPE_RTL8192DE, |
137 | HARDWARE_TYPE_RTL8192DU, | 137 | HARDWARE_TYPE_RTL8192DU, |
138 | HARDWARE_TYPE_RTL8723E, | 138 | HARDWARE_TYPE_RTL8723AE, |
139 | HARDWARE_TYPE_RTL8723U, | 139 | HARDWARE_TYPE_RTL8723U, |
140 | 140 | ||
141 | /* keep it last */ | 141 | /* keep it last */ |
@@ -389,6 +389,7 @@ enum rt_enc_alg { | |||
389 | RSERVED_ENCRYPTION = 3, | 389 | RSERVED_ENCRYPTION = 3, |
390 | AESCCMP_ENCRYPTION = 4, | 390 | AESCCMP_ENCRYPTION = 4, |
391 | WEP104_ENCRYPTION = 5, | 391 | WEP104_ENCRYPTION = 5, |
392 | AESCMAC_ENCRYPTION = 6, /*IEEE802.11w */ | ||
392 | }; | 393 | }; |
393 | 394 | ||
394 | enum rtl_hal_state { | 395 | enum rtl_hal_state { |
@@ -873,6 +874,7 @@ struct rtl_phy { | |||
873 | u32 adda_backup[16]; | 874 | u32 adda_backup[16]; |
874 | u32 iqk_mac_backup[IQK_MAC_REG_NUM]; | 875 | u32 iqk_mac_backup[IQK_MAC_REG_NUM]; |
875 | u32 iqk_bb_backup[10]; | 876 | u32 iqk_bb_backup[10]; |
877 | bool iqk_initialized; | ||
876 | 878 | ||
877 | /* Dual mac */ | 879 | /* Dual mac */ |
878 | bool need_iqk; | 880 | bool need_iqk; |
@@ -910,6 +912,8 @@ struct rtl_phy { | |||
910 | #define RTL_AGG_OPERATIONAL 3 | 912 | #define RTL_AGG_OPERATIONAL 3 |
911 | #define RTL_AGG_OFF 0 | 913 | #define RTL_AGG_OFF 0 |
912 | #define RTL_AGG_ON 1 | 914 | #define RTL_AGG_ON 1 |
915 | #define RTL_RX_AGG_START 1 | ||
916 | #define RTL_RX_AGG_STOP 0 | ||
913 | #define RTL_AGG_EMPTYING_HW_QUEUE_ADDBA 2 | 917 | #define RTL_AGG_EMPTYING_HW_QUEUE_ADDBA 2 |
914 | #define RTL_AGG_EMPTYING_HW_QUEUE_DELBA 3 | 918 | #define RTL_AGG_EMPTYING_HW_QUEUE_DELBA 3 |
915 | 919 | ||
@@ -920,6 +924,7 @@ struct rtl_ht_agg { | |||
920 | u64 bitmap; | 924 | u64 bitmap; |
921 | u32 rate_n_flags; | 925 | u32 rate_n_flags; |
922 | u8 agg_state; | 926 | u8 agg_state; |
927 | u8 rx_agg_state; | ||
923 | }; | 928 | }; |
924 | 929 | ||
925 | struct rtl_tid_data { | 930 | struct rtl_tid_data { |
@@ -927,11 +932,19 @@ struct rtl_tid_data { | |||
927 | struct rtl_ht_agg agg; | 932 | struct rtl_ht_agg agg; |
928 | }; | 933 | }; |
929 | 934 | ||
935 | struct rssi_sta { | ||
936 | long undecorated_smoothed_pwdb; | ||
937 | }; | ||
938 | |||
930 | struct rtl_sta_info { | 939 | struct rtl_sta_info { |
940 | struct list_head list; | ||
931 | u8 ratr_index; | 941 | u8 ratr_index; |
932 | u8 wireless_mode; | 942 | u8 wireless_mode; |
933 | u8 mimo_ps; | 943 | u8 mimo_ps; |
934 | struct rtl_tid_data tids[MAX_TID_COUNT]; | 944 | struct rtl_tid_data tids[MAX_TID_COUNT]; |
945 | |||
946 | /* just used for ap adhoc or mesh*/ | ||
947 | struct rssi_sta rssi_stat; | ||
935 | } __packed; | 948 | } __packed; |
936 | 949 | ||
937 | struct rtl_priv; | 950 | struct rtl_priv; |
@@ -1034,6 +1047,11 @@ struct rtl_mac { | |||
1034 | struct rtl_hal { | 1047 | struct rtl_hal { |
1035 | struct ieee80211_hw *hw; | 1048 | struct ieee80211_hw *hw; |
1036 | 1049 | ||
1050 | bool up_first_time; | ||
1051 | bool first_init; | ||
1052 | bool being_init_adapter; | ||
1053 | bool bbrf_ready; | ||
1054 | |||
1037 | enum intf_type interface; | 1055 | enum intf_type interface; |
1038 | u16 hw_type; /*92c or 92d or 92s and so on */ | 1056 | u16 hw_type; /*92c or 92d or 92s and so on */ |
1039 | u8 ic_class; | 1057 | u8 ic_class; |
@@ -1048,6 +1066,7 @@ struct rtl_hal { | |||
1048 | u16 fw_subversion; | 1066 | u16 fw_subversion; |
1049 | bool h2c_setinprogress; | 1067 | bool h2c_setinprogress; |
1050 | u8 last_hmeboxnum; | 1068 | u8 last_hmeboxnum; |
1069 | bool fw_ready; | ||
1051 | /*Reserve page start offset except beacon in TxQ. */ | 1070 | /*Reserve page start offset except beacon in TxQ. */ |
1052 | u8 fw_rsvdpage_startoffset; | 1071 | u8 fw_rsvdpage_startoffset; |
1053 | u8 h2c_txcmd_seq; | 1072 | u8 h2c_txcmd_seq; |
@@ -1083,6 +1102,8 @@ struct rtl_hal { | |||
1083 | bool load_imrandiqk_setting_for2g; | 1102 | bool load_imrandiqk_setting_for2g; |
1084 | 1103 | ||
1085 | bool disable_amsdu_8k; | 1104 | bool disable_amsdu_8k; |
1105 | bool master_of_dmsp; | ||
1106 | bool slave_of_dmsp; | ||
1086 | }; | 1107 | }; |
1087 | 1108 | ||
1088 | struct rtl_security { | 1109 | struct rtl_security { |
@@ -1144,6 +1165,9 @@ struct rtl_dm { | |||
1144 | bool disable_tx_int; | 1165 | bool disable_tx_int; |
1145 | char ofdm_index[2]; | 1166 | char ofdm_index[2]; |
1146 | char cck_index; | 1167 | char cck_index; |
1168 | |||
1169 | /* DMSP */ | ||
1170 | bool supp_phymode_switch; | ||
1147 | }; | 1171 | }; |
1148 | 1172 | ||
1149 | #define EFUSE_MAX_LOGICAL_SIZE 256 | 1173 | #define EFUSE_MAX_LOGICAL_SIZE 256 |
@@ -1337,6 +1361,10 @@ struct rtl_stats { | |||
1337 | }; | 1361 | }; |
1338 | 1362 | ||
1339 | struct rt_link_detect { | 1363 | struct rt_link_detect { |
1364 | /* count for roaming */ | ||
1365 | u32 bcn_rx_inperiod; | ||
1366 | u32 roam_times; | ||
1367 | |||
1340 | u32 num_tx_in4period[4]; | 1368 | u32 num_tx_in4period[4]; |
1341 | u32 num_rx_in4period[4]; | 1369 | u32 num_rx_in4period[4]; |
1342 | 1370 | ||
@@ -1344,6 +1372,8 @@ struct rt_link_detect { | |||
1344 | u32 num_rx_inperiod; | 1372 | u32 num_rx_inperiod; |
1345 | 1373 | ||
1346 | bool busytraffic; | 1374 | bool busytraffic; |
1375 | bool tx_busy_traffic; | ||
1376 | bool rx_busy_traffic; | ||
1347 | bool higher_busytraffic; | 1377 | bool higher_busytraffic; |
1348 | bool higher_busyrxtraffic; | 1378 | bool higher_busyrxtraffic; |
1349 | 1379 | ||
@@ -1455,7 +1485,12 @@ struct rtl_hal_ops { | |||
1455 | u32 regaddr, u32 bitmask); | 1485 | u32 regaddr, u32 bitmask); |
1456 | void (*set_rfreg) (struct ieee80211_hw *hw, enum radio_path rfpath, | 1486 | void (*set_rfreg) (struct ieee80211_hw *hw, enum radio_path rfpath, |
1457 | u32 regaddr, u32 bitmask, u32 data); | 1487 | u32 regaddr, u32 bitmask, u32 data); |
1488 | void (*allow_all_destaddr)(struct ieee80211_hw *hw, | ||
1489 | bool allow_all_da, bool write_into_reg); | ||
1458 | void (*linked_set_reg) (struct ieee80211_hw *hw); | 1490 | void (*linked_set_reg) (struct ieee80211_hw *hw); |
1491 | void (*check_switch_to_dmdp) (struct ieee80211_hw *hw); | ||
1492 | void (*dualmac_easy_concurrent) (struct ieee80211_hw *hw); | ||
1493 | void (*dualmac_switch_to_dmdp) (struct ieee80211_hw *hw); | ||
1459 | bool (*phy_rf6052_config) (struct ieee80211_hw *hw); | 1494 | bool (*phy_rf6052_config) (struct ieee80211_hw *hw); |
1460 | void (*phy_rf6052_set_cck_txpower) (struct ieee80211_hw *hw, | 1495 | void (*phy_rf6052_set_cck_txpower) (struct ieee80211_hw *hw, |
1461 | u8 *powerlevel); | 1496 | u8 *powerlevel); |
@@ -1475,6 +1510,8 @@ struct rtl_intf_ops { | |||
1475 | void (*read_efuse_byte)(struct ieee80211_hw *hw, u16 _offset, u8 *pbuf); | 1510 | void (*read_efuse_byte)(struct ieee80211_hw *hw, u16 _offset, u8 *pbuf); |
1476 | int (*adapter_start) (struct ieee80211_hw *hw); | 1511 | int (*adapter_start) (struct ieee80211_hw *hw); |
1477 | void (*adapter_stop) (struct ieee80211_hw *hw); | 1512 | void (*adapter_stop) (struct ieee80211_hw *hw); |
1513 | bool (*check_buddy_priv)(struct ieee80211_hw *hw, | ||
1514 | struct rtl_priv **buddy_priv); | ||
1478 | 1515 | ||
1479 | int (*adapter_tx) (struct ieee80211_hw *hw, | 1516 | int (*adapter_tx) (struct ieee80211_hw *hw, |
1480 | struct ieee80211_sta *sta, | 1517 | struct ieee80211_sta *sta, |
@@ -1559,11 +1596,16 @@ struct rtl_locks { | |||
1559 | spinlock_t h2c_lock; | 1596 | spinlock_t h2c_lock; |
1560 | spinlock_t rf_ps_lock; | 1597 | spinlock_t rf_ps_lock; |
1561 | spinlock_t rf_lock; | 1598 | spinlock_t rf_lock; |
1599 | spinlock_t lps_lock; | ||
1562 | spinlock_t waitq_lock; | 1600 | spinlock_t waitq_lock; |
1601 | spinlock_t entry_list_lock; | ||
1563 | spinlock_t usb_lock; | 1602 | spinlock_t usb_lock; |
1564 | 1603 | ||
1565 | /*Dual mac*/ | 1604 | /*Dual mac*/ |
1566 | spinlock_t cck_and_rw_pagea_lock; | 1605 | spinlock_t cck_and_rw_pagea_lock; |
1606 | |||
1607 | /*Easy concurrent*/ | ||
1608 | spinlock_t check_sendpkt_lock; | ||
1567 | }; | 1609 | }; |
1568 | 1610 | ||
1569 | struct rtl_works { | 1611 | struct rtl_works { |
@@ -1571,6 +1613,7 @@ struct rtl_works { | |||
1571 | 1613 | ||
1572 | /*timer */ | 1614 | /*timer */ |
1573 | struct timer_list watchdog_timer; | 1615 | struct timer_list watchdog_timer; |
1616 | struct timer_list dualmac_easyconcurrent_retrytimer; | ||
1574 | 1617 | ||
1575 | /*task */ | 1618 | /*task */ |
1576 | struct tasklet_struct irq_tasklet; | 1619 | struct tasklet_struct irq_tasklet; |
@@ -1598,6 +1641,31 @@ struct rtl_debug { | |||
1598 | char proc_name[20]; | 1641 | char proc_name[20]; |
1599 | }; | 1642 | }; |
1600 | 1643 | ||
1644 | #define MIMO_PS_STATIC 0 | ||
1645 | #define MIMO_PS_DYNAMIC 1 | ||
1646 | #define MIMO_PS_NOLIMIT 3 | ||
1647 | |||
1648 | struct rtl_dualmac_easy_concurrent_ctl { | ||
1649 | enum band_type currentbandtype_backfordmdp; | ||
1650 | bool close_bbandrf_for_dmsp; | ||
1651 | bool change_to_dmdp; | ||
1652 | bool change_to_dmsp; | ||
1653 | bool switch_in_process; | ||
1654 | }; | ||
1655 | |||
1656 | struct rtl_dmsp_ctl { | ||
1657 | bool activescan_for_slaveofdmsp; | ||
1658 | bool scan_for_anothermac_fordmsp; | ||
1659 | bool scan_for_itself_fordmsp; | ||
1660 | bool writedig_for_anothermacofdmsp; | ||
1661 | u32 curdigvalue_for_anothermacofdmsp; | ||
1662 | bool changecckpdstate_for_anothermacofdmsp; | ||
1663 | u8 curcckpdstate_for_anothermacofdmsp; | ||
1664 | bool changetxhighpowerlvl_for_anothermacofdmsp; | ||
1665 | u8 curtxhighlvl_for_anothermacofdmsp; | ||
1666 | long rssivalmin_for_anothermacofdmsp; | ||
1667 | }; | ||
1668 | |||
1601 | struct ps_t { | 1669 | struct ps_t { |
1602 | u8 pre_ccastate; | 1670 | u8 pre_ccastate; |
1603 | u8 cur_ccasate; | 1671 | u8 cur_ccasate; |
@@ -1624,7 +1692,7 @@ struct dig_t { | |||
1624 | u8 dig_twoport_algorithm; | 1692 | u8 dig_twoport_algorithm; |
1625 | u8 dig_dbgmode; | 1693 | u8 dig_dbgmode; |
1626 | u8 dig_slgorithm_switch; | 1694 | u8 dig_slgorithm_switch; |
1627 | u8 cursta_connectctate; | 1695 | u8 cursta_connectstate; |
1628 | u8 presta_connectstate; | 1696 | u8 presta_connectstate; |
1629 | u8 curmultista_connectstate; | 1697 | u8 curmultista_connectstate; |
1630 | char backoff_val; | 1698 | char backoff_val; |
@@ -1657,8 +1725,20 @@ struct dig_t { | |||
1657 | char backoffval_range_min; | 1725 | char backoffval_range_min; |
1658 | }; | 1726 | }; |
1659 | 1727 | ||
1728 | struct rtl_global_var { | ||
1729 | /* from this list we can get | ||
1730 | * other adapter's rtl_priv */ | ||
1731 | struct list_head glb_priv_list; | ||
1732 | spinlock_t glb_list_lock; | ||
1733 | }; | ||
1734 | |||
1660 | struct rtl_priv { | 1735 | struct rtl_priv { |
1661 | struct completion firmware_loading_complete; | 1736 | struct completion firmware_loading_complete; |
1737 | struct list_head list; | ||
1738 | struct rtl_priv *buddy_priv; | ||
1739 | struct rtl_global_var *glb_var; | ||
1740 | struct rtl_dualmac_easy_concurrent_ctl easy_concurrent_ctl; | ||
1741 | struct rtl_dmsp_ctl dmsp_ctl; | ||
1662 | struct rtl_locks locks; | 1742 | struct rtl_locks locks; |
1663 | struct rtl_works works; | 1743 | struct rtl_works works; |
1664 | struct rtl_mac mac80211; | 1744 | struct rtl_mac mac80211; |
@@ -1679,6 +1759,9 @@ struct rtl_priv { | |||
1679 | 1759 | ||
1680 | struct rtl_rate_priv *rate_priv; | 1760 | struct rtl_rate_priv *rate_priv; |
1681 | 1761 | ||
1762 | /* sta entry list for ap adhoc or mesh */ | ||
1763 | struct list_head entry_list; | ||
1764 | |||
1682 | struct rtl_debug dbg; | 1765 | struct rtl_debug dbg; |
1683 | int max_fw_size; | 1766 | int max_fw_size; |
1684 | 1767 | ||
@@ -1820,9 +1903,9 @@ struct bt_coexist_info { | |||
1820 | EF1BYTE(*((u8 *)(_ptr))) | 1903 | EF1BYTE(*((u8 *)(_ptr))) |
1821 | /* Read le16 data from memory and convert to host ordering */ | 1904 | /* Read le16 data from memory and convert to host ordering */ |
1822 | #define READEF2BYTE(_ptr) \ | 1905 | #define READEF2BYTE(_ptr) \ |
1823 | EF2BYTE(*((u16 *)(_ptr))) | 1906 | EF2BYTE(*(_ptr)) |
1824 | #define READEF4BYTE(_ptr) \ | 1907 | #define READEF4BYTE(_ptr) \ |
1825 | EF4BYTE(*((u32 *)(_ptr))) | 1908 | EF4BYTE(*(_ptr)) |
1826 | 1909 | ||
1827 | /* Write data to memory */ | 1910 | /* Write data to memory */ |
1828 | #define WRITEEF1BYTE(_ptr, _val) \ | 1911 | #define WRITEEF1BYTE(_ptr, _val) \ |
@@ -1831,7 +1914,7 @@ struct bt_coexist_info { | |||
1831 | #define WRITEEF2BYTE(_ptr, _val) \ | 1914 | #define WRITEEF2BYTE(_ptr, _val) \ |
1832 | (*((u16 *)(_ptr))) = EF2BYTE(_val) | 1915 | (*((u16 *)(_ptr))) = EF2BYTE(_val) |
1833 | #define WRITEEF4BYTE(_ptr, _val) \ | 1916 | #define WRITEEF4BYTE(_ptr, _val) \ |
1834 | (*((u16 *)(_ptr))) = EF2BYTE(_val) | 1917 | (*((u32 *)(_ptr))) = EF2BYTE(_val) |
1835 | 1918 | ||
1836 | /* Create a bit mask | 1919 | /* Create a bit mask |
1837 | * Examples: | 1920 | * Examples: |
@@ -1864,9 +1947,9 @@ struct bt_coexist_info { | |||
1864 | * 4-byte pointer in little-endian system. | 1947 | * 4-byte pointer in little-endian system. |
1865 | */ | 1948 | */ |
1866 | #define LE_P4BYTE_TO_HOST_4BYTE(__pstart) \ | 1949 | #define LE_P4BYTE_TO_HOST_4BYTE(__pstart) \ |
1867 | (EF4BYTE(*((u32 *)(__pstart)))) | 1950 | (EF4BYTE(*((__le32 *)(__pstart)))) |
1868 | #define LE_P2BYTE_TO_HOST_2BYTE(__pstart) \ | 1951 | #define LE_P2BYTE_TO_HOST_2BYTE(__pstart) \ |
1869 | (EF2BYTE(*((u16 *)(__pstart)))) | 1952 | (EF2BYTE(*((__le16 *)(__pstart)))) |
1870 | #define LE_P1BYTE_TO_HOST_1BYTE(__pstart) \ | 1953 | #define LE_P1BYTE_TO_HOST_1BYTE(__pstart) \ |
1871 | (EF1BYTE(*((u8 *)(__pstart)))) | 1954 | (EF1BYTE(*((u8 *)(__pstart)))) |
1872 | 1955 | ||
@@ -1913,13 +1996,13 @@ value to host byte ordering.*/ | |||
1913 | * Set subfield of little-endian 4-byte value to specified value. | 1996 | * Set subfield of little-endian 4-byte value to specified value. |
1914 | */ | 1997 | */ |
1915 | #define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \ | 1998 | #define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \ |
1916 | *((u32 *)(__pstart)) = EF4BYTE \ | 1999 | *((u32 *)(__pstart)) = \ |
1917 | ( \ | 2000 | ( \ |
1918 | LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) | \ | 2001 | LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) | \ |
1919 | ((((u32)__val) & BIT_LEN_MASK_32(__bitlen)) << (__bitoffset)) \ | 2002 | ((((u32)__val) & BIT_LEN_MASK_32(__bitlen)) << (__bitoffset)) \ |
1920 | ); | 2003 | ); |
1921 | #define SET_BITS_TO_LE_2BYTE(__pstart, __bitoffset, __bitlen, __val) \ | 2004 | #define SET_BITS_TO_LE_2BYTE(__pstart, __bitoffset, __bitlen, __val) \ |
1922 | *((u16 *)(__pstart)) = EF2BYTE \ | 2005 | *((u16 *)(__pstart)) = \ |
1923 | ( \ | 2006 | ( \ |
1924 | LE_BITS_CLEARED_TO_2BYTE(__pstart, __bitoffset, __bitlen) | \ | 2007 | LE_BITS_CLEARED_TO_2BYTE(__pstart, __bitoffset, __bitlen) | \ |
1925 | ((((u16)__val) & BIT_LEN_MASK_16(__bitlen)) << (__bitoffset)) \ | 2008 | ((((u16)__val) & BIT_LEN_MASK_16(__bitlen)) << (__bitoffset)) \ |
@@ -2105,4 +2188,11 @@ static inline struct ieee80211_sta *get_sta(struct ieee80211_hw *hw, | |||
2105 | return ieee80211_find_sta(vif, bssid); | 2188 | return ieee80211_find_sta(vif, bssid); |
2106 | } | 2189 | } |
2107 | 2190 | ||
2191 | static inline struct ieee80211_sta *rtl_find_sta(struct ieee80211_hw *hw, | ||
2192 | u8 *mac_addr) | ||
2193 | { | ||
2194 | struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); | ||
2195 | return ieee80211_find_sta(mac->vif, mac_addr); | ||
2196 | } | ||
2197 | |||
2108 | #endif | 2198 | #endif |
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c index 69042bb9a097..31cf6eba3a9e 100644 --- a/drivers/net/wireless/ti/wl18xx/main.c +++ b/drivers/net/wireless/ti/wl18xx/main.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include "../wlcore/acx.h" | 30 | #include "../wlcore/acx.h" |
31 | #include "../wlcore/tx.h" | 31 | #include "../wlcore/tx.h" |
32 | #include "../wlcore/rx.h" | 32 | #include "../wlcore/rx.h" |
33 | #include "../wlcore/io.h" | ||
34 | #include "../wlcore/boot.h" | 33 | #include "../wlcore/boot.h" |
35 | 34 | ||
36 | #include "reg.h" | 35 | #include "reg.h" |
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c index 00f6e69c1dcd..730186d0449b 100644 --- a/drivers/net/wireless/wl3501_cs.c +++ b/drivers/net/wireless/wl3501_cs.c | |||
@@ -1520,13 +1520,12 @@ static int wl3501_set_wap(struct net_device *dev, struct iw_request_info *info, | |||
1520 | union iwreq_data *wrqu, char *extra) | 1520 | union iwreq_data *wrqu, char *extra) |
1521 | { | 1521 | { |
1522 | struct wl3501_card *this = netdev_priv(dev); | 1522 | struct wl3501_card *this = netdev_priv(dev); |
1523 | static const u8 bcast[ETH_ALEN] = { 255, 255, 255, 255, 255, 255 }; | ||
1524 | int rc = -EINVAL; | 1523 | int rc = -EINVAL; |
1525 | 1524 | ||
1526 | /* FIXME: we support other ARPHRDs...*/ | 1525 | /* FIXME: we support other ARPHRDs...*/ |
1527 | if (wrqu->ap_addr.sa_family != ARPHRD_ETHER) | 1526 | if (wrqu->ap_addr.sa_family != ARPHRD_ETHER) |
1528 | goto out; | 1527 | goto out; |
1529 | if (!memcmp(bcast, wrqu->ap_addr.sa_data, ETH_ALEN)) { | 1528 | if (is_broadcast_ether_addr(wrqu->ap_addr.sa_data)) { |
1530 | /* FIXME: rescan? */ | 1529 | /* FIXME: rescan? */ |
1531 | } else | 1530 | } else |
1532 | memcpy(this->bssid, wrqu->ap_addr.sa_data, ETH_ALEN); | 1531 | memcpy(this->bssid, wrqu->ap_addr.sa_data, ETH_ALEN); |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index 459880104758..114364b5d466 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
@@ -1401,7 +1401,8 @@ struct ieee80211_hw *zd_mac_alloc_hw(struct usb_interface *intf) | |||
1401 | 1401 | ||
1402 | hw->flags = IEEE80211_HW_RX_INCLUDES_FCS | | 1402 | hw->flags = IEEE80211_HW_RX_INCLUDES_FCS | |
1403 | IEEE80211_HW_SIGNAL_UNSPEC | | 1403 | IEEE80211_HW_SIGNAL_UNSPEC | |
1404 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING; | 1404 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | |
1405 | IEEE80211_HW_MFP_CAPABLE; | ||
1405 | 1406 | ||
1406 | hw->wiphy->interface_modes = | 1407 | hw->wiphy->interface_modes = |
1407 | BIT(NL80211_IFTYPE_MESH_POINT) | | 1408 | BIT(NL80211_IFTYPE_MESH_POINT) | |
diff --git a/include/net/bluetooth/smp.h b/include/net/bluetooth/smp.h index 50993a531d45..f8ba07f3e5fa 100644 --- a/include/net/bluetooth/smp.h +++ b/include/net/bluetooth/smp.h | |||
@@ -136,7 +136,7 @@ struct smp_chan { | |||
136 | }; | 136 | }; |
137 | 137 | ||
138 | /* SMP Commands */ | 138 | /* SMP Commands */ |
139 | int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level); | 139 | int smp_conn_security(struct hci_conn *hcon, __u8 sec_level); |
140 | int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb); | 140 | int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb); |
141 | int smp_distribute_keys(struct l2cap_conn *conn, __u8 force); | 141 | int smp_distribute_keys(struct l2cap_conn *conn, __u8 force); |
142 | int smp_user_confirm_reply(struct hci_conn *conn, u16 mgmt_op, __le32 passkey); | 142 | int smp_user_confirm_reply(struct hci_conn *conn, u16 mgmt_op, __le32 passkey); |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 7b3b0568d289..a9a2be78e73c 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -245,6 +245,7 @@ struct ieee80211_sta_vht_cap { | |||
245 | * rates" IE, i.e. CCK rates first, then OFDM. | 245 | * rates" IE, i.e. CCK rates first, then OFDM. |
246 | * @n_bitrates: Number of bitrates in @bitrates | 246 | * @n_bitrates: Number of bitrates in @bitrates |
247 | * @ht_cap: HT capabilities in this band | 247 | * @ht_cap: HT capabilities in this band |
248 | * @vht_cap: VHT capabilities in this band | ||
248 | */ | 249 | */ |
249 | struct ieee80211_supported_band { | 250 | struct ieee80211_supported_band { |
250 | struct ieee80211_channel *channels; | 251 | struct ieee80211_channel *channels; |
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 5ad7da217474..3c094e78dde9 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <net/bluetooth/bluetooth.h> | 29 | #include <net/bluetooth/bluetooth.h> |
30 | #include <net/bluetooth/hci_core.h> | 30 | #include <net/bluetooth/hci_core.h> |
31 | #include <net/bluetooth/a2mp.h> | 31 | #include <net/bluetooth/a2mp.h> |
32 | #include <net/bluetooth/smp.h> | ||
32 | 33 | ||
33 | static void hci_le_connect(struct hci_conn *conn) | 34 | static void hci_le_connect(struct hci_conn *conn) |
34 | { | 35 | { |
@@ -619,6 +620,9 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type) | |||
619 | { | 620 | { |
620 | BT_DBG("hcon %p", conn); | 621 | BT_DBG("hcon %p", conn); |
621 | 622 | ||
623 | if (conn->type == LE_LINK) | ||
624 | return smp_conn_security(conn, sec_level); | ||
625 | |||
622 | /* For sdp we don't need the link key. */ | 626 | /* For sdp we don't need the link key. */ |
623 | if (sec_level == BT_SECURITY_SDP) | 627 | if (sec_level == BT_SECURITY_SDP) |
624 | return 1; | 628 | return 1; |
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index f0a3ab156ec6..e0abaf3cb6a5 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -1216,14 +1216,15 @@ clean: | |||
1216 | static void l2cap_conn_ready(struct l2cap_conn *conn) | 1216 | static void l2cap_conn_ready(struct l2cap_conn *conn) |
1217 | { | 1217 | { |
1218 | struct l2cap_chan *chan; | 1218 | struct l2cap_chan *chan; |
1219 | struct hci_conn *hcon = conn->hcon; | ||
1219 | 1220 | ||
1220 | BT_DBG("conn %p", conn); | 1221 | BT_DBG("conn %p", conn); |
1221 | 1222 | ||
1222 | if (!conn->hcon->out && conn->hcon->type == LE_LINK) | 1223 | if (!hcon->out && hcon->type == LE_LINK) |
1223 | l2cap_le_conn_ready(conn); | 1224 | l2cap_le_conn_ready(conn); |
1224 | 1225 | ||
1225 | if (conn->hcon->out && conn->hcon->type == LE_LINK) | 1226 | if (hcon->out && hcon->type == LE_LINK) |
1226 | smp_conn_security(conn, conn->hcon->pending_sec_level); | 1227 | smp_conn_security(hcon, hcon->pending_sec_level); |
1227 | 1228 | ||
1228 | mutex_lock(&conn->chan_lock); | 1229 | mutex_lock(&conn->chan_lock); |
1229 | 1230 | ||
@@ -1236,8 +1237,8 @@ static void l2cap_conn_ready(struct l2cap_conn *conn) | |||
1236 | continue; | 1237 | continue; |
1237 | } | 1238 | } |
1238 | 1239 | ||
1239 | if (conn->hcon->type == LE_LINK) { | 1240 | if (hcon->type == LE_LINK) { |
1240 | if (smp_conn_security(conn, chan->sec_level)) | 1241 | if (smp_conn_security(hcon, chan->sec_level)) |
1241 | l2cap_chan_ready(chan); | 1242 | l2cap_chan_ready(chan); |
1242 | 1243 | ||
1243 | } else if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED) { | 1244 | } else if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED) { |
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 3a6ce73541d9..083f2bf065d4 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
@@ -620,7 +620,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ch | |||
620 | break; | 620 | break; |
621 | } | 621 | } |
622 | 622 | ||
623 | if (smp_conn_security(conn, sec.level)) | 623 | if (smp_conn_security(conn->hcon, sec.level)) |
624 | break; | 624 | break; |
625 | sk->sk_state = BT_CONFIG; | 625 | sk->sk_state = BT_CONFIG; |
626 | chan->state = BT_CONFIG; | 626 | chan->state = BT_CONFIG; |
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 901a616c8083..8c225ef349cd 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -267,10 +267,10 @@ static void smp_failure(struct l2cap_conn *conn, u8 reason, u8 send) | |||
267 | mgmt_auth_failed(conn->hcon->hdev, conn->dst, hcon->type, | 267 | mgmt_auth_failed(conn->hcon->hdev, conn->dst, hcon->type, |
268 | hcon->dst_type, reason); | 268 | hcon->dst_type, reason); |
269 | 269 | ||
270 | if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags)) { | 270 | cancel_delayed_work_sync(&conn->security_timer); |
271 | cancel_delayed_work_sync(&conn->security_timer); | 271 | |
272 | if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags)) | ||
272 | smp_chan_destroy(conn); | 273 | smp_chan_destroy(conn); |
273 | } | ||
274 | } | 274 | } |
275 | 275 | ||
276 | #define JUST_WORKS 0x00 | 276 | #define JUST_WORKS 0x00 |
@@ -760,9 +760,9 @@ static u8 smp_cmd_security_req(struct l2cap_conn *conn, struct sk_buff *skb) | |||
760 | return 0; | 760 | return 0; |
761 | } | 761 | } |
762 | 762 | ||
763 | int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level) | 763 | int smp_conn_security(struct hci_conn *hcon, __u8 sec_level) |
764 | { | 764 | { |
765 | struct hci_conn *hcon = conn->hcon; | 765 | struct l2cap_conn *conn = hcon->l2cap_data; |
766 | struct smp_chan *smp = conn->smp_chan; | 766 | struct smp_chan *smp = conn->smp_chan; |
767 | __u8 authreq; | 767 | __u8 authreq; |
768 | 768 | ||
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 929f897a8ded..03fe6d1cff42 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -1389,6 +1389,8 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop, | |||
1389 | else | 1389 | else |
1390 | memset(next_hop, 0, ETH_ALEN); | 1390 | memset(next_hop, 0, ETH_ALEN); |
1391 | 1391 | ||
1392 | memset(pinfo, 0, sizeof(*pinfo)); | ||
1393 | |||
1392 | pinfo->generation = mesh_paths_generation; | 1394 | pinfo->generation = mesh_paths_generation; |
1393 | 1395 | ||
1394 | pinfo->filled = MPATH_INFO_FRAME_QLEN | | 1396 | pinfo->filled = MPATH_INFO_FRAME_QLEN | |
@@ -1407,7 +1409,6 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop, | |||
1407 | pinfo->discovery_timeout = | 1409 | pinfo->discovery_timeout = |
1408 | jiffies_to_msecs(mpath->discovery_timeout); | 1410 | jiffies_to_msecs(mpath->discovery_timeout); |
1409 | pinfo->discovery_retries = mpath->discovery_retries; | 1411 | pinfo->discovery_retries = mpath->discovery_retries; |
1410 | pinfo->flags = 0; | ||
1411 | if (mpath->flags & MESH_PATH_ACTIVE) | 1412 | if (mpath->flags & MESH_PATH_ACTIVE) |
1412 | pinfo->flags |= NL80211_MPATH_FLAG_ACTIVE; | 1413 | pinfo->flags |= NL80211_MPATH_FLAG_ACTIVE; |
1413 | if (mpath->flags & MESH_PATH_RESOLVING) | 1414 | if (mpath->flags & MESH_PATH_RESOLVING) |
@@ -1416,10 +1417,8 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop, | |||
1416 | pinfo->flags |= NL80211_MPATH_FLAG_SN_VALID; | 1417 | pinfo->flags |= NL80211_MPATH_FLAG_SN_VALID; |
1417 | if (mpath->flags & MESH_PATH_FIXED) | 1418 | if (mpath->flags & MESH_PATH_FIXED) |
1418 | pinfo->flags |= NL80211_MPATH_FLAG_FIXED; | 1419 | pinfo->flags |= NL80211_MPATH_FLAG_FIXED; |
1419 | if (mpath->flags & MESH_PATH_RESOLVING) | 1420 | if (mpath->flags & MESH_PATH_RESOLVED) |
1420 | pinfo->flags |= NL80211_MPATH_FLAG_RESOLVING; | 1421 | pinfo->flags |= NL80211_MPATH_FLAG_RESOLVED; |
1421 | |||
1422 | pinfo->flags = mpath->flags; | ||
1423 | } | 1422 | } |
1424 | 1423 | ||
1425 | static int ieee80211_get_mpath(struct wiphy *wiphy, struct net_device *dev, | 1424 | static int ieee80211_get_mpath(struct wiphy *wiphy, struct net_device *dev, |
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 59f8adc2aa5f..d747da541747 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -278,13 +278,15 @@ static int ieee80211_check_queues(struct ieee80211_sub_if_data *sdata) | |||
278 | int n_queues = sdata->local->hw.queues; | 278 | int n_queues = sdata->local->hw.queues; |
279 | int i; | 279 | int i; |
280 | 280 | ||
281 | for (i = 0; i < IEEE80211_NUM_ACS; i++) { | 281 | if (sdata->vif.type != NL80211_IFTYPE_P2P_DEVICE) { |
282 | if (WARN_ON_ONCE(sdata->vif.hw_queue[i] == | 282 | for (i = 0; i < IEEE80211_NUM_ACS; i++) { |
283 | IEEE80211_INVAL_HW_QUEUE)) | 283 | if (WARN_ON_ONCE(sdata->vif.hw_queue[i] == |
284 | return -EINVAL; | 284 | IEEE80211_INVAL_HW_QUEUE)) |
285 | if (WARN_ON_ONCE(sdata->vif.hw_queue[i] >= | 285 | return -EINVAL; |
286 | n_queues)) | 286 | if (WARN_ON_ONCE(sdata->vif.hw_queue[i] >= |
287 | return -EINVAL; | 287 | n_queues)) |
288 | return -EINVAL; | ||
289 | } | ||
288 | } | 290 | } |
289 | 291 | ||
290 | if ((sdata->vif.type != NL80211_IFTYPE_AP) || | 292 | if ((sdata->vif.type != NL80211_IFTYPE_AP) || |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index a8cf70bf1cba..5d77650d4363 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -3300,6 +3300,8 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata, | |||
3300 | goto out_unlock; | 3300 | goto out_unlock; |
3301 | 3301 | ||
3302 | err_clear: | 3302 | err_clear: |
3303 | memset(ifmgd->bssid, 0, ETH_ALEN); | ||
3304 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID); | ||
3303 | ifmgd->auth_data = NULL; | 3305 | ifmgd->auth_data = NULL; |
3304 | err_free: | 3306 | err_free: |
3305 | kfree(auth_data); | 3307 | kfree(auth_data); |
@@ -3508,6 +3510,8 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, | |||
3508 | err = 0; | 3510 | err = 0; |
3509 | goto out; | 3511 | goto out; |
3510 | err_clear: | 3512 | err_clear: |
3513 | memset(ifmgd->bssid, 0, ETH_ALEN); | ||
3514 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID); | ||
3511 | ifmgd->assoc_data = NULL; | 3515 | ifmgd->assoc_data = NULL; |
3512 | err_free: | 3516 | err_free: |
3513 | kfree(assoc_data); | 3517 | kfree(assoc_data); |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index b382605c5733..61c621e9273f 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -103,7 +103,7 @@ ieee80211_rx_radiotap_len(struct ieee80211_local *local, | |||
103 | return len; | 103 | return len; |
104 | } | 104 | } |
105 | 105 | ||
106 | /** | 106 | /* |
107 | * ieee80211_add_rx_radiotap_header - add radiotap header | 107 | * ieee80211_add_rx_radiotap_header - add radiotap header |
108 | * | 108 | * |
109 | * add a radiotap header containing all the fields which the hardware provided. | 109 | * add a radiotap header containing all the fields which the hardware provided. |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 34eb5c07a567..139946dc8020 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -5656,8 +5656,10 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info) | |||
5656 | sizeof(connect.ht_capa_mask)); | 5656 | sizeof(connect.ht_capa_mask)); |
5657 | 5657 | ||
5658 | if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) { | 5658 | if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) { |
5659 | if (!info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]) | 5659 | if (!info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]) { |
5660 | kfree(connkeys); | ||
5660 | return -EINVAL; | 5661 | return -EINVAL; |
5662 | } | ||
5661 | memcpy(&connect.ht_capa, | 5663 | memcpy(&connect.ht_capa, |
5662 | nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]), | 5664 | nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]), |
5663 | sizeof(connect.ht_capa)); | 5665 | sizeof(connect.ht_capa)); |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 2ded3c7fad06..1ad04e54014c 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -1949,8 +1949,7 @@ static void restore_regulatory_settings(bool reset_user) | |||
1949 | if (reg_request->initiator != | 1949 | if (reg_request->initiator != |
1950 | NL80211_REGDOM_SET_BY_USER) | 1950 | NL80211_REGDOM_SET_BY_USER) |
1951 | continue; | 1951 | continue; |
1952 | list_del(®_request->list); | 1952 | list_move_tail(®_request->list, &tmp_reg_req_list); |
1953 | list_add_tail(®_request->list, &tmp_reg_req_list); | ||
1954 | } | 1953 | } |
1955 | } | 1954 | } |
1956 | spin_unlock(®_requests_lock); | 1955 | spin_unlock(®_requests_lock); |
@@ -2009,8 +2008,7 @@ static void restore_regulatory_settings(bool reset_user) | |||
2009 | "into the queue\n", | 2008 | "into the queue\n", |
2010 | reg_request->alpha2[0], | 2009 | reg_request->alpha2[0], |
2011 | reg_request->alpha2[1]); | 2010 | reg_request->alpha2[1]); |
2012 | list_del(®_request->list); | 2011 | list_move_tail(®_request->list, ®_requests_list); |
2013 | list_add_tail(®_request->list, ®_requests_list); | ||
2014 | } | 2012 | } |
2015 | spin_unlock(®_requests_lock); | 2013 | spin_unlock(®_requests_lock); |
2016 | 2014 | ||
diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 848523a2b22f..9730c9862bdc 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c | |||
@@ -815,7 +815,7 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy, | |||
815 | return NULL; | 815 | return NULL; |
816 | 816 | ||
817 | if (WARN_ON(wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC && | 817 | if (WARN_ON(wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC && |
818 | (signal < 0 || signal > 100))) | 818 | (signal < 0 || signal > 100))) |
819 | return NULL; | 819 | return NULL; |
820 | 820 | ||
821 | if (WARN_ON(len < offsetof(struct ieee80211_mgmt, u.probe_resp.variable))) | 821 | if (WARN_ON(len < offsetof(struct ieee80211_mgmt, u.probe_resp.variable))) |
diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c index b0eb7aa49b60..c8717c1d082e 100644 --- a/net/wireless/wext-core.c +++ b/net/wireless/wext-core.c | |||
@@ -478,13 +478,13 @@ void wireless_send_event(struct net_device * dev, | |||
478 | if (descr->header_type == IW_HEADER_TYPE_POINT) { | 478 | if (descr->header_type == IW_HEADER_TYPE_POINT) { |
479 | /* Check if number of token fits within bounds */ | 479 | /* Check if number of token fits within bounds */ |
480 | if (wrqu->data.length > descr->max_tokens) { | 480 | if (wrqu->data.length > descr->max_tokens) { |
481 | netdev_err(dev, "(WE) : Wireless Event too big (%d)\n", | 481 | netdev_err(dev, "(WE) : Wireless Event (cmd=0x%04X) too big (%d)\n", |
482 | wrqu->data.length); | 482 | cmd, wrqu->data.length); |
483 | return; | 483 | return; |
484 | } | 484 | } |
485 | if (wrqu->data.length < descr->min_tokens) { | 485 | if (wrqu->data.length < descr->min_tokens) { |
486 | netdev_err(dev, "(WE) : Wireless Event too small (%d)\n", | 486 | netdev_err(dev, "(WE) : Wireless Event (cmd=0x%04X) too small (%d)\n", |
487 | wrqu->data.length); | 487 | cmd, wrqu->data.length); |
488 | return; | 488 | return; |
489 | } | 489 | } |
490 | /* Calculate extra_len - extra is NULL for restricted events */ | 490 | /* Calculate extra_len - extra is NULL for restricted events */ |