Lines Matching +full:channel +full:- +full:11
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright 2011-2020 NXP
14 priv->state_11h.is_11h_enabled = true; in mwifiex_init_11h_params()
15 priv->state_11h.is_11h_active = false; in mwifiex_init_11h_params()
20 return priv->state_11h.is_11h_active; in mwifiex_is_11h_active()
22 /* This function appends 11h info to a buffer while joining an
39 radio_type = mwifiex_band_to_radio_type((u8) bss_desc->bss_band); in mwifiex_11h_process_infra_join()
40 sband = priv->wdev.wiphy->bands[radio_type]; in mwifiex_11h_process_infra_join()
43 cap->header.type = cpu_to_le16(WLAN_EID_PWR_CAPABILITY); in mwifiex_11h_process_infra_join()
44 cap->header.len = cpu_to_le16(2); in mwifiex_11h_process_infra_join()
45 cap->min_pwr = 0; in mwifiex_11h_process_infra_join()
46 cap->max_pwr = 0; in mwifiex_11h_process_infra_join()
50 constraint->header.type = cpu_to_le16(WLAN_EID_PWR_CONSTRAINT); in mwifiex_11h_process_infra_join()
51 constraint->header.len = cpu_to_le16(2); in mwifiex_11h_process_infra_join()
52 constraint->chan = bss_desc->channel; in mwifiex_11h_process_infra_join()
53 constraint->constraint = bss_desc->local_constraint; in mwifiex_11h_process_infra_join()
57 ie_header->type = cpu_to_le16(TLV_TYPE_PASSTHROUGH); in mwifiex_11h_process_infra_join()
58 ie_header->len = cpu_to_le16(2 * sband->n_channels + 2); in mwifiex_11h_process_infra_join()
61 *(*buffer)++ = 2 * sband->n_channels; in mwifiex_11h_process_infra_join()
62 for (i = 0; i < sband->n_channels; i++) { in mwifiex_11h_process_infra_join()
64 sband->channels[i].center_freq); in mwifiex_11h_process_infra_join()
65 *(*buffer)++ = 1; /* one channel in the subband */ in mwifiex_11h_process_infra_join()
69 /* Enable or disable the 11h extensions in the firmware */
84 * Activate 11h functionality in the firmware if the spectrum management
86 * TLVs are set based on requested network's 11h capability.
91 if (bss_desc->sensed_11h) { in mwifiex_11h_process_join()
92 /* Activate 11h functions in firmware, turns on capability in mwifiex_11h_process_join()
96 priv->state_11h.is_11h_active = true; in mwifiex_11h_process_join()
97 bss_desc->cap_info_bitmap |= WLAN_CAPABILITY_SPECTRUM_MGMT; in mwifiex_11h_process_join()
100 /* Deactivate 11h functions in the firmware */ in mwifiex_11h_process_join()
102 priv->state_11h.is_11h_active = false; in mwifiex_11h_process_join()
103 bss_desc->cap_info_bitmap &= ~WLAN_CAPABILITY_SPECTRUM_MGMT; in mwifiex_11h_process_join()
119 chandef = priv->dfs_chandef; in mwifiex_dfs_cac_work_queue()
120 if (priv->wdev.links[0].cac_started) { in mwifiex_dfs_cac_work_queue()
121 mwifiex_dbg(priv->adapter, MSG, in mwifiex_dfs_cac_work_queue()
123 cfg80211_cac_event(priv->netdev, &chandef, in mwifiex_dfs_cac_work_queue()
129 /* This function prepares channel report request command to FW for
136 struct host_cmd_ds_chan_rpt_req *cr_req = &cmd->params.chan_rpt_req; in mwifiex_cmd_issue_chan_report_request()
139 cmd->command = cpu_to_le16(HostCmd_CMD_CHAN_REPORT_REQUEST); in mwifiex_cmd_issue_chan_report_request()
140 cmd->size = cpu_to_le16(S_DS_GEN); in mwifiex_cmd_issue_chan_report_request()
141 le16_unaligned_add_cpu(&cmd->size, in mwifiex_cmd_issue_chan_report_request()
144 cr_req->chan_desc.start_freq = cpu_to_le16(MWIFIEX_A_BAND_START_FREQ); in mwifiex_cmd_issue_chan_report_request()
145 cr_req->chan_desc.chan_num = radar_params->chandef->chan->hw_value; in mwifiex_cmd_issue_chan_report_request()
146 cr_req->chan_desc.chan_width = radar_params->chandef->width; in mwifiex_cmd_issue_chan_report_request()
147 cr_req->msec_dwell_time = cpu_to_le32(radar_params->cac_time_ms); in mwifiex_cmd_issue_chan_report_request()
149 if (radar_params->cac_time_ms) in mwifiex_cmd_issue_chan_report_request()
150 mwifiex_dbg(priv->adapter, MSG, in mwifiex_cmd_issue_chan_report_request()
151 "11h: issuing DFS Radar check for channel=%d\n", in mwifiex_cmd_issue_chan_report_request()
152 radar_params->chandef->chan->hw_value); in mwifiex_cmd_issue_chan_report_request()
154 mwifiex_dbg(priv->adapter, MSG, "cancelling CAC\n"); in mwifiex_cmd_issue_chan_report_request()
177 if (priv->wdev.links[0].cac_started) { in mwifiex_abort_cac()
178 if (mwifiex_stop_radar_detection(priv, &priv->dfs_chandef)) in mwifiex_abort_cac()
179 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_abort_cac()
181 mwifiex_dbg(priv->adapter, MSG, in mwifiex_abort_cac()
183 cancel_delayed_work_sync(&priv->dfs_cac_work); in mwifiex_abort_cac()
184 cfg80211_cac_event(priv->netdev, &priv->dfs_chandef, in mwifiex_abort_cac()
190 /* This function handles channel report event from FW during CAC period.
201 rpt_event = (void *)(skb->data + sizeof(u32)); in mwifiex_11h_handle_chanrpt_ready()
202 event_len = skb->len - (sizeof(struct host_cmd_ds_chan_rpt_event)+ in mwifiex_11h_handle_chanrpt_ready()
205 if (le32_to_cpu(rpt_event->result) != HostCmd_RESULT_OK) { in mwifiex_11h_handle_chanrpt_ready()
206 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_11h_handle_chanrpt_ready()
207 "Error in channel report event\n"); in mwifiex_11h_handle_chanrpt_ready()
208 return -1; in mwifiex_11h_handle_chanrpt_ready()
212 rpt = (void *)&rpt_event->tlvbuf; in mwifiex_11h_handle_chanrpt_ready()
213 tlv_len = le16_to_cpu(rpt->header.len); in mwifiex_11h_handle_chanrpt_ready()
215 switch (le16_to_cpu(rpt->header.type)) { in mwifiex_11h_handle_chanrpt_ready()
217 if (rpt->map.radar) { in mwifiex_11h_handle_chanrpt_ready()
218 mwifiex_dbg(priv->adapter, MSG, in mwifiex_11h_handle_chanrpt_ready()
219 "RADAR Detected on channel %d!\n", in mwifiex_11h_handle_chanrpt_ready()
220 priv->dfs_chandef.chan->hw_value); in mwifiex_11h_handle_chanrpt_ready()
221 cancel_delayed_work_sync(&priv->dfs_cac_work); in mwifiex_11h_handle_chanrpt_ready()
222 cfg80211_cac_event(priv->netdev, in mwifiex_11h_handle_chanrpt_ready()
223 &priv->dfs_chandef, in mwifiex_11h_handle_chanrpt_ready()
232 event_len -= (tlv_len + sizeof(rpt->header)); in mwifiex_11h_handle_chanrpt_ready()
244 rdr_event = (void *)(skb->data + sizeof(u32)); in mwifiex_11h_handle_radar_detected()
246 mwifiex_dbg(priv->adapter, MSG, in mwifiex_11h_handle_radar_detected()
248 if (mwifiex_stop_radar_detection(priv, &priv->dfs_chandef)) in mwifiex_11h_handle_radar_detected()
249 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_11h_handle_radar_detected()
251 cfg80211_radar_event(priv->adapter->wiphy, &priv->dfs_chandef, in mwifiex_11h_handle_radar_detected()
253 mwifiex_dbg(priv->adapter, MSG, "regdomain: %d\n", in mwifiex_11h_handle_radar_detected()
254 rdr_event->reg_domain); in mwifiex_11h_handle_radar_detected()
255 mwifiex_dbg(priv->adapter, MSG, "radar detection type: %d\n", in mwifiex_11h_handle_radar_detected()
256 rdr_event->det_type); in mwifiex_11h_handle_radar_detected()
261 /* This is work queue function for channel switch handling.
262 * This function takes care of updating new channel definitin to
263 * bss config structure, restart AP and indicate channel switch success
274 bss_cfg = &priv->bss_cfg; in mwifiex_dfs_chan_sw_work_queue()
275 if (!bss_cfg->beacon_period) { in mwifiex_dfs_chan_sw_work_queue()
276 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_dfs_chan_sw_work_queue()
277 "channel switch: AP already stopped\n"); in mwifiex_dfs_chan_sw_work_queue()
281 mwifiex_uap_set_channel(priv, bss_cfg, priv->dfs_chandef); in mwifiex_dfs_chan_sw_work_queue()
284 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_dfs_chan_sw_work_queue()
285 "Failed to start AP after channel switch\n"); in mwifiex_dfs_chan_sw_work_queue()
289 mwifiex_dbg(priv->adapter, MSG, in mwifiex_dfs_chan_sw_work_queue()
290 "indicating channel switch completion to kernel\n"); in mwifiex_dfs_chan_sw_work_queue()
291 wiphy_lock(priv->wdev.wiphy); in mwifiex_dfs_chan_sw_work_queue()
292 cfg80211_ch_switch_notify(priv->netdev, &priv->dfs_chandef, 0); in mwifiex_dfs_chan_sw_work_queue()
293 wiphy_unlock(priv->wdev.wiphy); in mwifiex_dfs_chan_sw_work_queue()