Commit Graph

5973 Commits

Author SHA1 Message Date
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 d293cfca1a Split device_t and softc for all attachments of vga(4). 2008-03-14 22:12:08 +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
taca 3a86ada98a Reflect change of PMF_FN_ARGS. 2008-03-13 16:29:48 +00:00
dyoung edb53ad207 Use device_t and accessors. 2008-03-12 18:26:58 +00:00
phx f04ba7d138 Make console drivers support PCI_IOC_CFGREAD/WRITE ioctls. This is useful for
XFree86, which can alternatively find the graphics card through /dev/ttyE0.
Approved by macallan.
2008-03-12 18:11:38 +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
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
dyoung 7f0a735df6 Use device_t and accessors. 2008-03-11 22:26:14 +00:00
dyoung 78a6c4d71a pci_disable_retry() is now a no-op, so don't call it any more. 2008-03-11 20:55:32 +00:00
dyoung db4f43a7cd pci_disable_retry() is now a no-op, so don't call it any more. 2008-03-11 20:45:04 +00:00
dyoung 0dddb5735e Finish the job: pci_disable_retry() is now a no-op, so don't call
it any more.
2008-03-11 20:41:35 +00:00
dyoung 5f07fde2c9 pci_disable_retry() is now a no-op, so don't call it any more. 2008-03-11 20:40:51 +00:00
dyoung e33cbf5cfc pci_disable_retry() is now a no-op, so don't call it any more. 2008-03-11 20:39:24 +00:00
joerg a7e72b4b2f Avoid unaligned pci_conf_read. 2008-03-11 13:36:14 +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
sketch 5c1ec14909 Fix console output. 2008-03-10 21:18:08 +00:00
phx 7bca1efe39 Do not attach genfb when the frame buffer is not flagged as being console
(e.g. when a serial console is used).
Approved by macallan.
2008-03-09 20:32:30 +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 365ad33516 In ath_pci_detach(), only disestablish the interrupt handler if it
is established.
2008-03-07 22:17:03 +00:00
dyoung dd9279e27b Use device_t and accessors. 2008-03-07 22:05:47 +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
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
xtraeme e75fa1bd1d Split device_t/softc and other related cosmetic changes. 2008-03-05 15:42:07 +00:00
xtraeme 3294fa721e Split device_t/softc, and other related cosmetic changes. 2008-03-05 15:03:36 +00:00
dyoung 11e3712cc6 Check device_has_power() instead of device_is_active() in pccbbintr(),
since the driver must acknowledge some interrupts while it leaves
the suspended state.  This protects against an interrupt storm that
will hang the system while I resume rtw0 at cardbus1.
2008-03-04 22:15:16 +00:00
cube 7cad7e5ad3 Split device_t/softc, and other related cosmetic changes. 2008-03-04 22:12:55 +00:00
drochner 1f41b0e499 -map 64-bit PCI BARs
-integrate some bits from upstream to support i965
from Yorick Hardy per PM
2008-03-04 11:52:38 +00:00
xtraeme 0dd978c139 Detect and initialize correctly RAID 1+0 levels. 2008-03-03 14:57:22 +00:00
xtraeme a9191491be RAID 1/1+0 volumes may only be created with foreground initialization,
use the quick_init member in the ARC_FW_CREATE_VOLUME command code.

You can now create RAID 1/1+0 volumes through bioctl(8), but only one
volume will be initialized; the other ones that need initialization will
wait until the first is done.
2008-03-01 16:33:29 +00:00
rmind c6186face4 Welcome to 4.99.55:
- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call.  It will
  indicate which event (POLL_IN, POLL_OUT, etc) happen.  If unknown,
  zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
2008-03-01 14:16:49 +00:00
xtraeme d66a6e73bb arc_create_sensors: if there are no valid volumes (all passthru volumes),
just exit from the kthread.
2008-03-01 13:56:46 +00:00
xtraeme e0b2280d73 arc_bio_inq: ask the firmware only once for the ARC_FW_SYSINFO
command code and use the softc values on the next bio requests.
2008-02-29 18:15:41 +00:00
xtraeme 5b41531f32 If a disk has been disconnected in a volume set, mark it as offline
and put it on another bus and print "disk missing"... the OpenBSD driver
does that but I forgot to re-add it.

Also save some values provided by the firmware in the softc and use them
in the bio(4) ioctls, this speeds up considerably bioctl(8) and avoids
so many firmware commands every time we want the current status.
2008-02-29 17:45:04 +00:00
xtraeme c0ed3b3e87 arc_refresh_sensors: show rebuilding status. 2008-02-29 12:56:03 +00:00
xtraeme 3e450e962a arc_bio_disk_novol: don't forget to free diskinfo if arc_msgbuf
returns an error.
2008-02-29 12:37:43 +00:00
dyoung f580a3a869 Use PMF_FN_ARGS, PMF_FN_PROTO. 2008-02-29 06:13:39 +00:00
xtraeme 9ec5a8145c If pmf_device_register1() fails for some reason, make it panic(9)
rather than printing an error. The shutdown handler is mandatory on
this driver to flush controller's cache or stopping background
rebuilds.
2008-02-28 21:08:45 +00:00
xtraeme 43b696d498 Register a sensor per disk connected to a valid volume, so that we
can get more details if state on a disk or volume has changed,
previously only state about the volume was available.

You'll see something like this with envstat(8) now:

$ envstat -darcmsr0
RAID 5 volume0 (sd0):   building
 disk0 volume0 (sd0):     online
 disk1 volume0 (sd0):     online
 disk2 volume0 (sd0):     online
 disk3 volume0 (sd0):     online
$

Convert the driver to use pmf(9) and register a shutdown power handler
via pmf_device_register1() that was added recently.

Misc cosmetics tweaks while I'm here.
2008-02-28 16:47:53 +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
macallan d15719537b switch to PCI_MAGIC_IO_RANGE 2008-02-28 00:21:38 +00:00
macallan ee03e6b4fb get rid of the last #ifdef macppc and use PCI_MAGIC_IO_RANGE to select
at which offset we mmap PCI IO space
2008-02-27 23:59:37 +00:00
drochner ee2a294e04 Register a NULL pmf handler, so that the system can suspend.
This is OK because wscons detaches the X server before devices are
suspended, and the X server closes the drm device on detach.
(We could install a suspend handler which just double-checks, but
atm its return value is ignored anyway.)
2008-02-27 18:01:49 +00:00
drochner d1cb76fad4 -Now that the address space conflict is solved, we can re-enable that old
workaround for some VESA BIOS which overwrites PGTBL_CTL. Pointed out
 by Yorick Hardy.
-make two variables introduced in the last commit static
2008-02-26 20:44:15 +00:00
xtraeme 22e6b6b586 Make it follow the standard convention of autoconf printing:
mfi0 at pci0 ...
mfi0: interrupting at ...

and only print the model string if it was matched.

Add the Dell PERC 5/i integraded subproduct ID.
2008-02-26 18:16:51 +00:00
xtraeme 54880c4f00 Added support for the mfi(4) controllers with powerpc IOPs such as
LSI SAS1078 or Dell PERC 6, from OpenBSD.

Tested by Akira Kato on current-users@.
2008-02-25 10:46:02 +00:00
xtraeme 0554960b0b Do not attach on Symbios SAS1078, doesn't work and it will be matched
soon by the mfi(4) driver.
2008-02-25 10:38:39 +00:00