Commit Graph

38 Commits

Author SHA1 Message Date
pfg
729533413f sys: use our roundup2/rounddown2() macros when param.h is available.
rounddown2 tends to produce longer lines than the original code
and when the code has a high indentation level it was not really
advantageous to do the replacement.

This tries to strike a balance between readability using the macros
and flexibility of having the expressions, so not everything is
converted.
2016-04-21 19:57:40 +00:00
imp
528b0d9be4 CardBus instead of cardbus. 2010-01-03 23:26:29 +00:00
imp
fb6fbfb763 __LP64__ is what's defined, not _LP64_, according to the manual (and
also experience).
2009-03-09 13:29:13 +00:00
imp
fdc03cf101 fix spelling error
Submitted by:	trasz
2009-02-06 09:34:17 +00:00
imp
0129b996aa Don't check for mapping above 4GB on 32-bit platforms. 2009-02-05 20:44:06 +00:00
imp
1d8d2a7ac9 Add some additional debugging for the memory code. 2009-02-05 18:51:14 +00:00
imp
28b104f719 First cut at fixing memory mapping botch. Nobody must use the ray(4)
driver since it couldn't have worked with NEWCARD w/o these fixes.
This should allow selecting 16-bit memory width as well (which was
what was broken).
2009-01-05 21:00:22 +00:00
jhb
55f67dd8da - Fix exca_(io|mem)_map() to return proper errno values.
- Change exca_activate_resource() to call BUS_ACTIVATE_RESOURCE() before
  calling exca_(io|mem)_map() since the latter use rman_get_bus(tag|handle)
  and the recent changes to nexus(4) mean that you need to activate a
  resource before reading the bus tag and handle.  This was true before,
  but now the nexus(4) drivers on x86 and ia64 are more forceful about it.

Reviewed by:	imp
2007-03-23 17:15:07 +00:00
imp
d9c67547e5 exca->pccarddev should always be non-null now. Only call it when the
device is actually attached.
2007-02-24 15:56:06 +00:00
imp
5b972eaa75 It turns out that it is easier to not NULL out pccard and cardbus
device pointers.  They don't change as the children device drivers
come and go.  Rather, check to see if the device is attached where we
would have checked ! NULL.  This solves many asymmetries in the code
that likely could lead to crashes when loading/unloading cbb without
one or more of the expected children's driver not present.
2007-02-15 07:22:27 +00:00
imp
bce860ebf1 Cleanup sloppy ifdef. 2006-09-24 00:26:33 +00:00
imp
99a2d2e8b4 The TOPIC97 and TOPIC100 seem to have a special register in the exca
space that enables low voltage operation (and maybe other stuff).
Enable the bits in this register so low voltage 16-bit cards may work.

Existance noticed in NetBSD driver.
2006-08-12 08:53:54 +00:00
imp
4e16f81076 Don't dereference an uninitialized pointer. 2006-03-09 16:28:24 +00:00
imp
0c736a6f9b Set the name of the chipset found 2005-10-19 00:25:39 +00:00
imp
cc449adce9 Minor commentary correction 2005-10-17 08:20:44 +00:00
imp
8a791e77bb MFP4: Minor tweaks. 2005-10-14 04:48:11 +00:00
imp
7fa2686fe8 'PC Card' instead of other variants 2005-09-22 06:01:44 +00:00
imp
c55a14c579 Properly calculate the offset in mapping the memory of pccards. This
allows my 3com cards to work again.  It appears that this code was
once there, but I removed it when I added the alignment issues.

