Page MenuHomeFreeBSD

mtw: Fix mtw_mcu_radio()
AcceptedPublic

Authored by markj on Sat, Feb 8, 7:14 PM.

Details

Reviewers
adrian
jsm
Summary

OpenBSD doesn't have this bug. They also use a different command number
here.

Reported by: gcc

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 62317
Build 59201: arc lint + arc unit

Event Timeline

markj requested review of this revision.Sat, Feb 8, 7:14 PM

good catch! @jsm what do you think?

This revision is now accepted and ready to land.Sat, Feb 8, 7:58 PM

good catch! @jsm what do you think?

Acutally it looks like I mixed up some functions here, the radio cmd in OpenBSD is different (8 here and 20 in OpenBSD) as Mark noted. And we should also probably add a disable radio like here if (disable) {

		/* disable radio */
		error = mtw_mcu_radio(sc, 0x30, 0x1);
		usbd_delay_ms(sc->sc_udev, 10);

}
https://github.com/openbsd/src/blob/2347e6edcd5e06bc97a8ea95077c54fc76d2e634/sys/dev/usb/if_mtw.c#L3344C1-L3348C3
Thanks

In D48903#1115325, @jsm wrote:

good catch! @jsm what do you think?

Acutally it looks like I mixed up some functions here, the radio cmd in OpenBSD is different (8 here and 20 in OpenBSD) as Mark noted. And we should also probably add a disable radio like here if (disable) {

		/* disable radio */
		error = mtw_mcu_radio(sc, 0x30, 0x1);
		usbd_delay_ms(sc->sc_udev, 10);

}
https://github.com/openbsd/src/blob/2347e6edcd5e06bc97a8ea95077c54fc76d2e634/sys/dev/usb/if_mtw.c#L3344C1-L3348C3
Thanks

Would you like to handle this instead? I was just trying to fix the gcc build failure since it triggers mail from jenkins, but I have no way to test patches for this driver.