Lines Matching refs:wdev
17 void wfx_tx_lock(struct wfx_dev *wdev) in wfx_tx_lock() argument
19 atomic_inc(&wdev->tx_lock); in wfx_tx_lock()
22 void wfx_tx_unlock(struct wfx_dev *wdev) in wfx_tx_unlock() argument
24 int tx_lock = atomic_dec_return(&wdev->tx_lock); in wfx_tx_unlock()
28 wfx_bh_request_tx(wdev); in wfx_tx_unlock()
31 void wfx_tx_flush(struct wfx_dev *wdev) in wfx_tx_flush() argument
36 if (wdev->chip_frozen) in wfx_tx_flush()
39 wfx_tx_lock(wdev); in wfx_tx_flush()
40 mutex_lock(&wdev->hif_cmd.lock); in wfx_tx_flush()
41 ret = wait_event_timeout(wdev->hif.tx_buffers_empty, !wdev->hif.tx_buffers_used, in wfx_tx_flush()
44 dev_warn(wdev->dev, "cannot flush tx buffers (%d still busy)\n", in wfx_tx_flush()
45 wdev->hif.tx_buffers_used); in wfx_tx_flush()
46 wfx_pending_dump_old_frames(wdev, 3000); in wfx_tx_flush()
48 wdev->chip_frozen = true; in wfx_tx_flush()
50 mutex_unlock(&wdev->hif_cmd.lock); in wfx_tx_flush()
51 wfx_tx_unlock(wdev); in wfx_tx_flush()
54 void wfx_tx_lock_flush(struct wfx_dev *wdev) in wfx_tx_lock_flush() argument
56 wfx_tx_lock(wdev); in wfx_tx_lock_flush()
57 wfx_tx_flush(wdev); in wfx_tx_lock_flush()
112 wake_up(&wvif->wdev->tx_dequeue); in wfx_tx_queue_drop()
128 void wfx_pending_drop(struct wfx_dev *wdev, struct sk_buff_head *dropped) in wfx_pending_drop() argument
134 WARN(!wdev->chip_frozen, "%s should only be used to recover a frozen device", __func__); in wfx_pending_drop()
135 while ((skb = skb_dequeue(&wdev->tx_pending)) != NULL) { in wfx_pending_drop()
136 wvif = wfx_skb_wvif(wdev, skb); in wfx_pending_drop()
147 struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id) in wfx_pending_get() argument
155 spin_lock_bh(&wdev->tx_pending.lock); in wfx_pending_get()
156 skb_queue_walk(&wdev->tx_pending, skb) { in wfx_pending_get()
161 spin_unlock_bh(&wdev->tx_pending.lock); in wfx_pending_get()
162 wvif = wfx_skb_wvif(wdev, skb); in wfx_pending_get()
169 skb_unlink(skb, &wdev->tx_pending); in wfx_pending_get()
172 spin_unlock_bh(&wdev->tx_pending.lock); in wfx_pending_get()
177 void wfx_pending_dump_old_frames(struct wfx_dev *wdev, unsigned int limit_ms) in wfx_pending_dump_old_frames() argument
185 spin_lock_bh(&wdev->tx_pending.lock); in wfx_pending_dump_old_frames()
186 skb_queue_walk(&wdev->tx_pending, skb) { in wfx_pending_dump_old_frames()
191 dev_info(wdev->dev, "frames stuck in firmware since %dms or more:\n", in wfx_pending_dump_old_frames()
195 dev_info(wdev->dev, " id %08x sent %lldms ago\n", in wfx_pending_dump_old_frames()
199 spin_unlock_bh(&wdev->tx_pending.lock); in wfx_pending_dump_old_frames()
202 unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, struct sk_buff *skb) in wfx_pending_get_pkt_us_delay() argument
231 static struct sk_buff *wfx_tx_queues_get_skb(struct wfx_dev *wdev) in wfx_tx_queues_get_skb() argument
233 struct wfx_queue *queues[IEEE80211_NUM_ACS * ARRAY_SIZE(wdev->vif)]; in wfx_tx_queues_get_skb()
241 while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { in wfx_tx_queues_get_skb()
254 while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { in wfx_tx_queues_get_skb()
265 trace_queues_stats(wdev, queues[i]); in wfx_tx_queues_get_skb()
270 if (mutex_is_locked(&wdev->scan_lock)) in wfx_tx_queues_get_skb()
274 while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { in wfx_tx_queues_get_skb()
288 trace_queues_stats(wdev, queues[i]); in wfx_tx_queues_get_skb()
300 trace_queues_stats(wdev, queues[i]); in wfx_tx_queues_get_skb()
307 struct wfx_hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) in wfx_tx_queues_get() argument
312 if (atomic_read(&wdev->tx_lock)) in wfx_tx_queues_get()
314 skb = wfx_tx_queues_get_skb(wdev); in wfx_tx_queues_get()
317 skb_queue_tail(&wdev->tx_pending, skb); in wfx_tx_queues_get()
318 wake_up(&wdev->tx_dequeue); in wfx_tx_queues_get()