Commit Graph

17804 Commits

Author SHA1 Message Date
thorpej 8657dbc0c8 Remove the last vestiges of COMPAT_NOLABEL. It's been 10 years; label
your disks already.
2004-08-28 17:45:24 +00:00
kent 4f9d67091a add debug code for ac97_write().
It is enabled by defining AC97_IO_DEBUG.
2004-08-28 07:02:11 +00:00
bouyer 80620a83a7 Improve handling of memory shortage, to fix problems like:
sd3(mpt0:0:1:0): unable to allocate scsipi_xfer
sd3: not queued, error 12
Havard Eidnes's analysis of this problem is that the scsipi_xfer pool is
competing for resources with other pools, including the the inode and vnode
pools which can grow quite large.

*_scsipi_cmd(): don't biodone the buffer if scsipi_make_xs() fails, let the
   caller deal with the problem
start function of block devices drivers: dequeue the buffer after the
   scsipi_command() call. If scsipi_command() fails with ENOMEM don't dequeue
   the buffer, and schedule a callout to call the start function after
   some delay.
scsipi_init(): prime the scsipi_xfer_pool with one page. This ensure that
   there is always some scsipi_xfer to play with. If scsipi_command() fails
   because of pool_get(), we're sure there will be resources available later,
   when the pending commands have completed.

