Commit Graph

3548 Commits

Author SHA1 Message Date
mycroft 3741fa9860 Kill another bogus initializer. 2003-10-28 22:22:28 +00:00
matt ebe74b9e7f fix bogus GCC uninitialized variable warning. Use TAILQ_FOREACH. 2003-10-28 18:35:06 +00:00
christos 05f07448b6 Another possibly uninitialized lasttx 2003-10-26 19:11:33 +00:00
christos 93af726cde Don't return random garbage in the default case; return the smallest ring
descriptor instead.
2003-10-26 18:20:43 +00:00
fvdl e645b8b032 Add definitions for 8139C+ and 8169 chips. Not used yet. From FreeBSD. 2003-10-25 23:48:45 +00:00
christos 9269644881 Fix uninitialized variable warning. 2003-10-25 21:33:04 +00:00
christos d2705ee1d2 make this compile again. I should really rename the FreeBSD KASSERT to
KASSERT2 or something.
2003-10-25 21:32:44 +00:00
christos 987510aee5 KASSERT takes 2 arguments here. 2003-10-25 19:41:44 +00:00
christos b3ae88ff5d Fix uninitialized variable warning. 2003-10-25 19:12:08 +00:00
christos 8bfd5e3292 Fix uninitialized variable warnings 2003-10-25 18:34:14 +00:00
simonb 7e135f3a2e Make this compile with older gcc. 2003-10-25 13:45:07 +00:00
christos 21027e6048 more uninitialized variables 2003-10-25 08:37:00 +00:00
christos 551bd8b829 fix uninitialized variables 2003-10-25 08:30:46 +00:00
mycroft f253f37fb0 In wi_newstate(), read the BSSID into a temporary buffer that has guaranteed
alignment.  Fixes a really obscure failure mode on Alpha, and panics on other
machines.
2003-10-24 23:58:22 +00:00
briggs 7dc8540d52 Avoid a race condition that could allow a removable controller (such as
a compact flash card) to lock the atabus thread if it gets detached during
the probe process.
2003-10-22 23:59:00 +00:00
christos ddccf85c50 support for NE2000_TYPE_AX88790 from
Yong-Jhen Hong yongjhen at alqualonde dot org
2003-10-22 00:12:36 +00:00
simonb 7feb1a91fa Remove return after panic(). 2003-10-21 06:22:16 +00:00
yamt 65995a9aa2 don't swap powerhook and shutdownhook. 2003-10-21 01:00:57 +00:00
fvdl 5f1e7fa5f8 Correct NULL abuse. 2003-10-21 00:57:47 +00:00
fvdl 86c363960e Correct NULL abuse. 2003-10-21 00:25:59 +00:00
dyoung ab4a574ce1 Don't take the 802.11 header off of a frame until after we've given
it to the driver's BPF tap.
2003-10-19 22:00:54 +00:00
simonb 9833c17169 Remove some unreachable code with the comment "To shut up compiler"
that neither gcc 2.95.3 or 3.3.1 complains about if that bit of code
is missing...
2003-10-19 01:49:03 +00:00
simonb 59fb31d7cc Remove unreachable break after return and goto statements. 2003-10-19 01:44:48 +00:00
tsutsui fd5c63296f Fix some attach messages for new ahc(4). 2003-10-18 07:44:51 +00:00
dyoung 5dca575ce1 ieee80211_newstate() wants for ic->ic_state to equal the previous
state, so do not update ic->ic_state in wi_newstate() before calling
ieee80211_newstate(). Instead, update ic->ic_state when we do not
let ieee80211_newstate() run.
2003-10-17 03:58:23 +00:00
dyoung d531221c67 Prepare for wi rate adaptation. Add wi_write_txrate, which only
writes a hardware register when the data rate selection actually
changes. Add wi_cfg_txrate, which writes the data rate selection
regardless.

Name some fields in the wi Tx buffer which we will use for rate
adaptation.

Name the Prism "Alternate Retry Count" RID, WI_RID_ALT_RETRY_COUNT.
2003-10-16 10:57:35 +00:00
dyoung 50daf0a217 The upper & lower bounds on wi RSSI are completely bogus, AFAICT. 2003-10-16 10:38:07 +00:00
dyoung 7c0b454d52 Cosmetic change: shorten 6 lines to 2. 2003-10-16 10:04:14 +00:00
dyoung 1ff3c191c9 Fix WEP transmission, too. From FreeBSD/Sam Leffler. 2003-10-16 09:31:08 +00:00
dyoung bcde77e394 ath(4) failed to detect when the number of DMA segments exceeded
the number of descriptors, because of a disparity between the
bus_dmamap_load_mbuf implementation in FreeBSD and NetBSD. Now I
cover up the difference using ath_dmamap_load_mbuf.

