Commit Graph

5994 Commits

Author SHA1 Message Date
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
xtraeme
56d9394d91 regen 2008-02-24 16:02:01 +00:00
xtraeme
f0667e8c53 + Dell PERC 6. 2008-02-24 16:01:46 +00:00
isaki
d540dc1cd1 Minor style fix. 2008-02-24 05:34:01 +00:00
mlelstv
69b2d26ed9 make this less verbose 2008-02-23 16:25:35 +00:00
mlelstv
6b959e1dfc Always attach AHCI_SATA devices, even when not configured for AHCI mode.
Fixes PR kern/38081.
2008-02-23 14:53:31 +00:00
rafal
c1fc4aa545 Request DMA-coherent memory for the rx/tx descriptors. Makes this work on
sgimips (tested on my O2).  Hint re: descriptor size << cacheline size from
Tsutsui-san; thanks!
2008-02-23 06:12:30 +00:00
dyoung
932264266e Detach self and children. Make some functions static. Use device_t
and accessors.  Use PMF_FN_*.
2008-02-23 02:17:16 +00:00
dyoung
d0f117b7d2 Detach self and children. Use device_t and accessors. Use PMF_FN_*. 2008-02-23 01:54:44 +00:00
dyoung
9aa9ebb999 Add a method to detach children. Use device_t and accessors. Use
PMF_FN_*.
2008-02-23 01:11:12 +00:00
dyoung
86fcf72f67 Simplify the switch-statement in pci_set_powerstate_int(), and fix
a couple of typos so that it will work as I think that it was
intended to: delay for 10000us or 200us on transitions to/from D3
or D2 state, respectively.  Discussed this with jmcneill@.
2008-02-23 00:27:53 +00:00
dyoung
b982c25441 Use device_t and accessors. Use aprint_*_dev(). Use PMF_FN_*. 2008-02-22 23:24:07 +00:00
dyoung
aea7bb1ab3 use device_t and accessors. Use aprint_*_dev(). Do not cast the
softc to 'struct device *', but use &sc->bce_dev instead.  Use
PMF_FN_*.
2008-02-22 23:21:01 +00:00
dyoung
cd44c43b28 Add a method to detach child.
Cosmetic: use device_t and accessors.  Use aprint_*_dev().  Use
PMF_FN_{ARGS,CALL,PROTO}.
2008-02-22 23:04:52 +00:00
dyoung
1fa24f5705 Add method to detach children.
Temporary: use PMF_FN_PROTO, PMF_FN_ARGS.
2008-02-22 22:22:27 +00:00
dyoung
22e9cad833 Add methods for detaching self and for detaching children.
Use device_t and accessors.  Use aprint_*_dev().
2008-02-22 22:19:36 +00:00
dyoung
941db428bc Add methods for detaching self and for detaching children.
Use device_t and accessors.  Use aprint_*_dev().
2008-02-22 22:15:31 +00:00
drochner
d9ffad8652 Add a horrible hack to allow the DRM driver to get at the bus_space_handle
allocated by the AGP driver in the case of Intel chipset graphics.
This is different from the patch by Yorick Hardy circulated a while ago
in that it doesn't change the semantics of reference counting within
the (3rd-party) DRM code -- it just bypasses it.
Needless to say that it is uglier, but it eases future updates to
the DRM code because the change there is just 2 LOC.

Imo, a cleaner solution for all that would be to attach "agp" to "vga"
in the intel chipset graphics case, which better reflects how the hardware
is structured. This would still need a hack to the DRM code, but
it would be confined to childs of the "vga" device, without need for
global variables.
Since there is a variety of intel chipsets with AGP and/or builtin
graphics options, this would need a considerable testing effort.
2008-02-22 19:47:06 +00:00
tsutsui
4c7dba7079 Add an entry for I-O DATA RSA-PCI 2-port serial board.
(works only on 16550A compatible mode)
2008-02-22 14:51:38 +00:00
tsutsui
5f46094d00 Regen from pcidevs rev 1.930:
> Add I-O DATA RSA-PCI 2 port serial board.
2008-02-22 14:49:46 +00:00
tsutsui
6a37ffc123 Add I-O DATA RSA-PCI 2 port serial board. 2008-02-22 14:48:50 +00:00
oster
06f0c8e418 Make outputs.master and inputs.dac show up in mixerctl output for the ALC888. Patch from, and much thanks to, jmcneill @. 2008-02-22 02:59:31 +00:00
drochner
569b8a258b clean up the error bit clear code:
-use an aligned pci config space address as everyone else -- I'm sorry
 about that because I like gson's way a lot -- it keeps the address
 offset due to alignment visually close to the data shift --, but since
 aligned addresses are used everywhere else in definitions, this
 causes confusion
