Commit Graph

568 Commits

Author SHA1 Message Date
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
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
dyoung
d2fb16224c Remove unused functions pci_disable_retry() and cardbus_disable_retry(). 2010-02-23 19:28:00 +00:00
jakllsch
e1d2d1d9ed Sprinkle __KERNEL_RCSID() into siisata(4).
Slightly adjust some comment styling.
2010-01-30 16:16:35 +00:00
pooka
8052f8db95 Remove conditional inclusion of unused bpf.h 2010-01-18 18:52:35 +00:00
dyoung
3022acc4eb Expand PMF_FN_* macros. 2010-01-08 19:42:11 +00:00
snj
be360188fc Move to 2-clause license. Approved by HAYAKAWA Koichi (copyright holder). 2009-12-15 22:17:12 +00:00
dyoung
90c2b25e8f Don't use com_activate(), it's going away. 2009-11-12 20:30:10 +00:00
dyoung
310df30dc7 Remove superfluous activation hook. 2009-11-12 19:20:08 +00:00
rmind
f95af63371 Drop 3rd and 4th clauses from Ichiro FUKUHARA's license.
Reviewed and approved by ichiro@ (copyright holder).
2009-10-21 14:15:50 +00:00
rmind
993cb03302 Drop 3rd and 4th clauses from David Young's license.
Reviewed and approved by dyoung@ (copyright holder).
2009-10-19 23:19:37 +00:00
bouyer
6d07b400dc Remove closes 3 & 4 from my licence. Lots of thanks to Soren Jacobsen
for the booring work !
2009-10-19 18:41:07 +00:00
dyoung
36fffd8d02 In pmf(9), improve the implementation of device self-suspension
and make suspension by self, by drvctl(8), and by ACPI system sleep
play nice together.  Start solidifying some temporary API changes.

1. Extract a new header file, <sys/device_if.h>, from <sys/device.h> and
   #include it from <sys/pmf.h> instead of <sys/device.h> to break the
   circular dependency between <sys/device.h> and <sys/pmf.h>.

2. Introduce pmf_qual_t, an aggregate of qualifications on a PMF
   suspend/resume call.  Start to replace instances of PMF_FN_PROTO,
   PMF_FN_ARGS, et cetera, with a pmf_qual_t.

3. Introduce the notion of a "suspensor," an entity that holds a
   device in suspension.  More than one suspensor may hold a device
   at once.  A device stays suspended as long as at least one
   suspensor holds it.  A device resumes when the last suspensor
   releases it.

   Currently, the kernel defines three suspensors,

   3a the system-suspensor: for system suspension, initiated
      by 'sysctl -w machdep.sleep_state=3', by lid closure, by
      power-button press, et cetera,

   3b the drvctl-suspensor: for device suspension by /dev/drvctl
      ioctl, e.g., drvctl -S sip0.

   3c the system self-suspensor: for device drivers that suspend
      themselves and their children.  Several drivers for network
      interfaces put the network device to sleep while it is not
      administratively up, that is, after the kernel calls if_stop(,
      1).  The self-suspensor should not be used directly.  See
      the description of suspensor delegates, below.

   A suspensor can have one or more "delegates".  A suspensor can
   release devices that its delegates hold suspended.  Right now,
   only the system self-suspensor has delegates.  For each device
   that a self-suspending driver attaches, it creates the device's
   self-suspensor, a delegate of the system self-suspensor.

   Suspensors stop a system-wide suspend/resume cycle from waking
   devices that the operator put to sleep with drvctl before the cycle.
   They also help self-suspension to work more simply, safely, and in
   accord with expectations.

4. Add the notion of device activation level, devact_level_t,
   and a routine for checking the current activation level,
   device_activation().  Current activation levels are DEVACT_LEVEL_BUS,
   DEVACT_LEVEL_DRIVER, and DEVACT_LEVEL_CLASS, which respectively
   indicate that the device's bus is active, that the bus and device are
   active, and that the bus, device, and the functions of the device's
   class (network, audio) are active.

   Suspend/resume calls can be qualified with a devact_level_t.
   The power-management framework treats a devact_level_t that
   qualifies a device suspension as the device's current activation
   level; it only runs hooks to reduce the activation level from
   the presumed current level to the fully suspended state.  The
   framework treats a devact_level_t qualifying device resumption
   as the target activation level; it only runs hooks to raise the
   activation level to the target.

