From owner-svn-src-stable@FreeBSD.ORG Sun Dec 19 21:33:28 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E579E106564A; Sun, 19 Dec 2010 21:33:28 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3DA88FC0A; Sun, 19 Dec 2010 21:33:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBJLXSKp030432; Sun, 19 Dec 2010 21:33:28 GMT (envelope-from joerg@svn.freebsd.org) Received: (from joerg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBJLXSvF030430; Sun, 19 Dec 2010 21:33:28 GMT (envelope-from joerg@svn.freebsd.org) Message-Id: <201012192133.oBJLXSvF030430@svn.freebsd.org> From: Joerg Wunsch Date: Sun, 19 Dec 2010 21:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216573 - stable/8/sys/dev/ieee488 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Dec 2010 21:33:29 -0000 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)