git: 3890a6eb01c1 - stable/13 - ulpt(4): Add support for Epson TM-U220B.

From: Hans Petter Selasky <hselasky_at_FreeBSD.org>
Date: Sun, 30 Apr 2023 06:58:06 UTC
The branch stable/13 has been updated by hselasky:

URL: https://cgit.FreeBSD.org/src/commit/?id=3890a6eb01c159b8199cee296078863a468a3f22

commit 3890a6eb01c159b8199cee296078863a468a3f22
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2022-04-02 00:27:48 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2023-04-30 06:56:18 +0000

    ulpt(4): Add support for Epson TM-U220B.
    
    Submitted by:           Archimedes Gaviola <archimedes.gaviola@gmail.com>
    Sponsored by:           NVIDIA Networking
    
    (cherry picked from commit 88162f7abd61206c98432f2c0de869a59be13854)
---
 sys/dev/usb/serial/ulpt.c | 13 +++++++++++--
 sys/dev/usb/usbdevs       |  1 +
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/sys/dev/usb/serial/ulpt.c b/sys/dev/usb/serial/ulpt.c
index c566da924374..935dc992c6c2 100644
--- a/sys/dev/usb/serial/ulpt.c
+++ b/sys/dev/usb/serial/ulpt.c
@@ -499,6 +499,13 @@ static const STRUCT_USB_HOST_ID ulpt_devs[] = {
 	{USB_IFACE_CLASS(UICLASS_PRINTER),
 	 USB_IFACE_SUBCLASS(UISUBCLASS_PRINTER),
 	 USB_IFACE_PROTOCOL(UIPROTO_PRINTER_1284)},
+
+	/* Epson printer */
+	{USB_VENDOR(USB_VENDOR_EPSON),
+	 USB_PRODUCT(USB_PRODUCT_EPSON_TMU220B),
+	 USB_IFACE_CLASS(UICLASS_VENDOR),
+	 USB_IFACE_SUBCLASS(UISUBCLASS_VENDOR),
+	 USB_IFACE_PROTOCOL(UIPROTO_PRINTER_BI)},
 };
 
 static int
@@ -555,8 +562,10 @@ ulpt_attach(device_t dev)
 				break;
 			} else {
 				alt_index++;
-				if ((id->bInterfaceClass == UICLASS_PRINTER) &&
-				    (id->bInterfaceSubClass == UISUBCLASS_PRINTER) &&
+				if ((id->bInterfaceClass == UICLASS_PRINTER ||
+				     id->bInterfaceClass == UICLASS_VENDOR) &&
+				    (id->bInterfaceSubClass == UISUBCLASS_PRINTER ||
+				     id->bInterfaceSubClass == UISUBCLASS_VENDOR) &&
 				    (id->bInterfaceProtocol == UIPROTO_PRINTER_BI)) {
 					goto found;
 				}
diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs
index fb282568935f..bab6d835d417 100644
--- a/sys/dev/usb/usbdevs
+++ b/sys/dev/usb/usbdevs
@@ -1949,6 +1949,7 @@ product EPSON 1270		0x0120	Perfection 1270 scanner
 product EPSON 2480		0x0121	Perfection 2480 scanner
 product EPSON 3590		0x0122	Perfection 3590 scanner
 product EPSON 4990		0x012a	Perfection 4990 Photo scanner
+product EPSON TMU220B		0x0202	TM-U220B
 product EPSON CRESSI_EDY	0x0521	Cressi Edy diving computer
 product EPSON N2ITION3		0x0522	Zeagle N2iTion3 diving computer
 product EPSON STYLUS_875DC	0x0601	Stylus Photo 875DC Card Reader