Lines Matching refs:wlvif
44 struct wl12xx_vif *wlvif, u8 id) in wl1271_set_default_wep_key() argument
47 bool is_ap = (wlvif->bss_type == BSS_TYPE_AP_BSS); in wl1271_set_default_wep_key()
51 wlvif->ap.bcast_hlid); in wl1271_set_default_wep_key()
53 ret = wl12xx_cmd_set_default_wep_key(wl, id, wlvif->sta.hlid); in wl1271_set_default_wep_key()
105 struct wl12xx_vif *wlvif, in wl1271_tx_regulate_link() argument
111 if (WARN_ON(!test_bit(hlid, wlvif->links_map))) in wl1271_tx_regulate_link()
129 wl12xx_ps_link_start(wl, wlvif, hlid, true); in wl1271_tx_regulate_link()
138 static u8 wl12xx_tx_get_hlid_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif, in wl12xx_tx_get_hlid_ap() argument
149 if (!test_bit(WLVIF_FLAG_AP_STARTED, &wlvif->flags)) in wl12xx_tx_get_hlid_ap()
154 return wlvif->ap.bcast_hlid; in wl12xx_tx_get_hlid_ap()
156 return wlvif->ap.global_hlid; in wl12xx_tx_get_hlid_ap()
160 u8 wl12xx_tx_get_hlid(struct wl1271 *wl, struct wl12xx_vif *wlvif, in wl12xx_tx_get_hlid() argument
165 if (wlvif->bss_type == BSS_TYPE_AP_BSS) in wl12xx_tx_get_hlid()
166 return wl12xx_tx_get_hlid_ap(wl, wlvif, skb, sta); in wl12xx_tx_get_hlid()
171 return wlvif->dev_hlid; in wl12xx_tx_get_hlid()
174 return wlvif->sta.hlid; in wl12xx_tx_get_hlid()
188 static int wl1271_tx_allocate(struct wl1271 *wl, struct wl12xx_vif *wlvif, in wl1271_tx_allocate() argument
244 static void wl1271_tx_fill_hdr(struct wl1271 *wl, struct wl12xx_vif *wlvif, in wl1271_tx_fill_hdr() argument
276 if (is_dummy || !wlvif || wlvif->bss_type != BSS_TYPE_AP_BSS) in wl1271_tx_fill_hdr()
295 } else if (wlvif) { in wl1271_tx_fill_hdr()
299 (wlvif->bss_type == BSS_TYPE_AP_BSS)) in wl1271_tx_fill_hdr()
307 if (is_dummy || !wlvif) in wl1271_tx_fill_hdr()
309 else if (wlvif->bss_type != BSS_TYPE_AP_BSS) { in wl1271_tx_fill_hdr()
316 rate_idx = wlvif->sta.basic_rate_idx; in wl1271_tx_fill_hdr()
318 rate_idx = wlvif->sta.p2p_rate_idx; in wl1271_tx_fill_hdr()
320 rate_idx = wlvif->sta.ap_rate_idx; in wl1271_tx_fill_hdr()
322 rate_idx = wlvif->sta.basic_rate_idx; in wl1271_tx_fill_hdr()
324 if (hlid == wlvif->ap.global_hlid) in wl1271_tx_fill_hdr()
325 rate_idx = wlvif->ap.mgmt_rate_idx; in wl1271_tx_fill_hdr()
326 else if (hlid == wlvif->ap.bcast_hlid || in wl1271_tx_fill_hdr()
333 rate_idx = wlvif->ap.bcast_rate_idx; in wl1271_tx_fill_hdr()
335 rate_idx = wlvif->ap.ucast_rate_idx[ac]; in wl1271_tx_fill_hdr()
352 static int wl1271_prepare_tx_frame(struct wl1271 *wl, struct wl12xx_vif *wlvif, in wl1271_prepare_tx_frame() argument
389 if (unlikely(is_wep && wlvif->default_key != idx)) { in wl1271_prepare_tx_frame()
390 ret = wl1271_set_default_wep_key(wl, wlvif, idx); in wl1271_prepare_tx_frame()
393 wlvif->default_key = idx; in wl1271_prepare_tx_frame()
399 ret = wl1271_tx_allocate(wl, wlvif, skb, extra, buf_offset, hlid, in wl1271_prepare_tx_frame()
404 wl1271_tx_fill_hdr(wl, wlvif, skb, extra, info, hlid); in wl1271_prepare_tx_frame()
406 if (!is_dummy && wlvif && wlvif->bss_type == BSS_TYPE_AP_BSS) { in wl1271_prepare_tx_frame()
408 wl1271_tx_regulate_link(wl, wlvif, hlid); in wl1271_prepare_tx_frame()
460 struct wl12xx_vif *wlvif; in wl1271_handle_tx_low_watermark() local
462 wl12xx_for_each_wlvif(wl, wlvif) { in wl1271_handle_tx_low_watermark()
464 if (wlcore_is_queue_stopped_by_reason(wl, wlvif, i, in wl1271_handle_tx_low_watermark()
466 wlvif->tx_queue_count[i] <= in wl1271_handle_tx_low_watermark()
469 wlcore_wake_queue(wl, wlvif, i, in wl1271_handle_tx_low_watermark()
510 if (lnk->wlvif) { in wlcore_lnk_dequeue()
511 WARN_ON_ONCE(lnk->wlvif->tx_queue_count[q] <= 0); in wlcore_lnk_dequeue()
512 lnk->wlvif->tx_queue_count[q]--; in wlcore_lnk_dequeue()
540 struct wl12xx_vif *wlvif, in wlcore_vif_dequeue_high_prio() argument
548 start_hlid = (wlvif->last_tx_hlid + 1) % WL12XX_MAX_LINKS; in wlcore_vif_dequeue_high_prio()
555 if (!test_bit(h, wlvif->links_map)) in wlcore_vif_dequeue_high_prio()
563 wlvif->last_tx_hlid = h; in wlcore_vif_dequeue_high_prio()
568 wlvif->last_tx_hlid = 0; in wlcore_vif_dequeue_high_prio()
570 *hlid = wlvif->last_tx_hlid; in wlcore_vif_dequeue_high_prio()
577 struct wl12xx_vif *wlvif = wl->last_wlvif; in wl1271_skb_dequeue() local
587 if (wlvif) { in wl1271_skb_dequeue()
588 wl12xx_for_each_wlvif_continue(wl, wlvif) { in wl1271_skb_dequeue()
589 if (!wlvif->tx_queue_count[ac]) in wl1271_skb_dequeue()
592 skb = wlcore_vif_dequeue_high_prio(wl, wlvif, ac, hlid, in wl1271_skb_dequeue()
597 wl->last_wlvif = wlvif; in wl1271_skb_dequeue()
615 wl12xx_for_each_wlvif(wl, wlvif) { in wl1271_skb_dequeue()
616 if (!wlvif->tx_queue_count[ac]) in wl1271_skb_dequeue()
619 skb = wlcore_vif_dequeue_high_prio(wl, wlvif, ac, hlid, in wl1271_skb_dequeue()
622 wl->last_wlvif = wlvif; in wl1271_skb_dequeue()
627 if (wlvif == wl->last_wlvif) in wl1271_skb_dequeue()
641 wl->last_wlvif = lnk->wlvif; in wl1271_skb_dequeue()
642 if (lnk->wlvif) in wl1271_skb_dequeue()
643 lnk->wlvif->last_tx_hlid = low_prio_hlid; in wl1271_skb_dequeue()
664 static void wl1271_skb_queue_head(struct wl1271 *wl, struct wl12xx_vif *wlvif, in wl1271_skb_queue_head() argument
676 wlvif->last_tx_hlid = (hlid + WL12XX_MAX_LINKS - 1) % in wl1271_skb_queue_head()
682 if (wlvif) in wl1271_skb_queue_head()
683 wlvif->tx_queue_count[q]++; in wl1271_skb_queue_head()
696 struct wl12xx_vif *wlvif; in wl12xx_rearm_rx_streaming() local
708 wl12xx_for_each_wlvif_sta(wl, wlvif) { in wl12xx_rearm_rx_streaming()
711 if (test_bit(hlid, wlvif->links_map)) { in wl12xx_rearm_rx_streaming()
721 if (!test_bit(WLVIF_FLAG_RX_STREAMING_STARTED, &wlvif->flags)) in wl12xx_rearm_rx_streaming()
723 &wlvif->rx_streaming_enable_work); in wl12xx_rearm_rx_streaming()
725 mod_timer(&wlvif->rx_streaming_timer, in wl12xx_rearm_rx_streaming()
742 struct wl12xx_vif *wlvif; in wlcore_tx_work_locked() local
759 wlvif = NULL; in wlcore_tx_work_locked()
761 wlvif = wl12xx_vif_to_data(info->control.vif); in wlcore_tx_work_locked()
765 has_data = wlvif && wl1271_tx_is_data_present(skb); in wlcore_tx_work_locked()
766 ret = wl1271_prepare_tx_frame(wl, wlvif, skb, buf_offset, in wlcore_tx_work_locked()
773 wl1271_skb_queue_head(wl, wlvif, skb, hlid); in wlcore_tx_work_locked()
790 wl1271_skb_queue_head(wl, wlvif, skb, hlid); in wlcore_tx_work_locked()
800 wl1271_skb_queue_head(wl, wlvif, skb, hlid); in wlcore_tx_work_locked()
891 struct wl12xx_vif *wlvif; in wl1271_tx_complete_packet() local
914 wlvif = wl12xx_vif_to_data(vif); in wl1271_tx_complete_packet()
921 wlvif->band); in wl1271_tx_complete_packet()
1035 if (lnk->wlvif) in wl1271_tx_reset_link_queues()
1036 lnk->wlvif->tx_queue_count[i] -= total[i]; in wl1271_tx_reset_link_queues()
1044 void wl12xx_tx_reset_wlvif(struct wl1271 *wl, struct wl12xx_vif *wlvif) in wl12xx_tx_reset_wlvif() argument
1049 for_each_set_bit(i, wlvif->links_map, WL12XX_MAX_LINKS) { in wl12xx_tx_reset_wlvif()
1050 if (wlvif->bss_type == BSS_TYPE_AP_BSS && in wl12xx_tx_reset_wlvif()
1051 i != wlvif->ap.bcast_hlid && i != wlvif->ap.global_hlid) { in wl12xx_tx_reset_wlvif()
1053 wl1271_free_sta(wl, wlvif, i); in wl12xx_tx_reset_wlvif()
1056 wl12xx_free_link(wl, wlvif, &hlid); in wl12xx_tx_reset_wlvif()
1059 wlvif->last_tx_hlid = 0; in wl12xx_tx_reset_wlvif()
1062 wlvif->tx_queue_count[i] = 0; in wl12xx_tx_reset_wlvif()
1186 void wlcore_stop_queue_locked(struct wl1271 *wl, struct wl12xx_vif *wlvif, in wlcore_stop_queue_locked() argument
1189 int hwq = wlcore_tx_get_mac80211_queue(wlvif, queue); in wlcore_stop_queue_locked()
1201 void wlcore_stop_queue(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 queue, in wlcore_stop_queue() argument
1207 wlcore_stop_queue_locked(wl, wlvif, queue, reason); in wlcore_stop_queue()
1211 void wlcore_wake_queue(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 queue, in wlcore_wake_queue() argument
1215 int hwq = wlcore_tx_get_mac80211_queue(wlvif, queue); in wlcore_wake_queue()
1274 struct wl12xx_vif *wlvif, u8 queue, in wlcore_is_queue_stopped_by_reason() argument
1281 stopped = wlcore_is_queue_stopped_by_reason_locked(wl, wlvif, queue, in wlcore_is_queue_stopped_by_reason()
1289 struct wl12xx_vif *wlvif, u8 queue, in wlcore_is_queue_stopped_by_reason_locked() argument
1292 int hwq = wlcore_tx_get_mac80211_queue(wlvif, queue); in wlcore_is_queue_stopped_by_reason_locked()
1298 bool wlcore_is_queue_stopped_locked(struct wl1271 *wl, struct wl12xx_vif *wlvif, in wlcore_is_queue_stopped_locked() argument
1301 int hwq = wlcore_tx_get_mac80211_queue(wlvif, queue); in wlcore_is_queue_stopped_locked()