From nobody Sat Apr 02 00:30:25 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 A1D3D1A46EED for ; Sat, 2 Apr 2022 00:30:29 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4KVdH84v77z3F4x for ; Sat, 2 Apr 2022 00:30:28 +0000 (UTC) (envelope-from hps@selasky.org) Received: from [10.36.2.165] (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 013662600D1; Sat, 2 Apr 2022 02:30:26 +0200 (CEST) Message-ID: <0b3e82fe-b45f-67f0-3009-90e887c14159@selasky.org> Date: Sat, 2 Apr 2022 02:30:25 +0200 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 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: Raspberry Pi 3B USB Printing Issue Content-Language: en-US To: Archimedes Gaviola Cc: freebsd-arm@freebsd.org 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> From: Hans Petter Selasky In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4KVdH84v77z3F4x X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-3.30 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; NEURAL_HAM_LONG(-1.00)[-1.000]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.999]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; MLMMJ_DEST(0.00)[freebsd-arm]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N 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: > on usbus1 > ulpt1: using bi-directional mode > ulpt1: offline > Here you go: https://cgit.freebsd.org/src/commit/?id=88162f7abd61206c98432f2c0de869a59be13854 Happy printing :-) --HPS