Home | History | Annotate | Download | only in cardbus
History log of /src/sys/dev/cardbus/if_tlp_cardbus.c
RevisionDateAuthorComments
 1.72  25-Sep-2022  thorpej Remove unnecessary include of <sys/malloc.h>.
 1.71  14-Jul-2016  msaitoh - Use aprint*() more in xxx_attach().
- Add missing aprint_naive("\n").
- Remove extra spaces and tabs.
- KNF.
 1.70  01-Aug-2011  drochner branches: 1.70.12; 1.70.30;
remove some bloat:
-cardbus doesn't use multiple interrupt lines like PCI, and it doesn't
use machanisms like interrupt line register and swizzling -- no need
to carry around dummy information, this is all dealt with by the
bridge
(I'm asking myself how "rbus_ppb" can work -- a bridge attached to
cardbus just can't work like a normal PCI bridge as far as interrupts
are concerned. I thing that should be a hardware specific driver
because behavior is not covered by a standard.)
-cardbus always uses 3.3V -- no need for a variable to keep track
of the voltage
 1.69  26-Jul-2011  dyoung Replace anonymous constants, 0x10, 0x14, ..., with PCI_BAR(0),
PCI_BAR(1), .... There was no change in the generated assembly. I used
this semantic patch:

@ mapsit @
identifier bar;
expression pact;
@@

(
pci_mapreg_map
|
Cardbus_mapreg_map
)(pact, bar, ...)

@ depends on mapsit @
identifier mapsit.bar;
@@
(
- #define bar 0x10
+ #define bar PCI_BAR(0)
|
- #define bar 0x14
+ #define bar PCI_BAR(1)
|
- #define bar 0x18
+ #define bar PCI_BAR(2)
|
- #define bar 0x1C
+ #define bar PCI_BAR(3)
|
- #define bar 0x20
+ #define bar PCI_BAR(4)
)
 1.68  09-Jul-2011  christos - add a routine to get the name of the card.
 1.67  10-Mar-2010  dyoung This is *always* compiled with #define rbus 1, so get rid of the
conditional compilation.

Simplify interrupt (dis)establishment by two source transformations:

- cardbus_intr_disestablish(cc, cf, ih);
+ Cardbus_intr_disestablish(ct, ih);

- ih = cardbus_intr_establish(cc, cf, ...);
+ ih = Cardbus_intr_establish(ct, ...);

Tested by Klaus Heinz.
 1.66  26-Feb-2010  dyoung Use PCI_ constants and macros instead of CARDBUS_. Use
Cardbus_conf_{read,write}() instead of cardbus_conf_{read,write}().
Delete all of the CARDBUS_ constants and macros that replicate PCI_.

Compile-tested, only.
 1.65  26-Feb-2010  dyoung sc_csr is read & written from the PCI Command & Status Register,
so make its type pcireg_t.
 1.64  25-Feb-2010  dyoung Make fxp at cardbus detach during shutdown.

Stop calling (*cardbus_ctrl) to enable bus mastering, I/O and memory
spaces on the CardBus bridge. cbb(4) always enables that stuff,
anyway. In the process, avoid remembering what BAR we mapped by
writing CARDBUS_{IO,MEM}_ENABLE to sc_cben or sc_cbenable, and
record the BAR in use sc_bar, instead.

Replace more CARDBUS_ constants with PCI_ constants.

Compile-tested, only.
 1.63  24-Feb-2010  dyoung Start to tuck Cardbus under the PCI abstraction. Step #1, textual
substitution: for all practical purposes, pcitag_t and cardbustag_t
are interchangeable, so just use pcitag_t. Ditto pcireg_t and
cardbusreg_t.

While I'm here, don't make a copy (sc_intrline) of
cardbus_attach_args.ca_intrline unless we use it, later.
 1.62  18-Jan-2010  pooka branches: 1.62.2;
Remove conditional inclusion of unused bpf.h
 1.61  17-Apr-2009  cegger device_t/softc split. Tested with tlp at pci
 1.60  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.59  24-Jun-2008  drochner branches: 1.59.4; 1.59.10;
clean up the cardbus interrupt stuff:
There were cardbus_intr_line_t and cardbus_intr_handle_t used intermixed
for the same variable, and that variable is pretty much useless because
cardbus doesn't follow the PCI interrupt swizzling etc scheme.
Useless interrupt numbers were printed on cardbus device attach.
So as a first step to sanity, kill cardbus_intr_handle_t and poison
cardbus_intr_line_t to discourage printing it as a %d.
Use cardbus_intr_line_t consistently throughout the code.
Remove the "interrupting at foo" messages because the information
is misleading. We could come up with a better interrupt vector
information, but because cardbus interrupts are mediated by pccbb
it would still be misleading.
 1.58  28-Apr-2008  martin branches: 1.58.2; 1.58.4;
Remove clause 3 and 4 from TNF licenses
 1.57  06-Apr-2008  cegger branches: 1.57.2; 1.57.4;
use aprint_*_dev and device_xname
 1.56  06-Feb-2008  dyoung branches: 1.56.6;
On a tlp@cardbus, don't set the Tx FIFO threshold to "store &
forward" mode, but let the driver automatically adjust.

Cardbus is not actually so slow that it cannot keep up with the
NIC. It may sometimes have appeared so because we had not enabled
PCI read bursts. These days, though, we enable read bursts on at
least one TI PCI-Cardbus bridge.
 1.55  09-Dec-2007  jmcneill Merge jmcneill-pm branch.
 1.54  19-Oct-2007  ad branches: 1.54.2; 1.54.4; 1.54.6;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.53  16-Nov-2006  christos branches: 1.53.8; 1.53.22; 1.53.24; 1.53.28;
__unused removal on arguments; approved by core.
 1.52  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.51  07-Sep-2006  dogcow branches: 1.51.2; 1.51.4;
remove more vestiges of CCITT, LLC, HDLC, NS, and NSIP.
 1.50  21-Jul-2006  gdamore Update ADMtek pci device ids to match data sheets. While here, add the 9513
