Ticket #8667: 0001-libertas-Do-not-schedule-a-scan-when-one-is-in-prog.patch

File 0001-libertas-Do-not-schedule-a-scan-when-one-is-in-prog.patch, 2.5 kB (added by jcardona, 6 years ago)
  • drivers/net/wireless/libertas/scan.c

    From 5674c531bbdaf429b48da35c9e02305ad4cced07 Mon Sep 17 00:00:00 2001
    From: Javier Cardona <javier@cozybit.com>
    Date: Thu, 25 Sep 2008 16:37:12 -0700
    Subject: [PATCH] libertas: Do not schedule a scan when one is in progress.
    
    wpa_supplicant will do a scan before associating.  After reasonable period of
    time, it will try to read the results via a get_scan_results ioctl
    (SIOCGIWSCAN).  If no results are available (for instance if the driver
    returns -EAGAIN) the supplicant will request another scan via the set_scan
    ioctl (SIOCSIWSCAN).
    
    When receiving the -EAGAIN error the caller should just retry a SIOCGIWSCAN.
    But wpa_supplicant does not check the return error and just re-issues a
    SIOCSIWSCAN in all cases, which worsens the problem.  So a better fix for this
    problem would probably be in wpa_supplicant.
    
    But for now we can address this problem in the driver by not scheduling new
    scans when one is in progress.
    
    Also, modify lbs_get_scan so that -EAGAIN errors show up in debug logs.
    ---
     drivers/net/wireless/libertas/scan.c |   13 +++++++++++--
     1 files changed, 11 insertions(+), 2 deletions(-)
    
    diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
    index 69f94c9..18f2377 100644
    a b  
    13721372        } 
    13731373        */ 
    13741374 
     1375        if (priv->last_scanned_channel) { 
     1376                lbs_deb_scan("scan in progress: ignore scan req\n"); 
     1377                goto out; 
     1378        } 
     1379 
    13751380        if (!delayed_work_pending(&priv->scan_work)) 
    13761381                queue_delayed_work(priv->work_thread, &priv->scan_work, 
    13771382                        msecs_to_jiffies(50)); 
     
    13811386        if (priv->surpriseremoved) 
    13821387                return -EIO; 
    13831388 
     1389out: 
    13841390        lbs_deb_leave(LBS_DEB_SCAN); 
    13851391        return 0; 
    13861392} 
     
    14101416        lbs_deb_enter(LBS_DEB_SCAN); 
    14111417 
    14121418        /* iwlist should wait until the current scan is finished */ 
    1413         if (priv->last_scanned_channel) 
    1414                 return -EAGAIN; 
     1419        if (priv->last_scanned_channel) { 
     1420                err = -EAGAIN; 
     1421                goto out; 
     1422        } 
    14151423 
    14161424        /* Update RSSI if current BSS is a locally created ad-hoc BSS */ 
    14171425        if ((priv->mode == IW_MODE_ADHOC) && priv->adhoccreate) { 
     
    14531461        dwrq->length = (ev - extra); 
    14541462        dwrq->flags = 0; 
    14551463 
     1464out: 
    14561465        lbs_deb_leave_args(LBS_DEB_SCAN, "ret %d", err); 
    14571466        return err; 
    14581467}