Lines Matching +full:assoc +full:- +full:weight

2  * Copyright (c) 2004-2011 Atheros Communications Inc.
3 * Copyright (c) 2011-2012 Qualcomm Atheros, Inc.
111 /* 802.1d to AC mapping. Refer pg 57 of WMM-test-plan-v1.2 */
128 wmi->ep_id = ep_id; in ath6kl_wmi_set_control_ep()
133 return wmi->ep_id; in ath6kl_wmi_get_control_ep()
140 if (WARN_ON(if_idx > (ar->vif_max - 1))) in ath6kl_get_vif_by_index()
144 spin_lock_bh(&ar->list_lock); in ath6kl_get_vif_by_index()
145 list_for_each_entry(vif, &ar->vif_list, list) { in ath6kl_get_vif_by_index()
146 if (vif->fw_vif_idx == if_idx) { in ath6kl_get_vif_by_index()
151 spin_unlock_bh(&ar->list_lock); in ath6kl_get_vif_by_index()
170 return -EINVAL; in ath6kl_wmi_dix_2_dot3()
174 return -ENOMEM; in ath6kl_wmi_dix_2_dot3()
176 eth_hdr = (struct ethhdr *) skb->data; in ath6kl_wmi_dix_2_dot3()
177 type = eth_hdr->h_proto; in ath6kl_wmi_dix_2_dot3()
185 new_len = skb->len - sizeof(*eth_hdr) + sizeof(*llc_hdr); in ath6kl_wmi_dix_2_dot3()
188 datap = skb->data; in ath6kl_wmi_dix_2_dot3()
190 eth_hdr->h_proto = cpu_to_be16(new_len); in ath6kl_wmi_dix_2_dot3()
195 llc_hdr->dsap = 0xAA; in ath6kl_wmi_dix_2_dot3()
196 llc_hdr->ssap = 0xAA; in ath6kl_wmi_dix_2_dot3()
197 llc_hdr->cntl = 0x03; in ath6kl_wmi_dix_2_dot3()
198 llc_hdr->org_code[0] = 0x0; in ath6kl_wmi_dix_2_dot3()
199 llc_hdr->org_code[1] = 0x0; in ath6kl_wmi_dix_2_dot3()
200 llc_hdr->org_code[2] = 0x0; in ath6kl_wmi_dix_2_dot3()
201 llc_hdr->eth_type = type; in ath6kl_wmi_dix_2_dot3()
213 return -EINVAL; in ath6kl_wmi_meta_add()
218 v1 = (struct wmi_tx_meta_v1 *) skb->data; in ath6kl_wmi_meta_add()
219 v1->pkt_id = 0; in ath6kl_wmi_meta_add()
220 v1->rate_plcy_id = 0; in ath6kl_wmi_meta_add()
225 v2 = (struct wmi_tx_meta_v2 *) skb->data; in ath6kl_wmi_meta_add()
242 if (WARN_ON(skb == NULL || (if_idx > wmi->parent_dev->vif_max - 1))) in ath6kl_wmi_data_hdr_add()
243 return -EINVAL; in ath6kl_wmi_data_hdr_add()
253 data_hdr = (struct wmi_data_hdr *)skb->data; in ath6kl_wmi_data_hdr_add()
256 data_hdr->info = msg_type << WMI_DATA_HDR_MSG_TYPE_SHIFT; in ath6kl_wmi_data_hdr_add()
257 data_hdr->info |= data_type << WMI_DATA_HDR_DATA_TYPE_SHIFT; in ath6kl_wmi_data_hdr_add()
260 data_hdr->info |= WMI_DATA_HDR_MORE; in ath6kl_wmi_data_hdr_add()
263 data_hdr->info3 |= cpu_to_le16(WMI_DATA_HDR_EOSP); in ath6kl_wmi_data_hdr_add()
265 data_hdr->info2 |= cpu_to_le16(meta_ver << WMI_DATA_HDR_META_SHIFT); in ath6kl_wmi_data_hdr_add()
266 data_hdr->info3 |= cpu_to_le16(if_idx & WMI_DATA_HDR_IF_IDX_MASK); in ath6kl_wmi_data_hdr_add()
279 * IP-TOS - 8bits in ath6kl_wmi_determine_user_priority()
280 * : DSCP(6-bits) ECN(2-bits) in ath6kl_wmi_determine_user_priority()
281 * : DSCP - P2 P1 P0 X X X in ath6kl_wmi_determine_user_priority()
284 ip_pri = ip_hdr->tos >> 5; in ath6kl_wmi_determine_user_priority()
313 return -EINVAL; in ath6kl_wmi_implicit_create_pstream()
315 datap = skb->data; in ath6kl_wmi_implicit_create_pstream()
318 meta_size = ((le16_to_cpu(data_hdr->info2) >> WMI_DATA_HDR_META_SHIFT) & in ath6kl_wmi_implicit_create_pstream()
332 if (llc_hdr->eth_type == htons(ip_type)) { in ath6kl_wmi_implicit_create_pstream()
349 if (skb->protocol == cpu_to_be16(ETH_P_PAE)) in ath6kl_wmi_implicit_create_pstream()
356 * FIXME: wmi->traffic_class is always 100 so this test doesn't in ath6kl_wmi_implicit_create_pstream()
359 if ((wmi->traffic_class == WMM_AC_VI) && in ath6kl_wmi_implicit_create_pstream()
368 spin_lock_bh(&wmi->lock); in ath6kl_wmi_implicit_create_pstream()
369 stream_exist = wmi->fat_pipe_exist; in ath6kl_wmi_implicit_create_pstream()
370 spin_unlock_bh(&wmi->lock); in ath6kl_wmi_implicit_create_pstream()
398 return -EINVAL; in ath6kl_wmi_dot11_hdr_remove()
400 datap = skb->data; in ath6kl_wmi_dot11_hdr_remove()
403 sub_type = pwh->frame_control & cpu_to_le16(IEEE80211_FCTL_STYPE); in ath6kl_wmi_dot11_hdr_remove()
416 datap = skb->data; in ath6kl_wmi_dot11_hdr_remove()
420 eth_hdr.h_proto = llc_hdr->eth_type; in ath6kl_wmi_dot11_hdr_remove()
443 datap = skb->data; in ath6kl_wmi_dot11_hdr_remove()
461 return -EINVAL; in ath6kl_wmi_dot3_2_dix()
463 datap = skb->data; in ath6kl_wmi_dot3_2_dix()
468 eth_hdr.h_proto = llc_hdr->eth_type; in ath6kl_wmi_dot3_2_dix()
471 datap = skb->data; in ath6kl_wmi_dot3_2_dix()
488 evt->num_msg, evt->msg_len, evt->msg_type); in ath6kl_wmi_tx_complete_event_rx()
490 for (index = 0; index < evt->num_msg; index++) { in ath6kl_wmi_tx_complete_event_rx()
496 msg_v1->status, msg_v1->pkt_id, in ath6kl_wmi_tx_complete_event_rx()
497 msg_v1->rate_idx, msg_v1->ack_failures); in ath6kl_wmi_tx_complete_event_rx()
510 struct ath6kl *ar = wmi->parent_dev; in ath6kl_wmi_remain_on_chnl_event_rx()
514 return -EINVAL; in ath6kl_wmi_remain_on_chnl_event_rx()
517 freq = le32_to_cpu(ev->freq); in ath6kl_wmi_remain_on_chnl_event_rx()
518 dur = le32_to_cpu(ev->duration); in ath6kl_wmi_remain_on_chnl_event_rx()
521 chan = ieee80211_get_channel(ar->wiphy, freq); in ath6kl_wmi_remain_on_chnl_event_rx()
526 return -EINVAL; in ath6kl_wmi_remain_on_chnl_event_rx()
528 id = vif->last_roc_id; in ath6kl_wmi_remain_on_chnl_event_rx()
529 cfg80211_ready_on_channel(&vif->wdev, id, chan, in ath6kl_wmi_remain_on_chnl_event_rx()
543 struct ath6kl *ar = wmi->parent_dev; in ath6kl_wmi_cancel_remain_on_chnl_event_rx()
547 return -EINVAL; in ath6kl_wmi_cancel_remain_on_chnl_event_rx()
550 freq = le32_to_cpu(ev->freq); in ath6kl_wmi_cancel_remain_on_chnl_event_rx()
551 dur = le32_to_cpu(ev->duration); in ath6kl_wmi_cancel_remain_on_chnl_event_rx()
554 freq, dur, ev->status); in ath6kl_wmi_cancel_remain_on_chnl_event_rx()
555 chan = ieee80211_get_channel(ar->wiphy, freq); in ath6kl_wmi_cancel_remain_on_chnl_event_rx()
560 return -EINVAL; in ath6kl_wmi_cancel_remain_on_chnl_event_rx()
562 if (vif->last_cancel_roc_id && in ath6kl_wmi_cancel_remain_on_chnl_event_rx()
563 vif->last_cancel_roc_id + 1 == vif->last_roc_id) in ath6kl_wmi_cancel_remain_on_chnl_event_rx()
564 id = vif->last_cancel_roc_id; /* event for cancel command */ in ath6kl_wmi_cancel_remain_on_chnl_event_rx()
566 id = vif->last_roc_id; /* timeout on uncanceled r-o-c */ in ath6kl_wmi_cancel_remain_on_chnl_event_rx()
567 vif->last_cancel_roc_id = 0; in ath6kl_wmi_cancel_remain_on_chnl_event_rx()
568 cfg80211_remain_on_channel_expired(&vif->wdev, id, chan, GFP_ATOMIC); in ath6kl_wmi_cancel_remain_on_chnl_event_rx()
580 return -EINVAL; in ath6kl_wmi_tx_status_event_rx()
583 id = le32_to_cpu(ev->id); in ath6kl_wmi_tx_status_event_rx()
585 id, ev->ack_status); in ath6kl_wmi_tx_status_event_rx()
586 if (wmi->last_mgmt_tx_frame) { in ath6kl_wmi_tx_status_event_rx()
587 cfg80211_mgmt_tx_status(&vif->wdev, id, in ath6kl_wmi_tx_status_event_rx()
588 wmi->last_mgmt_tx_frame, in ath6kl_wmi_tx_status_event_rx()
589 wmi->last_mgmt_tx_frame_len, in ath6kl_wmi_tx_status_event_rx()
590 !!ev->ack_status, GFP_ATOMIC); in ath6kl_wmi_tx_status_event_rx()
591 kfree(wmi->last_mgmt_tx_frame); in ath6kl_wmi_tx_status_event_rx()
592 wmi->last_mgmt_tx_frame = NULL; in ath6kl_wmi_tx_status_event_rx()
593 wmi->last_mgmt_tx_frame_len = 0; in ath6kl_wmi_tx_status_event_rx()
607 return -EINVAL; in ath6kl_wmi_rx_probe_req_event_rx()
610 freq = le32_to_cpu(ev->freq); in ath6kl_wmi_rx_probe_req_event_rx()
611 dlen = le16_to_cpu(ev->len); in ath6kl_wmi_rx_probe_req_event_rx()
612 if (datap + len < ev->data + dlen) { in ath6kl_wmi_rx_probe_req_event_rx()
615 return -EINVAL; in ath6kl_wmi_rx_probe_req_event_rx()
619 dlen, freq, vif->probe_req_report); in ath6kl_wmi_rx_probe_req_event_rx()
621 if (vif->probe_req_report || vif->nw_type == AP_NETWORK) in ath6kl_wmi_rx_probe_req_event_rx()
622 cfg80211_rx_mgmt(&vif->wdev, freq, 0, ev->data, dlen, 0); in ath6kl_wmi_rx_probe_req_event_rx()
633 return -EINVAL; in ath6kl_wmi_p2p_capabilities_event_rx()
636 dlen = le16_to_cpu(ev->len); in ath6kl_wmi_p2p_capabilities_event_rx()
650 return -EINVAL; in ath6kl_wmi_rx_action_event_rx()
653 freq = le32_to_cpu(ev->freq); in ath6kl_wmi_rx_action_event_rx()
654 dlen = le16_to_cpu(ev->len); in ath6kl_wmi_rx_action_event_rx()
655 if (datap + len < ev->data + dlen) { in ath6kl_wmi_rx_action_event_rx()
658 return -EINVAL; in ath6kl_wmi_rx_action_event_rx()
661 cfg80211_rx_mgmt(&vif->wdev, freq, 0, ev->data, dlen, 0); in ath6kl_wmi_rx_action_event_rx()
673 return -EINVAL; in ath6kl_wmi_p2p_info_event_rx()
676 flags = le32_to_cpu(ev->info_req_flags); in ath6kl_wmi_p2p_info_event_rx()
677 dlen = le16_to_cpu(ev->len); in ath6kl_wmi_p2p_info_event_rx()
683 return -EINVAL; in ath6kl_wmi_p2p_info_event_rx()
684 cap = (struct wmi_p2p_capabilities *) ev->data; in ath6kl_wmi_p2p_info_event_rx()
686 cap->go_power_save); in ath6kl_wmi_p2p_info_event_rx()
692 return -EINVAL; in ath6kl_wmi_p2p_info_event_rx()
693 mac = (struct wmi_p2p_macaddr *) ev->data; in ath6kl_wmi_p2p_info_event_rx()
695 mac->mac_addr); in ath6kl_wmi_p2p_info_event_rx()
701 return -EINVAL; in ath6kl_wmi_p2p_info_event_rx()
702 mod = (struct wmi_p2p_hmodel *) ev->data; in ath6kl_wmi_p2p_info_event_rx()
704 mod->p2p_model, in ath6kl_wmi_p2p_info_event_rx()
705 mod->p2p_model ? "host" : "firmware"); in ath6kl_wmi_p2p_info_event_rx()
720 memset(skb->data, 0, size); in ath6kl_wmi_get_new_buf()
725 /* Send a "simple" wmi command -- one with no arguments */
734 return -ENOMEM; in ath6kl_wmi_simple_cmd()
746 return -EINVAL; in ath6kl_wmi_ready_event_rx()
748 ath6kl_ready_event(wmi->parent_dev, ev->mac_addr, in ath6kl_wmi_ready_event_rx()
749 le32_to_cpu(ev->sw_version), in ath6kl_wmi_ready_event_rx()
750 le32_to_cpu(ev->abi_version), ev->phy_cap); in ath6kl_wmi_ready_event_rx()
768 return -ENOMEM; in ath6kl_wmi_set_roam_lrssi_cmd()
770 cmd = (struct roam_ctrl_cmd *) skb->data; in ath6kl_wmi_set_roam_lrssi_cmd()
772 cmd->info.params.lrssi_scan_period = cpu_to_le16(DEF_LRSSI_SCAN_PERIOD); in ath6kl_wmi_set_roam_lrssi_cmd()
773 cmd->info.params.lrssi_scan_threshold = a_cpu_to_sle16(lrssi + in ath6kl_wmi_set_roam_lrssi_cmd()
775 cmd->info.params.lrssi_roam_threshold = a_cpu_to_sle16(lrssi); in ath6kl_wmi_set_roam_lrssi_cmd()
776 cmd->info.params.roam_rssi_floor = DEF_LRSSI_ROAM_FLOOR; in ath6kl_wmi_set_roam_lrssi_cmd()
777 cmd->roam_ctrl = WMI_SET_LRSSI_SCAN_PARAMS; in ath6kl_wmi_set_roam_lrssi_cmd()
790 return -ENOMEM; in ath6kl_wmi_force_roam_cmd()
792 cmd = (struct roam_ctrl_cmd *) skb->data; in ath6kl_wmi_force_roam_cmd()
794 memcpy(cmd->info.bssid, bssid, ETH_ALEN); in ath6kl_wmi_force_roam_cmd()
795 cmd->roam_ctrl = WMI_FORCE_ROAM; in ath6kl_wmi_force_roam_cmd()
810 return -ENOMEM; in ath6kl_wmi_ap_set_beacon_intvl_cmd()
812 cmd = (struct set_beacon_int_cmd *) skb->data; in ath6kl_wmi_ap_set_beacon_intvl_cmd()
814 cmd->beacon_intvl = cpu_to_le32(beacon_intvl); in ath6kl_wmi_ap_set_beacon_intvl_cmd()
826 return -ENOMEM; in ath6kl_wmi_ap_set_dtim_cmd()
828 cmd = (struct set_dtim_cmd *) skb->data; in ath6kl_wmi_ap_set_dtim_cmd()
830 cmd->dtim_period = cpu_to_le32(dtim_period); in ath6kl_wmi_ap_set_dtim_cmd()
842 return -ENOMEM; in ath6kl_wmi_set_roam_mode_cmd()
844 cmd = (struct roam_ctrl_cmd *) skb->data; in ath6kl_wmi_set_roam_mode_cmd()
846 cmd->info.roam_mode = mode; in ath6kl_wmi_set_roam_mode_cmd()
847 cmd->roam_ctrl = WMI_SET_ROAM_MODE; in ath6kl_wmi_set_roam_mode_cmd()
861 return -EINVAL; in ath6kl_wmi_connect_event_rx()
865 if (vif->nw_type == AP_NETWORK) { in ath6kl_wmi_connect_event_rx()
867 struct net_device *dev = vif->ndev; in ath6kl_wmi_connect_event_rx()
868 if (memcmp(dev->dev_addr, ev->u.ap_bss.bssid, ETH_ALEN) == 0) { in ath6kl_wmi_connect_event_rx()
871 __func__, le16_to_cpu(ev->u.ap_bss.ch), in ath6kl_wmi_connect_event_rx()
872 ev->u.ap_bss.bssid); in ath6kl_wmi_connect_event_rx()
874 vif, le16_to_cpu(ev->u.ap_bss.ch)); in ath6kl_wmi_connect_event_rx()
878 __func__, ev->u.ap_sta.aid, in ath6kl_wmi_connect_event_rx()
879 ev->u.ap_sta.mac_addr, in ath6kl_wmi_connect_event_rx()
880 ev->u.ap_sta.auth, in ath6kl_wmi_connect_event_rx()
881 ev->u.ap_sta.keymgmt, in ath6kl_wmi_connect_event_rx()
882 le16_to_cpu(ev->u.ap_sta.cipher), in ath6kl_wmi_connect_event_rx()
883 ev->u.ap_sta.apsd_info); in ath6kl_wmi_connect_event_rx()
886 vif, ev->u.ap_sta.aid, ev->u.ap_sta.mac_addr, in ath6kl_wmi_connect_event_rx()
887 ev->u.ap_sta.keymgmt, in ath6kl_wmi_connect_event_rx()
888 le16_to_cpu(ev->u.ap_sta.cipher), in ath6kl_wmi_connect_event_rx()
889 ev->u.ap_sta.auth, ev->assoc_req_len, in ath6kl_wmi_connect_event_rx()
890 ev->assoc_info + ev->beacon_ie_len, in ath6kl_wmi_connect_event_rx()
891 ev->u.ap_sta.apsd_info); in ath6kl_wmi_connect_event_rx()
900 le16_to_cpu(ev->u.sta.ch), ev->u.sta.bssid, in ath6kl_wmi_connect_event_rx()
901 le16_to_cpu(ev->u.sta.listen_intvl), in ath6kl_wmi_connect_event_rx()
902 le16_to_cpu(ev->u.sta.beacon_intvl), in ath6kl_wmi_connect_event_rx()
903 le32_to_cpu(ev->u.sta.nw_type)); in ath6kl_wmi_connect_event_rx()
905 /* Start of assoc rsp IEs */ in ath6kl_wmi_connect_event_rx()
906 pie = ev->assoc_info + ev->beacon_ie_len + in ath6kl_wmi_connect_event_rx()
907 ev->assoc_req_len + (sizeof(u16) * 3); /* capinfo, status, aid */ in ath6kl_wmi_connect_event_rx()
909 /* End of assoc rsp IEs */ in ath6kl_wmi_connect_event_rx()
910 peie = ev->assoc_info + ev->beacon_ie_len + ev->assoc_req_len + in ath6kl_wmi_connect_event_rx()
911 ev->assoc_resp_len; in ath6kl_wmi_connect_event_rx()
921 wmi->is_wmm_enabled = true; in ath6kl_wmi_connect_event_rx()
926 if (wmi->is_wmm_enabled) in ath6kl_wmi_connect_event_rx()
932 ath6kl_connect_event(vif, le16_to_cpu(ev->u.sta.ch), in ath6kl_wmi_connect_event_rx()
933 ev->u.sta.bssid, in ath6kl_wmi_connect_event_rx()
934 le16_to_cpu(ev->u.sta.listen_intvl), in ath6kl_wmi_connect_event_rx()
935 le16_to_cpu(ev->u.sta.beacon_intvl), in ath6kl_wmi_connect_event_rx()
936 le32_to_cpu(ev->u.sta.nw_type), in ath6kl_wmi_connect_event_rx()
937 ev->beacon_ie_len, ev->assoc_req_len, in ath6kl_wmi_connect_event_rx()
938 ev->assoc_resp_len, ev->assoc_info); in ath6kl_wmi_connect_event_rx()
994 reg_code = le32_to_cpu(ev->reg_code); in ath6kl_wmi_regdomain_event()
1003 regpair->reg_domain); in ath6kl_wmi_regdomain_event()
1009 if (country && wmi->parent_dev->wiphy_registered) { in ath6kl_wmi_regdomain_event()
1010 alpha2[0] = country->isoName[0]; in ath6kl_wmi_regdomain_event()
1011 alpha2[1] = country->isoName[1]; in ath6kl_wmi_regdomain_event()
1013 regulatory_hint(wmi->parent_dev->wiphy, alpha2); in ath6kl_wmi_regdomain_event()
1024 wmi->traffic_class = 100; in ath6kl_wmi_disconnect_event_rx()
1027 return -EINVAL; in ath6kl_wmi_disconnect_event_rx()
1033 le16_to_cpu(ev->proto_reason_status), ev->bssid, in ath6kl_wmi_disconnect_event_rx()
1034 ev->disconn_reason, ev->assoc_resp_len); in ath6kl_wmi_disconnect_event_rx()
1036 wmi->is_wmm_enabled = false; in ath6kl_wmi_disconnect_event_rx()
1038 ath6kl_disconnect_event(vif, ev->disconn_reason, in ath6kl_wmi_disconnect_event_rx()
1039 ev->bssid, ev->assoc_resp_len, ev->assoc_info, in ath6kl_wmi_disconnect_event_rx()
1040 le16_to_cpu(ev->proto_reason_status)); in ath6kl_wmi_disconnect_event_rx()
1050 return -EINVAL; in ath6kl_wmi_peer_node_event_rx()
1054 if (ev->event_code == PEER_NODE_JOIN_EVENT) in ath6kl_wmi_peer_node_event_rx()
1056 ev->peer_mac_addr); in ath6kl_wmi_peer_node_event_rx()
1057 else if (ev->event_code == PEER_NODE_LEAVE_EVENT) in ath6kl_wmi_peer_node_event_rx()
1059 ev->peer_mac_addr); in ath6kl_wmi_peer_node_event_rx()
1070 return -EINVAL; in ath6kl_wmi_tkip_micerr_event_rx()
1074 ath6kl_tkip_micerr_event(vif, ev->key_id, ev->is_mcast); in ath6kl_wmi_tkip_micerr_event_rx()
1083 cfg80211_sched_scan_results(vif->ar->wiphy, 0); in ath6kl_wmi_sscan_timer()
1092 struct ath6kl *ar = wmi->parent_dev; in ath6kl_wmi_bssinfo_event_rx()
1096 return -EINVAL; in ath6kl_wmi_bssinfo_event_rx()
1100 len -= sizeof(struct wmi_bss_info_hdr2); in ath6kl_wmi_bssinfo_event_rx()
1103 "bss info evt - ch %u, snr %d, rssi %d, bssid \"%pM\" " in ath6kl_wmi_bssinfo_event_rx()
1105 bih->ch, bih->snr, bih->snr - 95, bih->bssid, in ath6kl_wmi_bssinfo_event_rx()
1106 bih->frame_type); in ath6kl_wmi_bssinfo_event_rx()
1108 if (bih->frame_type != BEACON_FTYPE && in ath6kl_wmi_bssinfo_event_rx()
1109 bih->frame_type != PROBERESP_FTYPE) in ath6kl_wmi_bssinfo_event_rx()
1112 if (bih->frame_type == BEACON_FTYPE && in ath6kl_wmi_bssinfo_event_rx()
1113 test_bit(CLEAR_BSSFILTER_ON_BEACON, &vif->flags)) { in ath6kl_wmi_bssinfo_event_rx()
1114 clear_bit(CLEAR_BSSFILTER_ON_BEACON, &vif->flags); in ath6kl_wmi_bssinfo_event_rx()
1115 ath6kl_wmi_bssfilter_cmd(ar->wmi, vif->fw_vif_idx, in ath6kl_wmi_bssinfo_event_rx()
1119 channel = ieee80211_get_channel(ar->wiphy, le16_to_cpu(bih->ch)); in ath6kl_wmi_bssinfo_event_rx()
1121 return -EINVAL; in ath6kl_wmi_bssinfo_event_rx()
1124 return -EINVAL; in ath6kl_wmi_bssinfo_event_rx()
1126 if (bih->frame_type == BEACON_FTYPE && in ath6kl_wmi_bssinfo_event_rx()
1127 test_bit(CONNECTED, &vif->flags) && in ath6kl_wmi_bssinfo_event_rx()
1128 memcmp(bih->bssid, vif->bssid, ETH_ALEN) == 0) { in ath6kl_wmi_bssinfo_event_rx()
1131 len - 8 - 2 - 2); in ath6kl_wmi_bssinfo_event_rx()
1133 vif->assoc_bss_dtim_period = tim[3]; in ath6kl_wmi_bssinfo_event_rx()
1134 set_bit(DTIM_PERIOD_AVAIL, &vif->flags); in ath6kl_wmi_bssinfo_event_rx()
1138 bss = cfg80211_inform_bss(ar->wiphy, channel, in ath6kl_wmi_bssinfo_event_rx()
1139 bih->frame_type == BEACON_FTYPE ? in ath6kl_wmi_bssinfo_event_rx()
1142 bih->bssid, get_unaligned_le64((__le64 *)buf), in ath6kl_wmi_bssinfo_event_rx()
1145 buf + 8 + 2 + 2, len - 8 - 2 - 2, in ath6kl_wmi_bssinfo_event_rx()
1146 (bih->snr - 95) * 100, GFP_ATOMIC); in ath6kl_wmi_bssinfo_event_rx()
1148 return -ENOMEM; in ath6kl_wmi_bssinfo_event_rx()
1149 cfg80211_put_bss(ar->wiphy, bss); in ath6kl_wmi_bssinfo_event_rx()
1160 if (test_bit(SCHED_SCANNING, &vif->flags) && in ath6kl_wmi_bssinfo_event_rx()
1161 !timer_pending(&vif->sched_scan_timer)) { in ath6kl_wmi_bssinfo_event_rx()
1162 mod_timer(&vif->sched_scan_timer, jiffies + in ath6kl_wmi_bssinfo_event_rx()
1176 return -EINVAL; in ath6kl_wmi_pstream_timeout_event_rx()
1179 if (ev->traffic_class >= WMM_NUM_AC) { in ath6kl_wmi_pstream_timeout_event_rx()
1180 ath6kl_err("invalid traffic class: %d\n", ev->traffic_class); in ath6kl_wmi_pstream_timeout_event_rx()
1181 return -EINVAL; in ath6kl_wmi_pstream_timeout_event_rx()
1190 spin_lock_bh(&wmi->lock); in ath6kl_wmi_pstream_timeout_event_rx()
1191 wmi->stream_exist_for_ac[ev->traffic_class] = 0; in ath6kl_wmi_pstream_timeout_event_rx()
1192 wmi->fat_pipe_exist &= ~(1 << ev->traffic_class); in ath6kl_wmi_pstream_timeout_event_rx()
1193 spin_unlock_bh(&wmi->lock); in ath6kl_wmi_pstream_timeout_event_rx()
1196 ath6kl_indicate_tx_activity(wmi->parent_dev, ev->traffic_class, false); in ath6kl_wmi_pstream_timeout_event_rx()
1207 return -EINVAL; in ath6kl_wmi_bitrate_reply_rx()
1211 ath6kl_dbg(ATH6KL_DBG_WMI, "rateindex %d\n", reply->rate_index); in ath6kl_wmi_bitrate_reply_rx()
1213 if (reply->rate_index != (s8) RATE_AUTO) { in ath6kl_wmi_bitrate_reply_rx()
1214 index = reply->rate_index & 0x7f; in ath6kl_wmi_bitrate_reply_rx()
1216 return -EINVAL; in ath6kl_wmi_bitrate_reply_rx()
1219 ath6kl_wakeup_event(wmi->parent_dev); in ath6kl_wmi_bitrate_reply_rx()
1226 ath6kl_tm_rx_event(wmi->parent_dev, datap, len); in ath6kl_wmi_test_rx()
1234 return -EINVAL; in ath6kl_wmi_ratemask_reply_rx()
1236 ath6kl_wakeup_event(wmi->parent_dev); in ath6kl_wmi_ratemask_reply_rx()
1244 return -EINVAL; in ath6kl_wmi_ch_list_reply_rx()
1246 ath6kl_wakeup_event(wmi->parent_dev); in ath6kl_wmi_ch_list_reply_rx()
1256 return -EINVAL; in ath6kl_wmi_tx_pwr_reply_rx()
1259 ath6kl_txpwr_rx_evt(wmi->parent_dev, reply->dbM); in ath6kl_wmi_tx_pwr_reply_rx()
1267 return -EINVAL; in ath6kl_wmi_keepalive_reply_rx()
1269 ath6kl_wakeup_event(wmi->parent_dev); in ath6kl_wmi_keepalive_reply_rx()
1281 ath6kl_scan_complete_evt(vif, a_sle32_to_cpu(ev->status)); in ath6kl_wmi_scan_complete_rx()
1282 wmi->is_probe_ssid = false; in ath6kl_wmi_scan_complete_rx()
1294 return -EINVAL; in ath6kl_wmi_neighbor_report_event_rx()
1296 if (struct_size(ev, neighbor, ev->num_neighbors) > len) { in ath6kl_wmi_neighbor_report_event_rx()
1299 ev->num_neighbors, len); in ath6kl_wmi_neighbor_report_event_rx()
1300 return -EINVAL; in ath6kl_wmi_neighbor_report_event_rx()
1302 for (i = 0; i < ev->num_neighbors; i++) { in ath6kl_wmi_neighbor_report_event_rx()
1303 ath6kl_dbg(ATH6KL_DBG_WMI, "neighbor %d/%d - %pM 0x%x\n", in ath6kl_wmi_neighbor_report_event_rx()
1304 i + 1, ev->num_neighbors, ev->neighbor[i].bssid, in ath6kl_wmi_neighbor_report_event_rx()
1305 ev->neighbor[i].bss_flags); in ath6kl_wmi_neighbor_report_event_rx()
1306 cfg80211_pmksa_candidate_notify(vif->ndev, i, in ath6kl_wmi_neighbor_report_event_rx()
1307 ev->neighbor[i].bssid, in ath6kl_wmi_neighbor_report_event_rx()
1308 !!(ev->neighbor[i].bss_flags & in ath6kl_wmi_neighbor_report_event_rx()
1329 switch (ev->err_code) { in ath6kl_wmi_error_event_rx()
1342 ev->cmd_id, type); in ath6kl_wmi_error_event_rx()
1360 u8 threshold = (u8) sq_thresh->upper_threshold[size - 1]; in ath6kl_wmi_get_upper_threshold()
1364 if (rssi < sq_thresh->upper_threshold[index]) { in ath6kl_wmi_get_upper_threshold()
1365 threshold = (u8) sq_thresh->upper_threshold[index]; in ath6kl_wmi_get_upper_threshold()
1378 u8 threshold = (u8) sq_thresh->lower_threshold[size - 1]; in ath6kl_wmi_get_lower_threshold()
1382 if (rssi > sq_thresh->lower_threshold[index]) { in ath6kl_wmi_get_lower_threshold()
1383 threshold = (u8) sq_thresh->lower_threshold[index]; in ath6kl_wmi_get_lower_threshold()
1399 return -ENOMEM; in ath6kl_wmi_send_rssi_threshold_params()
1401 cmd = (struct wmi_rssi_threshold_params_cmd *) skb->data; in ath6kl_wmi_send_rssi_threshold_params()
1420 return -EINVAL; in ath6kl_wmi_rssi_threshold_event_rx()
1423 new_threshold = (enum wmi_rssi_threshold_val) reply->range; in ath6kl_wmi_rssi_threshold_event_rx()
1424 rssi = a_sle16_to_cpu(reply->rssi); in ath6kl_wmi_rssi_threshold_event_rx()
1426 sq_thresh = &wmi->sq_threshld[SIGNAL_QUALITY_METRICS_RSSI]; in ath6kl_wmi_rssi_threshold_event_rx()
1435 if (rssi < sq_thresh->upper_threshold[0]) { in ath6kl_wmi_rssi_threshold_event_rx()
1439 } else if ((rssi < sq_thresh->upper_threshold[1]) && in ath6kl_wmi_rssi_threshold_event_rx()
1440 (rssi >= sq_thresh->upper_threshold[0])) { in ath6kl_wmi_rssi_threshold_event_rx()
1442 } else if ((rssi < sq_thresh->upper_threshold[2]) && in ath6kl_wmi_rssi_threshold_event_rx()
1443 (rssi >= sq_thresh->upper_threshold[1])) { in ath6kl_wmi_rssi_threshold_event_rx()
1445 } else if ((rssi < sq_thresh->upper_threshold[3]) && in ath6kl_wmi_rssi_threshold_event_rx()
1446 (rssi >= sq_thresh->upper_threshold[2])) { in ath6kl_wmi_rssi_threshold_event_rx()
1448 } else if ((rssi < sq_thresh->upper_threshold[4]) && in ath6kl_wmi_rssi_threshold_event_rx()
1449 (rssi >= sq_thresh->upper_threshold[3])) { in ath6kl_wmi_rssi_threshold_event_rx()
1451 } else if ((rssi < sq_thresh->upper_threshold[5]) && in ath6kl_wmi_rssi_threshold_event_rx()
1452 (rssi >= sq_thresh->upper_threshold[4])) { in ath6kl_wmi_rssi_threshold_event_rx()
1454 } else if (rssi >= sq_thresh->upper_threshold[5]) { in ath6kl_wmi_rssi_threshold_event_rx()
1459 if (rssi > sq_thresh->lower_threshold[0]) { in ath6kl_wmi_rssi_threshold_event_rx()
1462 rssi, sq_thresh->lower_threshold[0]); in ath6kl_wmi_rssi_threshold_event_rx()
1463 } else if ((rssi > sq_thresh->lower_threshold[1]) && in ath6kl_wmi_rssi_threshold_event_rx()
1464 (rssi <= sq_thresh->lower_threshold[0])) { in ath6kl_wmi_rssi_threshold_event_rx()
1466 } else if ((rssi > sq_thresh->lower_threshold[2]) && in ath6kl_wmi_rssi_threshold_event_rx()
1467 (rssi <= sq_thresh->lower_threshold[1])) { in ath6kl_wmi_rssi_threshold_event_rx()
1469 } else if ((rssi > sq_thresh->lower_threshold[3]) && in ath6kl_wmi_rssi_threshold_event_rx()
1470 (rssi <= sq_thresh->lower_threshold[2])) { in ath6kl_wmi_rssi_threshold_event_rx()
1472 } else if ((rssi > sq_thresh->lower_threshold[4]) && in ath6kl_wmi_rssi_threshold_event_rx()
1473 (rssi <= sq_thresh->lower_threshold[3])) { in ath6kl_wmi_rssi_threshold_event_rx()
1475 } else if ((rssi > sq_thresh->lower_threshold[5]) && in ath6kl_wmi_rssi_threshold_event_rx()
1476 (rssi <= sq_thresh->lower_threshold[4])) { in ath6kl_wmi_rssi_threshold_event_rx()
1478 } else if (rssi <= sq_thresh->lower_threshold[5]) { in ath6kl_wmi_rssi_threshold_event_rx()
1485 sq_thresh->lower_threshold_valid_count); in ath6kl_wmi_rssi_threshold_event_rx()
1487 sq_thresh->upper_threshold_valid_count); in ath6kl_wmi_rssi_threshold_event_rx()
1492 cmd.weight = sq_thresh->weight; in ath6kl_wmi_rssi_threshold_event_rx()
1493 cmd.poll_time = cpu_to_le32(sq_thresh->polling_interval); in ath6kl_wmi_rssi_threshold_event_rx()
1498 return -EIO; in ath6kl_wmi_rssi_threshold_event_rx()
1514 return -EINVAL; in ath6kl_wmi_cac_event_rx()
1517 if (reply->ac >= WMM_NUM_AC) { in ath6kl_wmi_cac_event_rx()
1518 ath6kl_err("invalid AC: %d\n", reply->ac); in ath6kl_wmi_cac_event_rx()
1519 return -EINVAL; in ath6kl_wmi_cac_event_rx()
1522 if ((reply->cac_indication == CAC_INDICATION_ADMISSION_RESP) && in ath6kl_wmi_cac_event_rx()
1523 (reply->status_code != IEEE80211_TSPEC_STATUS_ADMISS_ACCEPTED)) { in ath6kl_wmi_cac_event_rx()
1524 ts = (struct ieee80211_tspec_ie *) &(reply->tspec_suggestion); in ath6kl_wmi_cac_event_rx()
1525 tsinfo = le16_to_cpu(ts->tsinfo); in ath6kl_wmi_cac_event_rx()
1529 ath6kl_wmi_delete_pstream_cmd(wmi, vif->fw_vif_idx, in ath6kl_wmi_cac_event_rx()
1530 reply->ac, tsid); in ath6kl_wmi_cac_event_rx()
1531 } else if (reply->cac_indication == CAC_INDICATION_NO_RESP) { in ath6kl_wmi_cac_event_rx()
1536 spin_lock_bh(&wmi->lock); in ath6kl_wmi_cac_event_rx()
1537 active_tsids = wmi->stream_exist_for_ac[reply->ac]; in ath6kl_wmi_cac_event_rx()
1538 spin_unlock_bh(&wmi->lock); in ath6kl_wmi_cac_event_rx()
1545 ath6kl_wmi_delete_pstream_cmd(wmi, vif->fw_vif_idx, in ath6kl_wmi_cac_event_rx()
1546 reply->ac, index); in ath6kl_wmi_cac_event_rx()
1553 else if (reply->cac_indication == CAC_INDICATION_DELETE) { in ath6kl_wmi_cac_event_rx()
1554 ts = (struct ieee80211_tspec_ie *) &(reply->tspec_suggestion); in ath6kl_wmi_cac_event_rx()
1555 tsinfo = le16_to_cpu(ts->tsinfo); in ath6kl_wmi_cac_event_rx()
1559 spin_lock_bh(&wmi->lock); in ath6kl_wmi_cac_event_rx()
1560 wmi->stream_exist_for_ac[reply->ac] &= ~(1 << ts_id); in ath6kl_wmi_cac_event_rx()
1561 active_tsids = wmi->stream_exist_for_ac[reply->ac]; in ath6kl_wmi_cac_event_rx()
1562 spin_unlock_bh(&wmi->lock); in ath6kl_wmi_cac_event_rx()
1568 ath6kl_indicate_tx_activity(wmi->parent_dev, reply->ac, in ath6kl_wmi_cac_event_rx()
1570 wmi->fat_pipe_exist &= ~(1 << reply->ac); in ath6kl_wmi_cac_event_rx()
1584 return -EINVAL; in ath6kl_wmi_txe_notify_event_rx()
1586 if (vif->nw_type != INFRA_NETWORK || in ath6kl_wmi_txe_notify_event_rx()
1588 vif->ar->fw_capabilities)) in ath6kl_wmi_txe_notify_event_rx()
1589 return -EOPNOTSUPP; in ath6kl_wmi_txe_notify_event_rx()
1591 if (vif->sme_state != SME_CONNECTED) in ath6kl_wmi_txe_notify_event_rx()
1592 return -ENOTCONN; in ath6kl_wmi_txe_notify_event_rx()
1595 rate = le32_to_cpu(ev->rate); in ath6kl_wmi_txe_notify_event_rx()
1596 pkts = le32_to_cpu(ev->pkts); in ath6kl_wmi_txe_notify_event_rx()
1599 vif->bssid, rate, pkts, vif->txe_intvl); in ath6kl_wmi_txe_notify_event_rx()
1601 cfg80211_cqm_txe_notify(vif->ndev, vif->bssid, pkts, in ath6kl_wmi_txe_notify_event_rx()
1602 rate, vif->txe_intvl, GFP_KERNEL); in ath6kl_wmi_txe_notify_event_rx()
1615 return -ENOMEM; in ath6kl_wmi_set_txe_notify()
1617 cmd = (struct wmi_txe_notify_cmd *) skb->data; in ath6kl_wmi_set_txe_notify()
1618 cmd->rate = cpu_to_le32(rate); in ath6kl_wmi_set_txe_notify()
1619 cmd->pkts = cpu_to_le32(pkts); in ath6kl_wmi_set_txe_notify()
1620 cmd->intvl = cpu_to_le32(intvl); in ath6kl_wmi_set_txe_notify()
1634 return -ENOMEM; in ath6kl_wmi_set_rssi_filter_cmd()
1636 cmd = (struct wmi_set_rssi_filter_cmd *) skb->data; in ath6kl_wmi_set_rssi_filter_cmd()
1637 cmd->rssi = rssi; in ath6kl_wmi_set_rssi_filter_cmd()
1652 return -ENOMEM; in ath6kl_wmi_send_snr_threshold_params()
1654 cmd = (struct wmi_snr_threshold_params_cmd *) skb->data; in ath6kl_wmi_send_snr_threshold_params()
1673 return -EINVAL; in ath6kl_wmi_snr_threshold_event_rx()
1677 new_threshold = (enum wmi_snr_threshold_val) reply->range; in ath6kl_wmi_snr_threshold_event_rx()
1678 snr = reply->snr; in ath6kl_wmi_snr_threshold_event_rx()
1680 sq_thresh = &wmi->sq_threshld[SIGNAL_QUALITY_METRICS_SNR]; in ath6kl_wmi_snr_threshold_event_rx()
1689 if (snr < sq_thresh->upper_threshold[0]) { in ath6kl_wmi_snr_threshold_event_rx()
1693 } else if ((snr < sq_thresh->upper_threshold[1]) && in ath6kl_wmi_snr_threshold_event_rx()
1694 (snr >= sq_thresh->upper_threshold[0])) { in ath6kl_wmi_snr_threshold_event_rx()
1696 } else if ((snr < sq_thresh->upper_threshold[2]) && in ath6kl_wmi_snr_threshold_event_rx()
1697 (snr >= sq_thresh->upper_threshold[1])) { in ath6kl_wmi_snr_threshold_event_rx()
1699 } else if ((snr < sq_thresh->upper_threshold[3]) && in ath6kl_wmi_snr_threshold_event_rx()
1700 (snr >= sq_thresh->upper_threshold[2])) { in ath6kl_wmi_snr_threshold_event_rx()
1702 } else if (snr >= sq_thresh->upper_threshold[3]) { in ath6kl_wmi_snr_threshold_event_rx()
1707 if (snr > sq_thresh->lower_threshold[0]) { in ath6kl_wmi_snr_threshold_event_rx()
1710 sq_thresh->lower_threshold[0]); in ath6kl_wmi_snr_threshold_event_rx()
1711 } else if ((snr > sq_thresh->lower_threshold[1]) && in ath6kl_wmi_snr_threshold_event_rx()
1712 (snr <= sq_thresh->lower_threshold[0])) { in ath6kl_wmi_snr_threshold_event_rx()
1714 } else if ((snr > sq_thresh->lower_threshold[2]) && in ath6kl_wmi_snr_threshold_event_rx()
1715 (snr <= sq_thresh->lower_threshold[1])) { in ath6kl_wmi_snr_threshold_event_rx()
1717 } else if ((snr > sq_thresh->lower_threshold[3]) && in ath6kl_wmi_snr_threshold_event_rx()
1718 (snr <= sq_thresh->lower_threshold[2])) { in ath6kl_wmi_snr_threshold_event_rx()
1720 } else if (snr <= sq_thresh->lower_threshold[3]) { in ath6kl_wmi_snr_threshold_event_rx()
1727 sq_thresh->lower_threshold_valid_count); in ath6kl_wmi_snr_threshold_event_rx()
1729 sq_thresh->upper_threshold_valid_count); in ath6kl_wmi_snr_threshold_event_rx()
1734 cmd.weight = sq_thresh->weight; in ath6kl_wmi_snr_threshold_event_rx()
1735 cmd.poll_time = cpu_to_le32(sq_thresh->polling_interval); in ath6kl_wmi_snr_threshold_event_rx()
1745 return -EIO; in ath6kl_wmi_snr_threshold_event_rx()
1758 ev->ap_list_ver != APLIST_VER1) in ath6kl_wmi_aplist_event_rx()
1759 return -EINVAL; in ath6kl_wmi_aplist_event_rx()
1761 ap_info_v1 = (struct wmi_ap_info_v1 *) ev->ap_list; in ath6kl_wmi_aplist_event_rx()
1764 "number of APs in aplist event: %d\n", ev->num_ap); in ath6kl_wmi_aplist_event_rx()
1766 if (len < struct_size(ev, ap_list, ev->num_ap)) in ath6kl_wmi_aplist_event_rx()
1767 return -EINVAL; in ath6kl_wmi_aplist_event_rx()
1770 for (index = 0; index < ev->num_ap; index++) { in ath6kl_wmi_aplist_event_rx()
1772 index, ap_info_v1->bssid, ap_info_v1->channel); in ath6kl_wmi_aplist_event_rx()
1783 enum htc_endpoint_id ep_id = wmi->ep_id; in ath6kl_wmi_cmd_send()
1788 (if_idx > (wmi->parent_dev->vif_max - 1)))) { in ath6kl_wmi_cmd_send()
1790 return -EINVAL; in ath6kl_wmi_cmd_send()
1794 cmd_id, skb->len, sync_flag); in ath6kl_wmi_cmd_send()
1796 skb->data, skb->len); in ath6kl_wmi_cmd_send()
1800 return -EINVAL; in ath6kl_wmi_cmd_send()
1814 cmd_hdr = (struct wmi_cmd_hdr *) skb->data; in ath6kl_wmi_cmd_send()
1815 cmd_hdr->cmd_id = cpu_to_le16(cmd_id); in ath6kl_wmi_cmd_send()
1817 cmd_hdr->info1 = cpu_to_le16(info1); in ath6kl_wmi_cmd_send()
1827 ep_id = ath6kl_ac2_endpoint_id(wmi->parent_dev, WMM_AC_BE); in ath6kl_wmi_cmd_send()
1830 ath6kl_control_tx(wmi->parent_dev, skb, ep_id); in ath6kl_wmi_cmd_send()
1866 wmi->traffic_class = 100; in ath6kl_wmi_connect_cmd()
1869 return -EINVAL; in ath6kl_wmi_connect_cmd()
1872 return -EINVAL; in ath6kl_wmi_connect_cmd()
1876 return -ENOMEM; in ath6kl_wmi_connect_cmd()
1878 cc = (struct wmi_connect_cmd *) skb->data; in ath6kl_wmi_connect_cmd()
1881 memcpy(cc->ssid, ssid, ssid_len); in ath6kl_wmi_connect_cmd()
1883 cc->ssid_len = ssid_len; in ath6kl_wmi_connect_cmd()
1884 cc->nw_type = nw_type; in ath6kl_wmi_connect_cmd()
1885 cc->dot11_auth_mode = dot11_auth_mode; in ath6kl_wmi_connect_cmd()
1886 cc->auth_mode = auth_mode; in ath6kl_wmi_connect_cmd()
1887 cc->prwise_crypto_type = pairwise_crypto; in ath6kl_wmi_connect_cmd()
1888 cc->prwise_crypto_len = pairwise_crypto_len; in ath6kl_wmi_connect_cmd()
1889 cc->grp_crypto_type = group_crypto; in ath6kl_wmi_connect_cmd()
1890 cc->grp_crypto_len = group_crypto_len; in ath6kl_wmi_connect_cmd()
1891 cc->ch = cpu_to_le16(channel); in ath6kl_wmi_connect_cmd()
1892 cc->ctrl_flags = cpu_to_le32(ctrl_flags); in ath6kl_wmi_connect_cmd()
1893 cc->nw_subtype = nw_subtype; in ath6kl_wmi_connect_cmd()
1896 memcpy(cc->bssid, bssid, ETH_ALEN); in ath6kl_wmi_connect_cmd()
1914 wmi->traffic_class = 100; in ath6kl_wmi_reconnect_cmd()
1918 return -ENOMEM; in ath6kl_wmi_reconnect_cmd()
1920 cc = (struct wmi_reconnect_cmd *) skb->data; in ath6kl_wmi_reconnect_cmd()
1921 cc->channel = cpu_to_le16(channel); in ath6kl_wmi_reconnect_cmd()
1924 memcpy(cc->bssid, bssid, ETH_ALEN); in ath6kl_wmi_reconnect_cmd()
1938 wmi->traffic_class = 100; in ath6kl_wmi_disconnect_cmd()
1962 return -EINVAL; in ath6kl_wmi_startscan_cmd()
1965 return -EINVAL; in ath6kl_wmi_startscan_cmd()
1969 return -ENOMEM; in ath6kl_wmi_startscan_cmd()
1971 sc = (struct wmi_start_scan_cmd *) skb->data; in ath6kl_wmi_startscan_cmd()
1972 sc->scan_type = scan_type; in ath6kl_wmi_startscan_cmd()
1973 sc->force_fg_scan = cpu_to_le32(force_fgscan); in ath6kl_wmi_startscan_cmd()
1974 sc->is_legacy = cpu_to_le32(is_legacy); in ath6kl_wmi_startscan_cmd()
1975 sc->home_dwell_time = cpu_to_le32(home_dwell_time); in ath6kl_wmi_startscan_cmd()
1976 sc->force_scan_intvl = cpu_to_le32(force_scan_interval); in ath6kl_wmi_startscan_cmd()
1977 sc->num_ch = num_chan; in ath6kl_wmi_startscan_cmd()
1980 sc->ch_list[i] = cpu_to_le16(ch_list[i]); in ath6kl_wmi_startscan_cmd()
2004 struct ath6kl *ar = wmi->parent_dev; in ath6kl_wmi_beginscan_cmd()
2009 ar->fw_capabilities)) { in ath6kl_wmi_beginscan_cmd()
2018 return -EINVAL; in ath6kl_wmi_beginscan_cmd()
2021 return -EINVAL; in ath6kl_wmi_beginscan_cmd()
2025 return -ENOMEM; in ath6kl_wmi_beginscan_cmd()
2027 sc = (struct wmi_begin_scan_cmd *) skb->data; in ath6kl_wmi_beginscan_cmd()
2028 sc->scan_type = scan_type; in ath6kl_wmi_beginscan_cmd()
2029 sc->force_fg_scan = cpu_to_le32(force_fgscan); in ath6kl_wmi_beginscan_cmd()
2030 sc->is_legacy = cpu_to_le32(is_legacy); in ath6kl_wmi_beginscan_cmd()
2031 sc->home_dwell_time = cpu_to_le32(home_dwell_time); in ath6kl_wmi_beginscan_cmd()
2032 sc->force_scan_intvl = cpu_to_le32(force_scan_interval); in ath6kl_wmi_beginscan_cmd()
2033 sc->no_cck = cpu_to_le32(no_cck); in ath6kl_wmi_beginscan_cmd()
2034 sc->num_ch = num_chan; in ath6kl_wmi_beginscan_cmd()
2037 sband = ar->wiphy->bands[band]; in ath6kl_wmi_beginscan_cmd()
2046 supp_rates = sc->supp_rates[band].rates; in ath6kl_wmi_beginscan_cmd()
2049 for (i = 0; i < sband->n_bitrates; i++) { in ath6kl_wmi_beginscan_cmd()
2053 (u8) (sband->bitrates[i].bitrate / 5); in ath6kl_wmi_beginscan_cmd()
2055 sc->supp_rates[band].nrates = num_rates; in ath6kl_wmi_beginscan_cmd()
2059 sc->ch_list[i] = cpu_to_le16(ch_list[i]); in ath6kl_wmi_beginscan_cmd()
2075 return -ENOMEM; in ath6kl_wmi_enable_sched_scan_cmd()
2079 sc = (struct wmi_enable_sched_scan_cmd *) skb->data; in ath6kl_wmi_enable_sched_scan_cmd()
2080 sc->enable = enable ? 1 : 0; in ath6kl_wmi_enable_sched_scan_cmd()
2102 return -ENOMEM; in ath6kl_wmi_scanparams_cmd()
2104 sc = (struct wmi_scan_params_cmd *) skb->data; in ath6kl_wmi_scanparams_cmd()
2105 sc->fg_start_period = cpu_to_le16(fg_start_sec); in ath6kl_wmi_scanparams_cmd()
2106 sc->fg_end_period = cpu_to_le16(fg_end_sec); in ath6kl_wmi_scanparams_cmd()
2107 sc->bg_period = cpu_to_le16(bg_sec); in ath6kl_wmi_scanparams_cmd()
2108 sc->minact_chdwell_time = cpu_to_le16(minact_chdw_msec); in ath6kl_wmi_scanparams_cmd()
2109 sc->maxact_chdwell_time = cpu_to_le16(maxact_chdw_msec); in ath6kl_wmi_scanparams_cmd()
2110 sc->pas_chdwell_time = cpu_to_le16(pas_chdw_msec); in ath6kl_wmi_scanparams_cmd()
2111 sc->short_scan_ratio = short_scan_ratio; in ath6kl_wmi_scanparams_cmd()
2112 sc->scan_ctrl_flags = scan_ctrl_flag; in ath6kl_wmi_scanparams_cmd()
2113 sc->max_dfsch_act_time = cpu_to_le32(max_dfsch_act_time); in ath6kl_wmi_scanparams_cmd()
2114 sc->maxact_scan_per_ssid = cpu_to_le16(maxact_scan_per_ssid); in ath6kl_wmi_scanparams_cmd()
2128 return -EINVAL; in ath6kl_wmi_bssfilter_cmd()
2132 return -ENOMEM; in ath6kl_wmi_bssfilter_cmd()
2134 cmd = (struct wmi_bss_filter_cmd *) skb->data; in ath6kl_wmi_bssfilter_cmd()
2135 cmd->bss_filter = filter; in ath6kl_wmi_bssfilter_cmd()
2136 cmd->ie_mask = cpu_to_le32(ie_mask); in ath6kl_wmi_bssfilter_cmd()
2151 return -EINVAL; in ath6kl_wmi_probedssid_cmd()
2153 if (ssid_len > sizeof(cmd->ssid)) in ath6kl_wmi_probedssid_cmd()
2154 return -EINVAL; in ath6kl_wmi_probedssid_cmd()
2157 return -EINVAL; in ath6kl_wmi_probedssid_cmd()
2160 return -EINVAL; in ath6kl_wmi_probedssid_cmd()
2163 wmi->is_probe_ssid = true; in ath6kl_wmi_probedssid_cmd()
2167 return -ENOMEM; in ath6kl_wmi_probedssid_cmd()
2169 cmd = (struct wmi_probed_ssid_cmd *) skb->data; in ath6kl_wmi_probedssid_cmd()
2170 cmd->entry_index = index; in ath6kl_wmi_probedssid_cmd()
2171 cmd->flag = flag; in ath6kl_wmi_probedssid_cmd()
2172 cmd->ssid_len = ssid_len; in ath6kl_wmi_probedssid_cmd()
2173 memcpy(cmd->ssid, ssid, ssid_len); in ath6kl_wmi_probedssid_cmd()
2190 return -ENOMEM; in ath6kl_wmi_listeninterval_cmd()
2192 cmd = (struct wmi_listen_int_cmd *) skb->data; in ath6kl_wmi_listeninterval_cmd()
2193 cmd->listen_intvl = cpu_to_le16(listen_interval); in ath6kl_wmi_listeninterval_cmd()
2194 cmd->num_beacons = cpu_to_le16(listen_beacons); in ath6kl_wmi_listeninterval_cmd()
2210 return -ENOMEM; in ath6kl_wmi_bmisstime_cmd()
2212 cmd = (struct wmi_bmiss_time_cmd *) skb->data; in ath6kl_wmi_bmisstime_cmd()
2213 cmd->bmiss_time = cpu_to_le16(bmiss_time); in ath6kl_wmi_bmisstime_cmd()
2214 cmd->num_beacons = cpu_to_le16(num_beacons); in ath6kl_wmi_bmisstime_cmd()
2229 return -ENOMEM; in ath6kl_wmi_powermode_cmd()
2231 cmd = (struct wmi_power_mode_cmd *) skb->data; in ath6kl_wmi_powermode_cmd()
2232 cmd->pwr_mode = pwr_mode; in ath6kl_wmi_powermode_cmd()
2233 wmi->pwr_mode = pwr_mode; in ath6kl_wmi_powermode_cmd()
2251 return -ENOMEM; in ath6kl_wmi_pmparams_cmd()
2253 pm = (struct wmi_power_params_cmd *)skb->data; in ath6kl_wmi_pmparams_cmd()
2254 pm->idle_period = cpu_to_le16(idle_period); in ath6kl_wmi_pmparams_cmd()
2255 pm->pspoll_number = cpu_to_le16(ps_poll_num); in ath6kl_wmi_pmparams_cmd()
2256 pm->dtim_policy = cpu_to_le16(dtim_policy); in ath6kl_wmi_pmparams_cmd()
2257 pm->tx_wakeup_policy = cpu_to_le16(tx_wakeup_policy); in ath6kl_wmi_pmparams_cmd()
2258 pm->num_tx_to_wakeup = cpu_to_le16(num_tx_to_wakeup); in ath6kl_wmi_pmparams_cmd()
2259 pm->ps_fail_event_policy = cpu_to_le16(ps_fail_event_policy); in ath6kl_wmi_pmparams_cmd()
2274 return -ENOMEM; in ath6kl_wmi_disctimeout_cmd()
2276 cmd = (struct wmi_disc_timeout_cmd *) skb->data; in ath6kl_wmi_disctimeout_cmd()
2277 cmd->discon_timeout = timeout; in ath6kl_wmi_disctimeout_cmd()
2283 ath6kl_debug_set_disconnect_timeout(wmi->parent_dev, timeout); in ath6kl_wmi_disctimeout_cmd()
2306 return -EINVAL; in ath6kl_wmi_addkey_cmd()
2309 return -EINVAL; in ath6kl_wmi_addkey_cmd()
2313 return -ENOMEM; in ath6kl_wmi_addkey_cmd()
2315 cmd = (struct wmi_add_cipher_key_cmd *) skb->data; in ath6kl_wmi_addkey_cmd()
2316 cmd->key_index = key_index; in ath6kl_wmi_addkey_cmd()
2317 cmd->key_type = key_type; in ath6kl_wmi_addkey_cmd()
2318 cmd->key_usage = key_usage; in ath6kl_wmi_addkey_cmd()
2319 cmd->key_len = key_len; in ath6kl_wmi_addkey_cmd()
2320 memcpy(cmd->key, key_material, key_len); in ath6kl_wmi_addkey_cmd()
2323 memcpy(cmd->key_rsc, key_rsc, key_rsc_len); in ath6kl_wmi_addkey_cmd()
2325 cmd->key_op_ctrl = key_op_ctrl; in ath6kl_wmi_addkey_cmd()
2328 memcpy(cmd->key_mac_addr, mac_addr, ETH_ALEN); in ath6kl_wmi_addkey_cmd()
2344 return -ENOMEM; in ath6kl_wmi_add_krk_cmd()
2346 cmd = (struct wmi_add_krk_cmd *) skb->data; in ath6kl_wmi_add_krk_cmd()
2347 memcpy(cmd->krk, krk, WMI_KRK_LEN); in ath6kl_wmi_add_krk_cmd()
2362 return -EINVAL; in ath6kl_wmi_deletekey_cmd()
2366 return -ENOMEM; in ath6kl_wmi_deletekey_cmd()
2368 cmd = (struct wmi_delete_cipher_key_cmd *) skb->data; in ath6kl_wmi_deletekey_cmd()
2369 cmd->key_index = key_index; in ath6kl_wmi_deletekey_cmd()
2385 return -EINVAL; in ath6kl_wmi_setpmkid_cmd()
2388 return -EINVAL; in ath6kl_wmi_setpmkid_cmd()
2392 return -ENOMEM; in ath6kl_wmi_setpmkid_cmd()
2394 cmd = (struct wmi_setpmkid_cmd *) skb->data; in ath6kl_wmi_setpmkid_cmd()
2395 memcpy(cmd->bssid, bssid, ETH_ALEN); in ath6kl_wmi_setpmkid_cmd()
2397 memcpy(cmd->pmkid, pmkid, sizeof(cmd->pmkid)); in ath6kl_wmi_setpmkid_cmd()
2398 cmd->enable = PMKID_ENABLE; in ath6kl_wmi_setpmkid_cmd()
2400 memset(cmd->pmkid, 0, sizeof(cmd->pmkid)); in ath6kl_wmi_setpmkid_cmd()
2401 cmd->enable = PMKID_DISABLE; in ath6kl_wmi_setpmkid_cmd()
2416 if (WARN_ON(skb == NULL || ep_id == wmi->ep_id)) { in ath6kl_wmi_data_sync_send()
2418 return -EINVAL; in ath6kl_wmi_data_sync_send()
2423 data_hdr = (struct wmi_data_hdr *) skb->data; in ath6kl_wmi_data_sync_send()
2424 data_hdr->info = SYNC_MSGTYPE << WMI_DATA_HDR_MSG_TYPE_SHIFT; in ath6kl_wmi_data_sync_send()
2425 data_hdr->info3 = cpu_to_le16(if_idx & WMI_DATA_HDR_IF_IDX_MASK); in ath6kl_wmi_data_sync_send()
2427 ret = ath6kl_control_tx(wmi->parent_dev, skb, ep_id); in ath6kl_wmi_data_sync_send()
2443 spin_lock_bh(&wmi->lock); in ath6kl_wmi_sync_point()
2446 if (wmi->fat_pipe_exist & (1 << index)) { in ath6kl_wmi_sync_point()
2448 data_sync_bufs[num_pri_streams - 1].traffic_class = in ath6kl_wmi_sync_point()
2453 spin_unlock_bh(&wmi->lock); in ath6kl_wmi_sync_point()
2457 return -ENOMEM; in ath6kl_wmi_sync_point()
2459 cmd = (struct wmi_sync_cmd *) skb->data; in ath6kl_wmi_sync_point()
2465 cmd->data_sync_map = wmi->fat_pipe_exist; in ath6kl_wmi_sync_point()
2470 ret = -ENOMEM; in ath6kl_wmi_sync_point()
2494 ret = -ENOMEM; in ath6kl_wmi_sync_point()
2498 ep_id = ath6kl_ac2_endpoint_id(wmi->parent_dev, in ath6kl_wmi_sync_point()
2534 if (!((params->user_pri <= 0x7) && in ath6kl_wmi_create_pstream_cmd()
2535 (up_to_ac[params->user_pri & 0x7] == params->traffic_class) && in ath6kl_wmi_create_pstream_cmd()
2536 (params->traffic_direc == UPLINK_TRAFFIC || in ath6kl_wmi_create_pstream_cmd()
2537 params->traffic_direc == DNLINK_TRAFFIC || in ath6kl_wmi_create_pstream_cmd()
2538 params->traffic_direc == BIDIR_TRAFFIC) && in ath6kl_wmi_create_pstream_cmd()
2539 (params->traffic_type == TRAFFIC_TYPE_APERIODIC || in ath6kl_wmi_create_pstream_cmd()
2540 params->traffic_type == TRAFFIC_TYPE_PERIODIC) && in ath6kl_wmi_create_pstream_cmd()
2541 (params->voice_psc_cap == DISABLE_FOR_THIS_AC || in ath6kl_wmi_create_pstream_cmd()
2542 params->voice_psc_cap == ENABLE_FOR_THIS_AC || in ath6kl_wmi_create_pstream_cmd()
2543 params->voice_psc_cap == ENABLE_FOR_ALL_AC) && in ath6kl_wmi_create_pstream_cmd()
2544 (params->tsid == WMI_IMPLICIT_PSTREAM || in ath6kl_wmi_create_pstream_cmd()
2545 params->tsid <= WMI_MAX_THINSTREAM))) { in ath6kl_wmi_create_pstream_cmd()
2546 return -EINVAL; in ath6kl_wmi_create_pstream_cmd()
2555 min_phy = ((le32_to_cpu(params->min_phy_rate) / 1000) / 1000); in ath6kl_wmi_create_pstream_cmd()
2558 if (params->nominal_phy >= min_phy) { in ath6kl_wmi_create_pstream_cmd()
2560 nominal_phy = (params->nominal_phy * 1000) / 500; in ath6kl_wmi_create_pstream_cmd()
2562 "TSRS IE enabled::MinPhy %x->NominalPhy ===> %x\n", in ath6kl_wmi_create_pstream_cmd()
2565 params->nominal_phy = nominal_phy; in ath6kl_wmi_create_pstream_cmd()
2567 params->nominal_phy = 0; in ath6kl_wmi_create_pstream_cmd()
2572 return -ENOMEM; in ath6kl_wmi_create_pstream_cmd()
2576 params->traffic_class, params->tsid); in ath6kl_wmi_create_pstream_cmd()
2578 cmd = (struct wmi_create_pstream_cmd *) skb->data; in ath6kl_wmi_create_pstream_cmd()
2582 if ((u32) params->tsid == (u32) WMI_IMPLICIT_PSTREAM) { in ath6kl_wmi_create_pstream_cmd()
2583 spin_lock_bh(&wmi->lock); in ath6kl_wmi_create_pstream_cmd()
2584 fatpipe_exist_for_ac = (wmi->fat_pipe_exist & in ath6kl_wmi_create_pstream_cmd()
2585 (1 << params->traffic_class)); in ath6kl_wmi_create_pstream_cmd()
2586 wmi->fat_pipe_exist |= (1 << params->traffic_class); in ath6kl_wmi_create_pstream_cmd()
2587 spin_unlock_bh(&wmi->lock); in ath6kl_wmi_create_pstream_cmd()
2590 spin_lock_bh(&wmi->lock); in ath6kl_wmi_create_pstream_cmd()
2591 fatpipe_exist_for_ac = (wmi->fat_pipe_exist & in ath6kl_wmi_create_pstream_cmd()
2592 (1 << params->traffic_class)); in ath6kl_wmi_create_pstream_cmd()
2593 wmi->stream_exist_for_ac[params->traffic_class] |= in ath6kl_wmi_create_pstream_cmd()
2594 (1 << params->tsid); in ath6kl_wmi_create_pstream_cmd()
2599 wmi->fat_pipe_exist |= (1 << params->traffic_class); in ath6kl_wmi_create_pstream_cmd()
2600 spin_unlock_bh(&wmi->lock); in ath6kl_wmi_create_pstream_cmd()
2609 ath6kl_indicate_tx_activity(wmi->parent_dev, in ath6kl_wmi_create_pstream_cmd()
2610 params->traffic_class, true); in ath6kl_wmi_create_pstream_cmd()
2627 return -EINVAL; in ath6kl_wmi_delete_pstream_cmd()
2632 return -EINVAL; in ath6kl_wmi_delete_pstream_cmd()
2637 return -ENOMEM; in ath6kl_wmi_delete_pstream_cmd()
2639 cmd = (struct wmi_delete_pstream_cmd *) skb->data; in ath6kl_wmi_delete_pstream_cmd()
2640 cmd->traffic_class = traffic_class; in ath6kl_wmi_delete_pstream_cmd()
2641 cmd->tsid = tsid; in ath6kl_wmi_delete_pstream_cmd()
2643 spin_lock_bh(&wmi->lock); in ath6kl_wmi_delete_pstream_cmd()
2644 active_tsids = wmi->stream_exist_for_ac[traffic_class]; in ath6kl_wmi_delete_pstream_cmd()
2645 spin_unlock_bh(&wmi->lock); in ath6kl_wmi_delete_pstream_cmd()
2652 return -ENODATA; in ath6kl_wmi_delete_pstream_cmd()
2662 spin_lock_bh(&wmi->lock); in ath6kl_wmi_delete_pstream_cmd()
2663 wmi->stream_exist_for_ac[traffic_class] &= ~(1 << tsid); in ath6kl_wmi_delete_pstream_cmd()
2664 active_tsids = wmi->stream_exist_for_ac[traffic_class]; in ath6kl_wmi_delete_pstream_cmd()
2665 spin_unlock_bh(&wmi->lock); in ath6kl_wmi_delete_pstream_cmd()
2672 ath6kl_indicate_tx_activity(wmi->parent_dev, in ath6kl_wmi_delete_pstream_cmd()
2674 wmi->fat_pipe_exist &= ~(1 << traffic_class); in ath6kl_wmi_delete_pstream_cmd()
2690 return -EINVAL; in ath6kl_wmi_set_ip_cmd()
2694 return -ENOMEM; in ath6kl_wmi_set_ip_cmd()
2696 cmd = (struct wmi_set_ip_cmd *) skb->data; in ath6kl_wmi_set_ip_cmd()
2697 cmd->ips[0] = ips0; in ath6kl_wmi_set_ip_cmd()
2698 cmd->ips[1] = ips1; in ath6kl_wmi_set_ip_cmd()
2717 spin_lock_bh(&wmi->lock); in ath6kl_wmi_relinquish_implicit_pstream_credits()
2718 stream_exist = wmi->fat_pipe_exist; in ath6kl_wmi_relinquish_implicit_pstream_credits()
2719 spin_unlock_bh(&wmi->lock); in ath6kl_wmi_relinquish_implicit_pstream_credits()
2727 spin_lock_bh(&wmi->lock); in ath6kl_wmi_relinquish_implicit_pstream_credits()
2728 active_tsids = wmi->stream_exist_for_ac[i]; in ath6kl_wmi_relinquish_implicit_pstream_credits()
2729 spin_unlock_bh(&wmi->lock); in ath6kl_wmi_relinquish_implicit_pstream_credits()
2741 ath6kl_indicate_tx_activity(wmi->parent_dev, in ath6kl_wmi_relinquish_implicit_pstream_credits()
2748 spin_lock_bh(&wmi->lock); in ath6kl_wmi_relinquish_implicit_pstream_credits()
2749 wmi->fat_pipe_exist = stream_exist; in ath6kl_wmi_relinquish_implicit_pstream_credits()
2750 spin_unlock_bh(&wmi->lock); in ath6kl_wmi_relinquish_implicit_pstream_credits()
2766 ratemask[band] = mask->control[band].legacy; in ath6kl_set_bitrate_mask64()
2769 mask->control[band].legacy << 4; in ath6kl_set_bitrate_mask64()
2772 mcsrate = mask->control[band].ht_mcs[1]; in ath6kl_set_bitrate_mask64()
2774 mcsrate |= mask->control[band].ht_mcs[0]; in ath6kl_set_bitrate_mask64()
2785 return -ENOMEM; in ath6kl_set_bitrate_mask64()
2787 cmd = (struct wmi_set_tx_select_rates64_cmd *) skb->data; in ath6kl_set_bitrate_mask64()
2796 cmd->ratemask[mode] = cpu_to_le64(ratemask[band]); in ath6kl_set_bitrate_mask64()
2818 ratemask[band] = mask->control[band].legacy; in ath6kl_set_bitrate_mask32()
2821 mask->control[band].legacy << 4; in ath6kl_set_bitrate_mask32()
2824 mcsrate = mask->control[band].ht_mcs[0]; in ath6kl_set_bitrate_mask32()
2835 return -ENOMEM; in ath6kl_set_bitrate_mask32()
2837 cmd = (struct wmi_set_tx_select_rates32_cmd *) skb->data; in ath6kl_set_bitrate_mask32()
2846 cmd->ratemask[mode] = cpu_to_le32(ratemask[band]); in ath6kl_set_bitrate_mask32()
2858 struct ath6kl *ar = wmi->parent_dev; in ath6kl_wmi_set_bitrate_mask()
2861 ar->fw_capabilities)) in ath6kl_wmi_set_bitrate_mask()
2877 return -EINVAL; in ath6kl_wmi_set_host_sleep_mode_cmd()
2882 return -ENOMEM; in ath6kl_wmi_set_host_sleep_mode_cmd()
2884 cmd = (struct wmi_set_host_sleep_mode_cmd *) skb->data; in ath6kl_wmi_set_host_sleep_mode_cmd()
2888 cmd->asleep = cpu_to_le32(1); in ath6kl_wmi_set_host_sleep_mode_cmd()
2890 cmd->awake = cpu_to_le32(1); in ath6kl_wmi_set_host_sleep_mode_cmd()
2903 struct ath6kl *ar = wmi->parent_dev; in ath6kl_wmi_host_sleep_mode_cmd_prcd_evt_rx()
2905 set_bit(HOST_SLEEP_MODE_CMD_PROCESSED, &vif->flags); in ath6kl_wmi_host_sleep_mode_cmd_prcd_evt_rx()
2906 wake_up(&ar->event_wq); in ath6kl_wmi_host_sleep_mode_cmd_prcd_evt_rx()
2922 return -EINVAL; in ath6kl_wmi_set_wow_mode_cmd()
2927 return -ENOMEM; in ath6kl_wmi_set_wow_mode_cmd()
2929 cmd = (struct wmi_set_wow_mode_cmd *) skb->data; in ath6kl_wmi_set_wow_mode_cmd()
2930 cmd->enable_wow = cpu_to_le32(wow_mode); in ath6kl_wmi_set_wow_mode_cmd()
2931 cmd->filter = cpu_to_le32(filter); in ath6kl_wmi_set_wow_mode_cmd()
2932 cmd->host_req_delay = cpu_to_le16(host_req_delay); in ath6kl_wmi_set_wow_mode_cmd()
2958 return -ENOMEM; in ath6kl_wmi_add_wow_pattern_cmd()
2960 cmd = (struct wmi_add_wow_pattern_cmd *) skb->data; in ath6kl_wmi_add_wow_pattern_cmd()
2961 cmd->filter_list_id = list_id; in ath6kl_wmi_add_wow_pattern_cmd()
2962 cmd->filter_size = filter_size; in ath6kl_wmi_add_wow_pattern_cmd()
2963 cmd->filter_offset = filter_offset; in ath6kl_wmi_add_wow_pattern_cmd()
2965 memcpy(cmd->filter, filter, filter_size); in ath6kl_wmi_add_wow_pattern_cmd()
2967 filter_mask = (u8 *) (cmd->filter + filter_size); in ath6kl_wmi_add_wow_pattern_cmd()
2985 return -ENOMEM; in ath6kl_wmi_del_wow_pattern_cmd()
2987 cmd = (struct wmi_del_wow_pattern_cmd *) skb->data; in ath6kl_wmi_del_wow_pattern_cmd()
2988 cmd->filter_list_id = cpu_to_le16(list_id); in ath6kl_wmi_del_wow_pattern_cmd()
2989 cmd->filter_id = cpu_to_le16(filter_id); in ath6kl_wmi_del_wow_pattern_cmd()
3005 cmd_hdr = (struct wmix_cmd_hdr *) skb->data; in ath6kl_wmi_cmd_send_xtnd()
3006 cmd_hdr->cmd_id = cpu_to_le32(cmd_id); in ath6kl_wmi_cmd_send_xtnd()
3021 return -ENOMEM; in ath6kl_wmi_get_challenge_resp_cmd()
3023 cmd = (struct wmix_hb_challenge_resp_cmd *) skb->data; in ath6kl_wmi_get_challenge_resp_cmd()
3024 cmd->cookie = cpu_to_le32(cookie); in ath6kl_wmi_get_challenge_resp_cmd()
3025 cmd->source = cpu_to_le32(source); in ath6kl_wmi_get_challenge_resp_cmd()
3040 return -ENOMEM; in ath6kl_wmi_config_debug_module_cmd()
3042 cmd = (struct ath6kl_wmix_dbglog_cfg_module_cmd *) skb->data; in ath6kl_wmi_config_debug_module_cmd()
3043 cmd->valid = cpu_to_le32(valid); in ath6kl_wmi_config_debug_module_cmd()
3044 cmd->config = cpu_to_le32(config); in ath6kl_wmi_config_debug_module_cmd()
3064 return -ENOMEM; in ath6kl_wmi_set_tx_pwr_cmd()
3066 cmd = (struct wmi_set_tx_pwr_cmd *) skb->data; in ath6kl_wmi_set_tx_pwr_cmd()
3067 cmd->dbM = dbM; in ath6kl_wmi_set_tx_pwr_cmd()
3094 return -ENOMEM; in ath6kl_wmi_set_lpreamble_cmd()
3096 cmd = (struct wmi_set_lpreamble_cmd *) skb->data; in ath6kl_wmi_set_lpreamble_cmd()
3097 cmd->status = status; in ath6kl_wmi_set_lpreamble_cmd()
3098 cmd->preamble_policy = preamble_policy; in ath6kl_wmi_set_lpreamble_cmd()
3113 return -ENOMEM; in ath6kl_wmi_set_rts_cmd()
3115 cmd = (struct wmi_set_rts_cmd *) skb->data; in ath6kl_wmi_set_rts_cmd()
3116 cmd->threshold = cpu_to_le16(threshold); in ath6kl_wmi_set_rts_cmd()
3130 return -EINVAL; in ath6kl_wmi_set_wmm_txop()
3134 return -ENOMEM; in ath6kl_wmi_set_wmm_txop()
3136 cmd = (struct wmi_set_wmm_txop_cmd *) skb->data; in ath6kl_wmi_set_wmm_txop()
3137 cmd->txop_enable = cfg; in ath6kl_wmi_set_wmm_txop()
3153 return -ENOMEM; in ath6kl_wmi_set_keepalive_cmd()
3155 cmd = (struct wmi_set_keepalive_cmd *) skb->data; in ath6kl_wmi_set_keepalive_cmd()
3156 cmd->keep_alive_intvl = keep_alive_intvl; in ath6kl_wmi_set_keepalive_cmd()
3162 ath6kl_debug_set_keepalive(wmi->parent_dev, keep_alive_intvl); in ath6kl_wmi_set_keepalive_cmd()
3176 return -ENOMEM; in ath6kl_wmi_set_htcap_cmd()
3178 cmd = (struct wmi_set_htcap_cmd *) skb->data; in ath6kl_wmi_set_htcap_cmd()
3185 cmd->band = band; in ath6kl_wmi_set_htcap_cmd()
3186 cmd->ht_enable = !!htcap->ht_enable; in ath6kl_wmi_set_htcap_cmd()
3187 cmd->ht20_sgi = !!(htcap->cap_info & IEEE80211_HT_CAP_SGI_20); in ath6kl_wmi_set_htcap_cmd()
3188 cmd->ht40_supported = in ath6kl_wmi_set_htcap_cmd()
3189 !!(htcap->cap_info & IEEE80211_HT_CAP_SUP_WIDTH_20_40); in ath6kl_wmi_set_htcap_cmd()
3190 cmd->ht40_sgi = !!(htcap->cap_info & IEEE80211_HT_CAP_SGI_40); in ath6kl_wmi_set_htcap_cmd()
3191 cmd->intolerant_40mhz = in ath6kl_wmi_set_htcap_cmd()
3192 !!(htcap->cap_info & IEEE80211_HT_CAP_40MHZ_INTOLERANT); in ath6kl_wmi_set_htcap_cmd()
3193 cmd->max_ampdu_len_exp = htcap->ampdu_factor; in ath6kl_wmi_set_htcap_cmd()
3197 cmd->band, cmd->ht_enable, cmd->ht40_supported, in ath6kl_wmi_set_htcap_cmd()
3198 cmd->ht20_sgi, cmd->ht40_sgi, cmd->intolerant_40mhz, in ath6kl_wmi_set_htcap_cmd()
3199 cmd->max_ampdu_len_exp); in ath6kl_wmi_set_htcap_cmd()
3211 return -ENOMEM; in ath6kl_wmi_test_cmd()
3213 memcpy(skb->data, buf, len); in ath6kl_wmi_test_cmd()
3228 return -ENOMEM; in ath6kl_wmi_mcast_filter_cmd()
3230 cmd = (struct wmi_mcast_filter_cmd *) skb->data; in ath6kl_wmi_mcast_filter_cmd()
3231 cmd->mcast_all_enable = mc_all_on; in ath6kl_wmi_mcast_filter_cmd()
3249 return -EINVAL; in ath6kl_wmi_add_del_mcast_filter_cmd()
3254 return -ENOMEM; in ath6kl_wmi_add_del_mcast_filter_cmd()
3256 cmd = (struct wmi_mcast_filter_add_del_cmd *) skb->data; in ath6kl_wmi_add_del_mcast_filter_cmd()
3257 memcpy(cmd->mcast_mac, filter, ATH6KL_MCAST_FILTER_MAC_ADDR_SIZE); in ath6kl_wmi_add_del_mcast_filter_cmd()
3274 return -ENOMEM; in ath6kl_wmi_sta_bmiss_enhance_cmd()
3276 cmd = (struct wmi_sta_bmiss_enhance_cmd *) skb->data; in ath6kl_wmi_sta_bmiss_enhance_cmd()
3277 cmd->enable = enhance ? 1 : 0; in ath6kl_wmi_sta_bmiss_enhance_cmd()
3292 return -ENOMEM; in ath6kl_wmi_set_regdomain_cmd()
3294 cmd = (struct wmi_set_regdomain_cmd *) skb->data; in ath6kl_wmi_set_regdomain_cmd()
3295 memcpy(cmd->iso_name, alpha2, 2); in ath6kl_wmi_set_regdomain_cmd()
3304 struct ath6kl *ar = wmi->parent_dev; in ath6kl_wmi_get_rate()
3318 ar->fw_capabilities)) { in ath6kl_wmi_get_rate()
3340 return -EINVAL; in ath6kl_wmi_get_pmkid_list_event_rx()
3343 expected_len = sizeof(reply->num_pmkid) + in ath6kl_wmi_get_pmkid_list_event_rx()
3344 le32_to_cpu(reply->num_pmkid) * WMI_PMKID_LEN; in ath6kl_wmi_get_pmkid_list_event_rx()
3347 return -EINVAL; in ath6kl_wmi_get_pmkid_list_event_rx()
3357 aggr_recv_addba_req_evt(vif, cmd->tid, in ath6kl_wmi_addba_req_event_rx()
3358 le16_to_cpu(cmd->st_seq_no), cmd->win_sz); in ath6kl_wmi_addba_req_event_rx()
3368 aggr_recv_delba_req_evt(vif, cmd->tid); in ath6kl_wmi_delba_req_event_rx()
3384 return -ENOMEM; in ath6kl_wmi_ap_profile_commit()
3386 cm = (struct wmi_connect_cmd *) skb->data; in ath6kl_wmi_ap_profile_commit()
3392 "%s: nw_type=%u auth_mode=%u ch=%u ctrl_flags=0x%x-> res=%d\n", in ath6kl_wmi_ap_profile_commit()
3393 __func__, p->nw_type, p->auth_mode, le16_to_cpu(p->ch), in ath6kl_wmi_ap_profile_commit()
3394 le32_to_cpu(p->ctrl_flags), res); in ath6kl_wmi_ap_profile_commit()
3406 return -ENOMEM; in ath6kl_wmi_ap_set_mlme()
3408 cm = (struct wmi_ap_set_mlme_cmd *) skb->data; in ath6kl_wmi_ap_set_mlme()
3409 memcpy(cm->mac, mac, ETH_ALEN); in ath6kl_wmi_ap_set_mlme()
3410 cm->reason = cpu_to_le16(reason); in ath6kl_wmi_ap_set_mlme()
3411 cm->cmd = cmd; in ath6kl_wmi_ap_set_mlme()
3413 ath6kl_dbg(ATH6KL_DBG_WMI, "ap_set_mlme: cmd=%d reason=%d\n", cm->cmd, in ath6kl_wmi_ap_set_mlme()
3414 cm->reason); in ath6kl_wmi_ap_set_mlme()
3427 return -ENOMEM; in ath6kl_wmi_ap_hidden_ssid()
3429 cmd = (struct wmi_ap_hidden_ssid_cmd *) skb->data; in ath6kl_wmi_ap_hidden_ssid()
3430 cmd->hidden_ssid = enable ? 1 : 0; in ath6kl_wmi_ap_hidden_ssid()
3444 return -ENOMEM; in ath6kl_wmi_ap_set_apsd()
3446 cmd = (struct wmi_ap_set_apsd_cmd *)skb->data; in ath6kl_wmi_ap_set_apsd()
3447 cmd->enable = enable; in ath6kl_wmi_ap_set_apsd()
3461 return -ENOMEM; in ath6kl_wmi_set_apsd_bfrd_traf()
3463 cmd = (struct wmi_ap_apsd_buffered_traffic_cmd *)skb->data; in ath6kl_wmi_set_apsd_bfrd_traf()
3464 cmd->aid = cpu_to_le16(aid); in ath6kl_wmi_set_apsd_bfrd_traf()
3465 cmd->bitmap = cpu_to_le16(bitmap); in ath6kl_wmi_set_apsd_bfrd_traf()
3466 cmd->flags = cpu_to_le32(flags); in ath6kl_wmi_set_apsd_bfrd_traf()
3479 return -EINVAL; in ath6kl_wmi_pspoll_event_rx()
3483 ath6kl_pspoll_event(vif, le16_to_cpu(ev->aid)); in ath6kl_wmi_pspoll_event_rx()
3505 return -ENOMEM; in ath6kl_wmi_set_pvb_cmd()
3507 cmd = (struct wmi_ap_set_pvb_cmd *) skb->data; in ath6kl_wmi_set_pvb_cmd()
3508 cmd->aid = cpu_to_le16(aid); in ath6kl_wmi_set_pvb_cmd()
3509 cmd->rsvd = cpu_to_le16(0); in ath6kl_wmi_set_pvb_cmd()
3510 cmd->flag = cpu_to_le32(flag); in ath6kl_wmi_set_pvb_cmd()
3528 return -ENOMEM; in ath6kl_wmi_set_rx_frame_format_cmd()
3530 cmd = (struct wmi_rx_frame_format_cmd *) skb->data; in ath6kl_wmi_set_rx_frame_format_cmd()
3531 cmd->dot11_hdr = rx_dot11_hdr ? 1 : 0; in ath6kl_wmi_set_rx_frame_format_cmd()
3532 cmd->defrag_on_host = defrag_on_host ? 1 : 0; in ath6kl_wmi_set_rx_frame_format_cmd()
3533 cmd->meta_ver = rx_meta_ver; in ath6kl_wmi_set_rx_frame_format_cmd()
3550 return -ENOMEM; in ath6kl_wmi_set_appie_cmd()
3555 p = (struct wmi_set_appie_cmd *) skb->data; in ath6kl_wmi_set_appie_cmd()
3556 p->mgmt_frm_type = mgmt_frm_type; in ath6kl_wmi_set_appie_cmd()
3557 p->ie_len = ie_len; in ath6kl_wmi_set_appie_cmd()
3560 memcpy(p->ie_info, ie, ie_len); in ath6kl_wmi_set_appie_cmd()
3574 return -ENOMEM; in ath6kl_wmi_set_ie_cmd()
3578 p = (struct wmi_set_ie_cmd *) skb->data; in ath6kl_wmi_set_ie_cmd()
3579 p->ie_id = ie_id; in ath6kl_wmi_set_ie_cmd()
3580 p->ie_field = ie_field; in ath6kl_wmi_set_ie_cmd()
3581 p->ie_len = ie_len; in ath6kl_wmi_set_ie_cmd()
3583 memcpy(p->ie_info, ie_info, ie_len); in ath6kl_wmi_set_ie_cmd()
3596 return -ENOMEM; in ath6kl_wmi_disable_11b_rates_cmd()
3600 cmd = (struct wmi_disable_11b_rates_cmd *) skb->data; in ath6kl_wmi_disable_11b_rates_cmd()
3601 cmd->disable = disable ? 1 : 0; in ath6kl_wmi_disable_11b_rates_cmd()
3614 return -ENOMEM; in ath6kl_wmi_remain_on_chnl_cmd()
3618 p = (struct wmi_remain_on_chnl_cmd *) skb->data; in ath6kl_wmi_remain_on_chnl_cmd()
3619 p->freq = cpu_to_le32(freq); in ath6kl_wmi_remain_on_chnl_cmd()
3620 p->duration = cpu_to_le32(dur); in ath6kl_wmi_remain_on_chnl_cmd()
3638 return -EINVAL; /* Offload for wait not supported */ in ath6kl_wmi_send_action_cmd()
3642 return -ENOMEM; in ath6kl_wmi_send_action_cmd()
3647 return -ENOMEM; in ath6kl_wmi_send_action_cmd()
3650 kfree(wmi->last_mgmt_tx_frame); in ath6kl_wmi_send_action_cmd()
3651 wmi->last_mgmt_tx_frame = buf; in ath6kl_wmi_send_action_cmd()
3652 wmi->last_mgmt_tx_frame_len = data_len; in ath6kl_wmi_send_action_cmd()
3657 p = (struct wmi_send_action_cmd *) skb->data; in ath6kl_wmi_send_action_cmd()
3658 p->id = cpu_to_le32(id); in ath6kl_wmi_send_action_cmd()
3659 p->freq = cpu_to_le32(freq); in ath6kl_wmi_send_action_cmd()
3660 p->wait = cpu_to_le32(wait); in ath6kl_wmi_send_action_cmd()
3661 p->len = cpu_to_le16(data_len); in ath6kl_wmi_send_action_cmd()
3662 memcpy(p->data, data, data_len); in ath6kl_wmi_send_action_cmd()
3676 return -EINVAL; /* Offload for wait not supported */ in __ath6kl_wmi_send_mgmt_cmd()
3680 return -ENOMEM; in __ath6kl_wmi_send_mgmt_cmd()
3685 return -ENOMEM; in __ath6kl_wmi_send_mgmt_cmd()
3688 kfree(wmi->last_mgmt_tx_frame); in __ath6kl_wmi_send_mgmt_cmd()
3689 wmi->last_mgmt_tx_frame = buf; in __ath6kl_wmi_send_mgmt_cmd()
3690 wmi->last_mgmt_tx_frame_len = data_len; in __ath6kl_wmi_send_mgmt_cmd()
3695 p = (struct wmi_send_mgmt_cmd *) skb->data; in __ath6kl_wmi_send_mgmt_cmd()
3696 p->id = cpu_to_le32(id); in __ath6kl_wmi_send_mgmt_cmd()
3697 p->freq = cpu_to_le32(freq); in __ath6kl_wmi_send_mgmt_cmd()
3698 p->wait = cpu_to_le32(wait); in __ath6kl_wmi_send_mgmt_cmd()
3699 p->no_cck = cpu_to_le32(no_cck); in __ath6kl_wmi_send_mgmt_cmd()
3700 p->len = cpu_to_le16(data_len); in __ath6kl_wmi_send_mgmt_cmd()
3701 memcpy(p->data, data, data_len); in __ath6kl_wmi_send_mgmt_cmd()
3711 struct ath6kl *ar = wmi->parent_dev; in ath6kl_wmi_send_mgmt_cmd()
3714 ar->fw_capabilities)) { in ath6kl_wmi_send_mgmt_cmd()
3721 status = __ath6kl_wmi_send_mgmt_cmd(ar->wmi, if_idx, id, freq, in ath6kl_wmi_send_mgmt_cmd()
3725 status = ath6kl_wmi_send_action_cmd(ar->wmi, if_idx, id, freq, in ath6kl_wmi_send_mgmt_cmd()
3745 return -ENOMEM; in ath6kl_wmi_send_probe_response_cmd()
3750 p = (struct wmi_p2p_probe_response_cmd *) skb->data; in ath6kl_wmi_send_probe_response_cmd()
3751 p->freq = cpu_to_le32(freq); in ath6kl_wmi_send_probe_response_cmd()
3752 memcpy(p->destination_addr, dst, ETH_ALEN); in ath6kl_wmi_send_probe_response_cmd()
3753 p->len = cpu_to_le16(data_len); in ath6kl_wmi_send_probe_response_cmd()
3754 memcpy(p->data, data, data_len); in ath6kl_wmi_send_probe_response_cmd()
3767 return -ENOMEM; in ath6kl_wmi_probe_report_req_cmd()
3771 p = (struct wmi_probe_req_report_cmd *) skb->data; in ath6kl_wmi_probe_report_req_cmd()
3772 p->enable = enable ? 1 : 0; in ath6kl_wmi_probe_report_req_cmd()
3784 return -ENOMEM; in ath6kl_wmi_info_req_cmd()
3788 p = (struct wmi_get_p2p_info *) skb->data; in ath6kl_wmi_info_req_cmd()
3789 p->info_req_flags = cpu_to_le32(info_req_flags); in ath6kl_wmi_info_req_cmd()
3808 return -ENOMEM; in ath6kl_wmi_set_inact_period()
3810 cmd = (struct wmi_set_inact_period_cmd *) skb->data; in ath6kl_wmi_set_inact_period()
3811 cmd->inact_period = cpu_to_le32(inact_timeout); in ath6kl_wmi_set_inact_period()
3812 cmd->num_null_func = 0; in ath6kl_wmi_set_inact_period()
3827 ath6kl_recovery_hb_event(wmi->parent_dev, in ath6kl_wmi_hb_challenge_resp_event()
3828 le32_to_cpu(cmd->cookie)); in ath6kl_wmi_hb_challenge_resp_event()
3839 if (skb->len < sizeof(struct wmix_cmd_hdr)) { in ath6kl_wmi_control_rx_xtnd()
3841 return -EINVAL; in ath6kl_wmi_control_rx_xtnd()
3844 cmd = (struct wmix_cmd_hdr *) skb->data; in ath6kl_wmi_control_rx_xtnd()
3845 id = le32_to_cpu(cmd->cmd_id); in ath6kl_wmi_control_rx_xtnd()
3849 datap = skb->data; in ath6kl_wmi_control_rx_xtnd()
3850 len = skb->len; in ath6kl_wmi_control_rx_xtnd()
3859 ath6kl_debug_fwlog_event(wmi->parent_dev, datap, len); in ath6kl_wmi_control_rx_xtnd()
3863 ret = -EINVAL; in ath6kl_wmi_control_rx_xtnd()
3872 return ath6kl_debug_roam_tbl_event(wmi->parent_dev, datap, len); in ath6kl_wmi_roam_tbl_event_rx()
3881 vif = ath6kl_get_vif_by_index(wmi->parent_dev, if_idx); in ath6kl_wmi_proc_events_vif()
3886 return -EINVAL; in ath6kl_wmi_proc_events_vif()
3953 return -EINVAL; in ath6kl_wmi_proc_events_vif()
3968 cmd = (struct wmi_cmd_hdr *) skb->data; in ath6kl_wmi_proc_events()
3969 id = le16_to_cpu(cmd->cmd_id); in ath6kl_wmi_proc_events()
3970 if_idx = le16_to_cpu(cmd->info1) & WMI_CMD_HDR_IF_ID_MASK; in ath6kl_wmi_proc_events()
3973 datap = skb->data; in ath6kl_wmi_proc_events()
3974 len = skb->len; in ath6kl_wmi_proc_events()
4111 return -EINVAL; in ath6kl_wmi_control_rx()
4113 if (skb->len < sizeof(struct wmi_cmd_hdr)) { in ath6kl_wmi_control_rx()
4116 return -EINVAL; in ath6kl_wmi_control_rx()
4119 trace_ath6kl_wmi_event(skb->data, skb->len); in ath6kl_wmi_control_rx()
4126 spin_lock_bh(&wmi->lock); in ath6kl_wmi_reset()
4128 wmi->fat_pipe_exist = 0; in ath6kl_wmi_reset()
4129 memset(wmi->stream_exist_for_ac, 0, sizeof(wmi->stream_exist_for_ac)); in ath6kl_wmi_reset()
4131 spin_unlock_bh(&wmi->lock); in ath6kl_wmi_reset()
4142 spin_lock_init(&wmi->lock); in ath6kl_wmi_init()
4144 wmi->parent_dev = dev; in ath6kl_wmi_init()
4146 wmi->pwr_mode = REC_POWER; in ath6kl_wmi_init()
4158 kfree(wmi->last_mgmt_tx_frame); in ath6kl_wmi_shutdown()