From nobody Thu Mar 31 12:03:23 2022 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 06D3E1A45751 for ; Thu, 31 Mar 2022 12:03:37 +0000 (UTC) (envelope-from archimedes.gaviola@gmail.com) Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KThlr2W1Qz3DHW for ; Thu, 31 Mar 2022 12:03:36 +0000 (UTC) (envelope-from archimedes.gaviola@gmail.com) Received: by mail-ej1-x629.google.com with SMTP id dr20so47575636ejc.6 for ; Thu, 31 Mar 2022 05:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bKTIfCvnurskKfyoT9VgNyMiIgdJMqorQxx2cJFwabs=; b=XrzuJQaNnBr35msXhPooY4I1PurUv9dg/0U/SZM+zvXcSBVanWH0eYQdg9GyIibghN 7aoE7SfqEFZZ09MSjjQENgyjORUS2+ww0833ecxelznn7AdNlvagisN56nlYnLelVLuJ lqDj0RnXjuVg2VsdNbXfAkkEx2R3VRm33r+BfCJmZKKd/fr6ZDkgM2Bb+CEFyeHIZdz0 KiTkFxaDS5PdezgWQooMu+hFbKgjyAD1otBsBRzoUs19Ql6KH4jV1+H1tPfDCCyqORBo dI1pvOHBjDfZ65iVs3xFb8nlJhRtXLr1xBB58Qcbmx52XJK5NX0sqGVlAvn4aNr8EWl3 xwfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bKTIfCvnurskKfyoT9VgNyMiIgdJMqorQxx2cJFwabs=; b=XvVTZte3qlJHI6NBCgYl9Sp8BNErrKCB3ctuJgu1qwFIibr1uIaEpZ84Llvu3dnI7z l6z9W879iI7rIexgnUe7/BeFMLs0DqWqqC6W1q/G19CKw2aK+toJZixxO6eMHk2TCGtb g4qorUQtGiJWp77q3VRybmVrmT7Kihtq66L0UHNbg/XBCHRhtMDxQfhtrLuKeNskNgqj Jaw1G/S7uL74K9DiCv9194NiS8j1EcRhR44XZOEy95EDUkbMOY1F2h+AUdYZYcJ+uIG2 oTzzngxOKQGjnFRnJpFL/3K8628TG6DnO1/WiRT500NGJ8ofGj34q4wFiYnBr6hnj06I BMmw== X-Gm-Message-State: AOAM532QLk52XyQkBVB6IUDidD1SWEj8xevn51FLMwXkq5TtkV3vPTJK Dihe6tFyNY8bhoYnF+qT+AUSB6DxtkJvI0yd7cQU7jbC+Oligg== X-Google-Smtp-Source: ABdhPJybmbAGZL+8zP/fC5eo2Ns6mD/30wO9AoxqY8z3nyPHUGhllZ/biqoehDzVVw8/Im6fANg3D/cBQbvkpXou7j8= X-Received: by 2002:a17:907:6d9d:b0:6da:7d4c:287f with SMTP id sb29-20020a1709076d9d00b006da7d4c287fmr4438216ejc.741.1648728215226; Thu, 31 Mar 2022 05:03:35 -0700 (PDT) List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 References: <7c67118e-f6ec-c87d-9a81-3ee6a5952f49@selasky.org> <60f98b10-dcdc-cdf4-3d7a-fe9fd4dff223@selasky.org> <8226461b-5740-9c19-0575-2740bd952e16@selasky.org> <5fcece51-b014-330e-b701-fd75fa1ac204@selasky.org> In-Reply-To: From: Archimedes Gaviola Date: Thu, 31 Mar 2022 20:03:23 +0800 Message-ID: Subject: Re: Raspberry Pi 3B USB Printing Issue To: Hans Petter Selasky Cc: freebsd-arm@freebsd.org Content-Type: multipart/alternative; boundary="00000000000099913005db827320" X-Rspamd-Queue-Id: 4KThlr2W1Qz3DHW X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=XrzuJQaN; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of archimedesgaviola@gmail.com designates 2a00:1450:4864:20::629 as permitted sender) smtp.mailfrom=archimedesgaviola@gmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::629:from]; MLMMJ_DEST(0.00)[freebsd-arm]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N --00000000000099913005db827320 Content-Type: text/plain; charset="UTF-8" On Thu, Mar 31, 2022 at 7:52 PM Archimedes Gaviola < archimedes.gaviola@gmail.com> wrote: > > > On Sun, Mar 27, 2022 at 10:28 PM Archimedes Gaviola < > archimedes.gaviola@gmail.com> wrote: > >> >> >> On Sun, Mar 27, 2022 at 5:05 PM Hans Petter Selasky >> wrote: >> >>> On 3/27/22 07:55, Archimedes Gaviola wrote: >>> > On Sat, Mar 12, 2022 at 4:41 PM Hans Petter Selasky >>> wrote: >>> > >>> >> On 3/12/22 08:07, Archimedes Gaviola wrote: >>> >>> ugen1.5: at usbus1 >>> >>> ulpt1 on uhub1 >>> >>> ulpt1: on >>> usbus1 >>> >>> device_attach: ulpt1 attach returned 12 >>> >> >>> >> 12 : man errno : >>> >> 12 ENOMEM Cannot allocate memory. >>> >> >>> >> I guess the EPSON printer you've got is not compatible with ulpt >>> >> >>> >> When printing, can you make sure that the length transferred is never >>> a >>> >> multiple of 64 bytes? >>> >> >>> >> Also, there might be a bug lurking in the USB host controller driver, >>> >> like already mentioned. >>> >> >>> > >>> > >>> > Hi Hans, >>> > >>> > I just figured-out the ulpt(4) driver in my Epson printer while >>> comparing >>> > with my Xprinter printer's USB device info. My Epson printer is >>> providing >>> > vendor specific values of 255 in the bInterfaceClass and >>> bInterfaceSubClass >>> > respectively. >>> > >>> > bInterfaceClass = 0x00ff >>> > bInterfaceSubClass = 0x00ff >>> > >>> > It should be a value of 7 for bInterfaceClass and a value of 1 in >>> > bInterfaceSubClass. >>> > >>> > bInterfaceClass = 0x0007 >>> > bInterfaceSubClass = 0x0001 >>> > >>> > So, the ulpt_attach() routine below will break upon validation for >>> > mismatched values in UICLASS_PRINTER and UISUBCLASS_PRINTER. >>> > >>> > } else { >>> > alt_index++; >>> > if ((id->bInterfaceClass == >>> > UICLASS_PRINTER) && >>> > (id->bInterfaceSubClass == >>> > UISUBCLASS_PRINTER) && >>> > (id->bInterfaceProtocol == >>> > UIPROTO_PRINTER_BI)) { >>> > goto found; >>> > } >>> > } >>> > >>> > What I did is temporarily replace these values in the USB definition. >>> In >>> > this case, how should the project handle this non-compliance USB >>> devices? >>> > Though I will raise this to Epson if they could provide an updated >>> firmware. >>> > >>> > freebsd@generic:~ % diff -Nur /usr/src/sys/dev/usb/usb.h.orig >>> > /usr/src/sys/dev/usb/usb.h >>> > --- /usr/src/sys/dev/usb/usb.h.orig 2022-03-27 02:55:01.319235000 >>> +0800 >>> > +++ /usr/src/sys/dev/usb/usb.h 2022-03-27 02:57:10.608518000 +0800 >>> > @@ -459,8 +459,10 @@ >>> > #define UICLASS_PHYSICAL 0x05 >>> > #define UICLASS_IMAGE 0x06 >>> > #define UISUBCLASS_SIC 1 /* still image class >>> */ >>> > -#define UICLASS_PRINTER 0x07 >>> > -#define UISUBCLASS_PRINTER 1 >>> > +/* #define UICLASS_PRINTER 0x07 */ >>> > +/* #define UISUBCLASS_PRINTER 1 */ >>> > +#define UICLASS_PRINTER 0xff >>> > +#define UISUBCLASS_PRINTER 0xff >>> > >>> > I can print now with ulpt(4) driver but need further testing for any >>> issues. >>> > >>> > ugen1.5: at usbus1 >>> > ulpt0 on uhub1 >>> > ulpt0: on >>> usbus1 >>> > ulpt_attach: setting alternate config number: 0 >>> > ulpt0: using bi-directional mode >>> > >>> >>> Hi, >>> >>> I think you can just extend that piece of code to accept either value >>> using a boolean OR, ||. >>> >> >> >> Hi Hans, >> >> Ah okay, this is noted. I just thought it's not allowed. I already >> extended the code and on the way re-building the kernel. >> > > > Hi Hans, > > Here are the changes I've done in the /usr/src/sys/dev/usb/serial/ulpt.c > source. This works both now with my Epson TM-U220B and Xprinter printers. > It can detect either or both in 14.0-CURRENT. So far I haven't encountered > any strange behavior while printing using this ulpt(4) driver. > > freebsd@generic:~ % diff -Nur /usr/src/sys/dev/usb/serial/ulpt.c.orig > /usr/src/sys/dev/usb/serial/ulpt.c > --- /usr/src/sys/dev/usb/serial/ulpt.c.orig 2022-03-21 > 19:44:29.178010000 +0800 > +++ /usr/src/sys/dev/usb/serial/ulpt.c 2022-03-31 16:57:53.317952000 +0800 > @@ -495,6 +495,11 @@ > USB_IFACE_SUBCLASS(UISUBCLASS_PRINTER), > USB_IFACE_PROTOCOL(UIPROTO_PRINTER_BI)}, > > + /* Bi-directional USB vendor specific */ > + {USB_IFACE_CLASS(UICLASS_VENDOR), > + USB_IFACE_SUBCLASS(UISUBCLASS_VENDOR), > + USB_IFACE_PROTOCOL(UIPROTO_PRINTER_BI)}, > + > /* 1284 USB printer */ > {USB_IFACE_CLASS(UICLASS_PRINTER), > USB_IFACE_SUBCLASS(UISUBCLASS_PRINTER), > @@ -555,9 +560,11 @@ > break; > } else { > alt_index++; > - if ((id->bInterfaceClass == > UICLASS_PRINTER) && > - (id->bInterfaceSubClass == > UISUBCLASS_PRINTER) && > - (id->bInterfaceProtocol == > UIPROTO_PRINTER_BI)) { > + if ((id->bInterfaceClass == > UICLASS_PRINTER || > + id->bInterfaceClass == UICLASS_VENDOR) > && > + (id->bInterfaceSubClass == > UISUBCLASS_PRINTER || > + id->bInterfaceClass == > UISUBCLASS_VENDOR) && > + (id->bInterfaceProtocol == > UIPROTO_PRINTER_BI)) { > goto found; > } > } > > In the /usr/src/sys/dev/usb/usbdevs, I think there's a need to include the > undefined TM-U220B. > > freebsd@generic:~ % diff -Nur /usr/src/sys/dev/usb/usbdevs.orig > /usr/src/sys/dev/usb/usbdevs > --- /usr/src/sys/dev/usb/usbdevs.orig 2022-03-21 19:42:20.999397000 +0800 > +++ /usr/src/sys/dev/usb/usbdevs 2022-04-01 01:21:31.361567000 +0800 > @@ -1941,6 +1941,7 @@ > 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 > Here's the dmesg showing ulpt0 and ulpt1 respectively with my printers. ugen1.5: at usbus1 ugen1.6: at usbus1 ulpt0 on uhub1 ulpt0: on usbus1 ulpt0: using bi-directional mode ulpt1 on uhub1 ulpt1: on usbus1 ulpt1: using bi-directional mode ulpt1: offline --00000000000099913005db827320 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Thu, Mar 31, 2022 at 7:52 PM Archi= medes Gaviola <archimede= s.gaviola@gmail.com> wrote:


