rt2x00: allow disabling bands through platform_data
PATCH 2/3 rt2x00: allow disabling bands through platform_data
Signed-off-by Daniel Golle <[email protected]>
drivers/net/wireless/rt2x00/rt2x00.h +1 -0
@@ -426,6 +426,7 @@ struct hw_mode_spec {unsigned int supported_bands;#define SUPPORT_BAND_2GHZ 0x00000001#define SUPPORT_BAND_5GHZ 0x00000002 +#define SUPPORT_BAND_BOTH (SUPPORT_BAND_2GHZ | SUPPORT_BAND_5GHZ)unsigned int supported_rates;#define SUPPORT_RATE_CCK 0x00000001
drivers/net/wireless/rt2x00/rt2x00dev.c +16 -0
@@ -835,6 +835,22 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev,unsigned int num_rates;unsigned int i; +if (rt2x00dev->dev->platform_data) { +struct rt2x00_platform_data *pdata; + + pdata = rt2x00dev->dev->platform_data; +if (pdata->disable_2ghz) + spec->supported_bands &= ~SUPPORT_BAND_2GHZ ; +if (pdata->disable_5ghz) + spec->supported_bands &= ~SUPPORT_BAND_5GHZ ; + } + +if ((spec->supported_bands &SUPPORT_BAND_BOTH ) ==0 ) { +ERROR (rt2x00dev,"No supported bands\n" ); +return -EINVAL ; + } + + num_rates =0 ;if (spec->supported_rates &SUPPORT_RATE_CCK ) num_rates +=4 ;
include/linux/rt2x00_platform.h +3 -0
@@ -14,6 +14,9 @@struct rt2x00_platform_data {char *eeprom_file_name; + +int disable_2ghz; +int disable_5ghz; };#endif /* _RT2X00_PLATFORM_H */
Signature · 1 line
1.8.0.1
Hi Daniel,
Quoted 2 lines · Daniel Golle
Signed-off-by Daniel Golle <[email protected]>
Again we need a proper patch description here.
Also, can you explain why the enabling / disabling of individual bands needs to be done via platform data, as opposed to letting user space handle this?
Quoted 57 lines
drivers/net/wireless/rt2x00/rt2x00.h +1
-0@@ -426,6 +426,7 @@ struct hw_mode_spec {unsigned int supported_bands;#define SUPPORT_BAND_2GHZ 0x00000001#define SUPPORT_BAND_5GHZ 0x00000002 +#define SUPPORT_BAND_BOTH (SUPPORT_BAND_2GHZ | SUPPORT_BAND_5GHZ)unsigned int supported_rates;#define SUPPORT_RATE_CCK 0x00000001drivers/net/wireless/rt2x00/rt2x00dev.c +16
-0@@ -835,6 +835,22 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev,unsigned int num_rates;unsigned int i; +if (rt2x00dev->dev->platform_data) { +struct rt2x00_platform_data *pdata; + + pdata = rt2x00dev->dev->platform_data; +if (pdata->disable_2ghz) + spec->supported_bands &= ~SUPPORT_BAND_2GHZ ; +if (pdata->disable_5ghz) + spec->supported_bands &= ~SUPPORT_BAND_5GHZ ; + } + +if ((spec->supported_bands &SUPPORT_BAND_BOTH ) ==0 ) { +ERROR (rt2x00dev,"No supported bands\n" ); +return -EINVAL ; + } + + num_rates =0 ;if (spec->supported_rates &SUPPORT_RATE_CCK ) num_rates +=4 ;include/linux/rt2x00_platform.h +3
-0@@ -14,6 +14,9 @@struct rt2x00_platform_data {char *eeprom_file_name; + +int disable_2ghz; +int disable_5ghz; };#endif /* _RT2X00_PLATFORM_H */ Signature · 1 line
1.8.0.1
2012.12.11. 22:46 keltezéssel, Gertjan van Wingerde írta:
Quoted 11 lines
Hi Daniel,
Quoted 2 lines · Daniel Golle
Signed-off-by Daniel Golle <[email protected]>Again we need a proper patch description here.
Also, can you explain why the enabling / disabling of individual bands needs to be done via platform data, as opposed to letting user space handle this?
The patch should have been skipped for now. The explanation can be found here:
Quoted 1 line
http://rt2x00.serialmonkey.com/pipermail/users_rt2x00.serialmonkey.com/2012-November/005468.html
-Gabor