Sfoglia il codice sorgente

qcacmn: Support for DP RX Threads

Add support for DP RX Threads as a part of the FR. Multiple RX
threads can be enabled from the ini. The code is added in a new DP
module outside of the cmn project.

Change-Id: Id966c46c2799d23c2a4fa1c884610955afed3565
CRs-Fixed: 2256470
Mohit Khanna 6 anni fa
parent
commit
7ac554bda5

+ 36 - 0
dp/inc/cdp_txrx_cmn.h

@@ -34,6 +34,11 @@
  * Common Data Path Header File
  *
  *****************************************************************************/
+#define dp_alert(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_DP, params)
+#define dp_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_DP, params)
+#define dp_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_DP, params)
+#define dp_info(params...) QDF_TRACE_INFO(QDF_MODULE_ID_DP, params)
+#define dp_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_DP, params)
 
 static inline int
 cdp_soc_attach_target(ol_txrx_soc_handle soc)
@@ -916,6 +921,37 @@ static inline struct cdp_pdev *cdp_get_pdev_from_vdev
 	return soc->ops->cmn_drv_ops->txrx_get_pdev_from_vdev(vdev);
 }
 
+/**
+ * cdp_get_os_rx_handles_from_vdev() - Return os rx handles for a vdev
+ * @soc: ol_txrx_soc_handle handle
+ * @vdev: vdev for which os rx handles are needed
+ * @stack_fn_p: pointer to stack function pointer
+ * @osif_handle_p: pointer to ol_osif_vdev_handle
+ *
+ * Return: void
+ */
+static inline
+void cdp_get_os_rx_handles_from_vdev(ol_txrx_soc_handle soc,
+				     struct cdp_vdev *vdev,
+				     ol_txrx_rx_fp *stack_fn_p,
+				     ol_osif_vdev_handle *osif_handle_p)
+{
+	if (!soc || !soc->ops) {
+		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
+			  "%s: Invalid Instance:", __func__);
+		QDF_BUG(0);
+		return;
+	}
+
+	if (!soc->ops->cmn_drv_ops ||
+	    !soc->ops->cmn_drv_ops->txrx_get_os_rx_handles_from_vdev)
+		return;
+
+	soc->ops->cmn_drv_ops->txrx_get_os_rx_handles_from_vdev(vdev,
+								stack_fn_p,
+								osif_handle_p);
+}
+
 /**
  * cdp_get_ctrl_pdev_from_vdev() - Return control pdev of vdev
  * @vdev: vdev handle

+ 7 - 2
dp/inc/cdp_txrx_cmn_struct.h

@@ -573,7 +573,7 @@ typedef void (*ol_txrx_stats_callback)(void *ctxt,
  * OSIF which is called from txrx to
  * indicate whether the transmit OS
  * queues should be paused/resumed
- * @rx.std - the OS shim rx function to deliver rx data
+ * @rx.rx - the OS shim rx function to deliver rx data
  * frames to. This can have different values for
  * different virtual devices, e.g. so one virtual
  * device's OS shim directly hands rx frames to the OS,
@@ -581,7 +581,11 @@ typedef void (*ol_txrx_stats_callback)(void *ctxt,
  * messages before sending the rx frames to the OS. The
  * netbufs delivered to the osif_rx function are in the
  * format specified by the OS to use for tx and rx
- * frames (either 802.3 or native WiFi)
+ * frames (either 802.3 or native WiFi). In case RX Threads are enabled, pkts
+ * are given to the thread, instead of the stack via this pointer.
+ * @rx.stack - function to give packets to the stack. Differs from @rx.rx.
+ * In case RX Threads are enabled, this pointer holds the callback to give
+ * packets to the stack.
  * @rx.wai_check - the tx function pointer for WAPI frames
  * @rx.mon - the OS shim rx monitor function to deliver
  * monitor data to Though in practice, it is probable
@@ -613,6 +617,7 @@ struct ol_txrx_ops {
 	/* rx function pointers - specified by OS shim, stored by txrx */
 	struct {
 		ol_txrx_rx_fp           rx;
+		ol_txrx_rx_fp           rx_stack;
 		ol_txrx_rx_check_wai_fp wai_check;
 		ol_txrx_rx_mon_fp       mon;
 		ol_txrx_stats_rx_fp           stats_rx;

+ 12 - 1
dp/inc/cdp_txrx_ops.h

@@ -16,7 +16,6 @@
  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  * PERFORMANCE OF THIS SOFTWARE.
  */
-
 /**
  * @file cdp_txrx_ops.h
  * @brief Define the host data path converged API functions
@@ -334,6 +333,18 @@ struct cdp_cmn_ops {
 					struct cdp_ctrl_objmgr_pdev *ctrl_pdev);
 
 	ol_txrx_tx_fp tx_send;
+
+	/**
+	 * txrx_get_os_rx_handles_from_vdev() - Return function, osif vdev
+	 *					to deliver pkt to stack.
+	 * @vdev: vdev handle
+	 * @stack_fn: pointer to - function pointer to deliver RX pkt to stack
+	 * @osif_vdev: pointer to - osif vdev to deliver RX packet to.
+	 */
+	void (*txrx_get_os_rx_handles_from_vdev)
+					(struct cdp_vdev *vdev,
+					 ol_txrx_rx_fp *stack_fn,
+					 ol_osif_vdev_handle *osif_vdev);
 };
 
 struct cdp_ctrl_ops {

+ 29 - 0
dp/wifi3.0/dp_main.c

@@ -437,6 +437,19 @@ uint32_t dp_soc_get_mon_mask_for_interrupt_mode(struct dp_soc *soc, int intr_ctx
 }
 #endif
 
+/**
+ * dp_get_dp_vdev_from_cdp_vdev() - get dp_vdev from cdp_vdev by type-casting
+ * @cdp_opaque_vdev: pointer to cdp_vdev
+ *
+ * Return: pointer to dp_vdev
+ */
+static
+struct dp_vdev * dp_get_dp_vdev_from_cdp_vdev(struct cdp_vdev *cdp_opaque_vdev)
+{
+	return (struct dp_vdev *)cdp_opaque_vdev;
+}
+
+
 static int dp_peer_add_ast_wifi3(struct cdp_soc_t *soc_hdl,
 					struct cdp_peer *peer_hdl,
 					uint8_t *mac_addr,
@@ -1088,6 +1101,7 @@ static uint32_t dp_service_srngs(void *dp_ctx, uint32_t dp_budget)
 			if (rx_mask & (1 << ring)) {
 				work_done = dp_rx_process(int_ctx,
 					    soc->reo_dest_ring[ring].hal_srng,
+					    ring,
 					    remaining_quota);
 
 				QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
@@ -3620,6 +3634,7 @@ static void dp_vdev_register_wifi3(struct cdp_vdev *vdev_handle,
 	vdev->osif_vdev = osif_vdev;
 	vdev->ctrl_vdev = ctrl_vdev;
 	vdev->osif_rx = txrx_ops->rx.rx;
+	vdev->osif_rx_stack = txrx_ops->rx.rx_stack;
 	vdev->osif_rsim_rx_decap = txrx_ops->rx.rsim_rx_decap;
 	vdev->osif_get_key = txrx_ops->get_key;
 	vdev->osif_rx_mon = txrx_ops->rx.mon;
@@ -4699,6 +4714,18 @@ static int dp_get_opmode(struct cdp_vdev *vdev_handle)
 	return vdev->opmode;
 }
 
+static
+void dp_get_os_rx_handles_from_vdev_wifi3(struct cdp_vdev *pvdev,
+					  ol_txrx_rx_fp *stack_fn_p,
+					  ol_osif_vdev_handle *osif_vdev_p)
+{
+	struct dp_vdev *vdev = dp_get_dp_vdev_from_cdp_vdev(pvdev);
+
+	qdf_assert(vdev);
+	*stack_fn_p = vdev->osif_rx_stack;
+	*osif_vdev_p = vdev->osif_vdev;
+}
+
 static struct cdp_cfg *dp_get_ctrl_pdev_from_vdev_wifi3(struct cdp_vdev *pvdev)
 {
 	struct dp_vdev *vdev = (struct dp_vdev *)pvdev;
@@ -7592,6 +7619,8 @@ static struct cdp_cmn_ops dp_ops_cmn = {
 	.txrx_peer_flush_ast_table = dp_wds_flush_ast_table_wifi3,
 	.txrx_peer_map_attach = dp_peer_map_attach_wifi3,
 	.txrx_pdev_set_ctrl_pdev = dp_pdev_set_ctrl_pdev,
+	.txrx_get_os_rx_handles_from_vdev =
+					dp_get_os_rx_handles_from_vdev_wifi3,
 	.delba_tx_completion = dp_delba_tx_completion_wifi3,
 };
 

+ 1 - 1
dp/wifi3.0/dp_peer.c

@@ -2312,7 +2312,7 @@ struct cdp_vdev *dp_get_vdev_for_peer(void *peer_handle)
 {
 	struct dp_peer *peer = peer_handle;
 
-	DP_TRACE(INFO, "peer %pK vdev %pK", peer, peer->vdev);
+	DP_TRACE(DEBUG, "peer %pK vdev %pK", peer, peer->vdev);
 	return (struct cdp_vdev *)peer->vdev;
 }
 

+ 13 - 7
dp/wifi3.0/dp_rx.c

@@ -1238,6 +1238,7 @@ int dp_wds_rx_policy_check(
  *		     Called from the bottom half (tasklet/NET_RX_SOFTIRQ)
  * @soc: core txrx main context
  * @hal_ring: opaque pointer to the HAL Rx Ring, which will be serviced
+ * @reo_ring_num: ring number (0, 1, 2 or 3) of the reo ring.
  * @quota: No. of units (packets) that can be serviced in one shot.
  *
  * This function implements the core of Rx functionality. This is
@@ -1245,8 +1246,8 @@ int dp_wds_rx_policy_check(
  *
  * Return: uint32_t: No. of elements processed
  */
-uint32_t
-dp_rx_process(struct dp_intr *int_ctx, void *hal_ring, uint32_t quota)
+uint32_t dp_rx_process(struct dp_intr *int_ctx, void *hal_ring,
+		       uint8_t reo_ring_num, uint32_t quota)
 {
 	void *hal_soc;
 	void *ring_desc;
@@ -1383,6 +1384,7 @@ dp_rx_process(struct dp_intr *int_ctx, void *hal_ring, uint32_t quota)
 		if (msdu_desc_info.msdu_flags & HAL_MSDU_F_LAST_MSDU_IN_MPDU)
 			qdf_nbuf_set_rx_chfrag_end(rx_desc->nbuf, 1);
 
+		QDF_NBUF_CB_RX_CTX_ID(rx_desc->nbuf) = reo_ring_num;
 		DP_RX_LIST_APPEND(nbuf_head, nbuf_tail, rx_desc->nbuf);
 
 		/*
@@ -1401,6 +1403,9 @@ dp_rx_process(struct dp_intr *int_ctx, void *hal_ring, uint32_t quota)
 done:
 	hal_srng_access_end(hal_soc, hal_ring);
 
+	if (nbuf_tail)
+		QDF_NBUF_CB_RX_FLUSH_IND(nbuf_tail) = 1;
+
 	/* Update histogram statistics by looping through pdev's */
 	DP_RX_HIST_STATS_PER_PDEV();
 
@@ -1473,6 +1478,8 @@ done:
 		if (qdf_likely(peer != NULL)) {
 			vdev = peer->vdev;
 		} else {
+			DP_STATS_INC_PKT(soc, rx.err.rx_invalid_peer, 1,
+					 qdf_nbuf_len(nbuf));
 			qdf_nbuf_free(nbuf);
 			nbuf = next;
 			continue;
@@ -1635,11 +1642,10 @@ done:
 		}
 
 		dp_rx_lro(rx_tlv_hdr, peer, nbuf, int_ctx->lro_ctx);
-
+		qdf_nbuf_cb_update_peer_local_id(nbuf, peer->local_id);
 		DP_RX_LIST_APPEND(deliver_list_head,
-					deliver_list_tail,
-					nbuf);
-
+				  deliver_list_tail,
+				  nbuf);
 		DP_STATS_INC_PKT(peer, rx.to_stack, 1,
 				qdf_nbuf_len(nbuf));
 
@@ -1648,7 +1654,7 @@ done:
 
 	if (deliver_list_head)
 		dp_rx_deliver_to_stack(vdev, peer, deliver_list_head,
-				deliver_list_tail);
+				       deliver_list_tail);
 
 	return rx_bufs_used; /* Assume no scale factor for now */
 }

+ 12 - 9
dp/wifi3.0/dp_rx.h

@@ -315,7 +315,8 @@ void dp_rx_pdev_detach(struct dp_pdev *pdev);
 
 
 uint32_t
-dp_rx_process(struct dp_intr *int_ctx, void *hal_ring, uint32_t quota);
+dp_rx_process(struct dp_intr *int_ctx, void *hal_ring, uint8_t reo_ring_num,
+	      uint32_t quota);
 
 uint32_t dp_rx_err_process(struct dp_soc *soc, void *hal_ring, uint32_t quota);
 
@@ -512,14 +513,16 @@ void dp_rx_process_invalid_peer_wrapper(struct dp_soc *soc,
 void dp_rx_process_mic_error(struct dp_soc *soc, qdf_nbuf_t nbuf, uint8_t *rx_tlv_hdr);
 
 #define DP_RX_LIST_APPEND(head, tail, elem) \
-	do {                                                \
-		if (!(head)) {                              \
-			(head) = (elem);                    \
-		} else {                                    \
-			qdf_nbuf_set_next((tail), (elem));  \
-		}                                           \
-		(tail) = (elem);                            \
-		qdf_nbuf_set_next((tail), NULL);            \
+	do {                                                          \
+		if (!(head)) {                                        \
+			(head) = (elem);                              \
+			QDF_NBUF_CB_RX_NUM_ELEMENTS_IN_LIST(head) = 1;\
+		} else {                                              \
+			qdf_nbuf_set_next((tail), (elem));            \
+			QDF_NBUF_CB_RX_NUM_ELEMENTS_IN_LIST(head)++;  \
+		}                                                     \
+		(tail) = (elem);                                      \
+		qdf_nbuf_set_next((tail), NULL);                      \
 	} while (0)
 
 #ifndef BUILD_X86

+ 3 - 1
dp/wifi3.0/dp_types.h

@@ -1261,8 +1261,10 @@ struct dp_vdev {
 	/* dp_peer list */
 	TAILQ_HEAD(, dp_peer) peer_list;
 
-	/* callback to hand rx frames to the OS shim */
+	/* default RX call back function called by dp */
 	ol_txrx_rx_fp osif_rx;
+	/* callback to deliver rx frames to the OS */
+	ol_txrx_rx_fp osif_rx_stack;
 	ol_txrx_rsim_rx_decap_fp osif_rsim_rx_decap;
 	ol_txrx_get_key_fp osif_get_key;
 	ol_txrx_tx_free_ext_fp osif_tx_free_ext;

+ 80 - 2
qdf/inc/qdf_nbuf.h

@@ -607,6 +607,11 @@ enum qdf_proto_subtype {
  */
 typedef __qdf_nbuf_t qdf_nbuf_t;
 
+/**
+ * typedef qdf_nbuf_queue_head_t - Platform indepedent nbuf queue head
+ */
+typedef __qdf_nbuf_queue_head_t qdf_nbuf_queue_head_t;
+
 /**
  * @qdf_dma_map_cb_t - Dma map callback prototype
  */
@@ -787,6 +792,68 @@ qdf_nbuf_unmap_nbytes_single(
 }
 #endif /* NBUF_MEMORY_DEBUG */
 
+/**
+ * qdf_nbuf_queue_head_dequeue() - dequeue nbuf from the head of queue
+ * @nbuf_queue_head: pointer to nbuf queue head
+ *
+ * Return: pointer to network buffer dequeued
+ */
+static inline
+qdf_nbuf_t qdf_nbuf_queue_head_dequeue(qdf_nbuf_queue_head_t *nbuf_queue_head)
+{
+	return __qdf_nbuf_queue_head_dequeue(nbuf_queue_head);
+}
+
+/**
+ * qdf_nbuf_queue_head_qlen() - length of the queue
+ * @nbuf_queue_head: pointer to nbuf queue head
+ *
+ * Return: length of queue (number of nbufs) pointed by qdf_nbuf_queue_head_t
+ */
+static inline
+uint32_t qdf_nbuf_queue_head_qlen(qdf_nbuf_queue_head_t *nbuf_queue_head)
+{
+	return __qdf_nbuf_queue_head_qlen(nbuf_queue_head);
+}
+
+/**
+ * qdf_nbuf_queue_head_enqueue_tail() - enqueue nbuf into queue tail
+ * @nbuf_queue_head: pointer to nbuf queue head
+ * @nbuf: nbuf to be enqueued
+ *
+ * Return: None
+ */
+static inline
+void qdf_nbuf_queue_head_enqueue_tail(qdf_nbuf_queue_head_t *nbuf_queue_head,
+				      qdf_nbuf_t nbuf)
+{
+	return __qdf_nbuf_queue_head_enqueue_tail(nbuf_queue_head, nbuf);
+}
+
+/**
+ * qdf_nbuf_queue_head_init() - initialize qdf_nbuf_queue_head_t
+ * @nbuf_queue_head: pointer to nbuf queue head to be initialized
+ *
+ * Return: None
+ */
+static inline
+void qdf_nbuf_queue_head_init(qdf_nbuf_queue_head_t *nbuf_queue_head)
+{
+	return __qdf_nbuf_queue_head_init(nbuf_queue_head);
+}
+
+/**
+ * qdf_nbuf_queue_head_purge() - purge qdf_nbuf_queue_head_t
+ * @nbuf_queue_head: pointer to nbuf queue head to be purged
+ *
+ * Return: None
+ */
+static inline
+void qdf_nbuf_queue_head_purge(qdf_nbuf_queue_head_t *nbuf_queue_head)
+{
+	return __qdf_nbuf_queue_head_purge(nbuf_queue_head);
+}
+
 static inline void
 qdf_nbuf_sync_for_cpu(qdf_device_t osdev, qdf_nbuf_t buf, qdf_dma_dir_t dir)
 {
@@ -1305,16 +1372,27 @@ static inline qdf_nbuf_t qdf_nbuf_copy(qdf_nbuf_t buf)
 void qdf_nbuf_init_fast(qdf_nbuf_t nbuf);
 #endif /* WLAN_FEATURE_FASTPATH */
 
-static inline void qdf_nbuf_tx_free(qdf_nbuf_t buf_list, int tx_err)
+/**
+ * @qdf_nbuf_list_free() - free a list of nbufs
+ * @buf_list: A list of nbufs to be freed
+ *
+ * Return: none
+ */
+
+static inline void qdf_nbuf_list_free(qdf_nbuf_t buf_list)
 {
 	while (buf_list) {
 		qdf_nbuf_t next = qdf_nbuf_next(buf_list);
-
 		qdf_nbuf_free(buf_list);
 		buf_list = next;
 	}
 }
 
+static inline void qdf_nbuf_tx_free(qdf_nbuf_t buf_list, int tx_err)
+{
+	qdf_nbuf_list_free(buf_list);
+}
+
 static inline void qdf_nbuf_ref(qdf_nbuf_t buf)
 {
 	__qdf_nbuf_ref(buf);

+ 25 - 2
qdf/inc/qdf_threads.h

@@ -38,12 +38,20 @@ void qdf_sleep_us(uint32_t us_interval);
 
 void qdf_busy_wait(uint32_t us_interval);
 
+/**
+ * qdf_set_wake_up_idle() - set wakeup idle value
+ * @idle: true/false value for wake up idle
+ *
+ * Return: none
+ */
+void qdf_set_wake_up_idle(bool idle);
+
 /**
  * qdf_set_user_nice() - set thread's nice value
  * @thread: pointer to thread
  * @nice: nice value
  *
- * Return: none
+ * Return: void
  */
 void qdf_set_user_nice(qdf_thread_t *thread, long nice);
 
@@ -52,7 +60,7 @@ void qdf_set_user_nice(qdf_thread_t *thread, long nice);
  * @thread: pointer to thread
  * @nice: nice value
  *
- * Return: pointer to created kernel thread
+ * Return: pointer to created kernel thread on success else NULL
  */
 qdf_thread_t *qdf_create_thread(int (*thread_handler)(void *data), void *data,
 				const char thread_name[]);
@@ -111,4 +119,19 @@ void qdf_print_thread_trace(qdf_thread_t *thread);
  * Return: pointer to task struct
  */
 qdf_thread_t *qdf_get_current_task(void);
+
+/**
+ * qdf_get_current_pid() - get current task's process id
+ *
+ * Return: current task's process id (int)
+ */
+int qdf_get_current_pid(void);
+
+/**
+ * qdf_get_current_comm() - get current task's command name
+ *
+ * Return: current task's command name(char *)
+ */
+const char *qdf_get_current_comm(void);
+
 #endif /* __QDF_THREADS_H */

+ 51 - 4
qdf/linux/src/i_qdf_nbuf.h

@@ -44,6 +44,13 @@
  */
 typedef struct sk_buff *__qdf_nbuf_t;
 
+/**
+ * typedef __qdf_nbuf_queue_head_t - abstraction for sk_buff_head linux struct
+ *
+ * This is used for skb queue management via linux skb buff head APIs
+ */
+typedef struct sk_buff_head __qdf_nbuf_queue_head_t;
+
 #define QDF_NBUF_CB_TX_MAX_OS_FRAGS 1
 
 /* QDF_NBUF_CB_TX_MAX_EXTRA_FRAGS -
@@ -95,7 +102,7 @@ typedef union {
  * @rx.dev.priv_cb_m.tcp_ack_num: TCP ACK number
  * @rx.dev.priv_cb_m.lro_ctx: LRO context
  * @rx.dev.priv_cb_m.map_index:
- * @rx.dev.priv_cb_m.reserved: reserved
+ * @rx.dev.priv_cb_m.peer_local_id: peer_local_id for RX pkt
  *
  * @rx.lro_eligible: flag to indicate whether the MSDU is LRO eligible
  * @rx.peer_cached_buf_frm: peer cached buffer
@@ -105,6 +112,8 @@ typedef union {
  * @rx.ip_offset: offset to IP header
  * @rx.tcp_offset: offset to TCP header
  * @rx_ctx_id: Rx context id
+ * @flush_ind: flush indication
+ * @num_elements_in_list: number of elements in the nbuf list
  *
  * @rx.tcp_udp_chksum: L4 payload checksum
  * @rx.tcp_wim: TCP window size
@@ -187,7 +196,7 @@ struct qdf_nbuf_cb {
 					uint32_t tcp_ack_num;
 					unsigned char *lro_ctx;
 					uint32_t map_index;
-					uint32_t reserved;
+					uint32_t peer_local_id;
 				} priv_cb_m;
 			} dev;
 			uint32_t lro_eligible:1,
@@ -197,9 +206,11 @@ struct qdf_nbuf_cb {
 				ipv6_proto:1,
 				ip_offset:7,
 				tcp_offset:7,
-				rx_ctx_id:4;
+				rx_ctx_id:4,
+				flush_ind:1,
+				num_elements_in_list:8;
 			uint32_t tcp_udp_chksum:16,
-				tcp_win:16;
+				 tcp_win:16;
 			uint32_t flow_id;
 			uint8_t flag_chfrag_start:1,
 				flag_chfrag_cont:1,
@@ -297,6 +308,10 @@ QDF_COMPILE_TIME_ASSERT(qdf_nbuf_cb_size,
 	(((struct qdf_nbuf_cb *)((skb)->cb))->u.rx.tcp_offset)
 #define QDF_NBUF_CB_RX_CTX_ID(skb) \
 	(((struct qdf_nbuf_cb *)((skb)->cb))->u.rx.rx_ctx_id)
+#define QDF_NBUF_CB_RX_FLUSH_IND(skb) \
+		(((struct qdf_nbuf_cb *)((skb)->cb))->u.rx.flush_ind)
+#define QDF_NBUF_CB_RX_NUM_ELEMENTS_IN_LIST(skb) \
+		(((struct qdf_nbuf_cb *)((skb)->cb))->u.rx.num_elements_in_list)
 
 #define QDF_NBUF_CB_RX_TCP_CHKSUM(skb) \
 	(((struct qdf_nbuf_cb *)((skb)->cb))->u.rx.tcp_udp_chksum)
@@ -1837,6 +1852,38 @@ static inline void __qdf_nbuf_orphan(struct sk_buff *skb)
 {
 	return skb_orphan(skb);
 }
+
+static inline struct sk_buff *
+__qdf_nbuf_queue_head_dequeue(struct sk_buff_head *skb_queue_head)
+{
+	return skb_dequeue(skb_queue_head);
+}
+
+static inline
+uint32_t __qdf_nbuf_queue_head_qlen(struct sk_buff_head *skb_queue_head)
+{
+	return skb_queue_head->qlen;
+}
+
+static inline
+void __qdf_nbuf_queue_head_enqueue_tail(struct sk_buff_head *skb_queue_head,
+					struct sk_buff *skb)
+{
+	return skb_queue_tail(skb_queue_head, skb);
+}
+
+static inline
+void __qdf_nbuf_queue_head_init(struct sk_buff_head *skb_queue_head)
+{
+	return skb_queue_head_init(skb_queue_head);
+}
+
+static inline
+void __qdf_nbuf_queue_head_purge(struct sk_buff_head *skb_queue_head)
+{
+	return skb_queue_purge(skb_queue_head);
+}
+
 #ifdef CONFIG_WIN
 #include <i_qdf_nbuf_w.h>
 #else

+ 16 - 2
qdf/linux/src/i_qdf_nbuf_m.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -34,6 +34,9 @@
 #define QDF_NBUF_CB_RX_LRO_CTX(skb) \
 	(((struct qdf_nbuf_cb *)((skb)->cb))->u.rx.dev.priv_cb_m.lro_ctx)
 
+#define QDF_NBUF_CB_RX_PEER_LOCAL_ID(skb) \
+	(((struct qdf_nbuf_cb *)((skb)->cb))->u.rx.dev.priv_cb_m.peer_local_id)
+
 #define QDF_NBUF_CB_TX_IPA_OWNED(skb) \
 	(((struct qdf_nbuf_cb *)((skb)->cb))->u.tx.dev.priv_cb_m.ipa.owned)
 #define QDF_NBUF_CB_TX_IPA_PRIV(skb) \
@@ -58,7 +61,18 @@
 #define __qdf_nbuf_ipa_priv_set(skb, priv) \
 	(QDF_NBUF_CB_TX_IPA_PRIV(skb) = (priv))
 
-
+/**
+ * qdf_nbuf_cb_update_peer_local_id() - update peer local id in skb cb
+ * @skb: skb pointer whose cb is updated with peer local id information
+ * @peer_local_id: peer local id to be update in cb
+ *
+ * Return: void
+ */
+static inline void qdf_nbuf_cb_update_peer_local_id(struct sk_buff *skb,
+						    uint32_t peer_local_id)
+{
+	QDF_NBUF_CB_RX_PEER_LOCAL_ID(skb) = peer_local_id;
+}
 
 void __qdf_nbuf_init_replenish_timer(void);
 void __qdf_nbuf_deinit_replenish_timer(void);

+ 13 - 2
qdf/linux/src/i_qdf_nbuf_w.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -66,7 +66,18 @@
 #define __qdf_nbuf_get_tx_fctx(skb) \
 		 QDF_NBUF_CB_TX_FCTX((skb))
 
-
+/**
+ * qdf_nbuf_cb_update_peer_local_id() - update peer local id in skb cb
+ * @skb: skb pointer whose cb is updated with peer local id information
+ * @peer_local_id: peer local id to be update in cb
+ *
+ * Return: void
+ */
+static inline void qdf_nbuf_cb_update_peer_local_id(struct sk_buff *skb,
+						    uint32_t peer_local_id)
+{
+	/* Does not apply to WIN */
+}
 
 /**
  * __qdf_nbuf_push_head() - Push data in the front

+ 33 - 1
qdf/linux/src/qdf_threads.c

@@ -106,6 +106,19 @@ void qdf_busy_wait(uint32_t us_interval)
 }
 qdf_export_symbol(qdf_busy_wait);
 
+#ifdef MSM_PLATFORM
+void qdf_set_wake_up_idle(bool idle)
+{
+	set_wake_up_idle(idle);
+}
+#else
+void qdf_set_wake_up_idle(bool idle)
+{
+}
+#endif /* MSM_PLATFORM */
+
+qdf_export_symbol(qdf_set_wake_up_idle);
+
 void qdf_set_user_nice(qdf_thread_t *thread, long nice)
 {
 	set_user_nice(thread, nice);
@@ -115,7 +128,14 @@ qdf_export_symbol(qdf_set_user_nice);
 qdf_thread_t *qdf_create_thread(int (*thread_handler)(void *data), void *data,
 				const char thread_name[])
 {
-	return kthread_create(thread_handler, data, thread_name);
+	struct task_struct *task;
+
+	task = kthread_create(thread_handler, data, thread_name);
+
+	if (IS_ERR(task))
+		return NULL;
+
+	return task;
 }
 qdf_export_symbol(qdf_create_thread);
 
@@ -196,3 +216,15 @@ qdf_thread_t *qdf_get_current_task(void)
 	return current;
 }
 qdf_export_symbol(qdf_get_current_task);
+
+int qdf_get_current_pid(void)
+{
+	return current->pid;
+}
+qdf_export_symbol(qdf_get_current_pid);
+
+const char *qdf_get_current_comm(void)
+{
+	return current->comm;
+}
+qdf_export_symbol(qdf_get_current_comm);