Commit Graph

26 Commits

Author SHA1 Message Date
Warner Losh
e0a6103d7d manufacturer id is typically 4 bytes 2003-03-14 21:11:01 +00:00
Warner Losh
62bac311fc Don't be so verbose about 'unknown' CIS tuples. We were printing each
one three times before we did the dump.  Also, we printed 0x00 for the
tuple type rather than the actual tuple type.  Now, we print the
actual tuple type.  This appears to have no ill effects.

Should get rid of the

Code NN not found
and
code Unknown ignored

messages.  The ignored messages are still generated for tuples tuples
who have a minimum length set and we find a tuple of that type that's
shorter than the minimum length.
2003-03-14 13:17:35 +00:00
Brian Feldman
e088615df0 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.)
2003-02-25 22:14:38 +00:00
Takeshi Shibagaki
d9dd0fde5f Add some code which read manufucturer id. This is for NEWCARD compatibility.
Reviewed by: imp
2002-02-20 14:48:23 +00:00
Warner Losh
7a731ac2d2 Update length more correctly when parsing a cis info field.
Before, we were using
	while (*p++ && --len > 0);
to do this.  However, len doesn't get decremented for the NUL byte, so when
we used len later to see if we still have CIS left for some optional fields,
we'd run off the end of an array and dump core.

Instead, replace it with
	len -= strlen(p) + 1;
	p += strlen(p) + 1;
which is more correct.  It is a little bogus to assume that p points to
a valid C string, but only a little.  The PC Card SPEC mandates that it
does, and we already depend on that with the use of strdup a few lines
earlier.  Since much of the rest of the cis parsing code isn't hyper
retentive about error checking, I'll leave that level of checking for
another time and/or another committer :-).
2002-01-06 18:03:55 +00:00
Duncan Barclay
3105a10149 Use constants in <pccard/cis.h> for scannign the memory window with.
Approved by:	imp
2001-05-07 21:58:31 +00:00
Ollivier Robert
61ea53372a Fix building with -DDEBUG. 2000-06-18 20:22:11 +00:00
Mitsuru IWASAKI
1f4b0b5767 MFPAO3. Improvement of of pccard cis tuple parsing capability.
- Fixed bogus CIS tuple dumping (Network node ID, IRQ modes and etc.)
 - Include telling drivers ethernet address if Network node ID
   tuple is available.  This is usefull for some bogus ehter cards which
   can't get correct ethernet address from CIS tupple.

Obtained from:	PAO3
2000-04-26 15:36:43 +00:00
Mitsuru IWASAKI
1ea7ed21c8 MFPAO: support wildcard entry for generic serial and fixed
disk as fallthrough entry.

Submitted by:	MIHIRA Sanpei Yoshiro <sanpei@sanpei.org>, iwasaki
Reviewed by:	imp, -mobile ML and nomads ML in Japan
Obtained from:	http://www.freebsd.org/~iwasaki/pccard/pccardd-generic.diff
		http://home.jp.freebsd.org/~sanpei/4-current/usr.sbin-pccard-pccardd.diff
2000-04-05 18:39:21 +00:00
Warner Losh
17c770d7e5 Version 1.16 was a bad change, so revert it. 1999-12-08 18:12:02 +00:00
Warner Losh
87db5eaa0d Bump CIS_MAXSTR from 30 to 254. pccard appears to define the entire
section we take them from to be up to 255 bytes long, so that's the
max size for the string.  They can't all be this big, but I don't have
a better number and better to be a little long than a little short.

Also only consume len characters of the cis buffer so we don't run off
the end into the next buffer and get garbage.  This second patch
shouldn't impact anything, but I'll hold off back porting this to
-stable until I get more reports on the stability before/after this
fix.
1999-12-07 19:23:56 +00:00
Peter Wemm
97d92980a9 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
Nate Williams
8ff8eb13f7 MF22: Finish fixing 'looping' bug. 1998-04-20 05:42:26 +00:00
Nate Williams
c4bf475b75 - If we see a tuple we don't expect, don't spin forever. Withouth this fix,
I can't run pccardc dumpcis on my Wavelan card. :(

Obtained from:	PAO
1998-04-19 18:41:45 +00:00
Tatsumi Hosokawa
7d0ec55f03 Some parameter was left uninitialized when the card with incomplete
"Version 1" CIS tupple is plugged after normal card.
1998-03-20 04:49:19 +00:00
Nate Williams
ec3383fb48 - Include <pccard/cardinfo.h> instead of <pccard/card.h> which was recently
renamed.
1997-11-18 21:08:14 +00:00
Philippe Charnier
9dd6fd23cd Use err(3). Add usage()s. 1997-10-06 11:36:08 +00:00
Peter Wemm
476602a9d0 Revert $FreeBSD$ to $Id$ 1997-02-22 16:15:28 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Nate Williams
16a960917f - A pass at staticizing things.
- Try to have all output go through the routines in util.c [logerr(),
  log_1s(), die()]
- Add *some* code in util.c to allow pccardd to run out of sysinstall.

Submitted by: Mostly me, but some by Tatsumi Hosokawa <hosokawa@jp.FreeBSD.org>
1997-01-06 08:35:06 +00:00
Nate Williams
18f527dc18 Staticize and remove unused function.
Inspired by:	The Nomad code
1996-06-18 21:58:55 +00:00
Nate Williams
c40d042f0f Prepend the CIS string length define with CIS_ per the rest of the
constants.

Obtained from:	Nomad code
1996-06-17 22:30:30 +00:00
Nate Williams
94fe059277 Added RCS Id and BSD-style copyrights to individual files. 1996-04-18 04:25:17 +00:00
Nate Williams
ba4aa9f624 Run indent on all these files to make them more readable. (I also went
through by hand and cleaned up some indent bogons.)
1996-04-10 06:49:32 +00:00
Poul-Henning Kamp
f64c9758b0 Shut a bunch of warnings. 1995-08-25 09:46:01 +00:00
Poul-Henning Kamp
f2b46629be The userland part of Andrew McRae's PCMCIA/PCCARD code.
This is not quite finished yet, and therefore I have not added it to the
usr.sbin/Makefile yet.
I collected a bunch of Andrews small programs into one: pccardc /phk

Reviewed by:	phk
Submitted by:	Andrew McRae <andrew@mega.com.au>
1995-08-24 09:03:04 +00:00