WIP: Support for NetBSD #44

Closed
z3ntu wants to merge 3 commits from netbsd into master
z3ntu commented 2019-07-13 12:27:49 -05:00 (Migrated from github.com)

Patch by nia from pkgsrc.se (NetBSD ports)

Should work fine, but I'll test it in a VM.

builds.sr.ht mostly has NetBSD CI support finished, but it could still take a while until a NetBSD image is usable; but afterwards a NetBSD CI can be added.

Patch by nia from pkgsrc.se (NetBSD ports) Should work fine, but I'll test it in a VM. builds.sr.ht mostly has NetBSD CI support finished, but it could still take a while until a NetBSD image is usable; but afterwards a NetBSD CI can be added.
z3ntu commented 2019-07-19 06:56:33 -05:00 (Migrated from github.com)

Compiles fine in my NetBSD VM, but (same as with OpenBSD) the USB stack doesn't seem to work correctly with QEMU ("hub1: device problem, disabling port 2") when passing through my USB device to the VM

Compiles fine in my NetBSD VM, but (same as with OpenBSD) the USB stack doesn't seem to work correctly with QEMU ("hub1: device problem, disabling port 2") when passing through my USB device to the VM
mcuee commented 2019-12-11 08:28:46 -06:00 (Migrated from github.com)

To be honest, using libusb backend for HID device under NetBSD/OpenBSD are not that helpful as it is not easy to use the libusb to replace the HID driver. It will be good to use native HID api.

To be honest, using libusb backend for HID device under NetBSD/OpenBSD are not that helpful as it is not easy to use the libusb to replace the HID driver. It will be good to use native HID api.
Youw commented 2019-12-11 08:40:41 -06:00 (Migrated from github.com)

I think this the statement can be applied to Linux platform too.
Maybe we could have two separate backends for BSD too: libusb + native.

I think this the statement can be applied to Linux platform too. Maybe we could have two separate backends for BSD too: libusb + native.
mcuee commented 2019-12-11 08:51:42 -06:00 (Migrated from github.com)

For Linux it is at least possible to detach kernel hid driver. But it is okay to have libusb + native.

For Linux it is at least possible to detach kernel hid driver. But it is okay to have libusb + native.
mcuee commented 2019-12-11 08:55:12 -06:00 (Migrated from github.com)

Take note this is different from FreeBSD case. Back in 2012 I did tested quite a bit of FreeBSD USB stuff including HIDAPI as the USB stack allows generic driver along with HID driver for generic HID device.

I tested quite a bit of FreeBSD HPS USB stack back in 2007/2008 time. Then I tested for Alan Ott for FreeBSD HIDAPI in 2012.

But I am no longer be able to test under macOS, NetBSD/OpenBSD/HaiKu now that my Mac Mini 2011 was dead.

Take note this is different from FreeBSD case. Back in 2012 I did tested quite a bit of FreeBSD USB stuff including HIDAPI as the USB stack allows generic driver along with HID driver for generic HID device. I tested quite a bit of FreeBSD HPS USB stack back in 2007/2008 time. Then I tested for Alan Ott for FreeBSD HIDAPI in 2012. But I am no longer be able to test under macOS, NetBSD/OpenBSD/HaiKu now that my Mac Mini 2011 was dead.
mcuee commented 2021-06-14 22:46:00 -05:00 (Migrated from github.com)

Reference:
http://www.apcupsd.com/manual/manual.html#bsd-usb-configuration

Users of OpenBSD, NetBSD, and some versions of FreeBSD will need to rebuild the kernel in
order to enable the ugen driver and disable the uhid driver. uhid is not sufficient for 
apcupsd at this time and we need to prevent it from grabbing the UPS device. You should
make the following changes to your kernel config file:

FreeBSD (v5.4 and below, v6.0)
(you will not lose use of USB keyboard and mouse)
Disable: uhid
Enable: ugen
FreeBSD (v5.5, v6.1 and above)
(you will not lose use of USB keyboard and mouse)
Disable: (nothing)
Enable: ugen
This is the default configuration for a GENERIC kernel on many platforms so you most likely 
will not need to recompile.

NetBSD (v3.x and below)
(you will lose use of USB keyboard and mouse)
Disable: uhidev, ums, wsmouse, ukbd, wskbd, uhid
Enable: ugen
NetBSD (v4.0 and above)
You can use apcupsd on single USB port without disabling the USB keyboard and mouse on 
other ports, though all other devices will be disabled on the port you pick for your UPS.

OpenBSD
(you will lose use of USB keyboard and mouse):
Disable: uhidev, ums, wsmouse, ukbd, wskbd, uhid
Enable: ugen
Reference: http://www.apcupsd.com/manual/manual.html#bsd-usb-configuration ``` Users of OpenBSD, NetBSD, and some versions of FreeBSD will need to rebuild the kernel in order to enable the ugen driver and disable the uhid driver. uhid is not sufficient for apcupsd at this time and we need to prevent it from grabbing the UPS device. You should make the following changes to your kernel config file: FreeBSD (v5.4 and below, v6.0) (you will not lose use of USB keyboard and mouse) Disable: uhid Enable: ugen FreeBSD (v5.5, v6.1 and above) (you will not lose use of USB keyboard and mouse) Disable: (nothing) Enable: ugen This is the default configuration for a GENERIC kernel on many platforms so you most likely will not need to recompile. NetBSD (v3.x and below) (you will lose use of USB keyboard and mouse) Disable: uhidev, ums, wsmouse, ukbd, wskbd, uhid Enable: ugen NetBSD (v4.0 and above) You can use apcupsd on single USB port without disabling the USB keyboard and mouse on other ports, though all other devices will be disabled on the port you pick for your UPS. OpenBSD (you will lose use of USB keyboard and mouse): Disable: uhidev, ums, wsmouse, ukbd, wskbd, uhid Enable: ugen ```

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libusb/hidapi!44
No description provided.