Thanks Enami Tsugutomo for diagnosing this.
2003-10-16 09:13:30 +00:00
ichiro 581dfca276 add {shutdownhook,powerhook}disestablish() 2003-10-16 07:55:18 +00:00
itojun a4a1466cb5 add $NetBSD$ 2003-10-15 23:23:39 +00:00
enami 73473f6883 Return 0 on SIOC{ADD,DEL}MULTI. 2003-10-15 22:41:22 +00:00
itojun d587f445de s/printf/DPRINTF/ for ath_rate_ctl() 2003-10-15 22:19:31 +00:00
bouyer 70b50b0608 Make sure chp->atabus is initialised, and wakeup the right address when
shutting down the kernel thread.
2003-10-15 20:29:26 +00:00
bouyer ea6912c52d - don't ignore last bit when checking for floating bus value on slave
device; some ATAPI devices as master will report 0x7f in all registers
  for slave before reset
- For the same reason, remove the er1 check.
Makes slave device with a "strange" ATAPI master probe again.
Problem reported and fix tested by Gary Duzan on current-users.
2003-10-15 20:26:33 +00:00
bouyer 3d6919754d Clear chp->ch_drive[i].drive_flags if we didn't find a driver for the
drive.
2003-10-15 19:54:30 +00:00
dyoung e86c830f2a Fix WEP reception. 2003-10-15 11:40:07 +00:00
simonb 662c7128cd Re-order a little so that there's no unreachable code in this block. 2003-10-15 07:18:17 +00:00
enami 8823a8da9a Port multicast handling to NetBSD. Addresses PR23151. 2003-10-15 03:04:03 +00:00
dyoung f2a9708c75 Do not index arrays using enum constants, since enums can be
re-ordered and extended. Instead, use a switch-statement or a
key->value table with appropriate bounds-checking.
2003-10-14 23:13:44 +00:00
ichiro f4f7b1ae5c add support ath on cardbus
- implement power management
2003-10-14 17:47:03 +00:00
dyoung 031c2c9baa Why don't I make up my mind? No need to left-shift the country
codes when I right-shift the country-code register! Fixes a bug
reported by Dan Carosone: regulatory domain "ETSI" registered as
domain "Spain/Other", so he could only tune channels 10 and 11.
2003-10-13 16:35:49 +00:00
dyoung 2295b27590 Install athioctl.h, defining ioctls for Atheros 802.11a/b/g radios. 2003-10-13 08:29:48 +00:00
dyoung 372fd2b92a Adapt atw(4) to the new 802.11 layer.
Simplify atw_start, atw_newstate.

Synchronize access to atw_start by bracketing the call to
ieee80211_next_scan in atw_next_scan with splnet()/splx().
2003-10-13 08:22:19 +00:00
dyoung e31cc884ed Adapt awi(4) to the new 802.11 layer. 2003-10-13 08:10:48 +00:00
dyoung ef743c64b6 Switch wi(4) to the new 802.11 layer. 2003-10-13 08:07:21 +00:00
dyoung 2459b02669 Switch an(4) to using the header files in the new 802.11 layer. 2003-10-13 06:45:32 +00:00
dyoung a71225fe22 NetBSD/FreeBSD compatibility changes NetBSD, especially
locking, mbuf
2003-10-13 05:34:30 +00:00
dyoung ae577fc6ea Miscellaneous changes for NetBSD compatibility. 2003-10-13 05:23:07 +00:00
dyoung b495f27bbd A compatibility layer to smooth differences between NetBSD and
FreeBSD for ath(4).

XXX    Nobody with FreeBSD has signed off on this, so it may change
XXX    or go away entirely.
2003-10-13 05:16:20 +00:00
bouyer c298ea9fc9 Remove block that has been pasted twice. Pointed out by Alexander Yurchenko. 2003-10-12 19:28:50 +00:00
fvdl 7a26a8b8f5 Don't zap the lower 16 bits of the command/status register when clear
error bits.
2003-10-10 15:15:44 +00:00
briggs 85edb66218 Properly clear any latched errors before re-enabling SERR/PERR for PCI-X
in ahd_reset().
2003-10-10 15:02:08 +00:00
bouyer 0ea3fa883e Remove the check for WAIT+POLL+READ case in __wdccommand_start(),
this case is already handled in __wdccommand_intr().
Pointed out by Charles M. Hannum.
2003-10-09 18:40:19 +00:00
bouyer 7719e83c8b Following Matt Thomas's request, rename ata attribute to ata_hl, and
wdc_base to ata. We can now have
atabus* at ata?
in kernel config files.
2003-10-08 20:57:59 +00:00
pk ded7383371 In isp_fc_worker() reduce the timeout value used to poll for the link
status from 10 seconds to 250 milli seconds for the second and subsequent
attempts to determine the link status. This prevents unnecessary long
stalls after the device attach routines have completed.

