Lines Matching +full:in +full:- +full:band
6 * copyright notice and this permission notice appear in all copies.
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25 { .band = NL80211_BAND_2GHZ, .center_freq = 2412,
27 { .band = NL80211_BAND_2GHZ, .center_freq = 2417,
29 { .band = NL80211_BAND_2GHZ, .center_freq = 2422,
31 { .band = NL80211_BAND_2GHZ, .center_freq = 2427,
33 { .band = NL80211_BAND_2GHZ, .center_freq = 2432,
35 { .band = NL80211_BAND_2GHZ, .center_freq = 2437,
37 { .band = NL80211_BAND_2GHZ, .center_freq = 2442,
39 { .band = NL80211_BAND_2GHZ, .center_freq = 2447,
41 { .band = NL80211_BAND_2GHZ, .center_freq = 2452,
43 { .band = NL80211_BAND_2GHZ, .center_freq = 2457,
45 { .band = NL80211_BAND_2GHZ, .center_freq = 2462,
47 { .band = NL80211_BAND_2GHZ, .center_freq = 2467,
49 { .band = NL80211_BAND_2GHZ, .center_freq = 2472,
51 { .band = NL80211_BAND_2GHZ, .center_freq = 2484,
56 { .band = NL80211_BAND_5GHZ, .center_freq = 5180,
58 { .band = NL80211_BAND_5GHZ, .center_freq = 5200,
60 { .band = NL80211_BAND_5GHZ, .center_freq = 5220,
62 { .band = NL80211_BAND_5GHZ, .center_freq = 5240,
64 { .band = NL80211_BAND_5GHZ, .center_freq = 5260,
66 { .band = NL80211_BAND_5GHZ, .center_freq = 5280,
68 { .band = NL80211_BAND_5GHZ, .center_freq = 5300,
70 { .band = NL80211_BAND_5GHZ, .center_freq = 5320,
72 { .band = NL80211_BAND_5GHZ, .center_freq = 5500,
74 { .band = NL80211_BAND_5GHZ, .center_freq = 5520,
76 { .band = NL80211_BAND_5GHZ, .center_freq = 5540,
78 { .band = NL80211_BAND_5GHZ, .center_freq = 5560,
80 { .band = NL80211_BAND_5GHZ, .center_freq = 5580,
82 { .band = NL80211_BAND_5GHZ, .center_freq = 5600,
84 { .band = NL80211_BAND_5GHZ, .center_freq = 5620,
86 { .band = NL80211_BAND_5GHZ, .center_freq = 5640,
88 { .band = NL80211_BAND_5GHZ, .center_freq = 5660,
90 { .band = NL80211_BAND_5GHZ, .center_freq = 5680,
92 { .band = NL80211_BAND_5GHZ, .center_freq = 5700,
94 { .band = NL80211_BAND_5GHZ, .center_freq = 5745,
96 { .band = NL80211_BAND_5GHZ, .center_freq = 5765,
98 { .band = NL80211_BAND_5GHZ, .center_freq = 5785,
100 { .band = NL80211_BAND_5GHZ, .center_freq = 5805,
102 { .band = NL80211_BAND_5GHZ, .center_freq = 5825,
127 32, /* 1 - Wi-Fi alone */
130 0, /* 4 - BT EDR alone */
131 4, /* 5 - STA + BT EDR */
132 32, /* 6 - AP + BT EDR */
134 0, /* 8 - BT LE alone */
135 4, /* 9 - STA + BE LE */
139 1, /* 13 - STA + BT Dual */
140 4, /* 14 - AP + BT Dual */
170 * rsi_is_cipher_wep() - This function determines if the cipher is WEP or not.
178 if (((common->secinfo.gtk_cipher == WLAN_CIPHER_SUITE_WEP104) || in rsi_is_cipher_wep()
179 (common->secinfo.gtk_cipher == WLAN_CIPHER_SUITE_WEP40)) && in rsi_is_cipher_wep()
180 (!common->secinfo.ptk_cipher)) in rsi_is_cipher_wep()
187 * rsi_register_rates_channels() - This function registers channels and rates.
189 * @band: Operating band to be set.
191 * Return: int - 0 on success, negative error on failure.
193 static int rsi_register_rates_channels(struct rsi_hw *adapter, int band) in rsi_register_rates_channels() argument
195 struct ieee80211_supported_band *sbands = &adapter->sbands[band]; in rsi_register_rates_channels()
198 if (band == NL80211_BAND_2GHZ) { in rsi_register_rates_channels()
202 return -ENOMEM; in rsi_register_rates_channels()
203 sbands->band = NL80211_BAND_2GHZ; in rsi_register_rates_channels()
204 sbands->n_channels = ARRAY_SIZE(rsi_2ghz_channels); in rsi_register_rates_channels()
205 sbands->bitrates = rsi_rates; in rsi_register_rates_channels()
206 sbands->n_bitrates = ARRAY_SIZE(rsi_rates); in rsi_register_rates_channels()
211 return -ENOMEM; in rsi_register_rates_channels()
212 sbands->band = NL80211_BAND_5GHZ; in rsi_register_rates_channels()
213 sbands->n_channels = ARRAY_SIZE(rsi_5ghz_channels); in rsi_register_rates_channels()
214 sbands->bitrates = &rsi_rates[4]; in rsi_register_rates_channels()
215 sbands->n_bitrates = ARRAY_SIZE(rsi_rates) - 4; in rsi_register_rates_channels()
218 sbands->channels = channels; in rsi_register_rates_channels()
220 memset(&sbands->ht_cap, 0, sizeof(struct ieee80211_sta_ht_cap)); in rsi_register_rates_channels()
221 sbands->ht_cap.ht_supported = true; in rsi_register_rates_channels()
222 sbands->ht_cap.cap = (IEEE80211_HT_CAP_SUP_WIDTH_20_40 | in rsi_register_rates_channels()
225 sbands->ht_cap.ampdu_factor = IEEE80211_HT_MAX_AMPDU_16K; in rsi_register_rates_channels()
226 sbands->ht_cap.ampdu_density = IEEE80211_HT_MPDU_DENSITY_NONE; in rsi_register_rates_channels()
227 sbands->ht_cap.mcs.rx_mask[0] = 0xff; in rsi_register_rates_channels()
228 sbands->ht_cap.mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED; in rsi_register_rates_channels()
229 /* sbands->ht_cap.mcs.rx_highest = 0x82; */ in rsi_register_rates_channels()
237 struct cfg80211_scan_request *scan_req = &hw_req->req; in rsi_mac80211_hw_scan_start()
238 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_hw_scan_start()
239 struct rsi_common *common = adapter->priv; in rsi_mac80211_hw_scan_start()
240 struct ieee80211_bss_conf *bss = &vif->bss_conf; in rsi_mac80211_hw_scan_start()
243 common->mac_ops_resumed = false; in rsi_mac80211_hw_scan_start()
245 if (common->fsm_state != FSM_MAC_INIT_DONE) in rsi_mac80211_hw_scan_start()
246 return -ENODEV; in rsi_mac80211_hw_scan_start()
248 if ((common->wow_flags & RSI_WOW_ENABLED) || in rsi_mac80211_hw_scan_start()
249 scan_req->n_channels == 0) in rsi_mac80211_hw_scan_start()
250 return -EINVAL; in rsi_mac80211_hw_scan_start()
252 /* Scan already in progress. So return */ in rsi_mac80211_hw_scan_start()
253 if (common->bgscan_en) in rsi_mac80211_hw_scan_start()
254 return -EBUSY; in rsi_mac80211_hw_scan_start()
256 /* If STA is not connected, return with special value 1, in order in rsi_mac80211_hw_scan_start()
257 * to start sw_scan in mac80211 in rsi_mac80211_hw_scan_start()
259 if (!bss->assoc) in rsi_mac80211_hw_scan_start()
262 mutex_lock(&common->mutex); in rsi_mac80211_hw_scan_start()
263 common->hwscan = scan_req; in rsi_mac80211_hw_scan_start()
267 common->bgscan_en = true; in rsi_mac80211_hw_scan_start()
270 mutex_unlock(&common->mutex); in rsi_mac80211_hw_scan_start()
278 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_cancel_hw_scan()
279 struct rsi_common *common = adapter->priv; in rsi_mac80211_cancel_hw_scan()
283 mutex_lock(&common->mutex); in rsi_mac80211_cancel_hw_scan()
285 if (common->bgscan_en) { in rsi_mac80211_cancel_hw_scan()
287 common->bgscan_en = false; in rsi_mac80211_cancel_hw_scan()
289 ieee80211_scan_completed(adapter->hw, &info); in rsi_mac80211_cancel_hw_scan()
292 common->hwscan = NULL; in rsi_mac80211_cancel_hw_scan()
293 mutex_unlock(&common->mutex); in rsi_mac80211_cancel_hw_scan()
297 * rsi_mac80211_detach() - This function is used to de-initialize the
305 struct ieee80211_hw *hw = adapter->hw; in rsi_mac80211_detach()
306 enum nl80211_band band; in rsi_mac80211_detach() local
312 adapter->hw = NULL; in rsi_mac80211_detach()
315 for (band = 0; band < NUM_NL80211_BANDS; band++) { in rsi_mac80211_detach()
317 &adapter->sbands[band]; in rsi_mac80211_detach()
319 kfree(sband->channels); in rsi_mac80211_detach()
324 kfree(adapter->dfsentry); in rsi_mac80211_detach()
330 * rsi_indicate_tx_status() - This function indicates the transmit status.
344 if (!adapter->hw) { in rsi_indicate_tx_status()
350 info->flags |= IEEE80211_TX_STAT_ACK; in rsi_indicate_tx_status()
352 tx_params = (struct skb_info *)info->driver_data; in rsi_indicate_tx_status()
353 skb_pull(skb, tx_params->internal_hdr_size); in rsi_indicate_tx_status()
354 memset(info->driver_data, 0, IEEE80211_TX_INFO_DRIVER_DATA_SIZE); in rsi_indicate_tx_status()
356 ieee80211_tx_status_irqsafe(adapter->hw, skb); in rsi_indicate_tx_status()
360 * rsi_mac80211_tx() - This is the handler that 802.11 module calls for each
373 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_tx()
374 struct rsi_common *common = adapter->priv; in rsi_mac80211_tx()
375 struct ieee80211_hdr *wlh = (struct ieee80211_hdr *)skb->data; in rsi_mac80211_tx()
377 if (ieee80211_is_auth(wlh->frame_control)) in rsi_mac80211_tx()
378 common->mac_ops_resumed = false; in rsi_mac80211_tx()
384 * rsi_mac80211_start() - This is first handler that 802.11 module calls, since
393 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_start()
394 struct rsi_common *common = adapter->priv; in rsi_mac80211_start()
397 mutex_lock(&common->mutex); in rsi_mac80211_start()
398 if (common->hibernate_resume) { in rsi_mac80211_start()
399 common->reinit_hw = true; in rsi_mac80211_start()
400 adapter->host_intf_ops->reinit_device(adapter); in rsi_mac80211_start()
401 wait_for_completion(&adapter->priv->wlan_init_completion); in rsi_mac80211_start()
403 common->iface_down = false; in rsi_mac80211_start()
404 wiphy_rfkill_start_polling(hw->wiphy); in rsi_mac80211_start()
406 mutex_unlock(&common->mutex); in rsi_mac80211_start()
412 * rsi_mac80211_stop() - This is the last handler that 802.11 module calls.
419 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_stop()
420 struct rsi_common *common = adapter->priv; in rsi_mac80211_stop()
423 mutex_lock(&common->mutex); in rsi_mac80211_stop()
424 common->iface_down = true; in rsi_mac80211_stop()
425 wiphy_rfkill_stop_polling(hw->wiphy); in rsi_mac80211_stop()
430 mutex_unlock(&common->mutex); in rsi_mac80211_stop()
452 * rsi_mac80211_add_interface() - This function is called when a netdevice
462 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_add_interface()
463 struct rsi_common *common = adapter->priv; in rsi_mac80211_add_interface()
464 struct vif_priv *vif_info = (struct vif_priv *)vif->drv_priv; in rsi_mac80211_add_interface()
467 int vap_idx = -1, i; in rsi_mac80211_add_interface()
469 vif->driver_flags |= IEEE80211_VIF_SUPPORTS_UAPSD; in rsi_mac80211_add_interface()
470 mutex_lock(&common->mutex); in rsi_mac80211_add_interface()
472 intf_mode = rsi_map_intf_mode(vif->type); in rsi_mac80211_add_interface()
476 vif->type); in rsi_mac80211_add_interface()
477 mutex_unlock(&common->mutex); in rsi_mac80211_add_interface()
478 return -EOPNOTSUPP; in rsi_mac80211_add_interface()
480 if ((vif->type == NL80211_IFTYPE_P2P_DEVICE) || in rsi_mac80211_add_interface()
481 (vif->type == NL80211_IFTYPE_P2P_CLIENT) || in rsi_mac80211_add_interface()
482 (vif->type == NL80211_IFTYPE_P2P_GO)) in rsi_mac80211_add_interface()
483 common->p2p_enabled = true; in rsi_mac80211_add_interface()
487 if (!adapter->vifs[i] || in rsi_mac80211_add_interface()
488 !memcmp(vif->addr, adapter->vifs[i]->addr, ETH_ALEN)) { in rsi_mac80211_add_interface()
495 mutex_unlock(&common->mutex); in rsi_mac80211_add_interface()
496 return -EOPNOTSUPP; in rsi_mac80211_add_interface()
498 vif_info->vap_id = vap_idx; in rsi_mac80211_add_interface()
499 adapter->vifs[vap_idx] = vif; in rsi_mac80211_add_interface()
500 adapter->sc_nvifs++; in rsi_mac80211_add_interface()
503 if (rsi_set_vap_capabilities(common, intf_mode, vif->addr, in rsi_mac80211_add_interface()
504 vif_info->vap_id, vap_status)) { in rsi_mac80211_add_interface()
506 mutex_unlock(&common->mutex); in rsi_mac80211_add_interface()
507 return -EINVAL; in rsi_mac80211_add_interface()
510 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_add_interface()
511 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_mac80211_add_interface()
513 common->min_rate = RSI_RATE_AUTO; in rsi_mac80211_add_interface()
514 for (i = 0; i < common->max_stations; i++) in rsi_mac80211_add_interface()
515 common->stations[i].sta = NULL; in rsi_mac80211_add_interface()
518 mutex_unlock(&common->mutex); in rsi_mac80211_add_interface()
524 * rsi_mac80211_remove_interface() - This function notifies driver that an
534 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_remove_interface()
535 struct rsi_common *common = adapter->priv; in rsi_mac80211_remove_interface()
541 mutex_lock(&common->mutex); in rsi_mac80211_remove_interface()
543 if (adapter->sc_nvifs <= 0) { in rsi_mac80211_remove_interface()
544 mutex_unlock(&common->mutex); in rsi_mac80211_remove_interface()
548 opmode = rsi_map_intf_mode(vif->type); in rsi_mac80211_remove_interface()
551 mutex_unlock(&common->mutex); in rsi_mac80211_remove_interface()
555 if (!adapter->vifs[i]) in rsi_mac80211_remove_interface()
557 if (vif == adapter->vifs[i]) { in rsi_mac80211_remove_interface()
558 rsi_set_vap_capabilities(common, opmode, vif->addr, in rsi_mac80211_remove_interface()
560 adapter->sc_nvifs--; in rsi_mac80211_remove_interface()
561 adapter->vifs[i] = NULL; in rsi_mac80211_remove_interface()
564 mutex_unlock(&common->mutex); in rsi_mac80211_remove_interface()
568 * rsi_channel_change() - This function is a performs the checks
577 struct rsi_hw *adapter = hw->priv; in rsi_channel_change()
578 struct rsi_common *common = adapter->priv; in rsi_channel_change()
579 int status = -EOPNOTSUPP; in rsi_channel_change()
580 struct ieee80211_channel *curchan = hw->conf.chandef.chan; in rsi_channel_change()
581 u16 channel = curchan->hw_value; in rsi_channel_change()
589 __func__, curchan->center_freq, in rsi_channel_change()
590 curchan->flags, channel); in rsi_channel_change()
593 vif = adapter->vifs[i]; in rsi_channel_change()
596 if (vif->type == NL80211_IFTYPE_STATION) { in rsi_channel_change()
597 bss = &vif->bss_conf; in rsi_channel_change()
598 if (bss->assoc) { in rsi_channel_change()
605 if (!common->hw_data_qs_blocked && in rsi_channel_change()
609 common->hw_data_qs_blocked = true; in rsi_channel_change()
615 status = rsi_set_channel(adapter->priv, curchan); in rsi_channel_change()
618 if (common->hw_data_qs_blocked && in rsi_channel_change()
622 common->hw_data_qs_blocked = false; in rsi_channel_change()
630 * rsi_config_power() - This function configures tx power to device
637 struct rsi_hw *adapter = hw->priv; in rsi_config_power()
638 struct rsi_common *common = adapter->priv; in rsi_config_power()
639 struct ieee80211_conf *conf = &hw->conf; in rsi_config_power()
641 if (adapter->sc_nvifs <= 0) { in rsi_config_power()
643 return -EINVAL; in rsi_config_power()
647 "%s: Set tx power: %d dBM\n", __func__, conf->power_level); in rsi_config_power()
649 if (conf->power_level == common->tx_power) in rsi_config_power()
652 common->tx_power = conf->power_level; in rsi_config_power()
658 * rsi_mac80211_config() - This function is a handler for configuration
669 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_config()
670 struct rsi_common *common = adapter->priv; in rsi_mac80211_config()
671 struct ieee80211_conf *conf = &hw->conf; in rsi_mac80211_config()
672 int status = -EOPNOTSUPP; in rsi_mac80211_config()
674 mutex_lock(&common->mutex); in rsi_mac80211_config()
687 !common->mac_ops_resumed) { in rsi_mac80211_config()
693 vif = adapter->vifs[i]; in rsi_mac80211_config()
697 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_config()
698 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_mac80211_config()
702 if ((vif->type == NL80211_IFTYPE_STATION || in rsi_mac80211_config()
703 vif->type == NL80211_IFTYPE_P2P_CLIENT) && in rsi_mac80211_config()
704 (!sta_vif || vif->bss_conf.assoc)) in rsi_mac80211_config()
708 spin_lock_irqsave(&adapter->ps_lock, flags); in rsi_mac80211_config()
709 if (conf->flags & IEEE80211_CONF_PS) in rsi_mac80211_config()
713 spin_unlock_irqrestore(&adapter->ps_lock, flags); in rsi_mac80211_config()
720 if ((common->rts_threshold) <= IEEE80211_MAX_RTS_THRESHOLD) { in rsi_mac80211_config()
726 mutex_unlock(&common->mutex); in rsi_mac80211_config()
732 * rsi_get_connected_channel() - This function is used to get the current
746 bss = &vif->bss_conf; in rsi_get_connected_channel()
747 channel = bss->chandef.chan; in rsi_get_connected_channel()
752 return channel->hw_value; in rsi_get_connected_channel()
758 struct rsi_common *common = adapter->priv; in rsi_switch_channel()
761 if (common->iface_down) in rsi_switch_channel()
766 channel = vif->bss_conf.chandef.chan; in rsi_switch_channel()
773 rsi_dbg(INFO_ZONE, "Switched to channel - %d\n", channel->hw_value); in rsi_switch_channel()
777 * rsi_mac80211_bss_info_changed() - This function is a handler for config
792 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_bss_info_changed()
793 struct rsi_common *common = adapter->priv; in rsi_mac80211_bss_info_changed()
794 struct ieee80211_bss_conf *bss = &vif->bss_conf; in rsi_mac80211_bss_info_changed()
795 struct ieee80211_conf *conf = &hw->conf; in rsi_mac80211_bss_info_changed()
798 mutex_lock(&common->mutex); in rsi_mac80211_bss_info_changed()
801 __func__, bss_conf->assoc); in rsi_mac80211_bss_info_changed()
802 if (bss_conf->assoc) { in rsi_mac80211_bss_info_changed()
811 bss_conf->assoc, in rsi_mac80211_bss_info_changed()
812 bss_conf->bssid, in rsi_mac80211_bss_info_changed()
813 bss_conf->qos, in rsi_mac80211_bss_info_changed()
814 bss_conf->aid, in rsi_mac80211_bss_info_changed()
816 bss_conf->assoc_capability, vif); in rsi_mac80211_bss_info_changed()
817 adapter->ps_info.dtim_interval_duration = bss->dtim_period; in rsi_mac80211_bss_info_changed()
818 adapter->ps_info.listen_interval = conf->listen_interval; in rsi_mac80211_bss_info_changed()
820 /* If U-APSD is updated, send ps parameters to firmware */ in rsi_mac80211_bss_info_changed()
821 if (bss->assoc) { in rsi_mac80211_bss_info_changed()
822 if (common->uapsd_bitmap) { in rsi_mac80211_bss_info_changed()
827 common->uapsd_bitmap = 0; in rsi_mac80211_bss_info_changed()
832 common->cqm_info.last_cqm_event_rssi = 0; in rsi_mac80211_bss_info_changed()
833 common->cqm_info.rssi_thold = bss_conf->cqm_rssi_thold; in rsi_mac80211_bss_info_changed()
834 common->cqm_info.rssi_hyst = bss_conf->cqm_rssi_hyst; in rsi_mac80211_bss_info_changed()
836 common->cqm_info.rssi_thold, in rsi_mac80211_bss_info_changed()
837 common->cqm_info.rssi_hyst); in rsi_mac80211_bss_info_changed()
841 ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_bss_info_changed()
842 (vif->type == NL80211_IFTYPE_P2P_GO))) { in rsi_mac80211_bss_info_changed()
843 if (bss->enable_beacon) { in rsi_mac80211_bss_info_changed()
845 common->beacon_enabled = 1; in rsi_mac80211_bss_info_changed()
848 common->beacon_enabled = 0; in rsi_mac80211_bss_info_changed()
852 mutex_unlock(&common->mutex); in rsi_mac80211_bss_info_changed()
856 * rsi_mac80211_conf_filter() - This function configure the device's RX filter.
874 * rsi_mac80211_conf_tx() - This function configures TX queue parameters
888 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_conf_tx()
889 struct rsi_common *common = adapter->priv; in rsi_mac80211_conf_tx()
897 __func__, queue, params->aifs, in rsi_mac80211_conf_tx()
898 params->cw_min, params->cw_max, params->txop); in rsi_mac80211_conf_tx()
900 mutex_lock(&common->mutex); in rsi_mac80211_conf_tx()
920 memcpy(&common->edca_params[idx], in rsi_mac80211_conf_tx()
924 if (params->uapsd) in rsi_mac80211_conf_tx()
925 common->uapsd_bitmap |= idx; in rsi_mac80211_conf_tx()
927 common->uapsd_bitmap &= (~idx); in rsi_mac80211_conf_tx()
929 mutex_unlock(&common->mutex); in rsi_mac80211_conf_tx()
935 * rsi_hal_key_config() - This function loads the keys into the firmware.
948 struct rsi_hw *adapter = hw->priv; in rsi_hal_key_config()
954 if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) in rsi_hal_key_config()
960 __func__, key->cipher, key_type, key->keylen); in rsi_hal_key_config()
962 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_hal_key_config()
963 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_hal_key_config()
965 rsta = rsi_find_sta(adapter->priv, sta->addr); in rsi_hal_key_config()
967 sta_id = rsta->sta_id; in rsi_hal_key_config()
969 adapter->priv->key = key; in rsi_hal_key_config()
971 if ((key->cipher == WLAN_CIPHER_SUITE_WEP104) || in rsi_hal_key_config()
972 (key->cipher == WLAN_CIPHER_SUITE_WEP40)) { in rsi_hal_key_config()
973 status = rsi_hal_load_key(adapter->priv, in rsi_hal_key_config()
974 key->key, in rsi_hal_key_config()
975 key->keylen, in rsi_hal_key_config()
977 key->keyidx, in rsi_hal_key_config()
978 key->cipher, in rsi_hal_key_config()
986 status = rsi_hal_load_key(adapter->priv, in rsi_hal_key_config()
987 key->key, in rsi_hal_key_config()
988 key->keylen, in rsi_hal_key_config()
990 key->keyidx, in rsi_hal_key_config()
991 key->cipher, in rsi_hal_key_config()
997 if (vif->type == NL80211_IFTYPE_STATION && in rsi_hal_key_config()
998 (key->cipher == WLAN_CIPHER_SUITE_WEP104 || in rsi_hal_key_config()
999 key->cipher == WLAN_CIPHER_SUITE_WEP40)) { in rsi_hal_key_config()
1000 if (!rsi_send_block_unblock_frame(adapter->priv, false)) in rsi_hal_key_config()
1001 adapter->priv->hw_data_qs_blocked = false; in rsi_hal_key_config()
1008 * rsi_mac80211_set_key() - This function sets type of key to be loaded.
1023 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_set_key()
1024 struct rsi_common *common = adapter->priv; in rsi_mac80211_set_key()
1025 struct security_info *secinfo = &common->secinfo; in rsi_mac80211_set_key()
1028 mutex_lock(&common->mutex); in rsi_mac80211_set_key()
1031 secinfo->security_enable = true; in rsi_mac80211_set_key()
1034 mutex_unlock(&common->mutex); in rsi_mac80211_set_key()
1038 if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) in rsi_mac80211_set_key()
1039 secinfo->ptk_cipher = key->cipher; in rsi_mac80211_set_key()
1041 secinfo->gtk_cipher = key->cipher; in rsi_mac80211_set_key()
1043 key->hw_key_idx = key->keyidx; in rsi_mac80211_set_key()
1044 key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; in rsi_mac80211_set_key()
1050 if (vif->type == NL80211_IFTYPE_STATION) in rsi_mac80211_set_key()
1051 secinfo->security_enable = false; in rsi_mac80211_set_key()
1058 status = -EOPNOTSUPP; in rsi_mac80211_set_key()
1062 mutex_unlock(&common->mutex); in rsi_mac80211_set_key()
1067 * rsi_mac80211_ampdu_action() - This function selects the AMPDU action for
1072 * @params: Pointer to A-MPDU action parameters
1080 int status = -EOPNOTSUPP; in rsi_mac80211_ampdu_action()
1081 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_ampdu_action()
1082 struct rsi_common *common = adapter->priv; in rsi_mac80211_ampdu_action()
1086 struct ieee80211_sta *sta = params->sta; in rsi_mac80211_ampdu_action()
1088 enum ieee80211_ampdu_mlme_action action = params->action; in rsi_mac80211_ampdu_action()
1089 u16 tid = params->tid; in rsi_mac80211_ampdu_action()
1090 u16 *ssn = ¶ms->ssn; in rsi_mac80211_ampdu_action()
1091 u8 buf_size = params->buf_size; in rsi_mac80211_ampdu_action()
1094 if (vif == adapter->vifs[ii]) in rsi_mac80211_ampdu_action()
1098 mutex_lock(&common->mutex); in rsi_mac80211_ampdu_action()
1103 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_ampdu_action()
1104 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_mac80211_ampdu_action()
1105 rsta = rsi_find_sta(common, sta->addr); in rsi_mac80211_ampdu_action()
1111 sta_id = rsta->sta_id; in rsi_mac80211_ampdu_action()
1138 if ((vif->type == NL80211_IFTYPE_STATION) || in rsi_mac80211_ampdu_action()
1139 (vif->type == NL80211_IFTYPE_P2P_CLIENT)) in rsi_mac80211_ampdu_action()
1140 common->vif_info[ii].seq_start = seq_no; in rsi_mac80211_ampdu_action()
1141 else if ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_ampdu_action()
1142 (vif->type == NL80211_IFTYPE_P2P_GO)) in rsi_mac80211_ampdu_action()
1143 rsta->seq_start[tid] = seq_no; in rsi_mac80211_ampdu_action()
1157 ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid); in rsi_mac80211_ampdu_action()
1161 if ((vif->type == NL80211_IFTYPE_STATION) || in rsi_mac80211_ampdu_action()
1162 (vif->type == NL80211_IFTYPE_P2P_CLIENT)) in rsi_mac80211_ampdu_action()
1163 seq_start = common->vif_info[ii].seq_start; in rsi_mac80211_ampdu_action()
1164 else if ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_ampdu_action()
1165 (vif->type == NL80211_IFTYPE_P2P_GO)) in rsi_mac80211_ampdu_action()
1166 seq_start = rsta->seq_start[tid]; in rsi_mac80211_ampdu_action()
1181 mutex_unlock(&common->mutex); in rsi_mac80211_ampdu_action()
1186 * rsi_mac80211_set_rts_threshold() - This function sets rts threshold value.
1195 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_set_rts_threshold()
1196 struct rsi_common *common = adapter->priv; in rsi_mac80211_set_rts_threshold()
1198 mutex_lock(&common->mutex); in rsi_mac80211_set_rts_threshold()
1199 common->rts_threshold = value; in rsi_mac80211_set_rts_threshold()
1200 mutex_unlock(&common->mutex); in rsi_mac80211_set_rts_threshold()
1206 * rsi_mac80211_set_rate_mask() - This function sets bitrate_mask to be used.
1217 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_set_rate_mask()
1218 struct rsi_common *common = adapter->priv; in rsi_mac80211_set_rate_mask()
1219 enum nl80211_band band = hw->conf.chandef.chan->band; in rsi_mac80211_set_rate_mask() local
1221 mutex_lock(&common->mutex); in rsi_mac80211_set_rate_mask()
1222 common->fixedrate_mask[band] = 0; in rsi_mac80211_set_rate_mask()
1224 if (mask->control[band].legacy == 0xfff) { in rsi_mac80211_set_rate_mask()
1225 common->fixedrate_mask[band] = in rsi_mac80211_set_rate_mask()
1226 (mask->control[band].ht_mcs[0] << 12); in rsi_mac80211_set_rate_mask()
1228 common->fixedrate_mask[band] = in rsi_mac80211_set_rate_mask()
1229 mask->control[band].legacy; in rsi_mac80211_set_rate_mask()
1231 mutex_unlock(&common->mutex); in rsi_mac80211_set_rate_mask()
1237 * rsi_perform_cqm() - This function performs cqm.
1248 s8 last_event = common->cqm_info.last_cqm_event_rssi; in rsi_perform_cqm()
1249 int thold = common->cqm_info.rssi_thold; in rsi_perform_cqm()
1250 u32 hyst = common->cqm_info.rssi_hyst; in rsi_perform_cqm()
1253 if (rssi < thold && (last_event == 0 || rssi < (last_event - hyst))) in rsi_perform_cqm()
1261 common->cqm_info.last_cqm_event_rssi = rssi; in rsi_perform_cqm()
1269 * rsi_fill_rx_status() - This function fills rx status in
1283 struct rsi_hw *adapter = common->priv; in rsi_fill_rx_status()
1287 struct skb_info *rx_params = (struct skb_info *)info->driver_data; in rsi_fill_rx_status()
1289 char rssi = rx_params->rssi; in rsi_fill_rx_status()
1291 u8 channel = rx_params->channel; in rsi_fill_rx_status()
1295 hdr = ((struct ieee80211_hdr *)(skb->data)); in rsi_fill_rx_status()
1296 hdrlen = ieee80211_hdrlen(hdr->frame_control); in rsi_fill_rx_status()
1300 rxs->signal = -(rssi); in rsi_fill_rx_status()
1302 rxs->band = common->band; in rsi_fill_rx_status()
1304 freq = ieee80211_channel_to_frequency(channel, rxs->band); in rsi_fill_rx_status()
1307 rxs->freq = freq; in rsi_fill_rx_status()
1309 if (ieee80211_has_protected(hdr->frame_control)) { in rsi_fill_rx_status()
1311 memmove(skb->data + 4, skb->data, hdrlen); in rsi_fill_rx_status()
1314 memmove(skb->data + 8, skb->data, hdrlen); in rsi_fill_rx_status()
1316 rxs->flag |= RX_FLAG_MMIC_STRIPPED; in rsi_fill_rx_status()
1318 rxs->flag |= RX_FLAG_DECRYPTED; in rsi_fill_rx_status()
1319 rxs->flag |= RX_FLAG_IV_STRIPPED; in rsi_fill_rx_status()
1323 vif = adapter->vifs[i]; in rsi_fill_rx_status()
1326 if (vif->type == NL80211_IFTYPE_STATION) { in rsi_fill_rx_status()
1327 bss = &vif->bss_conf; in rsi_fill_rx_status()
1334 if (bss->assoc && !(memcmp(bss->bssid, hdr->addr2, ETH_ALEN))) { in rsi_fill_rx_status()
1335 if (ieee80211_is_beacon(hdr->frame_control)) in rsi_fill_rx_status()
1336 rsi_perform_cqm(common, hdr->addr2, rxs->signal, vif); in rsi_fill_rx_status()
1343 * rsi_indicate_pkt_to_os() - This function sends received packet to mac80211.
1352 struct rsi_hw *adapter = common->priv; in rsi_indicate_pkt_to_os()
1353 struct ieee80211_hw *hw = adapter->hw; in rsi_indicate_pkt_to_os()
1356 if ((common->iface_down) || (!adapter->sc_nvifs)) { in rsi_indicate_pkt_to_os()
1361 /* filling in the ieee80211_rx_status flags */ in rsi_indicate_pkt_to_os()
1371 u8 band = hw->conf.chandef.chan->band; in rsi_set_min_rate() local
1376 common->bitrate_mask[band] = sta->supp_rates[band]; in rsi_set_min_rate()
1378 rate_bitmap = (common->fixedrate_mask[band] & sta->supp_rates[band]); in rsi_set_min_rate()
1384 common->min_rate = rsi_rates[ii].hw_value; in rsi_set_min_rate()
1391 common->vif_info[0].is_ht = sta->ht_cap.ht_supported; in rsi_set_min_rate()
1393 if ((common->vif_info[0].is_ht) && (rate_bitmap >> 12)) { in rsi_set_min_rate()
1396 common->min_rate = rsi_mcsrates[ii]; in rsi_set_min_rate()
1404 common->min_rate = 0xffff; in rsi_set_min_rate()
1408 * rsi_mac80211_sta_add() - This function notifies driver about a peer getting
1420 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_sta_add()
1421 struct rsi_common *common = adapter->priv; in rsi_mac80211_sta_add()
1426 rsi_dbg(INFO_ZONE, "Station Add: %pM\n", sta->addr); in rsi_mac80211_sta_add()
1428 mutex_lock(&common->mutex); in rsi_mac80211_sta_add()
1430 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_sta_add()
1431 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_mac80211_sta_add()
1433 int sta_idx = -1; in rsi_mac80211_sta_add()
1434 int free_index = -1; in rsi_mac80211_sta_add()
1437 if (common->num_stations >= common->max_stations) { in rsi_mac80211_sta_add()
1439 status = -EOPNOTSUPP; in rsi_mac80211_sta_add()
1442 for (cnt = 0; cnt < common->max_stations; cnt++) { in rsi_mac80211_sta_add()
1443 rsta = &common->stations[cnt]; in rsi_mac80211_sta_add()
1445 if (!rsta->sta) { in rsi_mac80211_sta_add()
1450 if (!memcmp(rsta->sta->addr, sta->addr, ETH_ALEN)) { in rsi_mac80211_sta_add()
1465 status = -EINVAL; in rsi_mac80211_sta_add()
1468 rsta = &common->stations[sta_idx]; in rsi_mac80211_sta_add()
1469 rsta->sta = sta; in rsi_mac80211_sta_add()
1470 rsta->sta_id = sta_idx; in rsi_mac80211_sta_add()
1472 rsta->start_tx_aggr[cnt] = false; in rsi_mac80211_sta_add()
1474 rsta->seq_start[cnt] = 0; in rsi_mac80211_sta_add()
1481 sta->addr, sta->wme, sta->aid, in rsi_mac80211_sta_add()
1484 if (common->key) { in rsi_mac80211_sta_add()
1485 struct ieee80211_key_conf *key = common->key; in rsi_mac80211_sta_add()
1487 if ((key->cipher == WLAN_CIPHER_SUITE_WEP104) || in rsi_mac80211_sta_add()
1488 (key->cipher == WLAN_CIPHER_SUITE_WEP40)) in rsi_mac80211_sta_add()
1489 rsi_hal_load_key(adapter->priv, in rsi_mac80211_sta_add()
1490 key->key, in rsi_mac80211_sta_add()
1491 key->keylen, in rsi_mac80211_sta_add()
1493 key->keyidx, in rsi_mac80211_sta_add()
1494 key->cipher, in rsi_mac80211_sta_add()
1499 common->num_stations++; in rsi_mac80211_sta_add()
1503 if ((vif->type == NL80211_IFTYPE_STATION) || in rsi_mac80211_sta_add()
1504 (vif->type == NL80211_IFTYPE_P2P_CLIENT)) { in rsi_mac80211_sta_add()
1506 if (sta->ht_cap.ht_supported) { in rsi_mac80211_sta_add()
1507 common->vif_info[0].is_ht = true; in rsi_mac80211_sta_add()
1508 common->bitrate_mask[NL80211_BAND_2GHZ] = in rsi_mac80211_sta_add()
1509 sta->supp_rates[NL80211_BAND_2GHZ]; in rsi_mac80211_sta_add()
1510 if ((sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20) || in rsi_mac80211_sta_add()
1511 (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40)) in rsi_mac80211_sta_add()
1512 common->vif_info[0].sgi = true; in rsi_mac80211_sta_add()
1518 mutex_unlock(&common->mutex); in rsi_mac80211_sta_add()
1524 * rsi_mac80211_sta_remove() - This function notifies driver about a peer
1536 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_sta_remove()
1537 struct rsi_common *common = adapter->priv; in rsi_mac80211_sta_remove()
1538 struct ieee80211_bss_conf *bss = &vif->bss_conf; in rsi_mac80211_sta_remove()
1541 rsi_dbg(INFO_ZONE, "Station Remove: %pM\n", sta->addr); in rsi_mac80211_sta_remove()
1543 mutex_lock(&common->mutex); in rsi_mac80211_sta_remove()
1545 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_sta_remove()
1546 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_mac80211_sta_remove()
1551 for (sta_idx = 0; sta_idx < common->max_stations; sta_idx++) { in rsi_mac80211_sta_remove()
1552 rsta = &common->stations[sta_idx]; in rsi_mac80211_sta_remove()
1554 if (!rsta->sta) in rsi_mac80211_sta_remove()
1556 if (!memcmp(rsta->sta->addr, sta->addr, ETH_ALEN)) { in rsi_mac80211_sta_remove()
1558 sta->addr, sta->wme, in rsi_mac80211_sta_remove()
1559 sta->aid, sta, sta_idx, in rsi_mac80211_sta_remove()
1561 rsta->sta = NULL; in rsi_mac80211_sta_remove()
1562 rsta->sta_id = -1; in rsi_mac80211_sta_remove()
1564 rsta->start_tx_aggr[cnt] = false; in rsi_mac80211_sta_remove()
1565 if (common->num_stations > 0) in rsi_mac80211_sta_remove()
1566 common->num_stations--; in rsi_mac80211_sta_remove()
1570 if (sta_idx >= common->max_stations) in rsi_mac80211_sta_remove()
1574 if ((vif->type == NL80211_IFTYPE_STATION) || in rsi_mac80211_sta_remove()
1575 (vif->type == NL80211_IFTYPE_P2P_CLIENT)) { in rsi_mac80211_sta_remove()
1577 memcpy((u8 *)bss->bssid, (u8 *)sta->addr, ETH_ALEN); in rsi_mac80211_sta_remove()
1578 bss->qos = sta->wme; in rsi_mac80211_sta_remove()
1579 common->bitrate_mask[NL80211_BAND_2GHZ] = 0; in rsi_mac80211_sta_remove()
1580 common->bitrate_mask[NL80211_BAND_5GHZ] = 0; in rsi_mac80211_sta_remove()
1581 common->min_rate = 0xffff; in rsi_mac80211_sta_remove()
1582 common->vif_info[0].is_ht = false; in rsi_mac80211_sta_remove()
1583 common->vif_info[0].sgi = false; in rsi_mac80211_sta_remove()
1584 common->vif_info[0].seq_start = 0; in rsi_mac80211_sta_remove()
1585 common->secinfo.ptk_cipher = 0; in rsi_mac80211_sta_remove()
1586 common->secinfo.gtk_cipher = 0; in rsi_mac80211_sta_remove()
1587 if (!common->iface_down) in rsi_mac80211_sta_remove()
1590 mutex_unlock(&common->mutex); in rsi_mac80211_sta_remove()
1596 * rsi_mac80211_set_antenna() - This function is used to configure
1607 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_set_antenna()
1608 struct rsi_common *common = adapter->priv; in rsi_mac80211_set_antenna()
1617 return -EINVAL; in rsi_mac80211_set_antenna()
1623 mutex_lock(&common->mutex); in rsi_mac80211_set_antenna()
1626 if (common->ant_in_use != antenna) in rsi_mac80211_set_antenna()
1633 common->ant_in_use = antenna; in rsi_mac80211_set_antenna()
1635 mutex_unlock(&common->mutex); in rsi_mac80211_set_antenna()
1641 mutex_unlock(&common->mutex); in rsi_mac80211_set_antenna()
1642 return -EINVAL; in rsi_mac80211_set_antenna()
1646 * rsi_mac80211_get_antenna() - This function is used to configure
1658 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_get_antenna()
1659 struct rsi_common *common = adapter->priv; in rsi_mac80211_get_antenna()
1661 mutex_lock(&common->mutex); in rsi_mac80211_get_antenna()
1663 *tx_ant = (common->ant_in_use == ANTENNA_SEL_UFL) ? 1 : 0; in rsi_mac80211_get_antenna()
1666 mutex_unlock(&common->mutex); in rsi_mac80211_get_antenna()
1692 struct rsi_hw * adapter = hw->priv; in rsi_reg_notify()
1693 struct rsi_common *common = adapter->priv; in rsi_reg_notify()
1696 mutex_lock(&common->mutex); in rsi_reg_notify()
1699 request->alpha2, request->dfs_region); in rsi_reg_notify()
1701 if (common->num_supp_bands > 1) { in rsi_reg_notify()
1702 sband = wiphy->bands[NL80211_BAND_5GHZ]; in rsi_reg_notify()
1704 for (i = 0; i < sband->n_channels; i++) { in rsi_reg_notify()
1705 ch = &sband->channels[i]; in rsi_reg_notify()
1706 if (ch->flags & IEEE80211_CHAN_DISABLED) in rsi_reg_notify()
1709 if (ch->flags & IEEE80211_CHAN_RADAR) in rsi_reg_notify()
1710 ch->flags |= IEEE80211_CHAN_NO_IR; in rsi_reg_notify()
1713 adapter->dfs_region = rsi_map_region_code(request->dfs_region); in rsi_reg_notify()
1714 rsi_dbg(INFO_ZONE, "RSI region code = %d\n", adapter->dfs_region); in rsi_reg_notify()
1716 adapter->country[0] = request->alpha2[0]; in rsi_reg_notify()
1717 adapter->country[1] = request->alpha2[1]; in rsi_reg_notify()
1719 mutex_unlock(&common->mutex); in rsi_reg_notify()
1724 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_rfkill_poll()
1725 struct rsi_common *common = adapter->priv; in rsi_mac80211_rfkill_poll()
1727 mutex_lock(&common->mutex); in rsi_mac80211_rfkill_poll()
1728 if (common->fsm_state != FSM_MAC_INIT_DONE) in rsi_mac80211_rfkill_poll()
1729 wiphy_rfkill_set_hw_state(hw->wiphy, true); in rsi_mac80211_rfkill_poll()
1731 wiphy_rfkill_set_hw_state(hw->wiphy, false); in rsi_mac80211_rfkill_poll()
1732 mutex_unlock(&common->mutex); in rsi_mac80211_rfkill_poll()
1737 struct rsi_hw *adapter = common->priv; in rsi_resume_conn_channel()
1742 vif = adapter->vifs[cnt]; in rsi_resume_conn_channel()
1746 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_resume_conn_channel()
1747 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_resume_conn_channel()
1751 if (((vif->type == NL80211_IFTYPE_STATION) || in rsi_resume_conn_channel()
1752 (vif->type == NL80211_IFTYPE_P2P_CLIENT)) && in rsi_resume_conn_channel()
1753 vif->bss_conf.assoc) { in rsi_resume_conn_channel()
1766 mutex_lock(&common->mutex); in rsi_roc_timeout()
1767 ieee80211_remain_on_channel_expired(common->priv->hw); in rsi_roc_timeout()
1769 if (timer_pending(&common->roc_timer)) in rsi_roc_timeout()
1770 del_timer(&common->roc_timer); in rsi_roc_timeout()
1773 mutex_unlock(&common->mutex); in rsi_roc_timeout()
1780 struct rsi_hw *adapter = (struct rsi_hw *)hw->priv; in rsi_mac80211_roc()
1781 struct rsi_common *common = (struct rsi_common *)adapter->priv; in rsi_mac80211_roc()
1786 mutex_lock(&common->mutex); in rsi_mac80211_roc()
1788 __func__, chan->hw_value, duration); in rsi_mac80211_roc()
1790 if (timer_pending(&common->roc_timer)) { in rsi_mac80211_roc()
1791 rsi_dbg(INFO_ZONE, "Stop on-going ROC\n"); in rsi_mac80211_roc()
1792 del_timer(&common->roc_timer); in rsi_mac80211_roc()
1794 common->roc_timer.expires = msecs_to_jiffies(duration) + jiffies; in rsi_mac80211_roc()
1795 add_timer(&common->roc_timer); in rsi_mac80211_roc()
1797 /* Configure band */ in rsi_mac80211_roc()
1799 rsi_dbg(ERR_ZONE, "Failed to set band\n"); in rsi_mac80211_roc()
1800 status = -EINVAL; in rsi_mac80211_roc()
1807 status = -EINVAL; in rsi_mac80211_roc()
1811 common->roc_vif = vif; in rsi_mac80211_roc()
1814 __func__, chan->hw_value); in rsi_mac80211_roc()
1817 mutex_unlock(&common->mutex); in rsi_mac80211_roc()
1825 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_cancel_roc()
1826 struct rsi_common *common = adapter->priv; in rsi_mac80211_cancel_roc()
1830 mutex_lock(&common->mutex); in rsi_mac80211_cancel_roc()
1831 if (!timer_pending(&common->roc_timer)) { in rsi_mac80211_cancel_roc()
1832 mutex_unlock(&common->mutex); in rsi_mac80211_cancel_roc()
1836 del_timer(&common->roc_timer); in rsi_mac80211_cancel_roc()
1839 mutex_unlock(&common->mutex); in rsi_mac80211_cancel_roc()
1862 if (wowlan->any) in rsi_wow_map_triggers()
1864 if (wowlan->magic_pkt) in rsi_wow_map_triggers()
1866 if (wowlan->disconnect) in rsi_wow_map_triggers()
1868 if (wowlan->gtk_rekey_failure || wowlan->eap_identity_req || in rsi_wow_map_triggers()
1869 wowlan->four_way_handshake) in rsi_wow_map_triggers()
1877 struct rsi_common *common = adapter->priv; in rsi_config_wowlan()
1884 if (!adapter->vifs[0]) in rsi_config_wowlan()
1885 return -EINVAL; in rsi_config_wowlan()
1887 bss = &adapter->vifs[0]->bss_conf; in rsi_config_wowlan()
1891 return -EINVAL; in rsi_config_wowlan()
1894 common->wow_flags |= RSI_WOW_ENABLED; in rsi_config_wowlan()
1898 return -EINVAL; in rsi_config_wowlan()
1900 if (!bss->assoc) { in rsi_config_wowlan()
1903 common->wow_flags |= RSI_WOW_NO_CONNECTION; in rsi_config_wowlan()
1908 if (common->coex_mode > 1) in rsi_config_wowlan()
1909 rsi_disable_ps(adapter, adapter->vifs[0]); in rsi_config_wowlan()
1914 * Increase the beacon_miss threshold & keep-alive timers in in rsi_config_wowlan()
1929 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_suspend()
1930 struct rsi_common *common = adapter->priv; in rsi_mac80211_suspend()
1933 mutex_lock(&common->mutex); in rsi_mac80211_suspend()
1936 mutex_unlock(&common->mutex); in rsi_mac80211_suspend()
1939 mutex_unlock(&common->mutex); in rsi_mac80211_suspend()
1947 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_resume()
1948 struct rsi_common *common = adapter->priv; in rsi_mac80211_resume()
1950 common->wow_flags = 0; in rsi_mac80211_resume()
1954 if (common->hibernate_resume) { in rsi_mac80211_resume()
1955 common->mac_ops_resumed = true; in rsi_mac80211_resume()
1962 mutex_lock(&common->mutex); in rsi_mac80211_resume()
1968 mutex_unlock(&common->mutex); in rsi_mac80211_resume()
2005 * rsi_mac80211_attach() - This function is used to initialize Mac80211 stack.
2015 struct rsi_hw *adapter = common->priv; in rsi_mac80211_attach()
2023 return -ENOMEM; in rsi_mac80211_attach()
2026 wiphy = hw->wiphy; in rsi_mac80211_attach()
2028 SET_IEEE80211_DEV(hw, adapter->device); in rsi_mac80211_attach()
2030 hw->priv = adapter; in rsi_mac80211_attach()
2031 adapter->hw = hw; in rsi_mac80211_attach()
2039 hw->queues = MAX_HW_QUEUES; in rsi_mac80211_attach()
2040 hw->extra_tx_headroom = RSI_NEEDED_HEADROOM; in rsi_mac80211_attach()
2042 hw->max_rates = 1; in rsi_mac80211_attach()
2043 hw->max_rate_tries = MAX_RETRIES; in rsi_mac80211_attach()
2044 hw->uapsd_queues = RSI_IEEE80211_UAPSD_QUEUES; in rsi_mac80211_attach()
2045 hw->uapsd_max_sp_len = IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL; in rsi_mac80211_attach()
2047 hw->max_tx_aggregation_subframes = RSI_MAX_TX_AGGR_FRMS; in rsi_mac80211_attach()
2048 hw->max_rx_aggregation_subframes = RSI_MAX_RX_AGGR_FRMS; in rsi_mac80211_attach()
2049 hw->rate_control_algorithm = "AARF"; in rsi_mac80211_attach()
2051 SET_IEEE80211_PERM_ADDR(hw, common->mac_addr); in rsi_mac80211_attach()
2052 ether_addr_copy(hw->wiphy->addr_mask, addr_mask); in rsi_mac80211_attach()
2054 wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | in rsi_mac80211_attach()
2060 wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; in rsi_mac80211_attach()
2061 wiphy->retry_short = RETRY_SHORT; in rsi_mac80211_attach()
2062 wiphy->retry_long = RETRY_LONG; in rsi_mac80211_attach()
2063 wiphy->frag_threshold = IEEE80211_MAX_FRAG_THRESHOLD; in rsi_mac80211_attach()
2064 wiphy->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD; in rsi_mac80211_attach()
2065 wiphy->flags = 0; in rsi_mac80211_attach()
2067 wiphy->available_antennas_rx = 1; in rsi_mac80211_attach()
2068 wiphy->available_antennas_tx = 1; in rsi_mac80211_attach()
2073 wiphy->bands[NL80211_BAND_2GHZ] = in rsi_mac80211_attach()
2074 &adapter->sbands[NL80211_BAND_2GHZ]; in rsi_mac80211_attach()
2075 if (common->num_supp_bands > 1) { in rsi_mac80211_attach()
2080 wiphy->bands[NL80211_BAND_5GHZ] = in rsi_mac80211_attach()
2081 &adapter->sbands[NL80211_BAND_5GHZ]; in rsi_mac80211_attach()
2085 wiphy->max_ap_assoc_sta = rsi_max_ap_stas[common->oper_mode - 1]; in rsi_mac80211_attach()
2086 common->max_stations = wiphy->max_ap_assoc_sta; in rsi_mac80211_attach()
2087 rsi_dbg(ERR_ZONE, "Max Stations Allowed = %d\n", common->max_stations); in rsi_mac80211_attach()
2088 hw->sta_data_size = sizeof(struct rsi_sta); in rsi_mac80211_attach()
2090 wiphy->max_scan_ssids = RSI_MAX_SCAN_SSIDS; in rsi_mac80211_attach()
2091 wiphy->max_scan_ie_len = RSI_MAX_SCAN_IE_LEN; in rsi_mac80211_attach()
2092 wiphy->flags = WIPHY_FLAG_REPORTS_OBSS; in rsi_mac80211_attach()
2093 wiphy->flags |= WIPHY_FLAG_AP_UAPSD; in rsi_mac80211_attach()
2094 wiphy->features |= NL80211_FEATURE_INACTIVITY_TIMER; in rsi_mac80211_attach()
2095 wiphy->reg_notifier = rsi_reg_notify; in rsi_mac80211_attach()
2098 wiphy->wowlan = &rsi_wowlan_support; in rsi_mac80211_attach()
2103 /* Wi-Fi direct parameters */ in rsi_mac80211_attach()
2104 wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; in rsi_mac80211_attach()
2105 wiphy->flags |= WIPHY_FLAG_OFFCHAN_TX; in rsi_mac80211_attach()
2106 wiphy->max_remain_on_channel_duration = 10000; in rsi_mac80211_attach()
2107 hw->max_listen_interval = 10; in rsi_mac80211_attach()
2108 wiphy->iface_combinations = rsi_iface_combinations; in rsi_mac80211_attach()
2109 wiphy->n_iface_combinations = ARRAY_SIZE(rsi_iface_combinations); in rsi_mac80211_attach()
2111 if (common->coex_mode > 1) in rsi_mac80211_attach()
2112 wiphy->flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT; in rsi_mac80211_attach()