Commit Graph

15916 Commits

Author SHA1 Message Date
shige
a6e367af69 Add XICOR X1226 RTC driver. 2003-10-06 18:02:02 +00:00
bouyer
7b066791c8 Remove references to University of California from my copyright notices. 2003-10-05 17:48:49 +00:00
tsutsui
9869f97b24 Increase number of transmit/receive buffers from 10 to 32 to avoid
RX buffer overrun.
2003-10-05 14:57:14 +00:00
tsutsui
d008eb86c9 Pass proper dma mapsize of TX/RX mbufs to bus_dmamap_sync().
Now tl(4) works on sgimips.
2003-10-05 14:50:09 +00:00
tsutsui
cf2571bd30 Oops, more white space nit. 2003-10-05 14:44:55 +00:00
tsutsui
e7b57317b8 TAB/space nits. 2003-10-05 14:42:45 +00:00
jdolecek
e6286b949a Add some framework for MI assignment of device majors - add sys/dev/majors
which is automatically included during kernel config, and add comments
to individual machine-dependant majors.* files to assign new MI majors
in MI file.

Range 0-191 is reserved for machine-specific assignments, range
192+ are MI assignments.

Follows recent discussion on tech-kern@
2003-10-05 08:04:24 +00:00
dyoung
865b1e786b For memory-mapped access, get the endianness right on big-endian
hosts.  This makes awi work marginally better (although it's still
broken) on my Powerbook.
2003-10-04 22:04:36 +00:00
augustss
1c24ba42ab Several changes:
* Implement read for ulpt.
 * If the device is not opened for reading, occasionally drain any
   data the printer might have (but don't hammer the printer with reads).
 * Lower the buffer size to one page.
The driver seems to work with more printers now.
2003-10-04 21:19:50 +00:00
tsutsui
b8ecd4c7a4 Regen from tcdevs rev 1.18:
>- Move PMAGB-BA and PMAG-JA (which I have) out of "may be incorrect" entries.
>- Put driver name "tfb" for PMAG-JA (which will appear in future pmax-wscons).
2003-10-04 16:17:16 +00:00
tsutsui
6865a39a35 - Move PMAGB-BA and PMAG-JA (which I have) out of "may be incorrect" entries.
- Put driver name "tfb" for PMAG-JA (which will appear in future pmax-wscons).
2003-10-04 16:15:00 +00:00
pooka
dae7af8b24 Ready the kernel side of i4b for primary rate interface support by
removing assumptions that there are only two B channels and by
adding support for a varying number of channels.

Due to this, rename previously used isdn identified "bri" to "isdnif",
which better describes the current situation.
2003-10-03 16:38:44 +00:00
dsl
23069255ce Make 'minor(dev) == 1' a device that isn't affected by TIOCCONS.
For /dev/constty so that you can grab kernel messages when logged in
on the 'console'.
2003-10-03 13:15:52 +00:00
augustss
99ebb5ba5a Add more printers that report bidir mode, but can't handle it. From Linux. 2003-10-02 19:10:37 +00:00
augustss
301ab7ace1 Regen. 2003-10-02 19:09:53 +00:00
augustss
e45171e5c1 Add more printers (from Linux). 2003-10-02 19:09:28 +00:00
augustss
7838ca0944 Regen. 2003-10-02 18:34:35 +00:00
augustss
3d6bbf42ca Add HP Deskjet 6127. 2003-10-02 18:34:12 +00:00
christos
7e494b3ce8 Add a Quirk for my Appro, where it does not find all its busses in ACPI 2003-10-02 16:05:33 +00:00
mycroft
aeeaf47b01 Cleanup:
* auich_calibrate() assumes that the AC97 part is in its reset state.  To
  ensure this, call audio_attach_mi() after auich_calibrate().
* Explicitly support 12000Hz and 24000Hz.  (Why is there a discrete list at
  all?)
* Fix an obvious recording bug -- we were acking the wrong interrupt.
* Ensure that we don't get an interrupt during the AC97 speed probe by clearing
  the "interrupt on completion" bit in the DMA setup.
2003-10-02 07:41:53 +00:00
mycroft
fc3c7930e6 A bit of cleanup:
* Separate the code to set the default parameters into a new function,
  audio_set_defaults().  Make it use audiosetinfo(), which properly initializes
  the block size and whatnot.  Use this in both audioattach() and the
  /dev/audio case of audio_open().
* Do not force a reinitialization when /dev/sound is opened.
* Do all of the block size sanity checks in auto_init_ringbuffer(), not in
  both audio_calc_blksize() and audiosetinfo().
* Fix a bug in audiosetinfo() that caused the block size to not be recalculated
  immediately if we set it to 0.
* For AUDIO_GET[IO]OFFS, modify the deltablks calculation so that it gives us
  the number of block boundaries crossed.
2003-10-02 07:15:20 +00:00
fvdl
7baac02537 Reenable negotiation by default for discovery commands, until I figure out
what the issue is.
2003-10-01 18:01:06 +00:00
itojun
c6eceb7a58 avoid out-of-bounds memory access (array size out of sync). found by
openbsd 'bound' attribute.
2003-10-01 08:07:39 +00:00
martin
1483742f8a Fix typo (DP83020 -> DP83820) from HITOSHI Osada in PR kern/23023. 2003-09-30 21:21:34 +00:00
briggs
701f5ff4ba Make sure that we don't blow away the enables in ahd_reset() on PCI-X. 2003-09-30 12:34:16 +00:00
tron
9340e9d695 Fix build problem caused by integration of new I2C framework. 2003-09-30 09:35:15 +00:00
thorpej
2652188cc4 New generic I2C framework. Supports bit-bang and "intelligent" I2C
interface controllers (of varying intelligence levels).

Contributed by Wasabi Systems, Inc.  Primarily written by Steve Woodford,
with some modification by me.
2003-09-30 00:35:30 +00:00
grant
d2b2b89242 typo in comment 2003-09-29 23:31:04 +00:00
augustss
1aa1d2f8e2 The umass attach can fail in many ways. Print a message about why it
failed instead of just being silent about it.
2003-09-29 20:04:25 +00:00
scw
5b05921978 Copy our pci_chipset_tag_t into wi_pci_softc instead of a pointer
to pci_attach_args. The latter is allocated on the stack during auto-
configuration and so will not be valid after that time.

It's amazing how the old code worked for so long. I guess pci_attach_args
is allocated deep in pid#0's kernel stack on most platforms.
2003-09-29 14:10:35 +00:00
augustss
95b435b7b3 Update URLs. From PR 23004. 2003-09-29 11:54:26 +00:00
wiz
37ac1db454 available, not avaliable. From miod@openbsd. 2003-09-29 09:50:21 +00:00
jdolecek
c82b56d651 constify a little 2003-09-29 03:22:58 +00:00
mrg
0aad2d6101 - convert to new aprint*() autoconfig print mechanism
- clean up some magic numbers
- make 1.6 friendly
2003-09-29 01:53:02 +00:00
cube
e57b040603 Change the way of setting a port value so that a change too small to
fit in the number of bits used for the port still does something.

This fixes PR pkg/18741 for ac97-based hardware. Other audio drivers
might need a similar fix.
2003-09-28 22:24:09 +00:00
kent
1bea39944d codec id for AD1985 2003-09-28 15:39:09 +00:00
kent
0eb86c3701 Support for 4ch/6ch audio playback. 2003-09-28 13:37:19 +00:00
jdolecek
6c6463370e add entry for Lava Quattro-PCI (4 port serial)
contributed in PR kern/22977 by Heison Chak
2003-09-28 07:22:01 +00:00
jdolecek
330360f6a6 regen: ROLAND MIDI devices and Piengineering Xkeys entry 2003-09-28 07:15:47 +00:00
jdolecek
eb3ff4c555 add usbdevs entries and umidi quirks for Roland USB MIDI devices
contributed in PR kern/18096 by Clemens Ladisch
2003-09-28 07:14:56 +00:00
jdolecek
b2122d6d98 add Piengineering Xkeys 58 entry, from kern/20838 2003-09-28 06:55:57 +00:00
mrg
52b4a4af1d from Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>:
- if_bcereg.h should only have register definitions, so declarations
  of softc structure etc. should be in if_bce.c.
- The types of DMA descriptors should be u_int32_t, not unsigned long.
- netinet headers are not required here.
- Values passed via bce_tx_ring should also be byte-swapped.
- byte-swapping is not needed for bus_space access.

from me:
- KNF
- mark all magic numbers with /* MAGIC */ so they can be identified at
  some point.  there are 33 in total though many appear to be the same
  value, or related (eg, the 6 emac points.)

leaves these issues:
- RX pre-packet headers need to be byte-swapped or not?
- PAGE_SIZE bytes are allocated for both TX and RX DMA ring descriptors,
  but they should be 1024 (== sizeof(struct bce_dma_slot) * N[TR]XDESC).
- the mcast filter.
2003-09-28 01:03:07 +00:00
tsutsui
2fe24b8c7f Use strlcpy() rather than strncpy() + `\0' termination. 2003-09-27 17:42:11 +00:00
mycroft
c82b47f9bc Fix a non-fatal race condition. 2003-09-27 15:56:03 +00:00
mrg
871eae696e add new driver for broadcom BCM4401 chipset (as seen on recent dell
laptops) written by Cliff Wright <cliff@snipe444.org> and tested by
yours truly.

XXX: missing mcast filter support.

thanks cliff!
2003-09-27 13:13:28 +00:00
tls
d0ffab287c Remove NOSETTLE flag from channel in FibreChannel case. It makes sense that
it should be there, but in practice, on some systems an ugly race condition
rears its head: SCSI commands are issued before the FC thread ever runs, and
fail from then on forever.  Yuck.
2003-09-27 03:43:08 +00:00
wiz
db579612f4 Definition, not defintion. From miod@openbsd. 2003-09-26 22:25:21 +00:00
tsutsui
b299c2186f Remove casts and use %x in printf for tc_offset_t,
which is int32_t on both alpha and pmax.
2003-09-26 17:17:47 +00:00
matt
4c294aa149 Add DELL Perc 4/di (from Freebsd). 2003-09-26 16:31:08 +00:00
simonb
5c54e29374 Cast through (void *) to appease gcc3. 2003-09-26 16:02:24 +00:00
mycroft
c7d415bac1 Fix off-by-one problem in array size. 2003-09-26 16:00:12 +00:00
matt
d685af4b25 Regen. 2003-09-26 07:47:14 +00:00
matt
90bc204d53 Add Dell Perc 4/DI 2003-09-26 07:45:15 +00:00
thorpej
a398d77171 Confirmed; don't need to query stripe size on TwinStor. 2003-09-26 03:11:41 +00:00
thorpej
abcd16ecc6 Fix up the TWEIO_COMMAND code to actually work. The 3ware management API
library can now communicate with the card.
2003-09-25 22:26:40 +00:00
christos
7da4d27c12 imake this compile again. 2003-09-25 21:55:49 +00:00
mycroft
eefae40298 Hide the use of config_interrupts() in one place. 2003-09-25 19:29:48 +00:00
mycroft
864b96269c Modify the fdcattach() interface again, splitting it into two parts, so that
DRQ allocation is done earlier.
2003-09-25 19:06:19 +00:00
thorpej
1e3cfaaadc Install twereg.h and tweio.h 2003-09-25 18:05:53 +00:00
thorpej
70b9bb88c1 - Protect against multiple inclusion.
- Pull in <dev/pci/twereg.h> ourselves, as well.
2003-09-25 18:05:40 +00:00
joda
709b6b0e89 regen 2003-09-25 16:49:03 +00:00
joda
074d64615d more nvidia devices 2003-09-25 16:47:54 +00:00
pooka
2ef487b6bc autoconf goop for iavc 2003-09-25 15:58:14 +00:00
pooka
a99f02d0ee Add a driver for the CAPI-compliant AVM B1/T1 cards.
The driver backend is capable of supporting also ISA cards (no DMA)
and primary rate (PRI) cards in addition to the basic rate ones,
but I don't any to test on right now, so we don't support those
currently.

This code was originally written by Juha-Matti Liukkonen <jml@cubical.fi>
of Cubical Solutions Ltd. for FreeBSD, and was ported to NetBSD by
myself for the same company.
2003-09-25 15:53:26 +00:00
bouyer
703c60f5c6 Don't print modes we are using if we don't know which modes are really used. 2003-09-25 09:38:09 +00:00
thorpej
4fa7c2c48b - Fix a bug I introduced in a previous commit (oops).
- Add the twe_drivecommand ioctl structure.
2003-09-25 01:35:25 +00:00
mycroft
3d7395ab71 Update for new attach method. 2003-09-25 01:12:43 +00:00
mycroft
516d857707 Do fd probing after interrupts are enabled, and use tsleep() for delays.
Also try to accept a recalibrate interrupt to terminate the delay -- but that
doesn't seem to work reliably, so do a 2s timeout as well.
2003-09-25 01:05:06 +00:00
thorpej
544359b9a2 - Make CCB allocation slightly more efficient by changing how the
CCB is returned to the caller.
- Make code paths that can use twe_ccb_alloc_wait() use it, and assert
  that a CCB is always returned from that function.
- Assert that a CCB is always returned when allocating the reserved CCB
  for an AEN fetch.
2003-09-23 23:50:04 +00:00
thorpej
765ddabe83 Add a comment clarifying why we clear TWEF_AEN in twe_reset() now. 2003-09-23 23:10:53 +00:00
thorpej
1cad401c12 Separate the AEN fetching path into its own special path that uses the
reserved CCB.  This means that all remaining callers of twe_param_get*()
are called from a valid thread context, and thus have no need to use a
reserved CCB.  This will allow for further cleanup in a future commit.
2003-09-23 23:08:54 +00:00
mycroft
ab223e99bc Allow a device to reject CLEAR_FEATURE ENDPOINT_STALL (with a STALL) -- the
assumption being that the device will never use a STALL of a non-control pipe,
I guess.
2003-09-23 21:44:42 +00:00
mycroft
df8e298ddb Small changes -- if your controller clears DRV_BUSY when recalibrate completes,
you get lucky and the probe is faster.  A more complete fix will require making
the probe use interrupts, since there is no reliable way to poll.
2003-09-23 21:36:07 +00:00
martin
d505bdda83 Fix rx buffer size bitmask, do not explicitly set burst length and use 1536
bytes buffers, so this driver can finally cope with full size ethernet
packets. From Peter Bex.
2003-09-23 19:37:39 +00:00
bouyer
5a2aac1c7c Fix a typo that prevented pre-ata drives from working since 1999. 2003-09-23 16:27:10 +00:00
mycroft
f9d629fb93 Fix more probe delay and/or failure problems:
1) Don't wait for DRQ on an IDENTIFY command -- if it's not set when we see
   BSY clear, abort the command and ignore the drive.  (Do this by testing
   for DRQ in the read/write cases in __wdccommand_intr().)
2) Don't wait for DRQ to deassert when we finish an IDENTIFY (or any other
   non-block command that reads data) -- we don't do this for block I/O, and
   empirically it doesn't clear on my CF cards at all, causing a pointless 1s
   delay.
3) Add comments to some of the delay()s, and add missing ones in wdcreset()
   and the WDCC_RECAL in the so-called "pre-ATA" probe.
4) Slightly simplify the reset sequence -- we were doing an extra I/O.
5) Modify the register writability test to make sure that registers are not
   overlapped -- this can happen in some weird cases with a missing device 1.
6) Check the error register value after the reset -- if it's not 01h or 81h,
   as appropriate (see ATA spec), punt.
Tested with a number of ATA-only, ATAPI-only, mixed ATA-ATAPI, CF, and IDE
disk configurations.

Also remove the SINGLE_DRIVE nonsense again.
2003-09-23 09:19:22 +00:00
simonb
5a696d0850 Fix uninitialised variable introduced with previous change.
Patch from mlelstv.
2003-09-23 09:16:07 +00:00
mycroft
07da406c30 GC a structure element. 2003-09-23 09:11:43 +00:00
skd
f3de6832d9 Additional definitions as per SATA specifications.
Approved by Manuel Bouyer.
2003-09-23 03:55:59 +00:00
thorpej
ddfcdc4f1f Add support for dynamically attaching and detaching RAID array units. 2003-09-22 18:31:10 +00:00
thorpej
2f8976d430 Add TWEIO_{ADD,DEL}_UNIT ioctls (used by 3ware management tools). From
FreeBSD.
2003-09-22 01:44:57 +00:00
thorpej
b2b05806b3 Add a few additional control bits and opcodes. From FreeBSD. 2003-09-22 01:28:25 +00:00
thorpej
0448a55234 Improve AEN handling:
- Make AENs use the generic code table stuff.
- Add a few more AEN codes (from FreeBSD).
- Correct the context of a few AEN codes (some were listed as
  "unit context" when they're really "port context").
- Add a queue of AENs that management tools in userspace can poll
  (from FreeBSD).
2003-09-22 01:13:02 +00:00
thorpej
4431e5d2ea Fetch info about the drives during attach, and inject that info
into the msgbuf using aprint_verbose().
2003-09-21 19:46:44 +00:00
thorpej
a721d80bc9 Report the status of the logical drive (normal, degraded, etc.) at
attach time.
2003-09-21 19:33:10 +00:00
thorpej
21809f0c30 Expose the "param get" functions. 2003-09-21 19:27:27 +00:00
thorpej
291d256789 - Record more information about the array unit, including array
type and stripe depth.
- Report array type and stripe depth when attaching the logical drive.
2003-09-21 19:20:18 +00:00
jdolecek
7cea8a1389 cleanup & uniform descriptor owner handling:
* introduce fsetown(), fgetown(), fownsignal() - this sets/retrieves/signals
  the owner of descriptor, according to appropriate sematics
  of TIOCSPGRP/FIOSETOWN/SIOCSPGRP/TIOCGPGRP/FIOGETOWN/SIOCGPGRP ioctl; use
  these routines instead of custom code where appropriate
* make every place handling TIOCSPGRP/TIOCGPGRP handle also FIOSETOWN/FIOGETOWN
  properly, and remove the translation of FIO[SG]OWN to TIOC[SG]PGRP
  in sys_ioctl() & sys_fcntl()
* also remove the socket-specific hack in sys_ioctl()/sys_fcntl() and
  pass the ioctls down to soo_ioctl() as any other ioctl

change discussed on tech-kern@
2003-09-21 19:16:48 +00:00
thorpej
4cf2e784e2 Add some helper routines to fetch 1, 2, and 4 byte parameter values.
Modeled after code in FreeBSD.
2003-09-21 19:01:05 +00:00
manu
9a42b7a993 Do much more sanity checks when handling entries in the sc_scr array
of struct wsdisplay_softc. Unused entries are NULL, and there were
a lot of places where we did not checked that the caller did not
requested an operation on a NULL entry.

While we are there, one bit of KNFification, and make return code more
consistent by always returning the same code (EINVAL) when a screen
number higer than the maximum is requested.
2003-09-21 18:47:59 +00:00
thorpej
6c5904f215 Add some additional code -> description tables, and add a generic
routine to translate code -> description.  AENs will be converted
to this mechanism in a future commit.

Partially from FreeBSD.
2003-09-21 18:35:31 +00:00
nisimura
1e9ce6571c Regen. 2003-09-21 14:27:40 +00:00
nisimura
cfb11c4317 Redo, again. 2003-09-21 14:23:21 +00:00
nisimura
7fef26674d Redo the previous fix. 2003-09-21 14:12:09 +00:00
enami
a7c2135a0c Correctly resurrect the style in previous. While I'm here, also removed
whitespace at the end of line in comment.
2003-09-21 11:56:40 +00:00
bouyer
0ca58f3790 Ops, remove a line that escaped out of my local tree. 2003-09-21 11:30:43 +00:00
bouyer
9f91a8476e The return value from pciide_mapregs_* are ignored; make them return void.
Re-add support for HPT366 in compat mode.
2003-09-21 11:20:37 +00:00
bouyer
c6beeca692 Since we can't detect ghost drives in the wdc back-end, resurect
WDC_CAPABILITY_SINGLE_DRIVE.
2003-09-21 11:14:00 +00:00
nisimura
e17ee1fa3b Regen to fix the company name. 2003-09-21 07:59:04 +00:00
nisimura
54daa064f1 Fix the company name. It seems these days the company calls itself
"STMicroelectronics" anyway.
2003-09-21 07:45:13 +00:00
enami
893414b366 Make sure the message from pciide_chipen() starts at the beginning of line. 2003-09-20 22:46:02 +00:00
bouyer
d9ce986b70 Remove the "Register ghost test". It won't work, because on ATA register
of both devices are written, and device 0 will respond for device 1 if
device 1 isn't present. Pointed out by Quentin Garnier.
So the only way to know if device 1 is there or not is to send a command, which
is done later.
Detecting the second device here isn't important and won't speed up the probe.
We just need to know if there is at last one device on the bus.

Fix PR kern/22869 from Julio M. Merino Vidal.
2003-09-20 21:42:47 +00:00
jdolecek
ea7271519d regen - addition of KYE G-07 joystick entry
contributed in kern/22837 by Sergey Svishchev
2003-09-20 09:17:36 +00:00
jdolecek
63eb0e1ad8 add entry for KYE G-07 joystick
contributed in PR kern/22837 by Sergey Svishchev
2003-09-20 09:16:44 +00:00
christos
5508d7c9b8 print the name of the driver that found the ghost 2003-09-20 07:07:39 +00:00
enami
3144acc341 Now wdcattach() is called interrupts enabled, config_interrupts() tries to
call ata_raid_check_component() immediately, and panics since DMA setup
isn't done yet.  So, defer the call until attach stage is almost done.
Tested with Promise TX2000.
2003-09-20 02:19:36 +00:00
dyoung
28fe486c9f Allow channels 1-14 in MMK2, for real. Fixes PR 22530 from
FUKAUMI Naoki.
2003-09-20 01:03:30 +00:00
mycroft
d40837608f 1) Use config_interrupts() to attach IDE and ATAPI drives. This eliminates
most polling.
2) Clean up some goofiness in pciide -- get rid of the whole "candisable" path
   (it's gratuitous) and simplify the code by calling pciide_map_compat_intr(),
   *_set_modes() and wdc_print_modes() from central locations.
3) Add a register writability and register ghost test to eliminate phantom
   drives more quickly.
2003-09-19 21:35:56 +00:00
mycroft
e80260e91f Whoops, make sure 6-byte commands work again. 2003-09-18 06:55:53 +00:00
mycroft
f96fe2cc8a Don't print junk if an INQUIRY fails (usually with an ILLEGAL REQUEST due to
an unused LUN).  Also, if the qualifier says the LUN is non-existant, don't
try to attach a device here.
2003-09-18 05:06:53 +00:00
mycroft
9fa456e7b6 nluns should be 8, not 7. 2003-09-18 01:33:58 +00:00
mycroft
9dbb8c86d4 Merge the geometry and cache handling code for all direct access and optical
devices, as it's general to all SCSI MMC devices.  In the process, remove
PQUIRK_NO_FLEX_PAGE.
2003-09-18 00:06:31 +00:00
mycroft
e873dbd7ad If READ CAPACITY fails, try a READ FORMAT CAPACITIES. Separate this into
another function, always doing a page 0 MODE SENSE to get the block
descriptor if we use READ CAPACITY, and use SMS_DBD on the page 4/5 MODE
SENSE.  This does one extra command in some cases, but it separates and
simplifies the code a little.

Why do we prefer READ CAPACITY over READ FORMAT CAPACITIES?  Two reasons:
1) It's much older and is much less likely to have had its command code
abused, and is thus "safer" to try first.  2) ALL of my USB flash readers
and pen drives screw up their capacity descriptors -- mostly off-by-one
errors in the size (they return the maximum LBA number instead, a la READ
CAPACITY, which has *never* been how READ FORMAT CAPACITIES was documented
in the MMC spec), and one returns the "no media" code on slots that have
media inserted (despite returning almost-correct data otherwise)!

F*** me with a chainsaw.
2003-09-17 23:33:43 +00:00
mycroft
b2d9db1002 Remove PQUIRK_BYTE5_ZERO. 2003-09-17 19:14:56 +00:00
bouyer
65b0588afd Add back support for the legacy VT8237 IDE controller.
This wasn't an error, on this chipset we have the SATA controller on function
0 of the IDE controller, not the pcib bridge.
Fix provided by Stephen Degler.
2003-09-17 16:55:20 +00:00
drochner
b2a29ce0a3 typo in comment 2003-09-17 11:56:19 +00:00
mycroft
4b716264f7 Shuttle products do not need PQUIRK_NOTUR any more. Also removing them for the
other two items, since they are presumed unnecessary.
2003-09-17 07:49:11 +00:00
onoe
1a258bf241 Add Sony PEGA-WL110 CF WLAN 2003-09-16 08:28:55 +00:00
onoe
ac09f329a5 regen: Add Sony PEGA-WL110 CF WLAN 2003-09-16 08:27:33 +00:00
onoe
19cb1c084b Add Sony PEGA-WL110 CF WLAN 2003-09-16 08:26:37 +00:00
bouyer
e9a21b0707 Add support for Intel 82801EB Serial ATA. Not tested with a drive yet,
Matthias Scheler tested that the controller attaches properly.
2003-09-15 20:24:42 +00:00
bouyer
036c4d23c0 Add support for VIA 8237 Serial ATA. From Stephen Degler in kern/22727,
with some cleanup by me.
2003-09-15 20:15:44 +00:00
bouyer
9e1bd0b405 Regen: rename VT8237_RAID to VT8237_SATA 2003-09-15 19:51:09 +00:00
bouyer
4c46f960cc Rename VT8237_RAID to VT8237_SATA, as this is really what it is.
Suggested by Stephen Degler in kern/22727.
2003-09-15 19:50:45 +00:00
jmmv
99aaf4a240 Enable auvia_reset_codec's code and wait until the card is available.
Fixes 'invalid codec' problems (at least with AD1980).  Ok'ed by tsarna@.
2003-09-14 14:48:17 +00:00
junyoung
cc5534f795 Remove duplicate lines. 2003-09-14 13:01:40 +00:00
mycroft
10675507e9 Don't be silent if there is no media present. 2003-09-13 15:49:04 +00:00
mycroft
953ba0b251 Make sure the "raw partition" can always be opened again. 2003-09-13 14:44:50 +00:00
simonb
90fc39f5b8 Make some variables unsigned since that's the type of parameter they're
passed as to other functions.
2003-09-13 12:31:35 +00:00
jdolecek
a8cd2ca54c regen - fix description of one Intel PRO/100 VM variant, as reported
by Lars Heidieker on current-users@
2003-09-13 12:17:18 +00:00
simonb
a4852d80fc Remove an unreachable return statement (and fix a whitespace nit). 2003-09-13 12:17:12 +00:00
jdolecek
3a6c7eacfc fix description of Intel PRO/100 VM Network Controller with 82562ET/EZ PHY
don't activate any quirks for VM_6 variant
problem reported by Lars Heidieker on current-users

also don't activate any quirks for VM_3 - VM_5 variants, neither
VE_2 - VE_4, in anticipation that the more modern variants don't need
the quirks
2003-09-13 12:13:29 +00:00
jdolecek
a034152027 move dupfd from struct proc to struct lwp - it's per-LWP, not per-process; we
use curlwp where the lwp is not directly available, i.e. in device open
routines

briefly discussed on tech-kern
2003-09-13 08:32:10 +00:00
mycroft
09e452d82a Do the quirk initialization earlier. 2003-09-13 03:18:13 +00:00
mycroft
96b1a8d146 Arrange for the SCSI device to be target 0, and us to be the highest target
number.  This will make my life easier later...
2003-09-13 03:16:49 +00:00
mycroft
ec14ab4b89 The Ricoh power hackery is not reliable -- many cards just do not have the
voltage sense wired.  So, disable it and force the card to 5V by default.
Also, recode the hack to use the "direct Vcc" feature of the chip, letting
it manage the voltage directly, as this is supported on both the 296 and
396.
2003-09-12 22:09:04 +00:00
mycroft
509e3d9fce Set SCSIPI_CHAN_NOSETTLE. 2003-09-12 19:02:30 +00:00
mycroft
af0c320925 Some devices really want INQUIRY to be the first command they receive. Also,
the result of the extra TEST UNIT READY was being ignored anyway.  So, I wrote
it, I nuke it.
2003-09-12 16:39:25 +00:00
mycroft
8b05b0c1d3 In usbd_setup_pipe(), check the return value from usbd_clear_endpoint_stall(). 2003-09-12 16:22:57 +00:00
mycroft
af7e1b8144 Tweak a debugging printf(). 2003-09-12 16:18:08 +00:00
mycroft
6c1f753c7c ZIP drives don't need PQUIRK_NOTUR -- tested on both a 100 (by me) and a 250
(by gendalia).  The 100 seems to have another problem that I'm looking into.
2003-09-12 14:52:38 +00:00
ichiro
be42cc58d7 regen. 2003-09-11 11:34:46 +00:00
ichiro
7c4ee7e804 add product
Quatech Inc, PCMCIA Enhanced Parallel Port Card
2003-09-11 11:34:18 +00:00
jmmv
16091f0f1c After initialization of the AD1980 codec, swap master and surround volume
controls.  As it was before, the master volume control in all mixer programs
did nothing.  It seems that this codec is not correctly wired in (almost?)
all motherboards.

Patch by Quentin Garnier.  Fixes first part of PR kern/22548.
2003-09-11 09:21:29 +00:00
mycroft
dad4d4580d Update actlen even in the case where a TD returns an error -- this is critical
for the umass bulk-only STALL case.
2003-09-10 20:08:29 +00:00
uwe
f03574d68b G/c cs4231_round_buffersize and cs4231_round_blocksize. The round_*
mehtods are DMA-specific, so don't belong here in the first place.
SBus and EBus glue already changed to do the right thing.
2003-09-10 11:53:53 +00:00
uwe
a0a4638c6f Get rid of the disgusting struct apc_dma *dma = NULL; hack now that we
have proper definitions for offsets of APM DMA registers.

NULL out round_buffersize and round_blocksize in audio_hw_if.  We
don't seem to have any special requirements and audio(9) already
provides enough rounding.
2003-09-10 11:45:45 +00:00
uwe
725f80b71c Define APC DMA registers as offsets for bus space ops, so that we can
avoid linear mapping.  Actually, cs4231_sbus.c is already converted to
not use linear mapping of DMA registers, but it uses quick and
disgusting hack.
2003-09-10 11:37:13 +00:00
uwe
b3935a6934 Use EBDMA_BURST_SIZE_16. Introduce EBus specific round_blocksize to
make block size multiple of 16 words.  No point in using
round_buffersize that returns the argument unchanged, so just NULL it
in audio_hw_if.
2003-09-10 10:40:40 +00:00
augustss
efbfbb9402 Regen. 2003-09-10 06:54:40 +00:00
augustss
83c306df7e Add a couple of devices. 2003-09-10 06:52:27 +00:00
mycroft
2b919cb36a Mostly stylistic change, making comments and printf()s similar between BBB
and CBI.
2003-09-10 06:38:28 +00:00
mycroft
78435d869d Copyright maintenance. 2003-09-10 05:42:18 +00:00
mycroft
5118c3e1e9 Set up the blank fields in the INQUIRY buffer *before* executing the command --
because we can't really rely on the "additional length" being correct (any
more?).  Fixes some problems with devices showing up as "<, , >".
2003-09-10 05:35:50 +00:00
mycroft
ff7d94f5ec Er, missed one thing. 2003-09-10 05:30:15 +00:00
mycroft
9c39f1d6a5 Exorcise UMASS_QUIRK_FORCE_SHORT_INQUIRY. 2003-09-10 05:25:44 +00:00
briggs
7f9445d14a It is best to allow a little time for the reset to settle in before
we start polling the BMCR again.  Greg Woods noted on tech-net@
that the DP83840A manual states that there should be a 500us delay
between asserting software reset and attempting MII serial operations.

I've also noted that a DP83815 can get into a bad state on cable
removal and reinsertion if we do not delay here.

This may well address PR/16346, and I seem to recall occasional
reports of auto-negotiation and flaky kinds of errors that this
might also alleviate.
2003-09-10 05:25:22 +00:00
mycroft
2fe6c4d834 On a Bulk-In data stall, make sure we copy back the data received, per the
spec.  This is the real problem behind FORCE_SHORT_INQUIRY.
2003-09-10 05:20:21 +00:00
tls
ab54d7e94f Add support for jumbo (9K) frames. Add support for larger receive
descriptor sizes if larger mbuf clusters are in use -- currently
commented out because, for some reason, transmit doesn't work at
all with large mbuf cluster sizes.

Note that using actual 9K frames is a _lot_ less efficient than
using frames that are a little smaller than 8K so that they fit
in one or two pages (instead of two or three) and avoid the extra
chained descriptor with only 1K of data in it, too.  TCP will
segment things just fine for an 8K total packet size, just as it
does for 1500-byte packets.

On my system, using "mtu 8000" with ifconfig, I get an almost 50%
performance boost for TCP (930Mbit/sec instead of 660Mbit/sec) over
1500-byte frames.  "mtu 9000" yields only 770Mbit/sec.
2003-09-10 04:02:17 +00:00
mycroft
7bb5db4e3e The Sony camera reports itself as a "disk", not a "simplified direct access"
device -- ergo, it is "SCSI", not "RBC".
2003-09-10 03:13:53 +00:00
mycroft
b8fd3dab7d cc -pipe -ffreestanding -O2 -Werror -Wall -Wno-main -Wno-format-zero-length -Fix several problems with CCI handling, and enable it:
* We were never calling the callback function when we got a UFI CCI(!).
* We were passing a bogus residual count on non-UFI CCIs.
* After a REQUEST SENSE, the UFI CCI may include the ASC/ASCQ from the sense
  information -- don't consider this a failure.
In addition, remove a horrible hack that was causing us to drop sense
information on the floor and return empty INQUIRY responses, often in the case
where there is a UNIT ATTENTION pending during the INQUIRY.  (Some drives send
the data and then fail, some don't.)

This eliminates the need for quirks for the Y-E DATA FlashBuster.

These changes work on:

umass0: SAMSUNG SFD-321U [FW 0C], rev 1.10/2.10, addr 2
umass0: using UFI over CBI with CCI
sd0 at atapibus1 drive 0: <SMSC, USB FDC, 2.10> disk removable

umass0: TEAC TEAC FD-05PUB, rev 1.10/0.00, addr 2
umass0: using UFI over CBI with CCI
sd0 at atapibus0 drive 0: <TEAC, FD-05PUB, 1026> disk removable

umass0: Y-E DATA FlashBuster-U, rev 1.00/3.04, addr 2
umass0: using UFI over CBI with CCI
sd0 at atapibus0 drive 0: <Y-E DATA, USB-FDU, 3.04> disk removable
2003-09-10 02:49:18 +00:00
mycroft
3ce80fb07e Make similar changes as with cd_mode_{sense,select}(). 2003-09-09 06:32:14 +00:00
mycroft
f733d9708b Remove NOMODESENSE quirks for Iomega drives -- they're totally unneeded. 2003-09-09 03:57:57 +00:00
mycroft
1c4e2cf723 Delete the NOMODESENSE quirks for Maxtor USB hard drives, as these are no
doubt resolved (and were never actually needed in the first place -- someone
was let out without supervision).
2003-09-09 03:01:27 +00:00
mycroft
67ed54a25b In the test for whether to start the unit, I used the wrong error code.
ENODEV is only returned when we get "medium not present," which we can fail
immediately on.  All other "not ready" cases return EIO.
2003-09-09 02:43:34 +00:00
mycroft
06fca94595 Exorcise PQUIRK_NODOORLOCK. 2003-09-09 02:37:55 +00:00
mycroft
73b4a9d1ee PQUIRK_NODOORLOCK seems to be strictly unnecessary. If the drive doesn't
support it, we'll just get an ILLEGAL REQUEST and ignore it.  Furthermore,
on the PQI Travel Flash at least, it works just fine without.  These seem to
have been added in omnibus changes for particular devices, along with other
"quirks" that are now gone.  Adios, we won't cry for you.
2003-09-09 01:35:47 +00:00
mycroft
7365679351 Oops. Fix a typo in cd_mode_select(). 2003-09-08 23:44:29 +00:00
mycroft
ab5fff1eda Fix an error path where we might scsipi_prevent() on a non-removable device. 2003-09-08 23:43:35 +00:00
mycroft
5ad03464f5 There is absolutely no sense in having a PQUIRK_NODOORLOCK entry for a
non-removable device.  Nuke it.
2003-09-08 23:43:05 +00:00
mycroft
a599f64320 If maxlun>0, automatically set PQUIRK_FORCELUNS, rather than using quirk
table entries.
2003-09-08 19:57:29 +00:00
mycroft
de88b69b7b Remove UMASS_QUIRK_NO_START_STOP and UMASS_QUIRK_NO_MAX_LUN. 2003-09-08 19:30:59 +00:00
thorpej
baa2d09bad Fix a printf format. 2003-09-08 19:17:29 +00:00
thorpej
8faaed2240 Remove unused "skge" defns. 2003-09-08 18:59:48 +00:00
mycroft
648730c4cf Do a START UNIT only if the TEST UNIT READY reports that the device is not
ready.  This avoids gratuitously starting the motor on floppy and CD-ROM
drives, and eliminates the need for the audio playing test in cdopen().

Therefore, also remove PQUIRK_NOSTARTUNIT.
2003-09-08 18:51:33 +00:00
mycroft
2bfde7f903 Attempt to deal with Martin's weirdass Sun drive by setting the mode sense
allocation length a little more precisely -- add the space for the header in
cd_mode_sense().  Also delete the XS_CTL_SILENT, since we really do want to
see errors.

Lastly, add a similar wrapper for mode select, simplifying the callers
slightly.
2003-09-08 16:16:43 +00:00
tron
bab150d798 Regen. 2003-09-08 16:07:15 +00:00
tron
7a0eb6d14e Add quirk for Sandisk SDDR-86. The patch was supplied by Peter Seebach
in PR kern/22720.
2003-09-08 16:06:57 +00:00
kent
941d061f07 Correct flag names of AD1980 2003-09-08 13:58:21 +00:00
mycroft
a7155b9951 Rework sd_scsibus_get_parms() a little. Try to get a block descriptor even
if our other MODE SENSEs fail.  Use this code for the optical device case,
at least for now.  (We could query the optical media type and do a table
lookup for the geometry, but why bother?  Actually, why bother with geometry
at all, but I digress...)
2003-09-08 06:31:23 +00:00
mycroft
98ba1f5667 On further investigation... don't panic if we try to do a 6-byte mode
sense/select on ATAPI.  Some tape drives require it.  And who knows?  Some
fool might wire a RBC device to ATAPI.
2003-09-08 03:50:27 +00:00
mycroft
637a6554cf Perform the exorcism on scsipi_mode_select() too. 2003-09-08 03:33:31 +00:00
mycroft
4588667f28 Exorcise something evil and wrong in scsipi_mode_sense(). 2003-09-08 03:24:12 +00:00
mycroft
0239de4901 RBC devices do in fact requre using 6-byte MODE SENSE/SELECT. This is totally
the wrong way to deal with that, but... I'll get back to it later.
2003-09-08 03:09:09 +00:00
mycroft
f2a492ff6b Eliminate the separate ATAPI and SCSI attachments for "cd". 2003-09-08 01:56:33 +00:00
mycroft
5dd4bdd14c Use the const shaker. 2003-09-08 01:27:08 +00:00
mycroft
9203f63f67 We only need a single attachment for uk at scsibus and atapibus. 2003-09-08 01:26:41 +00:00
mycroft
cd456a7097 Nuke some printf()s. 2003-09-08 01:13:04 +00:00
mycroft
b6e043eed2 Set PQUIRK_ONLYBIG in the wdc-atapi frontend, obviating the need to ever test
the "bus type" for this.

Merge all the code in the SCSI and ATAPI backends for "cd" devices.  All of
the mode page handling and whatnot is general to SCSI MMC devices, and should
never have been separated to begin with.  This fixes a variety of problems,
and adds load/unload support for SCSI-attached devices.
2003-09-07 22:11:22 +00:00
tron
b0594a9271 Compile in the i845/i865 fallback attachment code only if generic AGP Intel
support is enabled.
2003-09-07 15:40:57 +00:00
tron
3c33a1ee2d If we fail to find the Integrated Graphics Device of an Intel i840 or
i865 chipset try the generic Intel AGP code because it is probably
a motherboard without onboard graphics.
2003-09-07 15:25:28 +00:00
kent
d10ee65a85 Codec id ADS 0x70 is AD1980, not AD1981.
http://mail-index.netbsd.org/tech-kern/2003/09/03/0005.html
2003-09-07 11:59:39 +00:00
kent
98f4ce5fd6 Use bitmask_snprintf() for printing ext id features. 2003-09-07 11:27:32 +00:00
tsutsui
71427b1eb1 Handle SROM quirk of tulip on Cobalt RAQ2. Fixes kern/20702. 2003-09-07 10:45:11 +00:00
isaki
515af69254 Delete strange ifdef x68k.
Requested by tsutsui@
2003-09-07 05:26:30 +00:00
isaki
bd7195dece Remove an advertising clause. 2003-09-07 04:24:05 +00:00
christos
5d43dc85d6 Rename the thread command name so that it fits on top's display. 2003-09-06 23:28:30 +00:00
mycroft
4d89e946a7 Some of the table entries are now noops. Remove them. 2003-09-05 11:24:56 +00:00
mycroft
61c35f890c Take vigilante action and remove all the NO_MAX_LUN, NOMODESENSE and
NOBIGMODESENSE "quirks".  These problems should be fixed without klugery
now.
2003-09-05 11:18:25 +00:00
mycroft
80605e4feb Use SMS_DBD in a several places to avoid even thinking about block descriptors. 2003-09-05 09:04:26 +00:00
mycroft
677da6684c Forgot to commit this. Add the "rpm" field to the flex geometry page. 2003-09-05 09:00:08 +00:00
tron
90ef1d5718 From FreeBSD as suggested by Nicolas Joly in PR kern/22682:
Do not initalize the LED's to 0x00.  The default configuration
the chip comes up in should yeild proper operation of the LED's.
2003-09-05 08:53:23 +00:00
mycroft
5c195383ca In addition to skipping a variable-length list of block descriptors, we also
have to adjust for whether he have a "small" or "large" mode sense response.

sd_scsibus_getcache(), sd_scsibus_setache(): Set SMS_DBD so that we don't
have to deal with block descriptors here.

sd_scsibus_mode_sense(): Add a new parameter, "int *big", which tells the
caller whether it's a small or large header.

sd_scsibus_get_parms(), sd_scsibus_getcache(), sd_scsibus_setcache(): Use
the "big" value to find the data following the mode sense header correctly.

sd_scsibus_mode_sense(): Disable PQUIRK_NOBIGMODESENSE for now, as the
reasons for it were dubious and most likely fixed now.

sd_scsibus_get_parms(): Now that we're actually locating the right data,
check the returned page code to see if it's correct before using the mode
page info.

sd_scsibus_get_parms(): Get the rotational rate from the flex geometry page
too, if present.

XXX sd_scsibus_get_{opt,simplifiedparms}() need some work.
2003-09-05 08:12:09 +00:00
itojun
891811de60 add DIAGNOSTIC check for AN_DEFAULT_xx 2003-09-05 05:38:44 +00:00
mycroft
a9e1f75ec7 Several changes to eliminate bogus controllers and sockets from being found:
PCIC_VENDOR_NONE: New.
PCIC_VENDOR_CIRRUS_*: Collapse the 2 chips into one vendor ID.

pcic_ident_ok(): Check the ID revision field -- if it's 0, punt.

pcic_vendor(): Check the ID revision field -- if it's 0, or the ID register
is all-1s, assume there is no chip present.  (Previously this would return
"Unknown controller" -- which, AFAICT, *never* resulted in a working device.)
Do the Cirrus check only after verifying that we got the Intel ID.

pcic_attach(): Use a priori knowledge of the Cirrus chips to determine the
number of sockets rather than trying (unsuccessfully) to probe.  Also, just
blast all of PCIC_INTR -- we do this in pcic_deactivate_card() anyway.
2003-09-05 01:02:51 +00:00
mycroft
8b228f0d42 sd_scsibus_get_parms():
* Use the "block descriptor length" to find the beginning of the mode page
  data.  This is critical, since some devices do not return a block descriptor
  at all.  (XXX There is disgusting structure hackery here.)
* Always use scsipi_size() (i.e. READ CAPACITY) to get the total disk size.
* Get the rotational rate from the rigid geometry page.
* Don't read the block size from the block descriptor if there was none.
* Get the block size from the flexible geometry page if possible.
* If we don't like the way page 4 smells, try page 5, rather than just punting.
2003-09-05 00:28:55 +00:00
thorpej
2f2b9c7cb0 GMII works on the i82543 now. 2003-09-04 19:32:19 +00:00
tsutsui
4189ddf652 Remove advertising clauses from code written by Shingo WATANABE.
He has kindly consented it.
2003-09-04 15:17:38 +00:00
mycroft
aea8e885f0 Cast a printf() arg so that USB_DEBUG compiles on multiple platforms. 2003-09-04 03:47:03 +00:00
mycroft
9bba9f60b6 Well, this is bloody obscure...
My Imation USB FlashGO! adapter responds to a Get Max Lun request with a
stall.  With uhci, this does the expected thing.  With ohci, it was returning
a "data underrun" error because we weren't setting "buffer rounding" (i.e.
USBD_SHORT_XFER_OK), and the underrun was taking priority.  This happened with
both the ohci in a Mac cube and the builtin ohci on the S3C2410.

So, set USBD_SHORT_XFER_OK on the Get Max Lun.  Now I get a stall reported and
umass attaches correctly.
2003-09-04 00:02:59 +00:00
simonb
553d2b901f Add missing semicolon. 2003-09-03 13:05:50 +00:00
mycroft
3713dfb05b Fix another place where we blasted PCIC_INTR_ENABLE. 2003-09-03 01:33:23 +00:00
mycroft
55ff1b2294 If the frontend passes in sc->irq=0, set PCIC_INTR_ENABLE. Also, don't clear
that bit all over the bloody place
2003-09-02 22:44:08 +00:00
fvdl
4458cfede6 * Make the ahc and ahd probes more alike.
* Remove some redundant code.
* ahd: Don't initiate negotiation for a discovery xs when the negotiation goal
  is set. Just looking at the auto_negotiate mask is enough, and it can
  cause an endless loop if the request gets requeued (happens with a
  of a PPR negotiation, which ends with a busfree).
2003-09-02 21:02:56 +00:00
fvdl
b9fcb05e95 Make this less chatty on probe/attach, to match the output of other controllers. 2003-09-02 20:59:51 +00:00
ichiro
867de3d367 add support IO-DATA PCET/TX-R EthernetCard 2003-09-02 12:43:02 +00:00
christos
b7510d87e5 fix debugging printfs 2003-09-01 16:44:03 +00:00
tls
48e67d1d60 Revert previous change, which was wrong. As Enami points out, we really do
want the NO_ESTIMATE flag here, because if the source doesn't have it,
rnd_add_data will *use the time the data was added directly as entropy*,
which is not a good idea either for a hardware RNG that works like this
one (periodically polled by the driver) or, really, like any other that I've
seen, because even for "interrupt when ready" RNGs the data rate (and thus
interrupt time) will vary only slightly for a given RNG configuration over
time, if at all.

The data we add _is_ counted into the pool estimage because we directly
pass in an entropy estimate.

The overloading of the NO_ESTIMATE flag with this meaning seems, to me, like
a design bug (albeit easily fixed) in the rng interface; but until that's
changed, we need to use it here.
2003-09-01 06:30:24 +00:00
uwe
f7c1e9b8e5 Comment change only, the ioctl is WSDISPLAYIO_PUTCMAP, not ..._SETCMAP.
The function is called igsfb_set_cmap() to follow the get/set/update
naming convention.
2003-08-31 14:41:15 +00:00
ragge
a808d6e157 Add stop routine. Add support for turning the device into promiscous mode.
Force interrupt in probe so that the interrupt vector can be detected.
2003-08-31 11:13:43 +00:00
gson
144519b826 The unit displayed when printing battery capacities and
charge/discharge rates was incorrect - the value printed is actually
in A, W, Ah, or Wh, not in mA, mW, mAh, or mWh (assuming as we must
that the period is interpreted as a decimal point, not a thousands
separator).
2003-08-31 01:36:12 +00:00
jdolecek
62614dd63a Add sk as the PCI SysKonnect driver 2003-08-30 21:41:19 +00:00
ragge
a936bbd778 bus-ify. Make bpf work, but no promiscuous mode yet. 2003-08-29 14:39:28 +00:00
ragge
b61c0451e0 The qt driver must be probed first, so that the qe driver is skipped
if it is a qt card.
2003-08-29 13:50:45 +00:00
ragge
cd72141286 Make the qt driver work under NetBSD. Still to do:
- bus-ify.
- bpf support.
- multicast support.
2003-08-29 13:49:39 +00:00
thorpej
a228727423 Apply the following change from 06/28/2003 04:46:54 by gibbs to the
FreeBSD ahd driver:

Fix a race condition in the flushing of commands that
have completed across the bus but not to the host before
processing of an exception condition (busfree, bus reset,
etc.).  When flushing the controller of completed commands,
we also look for packetized commands that have completed
with good status and are stored in the "good status fifo".
The hardware will post to the good status fifo even if
data for that command is still active in a FIFO.  In
one particular failure case, a command outstanding on the
bus reconnected, transferred data into a FIFO, and provided
good status while the host driver was processing an expected
busfree event (PPR message negotiation).  This resulted in
an entry in the good status fifo that we completed, but
since the sequencer was paused, the data in the data FIFO
for this command had never been transferred to the host.
Once the busfree processing was complete, the sequencer
was unpaused, and the data completed its transfer to the
host.  In some instances, the client for the data was notified
of the completion and attempted to view the data before
it arrived.  This case only occurred during FreeBSD's
multi-target probe of the SCSI bus while some devices are
negotiating to go packetized and some devices are already
running in packetized.

The fix is to run and FIFOs active with a context in the
good status fifo to completion before completing the command
to the SCSI layer.  This requies duplicating the FIFO rundown
operations in the host driver that would usually be handled
by the firmware, but there is no other alternative.

Don't blindly shutdown the SCB dma engine when restarting
the sequencer.  We may be killing an operation that is
not supposed to be cancelled.  The cases where we need to
shutdown these dma engines are already handled elsewhere in
the driver.

Fix a few more ahd_in?() -> ahd_in?_scbram() instances.
2003-08-29 05:50:42 +00:00
thorpej
efefe51428 Apply the following change from 06/28/2003 04:43:19 by gibbs to the
FreeBSD ahd driver:

Implement ahd_inq_scbram() and change the implemention
of ahd_inl_scbram to use ahd_inw_scbram instead of
ahd_inb_scbram().
2003-08-29 05:48:39 +00:00
thorpej
478ae1fc6e Apply the following change from 06/28/2003 04:45:25 by gibbs to the
FreeBSD ahd driver:

aic79xx.h:
	Add softc flag to indicate that we have seen at
	least one selection since the last bus reset or
	SE/LVD bus change.

aic79xx.c:
	Fix a few style nits.

	In ahd_update_pending_scbs(), only touch card registers
	once we have found an SCB that needs to be updated.
	This removes lots of clutter from PCI traces taken of
	error recovery performed by the driver.

	Short circuit the first selection iocell workaround handler
	if we've run once since the last bus reset or iocell change.
	This also removes clutter from PCI traces.

	Note if completions are pending in the qoutfifo when we dump
	card state.
2003-08-29 04:50:00 +00:00
thorpej
56ebfcc6d5 Apply the following change from 06/28/2003 04:42:11 by gibbs to the
FreeBSD ahd driver:

Correct a typo in a comment.

Add a comment in ahd_clear_critical_sections() about
our need to leave ENBUSFREE set in SIMODE1 while single
stepping.

Re-arrange some delay loops so that we always perform
a read after any register write and before the delay.
This should make the delay loop more accurate.

When completing message processing for a packetized
commention, return the controller to a state where
invalid non-packetized phases will still cause protocol
violations.  These are the same operations as those
performed in the clear_target_state routine in the
firmware.

Now that we have a chip with working ABORTPENDING
support (the 7901B), comment out the automatic use
of this feature until we can adequately test it.
The previous checkin updated the bug mask for the
7901B so this code was exercised.

When resetting the bus, perform an ahd_flush_device_writes()
call so that our reset assertion delay is acurately
timed from when the reset bit is written to the controller.
2003-08-29 04:38:07 +00:00
thorpej
7dbbf20851 Apply the following change from 06/28/2003 04:39:49 by gibbs to the
FreeBSD ahd driver:

aic79xx.h:
        Add a 7901A specific feature definition.

aic79xx_pci.c:
        Split out the general aic790X setup into it's own
        setup handler that works on single and dual controllers.
        Adjust all other PCI setup handlers to initialize the
        chips basic features and type before calling the generic
        handler.

        Turn off a few Rev B workarounds that are not required
        on the 7901B.
2003-08-29 04:17:39 +00:00
thorpej
3c41dc5921 Apply the following change from 07-23-2003 22:06:34 by gibbs to the
FreeBSD ahd driver:

Add parenthesis so that we get all of the bits all
of the contents of the CCSCBCTL register into our
local varaible.  The other bits are used in later tests.
This avoids a potential deadlock in ahd_run_qoutfifo()
if we happen to catch the DMA engine in just the right
state.
2003-08-29 04:03:09 +00:00
thorpej
c658309f7e Apply the following change from 07/06/2003 23:53:39 by gibbs to the
FreeBSD ahd driver:

When single stepping, only leave ENBUSFREE enabled
if it was already enabled.  We don't want to set it
when it shouldn't be set, we just don't want to
inadvertantly turn it off.  This should fix a recent
report of the aic7xxx driver repeatedly complaining of
"unexpected busfree while idle" in one configuration.
2003-08-29 04:00:35 +00:00
thorpej
ecffeb2eeb Apply the following change from 06/28/2003 04:44:10 by gibbs to the
FreeBSD ahd driver:

Use clr instead of an explicit mov from ALLZEROS
to clear SCB_FIFO_USE_COUNT.  This is just a
syntactic change.
2003-08-29 03:54:06 +00:00
thorpej
e5d09ce27d Apply the following change from 06/28/2003 04:40:46 made by gibbs to the
FreeBSD ahd driver:

aic79xx.seq:
        Remove an old comment that no longer applies.

        Fix a jump in our unexpected non-packetized phase
        handler to use an explicit lable.  The old code
        had a hardcoded jump offset that was off by one
        instruction.
2003-08-29 03:51:50 +00:00
thorpej
93cbf1d88e Sync perforce IDs. (From FreeBSD) 2003-08-29 03:45:59 +00:00
thorpej
720b377380 Apply the following change made 06/06/2003 23:51:13 by gibbs to the
FreeBSD ahd driver:

Work around SCSI spec violation by the Quantum Atlas 10K.
This drive delays going async after receiving a WDTR
message.  We now send an SDTR message after a WDTR even
if our goal is to go async.  This should work even for
confused devices.

If we get an unexpected busfree when attempting a WDTR
or SDTR, only set the goal negotiation parameters we were
trying to negotiate to off.  This means that should a WDTR
message fail, we will still try an SDTR if our goal is
non-async.

Fix a few more places where we were looking at goal.period
instead of goal.offset for determining if we should be
negotiating sync.  This should not have any impact on
our behavior, but the offset is more definitive and should
be used.
2003-08-29 03:41:28 +00:00
thorpej
6336835ec0 Apply the following change from 05/30/2003 02:14:22 made by scottl to the
FreeBSD ahd driver:

Fix a reported case of severe data corruption:

aic79xx.h:
aic79xx.reg:
        Return the SCB_TAG field to 16byte alignment.
        It seems that on some PCI systems, SCBs are not
        transferred correctly to the controller with
        the previous placement of the SCB_TAG field.

Approved by:    re (rwatson)
2003-08-29 03:17:14 +00:00
thorpej
20b90609de Apply the following change from 5/26/2003 21:15:52 made by gibbs to the
FreeBSD ahd driver:

Add 7901B support.

Sort IDs based on chip type.

Remove IROC IDs.  We'll switch to using the IROC masks
if/when we want to start attaching to IROC controllers.

Approved by: RE
2003-08-29 02:59:20 +00:00
isaki
05e2e8b5b9 Delete unnecessary #ifndef for x68k.
approved by tsutsui@
2003-08-29 02:45:57 +00:00
thorpej
34f28afa21 Apply the following change from 6/6/2003 23:48:18 by gibbs to the
FreeBSD ahd driver:

aic7770.c:
aic79xx.c:
aic79xx.h:
aic79xx_pci.c:
aic7xxx.c:
aic7xxx.h:
aic7xxx_pci.c:
	Switch ah?_reset() to take an additional "reinit" argument.
	Use this instead of init_level to determin if the chip
	should be fully reinitialized after a chip reset.  This
	is required so that ah?_shutdown() can reset the chip
	without side-effects.
2003-08-29 02:38:58 +00:00
thorpej
e05d84a35a Update FreeBSD RCS ID for last. 2003-08-29 02:18:16 +00:00
thorpej
88ac7e4d52 Apply the following change from 5/30/2003 02:15:15 made by scottl to the
FreeBSD ahd driver:

aic79xx.c:
	Use the special LUNLEN_SINGLE_LEVEL constant for
	post Rev A4 hardware for single byte luns.  Without
	this change, Rev B hardware would place the single
	byte of lun data in byte 0 of the lun structure when
	it should be in byte 1.  Since there are few if any
	devices on the market that support multiple luns in
	target mode, the corrupted lun field (which was only
	corrupted for non-zero luns) wasn't hurting us.

Approved by: re	(rwatson)
2003-08-29 01:58:32 +00:00
thorpej
6095f5f091 Add some missing definitions for the LUNLEN register. 2003-08-29 01:52:16 +00:00
thorpej
d8ede84c0f Apply the following change made on 5/26/2003 21:43:29 by gibbs to the
FreeBSD ahd driver:

aic79xx.c:
aic79xx_osm.h:
aic7xxx_osm.h:
	Explicitly define functions that take no arguments
	with "(void)"

Approved by: RE
2003-08-29 01:37:11 +00:00
thorpej
3dd1bba4c4 Apply the following change made on 5/26/2003 21:26:51 by gibbs to the
FreeBSD ahd driver:

Correct/Simplify ignore wide residue message handling

aic79xx.c:
	In ahd_handle_ign_wide_residue():
	o Use SCB_XFERLEN_ODD SCB field to determine transfer
	  "oddness" rather than the DATA_COUNT_ODD logic.
	  SCB_XFERLEN_ODD is toggled on every ignore wide
	  residue message so that multiple ignore wide residue
	  messages for the same transaction are properly supported.
	o If the sg list has been exausted, the sequencer
	  doesn't bother to update the residual data count
	  since it is known to be zero.  Perform the zeroing
	  manually before calculating the remaining data count.
	o Use multibyte in/out macros instead of shifting/masking
	  by hand.

aic79xx_inline.h:
	In ahd_setup_scb_common(), setup the SCB_XFERLEN_ODD field.

aic79xx.reg:
	Use the SCB_TASK_ATTRIBUTE field as a bit field in the
	non-packetized case.  We currently only define one bit,
	SCB_XFERLEN_ODD.

	Remove the ODD_SEG bit field that was used to carry the odd
	transfer length information through the SG cache.  This
	is obviated by SCB_XFERLEN_ODD field.

	Remove the DATA_COUNT_ODD scratch ram byte that was used
	dynamicaly compute data transfer oddness.  This is obviated
	by SCB_XFERLEN_ODD field.

aic79xx.seq:
	Remove all updates to the DATA_COUNT_ODD scratch ram field.
	Remove all uses of ODD_SEG.  These two save quite a few
	sequencer instructions.

	Use SCB_XFERLEN_ODD to validate the end of transfer
	ignore wide residue message case.
2003-08-29 01:28:51 +00:00
thorpej
1109945598 Apply the following change made 5/26/2003 21:18:48 by gibbs to the
FreeBSD ahd driver:

Change hadling of the Rev. A packetized lun output bug
to be more efficient by having the sequencer copy the
single byte of valid lun data into the long lun field.

aic79xx.c:
	Memset our hardware SCB to 0 so that untouched
	fields don't confuse diagnostic output.  With the
	old method for handling the Rev A bug, if the long
	lun field was not 0, this could result in bogus
	lun information being sent to drives.

	Use the same SCB transfer size for all chip types
	now that the long lun is not DMA'ed to the chip.

aic79xx.seq:
	Add code to copy lun information for Rev.A hardware.

aic79xx_inline.h:
	Remove host update of the long_lun field on every
	packetized command.
2003-08-29 00:46:05 +00:00
thorpej
e88c8722b7 Apply the following change checked in 2003/05/04 00:20:07 by gibbs
to the FreeBSD ahd driver:

Correct spelling errors.

Switch to handling bad SCSI status as a sequencer interrupt
instead of having the kernel proccess these failures via
the completion queue.  This is done because:

 o The old scheme required us to pause the sequencer and clear
   critical sections for each SCB.  It seems that these pause
   actions, if coincident with a sequencer FIFO interrupt, would
   result in a FIFO interrupt getting lost or directing to the
   wrong FIFO.  This caused hangs when the driver was stressed
   under high "queue full" loads.
 o The completion code assumed that it was always called with
   the sequencer running.  This may not be the case in timeout
   processing where completions occur manually via
   ahd_pause_and_flushwork().
 o With this scheme, the extra expense of clearing critical
   sections is avoided since the sequencer will only self pause
   once all pending selections have cleared and it is not in
   a critical section.

  aic79xx.c
        Add code to handle the new BAD_SCB_STATUS sequencer
        interrupt code.  This just redirects the SCB through
        the already existing ahd_complete_scb() code path.
        Remove code in ahd_handle_scsi_status() that paused
        the sequencer, made sure that no selections where
        pending, and cleared critical sections.  Bad
        status SCBs are now only processed when all of these
        conditions are true.

  aic79xx.reg:
        Add the BAD_SCB_STATUS sequencer interrupt code.

  aic79xx.seq:
        When completing an SCB upload to the host, if
        we are doing this because the SCB contains non-zero
        SCSI status, defer completing the SCB until there
        are no pending selection events.  When completing
        these SCBs, use the new BAD_SCB_STATUS sequencer
        interrupt.  For all other uploaded SCBs (currently
        only for underruns), the SCB is completed via the
        normal done queue.  Additionally, keep the SCB that
        is currently being uploaded on the COMPLETE_DMA_SCB
        list until the dma is completed, not just until the
        DMA is started.  This ensures that the DMA is restarted
        properly should the host disable the DMA transfer for
        some reason.

        In our RevA workaround for Maxtor drives, guard against
        the host pausing us while trying to pause I/O until the
        first data-valid REQ by clearing the current snapshot
        so that we can tell if the transfer has completed prior
        to us noticing the REQINIT status.

        In cfg4data_intr, shave off an instruction before getting
        the data path running by adding an entrypoint to the
        overrun handler to also increment the FIFO use count.

        In the overrun handler, be sure to clear our LONGJMP
        address in both exit paths.

Perform a few sequencer optimizations.

  aic79xx.c:
        Print the full path from the SCB when a packetized
        status overrun occurs.

        Remove references to LONGJMP_SCB which is being
        removed from firmware usage.

        Print the new SCB_FIFO_USE_COUNT field in the
        per-SCB section of ahd_dump_card_state().  The
        SCB_TAG field is now re-used by the sequencer,
        so it no longer makes sense to reference this
        field in the kernel driver.

  aic79xx.h:
        Re-arrange fields in the hardware SCB from largest
        size type to smallest.  This makes it easier to
        move fields without changing field alignment.

        The hardware scb tag field is now down near the
        "spare" portion of the SCB to facilitate reuse
        by the sequencer.

  aic79xx.reg:
        Remove LONGJMP_ADDR.

        Rearrange SCB fields to match aic79xx.h.
        Add SCB_FIFO_USE_COUNT as the first byte
        of the SCB_TAG field.

  aic79xx.seq:
        Add a per-SCB "Fifos in use count" field and use
        it to determine when it is safe (all data posted)
        to deliver status back to the host.  The old method
        involved polling one or both FIFOs to verify that
        the current task did not have pending data.  This
        makes running down the GSFIFO very cheap, so we
        will empty the GSFIFO in one idle loop pass in
        all cases.

        Use this simplification of the completion process
        to prune down the data FIFO teardown sequencer for
        packetized transfers.  Much more code is now shared
        between the data residual and transfer complete cases.

        Correct some issues in the packetized status handler.
        It used to be possible to CLRCHN our FIFO before status
        had fully transferred to the host.  We also failed to
        handle NONPACKREQ phases that could occur should a CRC
        error occur during transmission of the status data packet.

Correct a few big endian issues:

  aic79xx.c:
  aic79xx_inline.h:
  aic79xx_pci.c:
  aic79xx_osm.c:
        o Always get the SCB's tag via the SCB_GET_TAG acccessor
        o Add missing use of byte swapping macros when touching
          hscb fields.
        o Don't double swap SEEPROM data when it is printed.
          Correct a big-endian bug.  We cannot assign a
        o When assigning a 32bit LE variable to a 64bit LE
          variable, we must be explict about how the words
          of the 64bit LE variable are initialized.  Cast to
          (uint32_t*) to do this.

aic79xx.c:
        In ahd_clear_critical_section(), hit CRLSCSIINT
        after restoring the interrupt masks to avoid what
        appears to be a glitch on SCSIINT.  Any real SCSIINT
        status will be persistent and will immidiately
        reset SCSIINT.  This clear should only get rid of
        spurious SCSIINTs.

        This glitch was the cause of the "Unexpected PKT busfree"
        status that occurred under high queue full loads

        Call ahd_fini_scbdata() after shutdown so that
        any ahd_chip_init() routine that might access
        SCB data will not access free'd memory.

        Reset the bus on an IOERR since the chip doesn't
        seem to reset to the new voltage level without
        this.
        Change offset calculation for scatter gather maps
        so that the calculation is correct if an integral
        multiple of sg lists does not fit in the allocation
        size.

        Adjust bus dma tag for data buffers based on 39BIT
        addressing flag in our softc.

        Use the QFREEZE count to simplify ahd_pause_and_flushworkd().
        We can thus rely on the sequencer eventually clearing ENSELO.

        In ahd_abort_scbs(), fix a bug that could potentially
        corrupt sequencer state.  The saved SCB was being
        restored in the SCSI mode instead of the saved mode.
        It turns out that the SCB did not need to be saved at all
        as the scbptr is already restored by all subroutines
        called during this function that modify that register.

aic79xx.c:
aic79xx.h:
aic79xx_pci.c:
        Add support for parsing the seeprom vital product
        data.  The VPD data are currently unused.

aic79xx.h:
aic79xx.seq:
aic79xx_pci.c:
        Add a firmware workaround to make the LED blink
        brighter during packetized operations on the H2A.

aic79xx_inline.h:
        The host does not use timer interrupts, so don't
        gate our decision on whether or not to unpause
        the sequencer on whether or not a timer interrupt
        is pending.
2003-08-29 00:09:59 +00:00
thorpej
f3552c7ce0 Make sure we consistently report DT when sending an xfer mode async event. 2003-08-28 22:16:01 +00:00
thorpej
7ac69b3354 * Make matching and chip info table-driven.
* Print product name and revision at attach time.
* Use aprint_*().
2003-08-28 19:00:52 +00:00
thorpej
a81f6a99c2 Remove an unnececssary PCI config read. 2003-08-28 18:13:33 +00:00