qcacld-3.0: Fix __hdd_hard_start_xmit API for NAN Data Interface
qcacld-2.0 to qcacld-3.0 propagation
Make changes in __hdd_hard_start_xmit API registered with OS to enable
data path for NAN Data Interface.
Change-Id: I1d54c79da127b1dac7ea8c8e0e855e043571ad77
CRs-Fixed: 962367
diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c
index 4db478d..39bb930 100644
--- a/core/hdd/src/wlan_hdd_assoc.c
+++ b/core/hdd/src/wlan_hdd_assoc.c
@@ -1668,7 +1668,7 @@
pHddStaCtx->roam_info.roamingState =
HDD_ROAM_STATE_NONE;
} else {
- qdf_status = hdd_ibss_get_sta_id(
+ qdf_status = hdd_get_peer_sta_id(
pHddStaCtx,
&pRoamInfo->peerMac,
&staId);
diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c
index 1f0fcc5..fae0407 100644
--- a/core/hdd/src/wlan_hdd_ioctl.c
+++ b/core/hdd/src/wlan_hdd_ioctl.c
@@ -5150,7 +5150,7 @@
}
/* Get station index for the peer mac address and sanitize it */
- hdd_ibss_get_sta_id(pHddStaCtx, &peerMacAddr, &staIdx);
+ hdd_get_peer_sta_id(pHddStaCtx, &peerMacAddr, &staIdx);
if (staIdx > MAX_IBSS_PEERS) {
hdd_err("Invalid StaIdx %d returned", staIdx);
diff --git a/core/hdd/src/wlan_hdd_nan_datapath.c b/core/hdd/src/wlan_hdd_nan_datapath.c
index 0278f19..0361fb9 100644
--- a/core/hdd/src/wlan_hdd_nan_datapath.c
+++ b/core/hdd/src/wlan_hdd_nan_datapath.c
@@ -115,8 +115,9 @@
hdd_err(FL("Interface is not in NDI mode"));
return -EINVAL;
}
- netif_tx_disable(adapter->dev);
- netif_carrier_off(adapter->dev);
+ wlan_hdd_netif_queue_control(adapter,
+ WLAN_NETIF_TX_DISABLE_N_CARRIER,
+ WLAN_CONTROL_PATH);
#ifdef WLAN_OPEN_SOURCE
cancel_work_sync(&adapter->ipv4NotifierWorkQueue);
@@ -443,7 +444,7 @@
{
hdd_adapter_t *adapter;
char *iface_name;
- struct ndp_initiator_req req;
+ struct ndp_initiator_req req = {0};
QDF_STATUS status;
uint32_t ndp_qos_cfg;
tHalHandle hal = hdd_ctx->hHal;
@@ -700,6 +701,9 @@
hdd_err(FL("NDI interface successfully created"));
ndp_ctx->ndp_create_transaction_id = 0;
ndp_ctx->state = NAN_DATA_NDI_CREATED_STATE;
+ wlan_hdd_netif_queue_control(adapter,
+ WLAN_START_ALL_NETIF_QUEUE_N_CARRIER,
+ WLAN_CONTROL_PATH);
} else {
hdd_err(FL("NDI interface creation failed with reason %d"),
ndi_rsp->reason);
@@ -745,7 +749,9 @@
else
hdd_err(FL("NDI BSS stop failed with reason %d"),
ndi_rsp->reason);
-
+ wlan_hdd_netif_queue_control(adapter,
+ WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER,
+ WLAN_CONTROL_PATH);
complete(&adapter->disconnect_comp_var);
return;
}
@@ -955,6 +961,7 @@
tCsrRoamInfo roam_info = {0};
struct nan_datapath_ctx *ndp_ctx = WLAN_HDD_GET_NDP_CTX_PTR(adapter);
hdd_station_ctx_t *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
+ struct qdf_mac_addr bc_mac_addr = QDF_MAC_ADDR_BROADCAST_INITIALIZER;
ENTER();
@@ -972,16 +979,21 @@
/* this function is called for each new peer */
ndp_ctx->active_ndp_peers++;
+
hdd_roam_register_sta(adapter, &roam_info, new_peer_ind->sta_id,
&new_peer_ind->peer_mac_addr, &tmp_bss_descp);
hdd_ctx->sta_to_adapter[new_peer_ind->sta_id] = adapter;
/* perform following steps for first new peer ind */
if (ndp_ctx->active_ndp_peers == 1) {
+ hdd_ctx->sta_to_adapter[NDP_BROADCAST_STAID] = adapter;
+ hdd_save_peer(sta_ctx, new_peer_ind->sta_id, &bc_mac_addr);
+ hdd_roam_register_sta(adapter, &roam_info, NDP_BROADCAST_STAID,
+ &bc_mac_addr, &tmp_bss_descp);
hddLog(LOG1, FL("Set ctx connection state to connected"));
sta_ctx->conn_info.connState = eConnectionState_NdiConnected;
hdd_wmm_connect(adapter, &roam_info, eCSR_BSS_TYPE_NDI);
- netif_carrier_on(adapter->dev);
- netif_tx_start_all_queues(adapter->dev);
+ wlan_hdd_netif_queue_control(adapter,
+ WLAN_WAKE_ALL_NETIF_QUEUE, WLAN_CONTROL_PATH);
}
EXIT();
}
diff --git a/core/hdd/src/wlan_hdd_nan_datapath.h b/core/hdd/src/wlan_hdd_nan_datapath.h
index 93c6b7f..46bb816 100644
--- a/core/hdd/src/wlan_hdd_nan_datapath.h
+++ b/core/hdd/src/wlan_hdd_nan_datapath.h
@@ -40,6 +40,9 @@
#define NDP_APP_INFO_LEN 255
#define NDP_QOS_INFO_LEN 255
+#define HDD_MAX_NUM_NDP_STA (MAX_IBSS_PEERS)
+#define NDP_BROADCAST_STAID (0)
+
#ifdef WLAN_FEATURE_NAN_DATAPATH
#define WLAN_HDD_IS_NDI(adapter) ((adapter)->device_mode == QDF_NDI_MODE)
diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c
index efb6a1b..723be01 100644
--- a/core/hdd/src/wlan_hdd_tx_rx.c
+++ b/core/hdd/src/wlan_hdd_tx_rx.c
@@ -57,6 +57,8 @@
#include "cdp_txrx_peer_ops.h"
#include "ol_txrx.h"
+#include "wlan_hdd_nan_datapath.h"
+
const uint8_t hdd_wmm_ac_to_highest_up[] = {
SME_QOS_WMM_UP_RESV,
SME_QOS_WMM_UP_EE,
@@ -339,8 +341,8 @@
(struct qdf_mac_addr *) skb->data;
if (QDF_STATUS_SUCCESS !=
- hdd_ibss_get_sta_id(&pAdapter->sessionCtx.station,
- pDestMacAddress, &STAId))
+ hdd_get_peer_sta_id(&pAdapter->sessionCtx.station,
+ pDestMacAddress, &STAId))
STAId = HDD_WLAN_INVALID_STA_ID;
if ((STAId == HDD_WLAN_INVALID_STA_ID) &&
@@ -356,6 +358,20 @@
__func__);
goto drop_pkt;
}
+ } else if (QDF_NDI_MODE == pAdapter->device_mode) {
+ struct qdf_mac_addr *dest_mac_addr =
+ (struct qdf_mac_addr *)skb->data;
+ if (hdd_get_peer_sta_id(&pAdapter->sessionCtx.station,
+ dest_mac_addr, &STAId) !=
+ QDF_STATUS_SUCCESS) {
+ QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_WARN,
+ FL("Can't find peer: %pM, dropping packet"),
+ dest_mac_addr);
+ ++pAdapter->stats.tx_dropped;
+ ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped;
+ kfree_skb(skb);
+ return NETDEV_TX_OK;
+ }
} else {
if (QDF_OCB_MODE != pAdapter->device_mode &&
eConnectionState_Associated !=
@@ -557,7 +573,7 @@
}
/**
- * hdd_ibss_get_sta_id() - Get the StationID using the Peer Mac address
+ * hdd_get_peer_sta_id() - Get the StationID using the Peer Mac address
* @pHddStaCtx: pointer to HDD Station Context
* @pMacAddress: pointer to Peer Mac address
* @staID: pointer to returned Station Index
@@ -565,7 +581,7 @@
* Return: QDF_STATUS_SUCCESS/QDF_STATUS_E_FAILURE
*/
-QDF_STATUS hdd_ibss_get_sta_id(hdd_station_ctx_t *pHddStaCtx,
+QDF_STATUS hdd_get_peer_sta_id(hdd_station_ctx_t *pHddStaCtx,
struct qdf_mac_addr *pMacAddress, uint8_t *staId)
{
uint8_t idx;