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)
Sun, Oct 5, 10:34 PM
Unknown Object (File)
Sep 14 2025, 12:25 PM
Unknown Object (File)
Sep 13 2025, 11:54 PM
Unknown Object (File)
Sep 9 2025, 12:43 PM
Unknown Object (File)
Sep 3 2025, 11:37 PM
Unknown Object (File)
Aug 29 2025, 10:07 AM
Unknown Object (File)
Aug 19 2025, 5:17 PM
Unknown Object (File)
Aug 19 2025, 1:01 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.