Page MenuHomeFreeBSD

mtw: Fix mtw_mcu_radio()
AbandonedPublic

Authored by markj on Feb 8 2025, 7:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 1, 11:30 PM
Unknown Object (File)
Mon, Sep 28, 3:34 PM
Unknown Object (File)
Mon, Sep 28, 1:37 PM
Unknown Object (File)
Mon, Sep 14, 4:48 PM
Unknown Object (File)
Sat, Sep 12, 9:28 AM
Unknown Object (File)
Sep 2 2026, 11:58 PM
Unknown Object (File)
Aug 25 2026, 7:04 PM
Unknown Object (File)
Aug 25 2026, 2:09 AM
Subscribers

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.Feb 8 2025, 7:14 PM

good catch! @jsm what do you think?

This revision is now accepted and ready to land.Feb 8 2025, 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.