Home | History | Annotate | Download | only in pcmcia
History log of /src/sys/dev/pcmcia/pcmcia_cis.c
RevisionDateAuthorComments
 1.57  10-Nov-2019  chs in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.56  03-Feb-2019  mrg - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
this case, and thus can't be marked __dead easily
 1.55  12-May-2009  cegger branches: 1.55.64;
struct device * -> device_t, no functional changes intended.
 1.54  15-Mar-2009  cegger ansify function definitions
 1.53  14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.52  03-Jul-2008  drochner branches: 1.52.4; 1.52.10;
split device/softc
Now I'm through - all my devices are split.
 1.51  05-Apr-2008  cegger branches: 1.51.4; 1.51.6; 1.51.8;
use aprint_*_dev and device_xname
 1.50  16-Nov-2006  christos branches: 1.50.48;
__unused removal on arguments; approved by core.
 1.49  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.48  02-Sep-2006  christos branches: 1.48.2; 1.48.4;
redo with c99 initializers
 1.47  02-Sep-2006  christos - comment out impossible comparison
- add missing initializer
 1.46  08-Apr-2006  christos - wrap memspace {}, pointed out by rui.
- comment out the memspace none case, pointed out by rui.
- move declarations to the top to avoid brace mess.
 1.45  08-Apr-2006  christos Split the tuple parsing code in its own function for each kind, instead of
having a single parsing function that has more than 1000 lines of code.
 1.44  08-Apr-2006  rpaulo Back out rev 1.42 and 1.43. It's been causing much more hassle than it should
and I don't feel like continue arguing about it.
 1.43  06-Apr-2006  rpaulo Add misssing }. Sorry for breaking the build.
 1.42  06-Apr-2006  rpaulo In pcmcia_parse_cis_tuple(), refactor the memspace section introducing
a switch statement and fixing CID 566.
 1.41  23-Feb-2006  gdamore branches: 1.41.2; 1.41.4; 1.41.6;
When unmapping and remapping, the mem handle and mem tags can change. Do
not assume that they will remain the same.
 1.40  11-Dec-2005  christos branches: 1.40.2; 1.40.4; 1.40.6;
merge ktrace-lwp.
 1.39  27-Feb-2005  perry branches: 1.39.4;
nuke trailing whitespace
 1.38  04-Feb-2005  perry de-__P
 1.37  15-Oct-2004  enami branches: 1.37.4; 1.37.6;
Rewrite the loop without using useless SIMPLEQ_FOREACH macro.
 1.36  17-Sep-2004  itojun deal with PCMCIA_TPCE_IO_RANGE_ADDRSIZE_NONE and
PCMCIA_TPCE_IO_RANGE_LENGTHSIZE_NONE properly. enami
solves kern/26726.
 1.35  10-Aug-2004  mycroft Constify.
 1.34  07-Aug-2004  mycroft Swap around the output in some other cases so it's consistent.
Remove some more DELAY()s.
 1.33  07-Aug-2004  mycroft Only DELAY() once per CIS region, not once per tuple.
For PCMCIACISDEBUG, print out the tuple *before* parsing it or calling the
callback, so that we can see the tuple that the callback claimed.
 1.32  22-Oct-2003  mjl Typo in comment. From OpenBSD.
 1.31  15-Aug-2002  christos branches: 1.31.6;
Fix multi-function card memory problems:
- centralize pcmcia function allocation and free'ing.
- free the cfe too, not just the pf in the multifunction card case.
- don't free pointers while walking the list, because free() will
fill the memory with deadbeef, thus killing list walking.
 1.30  01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.29  12-Jan-2002  tsutsui branches: 1.29.8; 1.29.10;
Call malloc(9) with M_ZERO flag instead of memset() after malloc().
 1.28  15-Nov-2001  lukem don't need <sys/types.h> when including <sys/param.h>
 1.27  13-Nov-2001  lukem add RCSIDs
 1.26  25-Oct-2001  bouyer Commit changes I posted to tech-kern on Oct 14, which makes the ethernet part