5. Use pmf_qual_t, devact_level_t, and self-suspensors in several
   drivers.

6. Temporarily add an unused power-management workqueue that I will
   remove or replace, soon.
2009-09-16 16:34:49 +00:00
tsutsui
edeaa5dd16 Invert logic around nested pmf(9) registrations for readability. 2009-09-05 14:44:59 +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
kiyohara
1f46950ef0 Support siisata@cardbus.
It tested on amd64 and i386 only.
2009-07-19 06:28:08 +00:00
dyoung
a0d0f249f9 Let us detach pcmcia0 and cardbus0 at cardslot0, and cardslot0 at
cardbus0.
2009-05-21 17:32:32 +00:00
tsutsui
d2452bef38 Make ahc_detach() take struct ahc_softc * as well as ahc_attach()
and remove bogus casts around ahc_detach().

XXX: There is a pmf_device_deregister(9) call in ahc_detach()
XXX: while there is no pmf_device_register(9) in ahc_attach().
XXX: It looks more pmf(9) stuff is required for cardbus detach.
2009-05-16 06:44:05 +00:00
cegger
529e91fca1 struct device * -> device_t, no functional changes intended. 2009-05-12 14:16:35 +00:00
cegger
32c4940900 struct cfdata * -> cfdata_t, no functional changes intended. 2009-05-12 12:10:29 +00:00
cegger
6a970ea21d device_t/softc split 2009-05-05 09:51:23 +00:00
cegger
c455042514 device_t/softc split. Tested with tlp at pci 2009-04-17 10:20:32 +00:00
dyoung
0d1ba3e899 During shutdown, detach devices in an orderly fashion.
Call the detach routine for every device in the device tree, starting
with the leaves and moving toward the root, expecting that each
(pseudo-)device driver will use the opportunity to gracefully commit
outstandings transactions to the underlying (pseudo-)device and to
relinquish control of the hardware to the system BIOS.

Detaching devices is not suitable for every shutdown: in an emergency,
or if the system state is inconsistent, we should resort to a fast,
simple shutdown that uses only the pmf(9) shutdown hooks and the
(deprecated) shutdownhooks.  For now, if the flag RB_NOSYNC is set in
boothowto, opt for the fast, simple shutdown.

Add a device flag, DVF_DETACH_SHUTDOWN, that indicates by its presence
that it is safe to detach a device during shutdown.  Introduce macros
CFATTACH_DECL3() and CFATTACH_DECL3_NEW() for creating autoconf
attachments with default device flags.  Add DVF_DETACH_SHUTDOWN
to configuration attachments for atabus(4), atw(4) at cardbus(4),
cardbus(4), cardslot(4), com(4) at isa(4), elanpar(4), elanpex(4),
elansc(4), gpio(4), npx(4) at isa(4), nsphyter(4), pci(4), pcib(4),
pcmcia(4), ppb(4), sip(4), wd(4), and wdc(4) at isa(4).

Add a device-detachment "reason" flag, DETACH_SHUTDOWN, that tells the
autoconf code and a device driver that the reason for detachment is
system shutdown.

Add a sysctl, kern.detachall, that tells the system to try to detach
every device at shutdown, regardless of any device's DVF_DETACH_SHUTDOWN
flag.  The default for kern.detachall is 0.  SET IT TO 1, PLEASE, TO
HELP TEST AND DEBUG DEVICE DETACHMENT AT SHUTDOWN.

This is a work in progress.  In future work, I aim to treat
pseudo-devices more thoroughly, and to gracefully tear down a stack of
(pseudo-)disk drivers and filesystems, including cgd(4), vnd(4), and
raid(4) instances at shutdown.

Also commit some changes that are not easily untangled from the rest:

(1) begin to simplify device_t locking: rename struct pmf_private to
device_lock, and incorporate device_lock into struct device.

