Lines Matching refs:skb
37 struct sk_buff *skb) in ath10k_htc_control_tx_complete() argument
39 kfree_skb(skb); in ath10k_htc_control_tx_complete()
44 struct sk_buff *skb; in ath10k_htc_build_tx_ctrl_skb() local
47 skb = dev_alloc_skb(ATH10K_HTC_CONTROL_BUFFER_SIZE); in ath10k_htc_build_tx_ctrl_skb()
48 if (!skb) in ath10k_htc_build_tx_ctrl_skb()
51 skb_reserve(skb, 20); /* FIXME: why 20 bytes? */ in ath10k_htc_build_tx_ctrl_skb()
52 WARN_ONCE((unsigned long)skb->data & 3, "unaligned skb"); in ath10k_htc_build_tx_ctrl_skb()
54 skb_cb = ATH10K_SKB_CB(skb); in ath10k_htc_build_tx_ctrl_skb()
57 ath10k_dbg(ar, ATH10K_DBG_HTC, "%s: skb %p\n", __func__, skb); in ath10k_htc_build_tx_ctrl_skb()
58 return skb; in ath10k_htc_build_tx_ctrl_skb()
62 struct sk_buff *skb) in ath10k_htc_restore_tx_skb() argument
64 struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb); in ath10k_htc_restore_tx_skb()
66 dma_unmap_single(htc->ar->dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE); in ath10k_htc_restore_tx_skb()
67 skb_pull(skb, sizeof(struct ath10k_htc_hdr)); in ath10k_htc_restore_tx_skb()
71 struct sk_buff *skb) in ath10k_htc_notify_tx_completion() argument
76 ep->eid, skb); in ath10k_htc_notify_tx_completion()
78 ath10k_htc_restore_tx_skb(ep->htc, skb); in ath10k_htc_notify_tx_completion()
82 dev_kfree_skb_any(skb); in ath10k_htc_notify_tx_completion()
86 ep->ep_ops.ep_tx_complete(ep->htc->ar, skb); in ath10k_htc_notify_tx_completion()
105 struct sk_buff *skb) in ath10k_htc_prepare_tx_skb() argument
109 hdr = (struct ath10k_htc_hdr *)skb->data; in ath10k_htc_prepare_tx_skb()
112 hdr->len = __cpu_to_le16(skb->len - sizeof(*hdr)); in ath10k_htc_prepare_tx_skb()
126 struct sk_buff *skb) in ath10k_htc_send() argument
130 struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb); in ath10k_htc_send()
144 skb_push(skb, sizeof(struct ath10k_htc_hdr)); in ath10k_htc_send()
147 credits = DIV_ROUND_UP(skb->len, htc->target_credit_size); in ath10k_htc_send()
161 ath10k_htc_prepare_tx_skb(ep, skb); in ath10k_htc_send()
164 skb_cb->paddr = dma_map_single(dev, skb->data, skb->len, DMA_TO_DEVICE); in ath10k_htc_send()
172 sg_item.transfer_context = skb; in ath10k_htc_send()
173 sg_item.vaddr = skb->data; in ath10k_htc_send()
175 sg_item.len = skb->len; in ath10k_htc_send()
184 dma_unmap_single(dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE); in ath10k_htc_send()
198 skb_pull(skb, sizeof(struct ath10k_htc_hdr)); in ath10k_htc_send()
203 struct sk_buff *skb) in ath10k_htc_tx_completion_handler() argument
209 if (WARN_ON_ONCE(!skb)) in ath10k_htc_tx_completion_handler()
212 skb_cb = ATH10K_SKB_CB(skb); in ath10k_htc_tx_completion_handler()
215 ath10k_htc_notify_tx_completion(ep, skb); in ath10k_htc_tx_completion_handler()
326 struct sk_buff *skb) in ath10k_htc_rx_completion_handler() argument
338 hdr = (struct ath10k_htc_hdr *)skb->data; in ath10k_htc_rx_completion_handler()
339 skb_pull(skb, sizeof(*hdr)); in ath10k_htc_rx_completion_handler()
373 if (skb->len < payload_len) { in ath10k_htc_rx_completion_handler()
376 skb->len, payload_len); in ath10k_htc_rx_completion_handler()
408 skb_trim(skb, skb->len - trailer_len); in ath10k_htc_rx_completion_handler()
416 struct ath10k_htc_msg *msg = (struct ath10k_htc_msg *)skb->data; in ath10k_htc_rx_completion_handler()
433 min_t(int, skb->len, in ath10k_htc_rx_completion_handler()
436 memcpy(htc->control_resp_buffer, skb->data, in ath10k_htc_rx_completion_handler()
448 eid, skb); in ath10k_htc_rx_completion_handler()
449 ep->ep_ops.ep_rx_complete(ar, skb); in ath10k_htc_rx_completion_handler()
452 skb = NULL; in ath10k_htc_rx_completion_handler()
454 kfree_skb(skb); in ath10k_htc_rx_completion_handler()
460 struct sk_buff *skb) in ath10k_htc_control_rx_complete() argument
465 kfree_skb(skb); in ath10k_htc_control_rx_complete()
648 struct sk_buff *skb; in ath10k_htc_connect_service() local
671 skb = ath10k_htc_build_tx_ctrl_skb(htc->ar); in ath10k_htc_connect_service()
672 if (!skb) { in ath10k_htc_connect_service()
678 skb_put(skb, length); in ath10k_htc_connect_service()
679 memset(skb->data, 0, length); in ath10k_htc_connect_service()
681 msg = (struct ath10k_htc_msg *)skb->data; in ath10k_htc_connect_service()
699 status = ath10k_htc_send(htc, ATH10K_HTC_EP_0, skb); in ath10k_htc_connect_service()
701 kfree_skb(skb); in ath10k_htc_connect_service()
807 struct sk_buff *skb; in ath10k_htc_alloc_skb() local
809 skb = dev_alloc_skb(size + sizeof(struct ath10k_htc_hdr)); in ath10k_htc_alloc_skb()
810 if (!skb) in ath10k_htc_alloc_skb()
813 skb_reserve(skb, sizeof(struct ath10k_htc_hdr)); in ath10k_htc_alloc_skb()
816 if (!IS_ALIGNED((unsigned long)skb->data, 4)) in ath10k_htc_alloc_skb()
819 return skb; in ath10k_htc_alloc_skb()
825 struct sk_buff *skb; in ath10k_htc_start() local
829 skb = ath10k_htc_build_tx_ctrl_skb(htc->ar); in ath10k_htc_start()
830 if (!skb) in ath10k_htc_start()
833 skb_put(skb, sizeof(msg->hdr) + sizeof(msg->setup_complete_ext)); in ath10k_htc_start()
834 memset(skb->data, 0, skb->len); in ath10k_htc_start()
836 msg = (struct ath10k_htc_msg *)skb->data; in ath10k_htc_start()
842 status = ath10k_htc_send(htc, ATH10K_HTC_EP_0, skb); in ath10k_htc_start()
844 kfree_skb(skb); in ath10k_htc_start()