Commit Graph

5383 Commits

Author SHA1 Message Date
jakllsch e1d2d1d9ed Sprinkle __KERNEL_RCSID() into siisata(4).
Slightly adjust some comment styling.
2010-01-30 16:16:35 +00:00
pooka 10fe49d72c Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client.  This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached.  However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff.  ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
2010-01-19 22:06:18 +00:00
bouyer 3ccd2d9884 bio(4) is MP-safe but mfi(4) is not. So get the kernel_lock at
mfi_ioctl() entry and release it on exit.
2010-01-19 20:54:32 +00:00
pooka b99665a360 Nuke "ummmm" quality macro. It's outside __NetBSD__, so not
functional change, but some C parsers that don't know which cpp
macros are defined fall and hurt themselves quite badly with it.
2010-01-18 01:51:25 +00:00
pooka 64da563d90 Forward declare struct bpf_if and use that as the type for bpf_if
instead of "void *".  Buys us oo times the type-safety for 0 times
the price.
(no functional change)
2010-01-17 19:45:06 +00:00
mjacob 1f74793503 Amazingly, we've been freeing a handle and then using that which it referred
to for years. Bad.
2010-01-15 20:09:09 +00:00
macallan 089ff6369d set a delta value on the master channel and move it to the outputs class so
volume control via PMF works
2010-01-14 02:21:19 +00:00
jdc 33bc15eeb5 Mask out (disable) gem interrupts on detach. 2010-01-11 09:30:41 +00:00
mjacob 4176aa90c1 Keep track of what appear to be live Fibre Channel disks and store up the
Port WWNs for them as well as attaching them as a "port-wwn" property to
the device node in question. This allows MD code to find the boot device
on some platforms.

This is less clean than it should be. A better solution would be to make
some changes to the scsi infrastructure so that periphs can query and
use and store their own "native" transport addresses. However, that's
a much more invasive change and it is not clear how many ports or devices
really want or need that information (yet).
2010-01-11 01:33:22 +00:00
snj a0cb18657b Add a missing closing parenthesis in a few places. From Henning Petersen
in PR kern/42527.
2010-01-10 07:06:12 +00:00
tsutsui 59882a6e03 To print bus_addr_t value, cast it to u_long rather than size_t. 2010-01-09 14:15:48 +00:00
dyoung cd6e1fbf91 Expand PMF_FN_* macros. 2010-01-08 19:53:10 +00:00
mbalmer 982581e04d Remove extra semicolons. 2010-01-05 13:30:10 +00:00
mjacob bdfad64a07 Add some more definitions appropriate for T10 standards
and use those cleaned up definitions.

Use 2100 style firmware loading if the load address and
load size is less than 64k. Some apparently buggy ROMs
out there choke otherwise.

Clean up some WWNN derivations from WWPN.
2010-01-03 02:47:09 +00:00
christos 321813557d nothing uses ne2000_power anymore. 2010-01-02 19:27:41 +00:00
elad d52b481791 Change a comment. INSECURE has but one purpose. 2009-12-24 19:16:28 +00:00
kiyohara 414776980d Set filter at lan9118_init() and lan9118_ioctl with SIOCSIFFLAGS. 2009-12-20 10:57:35 +00:00
tsutsui 698e481cab Switch to using todr_[gs]ettime_ymdhms() format
which don't require struct timeval details.
Also fix a botch calling MI todr_settime(9) without rtc_offset adjustment.
2009-12-12 16:12:05 +00:00
tsutsui 471e528b58 Remove `volatile' qualifier from argument types of
struct timeval passed to todr_gettime(9) and todr_settime(9).
We no longer have an ancient and volatile struct timeval `time'
global since we have switched to MI timercounter(9) on all port.

XXX1: some of these RTC drivers still assume 32bit time_t
XXX2: some of these should be rewritten to use todr_[gs]ettime_ymdhms()
XXX3: todr(9) man page doesn't mention todr_[gs]ettime_ymdhms()
2009-12-12 14:44:08 +00:00
tsutsui 0b5468d9dc Don't refer garbage in stack.
- An argument of struct timeval *tv passed by todr_gettime(9) is used
  for a return value and it doesn't contain valid data. Don't read it.
