Page MenuHomeFreeBSD

mtw: Fix mtw_mcu_radio()
AbandonedPublic

Authored by markj on Feb 8 2025, 7:14 PM.
Tags
None
Referenced Files
F141130853: D48903.diff
Thu, Jan 1, 6:48 AM
Unknown Object (File)
Dec 1 2025, 6:11 PM
Unknown Object (File)
Dec 1 2025, 8:28 AM
Unknown Object (File)
Nov 15 2025, 8:30 AM
Unknown Object (File)
Nov 10 2025, 5:31 AM
Unknown Object (File)
Nov 4 2025, 9:06 PM
Unknown Object (File)
Oct 26 2025, 6:13 AM
Unknown Object (File)
Oct 24 2025, 9:04 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.