Tested on a dual port QLogic 3212.  Approved by mjacob@feral.com.
2003-10-08 19:51:01 +00:00
fvdl 61834e8959 Cap the transfer size at MAXPHYS, the driver won't get bigger requests
than that. Allocating 16M per SCB is silly (as pointed out by
Frederick Bruckman).
2003-10-08 17:38:31 +00:00
bouyer 99d6009c2a Make the ATA mid-layer appears as atabus, as proposed in
http://mail-index.netbsd.org/tech-kern/2003/09/25/0006.html
This adds a device (atabus) between IDE controllers and wd or atapibus, to
have each ATA channel show up in the device tree. Later there will be atabus
devices in /dev, so that we can do IOCTL on them.
Each atabus has its own kernel thread, to handle operations that needs polling,
e.g. reset and others.

Device probing on each bus it defered to the atabus thread creation.
This allows to do the reset and basic device probes in parallel, which reduce
boot time on systems with several pciide controllers.
2003-10-08 10:58:12 +00:00
mycroft 32856df936 We really don't need to do 2 resets in wdc_channel_attach() -- the one done
by wdcprobe() is enough.
2003-10-08 08:47:58 +00:00
fvdl f4f3bc1663 OR in ahc->sc_dmaflags when passed to bus_dmamap_create() in ahc_alloc_scbs(),
in order to pass _ISADMA_32BIT if needed. Should fix SCB allocation
failure for 2842 VL cards.
2003-10-07 19:11:13 +00:00
martin 9e16642238 Adapt to recent PRI changes. 2003-10-07 19:02:36 +00:00
dyoung c3139592cc Initial import of ath(4) from FreeBSD. 2003-10-07 05:27:17 +00:00
bouyer 3e1a342dd1 Revert to polling for ata_get_params() in wdc_channel_attach().
When probing a nonexistent slave, we may timeout waiting for an interrupt.
In __wdccommand_start(), for polled data in commands, abort quickly if
status still read 0 after 400ns (for a nonexistant slave, the
command will either be aborted, or the status register will report 0; for
a real device we should have BSY, DRQ or ERR).
Thanks to Alexander Yurchenko for reporting the problem and testing the
fix.
2003-10-06 21:51:31 +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
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
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
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
wiz 37ac1db454 available, not avaliable. From miod@openbsd. 2003-09-29 09:50:21 +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
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
simonb 5c54e29374 Cast through (void *) to appease gcc3. 2003-09-26 16:02:24 +00:00
mycroft eefae40298 Hide the use of config_interrupts() in one place. 2003-09-25 19:29:48 +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
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
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 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
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
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 9fa456e7b6 nluns should be 8, not 7. 2003-09-18 01:33:58 +00:00
drochner b2a29ce0a3 typo in comment 2003-09-17 11:56:19 +00:00
junyoung cc5534f795 Remove duplicate lines. 2003-09-14 13:01:40 +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
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
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 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
kent 941d061f07 Correct flag names of AD1980 2003-09-08 13:58:21 +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
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
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
christos b7510d87e5 fix debugging printfs 2003-09-01 16:44:03 +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
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 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
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 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
chs f217b85c1f make this build with GEM_DEBUG. fix rxhist counters. 2003-08-24 18:07:03 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
mjacob 190eaf015f Various updates to sync with mainline code. Nothing of great significance
to NetBSD, yet.
2003-08-07 01:12:15 +00:00
mjacob cef319e0b4 Note both active and nvram WWNN/WWPNs
Fix the bug where the thread worker constantly looped. It was a race as
to whether or not the thread fired up or a polled/probed command happened
first, or maybe it's due to other scsipi changes, but we never set the
value that caused the fc thread worker to actually go to sleep until an
initial loop up.

This was rather ugly as it consumed nearly all CPU time available from thence
on. Bad.
2003-08-07 01:10:53 +00:00
mjacob a1c1589fcf Clean out the 'fw' variable part of a CTIO2- the f/w doesn't actually
pass us back anything interesting here.
2003-08-07 01:09:02 +00:00
mjacob 03782491e6 Update from mainline: add ISP_NO_ZIO option. constify a few items.
LINT/ProPolice fixes from OpenBSD.

In isp_reinit, clear the port database.
2003-08-07 01:08:10 +00:00
bouyer 3200934182 Remove unused esiop_scsicmd() prototype. 2003-08-04 19:50:11 +00:00
tsutsui afa4f85c01 TAB/space cosmetics 2003-08-02 12:48:09 +00:00
scw 5aa077f5cf In fxp_intr(), bail early without touching any registers if sc_enabled is
zero, otherwise we could cause PCI master aborts if the card is in D3 power
state and we happen to share a PCI interrupt line with some other device.
2003-08-01 14:54:12 +00:00
tsutsui 1a4743265a - Add hooks for MD DMA transfers.
- Prepare ADAPTER_REQ_SET_XFER_MODE function.
  (currently sync xfer is not supported)
2003-08-01 00:38:38 +00:00
tsutsui fddebe9b9c There is a report that x68k SCSI no longer works after the previous changes.
It seems x68k SPC SCSI has several hardware quirks, so add some (a bit ugly)
#ifdefs for workaround.  (XXX - needs revisiting)
2003-07-27 03:51:28 +00:00
thorpej ee0f53cd8c Make this work on systems where bus_dmamap_sync() is not a noop.
In particular, when doing the "swap hscbs" trick, the scb must
reference the correct hscb_map when it gets a new hscb, otherwise
when you go to sync an hscb later, you could end up using the wrong
dmamap.

In order to make this work, we have to convert the shared_data stuff
to use a map_node, because of the "sentinel" trick played with the
initial "next_hscb".

