From nobody Sat Apr 23 05:01:30 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 10AC41A8B9B7 for ; Sat, 23 Apr 2022 05:01:49 +0000 (UTC) (envelope-from archimedes.gaviola@gmail.com) Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com [IPv6:2607:f8b0:4864:20::f2b]) (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 4KlfJW667yz4lrT for ; Sat, 23 Apr 2022 05:01:47 +0000 (UTC) (envelope-from archimedes.gaviola@gmail.com) Received: by mail-qv1-xf2b.google.com with SMTP id b17so7585272qvf.12 for ; Fri, 22 Apr 2022 22:01:47 -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=2vqlfkjrFOxEw7j2406woFJwPH6blh2kgf5ZzSvlZhw=; b=F0bh8UuNwO7dMYCII/JhX6WzFXDxOzzCMc1rccdV0oYyH6osmcUN6ZKvyUs5OReTOx WzUv7jnPA0RZH8mVCBu5QeQ3VoVS45LdHBwpXdXstyV4Z7Vih3/QfXMlHkUniRmc9TId qbhey/NLDRr2aLxSe4/u/m23NDWL9BNhk/pSpq9EQrZwcKAtSGyibBPZdmtQzwazlBLG nz4ZR9+31nhYigSXa7aOKnk/ybK44991qPiAfJXdlZej+7oZNstcSCzw1xiOMrc2YPuS 1LMomxRfT0gsq+O00v10mjxkCBIp6C4j32ukxZNJCy0P715CDs8w8XHfgFUe9kiDKWyL HjGg== 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=2vqlfkjrFOxEw7j2406woFJwPH6blh2kgf5ZzSvlZhw=; b=Winu2n0jfwYxyphsA4kGXCDe8VX/RhDbOpdIpDl/dTW3z1GsVWhNQ7RpIZESnqWOYN 8ZoU6iD+mgIV3i00avdlLo2LvJj8lBusvYABtAyvMpYxXqbOyHBu53z92AgZfi5d42Jh zbVuyA164Q1ZFOWHy8t6SaWUHEEWOZ55KvKvJLnbAjH0+5rxTqtW2bMxosJ+te3q9fC1 6iBng3OJGhYV9Tc3F431s3U/Hfvzsw8mZS7Bd2tVOwaS+rDGm7MTDlBl3CWpngKlJBYQ 9+hi1nCLZ883ZtyO5a4zm7UXbPZqjW68rLyH1K//lC9y/22tRbSYA9KM++Fj+RYEx/NO xtDA== X-Gm-Message-State: AOAM533SCWPjc3QbZWQ8+wLPwXp8vy0INZjaJnUajLEF2FdBhPNK1HNn l/ZJWnpZzfFY/ezcMZgTI9lebky64drQ4LEUYPyn9F6EnbeuEA== X-Google-Smtp-Source: ABdhPJzTt4cr3+HT+gTF+lPWBneSVrr5xQZdHMRsarA49rOVnGZ4xMipTK+oOybh6Kr9j7QMM7BxVK3h6JrNsRSS7r8= X-Received: by 2002:a05:6214:501b:b0:446:480f:17f9 with SMTP id jo27-20020a056214501b00b00446480f17f9mr5904587qvb.111.1650690100989; Fri, 22 Apr 2022 22:01:40 -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: <60f98b10-dcdc-cdf4-3d7a-fe9fd4dff223@selasky.org> <8226461b-5740-9c19-0575-2740bd952e16@selasky.org> <5fcece51-b014-330e-b701-fd75fa1ac204@selasky.org> <534edcd2-c6ef-729d-0768-9f469958e16a@selasky.org> <0b3e82fe-b45f-67f0-3009-90e887c14159@selasky.org> In-Reply-To: From: Archimedes Gaviola Date: Sat, 23 Apr 2022 13:01:30 +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="0000000000001a922305dd4b3d40" X-Rspamd-Queue-Id: 4KlfJW667yz4lrT X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=F0bh8UuN; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of archimedesgaviola@gmail.com designates 2607:f8b0:4864:20::f2b as permitted sender) smtp.mailfrom=archimedesgaviola@gmail.com X-Spamd-Result: default: False [-3.96 / 15.00]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0: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:2607:f8b0::/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(-0.96)[-0.964]; 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)[2607:f8b0:4864:20::f2b:from]; MLMMJ_DEST(0.00)[freebsd-arm]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N --0000000000001a922305dd4b3d40 Content-Type: text/plain; charset="UTF-8" On Sat, Apr 2, 2022 at 9:10 AM Archimedes Gaviola < archimedes.gaviola@gmail.com> wrote: > > > On Sat, Apr 2, 2022 at 8:30 AM Hans Petter Selasky > wrote: > >> On 4/2/22 00:56, Archimedes Gaviola wrote: >> > On Fri, Apr 1, 2022 at 12:01 AM Hans Petter Selasky >> 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: at usbus1 >> > ugen1.6: at usbus1 >> > ulpt0 on uhub1 >> > ulpt0: on >> usbus1 >> > ulpt0: using bi-directional mode >> > ulpt1 on uhub1 >> > ulpt1: > 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! :-) > Hi Hans, Confirmed this is now available in the https://download.freebsd.org/snapshots/arm64/aarch64/ISO-IMAGES/14.0/FreeBSD-14.0-CURRENT-arm64-aarch64-RPI-20220421-b91a48693a5-254961.img.xz and printing is working well. Once again, thanks a lot! Regards, Archimedes --0000000000001a922305dd4b3d40 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sat, Apr 2, 2022 at 9:1= 0 AM Archimedes Gaviola <archimedes.gaviola@gmail.com> wrote:

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 share= d to me
>>> previously?
>>>
>>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Epson printer */
>>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0{USB_VPI(USB_VENDOR_EPSON, USB_PRO= DUCT_EPSON_TMU220B, 0)},
>>
>> Yes, but you can also add the IFACE_XXX ones with "," si= mply.
>>
>
> Hi Hans,
>
> Here's what I have come-up with based on my understanding from you= r
> 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 fur= ther
> changes.
>
> freebsd@generic:~ % diff -Nur /usr/src/sys/dev/usb/serial/ulpt.c.orig<= br> > /usr/src/sys/dev/usb/serial/ulpt.c
> --- /usr/src/sys/dev/usb/serial/ulpt.c.orig=C2=A0 =C2=A0 =C2=A02022-03= -21
> 19:44:29.178010000 +0800
> +++ /usr/src/sys/dev/usb/serial/ulpt.c=C2=A0 2022-04-02 14:27:54.07359= 2000 +0800
> @@ -499,6 +499,13 @@
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {USB_IFACE_CLASS(UICLASS_PRINTER), >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0USB_IFACE_SUBCLASS(UISUBCLASS_= PRINTER),
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0USB_IFACE_PROTOCOL(UIPROTO_PRI= NTER_1284)},
> +
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Epson printer */
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0{USB_VENDOR(USB_VENDOR_EPSON),
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 USB_PRODUCT(USB_PRODUCT_EPSON_TMU220B), > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 USB_IFACE_CLASS(UICLASS_VENDOR),
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 USB_IFACE_SUBCLASS(UISUBCLASS_VENDOR), > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 USB_IFACE_PROTOCOL(UIPROTO_PRINTER_BI)},<= br> >=C2=A0 =C2=A0};
>
>=C2=A0 =C2=A0static int
> @@ -555,9 +562,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 =C2=A0 break;
>=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=A0if ((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 =C2=A0(id->bInterfaceS= ubClass =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(id->bInterfaceP= rotocol =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=A0if ((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 =C2=A0id->bInterfaceCl= ass =3D=3D UICLASS_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 =C2=A0(id->bInterfaceS= ubClass =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=A0id->bInterfaceCl= ass =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 =C2=A0(id->bInterfaceP= rotocol =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 }
>
> 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 =C2=A02022-03-21 19:42:20.= 999397000 +0800
> +++ /usr/src/sys/dev/usb/usbdevs=C2=A0 =C2=A0 =C2=A0 =C2=A0 2022-04-01= 01:21:31.361567000 +0800
> @@ -1941,6 +1941,7 @@
>=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
>=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
>=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
> +product EPSON TMU220B=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0x0202=C2=A0 = TM-U220B
>=C2=A0 =C2=A0product EPSON CRESSI_EDY=C2=A0 =C2=A0 =C2=A0 =C2=A00x0521= =C2=A0 Cressi Edy diving computer
>=C2=A0 =C2=A0product EPSON N2ITION3=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00x= 0522=C2=A0 Zeagle N2iTion3 diving computer
>=C2=A0 =C2=A0product EPSON STYLUS_875DC=C2=A0 =C2=A0 =C2=A00x0601=C2=A0= 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.freeb= sd.org/src/commit/?id=3D88162f7abd61206c98432f2c0de869a59be13854

Happy printing :-)

Hans, thank you so much f= or the help and guidance! :-)

Hi Hans,

Confirmed this is now ava= ilable in the https://download.freebsd.org/snapshots/arm64/aarch64/ISO= -IMAGES/14.0/FreeBSD-14.0-CURRENT-arm64-aarch64-RPI-20220421-b91a48693a5-25= 4961.img.xz and printing is working well. Once again, thanks a lot!
=

Regards,
Arch= imedes

--0000000000001a922305dd4b3d40--