Lines Matching +full:in +full:- +full:band +full:- +full:status
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()
242 common->mac_ops_resumed = false; in rsi_mac80211_hw_scan_start()
244 if (common->fsm_state != FSM_MAC_INIT_DONE) in rsi_mac80211_hw_scan_start()
245 return -ENODEV; in rsi_mac80211_hw_scan_start()
247 if ((common->wow_flags & RSI_WOW_ENABLED) || in rsi_mac80211_hw_scan_start()
248 scan_req->n_channels == 0) in rsi_mac80211_hw_scan_start()
249 return -EINVAL; in rsi_mac80211_hw_scan_start()
251 /* Scan already in progress. So return */ in rsi_mac80211_hw_scan_start()
252 if (common->bgscan_en) in rsi_mac80211_hw_scan_start()
253 return -EBUSY; in rsi_mac80211_hw_scan_start()
255 /* If STA is not connected, return with special value 1, in order in rsi_mac80211_hw_scan_start()
256 * to start sw_scan in mac80211 in rsi_mac80211_hw_scan_start()
258 if (!vif->cfg.assoc) in rsi_mac80211_hw_scan_start()
261 mutex_lock(&common->mutex); in rsi_mac80211_hw_scan_start()
262 common->hwscan = scan_req; in rsi_mac80211_hw_scan_start()
266 common->bgscan_en = true; in rsi_mac80211_hw_scan_start()
269 mutex_unlock(&common->mutex); in rsi_mac80211_hw_scan_start()
277 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_cancel_hw_scan()
278 struct rsi_common *common = adapter->priv; in rsi_mac80211_cancel_hw_scan()
282 mutex_lock(&common->mutex); in rsi_mac80211_cancel_hw_scan()
284 if (common->bgscan_en) { in rsi_mac80211_cancel_hw_scan()
286 common->bgscan_en = false; in rsi_mac80211_cancel_hw_scan()
288 ieee80211_scan_completed(adapter->hw, &info); in rsi_mac80211_cancel_hw_scan()
291 common->hwscan = NULL; in rsi_mac80211_cancel_hw_scan()
292 mutex_unlock(&common->mutex); in rsi_mac80211_cancel_hw_scan()
296 * rsi_mac80211_detach() - This function is used to de-initialize the
304 struct ieee80211_hw *hw = adapter->hw; in rsi_mac80211_detach()
305 enum nl80211_band band; in rsi_mac80211_detach() local
311 adapter->hw = NULL; in rsi_mac80211_detach()
314 for (band = 0; band < NUM_NL80211_BANDS; band++) { in rsi_mac80211_detach()
316 &adapter->sbands[band]; in rsi_mac80211_detach()
318 kfree(sband->channels); in rsi_mac80211_detach()
323 kfree(adapter->dfsentry); in rsi_mac80211_detach()
329 * rsi_indicate_tx_status() - This function indicates the transmit status.
332 * @status: Status
338 int status) in rsi_indicate_tx_status() argument
343 if (!adapter->hw) { in rsi_indicate_tx_status()
348 if (!status) in rsi_indicate_tx_status()
349 info->flags |= IEEE80211_TX_STAT_ACK; in rsi_indicate_tx_status()
351 tx_params = (struct skb_info *)info->driver_data; in rsi_indicate_tx_status()
352 skb_pull(skb, tx_params->internal_hdr_size); in rsi_indicate_tx_status()
353 memset(info->driver_data, 0, IEEE80211_TX_INFO_DRIVER_DATA_SIZE); in rsi_indicate_tx_status()
355 ieee80211_tx_status_irqsafe(adapter->hw, skb); in rsi_indicate_tx_status()
359 * rsi_mac80211_tx() - This is the handler that 802.11 module calls for each
372 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_tx()
373 struct rsi_common *common = adapter->priv; in rsi_mac80211_tx()
374 struct ieee80211_hdr *wlh = (struct ieee80211_hdr *)skb->data; in rsi_mac80211_tx()
376 if (ieee80211_is_auth(wlh->frame_control)) in rsi_mac80211_tx()
377 common->mac_ops_resumed = false; in rsi_mac80211_tx()
383 * rsi_mac80211_start() - This is first handler that 802.11 module calls, since
392 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_start()
393 struct rsi_common *common = adapter->priv; in rsi_mac80211_start()
396 mutex_lock(&common->mutex); in rsi_mac80211_start()
397 if (common->hibernate_resume) { in rsi_mac80211_start()
398 common->reinit_hw = true; in rsi_mac80211_start()
399 adapter->host_intf_ops->reinit_device(adapter); in rsi_mac80211_start()
400 wait_for_completion(&adapter->priv->wlan_init_completion); in rsi_mac80211_start()
402 common->iface_down = false; in rsi_mac80211_start()
403 wiphy_rfkill_start_polling(hw->wiphy); in rsi_mac80211_start()
405 mutex_unlock(&common->mutex); in rsi_mac80211_start()
411 * 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 for (i = 0; i < common->max_stations; i++) in rsi_mac80211_add_interface()
514 common->stations[i].sta = NULL; in rsi_mac80211_add_interface()
517 mutex_unlock(&common->mutex); in rsi_mac80211_add_interface()
523 * rsi_mac80211_remove_interface() - This function notifies driver that an
533 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_remove_interface()
534 struct rsi_common *common = adapter->priv; in rsi_mac80211_remove_interface()
540 mutex_lock(&common->mutex); in rsi_mac80211_remove_interface()
542 if (adapter->sc_nvifs <= 0) { in rsi_mac80211_remove_interface()
543 mutex_unlock(&common->mutex); in rsi_mac80211_remove_interface()
547 opmode = rsi_map_intf_mode(vif->type); in rsi_mac80211_remove_interface()
550 mutex_unlock(&common->mutex); in rsi_mac80211_remove_interface()
554 if (!adapter->vifs[i]) in rsi_mac80211_remove_interface()
556 if (vif == adapter->vifs[i]) { in rsi_mac80211_remove_interface()
557 rsi_set_vap_capabilities(common, opmode, vif->addr, in rsi_mac80211_remove_interface()
559 adapter->sc_nvifs--; in rsi_mac80211_remove_interface()
560 adapter->vifs[i] = NULL; in rsi_mac80211_remove_interface()
563 mutex_unlock(&common->mutex); in rsi_mac80211_remove_interface()
567 * rsi_channel_change() - This function is a performs the checks
576 struct rsi_hw *adapter = hw->priv; in rsi_channel_change()
577 struct rsi_common *common = adapter->priv; in rsi_channel_change()
578 int status = -EOPNOTSUPP; in rsi_channel_change() local
579 struct ieee80211_channel *curchan = hw->conf.chandef.chan; in rsi_channel_change()
580 u16 channel = curchan->hw_value; in rsi_channel_change()
587 __func__, curchan->center_freq, in rsi_channel_change()
588 curchan->flags, channel); in rsi_channel_change()
591 vif = adapter->vifs[i]; in rsi_channel_change()
594 if (vif->type == NL80211_IFTYPE_STATION) { in rsi_channel_change()
595 if (vif->cfg.assoc) { in rsi_channel_change()
602 if (!common->hw_data_qs_blocked && in rsi_channel_change()
606 common->hw_data_qs_blocked = true; in rsi_channel_change()
610 status = rsi_band_check(common, curchan); in rsi_channel_change()
611 if (!status) in rsi_channel_change()
612 status = rsi_set_channel(adapter->priv, curchan); in rsi_channel_change()
615 if (common->hw_data_qs_blocked && in rsi_channel_change()
619 common->hw_data_qs_blocked = false; in rsi_channel_change()
623 return status; in rsi_channel_change()
627 * rsi_config_power() - This function configures tx power to device
634 struct rsi_hw *adapter = hw->priv; in rsi_config_power()
635 struct rsi_common *common = adapter->priv; in rsi_config_power()
636 struct ieee80211_conf *conf = &hw->conf; in rsi_config_power()
638 if (adapter->sc_nvifs <= 0) { in rsi_config_power()
640 return -EINVAL; in rsi_config_power()
644 "%s: Set tx power: %d dBM\n", __func__, conf->power_level); in rsi_config_power()
646 if (conf->power_level == common->tx_power) in rsi_config_power()
649 common->tx_power = conf->power_level; in rsi_config_power()
655 * rsi_mac80211_config() - This function is a handler for configuration
666 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_config()
667 struct rsi_common *common = adapter->priv; in rsi_mac80211_config()
668 struct ieee80211_conf *conf = &hw->conf; in rsi_mac80211_config()
669 int status = -EOPNOTSUPP; in rsi_mac80211_config() local
671 mutex_lock(&common->mutex); in rsi_mac80211_config()
674 status = rsi_channel_change(hw); in rsi_mac80211_config()
679 status = rsi_config_power(hw); in rsi_mac80211_config()
684 !common->mac_ops_resumed) { in rsi_mac80211_config()
690 vif = adapter->vifs[i]; in rsi_mac80211_config()
694 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_config()
695 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_mac80211_config()
699 if ((vif->type == NL80211_IFTYPE_STATION || in rsi_mac80211_config()
700 vif->type == NL80211_IFTYPE_P2P_CLIENT) && in rsi_mac80211_config()
701 (!sta_vif || vif->cfg.assoc)) in rsi_mac80211_config()
705 spin_lock_irqsave(&adapter->ps_lock, flags); in rsi_mac80211_config()
706 if (conf->flags & IEEE80211_CONF_PS) in rsi_mac80211_config()
710 spin_unlock_irqrestore(&adapter->ps_lock, flags); in rsi_mac80211_config()
717 if ((common->rts_threshold) <= IEEE80211_MAX_RTS_THRESHOLD) { in rsi_mac80211_config()
720 status = rsi_send_vap_dynamic_update(common); in rsi_mac80211_config()
723 mutex_unlock(&common->mutex); in rsi_mac80211_config()
725 return status; in rsi_mac80211_config()
729 * rsi_get_connected_channel() - This function is used to get the current
743 bss = &vif->bss_conf; in rsi_get_connected_channel()
744 channel = bss->chanreq.oper.chan; in rsi_get_connected_channel()
749 return channel->hw_value; in rsi_get_connected_channel()
755 struct rsi_common *common = adapter->priv; in rsi_switch_channel()
758 if (common->iface_down) in rsi_switch_channel()
763 channel = vif->bss_conf.chanreq.oper.chan; in rsi_switch_channel()
770 rsi_dbg(INFO_ZONE, "Switched to channel - %d\n", channel->hw_value); in rsi_switch_channel()
774 * rsi_mac80211_bss_info_changed() - This function is a handler for config
789 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_bss_info_changed()
790 struct rsi_common *common = adapter->priv; in rsi_mac80211_bss_info_changed()
791 struct ieee80211_bss_conf *bss = &vif->bss_conf; in rsi_mac80211_bss_info_changed()
792 struct ieee80211_conf *conf = &hw->conf; in rsi_mac80211_bss_info_changed()
795 mutex_lock(&common->mutex); in rsi_mac80211_bss_info_changed()
797 rsi_dbg(INFO_ZONE, "%s: Changed Association status: %d\n", in rsi_mac80211_bss_info_changed()
798 __func__, vif->cfg.assoc); in rsi_mac80211_bss_info_changed()
799 if (vif->cfg.assoc) { in rsi_mac80211_bss_info_changed()
808 vif->cfg.assoc, in rsi_mac80211_bss_info_changed()
809 bss_conf->bssid, in rsi_mac80211_bss_info_changed()
810 bss_conf->qos, in rsi_mac80211_bss_info_changed()
811 vif->cfg.aid, in rsi_mac80211_bss_info_changed()
813 bss_conf->assoc_capability, vif); in rsi_mac80211_bss_info_changed()
814 adapter->ps_info.dtim_interval_duration = bss->dtim_period; in rsi_mac80211_bss_info_changed()
815 adapter->ps_info.listen_interval = conf->listen_interval; in rsi_mac80211_bss_info_changed()
817 /* If U-APSD is updated, send ps parameters to firmware */ in rsi_mac80211_bss_info_changed()
818 if (vif->cfg.assoc) { in rsi_mac80211_bss_info_changed()
819 if (common->uapsd_bitmap) { in rsi_mac80211_bss_info_changed()
824 common->uapsd_bitmap = 0; in rsi_mac80211_bss_info_changed()
829 common->cqm_info.last_cqm_event_rssi = 0; in rsi_mac80211_bss_info_changed()
830 common->cqm_info.rssi_thold = bss_conf->cqm_rssi_thold; in rsi_mac80211_bss_info_changed()
831 common->cqm_info.rssi_hyst = bss_conf->cqm_rssi_hyst; in rsi_mac80211_bss_info_changed()
833 common->cqm_info.rssi_thold, in rsi_mac80211_bss_info_changed()
834 common->cqm_info.rssi_hyst); in rsi_mac80211_bss_info_changed()
839 __func__, bss_conf->beacon_int); in rsi_mac80211_bss_info_changed()
840 if (common->beacon_interval != bss->beacon_int) { in rsi_mac80211_bss_info_changed()
841 common->beacon_interval = bss->beacon_int; in rsi_mac80211_bss_info_changed()
842 if (vif->type == NL80211_IFTYPE_AP) { in rsi_mac80211_bss_info_changed()
843 struct vif_priv *vif_info = (struct vif_priv *)vif->drv_priv; in rsi_mac80211_bss_info_changed()
846 vif->addr, vif_info->vap_id, in rsi_mac80211_bss_info_changed()
850 adapter->ps_info.listen_interval = in rsi_mac80211_bss_info_changed()
851 bss->beacon_int * adapter->ps_info.num_bcns_per_lis_int; in rsi_mac80211_bss_info_changed()
855 ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_bss_info_changed()
856 (vif->type == NL80211_IFTYPE_P2P_GO))) { in rsi_mac80211_bss_info_changed()
857 if (bss->enable_beacon) { in rsi_mac80211_bss_info_changed()
859 common->beacon_enabled = 1; in rsi_mac80211_bss_info_changed()
862 common->beacon_enabled = 0; in rsi_mac80211_bss_info_changed()
866 mutex_unlock(&common->mutex); in rsi_mac80211_bss_info_changed()
870 * rsi_mac80211_conf_filter() - This function configure the device's RX filter.
888 * rsi_mac80211_conf_tx() - This function configures TX queue parameters
904 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_conf_tx()
905 struct rsi_common *common = adapter->priv; in rsi_mac80211_conf_tx()
913 __func__, queue, params->aifs, in rsi_mac80211_conf_tx()
914 params->cw_min, params->cw_max, params->txop); in rsi_mac80211_conf_tx()
916 mutex_lock(&common->mutex); in rsi_mac80211_conf_tx()
936 memcpy(&common->edca_params[idx], in rsi_mac80211_conf_tx()
940 if (params->uapsd) in rsi_mac80211_conf_tx()
941 common->uapsd_bitmap |= idx; in rsi_mac80211_conf_tx()
943 common->uapsd_bitmap &= (~idx); in rsi_mac80211_conf_tx()
945 mutex_unlock(&common->mutex); in rsi_mac80211_conf_tx()
951 * rsi_hal_key_config() - This function loads the keys into the firmware.
957 * Return: status: 0 on success, negative error codes on failure.
964 struct rsi_hw *adapter = hw->priv; in rsi_hal_key_config()
966 int status; in rsi_hal_key_config() local
970 if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) in rsi_hal_key_config()
976 __func__, key->cipher, key_type, key->keylen); in rsi_hal_key_config()
978 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_hal_key_config()
979 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_hal_key_config()
981 rsta = rsi_find_sta(adapter->priv, sta->addr); in rsi_hal_key_config()
983 sta_id = rsta->sta_id; in rsi_hal_key_config()
985 adapter->priv->key = key; in rsi_hal_key_config()
987 if ((key->cipher == WLAN_CIPHER_SUITE_WEP104) || in rsi_hal_key_config()
988 (key->cipher == WLAN_CIPHER_SUITE_WEP40)) { in rsi_hal_key_config()
989 status = rsi_hal_load_key(adapter->priv, in rsi_hal_key_config()
990 key->key, in rsi_hal_key_config()
991 key->keylen, in rsi_hal_key_config()
993 key->keyidx, in rsi_hal_key_config()
994 key->cipher, in rsi_hal_key_config()
997 if (status) in rsi_hal_key_config()
998 return status; in rsi_hal_key_config()
1002 status = rsi_hal_load_key(adapter->priv, in rsi_hal_key_config()
1003 key->key, in rsi_hal_key_config()
1004 key->keylen, in rsi_hal_key_config()
1006 key->keyidx, in rsi_hal_key_config()
1007 key->cipher, in rsi_hal_key_config()
1010 if (status) in rsi_hal_key_config()
1011 return status; in rsi_hal_key_config()
1013 if (vif->type == NL80211_IFTYPE_STATION && in rsi_hal_key_config()
1014 (key->cipher == WLAN_CIPHER_SUITE_WEP104 || in rsi_hal_key_config()
1015 key->cipher == WLAN_CIPHER_SUITE_WEP40)) { in rsi_hal_key_config()
1016 if (!rsi_send_block_unblock_frame(adapter->priv, false)) in rsi_hal_key_config()
1017 adapter->priv->hw_data_qs_blocked = false; in rsi_hal_key_config()
1024 * rsi_mac80211_set_key() - This function sets type of key to be loaded.
1031 * Return: status: 0 on success, negative error code on failure.
1039 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_set_key()
1040 struct rsi_common *common = adapter->priv; in rsi_mac80211_set_key()
1041 struct security_info *secinfo = &common->secinfo; in rsi_mac80211_set_key()
1042 int status; in rsi_mac80211_set_key() local
1044 mutex_lock(&common->mutex); in rsi_mac80211_set_key()
1047 status = rsi_hal_key_config(hw, vif, key, sta); in rsi_mac80211_set_key()
1048 if (status) { in rsi_mac80211_set_key()
1049 mutex_unlock(&common->mutex); in rsi_mac80211_set_key()
1050 return status; in rsi_mac80211_set_key()
1053 if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) in rsi_mac80211_set_key()
1054 secinfo->ptk_cipher = key->cipher; in rsi_mac80211_set_key()
1056 secinfo->gtk_cipher = key->cipher; in rsi_mac80211_set_key()
1058 key->hw_key_idx = key->keyidx; in rsi_mac80211_set_key()
1059 key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; in rsi_mac80211_set_key()
1067 status = rsi_hal_key_config(hw, vif, key, sta); in rsi_mac80211_set_key()
1071 status = -EOPNOTSUPP; in rsi_mac80211_set_key()
1075 mutex_unlock(&common->mutex); in rsi_mac80211_set_key()
1076 return status; in rsi_mac80211_set_key()
1080 * rsi_mac80211_ampdu_action() - This function selects the AMPDU action for
1085 * @params: Pointer to A-MPDU action parameters
1087 * Return: status: 0 on success, negative error code on failure.
1093 int status = -EOPNOTSUPP; in rsi_mac80211_ampdu_action() local
1094 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_ampdu_action()
1095 struct rsi_common *common = adapter->priv; in rsi_mac80211_ampdu_action()
1099 struct ieee80211_sta *sta = params->sta; in rsi_mac80211_ampdu_action()
1101 enum ieee80211_ampdu_mlme_action action = params->action; in rsi_mac80211_ampdu_action()
1102 u16 tid = params->tid; in rsi_mac80211_ampdu_action()
1103 u16 *ssn = ¶ms->ssn; in rsi_mac80211_ampdu_action()
1104 u8 buf_size = params->buf_size; in rsi_mac80211_ampdu_action()
1107 if (vif == adapter->vifs[ii]) in rsi_mac80211_ampdu_action()
1112 return status; in rsi_mac80211_ampdu_action()
1114 mutex_lock(&common->mutex); in rsi_mac80211_ampdu_action()
1119 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_ampdu_action()
1120 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_mac80211_ampdu_action()
1121 rsta = rsi_find_sta(common, sta->addr); in rsi_mac80211_ampdu_action()
1124 status = 0; in rsi_mac80211_ampdu_action()
1127 sta_id = rsta->sta_id; in rsi_mac80211_ampdu_action()
1136 status = rsi_send_aggregation_params_frame(common, in rsi_mac80211_ampdu_action()
1145 status = rsi_send_aggregation_params_frame(common, in rsi_mac80211_ampdu_action()
1154 if ((vif->type == NL80211_IFTYPE_STATION) || in rsi_mac80211_ampdu_action()
1155 (vif->type == NL80211_IFTYPE_P2P_CLIENT)) in rsi_mac80211_ampdu_action()
1156 common->vif_info[ii].seq_start = seq_no; in rsi_mac80211_ampdu_action()
1157 else if ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_ampdu_action()
1158 (vif->type == NL80211_IFTYPE_P2P_GO)) in rsi_mac80211_ampdu_action()
1159 rsta->seq_start[tid] = seq_no; in rsi_mac80211_ampdu_action()
1160 status = IEEE80211_AMPDU_TX_START_IMMEDIATE; in rsi_mac80211_ampdu_action()
1166 status = rsi_send_aggregation_params_frame(common, in rsi_mac80211_ampdu_action()
1172 if (!status) in rsi_mac80211_ampdu_action()
1173 ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid); in rsi_mac80211_ampdu_action()
1177 if ((vif->type == NL80211_IFTYPE_STATION) || in rsi_mac80211_ampdu_action()
1178 (vif->type == NL80211_IFTYPE_P2P_CLIENT)) in rsi_mac80211_ampdu_action()
1179 seq_start = common->vif_info[ii].seq_start; in rsi_mac80211_ampdu_action()
1180 else if ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_ampdu_action()
1181 (vif->type == NL80211_IFTYPE_P2P_GO)) in rsi_mac80211_ampdu_action()
1182 seq_start = rsta->seq_start[tid]; in rsi_mac80211_ampdu_action()
1183 status = rsi_send_aggregation_params_frame(common, in rsi_mac80211_ampdu_action()
1197 mutex_unlock(&common->mutex); in rsi_mac80211_ampdu_action()
1198 return status; in rsi_mac80211_ampdu_action()
1202 * rsi_mac80211_set_rts_threshold() - This function sets rts threshold value.
1211 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_set_rts_threshold()
1212 struct rsi_common *common = adapter->priv; in rsi_mac80211_set_rts_threshold()
1214 mutex_lock(&common->mutex); in rsi_mac80211_set_rts_threshold()
1215 common->rts_threshold = value; in rsi_mac80211_set_rts_threshold()
1216 mutex_unlock(&common->mutex); in rsi_mac80211_set_rts_threshold()
1222 * rsi_mac80211_set_rate_mask() - This function sets bitrate_mask to be used.
1234 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_set_rate_mask()
1235 struct rsi_common *common = adapter->priv; in rsi_mac80211_set_rate_mask()
1238 mutex_lock(&common->mutex); in rsi_mac80211_set_rate_mask()
1240 for (i = 0; i < ARRAY_SIZE(common->rate_config); i++) { in rsi_mac80211_set_rate_mask()
1241 struct rsi_rate_config *cfg = &common->rate_config[i]; in rsi_mac80211_set_rate_mask()
1244 bm = mask->control[i].legacy | (mask->control[i].ht_mcs[0] << mcs_offset); in rsi_mac80211_set_rate_mask()
1246 int rate_index = ffs(bm) - 1; in rsi_mac80211_set_rate_mask()
1249 cfg->fixed_hw_rate = rsi_rates[rate_index].hw_value; in rsi_mac80211_set_rate_mask()
1251 cfg->fixed_hw_rate = rsi_mcsrates[rate_index - mcs_offset]; in rsi_mac80211_set_rate_mask()
1252 cfg->fixed_enabled = true; in rsi_mac80211_set_rate_mask()
1254 cfg->configured_mask = bm; in rsi_mac80211_set_rate_mask()
1255 cfg->fixed_enabled = false; in rsi_mac80211_set_rate_mask()
1259 mutex_unlock(&common->mutex); in rsi_mac80211_set_rate_mask()
1265 * rsi_perform_cqm() - This function performs cqm.
1276 s8 last_event = common->cqm_info.last_cqm_event_rssi; in rsi_perform_cqm()
1277 int thold = common->cqm_info.rssi_thold; in rsi_perform_cqm()
1278 u32 hyst = common->cqm_info.rssi_hyst; in rsi_perform_cqm()
1281 if (rssi < thold && (last_event == 0 || rssi < (last_event - hyst))) in rsi_perform_cqm()
1289 common->cqm_info.last_cqm_event_rssi = rssi; in rsi_perform_cqm()
1297 * rsi_fill_rx_status() - This function fills rx status in
1311 struct rsi_hw *adapter = common->priv; in rsi_fill_rx_status()
1315 struct skb_info *rx_params = (struct skb_info *)info->driver_data; in rsi_fill_rx_status()
1317 char rssi = rx_params->rssi; in rsi_fill_rx_status()
1319 u8 channel = rx_params->channel; in rsi_fill_rx_status()
1323 hdr = ((struct ieee80211_hdr *)(skb->data)); in rsi_fill_rx_status()
1324 hdrlen = ieee80211_hdrlen(hdr->frame_control); in rsi_fill_rx_status()
1328 rxs->signal = -(rssi); in rsi_fill_rx_status()
1330 rxs->band = common->band; in rsi_fill_rx_status()
1332 freq = ieee80211_channel_to_frequency(channel, rxs->band); in rsi_fill_rx_status()
1335 rxs->freq = freq; in rsi_fill_rx_status()
1337 if (ieee80211_has_protected(hdr->frame_control)) { in rsi_fill_rx_status()
1339 memmove(skb->data + 4, skb->data, hdrlen); in rsi_fill_rx_status()
1342 memmove(skb->data + 8, skb->data, hdrlen); in rsi_fill_rx_status()
1344 rxs->flag |= RX_FLAG_MMIC_STRIPPED; in rsi_fill_rx_status()
1346 rxs->flag |= RX_FLAG_DECRYPTED; in rsi_fill_rx_status()
1347 rxs->flag |= RX_FLAG_IV_STRIPPED; in rsi_fill_rx_status()
1351 vif = adapter->vifs[i]; in rsi_fill_rx_status()
1354 if (vif->type == NL80211_IFTYPE_STATION) { in rsi_fill_rx_status()
1355 bss = &vif->bss_conf; in rsi_fill_rx_status()
1362 if (vif->cfg.assoc && !(memcmp(bss->bssid, hdr->addr2, ETH_ALEN))) { in rsi_fill_rx_status()
1363 if (ieee80211_is_beacon(hdr->frame_control)) in rsi_fill_rx_status()
1364 rsi_perform_cqm(common, hdr->addr2, rxs->signal, vif); in rsi_fill_rx_status()
1371 * rsi_indicate_pkt_to_os() - This function sends received packet to mac80211.
1380 struct rsi_hw *adapter = common->priv; in rsi_indicate_pkt_to_os()
1381 struct ieee80211_hw *hw = adapter->hw; in rsi_indicate_pkt_to_os()
1384 if ((common->iface_down) || (!adapter->sc_nvifs)) { in rsi_indicate_pkt_to_os()
1389 /* filling in the ieee80211_rx_status flags */ in rsi_indicate_pkt_to_os()
1396 * rsi_mac80211_sta_add() - This function notifies driver about a peer getting
1408 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_sta_add()
1409 struct rsi_common *common = adapter->priv; in rsi_mac80211_sta_add()
1412 int status = 0; in rsi_mac80211_sta_add() local
1414 rsi_dbg(INFO_ZONE, "Station Add: %pM\n", sta->addr); in rsi_mac80211_sta_add()
1416 mutex_lock(&common->mutex); in rsi_mac80211_sta_add()
1418 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_sta_add()
1419 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_mac80211_sta_add()
1421 int sta_idx = -1; in rsi_mac80211_sta_add()
1422 int free_index = -1; in rsi_mac80211_sta_add()
1425 if (common->num_stations >= common->max_stations) { in rsi_mac80211_sta_add()
1427 status = -EOPNOTSUPP; in rsi_mac80211_sta_add()
1430 for (cnt = 0; cnt < common->max_stations; cnt++) { in rsi_mac80211_sta_add()
1431 rsta = &common->stations[cnt]; in rsi_mac80211_sta_add()
1433 if (!rsta->sta) { in rsi_mac80211_sta_add()
1438 if (!memcmp(rsta->sta->addr, sta->addr, ETH_ALEN)) { in rsi_mac80211_sta_add()
1453 status = -EINVAL; in rsi_mac80211_sta_add()
1456 rsta = &common->stations[sta_idx]; in rsi_mac80211_sta_add()
1457 rsta->sta = sta; in rsi_mac80211_sta_add()
1458 rsta->sta_id = sta_idx; in rsi_mac80211_sta_add()
1460 rsta->start_tx_aggr[cnt] = false; in rsi_mac80211_sta_add()
1462 rsta->seq_start[cnt] = 0; in rsi_mac80211_sta_add()
1467 rsi_dbg(INFO_ZONE, "Indicate bss status to device\n"); in rsi_mac80211_sta_add()
1469 sta->addr, sta->wme, sta->aid, in rsi_mac80211_sta_add()
1472 if (common->key) { in rsi_mac80211_sta_add()
1473 struct ieee80211_key_conf *key = common->key; in rsi_mac80211_sta_add()
1475 if ((key->cipher == WLAN_CIPHER_SUITE_WEP104) || in rsi_mac80211_sta_add()
1476 (key->cipher == WLAN_CIPHER_SUITE_WEP40)) in rsi_mac80211_sta_add()
1477 rsi_hal_load_key(adapter->priv, in rsi_mac80211_sta_add()
1478 key->key, in rsi_mac80211_sta_add()
1479 key->keylen, in rsi_mac80211_sta_add()
1481 key->keyidx, in rsi_mac80211_sta_add()
1482 key->cipher, in rsi_mac80211_sta_add()
1487 common->num_stations++; in rsi_mac80211_sta_add()
1491 if ((vif->type == NL80211_IFTYPE_STATION) || in rsi_mac80211_sta_add()
1492 (vif->type == NL80211_IFTYPE_P2P_CLIENT)) { in rsi_mac80211_sta_add()
1493 common->bitrate_mask[common->band] = sta->deflink.supp_rates[common->band]; in rsi_mac80211_sta_add()
1494 common->vif_info[0].is_ht = sta->deflink.ht_cap.ht_supported; in rsi_mac80211_sta_add()
1495 if (sta->deflink.ht_cap.ht_supported) { in rsi_mac80211_sta_add()
1496 common->bitrate_mask[NL80211_BAND_2GHZ] = in rsi_mac80211_sta_add()
1497 sta->deflink.supp_rates[NL80211_BAND_2GHZ]; in rsi_mac80211_sta_add()
1498 if ((sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_20) || in rsi_mac80211_sta_add()
1499 (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_40)) in rsi_mac80211_sta_add()
1500 common->vif_info[0].sgi = true; in rsi_mac80211_sta_add()
1506 mutex_unlock(&common->mutex); in rsi_mac80211_sta_add()
1508 return status; in rsi_mac80211_sta_add()
1512 * rsi_mac80211_sta_remove() - This function notifies driver about a peer
1524 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_sta_remove()
1525 struct rsi_common *common = adapter->priv; in rsi_mac80211_sta_remove()
1526 struct ieee80211_bss_conf *bss = &vif->bss_conf; in rsi_mac80211_sta_remove()
1529 rsi_dbg(INFO_ZONE, "Station Remove: %pM\n", sta->addr); in rsi_mac80211_sta_remove()
1531 mutex_lock(&common->mutex); in rsi_mac80211_sta_remove()
1533 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_sta_remove()
1534 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_mac80211_sta_remove()
1538 rsi_dbg(INFO_ZONE, "Indicate bss status to device\n"); in rsi_mac80211_sta_remove()
1539 for (sta_idx = 0; sta_idx < common->max_stations; sta_idx++) { in rsi_mac80211_sta_remove()
1540 rsta = &common->stations[sta_idx]; in rsi_mac80211_sta_remove()
1542 if (!rsta->sta) in rsi_mac80211_sta_remove()
1544 if (!memcmp(rsta->sta->addr, sta->addr, ETH_ALEN)) { in rsi_mac80211_sta_remove()
1546 sta->addr, sta->wme, in rsi_mac80211_sta_remove()
1547 sta->aid, sta, sta_idx, in rsi_mac80211_sta_remove()
1549 rsta->sta = NULL; in rsi_mac80211_sta_remove()
1550 rsta->sta_id = -1; in rsi_mac80211_sta_remove()
1552 rsta->start_tx_aggr[cnt] = false; in rsi_mac80211_sta_remove()
1553 if (common->num_stations > 0) in rsi_mac80211_sta_remove()
1554 common->num_stations--; in rsi_mac80211_sta_remove()
1558 if (sta_idx >= common->max_stations) in rsi_mac80211_sta_remove()
1562 if ((vif->type == NL80211_IFTYPE_STATION) || in rsi_mac80211_sta_remove()
1563 (vif->type == NL80211_IFTYPE_P2P_CLIENT)) { in rsi_mac80211_sta_remove()
1565 memcpy((u8 *)bss->bssid, (u8 *)sta->addr, ETH_ALEN); in rsi_mac80211_sta_remove()
1566 bss->qos = sta->wme; in rsi_mac80211_sta_remove()
1567 common->bitrate_mask[NL80211_BAND_2GHZ] = 0; in rsi_mac80211_sta_remove()
1568 common->bitrate_mask[NL80211_BAND_5GHZ] = 0; in rsi_mac80211_sta_remove()
1569 common->vif_info[0].is_ht = false; in rsi_mac80211_sta_remove()
1570 common->vif_info[0].sgi = false; in rsi_mac80211_sta_remove()
1571 common->vif_info[0].seq_start = 0; in rsi_mac80211_sta_remove()
1572 common->secinfo.ptk_cipher = 0; in rsi_mac80211_sta_remove()
1573 common->secinfo.gtk_cipher = 0; in rsi_mac80211_sta_remove()
1574 if (!common->iface_down) in rsi_mac80211_sta_remove()
1577 mutex_unlock(&common->mutex); in rsi_mac80211_sta_remove()
1583 * rsi_mac80211_set_antenna() - This function is used to configure
1594 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_set_antenna()
1595 struct rsi_common *common = adapter->priv; in rsi_mac80211_set_antenna()
1604 return -EINVAL; in rsi_mac80211_set_antenna()
1610 mutex_lock(&common->mutex); in rsi_mac80211_set_antenna()
1613 if (common->ant_in_use != antenna) in rsi_mac80211_set_antenna()
1620 common->ant_in_use = antenna; in rsi_mac80211_set_antenna()
1622 mutex_unlock(&common->mutex); in rsi_mac80211_set_antenna()
1628 mutex_unlock(&common->mutex); in rsi_mac80211_set_antenna()
1629 return -EINVAL; in rsi_mac80211_set_antenna()
1633 * rsi_mac80211_get_antenna() - This function is used to configure
1645 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_get_antenna()
1646 struct rsi_common *common = adapter->priv; in rsi_mac80211_get_antenna()
1648 mutex_lock(&common->mutex); in rsi_mac80211_get_antenna()
1650 *tx_ant = (common->ant_in_use == ANTENNA_SEL_UFL) ? 1 : 0; in rsi_mac80211_get_antenna()
1653 mutex_unlock(&common->mutex); in rsi_mac80211_get_antenna()
1679 struct rsi_hw * adapter = hw->priv; in rsi_reg_notify()
1680 struct rsi_common *common = adapter->priv; in rsi_reg_notify()
1683 mutex_lock(&common->mutex); in rsi_reg_notify()
1686 request->alpha2, request->dfs_region); in rsi_reg_notify()
1688 if (common->num_supp_bands > 1) { in rsi_reg_notify()
1689 sband = wiphy->bands[NL80211_BAND_5GHZ]; in rsi_reg_notify()
1691 for (i = 0; i < sband->n_channels; i++) { in rsi_reg_notify()
1692 ch = &sband->channels[i]; in rsi_reg_notify()
1693 if (ch->flags & IEEE80211_CHAN_DISABLED) in rsi_reg_notify()
1696 if (ch->flags & IEEE80211_CHAN_RADAR) in rsi_reg_notify()
1697 ch->flags |= IEEE80211_CHAN_NO_IR; in rsi_reg_notify()
1700 adapter->dfs_region = rsi_map_region_code(request->dfs_region); in rsi_reg_notify()
1701 rsi_dbg(INFO_ZONE, "RSI region code = %d\n", adapter->dfs_region); in rsi_reg_notify()
1703 adapter->country[0] = request->alpha2[0]; in rsi_reg_notify()
1704 adapter->country[1] = request->alpha2[1]; in rsi_reg_notify()
1706 mutex_unlock(&common->mutex); in rsi_reg_notify()
1711 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_rfkill_poll()
1712 struct rsi_common *common = adapter->priv; in rsi_mac80211_rfkill_poll()
1714 mutex_lock(&common->mutex); in rsi_mac80211_rfkill_poll()
1715 if (common->fsm_state != FSM_MAC_INIT_DONE) in rsi_mac80211_rfkill_poll()
1716 wiphy_rfkill_set_hw_state(hw->wiphy, true); in rsi_mac80211_rfkill_poll()
1718 wiphy_rfkill_set_hw_state(hw->wiphy, false); in rsi_mac80211_rfkill_poll()
1719 mutex_unlock(&common->mutex); in rsi_mac80211_rfkill_poll()
1724 struct rsi_hw *adapter = common->priv; in rsi_resume_conn_channel()
1729 vif = adapter->vifs[cnt]; in rsi_resume_conn_channel()
1733 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_resume_conn_channel()
1734 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_resume_conn_channel()
1738 if (((vif->type == NL80211_IFTYPE_STATION) || in rsi_resume_conn_channel()
1739 (vif->type == NL80211_IFTYPE_P2P_CLIENT)) && in rsi_resume_conn_channel()
1740 vif->cfg.assoc) { in rsi_resume_conn_channel()
1753 mutex_lock(&common->mutex); in rsi_roc_timeout()
1754 ieee80211_remain_on_channel_expired(common->priv->hw); in rsi_roc_timeout()
1756 if (timer_pending(&common->roc_timer)) in rsi_roc_timeout()
1757 del_timer(&common->roc_timer); in rsi_roc_timeout()
1760 mutex_unlock(&common->mutex); in rsi_roc_timeout()
1767 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_roc()
1768 struct rsi_common *common = adapter->priv; in rsi_mac80211_roc()
1769 int status = 0; in rsi_mac80211_roc() local
1773 mutex_lock(&common->mutex); in rsi_mac80211_roc()
1775 __func__, chan->hw_value, duration); in rsi_mac80211_roc()
1777 if (timer_pending(&common->roc_timer)) { in rsi_mac80211_roc()
1778 rsi_dbg(INFO_ZONE, "Stop on-going ROC\n"); in rsi_mac80211_roc()
1779 del_timer(&common->roc_timer); in rsi_mac80211_roc()
1781 common->roc_timer.expires = msecs_to_jiffies(duration) + jiffies; in rsi_mac80211_roc()
1782 add_timer(&common->roc_timer); in rsi_mac80211_roc()
1784 /* Configure band */ in rsi_mac80211_roc()
1786 rsi_dbg(ERR_ZONE, "Failed to set band\n"); in rsi_mac80211_roc()
1787 status = -EINVAL; in rsi_mac80211_roc()
1794 status = -EINVAL; in rsi_mac80211_roc()
1798 common->roc_vif = vif; in rsi_mac80211_roc()
1801 __func__, chan->hw_value); in rsi_mac80211_roc()
1804 mutex_unlock(&common->mutex); in rsi_mac80211_roc()
1806 return status; in rsi_mac80211_roc()
1812 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_cancel_roc()
1813 struct rsi_common *common = adapter->priv; in rsi_mac80211_cancel_roc()
1817 mutex_lock(&common->mutex); in rsi_mac80211_cancel_roc()
1818 if (!timer_pending(&common->roc_timer)) { in rsi_mac80211_cancel_roc()
1819 mutex_unlock(&common->mutex); in rsi_mac80211_cancel_roc()
1823 del_timer(&common->roc_timer); in rsi_mac80211_cancel_roc()
1826 mutex_unlock(&common->mutex); in rsi_mac80211_cancel_roc()
1849 if (wowlan->any) in rsi_wow_map_triggers()
1851 if (wowlan->magic_pkt) in rsi_wow_map_triggers()
1853 if (wowlan->disconnect) in rsi_wow_map_triggers()
1855 if (wowlan->gtk_rekey_failure || wowlan->eap_identity_req || in rsi_wow_map_triggers()
1856 wowlan->four_way_handshake) in rsi_wow_map_triggers()
1864 struct rsi_common *common = adapter->priv; in rsi_config_wowlan()
1865 struct ieee80211_vif *vif = adapter->vifs[0]; in rsi_config_wowlan()
1872 return -EINVAL; in rsi_config_wowlan()
1876 return -EINVAL; in rsi_config_wowlan()
1879 common->wow_flags |= RSI_WOW_ENABLED; in rsi_config_wowlan()
1883 return -EINVAL; in rsi_config_wowlan()
1885 if (!vif->cfg.assoc) { in rsi_config_wowlan()
1888 common->wow_flags |= RSI_WOW_NO_CONNECTION; in rsi_config_wowlan()
1893 if (common->coex_mode > 1) in rsi_config_wowlan()
1894 rsi_disable_ps(adapter, adapter->vifs[0]); in rsi_config_wowlan()
1899 * Increase the beacon_miss threshold & keep-alive timers in in rsi_config_wowlan()
1914 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_suspend()
1915 struct rsi_common *common = adapter->priv; in rsi_mac80211_suspend()
1918 mutex_lock(&common->mutex); in rsi_mac80211_suspend()
1921 mutex_unlock(&common->mutex); in rsi_mac80211_suspend()
1924 mutex_unlock(&common->mutex); in rsi_mac80211_suspend()
1932 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_resume()
1933 struct rsi_common *common = adapter->priv; in rsi_mac80211_resume()
1935 common->wow_flags = 0; in rsi_mac80211_resume()
1939 if (common->hibernate_resume) { in rsi_mac80211_resume()
1940 common->mac_ops_resumed = true; in rsi_mac80211_resume()
1947 mutex_lock(&common->mutex); in rsi_mac80211_resume()
1953 mutex_unlock(&common->mutex); in rsi_mac80211_resume()
1995 * rsi_mac80211_attach() - This function is used to initialize Mac80211 stack.
2002 int status = 0; in rsi_mac80211_attach() local
2005 struct rsi_hw *adapter = common->priv; in rsi_mac80211_attach()
2013 return -ENOMEM; in rsi_mac80211_attach()
2016 wiphy = hw->wiphy; in rsi_mac80211_attach()
2018 SET_IEEE80211_DEV(hw, adapter->device); in rsi_mac80211_attach()
2020 hw->priv = adapter; in rsi_mac80211_attach()
2021 adapter->hw = hw; in rsi_mac80211_attach()
2029 hw->queues = MAX_HW_QUEUES; in rsi_mac80211_attach()
2030 hw->extra_tx_headroom = RSI_NEEDED_HEADROOM; in rsi_mac80211_attach()
2032 hw->max_rates = 1; in rsi_mac80211_attach()
2033 hw->max_rate_tries = MAX_RETRIES; in rsi_mac80211_attach()
2034 hw->uapsd_queues = RSI_IEEE80211_UAPSD_QUEUES; in rsi_mac80211_attach()
2035 hw->uapsd_max_sp_len = IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL; in rsi_mac80211_attach()
2037 hw->max_tx_aggregation_subframes = RSI_MAX_TX_AGGR_FRMS; in rsi_mac80211_attach()
2038 hw->max_rx_aggregation_subframes = RSI_MAX_RX_AGGR_FRMS; in rsi_mac80211_attach()
2039 hw->rate_control_algorithm = "AARF"; in rsi_mac80211_attach()
2041 SET_IEEE80211_PERM_ADDR(hw, common->mac_addr); in rsi_mac80211_attach()
2042 ether_addr_copy(hw->wiphy->addr_mask, addr_mask); in rsi_mac80211_attach()
2044 wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | in rsi_mac80211_attach()
2050 wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; in rsi_mac80211_attach()
2051 wiphy->retry_short = RETRY_SHORT; in rsi_mac80211_attach()
2052 wiphy->retry_long = RETRY_LONG; in rsi_mac80211_attach()
2053 wiphy->frag_threshold = IEEE80211_MAX_FRAG_THRESHOLD; in rsi_mac80211_attach()
2054 wiphy->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD; in rsi_mac80211_attach()
2055 wiphy->flags = 0; in rsi_mac80211_attach()
2057 wiphy->available_antennas_rx = 1; in rsi_mac80211_attach()
2058 wiphy->available_antennas_tx = 1; in rsi_mac80211_attach()
2060 status = rsi_register_rates_channels(adapter, NL80211_BAND_2GHZ); in rsi_mac80211_attach()
2061 if (status) in rsi_mac80211_attach()
2062 return status; in rsi_mac80211_attach()
2063 wiphy->bands[NL80211_BAND_2GHZ] = in rsi_mac80211_attach()
2064 &adapter->sbands[NL80211_BAND_2GHZ]; in rsi_mac80211_attach()
2065 if (common->num_supp_bands > 1) { in rsi_mac80211_attach()
2066 status = rsi_register_rates_channels(adapter, in rsi_mac80211_attach()
2068 if (status) in rsi_mac80211_attach()
2069 return status; in rsi_mac80211_attach()
2070 wiphy->bands[NL80211_BAND_5GHZ] = in rsi_mac80211_attach()
2071 &adapter->sbands[NL80211_BAND_5GHZ]; in rsi_mac80211_attach()
2075 wiphy->max_ap_assoc_sta = rsi_max_ap_stas[common->oper_mode - 1]; in rsi_mac80211_attach()
2076 common->max_stations = wiphy->max_ap_assoc_sta; in rsi_mac80211_attach()
2077 rsi_dbg(ERR_ZONE, "Max Stations Allowed = %d\n", common->max_stations); in rsi_mac80211_attach()
2078 hw->sta_data_size = sizeof(struct rsi_sta); in rsi_mac80211_attach()
2080 wiphy->max_scan_ssids = RSI_MAX_SCAN_SSIDS; in rsi_mac80211_attach()
2081 wiphy->max_scan_ie_len = RSI_MAX_SCAN_IE_LEN; in rsi_mac80211_attach()
2082 wiphy->flags = WIPHY_FLAG_REPORTS_OBSS; in rsi_mac80211_attach()
2083 wiphy->flags |= WIPHY_FLAG_AP_UAPSD; in rsi_mac80211_attach()
2084 wiphy->features |= NL80211_FEATURE_INACTIVITY_TIMER; in rsi_mac80211_attach()
2085 wiphy->reg_notifier = rsi_reg_notify; in rsi_mac80211_attach()
2088 wiphy->wowlan = &rsi_wowlan_support; in rsi_mac80211_attach()
2093 /* Wi-Fi direct parameters */ in rsi_mac80211_attach()
2094 wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; in rsi_mac80211_attach()
2095 wiphy->flags |= WIPHY_FLAG_OFFCHAN_TX; in rsi_mac80211_attach()
2096 wiphy->max_remain_on_channel_duration = 10000; in rsi_mac80211_attach()
2097 hw->max_listen_interval = 10; in rsi_mac80211_attach()
2098 wiphy->iface_combinations = rsi_iface_combinations; in rsi_mac80211_attach()
2099 wiphy->n_iface_combinations = ARRAY_SIZE(rsi_iface_combinations); in rsi_mac80211_attach()
2101 if (common->coex_mode > 1) in rsi_mac80211_attach()
2102 wiphy->flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT; in rsi_mac80211_attach()
2104 status = ieee80211_register_hw(hw); in rsi_mac80211_attach()
2105 if (status) in rsi_mac80211_attach()
2106 return status; in rsi_mac80211_attach()