Bug 51958 - [urio] [patch] update for urio driver
Summary: [urio] [patch] update for urio driver
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: 4.8-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-usb (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-08 10:50 UTC by Akifyev Sergey
Modified: 2019-01-27 06:16 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Akifyev Sergey 2003-05-08 10:50:10 UTC
This patch adds support for Digit@lway MPIO mp3 players to
urio driver, and fixes it's possible deadlock. Patch was thoroughly
tested on -STABLE. I had no time to test it on -CURRENT, but it
shouldn't break anything there too. This is needed to support MPIO
driver project (http://mpio.sourceforge.net)

Fix: 

Just apply the patch.

--=20
regards,
Akifyev Sergey <asa@gascom.ru>
JSC Gascom <http://www.gascom.ru>
PGP key available from:
ftp://ftp.gascom.ru/pub/PGP-keys/asa.txt

--=-n+E2M38LMjCMnT0lllsD
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQA+uictbu06QwmNwNsRAg/RAJ9lhpuY3m8TovUk9kP9QsGB4tEdeQCgmBIU
MgH/kIZkcR6rELyksYjOPhI=
=eAtN
-----END PGP SIGNATURE-----

--=-n+E2M38LMjCMnT0lllsD--
How-To-Repeat: 	N/A
Comment 1 Akifyev Sergey 2003-05-12 14:36:11 UTC
On Thu, 2003-05-08 at 09:45, Sergey Akifyev wrote:
> 	Just apply the patch.

I think I forgot to include the patch :b
So, here it is:

-----------% cut %-----------
--- urio.c.orig	Thu May  8 11:50:28 2003
+++ urio.c	Thu May  8 12:16:35 2003
@@ -156,6 +156,8 @@
 	usbd_device_handle sc_udev;
 	usbd_interface_handle sc_iface;
 
+	int sc_mpio;
+
 	int sc_opened;
 	usbd_pipe_handle sc_pipeh_in;
 	usbd_pipe_handle sc_pipeh_out;
@@ -183,16 +185,21 @@
 		return UMATCH_NONE;
 
 	dd = usbd_get_device_descriptor(uaa->device);
+	if (!dd) return UMATCH_NONE;
 
-	if (dd &&
-	    ((UGETW(dd->idVendor) == USB_VENDOR_DIAMOND &&
-	    UGETW(dd->idProduct) == USB_PRODUCT_DIAMOND_RIO500USB) ||
-	    (UGETW(dd->idVendor) == USB_VENDOR_DIAMOND2 &&
-	      (UGETW(dd->idProduct) == USB_PRODUCT_DIAMOND2_RIO600USB ||
-	      UGETW(dd->idProduct) == USB_PRODUCT_DIAMOND2_RIO800USB))))
+	if (UGETW(dd->idVendor) == USB_VENDOR_DIGITALWAY &&
+		UGETW(dd->idProduct) == USB_PRODUCT_DIGITALWAY_MPIO) {
 		return UMATCH_VENDOR_PRODUCT;
-	else
-		return UMATCH_NONE;
+	}
+
+	if (((UGETW(dd->idVendor) == USB_VENDOR_DIAMOND &&
+		UGETW(dd->idProduct) == USB_PRODUCT_DIAMOND_RIO500USB) ||
+		(UGETW(dd->idVendor) == USB_VENDOR_DIAMOND2 &&
+		  (UGETW(dd->idProduct) == USB_PRODUCT_DIAMOND2_RIO600USB ||
+		  UGETW(dd->idProduct) == USB_PRODUCT_DIAMOND2_RIO800USB))))
+		return UMATCH_VENDOR_PRODUCT;
+
+	return UMATCH_NONE;
 }
 
 USB_ATTACH(urio)
@@ -201,6 +208,7 @@
 	char devinfo[1024];
 	usbd_device_handle udev;
 	usbd_interface_handle iface;
+	usb_device_descriptor_t *dd;
 	u_int8_t epcount;
 #if defined(__NetBSD__) || defined(__OpenBSD__)
 	u_int8_t niface;
@@ -239,6 +247,11 @@
 	}
 	sc->sc_iface = iface;
 #endif
+	dd = usbd_get_device_descriptor(uaa->device);
+	if (!dd) USB_ATTACH_ERROR_RETURN;
+
+	sc->sc_mpio = (UGETW(dd->idVendor) == USB_VENDOR_DIGITALWAY);
+	
 	sc->sc_opened = 0;
 	sc->sc_pipeh_in = 0;
 	sc->sc_pipeh_out = 0;
@@ -262,6 +275,10 @@
 			ermsg = "interface endpoint";
 			goto nobulk;
 		}
+
+		if (sc->sc_mpio &&
+			UE_GET_XFERTYPE(edesc->bmAttributes) != UE_BULK)
+			continue;
 	
 		d = RIO_UE_GET_DIR(edesc->bEndpointAddress);
 		if (d != RIO_NODIR)
@@ -313,7 +330,6 @@
 	if ((flag & (FWRITE|FREAD)) != (FWRITE|FREAD))
 		return EACCES;
 
-	sc->sc_opened = 1;
 	sc->sc_pipeh_in = 0;
 	sc->sc_pipeh_out = 0;
 	if (usbd_open_pipe(sc->sc_iface, 
@@ -332,6 +348,7 @@
 			sc->sc_pipeh_out = 0;
 			return EIO;
 	};
+	sc->sc_opened = 1;
 	return 0;
 }
 
@@ -517,6 +534,8 @@
 	usbd_status r;
 
 	USB_GET_SC(urio, unit, sc);
+
+	if (sc->sc_mpio) return ENXIO;
 
 	switch (cmd) {
 	case RIO_RECV_COMMAND:
--- usbdevs.orig	Thu May  8 11:51:36 2003
+++ usbdevs	Thu May  8 12:07:59 2003
@@ -349,6 +349,7 @@
 vendor ENTREGA		0x1645	Entrega
 vendor ACTIONTEC	0x1668	Actiontec Electronics
 vendor DLINK		0x2001	D-Link
+vendor DIGITALWAY	0x2735	Digit@lway
 vendor DAISY		0x3579	Daisy Technology
 vendor INTEL		0x8086	Intel
 vendor HP2		0xf003	Hewlett Packard
@@ -542,6 +543,9 @@
 product DIGI ACCELEPORT2	0x0002	AccelePort USB 2
 product DIGI ACCELEPORT4	0x0004	AccelePort USB 4
 product DIGI ACCELEPORT8	0x0008	AccelePort USB 8
+
+/* Digit@lway products */
+product DIGITALWAY MPIO		0x0001	MPIO MP3 Players
 
 /* D-Link products */
 /*product DLINK DSBS25		0x0100	DSB-S25 serial adapter*/
-----------% cut %-----------
-- 
regards,
Sergey Akifyev <asa@gascom.ru>
JSC Gascom <http://www.gascom.ru>
PGP key available from:
ftp://ftp.gascom.ru/pub/PGP-keys/asa.txt
Comment 2 Giorgos Keramidas freebsd_committer freebsd_triage 2003-05-15 09:59:32 UTC
Adding to audit trail:

On 2003-05-15 09:48, Sergey Akifyev <asa@gascom.ru> wrote:
>
> I can post the links to where patches are located :)
>
> ftp://ftp.gascom.ru/pub/patches/urio.c.diff
> ftp://ftp.gascom.ru/pub/patches/usbdevs.diff
>
> MD5 (urio.c.diff) = 6633a10e9543a5ca938d68a0ae9408d6
> MD5 (usbdevs.diff) = 0f487d9ec7ebb60955c998da7531967e
Comment 3 Akifyev Sergey 2003-06-04 15:30:07 UTC
On Thu, 2003-05-15 at 09:48, Sergey Akifyev wrote:

ftp://ftp.gascom.ru/pub/patches/urio.c.diff_1
MD5 (urio.c.diff_1) = df344d5bde81ba5b813ba98649ab0c8f

This is patch v2 for urio.c. It fixes also panic when unplugging player
when device is open by some process. This bug was not introduced by my
first patch. I've tested, it now survives unplugging at any condition.
Possibly, last version is not too clean, but it's much better than what
we have now :)

P.S. I'm resending this message: looks like nobody noticed this.
	Also, this would be correct to raise priority of this PR, as
	it is no longer just a support request.
	It fixes easily reproducible panic.
-- 
regards,
Sergey Akifyev <asa@gascom.ru>
JSC Gascom <http://www.gascom.ru>
PGP key available from:
ftp://ftp.gascom.ru/pub/PGP-keys/asa.txt
Comment 4 Kris Kennaway freebsd_committer freebsd_triage 2003-07-18 02:02:18 UTC
Responsible Changed
From-To: freebsd-bugs->joe

Assign to USB maintainer
Comment 5 joe freebsd_committer freebsd_triage 2004-11-10 11:06:19 UTC
Responsible Changed
From-To: joe->freebsd-usb

Hand this over to the usb mailling list.
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2007-07-02 07:10:53 UTC
State Changed
From-To: open->feedback

From misfiled PR usb/51958: 

Date: Sun, 01 Jul 2007 23:38:54 -0600 (MDT) 
Comment 7 Mark Linimon freebsd_committer freebsd_triage 2008-02-13 09:37:01 UTC
State Changed
From-To: feedback->suspended

The patches are no longer available on the FTP server, and the submitter 
has not responded for a request to their new location.  This one just 
fell through the cracks :-( 

Mark it suspended in case anyone wants to pick up the patch that's there 
and continue with it.
Comment 8 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:48:11 UTC
batch change:

For bugs that match the following
-  Status Is In progress 
AND
- Untouched since 2018-01-01.
AND
- Affects Base System OR Documentation

DO:

Reset to open status.


Note:
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
Comment 9 Oleksandr Tymoshenko freebsd_committer freebsd_triage 2019-01-27 06:16:23 UTC
The hardware required for verification of this patch is unlikely to be available. Closing PR as "OBE". If anybody has the device and is willing to verify the patch, please re-open the PR. Sorry patch hasn't been picked up sooner.