Date: Sat, 2 Apr 2022 09:10:25 +0800 From: Archimedes Gaviola <archimedes.gaviola@gmail.com> To: Hans Petter Selasky <hps@selasky.org> Cc: freebsd-arm@freebsd.org Subject: Re: Raspberry Pi 3B USB Printing Issue Message-ID: <CAJFbk7E4enEswXzOvyf-XcJ7vb_NgGMD9Wx-6Biwr_UsHZMapg@mail.gmail.com> In-Reply-To: <0b3e82fe-b45f-67f0-3009-90e887c14159@selasky.org> References: <CAJFbk7EzSfPNbaGxiweKrivwNrKXCPVzA1b7_=0_bTvbs8oBow@mail.gmail.com> <60f98b10-dcdc-cdf4-3d7a-fe9fd4dff223@selasky.org> <CAJFbk7EAjrQG5Kj_upVKW72opOS%2B8d63VrMnQdLxcJjUcfsd=g@mail.gmail.com> <8226461b-5740-9c19-0575-2740bd952e16@selasky.org> <CAJFbk7FMa_8EXM70HdhgdLmkpjpRD54fRrO=uctHV4uQ2_nNhA@mail.gmail.com> <5fcece51-b014-330e-b701-fd75fa1ac204@selasky.org> <CAJFbk7Gx1i5r-KunNP41re7A_6m%2BYPO6K3Ru-J=0xqidNQsj7A@mail.gmail.com> <a5d5f948-fdc8-037c-dda6-5291e7440e28@selasky.org> <CAJFbk7GAz44pwFUdYQJKMfDA1EXZ%2BJSqYCxeRyuCaYk-u%2BiPNw@mail.gmail.com> <d0cdee81-bb27-cec3-8fa1-74a381e9f3b3@selasky.org> <CAJFbk7G8gUjBPLHJEGvU4SULCQP5eGhNATOW0-paRgz8pqcqQg@mail.gmail.com> <CAJFbk7G87gmtf7cDx2qz_hsL9bEvou42EBDfAcacaV1vFAd-Tw@mail.gmail.com> <b22ae813-6605-726c-8f40-60bb27fce237@selasky.org> <CAJFbk7Ek=b9cpdVhWUWiQd3oAO4G203JqwDraHY%2B5wHeeNUWiw@mail.gmail.com> <534edcd2-c6ef-729d-0768-9f469958e16a@selasky.org> <CAJFbk7FYMfY==SKgs23DLnt6EnXH3YcXa6o40oer-95Qz2pnmw@mail.gmail.com> <0b3e82fe-b45f-67f0-3009-90e887c14159@selasky.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000124f6d05dba19021 Content-Type: text/plain; charset="UTF-8" On Sat, Apr 2, 2022 at 8:30 AM Hans Petter Selasky <hps@selasky.org> wrote: > On 4/2/22 00:56, Archimedes Gaviola wrote: > > On Fri, Apr 1, 2022 at 12:01 AM Hans Petter Selasky <hps@selasky.org> > wrote: > > > >> On 3/31/22 15:52, Archimedes Gaviola wrote: > >>> Are you pertaining to this code Hans, the one you've shared to me > >>> previously? > >>> > >>> + /* Epson printer */ > >>> + {USB_VPI(USB_VENDOR_EPSON, USB_PRODUCT_EPSON_TMU220B, 0)}, > >> > >> Yes, but you can also add the IFACE_XXX ones with "," simply. > >> > > > > Hi Hans, > > > > Here's what I have come-up with based on my understanding from your > > suggestion. I took a look as well from other USB devices' sources. This > > compiles without any problems, still able to detect my printers and > > printing still works well. Let me know if this is correct or needs > further > > changes. > > > > 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-04-02 14:27:54.073592000 > +0800 > > @@ -499,6 +499,13 @@ > > {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,9 +562,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; > > } > > } > > > > 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 > > > > freebsd@generic:~ % dmesg > > ... > > ugen1.5: <EPSON EPSON UB-U03II> at usbus1 > > ugen1.6: <Printer-58 USB Printing Support> at usbus1 > > ulpt0 on uhub1 > > ulpt0: <EPSON EPSON UB-U03II, class 0/0, rev 1.10/2.00, addr 5> on usbus1 > > ulpt0: using bi-directional mode > > ulpt1 on uhub1 > > ulpt1: <Printer-58 USB Printing Support, class 0/0, rev 2.00/2.54, addr > 6> > > on usbus1 > > ulpt1: using bi-directional mode > > ulpt1: offline > > > > Here you go: > > https://cgit.freebsd.org/src/commit/?id=88162f7abd61206c98432f2c0de869a59be13854 > > Happy printing :-) > Hans, thank you so much for the help and guidance! :-) --000000000000124f6d05dba19021 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">= <div dir=3D"ltr" class=3D"gmail_attr">On Sat, Apr 2, 2022 at 8:30 AM Hans P= etter Selasky <<a href=3D"mailto:hps@selasky.org">hps@selasky.org</a>>= ; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px= 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 4/2/= 22 00:56, Archimedes Gaviola wrote:<br> > On Fri, Apr 1, 2022 at 12:01 AM Hans Petter Selasky <<a href=3D"mai= lto:hps@selasky.org" target=3D"_blank">hps@selasky.org</a>> wrote:<br> > <br> >> On 3/31/22 15:52, Archimedes Gaviola wrote:<br> >>> Are you pertaining to this code Hans, the one you've share= d to me<br> >>> previously?<br> >>><br> >>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Epson printer */<br> >>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0{USB_VPI(USB_VENDOR_EPSON, USB_PRO= DUCT_EPSON_TMU220B, 0)},<br> >><br> >> Yes, but you can also add the IFACE_XXX ones with "," si= mply.<br> >><br> > <br> > Hi Hans,<br> > <br> > Here's what I have come-up with based on my understanding from you= r<br> > suggestion. I took a look as well from other USB devices' sources.= This<br> > compiles without any problems, still able to detect my printers and<br= > > printing still works well. Let me know if this is correct or needs fur= ther<br> > changes.<br> > <br> > freebsd@generic:~ % diff -Nur /usr/src/sys/dev/usb/serial/ulpt.c.orig<= br> > /usr/src/sys/dev/usb/serial/ulpt.c<br> > --- /usr/src/sys/dev/usb/serial/ulpt.c.orig=C2=A0 =C2=A0 =C2=A02022-03= -21<br> > 19:44:29.178010000 +0800<br> > +++ /usr/src/sys/dev/usb/serial/ulpt.c=C2=A0 2022-04-02 14:27:54.07359= 2000 +0800<br> > @@ -499,6 +499,13 @@<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {USB_IFACE_CLASS(UICLASS_PRINTER),<b= r> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0USB_IFACE_SUBCLASS(UISUBCLASS_= PRINTER),<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0USB_IFACE_PROTOCOL(UIPROTO_PRI= NTER_1284)},<br> > +<br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Epson printer */<br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0{USB_VENDOR(USB_VENDOR_EPSON),<br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 USB_PRODUCT(USB_PRODUCT_EPSON_TMU220B),<b= r> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 USB_IFACE_CLASS(UICLASS_VENDOR),<br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 USB_IFACE_SUBCLASS(UISUBCLASS_VENDOR),<br= > > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 USB_IFACE_PROTOCOL(UIPROTO_PRINTER_BI)},<= br> >=C2=A0 =C2=A0};<br> > <br> >=C2=A0 =C2=A0static int<br> > @@ -555,9 +562,11 @@<br> >=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 break;<br> >=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 {<br> >=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++;<br> > -=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=A0if ((id->bInterfaceClass =3D= =3D<br> > UICLASS_PRINTER) &&<br> > -=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->bInterfaceS= ubClass =3D=3D<br> > UISUBCLASS_PRINTER) &&<br> > -=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->bInterfaceP= rotocol =3D=3D<br> > UIPROTO_PRINTER_BI)) {<br> > +=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=A0if ((id->bInterfaceClass =3D= =3D UICLASS_PRINTER<br> > ||<br> > +=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=A0id->bInterfaceCl= ass =3D=3D UICLASS_VENDOR)<br> > &&<br> > +=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->bInterfaceS= ubClass =3D=3D<br> > UISUBCLASS_PRINTER ||<br> > +=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=A0id->bInterfaceCl= ass =3D=3D<br> > UISUBCLASS_VENDOR) &&<br> > +=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->bInterfaceP= rotocol =3D=3D<br> > UIPROTO_PRINTER_BI)) {<br> >=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;<br> >=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 }<br> >=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 }<br> > <br> > freebsd@generic:~ % diff -Nur /usr/src/sys/dev/usb/usbdevs.orig<br> > /usr/src/sys/dev/usb/usbdevs<br> > --- /usr/src/sys/dev/usb/usbdevs.orig=C2=A0 =C2=A02022-03-21 19:42:20.= 999397000 +0800<br> > +++ /usr/src/sys/dev/usb/usbdevs=C2=A0 =C2=A0 =C2=A0 =C2=A0 2022-04-01= 01:21:31.361567000 +0800<br> > @@ -1941,6 +1941,7 @@<br> >=C2=A0 =C2=A0product EPSON 2480=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A00x0121=C2=A0 Perfection 2480 scanner<br> >=C2=A0 =C2=A0product EPSON 3590=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A00x0122=C2=A0 Perfection 3590 scanner<br> >=C2=A0 =C2=A0product EPSON 4990=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A00x012a=C2=A0 Perfection 4990 Photo scanner<br> > +product EPSON TMU220B=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0x0202=C2=A0 = TM-U220B<br> >=C2=A0 =C2=A0product EPSON CRESSI_EDY=C2=A0 =C2=A0 =C2=A0 =C2=A00x0521= =C2=A0 Cressi Edy diving computer<br> >=C2=A0 =C2=A0product EPSON N2ITION3=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00x= 0522=C2=A0 Zeagle N2iTion3 diving computer<br> >=C2=A0 =C2=A0product EPSON STYLUS_875DC=C2=A0 =C2=A0 =C2=A00x0601=C2=A0= Stylus Photo 875DC Card Reader<br> > <br> > freebsd@generic:~ % dmesg<br> > ...<br> > ugen1.5: <EPSON EPSON UB-U03II> at usbus1<br> > ugen1.6: <Printer-58 USB Printing Support> at usbus1<br> > ulpt0 on uhub1<br> > ulpt0: <EPSON EPSON UB-U03II, class 0/0, rev 1.10/2.00, addr 5> = on usbus1<br> > ulpt0: using bi-directional mode<br> > ulpt1 on uhub1<br> > ulpt1: <Printer-58 USB Printing Support, class 0/0, rev 2.00/2.54, = addr 6><br> > on usbus1<br> > ulpt1: using bi-directional mode<br> > ulpt1: offline<br> > <br> <br> Here you go:<br> <a href=3D"https://cgit.freebsd.org/src/commit/?id=3D88162f7abd61206c98432f= 2c0de869a59be13854" rel=3D"noreferrer" target=3D"_blank">https://cgit.freeb= sd.org/src/commit/?id=3D88162f7abd61206c98432f2c0de869a59be13854</a><br> <br> Happy printing :-)<br></blockquote><div><br></div>Hans, thank you so much f= or the help and guidance! :-)<br></div></div> --000000000000124f6d05dba19021--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJFbk7E4enEswXzOvyf-XcJ7vb_NgGMD9Wx-6Biwr_UsHZMapg>