OSDN Git Service

net: wireless: bcm4329: Fix roaming failure case
authorGreg Goldman <ggoldman@broadcom.com>
Fri, 3 Sep 2010 00:03:57 +0000 (17:03 -0700)
committerDmitry Shmidt <dimitrysh@google.com>
Fri, 3 Sep 2010 00:04:52 +0000 (17:04 -0700)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/net/wireless/bcm4329/include/epivers.h
drivers/net/wireless/bcm4329/wl_iw.c
drivers/net/wireless/bcm4329/wl_iw.h

index caceabd..51b0da3 100644 (file)
 
 #define        EPI_RC_NUMBER           248
 
-#define        EPI_INCREMENTAL_NUMBER  0
+#define        EPI_INCREMENTAL_NUMBER  2
 
 #define        EPI_BUILD_NUMBER        0
 
-#define        EPI_VERSION             4, 218, 248, 0
+#define        EPI_VERSION             4, 218, 248, 2
 
-#define        EPI_VERSION_NUM         0x04daf800
+#define        EPI_VERSION_NUM         0x04daf802
 
 
-#define        EPI_VERSION_STR         "4.218.248.0"
-#define        EPI_ROUTER_VERSION_STR  "4.219.248.0"
+#define        EPI_VERSION_STR         "4.218.248.2"
+#define        EPI_ROUTER_VERSION_STR  "4.219.248.2"
 
 #endif 
index c6b2e8a..4806ede 100644 (file)
@@ -257,6 +257,8 @@ wl_iw_set_scan(
        union iwreq_data *wrqu,
        char *extra
 );
