[Bug 253374] [if_ure] Add support for RTL8153B, RTL8156 and RTL8156B

2021-06-02 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253374

Ganbold Tsagaankhuu  changed:

   What|Removed |Added

 CC||ganb...@freebsd.org

--- Comment #7 from Ganbold Tsagaankhuu  ---
(In reply to Hans Petter Selasky from comment #5)
jmg@ said he is not working actively on it.

Hans, can you work on it when you get a chance?

thanks,

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: eGalax USB touchscreen issues

2021-06-02 Thread Vladimir Kondratyev
On 02.06.2021 00:52, Mark Kane wrote:
> On 2021-05-31 16:29, Vladimir Kondratyev wrote:
>> Could you run usbhid-dump one more time?
>> Following part of dump is broken and does not match Xorg log:
>>
>> 000:003:000:DESCRIPTOR 1621478496.823720
>>   8D 0F 00 09 42 09 32 15 00 25 01 95 02 75 01 81
>>   02 95 06 75 01 81 03 05 01 09 30 75 10 95 01 A4
>>   55 00 65 00 36 00 00 46 00 00 16 1E 00 26 C8 0F
>>   81 02 09 31 16 3C 00 26
>>
>> Does evemu-record (devel/evemu) hear any events from eGlax?
> 
> Sure thing, output for both is below. evemu-record hears events from
> event8, none from event7.

There was a stupid mistake in previous patch. Could you test new one
(attached) ?

> # usbhid-dump
> 000:003:001:DESCRIPTOR 1622583731.526623
> 05 0C 09 01 A1 01 85 01 19 00 2A 3C 02 15 00 26
> 3C 02 95 01 75 10 81 00 C0 05 01 09 80 A1 01 85
> 02 19 81 29 83 25 01 75 01 95 03 81 02 95 05 81
> 01 C0
> 
> 000:003:000:DESCRIPTOR 1622583731.529418
> 05 01 09 06 A1 01 05 07 19 E0 29 E7 15 00 25 01
> 95 08 75 01 81 02 95 08 75 01 81 01 05 08 19 01
> 29 03 95 03 75 01 91 02 95 01 75 05 91 01 05 07
> 19 00 2A FF 00 15 00 26 FF 00 95 06 75 08 81 00
> C0
> 
> 000:004:000:DESCRIPTOR 1622583731.530328
> 05 01 09 01 A1 01 85 01 09 01 A1 00 05 09 19 01
> 29 02 15 00 25 01 95 02 75 01 81 02 95 01 75 06
> 81 01 05 01 09 30 09 31 16 00 00 26 FF 0F 36 00
> 00 46 FF 0F 66 00 00 75 10 95 02 81 02 C0 C0 05

For now, report descriptor is not broken but it still does not match my
expectations. Could you post output of

install sysutils/hid-tools
sudo kldload hidraw.ko
sudo hid-decode /dev/hidraw#

Where # is number corresponding your touchscreen

-- 
WBR
Vladimir Kondratyev
diff --git a/sys/dev/hid/hms.c b/sys/dev/hid/hms.c
index 94267b3fcd5..0f60eec86a4 100644
--- a/sys/dev/hid/hms.c
+++ b/sys/dev/hid/hms.c
@@ -109,6 +109,7 @@ static const struct hidmap_item hms_map_wheel_rev[] = 
{
 
 /* A match on these entries will load hms */
 static const struct hid_device_id hms_devs[] = {
+	{ HID_TLC(HUP_GENERIC_DESKTOP, HUG_POINTER) },
 	{ HID_TLC(HUP_GENERIC_DESKTOP, HUG_MOUSE) },
 };
 
diff --git a/sys/dev/hid/hpen.c b/sys/dev/hid/hpen.c
index 1d505e14089..2166641ea13 100644
--- a/sys/dev/hid/hpen.c
+++ b/sys/dev/hid/hpen.c
@@ -110,6 +110,8 @@ static const struct hidmap_item hpen_map_pen[] = {
 static const struct hid_device_id hpen_devs[] = {
 	{ HID_TLC(HUP_DIGITIZERS, HUD_DIGITIZER) },
 	{ HID_TLC(HUP_DIGITIZERS, HUD_PEN) },
+	{ HID_TLC(HUP_DIGITIZERS, HUD_TOUCHSCREEN),
+	  HID_BVP(BUS_USB, USB_VENDOR_EGALAX, USB_PRODUCT_EGALAX_TPANEL) },
 };
 
 static int
@@ -186,7 +188,7 @@ hpen_probe(device_t dev)
 {
 	struct hidmap *hm = device_get_softc(dev);
 	int error;
-	bool is_pen;
+	const char *suffix;
 
 	error = HIDBUS_LOOKUP_DRIVER_INFO(dev, hpen_devs);
 	if (error != 0)
@@ -195,14 +197,26 @@ hpen_probe(device_t dev)
 	hidmap_set_dev(hm, dev);
 
 	/* Check if report descriptor belongs to a HID tablet device */
-	is_pen = hidbus_get_usage(dev) == HID_USAGE2(HUP_DIGITIZERS, HUD_PEN);
-	error = is_pen
-	? HIDMAP_ADD_MAP(hm, hpen_map_pen, NULL)
-	: HIDMAP_ADD_MAP(hm, hpen_map_digi, NULL);
+	switch (HID_GET_USAGE(hidbus_get_usage(dev))) {
+	case HUD_PEN:
+		error = HIDMAP_ADD_MAP(hm, hpen_map_pen, NULL);
+		suffix = "Pen";
+		break;
+	case HUD_TOUCHSCREEN:
+		error = HIDMAP_ADD_MAP(hm, hpen_map_pen, NULL);
+		suffix = "TouchScreen";
+		break;
+	case HUD_DIGITIZER:
+		error = HIDMAP_ADD_MAP(hm, hpen_map_digi, NULL);
+		suffix = "Digitizer";
+		break;
+	default:
+		KASSERT(1 == 0, ("Unknown usage"));
+	}
 	if (error != 0)
 		return (error);
 
-	hidbus_set_desc(dev, is_pen ? "Pen" : "Digitizer");
+	hidbus_set_desc(dev, suffix);
 
 	return (BUS_PROBE_DEFAULT);
 }
___
freebsd-usb@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"