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
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
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
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
Responsible Changed From-To: freebsd-bugs->joe Assign to USB maintainer
Responsible Changed From-To: joe->freebsd-usb Hand this over to the usb mailling list.
State Changed From-To: open->feedback From misfiled PR usb/51958: Date: Sun, 01 Jul 2007 23:38:54 -0600 (MDT)
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.
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.
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.