reset g_onoff in wifi driver insmode, to avoid wifi driver error when rmmod with...
authorhwg <hwg@I7-CH.(none)>
Mon, 12 Dec 2011 12:24:09 +0000 (20:24 +0800)
committerhwg <hwg@I7-CH.(none)>
Mon, 12 Dec 2011 12:24:09 +0000 (20:24 +0800)
drivers/net/wireless/bcm4319/dhd_linux.c
drivers/net/wireless/bcm4319/wl_iw.c
drivers/net/wireless/bcm4329/dhd_linux.c
drivers/net/wireless/bcm4329/wl_iw.c

index 81eef135a16d63c52c721561886f1198ee85fb0e..edfbc1080479b0f7d96f1f109d664b3238989fb9 100644 (file)
@@ -2527,6 +2527,7 @@ dhd_detach(dhd_pub_t *dhdp)
        }
 }
 
+extern void reset_g_onoff(void);
 void
 rockchip_wifi_exit_module(void)
 {
@@ -2563,6 +2564,8 @@ rockchip_wifi_init_module(void)
                return -EINVAL;
        } while (0);
 
+        reset_g_onoff();
+
        /* Call customer gpio to turn on power with WL_REG_ON signal */
        dhd_customer_gpio_wlan_ctrl(WLAN_POWER_ON);
 
index 146dffd529764dab9e4257b9d633146e12cc6ca6..27d1210fea3586d7e04b58d399673368eb4d91d3 100644 (file)
@@ -317,6 +317,14 @@ static void swap_key_to_BE(
        key->iv_initialized = dtoh32(key->iv_initialized);
 }
 
+void reset_g_onoff(void)
+{
+    if(g_onoff == G_WLAN_SET_OFF) {
+        printk("g_onoff = G_WLAN_SET_OFF, need to reset to G_WLAN_SET_ON\n");
+        g_onoff = G_WLAN_SET_ON;
+    }
+}
+
 static int
 dev_wlc_ioctl(
        struct net_device *dev,
index 4058cbc02589dd4bab0dd811c1ac5f9236a4258f..d45d5c97603f21ce092a8cf8275340f145ce2471 100644 (file)
@@ -2529,6 +2529,7 @@ dhd_detach(dhd_pub_t *dhdp)
        }
 }
 
+extern void reset_g_onoff(void);
 void
 rockchip_wifi_exit_module(void)
 {
@@ -2565,6 +2566,8 @@ rockchip_wifi_init_module(void)
                return -EINVAL;
        } while (0);
 
+        reset_g_onoff();
+
        /* Call customer gpio to turn on power with WL_REG_ON signal */
        dhd_customer_gpio_wlan_ctrl(WLAN_POWER_ON);
 
index 146dffd529764dab9e4257b9d633146e12cc6ca6..27d1210fea3586d7e04b58d399673368eb4d91d3 100644 (file)
@@ -317,6 +317,14 @@ static void swap_key_to_BE(
        key->iv_initialized = dtoh32(key->iv_initialized);
 }
 
+void reset_g_onoff(void)
+{
+    if(g_onoff == G_WLAN_SET_OFF) {
+        printk("g_onoff = G_WLAN_SET_OFF, need to reset to G_WLAN_SET_ON\n");
+        g_onoff = G_WLAN_SET_ON;
+    }
+}
+
 static int
 dev_wlc_ioctl(
        struct net_device *dev,