diff options
author | green <green@FreeBSD.org> | 2003-02-25 22:14:38 +0000 |
---|---|---|
committer | green <green@FreeBSD.org> | 2003-02-25 22:14:38 +0000 |
commit | cf6c58298298caeb25b29001ebbd42d321e1964d (patch) | |
tree | 8b8a6335d2271076ce535b5d62270c7bdad4d695 /usr.sbin/pccard/pccardd | |
parent | a3f8d3d8190991dc750a8ef3f91002bc9f877b26 (diff) | |
download | FreeBSD-src-cf6c58298298caeb25b29001ebbd42d321e1964d.zip FreeBSD-src-cf6c58298298caeb25b29001ebbd42d321e1964d.tar.gz |
Add a new subcommand to pccardc(8), "dumpcisfile", which reads a CIS
structure from a file instead of a PC-CARD itself before parsing and
dumping it. (E.g. useful when you get a CIS file from a manufacturer
which fixes they broken card's CIS, and add it to the pccard quirks.)
Diffstat (limited to 'usr.sbin/pccard/pccardd')
-rw-r--r-- | usr.sbin/pccard/pccardd/readcis.c | 5 | ||||
-rw-r--r-- | usr.sbin/pccard/pccardd/readcis.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/pccard/pccardd/readcis.c b/usr.sbin/pccard/pccardd/readcis.c index 6953337..35fbcb6 100644 --- a/usr.sbin/pccard/pccardd/readcis.c +++ b/usr.sbin/pccard/pccardd/readcis.c @@ -49,6 +49,7 @@ static const char rcsid[] = #ifdef RATOCLAN static int rex5588 = 0; #endif +int isdumpcisfile = 0; static int read_attr(int, char *, int); static int ck_linktarget(int, off_t, int); @@ -745,7 +746,9 @@ read_attr(int fd, char *bp, int len) { char blk[1024], *p = blk; int i, l; - + + if (isdumpcisfile) + return (read(fd, bp, len)); if (len > sizeof(blk) / 2) len = sizeof(blk) / 2; l = i = read(fd, blk, len * 2); diff --git a/usr.sbin/pccard/pccardd/readcis.h b/usr.sbin/pccard/pccardd/readcis.h index 8c718e2..8ebd745 100644 --- a/usr.sbin/pccard/pccardd/readcis.h +++ b/usr.sbin/pccard/pccardd/readcis.h @@ -144,3 +144,5 @@ struct cis *readcis(int); char *tuple_name(unsigned char); u_int parse_num(int, u_char *, u_char **, int); + +int isdumpcisfile; |