Reviewed by Jason Thorpe and Havard Eidnes.
Todo: remove the "unable to allocate scsipi_xfer" and "not queued, error %d"
printfs, but I choose to keep them for now, to help make sure the code does
what it should.
2004-08-27 20:37:28 +00:00
oster bcb300782d Correct some RF_ASSERTS() that were missed when fixing memory issues
with this code.  Thanks to palle at lyckegaard.dk for pointing them
out.  Addresses PR#26776 (but doesn't use all the suggested fixes).
2004-08-27 15:55:50 +00:00
lukem ce0391e266 Minor cosmetic consistency tweaks, from Damien. 2004-08-27 00:02:02 +00:00
thorpej 96663f19df Use ANSI function decls, more static. 2004-08-26 18:38:19 +00:00
drochner 5b0932cc68 kick out the ioasic offset check which happens in submatch() now 2004-08-26 18:07:12 +00:00
drochner 131be74c33 turn the (unused) ioasic_submatch() function into something useful, use
the locator passing variant of config_found(), get rid of the macros
hiding cfdata accesses and include "locators.h" from the .c file only
2004-08-26 18:06:20 +00:00
drochner 73286594a1 some cleanup: use the locator-passing variant of config_found(), get
the macros just hiding cfdata members out of tcvar.h and include
"locators.h" only in the .c file
2004-08-26 17:57:00 +00:00
oster da1725a116 rf_CheckLabels() needs to die, but for now, we patch it by setting
fatal_error when too_fatal is set, and by setting fatal_error in a
couple other critical cases.
2004-08-26 17:09:18 +00:00
jkunz 6c6c2be95f Remove race conditions caused by the CPU cache of PA7100 CPUs. 2004-08-26 16:56:07 +00:00
jkunz 1035c6af08 Import STI wscons(4) driver from OpenBSD and add new driver for PS/2
keyboard / mouse pots of LASI.
2004-08-26 16:48:06 +00:00
itohy bb5bb52e57 Add njs.4 2004-08-26 14:19:55 +00:00
itohy 1d4f1abb08 Workbit NinjaSCSI-32 PCI/CardBus SCSI driver (njs) 2004-08-26 14:13:46 +00:00
itohy d1112abfcc Regen from pcidevs rev 1.647. 2004-08-26 13:16:08 +00:00
itohy 2e477d0c91 Add Workbit NinjaSCSI-32 PCI/CardBus products. 2004-08-26 13:14:59 +00:00
reinoud 943622e723 Delay initialisation of shadow registers. Tested on a Shark. 2004-08-25 13:06:16 +00:00
thorpej 8b2ffcedfc Use ANSI function decls and more use of static. 2004-08-24 00:53:28 +00:00
thorpej 45bd8be9fa Protect against multiple inclusion. 2004-08-23 23:17:54 +00:00
bouyer 89817e7217 Revert 1.12, it cause problems on promise controllers, as reported in
PR kern/26568 by Paul Shupak.
2004-08-23 21:30:35 +00:00
bouyer fabf6fa880 Fix typo pointed out by Patrick Welche on current-users@ 2004-08-23 20:01:10 +00:00
drochner baf74cd9d0 it is sufficient to include "locators.h" in cardbus.c 2004-08-23 18:21:51 +00:00
drochner d9b1d2cfd2 kick out the error-prone handcrafted single-linked list of cardbus
functions; replace by a simple *array[8]
2004-08-23 17:52:45 +00:00
drochner b2f07722fc make the "selective probing" work, and minor cleanup
(avoid using the macros which hide cfdata members, this doesn't help
for anything)
2004-08-23 16:41:48 +00:00
lukem 34a603de29 Add ipw(4) 2004-08-23 12:03:25 +00:00
lukem 6d906be913 NetBSD RCSID 2004-08-23 11:57:35 +00:00
lukem a91684ce5d ipw(4) - Intel PRO/Wireless 2100 driver.
Written by Damien Bergamini, from http://damien.bergamini.free.fr/ipw/
2004-08-23 11:42:02 +00:00
he 764115cc85 Put an #ifdef _KERNEL around inline functions using panic().
Fixes compile problem for the atactl program for the vax target.
2004-08-23 10:08:48 +00:00
thorpej 1efb3da0fb Make use of static. 2004-08-23 06:16:06 +00:00
thorpej 8aa1e65090 De-__P 2004-08-23 06:05:30 +00:00
thorpej 41e5f04cfd - Use ANSI function decls and make use of static. 2004-08-23 06:03:19 +00:00
thorpej 3e1286d67c - Use ANSI function decls.
- Sprinkle some static around.
- Sprinkle some const around.
2004-08-23 05:50:02 +00:00
thorpej 1a4f23700c Sprinkle static in a few places. 2004-08-23 05:39:46 +00:00
thorpej 4152bad13d Remove a comment that doesn't really make sense. 2004-08-23 05:38:15 +00:00
thorpej a1bb10ef89 Use static in a few more places. 2004-08-23 05:37:42 +00:00
thorpej 878ac57b19 Protect against multiple inclusion. 2004-08-23 04:45:18 +00:00
thorpej b8d3850087 Use ANSI function decls and more use of static. 2004-08-23 04:38:42 +00:00
thorpej c5ed5cafd4 Protect against multiple inclusion. 2004-08-23 04:30:28 +00:00
thorpej d0fcfb4c3a Use ANSI function decls and make use of static. 2004-08-21 23:48:33 +00:00
thorpej d17a849385 Use ANSI function decls and make use of static. 2004-08-21 22:48:18 +00:00
thorpej 383b485d9a Make the product table static. 2004-08-21 22:23:13 +00:00
thorpej 83a43d11ff Use ANSI function decls and make use of static. 2004-08-21 22:16:07 +00:00
thorpej 4deb00f885 Use ANSI function decls and make use of static. 2004-08-21 22:02:31 +00:00
nisimura 2ded7c9cd6 Redo the previous adjustment work. 2004-08-21 21:46:54 +00:00
nisimura e86b49fe3c Remove fluctuation of written name in alphabetical representation of
copyright holder.
2004-08-21 21:44:07 +00:00
thorpej f6b6634f46 Oops, missed one in last. 2004-08-21 21:30:58 +00:00
thorpej cb3eb355e7 Const poison scsipi_dtype(). 2004-08-21 21:30:29 +00:00
thorpej be6339d21a Use ANSI function decls and make use of static. 2004-08-21 21:29:39 +00:00
thorpej 3a4c3c0872 - De-__P.
- Use ANSI function decls.
2004-08-21 20:40:36 +00:00
thorpej 7994917f9b De-__P. 2004-08-21 17:41:18 +00:00
thorpej 6cb9b7482f Use ANSI function decls and make use of static. 2004-08-21 17:40:25 +00:00
thorpej 09662eaa73 Register description for SATA port multipliers. 2004-08-21 02:25:26 +00:00
thorpej 5373bdd103 - Move to48() to atareg.h and rename it atacmd_to48().
- Add an atacmd_tosataq() that converts a 32-bit command to a Native
  SATA Queued command.
2004-08-21 02:17:07 +00:00
thorpej 218dbb60a6 Make some functions referenced only in wdc.c private to that file. 2004-08-21 01:51:46 +00:00
thorpej 8eaae3f96b Eliminate some gratuitous spl frobbing in atabus_thread(). 2004-08-21 00:48:32 +00:00
thorpej 335b799580 atastart() (called only at splbio(), and from interrupts) can change
drive_flags, to make sure all drive_flags manipulations are done at
splbio().
2004-08-21 00:28:34 +00:00
thorpej 2aaf643e25 - atabus_detach(): Manipulate ch_flags at splbio().
- ata_reset_channel(): Assert that we're at splbio() when called.
- Sprinkle some comments about functions that must be called at splbio().
2004-08-20 23:50:13 +00:00
thorpej 4af8216045 WDC_DIAGNOSTIC -> ATA_DEBUG 2004-08-20 23:36:52 +00:00
thorpej e975b9caee - Add an (*ata_reset_channel)() member to ata_bustype.
- Add an ata_reset_channel() function that performs the common parts
  of resetting an ATA channel, which uses the (*ata_reset_channel)()
  callback to do the heavy lifting.  Adjust callers to use ata_reset_channel()
  instead of wdc_reset_channel().

