the OpenBSD group to fix a problem with the default ifmedia not being
set properly in some cases with a 3c905B, leading to a panic in ifmedia_set().
Also apply a patch to force the transmit start routine to check the
transmitter to make sure it isn't wedged if the outbound tx queue appears
full. This seems to cure some problems with 'watchdog timeout' errors
cropping up in some cases. I tried to do this before by checking for the
IFF_OACTIVE flag on entry to xl_start(), but if the IFF_OACTIVE flag is
set, ether_output() won't even call xl_start(). It should work now.
Lastly, increase the size of the TX queue from 10 descriptors to 16 to
hopefully make it less likely that the TX queue will fill up.
PHYs in tl_attach(). This is mainly to suck away any possible stray
interrupts.
This prevents an intermittent problem on some systems where the adapter
probes correctly but yields a device timeout (and possible subsequent adapter
check) when configured. When I originally tested the driver, I ifconfig'ed
the interface after the system had already been booted and didn't notice
any problems, but when configuring the interface immediately at startup,
it would occasionally timeout and hang, until an adapter check interrupt
came along and reset things again. I'm not exactly sure if this is a
general problem of just something peculiar to this hardware (there are
three devices, including the tlan, all on IRQ 11) but the extra reset
shouldn't hurt anything. (It works fine with my 100Mbps Olicom adapter too.)
Thanks to Mark Taylor from Cybernet (mtaylor@cybernet.com) for allowing
me remote access to a Compaq system for debugging purposes.
changes:
- Cleaned up register access macros so that they work like the XL
driver macros (you can switch from PIO to memory-mapped mode
using a single #define -- default is still memory mapped mode).
The old 'struct overlayed onto the memory mapped register space'
cruft has been removed.
- Improved multicast filter code. The ThunderLAN has four entry
perfect filter table in addition to the 64-bit hash table: we need
one of the perfect filter entries for the station address, but we
can use the other three for multicast filtering. We arrange to put
the first three multicast group addresses in the perfect filter
slots so that commonly joined groups like the all hosts group and
the all routers group can be filtered without using up bits in the
hash table.
Note: in FreeBSD 3.0, multicast groups are stored in a doubly
linked list, however new entries are added at the head of the list
(thereby pushing existing entries down towards the tail). We want
to update the filter starting from the oldest entry to the newest
since the all hosts group is always joined first. This means we
really want to start from the tail of the list, not the head, but
to find the tail we first have to traverse the list all the way to
the end and then add entries working backwards. This is a bit of a
kludge and could be inefficient if the list is long.
- Cleaned up autonegotiation code: tl_autoneg() wasn't always setting
modes correctly.
- Cleaned up ifmedia update and status routines as well.
- Added tl_hardreset() routine to initialize the internal PHY according
to the ThunderLAN manual.
- Did away with the kludge where PHYs were treated as separate logical
interfaces. This didn't really work, especially in the case of the
newer Olicom 2326 adapters which use a Micro Linear ML6692 PHY which
provides only 100Mbps support, relying on the internal PHY for 10Mbps
support (both PHYs share the RJ45 port, with the 6692 doing all the
autonegotiation work). This kludge resulted from my misunderstanding
of the operation of the Compaq Netelligent Dual Port card (the tlan
manual mentions multiple channels, but in a different context; this
got me a little confused). The driver has been reported to work
correctly with the dual port card.
- Added dio_getbit/dio_setbit/dio_read/dio_write functions which carefully
set the ThunderLAN's indirectly accessed internal registers. This makes
the EEPROM reading code more reliable.
Hopefully I won't have to touch this again before 3.0 goes out the door.
I plan to import the 2.2.x version sometime this week.
Approved-by: jkh
insertion point into the start queue looking for entries to remove and
mark them with the 'skip' address, recording the entry furthest from the
insertion point that needs to be removed. We then go through a second
loop starting at the furthest entry to be removed and compress the start
queue. The old algorithm started at (old insert point + 1) and wrapped
through the whole queue which would end up moving the start position in
the queue out from under the nose of the scrip processor.
+ Change some messages about CCB memory allocation
+ Turn a failure to DMA map all of a transaction due to lack of
ISP queue entries into a requeue operation (instead of the
case where it had been treated the same as a DMA too big
operation).
+ put back splsoftvm around bus_dmamap_load calls.
+ cleanup (and fix a glaring bug) in the and of the dma setup
routine. Also, the dma setup routines either return CMD_QUEUED
(for success) or CMD_COMPLETE (for failure) or CMD_EAGAIN
(for requeuing for resource shortage reasons).
full condition or other error which requires us to purge the
controller's start queue of transactions for a particular device.
We were relying on the NCR CCB's program address to cause the
script engine to skip to the next entry in the queue even though
the CCB is freed (and its program address switched to the idle
loop) by this action. We now set the address in the start queue
to be the "skip" function directly.
transmitter is wedged. If so, try to unwedge it, process any descriptors
that might need to be free()d, then proceed.
- Disable the 'background' autonegotiation performed during bootstrap.
What happens currently is that the driver starts an autoneg session,
the sets a timeout in the ifnet structure and returns. Later, when the
timer expires, the watchdog routine calls the autoneg handler to check
the results of the session. The problem with this is that the session
may not complete until some point after we have started to mount NFS
filesystems, which can cause the mounts to fail. This is especially
troublesome if booting with an NFS rootfs: we need the interface up
and running before reaching the mountroot() code.
The default behavior now is to do the autoneg synchronously, i.e. wait
5 seconds for the autoneg to complete before exiting the driver attach
routine. People who want the old behavior can compile the driver with
XL_BACKGROUND_AUTONEG #defined. This has no effect on autoneg sessions
initiated by 'ifconfig xl0 media autoselect.'
This slows the probe down a little, but it's either that or botching
NFS mounts at bootup.
- If xl_setmode_mii() is called and there's an autoneg session in progress,
cancel it, _then_ set the modes.
and use this when masking/unmasking interrupts.
Maintain a mapping from (iopaic number, int pin) tuple to irq number,
and use this when configuring devices and programming the ioapics.
Previous code assumed that irq number was equal to int pin number, and
that the ioapic number was 0.
Don't let an AP enter _cpu_switch before all local apics are initialized.
generating a trap 12 panic. The code blindly assumed that in the event
of a transmit error, the packet that caused the error would still be
at the head of the driver's transmit queue (sc->xl_cdata.xl_tx_head).
However in the case of error 82 (which indicates that a transmit error
occurred after part of the transmit FIFO memory has been reclaimed)
this is not true: the TX queue has already been flushed, and the
pointer to the head of the queue is NULL, so trying to dereference
the pointer to find the transmit descriptor address causes a crash.
The code now checks for a NULL pointer before trying to reload the
chip's download pointer register. There may still be error messages
printed warning of the transmit error, but no panic should occur.
Note that this eror code is only generated with "cyclone" chipsets
(3c900B, 3c905B, and presumeably the 3c980 server adapter). It should
only appear during periods of heavy traffic, probably only on
non-switched networks.
Problem reported by: Darcy Buskermolen <darcy@ok-connect.com>
XCVR value read from the EEPROM is completely wrong. I've had one report
of a 3c900 card that returns an xcvr value of 14, which is impossible
(the manual states that all vales above 8 are reserved). If the value
is out of the expe
Add PCI vendor ID for the 3c980-TX server adapter card, which apparently
also uses the cyclone chip. Graciously supplied Mats O Jansson
<maja@cntw.com>.
Also noted by Mats, the 10mpbs cyclone adapters should be named 3c900B,
not 3c905B. I haven't actually encountered a 10mbps only cyclone adapter
yet, nor anybody who has one, but this makes sense given the naming
scheme used for the older boomerang adapters.
Removed Hauppauge EEPROM 0x10 detection as I think 0x10 should be a
PAL tuner, not NTSC.
Reinstated some Tuner Guesswork code from 1.27
Submitted by: Roger Hardiman <roger@cs.strath.ac.uk>
Added PR kern/7177 for SECAM Video Highway Xtreme with single crystal
PLL configuration submitted by Vsevolod Lobko <seva@alex-ua.com>.
In kernel configuration file add
options OVERRIDE_CARD=2
options OVERRIDE_TUNER=11
options BKTR_USE_PLL
Submitted by: Roger Hardiman <roger@cs.strath.ac.uk>
Normally the full 640x480 (768x576 PAL) image is grabbed. This ioctl
allows a smaller area from anywhere within the video image to be
grabbed, eg a 400x300 image from (50,10).
See restrictions in BT848SCAPAREA.
Submitted by: Roger Hardiman <roger@cs.strath.ac.uk>
cluster from the RX descriptor is passed up to the higher layers and
replaced with an empty buffer for the next time the descriptor comes
up in the RX ring. The xl_newbuf() routine returns ENOBUFS if it can't
obtain a new mbuf cluster, but this return value was being ignored.
Now, if buffer allocation fails, we leave the old one in place and
drop the packet. This is rude, but there's not much else that can be
done in this situation.
Without this, the driver can cause a panic if the system runs out of
MBUF clusters. Now it will complain loudly, but it shouldn't cause a
panic.
Also added another pair of missing newlines to some printf()s.
delay controls how long the driver waits for autonegotiation to
complete after setting the 'autoneg restart bit' in a PHY. In some
cases, it seems 3 seconds is not long enough: with 3c905-TX cards
(external PHY), you sometimes see 'autoneg not complete; no carrier'
errors due to the timeout being too short. (3c905B adapters seem to
be happy with 3 seconds though.)
of associated mbuf clusters) in the RX ring from 4 to 16. On my
really fast PI 400Mhz test machines, 4 descriptors (and associated
mbuf clusters) is enough to achieve decent performance without any
RX overruns. However, one person reported problems with the following
scenario:
- P90 system running FreeBSD with a 3c905B-TX adapter, slow IDE hard
disk (Quantum Bigfoot?)
- PII 266 with SCSI disks running LoseNT and also with a 3c905B-TX
- Both machines connected together via crossover cable at 100Mbps
full-duplex
- LoseNT machine writing largs amounts of data (2.5 GB work of
files each in the neighborhood of 1 to 2 MB in size) via samba to
the FreeBSD machine
In this case, the LoseNT machine is sending data very fast. Apparently
there weren't any problems initially because the user was writing to
one particular disk which was relatively fast, however after this disk
filled up and the user started writing to the second slower disk, RX
overruns would occur and sometimes the RX DMA engine would stall after
a 100 to 500MB had been transfered. The xl_rxeof() handler is supposed
to detect this condition and restart the upload engine; I'm not sure
why it doesn't, unless interrupts are being lost and the rx handler
isn't getting called.
This is still an improvement over the Linux driver, which uses 32
descriptors in its receive ring. :)
Problem reported by: Heiko Schaefer <hschaefer@fto.de>
If I'm reading the manual correctly, the 3c905B actually loses its
PCI configuration during the transition from D3(hot) back to D0, not
during the transition from D0 to D3(hot). This means it should be possible
to save the existing PCI settings, restet the power state, then restore
the PCI settings afterwards. Changed xl_attach() to attempt this first
thing before the normal PCI setup. I'm not certain this will work correctly,
but it shouldn't hurt.
If xl_init() is called while an autoneg session is in progress, the
autoneg timeout and chip state will get clobbered. Try to avoid this
by checking sc->xl_autoneg at the start of xl_init() and defer
the initialization until later if it's set. (xl_init() is always called
at the end of an autoneg session by xl_autoneg_mii().)
Problem pointed out by: Larry Baird <lab@gta.com>
stability now. ALso modify /sys/conf/files, /sys/i386/conf/GENERIC
and /sys/i386/conf/LINT to add entries for the XL driver. Deactivate
support for the XL adapters in the vortex driver. LAstly, add a man
page.
(Also added an MLINKS entry for the ThunderLAN man page which I forgot
previously.)