Lines Matching +full:event +full:-
1 // SPDX-License-Identifier: GPL-2.0-only
3 * NXP Wireless LAN device driver: station event handling
5 * Copyright 2011-2020 NXP
20 struct sk_buff *event) in mwifiex_check_ibss_peer_capabilities() argument
29 skb_pull(event, MWIFIEX_IBSS_CONNECT_EVT_FIX_SIZE); in mwifiex_check_ibss_peer_capabilities()
30 evt_len = event->len; in mwifiex_check_ibss_peer_capabilities()
31 curr = event->data; in mwifiex_check_ibss_peer_capabilities()
33 mwifiex_dbg_dump(priv->adapter, EVT_D, "ibss peer capabilities:", in mwifiex_check_ibss_peer_capabilities()
34 event->data, event->len); in mwifiex_check_ibss_peer_capabilities()
36 skb_push(event, MWIFIEX_IBSS_CONNECT_EVT_FIX_SIZE); in mwifiex_check_ibss_peer_capabilities()
40 le16_to_cpu(tlv_mgmt_frame->header.type) == in mwifiex_check_ibss_peer_capabilities()
46 evt_len = le16_to_cpu(tlv_mgmt_frame->header.len); in mwifiex_check_ibss_peer_capabilities()
49 mwifiex_dbg(priv->adapter, MSG, in mwifiex_check_ibss_peer_capabilities()
56 ele_len = ele_hdr->len; in mwifiex_check_ibss_peer_capabilities()
61 switch (ele_hdr->element_id) { in mwifiex_check_ibss_peer_capabilities()
63 sta_ptr->is_11n_enabled = true; in mwifiex_check_ibss_peer_capabilities()
65 sta_ptr->max_amsdu = le16_to_cpu(ht_cap->cap_info) & in mwifiex_check_ibss_peer_capabilities()
69 mwifiex_dbg(priv->adapter, INFO, in mwifiex_check_ibss_peer_capabilities()
71 sta_ptr->max_amsdu); in mwifiex_check_ibss_peer_capabilities()
75 sta_ptr->is_11ac_enabled = true; in mwifiex_check_ibss_peer_capabilities()
78 switch (le32_to_cpu(vht_cap->vht_cap_info) & 0x3) { in mwifiex_check_ibss_peer_capabilities()
80 sta_ptr->max_amsdu = in mwifiex_check_ibss_peer_capabilities()
84 sta_ptr->max_amsdu = in mwifiex_check_ibss_peer_capabilities()
88 sta_ptr->max_amsdu = in mwifiex_check_ibss_peer_capabilities()
95 mwifiex_dbg(priv->adapter, INFO, in mwifiex_check_ibss_peer_capabilities()
97 sta_ptr->max_amsdu); in mwifiex_check_ibss_peer_capabilities()
104 evt_len -= (ele_len + sizeof(*ele_hdr)); in mwifiex_check_ibss_peer_capabilities()
113 * The function is invoked after receiving a disconnect event from firmware,
114 * and performs the following actions -
115 * - Set media status to disconnected
116 * - Clean up Tx and Rx packets
117 * - Resets SNR/NF/RSSI value in driver
118 * - Resets security configurations in driver
119 * - Enables auto data rate
120 * - Saves the previous SSID and BSSID so that they can
121 * be used for re-association, if required
122 * - Erases current SSID and BSSID information
123 * - Sends a disconnect event to upper layers/applications.
128 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_reset_connect_state()
130 if (!priv->media_connected) in mwifiex_reset_connect_state()
134 "info: handles disconnect event\n"); in mwifiex_reset_connect_state()
136 priv->media_connected = false; in mwifiex_reset_connect_state()
138 priv->auth_flag = 0; in mwifiex_reset_connect_state()
139 priv->auth_alg = WLAN_AUTH_NONE; in mwifiex_reset_connect_state()
141 priv->scan_block = false; in mwifiex_reset_connect_state()
142 priv->port_open = false; in mwifiex_reset_connect_state()
145 ISSUPP_TDLS_ENABLED(priv->adapter->fw_cap_info)) { in mwifiex_reset_connect_state()
148 if (priv->adapter->auto_tdls) in mwifiex_reset_connect_state()
156 priv->data_rssi_last = 0; in mwifiex_reset_connect_state()
157 priv->data_nf_last = 0; in mwifiex_reset_connect_state()
158 priv->data_rssi_avg = 0; in mwifiex_reset_connect_state()
159 priv->data_nf_avg = 0; in mwifiex_reset_connect_state()
160 priv->bcn_rssi_last = 0; in mwifiex_reset_connect_state()
161 priv->bcn_nf_last = 0; in mwifiex_reset_connect_state()
162 priv->bcn_rssi_avg = 0; in mwifiex_reset_connect_state()
163 priv->bcn_nf_avg = 0; in mwifiex_reset_connect_state()
164 priv->rxpd_rate = 0; in mwifiex_reset_connect_state()
165 priv->rxpd_htinfo = 0; in mwifiex_reset_connect_state()
166 priv->sec_info.wpa_enabled = false; in mwifiex_reset_connect_state()
167 priv->sec_info.wpa2_enabled = false; in mwifiex_reset_connect_state()
168 priv->wpa_ie_len = 0; in mwifiex_reset_connect_state()
170 priv->sec_info.wapi_enabled = false; in mwifiex_reset_connect_state()
171 priv->wapi_ie_len = 0; in mwifiex_reset_connect_state()
172 priv->sec_info.wapi_key_on = false; in mwifiex_reset_connect_state()
174 priv->sec_info.encryption_mode = 0; in mwifiex_reset_connect_state()
177 priv->is_data_rate_auto = true; in mwifiex_reset_connect_state()
178 priv->data_rate = 0; in mwifiex_reset_connect_state()
180 priv->ht_param_present = false; in mwifiex_reset_connect_state()
183 GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP) && priv->hist_data) in mwifiex_reset_connect_state()
186 if (priv->bss_mode == NL80211_IFTYPE_ADHOC) in mwifiex_reset_connect_state()
187 priv->adhoc_state = ADHOC_IDLE; in mwifiex_reset_connect_state()
191 * it could be used for re-assoc in mwifiex_reset_connect_state()
196 priv->prev_ssid.ssid, priv->prev_ssid.ssid_len); in mwifiex_reset_connect_state()
200 priv->curr_bss_params.bss_descriptor.ssid.ssid, in mwifiex_reset_connect_state()
201 priv->curr_bss_params.bss_descriptor.ssid.ssid_len); in mwifiex_reset_connect_state()
203 memcpy(&priv->prev_ssid, in mwifiex_reset_connect_state()
204 &priv->curr_bss_params.bss_descriptor.ssid, in mwifiex_reset_connect_state()
207 memcpy(priv->prev_bssid, in mwifiex_reset_connect_state()
208 priv->curr_bss_params.bss_descriptor.mac_address, ETH_ALEN); in mwifiex_reset_connect_state()
211 memset(&priv->curr_bss_params, 0x00, sizeof(priv->curr_bss_params)); in mwifiex_reset_connect_state()
213 adapter->tx_lock_flag = false; in mwifiex_reset_connect_state()
214 adapter->pps_uapsd_mode = false; in mwifiex_reset_connect_state()
216 if (test_bit(MWIFIEX_IS_CMD_TIMEDOUT, &adapter->work_flags) && in mwifiex_reset_connect_state()
217 adapter->curr_cmd) in mwifiex_reset_connect_state()
219 priv->media_connected = false; in mwifiex_reset_connect_state()
222 priv->cfg_bssid, reason_code); in mwifiex_reset_connect_state()
223 if (priv->bss_mode == NL80211_IFTYPE_STATION || in mwifiex_reset_connect_state()
224 priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) { in mwifiex_reset_connect_state()
225 if (adapter->host_mlme_enabled && adapter->host_mlme_link_lost) in mwifiex_reset_connect_state()
226 mwifiex_host_mlme_disconnect(adapter->priv_link_lost, in mwifiex_reset_connect_state()
229 cfg80211_disconnected(priv->netdev, reason_code, NULL, in mwifiex_reset_connect_state()
232 eth_zero_addr(priv->cfg_bssid); in mwifiex_reset_connect_state()
234 mwifiex_stop_net_dev_queue(priv->netdev, adapter); in mwifiex_reset_connect_state()
235 if (netif_carrier_ok(priv->netdev)) in mwifiex_reset_connect_state()
236 netif_carrier_off(priv->netdev); in mwifiex_reset_connect_state()
238 if (!ISSUPP_FIRMWARE_SUPPLICANT(priv->adapter->fw_cap_info)) in mwifiex_reset_connect_state()
249 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_parse_tdls_event()
252 (void *)event_skb->data + sizeof(adapter->event_cause); in mwifiex_parse_tdls_event()
253 u8 *mac = tdls_evt->peer_mac; in mwifiex_parse_tdls_event()
255 /* reserved 2 bytes are not mandatory in tdls event */ in mwifiex_parse_tdls_event()
256 if (event_skb->len < (sizeof(struct mwifiex_tdls_generic_event) - in mwifiex_parse_tdls_event()
257 sizeof(u16) - sizeof(adapter->event_cause))) { in mwifiex_parse_tdls_event()
258 mwifiex_dbg(adapter, ERROR, "Invalid event length!\n"); in mwifiex_parse_tdls_event()
259 return -1; in mwifiex_parse_tdls_event()
262 sta_ptr = mwifiex_get_sta_entry(priv, tdls_evt->peer_mac); in mwifiex_parse_tdls_event()
265 return -1; in mwifiex_parse_tdls_event()
268 switch (le16_to_cpu(tdls_evt->type)) { in mwifiex_parse_tdls_event()
270 cfg80211_tdls_oper_request(priv->netdev, in mwifiex_parse_tdls_event()
271 tdls_evt->peer_mac, in mwifiex_parse_tdls_event()
273 le16_to_cpu(tdls_evt->u.reason_code), in mwifiex_parse_tdls_event()
277 mwifiex_dbg(adapter, EVENT, "tdls channel switch result :\n"); in mwifiex_parse_tdls_event()
278 mwifiex_dbg(adapter, EVENT, in mwifiex_parse_tdls_event()
280 tdls_evt->u.switch_result.status, in mwifiex_parse_tdls_event()
281 tdls_evt->u.switch_result.reason, in mwifiex_parse_tdls_event()
282 tdls_evt->u.switch_result.cur_chan); in mwifiex_parse_tdls_event()
285 if (tdls_evt->u.switch_result.status != 0) { in mwifiex_parse_tdls_event()
286 switch (tdls_evt->u.switch_result.cur_chan) { in mwifiex_parse_tdls_event()
288 sta_ptr->tdls_status = TDLS_IN_BASE_CHAN; in mwifiex_parse_tdls_event()
291 sta_ptr->tdls_status = TDLS_IN_OFF_CHAN; in mwifiex_parse_tdls_event()
300 switch (tdls_evt->u.switch_result.cur_chan) { in mwifiex_parse_tdls_event()
302 if (sta_ptr->tdls_status == TDLS_IN_BASE_CHAN) in mwifiex_parse_tdls_event()
306 sta_ptr->tdls_status = TDLS_IN_BASE_CHAN; in mwifiex_parse_tdls_event()
309 if (sta_ptr->tdls_status == TDLS_IN_OFF_CHAN) in mwifiex_parse_tdls_event()
313 sta_ptr->tdls_status = TDLS_IN_OFF_CHAN; in mwifiex_parse_tdls_event()
321 mwifiex_dbg(adapter, EVENT, "tdls start channel switch...\n"); in mwifiex_parse_tdls_event()
322 sta_ptr->tdls_status = TDLS_CHAN_SWITCHING; in mwifiex_parse_tdls_event()
325 mwifiex_dbg(adapter, EVENT, in mwifiex_parse_tdls_event()
327 tdls_evt->u.cs_stop_reason); in mwifiex_parse_tdls_event()
343 mwifiex_dbg(priv->adapter, EVENT, in mwifiex_process_uap_tx_pause()
345 tp->peermac, tp->tx_pause, in mwifiex_process_uap_tx_pause()
346 tp->pkt_cnt); in mwifiex_process_uap_tx_pause()
348 if (ether_addr_equal(tp->peermac, priv->netdev->dev_addr)) { in mwifiex_process_uap_tx_pause()
349 if (tp->tx_pause) in mwifiex_process_uap_tx_pause()
350 priv->port_open = false; in mwifiex_process_uap_tx_pause()
352 priv->port_open = true; in mwifiex_process_uap_tx_pause()
353 } else if (is_multicast_ether_addr(tp->peermac)) { in mwifiex_process_uap_tx_pause()
354 mwifiex_update_ralist_tx_pause(priv, tp->peermac, tp->tx_pause); in mwifiex_process_uap_tx_pause()
356 spin_lock_bh(&priv->sta_list_spinlock); in mwifiex_process_uap_tx_pause()
357 sta_ptr = mwifiex_get_sta_entry(priv, tp->peermac); in mwifiex_process_uap_tx_pause()
358 if (sta_ptr && sta_ptr->tx_pause != tp->tx_pause) { in mwifiex_process_uap_tx_pause()
359 sta_ptr->tx_pause = tp->tx_pause; in mwifiex_process_uap_tx_pause()
360 spin_unlock_bh(&priv->sta_list_spinlock); in mwifiex_process_uap_tx_pause()
361 mwifiex_update_ralist_tx_pause(priv, tp->peermac, in mwifiex_process_uap_tx_pause()
362 tp->tx_pause); in mwifiex_process_uap_tx_pause()
364 spin_unlock_bh(&priv->sta_list_spinlock); in mwifiex_process_uap_tx_pause()
377 mwifiex_dbg(priv->adapter, EVENT, in mwifiex_process_sta_tx_pause()
379 tp->peermac, tp->tx_pause, in mwifiex_process_sta_tx_pause()
380 tp->pkt_cnt); in mwifiex_process_sta_tx_pause()
382 if (ether_addr_equal(tp->peermac, priv->cfg_bssid)) { in mwifiex_process_sta_tx_pause()
383 if (tp->tx_pause) in mwifiex_process_sta_tx_pause()
384 priv->port_open = false; in mwifiex_process_sta_tx_pause()
386 priv->port_open = true; in mwifiex_process_sta_tx_pause()
388 if (!ISSUPP_TDLS_ENABLED(priv->adapter->fw_cap_info)) in mwifiex_process_sta_tx_pause()
391 status = mwifiex_get_tdls_link_status(priv, tp->peermac); in mwifiex_process_sta_tx_pause()
393 spin_lock_bh(&priv->sta_list_spinlock); in mwifiex_process_sta_tx_pause()
394 sta_ptr = mwifiex_get_sta_entry(priv, tp->peermac); in mwifiex_process_sta_tx_pause()
395 if (sta_ptr && sta_ptr->tx_pause != tp->tx_pause) { in mwifiex_process_sta_tx_pause()
396 sta_ptr->tx_pause = tp->tx_pause; in mwifiex_process_sta_tx_pause()
397 spin_unlock_bh(&priv->sta_list_spinlock); in mwifiex_process_sta_tx_pause()
399 tp->peermac, in mwifiex_process_sta_tx_pause()
400 tp->tx_pause); in mwifiex_process_sta_tx_pause()
402 spin_unlock_bh(&priv->sta_list_spinlock); in mwifiex_process_sta_tx_pause()
413 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_process_multi_chan_event()
419 tlv_buf_left = event_skb->len - sizeof(u32); in mwifiex_process_multi_chan_event()
420 chan_info = (void *)event_skb->data + sizeof(u32); in mwifiex_process_multi_chan_event()
422 if (le16_to_cpu(chan_info->header.type) != TLV_TYPE_MULTI_CHAN_INFO || in mwifiex_process_multi_chan_event()
425 "unknown TLV in chan_info event\n"); in mwifiex_process_multi_chan_event()
429 adapter->usb_mc_status = le16_to_cpu(chan_info->status); in mwifiex_process_multi_chan_event()
430 mwifiex_dbg(adapter, EVENT, "multi chan operation %s\n", in mwifiex_process_multi_chan_event()
431 adapter->usb_mc_status ? "started" : "over"); in mwifiex_process_multi_chan_event()
433 tlv_buf_left -= sizeof(struct mwifiex_ie_types_multi_chan_info); in mwifiex_process_multi_chan_event()
434 tlv = (struct mwifiex_ie_types_header *)chan_info->tlv_buffer; in mwifiex_process_multi_chan_event()
437 tlv_type = le16_to_cpu(tlv->type); in mwifiex_process_multi_chan_event()
438 tlv_len = le16_to_cpu(tlv->len); in mwifiex_process_multi_chan_event()
452 intf_num = grp_info->intf_num; in mwifiex_process_multi_chan_event()
454 bss_type = grp_info->bss_type_numlist[i] >> 4; in mwifiex_process_multi_chan_event()
455 bss_num = grp_info->bss_type_numlist[i] & BSS_NUM_MASK; in mwifiex_process_multi_chan_event()
461 "in multi channel event\n"); in mwifiex_process_multi_chan_event()
464 if (adapter->iface_type == MWIFIEX_USB) { in mwifiex_process_multi_chan_event()
467 ep = grp_info->hid_num.usb_ep_num; in mwifiex_process_multi_chan_event()
470 intf_priv->usb_port = ep; in mwifiex_process_multi_chan_event()
474 tlv_buf_left -= sizeof(struct mwifiex_ie_types_header) + in mwifiex_process_multi_chan_event()
480 if (adapter->iface_type == MWIFIEX_USB) { in mwifiex_process_multi_chan_event()
481 adapter->tx_lock_flag = true; in mwifiex_process_multi_chan_event()
482 adapter->usb_mc_setup = true; in mwifiex_process_multi_chan_event()
494 if (!priv->media_connected) { in mwifiex_process_tx_pause_event()
495 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_process_tx_pause_event()
496 "tx_pause event while disconnected; bss_role=%d\n", in mwifiex_process_tx_pause_event()
497 priv->bss_role); in mwifiex_process_tx_pause_event()
501 tlv_buf_left = event_skb->len - sizeof(u32); in mwifiex_process_tx_pause_event()
502 tlv = (void *)event_skb->data + sizeof(u32); in mwifiex_process_tx_pause_event()
505 tlv_type = le16_to_cpu(tlv->type); in mwifiex_process_tx_pause_event()
506 tlv_len = le16_to_cpu(tlv->len); in mwifiex_process_tx_pause_event()
509 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_process_tx_pause_event()
521 tlv_buf_left -= sizeof(struct mwifiex_ie_types_header) + in mwifiex_process_tx_pause_event()
535 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_bt_coex_wlan_param_update_event()
539 s32 len = event_skb->len - sizeof(u32); in mwifiex_bt_coex_wlan_param_update_event()
540 u8 *cur_ptr = event_skb->data + sizeof(u32); in mwifiex_bt_coex_wlan_param_update_event()
545 tlv_len = le16_to_cpu(tlv->len); in mwifiex_bt_coex_wlan_param_update_event()
546 tlv_type = le16_to_cpu(tlv->type); in mwifiex_bt_coex_wlan_param_update_event()
554 adapter->coex_win_size = winsizetlv->coex_win_size; in mwifiex_bt_coex_wlan_param_update_event()
555 adapter->coex_tx_win_size = in mwifiex_bt_coex_wlan_param_update_event()
556 winsizetlv->tx_win_size; in mwifiex_bt_coex_wlan_param_update_event()
557 adapter->coex_rx_win_size = in mwifiex_bt_coex_wlan_param_update_event()
558 winsizetlv->rx_win_size; in mwifiex_bt_coex_wlan_param_update_event()
566 adapter->coex_scan = scantlv->coex_scan; in mwifiex_bt_coex_wlan_param_update_event()
567 adapter->coex_min_scan_time = le16_to_cpu(scantlv->min_scan_time); in mwifiex_bt_coex_wlan_param_update_event()
568 adapter->coex_max_scan_time = le16_to_cpu(scantlv->max_scan_time); in mwifiex_bt_coex_wlan_param_update_event()
575 len -= tlv_len + sizeof(struct mwifiex_ie_types_header); in mwifiex_bt_coex_wlan_param_update_event()
580 dev_dbg(adapter->dev, "coex_scan=%d min_scan=%d coex_win=%d, tx_win=%d rx_win=%d\n", in mwifiex_bt_coex_wlan_param_update_event()
581 adapter->coex_scan, adapter->coex_min_scan_time, in mwifiex_bt_coex_wlan_param_update_event()
582 adapter->coex_win_size, adapter->coex_tx_win_size, in mwifiex_bt_coex_wlan_param_update_event()
583 adapter->coex_rx_win_size); in mwifiex_bt_coex_wlan_param_update_event()
590 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_fw_dump_info_event()
592 (void *)adapter->event_body; in mwifiex_fw_dump_info_event()
594 if (adapter->iface_type != MWIFIEX_USB) { in mwifiex_fw_dump_info_event()
596 "event is not on usb interface, ignore it\n"); in mwifiex_fw_dump_info_event()
600 if (!adapter->devdump_data) { in mwifiex_fw_dump_info_event()
601 /* When receive the first event, allocate device dump in mwifiex_fw_dump_info_event()
604 adapter->devdump_data = vzalloc(MWIFIEX_FW_DUMP_SIZE); in mwifiex_fw_dump_info_event()
605 if (!adapter->devdump_data) { in mwifiex_fw_dump_info_event()
613 /* If no proceeded event arrive in 10s, upload device in mwifiex_fw_dump_info_event()
615 * transmission event get lost, in this cornel case, in mwifiex_fw_dump_info_event()
618 schedule_delayed_work(&adapter->devdump_work, in mwifiex_fw_dump_info_event()
623 if (adapter->devdump_len + event_skb->len >= MWIFIEX_FW_DUMP_SIZE) in mwifiex_fw_dump_info_event()
626 memmove(adapter->devdump_data + adapter->devdump_len, in mwifiex_fw_dump_info_event()
627 adapter->event_skb->data, event_skb->len); in mwifiex_fw_dump_info_event()
628 adapter->devdump_len += event_skb->len; in mwifiex_fw_dump_info_event()
630 if (le16_to_cpu(fw_dump_hdr->type) == FW_DUMP_INFO_ENDED) { in mwifiex_fw_dump_info_event()
632 "receive end of transmission flag event!\n"); in mwifiex_fw_dump_info_event()
638 cancel_delayed_work_sync(&adapter->devdump_work); in mwifiex_fw_dump_info_event()
647 * Event specific routines are called by this function based
648 * upon the generated event cause.
651 * layers, optionally recording the change -
652 * - EVENT_LINK_SENSED
653 * - EVENT_MIC_ERR_UNICAST
654 * - EVENT_MIC_ERR_MULTICAST
655 * - EVENT_PORT_RELEASE
656 * - EVENT_RSSI_LOW
657 * - EVENT_SNR_LOW
658 * - EVENT_MAX_FAIL
659 * - EVENT_RSSI_HIGH
660 * - EVENT_SNR_HIGH
661 * - EVENT_DATA_RSSI_LOW
662 * - EVENT_DATA_SNR_LOW
663 * - EVENT_DATA_RSSI_HIGH
664 * - EVENT_DATA_SNR_HIGH
665 * - EVENT_LINK_QUALITY
666 * - EVENT_PRE_BEACON_LOST
667 * - EVENT_IBSS_COALESCED
668 * - EVENT_IBSS_STA_CONNECT
669 * - EVENT_IBSS_STA_DISCONNECT
670 * - EVENT_WEP_ICV_ERR
671 * - EVENT_BW_CHANGE
672 * - EVENT_HOSTWAKE_STAIE
674 * For the following events, no action is taken -
675 * - EVENT_MIB_CHANGED
676 * - EVENT_INIT_DONE
677 * - EVENT_DUMMY_HOST_WAKEUP_SIGNAL
679 * Rest of the supported events requires driver handling -
680 * - EVENT_DEAUTHENTICATED
681 * - EVENT_DISASSOCIATED
682 * - EVENT_LINK_LOST
683 * - EVENT_PS_SLEEP
684 * - EVENT_PS_AWAKE
685 * - EVENT_DEEP_SLEEP_AWAKE
686 * - EVENT_HS_ACT_REQ
687 * - EVENT_ADHOC_BCN_LOST
688 * - EVENT_BG_SCAN_REPORT
689 * - EVENT_WMM_STATUS_CHANGE
690 * - EVENT_ADDBA
691 * - EVENT_DELBA
692 * - EVENT_BA_STREAM_TIEMOUT
693 * - EVENT_AMSDU_AGGR_CTRL
694 * - EVENT_FW_DUMP_INFO
698 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_process_sta_event()
700 u32 eventcause = adapter->event_cause; in mwifiex_process_sta_event()
708 "invalid EVENT: DUMMY_HOST_WAKEUP_SIGNAL, ignore it\n"); in mwifiex_process_sta_event()
711 mwifiex_dbg(adapter, EVENT, "event: LINK_SENSED\n"); in mwifiex_process_sta_event()
712 if (!netif_carrier_ok(priv->netdev)) in mwifiex_process_sta_event()
713 netif_carrier_on(priv->netdev); in mwifiex_process_sta_event()
714 mwifiex_wake_up_net_dev_queue(priv->netdev, adapter); in mwifiex_process_sta_event()
718 mwifiex_dbg(adapter, EVENT, "event: Deauthenticated\n"); in mwifiex_process_sta_event()
719 if (priv->wps.session_enable) { in mwifiex_process_sta_event()
721 "info: receive deauth event in wps session\n"); in mwifiex_process_sta_event()
724 adapter->dbg.num_event_deauth++; in mwifiex_process_sta_event()
725 if (priv->media_connected) { in mwifiex_process_sta_event()
727 get_unaligned_le16(adapter->event_body); in mwifiex_process_sta_event()
733 mwifiex_dbg(adapter, EVENT, "event: Disassociated\n"); in mwifiex_process_sta_event()
734 if (priv->wps.session_enable) { in mwifiex_process_sta_event()
736 "info: receive disassoc event in wps session\n"); in mwifiex_process_sta_event()
739 adapter->dbg.num_event_disassoc++; in mwifiex_process_sta_event()
740 if (priv->media_connected) { in mwifiex_process_sta_event()
742 get_unaligned_le16(adapter->event_body); in mwifiex_process_sta_event()
748 mwifiex_dbg(adapter, EVENT, "event: Link lost\n"); in mwifiex_process_sta_event()
749 adapter->dbg.num_event_link_lost++; in mwifiex_process_sta_event()
750 if (priv->media_connected) { in mwifiex_process_sta_event()
752 get_unaligned_le16(adapter->event_body); in mwifiex_process_sta_event()
753 if (adapter->host_mlme_enabled) { in mwifiex_process_sta_event()
754 adapter->priv_link_lost = priv; in mwifiex_process_sta_event()
755 adapter->host_mlme_link_lost = true; in mwifiex_process_sta_event()
756 queue_work(adapter->host_mlme_workqueue, in mwifiex_process_sta_event()
757 &adapter->host_mlme_work); in mwifiex_process_sta_event()
766 mwifiex_dbg(adapter, EVENT, "info: EVENT: SLEEP\n"); in mwifiex_process_sta_event()
768 adapter->ps_state = PS_STATE_PRE_SLEEP; in mwifiex_process_sta_event()
774 mwifiex_dbg(adapter, EVENT, "info: EVENT: AWAKE\n"); in mwifiex_process_sta_event()
775 if (!adapter->pps_uapsd_mode && in mwifiex_process_sta_event()
776 (priv->port_open || in mwifiex_process_sta_event()
777 (priv->bss_mode == NL80211_IFTYPE_ADHOC)) && in mwifiex_process_sta_event()
778 priv->media_connected && adapter->sleep_period.period) { in mwifiex_process_sta_event()
779 adapter->pps_uapsd_mode = true; in mwifiex_process_sta_event()
780 mwifiex_dbg(adapter, EVENT, in mwifiex_process_sta_event()
781 "event: PPS/UAPSD mode activated\n"); in mwifiex_process_sta_event()
783 adapter->tx_lock_flag = false; in mwifiex_process_sta_event()
784 if (adapter->pps_uapsd_mode && adapter->gen_null_pkt) { in mwifiex_process_sta_event()
786 if (adapter->data_sent || in mwifiex_process_sta_event()
787 (adapter->if_ops.is_port_ready && in mwifiex_process_sta_event()
788 !adapter->if_ops.is_port_ready(priv))) { in mwifiex_process_sta_event()
789 adapter->ps_state = PS_STATE_AWAKE; in mwifiex_process_sta_event()
790 adapter->pm_wakeup_card_req = false; in mwifiex_process_sta_event()
791 adapter->pm_wakeup_fw_try = false; in mwifiex_process_sta_event()
792 timer_delete(&adapter->wakeup_timer); in mwifiex_process_sta_event()
799 adapter->ps_state = in mwifiex_process_sta_event()
804 adapter->ps_state = PS_STATE_AWAKE; in mwifiex_process_sta_event()
805 adapter->pm_wakeup_card_req = false; in mwifiex_process_sta_event()
806 adapter->pm_wakeup_fw_try = false; in mwifiex_process_sta_event()
807 timer_delete(&adapter->wakeup_timer); in mwifiex_process_sta_event()
812 adapter->if_ops.wakeup_complete(adapter); in mwifiex_process_sta_event()
813 mwifiex_dbg(adapter, EVENT, "event: DS_AWAKE\n"); in mwifiex_process_sta_event()
814 if (adapter->is_deep_sleep) in mwifiex_process_sta_event()
815 adapter->is_deep_sleep = false; in mwifiex_process_sta_event()
819 mwifiex_dbg(adapter, EVENT, "event: HS_ACT_REQ\n"); in mwifiex_process_sta_event()
825 mwifiex_dbg(adapter, EVENT, "event: UNICAST MIC ERROR\n"); in mwifiex_process_sta_event()
826 cfg80211_michael_mic_failure(priv->netdev, priv->cfg_bssid, in mwifiex_process_sta_event()
828 -1, NULL, GFP_KERNEL); in mwifiex_process_sta_event()
832 mwifiex_dbg(adapter, EVENT, "event: MULTICAST MIC ERROR\n"); in mwifiex_process_sta_event()
833 cfg80211_michael_mic_failure(priv->netdev, priv->cfg_bssid, in mwifiex_process_sta_event()
835 -1, NULL, GFP_KERNEL); in mwifiex_process_sta_event()
842 mwifiex_dbg(adapter, EVENT, "event: ADHOC_BCN_LOST\n"); in mwifiex_process_sta_event()
844 mwifiex_stop_net_dev_queue(priv->netdev, adapter); in mwifiex_process_sta_event()
845 if (netif_carrier_ok(priv->netdev)) in mwifiex_process_sta_event()
846 netif_carrier_off(priv->netdev); in mwifiex_process_sta_event()
850 mwifiex_dbg(adapter, EVENT, "event: BGS_REPORT\n"); in mwifiex_process_sta_event()
856 dev_dbg(adapter->dev, "event: BGS_STOPPED\n"); in mwifiex_process_sta_event()
857 cfg80211_sched_scan_stopped(priv->wdev.wiphy, 0); in mwifiex_process_sta_event()
858 if (priv->sched_scanning) in mwifiex_process_sta_event()
859 priv->sched_scanning = false; in mwifiex_process_sta_event()
863 mwifiex_dbg(adapter, EVENT, "event: PORT RELEASE\n"); in mwifiex_process_sta_event()
864 priv->port_open = true; in mwifiex_process_sta_event()
868 mwifiex_dbg(adapter, EVENT, "event: EXT_SCAN Report\n"); in mwifiex_process_sta_event()
869 /* We intend to skip this event during suspend, but handle in mwifiex_process_sta_event()
872 if (adapter->ext_scan && (!priv->scan_aborting || in mwifiex_process_sta_event()
873 !netif_running(priv->netdev))) in mwifiex_process_sta_event()
875 adapter->event_skb->data); in mwifiex_process_sta_event()
880 mwifiex_dbg(adapter, EVENT, "event: WMM status changed\n"); in mwifiex_process_sta_event()
886 cfg80211_cqm_rssi_notify(priv->netdev, in mwifiex_process_sta_event()
891 priv->subsc_evt_rssi_state = RSSI_LOW_RECVD; in mwifiex_process_sta_event()
892 mwifiex_dbg(adapter, EVENT, "event: Beacon RSSI_LOW\n"); in mwifiex_process_sta_event()
895 mwifiex_dbg(adapter, EVENT, "event: Beacon SNR_LOW\n"); in mwifiex_process_sta_event()
898 mwifiex_dbg(adapter, EVENT, "event: MAX_FAIL\n"); in mwifiex_process_sta_event()
901 cfg80211_cqm_rssi_notify(priv->netdev, in mwifiex_process_sta_event()
906 priv->subsc_evt_rssi_state = RSSI_HIGH_RECVD; in mwifiex_process_sta_event()
907 mwifiex_dbg(adapter, EVENT, "event: Beacon RSSI_HIGH\n"); in mwifiex_process_sta_event()
910 mwifiex_dbg(adapter, EVENT, "event: Beacon SNR_HIGH\n"); in mwifiex_process_sta_event()
913 mwifiex_dbg(adapter, EVENT, "event: Data RSSI_LOW\n"); in mwifiex_process_sta_event()
916 mwifiex_dbg(adapter, EVENT, "event: Data SNR_LOW\n"); in mwifiex_process_sta_event()
919 mwifiex_dbg(adapter, EVENT, "event: Data RSSI_HIGH\n"); in mwifiex_process_sta_event()
922 mwifiex_dbg(adapter, EVENT, "event: Data SNR_HIGH\n"); in mwifiex_process_sta_event()
925 mwifiex_dbg(adapter, EVENT, "event: Link Quality\n"); in mwifiex_process_sta_event()
928 mwifiex_dbg(adapter, EVENT, "event: Pre-Beacon Lost\n"); in mwifiex_process_sta_event()
931 mwifiex_dbg(adapter, EVENT, "event: IBSS_COALESCED\n"); in mwifiex_process_sta_event()
937 ether_addr_copy(ibss_sta_addr, adapter->event_body + 2); in mwifiex_process_sta_event()
938 mwifiex_dbg(adapter, EVENT, "event: IBSS_STA_CONNECT %pM\n", in mwifiex_process_sta_event()
941 if (sta_ptr && adapter->adhoc_11n_enabled) { in mwifiex_process_sta_event()
943 adapter->event_skb); in mwifiex_process_sta_event()
944 if (sta_ptr->is_11n_enabled) in mwifiex_process_sta_event()
946 sta_ptr->ampdu_sta[i] = in mwifiex_process_sta_event()
947 priv->aggr_prio_tbl[i].ampdu_user; in mwifiex_process_sta_event()
950 sta_ptr->ampdu_sta[i] = in mwifiex_process_sta_event()
952 memset(sta_ptr->rx_seq, 0xff, sizeof(sta_ptr->rx_seq)); in mwifiex_process_sta_event()
957 ether_addr_copy(ibss_sta_addr, adapter->event_body + 2); in mwifiex_process_sta_event()
958 mwifiex_dbg(adapter, EVENT, "event: IBSS_STA_DISCONNECT %pM\n", in mwifiex_process_sta_event()
961 if (sta_ptr && sta_ptr->is_11n_enabled) { in mwifiex_process_sta_event()
970 mwifiex_dbg(adapter, EVENT, "event: ADDBA Request\n"); in mwifiex_process_sta_event()
973 adapter->event_body, false); in mwifiex_process_sta_event()
976 mwifiex_dbg(adapter, EVENT, "event: DELBA Request\n"); in mwifiex_process_sta_event()
977 mwifiex_11n_delete_ba_stream(priv, adapter->event_body); in mwifiex_process_sta_event()
980 mwifiex_dbg(adapter, EVENT, "event: BA Stream timeout\n"); in mwifiex_process_sta_event()
984 adapter->event_body); in mwifiex_process_sta_event()
987 ctrl = get_unaligned_le16(adapter->event_body); in mwifiex_process_sta_event()
988 mwifiex_dbg(adapter, EVENT, in mwifiex_process_sta_event()
989 "event: AMSDU_AGGR_CTRL %d\n", ctrl); in mwifiex_process_sta_event()
991 adapter->tx_buf_size = in mwifiex_process_sta_event()
992 min_t(u16, adapter->curr_tx_buf_size, ctrl); in mwifiex_process_sta_event()
993 mwifiex_dbg(adapter, EVENT, "event: tx_buf_size %d\n", in mwifiex_process_sta_event()
994 adapter->tx_buf_size); in mwifiex_process_sta_event()
998 mwifiex_dbg(adapter, EVENT, "event: WEP ICV error\n"); in mwifiex_process_sta_event()
1002 mwifiex_dbg(adapter, EVENT, "event: BW Change\n"); in mwifiex_process_sta_event()
1006 mwifiex_dbg(adapter, EVENT, in mwifiex_process_sta_event()
1007 "event: HOSTWAKE_STAIE %d\n", eventcause); in mwifiex_process_sta_event()
1011 mwifiex_dbg(adapter, EVENT, in mwifiex_process_sta_event()
1012 "event: Remain on channel expired\n"); in mwifiex_process_sta_event()
1014 if (adapter->host_mlme_enabled && in mwifiex_process_sta_event()
1015 (priv->auth_flag & HOST_MLME_AUTH_PENDING)) { in mwifiex_process_sta_event()
1016 priv->auth_flag = 0; in mwifiex_process_sta_event()
1017 priv->auth_alg = WLAN_AUTH_NONE; in mwifiex_process_sta_event()
1019 cfg80211_remain_on_channel_expired(&priv->wdev, in mwifiex_process_sta_event()
1020 priv->roc_cfg.cookie, in mwifiex_process_sta_event()
1021 &priv->roc_cfg.chan, in mwifiex_process_sta_event()
1025 memset(&priv->roc_cfg, 0x00, sizeof(struct mwifiex_roc_cfg)); in mwifiex_process_sta_event()
1030 mwifiex_dbg(adapter, EVENT, "event: Channel Switch Announcement\n"); in mwifiex_process_sta_event()
1031 priv->csa_expire_time = in mwifiex_process_sta_event()
1033 priv->csa_chan = priv->curr_bss_params.bss_descriptor.channel; in mwifiex_process_sta_event()
1036 priv->curr_bss_params.bss_descriptor.mac_address, in mwifiex_process_sta_event()
1041 ret = mwifiex_parse_tdls_event(priv, adapter->event_skb); in mwifiex_process_sta_event()
1045 mwifiex_dbg(adapter, EVENT, "event: TX DATA PAUSE\n"); in mwifiex_process_sta_event()
1046 mwifiex_process_tx_pause_event(priv, adapter->event_skb); in mwifiex_process_sta_event()
1050 mwifiex_dbg(adapter, EVENT, "event: multi-chan info\n"); in mwifiex_process_sta_event()
1051 mwifiex_process_multi_chan_event(priv, adapter->event_skb); in mwifiex_process_sta_event()
1055 mwifiex_dbg(adapter, EVENT, "event: TX_STATUS Report\n"); in mwifiex_process_sta_event()
1056 mwifiex_parse_tx_status_event(priv, adapter->event_body); in mwifiex_process_sta_event()
1060 mwifiex_dbg(adapter, EVENT, "event: Channel Report\n"); in mwifiex_process_sta_event()
1062 adapter->event_skb); in mwifiex_process_sta_event()
1065 mwifiex_dbg(adapter, EVENT, "event: Radar detected\n"); in mwifiex_process_sta_event()
1067 adapter->event_skb); in mwifiex_process_sta_event()
1070 dev_dbg(adapter->dev, "EVENT: BT coex wlan param update\n"); in mwifiex_process_sta_event()
1071 if (adapter->ignore_btcoex_events) in mwifiex_process_sta_event()
1075 adapter->event_skb); in mwifiex_process_sta_event()
1078 dev_dbg(adapter->dev, "EVENT: RXBA_SYNC\n"); in mwifiex_process_sta_event()
1079 mwifiex_11n_rxba_sync_event(priv, adapter->event_body, in mwifiex_process_sta_event()
1080 adapter->event_skb->len - in mwifiex_process_sta_event()
1084 mwifiex_dbg(adapter, EVENT, "event: firmware debug info\n"); in mwifiex_process_sta_event()
1085 mwifiex_fw_dump_info_event(priv, adapter->event_skb); in mwifiex_process_sta_event()
1087 /* Debugging event; not used, but let's not print an ERROR for it. */ in mwifiex_process_sta_event()
1089 mwifiex_dbg(adapter, EVENT, "event: debug\n"); in mwifiex_process_sta_event()
1092 mwifiex_dbg(adapter, ERROR, "event: unknown event id: %#x\n", in mwifiex_process_sta_event()