- fix printing of Ultra-DMA modes (shows up when the drive supports highther
modes than the controller).
- Don't use C_NEEDDONE anymore. We were setting this flag in a possibly
freed wdc_xfer (this didn't create problems, as it was free'd in the POLL
case only, while IRQs are blocked, but it's not good practice anyway
and pool(9) complains about it ;)
was being initialized to a KVA, when we really wanted a DMA address. Change
the code to allocate the overrun buffer with the control blocks, and
properly initialize overrun_buf.
Note that overrun_buf cannot actually be shared between all boards; DMA safe
memory could vary from bus to bus.
Garbage-collect two functions which are no longer used because of the
above changes.
2 times in the past
- Set up timeout per xfer instead of per interrupt. This helps with
PIO transfer (we would call timeout()/untimout() several times for a
transfer).
- If we missed an interrupt for a PIO transfer, reset and restart it
immedialy, don't try to recover and continue. If we missed an interrupt we
may have lost a read/write cycle on the IDE bus. If this happens 1) we
corrupt data and 2) we enter an interrupt loop at the end of the xfer, as
the drive has some more data to read/write, but the host thinks the xfer is
done.
This last change fix the (or at last some of the) 'lookup after lost interrupt'
some peoples have been experiencing.
anyway, take advantage of this and greatly simplify the programming
of the multicast filter. This solves the last reported "device timeout"
problem with this driver.
to the EPIC/100 driver's (adjusting for the fact that Intel Ethernet chips
are from Pluto):
* Don't allocate receive buffers until the interface is actually brought
up, and release all of them if the interface is taken down.
* Add a knob (defaults to off) which will copy an incoming packet to
a single header mbuf if it is small enough to fit in one, rather than
burning an entire cluster on it. Note that this change will be mostly
moot if/when sbcompress() is changed to handle compressing clusters.
Simplify some of the receive list logic:
* Rather than using a homegrown queue and additional software RX descriptors,
use an ifqueue to queue receive buffers, and M_{GET,SET}CTX() to hook DMA
maps and receive buffers together.
Clean up a bit:
* Macroize a bunch of things to make the code a bit easier to follow.
* Don't allocate receive buffers until the interface is actually brought
up, and release all of them if the interface is taken down.
* Add a knob (defaults to off) which will copy an incoming packet to
a single header mbuf if it is small enough to fit in one, rather than
burning an entire cluster on it. Note that this change will be mostly
moot if/when sbcompress() it changed to handle compressing clusters.
Constantine Sapuntzakis confirmed by Bill Sommerfeld. Although nothing is
supposed to call wakeup on this without setting AT_DONE, it's good practice to
do it this way (the process may be waken up by a setrunnable() call).
(Sorry for a big commit, I can't separate this into several pieces...)
Pls check sys/netinet6/TODO and sys/netinet6/IMPLEMENTATION for details.
- sys/kern: do not assume single mbuf, accept chained mbuf on passing
data from userland to kernel (or other way round).
- "midway" ATM card: ATM PVC pseudo device support, like those done in ALTQ
package (ftp://ftp.csl.sony.co.jp/pub/kjc/).
- sys/netinet/tcp*: IPv4/v6 dual stack tcp support.
- sys/netinet/{ip6,icmp6}.h, sys/net/pfkeyv2.h: IETF document assumes those
file to be there so we patch it up.
- sys/netinet: IPsec additions are here and there.
- sys/netinet6/*: most of IPv6 code sits here.
- sys/netkey: IPsec key management code
- dev/pci/pcidevs: regen
In my understanding no code here is subject to export control so it
should be safe.
false matches on controllers which properly respond to a WDCC_RECAL command.
Should close PR port-i386/7702 (the author tested this patch, and said it
solves his problem).
return 0 instead of EINVAL. In this case, there will only be one media
type, and the upper-level if_media code will ensure that the user is
setting to that type.
This matches changes Jason made a while back to sys/dev/ic/lance.c
between a bug in the receive path (buffer length used instead of actual
received frame length) and the ARP code not correctly setting the length
of the reused mbuf, which all told caused the transmit logic in the chip
to wedge.
Also, make sure to count received packets.
Found and fixed by Zdenek Salvet <salvet@ics.muni.cz>, PR #7809.
which use uvm_vslock() should now test the return value. If it's not
KERN_SUCCESS, wiring the pages failed, so the operation which is using
uvm_vslock() should error out.
XXX We currently just EFAULT a failed uvm_vslock(). We may want to do
more about translating error codes in the future.
directly, call the function pointer (*if_input)(ifp, m). The input routine
expects the packet header to be at the head of the packet, and will adjust
as necessary. Privatize the layer 2 input and output routines, allowing
*_ifattach() to set them up as appropriate.
(e.g., the 1240). Include the new 1080/1240 NVRAM layout reading code. Some
moderately significant mailbox changes were necessary also to accomodate a
second channel.
return 0 instead of EINVAL. In this case, there will only be one media
type, and the upper-level if_media code will ensure that the user is setting
to that type.
In other words, don't require the front-end to provide the no-op.
Reorganise the driver some what.
Rename tr_reset() to the more appropriate tr_stop().
Create a common tropic reset routine and use it in the frontends.
Move the code in tr_config() which is only used in the card attachment
routines into a new tr_attach() function.
Take adapter off the ring through tr_shutdown() in a shutdown hook.
This simplifies the bus-specific frontend.
per-packet discard of every received packet increases latency and
decrease throughput. INstead, Spin on S_COMMAND_IN_PROGESS for enough
iterations as the expected time to completion. Only do DELAY()/poll
loops (as suggested by Jason Thorpe) if spinning fails.
Take PCI as fastest case and compute worst-case estimate.
Shorten DELAY() in S_COMMAND_COMPLETE polling-loop up 10, loop-count
down. to speed up epreset() completion (m/c filter change, ifup/ipdown, etc).
* Clear the `enabled' bit in the softc so late hardware interrupts
(e.g., just after the full reset) done as part of shutdown) are dropped.
* Eliminate loops that poll forever on S_COMMAND_IN_PROGRESS to complete.
Add inline function with bounded loopcount plus small delay, to avoid
bugs in EISA hardware which never sets S_COMMAND_IN_PROGRESS.
Use for both TX_RESET/RX_RESET/GLOBAL_RESET cmds, and polling for
discard-Rx completion
Big-endian CPUs should use bus_space_{read,write}_multi_stream methods
to PIO packet data to NIC in 16-bit or 32-bit chunks.
Make it so.
Since we don't have stream methods on all ports yet (esp. i386), use
the bus_space_{read,write}_multi methods if the compile-time
stream-method feature-test macro is not set.
Originally from tsubai@netbsd.org, via HAYAKAWA koichi's cardbus patches.
- Don't rely on ATA signature: some ide controllers seems to not transmit it
properly (SIMIDE on arm32 machines). Instead, when we guess a drive is here
after reset, just mark it as ATA and OLD is it's not ATAPI.
- at attach time, use IDENTIFY to eliminate ghost from the probe. If the
drive had the old flag and IDENTIFY failed, issue a WDCC_RECAL command
to detect a pre-ATA disk. If IDENTIFY succeded, remove the OLD flag,
it's obviously not a pre-ATA disk.
- add a new controller flag, WDC_CAPABILITY_PREATA, used to shorcut parts
of the probe (not necessary, but makes the probe/attach faster). This is
only set by the ISA front-end, all other controllers supported can't have
pre-ATA drives attached.
The mechanism used are more or less the same as before, they have just been
reordered. Should solve port-arm32/7324 (waiting for feedback).
board versions with no BIOS. Separate mailbox interrupts from
IOCB interrupts. Read OUTMAILBOX5 while RISC_INT is active- not
after you clear it (potential race condition). Clear out older broken
BIG_ENDIAN goop. Don't negotiate narrow/async for LVD busses at startup
if already in LVD mode. Note usage of presumptive 1040C revision. For
all the LIP, PDB Changed, Loop UP/DOWN async events, mark fw state
as unknown as well as marking the need to do a getpdb on targets- after
a LIP for certain the f/w has to do PRLI/PLOGI for all targets again
and marking f/w state as unknown gives us a fighting chance to (start
to) hold up for that to complete.
that will SBusify an isp header or the lun/target portions of a request IOCB-
and have these only valid iff __sparc__ (no non-sparc SBus machine that *I*
know about).
was deasserted and we wanted to change parameters to -crtscts
This effectively stalled the transmitter since with TS_BUSY set
we only change parameters during the Tx interrupt handler.
are called from the interrupt or timeout handler, 0 otherwise.
- use this to know if we can busy-wait for wait_for_unbusy or wait_for_ready
This fixes a bug where CDs withot the DRQ_INTR capability would not busy-wait
for the CMDOUT phase.
While I'm there change 2 delay() to DELAY() for consistency, and
garbage-collect some old code from wdcintr() which has been ifdef'd out
for some time now.
DELAY(1)'s. This should fix interrupt driven lpt driver hang and
reboot problems for the group of users who have experienced them, and
shouldn't hurt anyone else.
* The fact that IIR_NOPEND was not set on entry does *not* mean that no
transmission was in progress. Besides, we don't want to throw away receive
interrupts either.
* In the !clearirq case, we didn't splx().
1. don't clear the irq unless it was clear before transmitting
2. also do various bus_space_barrier() ops
Stops console from freezing when kprintf interrupts tty driver output.
IDENTIFY said so: it doesn't help for the drive this was supposed helping,
and seems to break another device.
In interrupt routine, don't return 0 if we are polling: this should fix the
"panic: wdc_exec_command: polled command not done" some people reported
(kern/7269).
& strobe cycle. These bracket DELAY()'s of BROKEN_LPT_DELAY
microseconds. This can be used to kludge around mysterious hangs and
reboots some users experience. The cause of these failures is still
not known, but is conjectured to be hardware bug originated failures
in the bus cycle.
in not just used to access memory but is bassed to bus_space_xxx_n()
methods. For debugging purposes, bus_space can have additional constraints
which will be properly met by BUS_SPACE_ALIGNED_POINTER().
DRIVE_OLD, DRIVE_ATA or DRIVE_ATAPI based on register signatures.
The attach routine will issue a IDENTIFY command for ATA/ATAPI disk,
to detect flase matches by the probe routine.
probe/attach should now be fully compliant with ata-4/ata-5. As a side
effect, ATAPI drives which improperly use ATA register signatures should now
be attached as ATAPI.
need to downgrade, downgrade to PIO, as it has been shown if we got CRC errors
in Ultra-DMA mode, we will have silent data corruption in multiword DMA mode
(isn't IDE wonderfull ? :).
Set timeout to 1s for "normal" ata I/O, to minimise the effects of missed
interrupts.
Soren S. Jorvang <soren@t.dk>, with a lower match level.
Display the other accented characters which are not present in the IBM
character set by their non-accented equivalents, with an even lower
match level.
* Macroize hardware and software descriptor access (much easier to read).
* Simplify and optimize the transmit loop a bit, and use IFF_OACTIVE as
appropriate.
* Fix a potential race condition in the transmit loop. This change has
made the driver significantly more stable (almost completely eliminated
the "device timeout" errors that have plagued this driver).
* Implement transmit interrupt pacing.
* Add missing bus_dmamap_sync() calls (on transmit and receive descriptors
and fraglists). (Draining the write buffer when accessing these structures
may have also contributed to the increased stability of this driver on
the Alpha.)
Use fast memory timing NVRAM parameter. Clean up and fix establishment
of default target parameters. Don't use NVRAM if are flagged as not to
do so (I had a busted NVRAM setup which I couldn't edit that enabled SYNC
mode but disabled disconnect/reconnect and wide!!). Fix delays after
resets. BUS resets not done in isp_init anymore- relegated to OS
specific outer layers. Fix a buglet where you can get in a loop for
a NULL xs in the completion list in isp_intr. Add in some defines that
can disable fast posting. Add in code for Loop Up/Loop Down events that
call into the outer layers as to what to do.
define. Add a new config flag param (ISP_CFG_NONVRAM) whose intent it is
to cause NVRAM to be ignored. Add ISPASYNC_LOOP_DOWN and ISPASYNC_LOOP_UP
isp_async enums.
(we get LOOP DOWN events, and we'll hang on that at this time).
Add other isp_async cases- ISPASYNC_LOOP_DOWN and ISPASYNC_LOOP_UP. DOWN
will cause internal queuing until UP, whereupon a timeout will fire up
any pending xfers. It doesn't really keep commands from getting destroyed
by loop down events, but at least minimizes the damage. This was much
easier to implement with CAM.
the disk is ready to transfer data, and in ATA-5 the DSC has been obsoleted.
So only wait for DRQ to transfer data. This can be made conditional on the
ATA version if it's proven to break with some drives (worked with all the
drives I have access to).
While I'm there correct a few typos.
* Move the printf() delay to just after the printf(), where it actually makes
sense.
* Use zstty_stint() and zstty_softint() from zsparam(), to force an immediate
update of the carrier and flow control status. Abuse this in the attach and
open functions to defer all of that work. This insures that we don't lose
any status updates.
* Don't screw with register 1 when closing the console.
* Fix bugs in TIOCM??? (stay semicolon, clearing DTR while transmitting).
* Add comments in a couple of places.
the startup code. Implement a call to outer framework function so that
asynchronous events can be handled (e.g., speed negotiation, target mode).
Roll internal release tags.
Thanks to Scott for pointing this out to me (I got his mail and figured out
this change before seeing the discussion on tech-kern) and to Charles for
the initial explanation.
In wdc_probe_caps() add code to guess the ATA revision supported (if
ATA4 if Ultra-DMA, ATA2 if PIO mode > 2). We can't rely on param.atap_ata_major
here, at last one Ultra-DMA drive claims to support only ATA-3.
Use the ATA version in ata_perror(), and to try a flush cache command
in a shutdown hook for IDE drives.
calls
-support use of 2 fonts simultanously; this costs the ability to
"highlight", ie to use the upper 8 colours
-define screen types "80x25bf" and "80x50bf" which use this ability
-add conditional code to deal with the weird mapping of pcvt's
supplemental fonts
reported by Matthias Scheler <tron@lyssa.owl.de> in PR kern/6772.
- After receiving, check whether the receive DMA pointer became 0
what obviously happens if the list runs out of entries. Simply reinit
in this case. This fixes receive lockups after DDB use observed
by myself.
Unstall the receive engine if the ELINK_UPPKTSTATUS indicates that it
was stalled. (Don't know when this might happen. FreeBSD does so.)
+ Enable FIFO bursts, but also detect bogus 1040A with busted FIFO.
+ Use new MEMZERO crossplatform define.
+ Handle RQCS_QUEUE_FULL status case and let upper layer parse SCSI ststus
byte if nonzero (should be 0x28- Queue Full status)
+ Fold ISP_NVRAM_FIFO_THRESHOLD_128 into isp_fifo_threshold tag.
for FC HB based upon a SCCLUN define (15 for normal- 255 out of a possible
65535 for SCCLUN). Propagate loopid as adapter_target.
Roll minor platform version. Roll core version number.
Update mailbox definitions with cleaner target mode structure definitions.
Clean up some ENDIAN stuff. Correct botched ISP2100_NVRAM_HARDLOOPID offset.
- keep the modes supported by the drive in struct ata_drive_datas (will be
later used for downgrading the DMA/PIO mode on error)
- use config flags to force/disable PIO/DMA/UDMA modes
- For the CMD PCI0643/6 setup DMA mode to DMA Read multiple.
- When doing a first open, don't enable receive & status interupts before
the MD layer has had a chance to set things up.
- Enable logic to only enable DCD/CTS interupts if we are looking for/
expecting interupts on those pins. Disable otherwise.
- in zs_param, only pass up the state of ZSRR0_DCD if we have enabled
interupts on that pin.
Henry Hotz (<hotz@jpl.nasa.gov>) and Greg walsh <gwalsh@artec.com> have
tried these changes to get certain printers from hanging at boot. They
work in a 1.3.2 kernel for Greg.
an array of fixed-sized channel_softc elements. This way IDE controllers
which more than 1 channel (pciide) can extend the channel data easily
for private needs.
To avoid the double dereference at runtime, change the argument of
wdcstart() to the channel data pointer instead of the array index.
- Deactivate the card on removal and queue a REMOVAL event for the socket's
event thread to finish the detach.
- Queue an INSERTION event for the socket's event thread on insertion.
Implement a few missing infrastructure pieces to support this.
Hot swapping of PCMCIA cards now "works". (Not quite; things like network
devices need changes for their respestive subsystems. These changes are
coming soon...)
if the chip is reset while transmitting.
XXX
This occurs at boot time because the SIOCADDMULTI always resets the interface
when adding the `all hosts groups' -- usually while the ARP packet is being
transmitted. All drivers should be fixed to not reset the interface when
changing the multicast filter, if possible.
we can't use up all of the remaining sc->txslot[chan].bfree free
bytes) because that would cause the circular buffer read pointer
to become equal to the write pointer, thus signaling 'empty buffer'
to the hardware and stopping the transmitter. spotted and fixed
by Kenjiro Cho <kjc@csl.sony.co.jp>
in the printing of DMA mode (piix3/4 only)
others: set the debug_mask to 0, so that debug messages are turned off by
default but can be easily turned on.
Reset drive_flags to 0 for unconfigured devices, so that they are ignored
later. For configured devices, reset state to 0 after probe/attach.
struct scsipi_adapter; they were not used.
Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.
Inspired by PR #6090, from Matt Jacob.
This bus space tag and handle is used for 32 bit data transfers i.e.
when WDC_CAPABILITY_DATA32 is enabled as the 32 bit data register may
not be part of the standard drive registers.
a slightly different fibre startup (print ALPA now too). Change
the way that return values from dma setup is done. Make debug messages
out of some queue overflow situations. Turn PORT LOGGED OUT into
Selection Timeout equivlaent. On isp_restart actions don't blow off
the commands with HBA_BOTCH (XS_DRIVER_STUFFUP) - set them with HBA_BUSRESET
(which is defined as XS_DRIVER_STUFFUP until someone decides whether
the suggested change to the midlayer NetBSD is worthy of inclusion).
use PIO (or equivalent) code to do asynchronous transfers: In
ncr5380_scsi_cmd(), test to see if the request has been completed after
the call to ncr5380_sched(), and return COMPLETE if so. This avoids
going into an infinite loop in scsipi_execute_xs() while waiting for an
interrupt to trigger completion of the transfer... which, of course,
never happens, since it's already done.