Ignore:
Timestamp:
04/18/12 23:32:05 (14 months ago)
Author:
BrainSlayer
Message:

fix 5 ghz scanning (takes longer than normal)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/router/services/tools/site_survey_broadcom.c

    r19021 r19052  
    425425        } 
    426426        params.bss_type = DOT11_BSSTYPE_ANY; 
    427         params.scan_type = -1; 
     427        params.scan_type = 0; 
    428428        params.nprobes = -1; 
    429429        params.active_time = -1; 
    430430        params.passive_time = -1; 
    431431        params.home_time = -1; 
     432        params.channel_num = 0; 
    432433 
    433434        /* 
     
    438439                return -1; 
    439440        } 
    440         sleep(1); 
    441         bzero(buf, sizeof(buf)); 
    442         scan_res->buflen = sizeof(buf); 
    443  
    444         if (wl_ioctl(dev, WLC_SCAN_RESULTS, buf, WLC_IOCTL_MAXLEN) < 0) { 
    445                 fprintf(stderr, "scan results failed\n"); 
    446                 return -1; 
     441        int count = 10; 
     442        int ret = 0; 
     443        while ((count--) > 0)   //scan for max 5 seconds 
     444        { 
     445                usleep(500 * 1000); 
     446 
     447                bzero(buf, sizeof(buf)); 
     448                scan_res->buflen = sizeof(buf); 
     449                ret = wl_ioctl(dev, WLC_SCAN_RESULTS, buf, WLC_IOCTL_MAXLEN); 
     450                if (!ret) 
     451                        break; 
     452        } 
     453        if (ret < 0) { 
     454                fprintf(stderr, "scan failed with errorcode %d\n", ret); 
    447455        } 
    448456 
Note: See TracChangeset for help on using the changeset viewer.