Commit Graph

4846 Commits

Author SHA1 Message Date
uwe 3d9ebca642 Split device_t and softc. 2008-03-27 02:15:29 +00:00
tnn ebe7b38bb0 convert pcf8584 to device_t. 2008-03-26 19:14:24 +00:00
xtraeme 701c2ae0a3 Split device_t/softc for joy(4) and all its attachments. Also
use device_lookup_private() and related cosmetic changes.

Reviewed by cube@.
2008-03-26 18:27:07 +00:00
matt 595211a098 split device_t/softc. Use aprint_*_dev and device_xname.
switch to device_lookup_private.
2008-03-26 17:50:32 +00:00
xtraeme 8bea7f6b6e Split device_t/softc for ug(4) and other related cosmetic changes. 2008-03-26 16:09:37 +00:00
cube b1be269fbd Split device_t and softc for atapibus(4). 2008-03-24 14:44:26 +00:00
tsutsui a6bb23ea14 On preparing a setup packet, use proper byteswap ops and byte shift ops
rather than #ifdef BYTE_ORDER and subtle pointer casts.
2008-03-23 11:08:25 +00:00
tsutsui 7934941b93 Ignore the Report on MII error bit if chip doesn't have MII.
Fixes annoying "tlp0: MII error" messages on Qube 2700 with 21041.
2008-03-23 10:32:51 +00:00
xtraeme d749da9154 Split device_t/softc for ichlpcib(4) and all hpet consumers, plus
other related cosmetic changes.
2008-03-21 13:25:27 +00:00
dyoung 5c37160f8b Use aprint_*_dev(), and device_xname(). Constify a bit. 2008-03-21 08:17:30 +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
tsutsui 0e8643dfc7 It looks vlan tag info must appear not only in the first descriptor
but in all descriptors of a multi-descriptor transmission attempt on re(4).

Problem was reported and fix was confirmed by Chris Brookes on tech-net.
Should also close PR kern/37959.
2008-03-18 14:06:56 +00:00
xtraeme b2af3e5bc6 Merge some changes from OpenBSD:
RT2560+RT2661: update the physical address in the RX descriptor after
bus_dmamap_load() in the case where the same mbuf is reloaded.

modify interrupt handlers to exit early and return 0 on shared interrupts.

RT2661:
flags for register TXRX_CSR4 were shifted one bit too much on the left.
this has probably affected short preamble support as well as hardware
multi-rate retries settings.

fix handling of the SIOCS80211CHANNEL ioctl in monitor mode:
don't call xxx_set_chan() if the interface is not up&running.

Tested with the following hw:

ral0 at pci5 dev 0 function 0: Ralink Technologies RT2561 802.11b/g (rev. 0x00)
ral0: interrupting at ioapic0 pin 20 (irq 10)
ral0: 802.11 address 00:80:5a:4f:ab:e2
ral0: MAC/BBP RT2561C, RF RT2527
2008-03-17 17:22:49 +00:00
dyoung 1ac75f0733 Always deviter_release(). 2008-03-16 19:57:39 +00:00
cube 4dccf0ae94 Split device_t and softc for opl(4). That should have been done along with
midi(4), because opl_softc embed a midi_softc.
Fixes PR#38242 by Onno van der Linden.
2008-03-15 23:14:38 +00:00
cube a22d8d4abb Split device_t and softc for pckbc(4) and its attachments. 2008-03-15 13:23:24 +00:00
dyoung e86a2a1377 Cosmetic: make rtw_hw_keysupp() return a bool instead of int. In
rtw_wep_setkeys(), add a debug printf, and move the initialization
of keylen from the for-loop to the declaration.
2008-03-15 00:21:12 +00:00
dyoung 293fa13f60 Extract subroutine rtw_tx_kick() from rtw_start(), and reuse it in
rtw_io_enable() to restart the transmitter after resetting it.
2008-03-14 23:59:01 +00:00
dyoung 705696f034 In vga_is_console(), use deviter_first/_next() and device_t accessors.
Ok cube@.
2008-03-14 23:17:55 +00:00
dyoung 243c883b6e Change tests for "impossible" keys to KASSERT()s. Get rid of a
temporary variable.  In rtw_key_delete(), do not invalidate the
hardware keys unless a WEP key is deleted.
2008-03-14 23:04:42 +00:00
cube 4c9a9f3e5a Fix compilation under options RND_COM and COM_DEBUG.
Reported by Kurt Schreiner on current-users@.
2008-03-14 22:47:06 +00:00
cube d293cfca1a Split device_t and softc for all attachments of vga(4). 2008-03-14 22:12:08 +00:00
tsutsui f5506ae261 Enable ETHERCAP_VLAN_MTU. 2008-03-14 15:38:09 +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
tsutsui 12a7738525 Don't fetch DMA descriptor after BUS_DMASYNC_PREREAD op. 2008-03-14 13:42:01 +00:00
martin df9cb44ea9 Remove a tty_lock for now - I know that this is wrong, but the whole
tty subsystem locking is not consistent and Andrew didn't have
time to come up (or guide to) the right fix.
This prevents machines with serial console on zs(4) from deadlocking on
first input.
2008-03-14 08:23:51 +00:00
mhitch b6044f13b8 Initial bio(4) support; only volume status is handled. The driver doesn't
yet know about physical drives.  Derived from the OpenBSD ciss(4) bio(4)
support.
2008-03-14 03:30:19 +00:00
dyoung 0f6e74fc64 epic_stop: clear IFF_RUNNING before disabling. 2008-03-12 18:15:31 +00:00
dyoung 47d2258078 sonic_stop: clear IFF_RUNNING before disabling. 2008-03-12 18:13:15 +00:00
dyoung 332191ede5 sf_stop: clear IFF_RUNNING before disabling. 2008-03-12 18:09:56 +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 f71d8b8379 Cosmetic: use device_t and accessors. Change to ANSI-style
prototypes.  Delete some dead code.
2008-03-12 16:11:23 +00:00
dyoung 677859c28a Print the TPPoll register when the Tx DMA engine doesn't shut down
in the time we allow.
2008-03-12 15:47:49 +00:00
cube cf80f73d17 Split device_t and softc for the NE2000 Ethernet chip and all its variants
and attachments.  Use device_t accessors, correct types, and ANSIfy when
appropriate.
2008-03-12 14:31:11 +00:00
dyoung d347ff7717 Prepare for PMF self-suspension: in the if_stop() methods, clear
IFF_UP and IFF_RUNNING before running the 'disable' step, instead
of after.  Soon I will handle the 'disable' step by calling into
PMF, which may call if_stop(, 0).  Ordinarily, that is harmless.
This change lets the if_stop() routines exit early when they find
on entry that IFF_RUNNING is not set.
2008-03-11 23:58:06 +00:00
matt dfba816635 Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code.  Move to prototype definitions.  staticfy, constify, avoid casting.
Use device_* accessors.
2008-03-11 05:34:01 +00:00
mjacob 0e65dd74d1 Checkpoint of some fairly major isp(4) rototilling.
Reintroduce more of a 'channel' concept in preparation for NP-IV support.
This gets rid of the chanA/chanB concept as the 2400 can have up to 128
virtual channels. Actually, with MID firmware you can also have the 2200
and 2300 support 'channels, but they do it with an FL-Port topology.
Because FC cards can now have 'channels', just about every support
function for fibre channel had to be redone to have a channel index
as well.  Rototill isp_ioctl.h for channel stuff as well.

