summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTse-Yu Lo <tseyul@qca.qualcomm.com>2014-10-02 10:54:36 +0800
committerAnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com>2014-10-07 17:38:29 +0530
commit6fd5fd48dd9bf862a21d01efccdbd833d9b877bb (patch)
tree010b1fbf800972dd8f99c0e96d846ca3f8ac07d0
parentf5ed316d8eb752c2fa5b38a3225d837012ab5cc7 (diff)
wlan: SME: add GPIO LED flashing feature
Passing parameters from user to firmware for LED flashing control. The state of the LED GPIO control is determined by two 32 bit values (X_0 and X_1) to produce a 64 bit value. Each 32 bit value consists of 4 bytes, where each byte defines the number of 50ms intervals that the GPIO will remain at a predetermined state. The 64 bit value provides 8 unique GPIO timing intervals. The pattern starts with the MSB of X_0 and continues to the LSB of X_1. After executing the timer interval of the LSB of X_1, the pattern returns to the MSB of X_0 and repeats. The GPIO state for each timing interval alternates from Low to High and the first interval of the pattern represents the time when the GPIO is Low. When a timing interval of Zero is reached, it is skipped and moves on to the next interval. Change-Id: I97833f81005d61118617441aab8fd1876ab531ac CRs-Fixed: 733909
-rw-r--r--CORE/MAC/inc/sirApi.h10
-rw-r--r--CORE/MAC/src/include/sirParams.h2
-rw-r--r--CORE/SME/inc/sme_Api.h12
-rw-r--r--CORE/SME/src/sme_common/sme_Api.c42
-rw-r--r--CORE/WDA/inc/wlan_qct_wda.h4
-rw-r--r--Kbuild1
6 files changed, 71 insertions, 0 deletions
diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h
index c7f351d8b0fa..5d687d4a6690 100644
--- a/CORE/MAC/inc/sirApi.h
+++ b/CORE/MAC/inc/sirApi.h
@@ -5521,6 +5521,16 @@ typedef struct
} tSirDhcpSrvOffloadInfo, *tpSirDhcpSrvOffloadInfo;
#endif /* DHCP_SERVER_OFFLOAD */
+#ifdef WLAN_FEATURE_GPIO_LED_FLASHING
+typedef struct
+{
+ tANI_U32 reqId;
+ tANI_U32 pattern_id; /* pattern identifier. 0: disconnected 1: connected*/
+ tANI_U32 led_x0; /* led flashing parameter0 */
+ tANI_U32 led_x1; /* led flashing parameter1 */
+} tSirLedFlashingReq, *tpSirLedFlashingReq;
+#endif
+
/* find the size of given member within a structure */
#ifndef member_size
#define member_size(type, member) (sizeof(((type *)0)->member))
diff --git a/CORE/MAC/src/include/sirParams.h b/CORE/MAC/src/include/sirParams.h
index 9c5c6db54d77..b61c8cb4e88f 100644
--- a/CORE/MAC/src/include/sirParams.h
+++ b/CORE/MAC/src/include/sirParams.h
@@ -659,6 +659,8 @@ typedef struct sSirMbMsgP2p
#ifdef DHCP_SERVER_OFFLOAD
#define SIR_HAL_SET_DHCP_SERVER_OFFLOAD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 292)
#endif /* DHCP_SERVER_OFFLOAD */
+#define SIR_HAL_LED_FLASHING_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 293)
+
#define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF)
// CFG message types
diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h
index b3f319412799..6b2498ba6cf1 100644
--- a/CORE/SME/inc/sme_Api.h
+++ b/CORE/SME/inc/sme_Api.h
@@ -4081,4 +4081,16 @@ eHalStatus sme_setDhcpSrvOffload(tHalHandle hHal,
tSirDhcpSrvOffloadInfo *pDhcpSrvInfo);
#endif /* DHCP_SERVER_OFFLOAD */
+#ifdef WLAN_FEATURE_GPIO_LED_FLASHING
+/* ---------------------------------------------------------------------------
+ \fn sme_SetLedFlashing
+ \brief API to set the LED flashing feature.
+ \param hHal - The handle returned by macOpen.
+ \param x0, x1 - led flashing parameters
+ \return eHalStatus
+ ---------------------------------------------------------------------------*/
+eHalStatus sme_SetLedFlashing (tHalHandle hHal, tANI_U8 type,
+ tANI_U32 x0, tANI_U32 x1);
+#endif
+
#endif //#if !defined( __SME_API_H )
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c
index 200637bdab10..8a4f65fc776b 100644
--- a/CORE/SME/src/sme_common/sme_Api.c
+++ b/CORE/SME/src/sme_common/sme_Api.c
@@ -14139,3 +14139,45 @@ eHalStatus sme_setDhcpSrvOffload(tHalHandle hHal,
return (status);
}
#endif /* DHCP_SERVER_OFFLOAD */
+
+#ifdef WLAN_FEATURE_GPIO_LED_FLASHING
+/* ---------------------------------------------------------------------------
+ \fn sme_SetLedFlashing
+ \brief API to set the Led flashing parameters.
+ \param hHal - The handle returned by macOpen.
+ \param x0, x1 - led flashing parameters
+ \return eHalStatus
+ ---------------------------------------------------------------------------*/
+eHalStatus sme_SetLedFlashing (tHalHandle hHal, tANI_U8 type,
+ tANI_U32 x0, tANI_U32 x1)
+{
+ eHalStatus status = eHAL_STATUS_SUCCESS;
+ VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;
+ tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
+ vos_msg_t vosMessage;
+ tSirLedFlashingReq *ledflashing;
+
+ ledflashing = vos_mem_malloc(sizeof(*ledflashing));
+ if (!ledflashing) {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ FL("Not able to allocate memory for WDA_LED_TIMING_REQ"));
+ return eHAL_STATUS_FAILURE;
+ }
+
+ ledflashing->pattern_id = type;
+ ledflashing->led_x0 = x0;
+ ledflashing->led_x1 = x1;
+
+ if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) {
+ /* Serialize the req through MC thread */
+ vosMessage.bodyptr = ledflashing;
+ vosMessage.type = WDA_LED_FLASHING_REQ;
+ vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage);
+ if (!VOS_IS_STATUS_SUCCESS(vosStatus))
+ status = eHAL_STATUS_FAILURE;
+ sme_ReleaseGlobalLock(&pMac->sme);
+ }
+ return status;
+}
+#endif
+
diff --git a/CORE/WDA/inc/wlan_qct_wda.h b/CORE/WDA/inc/wlan_qct_wda.h
index 0181e7c3dc77..4f1a4bf72fcf 100644
--- a/CORE/WDA/inc/wlan_qct_wda.h
+++ b/CORE/WDA/inc/wlan_qct_wda.h
@@ -989,6 +989,10 @@ tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb);
#define WDA_SET_DHCP_SERVER_OFFLOAD_CMD SIR_HAL_SET_DHCP_SERVER_OFFLOAD
#endif /* DHCP_SERVER_OFFLOAD */
+#ifdef WLAN_FEATURE_GPIO_LED_FLASHING
+#define WDA_LED_FLASHING_REQ SIR_HAL_LED_FLASHING_REQ
+#endif
+
tSirRetStatus wdaPostCtrlMsg(tpAniSirGlobal pMac, tSirMsgQ *pMsg);
#define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40 // Bit 6 will be used to control BD rate for Management frames
diff --git a/Kbuild b/Kbuild
index 10bee2f20f54..2f829b6c0890 100644
--- a/Kbuild
+++ b/Kbuild
@@ -919,6 +919,7 @@ endif
ifeq ($(CONFIG_QCA_WIFI_SDIO), 1)
CDEFINES += -DFEATURE_WLAN_FORCE_SAP_SCC
CDEFINES += -DDHCP_SERVER_OFFLOAD
+CDEFINES += -DWLAN_FEATURE_GPIO_LED_FLASHING
endif
ifeq ($(CONFIG_ARCH_MSM), y)