qcacld-3.0: Data path changes to use converged APIs (Part 3)

Changes to register a per vdev tx callback function.

Register a per-vdev transmit function during vdev registration.
The OS interface (HDD) adapter stores this transmit function and
invokes it to transmit data frames.

Change-Id: I1dfe6f58d1d26069dadc2d719fff242c29071bad
CRs-Fixed: 994638
diff --git a/core/hdd/src/wlan_hdd_softap_tx_rx.c b/core/hdd/src/wlan_hdd_softap_tx_rx.c
index 09b862d..fb4739f 100644
--- a/core/hdd/src/wlan_hdd_softap_tx_rx.c
+++ b/core/hdd/src/wlan_hdd_softap_tx_rx.c
@@ -171,8 +171,8 @@
 	hdd_ap_ctx_t *pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pAdapter);
 	struct qdf_mac_addr *pDestMacAddress;
 	uint8_t STAId;
-	uint8_t proto_type = 0;
 #ifdef QCA_PKT_PROTO_TRACE
+	uint8_t proto_type = 0;
 	hdd_context_t *hddCtxt = (hdd_context_t *) pAdapter->pHddCtx;
 #endif /* QCA_PKT_PROTO_TRACE */
 
@@ -199,6 +199,16 @@
 		goto drop_pkt;
 	}
 
+	/*
+	* If a transmit function is not registered, drop packet
+	*/
+	if (!pAdapter->tx_fn) {
+		QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_INFO_HIGH,
+			 "%s: TX function not registered by the data path",
+			 __func__);
+		goto drop_pkt;
+	}
+
 	pDestMacAddress = (struct qdf_mac_addr *) skb->data;
 
 	if (qdf_is_macaddr_broadcast(pDestMacAddress) ||
@@ -313,8 +323,11 @@
 				(uint8_t *)&skb->data[QDF_DP_TRACE_RECORD_SIZE],
 				(qdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE)));
 
-	if (ol_tx_send_data_frame(STAId, skb,
-							  proto_type) != NULL) {
+#ifdef QCA_PKT_PROTO_TRACE
+	qdf_nbuf_trace_set_proto_type(skb, proto_type);
+#endif
+	if (pAdapter->tx_fn(ol_txrx_get_vdev_by_sta_id(STAId),
+		 (qdf_nbuf_t) skb) != NULL) {
 		QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_WARN,
 			  "%s: Failed to send packet to txrx for staid:%d",
 			  __func__, STAId);
@@ -706,6 +719,7 @@
 	ol_txrx_vdev_register(
 		 ol_txrx_get_vdev_from_vdev_id(pAdapter->sessionId),
 		 pAdapter, &txrx_ops);
+	pAdapter->tx_fn = txrx_ops.tx.tx;
 
 	/* if ( WPA ), tell TL to go to 'connected' and after keys come to the
 	 * driver then go to 'authenticated'.  For all other authentication