2012-02-18 19:36:09 +02:00
|
|
|
--- a/include/linux/rt2x00_platform.h
|
|
|
|
+++ b/include/linux/rt2x00_platform.h
|
|
|
|
@@ -14,6 +14,9 @@
|
|
|
|
|
|
|
|
struct rt2x00_platform_data {
|
|
|
|
char *eeprom_file_name;
|
|
|
|
+
|
|
|
|
+ int disable_2ghz;
|
|
|
|
+ int disable_5ghz;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _RT2X00_PLATFORM_H */
|
|
|
|
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
|
|
|
|
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
|
2012-03-10 15:31:34 +02:00
|
|
|
@@ -833,6 +833,22 @@ static int rt2x00lib_probe_hw_modes(stru
|
2012-02-18 19:36:09 +02:00
|
|
|
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;
|
|
|
|
--- a/drivers/net/wireless/rt2x00/rt2x00.h
|
|
|
|
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
|
2012-02-28 00:56:05 +02:00
|
|
|
@@ -425,6 +425,7 @@ struct hw_mode_spec {
|
2012-02-18 19:36:09 +02:00
|
|
|
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
|