Pick up a lot of work about fabric management (hopefully better) and keep
work in place that will allow for dynamic attachment/detachment of devices
(if I can figure out how to make the midlayer support it).

Merge the target code with external trees. Eventually it might even
be sorted out on NetBSD.

Update some firmware stuff.
2008-03-11 05:33:30 +00:00
dholland d02e700e66 Use NE2000_TYPE_UNKNOWN instead of just 0 in a couple places. 2008-03-09 20:32:45 +00:00
jmcneill 0bedbeef3a Convert from shutdownhook/powerhook to PMF. 2008-03-09 19:25:56 +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
cube 8ecf8999bf Split the softc from the device_t for all lpt(4) variants and attachments
except the ppbus stuff (which doesn't compile) and ulpt(4) which is
unrelated and can be dealt with separately.

As usual, it comes with related cosmetic changes.
2008-03-07 17:15:51 +00:00
dyoung 5f9eecf7e3 In com_detach(), don't destroy the lock twice. 2008-03-07 10:08:53 +00:00
dyoung 8e8ca68019 Use device_t and its accessors. 2008-03-07 08:39:18 +00:00
xtraeme 3680f71913 Split device_t/softc in the lm(4) driver and its attachments, and
other related cosmetic changes.
2008-03-05 15:41:31 +00:00
cube 14218c181b Split device_t/softc for midi(4), and other related cosmetic changes. 2008-03-04 21:56:11 +00:00
cube 926915cf40 - Split device_t and softc for pcppi(4) and attimer(4)
- Change the attimer <-> pcppi communication using device_t so that
  pcppi(4) doesn't have to know about the contents of struct attimer_softc.

XXX pcppi's childdet function is completely wrong.  This has to be
XXX revisited later.
2008-03-04 16:35:18 +00:00
tsutsui 54de16529a Explicitly include <sys/device.h> for device_t. 2008-03-03 12:30:57 +00:00
dyoung e4f3892584 Use pmf_device_register1() instead of shutdownhook_establish() to
register com_cleanup() as the shutdown hook.

Add a generic suspend routine.  Suspend and resume com@isa.

Protect against dereferencing a NULL softc in comioctl().

Destroy both a mutex and a callout in com_detach().

Cosmetic: use aprint_*_dev().  Use PMF_FN_ARGS, PMF_FN_PROTO.
2008-02-29 07:02:04 +00:00
dyoung f580a3a869 Use PMF_FN_ARGS, PMF_FN_PROTO. 2008-02-29 06:13:39 +00:00
xtraeme 91a508cbf7 Apply some KNF to this driver and do some random changes as well:
- Change malloc + memset(blah, 0, ...)  to malloc with M_ZERO.
- The adapt_ioctl assigned was returning ENOTTY, so there's no point
  on having it.
- Static'ify.

I believe there are some paths on this driver where the splbio()s
are not needed, but can't test to verify...
2008-02-25 21:22:32 +00:00