diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-11-04 12:34:32 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-06 16:48:52 -0500 |
commit | 4f2c53268ad1bdc7d6d12ca8bd110bb288a14300 (patch) | |
tree | d50c8f2b5246197fbecad9405d6606c5cdb97b3d /drivers/net/wireless | |
parent | ada0394cede08702b604a4c8ee13409a4109e773 (diff) |
rt2800usb: add rt2800_mcu_request() wrapper
Part of preparations for later code unification.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800usb.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index 15aed2916e0c..3783fdc4251f 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | |||
@@ -259,6 +259,13 @@ static void rt2800usb_mcu_request(struct rt2x00_dev *rt2x00dev, | |||
259 | mutex_unlock(&rt2x00dev->csr_mutex); | 259 | mutex_unlock(&rt2x00dev->csr_mutex); |
260 | } | 260 | } |
261 | 261 | ||
262 | static inline void rt2800_mcu_request(struct rt2x00_dev *rt2x00dev, | ||
263 | const u8 command, const u8 token, | ||
264 | const u8 arg0, const u8 arg1) | ||
265 | { | ||
266 | rt2800usb_mcu_request(rt2x00dev, command, token, arg0, arg1); | ||
267 | } | ||
268 | |||
262 | #ifdef CONFIG_RT2X00_LIB_DEBUGFS | 269 | #ifdef CONFIG_RT2X00_LIB_DEBUGFS |
263 | static const struct rt2x00debug rt2800usb_rt2x00debug = { | 270 | static const struct rt2x00debug rt2800usb_rt2x00debug = { |
264 | .owner = THIS_MODULE, | 271 | .owner = THIS_MODULE, |
@@ -319,10 +326,10 @@ static void rt2800usb_brightness_set(struct led_classdev *led_cdev, | |||
319 | EEPROM_FREQ_LED_MODE); | 326 | EEPROM_FREQ_LED_MODE); |
320 | 327 | ||
321 | if (led->type == LED_TYPE_RADIO) { | 328 | if (led->type == LED_TYPE_RADIO) { |
322 | rt2800usb_mcu_request(led->rt2x00dev, MCU_LED, 0xff, ledmode, | 329 | rt2800_mcu_request(led->rt2x00dev, MCU_LED, 0xff, ledmode, |
323 | enabled ? 0x20 : 0); | 330 | enabled ? 0x20 : 0); |
324 | } else if (led->type == LED_TYPE_ASSOC) { | 331 | } else if (led->type == LED_TYPE_ASSOC) { |
325 | rt2800usb_mcu_request(led->rt2x00dev, MCU_LED, 0xff, ledmode, | 332 | rt2800_mcu_request(led->rt2x00dev, MCU_LED, 0xff, ledmode, |
326 | enabled ? (bg_mode ? 0x60 : 0xa0) : 0x20); | 333 | enabled ? (bg_mode ? 0x60 : 0xa0) : 0x20); |
327 | } else if (led->type == LED_TYPE_QUALITY) { | 334 | } else if (led->type == LED_TYPE_QUALITY) { |
328 | /* | 335 | /* |
@@ -333,7 +340,7 @@ static void rt2800usb_brightness_set(struct led_classdev *led_cdev, | |||
333 | * work with bitshifting: | 340 | * work with bitshifting: |
334 | * (1 << level) - 1 | 341 | * (1 << level) - 1 |
335 | */ | 342 | */ |
336 | rt2800usb_mcu_request(led->rt2x00dev, MCU_LED_STRENGTH, 0xff, | 343 | rt2800_mcu_request(led->rt2x00dev, MCU_LED_STRENGTH, 0xff, |
337 | (1 << brightness / (LED_FULL / 6)) - 1, | 344 | (1 << brightness / (LED_FULL / 6)) - 1, |
338 | polarity); | 345 | polarity); |
339 | } | 346 | } |
@@ -1233,13 +1240,13 @@ static int rt2800usb_load_firmware(struct rt2x00_dev *rt2x00dev, | |||
1233 | /* | 1240 | /* |
1234 | * Send signal to firmware during boot time. | 1241 | * Send signal to firmware during boot time. |
1235 | */ | 1242 | */ |
1236 | rt2800usb_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0xff, 0, 0); | 1243 | rt2800_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0xff, 0, 0); |
1237 | 1244 | ||
1238 | if ((chipset == 0x3070) || | 1245 | if ((chipset == 0x3070) || |
1239 | (chipset == 0x3071) || | 1246 | (chipset == 0x3071) || |
1240 | (chipset == 0x3572)) { | 1247 | (chipset == 0x3572)) { |
1241 | udelay(200); | 1248 | udelay(200); |
1242 | rt2800usb_mcu_request(rt2x00dev, MCU_CURRENT, 0, 0, 0); | 1249 | rt2800_mcu_request(rt2x00dev, MCU_CURRENT, 0, 0, 0); |
1243 | udelay(10); | 1250 | udelay(10); |
1244 | } | 1251 | } |
1245 | 1252 | ||
@@ -1875,15 +1882,15 @@ static int rt2800usb_enable_radio(struct rt2x00_dev *rt2x00dev) | |||
1875 | * Initialize LED control | 1882 | * Initialize LED control |
1876 | */ | 1883 | */ |
1877 | rt2x00_eeprom_read(rt2x00dev, EEPROM_LED1, &word); | 1884 | rt2x00_eeprom_read(rt2x00dev, EEPROM_LED1, &word); |
1878 | rt2800usb_mcu_request(rt2x00dev, MCU_LED_1, 0xff, | 1885 | rt2800_mcu_request(rt2x00dev, MCU_LED_1, 0xff, |
1879 | word & 0xff, (word >> 8) & 0xff); | 1886 | word & 0xff, (word >> 8) & 0xff); |
1880 | 1887 | ||
1881 | rt2x00_eeprom_read(rt2x00dev, EEPROM_LED2, &word); | 1888 | rt2x00_eeprom_read(rt2x00dev, EEPROM_LED2, &word); |
1882 | rt2800usb_mcu_request(rt2x00dev, MCU_LED_2, 0xff, | 1889 | rt2800_mcu_request(rt2x00dev, MCU_LED_2, 0xff, |
1883 | word & 0xff, (word >> 8) & 0xff); | 1890 | word & 0xff, (word >> 8) & 0xff); |
1884 | 1891 | ||
1885 | rt2x00_eeprom_read(rt2x00dev, EEPROM_LED3, &word); | 1892 | rt2x00_eeprom_read(rt2x00dev, EEPROM_LED3, &word); |
1886 | rt2800usb_mcu_request(rt2x00dev, MCU_LED_3, 0xff, | 1893 | rt2800_mcu_request(rt2x00dev, MCU_LED_3, 0xff, |
1887 | word & 0xff, (word >> 8) & 0xff); | 1894 | word & 0xff, (word >> 8) & 0xff); |
1888 | 1895 | ||
1889 | return 0; | 1896 | return 0; |
@@ -1912,9 +1919,9 @@ static int rt2800usb_set_state(struct rt2x00_dev *rt2x00dev, | |||
1912 | enum dev_state state) | 1919 | enum dev_state state) |
1913 | { | 1920 | { |
1914 | if (state == STATE_AWAKE) | 1921 | if (state == STATE_AWAKE) |
1915 | rt2800usb_mcu_request(rt2x00dev, MCU_WAKEUP, 0xff, 0, 0); | 1922 | rt2800_mcu_request(rt2x00dev, MCU_WAKEUP, 0xff, 0, 0); |
1916 | else | 1923 | else |
1917 | rt2800usb_mcu_request(rt2x00dev, MCU_SLEEP, 0xff, 0, 2); | 1924 | rt2800_mcu_request(rt2x00dev, MCU_SLEEP, 0xff, 0, 2); |
1918 | 1925 | ||
1919 | return 0; | 1926 | return 0; |
1920 | } | 1927 | } |