Stop output as fast as possible when DCD is deasserted.
Do *not* automatically drop DTR when DCD is deasserted.
Only check for rr0 bits that we care about (DTR and DCD).
Make sure we turn on DTR and/or RTS as appropriate during open.
Rearrange close sequence so the tty is flushed before turning off interrupts.
Deal with `softcar' and the console device by silently asserting CLOCAL and
|HUPCL, as in com driver.
Do *not* fiddle with DTR when changing the line speed.
Make sure we update the tty's carrier status when CLOCAL or MDMBUF is changed.
Only change rr1 when we actually need to turn on or off TIE.
things happen if we are the console.
Restore to the prevoius value (not to hardwired 8N1) because this
could be set by the serial console initialization.
Closed PR kern/4373 (Dave Huang)
in the ISR (from the ISA "ed" driver's generic 8390 probe routine).
Also, add a big comment describing exactly what we're checking when
probing for the dp8390 (also lifted from the ISA "ed" driver).
The RST check should help weed-out non-matches before they get to the
fairly invasive memory check.
should creation/initialization of a mscp fail. Also, don't panic in
these situations. Instead, simply return an error condition and allow
the caller to deal with it. It may be the case that we were able to
create one mscp what we can grab, and continue to hobble along.
Also, fix the mscp freelist fencepost error, similar to aha.c and bha.c
should creation/initialization of a ccb fail. Also, don't panic in
these situations. Instead, simply return an error condition and allow
the caller to deal with it. It may be the case that we were able to
create one ccb what we can grab, and continue to hobble along.
shoud creation/initialization of a ccb fail. Also, don't panic in
these situations. Instead, simply return an error condition and allow
the caller to deal with it. It may be the case that we were able to
create one ccb what we can grab, and continue to hobble along.
Adjust the number of ccbs allocated during initialization.
Every ccb could potentially lock 64k of memory for dma buffers if bounce
buffers are used. Instead of BHA_CCB_MAX ccbs using 2MByte, only
sc_link.openings ccbs per device are allocated. Thus we now use only
256KByte per device present.
(hannken)
Fix a couple of errors in bha_create_ccbs():
- Don't ever let the number of CCBs be creater than BHA_CCB_MAX.
- Fix a fencepost that caused the last CCB allocated to never be put
on the freelist.
(thorpej)
- at end of attach, explicitely select an existing drive. This fixes hangs
some users reported (such as the one reported in port-i386/4247).
- Some atapi cdrom drives (e.g. Nec 24x) don't enables their registers before
a controller reset is issued. The controller probe routine is changed as
follow: issue a controller reset. If fail, test atapi signature on slave.
If fail, wait 5s and retry a reset. If the second reset fail, return(0).
If the first reset succeed, test presence of a master drive:
atapi signature, and if this fail RO/RW registers test. If no master, test
atapi signature on slave. If no slave, return 0.
"A sequence step of 0 after a select with ATN can be a selection
timeout, or it can also indicate the target did not respond with
a message out phase. The latter will occur on very old SCSI
devices which do not respond to the ATN signal and go directly to
the command phase".
Dave Huang <khym@bga.com>, with added check for broken early versions
of the 16650, taken from the Linux driver.
This should be extended to use, for example, higher trigger levels for
the bigger 16650 FIFO, and its capability for using a smaller divisor
and thus higher speeds. But this patch is very useful for 16650 users
already.
Dave Huang <khym@bga.com>, with added check for broken early versions
of the 16650, taken from the Linux driver.
This should be extended to use, for example, higher trigger levels for
the bigger 16650 FIFO, and its capability for using a smaller divisor
and thus higher speeds. But this patch is very useful for 16650 users
already.
options RND_COM
in your kernel config file (along with the
pseudo-device rnd
line) to enable this. If results are positive, I will make this enabled
by default.
The changes is to allow some limited mixer manipulation through
the audio device (instead of the mixer device).
This rendered 4 methods in audio_hw_if unused so garbage collect these.
> revision 1.1.2.4
> date: 1997/10/15 01:01:57; author: enami; state: Exp; lines: +10 -8
> Use bus_space_write_1() directly instead of NIC_PUT(), since
> - same io port is accessed by bus_space_read_1() in the same function, and
> - can bypass sc_reg_map[].
The isa attachment code is in isa/lpt_isa.c now, which attaches to the
already created ic/lpt* files.
You don't need to change your config files, but you need to re-"config" if
using lpt at isa.
XXX The "lpt" device definition should be in sys/conf/files instead, but to
my knowledge, there are some ports which have private copies of lpt, and would
choke on that. No need to make people unhappy 7 days before release branching.
pseudo-device rnd # /dev/random and in-kernel generator
in config files.
o Add declaration to all architectures.
o Clean up copyright message in rnd.c, rnd.h, and rndpool.c to include
that this code is derived in part from Ted Tyso's linux code.
[1] add EN_ENIDMAFIX - the byte-aligner on the ENI version of the card
appears to lose under heavy load so avoid using it. see comment
in midway.c for full details.
note that the Adaptec version of the card works properly under
load.
detected by Kenjiro Cho <kjc@csl.sony.co.jp> [confirmed by chuck]
fix by chuck & kjc
[2] update some freebsd specific code [from kjc]
[3] for circular buffers: ensure there is always one free slot so
that we can easily tell the difference between a full and
empty list. re-structure a few loops to reflect this.
fixes a problem with mbufs being free'd while still in DMA,
and makes drive a bit more robust.
detected and fixed by kjc
* support chip clocks != COM_FREQ, by introducing sc_frequency (for the
mainline code) and adding a frequency parameter right after the rate
parameter to comcnattach() and com_kgdb_attach().
- Make com_isa and com_multi initialize sc_frequency to COM_FREQ.
- Make i386/machdep.c and alpha/dec_xxx.c call com*attach() with the freq.
parameter.
* supio_attach_args get two more fields: a sc_ipl and a sc_arg, both ints.
- com_supio uses the first for interupt establishment (all childs will, as
soon as they exist) and the 2nd for sc_frequency.
- drsupio passes sc_ipl alway as 5, and for the "com"s, sc_arg as 16*115200
- hyper will pass sc_ipl as 6, and sc_arg as 16 * 460800
be probed several times. This fixes the "ATAPI CD probed as wd drive" problem.
Thanks to Geoff Wing <mason@primenet.com.au> for testing this on his hardware.
I also made inclusion of LPRINTF() dependent solely on the symbol
LPTDEBUG, initialized lptdebug variable to 0 instead of 1, and
matched arguments to format strings in LPRINTF() calls.
looking what's the autoconfig do on strange harware, and ATAPI_DEBUG2 is
for debuging data transfers (and is really verbose once the machine has booted
from an IDE disk).
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
at the same time instead by using two different calls. This enables
it to check more easily if the combined mode is all right.
- Improve the error checking in audio.c.
- Add a new audio property, AUDIO_PROP_INDEPENDENT, show if the
play and record settings are independent.
- Fix some buglets in audio.c.
-put all early console / KGDB initialization into 1 exported function
(com_*_attach()) each, dont use global variables anymore
-use the passed tcflag_t for port settings instead of hardwiring 8N1
-at autoconfiguration attach time, decide if the attaching device is
already console / KGDB by comparing bus tag and base addr (cgd's wish)
-export a function "com_is_console()" for use by driver frontends for
this comparision
-delay setting of cn_tab->cn_dev until autoconfiguration attach
to get the minor number right
-delete unused comcnprobe() and comcninit()
-Separate KGDB port initialization and softc related stuff to allow
KGDB to be attached in early system startup, before autoconfiguration.
-Export the variables needed by md code to hand-craft bus tag/handle.
-Fix initialization to enable interrupt by line break.
-Call DDB/KGDB at line break (move DDB call from the softirq handler
to the hard handler because it should work without a tty attached too).
a command to the 82586 for every frame to be transmitted. Instead, a
single command sets off the execution of a chain of commands consisting
of alternate XMITs and NO-OPs, where the link fields in the NO-OPs are
set to loop back onto themselves until the next XMIT is ready to go.
This trick found on a Linux WEB page.
All this induces reasonable transmission performance in my old multibus
adapter. The receiver performance is still abysmal..
- Change the way attach and open works to allow multiple audio
devices.
- Split the mulaw.c file into two to avoid dragging in mulaw
convertsion when they are not needed. Add 16 bit alaw/mulaw tables.
- Change the way audio properties are gotten.
- Recognize more versions os SoundBlaster.
- It is now possible to handle devices that want "looping" DMA,
e.g. the SoundBlaster correctly. The WSS and SB drivers use this.
To do this several new methods were introduced in audio_hw_if.
- Different silence handling (forced by previous change).
- The audio driver can now be mmap()-ed, but due to problems in
the VM system only for writing for now.
- The OSS (Linux) audio emulation takes advantage of some of the
new features.
zero. We use this later when the COMPLETE message comes in to set the
final residual count to zero. The flag is reset if the target resumes
a data phase. This obsoletes the `AUTOSAVE' quirk (for this driver).
Also, avoid overwriting the residual count if a SENSE was appended to
the current transaction.
'inline' as well as static. mark prototypes for static inline functions
as possibly unused (with __attribute__ ((unused))), to avoid generating
warnings when compiling without optimization but with most ports'
default warning flags. Clean up prototype list spacing, and make it more
consistent.
connect to their 1-wire bus like the DS2404 "EconoRAM Time Chip"
- and -
* Interface function definitions for this kind of chips. Currently only
low-level byte_read and _write, implenented as inline functions.
This functions take a struct ds_handle * (also defined here), which contains
pointers to bit-read/write and reset functions.
Eventually, prototypes for memory-access functions should go here, and the
1-wire bus should be made a BSD auto-configuration bus.
(a) The interrupt is a RESEL interrupt, and
(b) our state is SELECTING.
This condition can occur in perfectly normal operation if we are using
DMA to select the target and we are interrupted by another target
reselecting us. Per discussion with Paul Krannenburg.
Every ccb locks 64k of memory for dma buffers.
Instead of AHA_CCB_MAX ccbs using 1MByte only sc_link.openings ccbs
per device are allocated. Thus we now use only 128KByte per device present.
clock rate for this board on Alpha/PCI systems. Under x86/PCI, the
board f/w will correctly tell you "I'm running at 60Mhz", so the code
that preserved that across a board reset (which would drop the chip
back to 40Mhz) worked fine. On the 8200, the chip was saying "I'm 40Mhz"-
which wasn't true. This turned out to be okay as long as you didn't have
any FAST or UltraFast targets- In fact, setting the chip to 40Mhz allowed
you to run up to 8Mhz SCSI. Unfortunately you die bigtime on the devices
that go faster than that. The fix here is to only use what the chip tells
you the clock rate is in the cases you don't really know (sbus is the
only case where this could be different, although with 66Mhz PCI coming up,
this may change).
(1) fix a printf format (%x to print int, not %lx).
(2) fix probe of 4th chip/16th channel (used to tell whether or not the
board is a 16- or 32-port board) by removing an incorrect offset so
that the code matched its comments. (!!!)
(3) fix storage of chip number in per-channel structure so that it actually
stores the chip number, rather than the chip offset. This allows the
driver to work with more than the first four channels (i.e. with chips
other than chip number 0, which happens to have an offset of zero). (!!!)
MESSAGE_REJECT in response to SDTR or WDTR. Because of this, the
printfs that indicate refusal of sync/wide negotiation are unneeded
in normal operation. In the __NetBSD__ case, disable them by default.
They, like the other extra-verbose ahc driver boot messages, may be
reenabled with "options DEBUG". The behavior in the !__NetBSD__ case
is unchanged.
Set the encoding parameters slightly differently.
Remove the SW encoding/decodinf functions from this interface
and move them to the audio_parameter struct; this is both more efficient
and flexible.
This allows the front end to override the default DCR (byte-wide DMA,
x86 byte order, 8-byte FIFO) with different transfer size, byte order, DMA
parameters, and FIFO threshhold. If the loopback select bit is not set for
normal operation, the default is used instead.
Inspired by thoughts from Bernd Ernesti.
* epinit() had both explicit xcvr selection for 3c589 and a call
to epsetmedia(). The first is redundant; delete it, and EP_COAX_DEFAULT.
* Update comments to reflect 3c589 and 3c509B fixes. Fix typos.
this code makes equal sense for memory and I/O space, prefer to map
the PCI front end via memory space (conditionalized on a patchable kernel
variable), and do a bit of other random NetBSD-specific cleanup. (These
changes were sent to Justin Gibbs on March 28.)
in reset. If none there, try and get from the bus/platform specific code.
If a nonzero value for either, set the clock rate. This is why the PCI
card versions weren't working- they need to be set at 60MHZ, rather than
the default 40MHZ (which worked fine for the internal ISP chips on the
Alpha 8X00).
B) If a isp_poll returns failure (command never completed) to the caller
and no error is set in the xs struct, set XS_SELTIMEOUT. And then call...
C) Added isp_lostcmd function to try and ask the ISP chip about it's current
state as well as the state of commands for a particular target/lun. This is
going along to try and figure out why the very first command to the ISP always
seems to get swallowed up.
byte comparisons. Compare the ethernet addresses backwards on the
assumption that address number byte 6 has the most random distribution,
so packets not for us spend the least time in here.
we return from the driver expecting to come back due to an
interrupt, because the interrupt might not happen...
Do the untimeout in ncr53c9x_done instead of just before
almost every call to ncr53c9x_done as was done previously.
Make ncr53c9x_sense schedule its own timeout for the new
command it is starting (request sense), separate from the
timeout for the command that just completed.
- new MD variable: sc_initmodemedia, 79c960 cards can select
between two ports, but this needs to be done in the MI init mode page
- new defines for PCnet-ISA cards (79c960)
- new MD variable: sc_initmodemedia, 79c960 cards can select
between two ports, but this needs to be done in the MI init mode page
- new defines for PCnet-ISA cards (79c960)
- new MD variable: sc_initmodemedia, 79c960 cards can select
between two ports, but this needs to be done in the MI init mode page
- new defines for PCnet-ISA cards (79c960)
particularly older ones, don't do a SAVE DATA POINTER before disconnecting.
When the driver reconnects, it does an implicit RESTORE POINTERS, and
restores the data pointer from *before* the last transfer. If the driver
calculates the residual using the data pointer and doesn't account for
this, the residual will be wrong.
What we do is test for the SDEV_AUTOSAVE quirk when we see a disconnect
message, falling through to do a SAVE DATA POINTER if the quirk applies
to this target.
The workaround was suggested by Mycroft, who also provided the explanation
of the problem. Actual code was (mostly) ripped off from the 53C9x driver.
Anne Hutton <hutton@isi.edu>]:
- add support for Adaptec 155 PCI ATM cards (e.g. ANA-5940)
- add sc->is_adaptec to handle differences between cards.
- break out MID_MK_TXQ/MID_MK_RXQ seperate macros to handle
the new Adaptec format TXQ/RXQ.
- adjust en_dqneed to return 1 on ADP (since the Adaptec can
DMA anything in one DRQ/DTQ!)
- add hook for a bus specific reset function (adaptec has
a seperate reset register that needs to be hit when
resettting the midway).
- adjust DMA test to not worry about burst sizes on the
adaptec (since it handles it all for us!) and to handle
the new DTQ/DRQ format.
- add Adaptec DMA support to en_txlaunch() and en_service()
BUG FIXES:
- fixed receiver panic under heavy load ("lost mbuf in slot 0!").
when the reassembly buffer overflows, the T-bit is set in
the RDB and the data field is empty. en_service() sets up
a 4-byte (RDB size) dummy DMA without IF_ENQUEUE. but the
recv intr handling in en_intr() always does IF_DEQUEUE.
as a result, a successive recv intr loses its mbuf and
leads to a panic. the solution is to only IF_DEQUEUE if
the interrupt has non-zero length (indicating that there
is an mbuf to get). in order for this to work, EN_DQ_MK
must always be non-zero. we do this by or'ing in an unused
bit (0x80000).
reported by: Kenjiro Cho <kjc@csl.sony.co.jp>
- fix setting of transmit channel when txspeed[] is non-zero
(e.g. traffic shaping). the old scheme didn't work
properly (it allowed the same VCI to use multiple tx channels
thus defeating the txspeed[] parameter). the new scheme
statically assigns a VC to a channel when txspeed[] is set.
[note that the code to set txspeed[] isn't in the driver right
now since a MI interface to do this hasn't been made yet]
we add sc->txvc2slot[] and sc->txslot[n].nref for this.
reported by: Kenjiro Cho <kjc@csl.sony.co.jp>,
Milind M Buddihikot <milind@ccrc.wustl.edu>,
Dong Lin <dong@eecs.harvard.edu>
- when doing SRAM copies, be sure to round up the length to the next
largest word (otherwise the driver will try to do a byte clean
up DMA and then get an ID error interrupt).
MINOR CLEANUPS:
- clean up loops in DMA test
contributed by: Kenjiro Cho <kjc@csl.sony.co.jp>
- restructure and cleanup of en_read/en_write macros/inlines
- clean up some byte ordering stuff so that we are consistant throughout
the driver
Thanks to Michael Smith for reporting, Jason Thorpe for pointing to the
report, doing a quick workaround which pointed me to the right code part and
for testing the final fix.
does not supply media types, default to the "manual" type.
- Clean up the ETHER_CMP stuff slightly.
- Keep track of our carrier status, for media status requests.
Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.
For the detailed change history, look at the commit log entries for
the is-newarp branch.
the base address. This allows for a more flexible layout of buffers
in the Lance's memory.
- Add a new element 'sc_saved_csr0' to am7990_softc. It's value is or-ed
with the current csr0 value in the am7990_intr() function. This allowes
for a 'deferred' interrupt sceme.
to prepare for if_media, and to support EISA 3c59x cards:
* change epconfig() to take a short that encodes the chipset
type (3c509, or Demon/Vortex/Boomerang).
* add distinct 3c509 and Demon/Vortex/Boomerang media-sense
functions to back end.
* Add EISA match/attach support for the 3c592 and 3c597
(Demon) cards as well as the 3c509-comatibl EISA 3c509/3c579.
* Assume that ISA and ISA PnP cards are 3c509-style, until
proof to the contrary (e.g. large packet support).
Tested on 3c595, 3c590, and 3c509b. Not tested on 3c515 or Demon.
(RX_RESET, TX_RESET, GLOBAL_RESET).
Commands issued while a reset is in progress may be dropped. The driver
must wait until resets are complete; ep_complete_cmd() does so.
* Change RX_RESET, TX_RESET, GLOBAL_RESET to use ep_complete_cmd().
* Revert epconfig() to use inline RX_RESET, TX_RESET.
That avoids accidentally setting IFF_UP, which breaks both diskless boot,
and "halt" commands issued before the interface is brought up.
- if aal5 frame has a CRC error then the length field in the aal5 trailer
may not be valid, so we can not use it [and we must dump the frame]
[Yuhang Sun <sunyh@dworkin.wustl.edu> & chuck@ccrc.wustl.edu]
Newer boards (e.g., Vortex) take time to reset, and wedge on some machines.
Polling on S_COMMAND_IN_PROGRESS would be better, but that doesn't
work with xx_RESET commands on 3c509s.
CONFIG_CNTRL bits by making the "conn" argument to epconfig()
a u_int, not a u_int16_t, and by defining 100mbit media
bits in the upper 16 bits.
A redesigned interface that fixes this properly is in the pipeline.
comments in pr port-i386/2358: "if_ep/3C590 no longer working"
* Only call Vortex media-config code on PCI-attached devices, until
we know if it works on ISA and EISA large-packet devices also.
* Fix typo in printf of MAC address
look for 100mbit Xcvrs, print their names, add to ep_connectors.
* Print 10baseT as 10baseT, since media name (utp) is no longer a unique
transceiver type.
* Redo FIFO memory size printing, also show Tx/Rx split (xxx isa 3c509?).
* Print MAC address on a separate line, with 100Mbit media and fifo-ram
info it no longer fits on the same line as media types.
* Comment the fact that the "connection" media-selection code just doesn't
grok 100Mbit media.
* add code to look for 3c59x/3c90x media-select and autoconfig bits, though
we don't yet dynamically probe media when the autoconfig bit is set
(see previous bullet).
* XXX the whole connector/media code should be redone, perhaps a' la
the BSDI ifmedia design.
For now, we really only need 8 bits of media type.
* Add bogus definitions for 100mbit transcievers, to be set in the
"conn" argument to ep_config(). Should really use the same bits
as in EP_W0_CONFIG_CTRL bits, but I don't know what bits the 3c515
&c use for 100mbit media.
* Define bitflags for 100Mbit transceiver options in ep_connectors.
* Add definitions of powerup/powerdown commands. for interfaces with
power management. Should send a powerup after APM resume?
* Add definition of fragment-busmaster (vortex) START_DMA command.
* Add definition of PCI configuration-space media-present bits.
(really just EP_W3_RESET_OPTIONS remapped into pci config space.)
* Add comments describing what the #define's above are used for.
For now, we really only need 8 bits of media type.
* Add bogus definitions for 100mbit transcievers, to be set in the
"conn" argument to ep_config(). Should really use the same bits
as in EP_W0_CONFIG_CTRL bits, but I don't know what bits the 3c515
&c use for 100mbit media.
* Define bitflags for 100Mbit transceiver options in ep_connectors.
* Add definitions of powerup/powerdown commands. for interfaces with
power management. Should send a powerup after APM resume?
* Add definition of fragment-busmaster (vortex) START_DMA command.
* Add definition of PCI configuration-space media-present bits.
(really just EP_W3_RESET_OPTIONS remapped into pci config space.)
* Add comments describing what the #define's above are used for.
bit from the extended setup inquiry and key off it to:
- Force synchronous negotiation on targs > 7.
- Read additional information returned by wide cards on inquire setup.
- Read sync period on targs > 7.
- Display sync period/offset on targs > 7.
- Set scsi_link.max_target to 15.
cvs: ----------------------------------------------------------------------