-the mask applied to the data didn't make much sense, a look at the
 FreeBSD code where this code originates from suggests that there
 was just a mistake -- one trailing zero missing --
 anyway, the datasheet tells that the error bits are all write-one-
 to-clear, so just write back the value and we are done
2008-02-21 22:26:35 +00:00
drochner
efa71badb8 -fix the delay logics in "set powerstate" for the cases that D2 or D3
are switched to (was harmless because we don't do D2 yet and also
 don't (hmm - shouldn't) access devices in D3 (which would only make
 sense if we'd support D3hot)
-zero the io/mem/master enable bits before entering D3
 (The special handling of PCI_CLASS_DISPLAY devices is questionable
  here -- we can't care about the console if we are seriously follow
  the spec, and upstream bridges aren't considered anyway.)
-add exact references to the PCI PM spec
2008-02-21 22:02:22 +00:00
jnemeth
49c4d911fc KNF 2008-02-19 10:38:28 +00:00
jnemeth
3dd5990c06 PR/38056 - Simon Burge -- In ahci_pci_match, return the correct
value so that we only match SATA RAID controllers in AHCI mode.

Tested by: simonb@
Approved by: bouyer@
2008-02-19 10:37:56 +00:00
ober
6235fe300c More cleanup. Removal of debug comments. 2008-02-16 18:51:42 +00:00
gson
f3b879c064 Fix unaligned write to PCI configuration space. Should fix PR kern/37824. 2008-02-15 13:28:25 +00:00
tron
1112a56975 Regen. 2008-02-13 13:57:00 +00:00
tron
9886b76c16 Import PCI ids for the Matrox MGA G200e and the Intel E7230 and 82975X
chipsets from OpenBSD.
2008-02-13 13:56:46 +00:00
xtraeme
7794776b36 Attach ahcisata(4) to any RAID controller that supports AHCI, and make it
pass the ATAC_CAP_RAID capability for them. ok'ed by bouyer@.
2008-02-11 08:23:48 +00:00
ichiro
8bc3916209 regen 2008-02-10 10:59:44 +00:00
ichiro
bc141ac1b8 add few devices
PM965 interface
2008-02-10 10:59:18 +00:00
skrll
199fb5f423 Use PRIu64 in a DPRINTF. 2008-02-10 10:33:10 +00:00
skrll
5c7461ba78 More whitespace and RCSIds. 2008-02-09 19:14:53 +00:00
ober
0a7ceb2bfb Clean up white space and KNF everything. 2008-02-09 18:19:33 +00:00
ober
5b57893f60 Intel PRO/Wireless LAN 4965AGN Mini-PCI Adapter Driver ported from OpenBSD
by deroote@.  OK nick@ moof@
2008-02-09 12:25:43 +00:00
dyoung
2ccede0a9c Start patching up the kernel so that a network driver always has
the opportunity to handle an ioctl before generic ifioctl handling
occurs.  This will ease extending the kernel and sharing of code
between drivers.

First steps:  Make the signature of ifioctl_common() match struct
ifinet->if_ioctl.  Convert SIOCSIFCAP and SIOCSIFMTU to the new
ifioctl() regime, throughout the kernel.
2008-02-07 01:21:52 +00:00
joerg
577c689497 Don't use misaligned PCI config access. Reported by Christoph Egger. 2008-02-06 16:50:38 +00:00
ichiro
84528b0430 regen 2008-02-05 18:22:31 +00:00
ichiro
8cf4b4059b added some devices of "PCI-Cardbus bridge" 2008-02-05 18:22:09 +00:00
simonb
de8ac4a1b6 Print the "bus-master DMA support present" message out the same
other a few other SATA drivers do.  Nicer output than just a line
with ": DMA" on it...
2008-02-05 07:02:00 +00:00
simonb
d07d2923b8 Remove an extra \n from an attach message. Get's rid of a blank
line during boot.
2008-02-05 06:52:26 +00:00
mlelstv
527bf7ecad Check wether interrupts originate from the bge hardware.
Fixes PR kern/33433.
2008-02-04 21:44:35 +00:00
joerg
201546aaac Fix quirk to clean only PCI register 0x6a and 0x6b, which is likely
what the original code intended. This avoids the unaligned access.
According to jmmv@'s testing, this seems to work.
2008-02-04 14:12:25 +00:00
tron
9cb1a5317f Avoid using a stale PCI chipset tag pointer. This avoids panics while
attaching a 3Com 3C996B-T on my ULTRA60. Reviewed by Matthew Green.
2008-02-02 12:12:09 +00:00
tls
9b6c682b45 From Darran Hunt at Coyote Point: don't truncate HMAC to 96 bits unless
actually asked to.

Fixed in FreeBSD a while ago, discussed on tech-kern and tech-crypto.
2008-02-02 02:39:00 +00:00
dyoung
46be8b643f Fix a two races between the initialization code and cbb(4) interrupts:
establish the interrupt handler before enabling interrupts, so that
we will not get an interrupt storm that keeps the system from making
any progress.  (We may have only been susceptible to the storm if
cbb(4) shared an interrupt with, say, uhci(4)).  Also, finish
setting up the pcic_handle before enabling interrupts, so that the
Pcic_read() call in pccbbintr() will not jump to address 0!

Now, pccbb_intrinit() encapsulates all of the interrupt initialization.

Explicitly enable card-status changed (CSTSCHG) events.

Paranoia: ensure that writes to the socket event register (interrupt
acknowledgements) are flushed to the h/w by reading the register
(gross).  We really need something like
bus_space_sync(BUS_SPACE_BARRIER_WRITE_BEFORE_INTERRUPT).

More paranoia: in pccbbintr(), if the device is inactive, get out.
2008-02-02 00:31:25 +00:00
dyoung
b31e1f190c Use aprint_*_dev() and device_xname() instead of accessing dv_xname
directly.
2008-02-01 21:13:44 +00:00
jdc
129b6bc9a9 Set the chip revision in the softc. 2008-02-01 10:58:28 +00:00
markd
906c80684e s/AD1983_EVENT/AD198X_EVENT/ 2008-01-31 19:01:50 +00:00
markd
5dc269fc53 Use more meaningful names for AD1984 widgets.
Select dac as default input for internal mono speaker.
Handle jack pin detect for headphones and lineout on Dell Optiplex 755.
2008-01-31 18:58:57 +00:00
jmcneill
89cbafc849 AD1984: Create a dummy outputs.master mixer knob that mirrors inputs.dac,
since AD1984 doesn't have a traditional master volume control.
2008-01-30 23:03:09 +00:00
jmcneill
77c34d4c1c AD1984: Use the same DAC for speaker and headphones, so the headphone jack
works as expected on Thinkpad T61 (and probably others).
2008-01-30 22:09:00 +00:00
simonb
a4c23df6ce Add a simple resume hook that just calls bce_reset(), and register
this with pmf_device_register().

Makes suspend/resume with bce happy.  Much thanks to Jared for help here.
2008-01-30 12:00:35 +00:00
simonb
fb673d9599 WextraRemove unused DPRINTF/DPRINTFN macros.
Remove NetBSD 1.6 compatibility checks (way out of date).
Be somewhat consistent (and closer to KNF) with whitespace.
Use uintN_t instead of u_intN_t.

No functional changes.
2008-01-30 11:54:08 +00:00
tls
16a9229cf8 Sigh. What was meant here was an ITR register value of 1500, for 2604
interrupts/sec -- not the other way around.  Caught by yamt.

When I can confirm that it won't lock the chip up on the models claimed
to be problematic, I'll probably adjust the packet timers a bit further
to see if I can get latency down under low load.  But this should be
better.
2008-01-29 20:24:41 +00:00
jmcneill
ab245e294e PCI Power Management 1.2 says that system software should wait 10ms after
transitioning a device to or from D3hot, 200us to or from D2, and no wait
for D1 transitions. Update pci_set_powerstate_int to match the spec,
rather than naively waiting 1ms after every state transition.
2008-01-28 22:48:43 +00:00
dyoung
37b0eea62f Remove dead code and associated comments. 2008-01-28 18:18:37 +00:00
macallan
671b15c8ef get rid of the shutdown hook, add suspend and resume handlers instead
XXX: ahc_suspend panics here so suspend calls ahc_shutdown and resume does
nothing.
This fixes a hangup and subsequent panic which occured when the shutdown hooks
were called and /afterwards/ the sd suspend handler tried to flush caches
through an already shut down ahc.
2008-01-28 16:08:37 +00:00
jmcneill
515d26c53b Release ownership of EHCI to the BIOS when we suspend or detach the
device driver.
2008-01-28 00:44:17 +00:00
jmcneill
31646d87c2 Don't attempt to claim ownership from the BIOS if the OS already holds
the HC OS Owned semaphore. Unconditionally clear SMIs as long as the
USB legacy capability is present.
2008-01-27 20:09:14 +00:00
jmcneill
cdbea784c7 On resume, ensure that esa is powered up, and ensure we power the
AC97 codec once the host controller is up and running.
2008-01-27 01:57:03 +00:00
jmcneill
d66b2b71eb Fixup PCI_COMMAND_STATUS_REG on attach. 2008-01-27 01:56:02 +00:00
tsutsui
9e319fb40f Wakeup some newer chips from powerdown mode. From FreeBSD/Linux driver
via OpenBSD.

Tested by wiz@ in PR kern/37868.
2008-01-26 14:13:06 +00:00
jmmv
7660ca07d8 Now that the driver goes through the mii_ifmedia_change indirection
instead of directly calling the pcn_79c970_mediachange function, we
must initialize sc->sc_mii.mii_ifp so that this last function is
passed a valid parameter.

Fixes a panic in pcn_79c970_mediachange that arose immediately when
trying to use this interface due to a NULL pointer dereference.
Hi dyoung@!
2008-01-20 11:28:12 +00:00
dyoung
da15c1a71e Let ether_ioctl() handle default SIOCSIFMEDIA/SIOCGIFMEDIA actions. 2008-01-19 22:23:35 +00:00
dyoung
b480b62270 Make many ethernet drivers share the common code for MII media
handling, ether_mediastatus() and ether_mediachange().  Check for
a non-ENXIO error return from mii_mediachg().  (ENXIO indicates
that a PHY is suspended.)

This patch shrinks the source code size by 979 lines.  There was
a 5100-byte savings on the NetBSD/i386 kernel configuration, ALL.

I have made a few miscellaneous changes, too:

gem(4): use LIST_EMPTY(), LIST_FOREACH().
mtd(4): handle media ioctls, for a change!
axe(4): do not track link status in sc->axe_link any longer
nfe(4), aue(4), axe(4), udav(4), url(4): do not reset all PHYs
        on a change of media

Except for the change to mtd(4), no functional changes are intended.

XXX This patch affects more architectures than I can feasibly
XXX compile and run.  I have compiled macppc, sparc64, i386.  I
XXX have run the patches on i386 boxen with bnx(4) and sip(4).
XXX Compiling and running on evbmips (MERAKI, ADM5120) is in
XXX progress.
2008-01-19 22:10:14 +00:00
dyoung
ad45c434e8 Use the common code for ethernet media handling. Compiles on i386. 2008-01-19 20:25:44 +00:00
aymeric
8a162df73e recognize (again) the Intrepid 2 gem adapter in the Powerbook5,8 2008-01-19 15:56:52 +00:00
simonb
741ec49962 Use M_80211_NODE as malloc type for a 80211 node as rest of net80211
code does, instead of M_DEVBUF.  Fixes panics if KMEMSTATS are enabled.
Also use M_ZERO instead of memset on malloc()'s results.
2008-01-19 03:45:08 +00:00
joerg
4ef3261d7c Add power management support. Untested due to lack of feedback. 2008-01-18 01:33:40 +00:00
jklos
740cd1ea87 More Chelsio 10 gigabit driver files to complete the ones checked in
yesterday.
2008-01-17 15:54:35 +00:00
jklos
0123f42896 10 gigabit Chelsio cards now compile and work, although not very well yet. 2008-01-17 06:03:21 +00:00
jmcneill
f4e9b2430e Don't assume that sizeof(long) == sizeof(int); makes bktr work on amd64. 2008-01-16 13:08:54 +00:00
christos
9d6619f2e6 Remove ricoh hack; FreeBSD does not seem to do it, and it was a remnant from
the branch. Things should work properly now.
2008-01-15 21:55:24 +00:00
jmcneill
cdd511a2fb For WSDISPLAY_GINFO, depth should be sc->bits_per_pixel, not
sc->color_depth. While we're here, implement WSDISPLAYIO_LINEBYTES.
2008-01-15 02:00:49 +00:00
drochner
69ac8d9d9e fix some PCI config space offsets to be 32-bit aligned, the code
did already do the right bit shifting
2008-01-15 00:27:58 +00:00
drochner
98da2f9c50 fix some unaligned PCI config space accesses in suspend/resume functions 2008-01-15 00:24:47 +00:00
martin
e91d982a78 Make sure pci config space access only happens on 32bit aligned addresses. 2008-01-14 21:33:04 +00:00