- Instead, use getmicrotime(9) to get a "reasonable" (i.e. current) time
  to see expected year value (which is not kept by this device).
- If current time is not valid, assume this is the first todr_gettime(9)
  call from inittodr(9) and use file system time for the "reasonable" year.

Fixes silent hangup after mountroot() on sun2.

XXX: MI todr(9) functions seem to get mangled around year ~22000.
2009-12-11 11:07:04 +00:00
dyoung a14d2f3527 Simplify device-activation hooks. 2009-12-06 23:17:09 +00:00
dyoung e98edc8502 Delete dead code. 2009-12-06 23:15:59 +00:00
dyoung be75895d2f Simplify device-activation hook. 2009-12-06 23:14:39 +00:00
kiyohara 19077e5352 Split internal phy. We can use ukphy(4).
SMSC manufactures some PHY.  This PHY is built into LAN9x18 Family.
2009-12-06 12:22:17 +00:00
jdc 4d33475520 Really prefer the external over the internal PHY by checking only that
PHY address first.  Avoid problem with bogus ukphy's attaching on the
internal PHY of the SB1000.

Also, take some quirks for internal, external or either MII PHY from
the OpenBSD driver.
2009-12-05 16:43:25 +00:00
dyoung a03e1f359b Oops, there was one mii_activate() call left. Delete it. 2009-12-04 22:45:28 +00:00
martin 63d5a98148 Properly detach phys 2009-12-04 22:13:26 +00:00
jdc 2e4745d49b Only set 0x4FF in the transmit register for gigabit variants. Set 0x100
otherwise.
2009-12-04 13:35:56 +00:00
martin 4052083605 Fix a few nits in gem_detach:
Shuffle some bus_dmamem_ operations around, so they actually clean up
in the correct order.
Do not destroy a callout that might be stopped by if_detach later.
When detaching child devices fails, we have passed the point of no return
already, so complete our own cleanup and return the error in the end.
This happens for example when we have been unable to accomodate all phy
devices at attach time (and this is a separate bug).
2009-12-04 11:55:01 +00:00
mjacob 293ca32376 Have as a backup at least *some* usable WWN. 2009-12-03 14:51:48 +00:00
kiyohara 7fe24103db Maybe supported LAN9218 Family. 2009-12-02 12:51:50 +00:00
skrll 17b0854823 Spell busy correctly. 2009-12-01 23:16:00 +00:00
dyoung 8a18e16048 Delete wdcactivate() prototype, it's gone away for good. 2009-12-01 01:06:31 +00:00
dyoung 85acc87516 Simplify the device activation routine. 2009-12-01 01:05:23 +00:00
kiyohara 7e526c7d4b Fix "+ 0x100" instead of "| 0x100" in the case ID 0x11[5678]A. 2009-11-29 10:17:01 +00:00
kiyohara 5a4eb24b7c Change print messages.
1. Use aprint instead of DPRINTF in swap mode.
  2. Locates and vendor/LSI names 1-line print.
  3. Also print (and maybe support) LAN92xx.
2009-11-29 10:06:19 +00:00
kiyohara 171390a416 Set mii_media_active in lan9118_ifm_change(). This is like ukphy_status().
Also LAN9118_TXS_NC is valid when if FDX.
2009-11-29 09:34:20 +00:00
kiyohara 1f5a3ad189 Fix register access to MII in lan9118_mii_readreg()/lan9118_mii_writereg(). 2009-11-29 05:07:49 +00:00
kiyohara 96ade3c067 Comment out interrupt for LAN9118_INT_PHY_INT and LAN9118_INT_PME_INT. These
not support yet...
2009-11-28 13:20:41 +00:00
kiyohara ee2bb9f5be Check mbuf size and buffers. 2009-11-28 12:16:57 +00:00
kiyohara 8d9bae96a9 Support mii_tick().
Thanks tsubai@.
2009-11-28 08:44:00 +00:00
rmind 9303fb5a00 Remove IPL_LPT and IPL_IPI aliases, use the actual IPLs.
Fix some broken comments.
2009-11-25 14:28:49 +00:00
kiyohara d3d39bd6e8 - Wait the ready 5sec, not 5msec.
- Set IFM_ACTIVE to ifm_status instead of ifm_active.  ifconfig(8) always said
  'no carrier'...
2009-11-23 09:41:53 +00:00
rmind dbd9b86792 Remove some unecessary includes sys/user.h header. 2009-11-23 02:13:44 +00:00
jakllsch 84f4ce4699 Change bus_space_subregion() size for each SATA PHY register from 1 to 4,
as we do a bus_space_read_4() within these subregions.
2009-11-21 23:47:01 +00:00
macallan 910612113d Make colour depths higher than 8bit work in X.
Now igsfb will switch to 16 or 32 bit colour when entering graphics mode,
depending on available video memory and the given mode.
While there re-initialize the colour map etc. when leaving graphics mode.
2009-11-18 21:59:38 +00:00
macallan 1049d3d651 Write something more sane into the pixel format register - it's not pixel size
in bytes although that works in 8 and 16 bit colour depth.
While there do some magic number reduction.
2009-11-18 06:10:50 +00:00
dyoung 021235e4a6 Remove some dead code. 2009-11-12 20:38:35 +00:00
dyoung 05a97b4287 Delete definition of com_activate(), it's been removed. 2009-11-12 20:37:44 +00:00
dyoung b2f2de753f Move the code in com_activate() to com_detach(), where it always
belonged.  Remove com_activate().

Consolidate information about the console on com(4) in a new struct
comcons_info.

Support detachment & re-attachment of a system console on com(4).
Re-attachment is somehow incomplete.  Ideally, if some other device
could take over as console, it would, but we're not quite there,
yet.
2009-11-12 20:37:09 +00:00
dyoung 8e38167faa Remove definition of spc_activate(), it has gone away. 2009-11-12 20:15:02 +00:00
dyoung 2957bfb586 Remove superfluous activation hook.
Add a child-detachment hook.
2009-11-12 20:14:04 +00:00
dyoung 04b4cf9e54 Remove superfluous activation hook. 2009-11-12 19:37:17 +00:00
dyoung d061cb2faa Simplify activation hook. 2009-11-12 19:35:59 +00:00
dyoung 3e567daf68 Simplify activation hook. Replace each use of sc_invalid by either
calling config_deactivate(9) or device_is_active(9).
2009-11-12 19:32:14 +00:00
dyoung a6c5930eb6 Simplify activation hook. 2009-11-12 19:30:49 +00:00
dyoung 91901a7869 Simplify activation hook. Replace each use of sc_invalid by either
calling config_deactivate(9) or device_is_active(9).
2009-11-12 19:28:59 +00:00
dyoung e33ae76976 Remove superfluous activation hook. 2009-11-12 19:25:08 +00:00
macallan d0b2c36849 add modeseting support. Now if there's a mode string in igsfb_devconfig the
driver will try to use it if at all possible, otherwise fall back to the old
hardcoded 1024x768x60 mode.
2009-11-11 17:01:17 +00:00
macallan 293ac096d1 add support for an optional machine-dependent mmap() method, so the bus
backend can do whatever voodoo necessary to the aperture, IO space etc.
Mainly for shark, to get around the weird ARM bus_space.
2009-11-10 22:23:22 +00:00
jakllsch 9ae52821d4 Use hme_init() to provide a non-NULL ifp->if_init. 2009-11-03 22:06:30 +00:00
rmind 40cf6f3659 Remove uarea swap-out functionality:
- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code.  Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.
2009-10-21 21:11:57 +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
sborrill 88bbf990c2 Commit patch from PR#41926. Confirmed to work by PR submitter on two
controllers as well myself and another on viaide.

Stops errors such as the following when probing SATA drives through
controllers that offer the legacy pciide interface:
viaide1 channel 0: reset failed for drive 0

OK bouyer@
2009-10-06 13:45:01 +00:00
jmcneill 6c62f91733 Initial import of an SD/MMC driver for the Winbond W83L518D (and probably
W83L519D) Integrated Media Reader with PNP bus attachment glue.
2009-09-30 20:44:49 +00:00
njoly 33042a7b04 Be robust against an invalid timer period value. 2009-09-30 15:22:11 +00:00
jakllsch bd5cb77445 gpio(4) support for Intel ICH southbridges.
Tested on Intel SS4200-E (ICH7), and Acorp 6A815EPD (ICH2) motherboards,
on amd64 and i386 ports respectively.

It should be noted that the majority of boards with ICH chips do not
expose the GPIO pins for off-board use.  For instance, aside from the
three exposed-on-a-header pins on the 6A815EPD, another pin is also
used to control write protect on the FWH.  The SS4200 exposes the GPIO
on a header that connects to the 10 LEDs on the front panel, as well
as a tact switch on the back panel.
2009-09-27 17:55:31 +00:00
tsutsui 0719ca07be Replace shutdownhook_establish(9) with pmf_device_register1(9).
Compile test only.
2009-09-27 10:00:11 +00:00
tsutsui a6b618f221 Split device_t/softc. Tested on aic7901A. 2009-09-26 14:44:10 +00:00
tsutsui df90eec26b Make local functions static. 2009-09-22 16:44:08 +00:00
tsutsui 6b3b6e9a98 Fix possible endian issue. Untested. 2009-09-22 15:25:12 +00:00
tsutsui 3b0a685f2b Split device_t/softc. Tested only on cs at ofisa on shark. 2009-09-22 14:55:19 +00:00
tsutsui 36b4b2e6c0 - replace shutdownhook_establish(9) with pmf_device_register1(9)
- remove powerhook_establish(9) because all stuff in cs_power()
  will be handled in pmf_class_network

Briefly tested on CS8900 at ofisa on DNARD compatible.
2009-09-22 13:31:26 +00:00
tsutsui 606e573f63 - wrap long lines
- remove unnecessary casts against void pointers
2009-09-22 13:26:54 +00:00
tsutsui d7f21e6129 Don't declare ISA specific aic_isa_attach() in MI header, and
also make local functions in aic_isa.c static.
2009-09-22 13:18:28 +00:00
tsutsui 00eb8aa546 Split device_t/softc. Tested on AHA-1520B at ISA and ISAPnP.
XXX: ISA attachment shouldn't match cards in ISAPnP mode.
2009-09-22 12:56:06 +00:00
jakllsch 81f8a1dcf0 Add more-complete definitions of ICH GPIO-related registers.
While here, fix a typo in a register number.
2009-09-21 16:18:31 +00:00
tsutsui c8a52f80ba Split device_t/softc. Tested on AHA-1542CF. 2009-09-21 08:12:47 +00:00
tsutsui 13855cad09 Use common ether_crc32_le() for multicast hash. 2009-09-19 04:55:45 +00:00
tsutsui eb06ddcd95 hme_reset() is no longer called from bus attachments so make it static. 2009-09-18 12:40:15 +00:00
tsutsui 5dcfc285a0 Misc KNF and cosmetics, and remove unnecessary casts etc. 2009-09-17 18:14:41 +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
dyoung ba1e593dc7 Simplify activation routines. Don't block interrupts, if_deactivate()
does it.  Compile-tested, only.
2009-09-15 20:51:12 +00:00
dyoung fe01097755 Simplify activation routines: do not call mii_activate(), it is a
no-op.  Do not block interrupts, if_deactivate() will take care of
that for us.
2009-09-15 19:29:17 +00:00
dyoung b8695aecbf Simplify activation routines: don't call mii_activate(), it's a
no-op.  Don't block interrupts, if_deactivate() does it.
Compile-tested, only.
2009-09-15 19:20:29 +00:00
dyoung 662dfba47d To ease a future device_t/softc split, se device_private() instead
of casting device_t to softc.
2009-09-15 18:37:02 +00:00
dyoung 7cd3e7cb51 unifdef -D__NetBSD__ -U__FreeBSD__.
No functional change intended.
2009-09-15 18:32:00 +00:00
tsutsui 16c0f8385d Use device_private(), proper types or variables for device_t and softc.
(not yet split though)

No crash on gxemul emulating hpcmips mobilepro.
2009-09-14 13:41:15 +00:00
tsutsui 5770fb4ee0 u_intNN_t -> uintNN_t 2009-09-14 12:49:33 +00:00
dyoung 9e037d8311 Experimental support for fragmentation and RTS/CTS.
Delete unused atw_voodoo and constants.