This removes the last wdc-specific code from ata.c!
2004-08-20 23:26:53 +00:00
thorpej bd165f8e47 Use ANSI function decls for atabus open/close/ioctl. 2004-08-20 22:26:23 +00:00
thorpej c5adb42199 wdcreg.h is not needed here any more. 2004-08-20 22:19:00 +00:00
thorpej 56e2a255b5 Move common parts of attaching an ata_channel to a new ata_channel_attach()
function.
2004-08-20 22:17:06 +00:00
thorpej 3234a02f48 Move atabusconfig() to ata.c. 2004-08-20 22:02:40 +00:00
thorpej 51c34ebedf In ata_get_params(), use the (*ata_exec_command)() available from the
ata_bustype rather than using wdc_exec_command() directly.
2004-08-20 20:53:20 +00:00
thorpej 2606542c7b - Add an atac_bustype_ata member to atac_softc to hold a pointer to
the ata_bustype for the controller.  Fill it in and use it instead
  of referencing wdc_ata_bustype directly.
- Add an atac_atapibus_attach member to atac_softc to hold a pointer
  to the function that attaches the ATAPI bus for the controller.  Fill
  it in and use it instead of referencing wdc_atapibus_attach directly.
2004-08-20 20:52:31 +00:00
thorpej ce56a7e194 Also set the AT_XFDONE bit as appropriate. 2004-08-20 17:37:16 +00:00
thorpej 709a2d87fc Rename the ata_bustype "ata_reset_channel" member to "ata_reset_drive"
to reflect the new reality after Manuel added the bus reset ioctls.
2004-08-20 17:19:44 +00:00
yamt a92a80cf63 for offloc, use MII_OFFSET_ANY rather than abusing MII_PHY_ANY. 2004-08-20 15:21:24 +00:00
kent 2edd85fb18 Check power states after codec reset. This change fixes a
resume problem on some boards.
Patch provided by Joachim Thiemann in PR kern/26457
2004-08-20 14:36:13 +00:00
thorpej 9cc521a148 Move most of wdc_softc into a new atac_softc structure that contains
info common to all types of ATA controllers.
2004-08-20 06:39:37 +00:00
thorpej 2926431abf Use ANSI function decls and "static". 2004-08-19 23:30:09 +00:00
thorpej 1600c8b8cd - Add and use a CHAN_TO_WDC() macro to get the wdc_softc from an
ata_channel.
- Add and use a CHAN_TO_WDC_REGS() macro to get the wdc_regs from an
  ata_channel.
- Add and use a CHAN_TO_PCIIDE() macro to get the pciide_softc from an
  ata_channel.
- Add and use a CHAN_TO_PCHAN() macro to get the pciide_channel from an
  ata_channel.  (This one just hides a cast, and is really just for
  consistency with the others.)
