24 #include "../regd_common.h"
26 static int ath6kl_wmi_sync_point(
struct wmi *
wmi,
u8 if_idx);
28 static const s32 wmi_rate_tbl[][2] = {
62 static const u8 up_to_ac[] = {
123 if (skb_headroom(skb) < size)
131 "%s: pkt is already in 802.3 format\n", __func__);
135 new_len = skb->
len -
sizeof(*eth_hdr) +
sizeof(*llc_hdr);
142 memcpy(datap, eth_hdr,
sizeof(*eth_hdr));
145 llc_hdr->dsap = 0xAA;
146 llc_hdr->ssap = 0xAA;
147 llc_hdr->cntl = 0x03;
148 llc_hdr->org_code[0] = 0x0;
149 llc_hdr->org_code[1] = 0x0;
150 llc_hdr->org_code[2] = 0x0;
151 llc_hdr->eth_type =
type;
187 u8 meta_ver,
void *tx_meta_info,
u8 if_idx)
196 ret = ath6kl_wmi_meta_add(wmi, skb, &meta_ver, tx_meta_info);
234 ip_pri = ip_hdr->
tos >> 5;
237 if ((layer2_pri & 0x7) > ip_pri)
238 return (
u8) layer2_pri & 0x7;
245 return up_to_ac[user_priority & 0x7];
250 u32 layer2_priority,
bool wmm_enabled,
258 u8 stream_exist, usr_pri;
275 hdr_size =
sizeof(
struct ethhdr);
292 usr_pri = layer2_priority & 0x7;
309 ((usr_pri == 5) || (usr_pri == 4)))
313 traffic_class = up_to_ac[usr_pri & 0x7];
315 wmi_data_hdr_set_up(data_hdr, usr_pri);
317 spin_lock_bh(&wmi->
lock);
319 spin_unlock_bh(&wmi->
lock);
321 if (!(stream_exist & (1 << traffic_class))) {
322 memset(&cmd, 0,
sizeof(cmd));
367 memset(ð_hdr, 0,
sizeof(eth_hdr));
393 memcpy(datap, ð_hdr,
sizeof(eth_hdr));
413 memcpy(ð_hdr, datap,
sizeof(eth_hdr));
421 memcpy(datap, ð_hdr,
sizeof(eth_hdr));
426 static int ath6kl_wmi_tx_complete_event_rx(
u8 *datap,
int len)
438 for (index = 0; index < evt->
num_msg; index++) {
451 static int ath6kl_wmi_remain_on_chnl_event_rx(
struct wmi *wmi,
u8 *datap,
461 if (len <
sizeof(*ev))
469 chan = ieee80211_get_channel(ar->
wiphy, freq);
472 "remain_on_chnl: Unknown channel (freq=%u)\n",
483 static int ath6kl_wmi_cancel_remain_on_chnl_event_rx(
struct wmi *wmi,
494 if (len <
sizeof(*ev))
501 "cancel_remain_on_chnl: freq=%u dur=%u status=%u\n",
503 chan = ieee80211_get_channel(ar->
wiphy, freq);
506 "cancel_remain_on_chnl: Unknown channel (freq=%u)\n",
522 static int ath6kl_wmi_tx_status_event_rx(
struct wmi *wmi,
u8 *datap,
int len,
528 if (len <
sizeof(*ev))
548 static int ath6kl_wmi_rx_probe_req_event_rx(
struct wmi *wmi,
u8 *datap,
int len,
555 if (len <
sizeof(*ev))
561 if (datap + len < ev->
data + dlen) {
562 ath6kl_err(
"invalid wmi_p2p_rx_probe_req_event: len=%d dlen=%u\n",
567 "rx_probe_req: len=%u freq=%u probe_req_report=%d\n",
577 static int ath6kl_wmi_p2p_capabilities_event_rx(
u8 *datap,
int len)
582 if (len <
sizeof(*ev))
592 static int ath6kl_wmi_rx_action_event_rx(
struct wmi *wmi,
u8 *datap,
int len,
599 if (len <
sizeof(*ev))
605 if (datap + len < ev->
data + dlen) {
606 ath6kl_err(
"invalid wmi_rx_action_event: len=%d dlen=%u\n",
610 ath6kl_dbg(
ATH6KL_DBG_WMI,
"rx_action: len=%u freq=%u\n", dlen, freq);
617 static int ath6kl_wmi_p2p_info_event_rx(
u8 *datap,
int len)
623 if (len <
sizeof(*ev))
629 ath6kl_dbg(
ATH6KL_DBG_WMI,
"p2p_info: flags=%x len=%d\n", flags, dlen);
633 if (dlen <
sizeof(*cap))
642 if (dlen <
sizeof(*mac))
651 if (dlen <
sizeof(*mod))
661 static inline struct sk_buff *ath6kl_wmi_get_new_buf(
u32 size)
677 static int ath6kl_wmi_simple_cmd(
struct wmi *wmi,
u8 if_idx,
683 skb = ath6kl_wmi_get_new_buf(0);
692 static int ath6kl_wmi_ready_event_rx(
struct wmi *wmi,
u8 *datap,
int len)
717 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
724 cmd->
info.
params.lrssi_scan_threshold = a_cpu_to_sle16(lrssi +
726 cmd->
info.
params.lrssi_roam_threshold = a_cpu_to_sle16(lrssi);
741 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
760 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
776 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
790 static int ath6kl_wmi_connect_event_rx(
struct wmi *wmi,
u8 *datap,
int len,
806 "%s: freq %d bssid %pM (AP started)\n",
813 "%s: aid %u mac_addr %pM auth=%u keymgmt=%u cipher=%u apsd_info=%u (STA connected)\n",
835 "wmi event connect freq %d bssid %pM listen_intvl %d beacon_intvl %d type %d\n",
852 if (pie[1] > 3 && pie[2] == 0x00 && pie[3] == 0x50 &&
884 for (i = 0; i <
ARRAY_SIZE(allCountries); i++) {
885 if (allCountries[i].countryCode == countryCode)
886 return &allCountries[
i];
893 ath6kl_get_regpair(
u16 regdmn)
900 for (i = 0; i <
ARRAY_SIZE(regDomainPairs); i++) {
902 return ®DomainPairs[
i];
909 ath6kl_regd_find_country_by_rd(
u16 regdmn)
913 for (i = 0; i <
ARRAY_SIZE(allCountries); i++) {
915 return &allCountries[
i];
921 static void ath6kl_wmi_regdomain_event(
struct wmi *wmi,
u8 *datap,
int len)
934 country = ath6kl_regd_find_country((
u16) reg_code);
937 regpair = ath6kl_get_regpair((
u16) reg_code);
938 country = ath6kl_regd_find_country_by_rd((
u16) reg_code);
943 if (country && wmi->
parent_dev->wiphy_registered) {
944 alpha2[0] = country->
isoName[0];
945 alpha2[1] = country->
isoName[1];
950 alpha2[0], alpha2[1]);
954 static int ath6kl_wmi_disconnect_event_rx(
struct wmi *wmi,
u8 *datap,
int len,
966 "wmi event disconnect proto_reason %d bssid %pM wmi_reason %d assoc_resp_len %d\n",
979 static int ath6kl_wmi_peer_node_event_rx(
struct wmi *wmi,
u8 *datap,
int len)
998 static int ath6kl_wmi_tkip_micerr_event_rx(
struct wmi *wmi,
u8 *datap,
int len,
1020 static int ath6kl_wmi_bssinfo_event_rx(
struct wmi *wmi,
u8 *datap,
int len,
1038 "bss info evt - ch %u, snr %d, rssi %d, bssid \"%pM\" "
1055 if (channel ==
NULL)
1058 if (len < 8 + 2 + 2)
1067 if (tim && tim[1] >= 2) {
1100 memcpy(&mgmt->
u.beacon, buf, len);
1103 24 + len, (bih->
snr - 95) * 100,
1129 static int ath6kl_wmi_pstream_timeout_event_rx(
struct wmi *wmi,
u8 *datap,
1145 spin_lock_bh(&wmi->
lock);
1148 spin_unlock_bh(&wmi->
lock);
1156 static int ath6kl_wmi_bitrate_reply_rx(
struct wmi *wmi,
u8 *datap,
int len)
1174 rate = wmi_rate_tbl[
index][sgi];
1182 static int ath6kl_wmi_test_rx(
struct wmi *wmi,
u8 *datap,
int len)
1189 static int ath6kl_wmi_ratemask_reply_rx(
struct wmi *wmi,
u8 *datap,
int len)
1199 static int ath6kl_wmi_ch_list_reply_rx(
struct wmi *wmi,
u8 *datap,
int len)
1209 static int ath6kl_wmi_tx_pwr_reply_rx(
struct wmi *wmi,
u8 *datap,
int len)
1222 static int ath6kl_wmi_keepalive_reply_rx(
struct wmi *wmi,
u8 *datap,
int len)
1232 static int ath6kl_wmi_scan_complete_rx(
struct wmi *wmi,
u8 *datap,
int len,
1245 static int ath6kl_wmi_neighbor_report_event_rx(
struct wmi *wmi,
u8 *datap,
1251 if (len <
sizeof(*ev))
1257 "truncated neighbor event (num=%d len=%d)\n",
1282 static int ath6kl_wmi_error_event_rx(
struct wmi *wmi,
u8 *datap,
int len)
1284 const char *
type =
"unknown error";
1290 type =
"invalid parameter";
1293 type =
"invalid state";
1296 type =
"internal error";
1306 static int ath6kl_wmi_stats_event_rx(
struct wmi *wmi,
u8 *datap,
int len,
1314 static u8 ath6kl_wmi_get_upper_threshold(
s16 rssi,
1322 for (index = 0; index <
size; index++) {
1323 if (rssi < sq_thresh->upper_threshold[index]) {
1332 static u8 ath6kl_wmi_get_lower_threshold(
s16 rssi,
1340 for (index = 0; index <
size; index++) {
1350 static int ath6kl_wmi_send_rssi_threshold_params(
struct wmi *wmi,
1356 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
1367 static int ath6kl_wmi_rssi_threshold_event_rx(
struct wmi *wmi,
u8 *datap,
1374 u8 upper_rssi_threshold, lower_rssi_threshold;
1383 rssi = a_sle16_to_cpu(reply->
rssi);
1392 if (new_threshold) {
1394 if (rssi < sq_thresh->upper_threshold[0]) {
1396 "spurious upper rssi threshold event: %d\n",
1398 }
else if ((rssi < sq_thresh->upper_threshold[1]) &&
1401 }
else if ((rssi < sq_thresh->upper_threshold[2]) &&
1404 }
else if ((rssi < sq_thresh->upper_threshold[3]) &&
1407 }
else if ((rssi < sq_thresh->upper_threshold[4]) &&
1410 }
else if ((rssi < sq_thresh->upper_threshold[5]) &&
1420 "spurious lower rssi threshold event: %d %d\n",
1423 (rssi <= sq_thresh->lower_threshold[0])) {
1426 (rssi <= sq_thresh->lower_threshold[1])) {
1429 (rssi <= sq_thresh->lower_threshold[2])) {
1432 (rssi <= sq_thresh->lower_threshold[3])) {
1435 (rssi <= sq_thresh->lower_threshold[4])) {
1437 }
else if (rssi <= sq_thresh->lower_threshold[5]) {
1443 lower_rssi_threshold = ath6kl_wmi_get_lower_threshold(rssi, sq_thresh,
1445 upper_rssi_threshold = ath6kl_wmi_get_upper_threshold(rssi, sq_thresh,
1454 ret = ath6kl_wmi_send_rssi_threshold_params(wmi, &cmd);
1456 ath6kl_err(
"unable to configure rssi thresholds\n");
1463 static int ath6kl_wmi_cac_event_rx(
struct wmi *wmi,
u8 *datap,
int len,
1492 spin_lock_bh(&wmi->
lock);
1494 spin_unlock_bh(&wmi->
lock);
1496 for (index = 0; index <
sizeof(active_tsids) * 8; index++) {
1497 if ((active_tsids >> index) & 1)
1500 if (index < (
sizeof(active_tsids) * 8))
1516 spin_lock_bh(&wmi->
lock);
1519 spin_unlock_bh(&wmi->
lock);
1524 if (!active_tsids) {
1534 static int ath6kl_wmi_send_snr_threshold_params(
struct wmi *wmi,
1540 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
1551 static int ath6kl_wmi_snr_threshold_event_rx(
struct wmi *wmi,
u8 *datap,
1558 u8 upper_snr_threshold, lower_snr_threshold;
1577 if (new_threshold) {
1579 if (snr < sq_thresh->upper_threshold[0]) {
1581 "spurious upper snr threshold event: %d\n",
1583 }
else if ((snr < sq_thresh->upper_threshold[1]) &&
1586 }
else if ((snr < sq_thresh->upper_threshold[2]) &&
1589 }
else if ((snr < sq_thresh->upper_threshold[3]) &&
1599 "spurious lower snr threshold event: %d\n",
1602 (snr <= sq_thresh->lower_threshold[0])) {
1605 (snr <= sq_thresh->lower_threshold[1])) {
1608 (snr <= sq_thresh->lower_threshold[2])) {
1610 }
else if (snr <= sq_thresh->lower_threshold[3]) {
1616 lower_snr_threshold = ath6kl_wmi_get_lower_threshold(snr, sq_thresh,
1618 upper_snr_threshold = ath6kl_wmi_get_upper_threshold(snr, sq_thresh,
1628 "snr: %d, threshold: %d, lower: %d, upper: %d\n",
1630 lower_snr_threshold, upper_snr_threshold);
1632 ret = ath6kl_wmi_send_snr_threshold_params(wmi, &cmd);
1634 ath6kl_err(
"unable to configure snr threshold\n");
1641 static int ath6kl_wmi_aplist_event_rx(
struct wmi *wmi,
u8 *datap,
int len)
1643 u16 ap_info_entry_size;
1656 "number of APs in aplist event: %d\n", ev->
num_ap);
1659 (ev->
num_ap - 1) * ap_info_entry_size))
1663 for (index = 0; index < ev->
num_ap; index++) {
1684 cmd_id, skb->
len, sync_flag);
1699 ath6kl_wmi_sync_point(wmi, if_idx);
1712 false,
false, 0,
NULL, if_idx);
1728 ath6kl_wmi_sync_point(wmi, if_idx);
1739 u8 pairwise_crypto_len,
1741 u8 group_crypto_len,
int ssid_len,
u8 *
ssid,
1750 "wmi connect bssid %pM freq %d flags 0x%x ssid_len %d "
1751 "type %d dot11_auth %d auth %d pairwise %d group %d\n",
1752 bssid, channel, ctrl_flags, ssid_len, nw_type,
1753 dot11_auth_mode, auth_mode, pairwise_crypto, group_crypto);
1839 u32 home_dwell_time,
u32 force_scan_interval,
1860 size +=
sizeof(
u16) * (num_chan - 1);
1862 skb = ath6kl_wmi_get_new_buf(size);
1876 sband = ar->
wiphy->bands[band];
1881 ratemask = rates[band];
1886 if ((
BIT(i) & ratemask) == 0)
1888 supp_rates[num_rates++] =
1927 size +=
sizeof(
u16) * (num_chan - 1);
1929 skb = ath6kl_wmi_get_new_buf(size);
1952 u16 fg_end_sec,
u16 bg_sec,
1953 u16 minact_chdw_msec,
u16 maxact_chdw_msec,
1954 u16 pas_chdw_msec,
u8 short_scan_ratio,
1955 u8 scan_ctrl_flag,
u32 max_dfsch_act_time,
1956 u16 maxact_scan_per_ssid)
1962 skb = ath6kl_wmi_get_new_buf(
sizeof(*sc));
1992 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
2015 if (ssid_len >
sizeof(cmd->
ssid))
2024 if (flag & SPECIFIC_SSID_FLAG)
2027 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
2050 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
2070 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
2089 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
2103 u16 ps_poll_num,
u16 dtim_policy,
2104 u16 tx_wakeup_policy,
u16 num_tx_to_wakeup,
2105 u16 ps_fail_event_policy)
2111 skb = ath6kl_wmi_get_new_buf(
sizeof(*pm));
2134 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
2145 ath6kl_debug_set_disconnect_timeout(wmi->
parent_dev, timeout);
2153 u8 *key_rsc,
unsigned int key_rsc_len,
2163 "addkey cmd: key_index=%u key_type=%d key_usage=%d key_len=%d key_op_ctrl=%d\n",
2164 key_index, key_type, key_usage, key_len, key_op_ctrl);
2167 (key_material ==
NULL) || key_rsc_len > 8)
2173 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
2182 memcpy(cmd->
key, key_material, key_len);
2184 if (key_rsc !=
NULL)
2204 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
2226 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
2249 if (
set && pmkid ==
NULL)
2252 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
2272 static int ath6kl_wmi_data_sync_send(
struct wmi *wmi,
struct sk_buff *skb,
2292 static int ath6kl_wmi_sync_point(
struct wmi *wmi,
u8 if_idx)
2298 u8 index, num_pri_streams = 0;
2301 memset(data_sync_bufs, 0,
sizeof(data_sync_bufs));
2303 spin_lock_bh(&wmi->
lock);
2305 for (index = 0; index <
WMM_NUM_AC; index++) {
2308 data_sync_bufs[num_pri_streams - 1].traffic_class =
2313 spin_unlock_bh(&wmi->
lock);
2315 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
2329 for (index = 0; index < num_pri_streams; index++) {
2331 if (data_sync_bufs[index].skb ==
NULL) {
2357 for (index = 0; index < num_pri_streams; index++) {
2359 if (
WARN_ON(!data_sync_bufs[index].skb))
2363 data_sync_bufs[index].
2366 ath6kl_wmi_data_sync_send(wmi, data_sync_bufs[index].skb,
2380 for (index = 0; index < num_pri_streams; index++) {
2381 if (data_sync_bufs[index].skb !=
NULL) {
2382 dev_kfree_skb((
struct sk_buff *)data_sync_bufs[index].
2395 u8 fatpipe_exist_for_ac = 0;
2429 "TSRS IE enabled::MinPhy %x->NominalPhy ===> %x\n",
2430 min_phy, nominal_phy);
2437 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
2442 "sending create_pstream_cmd: ac=%d tsid:%d\n",
2446 memcpy(cmd, params,
sizeof(*cmd));
2450 spin_lock_bh(&wmi->
lock);
2454 spin_unlock_bh(&wmi->
lock);
2457 spin_lock_bh(&wmi->
lock);
2461 (1 << params->
tsid);
2467 spin_unlock_bh(&wmi->
lock);
2475 if (!fatpipe_exist_for_ac)
2489 u16 active_tsids = 0;
2492 if (traffic_class > 3) {
2493 ath6kl_err(
"invalid traffic class: %d\n", traffic_class);
2497 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
2505 spin_lock_bh(&wmi->
lock);
2507 spin_unlock_bh(&wmi->
lock);
2509 if (!(active_tsids & (1 << tsid))) {
2512 "TSID %d doesn't exist for traffic class: %d\n",
2513 tsid, traffic_class);
2518 "sending delete_pstream_cmd: traffic class: %d tsid=%d\n",
2519 traffic_class, tsid);
2524 spin_lock_bh(&wmi->
lock);
2527 spin_unlock_bh(&wmi->
lock);
2533 if (!active_tsids) {
2535 traffic_class,
false);
2550 if (ipv4_is_multicast(ips0) ||
2551 ipv4_is_multicast(ips1))
2567 static void ath6kl_wmi_relinquish_implicit_pstream_credits(
struct wmi *wmi)
2579 spin_lock_bh(&wmi->
lock);
2581 spin_unlock_bh(&wmi->
lock);
2584 if (stream_exist & (1 << i)) {
2590 spin_lock_bh(&wmi->
lock);
2592 spin_unlock_bh(&wmi->
lock);
2598 if (!active_tsids) {
2599 stream_exist &= ~(1 <<
i);
2611 spin_lock_bh(&wmi->
lock);
2613 spin_unlock_bh(&wmi->
lock);
2616 static int ath6kl_set_bitrate_mask64(
struct wmi *wmi,
u8 if_idx,
2624 memset(&ratemask, 0,
sizeof(ratemask));
2627 ratemask[band] = mask->
control[band].legacy;
2630 mask->
control[band].legacy << 4;
2633 mcsrate = mask->
control[band].mcs[1];
2635 mcsrate |= mask->
control[band].mcs[0];
2636 ratemask[band] |= mcsrate << 12;
2637 ratemask[band] |= mcsrate << 28;
2641 "Ratemask 64 bit: 2.4:%llx 5:%llx\n",
2642 ratemask[0], ratemask[1]);
2666 static int ath6kl_set_bitrate_mask32(
struct wmi *wmi,
u8 if_idx,
2674 memset(&ratemask, 0,
sizeof(ratemask));
2677 ratemask[band] = mask->
control[band].legacy;
2680 mask->
control[band].legacy << 4;
2683 mcsrate = mask->
control[band].mcs[0];
2684 ratemask[band] |= mcsrate << 12;
2685 ratemask[band] |= mcsrate << 20;
2689 "Ratemask 32 bit: 2.4:%x 5:%x\n",
2690 ratemask[0], ratemask[1]);
2692 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd) * WMI_RATES_MODE_MAX);
2720 return ath6kl_set_bitrate_mask64(wmi, if_idx, mask);
2722 return ath6kl_set_bitrate_mask32(wmi, if_idx, mask);
2734 ath6kl_err(
"invalid host sleep mode: %d\n", host_mode);
2738 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
2745 ath6kl_wmi_relinquish_implicit_pstream_credits(wmi);
2757 static int ath6kl_wmi_host_sleep_mode_cmd_prcd_evt_rx(
struct wmi *wmi,
2778 ath6kl_err(
"invalid wow mode: %d\n", wow_mode);
2782 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
2797 u8 list_id,
u8 filter_size,
2813 skb = ath6kl_wmi_get_new_buf(size);
2824 filter_mask = (
u8 *) (cmd->
filter + filter_size);
2825 memcpy(filter_mask, mask, filter_size);
2834 u16 list_id,
u16 filter_id)
2840 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
2853 static int ath6kl_wmi_cmd_send_xtnd(
struct wmi *wmi,
struct sk_buff *skb,
2876 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
2895 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
3002 u8 keep_alive_intvl)
3008 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
3019 ath6kl_debug_set_keepalive(wmi->
parent_dev, keep_alive_intvl);
3031 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
3053 "Set htcap: band:%d ht_enable:%d 40mhz:%d sgi_20mhz:%d sgi_40mhz:%d 40mhz_intolerant:%d ampdu_len_exp:%d\n",
3066 skb = ath6kl_wmi_get_new_buf(len);
3083 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
3102 if ((filter[0] != 0x33 || filter[1] != 0x33) &&
3103 (filter[0] != 0x01 || filter[1] != 0x00 ||
3104 filter[2] != 0x5e || filter[3] > 0x7f)) {
3105 ath6kl_warn(
"invalid multicast filter address\n");
3109 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
3129 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
3134 cmd->
enable = enhance ? 1 : 0;
3147 return wmi_rate_tbl[(
u32) rate_index][0];
3150 static int ath6kl_wmi_get_pmkid_list_event_rx(
struct wmi *wmi,
u8 *datap,
3160 expected_len =
sizeof(reply->
num_pmkid) +
3163 if (len < expected_len)
3169 static int ath6kl_wmi_addba_req_event_rx(
struct wmi *wmi,
u8 *datap,
int len,
3180 static int ath6kl_wmi_delba_req_event_rx(
struct wmi *wmi,
u8 *datap,
int len,
3199 skb = ath6kl_wmi_get_new_buf(
sizeof(*cm));
3204 memcpy(cm, p,
sizeof(*cm));
3209 "%s: nw_type=%u auth_mode=%u ch=%u ctrl_flags=0x%x-> res=%d\n",
3221 skb = ath6kl_wmi_get_new_buf(
sizeof(*cm));
3242 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
3259 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
3276 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
3290 static int ath6kl_wmi_pspoll_event_rx(
struct wmi *wmi,
u8 *datap,
int len,
3305 static int ath6kl_wmi_dtimexpiry_event_rx(
struct wmi *wmi,
u8 *datap,
int len,
3337 bool rx_dot11_hdr,
bool defrag_on_host)
3343 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
3365 skb = ath6kl_wmi_get_new_buf(
sizeof(*p) + ie_len);
3370 "set_appie_cmd: mgmt_frm_type=%u ie_len=%u\n",
3371 mgmt_frm_type, ie_len);
3376 if (ie !=
NULL && ie_len > 0)
3389 skb = ath6kl_wmi_get_new_buf(
sizeof(*p) + ie_len);
3393 ath6kl_dbg(
ATH6KL_DBG_WMI,
"set_ie_cmd: ie_id=%u ie_ie_field=%u ie_len=%u\n",
3394 ie_id, ie_field, ie_len);
3399 if (ie_info && ie_len > 0)
3411 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
3415 ath6kl_dbg(
ATH6KL_DBG_WMI,
"disable_11b_rates_cmd: disable=%u\n",
3418 cmd->
disable = disable ? 1 : 0;
3429 skb = ath6kl_wmi_get_new_buf(
sizeof(*p));
3433 ath6kl_dbg(
ATH6KL_DBG_WMI,
"remain_on_chnl_cmd: freq=%u dur=%u\n",
3446 static int ath6kl_wmi_send_action_cmd(
struct wmi *wmi,
u8 if_idx,
u32 id,
3461 skb = ath6kl_wmi_get_new_buf(
sizeof(*p) + data_len);
3468 memcpy(buf, data, data_len);
3473 "send_action_cmd: id=%u freq=%u wait=%u len=%u\n",
3474 id, freq, wait, data_len);
3485 static int __ath6kl_wmi_send_mgmt_cmd(
struct wmi *wmi,
u8 if_idx,
u32 id,
3486 u32 freq,
u32 wait,
const u8 *data,
3487 u16 data_len,
u32 no_cck)
3500 skb = ath6kl_wmi_get_new_buf(
sizeof(*p) + data_len);
3507 memcpy(buf, data, data_len);
3512 "send_action_cmd: id=%u freq=%u wait=%u len=%u\n",
3513 id, freq, wait, data_len);
3526 u32 wait,
const u8 *data,
u16 data_len,
3540 status = __ath6kl_wmi_send_mgmt_cmd(ar->
wmi, if_idx,
id, freq,
3541 wait, data, data_len,
3544 status = ath6kl_wmi_send_action_cmd(ar->
wmi, if_idx,
id, freq,
3545 wait, data, data_len);
3552 const u8 *
dst,
const u8 *data,
3562 skb = ath6kl_wmi_get_new_buf(cmd_len);
3567 "send_probe_response_cmd: freq=%u dst=%pM len=%u\n",
3568 freq, dst, data_len);
3584 skb = ath6kl_wmi_get_new_buf(
sizeof(*p));
3591 p->
enable = enable ? 1 : 0;
3601 skb = ath6kl_wmi_get_new_buf(
sizeof(*p));
3616 return ath6kl_wmi_simple_cmd(wmi, if_idx,
3625 skb = ath6kl_wmi_get_new_buf(
sizeof(*cmd));
3637 static int ath6kl_wmi_control_rx_xtnd(
struct wmi *wmi,
struct sk_buff *skb)
3664 ath6kl_debug_fwlog_event(wmi->
parent_dev, datap, len);
3675 static int ath6kl_wmi_roam_tbl_event_rx(
struct wmi *wmi,
u8 *datap,
int len)
3677 return ath6kl_debug_roam_tbl_event(wmi->
parent_dev, datap, len);
3681 static int ath6kl_wmi_proc_events_vif(
struct wmi *wmi,
u16 if_idx,
u16 cmd_id,
3689 "Wmi event for unavailable vif, vif_index:%d\n",
3697 return ath6kl_wmi_connect_event_rx(wmi, datap, len, vif);
3700 return ath6kl_wmi_disconnect_event_rx(wmi, datap, len, vif);
3703 return ath6kl_wmi_tkip_micerr_event_rx(wmi, datap, len, vif);
3706 return ath6kl_wmi_bssinfo_event_rx(wmi, datap, len, vif);
3709 return ath6kl_wmi_neighbor_report_event_rx(wmi, datap, len,
3713 return ath6kl_wmi_scan_complete_rx(wmi, datap, len, vif);
3716 return ath6kl_wmi_stats_event_rx(wmi, datap, len, vif);
3719 return ath6kl_wmi_cac_event_rx(wmi, datap, len, vif);
3722 return ath6kl_wmi_pspoll_event_rx(wmi, datap, len, vif);
3725 return ath6kl_wmi_dtimexpiry_event_rx(wmi, datap, len, vif);
3728 return ath6kl_wmi_addba_req_event_rx(wmi, datap, len, vif);
3731 return ath6kl_wmi_delba_req_event_rx(wmi, datap, len, vif);
3734 "WMI_SET_HOST_SLEEP_MODE_CMD_PROCESSED_EVENTID");
3735 return ath6kl_wmi_host_sleep_mode_cmd_prcd_evt_rx(wmi, vif);
3738 return ath6kl_wmi_remain_on_chnl_event_rx(wmi, datap, len, vif);
3741 "WMI_CANCEL_REMAIN_ON_CHNL_EVENTID\n");
3742 return ath6kl_wmi_cancel_remain_on_chnl_event_rx(wmi, datap,
3746 return ath6kl_wmi_tx_status_event_rx(wmi, datap, len, vif);
3749 return ath6kl_wmi_rx_probe_req_event_rx(wmi, datap, len, vif);
3752 return ath6kl_wmi_rx_action_event_rx(wmi, datap, len, vif);
3761 static int ath6kl_wmi_proc_events(
struct wmi *wmi,
struct sk_buff *skb)
3785 ret = ath6kl_wmi_bitrate_reply_rx(wmi, datap, len);
3789 ret = ath6kl_wmi_ch_list_reply_rx(wmi, datap, len);
3793 ret = ath6kl_wmi_tx_pwr_reply_rx(wmi, datap, len);
3797 ret = ath6kl_wmi_ready_event_rx(wmi, datap, len);
3801 ret = ath6kl_wmi_peer_node_event_rx(wmi, datap, len);
3805 ath6kl_wmi_regdomain_event(wmi, datap, len);
3809 ret = ath6kl_wmi_pstream_timeout_event_rx(wmi, datap, len);
3813 ret = ath6kl_wmi_error_event_rx(wmi, datap, len);
3817 ret = ath6kl_wmi_rssi_threshold_event_rx(wmi, datap, len);
3828 ret = ath6kl_wmi_roam_tbl_event_rx(wmi, datap, len);
3832 ret = ath6kl_wmi_control_rx_xtnd(wmi, skb);
3842 ret = ath6kl_wmi_test_rx(wmi, datap, len);
3846 ret = ath6kl_wmi_ratemask_reply_rx(wmi, datap, len);
3853 ret = ath6kl_wmi_snr_threshold_event_rx(wmi, datap, len);
3860 ret = ath6kl_wmi_aplist_event_rx(wmi, datap, len);
3864 ret = ath6kl_wmi_keepalive_reply_rx(wmi, datap, len);
3871 ret = ath6kl_wmi_get_pmkid_list_event_rx(wmi, datap, len);
3881 "WMI_REPORT_BTCOEX_CONFIG_EVENTID\n");
3885 "WMI_REPORT_BTCOEX_STATS_EVENTID\n");
3889 ret = ath6kl_wmi_tx_complete_event_rx(datap, len);
3893 ret = ath6kl_wmi_p2p_capabilities_event_rx(datap, len);
3897 ret = ath6kl_wmi_p2p_info_event_rx(datap, len);
3901 ret = ath6kl_wmi_proc_events_vif(wmi, if_idx,
id, datap, len);
3921 return ath6kl_wmi_proc_events(wmi, skb);
3926 spin_lock_bh(&wmi->
lock);
3931 spin_unlock_bh(&wmi->
lock);
3938 wmi = kzalloc(
sizeof(
struct wmi),
GFP_KERNEL);