Jelajahi Sumber

qcacld-3.0: Pull head from skb in monitor mode to make a room for rtap

Some of the platforms delivers the msdu with skb head and skb data
pointing to same address, in such cases do skb pull to create a room
for radiotap hdr and let qdf_nbuf_update_radiotap() API handle creating
room for radiotap header.

Note: When skb head and skb data pointer points to same
address, it indicates that radiotap size is already considered in
headroom.

CRs-Fixed: 2230412
Change-Id: Ide49544873554ae38a49af1511fd5bafd0d25102
Krunal Soni 7 tahun lalu
induk
melakukan
e23c41a517
1 mengubah file dengan 33 tambahan dan 2 penghapusan
  1. 33 2
      core/dp/htt/htt_rx.c

+ 33 - 2
core/dp/htt/htt_rx.c

@@ -2314,9 +2314,40 @@ static int htt_rx_mon_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev,
 		 */
 		htt_rx_mon_get_rx_status(pdev, rx_desc, &rx_status);
 		/*
-		 * 350 bytes of RX_STD_DESC size should be sufficient for
-		 * radiotap.
+		 * For certain platform, 350 bytes of headroom is already
+		 * appended to accomodate radiotap header but
+		 * qdf_nbuf_update_radiotap() API again will try to create
+		 * a room for radiotap header. To make our design simple
+		 * let qdf_nbuf_update_radiotap() API create a room for radiotap
+		 * header and update it, do qdf_nbuf_pull_head() operation and
+		 * pull 350 bytes of headroom.
+		 *
+		 *
+		 *
+		 *               (SKB buffer)
+		 * skb->head --> +-----------+ <-- skb->data
+		 *               |           |     (Before pulling headroom)
+		 *               |           |
+		 *               |   HEAD    |  350 bytes of headroom
+		 *               |           |
+		 *               |           |
+		 *               +-----------+ <-- skb->data
+		 *               |           |     (After pulling headroom)
+		 *               |           |
+		 *               |   DATA    |
+		 *               |           |
+		 *               |           |
+		 *               +-----------+
+		 *               |           |
+		 *               |           |
+		 *               |   TAIL    |
+		 *               |           |
+		 *               |           |
+		 *               +-----------+
+		 *
 		 */
+		if (qdf_nbuf_head(msdu) == qdf_nbuf_data(msdu))
+			qdf_nbuf_pull_head(msdu, HTT_RX_STD_DESC_RESERVATION);
 		qdf_nbuf_update_radiotap(&rx_status, msdu,
 						  HTT_RX_STD_DESC_RESERVATION);
 		amsdu_len = HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(*(msg_word +