Changeset 19024


Ignore:
Timestamp:
04/13/12 13:58:21 (13 months ago)
Author:
BrainSlayer
Message:

backward compatiblity fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/router/libutils/wl.c

    r19023 r19024  
    594594#else 
    595595 
     596#ifndef CHSPEC_IS40 
     597 
     598#define WL_CHANSPEC_CTL_SB_MASK         0x0300 
     599#define WL_CHANSPEC_CTL_SB_LOWER        0x0100 
     600#define WL_CHANSPEC_CTL_SB_UPPER        0x0200 
     601 
     602#define WL_CHANSPEC_BW_MASK             0x0C00 
     603#define WL_CHANSPEC_BW_40               0x0C00 
     604 
     605#define CHSPEC_CHANNEL(chspec)  ((uint8)(chspec & 0xff)) 
     606 
     607#define CHSPEC_IS40(chspec)     (((chspec) & WL_CHANSPEC_BW_MASK) == WL_CHANSPEC_BW_40) 
     608#define CHSPEC_SB_UPPER(chspec) ((chspec & WL_CHANSPEC_CTL_SB_MASK) == WL_CHANSPEC_CTL_SB_UPPER) 
     609#define CHSPEC_SB_LOWER(chspec) ((chspec & WL_CHANSPEC_CTL_SB_MASK) == WL_CHANSPEC_CTL_SB_LOWER) 
     610#endif 
     611 
    596612static int getcenterchannel(chanspec_t chspec) 
    597613{ 
    598614        const char *band; 
    599615        uint ctl_chan; 
    600  
     616        int channel; 
    601617        channel = CHSPEC_CHANNEL(chspec); 
    602618        /* check for non-default band spec */ 
     619 
    603620        if (CHSPEC_IS40(chspec)) { 
    604621                if (CHSPEC_SB_UPPER(chspec)) { 
     
    608625                } 
    609626        } 
     627        return channel; 
    610628} 
    611629#endif 
     
    662680        else if (nvram_nmatch("10", "wl%d_nbw", wl)) 
    663681                mask = WL_CHANSPEC_BW_10; 
     682#ifdef WL_CHANSPEC_BW_5 
    664683        else if (nvram_nmatch("5", "wl%d_nbw", wl)) 
    665684                mask = WL_CHANSPEC_BW_5; 
     685#endif 
    666686 
    667687        if (bw > 20) { 
Note: See TracChangeset for help on using the changeset viewer.