Lines Matching +full:event +full:-

1 // SPDX-License-Identifier: GPL-2.0-only
3 * NXP Wireless LAN device driver: AP event handling
5 * Copyright 2011-2020 NXP
15 struct sk_buff *event) in mwifiex_check_uap_capabilities() argument
24 priv->wmm_enabled = false; in mwifiex_check_uap_capabilities()
25 skb_pull(event, MWIFIEX_BSS_START_EVT_FIX_SIZE); in mwifiex_check_uap_capabilities()
26 evt_len = event->len; in mwifiex_check_uap_capabilities()
27 curr = event->data; in mwifiex_check_uap_capabilities()
29 mwifiex_dbg_dump(priv->adapter, EVT_D, "uap capabilities:", in mwifiex_check_uap_capabilities()
30 event->data, event->len); in mwifiex_check_uap_capabilities()
32 skb_push(event, MWIFIEX_BSS_START_EVT_FIX_SIZE); in mwifiex_check_uap_capabilities()
34 while ((evt_len >= sizeof(tlv_hdr->header))) { in mwifiex_check_uap_capabilities()
36 tlv_len = le16_to_cpu(tlv_hdr->header.len); in mwifiex_check_uap_capabilities()
38 if (evt_len < tlv_len + sizeof(tlv_hdr->header)) in mwifiex_check_uap_capabilities()
41 switch (le16_to_cpu(tlv_hdr->header.type)) { in mwifiex_check_uap_capabilities()
43 priv->ap_11n_enabled = true; in mwifiex_check_uap_capabilities()
47 priv->ap_11ac_enabled = true; in mwifiex_check_uap_capabilities()
55 wmm_param_ie->vend_hdr.len = (u8)tlv_len; in mwifiex_check_uap_capabilities()
56 wmm_param_ie->vend_hdr.element_id = in mwifiex_check_uap_capabilities()
58 mwifiex_dbg(priv->adapter, EVENT, in mwifiex_check_uap_capabilities()
61 wmm_param_ie->qos_info_bitmap & mask); in mwifiex_check_uap_capabilities()
64 priv->wmm_enabled = true; in mwifiex_check_uap_capabilities()
72 curr += (tlv_len + sizeof(tlv_hdr->header)); in mwifiex_check_uap_capabilities()
73 evt_len -= (tlv_len + sizeof(tlv_hdr->header)); in mwifiex_check_uap_capabilities()
82 * Event specific routines are called by this function based
83 * upon the generated event cause.
86 * Events supported for AP -
87 * - EVENT_UAP_STA_ASSOC
88 * - EVENT_UAP_STA_DEAUTH
89 * - EVENT_UAP_BSS_ACTIVE
90 * - EVENT_UAP_BSS_START
91 * - EVENT_UAP_BSS_IDLE
92 * - EVENT_UAP_MIC_COUNTERMEASURES:
96 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_process_uap_event()
98 u32 eventcause = adapter->event_cause; in mwifiex_process_uap_event()
100 struct mwifiex_assoc_event *event; in mwifiex_process_uap_event() local
110 return -ENOMEM; in mwifiex_process_uap_event()
112 event = (struct mwifiex_assoc_event *) in mwifiex_process_uap_event()
113 (adapter->event_body + MWIFIEX_UAP_EVENT_EXTRA_HEADER); in mwifiex_process_uap_event()
114 if (le16_to_cpu(event->type) == TLV_TYPE_UAP_MGMT_FRAME) { in mwifiex_process_uap_event()
115 len = -1; in mwifiex_process_uap_event()
117 if (ieee80211_is_assoc_req(event->frame_control)) in mwifiex_process_uap_event()
119 else if (ieee80211_is_reassoc_req(event->frame_control)) in mwifiex_process_uap_event()
121 * current_ap_addr before the re-assoc ies. in mwifiex_process_uap_event()
125 if (len != -1) { in mwifiex_process_uap_event()
126 sinfo->assoc_req_ies = &event->data[len]; in mwifiex_process_uap_event()
127 len = (u8 *)sinfo->assoc_req_ies - in mwifiex_process_uap_event()
128 (u8 *)&event->frame_control; in mwifiex_process_uap_event()
129 sinfo->assoc_req_ies_len = in mwifiex_process_uap_event()
130 le16_to_cpu(event->len) - (u16)len; in mwifiex_process_uap_event()
133 cfg80211_new_sta(priv->netdev, event->sta_addr, sinfo, in mwifiex_process_uap_event()
136 node = mwifiex_add_sta_entry(priv, event->sta_addr); in mwifiex_process_uap_event()
141 return -1; in mwifiex_process_uap_event()
144 if (!priv->ap_11n_enabled) { in mwifiex_process_uap_event()
149 mwifiex_set_sta_ht_cap(priv, sinfo->assoc_req_ies, in mwifiex_process_uap_event()
150 sinfo->assoc_req_ies_len, node); in mwifiex_process_uap_event()
153 if (node->is_11n_enabled) in mwifiex_process_uap_event()
154 node->ampdu_sta[i] = in mwifiex_process_uap_event()
155 priv->aggr_prio_tbl[i].ampdu_user; in mwifiex_process_uap_event()
157 node->ampdu_sta[i] = BA_STREAM_NOT_ALLOWED; in mwifiex_process_uap_event()
159 memset(node->rx_seq, 0xff, sizeof(node->rx_seq)); in mwifiex_process_uap_event()
163 deauth_mac = adapter->event_body + in mwifiex_process_uap_event()
165 cfg80211_del_sta(priv->netdev, deauth_mac, GFP_KERNEL); in mwifiex_process_uap_event()
167 if (priv->ap_11n_enabled) { in mwifiex_process_uap_event()
175 priv->media_connected = false; in mwifiex_process_uap_event()
176 priv->port_open = false; in mwifiex_process_uap_event()
181 priv->media_connected = true; in mwifiex_process_uap_event()
182 priv->port_open = true; in mwifiex_process_uap_event()
185 mwifiex_dbg(adapter, EVENT, in mwifiex_process_uap_event()
186 "AP EVENT: event id: %#x\n", eventcause); in mwifiex_process_uap_event()
187 priv->port_open = false; in mwifiex_process_uap_event()
188 eth_hw_addr_set(priv->netdev, adapter->event_body + 2); in mwifiex_process_uap_event()
189 if (priv->hist_data) in mwifiex_process_uap_event()
191 mwifiex_check_uap_capabilities(priv, adapter->event_skb); in mwifiex_process_uap_event()
195 mwifiex_dbg(adapter, EVENT, in mwifiex_process_uap_event()
196 "AP EVENT: event id: %#x\n", eventcause); in mwifiex_process_uap_event()
199 ctrl = get_unaligned_le16(adapter->event_body); in mwifiex_process_uap_event()
200 mwifiex_dbg(adapter, EVENT, in mwifiex_process_uap_event()
201 "event: AMSDU_AGGR_CTRL %d\n", ctrl); in mwifiex_process_uap_event()
203 if (priv->media_connected) { in mwifiex_process_uap_event()
204 adapter->tx_buf_size = in mwifiex_process_uap_event()
205 min_t(u16, adapter->curr_tx_buf_size, ctrl); in mwifiex_process_uap_event()
206 mwifiex_dbg(adapter, EVENT, in mwifiex_process_uap_event()
207 "event: tx_buf_size %d\n", in mwifiex_process_uap_event()
208 adapter->tx_buf_size); in mwifiex_process_uap_event()
212 mwifiex_dbg(adapter, EVENT, "event: ADDBA Request\n"); in mwifiex_process_uap_event()
213 if (priv->media_connected) in mwifiex_process_uap_event()
216 adapter->event_body, false); in mwifiex_process_uap_event()
219 mwifiex_dbg(adapter, EVENT, "event: DELBA Request\n"); in mwifiex_process_uap_event()
220 if (priv->media_connected) in mwifiex_process_uap_event()
221 mwifiex_11n_delete_ba_stream(priv, adapter->event_body); in mwifiex_process_uap_event()
224 mwifiex_dbg(adapter, EVENT, "event: BA Stream timeout\n"); in mwifiex_process_uap_event()
225 if (priv->media_connected) { in mwifiex_process_uap_event()
226 ba_timeout = (void *)adapter->event_body; in mwifiex_process_uap_event()
231 mwifiex_dbg(adapter, EVENT, "event: EXT_SCAN Report\n"); in mwifiex_process_uap_event()
232 if (adapter->ext_scan) in mwifiex_process_uap_event()
234 adapter->event_skb->data); in mwifiex_process_uap_event()
237 mwifiex_dbg(adapter, EVENT, "event: TX_STATUS Report\n"); in mwifiex_process_uap_event()
238 mwifiex_parse_tx_status_event(priv, adapter->event_body); in mwifiex_process_uap_event()
241 mwifiex_dbg(adapter, EVENT, "info: EVENT: SLEEP\n"); in mwifiex_process_uap_event()
243 adapter->ps_state = PS_STATE_PRE_SLEEP; in mwifiex_process_uap_event()
249 mwifiex_dbg(adapter, EVENT, "info: EVENT: AWAKE\n"); in mwifiex_process_uap_event()
250 if (!adapter->pps_uapsd_mode && in mwifiex_process_uap_event()
251 priv->media_connected && adapter->sleep_period.period) { in mwifiex_process_uap_event()
252 adapter->pps_uapsd_mode = true; in mwifiex_process_uap_event()
253 mwifiex_dbg(adapter, EVENT, in mwifiex_process_uap_event()
254 "event: PPS/UAPSD mode activated\n"); in mwifiex_process_uap_event()
256 adapter->tx_lock_flag = false; in mwifiex_process_uap_event()
257 if (adapter->pps_uapsd_mode && adapter->gen_null_pkt) { in mwifiex_process_uap_event()
259 if (adapter->data_sent || in mwifiex_process_uap_event()
260 (adapter->if_ops.is_port_ready && in mwifiex_process_uap_event()
261 !adapter->if_ops.is_port_ready(priv))) { in mwifiex_process_uap_event()
262 adapter->ps_state = PS_STATE_AWAKE; in mwifiex_process_uap_event()
263 adapter->pm_wakeup_card_req = false; in mwifiex_process_uap_event()
264 adapter->pm_wakeup_fw_try = false; in mwifiex_process_uap_event()
271 adapter->ps_state = in mwifiex_process_uap_event()
276 adapter->ps_state = PS_STATE_AWAKE; in mwifiex_process_uap_event()
277 adapter->pm_wakeup_card_req = false; in mwifiex_process_uap_event()
278 adapter->pm_wakeup_fw_try = false; in mwifiex_process_uap_event()
282 mwifiex_dbg(adapter, EVENT, "event: Channel Report\n"); in mwifiex_process_uap_event()
283 mwifiex_11h_handle_chanrpt_ready(priv, adapter->event_skb); in mwifiex_process_uap_event()
286 mwifiex_dbg(adapter, EVENT, "event: Radar detected\n"); in mwifiex_process_uap_event()
287 mwifiex_11h_handle_radar_detected(priv, adapter->event_skb); in mwifiex_process_uap_event()
290 mwifiex_dbg(adapter, EVENT, "event: BT coex wlan param update\n"); in mwifiex_process_uap_event()
292 adapter->event_skb); in mwifiex_process_uap_event()
295 mwifiex_dbg(adapter, EVENT, "event: TX DATA PAUSE\n"); in mwifiex_process_uap_event()
296 mwifiex_process_tx_pause_event(priv, adapter->event_skb); in mwifiex_process_uap_event()
300 mwifiex_dbg(adapter, EVENT, "event: multi-chan info\n"); in mwifiex_process_uap_event()
301 mwifiex_process_multi_chan_event(priv, adapter->event_skb); in mwifiex_process_uap_event()
304 dev_dbg(adapter->dev, "EVENT: RXBA_SYNC\n"); in mwifiex_process_uap_event()
305 mwifiex_11n_rxba_sync_event(priv, adapter->event_body, in mwifiex_process_uap_event()
306 adapter->event_skb->len - in mwifiex_process_uap_event()
311 mwifiex_dbg(adapter, EVENT, in mwifiex_process_uap_event()
312 "event: uap: Remain on channel expired\n"); in mwifiex_process_uap_event()
313 cfg80211_remain_on_channel_expired(&priv->wdev, in mwifiex_process_uap_event()
314 priv->roc_cfg.cookie, in mwifiex_process_uap_event()
315 &priv->roc_cfg.chan, in mwifiex_process_uap_event()
317 memset(&priv->roc_cfg, 0x00, sizeof(struct mwifiex_roc_cfg)); in mwifiex_process_uap_event()
321 mwifiex_dbg(adapter, EVENT, in mwifiex_process_uap_event()
322 "event: unknown event id: %#x\n", eventcause); in mwifiex_process_uap_event()
336 if (priv->ap_11n_enabled && node->is_11n_enabled) { in mwifiex_uap_del_sta_data()
337 mwifiex_11n_del_rx_reorder_tbl_by_ta(priv, node->mac_addr); in mwifiex_uap_del_sta_data()
338 mwifiex_del_tx_ba_stream_tbl_by_ra(priv, node->mac_addr); in mwifiex_uap_del_sta_data()
340 mwifiex_del_sta_entry(priv, node->mac_addr); in mwifiex_uap_del_sta_data()