net: wireless: bcmdhd: Add info_string param with driver/fw/chip info
authorDmitry Shmidt <dimitrysh@google.com>
Thu, 12 Jul 2012 23:58:00 +0000 (16:58 -0700)
committerDmitry Shmidt <dimitrysh@google.com>
Fri, 13 Jul 2012 00:25:05 +0000 (17:25 -0700)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/net/wireless/bcmdhd/dhd.h
drivers/net/wireless/bcmdhd/dhd_linux.c
drivers/net/wireless/bcmdhd/dhd_sdio.c

index 3ffbf0b82481dce20d25026cf2baa382c20d150f..f047c8efa8bc3bbc457a6932d5bb36c317396bf6 100644 (file)
@@ -432,6 +432,7 @@ extern void dhd_os_sdlock_eventq(dhd_pub_t * pub);
 extern void dhd_os_sdunlock_eventq(dhd_pub_t * pub);
 extern bool dhd_os_check_hang(dhd_pub_t *dhdp, int ifidx, int ret);
 extern int net_os_send_hang_message(struct net_device *dev);
+extern void dhd_set_version_info(dhd_pub_t *pub, char *fw);
 
 #ifdef PNO_SUPPORT
 extern int dhd_pno_enable(dhd_pub_t *dhd, int pfn_enabled);
@@ -521,6 +522,8 @@ extern int dhd_bus_membytes(dhd_pub_t *dhdp, bool set, uint32 address, uint8 *da
 extern void dhd_print_buf(void *pbuf, int len, int bytes_per_line);
 extern bool dhd_is_associated(dhd_pub_t *dhd, void *bss_buf, int *retval);
 extern uint dhd_bus_chip_id(dhd_pub_t *dhdp);
+extern uint dhd_bus_chiprev_id(dhd_pub_t *dhdp);
+extern uint dhd_bus_chippkg_id(dhd_pub_t *dhdp);
 
 #if defined(KEEP_ALIVE)
 extern int dhd_keep_alive_onoff(dhd_pub_t *dhd);
@@ -609,6 +612,8 @@ extern uint dhd_pktgen_len;
 extern char fw_path[MOD_PARAM_PATHLEN];
 extern char nv_path[MOD_PARAM_PATHLEN];
 
+#define MOD_PARAM_INFOLEN      512
+
 #ifdef SOFTAP
 extern char fw_path2[MOD_PARAM_PATHLEN];
 #endif
index 657a1bf6a83a29176b4354b65aafd47c5a4d5b93..f4dd38fc77e27a24375edbf03397b750218ac423 100644 (file)
@@ -295,6 +295,13 @@ typedef struct dhd_info {
 char firmware_path[MOD_PARAM_PATHLEN];
 char nvram_path[MOD_PARAM_PATHLEN];
 
+/* load firmware and/or nvram values from the filesystem */
+module_param_string(firmware_path, firmware_path, MOD_PARAM_PATHLEN, 0660);
+module_param_string(nvram_path, nvram_path, MOD_PARAM_PATHLEN, 0);
+
+char info_string[MOD_PARAM_INFOLEN];
+module_param_string(info_string, info_string, MOD_PARAM_INFOLEN, 0444);
+
 int op_mode = 0;
 module_param(op_mode, int, 0644);
 extern int wl_control_wl_start(struct net_device *dev);
@@ -310,10 +317,6 @@ module_param(dhd_sysioc, uint, 0);
 /* Error bits */
 module_param(dhd_msg_level, int, 0);
 
-/* load firmware and/or nvram values from the filesystem */
-module_param_string(firmware_path, firmware_path, MOD_PARAM_PATHLEN, 0660);
-module_param_string(nvram_path, nvram_path, MOD_PARAM_PATHLEN, 0);
-
 /* Watchdog interval */
 uint dhd_watchdog_ms = 10;
 module_param(dhd_watchdog_ms, uint, 0);
@@ -3314,6 +3317,8 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
                /* Print fw version info */
                DHD_ERROR(("Firmware version = %s\n", buf));
 
+               dhd_set_version_info(dhd, buf);
+
                DHD_BLOG(buf, strlen(buf) + 1);
                DHD_BLOG(dhd_version, strlen(dhd_version) + 1);
 
@@ -4851,6 +4856,20 @@ int dhd_os_check_if_up(void *dhdp)
        return pub->up;
 }
 
+void dhd_set_version_info(dhd_pub_t *dhdp, char *fw)
+{
+       int i;
+
+       i = snprintf(info_string, sizeof(info_string),
+               "WLAN:\n  Driver: %s\n  Firmware: %s ", EPI_VERSION_STR, fw);
+
+       if (!dhdp)
+               return;
+       i = snprintf(&info_string[i], sizeof(info_string) - i,
+               "\n  Chip: %x Rev %x Pkg %x\n", dhd_bus_chip_id(dhdp),
+               dhd_bus_chiprev_id(dhdp), dhd_bus_chippkg_id(dhdp));
+}
+
 int dhd_ioctl_entry_local(struct net_device *net, wl_ioctl_t *ioc, int cmd)
 {
        int ifidx;
index 4834ca2f9ed152cf671ae34cb0c4fcdf26dbb472..5b744f4fb1b46782477b94181354d3c66851ae59 100644 (file)
@@ -6320,7 +6320,23 @@ uint dhd_bus_chip_id(dhd_pub_t *dhdp)
 {
        dhd_bus_t *bus = dhdp->bus;
 
-       return  bus->sih->chip;
+       return bus->sih->chip;
+}
+
+/* Get Chip Rev ID version */
+uint dhd_bus_chiprev_id(dhd_pub_t *dhdp)
+{
+       dhd_bus_t *bus = dhdp->bus;
+
+       return bus->sih->chiprev;
+}
+
+/* Get Chip Pkg ID version */
+uint dhd_bus_chippkg_id(dhd_pub_t *dhdp)
+{
+       dhd_bus_t *bus = dhdp->bus;
+
+       return bus->sih->chippkg;
 }
 
 int