Commit 1e7d3035 authored by Gabor Juhos's avatar Gabor Juhos Committed by John W. Linville

rt2x00: rt2800pci: split rt2800pci_enable_radio function

The function is called for PCI and SoC devices
however the MCU related part of the function
has no effect on SoC devices. Move the common
part of the function into a separate helper and
use that for the SoC devices.
Signed-off-by: default avatarGabor Juhos <juhosg@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 28d4d98d
...@@ -61,6 +61,7 @@ static bool rt2800pci_hwcrypt_disabled(struct rt2x00_dev *rt2x00dev) ...@@ -61,6 +61,7 @@ static bool rt2800pci_hwcrypt_disabled(struct rt2x00_dev *rt2x00dev)
return modparam_nohwcrypt; return modparam_nohwcrypt;
} }
#ifdef CONFIG_PCI
static void rt2800pci_mcu_status(struct rt2x00_dev *rt2x00dev, const u8 token) static void rt2800pci_mcu_status(struct rt2x00_dev *rt2x00dev, const u8 token)
{ {
unsigned int i; unsigned int i;
...@@ -91,7 +92,6 @@ static void rt2800pci_mcu_status(struct rt2x00_dev *rt2x00dev, const u8 token) ...@@ -91,7 +92,6 @@ static void rt2800pci_mcu_status(struct rt2x00_dev *rt2x00dev, const u8 token)
rt2x00mmio_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0); rt2x00mmio_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
} }
#ifdef CONFIG_PCI
static void rt2800pci_eepromregister_read(struct eeprom_93cx6 *eeprom) static void rt2800pci_eepromregister_read(struct eeprom_93cx6 *eeprom)
{ {
struct rt2x00_dev *rt2x00dev = eeprom->data; struct rt2x00_dev *rt2x00dev = eeprom->data;
...@@ -210,17 +210,23 @@ static int rt2800pci_write_firmware(struct rt2x00_dev *rt2x00dev, ...@@ -210,17 +210,23 @@ static int rt2800pci_write_firmware(struct rt2x00_dev *rt2x00dev,
/* /*
* Device state switch handlers. * Device state switch handlers.
*/ */
static int rt2800pci_enable_radio(struct rt2x00_dev *rt2x00dev) static int rt2800mmio_enable_radio(struct rt2x00_dev *rt2x00dev)
{ {
int retval;
/* Wait for DMA, ignore error until we initialize queues. */ /* Wait for DMA, ignore error until we initialize queues. */
rt2800_wait_wpdma_ready(rt2x00dev); rt2800_wait_wpdma_ready(rt2x00dev);
if (unlikely(rt2800mmio_init_queues(rt2x00dev))) if (unlikely(rt2800mmio_init_queues(rt2x00dev)))
return -EIO; return -EIO;
retval = rt2800_enable_radio(rt2x00dev); return rt2800_enable_radio(rt2x00dev);
}
#ifdef CONFIG_PCI
static int rt2800pci_enable_radio(struct rt2x00_dev *rt2x00dev)
{
int retval;
retval = rt2800mmio_enable_radio(rt2x00dev);
if (retval) if (retval)
return retval; return retval;
...@@ -237,7 +243,6 @@ static int rt2800pci_enable_radio(struct rt2x00_dev *rt2x00dev) ...@@ -237,7 +243,6 @@ static int rt2800pci_enable_radio(struct rt2x00_dev *rt2x00dev)
return retval; return retval;
} }
#ifdef CONFIG_PCI
static int rt2800pci_set_state(struct rt2x00_dev *rt2x00dev, static int rt2800pci_set_state(struct rt2x00_dev *rt2x00dev,
enum dev_state state) enum dev_state state)
{ {
...@@ -484,7 +489,7 @@ static int rt2800soc_set_device_state(struct rt2x00_dev *rt2x00dev, ...@@ -484,7 +489,7 @@ static int rt2800soc_set_device_state(struct rt2x00_dev *rt2x00dev,
switch (state) { switch (state) {
case STATE_RADIO_ON: case STATE_RADIO_ON:
retval = rt2800pci_enable_radio(rt2x00dev); retval = rt2800mmio_enable_radio(rt2x00dev);
break; break;
case STATE_RADIO_OFF: case STATE_RADIO_OFF:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment