Commit Graph

26 Commits

Author SHA1 Message Date
jakllsch
28b0c5a3fd Make the Realtek PCI network interfaces detachable.
Use __arraycount to avoid null table entries.
Miscellaneous other touch-ups in bus front-ends.
2010-07-27 21:02:00 +00:00
dyoung
3caa8a5650 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, ...);

The identical change to a few other CardBus NICs has not caused any
problems, as expected, so I'm going to commit this rather safe change
and get on with the work.

Testers have been enlisted.  I will revisit this change if I get any
negative responses.
2010-03-18 20:51:42 +00:00
dyoung
508883c164 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.
2010-02-26 00:57:01 +00:00
dyoung
51d6f75dc3 sc_csr is read & written from the PCI Command & Status Register,
so make its type pcireg_t.
2010-02-26 00:01:27 +00:00
dyoung
fde907f497 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.
2010-02-25 23:40:39 +00:00
dyoung
8089c2dc69 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.
2010-02-24 19:52:51 +00:00
tsutsui
1de7f11179 Move pmf(9) calls to MI re_attach() and re_detach() from each backend. 2009-09-02 15:11:13 +00:00
tsutsui
c92a50c211 Remove unnecessary #includes. 2009-08-29 14:18:34 +00:00
drochner
36b6bc746c 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.
2008-06-24 19:44:51 +00:00
tsutsui
82cc885228 Split device_t/softc for re(4) and rtk(4). 2008-04-25 11:27:19 +00:00
cegger
c0d1e7cb9e use aprint_*_dev and device_xname 2008-04-06 07:54:17 +00:00
jmcneill
4c1d81b2b5 Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
ad
a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
tsutsui
19daf5ad0b Cleanup handling of quikrs on each RealTek chip:
- replace rtk_type member in rtk_softc which has chip types
  with new rtk_quirk that represents quirks on each chip:
  - RTKQ_8129           doesn't have internal MII (used in rtk(4))
  - RTKQ_8139CPLUS      has different register layout (for re(4))
  - RTKQ_8169NONS       (original 8169) requires some settings on init
  - RTKQ_PCIE           requires different settings in setmulti
  so that we don't have to check each hwrev values or types everywhere
  and newer variants will also work without changes if they don't
  have other quirks
  (sc_rev is unchenged for now for reference to the Realtek's driver)
- don't check hwrev register in re_pci_match() but check
  only PCI_VENDER(), PCI_PRODUCT() and PCI_REVISION()
  so that we no longer have to map pci space there
- add a new HWREV value for another 8168 variant
- try to map PCI mem space more properly
- remove (probably unneeded) ifp->if_baudrate initialization

Tested on a newer 8168 variant by Dennis den Brok on tech-kern,
and also tested on 8139 and 8169C on macppc, and 8139C+ on landisk
by me.
2007-03-21 12:17:31 +00:00
tsutsui
9f13d14c8a Unwrap some lines (after __unused removal). 2006-11-18 16:03:53 +00:00
christos
168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
dogcow
6cb622186f Sync up with rtk 'common macro' changes. 2006-10-27 18:47:07 +00:00
xtraeme
9b97f910cf More -Wunused warnings. 2006-10-12 07:39:27 +00:00
dogcow
f2d329dca0 remove more vestiges of CCITT, LLC, HDLC, NS, and NSIP. 2006-09-07 02:40:31 +00:00
thorpej
0bb0418280 Use device_private(). 2006-03-29 06:22:38 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
perry
f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
kanaoka
1c4a548b54 - Use aprint_*.
- Use ANSI decls.
 - Change some cosmetic.
2005-01-15 12:32:09 +00:00
kanaoka
3126ccfe57 - Add my tested device in a comment.
- Change minimum value of latency timer from 0x20 to 0x40.
2005-01-13 14:13:18 +00:00
kanaoka
9c2bc06a94 - Use ether_ioctl().
- Remove unnecessary re_init() in re_attach().
 - Remove notyet compile option.
2004-12-26 07:27:41 +00:00
jonathan
9d44c4d9b1 Snapshot of incomplete-but-working split of re(4) driver into a
bus-independent backend, with PCI and CardBus attachment code.
The committed code has two serious bugs:

1. The driver makes no attempt to recover resources when a (Cardbus)
instance is removed; bus resources are leaked.

2. In testing with a NetGear GA-511, the Cardbus card never responded
   to a reset/wakeup if the card is powered down after attachment.
   So for now, leave cardbus instances powered up at attachment
   (insertion, or at boot if a card is already present).

That aside, it acutally works on my GA-511. Committed as-is despite
the bugs, after repeated requests to make the code available for
further testing.  Also requires sys/dev/mii/miidevs rev 1.54 -> 1.55,
and consequent regen of miidevs{,_data}.h.
2004-12-23 06:26:30 +00:00