device (although I've never seen one, I have a datasheet for it. :-)
 1.49  29-Mar-2006  thorpej Use device_private().
 1.48  11-Dec-2005  christos branches: 1.48.4; 1.48.6; 1.48.8; 1.48.10; 1.48.12;
merge ktrace-lwp.
 1.47  09-Sep-2005  drochner remove the useless (always 0) device number from cardbus driver state,
autoconf attach structures and configuration cycle functions
(just leave the kernel configuration attribute for now to avoid breaking
config(1) files)
 1.46  13-Jun-2005  tron branches: 1.46.2;
Add support for the LinkSys PCMPC200 Cardbus ethernet card.
 1.45  27-Feb-2005  perry branches: 1.45.2;
nuke trailing whitespace
 1.44  04-Feb-2005  perry de-__P
 1.43  02-Aug-2004  mycroft branches: 1.43.4; 1.43.6;
3 things:
* cardbusdevs -> pcidevs
* Add a Microsoft product.
* Use tlp_cardbus_{disable,enable}() in the powerhook. This is an experiment
and may need more work.
 1.42  22-Jul-2004  mycroft Program BARs before enabling memory or I/O access.
 1.41  09-May-2004  jonathan Remove now-unused 'int pmreg'.
 1.40  08-May-2004  christos Cleanup and remove suplicate copies of the incorrect power setup code.
Thanks to mycroft for suggesting this.
XXX: This is a copy of the pci code; another reason cardbus needs to die.
 1.39  24-Oct-2003  mycroft + NetGear FA511
 1.38  11-Nov-2002  onoe branches: 1.38.6;
Add support of AboCom FE2500MX 10/100 Ethernet (Lanneed LD-CBL/TX).
 1.37  02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.36  30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.35  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.34  27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.33  14-Apr-2002  mycroft Snarf-and-barf the `quirk' code from if_tlp_pci.c, and use it to set the right
mediasw (MII-over-SIO) on the Level One FPC-0101TX 10/100 card.
XXX This should probably key off subsystem IDs, not OUIs...
 1.32  17-Feb-2002  augustss Add another tlp card (found by trial and error).
 1.31  13-Nov-2001  lukem add RCSID
 1.30  18-Jul-2001  thorpej Slight tweak to previous; C requires a statement after a label.
 1.29  18-Jul-2001  onoe revert 2 of 3 in previous commit.
empty default is needed to make gcc happy.
 1.28  17-Jul-2001  mrg remove empty default: cases.
 1.27  13-Apr-2001  kanaoka branches: 1.27.2;
Add support for ADMtek AN985.
 1.26  14-Mar-2001  christos PR/12405: Wolfgang Rupprecht: Add another abocom card (linksys pcm200)
 1.25  16-Jan-2001  thorpej branches: 1.25.2;
Add support for AN985-based CardBus network interfaces.
From Masanori Kanaoka <kanaoka@ann.hi-ho.ne.jp>.
 1.24  04-Apr-2000  thorpej branches: 1.24.4; 1.24.6;
Rearrange the 21142/21143 SROM/CIS handling code to give it a chance
of working, and last-ditch default to MII-over-SIO with no reset routine
if we don't find an ISV SROM or quirk.
 1.23  04-Apr-2000  thorpej - if_tlp_cardbus.c: Use the `pmreg' pointer passed by by
cardbus_get_capability() [mirror change already made to if_tlp_pci.c]
- if_tlp_cardbus.c: If we don't find an ISV SROM, try to grab the
Ethernet address from the CIS.
- if_tlp_cardbus.c: set CardBus cards to store-and-forward mode from
the get-go.
- Put the TxThresh tables in tulipvar.h, and use them in the CardBus
and PCI front-ends to go to store-and-forward mode.
- Document the Xircom X3201-3 clone a little more.
 1.22  22-Mar-2000  thorpej In tlp_cardbus_detach(), only unmap the bus space if we were able to
map it in the first place. Pointed out by enami@netbsd.org.
 1.21  19-Mar-2000  thorpej Add suspend/resume hooks to ensure that the chip doesn't scramble memory
after an APM suspend and is unsnoozed after an APM resume.
 1.20  15-Mar-2000  thorpej Add power management support to the `tlp' driver. The battery on my
laptop lasts a whole lot longer now.
 1.19  14-Mar-2000  thorpej Pick I/O before Memory space.
 1.18  10-Mar-2000  thorpej Move pretty much all of the PCI configuration goo into a separate
function.
 1.17  10-Mar-2000  thorpej Pull the code that take the Tulip out of powersave mode into a separate
function.
 1.16  07-Mar-2000  thorpej Reenable the code that clears SLEEP and SNOOZE from the CFDA register.
 1.15  07-Mar-2000  mycroft A few things:
* Take advantage of the tulip_read_srom() changes.
* Don't frob the so-called `CFDA' register. We're really looking for the
PMCSR, which is in a different location anyway.
* Don't panic if we detach an interface for which we never called tlp_attach().
 1.14  01-Mar-2000  thorpej Cosmetic change.
 1.13  04-Feb-2000  augustss Make the driver work even if DIAGNOSTIC is not set.
 1.12  04-Feb-2000  haya Now cardbus_mapreg_unmap() has been implemented in
sys/dev/cardbus/cardbus_map.c. The detech function in
sys/dev/cardbus/if_tlp_cardbus.c uses cardbus_mapreg_unmap().
 1.11  01-Feb-2000  thorpej First cut at detach support; doens't fully work yet.
 1.10  25-Jan-2000  thorpej Add support for the Xircom X3201-3 in 21143 emulation mode. This chip
appears on some Xircom and Intel RealPort(tm) cards.

From Rafal Boni, with some slight modifications from me.
 1.9  25-Jan-2000  thorpej Add a chip type for the Xircom X3201-3, and centralize the declaration
of the chip names array.
 1.8  25-Jan-2000  mycroft Do a CARDBUS_BM_ENABLE just to be sure.
 1.7  25-Jan-2000  thorpej Make sure the latency timer is set to a reasonable value.

From Masanori Kanaoka <kanaoka@ann.hi-ho.ne.jp>.
 1.6  11-Dec-1999  thorpej branches: 1.6.2;
Handle the 21143 PMCSR, like we do in the PCI front-end.
 1.5  11-Dec-1999  thorpej - Don't try to run the chip in big-endian mode. Not all chips support
this consistently, and it doesn't always work even when the chip
supports it.
- Make sure things DMA'd to the chip that the chip interprets are in
little-endian mode.
 1.4  07-Dec-1999  thorpej After reading the 21143 manual again, make sure SNOOZE is cleared in
the CFDA register, too.
 1.3  07-Dec-1999  thorpej Add the 21143 PMCSR offset, from Masanori Kanaoka.
 1.2  07-Dec-1999  thorpej Make sure to bring the chip out of sleep mode. From Masanori Kanaoka.
 1.1  19-Nov-1999  thorpej Add a basic CardBus front-end for the `tlp' driver. Still more work to do.
 1.6.2.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.24.6.5  21-Apr-2001  bouyer Sync with HEAD
 1.24.6.4  27-Mar-2001  bouyer Sync with HEAD.
 1.24.6.3  18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.24.6.2  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.24.6.1  04-Apr-2000  bouyer file if_tlp_cardbus.c was added on branch thorpej_scsipi on 2000-11-20 11:39:54 +0000
 1.24.4.1  29-Jan-2002  he Pull up revisions 1.25-1.27 (requested by dillo):
Add support for AN985-based CardBus network interfaces.
 1.25.2.8  11-Nov-2002  nathanw Catch up to -current
 1.25.2.7  18-Oct-2002  nathanw Catch up to -current.
 1.25.2.6  17-Apr-2002  nathanw Catch up to -current.
 1.25.2.5  28-Feb-2002  nathanw Catch up to -current.
 1.25.2.4  14-Nov-2001  nathanw Catch up to -current.
 1.25.2.3  24-Aug-2001  nathanw Catch up with -current.
 1.25.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.25.2.1  09-Apr-2001  nathanw Catch up with -current.
 1.27.2.5  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.27.2.4  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.27.2.3  16-Mar-2002  jdolecek Catch up with -current.
 1.27.2.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.27.2.1  03-Aug-2001  lukem update to -current
 1.38.6.7  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.38.6.6  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.38.6.5  04-Feb-2005  skrll Sync with HEAD.
 1.38.6.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.38.6.3  18-Sep-2004  skrll Sync with HEAD.
 1.38.6.2  12-Aug-2004  skrll Sync with HEAD.
 1.38.6.1  03-Aug-2004  skrll Sync with HEAD
 1.43.6.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.43.6.1  12-Feb-2005  yamt sync with head.
 1.43.4.1  29-Apr-2005  kent sync with -current
 1.45.2.1  18-Jun-2005  riz Pull up revision 1.46 (requested by tron in ticket #450):
Add support for the LinkSys PCMPC200 Cardbus ethernet card.
 1.46.2.5  11-Feb-2008  yamt sync with head.
 1.46.2.4  21-Jan-2008  yamt sync with head
 1.46.2.3  27-Oct-2007  yamt sync with head.
 1.46.2.2  30-Dec-2006  yamt sync with head.
 1.46.2.1  21-Jun-2006  yamt sync with head.
 1.48.12.1  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.48.10.1  19-Apr-2006  elad sync with head.
 1.48.8.3  14-Sep-2006  yamt sync with head.
 1.48.8.2  11-Aug-2006  yamt sync with head
 1.48.8.1  01-Apr-2006  yamt sync with head.
 1.48.6.1  22-Apr-2006  simonb Sync with head.
 1.48.4.1  09-Sep-2006  rpaulo sync with head
 1.51.4.2  10-Dec-2006  yamt sync with head.
 1.51.4.1  22-Oct-2006  yamt sync with head
 1.51.2.1  18-Nov-2006  ad Sync with head.
 1.53.28.1  25-Oct-2007  bouyer Sync with HEAD.
 1.53.24.3  23-Mar-2008  matt sync with HEAD
 1.53.24.2  09-Jan-2008  matt sync with HEAD
 1.53.24.1  06-Nov-2007  matt sync with HEAD
 1.53.22.2  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.53.22.1  23-Aug-2007  joerg Provide cardbus_{set,get}_powerstate instead of the former
cardbus_powerstate / cardbus_setpowerstate.
Provide cardbus_conf_{capture,restore} and cardbus_net_generic_power.

In general: reduce diff to PCI.
 1.53.8.1  23-Oct-2007  ad Sync with head.
 1.54.6.1  11-Dec-2007  yamt sync with head.
 1.54.4.1  26-Dec-2007  ad Sync with head.
 1.54.2.1  18-Feb-2008  mjf Sync with HEAD.
 1.56.6.2  29-Jun-2008  mjf Sync with HEAD.
 1.56.6.1  02-Jun-2008  mjf Sync with HEAD.
 1.57.4.3  11-Mar-2010  yamt sync with head
 1.57.4.2  04-May-2009  yamt sync with head.
 1.57.4.1  16-May-2008  yamt sync with head.
 1.57.2.1  18-May-2008  yamt sync with head.
 1.58.4.1  27-Jun-2008  simonb Sync with head.
 1.58.2.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.59.10.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.59.4.1  28-Apr-2009  skrll Sync with HEAD.
 1.62.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.70.30.1  05-Oct-2016  skrll Sync with HEAD
 1.70.12.1  03-Dec-2017  jdolecek update from HEAD

RSS XML Feed