Commit Graph

543 Commits

Author SHA1 Message Date
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
dyoung
347c1a2644 Use device_t and accessors.
In ohci_{pci,cardbus}_attach, do not get the device_t by casting
the softc to void *, but use `self' instead.
2008-03-07 21:48:46 +00:00
dyoung
2e3b67d337 Register the shutdown hook using pmf_device_register1(). 2008-03-07 21:36:51 +00:00
drochner
0e748e633e Extend the pmf suspend/resume hooks by a shutdown method, so drivers
can register a shutdown handler explicitely.
Install a pci bus shutdown handler which disables bus master accesses
for all childs, so the drivers don't need to care.
This will hopefully be sufficient to replace the shutdownhooks
(together with the powerhooks). (It has been suggested to use some
general event notification framework for shutdown handlers, but there
might be cases where shutdown handlers must be run in an order following
the device hierarchy, which wouldn't be easy with event handlers
not tied to drivers.)
approved by David Young
2008-02-28 14:25:12 +00:00
dyoung
2511aa0b7f Reduce diffs between cardbus_set_powerstate_int() and
pci_set_powerstate_int().
2008-02-23 00:30:56 +00:00
dyoung
520b45a1f0 Make the CardBus D2/D3 power-handling more alike to PCI's, but
without the typos. :-)

Use device_t and accessors.  Use aprint_*_dev().  Use PMF_FN_*.
2008-02-22 23:30:42 +00:00
dyoung
08a54ea3b3 Use device_xname(). 2008-02-18 06:17:27 +00:00
dyoung
efad92c959 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.
2008-02-06 22:11:54 +00:00
dyoung
5c1733cd95 Assert that 'offset' is divisible by four, since we're using it to
index a PCI configuration register.
2008-02-06 22:06:28 +00:00
dyoung
50b7998db1 After rtw_attach() is called, the hardware has been powered down,
so don't fiddle with the Function Event Registers.
2008-01-08 18:26:09 +00:00
dyoung
17b65ff15d Disable pci_disable_retry() and cardbus_disable_retry(), with a
long comment on pci_disable_retry() (cross-referenced at
cardbus_disable_retry()) that explains why.
2008-01-03 23:15:43 +00:00
dyoung
e9596bf19e Introduce a struct cardbus_chipset_tag, and make cardbus_chipset_tag_t
a pointer to that struct, so that we cannot assign pointers of
arbitrary type to cardbus_chipset_tag_t.  Tweak cbb(4) to accomodate
this change.

Make Cardbus_conf_read() and Carbus_conf_write() pass the right
arguments to cardbus_functions->cardbus_conf_{read,write}() for a
change.

Let's hope this stops the crash in cardbus_function_enable() that
macallan@ reported to me.
2008-01-02 23:11:34 +00:00
dyoung
4f422f7b22 Don't assign a cardbus function tag to a cardbus chipset tag.
Michael Lorenz, macallan@, actually found this bug.

(I will change cardbus_chipset_tag_t to a struct * from void *, so
that the compiler will detect similar typos in the future.)
2008-01-02 23:04:25 +00:00
dyoung
91345ba277 Do not read past the CIS region. Stops an MCHK exception on macppc
(reported by macallan@).

I originally detected this bug by activating 'PCI master target
abort' interrupts on the AMD Elan SC520 processor.  Lo and behold,
several interrupts occurred before the system had finished booting!
NetBSD should probably activate PCI exception reporting whenever
it is available.
2008-01-02 22:29:00 +00:00
dyoung
a142fc9c6b Add a debug message with aprint_debug_dev(). Use the right bus
tag.
2008-01-02 02:05:19 +00:00
dyoung
356cc80ff6 It makes practically no functional difference, but add curly braces
where they were intended.
2007-12-22 00:39:47 +00:00
dyoung
eafb0f479a Initialize and destroy the ATH_LOCK. 2007-12-21 18:26:13 +00:00
dyoung
1d18d8049c Do not embed a struct device in rtw_softc any longer. Register
both pci and cardbus attachments with CFATTACH_DECL_NEW().  Access
the softc through the device_t using device_private().

While I'm here, change a couple of KASSERT()s about the Rx buffer
length to a warning.
2007-12-21 18:22:43 +00:00
dyoung
cf784f4497 Improve pci, cbb, cardslot, cardbus, and pcmcia to support detachment
of this entire device tree:

pci0 at mainbus0
        elansc0 at pci0
                gpio0 at elansc0
        cbb0 at pci0
                cardslot0 at cbb0
                        cardbus0 at cardslot0
                        pcmcia0 at cardslot0
        cbb1 at pci0
                cardslot1 at cbb1
                        cardbus1 at cardslot1
                                rtw0 at cardbus1
                        pcmcia1 at cardslot1
        sip0 at pci0
                nsphyter0 at sip0
        sip1 at pci0
                nsphyter1 at sip1

Whew!
2007-12-16 21:28:30 +00:00
dyoung
058d9b982e Synchronize device detachment with network interrupts. Use the
pmf network class instead of powerhooks.
2007-12-16 00:04:07 +00:00
dyoung
c4245b0ab7 Oops, make last change compile. 2007-12-14 03:22:19 +00:00
dyoung
9a075a9c73 Comment-out calls to pci_disable_retry() and cardbus_disable_retry().
They do not seem well-justified according to anyone's understanding
of what they really do, and it seems especially inappropriate to
call them at attach- and resume-time.
2007-12-14 03:18:46 +00:00
jmcneill
94d68e1562 pmf_driver_register -> pmf_device_register 2007-12-09 23:58:40 +00:00
jmcneill
5430a31312 Register with power management framework. 2007-12-09 23:47:53 +00:00
jmcneill
4c1d81b2b5 Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
jmcneill
0791e7eb6c One of these aprint_normals should have been aprint_naive 2007-12-01 17:56:59 +00:00