MFC After: 5 days
PR: 70639 (and likely others)
2005-01-11 00:32:43 +00:00
imp
4b319958e7 Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
imp
382c9ac357 Didn't intend to commit debugging code enabled 2004-08-16 01:57:06 +00:00
imp
d51fd3961e Other part of the cbb isa/pci split. This likely is causing problems
wrt cbb module.
2004-08-15 23:17:54 +00:00
imp
c0271da9d5 Card type stuff was backwards, so assume io for the moment. mem needs
a lot of help and with luck bms will help me fix that.
2003-10-07 04:29:04 +00:00
imp
100e3b7635 CARDMEM is the offset of the address ON THE CARD (eg which page).
Instead, use EXCA_MEMREG_WIN_SHIFT which is the amount we shift the
bus address by to write into upper memory (eg above 24MB).  Use the
latter in this case.
2003-09-24 22:13:25 +00:00
imp
8809ff94d6 When we went to the set_flags interface for the memory resource, we
switched from PCCARD_MEM_FOO to PCCARD_A_MEM_FOO, yet we didn't change
exca in all the right places.  Do so now.  Also use PCCARD_WIDTH_AUTO
rather than the magic cookie 0.
2003-08-29 05:27:36 +00:00
imp
d947ee0dfe A number of minor fixes to the mapping of memory. This should help
reading the CIS on some cards.  However, not all just yet.  This makes
at least some of the xircom cards that weren't working to work.  It
doesn't make my home and away card work, however.

o Don't get the card offset wrong.  This is the biggest hassle for
  reading the CIS.  The old code was just so wrong I can't believe that
  it worked at all.
o Don't set the bit that allows/forces 16-bit memory access to the
  memory.  It is hard coded with 0x80.
o Don't need to slow down memory access with wait-states.  OLDCARD didn't
  need them and it doesn't hurt anything.
o remove bogus grousying in comment.
2003-08-28 05:01:11 +00:00
imp
9d9494d58d Fix location of $FreeBSD$ from last commit. 2003-08-27 23:30:01 +00:00
obrien
c63dab466c Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
imp
6fe75065ed MFP4:
Merge some common code from cbb into exca.
2003-06-07 20:46:39 +00:00
imp
ed66329ff9 Add two of three workarounds for interrupt storms for o2micro parts as
obtained from o2micro.  These should only be needed for 'older'
o2micro bridges (anything before the 7xxx series of bridges), but will
work with the new bridges.

# I don't plan on porting it to oldcard, but will happily commit to
# oldcard if someone else needs them.
2003-06-06 06:00:49 +00:00
phk
f68a8dce0d Don't use return(foo(...)); in function returning void.
Found by:       FlexeLint
2003-05-31 16:51:41 +00:00
imp
dd95a3a11a Massive overhaul of exca to help with the isa efforts:
o chip_name arrays ifdef'd out.
o use the OLDCARD-like get/put functions so we can support differnt types
  of mappings.
o Write the beggings of is this a valid exca device and introduce more
  chipset support.

# this is partially a wip, but also needed because some other cahnges I've
# made require some of these changes.
2003-02-14 06:21:18 +00:00
semenu
af97d007f0 Do not return(foo()) in void function.
Submitted by:	marius@alchemy.franken.de
MFC after:	3 days
2002-12-18 22:53:24 +00:00
imp
d0cb388eea Update comments to remind me about power bugs in oldcard. 2002-10-07 06:18:50 +00:00
imp
6823d78fc0 MFp4:
o Protect .h against multiple includes.
	o eliminate the pointers to the read/write routines.  The
	  bus_space_read routines can cope since we have the offset
	  field.
	o Print a warning if the requested map address is > 16M and
	  your chipset doesn't support the extended ExCA registers.
2002-07-26 08:01:08 +00:00
alfred
abcdbeb52e Fix a couple of places where preprocessor concatination was misused and
something wound up grafted to a comma.
2002-06-01 16:21:26 +00:00
takawata
d19ac116d6 Make oldcard and newcard kernel module work. 2002-05-30 17:38:00 +00:00
imp
a6ee5d93d9 Default debugging to OFF now. 2002-02-04 15:55:21 +00:00
imp
18c19163fe First draft of common code between pccbb and pcic drivers for talking
to ExCA register sets.  These registers exist in both ISA and PCI
devices in a couple different ways, and this will provide a common
base for future building.  This code is a rehash of the pccbb 16-bit
code, which was a rehash of the pcic code, which was a rehash of the
netbsd i82365 code.  More hashing to come.
2002-01-29 06:48:38 +00:00