From owner-svn-src-all@FreeBSD.ORG Thu Nov 20 08:20:53 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC5651065670; Thu, 20 Nov 2008 08:20:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC9818FC12; Thu, 20 Nov 2008 08:20:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAK8KrsK044618; Thu, 20 Nov 2008 08:20:53 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAK8KrQl044617; Thu, 20 Nov 2008 08:20:53 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200811200820.mAK8KrQl044617@svn.freebsd.org> From: Warner Losh Date: Thu, 20 Nov 2008 08:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185123 - head/usr.sbin/dumpcis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2008 08:20:53 -0000 Author: imp Date: Thu Nov 20 08:20:53 2008 New Revision: 185123 URL: http://svn.freebsd.org/changeset/base/185123 Log: Restore now-useless ioctl as a roadmap. The original dumpcis code assumed it had to toggle between attribute and common memory in the cards. The kernel is supposed to cope with that automatically and give us a tuple list. However, there's a number of details of how that happens that's currently, ummm, magical and/or not implemented for 16-bit PC Cards that have CIS_LONGLINK_C tuples in them (eg, mix both attribute memory and common memory). Also, CIS_LOGNLINK_A entries might not be handled completely correctly either, since there can be gaps in the attribute vs common stuff. All this will need to be corrected in the kernel. Once it is corrected, dumpcis can be made even simpler in some ways, a little more complicated in others once an API for presentation of CIS to userland in these weird cases is settled upon. Modified: head/usr.sbin/dumpcis/readcis.c Modified: head/usr.sbin/dumpcis/readcis.c ============================================================================== --- head/usr.sbin/dumpcis/readcis.c Thu Nov 20 08:14:14 2008 (r185122) +++ head/usr.sbin/dumpcis/readcis.c Thu Nov 20 08:20:53 2008 (r185123) @@ -259,6 +259,7 @@ read_one_tuplelist(int fd, int flags, of tl = xmalloc(sizeof(*tl)); tl->offs = offs; tl->flags = flags & MDF_ATTR; + ioctl(fd, PIOCRWFLAG, &flags); lseek(fd, offs, SEEK_SET); do { if (read(fd, &code, 1) != 1) {