Browse Source

qcacmn: Change HDD IPA to comply with the refactored SKB CB

Refactor IPA private data stored in skb control block,
which size is reduced to 32 bits.
Owner id is changed to 1 bit, to flag if the owner is IPA.
Callback function pointer is removed by adding the callback into cdf.
Skb control block priv data is reduced to 16 bits by storing the index
to the Tx descriptor list added in HDD.

Change-Id: I0eec0636794da3b4729b8be825afe6a1275915a4
CRs-Fixed: 982728
Yun Park 8 years ago
parent
commit
2a31213ccf
3 changed files with 33 additions and 3 deletions
  1. 14 0
      qdf/inc/qdf_nbuf.h
  2. 2 0
      qdf/linux/src/i_qdf_nbuf.h
  3. 17 3
      qdf/linux/src/qdf_nbuf.c

+ 14 - 0
qdf/inc/qdf_nbuf.h

@@ -2247,4 +2247,18 @@ qdf_nbuf_mark_wakeup_frame(qdf_nbuf_t buf)
 	 __qdf_nbuf_mark_wakeup_frame(buf);
 }
 
+/**
+ * qdf_nbuf_reg_free_cb - Registers nbuf free callback
+ * @cb_func_ptr: Callback pointer
+ *
+ * This function registers nbuf free callback
+ *
+ * Return: void
+ */
+static inline void
+qdf_nbuf_reg_free_cb(qdf_nbuf_free_t cb_func_ptr)
+{
+	 __qdf_nbuf_reg_free_cb(cb_func_ptr);
+}
+
 #endif /* _QDF_NBUF_H */

+ 2 - 0
qdf/linux/src/i_qdf_nbuf.h

@@ -337,6 +337,7 @@ struct qdf_nbuf_cb {
  */
 
 typedef void (*qdf_nbuf_trace_update_t)(char *);
+typedef void (*qdf_nbuf_free_t)(__qdf_nbuf_t);
 
 #define __qdf_nbuf_mapped_paddr_get(skb) QDF_NBUF_CB_PADDR(skb)
 
@@ -513,6 +514,7 @@ QDF_STATUS __qdf_nbuf_map_single(__qdf_device_t osdev,
 void __qdf_nbuf_unmap_single(__qdf_device_t osdev,
 			struct sk_buff *skb, qdf_dma_dir_t dir);
 void __qdf_nbuf_reg_trace_cb(qdf_nbuf_trace_update_t cb_func_ptr);
+void __qdf_nbuf_reg_free_cb(qdf_nbuf_free_t cb_func_ptr);
 
 QDF_STATUS __qdf_nbuf_dmamap_create(qdf_device_t osdev, __qdf_dma_map_t *dmap);
 void __qdf_nbuf_dmamap_destroy(qdf_device_t osdev, __qdf_dma_map_t dmap);

+ 17 - 3
qdf/linux/src/qdf_nbuf.c

@@ -166,6 +166,7 @@ EXPORT_SYMBOL(qdf_nbuf_set_state);
 
 /* globals do not need to be initialized to NULL/0 */
 qdf_nbuf_trace_update_t qdf_trace_update_cb;
+qdf_nbuf_free_t nbuf_free_cb;
 
 /**
  * __qdf_nbuf_alloc() - Allocate nbuf
@@ -236,9 +237,8 @@ EXPORT_SYMBOL(__qdf_nbuf_alloc);
 #ifdef CONFIG_MCL
 void __qdf_nbuf_free(struct sk_buff *skb)
 {
-	if (qdf_nbuf_ipa_owned_get(skb))
-		/* IPA cleanup function will need to be called here */
-		QDF_BUG(1);
+	if (nbuf_free_cb)
+		nbuf_free_cb(skb);
 	else
 		dev_kfree_skb_any(skb);
 }
@@ -2641,3 +2641,17 @@ unsigned int qdf_nbuf_update_radiotap(struct mon_rx_status *rx_status,
 	return 0;
 }
 #endif
+
+/**
+ * __qdf_nbuf_reg_free_cb() - register nbuf free callback
+ * @cb_func_ptr: function pointer to the nbuf free callback
+ *
+ * This function registers a callback function for nbuf free.
+ *
+ * Return: none
+ */
+void __qdf_nbuf_reg_free_cb(qdf_nbuf_free_t cb_func_ptr)
+{
+	nbuf_free_cb = cb_func_ptr;
+	return;
+}