(2) #include <sys/device.h> in sys/pmf.h in order to get some
definitions that it needs.  Stop unnecessarily #including <sys/device.h>
in sys/arch/x86/include/pic.h to keep the amd64, xen, and i386 releases
building.
2009-04-02 00:09:32 +00:00
cegger
c363a9cb62 bzero -> memset 2009-03-18 16:00:08 +00:00
cegger
f7d20361b0 ansify function definitions 2009-03-15 15:40:33 +00:00
dsl
82357f6d42 ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
2009-03-14 21:04:01 +00:00
dsl
454af1c0e8 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.)
2009-03-14 15:35:58 +00:00
tsutsui
cf97a4b35d Add TCPv4/UDPv4 RX hardware checksum support for i82559 and later chips
which don't have EXT_RFA and IPCB support. From hme(4) driver and
FreeBSD's fxp(4). Tested on i82559.

XXX: Probably we should have a common function to parse RX packet headers
XXX: to handle a raw checksum value and share it among hme(4) and gem(4) etc.
2009-03-07 15:03:25 +00:00
mrg
ce8a6e2599 - remove FXPF_IPCB flag. it should always/only be used with the code
conditional on FXPF_EXT_TXCB, so, replace all uses with that
- for the pci frontend, reestablish some flags lost the the prior
  changes and simplify one of the cases

this fixes PR 40677 and may fix PR 40431.
2009-02-20 05:49:34 +00:00
dyoung
aab95b778e Disable and acknowledge Function Events, and stop installing a
handler for them.

Don't override the latency timer set for us by the CardBus code.

Add a bit of debug code for the Function Event Registers, #if 0'd
out for now.

Cosmetic: remove gratuitous parenthesization of return statements.
Change the indentation of the struct atw_pci_softc definition.
Use a more meaningful variable name, et cetera.
2009-02-06 02:00:50 +00:00
dyoung
c11e37cd3d Disable and acknowledge Function Events, and stop installing a
handler for them.
2009-02-06 01:55:19 +00:00
mrg
71e27a6efb The PCI revision numbers are unique to a PCI vendor/product
ID pair.  Misuse of the revision numbers was causing some of the chip
features to be disabled on some integrated Intel chips.  So, move the
determination of the features into the bus frontend, where the
vendor/product ID is known.  (Note: sc_rev should be removed.  The
microcode patch stuff is also busted and needs to be fixed.)  Also,
poll the actual flow control status in inphy, rather than making
assumptions.

contributed anonymously.
2009-01-18 10:37:03 +00:00
alc
5d561f943e Sync ath(4) with the new HAL, mostly based on <jmcneill>'s patches.
Everything should be fine again !
2008-12-11 05:45:29 +00:00
dholland
ba8d06c990 Fix mangled attach output. Noted by Jari Kuittinen. 2008-10-12 02:15:02 +00:00
drochner
df0247d05d don't include i82365var.h, fixes build error, from Robert Swindells 2008-07-21 09:51:46 +00:00
dyoung
4f2602786e Don't write a register on the device until PCI I/O access has been
enabled on both the bus bridge and on the device.
2008-07-11 21:02:53 +00:00
dyoung
fa90a906d3 Don't write a memory-mapped register on the device until PCI memory
access has been enabled on both the bus bridge and on the device.
2008-07-11 20:57:51 +00:00
kiyohara
c8c9d3de59 Apply changes missed in "cardbus interrupt stuff cleanup" by drochner@:
http://mail-index.netbsd.org/source-changes/2008/06/24/msg207339.html
2008-07-11 17:50:45 +00:00
cegger
ff7f3a7e44 make this compile with DIAGNOSTIC 2008-07-10 05:11:10 +00:00
joerg
bcdf6fccac - device/softc split 2008-07-09 20:07:19 +00:00
joerg
52c17c8946 - device/softc split for ath(4) 2008-07-09 19:47:23 +00:00
joerg
2f3ebaa053 - device/softc split 2008-07-09 19:08:44 +00:00
joerg
0d1213e55a - device/softc split 2008-07-09 18:18:56 +00:00
joerg
85f9c6ce1a - device/softc split for fxp(4) 2008-07-09 17:07:28 +00:00
joerg
3d7462a945 Use device_private to access cardbus_softc. 2008-07-09 16:27:12 +00:00
drochner
53afd93cba minor cleanup so that it can cope with a futute split pcmcia device/softc 2008-07-03 18:57:52 +00:00
dogcow
78ff31a2cf fix type 2008-06-29 09:09:09 +00:00
drochner
cc29fcf8b9 constify the pcmcia/cardbus method tables 2008-06-26 12:33:17 +00:00
kiyohara
c7f7a60802 Fix split device_t/softc.
And reorder.
2008-06-26 03:32:17 +00:00
drochner
2b26f69613 Avoid the use of i82365var.h - we don't use any functions from there.
Extract some data structures for ressource management into our private
header instead. This allows to use a typed pointer instead of a
generic one which saves a lot of typecasts.
Also remove something marked as "dirty hack" which I admittedly don't
understand, but it doesn't look useful...
2008-06-25 15:29:23 +00:00
drochner
dbc8757839 split device/softc for pccbb, the cardbus half of cardslot and cardbus
(not yet pcmcia, there is a lot of md code involved)
2008-06-25 11:42:32 +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
drochner
52b8fec3cf clean up some useless code and variables in cardbus attachment 2008-06-24 17:32:09 +00:00
dyoung
ac6193d02f *Always* update the desired power status of each CardBus function,
even if we cannot remove power from the function because its device
property 'pmf-powerdown' is present and equal to false.