Export Tx/Rx statistics with evcnt(9).

Correct the Short Inter-Frame Space (SIFS) that we write to ADM8211's
registers; I do not recall if that corrected the SIFS that I observed
"on the air."  Use the constant IEEE80211_DUR_DS_EIFS to configure
the ADM8211's EIFS, instead of writing the same "magic" number,
0x64, that my reference driver wrote.

Do not clear OACTIVE in atw_init(), because atw_stop() cleared it
previously by calling atw_txdrain().

Use the net80211 short-preamble flag and instead of ATW_SHPREAMBLE.

Add an ADM8211 workaround from the reference driver, atw_workaround1(),
but don't compile it right now.

In at_intr(), don't stop processing the interrupt status after
restarting the receive ring, but process Tx interrupt status.  If
a packet's Tx lifetime is exceeded, reinitialize the device to get
packets moving again.  If the Tx FIFO underflows, restart the
transmitter, not the receiver!

Avoid losing synchronization with the Rx ring by replicating one
of Charles Hannum's fixes to rtw(4) here: receiving a management
packet may, as a side-effect, reset the Rx ring, so refer to the
softc's Rx ring pointer, sc_rxptr, every time through the loop in
atw_rxintr(), instead of refering to a pointer on the stack, i.

Re-synchronize DMA after reading the OWN bit on an Rx/Tx descriptor.
XXX This needs more work.

Reset sc_tx_timer as Tx descriptors are reclaimed from the device.

Shorten staircases in atw_watchdog().

Remove from softc an unused member, sc_intr_ack.
2009-09-13 22:07:34 +00:00
dyoung da6660904b Delete whitespace at ends of lines. No functional change intended. 2009-09-13 21:24:58 +00:00
tsutsui ad62cf6bd2 Fix an incomplete device_xname change in rev 1.69. PR kern/41861 2009-09-12 19:55:29 +00:00
tsutsui df9cde870d Fix warnings by -Wpointer-sign, which is disabled by default. PR kern/33965 2009-09-12 19:16:35 +00:00
tsutsui 0b4006b755 Make local functions static and remove a declaration that is also in hmevar.h.
Also comment out or remove declarations for #if 0'ed or nonexistent functions.
2009-09-08 18:35:42 +00:00
tsutsui 2b11b477b3 - split out chip reset ops from hme_stop() into a new function
hme_chipreset() to make hme_stop() match struct ifnet API
- set ifp->if_timer in hme_start() if any TX packets are queued
- also clear ifp->if_timer and ifp->if_flags in hme_stop()
- replace shutdownhook_establish(9) with pmf_device_reigster1(9)
Briefly checked hme at pci.
2009-09-08 17:16:33 +00:00
tsutsui 91bbbb9ed1 Split device_t/softc.
Tested QLogic 1020 Fast Wide SCSI HBA at PCI.
Sbus attachment is untested, but not so much quirks in it.
2009-09-07 13:39:19 +00:00
tsutsui c67601b868 Whitespace nits. 2009-09-07 13:31:44 +00:00
tsutsui 41f548bed9 Invert logic around nested pmf(9) registrations for readability. 2009-09-05 14:19:30 +00:00
tsutsui 15ecebfdb2 Make ahd_detach() take struct ahd_softc * rather than device_t
as well as ahd_attach().  (currently no backend calls it though)
2009-09-05 12:50:53 +00:00
tsutsui 7edc9e3e17 Use device_private() to get softc. 2009-09-05 12:46:55 +00:00
tsutsui d283274ba9 - use local ahd_name() to print device name
- pass proper device_t types to config(9) functions
2009-09-05 12:43:56 +00:00
tsutsui 1f74bbf3de Remove unnecessary casts against void pointers. 2009-09-05 12:39:25 +00:00
tsutsui aa60aebf13 Replace shutdownhook_establish(9) with pmf_device_register1(9) in
MI epconfig() and ep_detach(), and remove pmf(9) calls in pcmcia attachment.
Tested on ep0 at pci, but pcmcia attachment is untested.
2009-09-05 12:30:59 +00:00
tsutsui 1cc46c1f6d Remove one more extra whitespace. 2009-09-05 08:23:24 +00:00
tsutsui 97dbe6076b Remove unnecessary whitespace. 2009-09-05 03:50:49 +00:00
tsutsui f95171bf7a u_intNN_t -> uintNN_t 2009-09-04 18:40:19 +00:00
tsutsui 4466014699 Remove unnecessary whitespace. 2009-09-04 18:29:52 +00:00
tsutsui 4aff350284 Replace shutdownhook_establish(9) with pmf_device_register1(9).
Tested on sun3x.
2009-09-04 16:21:24 +00:00
tsutsui d0cad2b04e Remove now unused *shutdown_hook from softc. 2009-09-03 14:55:29 +00:00
tsutsui ffdf6c036a - wrap long lines
- remove unnecessary casts against void pointers
2009-09-03 14:52:22 +00:00
tsutsui 631843b598 Remove whitespaces between tabs. 2009-09-03 14:40:43 +00:00
tsutsui ae6e5bebd3 Misc cosmetics:
- remove c++ style comment
- wrap long lines
- remove unnecessary casts against void pointers
2009-09-03 14:37:58 +00:00
tsutsui 2ab0f07b1a Replace shutdownhook_establish(9) with pmf_device_register1().
Tested EtherPower II 10/100 (SMC9432TX) on macppc.
2009-09-03 14:13:16 +00:00
tsutsui 767b154f7a Use a proper local variable. 2009-09-02 17:22:53 +00:00
tsutsui 67a2fe67a4 Fix harmless pasto. (ahc -> ahd) 2009-09-02 17:11:26 +00:00
tsutsui 521f39b295 TAB vs space cleanup. 2009-09-02 17:08:12 +00:00
tsutsui e54ffcf9ee Replace shutdownhook_establish(9) with pmf_device_register1(9).
Untested, but mostly copied from ahc(4).

This may fix reboot failure problem on ahd(4) after pmf(9) merge:
http://mail-index.NetBSD.org/current-users/2007/12/10/0008.html
which was also seen on old ahc(4):
http://mail-index.NetBSD.org/port-sgimips/2008/01/05/msg000003.html
2009-09-02 16:38:17 +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 0968013cc2 Make local functions static. 2009-09-02 14:58:38 +00:00
tsutsui d90bf6dc81 Call ahc_shutdown() during system shutdown via pmf_device_register1(9),
as well as pre-pmf(9)'fied kernel did via shutdownhook_establish(9).
Tested on O2.

ahc_suspend() and ahc_resume() are still disabled due to lack of hardware.
Anyone who can test Cardbus APA-1480?
2009-09-02 11:44:11 +00:00
tsutsui 1056cb0520 Call pmf_device_register(9) in ahc_attahc() rather than ahc_pci_attach()
since pmf_device_deregister(9) is called from ahc_detach() so that
cardbus backend also gets proper pmf(9) calls.
PCI backend is tested on on O2, but cardbus is untested.
2009-09-02 11:10:37 +00:00
tsutsui 0f7a15058c Invert logic around nested pmf(9) registrations for readability. 2009-09-02 10:43:24 +00:00
tsutsui 531b631d68 Some backends may use ncr53c9x_abort(), so remove static declaration from
the function and explicitly declare it in ncr53c9xvar.h.  Noticed by he@.
2009-09-02 10:34:04 +00:00
jmcneill f6062bf27a aprint-ify 2009-09-01 21:46:52 +00:00
tsutsui e1e11a8c8e Also call pmf_class_network_register(9). 2009-09-01 17:12:42 +00:00
tsutsui a2ff563552 Replace shutdownhook_establish(9) with pmf_device_register1(9). 2009-09-01 15:19:20 +00:00
tsutsui 9ddabccc10 Treat 8168DP as well as 8168C/CP/D. From FreeBSD. 2009-08-31 13:05:30 +00:00
tsutsui 4ca1400e03 Misc KNF. 2009-08-30 02:07:05 +00:00
tsutsui f54cebb2d7 - no need to include "vlan.h" since no NVLAN reference
- whitespace in comment
2009-08-29 14:06:22 +00:00
tsutsui 6c957c4802 Uncomment /*static*/ function declarations,
and #ifdef'ed out an unused function.
2009-08-29 06:05:39 +00:00
dyoung e0567cec13 Use C99 types, s/u_int32_t/uint32_t/. No functional change intended. 2009-08-28 15:29:16 +00:00
dyoung ad4ed4b3dd Use *_FOREACH() routines instead of open-coding them. 2009-08-27 20:24:16 +00:00
dyoung b22313926a Make descriptors packed w/ 4-byte alignment. 2009-08-27 20:23:32 +00:00
tsutsui 6564af38e7 Remove an unnecessary assignment. No binary change. 2009-08-27 16:02:26 +00:00
bouyer 88384a5472 Oups, remove extra } 2009-08-27 09:40:39 +00:00
bouyer 952c92b561 mfi.c still uses the spl() synchronisation scheme and so needs the kernel lock.
The sysmon subsystem is marked MPSAFE and so runs without the kernel lock.
So get the kernel lock in mfi_sensor_refresh()  before calling
mfi_ioctl_vol().
This fixes command list corruption seen on heavy I/O load on the mfi
driver(4).
2009-08-26 21:41:05 +00:00
dyoung 5a395386a7 Let us detach ichlpcib(4) and its children.
XXX More testing is needed.  I've tested this on a Dell Dimension 3000,
XXX but that system does not attach every possible device that I try to
XXX detach with this code:

ichlpcib0 at pci0 dev 31 function 0
ichlpcib0: vendor 0x8086 product 0x24d0 (rev. 0x02)
timecounter: Timecounter "ichlpcib0" frequency 3579545 Hz quality 1000
ichlpcib0: 24-bit timer
ichlpcib0: TCO (watchdog) timer configured.
isa0 at ichlpcib0
2009-08-18 17:47:46 +00:00
dyoung 62dca01035 Add a bus-independent detachment routine. In the attachment routine,
save some device state to restore during detachment.
2009-08-18 17:06:35 +00:00
macallan 5f495e4be4 add voyagerfb, a driver for the Gdium Liberty 1000's onboard graphics chip 2009-08-12 19:28:00 +00:00
kiyohara 5bb9b7a6ef Support SMSC LAN9118 Family Ethernet interfaces device driver.
It tested on GUMSTIX only.
2009-08-09 06:40:09 +00:00
jun 3a6e583f13 fix pcic kthread creation timing.
see http://mail-index.netbsd.org/current-users/2008/07/15/msg003526.html

fix kern/41791 & port-hpcmips/41164.
ok by uwe & tsutsui
2009-08-05 13:29:16 +00:00
snj 7f43b2a600 Fix a typo inside a comment. 2009-08-03 20:06:36 +00:00
jmcneill 783afeb19c - fix TKIP, changes adapted from FreeBSD
- reduce diffs between FreeBSD and NetBSD athvar.h
2009-08-02 13:26:33 +00:00
dyoung 1b6947b941 Do a complete device_t/softc split for the PCI attachment. I have
not finished the device_t/softc split for the SBus attachment
because I don't have an SBus gem(4) to test with.

Convert from legacy shutdownhooks to a PMF shutdown hook.  Add PMF
suspend/resume handlers.

Factor a detachment hook out of gem_attach().  During device
attachment, track which resources are reserved in sc_attach_state,
and release only those resources during detachment.

Tested on gem0 and gem1 at pci1 on a Sun Fire V120.
2009-07-27 18:10:53 +00:00
kiyohara ce1343fcd9 Support Marvell Hercules-I/II SATA Controllers. 2009-07-27 12:34:12 +00:00
cegger ae3b7e2af6 use __arraycount, kill N() macro. 2009-07-25 23:43:06 +00:00
kiyohara 1f46950ef0 Support siisata@cardbus.
It tested on amd64 and i386 only.
2009-07-19 06:28:08 +00:00
dyoung bbc238f2cd Let us detach & re-attach children of mfi0. Detach mfi0 at shutdown.
Detachment may fail after freeing some but not all resources, so
take care not to re-release any resource during detachment.

Tested on a Dell PowerEdge 1950.
2009-07-16 18:58:38 +00:00
dyoung ebab3c38ca device_t/softc split. Tested and shown to work on a Dell PowerEdge
1950.
2009-07-16 18:10:00 +00:00