18 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
34 for (i = 0; i < max_conn; i++) {
83 static void ath6kl_sta_cleanup(
struct ath6kl *ar,
u8 i)
118 if (is_zero_ether_addr(mac))
121 if (is_broadcast_ether_addr(mac)) {
125 if (!is_zero_ether_addr(ar->
sta_list[i].mac)) {
126 ath6kl_sta_cleanup(ar, i);
134 "deleting station %pM aid=%d reason=%d\n",
136 ath6kl_sta_cleanup(ar, i);
157 if (cookie !=
NULL) {
204 ret = ath6kl_hif_diag_read32(ar, address, value);
206 ath6kl_warn(
"failed to read32 through diagnose window: %d\n",
222 ret = ath6kl_hif_diag_write32(ar, address, value);
225 ath6kl_err(
"failed to write 0x%x during diagnose window to 0x%d\n",
241 for (count = 0; count < length / 4; count++, address += 4) {
259 for (count = 0; count < length / 4; count++, address += 4) {
281 ath6kl_get_hi_item_addr(ar,
289 if (debug_hdr_addr == 0) {
290 ath6kl_warn(
"Invalid address for debug_hdr_addr\n");
313 length =
ALIGN(length, 4);
320 ath6kl_debug_fwlog_event(ar, buf, length);
335 }
while (address != firstbuf);
344 #define AR6003_RESET_CONTROL_ADDRESS 0x00004000
345 #define AR6004_RESET_CONTROL_ADDRESS 0x00004000
348 bool wait_fot_compltn,
bool cold_reset)
361 switch (target_type) {
376 static void ath6kl_install_static_wep_keys(
struct ath6kl_vif *vif)
414 ath6kl_install_static_wep_keys(vif);
425 "Delayed addkey for the initial group key for AP mode\n");
426 memset(key_rsc, 0,
sizeof(key_rsc));
434 "Delayed addkey failed: %d\n", res);
452 u8 keymgmt,
u8 ucipher,
u8 auth,
453 u8 assoc_req_len,
u8 *assoc_info,
u8 apsd_info)
459 ath6kl_dbg(
ATH6KL_DBG_TRC,
"new station %pM aid=%d\n", mac_addr, aid);
466 sizeof(mgmt->u.assoc_req)) {
467 ies = mgmt->u.assoc_req.variable;
468 ies_len = assoc_info + assoc_req_len - ies;
471 +
sizeof(mgmt->u.reassoc_req)) {
472 ies = mgmt->u.reassoc_req.variable;
473 ies_len = assoc_info + assoc_req_len - ies;
478 while (pos && pos + 1 < ies + ies_len) {
479 if (pos + 2 + pos[1] > ies + ies_len)
485 pos[2] == 0x00 && pos[3] == 0x50 && pos[4] == 0xf2) {
488 else if (pos[5] == 0x04) {
492 }
else if (pos[0] == 0x44 && wpa_ie ==
NULL) {
508 ath6kl_add_new_sta(vif, mac_addr, aid, wpa_ie,
509 wpa_ie ? 2 + wpa_ie[1] : 0,
510 keymgmt, ucipher, auth, apsd_info);
513 memset(&sinfo, 0,
sizeof(sinfo));
523 netif_wake_queue(vif->
ndev);
559 "ready event mac addr %pM sw_ver 0x%x abi_ver 0x%x cap 0x%x\n",
560 ar->
mac_addr, sw_ver, abi_ver, cap);
568 sizeof(ar->
wiphy->fw_version),
570 (ar->
version.wlan_ver & 0xf0000000) >> 28,
571 (ar->
version.wlan_ver & 0x0f000000) >> 24,
572 (ar->
version.wlan_ver & 0x00ff0000) >> 16,
573 (ar->
version.wlan_ver & 0x0000ffff));
617 static void ath6kl_check_ch_switch(
struct ath6kl *ar,
u16 channel)
629 res = ath6kl_commit_ch_switch(vif, channel);
632 ath6kl_err(
"channel switch failed nw_type %d res %d\n",
641 u8 assoc_req_len,
u8 assoc_resp_len,
647 listen_int, beacon_int,
648 net_type, beacon_ie_len,
649 assoc_req_len, assoc_resp_len,
658 ath6kl_check_ch_switch(ar, channel);
661 netif_wake_queue(vif->
ndev);
702 "ap tkip mic error received from aid=%d\n", keyid);
704 memset(tsc, 0,
sizeof(tsc));
722 if (len <
sizeof(*tgt_stats))
770 ccmp_stats = &tgt_stats->
stats.tkip_ccmp_stats;
796 a_sle16_to_cpu(tgt_stats->
cserv_stats.cs_ave_beacon_rssi);
808 tgt_stats->
wow_stats.wow_host_pkt_wakeups;
810 tgt_stats->
wow_stats.wow_host_evt_wakeups;
838 if (len <
sizeof(*p))
842 st_ap = &ap->
sta[
ac];
856 ath6kl_update_target_stats(vif, ptr, len);
879 bool psq_empty =
false;
909 mgmt_buf->
id, mgmt_buf->
freq,
933 bool mcastq_empty =
false;
950 mcastq_empty = skb_queue_empty(&ar->
mcastpsq);
976 u8 assoc_resp_len,
u8 *assoc_info,
977 u16 prot_reason_status)
987 if (!ath6kl_remove_sta(ar, bssid, prot_reason_status))
1002 if (!is_broadcast_ether_addr(bssid)) {
1015 assoc_resp_len, assoc_info,
1016 prot_reason_status);
1036 (prot_reason_status == 0x11)) ||
1037 ((reason ==
ASSOC_FAILED) && (prot_reason_status == 0x0) &&
1048 spin_unlock_bh(&vif->
if_lock);
1056 netif_stop_queue(vif->
ndev);
1088 netif_wake_queue(dev);
1095 static int ath6kl_close(
struct net_device *dev)
1099 netif_stop_queue(dev);
1115 static int ath6kl_set_features(
struct net_device *dev,
1129 dev->
features = features & ~NETIF_F_RXCSUM;
1132 }
else if (!(features & NETIF_F_RXCSUM) &&
1151 bool mc_all_on =
false;
1174 vif->
ar->fw_capabilities)) {
1187 mc_all_on ?
"enabling" :
"disabling");
1192 ath6kl_warn(
"Failed to %s multicast-all receive\n",
1193 mc_all_on ?
"enable" :
"disable");
1217 "Removing %pM from multicast filter\n",
1223 ath6kl_warn(
"Failed to remove multicast filter:%pM\n",
1233 INIT_LIST_HEAD(&mc_filter_new);
1257 "Adding %pM to multicast filter list\n",
1263 ath6kl_warn(
"Failed to add multicast filter :%pM\n",
1274 list_splice_tail(&mc_filter_new, &vif->
mc_filter);
1278 .ndo_open = ath6kl_open,
1279 .ndo_stop = ath6kl_close,
1281 .ndo_get_stats = ath6kl_get_stats,
1282 .ndo_set_features = ath6kl_set_features,
1283 .ndo_set_rx_mode = ath6kl_set_multicast_list,
1294 sizeof(struct wmi_data_hdr) + HTC_HDR_LENGTH
1295 + WMI_MAX_TX_META_SZ + ATH6KL_HTC_ALIGN_BYTES;