Lines Matching defs:hif

29 		if (!completion_done(&wdev->hif.ctrl_ready))
38 if (wait_for_completion_timeout(&wdev->hif.ctrl_ready, msecs_to_jiffies(2))) {
39 complete(&wdev->hif.ctrl_ready);
66 struct wfx_hif_msg *hif;
86 hif = (struct wfx_hif_msg *)skb->data;
87 WARN(hif->encrypted & 0x3, "encryption is unsupported");
90 computed_len = le16_to_cpu(hif->len);
95 print_hex_dump(KERN_INFO, "hif: ", DUMP_PREFIX_OFFSET, 16, 1,
96 hif, read_len, true);
100 if (!(hif->id & HIF_ID_IS_INDICATION)) {
102 if (hif->id == HIF_CNF_ID_MULTI_TRANSMIT)
104 ((struct wfx_hif_cnf_multi_transmit *)hif->body)->num_tx_confs;
107 WARN(wdev->hif.tx_buffers_used < release_count, "corrupted buffer counter");
108 wdev->hif.tx_buffers_used -= release_count;
110 _trace_hif_recv(hif, wdev->hif.tx_buffers_used);
112 if (hif->id != HIF_IND_ID_EXCEPTION && hif->id != HIF_IND_ID_ERROR) {
113 if (hif->seqnum != wdev->hif.rx_seqnum)
115 hif->seqnum, wdev->hif.rx_seqnum);
116 wdev->hif.rx_seqnum = (hif->seqnum + 1) % (HIF_COUNTER_MAX + 1);
119 skb_put(skb, le16_to_cpu(hif->len));
122 if (!wdev->hif.tx_buffers_used)
123 wake_up(&wdev->hif.tx_buffers_empty);
143 else if (try_wait_for_completion(&wdev->hif.ctrl_ready))
144 ctrl_reg = atomic_xchg(&wdev->hif.ctrl_reg, 0);
159 ctrl_reg = atomic_xchg(&wdev->hif.ctrl_reg, piggyback);
160 complete(&wdev->hif.ctrl_ready);
168 static void tx_helper(struct wfx_dev *wdev, struct wfx_hif_msg *hif)
173 size_t len = le16_to_cpu(hif->len);
175 WARN(len < sizeof(*hif), "try to send corrupted data");
177 hif->seqnum = wdev->hif.tx_seqnum;
178 wdev->hif.tx_seqnum = (wdev->hif.tx_seqnum + 1) % (HIF_COUNTER_MAX + 1);
180 data = hif;
189 wdev->hif.tx_buffers_used++;
190 _trace_hif_send(hif, wdev->hif.tx_buffers_used);
198 struct wfx_hif_msg *hif;
202 hif = NULL;
203 if (wdev->hif.tx_buffers_used < le16_to_cpu(wdev->hw_caps.num_inp_ch_bufs)) {
206 hif = wdev->hif_cmd.buf_send;
208 hif = wfx_tx_queues_get(wdev);
211 if (!hif)
213 tx_helper(wdev, hif);
235 struct wfx_dev *wdev = container_of(work, struct wfx_dev, hif.bh);
255 if (!wdev->hif.tx_buffers_used && !work_pending(work)) {
259 _trace_bh_stats(stats_ind, stats_req, stats_cnf, wdev->hif.tx_buffers_used, release_chip);
268 prev = atomic_xchg(&wdev->hif.ctrl_reg, cur);
269 complete(&wdev->hif.ctrl_ready);
270 queue_work(wdev->bh_wq, &wdev->hif.bh);
283 queue_work(wdev->bh_wq, &wdev->hif.bh);
316 INIT_WORK(&wdev->hif.bh, bh_work);
317 init_completion(&wdev->hif.ctrl_ready);
318 init_waitqueue_head(&wdev->hif.tx_buffers_empty);
323 flush_work(&wdev->hif.bh);