Lines Matching defs:wvif
63 static void wfx_filter_beacon(struct wfx_vif *wvif, bool filter_beacon)
91 wfx_hif_beacon_filter_control(wvif, 0, 1);
93 wfx_hif_set_beacon_filter_table(wvif, ARRAY_SIZE(filter_ies), filter_ies);
94 wfx_hif_beacon_filter_control(wvif, HIF_BEACON_FILTER_ENABLE, 0);
104 struct wfx_vif *wvif = NULL;
118 while ((wvif = wvif_iterate(wdev, wvif)) != NULL) {
119 mutex_lock(&wvif->scan_lock);
128 wfx_filter_beacon(wvif, filter_beacon);
135 vif = wvif_to_vif(wvif);
146 wfx_hif_set_rx_filter(wvif, filter_bssid, filter_prbreq);
148 mutex_unlock(&wvif->scan_lock);
153 static int wfx_get_ps_timeout(struct wfx_vif *wvif, bool *enable_ps)
156 struct ieee80211_conf *conf = &wvif->wdev->hw->conf;
157 struct ieee80211_vif *vif = wvif_to_vif(wvif);
161 if (wdev_to_wvif(wvif->wdev, 0)) {
162 struct wfx_vif *wvif_ch0 = wdev_to_wvif(wvif->wdev, 0);
167 if (wdev_to_wvif(wvif->wdev, 1)) {
168 struct wfx_vif *wvif_ch1 = wdev_to_wvif(wvif->wdev, 1);
179 dev_info(wvif->wdev->dev, "ignoring requested PS mode");
185 if (wfx_api_older_than(wvif->wdev, 3, 2))
198 int wfx_update_pm(struct wfx_vif *wvif)
200 struct ieee80211_vif *vif = wvif_to_vif(wvif);
206 ps_timeout = wfx_get_ps_timeout(wvif, &ps);
210 if (wvif->uapsd_mask)
213 if (!wait_for_completion_timeout(&wvif->set_pm_mode_complete, TU_TO_JIFFIES(512)))
214 dev_warn(wvif->wdev->dev, "timeout while waiting of set_pm_mode_complete\n");
215 return wfx_hif_set_pm(wvif, ps, ps_timeout);
223 struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
224 int old_uapsd = wvif->uapsd_mask;
229 assign_bit(queue, &wvif->uapsd_mask, params->uapsd);
230 wfx_hif_set_edca_queue_params(wvif, queue, params);
232 old_uapsd != wvif->uapsd_mask) {
233 wfx_hif_set_uapsd_info(wvif, wvif->uapsd_mask);
234 wfx_update_pm(wvif);
243 struct wfx_vif *wvif = NULL;
245 while ((wvif = wvif_iterate(wdev, wvif)) != NULL)
246 wfx_hif_rts_threshold(wvif, value);
250 void wfx_event_report_rssi(struct wfx_vif *wvif, u8 raw_rcpi_rssi)
255 struct ieee80211_vif *vif = wvif_to_vif(wvif);
269 struct wfx_vif *wvif = container_of(to_delayed_work(work), struct wfx_vif,
271 struct ieee80211_vif *vif = wvif_to_vif(wvif);
280 struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
282 wfx_hif_wep_default_key_id(wvif, idx);
285 void wfx_reset(struct wfx_vif *wvif)
287 struct wfx_dev *wdev = wvif->wdev;
290 wfx_hif_reset(wvif, false);
291 wfx_tx_policy_init(wvif);
293 wfx_hif_set_block_ack_policy(wvif, 0xFF, 0xFF);
295 wvif->join_in_progress = false;
296 cancel_delayed_work_sync(&wvif->beacon_loss_work);
297 wvif = NULL;
298 while ((wvif = wvif_iterate(wdev, wvif)) != NULL)
299 wfx_update_pm(wvif);
304 struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
307 sta_priv->vif_id = wvif->id;
310 wfx_hif_set_mfp(wvif, sta->mfp, sta->mfp);
315 sta_priv->link_id = ffz(wvif->link_id_map);
316 wvif->link_id_map |= BIT(sta_priv->link_id);
319 wfx_hif_map_link(wvif, false, sta->addr, sta_priv->link_id, sta->mfp);
326 struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
333 wfx_hif_map_link(wvif, true, sta->addr, sta_priv->link_id, false);
334 wvif->link_id_map &= ~BIT(sta_priv->link_id);
338 static int wfx_upload_ap_templates(struct wfx_vif *wvif)
340 struct ieee80211_vif *vif = wvif_to_vif(wvif);
343 skb = ieee80211_beacon_get(wvif->wdev->hw, vif, 0);
346 wfx_hif_set_template_frame(wvif, skb, HIF_TMPLT_BCN, API_RATE_INDEX_B_1MBPS);
349 skb = ieee80211_proberesp_get(wvif->wdev->hw, vif);
352 wfx_hif_set_template_frame(wvif, skb, HIF_TMPLT_PRBRES, API_RATE_INDEX_B_1MBPS);
357 static int wfx_set_mfp_ap(struct wfx_vif *wvif)
359 struct ieee80211_vif *vif = wvif_to_vif(wvif);
360 struct sk_buff *skb = ieee80211_beacon_get(wvif->wdev->hw, vif, 0);
388 wfx_hif_set_mfp(wvif, *ptr & BIT(7), *ptr & BIT(6));
399 struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
400 struct wfx_dev *wdev = wvif->wdev;
403 wvif = NULL;
404 while ((wvif = wvif_iterate(wdev, wvif)) != NULL)
405 wfx_update_pm(wvif);
406 wvif = (struct wfx_vif *)vif->drv_priv;
407 wfx_upload_ap_templates(wvif);
408 ret = wfx_hif_start(wvif, &vif->bss_conf, wvif->channel);
411 return wfx_set_mfp_ap(wvif);
417 struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
419 wfx_reset(wvif);
422 static void wfx_join(struct wfx_vif *wvif)
424 struct ieee80211_vif *vif = wvif_to_vif(wvif);
432 wfx_tx_lock_flush(wvif->wdev);
434 bss = cfg80211_get_bss(wvif->wdev->hw->wiphy, wvif->channel, conf->bssid, NULL, 0,
437 wfx_tx_unlock(wvif->wdev);
452 cfg80211_put_bss(wvif->wdev->hw->wiphy, bss);
454 wvif->join_in_progress = true;
455 ret = wfx_hif_join(wvif, conf, wvif->channel, ssid, ssid_len);
458 wfx_reset(wvif);
464 wfx_filter_beacon(wvif, false);
466 wfx_tx_unlock(wvif->wdev);
469 static void wfx_join_finalize(struct wfx_vif *wvif, struct ieee80211_bss_conf *info)
471 struct ieee80211_vif *vif = wvif_to_vif(wvif);
486 wvif->join_in_progress = false;
487 wfx_hif_set_association_mode(wvif, ampdu_density, greenfield, info->use_short_preamble);
488 wfx_hif_keep_alive_period(wvif, 0);
490 wfx_hif_set_bss_params(wvif, vif->cfg.aid, 7);
491 wfx_hif_set_beacon_wakeup_period(wvif, 1, 1);
492 wfx_update_pm(wvif);
497 struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
499 wfx_upload_ap_templates(wvif);
500 wfx_join(wvif);
506 struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
508 wfx_reset(wvif);
511 static void wfx_enable_beacon(struct wfx_vif *wvif, bool enable)
517 if (!enable && wfx_tx_queues_has_cab(wvif)) {
518 wvif->after_dtim_tx_allowed = true;
519 wfx_bh_request_tx(wvif->wdev);
521 wfx_hif_beacon_transmit(wvif, enable);
528 struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
537 wfx_join(wvif);
542 wfx_join_finalize(wvif, info);
544 wfx_reset(wvif);
552 wfx_hif_set_beacon_wakeup_period(wvif, info->dtim_period, info->dtim_period);
554 wfx_filter_beacon(wvif, true);
565 wfx_hif_set_arp_ipv4_filter(wvif, i, arp_addr);
570 wfx_upload_ap_templates(wvif);
573 wfx_enable_beacon(wvif, info->enable_beacon);
576 wfx_hif_keep_alive_period(wvif,
580 wfx_hif_erp_use_protection(wvif, info->use_cts_prot);
583 wfx_hif_slot_time(wvif, info->use_short_slot ? 9 : 20);
586 wfx_hif_set_rcpi_rssi_threshold(wvif, info->cqm_rssi_thold, info->cqm_rssi_hyst);
589 wfx_hif_set_output_power(wvif, info->txpower);
592 wfx_update_pm(wvif);
597 static int wfx_update_tim(struct wfx_vif *wvif)
599 struct ieee80211_vif *vif = wvif_to_vif(wvif);
604 skb = ieee80211_beacon_get_tim(wvif->wdev->hw, vif, &tim_offset,
615 if (wfx_tx_queues_has_cab(wvif))
621 wfx_hif_update_ie_beacon(wvif, tim_ptr, tim_length);
629 struct wfx_vif *wvif = container_of(work, struct wfx_vif, update_tim_work);
631 wfx_update_tim(wvif);
638 struct wfx_vif *wvif = wdev_to_wvif(wdev, sta_dev->vif_id);
640 if (!wvif) {
644 schedule_work(&wvif->update_tim_work);
648 void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd)
659 while ((wvif_it = wvif_iterate(wvif->wdev, wvif_it)) != NULL)
663 if (!wfx_tx_queues_has_cab(wvif) || wvif->after_dtim_tx_allowed)
664 dev_warn(wvif->wdev->dev, "incorrect sequence (%d CAB in queue)",
665 wfx_tx_queues_has_cab(wvif));
666 wvif->after_dtim_tx_allowed = true;
667 wfx_bh_request_tx(wvif->wdev);
702 struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
705 WARN(wvif->channel, "channel overwrite");
706 wvif->channel = ch;
715 struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
718 WARN(wvif->channel != ch, "channel mismatch");
719 wvif->channel = NULL;
731 struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
749 wvif->wdev = wdev;
751 wvif->link_id_map = 1; /* link-id 0 is reserved for multicast */
752 INIT_WORK(&wvif->update_tim_work, wfx_update_tim_work);
753 INIT_DELAYED_WORK(&wvif->beacon_loss_work, wfx_beacon_loss_work);
755 init_completion(&wvif->set_pm_mode_complete);
756 complete(&wvif->set_pm_mode_complete);
757 INIT_WORK(&wvif->tx_policy_upload_work, wfx_tx_policy_upload_work);
759 mutex_init(&wvif->scan_lock);
760 init_completion(&wvif->scan_complete);
761 INIT_WORK(&wvif->scan_work, wfx_hw_scan_work);
763 wfx_tx_queues_init(wvif);
764 wfx_tx_policy_init(wvif);
769 wvif->id = i;
775 wfx_hif_set_macaddr(wvif, vif->addr);
779 wvif = NULL;
780 while ((wvif = wvif_iterate(wdev, wvif)) != NULL) {
783 wfx_hif_set_block_ack_policy(wvif, 0xFF, 0xFF);
785 wfx_hif_set_block_ack_policy(wvif, 0x00, 0x00);
793 struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
795 wait_for_completion_timeout(&wvif->set_pm_mode_complete, msecs_to_jiffies(300));
796 wfx_tx_queues_check_empty(wvif);
799 WARN(wvif->link_id_map != 1, "corrupted state");
801 wfx_hif_reset(wvif, false);
802 wfx_hif_set_macaddr(wvif, NULL);
803 wfx_tx_policy_init(wvif);
805 cancel_delayed_work_sync(&wvif->beacon_loss_work);
806 wdev->vif[wvif->id] = NULL;
810 wvif = NULL;
811 while ((wvif = wvif_iterate(wdev, wvif)) != NULL) {
814 wfx_hif_set_block_ack_policy(wvif, 0xFF, 0xFF);
816 wfx_hif_set_block_ack_policy(wvif, 0x00, 0x00);