Author: joerg
Date: Sun Dec 19 21:33:28 2010
New Revision: 216573
URL: http://svn.freebsd.org/changeset/base/216573

Log:
  Fix __retval vs. retval confusion: retval is meant to store the (userland)
  pointer where data is to be returned by ibask() (currently unimplemented),
  while __retval holds the value returned by the libgpib ibfoo() functions.
  
  The confusion resulted in the ibfoo() functions returning an uninitialized
  value except in situations where the GPIB activity has been terminated
  abnormally.
  
  Implement more of __ibsta: END and SRQI status bits (taken out of the
  uPD7210 IRQ status).
  
  Approved by:  re (kib)

Modified:
  stable/8/sys/dev/ieee488/ibfoo.c

Modified: stable/8/sys/dev/ieee488/ibfoo.c
==============================================================================
--- stable/8/sys/dev/ieee488/ibfoo.c    Sun Dec 19 21:18:33 2010        
(r216572)
+++ stable/8/sys/dev/ieee488/ibfoo.c    Sun Dec 19 21:33:28 2010        
(r216573)
@@ -333,6 +333,14 @@ gpib_ib_wait_xfer(struct upd7210 *u, str
                        break;
                }
        }
+       if ((u->rreg[ISR1] & IXR1_ENDRX) != 0) {
+               ib->ap->__retval |= END;
+               ib->ap->__ibsta |= END;
+       }
+       if ((u->rreg[ISR2] & IXR2_SRQI) != 0) {
+               ib->ap->__retval |= SRQI;
+               ib->ap->__ibsta |= SRQI;
+       }
        ib->mode = BUSY;
        ib->buf = NULL;
        upd7210_wr(u, IMR1, 0);
@@ -1027,7 +1035,7 @@ gpib_ib_ioctl(struct cdev *dev, u_long c
        ap->__iberr = 0;
        ap->__ibsta = 0;
        ap->__ibcnt = 0;
-       ap->retval = 0;
+       ap->__retval = 0;
 
        if (ap->__field & __F_TMO) {
                if (ap->tmo < 0 || ap->tmo >= max_timeouts)
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to