Because we were not tracking the power status properly before, we
were not taking cards out of reset after a suspend/resume cycle on
their CardBus bridge.  We would lose the use of the card that way.
2008-06-11 07:01:54 +00:00
dyoung
3514b9346c Use device_t. 2008-06-11 06:28:18 +00:00
dyoung
f100644906 Remove code that is redundant with cardbus_child_resume(), which
restores PCI configuration space and restores the power state to
D0.
2008-06-11 05:33:44 +00:00
jmcneill
9709f2afe2 Add support for PCI_BUS_FIXUP and PCI_ADDR_FIXUP on amd64. 2008-05-18 02:06:14 +00:00
dyoung
c288de686c Match printf argument type (uintmax_t) to format string (PRIuMAX). 2008-05-14 19:24:48 +00:00
ad
1498ad220e Make various bits of debug code compile again. 2008-04-30 14:07:13 +00:00
scw
1de1c389bf Pull in some more changes from OpenBSD:
- replace rssadapt(9) with amrr for automatic rate control.
- don't blindly IFQ_DEQUEUE() then drop a Tx packet if there are no
  available Tx resources.
- move default MAC/BBP/RF settings from rt2661.c to rt2661reg.h.
- enable packet bursting when operating as a STA.
- implement new ic_updateslot() callback.
- in hostap mode, we defer update of the slot time until all associated
  STAs are notified with updated beacons.
- 802.11a uses a 16 microseconds short interframe space.
- Fix rt2661_set_macaddr() so that we don't override the "unicast to me"
  flag in RT2661_MAC_CSR3 when setting the MAC address.
- fix index of ERP information element in beacons.

Add a couple of tweaks of my own:

- The RX/TX BUSY flag should be the last thing written to a descriptor.
- Check and service any additional h/w interrupts before returning
  from the isr.

Tested in STA, AP, and Monitor modes. Tested with WEP, WPA, and WPA2 crypto.

Additional testing by xtraeme@
2008-04-29 22:21:45 +00:00
martin
3028e483e4 Convert to new 2 clause license 2008-04-29 06:53:00 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
tsutsui
82cc885228 Split device_t/softc for re(4) and rtk(4). 2008-04-25 11:27:19 +00:00
cegger
1b5ffa90ad - ansify
- use POSIX integers
2008-04-14 21:20:41 +00:00
spz
123ed98aff pretty up if_ex: pmf'ify, device split, and improve printing a bit too.
Reviewed and function-tested on if_ex_cardbus by cube (thanks).
Function-tested on if_ex_pci by myself.
2008-04-14 20:03:13 +00:00
skd
d51db07a71 Fix small error in device/sc splitup. 2008-04-09 11:32:26 +00:00
cegger
c0d1e7cb9e use aprint_*_dev and device_xname 2008-04-06 07:54:17 +00:00
kiyohara
1368789634 Sorry forgot.
Split device_t/softc, and cosmetic change.
2008-03-29 17:50:36 +00:00
ad
bd1204e3c8 Make it compile again. 2008-03-29 16:36:14 +00:00
drochner
fd0ded75ed split device/softc for USB host controllers and the usb (control)
device,
this is hairy stuff, and I've only tested with uhci/ehci at pci,
please test the rest and report problems
2008-03-28 17:14:45 +00:00
cube
7aa6248cdf Split device_t and softc for ATA devices, as well as wd(4). Other
cosmetic changes where appropriate.
2008-03-18 20:46:35 +00:00
cube
607ead0ef4 Split device_t and softc for all com(4) devices (well, everything that
uses a com_softc backend).  Use proper types and ansify where appropriate.
2008-03-14 15:09:09 +00:00
dyoung
3df2b2feb5 Use device_t and its accessors throughout. Use aprint_*_dev().
Improve PMF-ability.

        Add a 'flags' argument to suspend/resume handlers and
        callers such as pmf_system_suspend().

        Define a flag, PMF_F_SELF, which indicates to PMF that a
        device is suspending/resuming itself.  Add helper routines,
        pmf_device_suspend_self(dev) and pmf_device_resume_self(dev),
        that call pmf_device_suspend(dev, PMF_F_SELF) and
        pmf_device_resume(dev, PMF_F_SELF), respectively.  Use
        PMF_F_SELF to suspend/resume self in ath(4), audio(4),
        rtw(4), and sip(4).

        In ath(4) and in rtw(4), replace the icky sc_enable/sc_disable
        callbacks, provided by the bus front-end, with
        self-suspension/resumption.  Also, clean up the bus
        front-ends.  Make sure that the interrupt handler is
        disestablished during suspension.  Get rid of driver-private
        flags (e.g., RTW_F_ENABLED, ath_softc->sc_invalid); use
        device_is_active()/device_has_power() calls, instead.

        In the network-class suspend handler, call if_stop(, 0)
        instead of if_stop(, 1), because the latter is superfluous
        (bus- and driver-suspension hooks will 'disable' the NIC),
        and it may cause recursion.

        In the network-class resume handler, prevent infinite
        recursion through if_init() by getting out early if we are
        self-suspending (PMF_F_SELF).

rtw(4) improvements:

        Destroy rtw(4) callouts when we detach it.  Make rtw at
        pci detachable.  Print some more information with the "rx
        frame too long" warning.

Remove activate() methods:

        Get rid of rtw_activate() and ath_activate().  The device
        activate() methods are not good for much these days.

Make ath at cardbus resume with crypto functions intact:

        Introduce a boolean device property, "pmf-powerdown".  If
        pmf-powerdown is present and false, it indicates that a
        bus back-end should not remove power from a device.

        Honor this property in cardbus_child_suspend().

        Set this property to 'false' in ath_attach(), since removing
        power from an ath at cardbus seems to lobotomize the WPA
        crypto engine.  XXX Should the pmf-powerdown property
        propagate toward the root of the device tree?

Miscellaneous ath(4) changes:

        Warn if ath(4) tries to write crypto keys to suspended
        hardware.

        Reduce differences between FreeBSD and NetBSD in ath(4)
        multicast filter setup.

        Make ath_printrxbuf() print an rx descriptor's status &
        key index, to help debug crypto errors.

        Shorten a staircase in ath_ioctl().  Don't check for
        ieee80211_ioctl() return code ERESTART, it never happens.
2008-03-12 18:02:21 +00:00
dyoung
9a0e417e90 Use device_t and accessors. Setup power management in the PCI
front-end (XXX needs to look more alike the Cardbus front-end).
Establish the shutdown hook using PMF.
2008-03-07 22:32:52 +00:00
dyoung
5d30fe1a78 Use device_t and accessors. Use PMF instead of legacy power
management.  Establish the shutdown hook using PMF.
2008-03-07 22:04:00 +00:00
dyoung
81f7f6b3f2 Use device_t and its accessors. In uhci_{pci,cardbus}_attach, use
`self' instead of casting the softc to void *.
2008-03-07 21:57:56 +00:00