kern/51958: update for urio driver [PATCH]

Sergey Akifyev asa at gascom.ru
Mon May 12 06:40:10 PDT 2003


The following reply was made to PR kern/51958; it has been noted by GNATS.

From: Sergey Akifyev <asa at gascom.ru>
To: freebsd-gnats-submit at FreeBSD.org
Cc:  
Subject: Re: kern/51958: update for urio driver [PATCH]
Date: 12 May 2003 13:36:11 +0000

 --=-7YCBWw1li8Ql/q4ZtJeP
 Content-Type: text/plain
 Content-Transfer-Encoding: quoted-printable
 
 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;
 =20
 +	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;
 =20
  	dd =3D usbd_get_device_descriptor(uaa->device);
 +	if (!dd) return UMATCH_NONE;
 =20
 -	if (dd &&
 -	    ((UGETW(dd->idVendor) =3D=3D USB_VENDOR_DIAMOND &&
 -	    UGETW(dd->idProduct) =3D=3D USB_PRODUCT_DIAMOND_RIO500USB) ||
 -	    (UGETW(dd->idVendor) =3D=3D USB_VENDOR_DIAMOND2 &&
 -	      (UGETW(dd->idProduct) =3D=3D USB_PRODUCT_DIAMOND2_RIO600USB ||
 -	      UGETW(dd->idProduct) =3D=3D USB_PRODUCT_DIAMOND2_RIO800USB))))
 +	if (UGETW(dd->idVendor) =3D=3D USB_VENDOR_DIGITALWAY &&
 +		UGETW(dd->idProduct) =3D=3D USB_PRODUCT_DIGITALWAY_MPIO) {
  		return UMATCH_VENDOR_PRODUCT;
 -	else
 -		return UMATCH_NONE;
 +	}
 +
 +	if (((UGETW(dd->idVendor) =3D=3D USB_VENDOR_DIAMOND &&
 +		UGETW(dd->idProduct) =3D=3D USB_PRODUCT_DIAMOND_RIO500USB) ||
 +		(UGETW(dd->idVendor) =3D=3D USB_VENDOR_DIAMOND2 &&
 +		  (UGETW(dd->idProduct) =3D=3D USB_PRODUCT_DIAMOND2_RIO600USB ||
 +		  UGETW(dd->idProduct) =3D=3D USB_PRODUCT_DIAMOND2_RIO800USB))))
 +		return UMATCH_VENDOR_PRODUCT;
 +
 +	return UMATCH_NONE;
  }
 =20
  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 =3D iface;
  #endif
 +	dd =3D usbd_get_device_descriptor(uaa->device);
 +	if (!dd) USB_ATTACH_ERROR_RETURN;
 +
 +	sc->sc_mpio =3D (UGETW(dd->idVendor) =3D=3D USB_VENDOR_DIGITALWAY);
 +=09
  	sc->sc_opened =3D 0;
  	sc->sc_pipeh_in =3D 0;
  	sc->sc_pipeh_out =3D 0;
 @@ -262,6 +275,10 @@
  			ermsg =3D "interface endpoint";
  			goto nobulk;
  		}
 +
 +		if (sc->sc_mpio &&
 +			UE_GET_XFERTYPE(edesc->bmAttributes) !=3D UE_BULK)
 +			continue;
  =09
  		d =3D RIO_UE_GET_DIR(edesc->bEndpointAddress);
  		if (d !=3D RIO_NODIR)
 @@ -313,7 +330,6 @@
  	if ((flag & (FWRITE|FREAD)) !=3D (FWRITE|FREAD))
  		return EACCES;
 =20
 -	sc->sc_opened =3D 1;
  	sc->sc_pipeh_in =3D 0;
  	sc->sc_pipeh_out =3D 0;
  	if (usbd_open_pipe(sc->sc_iface,=20
 @@ -332,6 +348,7 @@
  			sc->sc_pipeh_out =3D 0;
  			return EIO;
  	};
 +	sc->sc_opened =3D 1;
  	return 0;
  }
 =20
 @@ -517,6 +534,8 @@
  	usbd_status r;
 =20
  	USB_GET_SC(urio, unit, sc);
 +
 +	if (sc->sc_mpio) return ENXIO;
 =20
  	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 at 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 at lway products */
 +product DIGITALWAY MPIO		0x0001	MPIO MP3 Players
 =20
  /* D-Link products */
  /*product DLINK DSBS25		0x0100	DSB-S25 serial adapter*/
 -----------% cut %-----------
 --=20
 regards,
 Sergey Akifyev <asa at gascom.ru>
 JSC Gascom <http://www.gascom.ru>
 PGP key available from:
 ftp://ftp.gascom.ru/pub/PGP-keys/asa.txt
 
 --=-7YCBWw1li8Ql/q4ZtJeP
 Content-Type: application/pgp-signature; name=signature.asc
 Content-Description: This is a digitally signed message part
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.2 (FreeBSD)
 
 iD8DBQA+v6NKbu06QwmNwNsRAkxJAJ9Oe6TVDO6VB3b+GnI+XIYZ3KYkcQCfVAj8
 Edfzxb8EXkI0qAPJi4jrN5E=
 =/mKY
 -----END PGP SIGNATURE-----
 
 --=-7YCBWw1li8Ql/q4ZtJeP--
 


More information about the freebsd-bugs mailing list