net: wireless: bcmdhd: fix bcm43341 fw_path for softap
Om Prakash Singh [Wed, 27 Feb 2013 12:31:29 +0000 (17:31 +0530)]
Bug 1239409

Change-Id: I78e07aaf9665bd19838d1e46ee7b343dc9d347bf
Signed-off-by: Om Prakash Singh <omp@nvidia.com>
Reviewed-on: http://git-master/r/204600
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

drivers/net/wireless/bcmdhd/dhd_sdio.c

index c3d0041..1706bb7 100644 (file)
@@ -7509,16 +7509,22 @@ _dhdsdio_download_firmware(struct dhd_bus *bus)
                        goto err;
                }
 
-               char *ptr_fw = strstr(bus->fw_path, "fw_bcmdhd");
-               if (ptr_fw == NULL) {
+               if (strstr(bus->fw_path, "fw_bcmdhd_apsta")) { /* HOTSPOT mode */
+                       char *ptr_fw = strstr(bus->fw_path, "fw_bcmdhd_apsta");
+                       if (boardrev == BCM943341_WBFGN_2
+                                       || boardrev == BCM943341_WBFGN_3) {
+                               strcpy(ptr_fw, "fw_bcmdhd_apsta_a0.bin");
+                       }
+               } else if (strstr(bus->fw_path, "fw_bcmdhd")) { /* STATION mode */
+                       char *ptr_fw = strstr(bus->fw_path, "fw_bcmdhd");
+                       if (boardrev == BCM943341_WBFGN_2
+                                       || boardrev == BCM943341_WBFGN_3) {
+                               strcpy(ptr_fw, "fw_bcmdhd_a0.bin");
+                       }
+               } else {
                        DHD_ERROR(("%s: Invalid fw_path for bcm943341: %s\n",
-                                               __func__, bus->fw_path));
+                               __func__, bus->fw_path));
                        goto err;
-               } else if (boardrev == BCM943341_WBFGN_2
-                                        || boardrev == BCM943341_WBFGN_3) {
-                       strcpy(ptr_fw, "fw_bcmdhd_a0.bin");
-               } else if (boardrev == BCM943341_WBFGN_4) {
-                       strcpy(ptr_fw, "fw_bcmdhd.bin");
                }
 
                DHD_ERROR(("%s: Modified nv_path for bcm943341_wbfgn_x: %s\n",