From 8a1dbe91d41f1b3bd8328cb716d9ccd54931e20d Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 20 Nov 2008 08:20:53 +0000 Subject: [PATCH] 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. --- usr.sbin/dumpcis/readcis.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/dumpcis/readcis.c b/usr.sbin/dumpcis/readcis.c index 1831b8dc7e5..4d2d110c494 100644 --- a/usr.sbin/dumpcis/readcis.c +++ b/usr.sbin/dumpcis/readcis.c @@ -259,6 +259,7 @@ read_one_tuplelist(int fd, int flags, off_t offs) 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) {