static inline int htt_tx_send_base(htt_pdev_handle pdev, cdf_nbuf_t msdu, uint16_t msdu_id, int download_len, uint8_t more_data) { struct htt_host_tx_desc_t *htt_host_tx_desc; struct htt_htc_pkt *pkt; int packet_len; HTC_ENDPOINT_ID ep_id; /* * The HTT tx descriptor was attached as the prefix fragment to the * msdu netbuf during the call to htt_tx_desc_init. * Retrieve it so we can provide its HTC header space to HTC. */ htt_host_tx_desc = (struct htt_host_tx_desc_t *) cdf_nbuf_get_frag_vaddr(msdu, 0); pkt = htt_htc_pkt_alloc(pdev); if (!pkt) return -ENOBUFS; /* failure */ pkt->msdu_id = msdu_id; pkt->pdev_ctxt = pdev->txrx_pdev; /* packet length includes HTT tx desc frag added above */ packet_len = cdf_nbuf_len(msdu); if (packet_len < download_len) { /* * This case of packet length being less than the nominal * download length can happen for a couple reasons: * In HL, the nominal download length is a large artificial * value. * In LL, the frame may not have the optional header fields * accounted for in the nominal download size (LLC/SNAP header, * IPv4 or IPv6 header). */ download_len = packet_len; } ep_id = htt_tx_htt2_get_ep_id(pdev, msdu); SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt, pdev->tx_send_complete_part2, (unsigned char *)htt_host_tx_desc, download_len - HTC_HDR_LENGTH, ep_id, 1); /* tag - not relevant here */ SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msdu); cdf_nbuf_trace_update(msdu, "HT:T:"); NBUF_UPDATE_TX_PKT_COUNT(msdu, NBUF_TX_PKT_HTT); DPTRACE(cdf_dp_trace(msdu, CDF_DP_TRACE_HTT_PACKET_PTR_RECORD, (uint8_t *)(cdf_nbuf_data(msdu)), sizeof(cdf_nbuf_data(msdu)))); htc_send_data_pkt(pdev->htc_pdev, &pkt->htc_pkt, more_data); return 0; /* success */ }
/** * adf_log_arp_pkt() - log ARP packet * @session_id: vdev_id * @skb: skb pointer * @dir: direction * * Return: true/false */ bool adf_log_arp_pkt(uint8_t session_id, struct sk_buff *skb, enum adf_proto_dir dir) { enum adf_proto_subtype proto_subtype; if ((adf_dp_get_proto_bitmap() & NBUF_PKT_TRAC_TYPE_ARP) && ((dir == ADF_TX && ADF_NBUF_GET_IS_ARP(skb)) || (dir == ADF_RX && adf_nbuf_is_ipv4_arp_pkt(skb)))){ proto_subtype = adf_nbuf_get_arp_subtype(skb); DPTRACE(adf_dp_trace_proto_pkt(ADF_DP_TRACE_ARP_PACKET_RECORD, session_id, (skb->data + ADF_NBUF_SRC_MAC_OFFSET), (skb->data + ADF_NBUF_DEST_MAC_OFFSET), ADF_PROTO_TYPE_ARP, proto_subtype, dir)); if (ADF_TX == dir) ADF_NBUF_CB_TX_DP_TRACE(skb) = 1; else if (ADF_RX == dir) ADF_NBUF_CB_RX_DP_TRACE(skb) = 1; return true; } return false; }
int htt_tx_send_std(htt_pdev_handle pdev, cdf_nbuf_t msdu, uint16_t msdu_id) { int download_len = pdev->download_len; int packet_len; /* packet length includes HTT tx desc frag added above */ packet_len = cdf_nbuf_len(msdu); if (packet_len < download_len) { /* * This case of packet length being less than the nominal * download length can happen for a couple of reasons: * In HL, the nominal download length is a large artificial * value. * In LL, the frame may not have the optional header fields * accounted for in the nominal download size (LLC/SNAP header, * IPv4 or IPv6 header). */ download_len = packet_len; } NBUF_UPDATE_TX_PKT_COUNT(msdu, NBUF_TX_PKT_HTT); DPTRACE(cdf_dp_trace(msdu, CDF_DP_TRACE_HTT_PACKET_PTR_RECORD, (uint8_t *)(cdf_nbuf_data(msdu)), sizeof(cdf_nbuf_data(msdu)))); if (cdf_nbuf_queue_len(&pdev->txnbufq) > 0) { HTT_TX_NBUF_QUEUE_ADD(pdev, msdu); htt_tx_sched(pdev); return 0; } cdf_nbuf_trace_update(msdu, "HT:T:"); if (htc_send_data_pkt (pdev->htc_pdev, msdu, pdev->htc_endpoint, download_len)) { HTT_TX_NBUF_QUEUE_ADD(pdev, msdu); } return 0; /* success */ }