From nobody Fri Apr 01 22:56:39 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 82D881A54DBF for ; Fri, 1 Apr 2022 22:57:07 +0000 (UTC) (envelope-from archimedes.gaviola@gmail.com) Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) (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 4KVbCK1Blhz4llD for ; Fri, 1 Apr 2022 22:56:58 +0000 (UTC) (envelope-from archimedes.gaviola@gmail.com) Received: by mail-ej1-x62c.google.com with SMTP id p15so8773367ejc.7 for ; Fri, 01 Apr 2022 15:56:58 -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=z/WzfxXWjzFX8C97lZBNMmn4n654ebROy/9KYvo/nUs=; b=OQ3uBTM4pCGY6c6WB0227oA3sTOu4Ep4+QciKpCCC9gXXeGlP/KovXnBoSisnD0bUE C6nyNVbgoCKXT2VMGCNvmTnzh1lsrBH6xkiqeSD/hbTsmnTjcW8rzqL54bh38duN7+kJ ej6YQodBb9rJVAVRvSJAA6nV9wPqw8VyR1GbenUpoF2HFoeEupi2ZFSiqeMblRF+nJYE GRBTioaLk2XzT3z3/wrQbtp6qS8L2XhFljQaWWIHHFl42t2paoFntn9P6wn7c8p+6W3j u3+ipd6H6XwBQWAF+Z4gizZzjI2LYYyQhUMPoRnqq0fsrAwGHyzpO/gI3cEeQPSicANq CoOQ== 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=z/WzfxXWjzFX8C97lZBNMmn4n654ebROy/9KYvo/nUs=; b=56iAjSxofQBjwvJdgcXokpMtqZ7QaSu3vF4Tx1In1IGIIB1LGCQiYYSZM2y/cnUdxu VHm5lRRLcHaM8xvEcnFPlToTUrR4jfqzBElN8nSHhNOlLTQOTCDBFVAIDaeZN5vwzQUr lRgbOBCYiffbMh/auBXnl7QUxkGD0DlBxM30XRZwbCz41HOBiSJ2azOQrGdGt4l5pWcl pr+HiJdyT/gmWahqycmBg2d1lqgAPh8mpz0cTp4vUtzomRM5yTt8ACxtk+GTnRHxLptd 5C1GlWYwCa8HE8cJcDFGTFNdqI9NVTDrS34c5yZBiWNME2mRMQWtZ7JuPLStFGw3a2h2 9usA== X-Gm-Message-State: AOAM530+niyooqjmH8r5hfYUGSso0SnW7mHz3p2Si5uHVSWTm8KxQGL/ iHTTXhf9m3d7YPs6bHvh2eJTtK5fxqA3Ev2SQzg2ksEnL7EL/w== X-Google-Smtp-Source: ABdhPJwvsMeI6unOLbgoR9uZNb4FyBOvshKyATKu09aOyk+DOIya2wbLhdFBHypxyqtWDinhwLm4fJ9ErayJAtyZoUc= X-Received: by 2002:a17:907:a41f:b0:6d6:f925:1696 with SMTP id sg31-20020a170907a41f00b006d6f9251696mr1789128ejc.62.1648853810773; Fri, 01 Apr 2022 15:56:50 -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> <534edcd2-c6ef-729d-0768-9f469958e16a@selasky.org> In-Reply-To: <534edcd2-c6ef-729d-0768-9f469958e16a@selasky.org> From: Archimedes Gaviola Date: Sat, 2 Apr 2022 06:56:39 +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="000000000000ad820305db9fb1a0" X-Rspamd-Queue-Id: 4KVbCK1Blhz4llD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=OQ3uBTM4; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of archimedesgaviola@gmail.com designates 2a00:1450:4864:20::62c as permitted sender) smtp.mailfrom=archimedesgaviola@gmail.com X-Spamd-Result: default: False [-2.73 / 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]; 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_SPAM_SHORT(0.27)[0.273]; 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::62c:from]; MLMMJ_DEST(0.00)[freebsd-arm]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N --000000000000ad820305db9fb1a0 Content-Type: text/plain; charset="UTF-8" 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: on usbus1 ulpt1: using bi-directional mode ulpt1: offline Thanks, Archimedes --000000000000ad820305db9fb1a0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Fri, Apr 1, 2022 at 12:01 AM Hans = Petter Selasky <hps@selasky.org&g= t; wrote:
On 3/3= 1/22 15:52, Archimedes Gaviola wrote:
> Are you pertaining to this code Hans, the one you've shared to me<= br> > 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_PRODUCT_EPS= ON_TMU220B, 0)},

Yes, but you can also add the IFACE_XXX ones with "," simply.
=

Hi Hans,

Here's what I have come-up wi= th based on my understanding from your suggestion. I took a look as well fr= om other USB devices' sources. This compiles without any problems, stil= l 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 =C2=A0 =C2=A0 2022-03-21 19:44:29= .178010000 +0800
+++ /usr/src/sys/dev/usb/serial/ulpt.c =C2=A02022-04-02= 14:27:54.073592000 +0800
@@ -499,6 +499,13 @@
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 {USB_IFACE_CLASS(UICLASS_PRINTER),
=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_1284)},
+
+ =C2=A0 =C2= =A0 =C2=A0 /* Epson printer */
+ =C2=A0 =C2=A0 =C2=A0 {USB_VENDOR(USB_VE= NDOR_EPSON),
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0USB_PRODUCT(USB_PRODUCT_EPSON_= TMU220B),
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0USB_IFACE_CLASS(UICLASS_VENDOR),<= br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0USB_IFACE_SUBCLASS(UISUBCLASS_VENDOR),
+= =C2=A0 =C2=A0 =C2=A0 =C2=A0USB_IFACE_PROTOCOL(UIPROTO_PRINTER_BI)},
=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 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 } 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_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 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 UISUBCLAS= S_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) &&
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =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->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-&= gt;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 }

freebsd@generic:~ % diff -Nur /usr/s= rc/sys/dev/usb/usbdevs.orig /usr/src/sys/dev/usb/usbdevs
--- /usr/src/sy= s/dev/usb/usbdevs.orig =C2=A0 2022-03-21 19:42:20.999397000 +0800
+++ /u= sr/src/sys/dev/usb/usbdevs =C2=A0 =C2=A0 =C2=A0 =C2=A02022-04-01 01:21:31.3= 61567000 +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 scanner
= =C2=A0product EPSON 3590 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0x0122 = =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
+pro= duct EPSON TMU220B =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00x0202 =C2=A0TM-U220B<= br>=C2=A0product EPSON CRESSI_EDY =C2=A0 =C2=A0 =C2=A0 0x0521 =C2=A0Cressi = 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 Reader

freebsd@ge= neric:~ % dmesg
...
ugen1.5: <EPSON EPSON UB-U03II> at usbus1
ugen1.6: &l= t;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 usbus1ulpt0: 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

Thanks,
Archimedes

--000000000000ad820305db9fb1a0--