of my Xircom RealPort Ethernet 10/100 + Modem (REM56G) work.
The modem part is still not usable (this would need some PCMCIA magic that
I don't know how to do; see my message to tech-kern on Oct 07).
Change to pcmcia_cis.c from OpenBSD.
I checked that this doesn't break a 3com 3C562D (ethernet+modem) which I
also have.
 1.25  24-Sep-2001  itohy branches: 1.25.2;
Add simple boundary check on CIS parsing.
I have a weird PC-card-style appliance (I'm not sure I may call it a PC card)
whose ``CIS'' reads zeros forever, which caused kernel panic.

For your interest, it is a cooling fan to be inserted to a PC card slot.
 1.24  07-Jul-2001  thorpej branches: 1.24.2; 1.24.4;
bzero -> memset
 1.23  13-May-2001  jmc Turn off PCMCIACISDEBUG by default. This should get set with options in a config file
 1.22  27-Mar-2001  toshii Change place of tuple.{memt,memh} initialization.
 1.21  10-Feb-2001  martin branches: 1.21.2;
Stopgap fix for PR 9984: sprinkle some (small) delays at appropriate
places into the CIS reading code.

The card in question has IO8 only enabled in its CIS info and is apparently
not able to keep up with quick reads. It words fine in a pcmcia slot but
panics(!) the kernel in a TI 1250 cardbus slot. This may be a failure of
the pci cardbus code when initializing this bridge. When finding (and
fixing) that, we should back this change out.

The card I am testing with is not broken, I have multiple versions of it
(AVM Fritz! pcmcia ISDN card), all work fine on windows and all cause
us to panic because of bogus CIS info read.

XXX - panicing because of bogus CIS data is probably another error.
 1.20  17-Oct-2000  haya Add a cis decoding function which decodes some CISTPL_FUNCE tuples for
disk and network functions.
 1.19  14-Jul-2000  jun apply Kenji Aoyama <aoyama@nk.mcu.or.jp>'s patch
on port-hpcmips-ja@jp.netbsd.org Mon, 10 Jul 2000 21:21:47 +0900

FIX:
Can't read CIS tuple chain:some TDK CF Flash memory card.
 1.18  21-Feb-2000  enami branches: 1.18.4;
Cosmetic changes.
 1.17  10-Feb-2000  chopps map common memory 8 bit for cis scan when following longlinks.
 1.16  25-Jan-2000  chopps The cfe is initialized to the default entry, when a table entry value
is present don't OR in the flags with the defaults, replace them.
 1.15  20-Jan-2000  enami Don't overwrite cfe->flags.
 1.14  14-Jan-2000  cgd Some additional sanity checks to keep this code from bursting into
flame if presented with bad CIS data (e.g. because of a memory space
conflict):
* more sanity checking on LONGLINK_MFC CIS tuples (exact length check, sanity
check on size vs. size of array we allocated for them), to avoid various
missteps which could cause this code to complete trash the kernel stack.
* clear the entire contents of the state structure before processing, so
things like uninitted pointers will actually have a known value!
* be more careful with CISTPL_CFTABLE_ENTRY: check to see that the current
state's default_entry isn't NULL before dereferencing it.
 1.13  07-Nov-1999  enami Print range of all iospaces or all memspaces if their length aren't zero.
 1.12  11-Jul-1999  bad branches: 1.12.2; 1.12.4; 1.12.8;
In pcmcia_pars_cis_tuple(): in the PCMCIA_TPCE_FS_MEMSPACE_TABLE case
there is one more memspace in the table then the PCMCIA_TPCE_MS_COUNT
mask produces.
 1.11  11-Jul-1999  bad In pcmcia_print_cis(): When printing io and mem spaces don't append trailing
0s if length or hostaddr are zero, instead DTRT.
 1.10  29-Dec-1998  marc branches: 1.10.2; 1.10.4;
check for end of tuple while reading cfe data
 1.9  22-Aug-1998  msaitoh fix version string (from PC Card Standard, April 1998 (Release 6.1))
 1.8  13-Aug-1998  nathanw Use PCMCIA_FUNCTION definitions.
Initialize function ID in new pcmcia_function structures to
PCMCIA_FUNCTION_UNSPEC, not PCMCIA_FUNCTION_MULTIFUNCTION (0).
 1.7  19-Jul-1998  christos Add a devlist2h.awk so that we don't sprinkle the same constants over
each device driver file and use it.
 1.6  01-Jul-1998  marc better MFC parsing (for 3c56[23]D), and make sure the pf is zeroed out before using it (for adaptec 1460b)
 1.5  29-May-1998  msaitoh add some information from "PC Card standard March 1997"
 1.4  09-Mar-1998  christos - fix pcmcia_scan_cis to return:
-1 error
0 desired tuple not found
1 desired tuple found
 1.3  19-Oct-1997  enami Make `manufacturer' and `product' 32bit wide so that they can contain
both 16bit id values found in card CIS and special value to indicate
that no value found in CIS. Use that special value for the card that
doesn't have id values. Test that value in ne2000_match().
 1.2  16-Oct-1997  thorpej Pull marc-pcmcia branch down from trunk.
 1.1  30-Jul-1997  marc branches: 1.1.2;
file pcmcia_cis.c was initially added on branch marc-pcmcia.
 1.1.2.10  16-Oct-1997  thorpej Copyright/license update.
 1.1.2.9  15-Oct-1997  enami No need to cast a generic pointer.
 1.1.2.8  14-Oct-1997  thorpej KNF, RCS IDs.
 1.1.2.7  18-Sep-1997  marc deal with the case of a card with a LONGLINK_MFC and an implicit but
invalid LONGLINK. Also be more verbose for debugging of this sort of
situation.
 1.1.2.6  23-Aug-1997  thorpej Make sure the newly allocated function structure is zero'd.
 1.1.2.5  10-Aug-1997  thorpej Always print a message if the CIS has a wrong checksum. Do not fail if
the checksum is wrong; many WaveLAN cards have bad checksums, but work fine.
 1.1.2.4  10-Aug-1997  thorpej Create a structure to encapsulate information about allocated i/o and
mem space on the pcmcia bus. Use this in chip-level window enable
functions rather than making assumptions about the bus space handles.

Also, clean up lots of debugging prints. Use patchables to enable them.
 1.1.2.3  30-Jul-1997  thorpej If Really Verbse Debugging is compiled in, use a patchable variable to
turn the messages on/off, so you can clean up the output without rebuilding.
 1.1.2.2  30-Jul-1997  marc add the pcmcia device dir.
 1.1.2.1  30-Jul-1997  marc added pcmcia infrastructure and a few devices
 1.10.4.1  02-Aug-1999  thorpej Update from trunk.
 1.10.2.1  15-Jan-2000  he Pull up revision 1.14 (requesged by cgd):
Make PCMCIA CIS parsing more robust.
 1.12.8.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.4.1  15-Nov-1999  fvdl Sync with -current
 1.12.2.3  21-Apr-2001  bouyer Sync with HEAD
 1.12.2.2  11-Feb-2001  bouyer Sync with HEAD.
 1.12.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.18.4.2  13-Mar-2001  he Pull up revision 1.21 (requested by martin):
Add some small delays at appropriate places in CIS reading code.
This is a stopgap fix for PR#9984, avoiding a panic when an
``AVM Fritz!'' ISDN card is installed in a cardbus slot.
 1.18.4.1  22-Aug-2000  jun Pullup rev. 1.19 (approved by thorpej):
apply Kenji Aoyama <aoyama@nk.mcu.or.jp>'s patch
on port-hpcmips-ja@jp.netbsd.org Mon, 10 Jul 2000 21:21:47 +0900
FIX:
Can't read CIS tuple chain:some TDK CF Flash memory card.
 1.21.2.9  27-Aug-2002  nathanw Catch up to -current.
 1.21.2.8  20-Jun-2002  nathanw Catch up to -current.
 1.21.2.7  28-Feb-2002  nathanw Catch up to -current.
 1.21.2.6  08-Jan-2002  nathanw Catch up to -current.
 1.21.2.5  14-Nov-2001  nathanw Catch up to -current.
 1.21.2.4  26-Sep-2001  nathanw Catch up to -current.
Again.
 1.21.2.3  24-Aug-2001  nathanw Catch up with -current.
 1.21.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.21.2.1  09-Apr-2001  nathanw Catch up with -current.
 1.24.4.1  01-Oct-2001  fvdl Catch up with -current.
 1.24.2.4  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.24.2.3  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.24.2.2  11-Feb-2002  jdolecek Sync w/ -current.
 1.24.2.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.25.2.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.29.10.1  21-Oct-2003  jmc Pullup to rev 1.31 (requested in ticket #699)
Enable support for multi-function pcmcia cards.
 1.29.8.2  29-Aug-2002  gehenna catch up with -current.
 1.29.8.1  20-Jun-2002  gehenna catch up with -current.
 1.31.6.7  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.31.6.6  04-Feb-2005  skrll Sync with HEAD.
 1.31.6.5  19-Oct-2004  skrll Sync with HEAD
 1.31.6.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.31.6.3  18-Sep-2004  skrll Sync with HEAD.
 1.31.6.2  12-Aug-2004  skrll Sync with HEAD.
 1.31.6.1  03-Aug-2004  skrll Sync with HEAD
 1.37.6.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.37.6.1  12-Feb-2005  yamt sync with head.
 1.37.4.1  29-Apr-2005  kent sync with -current
 1.39.4.2  30-Dec-2006  yamt sync with head.
 1.39.4.1  21-Jun-2006  yamt sync with head.
 1.40.6.1  22-Apr-2006  simonb Sync with head.
 1.40.4.1  09-Sep-2006  rpaulo sync with head
 1.40.2.1  01-Mar-2006  yamt sync with head.
 1.41.6.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.41.4.1  19-Apr-2006  elad sync with head.
 1.41.2.2  03-Sep-2006  yamt sync with head.
 1.41.2.1  03-Sep-2006  yamt sync with head.
(this file has not been synced at all after branching? why?)
 1.48.4.2  10-Dec-2006  yamt sync with head.
 1.48.4.1  22-Oct-2006  yamt sync with head
 1.48.2.1  18-Nov-2006  ad Sync with head.
 1.50.48.2  28-Sep-2008  mjf Sync with HEAD.
 1.50.48.1  02-Jun-2008  mjf Sync with HEAD.
 1.51.8.1  18-Jul-2008  simonb Sync with head.
 1.51.6.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.51.4.2  16-May-2009  yamt sync with head
 1.51.4.1  04-May-2009  yamt sync with head.
 1.52.10.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.52.4.1  28-Apr-2009  skrll Sync with HEAD.
 1.55.64.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.55.64.1  10-Jun-2019  christos Sync with HEAD

RSS XML Feed