diff options
| author | Tse-Yu Lo <tseyul@qca.qualcomm.com> | 2014-10-02 13:50:03 +0800 |
|---|---|---|
| committer | AnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com> | 2014-10-07 17:38:29 +0530 |
| commit | 002b875c15c30b36eaf97d4002ccfa3375582cf7 (patch) | |
| tree | 79b20a2f46e1d7f040d540b12a9c64dc247a351e | |
| parent | 6fd5fd48dd9bf862a21d01efccdbd833d9b877bb (diff) | |
wlan: HDD: add GPIO LED flashing feature
Pass 4 parameters from user to firmware for LED flashing control. The
1st and 2nd parameters are used for non-connected state and the 3rd and
4th parameters are used for connected state.
The LED GPIO control in each state 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: Idf9786e45d368b3d99ceb619e5ab8de6a30edb8e
CRs-Fixed: 733909
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_wext.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c index c385a2d88c5c..04de0a59fccb 100644 --- a/CORE/HDD/src/wlan_hdd_wext.c +++ b/CORE/HDD/src/wlan_hdd_wext.c @@ -374,6 +374,9 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2}, #define WE_MTRACE_DUMP_CMD 8 #define WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD 9 +#ifdef WLAN_FEATURE_GPIO_LED_FLASHING +#define WE_LED_FLASHING_PARAM 10 +#endif #ifdef FEATURE_WLAN_TDLS #undef MAX_VAR_ARGS #define MAX_VAR_ARGS 11 @@ -381,7 +384,6 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2}, #define MAX_VAR_ARGS 7 #endif - /* Private ioctls (with no sub-ioctls) */ /* note that they must be odd so that they have "get" semantics */ #define WLAN_PRIV_ADD_TSPEC (SIOCIWFIRSTPRIV + 9) @@ -7670,6 +7672,31 @@ static int __iw_set_var_ints_getnone(struct net_device *dev, } } break; + +#ifdef WLAN_FEATURE_GPIO_LED_FLASHING + case WE_LED_FLASHING_PARAM: + { + int i; + if (num_args != 4) { + hddLog(LOGE, + FL("gpio_control: 4 parameters are required")); + return -EINVAL; + } + + for (i = 0; i < num_args; i++) { + if (apps_args[i] >= 0x7fffffff) { + hddLog(LOGE, + FL("gpio_control: parameter should be less than 0x7fffffff")); + return -EINVAL; + } + } + sme_SetLedFlashing(WLAN_HDD_GET_HAL_CTX(pAdapter), + 0, apps_args[0], apps_args[1]); + sme_SetLedFlashing(WLAN_HDD_GET_HAL_CTX(pAdapter), + 1, apps_args[2], apps_args[3]); + } + break; +#endif default: { hddLog(LOGE, FL("Invalid IOCTL command %d"), sub_cmd ); @@ -10649,6 +10676,13 @@ static const struct iw_priv_args we_private_args[] = { 0, "setUnitTestCmd" }, +#ifdef WLAN_FEATURE_GPIO_LED_FLASHING + { WE_LED_FLASHING_PARAM, + IW_PRIV_TYPE_INT | MAX_VAR_ARGS, + 0, + "gpio_control" }, +#endif + /* handlers for main ioctl */ { WLAN_PRIV_ADD_TSPEC, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | HDD_WLAN_WMM_PARAM_COUNT, |
