prima: WLAN Driver Release 3.2.0.10
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 9f59945..85044f5 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2012, The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -141,8 +141,6 @@
/* the Android framework expects this param even though we don't use it */
#define BUF_LEN 20
static char fwpath[BUF_LEN];
-module_param_string(fwpath, fwpath, BUF_LEN,
- S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
/*
* The rate at which the driver sends RESTART event to supplicant
@@ -397,7 +395,7 @@
ret = -EFAULT;
}
}
- if(strncmp(priv_data.buf, "SETBAND", 7) == 0)
+ else if(strncmp(priv_data.buf, "SETBAND", 7) == 0)
{
tANI_U8 *ptr = (tANI_U8*)priv_data.buf ;
int ret = 0 ;
@@ -412,6 +410,20 @@
/* Change band request received */
ret = hdd_setBand_helper(dev, ptr);
}
+ else if ( strncasecmp(command, "COUNTRY", 7) == 0 )
+ {
+ char *country_code;
+
+ country_code = command + 8;
+ ret = (int)sme_ChangeCountryCode(pHddCtx->hHal, NULL, country_code,
+ pAdapter, pHddCtx->pvosContext);
+ if( 0 != ret )
+ {
+ VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL,
+ "%s: SME Change Country code fail ret=%d\n",__func__, ret);
+
+ }
+ }
}
exit:
if (command)
@@ -3910,17 +3922,17 @@
/**---------------------------------------------------------------------------
- \brief hdd_module_init() - Init Function
+ \brief hdd_driver_init() - Core Driver Init Function
- This is the driver entry point (invoked when module is loaded using insmod)
+ This is the driver entry point - called in different timeline depending
+ on whether the driver is statically or dynamically linked
\param - None
\return - 0 for success, non zero for failure
--------------------------------------------------------------------------*/
-
-static int __init hdd_module_init ( void)
+static int hdd_driver_init( void)
{
VOS_STATUS status;
v_CONTEXT_t pVosContext = NULL;
@@ -4132,6 +4144,63 @@
return ret_status;
}
+/**---------------------------------------------------------------------------
+
+ \brief hdd_module_init() - Init Function
+
+ This is the driver entry point (invoked when module is loaded using insmod)
+
+ \param - None
+
+ \return - 0 for success, non zero for failure
+
+ --------------------------------------------------------------------------*/
+#ifdef MODULE
+static int __init hdd_module_init ( void)
+{
+ return hdd_driver_init();
+}
+
+static int fwpath_changed_handler(const char *kmessage,
+ struct kernel_param *kp)
+{
+ /* nothing to do when driver is DLKM */
+ return 0;
+}
+#else /* #ifdef MODULE */
+static int __init hdd_module_init ( void)
+{
+ /* Driver initialization is delayed to fwpath_changed_handler */
+ return 0;
+}
+
+/**---------------------------------------------------------------------------
+
+ \brief fwpath_changed_handler() - Handler Function
+
+ This is the driver entry point
+ - delayed driver initialization when driver is statically linked
+ - invoked when module parameter is modified from userpspace to signal
+ initializing the WLAN driver
+
+ \return - 0 for success, non zero for failure
+
+ --------------------------------------------------------------------------*/
+static int fwpath_changed_handler(const char *kmessage,
+ struct kernel_param *kp)
+{
+ static int drv_inited = 0;
+
+ if (drv_inited) {
+ return 0;
+ }
+
+ drv_inited = 1;
+
+ return hdd_driver_init();
+}
+#endif /* #ifdef MODULE */
+
/**---------------------------------------------------------------------------
@@ -4620,3 +4689,6 @@
#if defined(WLAN_SOFTAP_FEATURE) || defined(ANI_MANF_DIAG)
module_param(con_mode, int, 0);
#endif
+
+module_param_call(fwpath, fwpath_changed_handler, param_get_string, fwpath,
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);