source: trunk/package/mac80211/patches/607-rt2x00-allow_disabling_bands_through_platform_data.patch @ 30871

Last change on this file since 30871 was 30871, checked in by nbd, 4 years ago

rt2x00: merge a fix for random tx stalls

File size: 1.3 KB
  • include/linux/rt2x00_platform.h

    a b  
    1414 
    1515struct rt2x00_platform_data { 
    1616        char *eeprom_file_name; 
     17 
     18        int disable_2ghz; 
     19        int disable_5ghz; 
    1720}; 
    1821 
    1922#endif /* _RT2X00_PLATFORM_H */ 
  • drivers/net/wireless/rt2x00/rt2x00dev.c

    a b static int rt2x00lib_probe_hw_modes(stru 
    833833        unsigned int num_rates; 
    834834        unsigned int i; 
    835835 
     836        if (rt2x00dev->dev->platform_data) { 
     837                struct rt2x00_platform_data *pdata; 
     838 
     839                pdata = rt2x00dev->dev->platform_data; 
     840                if (pdata->disable_2ghz) 
     841                        spec->supported_bands &= ~SUPPORT_BAND_2GHZ; 
     842                if (pdata->disable_5ghz) 
     843                        spec->supported_bands &= ~SUPPORT_BAND_5GHZ; 
     844        } 
     845 
     846        if ((spec->supported_bands & SUPPORT_BAND_BOTH) == 0) { 
     847                ERROR(rt2x00dev, "No supported bands\n"); 
     848                return -EINVAL; 
     849        } 
     850 
     851 
    836852        num_rates = 0; 
    837853        if (spec->supported_rates & SUPPORT_RATE_CCK) 
    838854                num_rates += 4; 
  • drivers/net/wireless/rt2x00/rt2x00.h

    a b struct hw_mode_spec { 
    425425        unsigned int supported_bands; 
    426426#define SUPPORT_BAND_2GHZ       0x00000001 
    427427#define SUPPORT_BAND_5GHZ       0x00000002 
     428#define SUPPORT_BAND_BOTH       (SUPPORT_BAND_2GHZ | SUPPORT_BAND_5GHZ) 
    428429 
    429430        unsigned int supported_rates; 
    430431#define SUPPORT_RATE_CCK        0x00000001 
Note: See TracBrowser for help on using the repository browser.