18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * NXP Wireless LAN device driver: AP event handling 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Copyright 2011-2020 NXP 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * This software file (the "File") is distributed by NXP 78c2ecf20Sopenharmony_ci * under the terms of the GNU General Public License Version 2, June 1991 88c2ecf20Sopenharmony_ci * (the "License"). You may use, redistribute and/or modify this File in 98c2ecf20Sopenharmony_ci * accordance with the terms and conditions of the License, a copy of which 108c2ecf20Sopenharmony_ci * is available by writing to the Free Software Foundation, Inc., 118c2ecf20Sopenharmony_ci * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the 128c2ecf20Sopenharmony_ci * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. 138c2ecf20Sopenharmony_ci * 148c2ecf20Sopenharmony_ci * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE 158c2ecf20Sopenharmony_ci * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE 168c2ecf20Sopenharmony_ci * ARE EXPRESSLY DISCLAIMED. The License provides additional details about 178c2ecf20Sopenharmony_ci * this warranty disclaimer. 188c2ecf20Sopenharmony_ci */ 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci#include "decl.h" 218c2ecf20Sopenharmony_ci#include "main.h" 228c2ecf20Sopenharmony_ci#include "11n.h" 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci#define MWIFIEX_BSS_START_EVT_FIX_SIZE 12 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_cistatic int mwifiex_check_uap_capabilities(struct mwifiex_private *priv, 278c2ecf20Sopenharmony_ci struct sk_buff *event) 288c2ecf20Sopenharmony_ci{ 298c2ecf20Sopenharmony_ci int evt_len; 308c2ecf20Sopenharmony_ci u8 *curr; 318c2ecf20Sopenharmony_ci u16 tlv_len; 328c2ecf20Sopenharmony_ci struct mwifiex_ie_types_data *tlv_hdr; 338c2ecf20Sopenharmony_ci struct ieee_types_wmm_parameter *wmm_param_ie = NULL; 348c2ecf20Sopenharmony_ci int mask = IEEE80211_WMM_IE_AP_QOSINFO_PARAM_SET_CNT_MASK; 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci priv->wmm_enabled = false; 378c2ecf20Sopenharmony_ci skb_pull(event, MWIFIEX_BSS_START_EVT_FIX_SIZE); 388c2ecf20Sopenharmony_ci evt_len = event->len; 398c2ecf20Sopenharmony_ci curr = event->data; 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci mwifiex_dbg_dump(priv->adapter, EVT_D, "uap capabilities:", 428c2ecf20Sopenharmony_ci event->data, event->len); 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci skb_push(event, MWIFIEX_BSS_START_EVT_FIX_SIZE); 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ci while ((evt_len >= sizeof(tlv_hdr->header))) { 478c2ecf20Sopenharmony_ci tlv_hdr = (struct mwifiex_ie_types_data *)curr; 488c2ecf20Sopenharmony_ci tlv_len = le16_to_cpu(tlv_hdr->header.len); 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_ci if (evt_len < tlv_len + sizeof(tlv_hdr->header)) 518c2ecf20Sopenharmony_ci break; 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ci switch (le16_to_cpu(tlv_hdr->header.type)) { 548c2ecf20Sopenharmony_ci case WLAN_EID_HT_CAPABILITY: 558c2ecf20Sopenharmony_ci priv->ap_11n_enabled = true; 568c2ecf20Sopenharmony_ci break; 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci case WLAN_EID_VHT_CAPABILITY: 598c2ecf20Sopenharmony_ci priv->ap_11ac_enabled = true; 608c2ecf20Sopenharmony_ci break; 618c2ecf20Sopenharmony_ci 628c2ecf20Sopenharmony_ci case WLAN_EID_VENDOR_SPECIFIC: 638c2ecf20Sopenharmony_ci /* Point the regular IEEE IE 2 bytes into the Marvell IE 648c2ecf20Sopenharmony_ci * and setup the IEEE IE type and length byte fields 658c2ecf20Sopenharmony_ci */ 668c2ecf20Sopenharmony_ci wmm_param_ie = (void *)(curr + 2); 678c2ecf20Sopenharmony_ci wmm_param_ie->vend_hdr.len = (u8)tlv_len; 688c2ecf20Sopenharmony_ci wmm_param_ie->vend_hdr.element_id = 698c2ecf20Sopenharmony_ci WLAN_EID_VENDOR_SPECIFIC; 708c2ecf20Sopenharmony_ci mwifiex_dbg(priv->adapter, EVENT, 718c2ecf20Sopenharmony_ci "info: check uap capabilities:\t" 728c2ecf20Sopenharmony_ci "wmm parameter set count: %d\n", 738c2ecf20Sopenharmony_ci wmm_param_ie->qos_info_bitmap & mask); 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_ci mwifiex_wmm_setup_ac_downgrade(priv); 768c2ecf20Sopenharmony_ci priv->wmm_enabled = true; 778c2ecf20Sopenharmony_ci mwifiex_wmm_setup_queue_priorities(priv, wmm_param_ie); 788c2ecf20Sopenharmony_ci break; 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci default: 818c2ecf20Sopenharmony_ci break; 828c2ecf20Sopenharmony_ci } 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_ci curr += (tlv_len + sizeof(tlv_hdr->header)); 858c2ecf20Sopenharmony_ci evt_len -= (tlv_len + sizeof(tlv_hdr->header)); 868c2ecf20Sopenharmony_ci } 878c2ecf20Sopenharmony_ci 888c2ecf20Sopenharmony_ci return 0; 898c2ecf20Sopenharmony_ci} 908c2ecf20Sopenharmony_ci 918c2ecf20Sopenharmony_ci/* 928c2ecf20Sopenharmony_ci * This function handles AP interface specific events generated by firmware. 938c2ecf20Sopenharmony_ci * 948c2ecf20Sopenharmony_ci * Event specific routines are called by this function based 958c2ecf20Sopenharmony_ci * upon the generated event cause. 968c2ecf20Sopenharmony_ci * 978c2ecf20Sopenharmony_ci * 988c2ecf20Sopenharmony_ci * Events supported for AP - 998c2ecf20Sopenharmony_ci * - EVENT_UAP_STA_ASSOC 1008c2ecf20Sopenharmony_ci * - EVENT_UAP_STA_DEAUTH 1018c2ecf20Sopenharmony_ci * - EVENT_UAP_BSS_ACTIVE 1028c2ecf20Sopenharmony_ci * - EVENT_UAP_BSS_START 1038c2ecf20Sopenharmony_ci * - EVENT_UAP_BSS_IDLE 1048c2ecf20Sopenharmony_ci * - EVENT_UAP_MIC_COUNTERMEASURES: 1058c2ecf20Sopenharmony_ci */ 1068c2ecf20Sopenharmony_ciint mwifiex_process_uap_event(struct mwifiex_private *priv) 1078c2ecf20Sopenharmony_ci{ 1088c2ecf20Sopenharmony_ci struct mwifiex_adapter *adapter = priv->adapter; 1098c2ecf20Sopenharmony_ci int len, i; 1108c2ecf20Sopenharmony_ci u32 eventcause = adapter->event_cause; 1118c2ecf20Sopenharmony_ci struct station_info *sinfo; 1128c2ecf20Sopenharmony_ci struct mwifiex_assoc_event *event; 1138c2ecf20Sopenharmony_ci struct mwifiex_sta_node *node; 1148c2ecf20Sopenharmony_ci u8 *deauth_mac; 1158c2ecf20Sopenharmony_ci struct host_cmd_ds_11n_batimeout *ba_timeout; 1168c2ecf20Sopenharmony_ci u16 ctrl; 1178c2ecf20Sopenharmony_ci 1188c2ecf20Sopenharmony_ci switch (eventcause) { 1198c2ecf20Sopenharmony_ci case EVENT_UAP_STA_ASSOC: 1208c2ecf20Sopenharmony_ci sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL); 1218c2ecf20Sopenharmony_ci if (!sinfo) 1228c2ecf20Sopenharmony_ci return -ENOMEM; 1238c2ecf20Sopenharmony_ci 1248c2ecf20Sopenharmony_ci event = (struct mwifiex_assoc_event *) 1258c2ecf20Sopenharmony_ci (adapter->event_body + MWIFIEX_UAP_EVENT_EXTRA_HEADER); 1268c2ecf20Sopenharmony_ci if (le16_to_cpu(event->type) == TLV_TYPE_UAP_MGMT_FRAME) { 1278c2ecf20Sopenharmony_ci len = -1; 1288c2ecf20Sopenharmony_ci 1298c2ecf20Sopenharmony_ci if (ieee80211_is_assoc_req(event->frame_control)) 1308c2ecf20Sopenharmony_ci len = 0; 1318c2ecf20Sopenharmony_ci else if (ieee80211_is_reassoc_req(event->frame_control)) 1328c2ecf20Sopenharmony_ci /* There will be ETH_ALEN bytes of 1338c2ecf20Sopenharmony_ci * current_ap_addr before the re-assoc ies. 1348c2ecf20Sopenharmony_ci */ 1358c2ecf20Sopenharmony_ci len = ETH_ALEN; 1368c2ecf20Sopenharmony_ci 1378c2ecf20Sopenharmony_ci if (len != -1) { 1388c2ecf20Sopenharmony_ci sinfo->assoc_req_ies = &event->data[len]; 1398c2ecf20Sopenharmony_ci len = (u8 *)sinfo->assoc_req_ies - 1408c2ecf20Sopenharmony_ci (u8 *)&event->frame_control; 1418c2ecf20Sopenharmony_ci sinfo->assoc_req_ies_len = 1428c2ecf20Sopenharmony_ci le16_to_cpu(event->len) - (u16)len; 1438c2ecf20Sopenharmony_ci } 1448c2ecf20Sopenharmony_ci } 1458c2ecf20Sopenharmony_ci cfg80211_new_sta(priv->netdev, event->sta_addr, sinfo, 1468c2ecf20Sopenharmony_ci GFP_KERNEL); 1478c2ecf20Sopenharmony_ci 1488c2ecf20Sopenharmony_ci node = mwifiex_add_sta_entry(priv, event->sta_addr); 1498c2ecf20Sopenharmony_ci if (!node) { 1508c2ecf20Sopenharmony_ci mwifiex_dbg(adapter, ERROR, 1518c2ecf20Sopenharmony_ci "could not create station entry!\n"); 1528c2ecf20Sopenharmony_ci kfree(sinfo); 1538c2ecf20Sopenharmony_ci return -1; 1548c2ecf20Sopenharmony_ci } 1558c2ecf20Sopenharmony_ci 1568c2ecf20Sopenharmony_ci if (!priv->ap_11n_enabled) { 1578c2ecf20Sopenharmony_ci kfree(sinfo); 1588c2ecf20Sopenharmony_ci break; 1598c2ecf20Sopenharmony_ci } 1608c2ecf20Sopenharmony_ci 1618c2ecf20Sopenharmony_ci mwifiex_set_sta_ht_cap(priv, sinfo->assoc_req_ies, 1628c2ecf20Sopenharmony_ci sinfo->assoc_req_ies_len, node); 1638c2ecf20Sopenharmony_ci 1648c2ecf20Sopenharmony_ci for (i = 0; i < MAX_NUM_TID; i++) { 1658c2ecf20Sopenharmony_ci if (node->is_11n_enabled) 1668c2ecf20Sopenharmony_ci node->ampdu_sta[i] = 1678c2ecf20Sopenharmony_ci priv->aggr_prio_tbl[i].ampdu_user; 1688c2ecf20Sopenharmony_ci else 1698c2ecf20Sopenharmony_ci node->ampdu_sta[i] = BA_STREAM_NOT_ALLOWED; 1708c2ecf20Sopenharmony_ci } 1718c2ecf20Sopenharmony_ci memset(node->rx_seq, 0xff, sizeof(node->rx_seq)); 1728c2ecf20Sopenharmony_ci kfree(sinfo); 1738c2ecf20Sopenharmony_ci break; 1748c2ecf20Sopenharmony_ci case EVENT_UAP_STA_DEAUTH: 1758c2ecf20Sopenharmony_ci deauth_mac = adapter->event_body + 1768c2ecf20Sopenharmony_ci MWIFIEX_UAP_EVENT_EXTRA_HEADER; 1778c2ecf20Sopenharmony_ci cfg80211_del_sta(priv->netdev, deauth_mac, GFP_KERNEL); 1788c2ecf20Sopenharmony_ci 1798c2ecf20Sopenharmony_ci if (priv->ap_11n_enabled) { 1808c2ecf20Sopenharmony_ci mwifiex_11n_del_rx_reorder_tbl_by_ta(priv, deauth_mac); 1818c2ecf20Sopenharmony_ci mwifiex_del_tx_ba_stream_tbl_by_ra(priv, deauth_mac); 1828c2ecf20Sopenharmony_ci } 1838c2ecf20Sopenharmony_ci mwifiex_wmm_del_peer_ra_list(priv, deauth_mac); 1848c2ecf20Sopenharmony_ci mwifiex_del_sta_entry(priv, deauth_mac); 1858c2ecf20Sopenharmony_ci break; 1868c2ecf20Sopenharmony_ci case EVENT_UAP_BSS_IDLE: 1878c2ecf20Sopenharmony_ci priv->media_connected = false; 1888c2ecf20Sopenharmony_ci priv->port_open = false; 1898c2ecf20Sopenharmony_ci mwifiex_clean_txrx(priv); 1908c2ecf20Sopenharmony_ci mwifiex_del_all_sta_list(priv); 1918c2ecf20Sopenharmony_ci break; 1928c2ecf20Sopenharmony_ci case EVENT_UAP_BSS_ACTIVE: 1938c2ecf20Sopenharmony_ci priv->media_connected = true; 1948c2ecf20Sopenharmony_ci priv->port_open = true; 1958c2ecf20Sopenharmony_ci break; 1968c2ecf20Sopenharmony_ci case EVENT_UAP_BSS_START: 1978c2ecf20Sopenharmony_ci mwifiex_dbg(adapter, EVENT, 1988c2ecf20Sopenharmony_ci "AP EVENT: event id: %#x\n", eventcause); 1998c2ecf20Sopenharmony_ci priv->port_open = false; 2008c2ecf20Sopenharmony_ci memcpy(priv->netdev->dev_addr, adapter->event_body + 2, 2018c2ecf20Sopenharmony_ci ETH_ALEN); 2028c2ecf20Sopenharmony_ci if (priv->hist_data) 2038c2ecf20Sopenharmony_ci mwifiex_hist_data_reset(priv); 2048c2ecf20Sopenharmony_ci mwifiex_check_uap_capabilities(priv, adapter->event_skb); 2058c2ecf20Sopenharmony_ci break; 2068c2ecf20Sopenharmony_ci case EVENT_UAP_MIC_COUNTERMEASURES: 2078c2ecf20Sopenharmony_ci /* For future development */ 2088c2ecf20Sopenharmony_ci mwifiex_dbg(adapter, EVENT, 2098c2ecf20Sopenharmony_ci "AP EVENT: event id: %#x\n", eventcause); 2108c2ecf20Sopenharmony_ci break; 2118c2ecf20Sopenharmony_ci case EVENT_AMSDU_AGGR_CTRL: 2128c2ecf20Sopenharmony_ci ctrl = get_unaligned_le16(adapter->event_body); 2138c2ecf20Sopenharmony_ci mwifiex_dbg(adapter, EVENT, 2148c2ecf20Sopenharmony_ci "event: AMSDU_AGGR_CTRL %d\n", ctrl); 2158c2ecf20Sopenharmony_ci 2168c2ecf20Sopenharmony_ci if (priv->media_connected) { 2178c2ecf20Sopenharmony_ci adapter->tx_buf_size = 2188c2ecf20Sopenharmony_ci min_t(u16, adapter->curr_tx_buf_size, ctrl); 2198c2ecf20Sopenharmony_ci mwifiex_dbg(adapter, EVENT, 2208c2ecf20Sopenharmony_ci "event: tx_buf_size %d\n", 2218c2ecf20Sopenharmony_ci adapter->tx_buf_size); 2228c2ecf20Sopenharmony_ci } 2238c2ecf20Sopenharmony_ci break; 2248c2ecf20Sopenharmony_ci case EVENT_ADDBA: 2258c2ecf20Sopenharmony_ci mwifiex_dbg(adapter, EVENT, "event: ADDBA Request\n"); 2268c2ecf20Sopenharmony_ci if (priv->media_connected) 2278c2ecf20Sopenharmony_ci mwifiex_send_cmd(priv, HostCmd_CMD_11N_ADDBA_RSP, 2288c2ecf20Sopenharmony_ci HostCmd_ACT_GEN_SET, 0, 2298c2ecf20Sopenharmony_ci adapter->event_body, false); 2308c2ecf20Sopenharmony_ci break; 2318c2ecf20Sopenharmony_ci case EVENT_DELBA: 2328c2ecf20Sopenharmony_ci mwifiex_dbg(adapter, EVENT, "event: DELBA Request\n"); 2338c2ecf20Sopenharmony_ci if (priv->media_connected) 2348c2ecf20Sopenharmony_ci mwifiex_11n_delete_ba_stream(priv, adapter->event_body); 2358c2ecf20Sopenharmony_ci break; 2368c2ecf20Sopenharmony_ci case EVENT_BA_STREAM_TIEMOUT: 2378c2ecf20Sopenharmony_ci mwifiex_dbg(adapter, EVENT, "event: BA Stream timeout\n"); 2388c2ecf20Sopenharmony_ci if (priv->media_connected) { 2398c2ecf20Sopenharmony_ci ba_timeout = (void *)adapter->event_body; 2408c2ecf20Sopenharmony_ci mwifiex_11n_ba_stream_timeout(priv, ba_timeout); 2418c2ecf20Sopenharmony_ci } 2428c2ecf20Sopenharmony_ci break; 2438c2ecf20Sopenharmony_ci case EVENT_EXT_SCAN_REPORT: 2448c2ecf20Sopenharmony_ci mwifiex_dbg(adapter, EVENT, "event: EXT_SCAN Report\n"); 2458c2ecf20Sopenharmony_ci if (adapter->ext_scan) 2468c2ecf20Sopenharmony_ci return mwifiex_handle_event_ext_scan_report(priv, 2478c2ecf20Sopenharmony_ci adapter->event_skb->data); 2488c2ecf20Sopenharmony_ci break; 2498c2ecf20Sopenharmony_ci case EVENT_TX_STATUS_REPORT: 2508c2ecf20Sopenharmony_ci mwifiex_dbg(adapter, EVENT, "event: TX_STATUS Report\n"); 2518c2ecf20Sopenharmony_ci mwifiex_parse_tx_status_event(priv, adapter->event_body); 2528c2ecf20Sopenharmony_ci break; 2538c2ecf20Sopenharmony_ci case EVENT_PS_SLEEP: 2548c2ecf20Sopenharmony_ci mwifiex_dbg(adapter, EVENT, "info: EVENT: SLEEP\n"); 2558c2ecf20Sopenharmony_ci 2568c2ecf20Sopenharmony_ci adapter->ps_state = PS_STATE_PRE_SLEEP; 2578c2ecf20Sopenharmony_ci 2588c2ecf20Sopenharmony_ci mwifiex_check_ps_cond(adapter); 2598c2ecf20Sopenharmony_ci break; 2608c2ecf20Sopenharmony_ci 2618c2ecf20Sopenharmony_ci case EVENT_PS_AWAKE: 2628c2ecf20Sopenharmony_ci mwifiex_dbg(adapter, EVENT, "info: EVENT: AWAKE\n"); 2638c2ecf20Sopenharmony_ci if (!adapter->pps_uapsd_mode && 2648c2ecf20Sopenharmony_ci priv->media_connected && adapter->sleep_period.period) { 2658c2ecf20Sopenharmony_ci adapter->pps_uapsd_mode = true; 2668c2ecf20Sopenharmony_ci mwifiex_dbg(adapter, EVENT, 2678c2ecf20Sopenharmony_ci "event: PPS/UAPSD mode activated\n"); 2688c2ecf20Sopenharmony_ci } 2698c2ecf20Sopenharmony_ci adapter->tx_lock_flag = false; 2708c2ecf20Sopenharmony_ci if (adapter->pps_uapsd_mode && adapter->gen_null_pkt) { 2718c2ecf20Sopenharmony_ci if (mwifiex_check_last_packet_indication(priv)) { 2728c2ecf20Sopenharmony_ci if (adapter->data_sent || 2738c2ecf20Sopenharmony_ci (adapter->if_ops.is_port_ready && 2748c2ecf20Sopenharmony_ci !adapter->if_ops.is_port_ready(priv))) { 2758c2ecf20Sopenharmony_ci adapter->ps_state = PS_STATE_AWAKE; 2768c2ecf20Sopenharmony_ci adapter->pm_wakeup_card_req = false; 2778c2ecf20Sopenharmony_ci adapter->pm_wakeup_fw_try = false; 2788c2ecf20Sopenharmony_ci break; 2798c2ecf20Sopenharmony_ci } 2808c2ecf20Sopenharmony_ci if (!mwifiex_send_null_packet 2818c2ecf20Sopenharmony_ci (priv, 2828c2ecf20Sopenharmony_ci MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET | 2838c2ecf20Sopenharmony_ci MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET)) 2848c2ecf20Sopenharmony_ci adapter->ps_state = 2858c2ecf20Sopenharmony_ci PS_STATE_SLEEP; 2868c2ecf20Sopenharmony_ci return 0; 2878c2ecf20Sopenharmony_ci } 2888c2ecf20Sopenharmony_ci } 2898c2ecf20Sopenharmony_ci adapter->ps_state = PS_STATE_AWAKE; 2908c2ecf20Sopenharmony_ci adapter->pm_wakeup_card_req = false; 2918c2ecf20Sopenharmony_ci adapter->pm_wakeup_fw_try = false; 2928c2ecf20Sopenharmony_ci break; 2938c2ecf20Sopenharmony_ci 2948c2ecf20Sopenharmony_ci case EVENT_CHANNEL_REPORT_RDY: 2958c2ecf20Sopenharmony_ci mwifiex_dbg(adapter, EVENT, "event: Channel Report\n"); 2968c2ecf20Sopenharmony_ci mwifiex_11h_handle_chanrpt_ready(priv, adapter->event_skb); 2978c2ecf20Sopenharmony_ci break; 2988c2ecf20Sopenharmony_ci case EVENT_RADAR_DETECTED: 2998c2ecf20Sopenharmony_ci mwifiex_dbg(adapter, EVENT, "event: Radar detected\n"); 3008c2ecf20Sopenharmony_ci mwifiex_11h_handle_radar_detected(priv, adapter->event_skb); 3018c2ecf20Sopenharmony_ci break; 3028c2ecf20Sopenharmony_ci case EVENT_BT_COEX_WLAN_PARA_CHANGE: 3038c2ecf20Sopenharmony_ci mwifiex_dbg(adapter, EVENT, "event: BT coex wlan param update\n"); 3048c2ecf20Sopenharmony_ci mwifiex_bt_coex_wlan_param_update_event(priv, 3058c2ecf20Sopenharmony_ci adapter->event_skb); 3068c2ecf20Sopenharmony_ci break; 3078c2ecf20Sopenharmony_ci case EVENT_TX_DATA_PAUSE: 3088c2ecf20Sopenharmony_ci mwifiex_dbg(adapter, EVENT, "event: TX DATA PAUSE\n"); 3098c2ecf20Sopenharmony_ci mwifiex_process_tx_pause_event(priv, adapter->event_skb); 3108c2ecf20Sopenharmony_ci break; 3118c2ecf20Sopenharmony_ci 3128c2ecf20Sopenharmony_ci case EVENT_MULTI_CHAN_INFO: 3138c2ecf20Sopenharmony_ci mwifiex_dbg(adapter, EVENT, "event: multi-chan info\n"); 3148c2ecf20Sopenharmony_ci mwifiex_process_multi_chan_event(priv, adapter->event_skb); 3158c2ecf20Sopenharmony_ci break; 3168c2ecf20Sopenharmony_ci case EVENT_RXBA_SYNC: 3178c2ecf20Sopenharmony_ci dev_dbg(adapter->dev, "EVENT: RXBA_SYNC\n"); 3188c2ecf20Sopenharmony_ci mwifiex_11n_rxba_sync_event(priv, adapter->event_body, 3198c2ecf20Sopenharmony_ci adapter->event_skb->len - 3208c2ecf20Sopenharmony_ci sizeof(eventcause)); 3218c2ecf20Sopenharmony_ci break; 3228c2ecf20Sopenharmony_ci 3238c2ecf20Sopenharmony_ci case EVENT_REMAIN_ON_CHAN_EXPIRED: 3248c2ecf20Sopenharmony_ci mwifiex_dbg(adapter, EVENT, 3258c2ecf20Sopenharmony_ci "event: uap: Remain on channel expired\n"); 3268c2ecf20Sopenharmony_ci cfg80211_remain_on_channel_expired(&priv->wdev, 3278c2ecf20Sopenharmony_ci priv->roc_cfg.cookie, 3288c2ecf20Sopenharmony_ci &priv->roc_cfg.chan, 3298c2ecf20Sopenharmony_ci GFP_ATOMIC); 3308c2ecf20Sopenharmony_ci memset(&priv->roc_cfg, 0x00, sizeof(struct mwifiex_roc_cfg)); 3318c2ecf20Sopenharmony_ci break; 3328c2ecf20Sopenharmony_ci 3338c2ecf20Sopenharmony_ci default: 3348c2ecf20Sopenharmony_ci mwifiex_dbg(adapter, EVENT, 3358c2ecf20Sopenharmony_ci "event: unknown event id: %#x\n", eventcause); 3368c2ecf20Sopenharmony_ci break; 3378c2ecf20Sopenharmony_ci } 3388c2ecf20Sopenharmony_ci 3398c2ecf20Sopenharmony_ci return 0; 3408c2ecf20Sopenharmony_ci} 3418c2ecf20Sopenharmony_ci 3428c2ecf20Sopenharmony_ci/* This function deletes station entry from associated station list. 3438c2ecf20Sopenharmony_ci * Also if both AP and STA are 11n enabled, RxReorder tables and TxBA stream 3448c2ecf20Sopenharmony_ci * tables created for this station are deleted. 3458c2ecf20Sopenharmony_ci */ 3468c2ecf20Sopenharmony_civoid mwifiex_uap_del_sta_data(struct mwifiex_private *priv, 3478c2ecf20Sopenharmony_ci struct mwifiex_sta_node *node) 3488c2ecf20Sopenharmony_ci{ 3498c2ecf20Sopenharmony_ci if (priv->ap_11n_enabled && node->is_11n_enabled) { 3508c2ecf20Sopenharmony_ci mwifiex_11n_del_rx_reorder_tbl_by_ta(priv, node->mac_addr); 3518c2ecf20Sopenharmony_ci mwifiex_del_tx_ba_stream_tbl_by_ra(priv, node->mac_addr); 3528c2ecf20Sopenharmony_ci } 3538c2ecf20Sopenharmony_ci mwifiex_del_sta_entry(priv, node->mac_addr); 3548c2ecf20Sopenharmony_ci 3558c2ecf20Sopenharmony_ci return; 3568c2ecf20Sopenharmony_ci} 357