Commit Graph

544 Commits

Author SHA1 Message Date
uebayasi
8184d5dc03 Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants.  These are provided by sys/param.h now.
2010-11-13 13:51:57 +00:00
jakllsch
e6977ed4d1 No need to store map size locally now. 2010-07-27 21:05:04 +00:00
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
be53a6d9bb Collect garbage: sc_rbus_{iot,memt} are not used. 2010-06-04 19:27:12 +00:00
pgoyette
2d953f414b Revert earlier changes to callers of pci_find{vendor,product} since
the original routine entrypoint name has been restored.

Requested by dyoung@ and mrg@
2010-05-25 08:37:10 +00:00
pgoyette
b18bc9eab4 Update all callers of the pci_find{vendor,product} routines to now call
these routines through their global pointers.
2010-05-24 20:29:49 +00:00
kiyohara
694a1ba36a Not necessary '\n'. 2010-04-19 07:05:15 +00:00
dyoung
fe84f32506 Cosmetic: join a couple of lines. Stop storing the value of a BAR in a
temporary variable with the name 'csr'.
2010-04-01 05:58:52 +00:00
kiyohara
af09db112b Bye-bye fw_port.h. 2010-03-29 03:05:27 +00:00
nonaka
821373d09b Added sdhc at cardbus support. 2010-03-27 03:04:51 +00:00
dyoung
51ff4e6509 ex_softc.ex_bustype is written but never read. Just get rid of it. 2010-03-22 23:03:30 +00:00
dyoung
fa492e587b Detach at shutdown. 2010-03-22 17:23:44 +00:00
dyoung
d2f2daad71 Remove superfluous cast (device_t to device_t). 2010-03-19 01:44:05 +00:00
dyoung
f4de9422d8 Use Cardbus_intr_disestablish() instead of cardbus_intr_disestablish().
Get rid of a (short) staircase in ex_cardbus_detach().
2010-03-19 01:34:46 +00:00
dyoung
d75450ce8b 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:54:56 +00:00
dyoung
8b504d80a5 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:52:43 +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
47f456a03f Delete unused member ct_bar[] from struct cardbus_devfunc. 2010-03-15 19:50:50 +00:00
dyoung
3fa968935a Delete unused functions cardbus_save_bar() and cardbus_restore_bar(). 2010-03-15 19:48:31 +00:00
dyoung
bc155f4a0d Delete unused members ct_rbus_iot and ct_rbus_memt from struct
cardbus_devfunc.
2010-03-15 19:43:17 +00:00
dyoung
6240526075 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 ITOH Yasufumi.  Results: njs(4) works, njata(4) hangs.
njata(4) also hangs in 5.0.1 and in 5.99.24 prior to this patch, so
there is no regression.
2010-03-11 17:27:40 +00:00
dyoung
30882f2250 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 Juraj Hercek.
2010-03-11 17:24:27 +00:00
dyoung
4b936f667e 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 me.
2010-03-10 21:00:36 +00:00
dyoung
dc1ff0bc8e 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.
2010-03-10 00:21:10 +00:00
dyoung
6d8bb433d1 Remove dead code (it is commented out).
Delete the detach routine, it's obviously not finished.
2010-03-05 22:47:03 +00:00
dyoung
7a5d03568b Simplify this a bit (and reduce differences with if_rtw_pci.c): we
don't have to save the base address or write it to the BAR.
2010-03-05 00:54:01 +00:00
dyoung
ccf94312cd This is *always* compiled with #define rbus 1, so get rid of the
conditional compilation.

Make a few changes of this kind:

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

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

Tested by plugging a Syba CardBus to FireWire adapter into an HP
Pavilion N3270, adding an address (169.254.0.7/16) to fwip0, attaching
and pinging a MacBook Pro.
2010-03-05 00:36:06 +00:00
dyoung
7ff20f205b This is *always* compiled with #define rbus 1, so get rid of the
conditional compilation.
2010-03-04 22:42:22 +00:00
dyoung
6cff081e8d Get rid of the #if 1 surrounding #include <dev/cardbus/rbus.h>.
This is *always* compiled with #define rbus 1, so get rid of the
conditional compilation.

ath, atw, and rtw work fine after this change.
2010-03-04 22:37:38 +00:00
dyoung
9b2935788e This is *always* compiled with #define rbus 1, so get rid of the
conditional compilation.
2010-03-04 22:34:37 +00:00
dyoung
3f128f06a2 Remove unnecessary #ifdef INET-enclosed #includes.
This is *always* compiled with #define rbus 1, so get rid of the
conditional compilation.
2010-03-04 22:33:12 +00:00
dyoung
55ce676397 It turns out that ppb at cardbus was not even in ALL. It has probably
not been compiled in a very long time.  With some minor changes, it was
possible to make it compile:

Use kmem_zalloc()/kmem_free() instead of alloca()/memset().

Use %zu and %zx for printf'ing bus_size_t.

Delete the declaration of an unused local variable.
2010-03-04 18:49:14 +00:00
dyoung
5a5c46dece Delete unfinished and unreachable code: ppb_cardbus_setup(),
ppb_cardbus_enable(), ppb_cardbus_disable().
2010-03-04 18:31:57 +00:00
dyoung
bee77fae60 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 kiyohara@.
2010-03-04 16:40:54 +00:00
dyoung
eb66a866ff 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, ...);

Compiles.  Untested.  Let me know if you use this hardware with NetBSD
any longer.
2010-03-03 00:56:41 +00:00
dyoung
355cdbdce9 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 with ath & atw units on a Soekris net4521.
2010-03-02 20:31:14 +00:00
dyoung
edec44fc69 Cosmetic: re-wrap some line. 2010-02-26 01:16:09 +00:00
dyoung
53a8345822 Cosmetic: join a line. 2010-02-26 01:15:08 +00:00
dyoung
ad812b20b2 Introduce Cardbus_intr_establish(cardbus_devfunc_t, ...) and
Cardbus_intr_disestablish(cardbus_devfunc_t, ...) and start using them.
2010-02-26 01:12:56 +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
fb7f881ea9 Use PCI_ constants instead of CARDBUS_ constants. Use Cardbus_conf_*()
functions instead of cardbus_conf_*() functions to simplify some
code.
2010-02-25 23:01:48 +00:00
dyoung
96d11f3066 Copy values from the cardbus_attach_args and use them instead of values
from the cardbus_softc.
2010-02-25 22:40:16 +00:00
dyoung
ae121f118d Don't use the cardbus_softc. Compile-tested, only. 2010-02-25 22:31:51 +00:00
dyoung
74013c932b Phase out some CardBus constants and types. Use the equivalent PCI
constants and types, instead:

        CARDBUS_CLASS_REG -> PCI_CLASS_REG
        CARDBUS_ID_REG -> PCI_ID_REG
        cardbus_product_id_t -> pci_product_id_t
        cardbus_vendor_id_t -> pci_vendor_id_t
2010-02-25 21:18:35 +00:00
dyoung
878053a897 Don't create the device's PCI tag with Cardbus_make_tag(9), but save and
use the tag found in the cardbus_attach_args.  Compile-tested, only.
2010-02-25 20:36:31 +00:00
dyoung
4ce33933f8 Cardbus_free_tag() and cardbus_free_tag() are no-ops, so get rid of them
to simplify the code a bit.
2010-02-25 00:47:39 +00:00
dyoung
7c4be3328d 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.

Poison new uses of cardbusreg_t and cardbustag_t by deleting the type
definitions.
2010-02-24 23:38:40 +00:00
dyoung
c1b390d493 A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
2010-02-24 22:37:54 +00:00