[rt2x00-users] [PATCH 3/3] rt2800pci: Fix 'Error - MCU request failed' during initialization
Jakub Kicinski
kubakici at wp.pl
Fri Jan 20 01:26:21 EST 2012
Hi!
On Thu, 19 Jan 2012 14:38:54 +0100
Stanislaw Gruszka <sgruszka at redhat.com> wrote:
> On Tue, Jan 17, 2012 at 05:46:00PM +0100, Jakub Kicinski wrote:
> > Bring MCU operations during device initialization to sync with legacy
> > driver.
> >
> > This should fix following error:
> > phy0 -> rt2800pci_mcu_status: Error - MCU request failed, no response
> > from hardware
> >
> > Signed-off-by: Jakub Kicinski <kubakici at wp.pl>
> > ---
> > drivers/net/wireless/rt2x00/rt2800pci.c | 20 +++++++++++++-------
> > 1 files changed, 13 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
> > index 451591b..6773296 100644
> > --- a/drivers/net/wireless/rt2x00/rt2800pci.c
> > +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
> > @@ -536,14 +536,20 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
> >
> > switch (state) {
> > case STATE_RADIO_ON:
> > - /*
> > - * Before the radio can be enabled, the device first has
> > - * to be woken up. After that it needs a bit of time
> > - * to be fully awake and then the radio can be enabled.
> > - */
> > - rt2800pci_set_device_state(rt2x00dev, STATE_AWAKE);
> > - msleep(1);
> > + /* Initialise all registers and send MCU_BOOT_SIGNAL. */
> > retval = rt2800pci_enable_radio(rt2x00dev);
> > +
> > + /* After resume MCU_BOOT_SIGNAL will trash those. */
> > + rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_STATUS, ~0);
> > + rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
> > +
> > + /* Finish initialization procedure. */
> > + rt2800_mcu_request(rt2x00dev, MCU_SLEEP, TOKEN_RADIO_OFF,
> > + 0xff, 0x02);
> > + rt2800pci_mcu_status(rt2x00dev, TOKEN_RADIO_OFF);
> > +
> > + rt2800_mcu_request(rt2x00dev, MCU_WAKEUP, TOKEN_WAKEUP, 0, 0);
> > + rt2800pci_mcu_status(rt2x00dev, TOKEN_WAKEUP);
> > break;
>
> So to turn the readio on we do: mcu reset, sleep and wakup. That does not
> seems to be right, i.e. (if I underspend correctly) vendor driver do only
> wakup (with 0x02 as last argument). But I can not comment, apparently
> I do not understand that stuff.
I think you may be referring to one of wake up function of legacy driver.
Either RT28xxPciAsicRadioOn or RT28xxPciStaAsicForceWakeup. Those
functions are to my understanding used to wake up form power saving and
we will do same thing as they do in set_state(STATE_AWAKE), (well, a
much simplified version of what they do actually ;)).
set_state(STATE_RADIO_ON) OTOH is more of initialization call, as (if my
grepping skills didn't go mad) it is only called from .start method. The
sleep&wakeup dance can be found in NICInitAsicFromEEPROM, which in turn
is called in legacy driver's .open method.
Still, you probably understand all this better than I do so please do
comment.
-- Kuba
More information about the users
mailing list