Created
November 21, 2011 09:35
-
-
Save Kwiboo/1382150 to your computer and use it in GitHub Desktop.
bcm4329: expose firmware_path to userland, backported from bcmdhd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/drivers/net/wireless/bcm4329/dhd_linux.c b/drivers/net/wireless/bcm4329/dhd_linux.c | |
index 90cc929..1c82a96 100644 | |
--- a/drivers/net/wireless/bcm4329/dhd_linux.c | |
+++ b/drivers/net/wireless/bcm4329/dhd_linux.c | |
@@ -319,7 +319,7 @@ struct semaphore dhd_registration_sem; | |
#define DHD_REGISTRATION_TIMEOUT 12000 /* msec : allowed time to finished dhd registration */ | |
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */ | |
/* load firmware and/or nvram values from the filesystem */ | |
-module_param_string(firmware_path, firmware_path, MOD_PARAM_PATHLEN, 0); | |
+module_param_string(firmware_path, firmware_path, MOD_PARAM_PATHLEN, 0660); | |
module_param_string(nvram_path, nvram_path, MOD_PARAM_PATHLEN, 0); | |
/* Error bits */ | |
@@ -1904,6 +1904,15 @@ dhd_open(struct net_device *net) | |
uint32 toe_ol; | |
#endif | |
int ifidx; | |
+ int32 ret = 0; | |
+ dhd_os_wake_lock(&dhd->pub); | |
+ /* Update FW path if it was changed */ | |
+ if ((firmware_path != NULL) && (firmware_path[0] != '\0')) { | |
+ if (firmware_path[strlen(firmware_path)-1] == '\n') | |
+ firmware_path[strlen(firmware_path)-1] = '\0'; | |
+ strcpy(fw_path, firmware_path); | |
+ firmware_path[0] = '\0'; | |
+ } | |
/* Force start if ifconfig_up gets called before START command */ | |
wl_control_wl_start(net); | |
@@ -1913,7 +1922,8 @@ dhd_open(struct net_device *net) | |
if ((dhd->iflist[ifidx]) && (dhd->iflist[ifidx]->state == WLC_E_IF_DEL)) { | |
DHD_ERROR(("%s: Error: called when IF already deleted\n", __FUNCTION__)); | |
- return -1; | |
+ ret = -1; | |
+ goto exit; | |
} | |
if (ifidx == 0) { /* do it only for primary eth0 */ | |
@@ -1935,7 +1945,9 @@ dhd_open(struct net_device *net) | |
dhd->pub.up = 1; | |
OLD_MOD_INC_USE_COUNT; | |
- return 0; | |
+exit: | |
+ dhd_os_wake_unlock(&dhd->pub); | |
+ return ret; | |
} | |
osl_t * |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment