Commit Graph

466 Commits

Author SHA1 Message Date
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