svn commit: r198631 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/usb/misc dev/usb/storage dev/xen/xenpci

Andrew Thompson thompsa at FreeBSD.org
Thu Oct 29 23:09:38 UTC 2009


Author: thompsa
Date: Thu Oct 29 23:09:37 2009
New Revision: 198631
URL: http://svn.freebsd.org/changeset/base/198631

Log:
  MFC r196490
  
   - FIFO's are always opened separately in read and write direction even if the
     actual device is opened for read and write. Fix fflags check so that the UFM
     and URIO drivers work.

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/usb/misc/ufm.c
  stable/8/sys/dev/usb/storage/urio.c
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/misc/ufm.c
==============================================================================
--- stable/8/sys/dev/usb/misc/ufm.c	Thu Oct 29 23:09:02 2009	(r198630)
+++ stable/8/sys/dev/usb/misc/ufm.c	Thu Oct 29 23:09:37 2009	(r198631)
@@ -86,11 +86,9 @@ static device_attach_t ufm_attach;
 static device_detach_t ufm_detach;
 
 static usb_fifo_ioctl_t ufm_ioctl;
-static usb_fifo_open_t ufm_open;
 
 static struct usb_fifo_methods ufm_fifo_methods = {
 	.f_ioctl = &ufm_ioctl,
-	.f_open = &ufm_open,
 	.basename[0] = "ufm",
 };
 
@@ -179,15 +177,6 @@ ufm_detach(device_t dev)
 }
 
 static int
-ufm_open(struct usb_fifo *dev, int fflags)
-{
-	if ((fflags & (FWRITE | FREAD)) != (FWRITE | FREAD)) {
-		return (EACCES);
-	}
-	return (0);
-}
-
-static int
 ufm_do_req(struct ufm_softc *sc, uint8_t request,
     uint16_t value, uint16_t index, uint8_t *retbuf)
 {
@@ -315,6 +304,10 @@ ufm_ioctl(struct usb_fifo *fifo, u_long 
 	struct ufm_softc *sc = usb_fifo_softc(fifo);
 	int error = 0;
 
+	if ((fflags & (FWRITE | FREAD)) != (FWRITE | FREAD)) {
+		return (EACCES);
+	}
+
 	switch (cmd) {
 	case FM_SET_FREQ:
 		error = ufm_set_freq(sc, addr);

Modified: stable/8/sys/dev/usb/storage/urio.c
==============================================================================
--- stable/8/sys/dev/usb/storage/urio.c	Thu Oct 29 23:09:02 2009	(r198630)
+++ stable/8/sys/dev/usb/storage/urio.c	Thu Oct 29 23:09:37 2009	(r198631)
@@ -390,9 +390,6 @@ urio_open(struct usb_fifo *fifo, int ffl
 {
 	struct urio_softc *sc = usb_fifo_softc(fifo);
 
-	if ((fflags & (FWRITE | FREAD)) != (FWRITE | FREAD)) {
-		return (EACCES);
-	}
 	if (fflags & FREAD) {
 		/* clear stall first */
 		mtx_lock(&sc->sc_mtx);


More information about the svn-src-all mailing list