This driver now works on XScale-based platforms.
2003-07-26 06:15:57 +00:00
pk 9957c167e0 Print more diagnostic info on the occassions `unexpected disconnect' and
`invalid state'.
2003-07-25 06:40:29 +00:00
lukem 365cbd9428 add missing __KERNEL_RCSID() 2003-07-14 15:47:00 +00:00
drochner 037daa02c2 fixed botched prototype,
while being here clean up whitespace
2003-07-11 10:15:56 +00:00
itojun 7f6ed16ef4 function prototype must not have variable name 2003-07-08 10:06:28 +00:00
dyoung a036b1536b Oops. Add the atw(4) sources, too. 2003-07-06 22:57:23 +00:00
dyoung 6e3daf0a07 Still more consolidation of 802.11 media-handling, moving moving
common code from awi and wi into the 802.11 framework. Inspired by
Sam Leffler's patches to FreeBSD.
2003-07-06 20:01:17 +00:00
jdolecek 486593e9b9 actually do gather some randomness (if it's enabled)
modelled after what elink3.c does
2003-07-06 09:12:59 +00:00
dyoung 030634087a Prepare to consolidate 802.11 media handling (which is handled in
code duplicated by each driver, now) into the 802.11 framework.
2003-07-06 07:54:43 +00:00
dyoung 2c1f7efe46 Improved RSSI->dBm conversion, especially for Lucent cards, for
which I borrowed some conversion constants from the Linux orinoco_cs
driver.
2003-07-06 07:15:55 +00:00
tsutsui c42dcc7de8 More misc fixes for forthcoming hp300 MI SCSI support:
- Don't use SCMD_XFR command in message-in phase and status phase.
   It causes unexpected hangs on heavy load. Instead transfer data
   manually via TEMP register by SCMD_SET_ACK and SCMD_RST_ACK.
 - Don't set SCMD_ICPT_XFR in spc_dataout_pio() and spc_msgout().
 - Rewrite spc_datain_pio() to handle FIFO more properly.
2003-07-05 19:50:17 +00:00
tsutsui e30199e1ff Misc cleanup:
- disable debug code by default
 - use MI minphys()
 - add proper delay in spc_find()
 - initialize TMOD register in spc_reset()
 - wrap a sanity check with #ifdef DIAGNOSTIC (sync with aic6360.c)
 - no need to set LUN bits in SCSI command which should be done in mid-layer
 - set proper resid even in error case
 - fix/remove some bogus comments
2003-07-05 19:31:11 +00:00
tsutsui cfa57f87aa Use bus_space_{read,write}_multi_1() for PIO data transfers. 2003-07-05 19:04:48 +00:00
tsutsui 6615ddefa9 Rename some MI mb89352 functions for consistency:
spcintr() -> spc_intr()
 spcattach() -> spc_attach()
2003-07-05 19:00:16 +00:00
tsutsui 443eeab7de Some cosmetics:
- Remove useless macro.
 - Remove ^L characters.
 - KNF a comment.
2003-07-05 18:56:55 +00:00
drochner 71bedfd458 Avoid an obscure gcc3 complaint about
"dereferencing type-punned pointer" by a cast to "void *".
I don't completely understand the warning, but it helps.
2003-07-03 11:12:32 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
jdolecek 83872500d3 cosmetic - make sc_supmedia of struct lance_softc const 2003-06-29 14:42:58 +00:00
simonb 7aa3dc6d45 Restore parentheses around return value that were removed with the
previous commit.
2003-06-29 14:09:21 +00:00
itojun 0778967b85 lwp change lossage 2003-06-29 12:36:35 +00:00
darrenr c372874b88 More changes for providing lwpid for ktrace (sparc GENERIC built) 2003-06-29 09:56:28 +00:00
thorpej 1966c13215 Correct the R-W'ness of GDT_IOCTL_DRVERS and GDT_IOCTL_CTRTYPE.
From Achim Leubner @ ICP.
2003-06-29 01:28:23 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
uwe c173e7908e Only install accelerated rasops for CyberPro, we don't know yet how to
access the coprocessor on 1682 in Krups.
2003-06-24 00:13:29 +00:00
martin d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
bouyer 5b96ee4889 Make sure we pass the current state of the driver to scsipi_async_event(),
not the request from the mid-layer.
Fix kern/21893 from Anthony Mallet.
2003-06-19 20:11:14 +00:00
rh f51b948f11 Add and enable monitoring mode for Lucent cards. 2003-06-19 06:16:36 +00:00
bsh 4b87783212 in cominit(), turn on UUE bit in IER register if it is PXA2x0's
built-in UART.
2003-06-18 04:35:23 +00:00
simonb 83619b47f3 Wrap some long lines. 2003-06-15 01:34:34 +00:00
thorpej 0eff671820 Also pass a type argument to comcnattach() and com_kgdb_attach().
comspeed() (and thus cominit()) may need this information.
2003-06-14 17:01:06 +00:00
thorpej 5ae120da7b Introduce a new "type" field in the softc which is used to indicate
the general UART type.  Currently, we have "normal", "hayesp" and
"pxa2x0" types.  Replace the corresponding hw flags with the new type
values.
2003-06-14 16:25:52 +00:00
thorpej 3178a4f415 Add support for dynamic rescan of cache service logical drives, using
the ioctl issued by the ICP RAID management libraries (used by the
storcon and iirconfig tools).  This requires some infrastructure changes:
* Add a "service callback" mechanism that the ld driver (cache service)
  and the iopsp driver (raw service) can register with the icp parent.
  Right now this callback allows the children to adjust their notion of
  how many command openings are available.
* Add a mutex around the icp ioctl handler, allowing only one thread
  to execute an ioctl at a time.
* Add a way to freeze the controller command queue.  We stop all I/O
  while processing rescans (due to the semantics of icp_cmd()).
* Make icp_cmd() work when !cold.
* Add detach support to ld@icp.
2003-06-13 05:57:30 +00:00
kent f7f6440dff Add AD1981-specific initialization.
The patch provided by Lars Heideker.

PR: kern/20368
2003-06-13 05:31:29 +00:00
uwe faa757d699 Request KBC_SELFTEST in pckbc_cnattach(), hidden under #ifdef
PCKBC_CNATTACH_SELFTEST.  On machines where we boot on cold iron
(e.g. netwinder) we need this to init the pckbc.
2003-06-12 03:34:12 +00:00
scw 146abc03d1 In ac97_restore_shadow(), make sure to restore the codec's extended
control register if we configured it during ac97_attach().
2003-06-11 14:22:27 +00:00
uwe a7ed2dae3d Correct calculation of the blit src/dst for blits we do backwards. 2003-06-10 22:07:38 +00:00
grant 5d17facb78 wrap a debug message in #ifdef PCKBCDEBUG.
ok'd by simonb. fixes my PR kern/18441.
2003-06-10 07:46:29 +00:00
thorpej 47edad1115 Always queue transfers in the ld driver to prevent transient resource
shortages in the back-ends from aborting transfers.

Reviewed by ad@.
2003-06-07 23:37:24 +00:00
dogcow b7da893283 Some models of the 556B don't turn on the transmitter without magic
values getting written. Fix from FreeBSD; cf sys/pci/if_xl.c, rev 1.110
2003-06-05 22:11:21 +00:00
scw 5eb709747b Add support, via a kernel config file option, for the 16550-compatible
com ports found on Intel PXA2x0 processors.

Re-arrange the code which detects the FIFO configuration to defer
printing until _after_ com_fifo is cleared. Some supposedly compatible
chips clear the Tx/Rx FIFOs when this happens, resulting in previous
output being lost.
2003-06-05 13:40:38 +00:00
petrov 7a41bf9cce Fix the previous patch of me. 2003-06-02 22:52:36 +00:00
gmcgarry 59720b5acd Register definitions for TMS 9914 GPIB controller. 2003-06-02 03:55:04 +00:00
gmcgarry 8cfea04139 Register definitions for NEC uPD7210 GPIB controller. 2003-06-02 03:54:31 +00:00
uwe 97e817d08e Implement accelerated text ops using graphic coprocessor. 2003-05-31 23:22:26 +00:00
dyoung 5bcf25f890 Picky cosmetic change: remove leading space. 2003-05-31 19:38:08 +00:00
uwe 70161de941 Correct coprocessor registers base.
Feh, manuals that lie...
2003-05-31 18:25:40 +00:00
uwe a19b05b597 Oops, do not disable coprocessor in igsfb_init_ext. 2003-05-30 22:41:52 +00:00
yamt b1286467f1 ip/tcp/udp checksum offloading support for i82550.
largely from FreeBSD.
2003-05-26 16:14:49 +00:00
yamt b57a775a7d check and MCLAIM correct mbuf in fxp_copy_small path. 2003-05-25 15:10:23 +00:00
dyoung 55196426e6 Update to wi interrupt handling:
No longer require a hi-low-hi transition of a status bit before
  we believe it. It's a performance killer, and without it there
  does not seem to be a race.

  Sam Leffler reports that wi_intr needs to be bracketed by
  disable/enable interrupts through WI_INT_EN, or else performance
  is bad on Lucent. So now we do that.
2003-05-22 06:34:45 +00:00
dyoung ba845eeeb3 Stop wi panics on card ejection in Powerbook in both the enabled
and disabled states. This should fix an x86 panic somebody reported
on icb.
2003-05-20 01:29:35 +00:00
tsutsui 09d1921299 Misc cosmetics:
- some KNF and wrap long lines
- use TAILQ macro
- replace some magic numbers with macro
- use #if 0/#endif pair to disable code
2003-05-19 14:56:03 +00:00
fvdl 385c785fd2 Inialize sc_tty->t_dev early for serial console, so that cn_check_magic
will match in the case of a break before the console was opened for the
first time. Makes BREAKing into DDB work (again) as soon as interrupts
are enabled.
2003-05-18 15:10:08 +00:00
thorpej 02ad493d76 Fail icpioctl() if securelevel > 1. 2003-05-18 06:18:25 +00:00
thorpej 577fd9d8fa * Use aprint*().
* Add Ultra/133 to wdc_print_modes().
2003-05-17 21:52:03 +00:00
christos acec85bb7c Initialize and reset curtxeps to zero each time the error rate is exceeded.
This stops the continuous spewing of error messages, making it just sporadic.
2003-05-17 16:46:03 +00:00
thorpej 548e1373f8 Another fix from Achim Leubner @ ICP:
Test-busy *before* marking the controller as processing a user ioctl,
otherwise the command queue could stall permanently if test-busy returned
true.
2003-05-17 15:34:12 +00:00
dyoung 045ad0db5e IEEE80211_LOCK and WI_LOCK conceal enormous differences in locking
semantics on FreeBSD and NetBSD, so I am backing them out until
the macro set is enriched.
2003-05-16 01:26:17 +00:00
petrov 182de37049 Move DTIMEXP and RFIFOVF warnings under control of HMEDEBUG.
PR port-sparc64/20280 by grant beattie.
2003-05-14 19:46:59 +00:00
wiz 74da88f77a Correct spelling of coalesce. (Will forward to Justin Gibbs.) 2003-05-14 12:57:45 +00:00
wiz 05e990b871 summarize with two m. 2003-05-14 12:46:27 +00:00
thorpej 405790a85a Add support for the user-generated command interface and event logging
required by the ICP-Vortex management tools.  Many thanks to Achim Leubner
at ICP-Vortex for a few bug fixes and for testing.
2003-05-13 15:42:33 +00:00
dyoung e91ed415cd Revert to previous multicast logic, which enami@sm.sony.co.jp says
was correct.
2003-05-13 08:58:01 +00:00
dyoung 850a6ef1e6 Begin synchronization with FreeBSD:
1 Add channel mask, transmit rate-mask arguments to wi_scan_ap.
2 Adopt the macros WI_LOCK/WI_UNLOCK for synchronization. FreeBSD
  uses a different synchronization mechanism.
3 In wi_cmd, adopt constants WI_DELAY/WI_TIMEOUT for timing.
4 Pull debug messages from into wi_read_nicid from FreeBSD.
5 Bug fix: if IFF_ALLMULTI, don't filter any multicasts.
6 Count and report TX exceptions, but don't generate any additional
  interrupts.
2003-05-13 08:35:58 +00:00
dyoung 5ffe819b6e For converge with FreeBSD: 2003-05-13 07:17:46 +00:00
dyoung 45e5f65918 Track TX exceptions. This will eventually enable round-robin retries
(for fairness) and RTM_LOSING or some such other message to indicate
a losing wireless destination.

From FreeBSD.
2003-05-13 07:13:49 +00:00
dyoung 904079b8af Complete prior patch: dump packets in wi_rx_intr, too. 2003-05-13 06:51:10 +00:00
dyoung aa1a3737de Debug code from FreeBSD: handy packet dumps when IFF_DEBUG|IFF_LINK2
are set.
2003-05-13 06:48:56 +00:00
dyoung a090735114 Misc changes to wi_stop. First, block interrupts in wi_stop. (From
FreeBSD.)

Fix a bug in wi_stop where ejecting from the Powerbook crashes the
system. Essentially, the patch makes sure we write *no* registers
when we are no longer attached.

Also, for consistency w/ FreeBSD, use sc_portnum throughout wi,
instead of hard-coding WI_PORT0 .
2003-05-13 06:33:40 +00:00
dyoung 8f56bda785 For uniformity between FreeBSD & NetBSD, adopt FreeBSD's more
concise wi_cmd.
2003-05-13 06:15:47 +00:00
uwe a3e1bfb091 Use hardware sprite for the text mode cursor.
Fail cursor related ioctls with EBUSY while in text mode.

Don't do uvm_useracc checks before copyout, instead check copyout()
return value directly.

Minor cleanups.
2003-05-11 03:20:09 +00:00
uwe 6311425db4 Don't need a separate bit expansion table for the cursor mask. 2003-05-10 16:20:23 +00:00
uwe 64e9f09f51 Enforce that the cursor position and the hot spot are within bounds.
Constify a bit.  Fix unsignedness of a few local variables.
2003-05-10 15:25:19 +00:00
uwe 2866542ad3 Redo attachment to support proper cnattach.
wscons on netwinder almost works now.
2003-05-10 01:51:56 +00:00
christos 16561289af PR/13653: Onno van der Linden: Set tranceiver media properly. 2003-05-09 20:54:18 +00:00
martin 82f1702c53 Add missing include.
Addresses parts of PR kern/21448 by Frank Kardel.
2003-05-08 21:16:19 +00:00
kristerw 204dc598d9 Change the type of the 'code' parameter of ahc_send_async() from u_int
to ac_code to agree with the function definition.
2003-05-04 23:37:27 +00:00
wiz 1ffa7b76c4 DMA, not dma nor Dma. 2003-05-03 18:10:37 +00:00
dyoung a7d738c524 Adapt SMC 93cx6 library so that it will work with both 8- and 32-bit
registers.  This is so that I can read an SMC 93cx6 through the
32-bit registers of the ADMtek ADM8211 802.11 wireless MAC.

Adapt aic to choose 8-bit registers.
2003-05-02 19:12:19 +00:00
fvdl df29adfb0e Don't reference channel_b if it's not a twin channel adapter.
From MINOURA Makoto.
2003-05-01 23:00:20 +00:00
thorpej c1e26c1b48 Free the mpt request structure before calling scsipi_done(), as
scsipi_done() may start another command which needs the request
structure being freed.

Patch from Stephan Uphoff, modified slightly by me.
2003-05-01 20:18:35 +00:00
scw f95724bd6b Add support for the SMC91C111 chip, with its internal PHY. 2003-04-29 08:47:29 +00:00
nakayama 1e411d7027 Make DMA mode works on Promise Ultra66/100 with 48-bit LBA drives.
Ok'ed by bouyer in tech-kern@netbsd.org.
2003-04-28 05:20:29 +00:00
briggs 742c5dbd3a Allow the console to be used for kgdb if both DDB and KGDB are defined. 2003-04-28 02:46:09 +00:00
wiz c42e1fac66 Management, not managment. Mostly from jmc@openbsd. 2003-04-26 22:07:12 +00:00
bouyer 99a36b0abd Rename WDSF_EN_WR_CACHE to WDSF_WRITE_CACHE_EN for consistency with other
subcommands.
2003-04-26 09:29:41 +00:00
fvdl 00a8526dca Do the right thing in the case of an attach error. From Manuel Bouyer. 2003-04-25 16:03:45 +00:00
tls 85c8cfb533 Correct use of MAXBSIZE where MAXPHYS was intended. This is a necessary
first step towards per-device MAXPHYS, and has the beneficial side effect
of allowing clustering to MAXPHYS even on systems that need to run with
a reduced MAXBSIZE to get more metadata buffers.
2003-04-23 00:55:17 +00:00
fvdl 3f5d6a0d73 Remove unused variable. 2003-04-21 22:00:42 +00:00
fvdl 9ec222cfbe Remove trigraph. 2003-04-21 21:49:31 +00:00
fvdl 2674450fcb Avoid trigraph in string. 2003-04-21 21:45:59 +00:00
fvdl 13b6cff110 Reset bus in attach, not at first access. 2003-04-21 20:05:26 +00:00
fvdl 11e1ebb8dd Reset channel(s) in ahc_attach, rather than at first access. 2003-04-21 19:59:48 +00:00
fvdl 1adc169997 Add NetBSD RCS Id. 2003-04-21 18:12:22 +00:00
fvdl d7ad58b224 Add file that I missed when adding the ahd driver. 2003-04-21 16:53:59 +00:00
fvdl 7c5409295c Set/report DT a bit more correctly. 2003-04-21 16:52:07 +00:00
gson c8da8f2398 Ignore input when the port is not open. This change is functionally
identical to the patch in kern/6502 (which is hereby fixed), but
modelled after the corresponding fix to the 8530 driver in
z8530tty.c revision 1.60 to maintain consistency with that driver.
2003-04-21 03:43:18 +00:00
fvdl 1aca5bda05 ahd, driver for Adaptec 790x U320 controllers. Originally by Justin Gibbs
for FreeBSD, ported to NetBSD by Pascal Renauld, Network Storage Solutions,
Inc, plus a bunch of changes by me.

This driver is as yet untested in this final form, it will be added
to config files when it has been tested.
2003-04-21 00:14:52 +00:00
fvdl d96d9c4be4 Pick the right channel in the reset ioctl. 2003-04-20 21:25:59 +00:00
fvdl b30a81c90c Resurrect change from previous ahc driver version: reset channel (unless
configured not to in the BIOS) on first access.
2003-04-20 19:49:45 +00:00
fvdl c2a2dc04eb Fix ahc_print_registers some more. 2003-04-20 18:57:41 +00:00
fvdl ed7c318180 Fix ahc_print_register up. 2003-04-20 18:31:16 +00:00
fvdl c620a2fd66 Fix some AHC_DEBUG printf cases, and undef AHC_DEBUG. 2003-04-20 16:04:54 +00:00
fvdl c8a7cfc565 Actually define ahc_htole and reverse macros. 2003-04-20 15:32:10 +00:00
fvdl 6288ca0b93 Delay ahc_free until after shutdown hook disestablish. 2003-04-20 15:31:50 +00:00
bjh21 b05cf42fce Use %lu format and (u_long) cast when printing size_t. 2003-04-20 12:54:05 +00:00
fvdl 26813b6545 Get rid of AHC_LUN_WILDCARD, making differences with FreeBSD smaller. 2003-04-20 11:17:20 +00:00
fvdl 2d41d30fa5 NetBSD RCS Ids. 2003-04-19 19:38:21 +00:00
fvdl ccadc2cbd3 Newer adaptec 7xxx driver. Written by Justin Gibbs for FreeBSD. Ported to
NetBSD by Pascal Renauld at Network Storage Solutions, Inc.
Some modifications by me.
2003-04-19 19:33:29 +00:00
thorpej 6f2e904450 Use the standard fixed-sized types on NetBSD. 2003-04-16 23:24:01 +00:00
thorpej 6c29c1f6fb In the polling case, don't call mpt_timeout() twice. 2003-04-16 23:17:30 +00:00
thorpej 98f531d377 mpt_dma_mem_alloc(): If we fail, only destroy request DMA maps that
were actually created.
2003-04-16 23:16:41 +00:00