Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linville' of git://github.com/kvalo/ath6kl

+455 -178
+167 -71
drivers/net/wireless/ath/ath6kl/cfg80211.c
··· 693 693 ie, 2 + vif->ssid_len + beacon_ie_len, 694 694 0, GFP_KERNEL); 695 695 if (bss) 696 - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "added bss %pM to " 697 - "cfg80211\n", bssid); 696 + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, 697 + "added bss %pM to cfg80211\n", bssid); 698 698 kfree(ie); 699 699 } else 700 700 ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "cfg80211 already has a bss\n"); ··· 882 882 vif->sme_state = SME_DISCONNECTED; 883 883 } 884 884 885 + static int ath6kl_set_probed_ssids(struct ath6kl *ar, 886 + struct ath6kl_vif *vif, 887 + struct cfg80211_ssid *ssids, int n_ssids) 888 + { 889 + u8 i; 890 + 891 + if (n_ssids > MAX_PROBED_SSID_INDEX) 892 + return -EINVAL; 893 + 894 + for (i = 0; i < n_ssids; i++) { 895 + ath6kl_wmi_probedssid_cmd(ar->wmi, vif->fw_vif_idx, i, 896 + ssids[i].ssid_len ? 897 + SPECIFIC_SSID_FLAG : ANY_SSID_FLAG, 898 + ssids[i].ssid_len, 899 + ssids[i].ssid); 900 + } 901 + 902 + /* Make sure no old entries are left behind */ 903 + for (i = n_ssids; i < MAX_PROBED_SSID_INDEX; i++) { 904 + ath6kl_wmi_probedssid_cmd(ar->wmi, vif->fw_vif_idx, i, 905 + DISABLE_SSID_FLAG, 0, NULL); 906 + } 907 + 908 + return 0; 909 + } 910 + 885 911 static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev, 886 912 struct cfg80211_scan_request *request) 887 913 { ··· 925 899 926 900 if (!ar->usr_bss_filter) { 927 901 clear_bit(CLEAR_BSSFILTER_ON_BEACON, &vif->flags); 928 - ret = ath6kl_wmi_bssfilter_cmd( 929 - ar->wmi, vif->fw_vif_idx, 930 - (test_bit(CONNECTED, &vif->flags) ? 931 - ALL_BUT_BSS_FILTER : ALL_BSS_FILTER), 0); 902 + ret = ath6kl_wmi_bssfilter_cmd(ar->wmi, vif->fw_vif_idx, 903 + ALL_BSS_FILTER, 0); 932 904 if (ret) { 933 905 ath6kl_err("couldn't set bss filtering\n"); 934 906 return ret; 935 907 } 936 908 } 937 909 938 - if (request->n_ssids && request->ssids[0].ssid_len) { 939 - u8 i; 940 - 941 - if (request->n_ssids > (MAX_PROBED_SSID_INDEX - 1)) 942 - request->n_ssids = MAX_PROBED_SSID_INDEX - 1; 943 - 944 - for (i = 0; i < request->n_ssids; i++) 945 - ath6kl_wmi_probedssid_cmd(ar->wmi, vif->fw_vif_idx, 946 - i + 1, SPECIFIC_SSID_FLAG, 947 - request->ssids[i].ssid_len, 948 - request->ssids[i].ssid); 949 - } 910 + ret = ath6kl_set_probed_ssids(ar, vif, request->ssids, 911 + request->n_ssids); 912 + if (ret < 0) 913 + return ret; 950 914 951 915 /* this also clears IE in fw if it's not set */ 952 916 ret = ath6kl_wmi_set_appie_cmd(ar->wmi, vif->fw_vif_idx, 953 917 WMI_FRAME_PROBE_REQ, 954 918 request->ie, request->ie_len); 955 919 if (ret) { 956 - ath6kl_err("failed to set Probe Request appie for " 957 - "scan"); 920 + ath6kl_err("failed to set Probe Request appie for scan"); 958 921 return ret; 959 922 } 960 923 ··· 960 945 961 946 channels = kzalloc(n_channels * sizeof(u16), GFP_KERNEL); 962 947 if (channels == NULL) { 963 - ath6kl_warn("failed to set scan channels, " 964 - "scan all channels"); 948 + ath6kl_warn("failed to set scan channels, scan all channels"); 965 949 n_channels = 0; 966 950 } 967 951 ··· 1030 1016 out: 1031 1017 cfg80211_scan_done(vif->scan_req, aborted); 1032 1018 vif->scan_req = NULL; 1019 + } 1020 + 1021 + void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq, 1022 + enum wmi_phy_mode mode) 1023 + { 1024 + enum nl80211_channel_type type; 1025 + 1026 + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, 1027 + "channel switch notify nw_type %d freq %d mode %d\n", 1028 + vif->nw_type, freq, mode); 1029 + 1030 + type = (mode == WMI_11G_HT20) ? NL80211_CHAN_HT20 : NL80211_CHAN_NO_HT; 1031 + 1032 + cfg80211_ch_switch_notify(vif->ndev, freq, type); 1033 1033 } 1034 1034 1035 1035 static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, ··· 1139 1111 ar->ap_mode_bkey.key_len = key->key_len; 1140 1112 memcpy(ar->ap_mode_bkey.key, key->key, key->key_len); 1141 1113 if (!test_bit(CONNECTED, &vif->flags)) { 1142 - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "Delay initial group " 1143 - "key configuration until AP mode has been " 1144 - "started\n"); 1114 + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, 1115 + "Delay initial group key configuration until AP mode has been started\n"); 1145 1116 /* 1146 1117 * The key will be set in ath6kl_connect_ap_mode() once 1147 1118 * the connected event is received from the target. ··· 1156 1129 * the AP mode has properly started 1157 1130 * (ath6kl_install_statioc_wep_keys). 1158 1131 */ 1159 - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "Delay WEP key configuration " 1160 - "until AP mode has been started\n"); 1132 + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, 1133 + "Delay WEP key configuration until AP mode has been started\n"); 1161 1134 vif->wep_key_list[key_index].key_len = key->key_len; 1162 1135 memcpy(vif->wep_key_list[key_index].key, key->key, 1163 1136 key->key_len); ··· 1989 1962 sizeof(discvr_pattern), discvr_offset, 1990 1963 discvr_pattern, discvr_mask); 1991 1964 if (ret) { 1992 - ath6kl_err("failed to add WOW mDNS/SSDP/LLMNR " 1993 - "pattern\n"); 1965 + ath6kl_err("failed to add WOW mDNS/SSDP/LLMNR pattern\n"); 1994 1966 return ret; 1995 1967 } 1996 1968 } ··· 2057 2031 u8 index = 0; 2058 2032 __be32 ips[MAX_IP_ADDRS]; 2059 2033 2034 + /* The FW currently can't support multi-vif WoW properly. */ 2035 + if (ar->num_vif > 1) 2036 + return -EIO; 2037 + 2060 2038 vif = ath6kl_vif_first(ar); 2061 2039 if (!vif) 2062 2040 return -EIO; ··· 2073 2043 2074 2044 if (wow && (wow->n_patterns > WOW_MAX_FILTERS_PER_LIST)) 2075 2045 return -EINVAL; 2046 + 2047 + if (!test_bit(NETDEV_MCAST_ALL_ON, &vif->flags)) { 2048 + ret = ath6kl_wmi_mcast_filter_cmd(vif->ar->wmi, 2049 + vif->fw_vif_idx, false); 2050 + if (ret) 2051 + return ret; 2052 + } 2076 2053 2077 2054 /* Clear existing WOW patterns */ 2078 2055 for (i = 0; i < WOW_MAX_FILTERS_PER_LIST; i++) ··· 2184 2147 ret = ath6kl_wmi_set_host_sleep_mode_cmd(ar->wmi, vif->fw_vif_idx, 2185 2148 ATH6KL_HOST_MODE_AWAKE); 2186 2149 if (ret) { 2187 - ath6kl_warn("Failed to configure host sleep mode for " 2188 - "wow resume: %d\n", ret); 2150 + ath6kl_warn("Failed to configure host sleep mode for wow resume: %d\n", 2151 + ret); 2189 2152 ar->state = ATH6KL_STATE_WOW; 2190 2153 return ret; 2191 2154 } ··· 2209 2172 2210 2173 ar->state = ATH6KL_STATE_ON; 2211 2174 2175 + if (!test_bit(NETDEV_MCAST_ALL_OFF, &vif->flags)) { 2176 + ret = ath6kl_wmi_mcast_filter_cmd(vif->ar->wmi, 2177 + vif->fw_vif_idx, true); 2178 + if (ret) 2179 + return ret; 2180 + } 2181 + 2212 2182 netif_wake_queue(vif->ndev); 2213 2183 2214 2184 return 0; ··· 2230 2186 if (!vif) 2231 2187 return -EIO; 2232 2188 2233 - if (!ath6kl_cfg80211_ready(vif)) 2189 + if (!test_bit(WMI_READY, &ar->flag)) { 2190 + ath6kl_err("deepsleep failed as wmi is not ready\n"); 2234 2191 return -EIO; 2192 + } 2235 2193 2236 2194 ath6kl_cfg80211_stop_all(ar); 2237 2195 ··· 2493 2447 band, htcap); 2494 2448 } 2495 2449 2450 + static int ath6kl_restore_htcap(struct ath6kl_vif *vif) 2451 + { 2452 + struct wiphy *wiphy = vif->ar->wiphy; 2453 + int band, ret = 0; 2454 + 2455 + for (band = 0; band < IEEE80211_NUM_BANDS; band++) { 2456 + if (!wiphy->bands[band]) 2457 + continue; 2458 + 2459 + ret = ath6kl_set_htcap(vif, band, 2460 + wiphy->bands[band]->ht_cap.ht_supported); 2461 + if (ret) 2462 + return ret; 2463 + } 2464 + 2465 + return ret; 2466 + } 2467 + 2496 2468 static bool ath6kl_is_p2p_ie(const u8 *pos) 2497 2469 { 2498 2470 return pos[0] == WLAN_EID_VENDOR_SPECIFIC && pos[1] >= 4 && ··· 2632 2568 /* skip element id and length */ 2633 2569 rsn_ie += 2; 2634 2570 2635 - /* skip version, group cipher */ 2636 - if (rsn_ie_len < 6) 2571 + /* skip version */ 2572 + if (rsn_ie_len < 2) 2637 2573 return -EINVAL; 2638 - rsn_ie += 6; 2639 - rsn_ie_len -= 6; 2574 + rsn_ie += 2; 2575 + rsn_ie_len -= 2; 2576 + 2577 + /* skip group cipher suite */ 2578 + if (rsn_ie_len < 4) 2579 + return 0; 2580 + rsn_ie += 4; 2581 + rsn_ie_len -= 4; 2640 2582 2641 2583 /* skip pairwise cipher suite */ 2642 2584 if (rsn_ie_len < 2) 2643 - return -EINVAL; 2644 - cnt = *((u16 *) rsn_ie); 2585 + return 0; 2586 + cnt = get_unaligned_le16(rsn_ie); 2645 2587 rsn_ie += (2 + cnt * 4); 2646 2588 rsn_ie_len -= (2 + cnt * 4); 2647 2589 2648 2590 /* skip akm suite */ 2649 2591 if (rsn_ie_len < 2) 2650 - return -EINVAL; 2651 - cnt = *((u16 *) rsn_ie); 2592 + return 0; 2593 + cnt = get_unaligned_le16(rsn_ie); 2652 2594 rsn_ie += (2 + cnt * 4); 2653 2595 rsn_ie_len -= (2 + cnt * 4); 2654 2596 2655 2597 if (rsn_ie_len < 2) 2656 - return -EINVAL; 2598 + return 0; 2657 2599 2658 2600 memcpy(rsn_capab, rsn_ie, 2); 2659 2601 ··· 2836 2766 return res; 2837 2767 } 2838 2768 2769 + memcpy(&vif->profile, &p, sizeof(p)); 2839 2770 res = ath6kl_wmi_ap_profile_commit(ar->wmi, vif->fw_vif_idx, &p); 2840 2771 if (res < 0) 2841 2772 return res; ··· 2872 2801 clear_bit(CONNECTED, &vif->flags); 2873 2802 2874 2803 /* Restore ht setting in firmware */ 2875 - if (ath6kl_set_htcap(vif, IEEE80211_BAND_2GHZ, true)) 2876 - return -EIO; 2877 - 2878 - if (ath6kl_set_htcap(vif, IEEE80211_BAND_5GHZ, true)) 2879 - return -EIO; 2880 - 2881 - return 0; 2804 + return ath6kl_restore_htcap(vif); 2882 2805 } 2883 2806 2884 2807 static const u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; ··· 3146 3081 struct ath6kl_vif *vif = netdev_priv(dev); 3147 3082 u16 interval; 3148 3083 int ret; 3149 - u8 i; 3150 3084 3151 3085 if (ar->state != ATH6KL_STATE_ON) 3152 3086 return -EIO; ··· 3153 3089 if (vif->sme_state != SME_DISCONNECTED) 3154 3090 return -EBUSY; 3155 3091 3092 + /* The FW currently can't support multi-vif WoW properly. */ 3093 + if (ar->num_vif > 1) 3094 + return -EIO; 3095 + 3156 3096 ath6kl_cfg80211_scan_complete_event(vif, true); 3157 3097 3158 - for (i = 0; i < ar->wiphy->max_sched_scan_ssids; i++) { 3159 - ath6kl_wmi_probedssid_cmd(ar->wmi, vif->fw_vif_idx, 3160 - i, DISABLE_SSID_FLAG, 3161 - 0, NULL); 3162 - } 3098 + ret = ath6kl_set_probed_ssids(ar, vif, request->ssids, 3099 + request->n_ssids); 3100 + if (ret < 0) 3101 + return ret; 3163 3102 3164 3103 /* fw uses seconds, also make sure that it's >0 */ 3165 3104 interval = max_t(u16, 1, request->interval / 1000); 3166 3105 3167 3106 ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, 3168 3107 interval, interval, 3169 - 10, 0, 0, 0, 3, 0, 0, 0); 3170 - 3171 - if (request->n_ssids && request->ssids[0].ssid_len) { 3172 - for (i = 0; i < request->n_ssids; i++) { 3173 - ath6kl_wmi_probedssid_cmd(ar->wmi, vif->fw_vif_idx, 3174 - i, SPECIFIC_SSID_FLAG, 3175 - request->ssids[i].ssid_len, 3176 - request->ssids[i].ssid); 3177 - } 3178 - } 3108 + vif->bg_scan_period, 0, 0, 0, 3, 0, 0, 0); 3179 3109 3180 3110 ret = ath6kl_wmi_set_wow_mode_cmd(ar->wmi, vif->fw_vif_idx, 3181 3111 ATH6KL_WOW_MODE_ENABLE, ··· 3329 3271 ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode; 3330 3272 3331 3273 if (ath6kl_wmi_powermode_cmd(ar->wmi, 0, REC_POWER) != 0) 3332 - ath6kl_warn("ath6kl_deep_sleep_enable: " 3333 - "wmi_powermode_cmd failed\n"); 3274 + ath6kl_warn("ath6kl_deep_sleep_enable: wmi_powermode_cmd failed\n"); 3334 3275 return; 3335 3276 } 3336 3277 ··· 3409 3352 vif->next_mode = nw_type; 3410 3353 vif->listen_intvl_t = ATH6KL_DEFAULT_LISTEN_INTVAL; 3411 3354 vif->bmiss_time_t = ATH6KL_DEFAULT_BMISS_TIME; 3355 + vif->bg_scan_period = 0; 3412 3356 vif->htcap.ht_enable = true; 3413 3357 3414 3358 memcpy(ndev->dev_addr, ar->mac_addr, ETH_ALEN); ··· 3451 3393 int ath6kl_cfg80211_init(struct ath6kl *ar) 3452 3394 { 3453 3395 struct wiphy *wiphy = ar->wiphy; 3396 + bool band_2gig = false, band_5gig = false, ht = false; 3454 3397 int ret; 3455 3398 3456 3399 wiphy->mgmt_stypes = ath6kl_mgmt_stypes; ··· 3472 3413 /* max num of ssids that can be probed during scanning */ 3473 3414 wiphy->max_scan_ssids = MAX_PROBED_SSID_INDEX; 3474 3415 wiphy->max_scan_ie_len = 1000; /* FIX: what is correct limit? */ 3475 - wiphy->bands[IEEE80211_BAND_2GHZ] = &ath6kl_band_2ghz; 3476 - wiphy->bands[IEEE80211_BAND_5GHZ] = &ath6kl_band_5ghz; 3416 + switch (ar->hw.cap) { 3417 + case WMI_11AN_CAP: 3418 + ht = true; 3419 + case WMI_11A_CAP: 3420 + band_5gig = true; 3421 + break; 3422 + case WMI_11GN_CAP: 3423 + ht = true; 3424 + case WMI_11G_CAP: 3425 + band_2gig = true; 3426 + break; 3427 + case WMI_11AGN_CAP: 3428 + ht = true; 3429 + case WMI_11AG_CAP: 3430 + band_2gig = true; 3431 + band_5gig = true; 3432 + break; 3433 + default: 3434 + ath6kl_err("invalid phy capability!\n"); 3435 + return -EINVAL; 3436 + } 3437 + 3438 + /* 3439 + * Even if the fw has HT support, advertise HT cap only when 3440 + * the firmware has support to override RSN capability, otherwise 3441 + * 4-way handshake would fail. 3442 + */ 3443 + if (!(ht && 3444 + test_bit(ATH6KL_FW_CAPABILITY_RSN_CAP_OVERRIDE, 3445 + ar->fw_capabilities))) { 3446 + ath6kl_band_2ghz.ht_cap.cap = 0; 3447 + ath6kl_band_2ghz.ht_cap.ht_supported = false; 3448 + ath6kl_band_5ghz.ht_cap.cap = 0; 3449 + ath6kl_band_5ghz.ht_cap.ht_supported = false; 3450 + } 3451 + if (band_2gig) 3452 + wiphy->bands[IEEE80211_BAND_2GHZ] = &ath6kl_band_2ghz; 3453 + if (band_5gig) 3454 + wiphy->bands[IEEE80211_BAND_5GHZ] = &ath6kl_band_5ghz; 3455 + 3477 3456 wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; 3478 3457 3479 3458 wiphy->cipher_suites = cipher_suites; ··· 3527 3430 wiphy->wowlan.pattern_min_len = 1; 3528 3431 wiphy->wowlan.pattern_max_len = WOW_PATTERN_SIZE; 3529 3432 3530 - wiphy->max_sched_scan_ssids = 10; 3433 + wiphy->max_sched_scan_ssids = MAX_PROBED_SSID_INDEX; 3531 3434 3532 3435 ar->wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM | 3533 3436 WIPHY_FLAG_HAVE_AP_SME | ··· 3544 3447 ar->wiphy->probe_resp_offload = 3545 3448 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS | 3546 3449 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2 | 3547 - NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P | 3548 - NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U; 3450 + NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P; 3549 3451 3550 3452 ret = wiphy_register(wiphy); 3551 3453 if (ret < 0) {
+2
drivers/net/wireless/ath/ath6kl/cfg80211.h
··· 28 28 struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name, 29 29 enum nl80211_iftype type, 30 30 u8 fw_vif_idx, u8 nw_type); 31 + void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq, 32 + enum wmi_phy_mode mode); 31 33 void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, bool aborted); 32 34 33 35 void ath6kl_cfg80211_connect_event(struct ath6kl_vif *vif, u16 channel,
+24 -9
drivers/net/wireless/ath/ath6kl/core.h
··· 126 126 #define AR6003_HW_2_0_FIRMWARE_FILE "athwlan.bin.z77" 127 127 #define AR6003_HW_2_0_TCMD_FIRMWARE_FILE "athtcmd_ram.bin" 128 128 #define AR6003_HW_2_0_PATCH_FILE "data.patch.bin" 129 - #define AR6003_HW_2_0_BOARD_DATA_FILE "ath6k/AR6003/hw2.0/bdata.bin" 129 + #define AR6003_HW_2_0_BOARD_DATA_FILE AR6003_HW_2_0_FW_DIR "/bdata.bin" 130 130 #define AR6003_HW_2_0_DEFAULT_BOARD_DATA_FILE \ 131 - "ath6k/AR6003/hw2.0/bdata.SD31.bin" 131 + AR6003_HW_2_0_FW_DIR "/bdata.SD31.bin" 132 132 133 133 /* AR6003 3.0 definitions */ 134 134 #define AR6003_HW_2_1_1_VERSION 0x30000582 ··· 139 139 #define AR6003_HW_2_1_1_UTF_FIRMWARE_FILE "utf.bin" 140 140 #define AR6003_HW_2_1_1_TESTSCRIPT_FILE "nullTestFlow.bin" 141 141 #define AR6003_HW_2_1_1_PATCH_FILE "data.patch.bin" 142 - #define AR6003_HW_2_1_1_BOARD_DATA_FILE "ath6k/AR6003/hw2.1.1/bdata.bin" 142 + #define AR6003_HW_2_1_1_BOARD_DATA_FILE AR6003_HW_2_1_1_FW_DIR "/bdata.bin" 143 143 #define AR6003_HW_2_1_1_DEFAULT_BOARD_DATA_FILE \ 144 - "ath6k/AR6003/hw2.1.1/bdata.SD31.bin" 144 + AR6003_HW_2_1_1_FW_DIR "/bdata.SD31.bin" 145 145 146 146 /* AR6004 1.0 definitions */ 147 147 #define AR6004_HW_1_0_VERSION 0x30000623 148 148 #define AR6004_HW_1_0_FW_DIR "ath6k/AR6004/hw1.0" 149 149 #define AR6004_HW_1_0_FIRMWARE_FILE "fw.ram.bin" 150 - #define AR6004_HW_1_0_BOARD_DATA_FILE "ath6k/AR6004/hw1.0/bdata.bin" 150 + #define AR6004_HW_1_0_BOARD_DATA_FILE AR6004_HW_1_0_FW_DIR "/bdata.bin" 151 151 #define AR6004_HW_1_0_DEFAULT_BOARD_DATA_FILE \ 152 - "ath6k/AR6004/hw1.0/bdata.DB132.bin" 152 + AR6004_HW_1_0_FW_DIR "/bdata.DB132.bin" 153 153 154 154 /* AR6004 1.1 definitions */ 155 155 #define AR6004_HW_1_1_VERSION 0x30000001 156 156 #define AR6004_HW_1_1_FW_DIR "ath6k/AR6004/hw1.1" 157 157 #define AR6004_HW_1_1_FIRMWARE_FILE "fw.ram.bin" 158 - #define AR6004_HW_1_1_BOARD_DATA_FILE "ath6k/AR6004/hw1.1/bdata.bin" 158 + #define AR6004_HW_1_1_BOARD_DATA_FILE AR6004_HW_1_1_FW_DIR "/bdata.bin" 159 159 #define AR6004_HW_1_1_DEFAULT_BOARD_DATA_FILE \ 160 - "ath6k/AR6004/hw1.1/bdata.DB132.bin" 160 + AR6004_HW_1_1_FW_DIR "/bdata.DB132.bin" 161 + 162 + /* AR6004 1.2 definitions */ 163 + #define AR6004_HW_1_2_VERSION 0x300007e8 164 + #define AR6004_HW_1_2_FW_DIR "ath6k/AR6004/hw1.2" 165 + #define AR6004_HW_1_2_FIRMWARE_FILE "fw.ram.bin" 166 + #define AR6004_HW_1_2_BOARD_DATA_FILE AR6004_HW_1_2_FW_DIR "/bdata.bin" 167 + #define AR6004_HW_1_2_DEFAULT_BOARD_DATA_FILE \ 168 + AR6004_HW_1_2_FW_DIR "/bdata.bin" 161 169 162 170 /* Per STA data, used in AP mode */ 163 171 #define STA_PS_AWAKE BIT(0) ··· 510 502 WLAN_ENABLED, 511 503 STATS_UPDATE_PEND, 512 504 HOST_SLEEP_MODE_CMD_PROCESSED, 505 + NETDEV_MCAST_ALL_ON, 506 + NETDEV_MCAST_ALL_OFF, 513 507 }; 514 508 515 509 struct ath6kl_vif { ··· 559 549 u16 assoc_bss_beacon_int; 560 550 u16 listen_intvl_t; 561 551 u16 bmiss_time_t; 552 + u16 bg_scan_period; 562 553 u8 assoc_bss_dtim_period; 563 554 struct net_device_stats net_stats; 564 555 struct target_stats target_stats; 556 + struct wmi_connect_cmd profile; 565 557 566 558 struct list_head mc_filter; 567 559 }; ··· 652 640 u8 sta_list_index; 653 641 struct ath6kl_req_key ap_mode_bkey; 654 642 struct sk_buff_head mcastpsq; 643 + u32 want_ch_switch; 655 644 656 645 /* 657 646 * FIXME: protects access to mcastpsq but is actually useless as ··· 685 672 u32 refclk_hz; 686 673 u32 uarttx_pin; 687 674 u32 testscript_addr; 675 + enum wmi_phy_cap cap; 688 676 689 677 struct ath6kl_hw_fw { 690 678 const char *dir; ··· 819 805 struct ath6kl_sta *ath6kl_find_sta(struct ath6kl_vif *vif, u8 *node_addr); 820 806 struct ath6kl_sta *ath6kl_find_sta_by_aid(struct ath6kl *ar, u8 aid); 821 807 822 - void ath6kl_ready_event(void *devt, u8 *datap, u32 sw_ver, u32 abi_ver); 808 + void ath6kl_ready_event(void *devt, u8 *datap, u32 sw_ver, u32 abi_ver, 809 + enum wmi_phy_cap cap); 823 810 int ath6kl_control_tx(void *devt, struct sk_buff *skb, 824 811 enum htc_endpoint_id eid); 825 812 void ath6kl_connect_event(struct ath6kl_vif *vif, u16 channel,
+11 -1
drivers/net/wireless/ath/ath6kl/debug.c
··· 401 401 402 402 ret = wait_for_completion_interruptible( 403 403 &ar->debug.fwlog_completion); 404 - if (ret == -ERESTARTSYS) 404 + if (ret == -ERESTARTSYS) { 405 + vfree(buf); 405 406 return ret; 407 + } 406 408 407 409 spin_lock(&ar->debug.fwlog_queue.lock); 408 410 } ··· 1572 1570 size_t count, loff_t *ppos) 1573 1571 { 1574 1572 struct ath6kl *ar = file->private_data; 1573 + struct ath6kl_vif *vif; 1575 1574 u16 bgscan_int; 1576 1575 char buf[32]; 1577 1576 ssize_t len; 1577 + 1578 + vif = ath6kl_vif_first(ar); 1579 + if (!vif) 1580 + return -EIO; 1578 1581 1579 1582 len = min(count, sizeof(buf) - 1); 1580 1583 if (copy_from_user(buf, user_buf, len)) ··· 1591 1584 1592 1585 if (bgscan_int == 0) 1593 1586 bgscan_int = 0xffff; 1587 + 1588 + vif->bg_scan_period = bgscan_int; 1594 1589 1595 1590 ath6kl_wmi_scanparams_cmd(ar->wmi, 0, 0, 0, bgscan_int, 0, 0, 0, 3, 1596 1591 0, 0, 0); ··· 1818 1809 void ath6kl_debug_cleanup(struct ath6kl *ar) 1819 1810 { 1820 1811 skb_queue_purge(&ar->debug.fwlog_queue); 1812 + complete(&ar->debug.fwlog_completion); 1821 1813 kfree(ar->debug.roam_tbl); 1822 1814 } 1823 1815
+28 -17
drivers/net/wireless/ath/ath6kl/htc_mbox.c
··· 83 83 * never goes inactive EVER. 84 84 */ 85 85 cur_ep_dist->dist_flags |= HTC_EP_ACTIVE; 86 - } else if (cur_ep_dist->svc_id == WMI_DATA_BK_SVC) 87 - /* this is the lowest priority data endpoint */ 88 - /* FIXME: this looks fishy, check */ 89 - cred_info->lowestpri_ep_dist = cur_ep_dist->list; 86 + } 90 87 91 88 /* 92 89 * Streams have to be created (explicit | implicit) for all ··· 96 99 * as traffic activity demands 97 100 */ 98 101 } 102 + 103 + /* 104 + * For ath6kl_credit_seek function, 105 + * it use list_for_each_entry_reverse to walk around the whole ep list. 106 + * Therefore assign this lowestpri_ep_dist after walk around the ep_list 107 + */ 108 + cred_info->lowestpri_ep_dist = cur_ep_dist->list; 99 109 100 110 WARN_ON(cred_info->cur_free_credits <= 0); 101 111 ··· 762 758 u32 txb_mask; 763 759 u8 ac = WMM_NUM_AC; 764 760 765 - if ((HTC_CTRL_RSVD_SVC != endpoint->svc_id) || 761 + if ((HTC_CTRL_RSVD_SVC != endpoint->svc_id) && 766 762 (WMI_CONTROL_SVC != endpoint->svc_id)) 767 763 ac = target->dev->ar->ep2ac_map[endpoint->eid]; 768 764 ··· 797 793 * itself 798 794 */ 799 795 txb_mask = ((1 << ac) - 1); 800 - /* 801 - * when the scatter request resources drop below a 802 - * certain threshold, disable Tx bundling for all 803 - * AC's with priority lower than the current requesting 804 - * AC. Otherwise re-enable Tx bundling for them 805 - */ 806 - if (scat_req->scat_q_depth < ATH6KL_SCATTER_REQS) 807 - target->tx_bndl_mask &= ~txb_mask; 808 - else 809 - target->tx_bndl_mask |= txb_mask; 796 + 797 + /* 798 + * when the scatter request resources drop below a 799 + * certain threshold, disable Tx bundling for all 800 + * AC's with priority lower than the current requesting 801 + * AC. Otherwise re-enable Tx bundling for them 802 + */ 803 + if (scat_req->scat_q_depth < ATH6KL_SCATTER_REQS) 804 + target->tx_bndl_mask &= ~txb_mask; 805 + else 806 + target->tx_bndl_mask |= txb_mask; 810 807 } 811 808 812 809 ath6kl_dbg(ATH6KL_DBG_HTC, "htc tx pkts to scatter: %d\n", ··· 854 849 int bundle_sent; 855 850 int n_pkts_bundle; 856 851 u8 ac = WMM_NUM_AC; 852 + int status; 857 853 858 854 spin_lock_bh(&target->tx_lock); 859 855 ··· 872 866 */ 873 867 INIT_LIST_HEAD(&txq); 874 868 875 - if ((HTC_CTRL_RSVD_SVC != endpoint->svc_id) || 869 + if ((HTC_CTRL_RSVD_SVC != endpoint->svc_id) && 876 870 (WMI_CONTROL_SVC != endpoint->svc_id)) 877 871 ac = target->dev->ar->ep2ac_map[endpoint->eid]; 878 872 ··· 916 910 917 911 ath6kl_htc_tx_prep_pkt(packet, packet->info.tx.flags, 918 912 0, packet->info.tx.seqno); 919 - ath6kl_htc_tx_issue(target, packet); 913 + status = ath6kl_htc_tx_issue(target, packet); 914 + 915 + if (status) { 916 + packet->status = status; 917 + packet->completion(packet->context, packet); 918 + } 920 919 } 921 920 922 921 spin_lock_bh(&target->tx_lock);
+3 -8
drivers/net/wireless/ath/ath6kl/htc_pipe.c
··· 108 108 109 109 /* get packet at head, but don't remove it */ 110 110 packet = list_first_entry(&ep->txq, struct htc_packet, list); 111 - if (packet == NULL) 112 - break; 113 111 114 112 ath6kl_dbg(ATH6KL_DBG_HTC, 115 113 "%s: got head packet:0x%p , queue depth: %d\n", ··· 801 803 802 804 /* get first packet to find out which ep the packets will go into */ 803 805 packet = list_first_entry(pkt_queue, struct htc_packet, list); 804 - if (packet == NULL) 805 - return -EINVAL; 806 806 807 807 if (packet->endpoint >= ENDPOINT_MAX) { 808 808 WARN_ON_ONCE(1); ··· 1378 1382 /* copy all the callbacks */ 1379 1383 ep->ep_cb = conn_req->ep_cb; 1380 1384 1385 + /* initialize tx_drop_packet_threshold */ 1386 + ep->tx_drop_packet_threshold = MAX_HI_COOKIE_NUM; 1387 + 1381 1388 status = ath6kl_hif_pipe_map_service(ar, ep->svc_id, 1382 1389 &ep->pipe.pipeid_ul, 1383 1390 &ep->pipe.pipeid_dl); ··· 1635 1636 return -EINVAL; 1636 1637 1637 1638 first = list_first_entry(pkt_queue, struct htc_packet, list); 1638 - if (first == NULL) { 1639 - WARN_ON_ONCE(1); 1640 - return -EINVAL; 1641 - } 1642 1639 1643 1640 if (first->endpoint >= ENDPOINT_MAX) { 1644 1641 WARN_ON_ONCE(1);
+24 -5
drivers/net/wireless/ath/ath6kl/init.c
··· 119 119 .fw_board = AR6004_HW_1_1_BOARD_DATA_FILE, 120 120 .fw_default_board = AR6004_HW_1_1_DEFAULT_BOARD_DATA_FILE, 121 121 }, 122 + { 123 + .id = AR6004_HW_1_2_VERSION, 124 + .name = "ar6004 hw 1.2", 125 + .dataset_patch_addr = 0x436ecc, 126 + .app_load_addr = 0x1234, 127 + .board_ext_data_addr = 0x437000, 128 + .reserved_ram_size = 9216, 129 + .board_addr = 0x435c00, 130 + .refclk_hz = 40000000, 131 + .uarttx_pin = 11, 132 + 133 + .fw = { 134 + .dir = AR6004_HW_1_2_FW_DIR, 135 + .fw = AR6004_HW_1_2_FIRMWARE_FILE, 136 + }, 137 + .fw_board = AR6004_HW_1_2_BOARD_DATA_FILE, 138 + .fw_default_board = AR6004_HW_1_2_DEFAULT_BOARD_DATA_FILE, 139 + }, 122 140 }; 123 141 124 142 /* ··· 463 445 P2P_FLAG_MACADDR_REQ | 464 446 P2P_FLAG_HMODEL_REQ); 465 447 if (ret) { 466 - ath6kl_dbg(ATH6KL_DBG_TRC, "failed to request P2P " 467 - "capabilities (%d) - assuming P2P not " 468 - "supported\n", ret); 448 + ath6kl_dbg(ATH6KL_DBG_TRC, 449 + "failed to request P2P capabilities (%d) - assuming P2P not supported\n", 450 + ret); 469 451 ar->p2p = false; 470 452 } 471 453 } ··· 474 456 /* Enable Probe Request reporting for P2P */ 475 457 ret = ath6kl_wmi_probe_report_req_cmd(ar->wmi, idx, true); 476 458 if (ret) { 477 - ath6kl_dbg(ATH6KL_DBG_TRC, "failed to enable Probe " 478 - "Request reporting (%d)\n", ret); 459 + ath6kl_dbg(ATH6KL_DBG_TRC, 460 + "failed to enable Probe Request reporting (%d)\n", 461 + ret); 479 462 } 480 463 } 481 464
+88 -16
drivers/net/wireless/ath/ath6kl/main.c
··· 421 421 if (!ik->valid) 422 422 break; 423 423 424 - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "Delayed addkey for " 425 - "the initial group key for AP mode\n"); 424 + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, 425 + "Delayed addkey for the initial group key for AP mode\n"); 426 426 memset(key_rsc, 0, sizeof(key_rsc)); 427 427 res = ath6kl_wmi_addkey_cmd( 428 428 ar->wmi, vif->fw_vif_idx, ik->key_index, ik->key_type, ··· 430 430 ik->key, 431 431 KEY_OP_INIT_VAL, NULL, SYNC_BOTH_WMIFLAG); 432 432 if (res) { 433 - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "Delayed " 434 - "addkey failed: %d\n", res); 433 + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, 434 + "Delayed addkey failed: %d\n", res); 435 435 } 436 436 break; 437 + } 438 + 439 + if (ar->want_ch_switch & (1 << vif->fw_vif_idx)) { 440 + ar->want_ch_switch &= ~(1 << vif->fw_vif_idx); 441 + /* we actually don't know the phymode, default to HT20 */ 442 + ath6kl_cfg80211_ch_switch_notify(vif, channel, 443 + WMI_11G_HT20); 437 444 } 438 445 439 446 ath6kl_wmi_bssfilter_cmd(ar->wmi, vif->fw_vif_idx, NONE_BSS_FILTER, 0); ··· 548 541 549 542 /* WMI Event handlers */ 550 543 551 - void ath6kl_ready_event(void *devt, u8 *datap, u32 sw_ver, u32 abi_ver) 544 + void ath6kl_ready_event(void *devt, u8 *datap, u32 sw_ver, u32 abi_ver, 545 + enum wmi_phy_cap cap) 552 546 { 553 547 struct ath6kl *ar = devt; 554 548 ··· 559 551 560 552 ar->version.wlan_ver = sw_ver; 561 553 ar->version.abi_ver = abi_ver; 554 + ar->hw.cap = cap; 562 555 563 556 snprintf(ar->wiphy->fw_version, 564 557 sizeof(ar->wiphy->fw_version), ··· 593 584 ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "scan complete: %d\n", status); 594 585 } 595 586 587 + static int ath6kl_commit_ch_switch(struct ath6kl_vif *vif, u16 channel) 588 + { 589 + 590 + struct ath6kl *ar = vif->ar; 591 + 592 + vif->next_chan = channel; 593 + vif->profile.ch = cpu_to_le16(channel); 594 + 595 + switch (vif->nw_type) { 596 + case AP_NETWORK: 597 + return ath6kl_wmi_ap_profile_commit(ar->wmi, vif->fw_vif_idx, 598 + &vif->profile); 599 + default: 600 + ath6kl_err("won't switch channels nw_type=%d\n", vif->nw_type); 601 + return -ENOTSUPP; 602 + } 603 + } 604 + 605 + static void ath6kl_check_ch_switch(struct ath6kl *ar, u16 channel) 606 + { 607 + 608 + struct ath6kl_vif *vif; 609 + int res = 0; 610 + 611 + if (!ar->want_ch_switch) 612 + return; 613 + 614 + spin_lock_bh(&ar->list_lock); 615 + list_for_each_entry(vif, &ar->vif_list, list) { 616 + if (ar->want_ch_switch & (1 << vif->fw_vif_idx)) 617 + res = ath6kl_commit_ch_switch(vif, channel); 618 + 619 + if (res) 620 + ath6kl_err("channel switch failed nw_type %d res %d\n", 621 + vif->nw_type, res); 622 + } 623 + spin_unlock_bh(&ar->list_lock); 624 + } 625 + 596 626 void ath6kl_connect_event(struct ath6kl_vif *vif, u16 channel, u8 *bssid, 597 627 u16 listen_int, u16 beacon_int, 598 628 enum network_type net_type, u8 beacon_ie_len, ··· 649 601 memcpy(vif->bssid, bssid, sizeof(vif->bssid)); 650 602 vif->bss_ch = channel; 651 603 652 - if ((vif->nw_type == INFRA_NETWORK)) 604 + if ((vif->nw_type == INFRA_NETWORK)) { 653 605 ath6kl_wmi_listeninterval_cmd(ar->wmi, vif->fw_vif_idx, 654 606 vif->listen_intvl_t, 0); 607 + ath6kl_check_ch_switch(ar, channel); 608 + } 655 609 656 610 netif_wake_queue(vif->ndev); 657 611 ··· 976 926 struct ath6kl *ar = vif->ar; 977 927 978 928 if (vif->nw_type == AP_NETWORK) { 929 + /* disconnect due to other STA vif switching channels */ 930 + if (reason == BSS_DISCONNECTED && 931 + prot_reason_status == WMI_AP_REASON_STA_ROAM) 932 + ar->want_ch_switch |= 1 << vif->fw_vif_idx; 933 + 979 934 if (!ath6kl_remove_sta(ar, bssid, prot_reason_status)) 980 935 return; 981 936 ··· 1145 1090 static void ath6kl_set_multicast_list(struct net_device *ndev) 1146 1091 { 1147 1092 struct ath6kl_vif *vif = netdev_priv(ndev); 1148 - bool mc_all_on = false, mc_all_off = false; 1093 + bool mc_all_on = false; 1149 1094 int mc_count = netdev_mc_count(ndev); 1150 1095 struct netdev_hw_addr *ha; 1151 1096 bool found; ··· 1157 1102 !test_bit(WLAN_ENABLED, &vif->flags)) 1158 1103 return; 1159 1104 1105 + /* Enable multicast-all filter. */ 1160 1106 mc_all_on = !!(ndev->flags & IFF_PROMISC) || 1161 1107 !!(ndev->flags & IFF_ALLMULTI) || 1162 1108 !!(mc_count > ATH6K_MAX_MC_FILTERS_PER_LIST); 1163 1109 1164 - mc_all_off = !(ndev->flags & IFF_MULTICAST) || mc_count == 0; 1110 + if (mc_all_on) 1111 + set_bit(NETDEV_MCAST_ALL_ON, &vif->flags); 1112 + else 1113 + clear_bit(NETDEV_MCAST_ALL_ON, &vif->flags); 1165 1114 1166 - if (mc_all_on || mc_all_off) { 1167 - /* Enable/disable all multicast */ 1168 - ath6kl_dbg(ATH6KL_DBG_TRC, "%s multicast filter\n", 1169 - mc_all_on ? "enabling" : "disabling"); 1170 - ret = ath6kl_wmi_mcast_filter_cmd(vif->ar->wmi, vif->fw_vif_idx, 1115 + mc_all_on = mc_all_on || (vif->ar->state == ATH6KL_STATE_ON); 1116 + 1117 + if (!(ndev->flags & IFF_MULTICAST)) { 1118 + mc_all_on = false; 1119 + set_bit(NETDEV_MCAST_ALL_OFF, &vif->flags); 1120 + } else { 1121 + clear_bit(NETDEV_MCAST_ALL_OFF, &vif->flags); 1122 + } 1123 + 1124 + /* Enable/disable "multicast-all" filter*/ 1125 + ath6kl_dbg(ATH6KL_DBG_TRC, "%s multicast-all filter\n", 1126 + mc_all_on ? "enabling" : "disabling"); 1127 + 1128 + ret = ath6kl_wmi_mcast_filter_cmd(vif->ar->wmi, vif->fw_vif_idx, 1171 1129 mc_all_on); 1172 - if (ret) 1173 - ath6kl_warn("Failed to %s multicast receive\n", 1174 - mc_all_on ? "enable" : "disable"); 1130 + if (ret) { 1131 + ath6kl_warn("Failed to %s multicast-all receive\n", 1132 + mc_all_on ? "enable" : "disable"); 1175 1133 return; 1176 1134 } 1177 1135 1136 + if (test_bit(NETDEV_MCAST_ALL_ON, &vif->flags)) 1137 + return; 1138 + 1139 + /* Keep the driver and firmware mcast list in sync. */ 1178 1140 list_for_each_entry_safe(mc_filter, tmp, &vif->mc_filter, list) { 1179 1141 found = false; 1180 1142 netdev_for_each_mc_addr(ha, ndev) {
+11 -6
drivers/net/wireless/ath/ath6kl/sdio.c
··· 552 552 553 553 bus_req = ath6kl_sdio_alloc_busreq(ar_sdio); 554 554 555 - if (!bus_req) 555 + if (WARN_ON_ONCE(!bus_req)) 556 556 return -ENOMEM; 557 557 558 558 bus_req->address = address; ··· 915 915 } 916 916 917 917 cut_pwr: 918 + if (func->card && func->card->host) 919 + func->card->host->pm_flags &= ~MMC_PM_KEEP_POWER; 920 + 918 921 return ath6kl_cfg80211_suspend(ar, ATH6KL_CFG_SUSPEND_CUTPOWER, NULL); 919 922 } 920 923 ··· 988 985 } 989 986 990 987 if (status) { 991 - ath6kl_err("%s: failed to write initial bytes of 0x%x " 992 - "to window reg: 0x%X\n", __func__, 993 - addr, reg_addr); 988 + ath6kl_err("%s: failed to write initial bytes of 0x%x to window reg: 0x%X\n", 989 + __func__, addr, reg_addr); 994 990 return status; 995 991 } 996 992 ··· 1078 1076 (u8 *)&ar->bmi.cmd_credits, 4, 1079 1077 HIF_RD_SYNC_BYTE_INC); 1080 1078 if (ret) { 1081 - ath6kl_err("Unable to decrement the command credit " 1082 - "count register: %d\n", ret); 1079 + ath6kl_err("Unable to decrement the command credit count register: %d\n", 1080 + ret); 1083 1081 return ret; 1084 1082 } 1085 1083 ··· 1459 1457 MODULE_FIRMWARE(AR6004_HW_1_1_FW_DIR "/" AR6004_HW_1_1_FIRMWARE_FILE); 1460 1458 MODULE_FIRMWARE(AR6004_HW_1_1_BOARD_DATA_FILE); 1461 1459 MODULE_FIRMWARE(AR6004_HW_1_1_DEFAULT_BOARD_DATA_FILE); 1460 + MODULE_FIRMWARE(AR6004_HW_1_2_FW_DIR "/" AR6004_HW_1_2_FIRMWARE_FILE); 1461 + MODULE_FIRMWARE(AR6004_HW_1_2_BOARD_DATA_FILE); 1462 + MODULE_FIRMWARE(AR6004_HW_1_2_DEFAULT_BOARD_DATA_FILE);
+4 -8
drivers/net/wireless/ath/ath6kl/txrx.c
··· 362 362 skb, skb->data, skb->len); 363 363 364 364 /* If target is not associated */ 365 - if (!test_bit(CONNECTED, &vif->flags)) { 366 - dev_kfree_skb(skb); 367 - return 0; 368 - } 365 + if (!test_bit(CONNECTED, &vif->flags)) 366 + goto fail_tx; 369 367 370 - if (WARN_ON_ONCE(ar->state != ATH6KL_STATE_ON)) { 371 - dev_kfree_skb(skb); 372 - return 0; 373 - } 368 + if (WARN_ON_ONCE(ar->state != ATH6KL_STATE_ON)) 369 + goto fail_tx; 374 370 375 371 if (!test_bit(WMI_READY, &ar->flag)) 376 372 goto fail_tx;
+12
drivers/net/wireless/ath/ath6kl/usb.c
··· 1037 1037 hif_stop(ar); 1038 1038 } 1039 1039 1040 + static void ath6kl_usb_cleanup_scatter(struct ath6kl *ar) 1041 + { 1042 + /* 1043 + * USB doesn't support it. Just return. 1044 + */ 1045 + return; 1046 + } 1047 + 1040 1048 static const struct ath6kl_hif_ops ath6kl_usb_ops = { 1041 1049 .diag_read32 = ath6kl_usb_diag_read32, 1042 1050 .diag_write32 = ath6kl_usb_diag_write32, ··· 1057 1049 .pipe_get_default = ath6kl_usb_get_default_pipe, 1058 1050 .pipe_map_service = ath6kl_usb_map_service_pipe, 1059 1051 .pipe_get_free_queue_number = ath6kl_usb_get_free_queue_number, 1052 + .cleanup_scatter = ath6kl_usb_cleanup_scatter, 1060 1053 }; 1061 1054 1062 1055 /* ath6kl usb driver registered functions */ ··· 1216 1207 MODULE_FIRMWARE(AR6004_HW_1_1_FIRMWARE_FILE); 1217 1208 MODULE_FIRMWARE(AR6004_HW_1_1_BOARD_DATA_FILE); 1218 1209 MODULE_FIRMWARE(AR6004_HW_1_1_DEFAULT_BOARD_DATA_FILE); 1210 + MODULE_FIRMWARE(AR6004_HW_1_2_FIRMWARE_FILE); 1211 + MODULE_FIRMWARE(AR6004_HW_1_2_BOARD_DATA_FILE); 1212 + MODULE_FIRMWARE(AR6004_HW_1_2_DEFAULT_BOARD_DATA_FILE);
+57 -37
drivers/net/wireless/ath/ath6kl/wmi.c
··· 16 16 */ 17 17 18 18 #include <linux/ip.h> 19 + #include <linux/in.h> 19 20 #include "core.h" 20 21 #include "debug.h" 21 22 #include "testmode.h" ··· 290 289 layer2_priority); 291 290 } else 292 291 usr_pri = layer2_priority & 0x7; 292 + 293 + /* 294 + * Queue the EAPOL frames in the same WMM_AC_VO queue 295 + * as that of management frames. 296 + */ 297 + if (skb->protocol == cpu_to_be16(ETH_P_PAE)) 298 + usr_pri = WMI_VOICE_USER_PRIORITY; 293 299 } 294 300 295 301 /* ··· 468 460 freq, dur); 469 461 chan = ieee80211_get_channel(ar->wiphy, freq); 470 462 if (!chan) { 471 - ath6kl_dbg(ATH6KL_DBG_WMI, "remain_on_chnl: Unknown channel " 472 - "(freq=%u)\n", freq); 463 + ath6kl_dbg(ATH6KL_DBG_WMI, 464 + "remain_on_chnl: Unknown channel (freq=%u)\n", 465 + freq); 473 466 return -EINVAL; 474 467 } 475 468 id = vif->last_roc_id; ··· 497 488 ev = (struct wmi_cancel_remain_on_chnl_event *) datap; 498 489 freq = le32_to_cpu(ev->freq); 499 490 dur = le32_to_cpu(ev->duration); 500 - ath6kl_dbg(ATH6KL_DBG_WMI, "cancel_remain_on_chnl: freq=%u dur=%u " 501 - "status=%u\n", freq, dur, ev->status); 491 + ath6kl_dbg(ATH6KL_DBG_WMI, 492 + "cancel_remain_on_chnl: freq=%u dur=%u status=%u\n", 493 + freq, dur, ev->status); 502 494 chan = ieee80211_get_channel(ar->wiphy, freq); 503 495 if (!chan) { 504 - ath6kl_dbg(ATH6KL_DBG_WMI, "cancel_remain_on_chnl: Unknown " 505 - "channel (freq=%u)\n", freq); 496 + ath6kl_dbg(ATH6KL_DBG_WMI, 497 + "cancel_remain_on_chnl: Unknown channel (freq=%u)\n", 498 + freq); 506 499 return -EINVAL; 507 500 } 508 501 if (vif->last_cancel_roc_id && ··· 559 548 freq = le32_to_cpu(ev->freq); 560 549 dlen = le16_to_cpu(ev->len); 561 550 if (datap + len < ev->data + dlen) { 562 - ath6kl_err("invalid wmi_p2p_rx_probe_req_event: " 563 - "len=%d dlen=%u\n", len, dlen); 551 + ath6kl_err("invalid wmi_p2p_rx_probe_req_event: len=%d dlen=%u\n", 552 + len, dlen); 564 553 return -EINVAL; 565 554 } 566 - ath6kl_dbg(ATH6KL_DBG_WMI, "rx_probe_req: len=%u freq=%u " 567 - "probe_req_report=%d\n", 555 + ath6kl_dbg(ATH6KL_DBG_WMI, 556 + "rx_probe_req: len=%u freq=%u probe_req_report=%d\n", 568 557 dlen, freq, vif->probe_req_report); 569 558 570 559 if (vif->probe_req_report || vif->nw_type == AP_NETWORK) ··· 603 592 freq = le32_to_cpu(ev->freq); 604 593 dlen = le16_to_cpu(ev->len); 605 594 if (datap + len < ev->data + dlen) { 606 - ath6kl_err("invalid wmi_rx_action_event: " 607 - "len=%d dlen=%u\n", len, dlen); 595 + ath6kl_err("invalid wmi_rx_action_event: len=%d dlen=%u\n", 596 + len, dlen); 608 597 return -EINVAL; 609 598 } 610 599 ath6kl_dbg(ATH6KL_DBG_WMI, "rx_action: len=%u freq=%u\n", dlen, freq); ··· 698 687 699 688 ath6kl_ready_event(wmi->parent_dev, ev->mac_addr, 700 689 le32_to_cpu(ev->sw_version), 701 - le32_to_cpu(ev->abi_version)); 690 + le32_to_cpu(ev->abi_version), ev->phy_cap); 702 691 703 692 return 0; 704 693 } ··· 788 777 /* AP mode start/STA connected event */ 789 778 struct net_device *dev = vif->ndev; 790 779 if (memcmp(dev->dev_addr, ev->u.ap_bss.bssid, ETH_ALEN) == 0) { 791 - ath6kl_dbg(ATH6KL_DBG_WMI, "%s: freq %d bssid %pM " 792 - "(AP started)\n", 780 + ath6kl_dbg(ATH6KL_DBG_WMI, 781 + "%s: freq %d bssid %pM (AP started)\n", 793 782 __func__, le16_to_cpu(ev->u.ap_bss.ch), 794 783 ev->u.ap_bss.bssid); 795 784 ath6kl_connect_ap_mode_bss( 796 785 vif, le16_to_cpu(ev->u.ap_bss.ch)); 797 786 } else { 798 - ath6kl_dbg(ATH6KL_DBG_WMI, "%s: aid %u mac_addr %pM " 799 - "auth=%u keymgmt=%u cipher=%u apsd_info=%u " 800 - "(STA connected)\n", 787 + ath6kl_dbg(ATH6KL_DBG_WMI, 788 + "%s: aid %u mac_addr %pM auth=%u keymgmt=%u cipher=%u apsd_info=%u (STA connected)\n", 801 789 __func__, ev->u.ap_sta.aid, 802 790 ev->u.ap_sta.mac_addr, 803 791 ev->u.ap_sta.auth, ··· 1239 1229 ev = (struct wmi_neighbor_report_event *) datap; 1240 1230 if (sizeof(*ev) + ev->num_neighbors * sizeof(struct wmi_neighbor_info) 1241 1231 > len) { 1242 - ath6kl_dbg(ATH6KL_DBG_WMI, "truncated neighbor event " 1243 - "(num=%d len=%d)\n", ev->num_neighbors, len); 1232 + ath6kl_dbg(ATH6KL_DBG_WMI, 1233 + "truncated neighbor event (num=%d len=%d)\n", 1234 + ev->num_neighbors, len); 1244 1235 return -EINVAL; 1245 1236 } 1246 1237 for (i = 0; i < ev->num_neighbors; i++) { ··· 1825 1814 u32 home_dwell_time, u32 force_scan_interval, 1826 1815 s8 num_chan, u16 *ch_list, u32 no_cck, u32 *rates) 1827 1816 { 1817 + struct ieee80211_supported_band *sband; 1828 1818 struct sk_buff *skb; 1829 1819 struct wmi_begin_scan_cmd *sc; 1830 - s8 size; 1820 + s8 size, *supp_rates; 1831 1821 int i, band, ret; 1832 1822 struct ath6kl *ar = wmi->parent_dev; 1833 1823 int num_rates; 1824 + u32 ratemask; 1834 1825 1835 1826 size = sizeof(struct wmi_begin_scan_cmd); 1836 1827 ··· 1859 1846 sc->num_ch = num_chan; 1860 1847 1861 1848 for (band = 0; band < IEEE80211_NUM_BANDS; band++) { 1862 - struct ieee80211_supported_band *sband = 1863 - ar->wiphy->bands[band]; 1864 - u32 ratemask = rates[band]; 1865 - u8 *supp_rates = sc->supp_rates[band].rates; 1849 + sband = ar->wiphy->bands[band]; 1850 + 1851 + if (!sband) 1852 + continue; 1853 + 1854 + ratemask = rates[band]; 1855 + supp_rates = sc->supp_rates[band].rates; 1866 1856 num_rates = 0; 1867 1857 1868 1858 for (i = 0; i < sband->n_bitrates; i++) { ··· 2145 2129 struct wmi_add_cipher_key_cmd *cmd; 2146 2130 int ret; 2147 2131 2148 - ath6kl_dbg(ATH6KL_DBG_WMI, "addkey cmd: key_index=%u key_type=%d " 2149 - "key_usage=%d key_len=%d key_op_ctrl=%d\n", 2132 + ath6kl_dbg(ATH6KL_DBG_WMI, 2133 + "addkey cmd: key_index=%u key_type=%d key_usage=%d key_len=%d key_op_ctrl=%d\n", 2150 2134 key_index, key_type, key_usage, key_len, key_op_ctrl); 2151 2135 2152 2136 if ((key_index > WMI_MAX_KEY_INDEX) || (key_len > WMI_MAX_KEY_LEN) || ··· 3063 3047 3064 3048 res = ath6kl_wmi_cmd_send(wmip, if_idx, skb, WMI_AP_CONFIG_COMMIT_CMDID, 3065 3049 NO_SYNC_WMIFLAG); 3066 - ath6kl_dbg(ATH6KL_DBG_WMI, "%s: nw_type=%u auth_mode=%u ch=%u " 3067 - "ctrl_flags=0x%x-> res=%d\n", 3050 + ath6kl_dbg(ATH6KL_DBG_WMI, 3051 + "%s: nw_type=%u auth_mode=%u ch=%u ctrl_flags=0x%x-> res=%d\n", 3068 3052 __func__, p->nw_type, p->auth_mode, le16_to_cpu(p->ch), 3069 3053 le32_to_cpu(p->ctrl_flags), res); 3070 3054 return res; ··· 3224 3208 if (!skb) 3225 3209 return -ENOMEM; 3226 3210 3227 - ath6kl_dbg(ATH6KL_DBG_WMI, "set_appie_cmd: mgmt_frm_type=%u " 3228 - "ie_len=%u\n", mgmt_frm_type, ie_len); 3211 + ath6kl_dbg(ATH6KL_DBG_WMI, 3212 + "set_appie_cmd: mgmt_frm_type=%u ie_len=%u\n", 3213 + mgmt_frm_type, ie_len); 3229 3214 p = (struct wmi_set_appie_cmd *) skb->data; 3230 3215 p->mgmt_frm_type = mgmt_frm_type; 3231 3216 p->ie_len = ie_len; ··· 3327 3310 wmi->last_mgmt_tx_frame = buf; 3328 3311 wmi->last_mgmt_tx_frame_len = data_len; 3329 3312 3330 - ath6kl_dbg(ATH6KL_DBG_WMI, "send_action_cmd: id=%u freq=%u wait=%u " 3331 - "len=%u\n", id, freq, wait, data_len); 3313 + ath6kl_dbg(ATH6KL_DBG_WMI, 3314 + "send_action_cmd: id=%u freq=%u wait=%u len=%u\n", 3315 + id, freq, wait, data_len); 3332 3316 p = (struct wmi_send_action_cmd *) skb->data; 3333 3317 p->id = cpu_to_le32(id); 3334 3318 p->freq = cpu_to_le32(freq); ··· 3366 3348 wmi->last_mgmt_tx_frame = buf; 3367 3349 wmi->last_mgmt_tx_frame_len = data_len; 3368 3350 3369 - ath6kl_dbg(ATH6KL_DBG_WMI, "send_action_cmd: id=%u freq=%u wait=%u " 3370 - "len=%u\n", id, freq, wait, data_len); 3351 + ath6kl_dbg(ATH6KL_DBG_WMI, 3352 + "send_action_cmd: id=%u freq=%u wait=%u len=%u\n", 3353 + id, freq, wait, data_len); 3371 3354 p = (struct wmi_send_mgmt_cmd *) skb->data; 3372 3355 p->id = cpu_to_le32(id); 3373 3356 p->freq = cpu_to_le32(freq); ··· 3421 3402 if (!skb) 3422 3403 return -ENOMEM; 3423 3404 3424 - ath6kl_dbg(ATH6KL_DBG_WMI, "send_probe_response_cmd: freq=%u dst=%pM " 3425 - "len=%u\n", freq, dst, data_len); 3405 + ath6kl_dbg(ATH6KL_DBG_WMI, 3406 + "send_probe_response_cmd: freq=%u dst=%pM len=%u\n", 3407 + freq, dst, data_len); 3426 3408 p = (struct wmi_p2p_probe_response_cmd *) skb->data; 3427 3409 p->freq = cpu_to_le32(freq); 3428 3410 memcpy(p->destination_addr, dst, ETH_ALEN);
+24
drivers/net/wireless/ath/ath6kl/wmi.h
··· 106 106 #define WMM_AC_VI 2 /* video */ 107 107 #define WMM_AC_VO 3 /* voice */ 108 108 109 + #define WMI_VOICE_USER_PRIORITY 0x7 110 + 109 111 struct wmi { 110 112 u16 stream_exist_for_ac[WMM_NUM_AC]; 111 113 u8 fat_pipe_exist; ··· 1153 1151 WMI_11AG_MODE = 0x3, 1154 1152 WMI_11B_MODE = 0x4, 1155 1153 WMI_11GONLY_MODE = 0x5, 1154 + WMI_11G_HT20 = 0x6, 1156 1155 }; 1157 1156 1158 1157 #define WMI_MAX_CHANNELS 32 ··· 1419 1416 u8 phy_cap; 1420 1417 } __packed; 1421 1418 1419 + /* WMI_PHY_CAPABILITY */ 1420 + enum wmi_phy_cap { 1421 + WMI_11A_CAP = 0x01, 1422 + WMI_11G_CAP = 0x02, 1423 + WMI_11AG_CAP = 0x03, 1424 + WMI_11AN_CAP = 0x04, 1425 + WMI_11GN_CAP = 0x05, 1426 + WMI_11AGN_CAP = 0x06, 1427 + }; 1428 + 1422 1429 /* Connect Event */ 1423 1430 struct wmi_connect_event { 1424 1431 union { ··· 1479 1466 PROFILE_MISMATCH = 0x0c, 1480 1467 CONNECTION_EVICTED = 0x0d, 1481 1468 IBSS_MERGE = 0xe, 1469 + }; 1470 + 1471 + /* AP mode disconnect proto_reasons */ 1472 + enum ap_disconnect_reason { 1473 + WMI_AP_REASON_STA_LEFT = 101, 1474 + WMI_AP_REASON_FROM_HOST = 102, 1475 + WMI_AP_REASON_COMM_TIMEOUT = 103, 1476 + WMI_AP_REASON_MAX_STA = 104, 1477 + WMI_AP_REASON_ACL = 105, 1478 + WMI_AP_REASON_STA_ROAM = 106, 1479 + WMI_AP_REASON_DFS_CHANNEL = 107, 1482 1480 }; 1483 1481 1484 1482 #define ATH6KL_COUNTRY_RD_SHIFT 16