On Sun, Mar 27, 20= 22 at 10:28 PM Archimedes Gaviola <archimedes.gaviola@gmail.com> wrote:
<= div dir=3D"ltr">

On Sun, Mar 27, 2022 at 5:05 PM Hans Petter Selasky <= ;hps@selasky.org&g= t; wrote:
On 3/2= 7/22 07:55, Archimedes Gaviola wrote:
> On Sat, Mar 12, 2022 at 4:41 PM Hans Petter Selasky <hps@selasky.org> wrote:
>
>> On 3/12/22 08:07, Archimedes Gaviola wrote:
>>> ugen1.5: <EPSON EPSON UB-U03II> at usbus1
>>> ulpt1 on uhub1
>>> ulpt1: <EPSON EPSON UB-U03II, class 0/0, rev 1.10/2.00, add= r 5> on usbus1
>>> device_attach: ulpt1 attach returned 12
>>
>> 12 : man errno :
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 12 ENOMEM Cannot allocate memory.
>>
>> I guess the EPSON printer you've got is not compatible with ul= pt<n>
>>
>> When printing, can you make sure that the length transferred is ne= ver a
>> multiple of 64 bytes?
>>
>> Also, there might be a bug lurking in the USB host controller driv= er,
>> like already mentioned.
>>
>
>
> Hi Hans,
>
> I just figured-out the ulpt(4) driver in my Epson printer while compar= ing
> with my Xprinter printer's USB device info. My Epson printer is pr= oviding
> vendor specific values of 255 in the bInterfaceClass and bInterfaceSub= Class
> respectively.
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 bInterfaceClass =3D 0x00ff=C2=A0 <Vendor= specific>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 bInterfaceSubClass =3D 0x00ff
>
> It should be a value of 7 for bInterfaceClass and a value of 1 in
> bInterfaceSubClass.
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 bInterfaceClass =3D 0x0007=C2=A0 <Printe= r device>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 bInterfaceSubClass =3D 0x0001
>
> So, the ulpt_attach() routine below will break upon validation for
> mismatched values in UICLASS_PRINTER and=C2=A0 UISUBCLASS_PRINTER.
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 } else {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 alt_index++;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if ((id->bInterfaceClas= s =3D=3D
> UICLASS_PRINTER) &&
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (id->bInt= erfaceSubClass =3D=3D
> UISUBCLASS_PRINTER) &&
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (id->bInt= erfaceProtocol =3D=3D
> UIPROTO_PRINTER_BI)) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 goto found;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 }
>
> What I did is temporarily replace these values in the USB definition. = In
> this case, how should the project handle this non-compliance USB devic= es?
> Though I will raise this to Epson if they could provide an updated fir= mware.
>
> freebsd@generic:~ % diff -Nur /usr/src/sys/dev/usb/usb.h.orig
> /usr/src/sys/dev/usb/usb.h
> --- /usr/src/sys/dev/usb/usb.h.orig=C2=A0 =C2=A0 =C2=A02022-03-27 02:5= 5:01.319235000 +0800
> +++ /usr/src/sys/dev/usb/usb.h=C2=A0 2022-03-27 02:57:10.608518000 +08= 00
> @@ -459,8 +459,10 @@
>=C2=A0 =C2=A0#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 UICLASS_PHYSICAL=C2=A0 = =C2=A0 =C2=A0 =C2=A0 0x05
>=C2=A0 =C2=A0#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 UICLASS_IMAGE=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00x06
>=C2=A0 =C2=A0#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 UISUBCLASS_SIC=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 1=C2=A0 =C2=A0 =C2=A0 =C2=A0/* still image clas= s */
> -#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 UICLASS_PRINTER=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A00x07
> -#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 UISUBCLASS_PRINTER=C2=A0 =C2=A0 = =C2=A0 1
> +/* #define=C2=A0 =C2=A0 =C2=A0UICLASS_PRINTER=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A00x07 */
> +/* #define=C2=A0 =C2=A0 =C2=A0UISUBCLASS_PRINTER=C2=A0 =C2=A0 =C2=A0 = 1 */
> +#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 UICLASS_PRINTER=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A00xff
> +#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 UISUBCLASS_PRINTER=C2=A0 =C2=A0 = =C2=A0 0xff
>
> I can print now with ulpt(4) driver but need further testing for any i= ssues.
>
> ugen1.5: <EPSON EPSON UB-U03II> at usbus1
> ulpt0 on uhub1
> ulpt0: <EPSON EPSON UB-U03II, class 0/0, rev 1.10/2.00, addr 5> = on usbus1
> ulpt_attach: setting alternate config number: 0
> ulpt0: using bi-directional mode
>

