[rt2x00-users] [PATCH 1/3] rt2800pci: remove rt2800pci_set_state function

Stanislaw Gruszka sgruszka at redhat.com
Fri Jan 20 19:25:19 AEDT 2012

On Tue, Jan 17, 2012 at 05:22:52PM +0100, Jakub Kicinski wrote:
>  		rt2800pci_disable_radio(rt2x00dev);
> -		rt2800pci_set_state(rt2x00dev, STATE_SLEEP);
> +		rt2800pci_set_device_state(rt2x00dev, STATE_SLEEP);
I a bit dislike these recursive calls. I would prefer direct calls to
rt2800pci_mcu_request() and eventually rearrange switch() statement do do
fall through, i.e:

        case STATE_RADIO_OFF:
                 * After the radio has been disabled, the device should
                 * be put to sleep for powersaving.
                /* fall through */
        case STATE_DEEP_SLEEP:
        case STATE_SLEEP:
        case STATE_STANDBY:
                /* PCIe devices won't report status after SLEEP request. */
                rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_STATUS, ~0);
                rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
                rt2800_mcu_req(rt2x00dev, MCU_SLEEP, TOKEN_SLEEP, 0xff, 0x01);

More information about the users mailing list