1) get_free_or_disc_scb was not being passed its argument correctly
in one case
2) Add protection in the form of the QOUTQCNT variable to prevent
overflowing the QOUTFIFO.
This should make SCB Paging work. Really, I mean it now. 8-)
This allows the user to add modify syscons's configuration flags using
UserConfig that will allow older/quirky hardware (most notably older IBM
ThinkPad laptops) to work with the standard boot kernel.
Inspired by: The Nomads
3COM 3C590 Etherlink III PCI,
3COM 3C595 Fast Etherlink PCI,
3COM 3C592 Etherlink III EISA,
3COM 3C590 Fast Etherlink EISA,
3COM 3C900 Etherlink XL PCI and
3COM 3C905 Fast Etherlink XL PCI.
This driver is based on OpenBSD's driver. I modified it to run under FreeBSd
and made it actually work usefully.
Afterwards, nao@tom-yam.or.jp (HAMADA Naoki) added EISA support as well as
early support for 3C900 Etherlink XL PCI and 3C905 Fast Etherlink XL PCI.
He also split up the driver in a bus independant and bus dependant parts.
Especially the 3c59X support should be pretty stable now.
Submitted by: partly nao@tom-yam.or.jp (HAMADA Naoki)
Obtained from:partly OpenBSD
appearance of this bug was the malfunctioning -M option in GNU tar (it
worked only by explicitly specifying -L).
Reviewed by: bde, and partially corrected accoring to his comments
Candidate for 2.2, IMHO even for 2.1.6.
(1) deleted #if 0
pc98/pc98/mse.c
(2) hold per-unit I/O ports in ed_softc
pc98/pc98/if_ed.c
pc98/pc98/if_ed98.h
(3) merge more files by segregating changes into headers.
new file (moved from pc98/pc98):
i386/isa/aic_98.h
deleted:
well, it's already in the commit message so I won't repeat the
long list here ;)
Submitted by: The FreeBSD(98) Development Team
Check that a received packet isn't longer than MCLBYTES. This will
sometimes happen if a cable is plugged into or removed from a live
system.
Try to cater better for early receive interrupts.
used mvi instead of mov. Luckily this code is most likely never executed
since it is only there for sanity should a target goes into the data phase
twice during a single selection or reselection.
TIMER_FREQ.
Fixed missing splx() in scrn_timer(). The bug was harmless because of the
undocumented behaviour that the ipl is automatically restored for timeout
functions (see softclock()). Perhaps we should depend on this behaviour.
Fixed the ddb fix in rev.1.176. The in_debugger flag was no use because
it only works when the debugger is entered via the keyboard hotkey. The
debugger may be entered for breakpoints and traps, and the console putc
routine has no way of knowing when it was, so the console putc routine
must (almost?) always remove the cursor image.
Not fixed: console switching in ddb doesn't work (ISTR it working), and
console 0 shouldn't be switched to for the debugger hotkey unless console
0 is /dev/console.
Fixed side effects from calling add_keyboard_randomness() in the console
getc routine by not calling it. add_keyboard_randomness() currently
always reenables interrupts on 386's and 486's. This is very bad if the
console getc routine is called from the debugger and the debugger was
entered with interrupts disabled.
Fixed preservation of initial screen and now-bogus comment about it. It
was broken by setting the initial scr_buf to `buffer' instead of Crtat.
`buffer' was full of nulls and the first scroll cleared everything above
the things written through syscons.
Submitted by: bruce (bde@freebsd.org)
SCB paging is now handled almost entirely by the sequencer and also uses
DMA. This should make SCB paging at least an order of magnitude more
efficient and vastly simplifies the implementation.
Add a few space optimizations so this code still fits on aic7770 chips.
Update comments.
bit (0x0008) in the sc driver configuration line. This way it's easy to
boink a generic kernel.
Also, document and place in an opt_ file the #define's for overriding which
serial port is the system console.
Approved by: sos
Garrett Wollman sent me this code a few weeks ago for review, and I made
some significant changes, which he in turn accepted ...
In order to make use of these changes, a device entry has to added to /dev.
Submitted by: wollman
there is keyboard input.
The mousepointer is shown again immediately if moved.
Also a function pointer used to install a userwritten extra
ioctl handler (sc_user_ioctl). This way its is possible to
install user defined videomodes etc etc. No further changes
should be in the kernel.
<net/if_arp.h> and fixed the things that depended on it. The nested
include just allowed unportable programs to compile and made my
simple #include checking program report that networking code doesn't
need to include <sys/socket.h>.
I have only tested the ABP5140 card and only with a single CDROM drive
but it seems to work fine. This driver relies on features found only in
the SCSI branch so will not work in -current until those changes
are brought in. It also doesn't have any error handling code *yet*.
The goal is to use this driver as the development platform for the new
generic SCSI layer error recovery/handling code.
PCI and EISA front ends will show up as soon as I get my hands on
the cards. There are also a few issues in the driver that I need
to clear up with AdvanSys before I can suggest sticking one of
these cards in your server. 8-)
Thanks to AdvanSys for releasing this code under a suitable copyright.
Obtained from: Ported from the Linux driver writen by
bobf@advansys.com (Bob Frey).
divisor latch registers if the registers wouldn't change.
Use the default console cfcr setting while setting the divisor
latch registers for console i/o. Input may be messed up by
transiently changing the cfcr.
Use a usual cfcr setting while setting the divisor latch registers
in the probe. This shouldn't matter, but this is not the place to
test the UART's handling of 5 bit words.
Removed a stale devfs comment.
not resuming the NIC as required for transmit. Thanks to Alan Cox
<alc@cs.rice.edu> for noticing this.
Added another performance optimization to compensate. :-)
Changed crscdt to 1...strange, but this seems to be needed for some reason
despite what the manual says.
ring that caused wrong things to happen sometimes.
Doubled the number of transmit descriptors to 128 so that the internal
FIFO in the NIC can be fully filled when dealing with small packets.
Several minor performance improvements.
- don't include <sys/ioctl.h> in any header. Include <sys/ioccom.h>
instead. This was already done in 4.4Lite for the most important
ioctl headers. Header spam currently increases kernel build
times by 10-20%. There are more than 30000 #includes (not counting
duplicates) for compiling LINT.
- include <sys/types.h> if and only it is necessary to make the header
almost self-sufficient (some ioctl headers still need structs from
elsewhere).
- uniformized idempotency ifdefs. Copied the style in the 4.4Lite
ioctl headers.
to deal with the fact that we relied on devconf to do the shutdown
callouts in various drivers. The changes in this commit are to add support
for device shutdown in this driver via the new at_shutdown() mechanism.
Similar changes need to be made to all of the other drivers that need
a shutdown routine called (if_de.c comes to mind immediately).
changes. This version should fix a number of bugs such as with auto-
speed sensing and at least one known panic.
Submitted by: Matt Thomas (matt@3am-software.com)
instead of 0 if there is no input.
syscons.c:
Added missing spl locking in sccncheckc(). Return the same value as
sccngetc() would. It is wrong for sccngetc() to return non-ASCII, but
stripping the non-ASCII bits doesn't help.
still being used just to support printing of the device name in the
probe. Restored the method used in rev.1.6 and changed it to print
the same strings as the previous revision.
Reviewed by: Paul Richards
(1) Add PC98 support to apm_bios.h and ns16550.h, remove pc98/pc98/ic
(2) Move PC98 specific code out of cpufunc.h (to pc98.h)
(3) Let the boot subtrees look more alike
Submitted by: The FreeBSD(98) Development Team
<freebsd98-hackers@jp.freebsd.org>
and xdm, possibly in general.
What was happening was that the server was doing a tcsetattr(.. TCSADRAIN)
on the mouse fd after a write. Since /dev/sysmouse had a null t_oproc,
the drain failed with EIO. Somehow this spammed XFree86 (!@&^#%*& binary
release!!), and the driver was left in a bogus state (ie: switch_in_progress
permanently TRUE).
The simplest way out was to implement a dummy scmousestart() routine to
accept any characters from the tty system and toss them into the void.
It would probably be more correct to intercept scwrite()'s to the mouse
device, but that's executed for every single write to the screen.
Supplying a start routine to eat the characters is only executed for the
mouse port during startup/shutdown, so it should be faster.
This enables other consumers of the mouse, to get it info via
moused/syscons.
In order to use it run moused (from sysconfig), and then tell
your Xserver that it should use /dev/sysmouse (mknod sysmouse c 12 128)
and it a mousesystems mouse. Everybody will be happy then :)
Remember that moused still needs to know what kind of mouse you
have..
Comments welcome, as is test results...
(A pointer to a const was misused to avoid loading loading the same
value twice, but gcc does exactly the same optimization automatically.
It can see that the value hasn't changed.)
If you define this, it means your keyboard is actually probable using the
brain-dammaged probe routine in syscons, and if the keyboard is NOT found,
then you don't want syscons to activate itself further.
This makes life sane for those of us who use serial consoles most of the
time and want "the right thing" to happen when we plug a keyboard in.
way it attaches multiple PCI buses directly to the CPU, instead of having
them hanging off from PCI to PCI bridges. This code is a hack, and will
be obsoleted by the planned rework of the PCI code, which will change the
dealing with PCI to PCI bridges and other special devices significantly.
The patch also adds a kern_devconf entry for PCI bus 0 which is assumed
to be a child of cpu0. The new PCI code will make it possible to hand out
the kern_devconf structure to a pci device being attached, since this is
(regretably, IMHO) required by a few ISA devices.
Finally there are new PCI ids for some Intel chip set devices, which had
already been known to 2.1.5R, but did not make it into -current. This closes
"kern/1558: PCI probe seems to have lost a device in -current".
with an inconsistent state. I think the return actually "can't happen".
Cleaned up style of recent changes.
I only fiddled with this because of bugs in recent changes.
note that at_shutdown has a new parameter to indicate When
during a shutdown the callout should be made. also
add a RB_POWEROFF flag to reboot "howto" parameter..
tells the reboot code in our at_shutdown module to turn off the UPS
and kill the power. bound to be useful eventually on laptops
during phk's staticize/cleanup commits. pstat needs it, the MAXCONS
option is not visible anywhere else, and pstat uses it to find the bounds
of the sccons[MAXCONS] array, which varies.
for work regardless of whether there was an interrupt. This needs more
work, it should be able to run better when there are more than 3 host
cards present, ie: all cards in polling-only mode with no IRQ. (The
host cards have a choice of 3 irq's, 11, 12, or 15, or just polling)
and then never accept for sending packet from upper layer anymore
(i.e. ping -f )
Reviewed by: David Greenman <dg@root.com>
Submitted by: amurai@spec.co.jp
blocked in a write() while waiting for the output to drain, sleep only
for tp->t_timeout, not forever. This only seems to happen when there is
either a modem lockup holding the hardware flow control down, or due to
some problem in the driver with processes attempting to write after the
modem has hung up (eg: elm, tf).
Saves about 280 butes of source per driver, 56 bytes in object size
and another 56 bytes moves from data to bss.
No functional change intended nor expected.
GENERIC should be about one k smaller now :-)
of this patch, which had not actually been reviewed by Joerg or Paul!
(I'll better stop committing files after midnight ...)
I'm now commiting the latest code, which has been reported to work.
Minor correction to the previous commit message for this file:
The first PCI Lance in a system will get a name of lnc1, the second
will be known as lnc2 and so on. An arbitrary number of cards is
supported in a system ...
before attaching. Without this fix, 3c579(EISA) never make
any H/W inturrupt.
Reviewed by: "Justin T. Gibbs" <gibbs@freefall.freebsd.org>, nao@sbl.cl.nec.co.jp and owner-current on mailing list ;-)
Submitted by: amurai@spec.co.jp, nao@sbl.cl.nec.co.jp
This code applies to several systems with integrated Ethernet
chip, for example from HP or Compaq. It should also support
PCI Ethernet cards based on the AMD PCI Lance chip.
This code has been reviewed (visually) by Paul Richards and
tested (using an ISA Lance board) by Joerg Wunsch.
Since the parameters to nearly each and every single function
had to be changed (generally from unit number to lnc_soft*),
there is some potential for buglets having crept in ...
BEWARE: If you had lnc0 configured to have the ISA probe find
your PCI Lance, then it should now be found by the PCI probe,
and should be automatically configured as pci1 (!!! note the "1").
Reviewed by: paul, joerg
(author's explaination):
Bit 15 is the flag to request a transmit complete interrupt. The
driver was apparently written to minimize interrupts, and if not for a
3-COM design quirk, everything would be just ducky.
Prior to loading the outbound packet into the FIFO, the driver checks
to see if there's enough space to contain the packet. If not, the
driver requests a transmit-available interrupt when there is
sufficient room. Unfortunately, the card is continuing to process the
prior FIFO, and by the time the driver sets the threshold for a
transmit available interrupt, the space is already available. When
this occurs, the 3COM card ignores the interrupt request, and the
driver is hung waiting for an interrupt that will never occur.
There's probably a more elegant solution, but requesting the transmit
complete interrupt was the easiest to implement. An alternative fix
might be to check free FIFO space again, after requesting the transmit
available interrupt, but I haven't bothered pursuing this. Since the
patch, my 3C590 (PCI, same FIFO interface as 3C509) has been rock
solid.
Submitted by: mevans@candle.com (Mike Evans)
based on the HD64570 chip. Both the 1 and 2 port cards is supported.
Line speeds of up to 2Mbps is possible. At this speed about 95% of the
bandwidth is usable with 486DX processors.
The standard FreeBSD sppp code is used for the link level layer. The
default protocol used is PPP. The Cisco HDLC protocol can be used by
adding "link2" to the ifconfig line in /etc/sysconfig or where ever
ifconfig is run.
At the moment only the X.21 interface is tested. The others may need
tweaks to the clock selection code.
via an ioctl (MOUSE_ACTION).
Fixed a couple of bugs (destructive cursor, uncut, jitter).
Now applications can use the mouse via the MOUSE_MODE ioctl, its
possible to have a signal sent on mouseevents, makeing an event loop
in the application take over mouseevents.
things tend to work better if you write the settings to the correct
register.. (*blush*). This subtle bug has been haunting me for ages, and
will solve a few problems that have been reported to me.
Also, take a shot at fixing the serial BREAK processing, what was there
before never really worked. (There is a PR on this I think)
Real support for a Textmode mousecursor, works by reprogramming the
charset. Together with this support for cut&paste in text mode.
To use it a userland daemon is needed (moused), which provides
the interface to the various mice protokols.
Bug fixes here and there, all known PR's closed by this update.
is only used by the icu support modules and by a few drivers that know
too much about the icu (most only use it to convert `n' to `IRQn'). isa.h
is only used by ioconf.c and by a few drivers that know too much about
isa addresses (a few have to, because config is deficient).
Original version by John Hay.
Simplified timestamp code by reading the time exactly when necessary.
This may slow down the interrupt handler with extra calls to microtime(),
but only in bad configurations - the input fifo should normally be
disabled if timestamps on input are being used, since otherwise the
timestamp won't be precisely associated with any particular input event.
The interrupt handler remains slowed down by one test and branch for
each input (and now DCD change) event - avoiding this is not practical
yet.
The simplifications also fixed:
- timestamps for input sometimes being clobbered by output and modem
status interrupts.
- valid timestamps not being available unless the port is configured with
vector siointrts. siointrts no longer exists.
- compiler warnings about siointr* in some configurations.
Simplified timestamp and probe code by depending on recent changes in
microtime() and DELAY() to preserve the interrupt enable flag.
parameters to printf() using the "D" format. (Why this even worked on
my box during testing I don't know, but as soon as I powered it on/off
it quite working.)
using the existing files using the existing PCCARD support. Now that
this is in place I would like to fixup the PCCARD hooks and remove the
if_zp driver. At this point, we support everything we used to support
*AND MORE* with the PCCARD code.
Submitted by: Naoki Hamada <nao@sbl.cl.nec.co.jp> (via the Nomad release)
[ This works on both my 3C589B and 3C589C ]
My 3C509B-COMBO works fine with the following patch. Switching between
UTP and BNC is quite easy. (Just type 'ifconfig ep0 link1 -link2' or 'ifconifg
ep0 link2 -link1'.)
[ I tested this with the additional PC-CARD patches and it works on both
connectors on my 3C589B and 3C589C ]
Reviewed by: nate
Submitted by: Naoki Hamada <nao@sbl.cl.nec.co.jp>
All new code is "#ifdef PC98"ed so this should make no difference to
PC/AT (and its clones) users.
Ok'd by: core
Submitted by: FreeBSD(98) development team
mode when this occurs and allow the target to complete the transaction.
Force a retry on overruns since they are usually caused by termination or
cable problems.
on the baud rate, dont get upset if it's been hung up by setting B0.
Instead, sleep for a short time, as the host controller takes a while
to go through the state changes.
seeing SPIORDY and checking for PHASEMIS. My last change turned out to
be less cosmetic then I thought.
Pointed out by: Satoshi Asami <asami@cs.berkeley.edu>,
Faried Nawaz <fn@pain.csrv.uidaho.edu
Cosmetic change to p_mesgout code so that it "looks" the same as what
is done in the inb* routines.
NetBSD/OpenBSD support Submitted by:Noriyuki Soda <soda@sra.co.jp>,
Pete Bentley <pete@demon.net>,
Charles M. Hannum <mycroft@mit.edu>,
Theo de Raadt <deraadt@theos.com>
phasemiss to sneak by without detection. This should fix the
Wide/Narrow boot problems that have been reported since this bug
caused the driver ignore a narrow target rejecting wide negotiation.
I spent the better part of a day trying to figure out why my
experiment didn't work the way I expected, only to find out that
the router was dropping huge numbers of packets because of PCI bus
priblems. This does not fix the bug that errors are counted as
input packets because my patch doesn't apply cleanly.
is enabled by having an "device ed0 at isa? [...]" config line.
The first PCI card will get a unit number one higher than the highest
defined for any ISA card of the ED type, e.g. if ed0 and ed1 are
configured, then the PCI cards will be ed2, ed3, ...
BEWARE: If you have configured your kernel as ed0 with the port address
as assigned by the PCI BIOS, then your card will be found by both the
PCI and ISA probes, and bad things may happen. Make sure to restore
the original port address form the GENERIC kernel for the ed0 device!
Reviewed by: davidg