Hi,

I think you can just extend that piece of code to accept either value
using a boolean OR, ||.


Hi Hans,

Ah okay, this is noted. I just thought it's not all= owed. I already extended the code and on the way re-building the kernel.


Hi Hans,

Here are the changes I've done in the /usr/src/sys/dev/= usb/serial/ulpt.c source. This works both now with my Epson TM-U220B and Xp= rinter printers. It can detect either or both in 14.0-CURRENT. So far I hav= en't encountered any strange behavior while printing using this ulpt(4)= driver.

freebsd@generic:~ % diff -Nur /usr/sr= c/sys/dev/usb/serial/ulpt.c.orig /usr/src/sys/dev/usb/serial/ulpt.c
--- = /usr/src/sys/dev/usb/serial/ulpt.c.orig =C2=A0 =C2=A0 2022-03-21 19:44:29.1= 78010000 +0800
+++ /usr/src/sys/dev/usb/serial/ulpt.c =C2=A02022-03-31 1= 6:57:53.317952000 +0800
@@ -495,6 +495,11 @@
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0USB_IFACE_SUBCLASS(UISUBCLASS_PRINTER),
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0USB_IFACE_PROTOCOL(UIPROTO_PRINTER_BI)},

+ =C2=A0 =C2= =A0 =C2=A0 /* Bi-directional USB vendor specific */
+ =C2=A0 =C2=A0 =C2= =A0 {USB_IFACE_CLASS(UICLASS_VENDOR),
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0USB_I= FACE_SUBCLASS(UISUBCLASS_VENDOR),
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0USB_IFACE= _PROTOCOL(UIPROTO_PRINTER_BI)},
+
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* 1284= USB printer */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {USB_IFACE_CLASS(UICLASS_PRI= NTER),
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0USB_IFACE_SUBCLASS(UISUBCLASS_P= RINTER),
@@ -555,9 +560,11 @@
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 b= reak;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 } else {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 alt_inde= x++;
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if ((id->bInterfaceClass =3D= =3D UICLASS_PRINTER) &&
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 (id->bInterfaceSubClass =3D=3D UISUBCLASS_PRINTER) &&
= - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (id->bInterfaceProtocol = =3D=3D UIPROTO_PRINTER_BI)) {
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if ((id-= >bInterfaceClass =3D=3D UICLASS_PRINTER ||
+ =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 id->bInterfaceClass =3D=3D UICLASS_VENDOR) &&am= p;
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (id->bInterfaceSubC= lass =3D=3D UISUBCLASS_PRINTER ||
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 id->bInterfaceClass =3D=3D UISUBCLASS_VENDOR) &&
+= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (id->bInterfaceProtocol = =3D=3D UIPROTO_PRINTER_BI)) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 goto found;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 }
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 }