+
+#if !defined(CSCAN)
 static int
 wl_iw_get_scan(
        struct net_device *dev,
@@ -272,7 +274,7 @@ wl_iw_get_scan_prep(
        char *extra,
        short max_size
 );
-
+#endif
 
 static void swap_key_from_BE(
                wl_wsec_key_t *key
@@ -2370,6 +2372,7 @@ wl_iw_mlme(
 }
 #endif 
 
+#ifndef WL_IW_USE_ISCAN
 static int
 wl_iw_get_aplist(
        struct net_device *dev,
@@ -2445,6 +2448,7 @@ wl_iw_get_aplist(
        }
        return 0;
 }
+#endif
 
 #ifdef WL_IW_USE_ISCAN
 static int
@@ -2470,7 +2474,8 @@ wl_iw_iscan_get_aplist(
                return -EINVAL;
 
        if ((!iscan) || (iscan->sysioc_pid < 0)) {
-               return wl_iw_get_aplist(dev, info, dwrq, extra);
+               WL_ERROR(("%s error\n", __FUNCTION__));
+               return 0;
        }
 
        buf = iscan->list_hdr;
@@ -3195,9 +3200,7 @@ wl_iw_iscan_set_scan(
 #endif
 
        if ((!iscan) || (iscan->sysioc_pid < 0)) {
-               WL_TRACE(("%s use backup if iscan thread is not successful\n", \
-                        __FUNCTION__));
-               ret = wl_iw_set_scan(dev, info, wrqu, extra);
+               WL_ERROR(("%s error\n", __FUNCTION__));
                goto set_scan_end;
        }
 
@@ -3399,6 +3402,7 @@ wl_iw_handle_scanresults_ies(char **event_p, char *end,
        return 0;
 }
 
+#if !defined(CSCAN)
 static uint
 wl_iw_get_scan_prep(
        wl_scan_results_t *list,
@@ -3555,7 +3559,6 @@ wl_iw_get_scan(
        }
 #endif
 
-
        if (g_scan_specified_ssid) {
                
                list = kmalloc(len, GFP_KERNEL);
@@ -3569,10 +3572,12 @@ wl_iw_get_scan(
        memset(list, 0, len);
        list->buflen = htod32(len);
        if ((error = dev_wlc_ioctl(dev, WLC_SCAN_RESULTS, list, len))) {
-               WL_TRACE(("%s: %s : Scan_results ERROR %d\n", dev->name, __FUNCTION__, len));
+               WL_ERROR(("%s: %s : Scan_results ERROR %d\n", dev->name, __FUNCTION__, error));
                dwrq->length = len;
-               if (g_scan_specified_ssid)
+               if (g_scan_specified_ssid) {
+                       g_scan_specified_ssid = 0;
                        kfree(list);
+               }
                return 0;
        }
        list->buflen = dtoh32(list->buflen);
@@ -3671,6 +3676,7 @@ wl_iw_get_scan(
        WL_TRACE(("%s return to WE %d bytes APs=%d\n", __FUNCTION__, dwrq->length, list->count));
        return 0;
 }
+#endif
 
 #if defined(WL_IW_USE_ISCAN)
 static int
@@ -3717,8 +3723,8 @@ wl_iw_iscan_get_scan(
        }
 
        if ((!iscan) || (iscan->sysioc_pid < 0)) {
-               WL_TRACE(("%ssysioc_pid\n", __FUNCTION__));
-               return wl_iw_get_scan(dev, info, dwrq, extra);
+               WL_ERROR(("%ssysioc_pid\n", __FUNCTION__));
+               return -EAGAIN;
        }
 
 #if !defined(CSCAN)
@@ -7217,6 +7223,8 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data)
        uint32 datalen = ntoh32(e->datalen);
        uint32 status =  ntoh32(e->status);
        uint32 toto;
+       static uint32 roam_no_success = 0;
+       static bool roam_no_success_send = FALSE;
 
        memset(&wrqu, 0, sizeof(wrqu));
        memset(extra, 0, sizeof(extra));
@@ -7282,12 +7290,24 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data)
                break;
        case WLC_E_ROAM:
                if (status != WLC_E_STATUS_SUCCESS) {
-                       WL_ERROR(("ROAMING did not succeeded, keep status Quo\n"));
-                       goto wl_iw_event_end;
+                       roam_no_success++;
+                       if ((roam_no_success == 3) && (roam_no_success_send == FALSE)) {
+
+                               roam_no_success_send = TRUE;
+                               bzero(wrqu.addr.sa_data, ETHER_ADDR_LEN);
+                               bzero(&extra, ETHER_ADDR_LEN);
+                               cmd = SIOCGIWAP;
+                               WL_ERROR(("%s  ROAMING did not succeeded , send Link Down\n", \
+                                       __FUNCTION__));
+                       } else {
+                               WL_TRACE(("##### ROAMING did not succeeded %d\n", roam_no_success));
+                               goto wl_iw_event_end;
+                       }
+               } else {
+                       memcpy(wrqu.addr.sa_data, &e->addr.octet, ETHER_ADDR_LEN);
+                       wrqu.addr.sa_family = ARPHRD_ETHER;
+                       cmd = SIOCGIWAP;
                }
-               memcpy(wrqu.addr.sa_data, &e->addr.octet, ETHER_ADDR_LEN);
-               wrqu.addr.sa_family = ARPHRD_ETHER;
-               cmd = SIOCGIWAP;
                break;
        case WLC_E_DEAUTH_IND:
        case WLC_E_DISASSOC_IND:
@@ -7343,6 +7363,8 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data)
                                wl_iw_send_priv_event(priv_dev, "AP_UP");
                        } else {
                                WL_TRACE(("STA_LINK_UP\n"));
+                               roam_no_success_send = FALSE;
+                               roam_no_success = 0;
                        }
 #endif
                        WL_TRACE(("Link UP\n"));
index 866fbd5..6381472 100644 (file)
@@ -47,7 +47,7 @@
 #define BAND_SET_CMD                           "SETBAND"
 #define DTIM_SKIP_GET_CMD                      "DTIMSKIPGET"
 #define DTIM_SKIP_SET_CMD                      "DTIMSKIPSET"
-#define SETSUSPEND_CMD                         "SETSUSPEND"
+#define SETSUSPEND_CMD                         "SETSUSPENDOPT"
 #define PNOSSIDCLR_SET_CMD                     "PNOSSIDCLR"
 #define PNOSETUP_SET_CMD                       "PNOSETUP"
 #define PNOENABLE_SET_CMD                      "PNOFORCE"