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.
418 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_stop()
419 struct rsi_common *common = adapter->priv; in rsi_mac80211_stop()
422 mutex_lock(&common->mutex); in rsi_mac80211_stop()
423 common->iface_down = true; in rsi_mac80211_stop()
424 wiphy_rfkill_stop_polling(hw->wiphy); in rsi_mac80211_stop()
429 mutex_unlock(&common->mutex); in rsi_mac80211_stop()
451 * rsi_mac80211_add_interface() - This function is called when a netdevice
461 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_add_interface()
462 struct rsi_common *common = adapter->priv; in rsi_mac80211_add_interface()
463 struct vif_priv *vif_info = (struct vif_priv *)vif->drv_priv; in rsi_mac80211_add_interface()
466 int vap_idx = -1, i; in rsi_mac80211_add_interface()
468 vif->driver_flags |= IEEE80211_VIF_SUPPORTS_UAPSD; in rsi_mac80211_add_interface()
469 mutex_lock(&common->mutex); in rsi_mac80211_add_interface()
471 intf_mode = rsi_map_intf_mode(vif->type); in rsi_mac80211_add_interface()
475 vif->type); in rsi_mac80211_add_interface()
476 mutex_unlock(&common->mutex); in rsi_mac80211_add_interface()
477 return -EOPNOTSUPP; in rsi_mac80211_add_interface()
479 if ((vif->type == NL80211_IFTYPE_P2P_DEVICE) || in rsi_mac80211_add_interface()
480 (vif->type == NL80211_IFTYPE_P2P_CLIENT) || in rsi_mac80211_add_interface()
481 (vif->type == NL80211_IFTYPE_P2P_GO)) in rsi_mac80211_add_interface()
482 common->p2p_enabled = true; in rsi_mac80211_add_interface()
486 if (!adapter->vifs[i] || in rsi_mac80211_add_interface()
487 !memcmp(vif->addr, adapter->vifs[i]->addr, ETH_ALEN)) { in rsi_mac80211_add_interface()
494 mutex_unlock(&common->mutex); in rsi_mac80211_add_interface()
495 return -EOPNOTSUPP; in rsi_mac80211_add_interface()
497 vif_info->vap_id = vap_idx; in rsi_mac80211_add_interface()
498 adapter->vifs[vap_idx] = vif; in rsi_mac80211_add_interface()
499 adapter->sc_nvifs++; in rsi_mac80211_add_interface()
502 if (rsi_set_vap_capabilities(common, intf_mode, vif->addr, in rsi_mac80211_add_interface()
503 vif_info->vap_id, vap_status)) { in rsi_mac80211_add_interface()
505 mutex_unlock(&common->mutex); in rsi_mac80211_add_interface()
506 return -EINVAL; in rsi_mac80211_add_interface()
509 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_add_interface()
510 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_mac80211_add_interface()
512 for (i = 0; i < common->max_stations; i++) in rsi_mac80211_add_interface()
513 common->stations[i].sta = NULL; in rsi_mac80211_add_interface()
516 mutex_unlock(&common->mutex); in rsi_mac80211_add_interface()
522 * rsi_mac80211_remove_interface() - This function notifies driver that an
532 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_remove_interface()
533 struct rsi_common *common = adapter->priv; in rsi_mac80211_remove_interface()
539 mutex_lock(&common->mutex); in rsi_mac80211_remove_interface()
541 if (adapter->sc_nvifs <= 0) { in rsi_mac80211_remove_interface()
542 mutex_unlock(&common->mutex); in rsi_mac80211_remove_interface()
546 opmode = rsi_map_intf_mode(vif->type); in rsi_mac80211_remove_interface()
549 mutex_unlock(&common->mutex); in rsi_mac80211_remove_interface()
553 if (!adapter->vifs[i]) in rsi_mac80211_remove_interface()
555 if (vif == adapter->vifs[i]) { in rsi_mac80211_remove_interface()
556 rsi_set_vap_capabilities(common, opmode, vif->addr, in rsi_mac80211_remove_interface()
558 adapter->sc_nvifs--; in rsi_mac80211_remove_interface()
559 adapter->vifs[i] = NULL; in rsi_mac80211_remove_interface()
562 mutex_unlock(&common->mutex); in rsi_mac80211_remove_interface()
566 * rsi_channel_change() - This function is a performs the checks
575 struct rsi_hw *adapter = hw->priv; in rsi_channel_change()
576 struct rsi_common *common = adapter->priv; in rsi_channel_change()
577 int status = -EOPNOTSUPP; in rsi_channel_change() local
578 struct ieee80211_channel *curchan = hw->conf.chandef.chan; in rsi_channel_change()
579 u16 channel = curchan->hw_value; in rsi_channel_change()
586 __func__, curchan->center_freq, in rsi_channel_change()
587 curchan->flags, channel); in rsi_channel_change()
590 vif = adapter->vifs[i]; in rsi_channel_change()
593 if (vif->type == NL80211_IFTYPE_STATION) { in rsi_channel_change()
594 if (vif->cfg.assoc) { in rsi_channel_change()
601 if (!common->hw_data_qs_blocked && in rsi_channel_change()
605 common->hw_data_qs_blocked = true; in rsi_channel_change()
609 status = rsi_band_check(common, curchan); in rsi_channel_change()
610 if (!status) in rsi_channel_change()
611 status = rsi_set_channel(adapter->priv, curchan); in rsi_channel_change()
614 if (common->hw_data_qs_blocked && in rsi_channel_change()
618 common->hw_data_qs_blocked = false; in rsi_channel_change()
622 return status; in rsi_channel_change()
626 * rsi_config_power() - This function configures tx power to device
633 struct rsi_hw *adapter = hw->priv; in rsi_config_power()
634 struct rsi_common *common = adapter->priv; in rsi_config_power()
635 struct ieee80211_conf *conf = &hw->conf; in rsi_config_power()
637 if (adapter->sc_nvifs <= 0) { in rsi_config_power()
639 return -EINVAL; in rsi_config_power()
643 "%s: Set tx power: %d dBM\n", __func__, conf->power_level); in rsi_config_power()
645 if (conf->power_level == common->tx_power) in rsi_config_power()
648 common->tx_power = conf->power_level; in rsi_config_power()
654 * rsi_mac80211_config() - This function is a handler for configuration
665 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_config()
666 struct rsi_common *common = adapter->priv; in rsi_mac80211_config()
667 struct ieee80211_conf *conf = &hw->conf; in rsi_mac80211_config()
668 int status = -EOPNOTSUPP; in rsi_mac80211_config() local
670 mutex_lock(&common->mutex); in rsi_mac80211_config()
673 status = rsi_channel_change(hw); in rsi_mac80211_config()
678 status = rsi_config_power(hw); in rsi_mac80211_config()
683 !common->mac_ops_resumed) { in rsi_mac80211_config()
689 vif = adapter->vifs[i]; in rsi_mac80211_config()
693 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_config()
694 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_mac80211_config()
698 if ((vif->type == NL80211_IFTYPE_STATION || in rsi_mac80211_config()
699 vif->type == NL80211_IFTYPE_P2P_CLIENT) && in rsi_mac80211_config()
700 (!sta_vif || vif->cfg.assoc)) in rsi_mac80211_config()
704 spin_lock_irqsave(&adapter->ps_lock, flags); in rsi_mac80211_config()
705 if (conf->flags & IEEE80211_CONF_PS) in rsi_mac80211_config()
709 spin_unlock_irqrestore(&adapter->ps_lock, flags); in rsi_mac80211_config()
716 if ((common->rts_threshold) <= IEEE80211_MAX_RTS_THRESHOLD) { in rsi_mac80211_config()
719 status = rsi_send_vap_dynamic_update(common); in rsi_mac80211_config()
722 mutex_unlock(&common->mutex); in rsi_mac80211_config()
724 return status; in rsi_mac80211_config()
728 * rsi_get_connected_channel() - This function is used to get the current
742 bss = &vif->bss_conf; in rsi_get_connected_channel()
743 channel = bss->chandef.chan; in rsi_get_connected_channel()
748 return channel->hw_value; in rsi_get_connected_channel()
754 struct rsi_common *common = adapter->priv; in rsi_switch_channel()
757 if (common->iface_down) in rsi_switch_channel()
762 channel = vif->bss_conf.chandef.chan; in rsi_switch_channel()
769 rsi_dbg(INFO_ZONE, "Switched to channel - %d\n", channel->hw_value); in rsi_switch_channel()
773 * rsi_mac80211_bss_info_changed() - This function is a handler for config
788 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_bss_info_changed()
789 struct rsi_common *common = adapter->priv; in rsi_mac80211_bss_info_changed()
790 struct ieee80211_bss_conf *bss = &vif->bss_conf; in rsi_mac80211_bss_info_changed()
791 struct ieee80211_conf *conf = &hw->conf; in rsi_mac80211_bss_info_changed()
794 mutex_lock(&common->mutex); in rsi_mac80211_bss_info_changed()
796 rsi_dbg(INFO_ZONE, "%s: Changed Association status: %d\n", in rsi_mac80211_bss_info_changed()
797 __func__, vif->cfg.assoc); in rsi_mac80211_bss_info_changed()
798 if (vif->cfg.assoc) { in rsi_mac80211_bss_info_changed()
807 vif->cfg.assoc, in rsi_mac80211_bss_info_changed()
808 bss_conf->bssid, in rsi_mac80211_bss_info_changed()
809 bss_conf->qos, in rsi_mac80211_bss_info_changed()
810 vif->cfg.aid, in rsi_mac80211_bss_info_changed()
812 bss_conf->assoc_capability, vif); in rsi_mac80211_bss_info_changed()
813 adapter->ps_info.dtim_interval_duration = bss->dtim_period; in rsi_mac80211_bss_info_changed()
814 adapter->ps_info.listen_interval = conf->listen_interval; in rsi_mac80211_bss_info_changed()
816 /* If U-APSD is updated, send ps parameters to firmware */ in rsi_mac80211_bss_info_changed()
817 if (vif->cfg.assoc) { in rsi_mac80211_bss_info_changed()
818 if (common->uapsd_bitmap) { in rsi_mac80211_bss_info_changed()
823 common->uapsd_bitmap = 0; in rsi_mac80211_bss_info_changed()
828 common->cqm_info.last_cqm_event_rssi = 0; in rsi_mac80211_bss_info_changed()
829 common->cqm_info.rssi_thold = bss_conf->cqm_rssi_thold; in rsi_mac80211_bss_info_changed()
830 common->cqm_info.rssi_hyst = bss_conf->cqm_rssi_hyst; in rsi_mac80211_bss_info_changed()
832 common->cqm_info.rssi_thold, in rsi_mac80211_bss_info_changed()
833 common->cqm_info.rssi_hyst); in rsi_mac80211_bss_info_changed()
838 __func__, bss_conf->beacon_int); in rsi_mac80211_bss_info_changed()
839 if (common->beacon_interval != bss->beacon_int) { in rsi_mac80211_bss_info_changed()
840 common->beacon_interval = bss->beacon_int; in rsi_mac80211_bss_info_changed()
841 if (vif->type == NL80211_IFTYPE_AP) { in rsi_mac80211_bss_info_changed()
842 struct vif_priv *vif_info = (struct vif_priv *)vif->drv_priv; in rsi_mac80211_bss_info_changed()
845 vif->addr, vif_info->vap_id, in rsi_mac80211_bss_info_changed()
849 adapter->ps_info.listen_interval = in rsi_mac80211_bss_info_changed()
850 bss->beacon_int * adapter->ps_info.num_bcns_per_lis_int; in rsi_mac80211_bss_info_changed()
854 ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_bss_info_changed()
855 (vif->type == NL80211_IFTYPE_P2P_GO))) { in rsi_mac80211_bss_info_changed()
856 if (bss->enable_beacon) { in rsi_mac80211_bss_info_changed()
858 common->beacon_enabled = 1; in rsi_mac80211_bss_info_changed()
861 common->beacon_enabled = 0; in rsi_mac80211_bss_info_changed()
865 mutex_unlock(&common->mutex); in rsi_mac80211_bss_info_changed()
869 * rsi_mac80211_conf_filter() - This function configure the device's RX filter.
887 * rsi_mac80211_conf_tx() - This function configures TX queue parameters
903 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_conf_tx()
904 struct rsi_common *common = adapter->priv; in rsi_mac80211_conf_tx()
912 __func__, queue, params->aifs, in rsi_mac80211_conf_tx()
913 params->cw_min, params->cw_max, params->txop); in rsi_mac80211_conf_tx()
915 mutex_lock(&common->mutex); in rsi_mac80211_conf_tx()
935 memcpy(&common->edca_params[idx], in rsi_mac80211_conf_tx()
939 if (params->uapsd) in rsi_mac80211_conf_tx()
940 common->uapsd_bitmap |= idx; in rsi_mac80211_conf_tx()
942 common->uapsd_bitmap &= (~idx); in rsi_mac80211_conf_tx()
944 mutex_unlock(&common->mutex); in rsi_mac80211_conf_tx()
950 * rsi_hal_key_config() - This function loads the keys into the firmware.
956 * Return: status: 0 on success, negative error codes on failure.
963 struct rsi_hw *adapter = hw->priv; in rsi_hal_key_config()
965 int status; in rsi_hal_key_config() local
969 if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) in rsi_hal_key_config()
975 __func__, key->cipher, key_type, key->keylen); in rsi_hal_key_config()
977 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_hal_key_config()
978 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_hal_key_config()
980 rsta = rsi_find_sta(adapter->priv, sta->addr); in rsi_hal_key_config()
982 sta_id = rsta->sta_id; in rsi_hal_key_config()
984 adapter->priv->key = key; in rsi_hal_key_config()
986 if ((key->cipher == WLAN_CIPHER_SUITE_WEP104) || in rsi_hal_key_config()
987 (key->cipher == WLAN_CIPHER_SUITE_WEP40)) { in rsi_hal_key_config()
988 status = rsi_hal_load_key(adapter->priv, in rsi_hal_key_config()
989 key->key, in rsi_hal_key_config()
990 key->keylen, in rsi_hal_key_config()
992 key->keyidx, in rsi_hal_key_config()
993 key->cipher, in rsi_hal_key_config()
996 if (status) in rsi_hal_key_config()
997 return status; in rsi_hal_key_config()
1001 status = rsi_hal_load_key(adapter->priv, in rsi_hal_key_config()
1002 key->key, in rsi_hal_key_config()
1003 key->keylen, in rsi_hal_key_config()
1005 key->keyidx, in rsi_hal_key_config()
1006 key->cipher, in rsi_hal_key_config()
1009 if (status) in rsi_hal_key_config()
1010 return status; in rsi_hal_key_config()
1012 if (vif->type == NL80211_IFTYPE_STATION && in rsi_hal_key_config()
1013 (key->cipher == WLAN_CIPHER_SUITE_WEP104 || in rsi_hal_key_config()
1014 key->cipher == WLAN_CIPHER_SUITE_WEP40)) { in rsi_hal_key_config()
1015 if (!rsi_send_block_unblock_frame(adapter->priv, false)) in rsi_hal_key_config()
1016 adapter->priv->hw_data_qs_blocked = false; in rsi_hal_key_config()
1023 * rsi_mac80211_set_key() - This function sets type of key to be loaded.
1030 * Return: status: 0 on success, negative error code on failure.
1038 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_set_key()
1039 struct rsi_common *common = adapter->priv; in rsi_mac80211_set_key()
1040 struct security_info *secinfo = &common->secinfo; in rsi_mac80211_set_key()
1041 int status; in rsi_mac80211_set_key() local
1043 mutex_lock(&common->mutex); in rsi_mac80211_set_key()
1046 status = rsi_hal_key_config(hw, vif, key, sta); in rsi_mac80211_set_key()
1047 if (status) { in rsi_mac80211_set_key()
1048 mutex_unlock(&common->mutex); in rsi_mac80211_set_key()
1049 return status; in rsi_mac80211_set_key()
1052 if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) in rsi_mac80211_set_key()
1053 secinfo->ptk_cipher = key->cipher; in rsi_mac80211_set_key()
1055 secinfo->gtk_cipher = key->cipher; in rsi_mac80211_set_key()
1057 key->hw_key_idx = key->keyidx; in rsi_mac80211_set_key()
1058 key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; in rsi_mac80211_set_key()
1066 status = rsi_hal_key_config(hw, vif, key, sta); in rsi_mac80211_set_key()
1070 status = -EOPNOTSUPP; in rsi_mac80211_set_key()
1074 mutex_unlock(&common->mutex); in rsi_mac80211_set_key()
1075 return status; in rsi_mac80211_set_key()
1079 * rsi_mac80211_ampdu_action() - This function selects the AMPDU action for
1084 * @params: Pointer to A-MPDU action parameters
1086 * Return: status: 0 on success, negative error code on failure.
1092 int status = -EOPNOTSUPP; in rsi_mac80211_ampdu_action() local
1093 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_ampdu_action()
1094 struct rsi_common *common = adapter->priv; in rsi_mac80211_ampdu_action()
1098 struct ieee80211_sta *sta = params->sta; in rsi_mac80211_ampdu_action()
1100 enum ieee80211_ampdu_mlme_action action = params->action; in rsi_mac80211_ampdu_action()
1101 u16 tid = params->tid; in rsi_mac80211_ampdu_action()
1102 u16 *ssn = ¶ms->ssn; in rsi_mac80211_ampdu_action()
1103 u8 buf_size = params->buf_size; in rsi_mac80211_ampdu_action()
1106 if (vif == adapter->vifs[ii]) in rsi_mac80211_ampdu_action()
1111 return status; in rsi_mac80211_ampdu_action()
1113 mutex_lock(&common->mutex); in rsi_mac80211_ampdu_action()
1118 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_ampdu_action()
1119 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_mac80211_ampdu_action()
1120 rsta = rsi_find_sta(common, sta->addr); in rsi_mac80211_ampdu_action()
1123 status = 0; in rsi_mac80211_ampdu_action()
1126 sta_id = rsta->sta_id; in rsi_mac80211_ampdu_action()
1135 status = rsi_send_aggregation_params_frame(common, in rsi_mac80211_ampdu_action()
1144 status = rsi_send_aggregation_params_frame(common, in rsi_mac80211_ampdu_action()
1153 if ((vif->type == NL80211_IFTYPE_STATION) || in rsi_mac80211_ampdu_action()
1154 (vif->type == NL80211_IFTYPE_P2P_CLIENT)) in rsi_mac80211_ampdu_action()
1155 common->vif_info[ii].seq_start = seq_no; in rsi_mac80211_ampdu_action()
1156 else if ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_ampdu_action()
1157 (vif->type == NL80211_IFTYPE_P2P_GO)) in rsi_mac80211_ampdu_action()
1158 rsta->seq_start[tid] = seq_no; in rsi_mac80211_ampdu_action()
1159 status = IEEE80211_AMPDU_TX_START_IMMEDIATE; in rsi_mac80211_ampdu_action()
1165 status = rsi_send_aggregation_params_frame(common, in rsi_mac80211_ampdu_action()
1171 if (!status) in rsi_mac80211_ampdu_action()
1172 ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid); in rsi_mac80211_ampdu_action()
1176 if ((vif->type == NL80211_IFTYPE_STATION) || in rsi_mac80211_ampdu_action()
1177 (vif->type == NL80211_IFTYPE_P2P_CLIENT)) in rsi_mac80211_ampdu_action()
1178 seq_start = common->vif_info[ii].seq_start; in rsi_mac80211_ampdu_action()
1179 else if ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_ampdu_action()
1180 (vif->type == NL80211_IFTYPE_P2P_GO)) in rsi_mac80211_ampdu_action()
1181 seq_start = rsta->seq_start[tid]; in rsi_mac80211_ampdu_action()
1182 status = rsi_send_aggregation_params_frame(common, in rsi_mac80211_ampdu_action()
1196 mutex_unlock(&common->mutex); in rsi_mac80211_ampdu_action()
1197 return status; in rsi_mac80211_ampdu_action()
1201 * rsi_mac80211_set_rts_threshold() - This function sets rts threshold value.
1210 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_set_rts_threshold()
1211 struct rsi_common *common = adapter->priv; in rsi_mac80211_set_rts_threshold()
1213 mutex_lock(&common->mutex); in rsi_mac80211_set_rts_threshold()
1214 common->rts_threshold = value; in rsi_mac80211_set_rts_threshold()
1215 mutex_unlock(&common->mutex); in rsi_mac80211_set_rts_threshold()
1221 * rsi_mac80211_set_rate_mask() - This function sets bitrate_mask to be used.
1233 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_set_rate_mask()
1234 struct rsi_common *common = adapter->priv; in rsi_mac80211_set_rate_mask()
1237 mutex_lock(&common->mutex); in rsi_mac80211_set_rate_mask()
1239 for (i = 0; i < ARRAY_SIZE(common->rate_config); i++) { in rsi_mac80211_set_rate_mask()
1240 struct rsi_rate_config *cfg = &common->rate_config[i]; in rsi_mac80211_set_rate_mask()
1243 bm = mask->control[i].legacy | (mask->control[i].ht_mcs[0] << mcs_offset); in rsi_mac80211_set_rate_mask()
1245 int rate_index = ffs(bm) - 1; in rsi_mac80211_set_rate_mask()
1248 cfg->fixed_hw_rate = rsi_rates[rate_index].hw_value; in rsi_mac80211_set_rate_mask()
1250 cfg->fixed_hw_rate = rsi_mcsrates[rate_index - mcs_offset]; in rsi_mac80211_set_rate_mask()
1251 cfg->fixed_enabled = true; in rsi_mac80211_set_rate_mask()
1253 cfg->configured_mask = bm; in rsi_mac80211_set_rate_mask()
1254 cfg->fixed_enabled = false; in rsi_mac80211_set_rate_mask()
1258 mutex_unlock(&common->mutex); in rsi_mac80211_set_rate_mask()
1264 * rsi_perform_cqm() - This function performs cqm.
1275 s8 last_event = common->cqm_info.last_cqm_event_rssi; in rsi_perform_cqm()
1276 int thold = common->cqm_info.rssi_thold; in rsi_perform_cqm()
1277 u32 hyst = common->cqm_info.rssi_hyst; in rsi_perform_cqm()
1280 if (rssi < thold && (last_event == 0 || rssi < (last_event - hyst))) in rsi_perform_cqm()
1288 common->cqm_info.last_cqm_event_rssi = rssi; in rsi_perform_cqm()
1296 * rsi_fill_rx_status() - This function fills rx status in
1310 struct rsi_hw *adapter = common->priv; in rsi_fill_rx_status()
1314 struct skb_info *rx_params = (struct skb_info *)info->driver_data; in rsi_fill_rx_status()
1316 char rssi = rx_params->rssi; in rsi_fill_rx_status()
1318 u8 channel = rx_params->channel; in rsi_fill_rx_status()
1322 hdr = ((struct ieee80211_hdr *)(skb->data)); in rsi_fill_rx_status()
1323 hdrlen = ieee80211_hdrlen(hdr->frame_control); in rsi_fill_rx_status()
1327 rxs->signal = -(rssi); in rsi_fill_rx_status()
1329 rxs->band = common->band; in rsi_fill_rx_status()
1331 freq = ieee80211_channel_to_frequency(channel, rxs->band); in rsi_fill_rx_status()
1334 rxs->freq = freq; in rsi_fill_rx_status()
1336 if (ieee80211_has_protected(hdr->frame_control)) { in rsi_fill_rx_status()
1338 memmove(skb->data + 4, skb->data, hdrlen); in rsi_fill_rx_status()
1341 memmove(skb->data + 8, skb->data, hdrlen); in rsi_fill_rx_status()
1343 rxs->flag |= RX_FLAG_MMIC_STRIPPED; in rsi_fill_rx_status()
1345 rxs->flag |= RX_FLAG_DECRYPTED; in rsi_fill_rx_status()
1346 rxs->flag |= RX_FLAG_IV_STRIPPED; in rsi_fill_rx_status()
1350 vif = adapter->vifs[i]; in rsi_fill_rx_status()
1353 if (vif->type == NL80211_IFTYPE_STATION) { in rsi_fill_rx_status()
1354 bss = &vif->bss_conf; in rsi_fill_rx_status()
1361 if (vif->cfg.assoc && !(memcmp(bss->bssid, hdr->addr2, ETH_ALEN))) { in rsi_fill_rx_status()
1362 if (ieee80211_is_beacon(hdr->frame_control)) in rsi_fill_rx_status()
1363 rsi_perform_cqm(common, hdr->addr2, rxs->signal, vif); in rsi_fill_rx_status()
1370 * rsi_indicate_pkt_to_os() - This function sends received packet to mac80211.
1379 struct rsi_hw *adapter = common->priv; in rsi_indicate_pkt_to_os()
1380 struct ieee80211_hw *hw = adapter->hw; in rsi_indicate_pkt_to_os()
1383 if ((common->iface_down) || (!adapter->sc_nvifs)) { in rsi_indicate_pkt_to_os()
1388 /* filling in the ieee80211_rx_status flags */ in rsi_indicate_pkt_to_os()
1395 * rsi_mac80211_sta_add() - This function notifies driver about a peer getting
1407 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_sta_add()
1408 struct rsi_common *common = adapter->priv; in rsi_mac80211_sta_add()
1411 int status = 0; in rsi_mac80211_sta_add() local
1413 rsi_dbg(INFO_ZONE, "Station Add: %pM\n", sta->addr); in rsi_mac80211_sta_add()
1415 mutex_lock(&common->mutex); in rsi_mac80211_sta_add()
1417 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_sta_add()
1418 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_mac80211_sta_add()
1420 int sta_idx = -1; in rsi_mac80211_sta_add()
1421 int free_index = -1; in rsi_mac80211_sta_add()
1424 if (common->num_stations >= common->max_stations) { in rsi_mac80211_sta_add()
1426 status = -EOPNOTSUPP; in rsi_mac80211_sta_add()
1429 for (cnt = 0; cnt < common->max_stations; cnt++) { in rsi_mac80211_sta_add()
1430 rsta = &common->stations[cnt]; in rsi_mac80211_sta_add()
1432 if (!rsta->sta) { in rsi_mac80211_sta_add()
1437 if (!memcmp(rsta->sta->addr, sta->addr, ETH_ALEN)) { in rsi_mac80211_sta_add()
1452 status = -EINVAL; in rsi_mac80211_sta_add()
1455 rsta = &common->stations[sta_idx]; in rsi_mac80211_sta_add()
1456 rsta->sta = sta; in rsi_mac80211_sta_add()
1457 rsta->sta_id = sta_idx; in rsi_mac80211_sta_add()
1459 rsta->start_tx_aggr[cnt] = false; in rsi_mac80211_sta_add()
1461 rsta->seq_start[cnt] = 0; in rsi_mac80211_sta_add()
1466 rsi_dbg(INFO_ZONE, "Indicate bss status to device\n"); in rsi_mac80211_sta_add()
1468 sta->addr, sta->wme, sta->aid, in rsi_mac80211_sta_add()
1471 if (common->key) { in rsi_mac80211_sta_add()
1472 struct ieee80211_key_conf *key = common->key; in rsi_mac80211_sta_add()
1474 if ((key->cipher == WLAN_CIPHER_SUITE_WEP104) || in rsi_mac80211_sta_add()
1475 (key->cipher == WLAN_CIPHER_SUITE_WEP40)) in rsi_mac80211_sta_add()
1476 rsi_hal_load_key(adapter->priv, in rsi_mac80211_sta_add()
1477 key->key, in rsi_mac80211_sta_add()
1478 key->keylen, in rsi_mac80211_sta_add()
1480 key->keyidx, in rsi_mac80211_sta_add()
1481 key->cipher, in rsi_mac80211_sta_add()
1486 common->num_stations++; in rsi_mac80211_sta_add()
1490 if ((vif->type == NL80211_IFTYPE_STATION) || in rsi_mac80211_sta_add()
1491 (vif->type == NL80211_IFTYPE_P2P_CLIENT)) { in rsi_mac80211_sta_add()
1492 common->bitrate_mask[common->band] = sta->deflink.supp_rates[common->band]; in rsi_mac80211_sta_add()
1493 common->vif_info[0].is_ht = sta->deflink.ht_cap.ht_supported; in rsi_mac80211_sta_add()
1494 if (sta->deflink.ht_cap.ht_supported) { in rsi_mac80211_sta_add()
1495 common->bitrate_mask[NL80211_BAND_2GHZ] = in rsi_mac80211_sta_add()
1496 sta->deflink.supp_rates[NL80211_BAND_2GHZ]; in rsi_mac80211_sta_add()
1497 if ((sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_20) || in rsi_mac80211_sta_add()
1498 (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_40)) in rsi_mac80211_sta_add()
1499 common->vif_info[0].sgi = true; in rsi_mac80211_sta_add()
1505 mutex_unlock(&common->mutex); in rsi_mac80211_sta_add()
1507 return status; in rsi_mac80211_sta_add()
1511 * rsi_mac80211_sta_remove() - This function notifies driver about a peer
1523 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_sta_remove()
1524 struct rsi_common *common = adapter->priv; in rsi_mac80211_sta_remove()
1525 struct ieee80211_bss_conf *bss = &vif->bss_conf; in rsi_mac80211_sta_remove()
1528 rsi_dbg(INFO_ZONE, "Station Remove: %pM\n", sta->addr); in rsi_mac80211_sta_remove()
1530 mutex_lock(&common->mutex); in rsi_mac80211_sta_remove()
1532 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_mac80211_sta_remove()
1533 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_mac80211_sta_remove()
1537 rsi_dbg(INFO_ZONE, "Indicate bss status to device\n"); in rsi_mac80211_sta_remove()
1538 for (sta_idx = 0; sta_idx < common->max_stations; sta_idx++) { in rsi_mac80211_sta_remove()
1539 rsta = &common->stations[sta_idx]; in rsi_mac80211_sta_remove()
1541 if (!rsta->sta) in rsi_mac80211_sta_remove()
1543 if (!memcmp(rsta->sta->addr, sta->addr, ETH_ALEN)) { in rsi_mac80211_sta_remove()
1545 sta->addr, sta->wme, in rsi_mac80211_sta_remove()
1546 sta->aid, sta, sta_idx, in rsi_mac80211_sta_remove()
1548 rsta->sta = NULL; in rsi_mac80211_sta_remove()
1549 rsta->sta_id = -1; in rsi_mac80211_sta_remove()
1551 rsta->start_tx_aggr[cnt] = false; in rsi_mac80211_sta_remove()
1552 if (common->num_stations > 0) in rsi_mac80211_sta_remove()
1553 common->num_stations--; in rsi_mac80211_sta_remove()
1557 if (sta_idx >= common->max_stations) in rsi_mac80211_sta_remove()
1561 if ((vif->type == NL80211_IFTYPE_STATION) || in rsi_mac80211_sta_remove()
1562 (vif->type == NL80211_IFTYPE_P2P_CLIENT)) { in rsi_mac80211_sta_remove()
1564 memcpy((u8 *)bss->bssid, (u8 *)sta->addr, ETH_ALEN); in rsi_mac80211_sta_remove()
1565 bss->qos = sta->wme; in rsi_mac80211_sta_remove()
1566 common->bitrate_mask[NL80211_BAND_2GHZ] = 0; in rsi_mac80211_sta_remove()
1567 common->bitrate_mask[NL80211_BAND_5GHZ] = 0; in rsi_mac80211_sta_remove()
1568 common->vif_info[0].is_ht = false; in rsi_mac80211_sta_remove()
1569 common->vif_info[0].sgi = false; in rsi_mac80211_sta_remove()
1570 common->vif_info[0].seq_start = 0; in rsi_mac80211_sta_remove()
1571 common->secinfo.ptk_cipher = 0; in rsi_mac80211_sta_remove()
1572 common->secinfo.gtk_cipher = 0; in rsi_mac80211_sta_remove()
1573 if (!common->iface_down) in rsi_mac80211_sta_remove()
1576 mutex_unlock(&common->mutex); in rsi_mac80211_sta_remove()
1582 * rsi_mac80211_set_antenna() - This function is used to configure
1593 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_set_antenna()
1594 struct rsi_common *common = adapter->priv; in rsi_mac80211_set_antenna()
1603 return -EINVAL; in rsi_mac80211_set_antenna()
1609 mutex_lock(&common->mutex); in rsi_mac80211_set_antenna()
1612 if (common->ant_in_use != antenna) in rsi_mac80211_set_antenna()
1619 common->ant_in_use = antenna; in rsi_mac80211_set_antenna()
1621 mutex_unlock(&common->mutex); in rsi_mac80211_set_antenna()
1627 mutex_unlock(&common->mutex); in rsi_mac80211_set_antenna()
1628 return -EINVAL; in rsi_mac80211_set_antenna()
1632 * rsi_mac80211_get_antenna() - This function is used to configure
1644 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_get_antenna()
1645 struct rsi_common *common = adapter->priv; in rsi_mac80211_get_antenna()
1647 mutex_lock(&common->mutex); in rsi_mac80211_get_antenna()
1649 *tx_ant = (common->ant_in_use == ANTENNA_SEL_UFL) ? 1 : 0; in rsi_mac80211_get_antenna()
1652 mutex_unlock(&common->mutex); in rsi_mac80211_get_antenna()
1678 struct rsi_hw * adapter = hw->priv; in rsi_reg_notify()
1679 struct rsi_common *common = adapter->priv; in rsi_reg_notify()
1682 mutex_lock(&common->mutex); in rsi_reg_notify()
1685 request->alpha2, request->dfs_region); in rsi_reg_notify()
1687 if (common->num_supp_bands > 1) { in rsi_reg_notify()
1688 sband = wiphy->bands[NL80211_BAND_5GHZ]; in rsi_reg_notify()
1690 for (i = 0; i < sband->n_channels; i++) { in rsi_reg_notify()
1691 ch = &sband->channels[i]; in rsi_reg_notify()
1692 if (ch->flags & IEEE80211_CHAN_DISABLED) in rsi_reg_notify()
1695 if (ch->flags & IEEE80211_CHAN_RADAR) in rsi_reg_notify()
1696 ch->flags |= IEEE80211_CHAN_NO_IR; in rsi_reg_notify()
1699 adapter->dfs_region = rsi_map_region_code(request->dfs_region); in rsi_reg_notify()
1700 rsi_dbg(INFO_ZONE, "RSI region code = %d\n", adapter->dfs_region); in rsi_reg_notify()
1702 adapter->country[0] = request->alpha2[0]; in rsi_reg_notify()
1703 adapter->country[1] = request->alpha2[1]; in rsi_reg_notify()
1705 mutex_unlock(&common->mutex); in rsi_reg_notify()
1710 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_rfkill_poll()
1711 struct rsi_common *common = adapter->priv; in rsi_mac80211_rfkill_poll()
1713 mutex_lock(&common->mutex); in rsi_mac80211_rfkill_poll()
1714 if (common->fsm_state != FSM_MAC_INIT_DONE) in rsi_mac80211_rfkill_poll()
1715 wiphy_rfkill_set_hw_state(hw->wiphy, true); in rsi_mac80211_rfkill_poll()
1717 wiphy_rfkill_set_hw_state(hw->wiphy, false); in rsi_mac80211_rfkill_poll()
1718 mutex_unlock(&common->mutex); in rsi_mac80211_rfkill_poll()
1723 struct rsi_hw *adapter = common->priv; in rsi_resume_conn_channel()
1728 vif = adapter->vifs[cnt]; in rsi_resume_conn_channel()
1732 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_resume_conn_channel()
1733 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_resume_conn_channel()
1737 if (((vif->type == NL80211_IFTYPE_STATION) || in rsi_resume_conn_channel()
1738 (vif->type == NL80211_IFTYPE_P2P_CLIENT)) && in rsi_resume_conn_channel()
1739 vif->cfg.assoc) { in rsi_resume_conn_channel()
1752 mutex_lock(&common->mutex); in rsi_roc_timeout()
1753 ieee80211_remain_on_channel_expired(common->priv->hw); in rsi_roc_timeout()
1755 if (timer_pending(&common->roc_timer)) in rsi_roc_timeout()
1756 del_timer(&common->roc_timer); in rsi_roc_timeout()
1759 mutex_unlock(&common->mutex); in rsi_roc_timeout()
1766 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_roc()
1767 struct rsi_common *common = adapter->priv; in rsi_mac80211_roc()
1768 int status = 0; in rsi_mac80211_roc() local
1772 mutex_lock(&common->mutex); in rsi_mac80211_roc()
1774 __func__, chan->hw_value, duration); in rsi_mac80211_roc()
1776 if (timer_pending(&common->roc_timer)) { in rsi_mac80211_roc()
1777 rsi_dbg(INFO_ZONE, "Stop on-going ROC\n"); in rsi_mac80211_roc()
1778 del_timer(&common->roc_timer); in rsi_mac80211_roc()
1780 common->roc_timer.expires = msecs_to_jiffies(duration) + jiffies; in rsi_mac80211_roc()
1781 add_timer(&common->roc_timer); in rsi_mac80211_roc()
1783 /* Configure band */ in rsi_mac80211_roc()
1785 rsi_dbg(ERR_ZONE, "Failed to set band\n"); in rsi_mac80211_roc()
1786 status = -EINVAL; in rsi_mac80211_roc()
1793 status = -EINVAL; in rsi_mac80211_roc()
1797 common->roc_vif = vif; in rsi_mac80211_roc()
1800 __func__, chan->hw_value); in rsi_mac80211_roc()
1803 mutex_unlock(&common->mutex); in rsi_mac80211_roc()
1805 return status; in rsi_mac80211_roc()
1811 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_cancel_roc()
1812 struct rsi_common *common = adapter->priv; in rsi_mac80211_cancel_roc()
1816 mutex_lock(&common->mutex); in rsi_mac80211_cancel_roc()
1817 if (!timer_pending(&common->roc_timer)) { in rsi_mac80211_cancel_roc()
1818 mutex_unlock(&common->mutex); in rsi_mac80211_cancel_roc()
1822 del_timer(&common->roc_timer); in rsi_mac80211_cancel_roc()
1825 mutex_unlock(&common->mutex); in rsi_mac80211_cancel_roc()
1848 if (wowlan->any) in rsi_wow_map_triggers()
1850 if (wowlan->magic_pkt) in rsi_wow_map_triggers()
1852 if (wowlan->disconnect) in rsi_wow_map_triggers()
1854 if (wowlan->gtk_rekey_failure || wowlan->eap_identity_req || in rsi_wow_map_triggers()
1855 wowlan->four_way_handshake) in rsi_wow_map_triggers()
1863 struct rsi_common *common = adapter->priv; in rsi_config_wowlan()
1864 struct ieee80211_vif *vif = adapter->vifs[0]; in rsi_config_wowlan()
1871 return -EINVAL; in rsi_config_wowlan()
1875 return -EINVAL; in rsi_config_wowlan()
1878 common->wow_flags |= RSI_WOW_ENABLED; in rsi_config_wowlan()
1882 return -EINVAL; in rsi_config_wowlan()
1884 if (!vif->cfg.assoc) { in rsi_config_wowlan()
1887 common->wow_flags |= RSI_WOW_NO_CONNECTION; in rsi_config_wowlan()
1892 if (common->coex_mode > 1) in rsi_config_wowlan()
1893 rsi_disable_ps(adapter, adapter->vifs[0]); in rsi_config_wowlan()
1898 * Increase the beacon_miss threshold & keep-alive timers in in rsi_config_wowlan()
1913 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_suspend()
1914 struct rsi_common *common = adapter->priv; in rsi_mac80211_suspend()
1917 mutex_lock(&common->mutex); in rsi_mac80211_suspend()
1920 mutex_unlock(&common->mutex); in rsi_mac80211_suspend()
1923 mutex_unlock(&common->mutex); in rsi_mac80211_suspend()
1931 struct rsi_hw *adapter = hw->priv; in rsi_mac80211_resume()
1932 struct rsi_common *common = adapter->priv; in rsi_mac80211_resume()
1934 common->wow_flags = 0; in rsi_mac80211_resume()
1938 if (common->hibernate_resume) { in rsi_mac80211_resume()
1939 common->mac_ops_resumed = true; in rsi_mac80211_resume()
1946 mutex_lock(&common->mutex); in rsi_mac80211_resume()
1952 mutex_unlock(&common->mutex); in rsi_mac80211_resume()
1990 * rsi_mac80211_attach() - This function is used to initialize Mac80211 stack.
1997 int status = 0; in rsi_mac80211_attach() local
2000 struct rsi_hw *adapter = common->priv; in rsi_mac80211_attach()
2008 return -ENOMEM; in rsi_mac80211_attach()
2011 wiphy = hw->wiphy; in rsi_mac80211_attach()
2013 SET_IEEE80211_DEV(hw, adapter->device); in rsi_mac80211_attach()
2015 hw->priv = adapter; in rsi_mac80211_attach()
2016 adapter->hw = hw; in rsi_mac80211_attach()
2024 hw->queues = MAX_HW_QUEUES; in rsi_mac80211_attach()
2025 hw->extra_tx_headroom = RSI_NEEDED_HEADROOM; in rsi_mac80211_attach()
2027 hw->max_rates = 1; in rsi_mac80211_attach()
2028 hw->max_rate_tries = MAX_RETRIES; in rsi_mac80211_attach()
2029 hw->uapsd_queues = RSI_IEEE80211_UAPSD_QUEUES; in rsi_mac80211_attach()
2030 hw->uapsd_max_sp_len = IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL; in rsi_mac80211_attach()
2032 hw->max_tx_aggregation_subframes = RSI_MAX_TX_AGGR_FRMS; in rsi_mac80211_attach()
2033 hw->max_rx_aggregation_subframes = RSI_MAX_RX_AGGR_FRMS; in rsi_mac80211_attach()
2034 hw->rate_control_algorithm = "AARF"; in rsi_mac80211_attach()
2036 SET_IEEE80211_PERM_ADDR(hw, common->mac_addr); in rsi_mac80211_attach()
2037 ether_addr_copy(hw->wiphy->addr_mask, addr_mask); in rsi_mac80211_attach()
2039 wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | in rsi_mac80211_attach()
2045 wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; in rsi_mac80211_attach()
2046 wiphy->retry_short = RETRY_SHORT; in rsi_mac80211_attach()
2047 wiphy->retry_long = RETRY_LONG; in rsi_mac80211_attach()
2048 wiphy->frag_threshold = IEEE80211_MAX_FRAG_THRESHOLD; in rsi_mac80211_attach()
2049 wiphy->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD; in rsi_mac80211_attach()
2050 wiphy->flags = 0; in rsi_mac80211_attach()
2052 wiphy->available_antennas_rx = 1; in rsi_mac80211_attach()
2053 wiphy->available_antennas_tx = 1; in rsi_mac80211_attach()
2055 status = rsi_register_rates_channels(adapter, NL80211_BAND_2GHZ); in rsi_mac80211_attach()
2056 if (status) in rsi_mac80211_attach()
2057 return status; in rsi_mac80211_attach()
2058 wiphy->bands[NL80211_BAND_2GHZ] = in rsi_mac80211_attach()
2059 &adapter->sbands[NL80211_BAND_2GHZ]; in rsi_mac80211_attach()
2060 if (common->num_supp_bands > 1) { in rsi_mac80211_attach()
2061 status = rsi_register_rates_channels(adapter, in rsi_mac80211_attach()
2063 if (status) in rsi_mac80211_attach()
2064 return status; in rsi_mac80211_attach()
2065 wiphy->bands[NL80211_BAND_5GHZ] = in rsi_mac80211_attach()
2066 &adapter->sbands[NL80211_BAND_5GHZ]; in rsi_mac80211_attach()
2070 wiphy->max_ap_assoc_sta = rsi_max_ap_stas[common->oper_mode - 1]; in rsi_mac80211_attach()
2071 common->max_stations = wiphy->max_ap_assoc_sta; in rsi_mac80211_attach()
2072 rsi_dbg(ERR_ZONE, "Max Stations Allowed = %d\n", common->max_stations); in rsi_mac80211_attach()
2073 hw->sta_data_size = sizeof(struct rsi_sta); in rsi_mac80211_attach()
2075 wiphy->max_scan_ssids = RSI_MAX_SCAN_SSIDS; in rsi_mac80211_attach()
2076 wiphy->max_scan_ie_len = RSI_MAX_SCAN_IE_LEN; in rsi_mac80211_attach()
2077 wiphy->flags = WIPHY_FLAG_REPORTS_OBSS; in rsi_mac80211_attach()
2078 wiphy->flags |= WIPHY_FLAG_AP_UAPSD; in rsi_mac80211_attach()
2079 wiphy->features |= NL80211_FEATURE_INACTIVITY_TIMER; in rsi_mac80211_attach()
2080 wiphy->reg_notifier = rsi_reg_notify; in rsi_mac80211_attach()
2083 wiphy->wowlan = &rsi_wowlan_support; in rsi_mac80211_attach()
2088 /* Wi-Fi direct parameters */ in rsi_mac80211_attach()
2089 wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; in rsi_mac80211_attach()
2090 wiphy->flags |= WIPHY_FLAG_OFFCHAN_TX; in rsi_mac80211_attach()
2091 wiphy->max_remain_on_channel_duration = 10000; in rsi_mac80211_attach()
2092 hw->max_listen_interval = 10; in rsi_mac80211_attach()
2093 wiphy->iface_combinations = rsi_iface_combinations; in rsi_mac80211_attach()
2094 wiphy->n_iface_combinations = ARRAY_SIZE(rsi_iface_combinations); in rsi_mac80211_attach()
2096 if (common->coex_mode > 1) in rsi_mac80211_attach()
2097 wiphy->flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT; in rsi_mac80211_attach()
2099 status = ieee80211_register_hw(hw); in rsi_mac80211_attach()
2100 if (status) in rsi_mac80211_attach()
2101 return status; in rsi_mac80211_attach()