Lines Matching refs:wdev

17 void wfx_tx_lock(struct wfx_dev *wdev)
19 atomic_inc(&wdev->tx_lock);
22 void wfx_tx_unlock(struct wfx_dev *wdev)
24 int tx_lock = atomic_dec_return(&wdev->tx_lock);
28 wfx_bh_request_tx(wdev);
31 void wfx_tx_flush(struct wfx_dev *wdev)
36 if (wdev->chip_frozen)
39 wfx_tx_lock(wdev);
40 mutex_lock(&wdev->hif_cmd.lock);
41 ret = wait_event_timeout(wdev->hif.tx_buffers_empty, !wdev->hif.tx_buffers_used,
44 dev_warn(wdev->dev, "cannot flush tx buffers (%d still busy)\n",
45 wdev->hif.tx_buffers_used);
46 wfx_pending_dump_old_frames(wdev, 3000);
48 wdev->chip_frozen = true;
50 mutex_unlock(&wdev->hif_cmd.lock);
51 wfx_tx_unlock(wdev);
54 void wfx_tx_lock_flush(struct wfx_dev *wdev)
56 wfx_tx_lock(wdev);
57 wfx_tx_flush(wdev);
108 wake_up(&wvif->wdev->tx_dequeue);
122 void wfx_pending_drop(struct wfx_dev *wdev, struct sk_buff_head *dropped)
129 WARN(!wdev->chip_frozen, "%s should only be used to recover a frozen device", __func__);
130 while ((skb = skb_dequeue(&wdev->tx_pending)) != NULL) {
132 wvif = wdev_to_wvif(wdev, hif->interface);
143 struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id)
151 spin_lock_bh(&wdev->tx_pending.lock);
152 skb_queue_walk(&wdev->tx_pending, skb) {
157 spin_unlock_bh(&wdev->tx_pending.lock);
158 wvif = wdev_to_wvif(wdev, hif->interface);
165 skb_unlink(skb, &wdev->tx_pending);
168 spin_unlock_bh(&wdev->tx_pending.lock);
173 void wfx_pending_dump_old_frames(struct wfx_dev *wdev, unsigned int limit_ms)
181 spin_lock_bh(&wdev->tx_pending.lock);
182 skb_queue_walk(&wdev->tx_pending, skb) {
187 dev_info(wdev->dev, "frames stuck in firmware since %dms or more:\n",
191 dev_info(wdev->dev, " id %08x sent %lldms ago\n",
195 spin_unlock_bh(&wdev->tx_pending.lock);
198 unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, struct sk_buff *skb)
227 static struct sk_buff *wfx_tx_queues_get_skb(struct wfx_dev *wdev)
229 struct wfx_queue *queues[IEEE80211_NUM_ACS * ARRAY_SIZE(wdev->vif)];
237 while ((wvif = wvif_iterate(wdev, wvif)) != NULL) {
250 while ((wvif = wvif_iterate(wdev, wvif)) != NULL) {
264 trace_queues_stats(wdev, queues[i]);
276 trace_queues_stats(wdev, queues[i]);
283 struct wfx_hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev)
288 if (atomic_read(&wdev->tx_lock))
290 skb = wfx_tx_queues_get_skb(wdev);
293 skb_queue_tail(&wdev->tx_pending, skb);
294 wake_up(&wdev->tx_dequeue);