diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-11-04 12:34:39 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-06 16:48:52 -0500 |
commit | 3a9e5b0fff63bb87dd6e0f9c60626e16d81192af (patch) | |
tree | b63d9434a2c666c38b1fc5c6cdfb9702831ddedc /drivers/net/wireless/rt2x00/rt2800pci.c | |
parent | 4f2c53268ad1bdc7d6d12ca8bd110bb288a14300 (diff) |
rt2800pci: 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/rt2x00/rt2800pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800pci.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index 83fe1babd5bb..8f8f8d85f2cf 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c | |||
@@ -279,6 +279,13 @@ static void rt2800pci_mcu_request(struct rt2x00_dev *rt2x00dev, | |||
279 | mutex_unlock(&rt2x00dev->csr_mutex); | 279 | mutex_unlock(&rt2x00dev->csr_mutex); |
280 | } | 280 | } |
281 | 281 | ||
282 | static inline void rt2800_mcu_request(struct rt2x00_dev *rt2x00dev, | ||
283 | const u8 command, const u8 token, | ||
284 | const u8 arg0, const u8 arg1) | ||
285 | { | ||
286 | rt2800pci_mcu_request(rt2x00dev, command, token, arg0, arg1); | ||
287 | } | ||
288 | |||
282 | static void rt2800pci_mcu_status(struct rt2x00_dev *rt2x00dev, const u8 token) | 289 | static void rt2800pci_mcu_status(struct rt2x00_dev *rt2x00dev, const u8 token) |
283 | { | 290 | { |
284 | unsigned int i; | 291 | unsigned int i; |
@@ -470,10 +477,10 @@ static void rt2800pci_brightness_set(struct led_classdev *led_cdev, | |||
470 | EEPROM_FREQ_LED_MODE); | 477 | EEPROM_FREQ_LED_MODE); |
471 | 478 | ||
472 | if (led->type == LED_TYPE_RADIO) { | 479 | if (led->type == LED_TYPE_RADIO) { |
473 | rt2800pci_mcu_request(led->rt2x00dev, MCU_LED, 0xff, ledmode, | 480 | rt2800_mcu_request(led->rt2x00dev, MCU_LED, 0xff, ledmode, |
474 | enabled ? 0x20 : 0); | 481 | enabled ? 0x20 : 0); |
475 | } else if (led->type == LED_TYPE_ASSOC) { | 482 | } else if (led->type == LED_TYPE_ASSOC) { |
476 | rt2800pci_mcu_request(led->rt2x00dev, MCU_LED, 0xff, ledmode, | 483 | rt2800_mcu_request(led->rt2x00dev, MCU_LED, 0xff, ledmode, |
477 | enabled ? (bg_mode ? 0x60 : 0xa0) : 0x20); | 484 | enabled ? (bg_mode ? 0x60 : 0xa0) : 0x20); |
478 | } else if (led->type == LED_TYPE_QUALITY) { | 485 | } else if (led->type == LED_TYPE_QUALITY) { |
479 | /* | 486 | /* |
@@ -484,7 +491,7 @@ static void rt2800pci_brightness_set(struct led_classdev *led_cdev, | |||
484 | * work with bitshifting: | 491 | * work with bitshifting: |
485 | * (1 << level) - 1 | 492 | * (1 << level) - 1 |
486 | */ | 493 | */ |
487 | rt2800pci_mcu_request(led->rt2x00dev, MCU_LED_STRENGTH, 0xff, | 494 | rt2800_mcu_request(led->rt2x00dev, MCU_LED_STRENGTH, 0xff, |
488 | (1 << brightness / (LED_FULL / 6)) - 1, | 495 | (1 << brightness / (LED_FULL / 6)) - 1, |
489 | polarity); | 496 | polarity); |
490 | } | 497 | } |
@@ -2040,7 +2047,7 @@ static int rt2800pci_enable_radio(struct rt2x00_dev *rt2x00dev) | |||
2040 | /* | 2047 | /* |
2041 | * Send signal to firmware during boot time. | 2048 | * Send signal to firmware during boot time. |
2042 | */ | 2049 | */ |
2043 | rt2800pci_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0xff, 0, 0); | 2050 | rt2800_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0xff, 0, 0); |
2044 | 2051 | ||
2045 | /* | 2052 | /* |
2046 | * Enable RX. | 2053 | * Enable RX. |
@@ -2066,15 +2073,15 @@ static int rt2800pci_enable_radio(struct rt2x00_dev *rt2x00dev) | |||
2066 | * Initialize LED control | 2073 | * Initialize LED control |
2067 | */ | 2074 | */ |
2068 | rt2x00_eeprom_read(rt2x00dev, EEPROM_LED1, &word); | 2075 | rt2x00_eeprom_read(rt2x00dev, EEPROM_LED1, &word); |
2069 | rt2800pci_mcu_request(rt2x00dev, MCU_LED_1, 0xff, | 2076 | rt2800_mcu_request(rt2x00dev, MCU_LED_1, 0xff, |
2070 | word & 0xff, (word >> 8) & 0xff); | 2077 | word & 0xff, (word >> 8) & 0xff); |
2071 | 2078 | ||
2072 | rt2x00_eeprom_read(rt2x00dev, EEPROM_LED2, &word); | 2079 | rt2x00_eeprom_read(rt2x00dev, EEPROM_LED2, &word); |
2073 | rt2800pci_mcu_request(rt2x00dev, MCU_LED_2, 0xff, | 2080 | rt2800_mcu_request(rt2x00dev, MCU_LED_2, 0xff, |
2074 | word & 0xff, (word >> 8) & 0xff); | 2081 | word & 0xff, (word >> 8) & 0xff); |
2075 | 2082 | ||
2076 | rt2x00_eeprom_read(rt2x00dev, EEPROM_LED3, &word); | 2083 | rt2x00_eeprom_read(rt2x00dev, EEPROM_LED3, &word); |
2077 | rt2800pci_mcu_request(rt2x00dev, MCU_LED_3, 0xff, | 2084 | rt2800_mcu_request(rt2x00dev, MCU_LED_3, 0xff, |
2078 | word & 0xff, (word >> 8) & 0xff); | 2085 | word & 0xff, (word >> 8) & 0xff); |
2079 | 2086 | ||
2080 | return 0; | 2087 | return 0; |
@@ -2123,10 +2130,10 @@ static int rt2800pci_set_state(struct rt2x00_dev *rt2x00dev, | |||
2123 | * if the device is booting and wasn't asleep it will return | 2130 | * if the device is booting and wasn't asleep it will return |
2124 | * failure when attempting to wakeup. | 2131 | * failure when attempting to wakeup. |
2125 | */ | 2132 | */ |
2126 | rt2800pci_mcu_request(rt2x00dev, MCU_SLEEP, 0xff, 0, 2); | 2133 | rt2800_mcu_request(rt2x00dev, MCU_SLEEP, 0xff, 0, 2); |
2127 | 2134 | ||
2128 | if (state == STATE_AWAKE) { | 2135 | if (state == STATE_AWAKE) { |
2129 | rt2800pci_mcu_request(rt2x00dev, MCU_WAKEUP, TOKEN_WAKUP, 0, 0); | 2136 | rt2800_mcu_request(rt2x00dev, MCU_WAKEUP, TOKEN_WAKUP, 0, 0); |
2130 | rt2800pci_mcu_status(rt2x00dev, TOKEN_WAKUP); | 2137 | rt2800pci_mcu_status(rt2x00dev, TOKEN_WAKUP); |
2131 | } | 2138 | } |
2132 | 2139 | ||