summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CORE/CLD_TXRX/TLSHIM/tl_shim.c36
-rw-r--r--CORE/SAP/src/sapFsm.c4
-rw-r--r--CORE/TL/inc/wlan_qct_tl.h14
3 files changed, 52 insertions, 2 deletions
diff --git a/CORE/CLD_TXRX/TLSHIM/tl_shim.c b/CORE/CLD_TXRX/TLSHIM/tl_shim.c
index a3823e320ace..b3eb14e7e69c 100644
--- a/CORE/CLD_TXRX/TLSHIM/tl_shim.c
+++ b/CORE/CLD_TXRX/TLSHIM/tl_shim.c
@@ -2135,6 +2135,42 @@ VOS_STATUS tl_shim_get_vdevid(struct ol_txrx_peer_t *peer, u_int8_t *vdev_id)
return VOS_STATUS_SUCCESS;
}
+#ifdef QCA_SUPPORT_TXRX_LOCAL_PEER_ID
+/**
+ * tl_shim_get_sta_id_by_addr() - get peer local id given the MAC address.
+ * @vos_context: pointer to vos context
+ * @mac_addr: pointer to mac address
+ *
+ * Return: local id of the peer given the MAC address.
+ */
+uint16_t tl_shim_get_sta_id_by_addr(void *vos_context, uint8_t *mac_addr)
+{
+ struct ol_txrx_peer_t *peer;
+ ol_txrx_pdev_handle pdev;
+ uint8_t peer_id;
+
+ if (vos_context == NULL || mac_addr == NULL) {
+ TLSHIM_LOGE("Invalid argument %p, %p", vos_context, mac_addr);
+ return 0;
+ }
+
+ pdev = vos_get_context(VOS_MODULE_ID_TXRX, vos_context);
+ if (!pdev) {
+ TLSHIM_LOGE("PDEV [%pM] not found", mac_addr);
+ return 0;
+ }
+
+ peer = ol_txrx_find_peer_by_addr(pdev, mac_addr, &peer_id);
+
+ if (!peer) {
+ TLSHIM_LOGW("PEER [%pM] not found", mac_addr);
+ return 0;
+ }
+
+ return peer->local_id;
+}
+#endif
+
/*
* Function to get vdev(tl_context) given the MAC address.
*/
diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c
index 1b501a5a6368..32de15b40af1 100644
--- a/CORE/SAP/src/sapFsm.c
+++ b/CORE/SAP/src/sapFsm.c
@@ -3289,7 +3289,9 @@ sapSignalHDDevent
}
else
{
- sapApAppEvent.sapevt.sapStartBssCompleteEvent.staId = 0;
+ sapApAppEvent.sapevt.sapStartBssCompleteEvent.staId =
+ tl_shim_get_sta_id_by_addr(sapContext->pvosGCtx,
+ sapContext->self_mac_addr);
}
VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "%s(eSAP_START_BSS_EVENT): staId = %d",
diff --git a/CORE/TL/inc/wlan_qct_tl.h b/CORE/TL/inc/wlan_qct_tl.h
index 51cb7c1f2bb8..4956f47de65b 100644
--- a/CORE/TL/inc/wlan_qct_tl.h
+++ b/CORE/TL/inc/wlan_qct_tl.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2014, 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2014, 2016-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -2950,4 +2950,16 @@ VOS_STATUS WLANTL_RegisterOCBPeer(void *vos_ctx, uint8_t *mac_addr,
void WLANTL_display_datapath_stats(void *vos_ctx, uint16_t bitmap);
void WLANTL_clear_datapath_stats(void *vos_ctx, uint16_t bitmap);
+#ifdef QCA_SUPPORT_TXRX_LOCAL_PEER_ID
+/**
+ * tl_shim_get_sta_id_by_addr() - get peer local id given the MAC address.
+ * @vos_context: pointer to vos context
+ * @mac_addr: pointer to mac address
+ *
+ * Return: local id of the peer given the MAC address.
+ */
+uint16_t tl_shim_get_sta_id_by_addr(void *vos_context, uint8_t *mac_addr);
+#else
+#define tl_shim_get_sta_id_by_addr(vos_context,mac_addr) 0
+#endif
#endif /* #ifndef WLAN_QCT_WLANTL_H */