2004-08-19 23:25:35 +00:00
thorpej 65193a3b71 Protect against multiple inclusion. 2004-08-19 17:56:57 +00:00
drochner f2e99ab844 support rescan / manual detach
This code needs cleanup, at least a reasonable linked list
implementation (fixed a bug in detach_card() in the process which
left a dangling pointer around).
Also removed a questionable and undocumented use of the parent's
device unit number as locator value.
(As with the pcmcia code: someone please review wrt powerup/down etc.)
2004-08-19 14:50:52 +00:00
dyoung c9108ddfc8 Hubert Feyrer points out that hw.ath.countrycode really ought to
be writeable.  Make hw.ath.outdoor writeable while I am here.
2004-08-18 21:59:39 +00:00
drochner 890158d024 Allow to rescan and detach by user request, using the new autoconf
functions.
For later rescans (eg after a driver LKM was loaded) to make sense,
don't consider it an error if no driver was attached on the initial
bus scan.
Someone who understands the enable/disable/powerup/down stuff please
review this.
2004-08-18 12:01:13 +00:00
drochner a758a2aba6 allow to detach child devices and (optional selectively) bus rescans,
using the new autoconf functions
2004-08-18 11:54:47 +00:00
drochner 6ea832578d Use the new autoconf functions to rescan busses and detach devices
on user request.
This duplicates the functionality provided by a private ioctl
interface (accessible through scsictl(8)), but in a more generic way.
2004-08-18 11:50:59 +00:00
drochner c67a72f6ff make PCI devices attachable/detachable (as far as the particular drivers
allow), and allow to rescan a bus selectively (ie only the device/
function I'm looking at)
2004-08-17 23:20:10 +00:00
enami 31c5dbae84 Dereference ch_wdc after filled. 2004-08-16 22:11:13 +00:00
mrg 2db238d57d fix a wrong variable name in a debug message. 2004-08-16 16:43:29 +00:00
mycroft 5111abd827 Simplify some manipulation of PCIC_INTR.
Further attempt to mitigate "bad Vcc" errors.
2004-08-16 15:46:37 +00:00
mycroft f0b8d692af Some tweaks, per the PC Card spec:
* Assert RESET before powering off a socket.
* Turn on the output enable bit earlier so the interface actually drives CEn
  and RESET.
* Tighten up the power-on timing a bit.
* Mention the specific timing values named in the spec.

For pccbb, be careful to always power off before zeroing PWRCTL.
2004-08-16 15:40:35 +00:00
mycroft 4ff9d12ea9 Do not attempt to fiddle with the power-control bits in PWRCTL; just read them
back after touching the PCI registers.

This shouldn't be necessary, but somehow the controller detects the need for
VPP2=12V and automatically applies it, and gives us a "bad Vcc" error if we
turn it off accidentally.
2004-08-16 14:48:56 +00:00
mycroft 48de8a7bff wdc_init_shadow_regs() must now be called after ch_wdc is filled in, or we get
a null pointer dereference.
2004-08-16 14:47:31 +00:00
mycroft a6f02be621 And the reason we had to call pccbb_power() twice in the enable routine is...
we were writing to PCIC_PWRCTL in between and causing the socket to power off.
D'oh.
2004-08-15 20:19:14 +00:00
mycroft 1eb6dd26a9 Allow keypad PgUp/PgDn to scroll as well. 2004-08-14 16:42:36 +00:00
thorpej 08fa2a3486 - Split the register handles out of struct wdc_channel into a separate
wdc_regs structure, and array of which (indexed per channel) is pointed
  to by struct wdc_softc.
- Move the resulting wdc_channel structure to atavar.h and rename it to
  ata_channel.  Rename the corresponding flags.
- Add a "ch_ndrive" member to struct ata_channel, which indicates the
  maximum number of drives that can be present on the channel.  For now,
  this is always 2.  Add an ATA_MAXDRIVES constant that places an upper
  limit on this value, also currently 2.
2004-08-14 15:14:35 +00:00
thorpej 4b51cecfc2 - Split the register handles out of struct wdc_channel into a separate
wdc_regs structure, and array of which (indexed per channel) is pointed
  to by struct wdc_softc.
- Move the resulting wdc_channel structure to atavar.h and rename it to
  ata_channel.  Rename the corresponding flags.
- Add a "ch_ndrive" member to struct ata_channel, which indicates the
  maximum number of drives that can be present on the channel.  For now,
  this is always 2.  Add an ATA_MAXDRIVES constant that places an upper
  limit on this value, also currently 2.
2004-08-14 15:08:04 +00:00
tsutsui d91b03bd13 Use bus_space(9) on news68k.
Update/sort the comment/ifdefs about bus_space-using ports.

XXX which should we use defined(__${MACHINE_CPU}__) or defined(${MACHINE})?
2004-08-13 12:59:20 +00:00
mycroft e3dd5f4885 Rearrange slightly so that we don't blow up if the card disappears during the
initial enable.
2004-08-13 12:42:11 +00:00
pooka b151590832 kill "magic" number 2004-08-13 11:25:58 +00:00
mycroft 1d167b13be amd64 also has bus_space... 2004-08-13 10:52:18 +00:00
mycroft 27b5b1440c Remove a really gratuitous 1s delay. 2004-08-13 04:36:08 +00:00
thorpej 46f4277564 WDCDEBUG -> ATADEBUG. 2004-08-13 04:10:49 +00:00
mycroft c369e5b81c Fix two annoying display glitches with "fast scrolling" and
WSDISPLAY_SCROLLSUPPORT.
2004-08-13 04:03:38 +00:00
thorpej ab20886f7b Don't bother with bits that tell of the presence of optional callbacks;
just check the function pointers for NULL.
2004-08-13 03:12:59 +00:00
thorpej 577bf67014 Move wdcstart() to ata.c and rename it to atastart(). 2004-08-13 02:16:40 +00:00
thorpej 996c3ca90e Move wdc_exec_xfer() to ata.c and rename it ata_exec_xfer(). 2004-08-13 02:10:43 +00:00
thorpej e6d61c5bc9 Move wdc_addref() and wdc_delref() to ata.c and rename them to
ata_*.
2004-08-12 22:39:40 +00:00