In the=20 /usr/src/sys/dev/usb/usbdevs, I think there's a need to include the und= efined TM-U220B.

freebsd@generic:~ % diff -Nur= /usr/src/sys/dev/usb/usbdevs.orig /usr/src/sys/dev/usb/usbdevs
--- /usr= /src/sys/dev/usb/usbdevs.orig =C2=A0 2022-03-21 19:42:20.999397000 +0800+++ /usr/src/sys/dev/usb/usbdevs =C2=A0 =C2=A0 =C2=A0 =C2=A02022-04-01 01:= 21:31.361567000 +0800
@@ -1941,6 +1941,7 @@
=C2=A0product EPSON 2480 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0x0121 =C2=A0Perfection 2480 scan= ner
=C2=A0product EPSON 3590 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0= x0122 =C2=A0Perfection 3590 scanner
=C2=A0product EPSON 4990 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0x012a =C2=A0Perfection 4990 Photo scanner<= br>+product EPSON TMU220B =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00x0202 =C2=A0TM= -U220B
=C2=A0product EPSON CRESSI_EDY =C2=A0 =C2=A0 =C2=A0 0x0521 =C2=A0= Cressi Edy diving computer
=C2=A0product EPSON N2ITION3 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 0x0522 =C2=A0Zeagle N2iTion3 diving computer
=C2=A0product= EPSON STYLUS_875DC =C2=A0 =C2=A0 0x0601 =C2=A0Stylus Photo 875DC Card Read= er


Here's the dmesg showing ulpt0 and ulpt1 respectively with my printers= .

= ugen1.5: <EPSON EPSON UB-U03II> at usbus1
ugen1.6: <Printer-58 = USB Printing Support> at usbus1
ulpt0 on uhub1
ulpt0: <EPSON EP= SON UB-U03II, class 0/0, rev 1.10/2.00, addr 5> on usbus1
ulpt0: usin= g bi-directional mode
ulpt1 on uhub1
ulpt1: <Printer-58 USB Printi= ng Support, class 0/0, rev 2.00/2.54, addr 6> on usbus1
ulpt1: using = bi-directional mode
ulpt1: offline
<= br>

--00000000000099913005db827320--