History log of /freebsd-10-stable/sys/pci/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
310076 14-Dec-2016 avg

MFC r308529: intpm: clean up intsmb_bread and intsmb_pcall

306815 07-Oct-2016 avg

MFC r306218,306290: amdsbwd, intpm: unify bits specific to AMD chipsets

306141 21-Sep-2016 avg

MFC r305602: intpm: fix attachment to supported AMD FCHs

306125 21-Sep-2016 avg

MFC r305606: intpm: make sure to register smbus driver before intpm driver

306123 21-Sep-2016 avg

MFC r305604: intpm: better clean up resources after a failed attachment

306121 21-Sep-2016 avg

MFC r305603: intpm: do not try attaching to unsupported controller revisions

305463 06-Sep-2016 avg

MFC r304674: intpm: add support for SB800

292780 27-Dec-2015 marius

MFC: r271864

Move rl(4) to dev/rl.

264442 14-Apr-2014 yongari

MFC r263957:
Increase the number of TX DMA segments from 32 to 35. It turned
out 32 is not enough to support a full sized TSO packet.
While I'm here fix a long standing bug introduced in r169632 in
bce(4) where it didn't include L2 header length of TSO packet in
the maximum DMA segment size calculation.

262391 23-Feb-2014 marius

MFC: r261531

- Implement the RX EARLYOFF and RXDV GATED bits as done by RealTek's Linux
driver as iof version 8.037.00 for RTL8168{E-VL,EP,F,G,GU} and RTL8411B.
This makes reception of packets work with the RTL8168G (HW rev. 0x4c000000)
in my Shuttle DS47.
- Consistently use RL_MSI_MESSAGES.
In joint forces with: yongari

262389 23-Feb-2014 marius

MFC: r261529

Try to make the style used here consistent.

257617 04-Nov-2013 yongari

MFC r257306:
Add preliminary support for RTL8168EP.
Approved by: re (delphij)

257615 04-Nov-2013 yongari

MFC r257305:
Add preliminary support for RTL8168G, RTL8168GU and RTL8411B.
RTL8168GU has two variants(GMII and MII) but it uses the same chip
revision id. Driver checks PCI device id of controller and
sets internal capability flag(i.e. jumbo frame and link speed down
in WOL).
Approved by: re (delphij)

257610 04-Nov-2013 yongari

MFC r256828:
Add preliminary support for RTL8106E PCIe FastEthernet.
Approved by: re (delphij)

257608 04-Nov-2013 yongari

r256827:
Correct MAC revision bits. Previously it always cleared bit 20 and
bit 21.
Approved by: re (delphij)

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


254263 12-Aug-2013 scottl

Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCI
command register. The lazy BAR allocation code in FreeBSD sometimes
disables this bit when it detects a range conflict, and will re-enable
it on demand when a driver allocates the BAR. Thus, the bit is no longer
a reliable indication of capability, and should not be checked. This
results in the elimination of a lot of code from drivers, and also gives
the opportunity to simplify a lot of drivers to use a helper API to set
the busmaster enable bit.

This changes fixes some recent reports of disk controllers and their
associated drives/enclosures disappearing during boot.

Submitted by: jhb
Reviewed by: jfv, marius, achadd, achim
MFC after: 1 day


249585 17-Apr-2013 gabor

- Corrrect mispellings of word useful

Submitted by: Christoph Mallon <christoph.mallon@gmx.de> (via private mail)


247095 21-Feb-2013 glebius

Fix build.


247070 21-Feb-2013 imp

Most other giant locked storage drivers in the tree don't use
splsoftclock to note the need for future locking, so remove it from
here.


247067 21-Feb-2013 imp

Kill now-bogus splhigh() -- it is a nop


246037 28-Jan-2013 jhb

Mark 'ticks', 'time_second', and 'time_uptime' as volatile to prevent the
compiler from caching their values in tight loops.

Reviewed by: bde
MFC after: 1 week


245485 16-Jan-2013 yongari

Add D-Link DFE-520TX rev C1.

Tested by: Ruslan Makhmatkhanov < cvs-src <> yandex dot ru >
MFC After: 1 week


243882 05-Dec-2012 glebius

Mechanically substitute flags from historic mbuf allocator with
malloc(9) flags within sys.

Exceptions:

- sys/contrib not touched
- sys/mbuf.h edited manually


242625 05-Nov-2012 dim

Remove duplicate const specifiers in many drivers (I hope I got all of
them, please let me know if not). Most of these are of the form:

static const struct bzzt_type {
[...list of members...]
} const bzzt_devs[] = {
[...list of initializers...]
};

The second const is unnecessary, as arrays cannot be modified anyway,
and if the elements are const, the whole thing is const automatically
(e.g. it is placed in .rodata).

I have verified this does not change the binary output of a full kernel
build (except for build timestamps embedded in the object files).

Reviewed by: yongari, marius
MFC after: 1 week


234338 16-Apr-2012 avg

intpm: add ATI IXP400 pci id

PR: kern/136762
Submitted by: Aurelien Mere <freebsd@amc-os.com>
Tested by: Jens Link <jens.link@gmx.de>
MFC after: 5 days


234043 08-Apr-2012 avg

intpm: return only SMB bus error codes from SMB methods

PR: kern/25733
MFC after: 5 days


234040 08-Apr-2012 avg

intpm: reflect the fact that SB800 and later AMD chipsets are not supported

They do not have compatible configuration registers in PCI configuration
space. Instead their configuration resides in AMD "PM I/O" space
(accessed via a pair of I/O space registers).

MFC after: 5 days


232145 25-Feb-2012 yongari

Use correct Config registers for RTL8139 family. Unlike RTL8168 and
RTL810x family , RTL8139 has different register map for Config
registers.

While here, follow the lead of re(4) in WOL configuration.
- Disable WOL_UCAST and WOL_MCAST capabilities by default.
- Config5 register write does not need to unlock EEPROM access
on RTL8139 family but unlocking EEPROM access does not affect
its operation and make it consistent with re(4).

Reported by: Matt Renzelmann mjr <> cs dot wisc dot edu


227916 23-Nov-2011 yongari

To save more power, switch to 10/100Mbps link when controller is
put into suspend/shutdown. Old PCI controllers performed that
operation in firmware but for RTL8111C or newer controllers, it's
responsibility of driver. It's not clear whether the firmware of
RTL8111B still downgrades its speed to 10/100Mbps so leave it as it
was.


227914 23-Nov-2011 yongari

Make sure to stop TX MAC before freeing queued TX frames.
For RTL8111DP, check if the TX MAC is active by reading RL_GTXSTART
register. For RTL8402/8168E-VL/8168F/8411, wait until TX queue is
empty.


227843 22-Nov-2011 marius

- There's no need to overwrite the default device method with the default
one. Interestingly, these are actually the default for quite some time
(bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9)
since r52045) but even recently added device drivers do this unnecessarily.
Discussed with: jhb, marcel
- While at it, use DEVMETHOD_END.
Discussed with: jhb
- Also while at it, use __FBSDID.


227639 17-Nov-2011 yongari

Add preliminary support for RTL8168/8111F PCIe Gigabit ethernet.

H/W donated by: RealTek Semiconductor Corp.


227638 17-Nov-2011 yongari

Add preliminary support for second generation RTL8105E PCIe
FastEthernet.

H/W donated by: RealTek Semiconductor Corp.


227593 16-Nov-2011 yongari

Disable PCIe ASPM (Active State Power Management) for all
controllers.
More and more RealTek controllers started to implement EEE feature.
Vendor driver seems to load a kind of firmware for EEE with
additional PHY fixups. It is known that the EEE feature may need
ASPM support. Unfortunately there is no documentation for EEE of
the controller so enabling ASPM may cause more problems.


227590 16-Nov-2011 yongari

Add preliminary support for RTL8411 PCIe Gigabit ethernet with
integrated card reader.

H/W donated by: RealTek Semiconductor Corp.


227587 16-Nov-2011 yongari

Add preliminary support for RTL8402 PCIe FastEthernet with
integrated card reader.

H/W donated by: RealTek Semiconductor Corp.


226995 01-Nov-2011 marius

- Import the common MII bitbang'ing code from NetBSD and convert drivers to
take advantage of it instead of duplicating it. This reduces the size of
the i386 GENERIC kernel by about 4k. The only potential in-tree user left
unconverted is xe(4), which generally should be changed to use miibus(4)
instead of implementing PHY handling on its own, as otherwise it makes not
much sense to add a dependency on miibus(4)/mii_bitbang(4) to xe(4) just
for the MII bitbang'ing code. The common MII bitbang'ing code also is
useful in the embedded space for using GPIO pins to implement MII access.
- Based on lessons learnt with dc(4) (see r185750), add bus barriers to the
MII bitbang read and write functions of the other drivers converted in
order to ensure the intended ordering. Given that register access via an
index register as well as register bank/window switching is subject to the
same problem, also add bus barriers to the respective functions of smc(4),
tl(4) and xl(4).
- Sprinkle some const.

Thanks to the following testers:
Andrew Bliznak (nge(4)), nwhitehorn@ (bm(4)), yongari@ (sis(4) and ste(4))
Thanks to Hans-Joerg Sirtl for supplying hardware to test stge(4).

Reviewed by: yongari (subset of drivers)
Obtained from: NetBSD (partially)


226478 17-Oct-2011 yongari

Close a race where SIOCGIFMEDIA ioctl get inconsistent link status.
Because driver is accessing a common MII structure in
mii_pollstat(), updating user supplied structure should be done
before dropping a driver lock.

Reported by: Karim (fodillemlinkarimi <> gmail dot com)


224506 30-Jul-2011 yongari

Add new device id of D-Link DGE-530T Rev. C controller. DGE-503T
Rev A1 and B1 is supported by sk(4) but the DGE-530T Rev. C
controller is re-branded RealTek 8169 controller.

PR: kern/159116
Approved by: re (kib)


219902 23-Mar-2011 jhb

Do a sweep of the tree replacing calls to pci_find_extcap() with calls to
pci_find_cap() instead.


218760 16-Feb-2011 yongari

Add initial support for RTL8401E PCIe Fast Ethernet.

PR: 154789


217911 26-Jan-2011 yongari

Add support for RTL8105E PCIe Fast Ethernet controller. It seems
the controller has a kind of embedded controller/memory and vendor
applies a large set of magic code via undocumented PHY registers in
device initialization stage. I guess it's a firmware image for the
embedded controller in RTL8105E since the code is too big compared
to other DSP fixups. However I have no idea what that magic code
does and what's purpose of the embedded controller. Fortunately
driver seems to still work without loading the firmware.

While I'm here change device description of RTL810xE controller.

H/W donated by: Realtek Semiconductor Corp.


217902 26-Jan-2011 yongari

Do not use interrupt taskqueue on controllers with MSI/MSI-X
capability. One of reason using interrupt taskqueue in re(4) was
to reduce number of TX/RX interrupts under load because re(4)
controllers have no good TX/RX interrupt moderation mechanism.
Basic TX interrupt moderation is done by hardware for most
controllers but RX interrupt moderation through undocumented
register showed poor RX performance so it was disabled in r215025.
Using taskqueue to handle RX interrupt greatly reduced number of
interrupts but re(4) consumed all available CPU cycles to run the
taskqueue under high TX/RX network load. This can happen even with
RTL810x fast ethernet controller and I believe this is not
acceptable for most systems.

To mitigate the issue, use one-shot timer register to moderate RX
interrupts. The timer register provides programmable one-shot timer
and can be used to suppress interrupt generation. The timer runs at
125MHZ on PCIe controllers so the minimum time allowed for the
timer is 8ns. Data sheet says the register is 32 bits but
experimentation shows only lower 13 bits are valid so maximum time
that can be programmed is 65.528us. This yields theoretical maximum
number of RX interrupts that could be generated per second is about
15260. Combined with TX completion interrupts re(4) shall generate
less than 20k interrupts. This number is still slightly high
compared to other intelligent ethernet controllers but system is
very responsive even under high network load.

Introduce sysctl variable dev.re.%d.int_rx_mod that controls amount
of time to delay RX interrupt processing in units of us. Value 0
completely disables RX interrupt moderation. To provide old
behavior for controllers that have MSI/MSI-X capability, introduce
a new tunable hw.re.intr_filter. If the tunable is set to non-zero
value, driver will use interrupt taskqueue. The default value of
the tunable is 0. This tunable has no effect on controllers that
has no MSI/MSI-X capability or if MSI/MSI-X is explicitly disabled
by administrator.

While I'm here cleanup interrupt setup/teardown since re(4) uses
single MSI/MSI-X message at this moment.


217868 25-Jan-2011 yongari

Remove TX taskqueue and directly invoke re_start in interrupt task.


217857 25-Jan-2011 yongari

Prefer MSI-X to MSI on controllers that support MSI-X. All
recent PCIe controllers(RTL8102E or later and RTL8168/8111C or
later) supports either 2 or 4 MSI-X messages. Unfortunately vendor
did not publicly release RSS related information yet. However
switching to MSI-X is one-step forward to support RSS.


217524 18-Jan-2011 yongari

Change model names of controller RTL_HWREV_8168_SPIN[123] to real ones.
s/RL_HWREV_8168_SPIN1/RL_HWREV_8168B_SPIN1/g
s/RL_HWREV_8168_SPIN2/RL_HWREV_8168B_SPIN2/g
s/RL_HWREV_8168_SPIN3/RL_HWREV_8168B_SPIN3/g
No functional changes.


217499 17-Jan-2011 yongari

Implement initial jumbo frame support for RTL8168/8111 C/D/E PCIe
GbE controllers. It seems these controllers no longer support
multi-fragmented RX buffers such that driver have to allocate
physically contiguous buffers.

o Retire RL_FLAG_NOJUMBO flag and introduce RL_FLAG_JUMBOV2 to
mark controllers that use new jumbo frame scheme.
o Configure PCIe max read request size to 4096 for standard frames
and reduce it to 512 for jumbo frames.
o TSO/checksum offloading is not supported for jumbo frames on
these controllers. Reflect it to ioctl handler and driver
initialization.
o Remove unused rl_stats_no_timeout in softc.
o Embed a pointer to structure rl_hwrev into softc to keep track
of controller MTU limitation and remove rl_hwrev in softc since
that information is available through a pointer to structure
rl_hwrev.

Special thanks to Realtek for donating sample hardwares which made
this possible.

H/W donated by: Realtek Semiconductor Corp.


217498 17-Jan-2011 yongari

Add initial support for RTL8168E/8111E-VL PCIe GbE.

H/W donated by: Realtek Semiconductor Corp.


217246 10-Jan-2011 yongari

Implement TSO on RealTek RTL8168/8111 C or later controllers.
RealTek changed TX descriptor format for later controllers so these
controllers require MSS configuration in different location of TX
descriptor. TSO is enabled by default for controllers that use new
descriptor format.
For old controllers, TSO is still disabled by default due to broken
frames under certain conditions but users can enable it.
Special thanks to Hayes Wang at RealTek.

MFC after: 2 weeks


215020 08-Nov-2010 yongari

Remove standard PCI configuration space register definitions.


215019 08-Nov-2010 yongari

Remove trailing white spaces.


215018 08-Nov-2010 yongari

Consistently use tab character instead of using space character.
No functional changes.


215017 08-Nov-2010 yongari

Follow the lead of vendor's interrupt moderation mechanism.
It seems RTL8169/RTL8168/RTL810xE has a kind of interrupt
moderation mechanism but it is not documented at all. The magic
value dramatically reduced number of interrupts without noticeable
performance drops so apply it to all RTL8169/RTL8169 controllers.
Vendor's FreeBSD driver also applies it to RTL810xE controllers but
their Linux driver explicitly cleared the register, so do not
enable interrupt moderation for RTL810xE controllers.

While I'm here sort 8169 specific registers.

Obtained from: RealTek FreeBSD driver


214844 05-Nov-2010 yongari

Add simple MAC statistics counter reading support. Unfortunately
useful counters like rl_missed_pkts is 16 bits quantity which is
too small to hold meaningful information happened in a second. This
means driver should frequently read these counters in order not to
lose accuracy and that approach is too inefficient in driver's
view. Moreover it seems there is no way to trigger an interrupt to
detect counter near-full or wraparound event as well as lacking
clearing the MAC counters. Another limitation of reading the
counters from RealTek controllers is lack of interrupt firing at
the end of DMA cycle of MAC counter read request such that driver
have to poll the end of the DMA which is a time consuming process
as well as inefficient. The more severe issue of the MAC counter
read request is it takes too long to complete the DMA. All these
limitation made maintaining MAC counters in driver impractical. For
now, just provide simple sysctl interface to trigger reading the
MAC counters. These counters could be used to track down driver
issues. Users can read MAC counters maintained in controller with
the following command.
#sysctl dev.re.0.stats=1

While I'm here add check for validity of dma map and allocated
memory before unloading/freeing them.

Tested by: rmacklem


213893 15-Oct-2010 marius

Convert the PHY drivers to honor the mii_flags passed down and convert
the NIC drivers as well as the PHY drivers to take advantage of the
mii_attach() introduced in r213878 to get rid of certain hacks. For
the most part these were:
- Artificially limiting miibus_{read,write}reg methods to certain PHY
addresses; we now let mii_attach() only probe the PHY at the desired
address(es) instead.
- PHY drivers setting MIIF_* flags based on the NIC driver they hang
off from, partly even based on grabbing and using the softc of the
parent; we now pass these flags down from the NIC to the PHY drivers
via mii_attach(). This got us rid of all such hacks except those of
brgphy() in combination with bce(4) and bge(4), which is way beyond
what can be expressed with simple flags.

While at it, I took the opportunity to change the NIC drivers to pass
up the error returned by mii_attach() (previously by mii_phy_probe())
and unify the error message used in this case where and as appropriate
as mii_attach() actually can fail for a number of reasons, not just
because of no PHY(s) being present at the expected address(es).

Reviewed by: jhb, yongari


213796 13-Oct-2010 yongari

Rewrite interrupt handler to give fairness for both RX and TX.
Previously rl(4) continuously checked whether there are RX events
or TX completions in forever loop. This caused TX starvation under
high RX load as well as consuming too much CPU cycles in the
interrupt handler. If interrupt was shared with other devices which
may be always true due to USB devices in these days, rl(4) also
tried to process the interrupt. This means polling(4) was the only
way to mitigate the these issues.

To address these issues, rl(4) now disables interrupts when it
knows the interrupt is ours and limit the number of iteration of
the loop to 16. The interrupt would be enabled again before exiting
interrupt handler if the driver is still running. Because RX buffer
is 64KB in size, the number of iterations in the loop has nothing
to do with number of RX packets being processed. This change
ensures sending TX frames under high RX load.

RX handler drops a driver lock to pass received frames to upper
stack such that there is a window that user can down the interface.
So rl(4) now checks whether driver is still running before serving
RX or TX completion in the loop.

While I'm here, exit interrupt handler when driver initialized
controller.

With this change, now rl(4) can send frames under high RX load even
though the TX performance is still not good(rl(4) controllers can't
queue more than 4 frames at a time so low TX performance was one of
design issue of rl(4) controllers). It's much better than previous
TX starvation and you should not notice RX performance drop with
this change. Controller still shows poor performance under high
network load but for many cases it's now usable without resorting
to polling(4).

MFC after: 2 weeks


213306 30-Sep-2010 yongari

Rename rl_setmulti() to rl_rxfilter() as rl_rxfilter() will handle
IFF_ALLMULTI/IFF_PROMISC as well as multicast filter configuration.
Rewrite RX filter logic to reduce number of register accesses and
make it handle promiscuous/allmulti toggling without controller
reinitialization.

Previously rl(4) counted on controller reinitialization to reprogram
promiscuous configuration but r211767 resulted in avoiding
controller reinitialization whenever promiscuous mode is toggled.
To address this, keep track of driver's view of interface state and
handle IFF_ALLMULTI/IFF_PROMISC changes without reinitializing
controller. This should fix a regression introduced in r211267.

While I'm here remove unnecessary variable reassignment in ioctl
handler.

PR: kern/151079
MFC after: 1 week


211767 24-Aug-2010 yongari

Remove unnecessary controller reinitialization.

PR: kern/87506


211648 22-Aug-2010 yongari

It seems some newer RTL8139 controllers provides only memory space
register mapping. I'm not sure whether it comes from the fact that
controllers live behind certain PCI brdge(PLX PCI 6152 33BC) and
the bridge has some issues in handling I/O space register mapping.
Unfortunately it's not possible to narrow down to an exact
controller that shows this issue because RealTek used the same PCI
device/revision id again. In theory, it's possible to check parent
PCI bridge device and change rl(4) to use memory space register
mapping if the parent PCI bridge is PLX PCI 6152. But I didn't try
to do that and we wouldn't get much benefit with added complexity.

Blindly switching to use memory space register mapping for rl(4)
may make most old controllers not to work. At least, I don't want
to take potential risk from such change. So use I/O space register
mapping by default but give users chance to override it via a
tunable. The tunable to use memory space register mapping would be
given by adding the following line to /boot/loader.conf file.

dev.rl.%d.prefer_iomap="0"

This change makes P811B quad-port work with this tunable.

Tested by: Nikola Kalpazanov ( n.kalpazanov <> gmail dot com )
MFC after: 1 week


210244 19-Jul-2010 yongari

Implement WOL. WOL is supported on RTL8139B or newer controllers.

PR: kern/148013


207554 03-May-2010 sobomax

Add new tunable 'net.link.ifqmaxlen' to set default send interface
queue length. The default value for this parameter is 50, which is
quite low for many of today's uses and the only way to modify this
parameter right now is to edit if_var.h file. Also add read-only
sysctl with the same name, so that it's possible to retrieve the
current value.

MFC after: 1 month


206436 09-Apr-2010 yongari

Consistently use capital letters.


206433 09-Apr-2010 yongari

Add preliminary support for 8168E/8111E PCIe controller.
While I'm here simplify device description string.

Tested by: Michael Beckmann < michael <> apfel dot de >
MFC after: 5 days


203082 27-Jan-2010 yongari

Add initial support for RTL8103E PCIe fastethernet.

PR: kern/142974


202931 24-Jan-2010 gavin

Add support for four more nfsmb controllers, shipping on at least the
ASUS Atom ION boards.

PR: kern/142571
Submitted by: oliver
Approved by: ed (mentor)
MFC after: 1 week


201758 07-Jan-2010 mbr

Remove extraneous semicolons, no functional changes.

Submitted by: Marc Balmer <marc@msys.ch>
MFC after: 1 week


197325 19-Sep-2009 avg

intpm/sb700: force polling mode if configured interrupt is SMI

instead of failing to attach


197128 12-Sep-2009 avg

intpm: add support for smbus controller found in AMD SB700

According to the specifications AMD/ATI SMBus controller is very
similar to SMBus controller found in PIIX4.
Some notable differences:
o different bit for enabling/signalling regular interrupt mode
o in practice seems to support only polling mode
Thus, intpm driver is modified to support polling-only mode
and to recognize SB700 PCI ID and differences.

Tested on: SB700 and PIIX4E platforms
Reviewed by: jhb
MFC after: 2 weeks
X-Perhaps-ToDo: rename the driver to reflect its function
and supported hardware


196516 24-Aug-2009 yongari

Add RTL8168DP/RTL8111DP device id. While I'm here append "8111D" to
the description of RTL8168D as RL_HWREV_8168D can be either
RTL8168D or RTL8111D.

PR: kern/137672
MFC after: 3 days


195675 14-Jul-2009 avatar

Adding hardware ID for RTL810x PCIe found on HP Pavilion DV2-1022AX.

Reviewed by: yongari
Approved by: re (kib, kensmith)


195049 26-Jun-2009 rwatson

Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/
IF_ADDR_UNLOCK() across network device drivers when accessing the
per-interface multicast address list, if_multiaddrs. This will
allow us to change the locking strategy without affecting our driver
programming interface or binary interface.

For two wireless drivers, remove unnecessary locking, since they
don't actually access the multicast address list.

Approved by: re (kib)
MFC after: 6 weeks


193096 30-May-2009 attilio

When user_frac in the polling subsystem is low it is going to busy the
CPU for too long period than necessary. Additively, interfaces are kept
polled (in the tick) even if no more packets are available.
In order to avoid such situations a new generic mechanism can be
implemented in proactive way, keeping track of the time spent on any
packet and fragmenting the time for any tick, stopping the processing
as soon as possible.

In order to implement such mechanism, the polling handler needs to
change, returning the number of packets processed.
While the intended logic is not part of this patch, the polling KPI is
broken by this commit, adding an int return value and the new flag
IFCAP_POLLING_NOCOUNT (which will signal that the return value is
meaningless for the installed handler and checking should be skipped).

Bump __FreeBSD_version in order to signal such situation.

Reviewed by: emaste
Sponsored by: Sandvine Incorporated


191301 20-Apr-2009 yongari

For RTL8139C+ controllers, have controller handle padding short
checksum offload frames. Software workaround used for broken
controllers(RTL8169, RTL8168, RTL8168B) seem to cause watchdog
timeouts on RTL8139C+.
Introduce a new flag RL_FLAG_AUTOPAD to mark automatic padding
feature of controller and set it for RTL8139C+ and controllers that
use new descriptor format. This fixes watchdog timeouts seen on
RTL8139C+.

Reported by: Dimitri Rodis < DimitriR <> integritasystems dot com >
Tested by: Dimitri Rodis < DimitriR <> integritasystems dot com >


189882 16-Mar-2009 avg

intpm: minor enhancements

1. fix nointr check in intsmb_start, matters only if ENABLE_ALART is
defined (by default, it is not);
2. drop unnecessary inspection/reporting of power-management io registers
base address;
3. in verbose mode report errors from SMBus host controller and their
mapping to smbus(4) errors;

Approved by: jhb (mentor)


189317 03-Mar-2009 imp

The callback takes a void *, not a caddr_t * (sic).
Except for the bb callback, which takes a caddr_t and not a caddr_t *.


188474 11-Feb-2009 yongari

Allocating 2 MSI messages do not seem to work on certain controllers
so use just 1 MSI message. This fixes regression introduced in
r188381.

Tested by: many


188392 09-Feb-2009 fjoe

Destroy TX tag outside of loop scope.

Found with: Coverity Prevent(tm)
CID: 3886


187483 20-Jan-2009 jkim

- Add support for 8110SCe part. Some magic registers were taken from
Linux driver.
- Swap hardware revisions for 8110S and 8169S as Linux driver claims.

Reviewed by: yongari (early version)


187482 20-Jan-2009 jkim

Retire RL_FLAG_INVMAR bit to match its comment and reality.


187417 19-Jan-2009 yongari

Sometimes RTL8168B seems to take long time to access GMII registers
in device attach phase. Double GMII register access timeout value
to fix the issue.

Reported by: wkoszek
Tested by: wkoszek


186390 22-Dec-2008 yongari

Since we don't request reset for rlphy(4), the link state 'UP'
event from mii(4) may not be delivered if valid link was already
established. To address the issue, check current link state after
driving MII_TICK. This should fix a regression introduced in
r184245.

PR: kern/129647


186214 17-Dec-2008 yongari

It seems that RealTek PCIe controllers require an explicit Tx poll
command whenever Tx completion interrupt is raised. The Tx poll
bit is cleared when all packets waiting to be transferred have been
processed. This means the second Tx poll command can be silently
ignored as the Tx poll bit could be still active while processing
of previous Tx poll command is in progress.
To address the issue re(4) used to invoke the Tx poll command in Tx
completion handler whenever it detects there are pending packets in
TxQ. However that still does not seem to completely eliminate
watchdog timeouts seen on RealTek PCIe controllers. To fix the
issue kick Tx poll command only after Tx completion interrupt is
raised as this would indicate Tx is now idle state such that it can
accept new Tx poll command again. While here apply this workaround
for PCIe based controllers as other controllers does not seem to
have this limitation.

Tested by: Victor Balada Diaz < victor <> bsdes DOT net >


186210 17-Dec-2008 yongari

For RTL8168C SPIN2 controllers, make sure to take the controller
out of sleep mode prior to accessing to PHY. This should fix device
attach failure seen on these controllers. Also enable the sleep
mode when device is put into sleep state.

PR: kern/123123, kern/123053


186142 15-Dec-2008 wilko

By default assume a 8139 chip if the EEPROM contents prove inconclusive. The
same LOM hardware with goofed-up EEPROM programming also needed reading the
Ethernet address from the chips registers as the EEPROM did not have a
sensible address programmed.

Patch developed by: pyun@
Funky hardware on loan: www.id-it.nl

MFC after: 2 weeks


185903 11-Dec-2008 yongari

Make WOL work on RTL8168B. This controller seems to require
explicit command to enable Rx MAC prior to entering D3.

Tested by: Cyrus Rahman <crahman <> gmail DOT com>


185901 11-Dec-2008 yongari

Don't access undocumented register 0x82 on controllers that
have no such register. While here clear undocumented PHY
register 0x0B for RTL8110S.

Obtained from: RealTek FreeBSD driver


185900 11-Dec-2008 yongari

Newer RealTek controllers requires setting stop request bit to
terminate active Tx/Rx operation.


185753 08-Dec-2008 yongari

o Implemented miibus_statchg handler. It detects whether re(4)
established a valid link or not. In miibus_statchg handler add a
check for established link is valid one for the controller(e.g.
1000baseT is not a valid link for fastethernet controllers.)
o Added a flag RE_FLAG_FASTETHER to mark fastethernet controllers.
o Added additional check to know whether we've really encountered
watchdog timeouts or missed Tx completion interrupts. This change
may help to track down the cause of watchdog timeouts.
o In interrupt handler, removed a check for link state change
interrupt. Not all controllers have the bit and re(4) did not
rely on the event for a long time. In addition, re(4) didn't
request the interrupt in RL_IMR register.

Tested by: rpaulo


185575 03-Dec-2008 yongari

Update if_iqdrops instead of if_ierrors when m_devget(9) fails.


185542 02-Dec-2008 yongari

Add 8168D support.

Submitted by: Andrew < andrewwtulloch <> gmail DOT com >


184562 02-Nov-2008 imp

Move mn over. One of the last stragglers in sys/pci. There's no
module built for this hardware, so no changes needed.


184559 02-Nov-2008 imp

Make RL_TWISTER_ENABLE a tunable/sysctl. Eliminate it as an option.
Fix module build.

Submitted by: Kostik Belousov


184524 01-Nov-2008 imp

Fix a few typos/spelling errors in my comments from the last commit,
plus a few others that had lingered in this driver...

Submitted by: "b." bf2006a att yahoo KIBO com


184515 31-Oct-2008 imp

Add RL_TWISTER_ENABLE option. This enables the magic bits to do long
cable tuning. This has helped in some installations for hardware
deployed by a former employer. Made optional because the lists aren't
full of complaints about these cards... even when they were wildly
popular.

Reviewed by: attilio@, jhb@, trhodes@ (all an older version of the patch)


184245 25-Oct-2008 yongari

Implement miibus_statchg handler. It detects whether rl(4)
established a valid link or not.
In rl_start_locked, don't try to send packets unless we have valid
link. While I'm here add a check that verifies whether driver can
accept Tx requests by inspecting IFF_DRV_OACTIVE/IFF_DRV_RUNNING
flag.


184243 25-Oct-2008 yongari

After sending stop command to MAC, give hardware chance to drain
active DMA operation.


184242 25-Oct-2008 yongari

Make rl_init_locked() call rl_reset. This will put hardware into
sane state after resume/watchdog timeouts.


184241 25-Oct-2008 yongari

Don't rearm watchdog timer in rl_txeof(). The watchdog timer was
already set in rl_start_locked(). Touching the watchdog timer in
other places will hide the root cause of watchdog timeouts.


184240 25-Oct-2008 yongari

Various bus_dma(9) fixes.
- The hardware does not support DAC so limit DMA address space to
4GB.
- Removed BUS_DMA_ALLOC_NOW flag.
- Created separated Tx buffer and Rx buffer DMA tags. Previously
it used to single DMA tag and it was not possible to specify
different DMA restrictions.
- Apply 4 bytes alignment limitation of Tx buffer.
- Apply 8 bytes alignment limitation of Rx buffer.
- Tx side bus_dmamap_load_mbuf_sg(9) support.
- Preallocate Tx DMA maps as creating DMA maps take very long time
on architectures that require real DMA maps.
- Adjust guard buffer size to 1522 + 8 as it should include VLAN
and additional reserved bytes in Rx buffer.
- Plug memory leak in device detach. Previously wrong buffer
address was used to free allocated memory.
- Added rl_list_rx_init() to clear Rx buffer and cleared the
buffer.
- Don't destroy DMA maps in rl_txeof() as the DMA map should be
reused. There is no reason to destroy/recreate the DMA maps in
this driver.
- Removed rl_dma_map_rxbuf()/rl_dma_map_txbuf() callbacks.
- The hardware does not support descriptor based DMA on Tx side
and the Tx buffer address should be aligned on 4 bytes boundary
as well as manual padding for short frames. Because of this
hardware limitation rl(4) always used to invoke m_defrag(9) to
get a 4 bytes aligned single buffer. However m_defrag(9) takes
a lot of CPU cycles on slow machines and not all packets need
the help of m_defrag(9). Armed with the information, don't
invoke m_defrag(9) if the following conditions are true.
1. Buffer is not fragmented.
2. Buffer is aligned on 4 bytes boundary.
3. Manual padding is not necessary.
4. Or padding is necessary but upper stack passed a writable
buffer and the space needed for padding is satisfied.
This change combined with preallocated DMA maps greatly
increased Tx performance of driver on sparc64.
- Moved bus_dmamap_sync(9) in rl_start_locked() to rl_encap() and
corrected memory synchronization operation specifier of
bus_dmamap_sync(9).
- Removed bus_dmamap_unload(9) in rl_stop(). There is no need to
reload/unload Rx buffer as rl(4) always have to copy from the
buffer. It just needs proper bus_dmamap_sync(9) calls before
copying the received frame.

With this change rl(4) should work on systems with more than 4GB
memory.

PR: kern/128143


181741 14-Aug-2008 imp

Move wb driver from sys/pci to sys/dev/wb.


181740 14-Aug-2008 imp

Move pcn driver from sys/pci to sys/dev/pcn.


181739 14-Aug-2008 imp

Move the ste driver from sys/pci to sys/dev/ste.


181738 14-Aug-2008 imp

Move the tl driver form sys/pci to sys/dev/tl.


181524 10-Aug-2008 imp

Move sis to sys/dev/sis for consistency.


181522 10-Aug-2008 imp

Move the xl driver form sys/pci to sys/dev/xl for consistency.


181303 04-Aug-2008 jhb

Add locking to the various iicbus(4) bridge drivers:
- Just grab Giant in the ixp425_iic(4) driver since this driver uses
a shared address/data register window pair to access the actual
I2C registers. None of the other ixp425 drivers lock access to these
shared address/data registers yet and that would need to be done before
this could use any meaningful locking.
- Add locking to the interrupt handler and 'iicbus_reset' methods of the
at91_twi(4) driver.
- Add locking to the pcf(4) driver. Other pcf(4) fixes include:
- Don't needlessly zero the softc.
- Use bus_foo rather than bus_space_foo and remove bus space tag and
handle from softc.
- The lpbb(4) driver just grabs Giant for now. This will be refined later
when ppbus(4) is locked.
- As was done with smbus earlier, move the DRIVER_MODULE() lines to match
the bus driver (either iicbus or iicbb) to the bridge driver into the
bridge drivers.

Tested by: sam (arm/ixp425)


181270 04-Aug-2008 yongari

The number of bits reserved for MSS in RealTek controllers is
11bits. This limits the maximum interface MTU size in TSO case
as upper stack should not generate TCP segments with MSS greater
than the limit. Armed with this information, disable TSO if
interface MTU is greater than the limit.


181002 30-Jul-2008 jhb

Set all of the "optimum performance" PHY registers for the 15D parts as
well as the 15C since it seems to be required in practice. The Linux
natsemi.c driver mostly does this as well.

PR: kern/112179
Submitted by: Mark Willson mark - hydrus org uk
MFC after: 1 week


181000 30-Jul-2008 jhb

SIS_SETBIT() already does a read/modify/write operation, so there isn't
a reason to read the register twice.

MFC after: 1 week


180377 09-Jul-2008 yongari

Add driver support for RTL8102E and RTL8102EL which is the second
generation of RTL810x PCIe fast ethernet controller. Note, Tx/Rx
descriptor format is different from that of first generation of
RTL8101E series. Jumbo frame is not supported for RTL810x
family.

Tested by: NAGATA Shinya ( maya AT negeta DOT com )


180177 02-Jul-2008 yongari

Add a new RTL8169 variant, 8169SB(L)/8110SB(L).

Reported by: nork
Tested by: nork


180176 02-Jul-2008 yongari

Add basic support for RTL8168C, RTL8168CP, RTL8111C and RTL8111CP.
ATM Tx/Rx checksum offload is supported but TSO and jumbo frame is
not yet supported. Because these newer controllers use different
descriptor formats, a flag RL_FLAG_DESCV2 flag was introduced to
handle that case in Tx/Rx handler. Also newer controllers seems to
require to not touch 'enable Tx/Rx bit' in RL_CPLUS_CMD register
so don't blindly try to set that bits.

Note, it seems that there is still power-saving related issue where
driver fails to attach PHY. Rebooting seems to fix that issue but
number of required reboots varys.

Many thanks to users that helped during developement. I really
appreciate their patient and test/feedbacks.


180171 02-Jul-2008 yongari

Instead of allocating variables for each events/hardware flags, use
a dedicated flag that represents controller capabilities/events.
This will simplify many part of code that requires different
workaround for each controller revisions and will enhance
readability.
While I'm here move PHY wakeup code up before mii_phy_probe() which
seems to help to wake PHY in some cases.


180169 02-Jul-2008 yongari

Switch to memory space register mapping over IO space. If that
mapping fails fall back to traditional IO space access.


179933 22-Jun-2008 gonzo

Add support for VT8237 ISA bridge.

PR: kern/120714
Event: Bugathon#5


179860 18-Jun-2008 joerg

Add the SMB functionality for the MCP65 chipset I happen to
have in my new motherboard.


179831 16-Jun-2008 remko

Add another 8139D variant.

PR: 124622
Submitted by: Evgeny Zhirnov <jirnov at gmail dot com>
Approved by: imp (mentor, implicit)
MFC after: 3 days


179622 06-Jun-2008 jhb

- Use bus_foo() rather than bus_space_foo() and remove bus space tag/handle
from softc.
- Mark interrupt handlers MPSAFE as these drivers have been locked for a
while.


179378 28-May-2008 jhb

Remove unused 'xl_unit' member from softc.


178972 12-May-2008 jhb

- Set sc->dev to the new-bus device_t so all the device_printf()s work.
- Add a missing newline to a printf.

MFC after: 1 week
Submitted by: Andriy Gapon avg <> icyb.net.ua


178054 10-Apr-2008 yongari

It seems that RealTek 8129/8139 chip reports invalid length of
received frame under certain conditions. wpaul said the length
0xfff0 is special meaning that indicates hardware is in the
process of copying a packet into host memory. But it seems
there are other cases that hardware is busy or stuck in bad
situation even if the received frame length is not 0xfff0.
To work-around this condition, add a check that verifys that
recevied frame length is in valid range. If received length is out
of range reinitialize hardware to recover from stuck condition.

Reported by: Mike Tancsa ( mike AT sentex DOT net )
Tested by: Mike Tancsa
Obtained from: OpenBSD
MFC after: 1 week


177771 31-Mar-2008 yongari

Padding more bytes than necessary one broke another variants of
PCIe RealTek chips. Only pad IP packets if the payload is less than
28 bytes.

Obtained from: NetBSD
PR: kern/122221


177599 25-Mar-2008 ru

Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT.
Removed dead code that assumed that M_TRYWAIT can return NULL; it's not true
since the advent of MBUMA.

Reviewed by: arch

There are ongoing disputes as to whether we want to switch to directly using
UMA flags M_WAITOK/M_NOWAIT for mbuf(9) allocation.


177562 24-Mar-2008 marius

- Take advantage of bus_dmamap_load_mbuf_sg(9).
- Take advantage of m_collapse(9).
- Sync with other NIC drivers and prepend a TX mbuf if the first attempt
to load it fails with an error other than EFBIG and stop trying instead
of freeing it and keeping on trying to enqueue more mbufs. Also ensure
the driver queue isn't empty before trying to enqueue mbufs in order to
reduce locking operations.
- In xl_ifmedia_upd() add a missing XL_UNLOCK(). [1]
- Const'ify the xl_devs array.
- Remove an outdated comment.

PR: 113406 [1]
MFC after: 1 month


177522 23-Mar-2008 yongari

For MSI capable hardwares, enable MSI enable bit in RL_CFG2
register. If MSI was disabled by hw.re.msi_disable tunable
expliclty clear the MSI enable bit.


177049 11-Mar-2008 yongari

vr(4) was repocopied to src/sys/dev/vr.


176757 03-Mar-2008 yongari

Don't map memory/IO resource in device probe and just use PCI
vendor/revision/sub device id of the hardware to probe it.
This is the same way as NetBSD does and it enhances readabilty
a lot.


176756 03-Mar-2008 yongari

Don't allow jumbo frame on 8139C+ controller.
While I'm here add a check for minimal MTU length.


176754 03-Mar-2008 yongari

Implement WOL.

Tested by: Fabian Keil ( freebsd-listen AT fabienkeli DOT de )


175872 01-Feb-2008 phk

Give MEXTADD() another argument to make both void pointers to the
free function controlable, instead of passing the KVA of the buffer
storage as the first argument.

Fix all conventional users of the API to pass the KVA of the buffer
as the first argument, to make this a no-op commit.

Likely break the only non-convetional user of the API, after informing
the relevant committer.

Update the mbuf(9) manual page, which was already out of sync on
this point.

Bump __FreeBSD_version to 800016 as there is no way to tell how
many arguments a CPP macro needs any other way.

This paves the way for giving sendfile(9) a way to wait for the
passed storage to have been accessed before returning.

This does not affect the memory layout or size of mbufs.

Parental oversight by: sam and rwatson.

No MFC is anticipated.


175533 21-Jan-2008 ru

Add copyrights.

PR: 119136


175523 21-Jan-2008 yongari

sf(4) was repocopied to src/sys/dev/sf.


175337 15-Jan-2008 yongari

Overhaul re(4).
o Increased number of Rx/Tx descriptors to 256 for 8169 GigEs
because it's hard to push the hardware to the limit with default
64 descriptors.
TSO requires large number of Tx descriptors to pass a full sized
TCP segment(65535 bytes IP packet) to hardware. Previously it
consumed 32 Tx descriptors, assuming MCLBYTES DMA segment size,
to send the TCP segment which means re(4) couldn't queue more
than two full sized IP packets.
For 8139C+ it still uses 64 Rx/Tx descriptors due to its hardware
limitations. With this changes there are (very) small waste of
memory for 8139C+ users but I don't think it would affect 8139C+
users for most cases.
o Various bus_dma(9) fixes.
- The hardware supports DAC so allow 64bit DMA operations.
- Removed BUS_DMA_ALLOC_NOW flag.
- Increased DMA segment size to 4096 from MCLBYTES because TSO
consumes too many descriptors with MCLBYTES DMA segment size.
- Tx/Rx side bus_dmamap_load_mbuf_sg(9) support. With these
changes the code is more readable than previous one and got a
(slightly) better performance as it doesn't need to pass/
decode arguments to/from callback function.
- Removed unnecessary callback function re_dmamap_desc() and
nuked rl_dmaload_arg structure which was used in the callback.
- Additional protection for DMA map load failure. In case of
failure reuse current map instead of returning a bogus DMA
map.
- Deferred DMA map unloading/sync operation for maximum
performance until we really need to load new DMA map. If we
happen to reuse current map(e.g. input error) there is no need
to sync/unload/load again.
- The number of allowable Tx DMA segments for a mbuf chains are
now 32 instead of magic nseg value. If the number of available
Tx descriptors are short enough to send highly fragmented mbuf
chains an optimized re_defrag() is called to collapse mbuf
chains which is supposed to be much faster than m_defrag(9).
re_defrag() was borrowed from ath(4).
- Separated Rx/Tx DMA tag from a common DMA tag such that Rx DMA
tag correctly uses DMA maps that were created with DMA alignment
restriction(8bytes alignments). Tx DMA tag does not have such
alignment limitation.
- Added additional sanity checks for DMA ring map load failure.
- Added additional spare Rx DMA map for graceful handling of Rx
DMA map load failure.
- Fixed misused bus_dmamap_sync(9) and added missing
bus_dmamap_sync(9) in re_encap()/re_txeof()/re_rxeof().
o Enabled TSO again as re(4) have reasonable number of Tx
descriptors.
o Don't touch DMA address of a Tx descriptor in re_txeof(). It's
not needed.
o Fix incorrect update of if_ierrors counter. For Rx buffer
shortage it should update if_qdrops as the buffer is reused.
o Added checks for unsupported H/W revisions and return ENXIO for
these hardwares. This is required to remove resource allocation
code in re_probe as other drivers do in device probe routine.
o Modified descriptor index manipulation macros as it's now possible
to have different number of descriptors for Rx/Tx.
o In re_start, to save a lock operation, use IFQ_DRV_IS_EMPTY before
trying to invoke IFQ_DRV_DEQUEUE. Also don't blindly call re_encap
since we already know the number of available Tx descriptors in
advance.
o Removed RL_TX_DESC_THLD which was used to reserve RL_TX_DESC_THLD
descriptors in Tx path. There is no such a limitation mentioned in
8139C+/8169/8110/8168/8101/8111 datasheet and it seems to work ok
without reserving RL_TX_DESC_THLD descriptors.
o Fix a comment for RL_GTXSTART. The register is 8bits register.
o Added comments for 8169/8139C+ hardware restrictions on descriptors.
o Removed forward declaration for "struct rl_softc", it's not needed.
o Added a new structure rl_txdesc for Tx descriptor managements and
a structure rl_rxdesc for Rx descriptor managements.
o Removed unused member variable rl_intlock in driver softc. There are
still several unused member variables which are supposed to be used
to access hardware statistics counters. But it seems that accessing
hardware counters were not implemented yet.


174428 08-Dec-2007 yongari

Add another RTL8168 revision 3 which is found on RTL8111-GR Gigabit
Ethernet Controller. Multicast filtering wasn't tested and needs more
expore. While I'm here change complex if statements with switch
statement which would improve readability.

Reported by: Abdullah Ibn Hamad Al-Marri < wearabnet AT yahoo DOT ca >
Tested by: Abdullah Ibn Hamad Al-Marri < wearabnet AT yahoo DOT ca >


174135 01-Dec-2007 phk

Remove XRPU driver, after asking all the users.


173948 26-Nov-2007 remko

Add the FNW3603TX Planex NIC.

PR: 76081
Approved by: imp (mentor)
Submitted by: umi at pocke dot org
MFC After: 3 days


173839 22-Nov-2007 yongari

Fix function prototype for device_shutdown method.


173573 12-Nov-2007 jhb

Move the agp(4) driver from sys/pci to sys/dev/agp. __FreeBSD_version was
bumped to 800004 to note the change though userland apps should not be
affected since they use <sys/agpio.h> rather than the headers in
sys/dev/agp.

Discussed with: anholt
Repocopy by: simon


173525 10-Nov-2007 remko

Add SMB support for the MCP61 chipset.

PR: 108830
Submitted by: Edwin Mons <freebsd at edwinm dot ik dot nu>
Approbed by: imp (mentor)


173203 30-Oct-2007 jhb

Split agp_generic_detach() up into two routines: agp_free_cdev() destroys
/dev/agpgart and agp_free_res() frees resources like the BAR for the
aperture. Splitting this up lets chipset-specific detach routines
manipulate the aperture during their detach routines without panicing.

MFC after: 1 week
Reviewed by: anholt


172667 15-Oct-2007 jhb

Oops, convert a tsleep() to a msleep() that was missed when adding locking
to this driver.

Reported by: Michael Butler : imb of protected-networks net


172568 12-Oct-2007 kevlo

Spelling fix for interupt -> interrupt


172555 12-Oct-2007 yongari

Not all VIA Rhine chips support 256 register space. So touching
VR_STICKHW register would result in unexpected results on these
hardwares. wpaul said the following for the issue.

The vr_attach() routine unconditionally does this for all supported
chips:

/*
* Windows may put the chip in suspend mode when it
* shuts down. Be sure to kick it in the head to wake it
* up again.
*/
VR_CLRBIT(sc, VR_STICKHW, (VR_STICKHW_DS0|VR_STICKHW_DS1));

The problem is, the VR_STICKHW register is not valid on all Rhine
devices. The VT86C100A chip, which is present on the D-Link DFE-530TX
boards, doesn't support power management, and its register space is
only 128 bytes wide. The VR_STICKHW register offset falls outside this
range. This may go unnoticed in most scenarios, but if you happen to have
another PCI device in your system which is assigned the register
space immediately after that of the Rhine, the vr(4) driver will
incorrectly stomp it. In my case, the BIOS on my test board decided
to put the register space for my PRO/100 ethernet board right next
to the Rhine, and the Rhine driver ended up clobbering the IMR register
of the PRO/100 device. (Long story short: the board kept locking up on
boot. Took me the better part of the morning suss out why.)

The strictly correct thing to do would be to check the PCI config space
to make sure the device supports the power management capability and only
write to the VR_STICKHW register if it does.

Instead of inspecting chip revision numbers for the availability of
VR_STICKHW register, check the existence of power management capability
of the hardware as wpaul suggested.

Reported by: wpaul
Suggested by: wpaul
OK'ed by: jhb


172262 21-Sep-2007 kevlo

- Add the device ID for the VIA VT3324 (CX700) chipset.
- Set and Get aperture size correctly for VIA's AGP3 chipsets.

Approved by: re (kensmith)


172187 15-Sep-2007 alc

Add the PCI id for the Intel 7221's integrated graphics controller. It is
similar to a 915G.

Approved by: re (kensmith)
Reviewed by: anholt
MFC after: 3 weeks


171744 06-Aug-2007 rwatson

Remove the now-unused NET_{LOCK,UNLOCK,ASSERT}_GIANT() macros, which
previously conditionally acquired Giant based on debug.mpsafenet. As that
has now been removed, they are no longer required. Removing them
significantly simplifies error-handling in the socket layer, eliminated
quite a bit of unwinding of locking in error cases.

While here clean up the now unneeded opt_net.h, which previously was used
for the NET_WITH_GIANT kernel option. Clean up some related gotos for
consistency.

Reviewed by: bz, csjp
Tested by: kris
Approved by: re (kensmith)


171693 02-Aug-2007 kevlo

Add the device ID for the VIA CX700 chipset.

Approved by: re (hrs)


171560 24-Jul-2007 yongari

Add MSI support.
Ever since switching to adaptive polling re(4) occasionally spews
watchdog timeouts on systems with MSI capability. This change is
minimal one for supporting MSI and re(4) also needs MSIX support
for RTL8111C in future. Because softc structure of re(4) is shared
with rl(4), rl(4) was touched to use the modified softc.

Reported by: cnst
Tested by: cnst
Approved by: re (kensmith)


171433 13-Jul-2007 anholt

Add support for G965/Q965/GM965/GME965/GME945 AGP.

This adds a function to agp.c to set the aperture resource ID if it's
not the usual AGP_APBASE. Previously, agp.c had been assuming
AGP_APBASE, which resulted in incorrect agp_info, and contortions by
agp_i810.c to work around it.

This also adds functions to agp.c for default AGP_GET_APERTURE() and
AGP_SET_APERTURE(), which return the aperture resource size and disallow
aperture size changes. Moving to these for our AGP drivers will likely
result in stability improvements. This should fix 855-class aperture
size detection.

Additionally, refuse to attach agp_i810 when some RAM is above 4GB and
the GART can't reference memory that high. This should be very rare.
The correct solution would be bus_dma conversion for agp, which is
beyond the scope of this change. Other AGP drivers could likely use
this change as well.

G33/Q35/Q33 AGP support is also included, but disconnected by default
due to lack of testing.

PR: kern/109724 (855 aperture issue)
Submitted by: FUJIMOTO Kou<fujimoto@j.dendai.ac.jp>
Approved by: re (hrs)


171263 06-Jul-2007 yongari

re(4) devices requires an external EEPROM. Depending on models it
would be 93C46(1Kbit) or 93C56(2Kbit). One of differences between them
is number of address lines required to access the EEPROM. For example,
93C56 EEPROM needs 8 address lines to read/write data. If 93C56
recevied premature end of required number of serial clock(CLK) to set
OP code/address of EEPROM, the result would be unexpected behavior.
Previously it tried to detect 93C46, which requires 6 address lines,
and then assumed it would be 93C56 if read data was not expected
value. However, this approach didn't work in some models/situations
as 93C56 requries 8 address lines to access its data. In order to fix
it, change EEPROM probing order such that 93C56 is detected reliably.

While I'm here change hard-coded address line numbers with defined
constant to enhance readability.

PR: 112710
Approved by: re (mux)


170872 17-Jun-2007 scottl

Prepare for future integration between CAM and newbus. xpt_bus_register
now takes a device_t to be the parent of the bus that is being created.
Most SIMs have been updated with a reasonable argument, but a few exceptions
just pass NULL for now. This argument isn't used yet and the newbus
integration likely won't be ready until after 7.0-RELEASE.


170794 15-Jun-2007 thompsa

The mac address must be written a word length at a time, it was having no effect before.

MFC after: 1 week


170093 29-May-2007 rwatson

Where I previously removed calls to kdb_enter(), now remove include of
kdb.h.

Pointed out by: bde


170027 27-May-2007 rwatson

Implement assert() in ncr.c using KASSERT() rather than explicitly testing
the assertion and then calling kdb_enter().


169414 09-May-2007 yar

tl(4) appears to support long frames.

Tested by: Peter Jeremy <peterjeremy at optushome dot com dot au>


168973 23-Apr-2007 phk

Add VLAN capability.

Submitted by: Slawa Olhovchenkov <slw@zxy.spb.ru>


168953 22-Apr-2007 phk

Remove the old software bit-banging MII interface, we started using
the Rhines shiftregisters in four years ago (1.60).


168952 22-Apr-2007 phk

Remove further cobwebs: Two layers of pointless substructures.


168950 22-Apr-2007 phk

Initialize the physical next pointer in the tx descriptors when we
initialize instead of in the start routine.


168948 22-Apr-2007 phk

Don't rename fields with #define.
Collapse two semantically identical structs.
Add missing vr_ prefix.


168946 22-Apr-2007 phk

Run if_vr(4) through FlexeLint and clean some of the cobwebs found.


168870 19-Apr-2007 jhb

Oops, fix intsmb(4) attach. Don't overwrite the 'value' holding the
interrupt mode with the SMB revision before checking 'value' for a valid
interrupt mode.

Reported by: Ulrich Spoerlein <uspoerlein of gmail fame>


168828 18-Apr-2007 yongari

Don't reinitialize the hardware if only PROMISC flag was changed.
Previously whenever PROMISC mode turned on/off link renegotiation
occurs and it could resulted in network unavailability for serveral
seconds.(Depending on switch STP settings it could last several tens
seconds.)

Reported by: Prokofiev S.P. < proks AT logos DOT uptel DOT net >
Tested by: Prokofiev S.P. < proks AT logos DOT uptel DOT net >


168827 17-Apr-2007 phk

Add support for hw-assisted checksums on 6105M.

Sponsored by: Soekris Engineering


168820 17-Apr-2007 phk

No need to throw tag+handle around on the stack.


168813 17-Apr-2007 phk

Improve the if_vr driver ever so slightly.

The 6105M and 6102 does not have the DWORD alignment problem, so
don't m_defrag() every packet in the transmit path for those.

More stringent usage of tx-descriptor ring and its flags.

Tested on 6102 and 6105M, other chips may also be able to run
without the m_defrag() but I have neither hardware nor docs to
find out.

Sponsored by: Soekris Engineering


168752 15-Apr-2007 scottl

Remove Giant from CAM. Drivers (SIMs) now register a mutex that CAM will
use to synchornize and protect all data objects that are used for that
SIM. Drivers that are not yet MPSAFE register Giant and operate as
usual. RIght now, no drivers are MPSAFE, though a few will be changed
in the coming week as this work settles down.

The driver API has changed, so all CAM drivers will need to be recompiled.
The userland API has not changed, so tools like camcontrol do not need to
be recompiled.


167407 10-Mar-2007 yongari

Add new ST201 PCI id.

PR: kern/108150


166940 24-Feb-2007 delphij

Convert sis(4) to use its own watchdog procedure.

Submitted by: Florian C. Smeets <flo kasimir com>


166920 23-Feb-2007 imp

Catchup with filters


166901 23-Feb-2007 piso

o break newbus api: add a new argument of type driver_filter_t to
bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Reviewed by: many
Approved by: re@


166165 21-Jan-2007 marius

Change the remainder of the drivers for DMA'ing devices enabled in the
sparc64 GENERIC and the sound device drivers known working on sparc64
to use bus_get_dma_tag() to obtain the parent DMA tag so we can get rid
of the sparc64_root_dma_tag kludge eventually. Except for ath(4), sk(4),
stge(4) and ti(4) these changes are runtime tested (unless I booted up
the wrong kernels again...).


166057 16-Jan-2007 marius

o In re_newbuf() and re_encap() if re_dma_map_desc() aborts the mapping
operation as it ran out of free descriptors or if there are too many
segments in the first place, call bus_dmamap_unload() in order to
unload the already loaded segments.
For trying to map the defragmented mbuf (chain) in re_encap() this
introduces re_dma_map_desc() setting arg.rl_maxsegs to 0 as a new
failure mode. Previously we just ignored this case, corrupting our
view of the TX ring.
o In re_txeof():
- Don't clear IFF_DRV_OACTIVE unless there are at least 4 free TX
descriptors. Further down the road re_encap() will bail if there
aren't at least 4 free TX descriptors, causing re_start() to
abort and prepend the dequeued mbuf again so it makes no sense
to pretend we could process mbufs again when in fact we won't.
While at it replace this magic 4 with a macro RL_TX_DESC_THLD
throughout this driver.
- Don't cancel the watchdog timeout as soon as there's at least one
free TX descriptor but instead only if all descriptors have been
handled. It's perfectly normal, especially in the DEVICE_POLLING
case, that re_txeof() is called when only a part of the enqueued
TX descriptors have been handled, causing the watchdog to be
disarmed prematurely.
o In re_encap():
- If m_defrag() fails just drop the packet like other NIC drivers
do. This should only happen when there's a mbuf shortage, in which
case it was possible to end up with an IFQ full of packets which
couldn't be processed as they couldn't be defragmented as they
were taking up all the mbufs themselves. This includes adjusting
re_start() to not trying to prepend the mbuf (chain) if re_encap()
has freed it.
- Remove dupe initialization of members of struct rl_dmaload_arg to
values that didn't change since trying to process the fragmented
mbuf chain.
While at it remove an unused member from struct rl_dmaload_arg.
o In re_start() remove a abandoned, banal comment. The corresponding
code was moved to re_attach() some time ago.

With these changes re(4) now survives one day (until stopped) of
hammering out packets here.

Reviewed by: yongari
MFC after: 2 weeks


166047 16-Jan-2007 jhb

Remove duplicate variable initialization.

CID: 1706
Found by: Coverity Prevent (tm)


165997 13-Jan-2007 marius

- Allow multiple (external) PHYs with Am79C97{2,6}, which actually
only support external PHYs (besides not connectable internal ones
which respond at the usual addresses, but which don't hurt if we
let them show up) and don't wedge when isolating PHYs. Actually,
this change special cases limiting PHYs to Am79C97{3,5,8}, for
which this driver doesn't implement swiching between the internal
and external PHYs, yet, and Am79C971, where isolating the external
PHY (at least in case it's a DP83840A) wedges the chip. Together
with sys/dev/mii/acphy.c rev. 1.21 this adds support for the
100baseFX port of AT-2700 series adaptors, which use two AC101,
one for the copper and one for the fibre port (there might be
variants which only use one PHY though).
- Fix a bug in the previous revision that prevented the address of
the used (external) PHY to be actually recorded.
- Don't bother to set if_mtu to ETHERMTU, ether_ifattach() does that.

MFC after: 1 week


165951 11-Jan-2007 jhb

Various updates to most of the smbus(4) drivers:
- Use printf() and device_printf() instead of log() in ichsmb(4).
- Create the mutex sooner during ichsmb(4) attach.
- Attach the interrupt handler later during ichsmb(4) attach to avoid
races.
- Don't try to set PCIM_CMD_PORTEN in ichsmb(4) attach as the PCI bus
driver does this already.
- Add locking to alpm(4), amdpm(4), amdsmb(4), intsmb(4), nfsmb(4), and
viapm(4).
- Axe ALPM_SMBIO_BASE_ADDR, it's not really safe to write arbitrary values
into BARs, and the PCI bus layer will allocate resources now if needed.
- Merge intpm(4) and intsmb(4) into just intsmb(4). Previously, intpm(4)
attached to the PCI device and created an intsmb(4) child. Now,
intsmb(4) just attaches to PCI directly.
- Change several intsmb functions to take a softc instead of a device_t
to make things simpler.


165826 06-Jan-2007 takawata

Restore agp aperture size after resume, in case it is modified after boot.


165815 05-Jan-2007 jkim

- Clean up Aperture Access Global Enable (APEN) bit access.
- Rename confusing AGP_INTEL_I845_MCHCFG to AGP_INTEL_I845_AGPM.
- Move E7205 and E7505 from i8x5 to i8x0 family. It probably worked
because the actual offset is the same.

In fact, all three families have the bit at the exact same place. Only
differences are name and width of the registers, i.e., NBXCFG (0x50, dword),
RDCR (0x51, byte), AGPM (0x51, byte), MCHCFG (0x50, word) depending on
the family of the chipsets.


165811 05-Jan-2007 jkim

Fix style(9).


165805 05-Jan-2007 takawata

Make agp_intel capable to work after resume from S3 state.


165311 18-Dec-2006 yongari

Don't assume IF_LLADDR returns aligned memory address.
Because accessing ID registers in rtl81x9 needs 32bit register access
and RL_IDR4/RL_IDR5 registers are reservered registers bzero() is
needed before copying ethernet address.
This fixes unaligned memory accesses panic in sparc64.

PR: kern/106801
MFC after: 3 days


164999 08-Dec-2006 marius

- Revert the parts of the previous revision which reloaded the watchdog
timer in xl_txeof()/xl_txeof_90xB(); xl_poll_locked() unconditionally
invokes xl_txeof()/xl_txeof_90xB(), effectively circumventing that
the watchdog ever fires in the DEVICE_POLLING case as its timer is
constantly reloaded.
- Remove the banal and pedantically outdated comment regarding setting
xl_wdog_timer to 0 in xl_txeof().

Pointed out by: bde


164935 06-Dec-2006 marius

- Use the xl_stats_update() callout instead of if_slowtimo() for
driving xl_watchdog() in order to avoid races accessing if_timer.
While at it relax the watchdog a bit by reloading it in xl_txeof()/
xl_txeof_90xB() if there are still packets enqueued.
- Use bus_get_dma_tag() so xl(4) works on platforms requiring it.
- Don't bother to set if_mtu to ETHERMTU, ether_ifattach() does that.


164811 01-Dec-2006 ru

if_watchdog -> rl_watchdog


164712 28-Nov-2006 marius

- Clear the PCN_MISC_ASEL bit so the media port can be actually set
via the PCN_CSR_MODE register. Along with sys/dev/mii/nsphy.c 1.26
this fixes the case of certain Am79c971-based HP cards and on-board
ones in IBM machines reporting link but not actually passing any
traffic. [1]
- Add support for the internal 10baseT PHY, which actually is used on
at least said HP cards (together with an external DP83840A in a
multiple PHYs configuration). With cards that don't make use of this
internal PHY it'll also show up in FreeBSD but not cause any harm.
This is still missing support for multiple PHYs configuration using
the internal 100baseTX and/or HomePNA PHYs together with external
PHYs or multiple external PHYs though.
- In pcn_ifmedia_upd() call pcn_reset() as otherwise the Am79C971 of
at least said HP cards can wedge when switching from the internal
10baseT PHY to the external PHY. This means that we need to also
initialize and possibly start the chip again in pcn_ifmedia_upd(),
which isn't that bad though as for setting the media port the chip
has to be powered down or stopped anyway and unlike documented
doesn't take effect until the next initialization.

PR: 27995, 25959, 72966 (likely) [1]
MFC after: 2 weeks


164463 21-Nov-2006 yongari

Add TSO support.

Tested by: wilko, Pieter de Goeje < pieter AT degoeje DOT nl >


164460 21-Nov-2006 yongari

Use #ifndef __NO_STRICT_ALIGNMENT rather than
#if !defined(__i386__) && !defined(__amd64__) for architectures
with alignment constraints.


164072 07-Nov-2006 marius

- Don't bother to include IDs of PCnet chips which are not supported
by this driver and largely are not even PCI devices in pcn_chipid.
- Use device_printf(9)/if_printf(9) rather than implementing their
functionality with printf(9).
- Sprinkle some const.


163896 02-Nov-2006 mjacob

2nd and final commit that moves us to CAM_NEW_TRAN_CODE
as the default.

Reviewed by multitudes.


163892 02-Nov-2006 marius

Remove <sys/types.h>; including both <sys/param.h> and <sys/types.h>
violates style(9).


163816 31-Oct-2006 mjacob

The first of 3 major steps to move the CAM layer forward to using
the CAM_NEW_TRAN_CODE that has been in the tree for some years now.

This first step consists solely of adding to or correcting
CAM_NEW_TRAN_CODE pieces in the kernel source tree such
that a both a GENERIC (at least on i386) and a LINT build
with CAM_NEW_TRAN_CODE as an option will compile correctly
and run (at least with some the h/w I have).

After a short settle time, the other pieces (making
CAM_NEW_TRAN_CODE the default and updating libcam
and camcontrol) will be brought in.

This will be an incompatible change in that the size of structures
related to XPT_PATH_INQ and XPT_{GET,SET}_TRAN_SETTINGS change
in both size and content. However, basic system operation and
basic system utilities work well enough with this change.

Reviewed by: freebsd-scsi and specific stakeholders


163773 29-Oct-2006 marius

Wrap code optimized for architectures without alignment constraints
in #ifdef __NO_STRICT_ALIGNMENT rather than #if defined(__i386__) ||
defined(__amd64__). Currently this change is cosmetic only though.
While at it, fix a nearby style(9) bug and remove a no longer used
header.


163614 22-Oct-2006 alc

The page queues lock is no longer required by vm_page_busy() or
vm_page_wakeup(). Reduce or eliminate its use accordingly.


163459 17-Oct-2006 ru

Older incarnations of the device used non-standard BARs.

Reported by: Andriy Gapon
Confirmed by: many (including lm-sensors-2.10.1)
MFC after: 3 days


163362 15-Oct-2006 tanimura

Fix the wraparound of memsize >=2GB.


163181 09-Oct-2006 jkim

Fix style(9) nits.


163180 09-Oct-2006 jkim

Fix 32-bit PTE in the GART table.

Noticed by: jmg


162690 27-Sep-2006 anholt

Add support for 945G/GM AGP chipsets.

The key problem was that the aperture size detection using the MSAC bit
doesn't work -- the bit appears to be set even when it shouldn't be. Linux
takes a different approach, testing for a bit of the GMADR (PCIR_BAR(2)) being
set. However, as I don't think that's a safe way to test aperture size, we
just allocate the resource and check its size. This also pointed out that
agp_generic_attach hadn't been allocating our aperture resource, which may
have caused problems in some cases.

Also corrected is a minor copy-and-pasteo in an error case.

PR: kern/103079
Submitted by: mnag
Tested on: i945GM, i915GM
MFC after: 2 weeks


162317 15-Sep-2006 ru

Whitespace nits.


162315 15-Sep-2006 glebius

Consistently use if_printf() only in interface methods: if_start,
if_ioctl, if_watchdog, etc, or in functions that are used by
these methods only. In all other cases use device_printf().

This also fixes several panics, when if_printf() is called before
softc->ifp was initialized.

Submitted by: Alex Lyashkov <umka sevcity.net>


162289 13-Sep-2006 jhb

intpm(4) meet style(9). style(9) meet intpm(4).


162249 12-Sep-2006 jhb

Trim some unneeded includes.


162234 11-Sep-2006 jhb

Minor overhaul of SMBus support:
- Change smbus_callback() to pass a void * rather than caddr_t.
- Change smbus_bread() to pass a pointer to the count and have it be an
in/out parameter. The input is the size of the buffer (same as before),
but on return it will contain the actual amount of data read back from
the bus. Note that this value may be larger than the input value. It
is up to the caller to treat this as an error if desired.
- Change the SMB_BREAD ioctl to write out the updated struct smbcmd which
will contain the actual number of bytes read in the 'count' field. To
preserve the previous ABI, the old ioctl value is mapped to SMB_OLD_BREAD
which doesn't copy the updated smbcmd back out to userland. I doubt anyone
actually used the old BREAD anyway as it was rediculous to do a bulk-read
but not tell the using program how much data was actually read.
- Make the smbus driver and devclass public in the smbus module and
push all the DRIVER_MODULE()'s for attaching the smbus driver to
various foosmb drivers out into the foosmb modules. This makes all
the foosmb logic centralized and allows new foosmb modules to be
self-contained w/o having to hack smbus.c everytime a new smbus driver
is added.
- Add a new SMB_EINVAL error bit and use it in place of EINVAL to return
an error for bad arguments (such as invalid counts for bread and bwrite).
- Map SMB bus error bits to EIO in smbus_error().
- Make the smbus driver call bus_generic_probe() and require child drivers
such as smb(4) to create device_t's via identify routines. Previously,
smbus just created one anonymous device during attach, and if you had
multiple drivers that could attach it was just random chance as to which
driver got to probe for the sole device_t first.
- Add a mutex to the smbus(4) softc and use it in place of dummy splhigh()
to protect the 'owner' field and perform necessary synchronization for
smbus_request_bus() and smbus_release_bus().
- Change the bread() and bwrite() methods of alpm(4), amdpm(4), and
viapm(4) to only perform a single transaction and not try to use a
loop of multiple transactions for a large request. The framing and
commands to use for a large transaction depend on the upper-layer
protocol (such as SSIF for IPMI over SMBus) from what I can tell, and the
smb(4) driver never allowed bulk read/writes of more than 32-bytes
anyway. The other smb drivers only performed single transactions.
- Fix buffer overflows in the bread() methods of ichsmb(4), alpm(4),
amdpm(4), amdsmb(4), intpm(4), and nfsmb(4).
- Use SMB_xxx errors in viapm(4).
- Destroy ichsmb(4)'s mutex after bus_generic_detach() to avoid problems
from child devices making smb upcalls that would use the mutex during
their detach methods.

MFC after: 1 week
Reviewed by: jmg (mostly)


161788 01-Sep-2006 anholt

Add support for another ATI IGP 340M (RS200M) AGP bridge.

PR: kern/100958
Submitted by: Kazuo Dohzono <dohzono@axion-software.com>
MFC after: 1 week


161518 21-Aug-2006 jkim

Use aperture base address from north bridge. Some BIOS does not encode
misc. control registers correctly and it is inconsistent with north bridge.
In fact, there are too many broken BIOS implementations out there and we
cannot fix every possible combination but at least it is consistent with
what we advertise with ioctl(2).


161450 18-Aug-2006 ru

Add more nForce4 SMBus 2.0 PCI IDs.


161239 12-Aug-2006 yongari

Don't reset Tx threshold value whenever xl_init_locked() is called.
Instead the threshould is initialized in device attach. Later the
threshold could be increased in Tx underrun error and the new
threshold should be used in xl_init_locked().


161238 12-Aug-2006 yongari

Make sure to check frames in Tx queue are empty before clearing
watchdog timer.


161222 11-Aug-2006 jkim

Explicitly set v3 mode only when it is requested. Don't bother otherwise.


160964 04-Aug-2006 yar

Commit the results of the typo hunt by Darren Pilgrim.
This change affects documentation and comments only,
no real code involved.

PR: misc/101245
Submitted by: Darren Pilgrim <darren pilgrim bitfreak org>
Tested by: md5(1)
MFC after: 1 week


160883 01-Aug-2006 wpaul

Another small update to the re(4) driver:

- Change the workaround for the autopad/checksum offload bug so that
instead of lying about the map size, we actually create a properly
padded mbuf and map it as usual. The other trick works, but is ugly.
This approach also gives us a chance to zero the pad space to avoid
possibly leaking data.

- With the PCIe devices, it looks issuing a TX command while there's
already a transmission in progress doesn't have any effect. In other
words, if you send two packets in rapid succession, the second one may
end up sitting in the TX DMA ring until another transmit command is
issued later in the future. Basically, if re_txeof() sees that there
are still descriptors outstanding, it needs to manually resume the
TX DMA channel by issuing another TX command to make sure all
transmissions are flushed out. (The PCI devices seem to keep the
TX channel moving until all descriptors have been consumed. I'm not
sure why the PCIe devices behave differently.)

(You can see this issue if you do the following test: plug an re(4)
interface into another host via crossover cable, and from the other
host do 'ping -c 2 <host with re(4) NIC>' to prime the ARP cache,
then do 'ping -c 1 -s 1473 <host with re(4) NIC>'. You're supposed
to see two packets sent in response, but you may only see one. If
you do 'ping -c 1 -s 1473 <host with re(4) NIC>' again, you'll
see two packets, but one will be the missing fragment from the last
ping, followed by one of the fragments from this ping.)

- Add the PCI ID for the US Robotics 997902 NIC, which is based on
the RTL8169S.

- Add a tsleep() of 1 second in re_detach() after the interrupt handler
is disconnected. This should allow any tasks queued up by the ISR
to drain. Now, I know you're supposed to use taskqueue_drain() for
this, but something about the way taskqueue_drain() works with
taskqueue_fast queues doesn't seem quite right, and I refuse to be
tricked into fixing it.


160843 30-Jul-2006 wpaul

Fix the following bugs in re(4)

- Correct the PCI ID for the 8169SC/8110SC in the device list (I added
the macro for it to if_rlreg.h before, but forgot to use it.)

- Remove the extra interrupt spinlock I added previously. After giving it
some more thought, it's not really needed.

- Work around a hardware bug in some versions of the 8169. When sending
very small IP datagrams with checksum offload enabled, a conflict can
occur between the TX autopadding feature and the hardware checksumming
that can corrupt the outbound packet. This is the reason that checksum
offload sometimes breaks NFS: if you're using NFS over UDP, and you're
very unlucky, you might find yourself doing a fragmented NFS write where
the last fragment is smaller than the minimum ethernet frame size (60
bytes). (It's rare, but if you keep NFS running long enough it'll
happen.) If checksum offload is enabled, the chip will have to both
autopad the fragment and calculate its checksum header. This confuses
some revs of the 8169, causing the packet that appears on the wire
to be corrupted. (The IP addresses and the checksum field are mangled.)
This will cause the NFS write to fail. Unfortunately, when NFS retries,
it sends the same write request over and over again, and it keeps
failing, so NFS stays wedged.

(A simple way to provoke the failure is to connect the failing system
to a network with a known good machine and do "ping -s 1473 <badhost>"
from the good system. The ping will fail.)

Someone had previously worked around this using the heavy-handed
approahch of just disabling checksum offload. The correct fix is to
manually pad short frames where the TCP/IP stack has requested
checksum offloading. This allows us to have checksum offload turned
on by default but still let NFS work right.

- Not a bug, but change the ID strings for devices with hardware rev
0x30000000 and 0x38000000 to both be 8168B/8111B. According to RealTek,
they're both the same device, but 0x30000000 is an earlier silicon spin.


160008 28-Jun-2006 wpaul

Properly detect the RTL8168(B?) again. RealTek sent me a bunch of sample
cards: the chips are all marked "RTL8111B", but they put stickers on the
back that say "RTL8168B/8111B". The manual says there's only one HWREV code
for both the 8111B and 8168B devices, which is 0x30000000, but the cards
they sent me actually report HWREV of 0x38000000. Deciding to trust the
hardware in front of me rather than a possibly incorrect manual (it wouldn't
be the first time the HWREVs were incorrectly documented), I changed the
8168 revision code. It turns out this was a mistake though: 0x30000000
really is a valid for the 8168.

There are two possible reasons for there to be two different HWREVs:

1) 0x30000000 is used only for the 8168B and 0x38000000 is only for
the 8111B.
2) There were 8111/8168 rev A devices which both used code 0x30000000,
and the 8111B/8168B both use 0x38000000.

The product list on the RealTek website doesn't mention the existence of
any 8168/8111 rev A chips being in production though, and I've never seen
one, so until I get clarification from RealTek, I'm going to assume that
0x30000000 is just for the 8168B and 0x38000000 is for the 8111B only.

So, the HWREV code for the 8168 has been put back to 0x30000000,
a new 8111 HWREV code has been added, and there are now separate
entries for recognizing both devices in the device list. This will
allow all devices to work, though if it turns out I'm wrong I may
need to change the ID strings


159981 27-Jun-2006 anholt

Fix breakage of CHIP_I855 in the last revision.

Submitted by: Ted Faber <faber@ISI.EDU>


159962 26-Jun-2006 wpaul

Add support for the RealTek 8169SC/8110SC and RTL8101E devices. The
latter is a PCIe 10/100 chip.

Finally fix the EEPROM reading code so that we can access the EEPROMs on all
devices. In order to access the EEPROM, we must select 'EEPROM programming'
mode, and then set the EEPROM chip select bit. Previously, we were setting
both bits simultaneously, which doesn't work: they must be set in the
right sequence.

Always obtain the station address from the EEPROM, now that EEPROM
reading works correctly.

Make the TX interrupt moderation code based on the internal timer
optional and turned off by default.

Make the re_diag() routine conditional and off by default. When it is
on, only use it for the original 8169, which was the only device that
that really needed it.

Modify interrupt handling to use a fast interrupt handler and fast
taskqeueue.

Correct the rgephy driver so that it only applies the DSP fixup for
PHY revs 0 and 1. Later chips are fixed and don't need the fixup.

Make the rgephy driver advertise both 1000_FD and 1000_HD bits in
autoneg mode. A couple of the devices don't autoneg correctly unless
configured this way.


159926 25-Jun-2006 anholt

Replace the three copies of the list of pci ids with a single centralized list.
Add the i945 PCI IDs commented out -- I think it should just work, but it hasn't
been tested yet.


159075 30-May-2006 jkim

Move SiS 760 to where it belongs.

PR: 98094
Submitted by: Mike M < mmcgus at yahoo dot com >


158878 24-May-2006 glebius

Rename device name in the last commit. According to PR, the ID is
more likely to belong to chips of 8168 family.

PR: kern/96734
Submitted by: Sven Petai <hadara bsd.ee>


158655 16-May-2006 anholt

Add support for allocating one larger than page-sized contiguous block of memory
with a physical address. This is used for hardware ARGB cursor support on newer
chipsets.


158651 16-May-2006 phk

Since DELAY() was moved, most <machine/clock.h> #includes have been
unnecessary.


158614 15-May-2006 marius

Replace references to lnc(4) with references to le(4) (so far the notes
still apply to le(4)) now that lnc(4) is removed and le(4) is going to
replace it.


158471 12-May-2006 jhb

Remove various bits of conditional Alpha code and fixup a few comments.


158061 27-Apr-2006 yongari

The sk(4) driver has moved to /sys/dev/sk


156988 22-Mar-2006 glebius

Add support for RTL8111B chip, that can be found on some mainboards,
for example ASUS P5PL2.

Tested by: Vadim Frolov <vadim uch.net>


156035 26-Feb-2006 imp

Remove de driver from old location.


155772 17-Feb-2006 anholt

Add support for the Intel E7205 chipset.

PR: kern/91315
Submitted by: Joerg Pulz <Joerg.Pulz@frm2.tum.de>


155671 14-Feb-2006 glebius

Do not touch ifp->if_baudrate in miibus aware drivers.


155186 01-Feb-2006 jhb

Don't add an agp child in vgapci's attach routine if the PCIY_AGP
capability is present as not all devices supported by the agp_i810 driver
(such as i915) have the AGP capability. Instead, add an identify routine
to the agp_i810 driver that uses the PCI ID to determine if it should
create an agp child device.


154509 18-Jan-2006 glebius

Check ifp before dereferencing it in xl_detach(). xl_detach() can be called
from xl_attach(), when ifp is not defined yet.

Found with: Coverity Prevent(tm)


154486 17-Jan-2006 jhb

Fix a memory leak I introduced with the hostb/vgapci stuff.

Reported by: Coverity (via dfr's clue-bat)


154454 17-Jan-2006 yongari

The number of ticks per usec for YUKON_EC is 125.


154448 17-Jan-2006 yongari

fix interrupt moderation timer frequencies for Yukon

Obtained from: OpenBSD


154447 17-Jan-2006 yongari

remove trailing spaces


154388 15-Jan-2006 bz

Remove unused code.

Found with: Coverity Prevent(tm)


153644 22-Dec-2005 jhb

Use the copy of the card's MAC address saved in tulip_enaddr() in the softc
if we need a valid MAC address (for probing the media for example) before
ether_ifattach() has been called since IF_LLADDR() is NULL then.

Tested by: tisco


153618 21-Dec-2005 ru

Drivers for AMD-8111 and NVIDIA nForce2/3/4 SMBus 2.0 controllers.


153617 21-Dec-2005 jhb

Use ETHER_ADDR_LEN rather than hardcoding 6.


153580 20-Dec-2005 jhb

- Use PCIR_BAR() macro for the BAR for the aperture.
- Axe macros used for walking PCI capabilities list. We now ask the PCI
bus to find caps for us rather than doing it in the drm and agp drivers.


153579 20-Dec-2005 jhb

- Bump FreeBSD version for the hostb(4) and vgapci(4) drivers as well as
the addition of pci_find_extcap().
- Change the drm drivers to attach to vgapci. This is #ifdef'd so the
code can be shared across branches.
- Use pci_find_extcap() to look for AGP and PCIE capabilities in drm.
- GC all the drmsub stuff for i810/i830/i915. The agp and drm devices are
now both children of vgapci.


153572 20-Dec-2005 jhb

Change the various AGP drivers that attach to the Host-PCI bridge device to
attach to the hostb driver instead. This means that agp can now be loaded
at runtime (in theory at least). Also, the drivers no longer have to
explicity call device_verbose() to cancel out any earlier calls to
device_quiet() by the hostb(4) driver (this shows a limitation in new-bus,
drivers really shouldn't be doing device_quiet() until they know they are
going to drive that device, i.e. in attach).


153568 20-Dec-2005 jhb

Change the agp_find_device() to return the first agp device that has been
attached to a driver rather than always returning agp0.


153563 20-Dec-2005 jhb

Don't map the AGP aperture into contiguous KVA. The various graphics
drivers already map sections into KVA as needed anyway. Note that this
will probably break the nvidia driver, but I will coordinate to get that
fixed.

MFC after: 2 weeks


153562 20-Dec-2005 jhb

Destroy the /dev device before destroying the mutex or releasing resources
rather than afterwards.

MFC after: 1 week


153561 20-Dec-2005 jhb

Use pci_find_extcap() to search for AGP capabilities (PCIY_AGP).


153491 16-Dec-2005 ru

Backout pseudo nForce2/3/4 support. These devices (as well as
AMD-8111 SMBus 2.0 controller) are all SMBus 2.0 controllers,
and need another implementation of SMBus access methods, while
this driver supports AMD-756 SMBus 1.0 controller and clones,
including AMD-8111 SMBus 1.0 controller.

Tested by: Vladimir Timofeev (0x006410de),
mezz (0x008410de),
ru (0x00d410de)

All of us got the same(!) nonsense when running ``mbmon -S'',
repeated every four rows.


153479 16-Dec-2005 ru

Fix PCI ID of the AMD-8111 System Management controller so it matches
SMBus 1.0 and not SMBus 2.0.

AMD-8111 hub (datasheet is publically available) implements both SMBus
2.0 (a separate PCI device) and SMBus 1.0 (a subfunction of the System
Management Controller device with the base I/O address is accessible
through the CSR 0x58). This driver only supports AMD-756 SMBus 1.0
compatible devices.

With the patched sysutils/xmbmon port (to also fix PCI ID and to enable
smb(4) support), I now get:

pciconf:
none0@pci0:7:2: class=0x0c0500 card=0x746a1022 chip=0x746a1022 rev=0x02 hdr=0x00
vendor = 'Advanced Micro Devices (AMD)'
device = 'AMD-8111 SMBus 2.0 Controller'
class = serial bus
subclass = SMBus
amdpm0@pci0:7:3: class=0x068000 card=0x746b1022 chip=0x746b1022 rev=0x05 hdr=0x00
vendor = 'Advanced Micro Devices (AMD)'
device = 'AMD-8111 ACPI System Management Controller'
class = bridge

dmesg:
amdpm0: <AMD 756/766/768/8111 Power Management Controller> port 0x10e0-0x10ff at device 7.3 on pci0
smbus0: <System Management Bus> on amdpm0

# mbmon -A -d
Summary of Detection:
* SMB monitor(s)[ioctl:AMD8111]:
** Winbond Chip W83627HF/THF/THF-A found at slave address: 0x50.
** Analog Dev. Chip ADM1027 found at slave address: 0x5C.
* ISA monitor(s):
** Winbond Chip W83627HF/THF/THF-A found.

I think the confusion comes from the fact that nobody really tried
SMBus with xmbmon :-), since sysutils/xmbmon port doesn't come with
SMBus support enabled, neither in FreeBSD 4, nor in later versions,
so mbmon(1) was just showing the values from the Winbond sensors
accessible through the ISA I/O method (mbmon -I), for me anyway.

On my test machine, the amdpm(4) didn't even attach due to I/O port
allocation failure (who knows what the hell it read from CSR 0x58
of the SMBus 2.0 device :-), which isn't in the CSR space).

I've also checked that lm_sensors.org uses correct PCI ID for SMBus
1.0 of AMD-8111:

i2c-amd756.c: {PCI_VENDOR_ID_AMD, 0x746B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AMD8111 },

This driver is analogous to our amdpm.c which supports SMBus 1.0
AMD-756 and compatible devices, including SMBus 1.0 on AMD-8111.

i2c-amd8111.c: { 0x1022, 0x746a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },

This driver is analogous to nForce-2/3/4, i2c-nforce2.c, which
supports SMBus 2.0, and which our amdpm.c does NOT support
(SMBus 2.0 uses a different, ACPI-unified, API to talk to SMBus).
At least I know for sure it doesn't work with my nForce3. :-)

(The xmbmon port will be fixed to correct the PCI ID too and to
enable the smb(4) support.)


153419 14-Dec-2005 jhb

Add support for the nForce2/3/4 SMBus controllers which all contain two
SMBus busses. Because of limitations in smbus_if.m, the second smbus is
attached to an amdpm1 device that is a child of amdpm0.

Submitted by: Artemiev Igor ai (at) bmc dot brk dot ru


153280 10-Dec-2005 scottl

The if_ti Tigon I/II driver has moved to /sys/dev/ti


153084 04-Dec-2005 ru

Fix -Wundef from compiling the amd64 LINT.


153031 02-Dec-2005 anholt

Add support for i915 GMCH AGP. This diff is a combination of work by myself
and some fixes from Motomichi Matsuzaki. Testing involved many people, but the
final, successful testing was from rwatson who endured several rounds of "it
crashes at XYZ stage" "oh, please correct this typo and try again." The Linux
driver, and to a small extent the limited specs, were both used as a reference
for how to program the chipset.

PR: kern/80396
Submitted by: Martin Mersberger


152992 01-Dec-2005 ru

Fix the type of "eaddr" to guarantee the required alignment.

Suggested by: marcel


152962 30-Nov-2005 ru

Byte copy IF_LLADDR() on stack to align it to be safe for typecasts.

Tested by: jhb


152914 29-Nov-2005 anholt

Add support for the i855GM, tested by an r300 user.


152666 21-Nov-2005 jhb

Various fixes to make de(4) not panic after ru@'s IF_LLADDR() changes:
- Don't call tulip_addr_filter() to reset the RX address filter in
tulip_reset() since that gets called before ether_ifattach(). Just
call it in tulip_init_locked().
- Use be16dec() and le16dec() to parse MAC addresses when programming
the RX filter.
- Let ether_ioctl() handle SIOCSIFMTU since we were doing the exact same
thing with the added bonus that we leaked the driver lock if the MTU
was > ETHERMTU in the homerolled version. This part will be MFC'd.

Clue from: wpaul (1)
Stolen from: marcel (2 via patch for dc(4))
MFC after: 1 week


152435 14-Nov-2005 jkim

0xb1881106 seems to be an AGP bridge and some BIOSes incorrectly handle
the bridge. Therefore, we give the same treatment as we did for nForce3-250
and ULi chipsets. VIA AGPv3 code was copied from agp_via.c.


152315 11-Nov-2005 ru

- Store pointer to the link-level address right in "struct ifnet"
rather than in ifindex_table[]; all (except one) accesses are
through ifp anyway. IF_LLADDR() works faster, and all (except
one) ifaddr_byindex() users were converted to use ifp->if_addr.

- Stop storing a (pointer to) Ethernet address in "struct arpcom",
and drop the IFP2ENADDR() macro; all users have been converted
to use IF_LLADDR() instead.


152311 11-Nov-2005 ru

Catch up with IFP2ENADDR() type change (array -> pointer).


151911 31-Oct-2005 jhb

- Use callout_*() to manage the callout and make it MPSAFE.
- Fix locking in detach(), we only need to lock across vr_stop().

Tested by: Mike Tancsa mike at sentex dot net
MFC after: 1 week


151901 31-Oct-2005 jhb

Add the device ID for the VIA VT8235 south bridge.

PR: kern/62438
Submitted by: FUJIMOTO Kou fujimoto at j dot dendai dot ac dot jp
Tested by: Oliver Fromme olli at secnetix dot de
MFC after: 1 week


151900 31-Oct-2005 jhb

Some of the VIA pm and propm devices are actually the same device as the
PCI-ISA bridge. Thus, when viapm0 or viapropm0 attaches, isab0 dosen't
attach so there is no isa0 bus hung off of that bridge. In the non-ACPI
case, legacy0 will add an isa0 anyway as a fail-safe, but ACPI assumes that
any ISA bus will be enumerated via a bridge. To fix this, call
isab_attach() to attach an isa0 ISA child bus device if the pm or propm
device we are probing is a PCI-ISA bridge. Both drivers now have to
implement the bus_if interface via the generic methods for resource
allocation, etc. to work. Also, we now add 2 new ISA bus drivers that
attach to viapm and viapropm devices.

PR: kern/87363
Reported by: Oliver Fromme olli at secnetix dot de
Tested by: glebius
MFC after: 1 week


151779 28-Oct-2005 wpaul

Remove forgotten, no longer needed WB_UNLOCK() from the end wb_ioctl().
With this change, the driver tests good (at least on i386):

wb0: <Winbond W89C840F 10/100BaseTX> port 0xb800-0xb87f mem 0xe6800000-0xe680007f irq 12 at device 10.0 on pci0
miibus1: <MII bus> on wb0
amphy0: <Am79C873 10/100 media interface> on miibus1
amphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
wb0: Ethernet address: 00:00:e8:18:2a:02
wb0: link state changed to DOWN
wb0: link state changed to UP


151774 27-Oct-2005 jhb

Fixup locking and mark MPSAFE.
- Add locked variants of init() and start().
- Use callout_*() to manage callout.
- Test IFF_DRV_RUNNING rather than IFF_UP in wb_intr() to see if we are
still active when an interrupt comes in.

I couldn't find any of these cards anywhere to test on myself, and google
turns up references to FreeBSD and OpenBSD manpages for this driver when
trying to locate a card that way. I'm not sure anyone actually uses these
cards with FreeBSD.

Tested by: NO ONE (despite repeated requests)


151773 27-Oct-2005 jhb

- Use if_printf() and device_printf() and remove vr_unit from the softc.
I had to initialize the ifnet a bit earlier in attach so that the
if_printf()'s in vr_reset() didn't explode with a page fault.
- Use M_ZERO with contigmalloc() rather than an explicit bzero.


151545 22-Oct-2005 imp

Replace FreeBSD 3.x syntax (controller miibus0) with 4.x syntax
(device miibus) in time for 7.0 :-)


151436 18-Oct-2005 imp

Remove dc after repo copy.


151341 14-Oct-2005 jhb

Only allow the sk(4) driver to attach to revision 2 of the LinkSys EG1032
cards and teach the re(4) driver to attach to revision 3 cards.

Submitted by: Fredrik Lindberg fli+freebsd-current at shapeshifter dot se
MFC after: 2 weeks
Reviewed by: imp, mdodd


151297 13-Oct-2005 ru

In detach method, move if_free() after bus_teardown_intr().


151242 11-Oct-2005 yar

Mark sk(4) as capable of handling extended VLAN frames. NICs
based on XMAC II chip should be ready for this in their initial
mode of operation, and Yukon-based NICs are configured so by
the driver.

PR: kern/79998
MFC after: 1 month


150968 05-Oct-2005 glebius

- Don't pollute opt_global.h with DEVICE_POLLING and introduce
opt_device_polling.h
- Include opt_device_polling.h into appropriate files.
- Embrace with HAVE_KERNEL_OPTION_HEADERS the include in the files that
can be compiled as loadable modules.

Reviewed by: bde


150789 01-Oct-2005 glebius

Big polling(4) cleanup.

o Axe poll in trap.

o Axe IFF_POLLING flag from if_flags.

o Rework revision 1.21 (Giant removal), in such a way that
poll_mtx is not dropped during call to polling handler.
This fixes problem with idle polling.

o Make registration and deregistration from polling in a
functional way, insted of next tick/interrupt.

o Obsolete kern.polling.enable. Polling is turned on/off
with ifconfig.

Detailed kern_poll.c changes:
- Remove polling handler flags, introduced in 1.21. The are not
needed now.
- Forget and do not check if_flags, if_capenable and if_drv_flags.
- Call all registered polling handlers unconditionally.
- Do not drop poll_mtx, when entering polling handlers.
- In ether_poll() NET_LOCK_GIANT prior to locking poll_mtx.
- In netisr_poll() axe the block, where polling code asks drivers
to unregister.
- In netisr_poll() and ether_poll() do polling always, if any
handlers are present.
- In ether_poll_[de]register() remove a lot of error hiding code. Assert
that arguments are correct, instead.
- In ether_poll_[de]register() use standard return values in case of
error or success.
- Introduce poll_switch() that is a sysctl handler for kern.polling.enable.
poll_switch() goes through interface list and enabled/disables polling.
A message that kern.polling.enable is deprecated is printed.

Detailed driver changes:
- On attach driver announces IFCAP_POLLING in if_capabilities, but
not in if_capenable.
- On detach driver calls ether_poll_deregister() if polling is enabled.
- In polling handler driver obtains its lock and checks IFF_DRV_RUNNING
flag. If there is no, then unlocks and returns.
- In ioctl handler driver checks for IFCAP_POLLING flag requested to
be set or cleared. Driver first calls ether_poll_[de]register(), then
obtains driver lock and [dis/en]ables interrupts.
- In interrupt handler driver checks IFCAP_POLLING flag in if_capenable.
If present, then returns.This is important to protect from spurious
interrupts.

Reviewed by: ru, sam, jhb


150720 29-Sep-2005 jhb

- Use if_printf() and device_printf() in re(4) and remove rl_unit from
the softc.
- Use callout_init_mtx() and rather than timeout/untimeout in both rl(4)
and re(4).
- Fix locking for ifmedia by locking the driver in the ifmedia handlers
rather than in the miibus functions. (re(4) didn't lock the mii stuff
at all!)
- Fix some locking in re_ioctl().

Note: the two drivers share the same softc declared in if_rlreg.h, so they
had to be change simultaneously.

MFC after: 1 week
Tested by: several on rl(4), none on re(4)


150719 29-Sep-2005 jhb

Use if_printf() and device_printf().


150716 29-Sep-2005 jhb

Typo.


150645 27-Sep-2005 jkim

- Add a work-around for nForce3-250. Aperture base address encoded in misc.
control register and AGP bridge seems to be inconsistent with some BIOS.
Instead of relying on BIOS settings, we just take the initial aperture size
and encode them for both miscellaneous control register and AGP bridge.
Some idea was borrowed from agp_nvidia.c.

- Add preliminary ULi M1689 chipset support. The idea was taken from Linux
because hardware and documentation are unavailable. Not tested.

- Add more VIA chipset PCI IDs taken from Linux driver.

Approved by: anholt (mentor)
Tested by: Adam Gregoire <ebola at psychoholics dot org>
Ganael Laplanche <ganael.laplanche at martymac dot com>
K Wieland <kwieland at wustl dot edu>


150636 27-Sep-2005 mlaier

Remove bridge(4) from the tree. if_bridge(4) is a full functional
replacement and has additional features which make it superior.

Discussed on: -arch
Reviewed by: thompsa
X-MFC-after: never (RELENG_6 as transition period)


150583 26-Sep-2005 jhb

Small fixes to sis(4):
- Remove sis_unit and use device_printf() and if_printf() instead.
- Use callout_init_mtx() for the callout.
- Remove spls.
- Fix locking for ifmedia to happen in the ifmedia handlers rather than in
sis_ioctl().
- Log an error message if we fail to allocate any resources. Perform
cleanup if we fail to allocate any resources so that we don't leave
a mutex hanging around.

Tested by: Jason Tsai jason dot tsai at newcyberian dot com (1-4)
MFC after: 3 days


150526 24-Sep-2005 phk

Use the new bus_space/resource convenience functions.


150369 20-Sep-2005 phk

Move code macros from if_sis*reg*.h to if_sis.*c*


150236 17-Sep-2005 anholt

Add a new AGP driver for ATI IGP chipsets. The driver is based on reading of
the Linux driver, since specs are unavailable. Many thanks to Adam Kirchhoff
for multiple useful testing cycles, and Ralf Wostrack for the final fix to get
it working.

PR: i386/75251
Submitted by: anholt


150235 16-Sep-2005 anholt

Fix agp_nvidia.c to behave more like the linux driver, fixing DRI on Radeon
9200 according to one responder. The primary issue was not setting some bits
to say that the entries were active, but also fix one place where some memory
wasn't being used as volatile as it should. While here, change some use of ffs
to a relatively short case statement, to make it more obvious what's going on.

PR: kern/71638, kern/72372, kern/71547?
Submitted by: Andrew J. Caines <A.J.Caines@halplant.com>,
Robin Schoonover <end@endif.cjb.net>,
Jason Henson <jason@ec.rr.com>


150213 16-Sep-2005 ru

Fix "struct ifnet" leaks when attach() fails in the middle, e.g.
when mii_phy_probe() or bus_setup_intr() fails. For drivers that
call their detach() in this case, call if_free() there to cover
this case too.


150174 15-Sep-2005 keramida

When bus_alloc_resource_any() fails, dc_detach() is called and it
attempts to deallocate busdma tags and resources that haven't been
allocated yet, causing a panic every time a dc interface fails to
attach. Fix by checking that we really have something to dealloc
before calling bus_dma*() functions.

Approved by: jhb
MFC after: 1 week


150171 15-Sep-2005 jhb

- Fixup locking and mark MPSAFE.
- Use callout_init_mtx() and static callouts rather than timeout().
- m_getcl() in one place to simplify the code.

Tested by: Gavin Atkinson gavin dot atkinson at ury dot york dot ac dot uk
MFC after: 1 week


150126 14-Sep-2005 ru

Fixed "Memory modified after free" panic in rl_detach() due
to rl_stop() accessing already freed "struct ifnet".

Fixed LOR between rl mutex and some ACPI mutex in rl_detach().


149677 31-Aug-2005 jhb

Use if_printf() and device_printf() for printf's and remove the unit number
from the softc.

MFC after: 3 days


149646 30-Aug-2005 jhb

Various locking fixes and mark MPSAFE:
- Add locked variants of start(), init(), ifmedia_upd(), and poll() and stop
recursing on the driver lock.
- Add locking to ifmedia_upd() and ifmedia_sts().
- Use callout_*() instead of timeout/untimeout.
- Fix locking in ioctl().

Tested by: Bob Bishop rb at gid dot co dot uk
MFC after: 3 days


149595 29-Aug-2005 imp

Better comment


149588 29-Aug-2005 imp

Fix another instance of old info re: miibus


149584 29-Aug-2005 imp

Fix obsolete comment.

MFC After: 2 days


149497 26-Aug-2005 jhb

- Use m_defrag() instead of homerolling our own variant
tulip_mbuf_compress(). If we fail to allocate a new mbuf to copy the
data into, put the mbuf back in the driver's send queue so that we can
retry it later rather than throwing the packet away.
- Use m_devget() instead of doing it inline ourselves in the
TULIP_COPY_RXDATA case. If we fail to allocate an mbuf to copy the data
into, don't forget about the original mbuf cluster. The old code would
lose the pointer and leak the cluster in that case. Now it doesn't lose
it but always sticks the original rx buffer back into the receive ring
after trying to copy the data out and send it up the stack. Also, if we
fail to allocate a new mbuf to copy the data into, log an input error.
Also, don't combine the priming case with the received-a-packet case to
make the code flow a bit clearer and easier to follow.


149476 25-Aug-2005 jhb

- Remove non-bus-dma code.
- Remove form feed characters.
- Fixup style of function declarations.
- Assume that an mbuf cluster is big enough to hold an ethernet frame.
(This should really be using m_defrag(), but this diff is just simple
changes for now.)


149473 25-Aug-2005 jhb

Major rototill of this driver to add FreeBSD bus-dma support:
- Allocate arrays of metadata for the descriptors in the rx and tx rings
and change the ring pointers to walk the metadata array rather than the
actual descriptor rings. Each metadata object contains a pointer to its
descriptor, a pointer to any associated mbuf, and a pointer to the
associated bus_dmamap_t in the bus_dma case. The mbuf pointers replace
the tulip_txq and tulip_rxq local ifqueue's in the softc.
- Add lots of KTR trace entries using a local KTR_TULIP level which
defaults to 0, but can be changed to KTR_DEV at the top of the file
when debugging.
- Rename tulip_init(), tulip_start(), tulip_ifinit(), and tulip_ifstart()
to tulip_init_locked(), tulip_start_locked(), tulip_init(), and
tulip_start(), respectively, to match the convention in other drivers.
- Add a TULIP_SP_MAC() macro to encode two bytes of the MAC address into
the setup buffer and use that in place of lots of BYTE_ORDER #ifdef's.
Also, remove an incorrect XXX comment I added earlier, the driver was
correct (at least it does the same thing dc(4) does). TULIP_SP_MAC
was shamelessly copied from DC_SP_MAC() in dc(4).
- Remove the #ifdef'd NetBSD bus-dma code and replace it with FreeBSD
bus-dma code that not only compiles but even works at runtime.
- Use callout_init_mtx() instead of just callout_init().
- Correct the various wrapper macros for bus_dmamap_sync() for the rx
and tx buffers to only ask for the sync ops that they actually need.
- Tidy the #ifdef TULIP_COPY_RXDATA code by expanding an #ifdef a bit
so it becomes easier to read at the expense of a couple of duplicated
lines of code. Also, use m_getcl() to get an mbuf cluster rather than
MGETHDR() followed by MCLGET().
- Maintain the ring free (ri_free) count for the rx ring metadata since
we no longer have tulip_rxq.ifq_len around to indicate how many mbuf's
are currently in the rx ring.
- Add code to teardown bus_dma resources when attach fails and generally
fixup attach to do a better job of cleaning up when it fails. This
gets us a good bit closer to possibly having a detach method someday
and making this driver an unloadable module.
- Add some functions that can be called from ddb to dump the state of
a descriptor ring and to dump the state of an individual descriptor.
- Various comment grammer and spelling fixes.

I have bus-dma turned on by default, but I've left the non-bus-dma code
around so that it can be turned off to aid in debugging should any problems
turn up later on. I'll be removing the non-bus-dma code in a subsequent
commit.


149251 18-Aug-2005 jhb

Various fixups to locking:
- Remove a lot of superfluous locking during attach. There is no need
to lock access to the driver until some other thread has a way of getting
to it. For ethernet drivers the other ways include registering an
interrupt handler via bus_setup_intr(), calling ether_ifattach() to hook
into the network stack, and kicking off a callout-driven timer via
callout_reset().
- Use callout_* rather than timeout/untimeout.
- Break out of xl_rxeof() if IFF_DRV_RUNNING is clear after ifp->if_input
returns to handle the case where the interface was stopped while we were
passing a packet up the stack. Don't call xl_rxeof() in xl_rxeof_task()
unless IFF_DRV_RUNNING is set. With these fixes in place, any
outstanding task will gracefully terminate as soon as it gets a chance to
run after the interface has been stopped via xl_stop(). As a result,
taskqueue_drain() is no longer required in xl_stop(). The task is still
drained in detach() however to make sure that detach() can safely destroy
the driver mutex at the end of the function.
- Lock the driver lock in the ifmedia callouts and don't lock across
ifmedia_ioctl() in xl_ioctl().

Note: glebius came up with most of (3) as well independently. I took a
rather roundabout way of arriving at the same conclusion.

MFC after: 3 days


149249 18-Aug-2005 jhb

Fixup locking and mark MPSAFE:
- Add locked versions of start and init. The SRM_MEDIA code in dc_init()
stayed in dc_init() instead of moving to dc_init_locked() to make the
locking saner.
- Use callout_init_mtx().
- Fixup locking in detach and ioctl.
- Lock the driver in the ifmedia callouts.
- Don't recurse on the driver lock.
- De-spl.

MFC after: 3 days


149240 18-Aug-2005 jhb

Fixup locking for sf(4) and mark MPSAFE:
- Add locked variants of start, init, and ifmedia_upd.
- Use callout_* instead of timeout/untimeout.
- Don't recurse on the driver lock.
- Fixup locking in ioctl.
- Lock the driver lock in the ifmedia handlers rather than across
ifmedia_ioctl().

Tested by: brueffer
MFC after: 3 days


149206 17-Aug-2005 jhb

- Use htole32() instead of using bswap32() conditional on #if BYTE_ORDER.
- Don't set IFF_ALLMULTI in our ifnet's if_flags if we end up allowing
all multicast due to limits in the MAC receive filters in hardware.

Requested by: rwatson (2)


149205 17-Aug-2005 jhb

Remove the unused TULIP_CSR_{READ,WRITE}BYTE macros.


149204 17-Aug-2005 jhb

Use callout_init_mtx() to simplify the stats callout.

MFC after: 3 days


149189 17-Aug-2005 jhb

Use device_printf() and if_printf() and remove ste_unit from the softc.


149021 13-Aug-2005 bz

* Solve "No PHY found" problem for more Yukon Lite variants.
* Catch a bus attach error.
* Improve locking.

MFC after: 6 days


148948 10-Aug-2005 jhb

Use device_printf() and if_printf() and remove dc_unit from softc.


148947 10-Aug-2005 jhb

Use if_printf() and device_printf() and axe sf_unit from the softc as a
result.


148906 09-Aug-2005 jhb

Call tulip_start() rather than tulip_ifstart() from the interrupt handler
to avoid recursing on the driver lock. Not sure why my test box didn't
catch this earlier.

MFC after: 3 days


148887 09-Aug-2005 rwatson

Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and
IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to
ifnet.if_drv_flags. Device drivers are now responsible for
synchronizing access to these flags, as they are in if_drv_flags. This
helps prevent races between the network stack and device driver in
maintaining the interface flags field.

Many __FreeBSD__ and __FreeBSD_version checks maintained and continued;
some less so.

Reviewed by: pjd, bz
MFC after: 7 days


148738 05-Aug-2005 jhb

Fix up the locking in pcn(4) and mark it MPSAFE.
- Add locked versions of the init() and start() methods.
- Use callout_*() rather than timeout().
- Make the driver lock non-recursive.
- Push down locking in detach() and ioctl().
- Fix the tick routine to bail if the interface has been stopped and use
callout_drain() in detach() after the call to stop().
- Lock the driver lock in the ifmedia handlers.

Tested by: Ketrien I. Saihr-Kesenchedra ketrien at error404.nls.net
MFC after: 1 week


148722 05-Aug-2005 tobez

Recognize D-Link DGE-528(T) Gigabit as an re(4) device.

Submitted by: Andrus Nomm <andrus@members.ee>
PR: 76780
MFC After: 1 week


148654 03-Aug-2005 rwatson

Modify device drivers supporting multicast addresses to lock if_addr_mtx
over iteration of their multicast address lists when synchronizing the
hardware address filter with the network stack-maintained list.

Problem reported by: Ed Maste (emaste at phaedrus dot sandvine dot ca>
MFC after: 1 week


148445 27-Jul-2005 jhb

- Use callout_*() rather than timeout() to periodically poll the media.
- Add locking to protect the softc and mark this driver as MP safe. There
are still some edge cases with multiport cards that need more locking
work.

MFC after: 1 week
Tested on: alpha


148444 27-Jul-2005 jhb

Fix a typo in the name of the dmamap for a bus_dmamap_sync().

MFC after: 3 days


148434 27-Jul-2005 imp

The 575A doesn't have funcregs in memio. So don't claim that it does.
This gets my 575A card probing.

Card provided by: James Flemer
MFC After: 3 days


148256 21-Jul-2005 jhb

- Use the PCIR_BAR() macro rather than hardcoding rids.
- Use pci_enable_busmaster() rather than fiddling with the PCI command
register directly.


148255 21-Jul-2005 jhb

Don't set if_start to tulip_ifstart all over the place. It is already
set in tulip_attach() and its value is never changed, so all the extra sets
are redundant. I'm guessing that at some point in time de(4) had an
alternate start routine, but that hasn't been true in recent history.


148252 21-Jul-2005 jhb

Remove conditional code that has largely rotted that is also not on by
default:
- TULIP_NEED_FASTTIMEOUT - tulip_fasttimeout() wasn't called anywhere
- BIG_PACKET - only worked on i386 anyway
- TULIP_USE_SOFTINTR - doesn't compile and was never updated to handle
new netisr registration
- non-FreeBSD code


148249 21-Jul-2005 jhb

Use get_cyclecount() rather than hardcoding rdtsc and rpcc in asm for i386
and alpha, respectively.


148248 21-Jul-2005 jhb

Fix a typo and some whitespace nits.


147954 13-Jul-2005 glebius

NET_LOCK_GIANT() when entering network code.

Pointy hat to: glebius
Reported by: rodrigc


147828 08-Jul-2005 mlaier

ALTQify ste(4).

Requested and tested by: <nike_d at cytexbg dot com>
Approved by: re (scottl)


147805 07-Jul-2005 scottl

Fix ifnet fallout in if_ti.

Reviewed by: brooks
Approved by: re


147606 26-Jun-2005 anholt

Make the initialization in the AGPv3 case match that of Linux. Fixes hangs on
X startup with DRI enabled, with a v3-capable card.

Tested by: Tom McLaughlin <tmclaugh@sdf.lonestar.org>
Approved by: re (scottl)


147291 11-Jun-2005 brooks

Move if_alloc() up so it's before mii_phy_probe().


147256 10-Jun-2005 brooks

Stop embedding struct ifnet at the top of driver softcs. Instead the
struct ifnet or the layer 2 common structure it was embedded in have
been replaced with a struct ifnet pointer to be filled by a call to the
new function, if_alloc(). The layer 2 common structure is also allocated
via if_alloc() based on the interface type. It is hung off the new
struct ifnet member, if_l2com.

This change removes the size of these structures from the kernel ABI and
will allow us to better manage them as interfaces come and go.

Other changes of note:
- Struct arpcom is no longer referenced in normal interface code.
Instead the Ethernet address is accessed via the IFP2ENADDR() macro.
To enforce this ac_enaddr has been renamed to _ac_enaddr.
- The second argument to ether_ifattach is now always the mac address
from driver private storage rather than sometimes being ac_enaddr.

Reviewed by: sobomax, sam


146734 29-May-2005 nyan

Remove bus_{mem,p}io.h and related code for a micro-optimization on i386
and amd64. The optimization is a trivial on recent machines.

Reviewed by: -arch (imp, marcel, dfr)


146435 20-May-2005 glebius

Calling xl_rxeof() at the end of xl_start_locked() leads to recursion
in case of IP fast forwarding. Enqueue a taskqueue(9) task instead of
calling xl_rxeof() directly.

Reported & tested by: Slava Alpatov
Reviewed by: wpaul
MFC after: 1 week


145501 25-Apr-2005 bz

Deal with failed malloc calls[1].
While there also check for failed device_add_child calls.

Found by: Coventry Analysis tool[1].
Submitted by: sam[1]
Approved by: pjd (mentor)
MFC after: 1 week


145219 18-Apr-2005 imp

Fix newer Xircom CBE2-100 cards that were reporting
dc0: MII without any PHY!
We have to enable the connection to the MII first. Doing so fixes the
problem cards without breaking the older, working cards.

Bad card provided by: deischen


144981 13-Apr-2005 mdodd

Invert conditional and use continue to reduce nesting.


144809 08-Apr-2005 obrien

Add nForce3-250.


144517 02-Apr-2005 obrien

nVidia AGP chipsets beyond nForce2 are AMD64-specific.
So move the AGP support to there.

Submitted by: Jung-uk Kim <jkim@niksun.com>


144407 31-Mar-2005 scottl

If resource allocation fails, we could wind up freeing the cdev without it
being allocated. Add a simple check for this.

Submitted by: yongari


144243 28-Mar-2005 obrien

Bring rev 1.31 to the AMD64 platform.
This adds support for the SiS intergrated NIC on some Athlon64 motherboards.
The MAC address is stored in the APC CMOS RAM and this fixes the
sis driver ending up with a 00:00:00:00:00:00 MAC address.

Submitted by: Stasys Smailys <ssmailys@komvista.lt>


144165 26-Mar-2005 sam

deal with malloc failure when setting up the multicast filter

Noticed by: Coverity Prevent analysis tool


144164 26-Mar-2005 sam

handle malloc failure and sk_vpd_prodname potentially being null for
other reasons

Noticed by: Coverity Prevent analysis tool
Reviewed by: bz, jmg


144155 26-Mar-2005 ru

xl(4) meets polling(4). Hardware for this work kindly provided by
Eric Masson.

MFC after: 3 weeks


143903 21-Mar-2005 scottl

Start the process of modernizing the Tigon driver by using busdma for the
descriptor and configuration data. Thanks to Martin Nilsson for providing
hardware.


143754 17-Mar-2005 bz

Do not try to free non allocated memory in error case.
Do our best to plug some memory leaks (VPD data, jumbo memory buffer,...).
Log if we cannot free because memory still in use[1].
Change locking to avoid ''acquiring duplicate lock of same
type: "network driver"'' and potential deadlock. Also seems to fix LOR #063.

[1] This change does not solve problems if buffers are still in use when
unloading if_sk.ko. There is ongoing work which will address jumbogram
allocations in a more general way.

PR: kern/75677 (with changes, no mii fixes in here)
Tested by: net, Antoine Brodin (slightly different version)
Approved by: rwatson (mentor)
MFC after: 5 days


143753 17-Mar-2005 bz

* Lower interrupt moderation timer 200->100.
Obtained from: NetBSD if_sk.c rev. 1.11

* Make interrupt moderation configurable via sysctl/tuneable.
PR: kern/41220
Approved by: rwatson (mentor)


143752 17-Mar-2005 bz

* Improve chip identification.
Obtained from: NetBSD if_sk.c rev. 1.11

* Take PHY out of reset for Yukon Lite Rev. A3.
Submitted by: postings on net@ in thread "skc0: no PHY found", 2005-02-22

Tested by: net
Approved by: rwatson (mentor)
MFC after: 5 days


143751 17-Mar-2005 bz

* When adding/deleting multicast addresses, only whack the address filter
if the interface is marked RUNNING.
Obtained from: NetBSD if_sk.c rev. 1.12

* Don't initialize the card (and start an autonegotiation) every time the IP
address changes. Makes 'dhclient sk0' invocations way faster and more
consistant. i.e. one DHCPREQUEST elicits the DHCPACK.
Obtained from: OpenBSD if_sk.c rev. 1.56

* Additional locking changes in sk_ioctl.

PR: kern/61296 should see improvements by the last two.
Approved by: rwatson (mentor)
MFC after: 5 days


143309 09-Mar-2005 scottl

Bugger, wiped out a needed comma in the previous commit.


143307 08-Mar-2005 scottl

The DC driver asks for an alignment of PAGE_SIZE for data buffers, but also
asks that each buffer be (2048 * 256) bytes long. I suspect that alignment
isn't a real requirement since busdma only recently started honoring it. The
size is also bogus. Fix both of these and stop busdma from trying to
exhaust the system memory pool with bounce pages.

Submitted by: Kevin Oberman
MFC After: 7 days


142646 27-Feb-2005 cognet

Add device id for the Ali M1671 host to AGP bridge.


142418 25-Feb-2005 imp

Add back 'n' that went missing in last commit


142407 24-Feb-2005 imp

Fix style(9) issues with __P removal.

Noticed by: bde


142398 24-Feb-2005 imp

Return BUS_PROBE_DEFAULT instead of 0.


141885 14-Feb-2005 anholt

Correct the SiS 755 PCI ID. Confirmed against Linux code.

PR: kern/76411
Submitted by: Jonathan Fosburgh, jonathan at fosburgh dot org
Obtained from: Jung-uk Kim, jkim at niksun.com


141883 14-Feb-2005 anholt

No use for this AMD64 special-case "return NULL;" in probe now that we don't
do fake "generic" support.


141676 11-Feb-2005 mlaier

Adjust TX threshold on every TX underrun. Some supported cards (8139-based)
can retransmit on TX underrun and set TOK in addition to TUND. Also add a
check to prevent overflow of the addressable threshold.

This fixes some reports of rl(4) slowness, believed to be related to ALTQ
before.

PR: kern/61448
Submitted by: Tim Draegen-Gilman <timNOeudaemonSPAMnet> (with changes)
MFC after: 1 week


140970 29-Jan-2005 bz

Cleanup debugging code and put it under bootverbose
(includes minor style polishing).

Approved by: rwatson (mentor)


140642 22-Jan-2005 imp

Bring in support for SUGOI LAN GIGA NIC made by System TALKS, Inc from
a RealTek 8169SB.

PR: 74262
Submitted by: Yoshikazu GOTO-san

# Submitter notes that he's unsure of the revision string for 8169SB


139974 10-Jan-2005 ru

Reimplement the fix in rev. 1.126.

OK'ed by: phk


139944 09-Jan-2005 sam

correct direction for bus_dma sync of rx buffer

Submitted by: Tai-hwa Liang


139888 07-Jan-2005 phk

Revert local experiment which leaked into commit.


139887 07-Jan-2005 phk

Fix compilation of DEVICE_POLLING code.


139834 07-Jan-2005 scottl

Fix typos from previous commit.


139825 07-Jan-2005 imp

/* -> /*- for license, minor formatting changes


139810 07-Jan-2005 phk

We no longer recurse the mutex.


139809 07-Jan-2005 phk

If we get an interrupt and the interface is down, return before we
grab the lock. This should help a tiny bit on machines where unused
if_sis interfaces share IRQ.


139808 06-Jan-2005 phk

Don't tweak DSP on the ..16 chips.


139807 06-Jan-2005 phk

Fix for an issue with excessive collisions in half duplex mode.


139806 06-Jan-2005 phk

Nail the short cable problem the exact way National says it should be.


139805 06-Jan-2005 phk

Simplify and fix bugs in rx/tx ring cleanup.


139802 06-Jan-2005 phk

Rewrite the rx/tx ring initialization to use pointers instead of arrays.


139801 06-Jan-2005 phk

Eliminate a bunch of unnecessary prototypes.


139800 06-Jan-2005 phk

Move the module related stuff to the bottom of the file. This will
allow us to save prototypes.


139798 06-Jan-2005 phk

Make sure to clear any pending interrupts when we stop the interface.


139797 06-Jan-2005 phk

Close a theoretical race: By the time the watchdog comes around
the interface may have been stopped, so we should not restart it.


139741 05-Jan-2005 phk

Align if else if properly


139740 05-Jan-2005 phk

Style: new-speak functions, remove pointless "return".


139717 05-Jan-2005 phk

Make sis_initl() take a typed argument.
Expect caller to lock before calling sis_stop()
Various style stuff.


139715 05-Jan-2005 phk

Add locked/unlocked variants of sis_init()


139714 05-Jan-2005 phk

Make a locked and unlocked variant of sis_start()


139708 05-Jan-2005 phk

Don't declare variables "register", the compiler ought to know what to do.


139691 04-Jan-2005 phk

Instead of keeping track of the index into the receive ring use the already
implemented "sis_nextdesc" pointer to keep a pointer instead.


139690 04-Jan-2005 phk

Forget about the sis_list_data and sis_ring_data structures and embedd
their fields directly in the softc structure.

This is a no-op which shortens most of the affected source lines
by N * 10 characters.


139689 04-Jan-2005 phk

Prototype busdma callback using the typedef.


139649 03-Jan-2005 rwatson

Add PCI and device ID's to if_xl to support:

3C920B-EMB-WNM Integrated Fast Ethernet Controller

Submitter reports that the card appears to autonegotiate properly, and
operate well with high levels of NFS traffic.

PR: 75253
Submitted by: "Oleg V. Nauman" <oleg at reis dot zp dot ua>
MFC after: 2 weeks


139431 30-Dec-2004 anholt

[1] Remove the generic bridge support from those drivers that had it. The
generic bridge support was biting us more than it helped, whenever a new chipset
came out from a vendor and misprogramming it caused strange hangs or corruption.
[2] Add a large number of PCI IDs based on what the linux drivers support.
Note that the new PCI IDs haven't been tested, they're just *likely* to work.
In particular the VIA AGP 8x chipsets are concerning, due to lack of testing,
possible issues (kern/69953), and not having a nice "does this bridge say it
would do 8x" function. However, this shouldn't make the situation worse, since
these chips would have probed in the past anyway.


139263 24-Dec-2004 mlaier

Enable sk(4) for ATLQ.

Thoroughly tested by: Ender <ender NO tog SPAM net>
MFC after: 4 weeks


139059 20-Dec-2004 bz

Enable jumbo frames on Yukon variants of sk(4).

In contrast to OpenBSD we enable jumbo frame support
depending on MTU setting (like done for xmac).

Approved by: pjd (mentor)
Obtained from: OpenBSD if_sk.c r1.52 (YU_SMR_MFL_JUMBO flag)
Tested by: Heinz Knocke <knockefreebsd at o2 dot pl>
MFC after: 5 days


138424 06-Dec-2004 alc

Update the Tigon 1 and 2 driver to use the sf_buf API for implementing
zero-copy receive of jumbo frames. This eliminates the need for the
jumbo frame allocator implemented in kern/uipc_jumbo.c and sys/jumbo.h.
Remove it.

Note: Zero-copy receive of jumbo frames did not work without these changes;
I believe there was insufficient locking on the jumbo vm object.

Tested by: ken@
Discussed with: gallatin@


138355 03-Dec-2004 mdodd

- Simplify pcn_probe() by moving vendor/device matching code to pcn_match().
- Avoid LOR in pcn_probe() by removing useless mutex stuff.


138354 03-Dec-2004 mdodd

- Move chip ID code into separate function.
- Initialize sc->pcn_type during ATTACH as softc contents may not surivive
from PROBE.
- Print out chip-id to assist with ongoing pcn(4) debugging efforts.


138351 03-Dec-2004 mdodd

Additional register definitions.

Obtained from: NetBSD


137835 17-Nov-2004 brueffer

Correct URL of the programming manual.


137834 17-Nov-2004 brueffer

Add missing /* DEVICE_POLLING */


137827 17-Nov-2004 jmg

only clear the IFF_OACTIVE flag when we have a chance of being able to
queue a packet to the hardware... instead of when the hardware queue is
empty..

don't initalize cur_tx now that it doesn't need to be...

Pointed out by: bde


137756 15-Nov-2004 jmg

move the lock after the NULL check so we don't have a hard(er) to diagnose
panic...

Pointed out by: Bjoern A. Zeeb


137743 15-Nov-2004 jmg

fix the missing lock in sk_jfree (verified w/ an assert)
also fix up handling and proding of the tx, _OACTIVE is now handled
better...

Submitted by: Peter Edwards (sk_jfree)
Obtained from: OpenBSD and/or NetBSD (tx prod)


137699 14-Nov-2004 obrien

Commit more debugging output. This is a little bit of using a large hammer,
but sk(4) is so prevalent on AMD64 motherboards we need to reduce the number
of round trips in the mailing lists trying to get sufficient information to
make sure we've got a handle on all the problems and are working towards
making sk(4) solid.

Submitted by: bz


137674 13-Nov-2004 bz

Set ramsize depending on a value from eprom instead of using
hardcoded 128k for Yukon devices. 88E8001 only has 64k of on-chip RAM[1].

[1] http://www.marvell.com/products/pcconn/yukon/Yukon_88E8001_10_073103_final.pdf

Tested by: amd64, current
Approved by: rwatson (mentor)
MFC after: 1 week


137620 12-Nov-2004 brueffer

Add altq support.

Patch by mlaier.

Approved by: mlaier
MFC after: 2 weeks


137557 10-Nov-2004 brueffer

Add device polling support

Original patch by me, improvements by ru

Happy birthday to: BSDforen.de!
Approved by: ru
MFC after: 2 weeks


137402 08-Nov-2004 phk

Hide link up/down/media printfs behind bootverbose


137387 08-Nov-2004 mlaier

Another missing ! in front of IFQ_DRV_IS_EMPTY, this time in an even more
sensitive, but less excercised location (the watchdog). While here use the
*_start_locked function directly to avoid drop, grab, drop lock.

I have to be very careful with future ALTQ patches!

Found & reviewed by: rwatson
MFC after: 3 days


137111 01-Nov-2004 obrien

* Correct an off-by-one reading vpd ro data.
* Announce some more fields from ro area for better debugging of broken
sk(4)s on various boards.

Submitted by: Bjoern A. Zeeb <bzeeb-lists@lists.zabbadoz.net>


136997 27-Oct-2004 bms

Forcibly disable interrupts, if we find ourselves servicing one when
the device is suspended or shutting down. This will need to be rethought
slightly if we implement suspend/resume support within vr(4).
This appears to fix the vr_shutdown() panic on SMP machines.

My theory here is there's a race somewhere during vr_detach() with
vr_intr() in the SMP case which was sometimes being triggered,
although quite why this was happening is unclear (vr_stop() also
explicitly disables interrupts by writing to the IMR register).

MFC-to-RELENG_5* candidate.

PR: kern/62889
Tested by: seb at struchtrup dot com
MFC after: 10 days


136976 26-Oct-2004 bms

Workaround for a recursive acquisition of the driver mutex during device
detach; triggered by ether_ifdetach() -> if_delmulti() -> vr_ioctl().
MFC candidate.

PR: kern/62889
MFC after: 3 days


136853 24-Oct-2004 alc

Use VM_ALLOC_NOBUSY to eliminate an unneeded vm_page_wakeup() call and the
synchronization that one entails.


136852 24-Oct-2004 alc

Avoid repeated acquisition and release of the vm object lock inside of
two loops in agp_generic_bind_memory(). As an intended side-effect, all
of the calls to vm_page_wakeup() are now performed with the containing
vm object lock held.


136705 19-Oct-2004 bms

Really really fix typo this time.


136696 19-Oct-2004 bms

Fix typo sc -> dev.


136693 19-Oct-2004 bms

Detach the Rhine completely on shutdown, rather than merely stopping it
as the original logic did. This fixes a race with vr_intr() which was
masked on UP systems and manifested on SMP systems.

PR: kern/62889
MFC after: 1 day


136683 18-Oct-2004 jmg

fix (for me) the problems where if_de gets really slow after time
(usually taking 20 seconds to transmit a packet).. no longer fall back
to only transmitting one packet (instead of the entire queue) after we
have processed the entire send queue... I have no idea why we didn't
start seeing this problem ~6 years ago when this code was introduced...


136269 08-Oct-2004 mlaier

Fix sis, bfe and ndis in the same way dc was fixed:
Do not tell the hardware to send when there were no packets enqueued.

Found and reviewed by: green
MFC after: 1 days


136133 05-Oct-2004 anholt

Add PCI ID for VIA K8T800Pro chipset. Tested with agptest and X with DRI
enabled, but not 3D.


136026 01-Oct-2004 mux

Read the MAC address in the EEPROM in the correct byte order. This
is a no-op on little endian architectures, but fixes getting the MAC
address for some dc(4) cards on big endian architectures.

This is a RELENG_5 candidate.

Tested by: gallatin (powerpc), marius (sparc64)
First version of the patch written by: gallatin


136016 01-Oct-2004 green

Add ALTQ support for dc(4), based upon a mostly-working patch from mlaier.


136015 01-Oct-2004 green

Conditionalize IFF_NEEDSGIANT, like everything else here, on IS_MPSAFE.
The driver doesn't look any less safe without Giant than with, and works
with IS_MPSAFE set to 1 here, so others should probably test it as such.


135896 28-Sep-2004 jmg

fix jumbo frames as much as they can be fixed for re. We now cap the MTU
to 7422 since it appears that the 8169S can't transmit anything larger..
The 8169S can receive full jumbo frames, but we don't have an mru to let
the upper layers know this...

add fixup so that this driver should work on alignment constrained platforms
(!i386 && !amd64)

MFC after: 5 days


135813 26-Sep-2004 johan

style: Move the { back to the else line to match the }.

Discussed with: glebius
X-MFC after: 5.3-Release


135577 22-Sep-2004 stefanf

Prefer C99's __func__ over GCC's __FUNCTION__.


135469 19-Sep-2004 jmg

fix misspelling of TX...

Submitted by: Johan Karlsson
MFC after: 3 days


135467 19-Sep-2004 jmg

comment requirement that rx/tx descriptor counts must be equal due to
shared code...
define rx descriptor count in terms of tx
align defines

MFC after: 3 days


135043 10-Sep-2004 se

Fix oversight reported by Norikatsu Shigemura for the "sym" driver
(which was derived from the "ncr" driver) and add a MODULE_DEPEND
on "cam".

MT5 candidate, IMHO.
MFC after: 1 week


134989 09-Sep-2004 glebius

Do not call xl_init_locked() unconditionally when we are bringed UP. Call
it only if we weren't UP before. In some cases xl_init causes long media
re-negotiation, and ppp(8) fails to open PPPoE connection because it sets
IFF_UP every time before opening PPPoE connection.

PR: kern/69133
Patch by: mdodd
Approved by: wpaul, julian (mentor)
MFC after: 1 week


134842 06-Sep-2004 brueffer

Fix a couple of typos in comments

MFC after: 3 days


134442 28-Aug-2004 rwatson

Tag a last set of PCI network interfaces as IFF_NEEDSGIANT until they
are either locked down or demonstrated MPSAFE.


134433 28-Aug-2004 sanpei

Add support Corega CG-LAPCIGT Gigabit Ethernet(8169S)

PR: [FreeBSD-users-jp 80667]
Submitted by: FUJIMOTO Kou <fujimoto@j.dendai.ac.jp>
MFC after: 1 week


134285 25-Aug-2004 rwatson

if_dc includes locking, but that locking is disabled by a #ifdef
by default. As such, mark if_dc as IFF_NEEDSGIANT until such
time as appropriate locking review and testing can take place,
and the locking can be enabled by default.

RELENG_5 candidate.


134144 22-Aug-2004 anholt

Add support for Intel E7205 AGP.

PR: kern/69858
Submitted by: Jacobo Arvelo <unix4all at gulic dot org>


134099 21-Aug-2004 anholt

Fix aperture size detection on some ALi chipsets by only using the lowest 4 bits
to check aperture size, avoiding hangs. Maintain the rest of the bits when
setting/unsetting ATTBASE. This essentially matches Linux's AGP driver as well.

PR: kern/70037
Submitted by: Mark Tinguely <tinguely at casselton dot net>
Obtained from: NetBSD


134098 21-Aug-2004 anholt

Apply some stylistic changes based off of kern/70037 (content changes to
follow).


134072 20-Aug-2004 jmg

fix LOR's in sk. Original patch from dwhite. This moves the memory
allocation earlier on in sk_attach so we don't have to lock until a bit
later.

PR: 69752


134066 20-Aug-2004 jmg

put function's name at begining of column...


134064 20-Aug-2004 jmg

add pci id for Belkin F5D5005 Gigabit ethernet card.


134043 19-Aug-2004 obrien

Unconditionally support the AMD64 GART HW.


133852 16-Aug-2004 obrien

AMD64 on-CPU GART support.
This also applies to AMD64 HW running 'i386' OS.

Submitted by: Jung-uk Kim <jkim@niksun.com>
Integration by: obrien


133851 16-Aug-2004 obrien

style.9.


133728 14-Aug-2004 marius

- Make OF_getetheraddr() honour the "local-mac-address?" system config
variable. If set to "true" OF_getetheraddr() will now return the unique
MAC address stored in the "local-mac-address" property of the device's
OFW node if present and the host address/system default MAC address if
the node doesn't doesn't have such a property. If set to "false" the
host address will be returned for all devices like before this change.
This brings the behaviour of device drivers for NICs with OFW support/
FCode, i.e. dc(4) for on-board DM9102A on Sun machines, gem(4) and hme(4),
regarding "local-mac-address?" in line with NetBSD and Solaris.
The man pages of the respective drivers will be updated separately to
reflect this change.
- Remove OF_getetheraddr2() which was used as a stopgap in dc(4). Its
functionality is now part of OF_getetheraddr().


133674 13-Aug-2004 rwatson

Since the if_de driver doesn't contain locking, mark it as
IFF_NEEDSGIANT so that ifp->if_start won't be called without Giant
when running debug.mpsafenet=1.


133468 11-Aug-2004 scottl

Revert rev 1.93 and replace it by grabbing the vr lock before calling
mii_pollstat(). The previous was causing the vr lock to recurse.

PR: kern/70189


133406 09-Aug-2004 anholt

Minimal fix to prevent crashes when an AGP v2 card is used with the new v3 VIA
chipsets, based on Linux's via-agp.c. On boot, the system selects which AGP
version to use based on the inserted card. If v2 was chosen, the chipset
needs to be programmed with the v2 registers still. Also included in kern/69953
are changes to make the programming of the v3 registers match linux, but that
will be left out until the need to do so is confirmed (want specs or a tester).

PR: kern/69953
Submitted by: Oleg Sharoiko <os@rsu.ru>
Tested by: Oleg Sharoiko <os@rsu.ru>, Geoff Speicher <geoff@speicher.org>
(full version from PR)


133403 09-Aug-2004 green

Fix rl(4)'s lock behavior upon deinitialization. I would get a panic
when kldunloading due to its private locking being acquired recursively.


133279 07-Aug-2004 rwatson

Acquire vr lock before entering vr_setcfg() in vr_miibus_statchg(),
since vr_setcfg() expects it.

Reported by: Mike Bristow <mike@urgle.com>


133200 06-Aug-2004 roam

Do not attempt to clean up data that has not been initialized yet.
This fixes two kernel panics on boot when the xl driver fails to
allocate bus/port/memory resources.

Reviewed by: silence on -net


133006 02-Aug-2004 mlaier

Unbreak DEVICE_POLLING build / LINT. Sorry!

Submitted by: roam


132986 01-Aug-2004 mlaier

Second part of ALTQ driver modifications, covering:
an(4), ath(4), hme(4), ndis(4), vr(4) and wi(4)

Please help testing: http://people.freebsd.org/~mlaier/ALTQ_driver/

Tested by: Vaidas Damosevicius (an, ath, wi)
Roman Divacky (vr)
Submitted by: yongari (hme)


131934 10-Jul-2004 marcel

Update for the KDB framework:
o Call kdb_enter() instead of Debugger().


131848 09-Jul-2004 bms

Further improve locking in xl(4):

- Avoid an additional lock acquire/release when leaving xl_intr(), by
changing xl_start*() to xl_start*_locked(), and calling the appropriate
routine by chip revision (as the DMA descriptors are different).

- Simplify the appropriate routines now that they are called with the
lock held.

This should save a significant amount of CPU cycles spent on servicing
each interrupt for both UP and SMP whilst remaining MPSAFE.

Tested by: rwatson


131847 09-Jul-2004 bms

Apply the long-overdue hatchet of style(9) death to this file.


131844 09-Jul-2004 bms

Further locking improvements for vr(4):
- Add *_locked() entry points as needed to avoid unnecessary lock thrashing.
- Use these entry points wisely.
- Only acquire the lock once when servicing an interrupt.
- Check 'suspended' on interrupt to avoid racing detach.
- Correct a mis-spelled comment.
- Don't take the lock in vr_reset() to avoid lock thrashing in attach.
- Comment this.

Reviewed by: -net (silence)


131843 09-Jul-2004 bms

Add a 'suspended' flag to softc so that we can avoid races on detach.


131842 09-Jul-2004 bms

Actually turn on driver locking in xl(4).


131841 09-Jul-2004 bms

Further rl(4) locking improvements:
- Avoid unnecessary re-acquisition elsewhere by adding *_locked()
entry points as needed.
- Correct locking for the DEVICE_POLLING case.
- Hold the driver lock for the entire duration of interrupt servicing,
to avoid unneeded, expensive re-acquisition; use *_locked() entry
points as needed.

Reviewed by: -net (silence)


131657 05-Jul-2004 bms

Whitespace nit


131656 05-Jul-2004 bms

Eliminate redundant return keywords.


131655 05-Jul-2004 bms

Whitespace pass.


131654 05-Jul-2004 bms

style(9):
- Space before bracketized non-void function returns.
- Space before condition for conditional blocks.


131653 05-Jul-2004 bms

Eliminate redundant return keywords.


131652 05-Jul-2004 bms

Whitespace nits


131651 05-Jul-2004 bms

style(9) pass on prototypes.


131606 05-Jul-2004 bms

Locking cleanup for rl(4).
- Eliminate the use of a recursive mutex.
- Mark the driver INTR_MPSAFE.

This work is incomplete and will be refined in a future commit.
- Most notably, _locked() variants of entry points need to be introduced.
- The mii upcall/downcall may still be racy.
- Add a stubbed-out guard against racing rl_detach() for the time being.

Tested on: UP, debug.mpsafenet && !debug.mpsafenet
Reviewed by: silence on -net


131605 05-Jul-2004 bms

style(9) and whitespace cleanup.
Use C99 types. Use ANSI function definitions. Sort prototypes.
Split long lines correctly. Punctuate/wordsmith comments.
Use device_printf()/if_printf() where possible.

Reviewed by: -net (silence)


131604 05-Jul-2004 bms

Reintroduce and clean up locking in xl(4).

- Eliminate the use of a recursive mutex.
- Mark the driver as INTR_MPSAFE.
- Split the default media choice code out into xl_choose_media() to
avoid making poor assumptions about the state of the lock during attach.
- The miibus upcall/downcall paths may still be racy.
Change to commented-out locking assertions there for now.
- Tested with nfsclient, routed, ssh, ntp, dhclient and quagga bgpd.
- This needs SMP test coverage. I do not have such resources.

Tested on: UP, !debug.mpsafenet && debug.mpsafenet
Hardware: 3C905B-TX (0x905510b7)


131601 05-Jul-2004 bms

Use if_printf() and device_printf() where appropriate, i.e.:
- Use device_printf() during device probe/attach.
- Move if_xname initialization to before xl_reset() is called.
- Use if_printf() at all other times after struct ifnet has been
initialized.


131600 04-Jul-2004 bms

ANSIfy function definitions.
Remove unnecessary return keywords.
Other minor stylistic changes.


131597 04-Jul-2004 bms

Fix whitespace, indentation, long line wrapping and comments.


131596 04-Jul-2004 bms

Fix whitespace and comments.


131575 04-Jul-2004 stefanf

Consistently use __inline instead of __inline__ as the former is an empty macro
in <sys/cdefs.h> for compilers without support for inline.


131518 03-Jul-2004 bms

SMPng locking cleanup for vr(4).
- Remove recursive locking situations. Remove the MTX_RECURSE bit.
- Take the lock for any routine which is not called from within if_vr.c
itself; this includes entry points called by newbus, ifnet, callout,
ifmedia, and polling subsystems.
- Remove spl references from the code added to miibus callbacks in rev 1.60.
- Add the INTR_MPSAFE bit.
- Tidy up some assignments; locks are not needed for taking the address
of something at a known offset, for example.
- Tested on the machine this was committed from.

Tested on: UP only, !debug.mpsafenet && debug.mpsafenet
Reviewed by: rwatson


131517 03-Jul-2004 bms

- Another whitespace pass; make locking calls more obvious.
- Use C99 types for vr_miibus_readreg().


131503 02-Jul-2004 bms

style(9) compliance.
Put some braces around the busy-wait loop in vr_rxeoc() to make the
no-op semicolon more obvious.
No functional changes.
Running on the machine I am committing from without problems.

Reviewed by: jmallett


131455 02-Jul-2004 mlaier

Bring in the first chunk of altq driver modifications. This covers the
following drivers: bfe(4), em(4), fxp(4), lnc(4), tun(4), de(4) rl(4),
sis(4) and xl(4)

More patches are pending on: http://peoples.freebsd.org/~mlaier/ Please take
a look and tell me if "your" driver is missing, so I can fix this.

Tested-by: many
No-objection: -current, -net


131433 02-Jul-2004 jhb

Add support for the VIA Apollo KT400/400A/600 AGP host bridges which use
the VIA v3 register offsets.

PR: 68545
Submitted by: Ariff Abdullah <skywizard@mybsd.org.my>


131289 29-Jun-2004 imp

Remove saved_* from dc_softc. They are now no longer needed.

Submitted by: Marius Strobl


131253 28-Jun-2004 imp

Remove burn bridges code that saved/restored the pci config registers
that are now handled in the pci bus layer. They are no longer
necessary.


130879 21-Jun-2004 phk

Be BURN_BRIDGES compliant.


130585 16-Jun-2004 phk

Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.


130415 13-Jun-2004 phk

Use NG_FREE_MSG() instead of FREE().


130270 09-Jun-2004 naddy

Replace handrolled CRC calculation with ether_crc32_[lb]e().


129878 30-May-2004 phk

Add missing <sys/module.h> includes


129876 30-May-2004 phk

Add some missing <sys/module.h> includes which are masked by the
one on death-row in <sys/kernel.h>


129823 29-May-2004 julian

Switch to using C99 sparse initialisers for the type methods array.
Should make no binary difference.

Submitted by: Gleb Smirnoff <glebius@cell.sick.ru>
Reviewed by: Harti Brandt <harti@freebsd.org>
MFC after: 1 week


129672 24-May-2004 jhb

Wrap the code to save/restore PCI config registers on suspend/resume in
#ifndef BURN_BRIDGES.

Noticed by: phk


129636 23-May-2004 rwatson

Only initialize the if_sis callout as MPSAFE if debug.mpsafenet is set
true. Otherwise, assertion checks for Giant in the network stack will
fail causing a panic.

Reported by: simon


129633 23-May-2004 yar

A handler for ioctl(SIOCSIFCAP) should not alter a bit in
if_capenable unless the interface driver is actually able
to toggle the respective capability on and off.

Reviewed by: ru


129605 23-May-2004 mux

Use __FBSDID.


129601 23-May-2004 mux

In agp_generic_bind_memory(), grab the needed pages before acquiring
the agp mutex. We do this because vm_page_grab() called with the
VM_ALLOC_RETRY flag can sleep.

Pointed out by: alc


129579 22-May-2004 mux

Get rid of a lockmgr consumer by making agp(4) use a standard mutex,
since it's always acquiring the lock exclusively. This was tested
with X on an SMP box, with and without WITNESS.


129567 22-May-2004 mux

Plug three lock leaks.


129415 19-May-2004 anholt

Add explicit list of SiS AGP chipsets based on Linux kernel's list.

Prompted by: i386/59503


129413 19-May-2004 imp

Replace the lame big endian crc with wpaul's standard big endian crc
algorithm, supplied by wpaul himself. The lame one has an origin
that's been called into question, so rather than argue about that (one
could make an excellent fair use argument), replace it with better
code since that's what FreeBSD is about.

Submitted by: wpaul[1], Klaus Klein

[1] Bill called this a silly bikeshed. Maybe his is not incorrect.


129189 13-May-2004 jhb

Different VIA host bridges use different offsets to their AGP config
registers, so add a register offset array to the softc. We key off the
device ID to determine which set of register offsets. Currently the 8385
host bridge used on amd64 is the only bridge to use the AGP3_VIA_*
register offsets and all other bridges use the AGP_VIA_* offsets. It is
currently unclear if the AGP3_VIA_* offsets are for VIA bridges that
implement AGP 3.0 bridges or just for amd64 bridges.

Submitted by: Kenneth Culver culverk at sweetdreamsracing dot biz


128815 02-May-2004 bde

Remove old cy driver files. They have been repo-copied to sys/dev/cy and
sys/dev/ic and adjusted to work there.


128613 24-Apr-2004 alc

Push down the responsibility for zeroing a physical page from the
caller to vm_page_grab(). Although this gives VM_ALLOC_ZERO a
different meaning for vm_page_grab() than for vm_page_alloc(), I feel
such change is necessary to accomplish other goals. Specifically, I
want to make the PG_ZERO flag immutable between the time it is
allocated by vm_page_alloc() and freed by vm_page_free() or
vm_page_free_zero() to avoid locking overheads. Once we gave up on
the ability to automatically recognize a zeroed page upon entry to
vm_page_free(), the ability to mutate the PG_ZERO flag became useless.
Instead, I would like to say that "Once a page becomes valid, its
PG_ZERO flag must be ignored."


128472 20-Apr-2004 obrien

Add support for the AMD 8111.


128439 19-Apr-2004 obrien

Use BSD spelling, no SysV.


128199 13-Apr-2004 imp

Boomerang 10/100BT (found in 2c905-TX) chips apparently suffer the
same problems as their Hurricane 575* bretheren in that one could set
the memory mapped port, but that has no effect. Add a quirk for this.

# I'll have to see if I can dig up documentation on these parts to see
# if there's someway software can know this other than a table...


128138 11-Apr-2004 ru

Implemented per-interface polling(4) control.


128121 11-Apr-2004 ru

Implemented per-interface polling(4) control.


128118 11-Apr-2004 ru

Implemented per-interface polling(4) control.


128117 11-Apr-2004 ru

Implemented per-interface polling(4) control.


128115 11-Apr-2004 ru

First driver with user-configurable polling(4).


127937 06-Apr-2004 ru

Actually fix the TX performance with polling(4) enabled
by increasing the TX list size from 64 to 128, which is
adequate for HZ=1000.

Submitted by: Vsevolod Lobko


127927 06-Apr-2004 ru

- Improved the TX performance with polling(4) by only checking the
status registers for error conditions and updating statistics
when there are cycles left (inspired by the nge(4) driver).

- Removed the TX list counter and the producer/consumer gap; it's
enough to just ensure we don't reuse the last (free) descriptor,
as the chip may not have read its next pointer yet. If we reuse
it, the TX may stall under a heavy TX load with polling enabled.

- Dropped code to recharge the watchdog timer, it's pointless; the
watchdog routine will re-init the chip and both RX and TX lists.


127901 05-Apr-2004 ru

- Rewritten TX to use only two pointers to track producer/consumer.
- Added polling(4) support!
- Bugfix: don't forget to set IFF_OACTIVE when TX list is full.
- Minor: tidy up vr_encap().


127885 05-Apr-2004 bde

Converted the isa probe and attach to new-bus so that this driver works
without the (defunct) isa compatibility shims. The new-bus-specific
parts are very similar to the ones for the pci probe and attach.

This was held up too long waiting for a repo copy to src/sys/dev/cy,
so I decided to fix the files in their old place. This gives easier
to read and merge diffs anyway.

The "count" line in src/sys/conf/files won't be changed until after
the repo copy, so old kernel configs that specify a count need not be
(and must not be) changed until then. The count is just ignored in
the driver. One unfinished detail is dynamic allocation of arrays
with <count> and (<count> * 32) entries, and iteration over the arrays.
This is now kludged with a fixed count of 10 (up to 10 cards with up
to 32 ports each).

Prodded by: imp
Submitted by: mostly by imp
Approved by: imp


127873 05-Apr-2004 imp

Add register definitions for the status and command registers for AGP.

PR: 64846
Submitted by: Samy Al Bahra


127815 03-Apr-2004 njl

Add the ability to disable agp devices at the loader prompt. Usage is
hint.agp.0.disabled="1"

Submitted by: jhb


127793 03-Apr-2004 ru

Recharge the watchdog timer if there's still some TX work left.


127790 03-Apr-2004 peadar

Before MFC'ing the previous commit, I noticed I'd left out a case.
Add in missing case for i845G in the attach routine. I'll MFC this
with the rest of the change after the 4.10 codefreeze lifts.

Reviewed By: Doug Rabson


127783 03-Apr-2004 ru

Fixed a few bugs in the rl(4) driver:

Under polling(4), we counted non-existent output packets and wasted
CPU cycles, corrected. (PR kern/64975.)

The fix in revision 1.71 to correct resetting of the watchdog timer
was wrong.

In rl(4), the TX list does not have a gap between the consumer and
producer, so the "empty TX list" test was wrong, corrected.

Also, resetting the timer to five each time we know there is still
some TX work to do was a bad idea -- under polling(4), if the chip
goes out to lunch, this results in the watchdog routine to _never_
be called. Instead, let the timer downgrade to zero and fire the
watchdog, then reset it to five when it is zero AND there is some
TX work left. (Most other network drivers need this fix too.)

MFC after: 3 days


127775 02-Apr-2004 ru

Performance tuning.

Moved the RX ring resyncing code to ste_rxeoc(), and only run it
if we were asked to POLL_AND_CHECK_STATUS, under DEVICE_POLLING.
(This significantly reduces the CPU load.)

Improved the RX ring resyncing code by re-checking if the head
is still empty before doing resyncing. This mostly affects the
DEVICE_POLLING mode, where we run this code periodically. We
could start checking with an empty head (well, an empty ring
even), and after doing a few iterations, the chip might write
a few entries, including the head, and we would bogusly consider
this case as requiring resyncing. On a test box, this reduced
the number of resyncs done by a factor of 10.

In ste_txeof(sc), only reset the watchdog timer to zero when
the TX list is completely empty.

Converted ste_tx_prev_idx to a pointer -- faster.

Removed some bitrot.


127709 01-Apr-2004 ru

Moved the statistical counter under hw.ste.rxsyncs.

Suggested by: njl


127688 31-Mar-2004 ru

Under a heavy RX load, at least with D-Link DFE-550TX adapters,
the driver's RX ring head may fall behind the chip, causing the
stuck traffic, disordered packets, etc. Work around this by
adopting the technique of resyncing RX head used in dc(4) and
xl(4) drivers, but do it in a slightly different place to reduce
the number of resyncs needed.

Also, set the NIC's RX polling period to a more meaningful value,
to stop overloading the PCI bus (this also reduces the number of
resyncs by a factor of 3 or more in a long run; the actual number
is very dependent on a nature of the traffic).

Maintain the statistics counter as the hw.ste_rxsyncs sysctl.

In cooperation with: Vsevolod Lobko
OK'ed by: ambrisko
MFC after: 5 days


127686 31-Mar-2004 ru

Added polling(4) support for ste(4).

MFC after: 5 days


127672 31-Mar-2004 mckay

Support the D-Link DGE-530T. Mine appears to have a blank eeprom, so assume
they all do and handle that without alarming the user. Also pull in a bit
of defensive code from OpenBSD that triggers when a card is recognised but
not properly classified as either Genesis or Yukon. Not that I could ever
have needed this. :-)

Obtained from: OpenBSD/NetBSD (partially)
MFC after: 2 weeks


127634 30-Mar-2004 ru

Switch ste_encap() over to using m_defrag().

No functional change, the previous ste_encap() was correct WRT
long mbuf chains; this just reduces code duplication.

MFC after: 3 days
Prodded by: ambrisko


127377 24-Mar-2004 ru

Properly reprogram the hardware when IFF_ALLMULTI flag is set.


127213 19-Mar-2004 silby

solid reports that it is buggy *and* that it slows down transmit
speed.

Buggy report: Matt Dillon & others
Slowness report: I can't find the e-mail

MFC After: 1 minute


127135 17-Mar-2004 njl

Convert callers to the new bus_alloc_resource_any(9) API.

Submitted by: Mark Santcroos <marks@ripe.net>
Reviewed by: imp, dfr, bde


126966 14-Mar-2004 mdodd

Announce ethernet MAC addresss in ether_ifattach().


126922 13-Mar-2004 peadar

Recognise the 82845G AGP bridge, and poke it appropriately at
attach/detach time.

Assigning the default behaviour to this particular device is
incorrect, corrupting the video BIOS aperture, and breaking
VESA support in the kernel and XFree86.

Reviewed By: dfr
MFC after: 1 week
PR: kern/62906


126847 11-Mar-2004 mux

Stop setting ifp->if_output to ether_output() since ether_ifattach()
does it for us already.


126080 21-Feb-2004 phk

Device megapatch 4/6:

Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.


126076 21-Feb-2004 phk

Device megapatch 1/6:

Free approx 86 major numbers with a mostly automatically generated patch.

A number of strategic drivers have been left behind by caution, and a few
because they still (ab)use their major number.


125845 15-Feb-2004 phk

This is not a D_TTY driver.


124817 21-Jan-2004 wpaul

Fix multicast and promiscuous mode handling for Yukon devices.

Submitted by: Jung-uk Kim <jkim@niksun.com>


124816 21-Jan-2004 wpaul

Calculate the right register offset when clearing TX buffer pointer
registers in rl_stop().

PR: kern/60250


124460 13-Jan-2004 alc

Replace calls to vm_page_alloc_contig() by calls to contigmalloc().
vm_page_alloc_contig() will be removed after the three remaining drivers
that use it are also converted to contigmalloc().


124259 08-Jan-2004 mux

Some integrated Davicom cards in sparc64 boxes have an all zeros
MAC address in the EEPROM, and we need to get it from OpenFirmware.
This isn't very pretty but time is lacking to do this in a better
way this near 5.2-RELEASE. This is a RELENG_5_2 candidate.

Original version by: Marius Strobl <marius@alchemy.franken.de>
Tested by: Pete Bentley <pete@sorted.org>
Reviewed by: jake


124240 08-Jan-2004 truckman

The transmit frame status is stored in the last transmit descriptor for the
frame, not the first. It is probably also not safe to free the mbuf chain
as soon as the OWN bit is cleared on the first descriptor since the chip
may not be done copying the frame into the transmit FIFO. Revert the part of
of busdma conversion (if_dc.c rev 1.115) which changed dc_txeof() to look for
the status in the first descriptor and free the mbuf chain when processing
the first descriptor for the frame, and revert the matching changes elsewhere
in the driver. This part of the busdma change caused the driver to report
spurious collisions and output errors, even when running in full-duplex mode.
Reverting the mbuf chain handling slightly complicates dc_dma_map_txbuf(),
since it is responsible for setting the OWN bits on the descriptors, but does
not normally have direct access to the mbuf chain.

Tested by:
Dejan Lesjak <dejan.lesjak at ijs.si> alpha/<Intel 21143 10/100BaseTX>
"Xin LI" <delphij at frontfree.net> i386/<Macronix 98713 10/100BaseTX>
Wiktor Niesiobedzki <bsd at w.evip.pl> i386/<3Com OfficeConnect 10/100B>

Reviewed by: mux


124076 02-Jan-2004 wpaul

Fix detection of RealTek 8129 PCI cards. Apparently, these cards
report a hardware rev of 0x00000000. Sadly, the 8169 gigE MAC
also reports 0x00000000, so testing against this for exclusion
results in both cards being skipped by rl_probe(). Make the 8169
test more specific by matching against both the hwrev and the PCI
ID for this chip.

PR: kern/60824


123833 25-Dec-2003 phk

Vastly improve performance of IRQ handling on stopped interfaces with
this driver by introducing a flag saying we already stopped the device.

On my Soekris net4801, this took a ping -i 0.001 from spending 80% of
time in interrupt handling to 10% (approx numbers).

This was a particular problem for the net4801 because the tree
interfaces share the same interrupt, but it would be a problem for
any configuration where an unused if_sis interface shares an interrupt
with a busy device.

Other drivers may have similar problems.

Thanks to: Luigi


123740 23-Dec-2003 peter

Catch a few places where NULL (pointer) was used where 0 (integer) was
expected.


123491 12-Dec-2003 phk

Attempt to get the short cable fix to work better on the if_sis:

Only do short-cable on revisions that need it.

Move generic initialization before short-cable fix, in order to not
clobber short cable fix register setting.


123289 08-Dec-2003 obrien

Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones.

Requested by: bde,imp


123213 07-Dec-2003 imp

Remote meteor driver. It hasn't compiled in over 3 years. If someone
makes it compile again, and can test it, we can restore the driver to
the tree.


123166 06-Dec-2003 sanpei

Add support for ELECOM/Laneed CardBus FastEtherner Card(LD-CBL/TXA)

Submitted by: Masahiro Yamagishi <night@pluto.dti.ne.jp>
Approved by: re (scottl)


123105 02-Dec-2003 bde

Fixed some minor indentation bugs.

Approved by: re (scottl)


123104 02-Dec-2003 bde

Fixed breakage of the pci case of the cy driver by the new interrupt
code. Both the driver and the new code were wrong. Driver interrupt
handlers are supposed to take "void *vsc" arg, but some including all
COMPAT_ISA drivers and the pci part of the cy driver want an "int unit"
arg. They got this using bogus casts of function pointers which should
have kept working despite their bogusness. However, the new interrupt
code doesn't honor requests to pass an arg of ((void *)0), so things
are very broken if the arg is actually a representation of unit 0.

The fix is to use a normal "void *vsc" arg for the pci case and a
wrapper for the COMPAT_ISA case (of the cy driver). This cleans up
new-busification of the pci case but takes the COMPAT_ISA case a little
further from new-bus. The corresponding bug for the COMPAT_ISA case
has already been fixed similarly using a wrapper in compat_isa.c and
we need another wrapper just to undo that.

Fixed some directly related style bugs (mainly by removing compatibility
cruft).

cy.c:
Fixed an indirectly related old bug in cyattach_common(). A wrong status
was returned in the unlikely event that malloc() failed.

Approved by: re (scottl)


123052 29-Nov-2003 sam

correct typo in interrupt handling for the 2nd port of 2-port cards

Submitted by: luigi
Reviewed by: checking original openbsd code
Approved by: re (scottl)


123019 28-Nov-2003 imp

Sometimes cardbus attachments don't attach, so while we track down
this problem put these lines back in. While they should be
unnecessary, they appear to be sometimes necessary.

Reviewed in concept: dfr
Approved by: re (scottl@)


122689 14-Nov-2003 sam

Drop the driver lock around calls to if_input to avoid a LOR when
the packets are immediately returned for sending (e.g. when bridging
or packet forwarding). There are more efficient ways to do this
but for now use the least intrusive approach.

Reviewed by: imp, rwatson


122678 14-Nov-2003 obrien

Remove duplicate FBSDID's, move others to their right place.


122643 14-Nov-2003 imp

reconst poison
re-de u_intXX_t


122625 13-Nov-2003 obrien

Try to create some sort of consistency in how the routings to find the
multicast hash are written. There are still two distinct algorithms used,
and there actually isn't any reason each driver should have its own copy
of this function as they could all share one copy of it (if it grew an
additional argument).


122586 12-Nov-2003 wilko

Add vendor ID to make Marvell chipset work. E.g. to be found
on SMC9452TX it seems

Submitted by: Jung-uk Kim <jkim@niksun.com>
Tested by: <Radu Bogdan 'veedee' Rusu> veedee@c7.campus.utcluj.ro
MFC after: 2 weeks


122513 11-Nov-2003 anholt

- Disable AGP on ALI chipsets if aperture size is 0.
- Fail in agp_alloc_gatt if the aperture size is 0 instead of panicing in
contigmalloc.

Reported by: Bjoern Fischer <bfischer@Techfak.Uni-Bielefeld.DE>
Reviewed by: jhb
MFC after: 1 week


122258 07-Nov-2003 peter

Ahh, the joys of badge engineering. Tell the sk driver that the
Linksys EG1032 is yet another variation. It looks just like the 3c940
except it only has a Marvell logo and no 3com logo.


122160 06-Nov-2003 imp

s/driver/device/ for config file line


122136 05-Nov-2003 imp

Change config file syntax to be less FreeBSD 3.x


121942 03-Nov-2003 phk

Free major#100


121939 03-Nov-2003 dfr

Remove explicit cardbus attachments from drivers where this is identical
to the pci attachment. Cardbus is a derived class of pci so all pci
drivers are automatically available for matching against cardbus devices.

Reviewed by: imp


121908 02-Nov-2003 ru

Correct the spelling of m_devget() in the sysctl variable description.


121816 31-Oct-2003 brooks

Replace the if_name and if_unit members of struct ifnet with new members
if_xname, if_dname, and if_dunit. if_xname is the name of the interface
and if_dname/unit are the driver name and instance.

This change paves the way for interface renaming and enhanced pseudo
device creation and configuration symantics.

Approved By: re (in principle)
Reviewed By: njl, imp
Tested On: i386, amd64, sparc64
Obtained From: NetBSD (if_xname)


121697 29-Oct-2003 sam

mark interrupt handlers MPSAFE


121440 23-Oct-2003 jhb

Add simple support for AGP 3.0 including enabling 8x mode. The simple
part of the support is that it still assumes one master and one target
where as AGP 3.0 actually supports multiple devices on the bus.

Submitted by: Keith Whitwell <keith@tungstengraphics.com>
Sponsored by: The Weather Channel


121437 23-Oct-2003 jhb

Use a switch statement on the devid instead of if-else for determing which
code to use to see if the onboard video has been disabled or not.

Submitted by: Keith Whitwell <keith@tungstengraphics.com>


121433 23-Oct-2003 imp

Const poison crc routines (why these aren't centralized, I'm not sure).


121262 19-Oct-2003 silby

Fix m_head handling in sis_encap so that the correct mbuf is always handed
to BPF_MTAP.


121261 19-Oct-2003 silby

Fix a problem where m_defrag would allocate a new mbuf to replace the
chain passed into dc_encap, which dc_start was unaware of. This caused
the old (now invalid) mbuf to be passed to BPF_MTAP.

Spotted by: Kenjiro Cho <kjc@csl.sony.co.jp>


120980 10-Oct-2003 phk

Sanitize the code relating to the /dev/ti%d entries. In particular evict
the evil vnode sniffing code and use destroy_dev() instead.


120822 05-Oct-2003 mbr

Ignore CSR13, CSR14, CSR15 'Media Specific Data' registers
for 21143 based cards which use SIA mode.

This fixes 10mbit mode for ZNYX ZX346Q cards and other
21143 based cards.

PR: 32118
Submitted by: Rene de Vries <rene@tunix.nl>
Geert Jan de Groot <GeertJan.deGroot@tunix.nl>

Obtained from: BSDI

MFC after: 2 weeks


120673 02-Oct-2003 anholt

Make the i810 AGP device create a "drmsub" child device. This will be attached
to by the DRM for i8xx devices.

Submitted by: Keith Whitwell <keith@tungstengraphics.com>


120565 29-Sep-2003 silby

Add a tiny bit more delay in the xl_mii_sync function; this is necessary
for proper intialization in certain 905B + old system combinations.

Tested by: Jakub Miziolek <jxm@obta.uw.edu.pl>


120286 20-Sep-2003 wilko

Add missing file, it is sorely needed to make if_sk.c compile again.


120281 20-Sep-2003 wilko

Add support for SK-9521 V2.0 and 3COM 3C940.

Tested at 100Mbit only, using Asus P4P800 onboard 3C940.
The -stable version of this patch I have in use for ~2 weeks now, and works
just fine for me.

Based on: Nathan L. Binkert's patch for OpenBSD
Patch submitted by and thanks to: Jung-uk Kim <jkim@niksun.com>
MFC after: 2 weeks


120215 19-Sep-2003 wpaul

Remove jumbo buffer #defines that I ended up not needing.


120144 17-Sep-2003 anholt

Fix a typo in r1.8: The GTLB enable/flush bit is 1<<7, not 1<<8.

PR: kern/56297
Submitted by: Dan Angelescu <mrhsaacdoh@yahoo.com>


120111 16-Sep-2003 mbr

Don't read the MAC address from a copy of the EEPROM in the softc
that has been recorded earlier and overwrite it again later by
reading it directly from the EEPROM again.

Read the MAC address from the PAR0/PAR1 registers instead, which
are autoloaded on reboot.

Tested on AN985, AN983B. According to the datasheets, it should
also work for the AL981 (I don't have such a chip on a card at home)

PR: 52988
Submitted by: Andrew Gordon <arg-bsd@arg.me.uk>
MFC after: 2 weeks


120058 14-Sep-2003 mdodd

- Avoid calling pci_get_device() more than once in a single function.
- Provide a mechanism to prevent the use of MMIO.
- Prevent the use of MMIO for all 3c575 cardbus cards.


120043 13-Sep-2003 wpaul

Teach the re(4) driver about the CFG2 register, which tells us whether
we're on a 32-bit/64-bit bus or not. Use this to decide if we should
set the PCI dual-address cycle enable bit in the C+ command register.
(Enabling DAC on a 32-bit bus seems to do bad things.)

Also, initialize the C+ command register early in the re_init() routine.
The documentation says this register should be configured first.


119981 11-Sep-2003 wpaul

- For the 8169 chips, read the station address by forcing an EEPROM
autoload and then copying the contends of the station address
registers. For some reason, reading the EEPROM on the 8169S doesn't
work right. This gets around the problem, and allows us to read
the station address correctly on the 8169S.

- Insert a delay after initiating packet transmition in re_diag() to
allow lots of time for the frame to echo back to the host, and wait
for both the 'RX complete' and 'timeout expired' bits in the ISR
register to be set.

- Deal more intelligently with the fact that the frame length
field in the RX descriptor is a different width on the 8139C+
than it is on the 8169/8169S/8110S

- For the 8169, you have to set bit 17 in the TX config register
to enter digital loopback mode, but for the 8139C+, you have to
set both bits 17 and 18. Take this into account so that re_diag()
works properly for both types of chips.


119977 11-Sep-2003 wpaul

Re-enable VLAN_MTU capability for this driver. (Got reverted when
I pulled out the C+/8169 bits.)


119976 11-Sep-2003 wpaul

Add a PHY driver to support the built-in gigE PHY in the 8169S/8110S
ethernet chips. This driver is pretty simple, however it contains
special DSP initialization code which is needed in order to get
the chip to negotiate a gigE link. (This special initialization
may not be needed in subsequent chip revs.) Also:

- Fix typo in if_rlreg.h (RL_GMEDIASTAT_1000MPS -> RL_GMEDIASTAT_1000MBPS)

- Deal with shared interrupts in re_intr(): if interface isn't up,
return.

- Fix another bug in re_gmii_writereg() (properly apply data field mask)

- Allow PHY driver to read the RL_GMEDIASTAT register via the
re_gmii_readreg() register (this is register needed to determine
real time link/media status).


119954 10-Sep-2003 wpaul

Teach rl(4) about new hwrev codes.


119949 10-Sep-2003 wpaul

Update hardware revision table. 0x04000000 appears to be the revision
for the 8169S, according to my sample board. The RealTek Linux driver
mentions 0x00800000. I'm assigning this to the 8110S until I get
more info on it. (The (preliminary) RealTek docs only say that 8169S/8110S
chips will have some combination of those two bits set, but doesn't say
exactly what bit combination goes with which chip variant.)


119871 08-Sep-2003 wpaul

Fix path of pci #includes that I botched.

Also pointed out by: Larry Rosenman


119868 08-Sep-2003 wpaul

Take the support for the 8139C+/8169/8169S/8110S chips out of the
rl(4) driver and put it in a new re(4) driver. The re(4) driver shares
the if_rlreg.h file with rl(4) but is a separate module. (Ultimately
I may change this. For now, it's convenient.)

rl(4) has been modified so that it will never attach to an 8139C+
chip, leaving it to re(4) instead. Only re(4) has the PCI IDs to
match the 8169/8169S/8110S gigE chips. if_re.c contains the same
basic code that was originally bolted onto if_rl.c, with the
following updates:

- Added support for jumbo frames. Currently, there seems to be
a limit of approximately 6200 bytes for jumbo frames on transmit.
(This was determined via experimentation.) The 8169S/8110S chips
apparently are limited to 7.5K frames on transmit. This may require
some more work, though the framework to handle jumbo frames on RX
is in place: the re_rxeof() routine will gather up frames than span
multiple 2K clusters into a single mbuf list.

- Fixed bug in re_txeof(): if we reap some of the TX buffers,
but there are still some pending, re-arm the timer before exiting
re_txeof() so that another timeout interrupt will be generated, just
in case re_start() doesn't do it for us.

- Handle the 'link state changed' interrupt

- Fix a detach bug. If re(4) is loaded as a module, and you do
tcpdump -i re0, then you do 'kldunload if_re,' the system will
panic after a few seconds. This happens because ether_ifdetach()
ends up calling the BPF detach code, which notices the interface
is in promiscuous mode and tries to switch promisc mode off while
detaching the BPF listner. This ultimately results in a call
to re_ioctl() (due to SIOCSIFFLAGS), which in turn calls re_init()
to handle the IFF_PROMISC flag change. Unfortunately, calling re_init()
here turns the chip back on and restarts the 1-second timeout loop
that drives re_tick(). By the time the timeout fires, if_re.ko
has been unloaded, which results in a call to invalid code and
blows up the system.

To fix this, I cleared the IFF_UP flag before calling ether_ifdetach(),
which stops the ioctl routine from trying to reset the chip.

- Modified comments in re_rxeof() relating to the difference in
RX descriptor status bit layout between the 8139C+ and the gigE
chips. The layout is different because the frame length field
was expanded from 12 bits to 13, and they got rid of one of the
status bits to make room.

- Add diagnostic code (re_diag()) to test for the case where a user
has installed a broken 32-bit 8169 PCI NIC in a 64-bit slot. Some
NICs have the REQ64# and ACK64# lines connected even though the
board is 32-bit only (in this case, they should be pulled high).
This fools the chip into doing 64-bit DMA transfers even though
there is no 64-bit data path. To detect this, re_diag() puts the
chip into digital loopback mode and sets the receiver to promiscuous
mode, then initiates a single 64-byte packet transmission. The
frame is echoed back to the host, and if the frame contents are
intact, we know DMA is working correctly, otherwise we complain
loudly on the console and abort the device attach. (At the moment,
I don't know of any way to work around the problem other than
physically modifying the board, so until/unless I can think of a
software workaround, this will have do to.)

- Created re(4) man page

- Modified rlphy.c to allow re(4) to attach as well as rl(4).

Note that this code works for the sample 8169/Marvell 88E1000 NIC
that I have, but probably won't work for the 8169S/8110S chips.
RealTek has sent me some sample NICs, but they haven't arrived yet.
I will probably need to add an rlgphy driver to handle the on-board
PHY in the 8169S/8110S (it needs special DSP initialization).


119798 06-Sep-2003 dfr

Make indentation uniform.


119796 06-Sep-2003 dfr

When recording resources for the amdpm driver, only describe the ports
we actually use. Originally, the code reserved 0x8000 to 0x80ff inclusive
which on my hardware conflicts with the acpi timer. This broke the amdpm
driver since it was actually given ports 0x800c to 0x810b (which should
not have happened, IMHO).

This also allows us to considerably simplify the handling of the nForce
smb driver, removing the need for a separate nfpm driver. With this, SMB
accesses appear to work on my Tyan Tiger MP board. Your mileage may vary.
In particular, the nForce changes have not been tested.


119785 05-Sep-2003 sam

change timer to MPSAFE

Sponsored by: FreeBSD Foundation


119738 04-Sep-2003 tmm

Use stream bus space accesses to program the ID (station address)
registers; otherwise, the byte order of the address is changed on
big-endian machines.


119712 03-Sep-2003 phk

Examine and record the Silicon Revision Register on NS parts.

We can't update the device description in attach (why not ?), so
we device_print() what we find.

Conditionalize the short cable fix on this being older than rev 16A.

Call device_printf() when we apply short cable fix.

Include interrupt hold-off setting for rev 16+ under "#ifdef notyet"

The device_printf()'s will go under bootverbose once the various
issues have settled a bit.


119690 02-Sep-2003 jhb

Use PCIR_BAR(x) instead of PCIR_MAPS.

Glanced over by: imp, gibbs
Tested by: i386 LINT


119655 01-Sep-2003 dfr

Add support for AMD766 and AMD768 chipsets.

PR: 41812


119498 27-Aug-2003 mbr

All davicom cards seem to need DC_TX_ALIGN.


119493 26-Aug-2003 nectar

Revision 1.126 broke the interface of the bktr driver's
METEORSSIGNAL ioctl. Applications use this ioctl with the value
METEOR_SIG_MODE_MASK (0xFFFF0000, -65536) to reset signal delivery,
but revision 1.126 caused the driver to return EINVAL in this case.
Interestingly, the same METEORSSIGNAL ioctl in the meteor driver uses
0 to reset signal delivery.

This commit allows METEOR_SIG_MODE_MASK as a synonym for 0 in the
bktr driver, and restructures the code a bit so that it is otherwise
identical between the bktr and meteor drivers.


119434 24-Aug-2003 mbr

Make TX on davicom 9102A working again. This chip needs
its mbufs aligned on TX.

PR: 53656, 42714
MFC after: 3 days


119371 23-Aug-2003 mdodd

PCI header files live in dev/pci.


119369 23-Aug-2003 mdodd

Report media status for bitrate PHYs.


119368 23-Aug-2003 mdodd

AGP GART driver for NVIDIA nForce/nForce2 chipsets.


119366 23-Aug-2003 imp

dev/pci/meteor_reg.h doesn't exist. Revert this part of last commit.


119343 23-Aug-2003 marcel

Revert previous change for ncrreg.h. The header really lives in
sys/pci.


119288 22-Aug-2003 imp

Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.


119137 19-Aug-2003 sam

Change instances of callout_init that specify MPSAFE behaviour to
use CALLOUT_MPSAFE instead of "1" for the second parameter. This
does not change the behaviour; it just makes the intent more clear.


119130 19-Aug-2003 sam

"short cable" fix for DP8315

Derived from: netbsd and tech note at soekris web site
MFC after: 1 week


118978 15-Aug-2003 wpaul

Argh. Last commit only had the __FBSDID() fix. Really add the device ID
for the 8100 this time.


118977 15-Aug-2003 wpaul

It appears in some configurations with an on-board RTL8100 chip (in this
case, a "Vortex86" mini PC), the PCI device ID value in the EEPROM (0x8100)
does not agree with the PCI device ID returned by pci_get_device() (0x8139).
This means that while rl_probe() matches the device, rl_attach() doesn't.
Work around this by adding an entry to the rl_devs table for the 8100 with
a device ID of 0x8100.

Also, get rid of extra instance of __FBSDID(). One is enough.


118889 13-Aug-2003 wpaul

Set the TX hardware checksum offload bits on all the descriptors of a
multi-fragment transmission. I'm not sure if this is a bug or a requirement
that I overlooked with going through the documentation, but the sample
8169 NIC that I have seems to require it at least some of the time or
else it botches TCP checksums on segments that span multiple descriptors.


118749 10-Aug-2003 nectar

Add or correct range checking of signal numbers in system calls and
ioctls.

In the particular case of ptrace(), this commit more-or-less reverts
revision 1.53 of sys_process.c, which appears to have been erroneous.

Reviewed by: iedowse, jhb


118714 10-Aug-2003 wpaul

Grrr. There is a gratuitous difference in the RX descriptor status
word between the 8139C+ and the 8169. The 8139C+ has a 'frame alignment
error bit' (bit 27) but the 8169 does not. Rather than simply mark this
bit as reserved, RealTek removed it completely and shifted the remaining
status bits one space to the left. This was causing rl_rxeofcplus()
to misparse the error and checksum bits.

To workaround this, rl_rxeofcplus() now shifts the rxstat word one
bit to the right before testing any of the status bits (but after
the frame length has been extracted).


118712 10-Aug-2003 wpaul

- Update some comments regarding hardware details of the 8169 and
note the existence of the 8169S and 8110S components. (The 8169
is just a MAC, the 8169S and 8110S contain both a MAC and PHY.)

- Properly handle list and buffer addresses as 64-bit. The RX and
TX DMA list addresses should be bus_addr_t's. Added RL_ADDR_HI()
and RL_ADDR_LO() macros to obtain values for writing into chip
registers.

- Set a slightly different TIMERINT value for 8169 NICs for improved
performance.

- Change left out of previous commit log: added some additional
hardware rev codes for other 10/100 chips and for the 8169S/8110S
'rev C' gigE MACs.


118586 07-Aug-2003 wpaul

Add preliminary support for the RealTek 8169 gigE chip. Changes:

- Fix a bug in rl_dma_map_desc(): set the 'end of ring' bit in the
right descriptor (DESC_CNT - 1, not DESC_CNT). The 8139C+ is limited
to 64 descriptors and automatically wraps at 64 descriptors even
if the EOR bit isn't set, but the 8169 NIC can have up to 1024
descriptors per ring, so we must set the wrap point in the right
place.

- RealTek moved the RL_TIMERINT register from offset 0x54 to 0x58 in
the 8169 -- account for this.

- Added rl_gmii_readreg() and rl_gmii_writereg() routines.

- Fix rl_probe() to deal with the case where the base type is
not RL_8139.

The next step is to add jumbo buffer support.

Tested with the Xterasys XN-152 NIC (hard to beat $29 for a gigE NIC).


118454 05-Aug-2003 simokawa

Enable IFCAP_VLAN_MTU and increase MTU for it.

Reviewed by: wpaul


118089 27-Jul-2003 mux

Use the BUS_DMA_ZERO flag.


118084 27-Jul-2003 mux

Use the BUS_DMA_ZERO flag.


118082 27-Jul-2003 mux

Use the BUS_DMA_ZERO flag instead of bzero()'ing DMA memory.


118073 27-Jul-2003 robert

Changed the type of the variable `qidx' from u_int8_t to int,
mainly to quiet a warning emitted by GCC 3.3 about comparing
a variable to a value which is larger than the former can hold.

The value was checked to make sure the `np->squeue' array is
not accessed behind its boundary.
This worked due to possibly accidental truncation when
(np->squeueput + 1) was larger than or equal to MAX_START (256)
when it was assigned to `qidx'.

`qidx' is used to hold the next position in the start queue
for an insertion. The new type was chosen because some other
code in the function ncr_freeze_devq() also uses plain integers
to hold those indices.

Wrapped the line after the closing parenthesis of an `if'
condition.


117858 22-Jul-2003 cognet

Erm, my previous commit was wrong and sis_tick() was only called each time
sis_ioctl() was called, so one had to use ifconfig each time the cable got
plugged in to be able to use the connection.
Do it a better way now, add a "in_tick" field in the softc structure,
call timeout() in sis_tick() and don't call it in sis_init() if in_tick is
non-zero.
Reported by: Landmark Networks
Pointy hat to: cognet


117769 19-Jul-2003 imp

Add support for FA-511; Submitted by: Kenneth P. Stox; Pr 42858


117748 18-Jul-2003 wpaul

Fix a busdma bogon:

Some of the calls to bus_dmamap_sync() were syncing the DMA descriptor
ring maps using the mbuf tag, when they should have been using the
descriptor ring tag instead.


117388 10-Jul-2003 wpaul

Add support for the 8139C+ chipset. Unlike the other chips in the 8139
series, the 8139C+ has a descriptor-based DMA mechanism, and its
performance is actually pretty respectable. Note: the 8139D chip does
not support C+ mode. Only the 8139C+ and 8169 gigE chips support C+ mode.

Supported features:

- RX and TX checksum offload
- hardware VLAN tag insertion/extraction
- TX interrupt moderation using the 8139's on-board timer

Everything should be properly busdma'ed and endian-independent, so
things should work ok on non-x86 platforms. Unfortunately, my call
for testers on this code was met with deafening silence, and I don't
have access to any non-x86 FreeBSD boxes at the moment, so this is
speculation.

The device detection code has been cleaned up a little as well
(thanks to Michal Mertl) for the patches.

There are also updates to the rl(4) man page (which I accidentally
checked in before when I updated the dc(4) man page. Oops.)

Todo: finish support for the 8169 gigabit ethernet chip. This
mainly requires writing an rlgphy driver to handle the 8169's built-in
PHY. This will have to wait until I actually get my hands on an 8169
card for testing though. (I still can't find a source for one in the
U.S. Suggestions/pointers welcome.)


117386 10-Jul-2003 wpaul

Add support for a bunch of Microsoft networking products:

- MN-110 10/100 USB ethernet (ADMtek Pegasus II, if_aue)
- MN-120 10/100 cardbus (ADMtek Centaur-C, if_dc)
- MN-130 10/100 PCI (ADMtek Centaur-P, if_dc)

Also update dc(4) man page to mention support for MN-120 and MN-130.


117375 10-Jul-2003 wpaul

Support for large frames for VLANs was added by tweaking the packet size
register, present only on 3c90xB and later NICs. This meant that you could
not use a 1500 byte MTU with VLANs on original 3c905/3c900 cards (boomerang
chipset). The boomerang chip does support large frames though, just not
in the same way: you can set the 'allow large frames' bit in the MAC
control register to receive frames up to 4K in size.

Changes:

- Set the 'allow large frames' bit for boomerang chips and increase
the packet size register for cyclone and later chips. This allows
us to use IFCAP_VLAN_MTU on all supported xl(4) NICs.
- Actually set the IFCAP_VLAN_MTU flag in the capabilities word
in xl_attach().
- Change the method used to detect older boomerang chips. My 3c575C
cardbus NIC was being incorrectly identified as 3c90x chip instead
of 3c90xB because the capabilities word in its EEPROM reports
a bizzare value. In addition to checking for the supportsNoTxLength
bit, also check for the absence of the supportsLargePackets bit.
Both of these cases denote a 3c90xB chip.
- Make RX and TX checksums configurable via the SIOCSIFCAP ioctl.
- Avoid an unecessary le32toh() in xl_rxeof(): we already have the
received frame size in the lower 16 bits of rxstat, no need to
read it again.

Tested with 3c905-TX, 3c900-TPO, 3c980C and 3c575C NICs.


117354 09-Jul-2003 mux

Make the dc(4) driver endian-clean, so to that it works on sparc64.
There are such cards in Netra X1 boxes, which should thus be fully
supported now.

Tested by: jake


117295 06-Jul-2003 mux

Convert the dc(4) driver to the busdma API. This is a necessary step
to have this driver working on sparc64. It still needs to be made
endian-clean before it can work there.

Special thanks to dragonk@evilcode.net for sending me a dc(4) card so
that I was able to do this work.

Many cheers to all the people that tested this change, thanks to them,
this change shouldn't break anything :-).

Tested by: marcel (i386 and ia64), ru (i386), wilko (alpha),
mbr (i386), wpaul (i386) and
Will Saxon <WillS@housing.ufl.edu> (i386)


117282 06-Jul-2003 mux

Fix a bug that could cause dc(4) to m_freem() an already freed
mbuf or something that isn't an mbuf.

MFC after: 3 days


117281 06-Jul-2003 mux

Various style(9) and readability fixes.


117220 04-Jul-2003 mux

- Ensure that the busdma API won't do deferred loads by using the
BUS_DMA_NOWAIT flag, since the code can't handle this.
- Use NULL, NULL for the lockfunc and lockfuncarg parameters of
bus_dma_tag_create() since deferred loads can't happen now.


117208 03-Jul-2003 imp

Due to extreme bogusness in the pci bus layer, these drivers were
forced to do slightly bogus power state manipulation. However, this
is one of those features that is preventing further progress, so mark
them as BURN_BIRDGES like I did for the drivers in sys/dev/...

This, like the other change, are a no-op unless you have BURN_BRIDGES
in your kernel.


117126 01-Jul-2003 scottl

Mega busdma API commit.

Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg.
Lockfunc allows a driver to provide a function for managing its locking
semantics while using busdma. At the moment, this is used for the
asynchronous busdma_swi and callback mechanism. Two lockfunc implementations
are provided: busdma_lock_mutex() performs standard mutex operations on the
mutex that is specified from lockfuncarg. dftl_lock() is a panic
implementation and is defaulted to when NULL, NULL are passed to
bus_dma_tag_create(). The only time that NULL, NULL should ever be used is
when the driver ensures that bus_dmamap_load() will not be deferred.
Drivers that do not provide their own locking can pass
busdma_lock_mutex,&Giant args in order to preserve the former behaviour.

sparc64 and powerpc do not provide real busdma_swi functions, so this is
largely a noop on those platforms. The busdma_swi on is64 is not properly
locked yet, so warnings will be emitted on this platform when busdma
callback deferrals happen.

If anyone gets panics or warnings from dflt_lock() being called, please
let me know right away.

Reviewed by: tmm, gibbs


117029 29-Jun-2003 wpaul

In order to set the MAC address on RealTek NICs, you must flip WRITECFG
bit in the EEPROM mode register on. Also, the address must be written
in two 32-bit register accesses instead of 6 8-bit accesses.

Tested with my 8139B cardbus NIC.

PR: kern/35900
Submitted by: Mark Kettenis <kettenis@chello.nl>


117016 29-Jun-2003 wpaul

Modify the xl_reset() routine slightly so that, if we're using memory
mapped I/O mode, we pause for .1 seconds after issuing the reset command
before trying to poll the 'command busy' bit in the status register.
With my 3c575C cardbus NIC, my Sony Picturebook locks up when it tries
to read the status register immediately after the reset. This appears
to be a problem only with certain NICs on certain hardware, but the
added delay should not hurt cards that already work.

This bug seems to have been brought to light by the fact that the xl
driver now defaults to memory mapped I/O mode instead of programmed
I/O mode like it used to. With PIO mode, the delay isn't needed and
everything works (which is why this NIC worked with 5.0-RELEASE but
not 5.1). I suspect that what's happening is that when the chip is
reset, it takes a little while for the memory-mapped decoding logic
to recover. Trying to access the chip's registers during this period
causes an error condition of some kind that wedges the system.


116921 27-Jun-2003 jhb

Sort the list of PCI ID's in numerical order and fix a whitespace bogon.


116723 23-Jun-2003 mdodd

Add a PCI ID for the Apollo Pro 133A.

PR: kern/46983
Submitted by: David Holm <david@realityrift.com>


116722 23-Jun-2003 mdodd

Add PCI IDs for the i82855 and i82875P AGP bridges.

PR: i386/53136, i386/51802
Submitted by: Kyunghwan Kim <redjade@atropos.snu.ac.kr>, Norikatsu Shigemura <nork@FreeBSD.org>


116671 22-Jun-2003 mdodd

Add ID for VT8233A.

PR: i386/38299
Submitted by: Rob Schulhof <rrs@there.net>


116555 19-Jun-2003 alc

Add vm object locking.


116444 16-Jun-2003 harti

Repo-copy of sys/pci/if_en_pci.c to the rest of the midway driver (sys/dev/en)
so that all of the driver sources are in one place. Adjust the configuration
files and the module build.


116351 14-Jun-2003 njl

Merge common XPT_CALC_GEOMETRY functions into a single convenience function.
Devices below may experience a change in geometry.

* Due to a bug, aic(4) never used extended geometry. Changes all drives
>1G to now use extended translation.
* sbp(4) drives exactly 1 GB in size now no longer use extended geometry.
* umass(4) drives exactly 1 GB in size now no longer use extended geometry.

For all other controllers in this commit, this should be a no-op.

Looked over by: scottl


116321 13-Jun-2003 ticso

Fix alignment requirements of tulip_rombuf by further increasing
tulip_boardid size.
Add a comment to tulip_rombuf about this requirement.
I have had panics on alpha while probing a de card.


116310 13-Jun-2003 mux

Remove code that tries to detect if the MCLSHIFT and MSIZE macros
are the same that those of the kernel in the KLD_MODULE case. If
we ever want to detect that kind of problems, this is not the right
place to do this since every network driver would be affected by
such desynchronisation.


116294 13-Jun-2003 harti

Make the midway driver use the new ATM phy driver. This allows one to
toggle several media options (sonet/sdh, for example) with ifconfig and
to see the carrier state in ifconfig's output. It gives also read/write
access (given the right privilegs) to the S/Uni registers to user space
programs.


116288 13-Jun-2003 alc

Add vm object locking.


116192 11-Jun-2003 obrien

Use __FBSDID().


116129 09-Jun-2003 se

Remove embededded ID string which was meant to provide information
about the driver version in case of an error report. It conflicts with
some other variable of the same name that has been added to the kernel
just recently and there haven't been any bug reports for quite some
time now, anyway ...


116024 08-Jun-2003 mbr

Add ADMtek ADM9511 and ADM9513 device ID's.

PR: PR51823
Submitted by: Kaho Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>
Reviewed by: phk
MFC after: 2 days


115644 01-Jun-2003 mux

Change a :
bzero(ptr, sizeof(DC_RXLEN * 5));
which should obviously be:
bzero(ptr, DC_RXLEN * 5);

Looks like this bug may have reduced the effectiveness of the
workaround for the hardware bug in the PNIC chips.

MFC after: 1 week


115632 01-Jun-2003 mux

- Style(9) fixes, most notably :
o Remove register keyword
o ANSIfy prototypes
o Remove "return;" at the end of void functions
o Remove trailing spaces
o Don't align local variables with tabs and reorder them
o Don't use /* FOO */ at the end of a #ifdef FOO block if
it's a small block
- Other non-functional changes :
o 6 -> ETHER_ADDR_LEN
o Don't initialize if_output; ether_ifattach() does it for us


115532 31-May-2003 phk

Remove unused variable.

Found by: FlexeLint


115531 31-May-2003 phk

Remove unused variables.
Remove now unused pointer to ether header.
Remove break after return

Found by: FlexeLint


115530 31-May-2003 phk

Remove break after return;

Found by: FlexeLint


115529 31-May-2003 phk

Remove break after return

Found by: FlexeLint


115528 31-May-2003 phk

Remove unused variables.

Found by: FlexeLint


115527 31-May-2003 phk

Remove now unused pointer to etherheader.

Found by: FlexeLint


115526 31-May-2003 phk

Remove unused variable.

Found by: FlexeLint


115519 31-May-2003 phk

Move some FALLTHROUGH comments so they work.
Fix indentation error.
Make boardid string long enough.
Remove unused variable.

Found by: FlexeLint


115355 27-May-2003 jhb

Fix support for 256 MB aperture sizes on chipsets such as the 845 and
865. The APSIZE register has a variable-sized field of enabled bits.
To figure out how many bits a specific host bridge supports, write the
maximum width and see how many bits are set in the hardware. We then
use this mask for setting and getting the aperture size. Prior to this,
the agp(4) driver would treat an aperture size of 256 MB as 128 MB and
would not allocate enough physical memory for the GART as a result.

MFC after: 3 days
Sponsored by: The Weather Channel
Approved by: re (rwatson)


115354 27-May-2003 jhb

Grr, fix compile. The bane of trying to split out patches into two
commits.

Reported by: Lukas Ertl <l.ertl@univie.ac.at>
With hat: re
Pointy hat to: jhb


115349 27-May-2003 jhb

Add support for the Intel 865 chipset.

MFC after: 3 days
Sponsored by: The Weather Channel
Approved by: re (murray)


115029 15-May-2003 mbr

Only use a SIA/SYM media info block if no MII block is detected.
The submitter of PR 32118 told me that this patch also fixes autoselecting
for znyx 4 port cards (10baseT, 100baseTX did work already).

PR: 32118
Reviewed by: imp
Approved by: rwatson (re)


114957 12-May-2003 mbr

Add support for 3Com OfficeConnect 10/100B.

PR: 49059, 50747
Submitted by: Dax Eckenberg <daxbert@dweebsoft.com>
Reviewed by: imp, jhb
Approved by: jhb
MFC after: 2 weeks


114770 06-May-2003 cognet

Don't call timeout() in sis_tick(), this is done earlier by mii_tick(), and it
leads to a panic at unload time, as we own 2 instances of callout and
untimeout() only one.
Will I'm there, remove a call to callout_handler_init(), one is enough.

Reviewed by: wpaul


114739 05-May-2003 harti

Define a link layer MIB for ATM. Most fields of this MIB are needed by
ILMI daemons. Factor out common softc fields for all ATM interfaces that
need to be externally visible into an ifatm structure and make the midway
driver using this structure and fill the MIB.


114399 01-May-2003 mbr

Use only a 64bit hash filter table for ADM-Centaur cards like the
Accton EN2242 and the ADMtek AN985 cards.

PR: 32699
Submitted by: Jean-Luc Richier <Jean-Luc.Richier@imag.fr>
Reviewed by: phk
MFC after: 2 weeks


114201 29-Apr-2003 harti

Add module data and version to the atm_subr and reference this info from the
(currently) only consumer (en).

Add a sysctl node hw.atm where the atm drivers will hook on their hardware
sysctl sub-trees.

Make atm_ifattach call if_attach and remove the corresponding call to if_attach
from en. Create atm_ifdetach and use that in en.

While the last change actually changes the interface this is not a problem in
practice because the only other consumer of this API is an older LANAI driver
on the net, that is not ready for current anyway.

Reviewed by: -atm


114018 25-Apr-2003 harti

Convert the midway driver to use busdma. Except for this conversion the
following changes have been done:

- stylify. The original code was too hard to read.
- get rid of a number of compilation options (Adaptec-only, Eni-only, no-DMA).
- more debugging features.
- locking. This is not correct yet in the absence of interface layer locking,
but is correct enough to not to cause lock order reversals.
- remove RAW mode. There are no users of this in the tree and I doubt that
there are any.
- remove NetBSD compatibility code. There was no way to keep NetBSD non-busdma
and FreeBSD busdma code together.
- if_en now buildable as a module.

This has been actively tested on sparc64 and i386 with ENI server and
client cards and an Adaptec card (thanks to kjc).

Reviewed by: mdodd, arr


113812 21-Apr-2003 imp

Use newly minted device_is_attached rather than device_is_alive to see
if attach succeeded. device_is_alive just tells us that probe
succeeded. Since we were using it to do things like detach net
interfaces, this caused problems when there were errors in the attach
routine.

Symptoms of problem reported by: martin blapp


113799 21-Apr-2003 obrien

Explicitly declare 'int' parameters.


113669 18-Apr-2003 sanpei

Add support for Planex FNW-3602-T(CardBus 100M/10M).

Submitted by: kazz <kazz@v001.vaio.ne.jp>
Obtained from: [bsd-nomads:16637]


113609 17-Apr-2003 njl

Revise attach/detach resource cleanup
- Unconditionally call *_stop() if device is in the tree. This is to
prevent callouts from happening after the device is gone. Checks for
bus_child_present() should be added in the future to keep from touching
potentially non-existent hardware in *_detach(). Found by iedowse@.
- Always check for and free miibus children, even if the device is not in
the tree since some failure cases could have gotten here.
- Call ether_ifdetach() in the irq setup failure case
- ti(4), xl(4): move ifmedia_init() calls to the beginning of attach so
that ifmedia_removeall() can be unconditionally called on detach. There
is no way to detect whether ifmedia has been initialized without using
a separate variable (as tl(4) does).
- Add comments to indicate assumptions of code path


113592 17-Apr-2003 iedowse

Revert part of revision 1.97 by calling dc_stop() unconditionally
in dc_detach() instead of only calling it if the hardware is preset.
This is a workaround for page faults in softclock() after a `dc'
device was detached, caused by not disabling a timer before freeing
its memory. The bus_child_present() checks should probably be
re-added later, but only to avoid the hardware accesses and not the
other resource cleanups in dc_stop().

Approved by: njl


113565 16-Apr-2003 jhb

Remove another unused variable.


113564 16-Apr-2003 jhb

Remove an unused variable so this compiles again.


113561 16-Apr-2003 mdodd

Remove some code that managed to escape from my local repository.


113548 16-Apr-2003 mdodd

- Remove a block of code I missed in the previous commit.
- Call tl_ifmedia_upd() in tl_init() for cards with bitrate devices.


113545 16-Apr-2003 mdodd

- Don't call pci_enable_io() in drivers (unless needed for resume).
- Don't test memory/port status and emit an error message; the PCI
bus code will do this now.


113506 15-Apr-2003 mdodd

- Express hard dependencies on bus (pci, isa, pccard) and
network layer (ether).
- Don't abuse module names to facilitate ifconfig module loading;
such abuse isn't really needed. (And if we do need type information
associated with a module then we should make it explicit and not
use hacks.)


113496 15-Apr-2003 silby

Rework the rl_encap failure case. Previously, we would stuff the
unencapsulated packet back into the IFQ. Unfortunately, the only reason
rl_encap would fail was due to m_defrag failing, which should only happen
when we're low on mbufs. Hence, it was possible for us to end up with
an IFQ full of packets which could never clear the queue because they could
never be defragmented because they were themselves taking up all the mbufs.

To solve this, take if_xl's approach to the problem of encapsulation failure:
drop the packet.

MFC after: 3 days


113298 09-Apr-2003 mux

Correct maxsize/maxsegsz parameters to bus_dma_tag_create().


113274 09-Apr-2003 silby

Fix if_vr's handling of vr_encap failures. 3 parts:

- Don't bother setting OACTIVE when the descriptors are all full
or there's a vr_encap failure, it doesn't help anything.
- Correctly roll back on the descriptor list after a failure
so as not to corrupt the list.
- Add a missing VR_UNLOCK().

Without these changes, vr_encap failure (which is assured during
a low mbuf situation) would result in the card locking until
the watchdog could fire.

MFC after: 1 week


113237 08-Apr-2003 silby

Quick fix so that the watchdog timer is not set unless packets are
actually queued for transmission. Without this, a low memory situation
would trigger false watchdog timeouts.

MFC after: 1 week


113236 08-Apr-2003 silby

Fix up callers of xl_encap so that they handle a failure response
properly (likely due to mbuf exhaustion.) Previously, the driver
got somewhat wedged.

Also, remove the annoying messages printed every time xl_encap
couldn't allocate a mbuf; they served no useful purpose, and just made
an mbuf exhaustion situation more annoying.

MFC after: 1 week


113204 07-Apr-2003 murray

Fix typo.

PR: kern/50504
Submitted by: Alex Semenyaka <alexs@snark.ratmir.ru>
MFC after: 3 days


113150 05-Apr-2003 mux

Use bus_dmamap_load_mbuf() instead of bus_dmamap_load() for the
RX part of this driver too. It's better since the code wasn't
dealing with bus_dmamap_load() returning EINPROGRESS, and this
can't happen with bus_dmamap_load_mbuf().

Submitted by: jake


113038 03-Apr-2003 obrien

Use __FBSDID rather than rcsid[].


112930 01-Apr-2003 phk

Fix KASSERT syntax error.


112928 01-Apr-2003 phk

Fix KASSERT syntax errors.

Please compile LINT before commiting.


112880 31-Mar-2003 jhb

Add missing ()'s so that these drivers all compile again.

Noticed by: jake
Tested on: i386 (compile)


112878 31-Mar-2003 jhb

If we fail to find our PCI ID in attach (this should never happen), then
just return ENXIO directly instead of calling tl_detach() since that would
panic since the softc mutex isn't initialized until after this check.


112872 31-Mar-2003 njl

Clean up locking and resource management for pci/if_*

- Remove locking of the softc in the attach method, instead depending on
bus_setup_intr being at the end of attach (delaying interrupt enable until
after ether_ifattach is called)
- Call *_detach directly in the error case of attach, depending on checking
in detach to only free resources that were allocated. This puts all
resource freeing in one place, avoiding thinkos that lead to memory leaks.
- Add bus_child_present check to calls to *_stop in the detach method to
be sure hw is present before touching its registers.
- Remove bzero softc calls since device_t should do this for us.
- dc: move interrupt allocation back where it was before. It was unnecessary
to move it. This reverts part of 1.88
- rl: move irq allocation before ether_ifattach. Problems might have been
caused by allocating the irq after enabling interrupts on the card.
- rl: call rl_stop before ether_ifdetach
- sf: call sf_stop before ether_ifdetach
- sis: add missed free of sis_tag
- sis: check errors from tag creation
- sis: move dmamem_alloc and dmamap_load to happen at same time as tag creation
- sk: remove duplicate initialization of sk_dev
- ste: add missed bus_generic_detach
- ti: call ti_stop before ether_ifdetach
- ti: add missed error setting in ti_rdata alloc failure
- vr: add missed error setting in I/O, memory mapping cases
- xl: add missed error setting in I/O, memory mapping cases
- xl: remove multi-level goto on attach failure
- xl: move dmamem_alloc and dmamap_load to happen at same time as tag creation
- Calls to free(9) are unconditional because it is valid to call free with a
null pointer.

Reviewed by: imp, mdodd


112839 30-Mar-2003 silby

Switch rl_encap over to using m_defrag.

No functional change, the previous rl_encap was correct wrt long
mbuf chains; this just reduces code duplication.

MFC after: 2 weeks


112821 29-Mar-2003 silby

Switch vr_encap over to using m_defrag instead of its own version
of the function.

No functional change, this driver already handled long mbuf chains
correctly.

MFC after: 2 weeks


112819 29-Mar-2003 silby

Update if_dc to use m_defrag, removing the semi-duplicate dc_coal
function.

Also, use m_defrag where appropriate to defrag long mbuf chains
in the same fashion as was done in if_sis.c. Before this change,
if_dc would blow up and take down the interface if fed a really long
mbuf chain.

MFC after: 2 weeks


112808 29-Mar-2003 silby

Have sis_encap use m_defrag if:

1. The chain passed in is > 31 fragments long
or
2. The chain will not fit in the remaining descriptors without
defragmentation.

This is slightly less clear than other network drivers because the sis
chips share one descriptor list for all packets, it seems.

Before this change, a > 127 fragment chain would get stuck in the IFQUEUE
permanently, bringing all network traffic to a halt.

MFC after: 2 weeks


112779 29-Mar-2003 silby

Fix up the long mbuf chain recovery code to use m_defrag; the old
code messed up on B & C chipsets because it lost the packet header
and therefore the flag indicating the need for hardware checksums.

MFC after: 2 weeks


112569 25-Mar-2003 jake

- Add vm_paddr_t, a physical address type. This is required for systems
where physical addresses larger than virtual addresses, such as i386s
with PAE.
- Use this to represent physical addresses in the MI vm system and in the
i386 pmap code. This also changes the paddr parameter to d_mmap_t.
- Fix printf formats to handle physical addresses >4G in the i386 memory
detection code, and due to kvtop returning vm_paddr_t instead of u_long.

Note that this is a name change only; vm_paddr_t is still the same as
vm_offset_t on all currently supported platforms.

Sponsored by: DARPA, Network Associates Laboratories
Discussed with: re, phk (cdevsw change)


112469 21-Mar-2003 mdodd

- Use if_broadcastaddr from struct ifnet rather than relying on
extern 'etherbroadcastaddr'.
- Make 'etherbroadcastaddr' static.

Reviewed by: imp


112393 19-Mar-2003 silby

Make sure to free the correct resources when the card fails to attach
properly. (Broken in the previous commit.)

Noticed by: "Niels Chr. Bank-Pedersen" <ncbp@bank-pedersen.dk>


112379 18-Mar-2003 sanpei

Add support for Planex FNW-3800-TX(CardBus 100M/10M).

Submitted by: Kunihiro Arai <araik@attglobal.net>
Obtained from: [bsd-nomads:16625]


112364 18-Mar-2003 silby

Instead of relying on a compile time define to determine whether the xl
driver should use port or memory based IO, determine it dynamically
at runtime, preferring MMIO where possible. This helps us support newer
arches which dislike port based access better.

Tested on i386 & sparc64, with 3c900, 905, 905b, and 905C cards.
(in varying combinations by both jake and myself)


112184 13-Mar-2003 sos

Add pci id# for the sis648


111877 04-Mar-2003 bmilekic

Fix bug introduced in 1.130. For the < MHLEN case, we should
be doing a m_gethdr(), not an m_get().

Pointed out by: Hiten Pandya <hiten@unixdaemons.com>
Pointy hat to: Me


111815 03-Mar-2003 phk

Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by: re(scottl)


111759 02-Mar-2003 phk

Spell noread() and nowrite() correctly (ie: not "NULL")


111748 02-Mar-2003 des

More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9).


111547 26-Feb-2003 nyan

Use rman_get_start() to get start address of the resource.


111462 25-Feb-2003 mux

Cleanup of the d_mmap_t interface.

- Get rid of the useless atop() / pmap_phys_address() detour. The
device mmap handlers must now give back the physical address
without atop()'ing it.
- Don't borrow the physical address of the mapping in the returned
int. Now we properly pass a vm_offset_t * and expect it to be
filled by the mmap handler when the mapping was successful. The
mmap handler must now return 0 when successful, any other value
is considered as an error. Previously, returning -1 was the only
way to fail. This change thus accidentally fixes some devices
which were bogusly returning errno constants which would have been
considered as addresses by the device pager.
- Garbage collect the poorly named pmap_phys_address() now that it's
no longer used.
- Convert all the d_mmap_t consumers to the new API.

I'm still not sure wheter we need a __FreeBSD_version bump for this,
since and we didn't guarantee API/ABI stability until 5.1-RELEASE.

Discussed with: alc, phk, jake
Reviewed by: peter
Compile-tested on: LINT (i386), GENERIC (alpha and sparc64)
Runtime-tested on: i386


111457 25-Feb-2003 marcel

Remove support for running in SimOS. The support has rotted over
time and there's no indication that it will improve anytime soon.
By removing support for SimOS it is possible to build LINT on
Alpha, which is considered more important at the moment.

Not objected to on: alpha@


111381 23-Feb-2003 dan

Add support for Peppercon ROL-F Card.

Submitted by: Sascha Holzeiter <sascha@root-login.org>
PR: 48559


111257 22-Feb-2003 bmilekic

Make xl use m_getcl() to allocate an mbuf and a cluster in one shot,
as opposed to one after the other. This is faster in both -CURRENT
and -STABLE. Additionally, there is less code duplication for
error-checking.

One thing to note is that this code seems to return(1) when no buffers
are available; perhaps ENOBUFS should be the correct return value?

Partially submitted & tested by: Hiten Pandya <hiten@unixdaemons.com>
MFC after: 1 week


111136 19-Feb-2003 mux

Fix panic on sparc64 introduced in my last commit. I really
wish the busdma APIs were more consistent accross architectures.

We should probably move all the other DMA map creations in
xl_attach() where we can really handle them failing, since
xl_init() is void and shouldn't fail.

Pointy hat to: mux
Tested by: Anders Andersson <anders@hack.org>


111119 19-Feb-2003 imp

Back out M_* changes, per decision of the TRB.

Approved by: trb


111091 18-Feb-2003 mux

- Fix mbuf leak when we successfully allocate a new mbuf but fail to
bus_dmamap_load() it.
- Make it so reusing mbufs when we can't allocate (or map) new ones
actually works. We were previously trying to reuse a mbuf which
was already bus_dmamap_unload()'ed.

Reviewed by: silby


110844 14-Feb-2003 anholt

Split the arch-specific AGP files into the appropriate files.* and do the same
for the agp module, and add agp to the list of modules to compile for alpha.
Add an alpha_mb() to agp_flush_cache for alpha -- it's not correct but may
improve the situation, and it's what linux and NetBSD do.


110843 14-Feb-2003 anholt

Remove an extra agp_flush_cache(). The i810 case that needs it already has it.


110814 13-Feb-2003 anholt

Add agpreg.h missed in commit to agp_i810 (adding i85x/i86x AGP support).


110785 13-Feb-2003 anholt

Add Intel 85x/86x AGP support.

Submitted by: David Dawes <dawes@xfree86.org>


110754 12-Feb-2003 imp

Minor correction to comment: PNIC and XIRCOM have eeprom, its just
non-standard.


110601 09-Feb-2003 njl

Clean up exit path from rl_attach() to remove multiple returns


110572 08-Feb-2003 mdodd

Fix an oversight in some code I added to the last commit.


110567 08-Feb-2003 mdodd

- Remove duplicate call to callout_handle_init() in pcn_attach().
- Conditionalize mtx_destroy() in pcn_attach().
- Assert driver lock in pcn_intr().

Submitted by: Hiten Pandya <hiten@unixdaemons.com>


110524 07-Feb-2003 mbr

Fix the breakage resulting from Rev. 1.80. Get the eeprom width
for all but two cards. This should fix broken cards like these:

DM9102 (Davicom, DEVICE_ID: 0x9002)
DM9009 (Davicom, DEVICE_ID: 0x9009)
DM9100 (Davicom, DEVICE_ID: 0x9100)
98713/98713_CP (Macronix PMAC, DEVICE_ID: 0x0512)
98713_CP (Macronix PMAC, DEVICE_ID: 0x0512)
987x5 (Macronix PMAC, DEVICE_ID: 0x0531)
98727 (Macronix PMAC, DEVICE_ID: 0x0532)
82C115 (Lite-On PNIC II, DEVICE_ID: 0xc115)
AX88140A (ASIX Dev_ID: DEVICE_ID: 0x1400)
EN1217 (Accton EN1217, DEVICE_ID: 0x1217)

Note that these cards sould still work in STABLE.

Reviewed by: imp


110497 07-Feb-2003 mbr

Add missing braces.

Found by: FlexeLint (phk)
Reviewed by: wpaul, phk


110495 07-Feb-2003 mdodd

Turn off interrupts in pcn_stop().


110472 06-Feb-2003 mdodd

Consolidate resource release code on error condition.


110420 05-Feb-2003 mbr

Move the DC_SETBIT to the attach function.

Reviewed by: phk


110170 01-Feb-2003 silby

Add deviceids for 6105 and 6105M chips. Further changes will be necessary
to fully support these new chips, but preliminary evidence suggests that
they work acceptable with our present driver.

MFC after: 1 week


110168 01-Feb-2003 silby

Switch the if_vr driver from using our generic MII routines over to
using the Rhine's internal shift registers which are designed
for the job. This reduces the amount of time we wait around shifting
bits, and seems to work better with some chips.

Also, provide a workaround for some newer cards which report fake PHYs
at multiple addresses. (As more cards are ID'd, I'm sure this part
of the code will have to be expanded to cover more cases.)

Submitted by: Thomas Nystrom <thn@saeab.se>
MFC after: 1 week


110131 31-Jan-2003 silby

Fixes from Thomas Nystrom to fix hanging problems experienced by vr cards
under load.

This patch has been tested by Thomas and other for more than a month now,
and all (known) hangs seem to be solved.

Thomas's explanation of the patch:

* Fix the problem with the printing of the RX-error.

* Code from if_fet do better deal with the RX-recovery including a
timeout of the RX-turnoff.

* The call to vr_rxeof before vr_rxeoc have been moved to a point
where the RX-part of the chip is turned off. Otherwise there is a
window where new data could have been written to the buffer chain
before the RX-part is turned off. If this happens the chip will see
a busy rx-buffer. I have no evidence that this have occured but
god knows what the chip will do in this case!

* I have added a timeout of the TX-turnoff. I have checked and in
my 900 MHz system the flags for turnoff (both RX & TX) is seen at
the first check in the loop.

* I could see that I got the VR_ISR_DROPPED interrupt sometimes and
started to thinking about this. I then realized that no recovery is
needed for this case and therefore I only count it as an rxerror
(which was not done before).

* Finally I have changed the FIFO RX threshhold to 128 bytes. When I
did this the VR_ISR_DROPPED interrupt went away. Theory: The chip
will receive a complete frame before it tries to write it out to
memory then the RX threshold is set to store'n'forward. IF the frame
is large AND the next rx frame also is large AND the bus is busy
transfering a TX frame to the TX fifo THEN the second received
frame wont fit in the FIFO and is then dropped. By having the RX
threshold set to 128 the RX fifo is emptied faster.

MFC after: 5 days


110061 29-Jan-2003 mux

Fix typo in an unused macro.


110013 29-Jan-2003 joe

Migrate the PCI bus logic for ohci and uhci from sys/pci to sys/dev/usb.


109976 28-Jan-2003 mbr

Add PCI revision number for 630A and 900B. Enable parity error detection
on 900B and 635(A).

Re-add the enhanced PHY access register method again for older chipsets,
they do not seem to work with all old chips.

Reviewed by: phk
MFC after: 7 days


109784 24-Jan-2003 mux

Remove the now unused sys/malloc.h header.


109688 22-Jan-2003 silby

Correctly identify the 3C920B chipset; although it may ship with some Nforce2
boards, it's definitely not an Nvidia chip.

Info from: Nvidia's Linux Network driver & pciids.sourceforge.net


109623 21-Jan-2003 alfred

Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.


109517 19-Jan-2003 obrien

Complete the support of the on-board xl(4) on nVidia nForce2 mobo's.

Submitted by: Mikko S. Hyvarinen <morphy@morphy.iki.fi>


109503 19-Jan-2003 tmm

Make the xl driver work on sparc64:
- Add conversions to/from little endian for fields that the NIC accesses
by DMA as required.
- Add some bus_dmamap_sync() calls, and correct some existing ones.
- Read the receiver information from the EEPROM in an endian-neutral
manner.
- Load all RX and TX descriptors in a single DMA map up front, and
get the bus addresses of individual descriptors by address arithmetic;
this fixes multiple use of the descriptor tags, which would have
undesired effects.
It seems that xl still does not work on e250 boxen, for reasons which
are not clear yet.

Reviewed by: mux


109245 14-Jan-2003 njl

Remove bogus locking from dc(4). Instead, move interrupt allocation
and ether_ifattach() to end. This fixes a "could sleep" case and
simplifies error exit cases as well. Also be sure to set errno
and clean up resources in !mac error case.

Tested by: Ryan Beasley


109147 12-Jan-2003 obrien

Partial support for the nVidia nForce2 chipset's on-board Broadcom/Altima PHY
and 3com MAC. Specifications for the Altima PHY are available at:
http://www.altimacom.com/products/ac101L.html

Submitted by: Mikko S. Hyvarinen <morphy@morphy.iki.fi>


109115 11-Jan-2003 anholt

Add support for the Intel 82820 UP-only AGP bridge.

PR: 41466
Submitted by: NIIMI Satoshi <sa2c@sa2c.net>
MFC after: 1 week


109109 11-Jan-2003 des

FBSDIDize and clean up whitespace nits.


109108 11-Jan-2003 des

Read sanpei's mind, and unbreak the build.


109095 11-Jan-2003 sanpei

Add support for Corega FEtherII CB-TXD (CardBus 100M/10M).
Fix typo (Coreaga->Corega)


109061 10-Jan-2003 mbr

Make newer integrated SiS900 cards working.

Allow to read EEPROM from LAN. It is shared
between a 1394 controller and the NIC and each
time we access it, we need to set SIS_EECMD_REQ.

Idea from: linux driver source

Reviewed by: luoqi
Obtained from: linux driver source (idea)


109060 10-Jan-2003 mbr

Sis no longer implements the enhanced phy control
register, and phy has to be directly accessed via mdio.

Patch converted to CURRENT from STABLE.

Submitted by: luoqi
Reviewed by: luoqi (again)
MFC after: 2 weeks


109059 10-Jan-2003 mbr

SIS_CFG_EDB_MASTER_EN indicates the EDB bus is used instead of
the PCI bus. When this bit is set, the Max DMA Burst Size
for TX/RX DMA should be no larger than 64 bytes.

Reviewed by: luoqi
Obtained from: (idea from linux driver source)
MFC after: 2 weeks


109058 10-Jan-2003 mbr

When reading PHY regs over the i2c bus, the turnaround ACK bit
is read one clock edge too late. This bit is driven low by
slave (as any other input data bits from slave) when the clock
is LOW. The current code did read the bit after the clock was
driven high again.

Reviewed by: luoqi
MFC after: 2 weeks


109048 10-Jan-2003 imp

Add preliminary support for the Hawking PN672TX CardBus cards.

# Preliminary because there are some subtle things the NetBSD driver does
# that we don't do yet. My card works for me w/o them.


109030 09-Jan-2003 trhodes

Add support for the Davicom DM9009 chipset.

PR: 46859
Submitted by: Boaz Haberman <boaz@ool-182f8b09.dyn.optonline.net>
Approved by: rwatson


108849 07-Jan-2003 mux

o Only try to recopy the mbuf into an mbuf cluster if
bus_dmamap_load_mbuf() returned EFBIG.
o Fix mbuf leaks in an error (rare) code path.
o Reuse the TX descriptor if xl_encap() failed instead of
just picking the next one.
o Better error messages.


108758 06-Jan-2003 silby

Ooops, use the full name of XL_FLAG_EEPROM_OFFSET_30

Noticed by: Niels Chr. Bank-Pedersen <ncbp@bank-pedersen.dk>


108752 06-Jan-2003 silby

Add support for the 3c555 miniPCI chipset.

Submitted by: johannes <johannes@paradise.net.nz>
PR: 46603
MFC after: 3 days


108750 06-Jan-2003 silby

Add two MII_SETs to provide a bit more time between operations in
xl_sync; this appears to be necessary with certain systems.

Requested by: Michael Class <michael_class@gmx.net>


108729 05-Jan-2003 jake

Tweaks to make if_rl work on sparc64.

Mostly submitted by: tmm
Tested on: i386, sparc64


108533 01-Jan-2003 schweikh

Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.


108470 30-Dec-2002 schweikh

Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/
Add FreeBSD Id tag where missing.


108449 30-Dec-2002 mux

Leave only one of the two $FreeBSD$ tag, and use __FBSDID().


108237 23-Dec-2002 phk

Change the chip description from "DFE-550TX" to "DL10050".
The DL10050 chip is used on the 550TX and 580TX cards, probably
others as well.


108236 23-Dec-2002 alc

- Hold the page queues lock around vm_page_wakeup().


108065 18-Dec-2002 mux

Fix bug with 3c90xB cards and newer. We weren't trying to
copy the mbuf chain into an mbuf cluster when there is
more than 63 mbufs in the chain. We were trying with older
cards though.


108062 18-Dec-2002 semenu

Fix the missspelt letter in DC_CTYPE_PUP_AUTOSENSe define.

Submitted by: marius@alchemy.franken.de
MFC after: 3 days


107959 17-Dec-2002 mux

Convert the xl(4) driver to the busdma API. This should make
it possible to use this driver under ia64, sparc64 (though
there may be endianness issues with this one) and other archs.

Tested on: i386, alpha (gallatin)


107840 13-Dec-2002 scottl

Move the amd(4) driver to it's own directory in preparation for it growing
an sbus front-end.


107833 13-Dec-2002 mux

Correct a harmless problem when creating the DMA tag
used to map mbufs. The maximum size should be MCLBYTES
and not SIS_TX_LIST_SZ. This is probably a typo in
the original commit.

Tested by: cognet


107302 27-Nov-2002 imp

Xircom cards store the MAC address in the CIS, so get it from the new
pci_get_ether accesor, which gets it from the CIS for cardbus cards
(and from other pci-like buses via whatever mechanism is used there).

Submitted by: sam
Approved by: re (blanket)


107239 25-Nov-2002 luigi

Fix handling of IFF_ALLMULTI. The same bug in various forms affects
the following drivers:

dc mn sf sk ste ti tl xl an bge em gem gx ie lge sr aue cue kue wi xe

Approved by: re


107220 25-Nov-2002 silby

Import some relevant changes from Via's if_fet driver:

1. Detect the revision of the Rhine chip we're using.
2. Use the force reset command on revisions which support
it whenever the normal reset command fails.

This should solve a wide range of "my vr0 locks up with reset
failed messages" problems. (Although the root causes should
be eventually tracked down.)

Tested by: grenville armitage <garmitage@swin.edu.au>
Obtained from: Via's if_fet driver
MFC after: 3 days
Approved by: re


106936 14-Nov-2002 sam

o track either_ifattach/ether_ifdetach API changes
o use if_input for input packet processing
o don't strip the Ethernet header for input packets
o use BPF_* macros bpf tapping
o call ether_ioctl to handle default ioctl case
o track vlan changes

Reviewed by: many
Approved by: re


106860 13-Nov-2002 mux

Remove a bunch of #include "opt_pci.h".


106705 09-Nov-2002 alfred

Fix an unparenthasized macro argument. md5s differ but this is likely
to order of operations that are actually fixed by the proper parenthasizing.


106696 09-Nov-2002 alfred

Fix instances of macros with improperly parenthasized arguments.

Verified by: md5


106668 08-Nov-2002 jhb

Fix some sizeof(int) != sizeof(void *) warnings.


106628 08-Nov-2002 jhb

Wrap a device_printf() that violates bus space abstractions to figure out
if it's IO port resource is IO or memory mapped for the sake of a printf
using i386-specific values in #ifdef __i386__.


106627 08-Nov-2002 jhb

Use %z to print a size_t value.


106626 08-Nov-2002 jhb

Use %z to print size_t values.


106157 29-Oct-2002 imp

Don't take out the rl_mtx lock in the attach routine. The only way
we'd need it is if we're interrupted. So, register the interrupt last
in the attach routine.


105675 22-Oct-2002 silby

Add some magic bits necessary to turn the transmitter on for some
(newer) 556B chips.

Requested & tested by: Dinesh Nambisan <dinesh@nambisan.net>
Magic bits found by: Dave Dribin & Donald Becker

MFC After: 3 days


105599 21-Oct-2002 brooks

Use if_printf(ifp, "blah") and device_printf(dev, "blah") instead of
printf("%s%d: blah", ifp->if_name, ifp->if_xname). This eliminates the
need to store the unit number in the softc.


105221 16-Oct-2002 phk

Be consistent about functions being static.
Properly put macro args in ().

Spotted by: FlexeLint.


105219 16-Oct-2002 phk

Be consistent about functions being static.

Spotted by: FlexeLint.


105213 16-Oct-2002 phk

Rename struct softc to struct mn_softc.


105145 15-Oct-2002 marcel

Fix previous commit: Don't cast integral types to pointers to
print them with %p. Cast to unsigned long and print with %#lx.

Discussed with: bde


105137 14-Oct-2002 peter

Turn off the premature locking in xl. The driver tries to use the mutexes
as spl replacements, but you cant sleep while holding mutexes.

This change has been made on many other drivers.


104999 12-Oct-2002 marcel

Make this compile on 64-bit architectures (e.g. ia64) by not assuming
pointers (but more precisely vm_offset_t) can be printed with %x. Use
%p instead and cast the argument to caddr_t.


104600 07-Oct-2002 imp

Ooops. Need to free dc_srom on detach to not leak memory.

Pointy Hat to: The Mad Redhead of Niwot


104599 07-Oct-2002 imp

Dynamically configure the width of the srom. This code comes from
OpenBSD who got the code (or the idea) from the NetBSD tlp driver.

This gets some cardbus dc cards working (either completely or nearly
so). It also appears to get additional pci cards working, without
breaking working ones.

# Maybe some additional work is needed here. Also, the cardbus attachment
# might need to match on the CIS rather than on the vendor/device so we have
# a finer level of detail as to what the card is. Technically, the
# vendor/device fields are undefined for CardBus (even though most cards are
# using common silicon with pci models).


104401 03-Oct-2002 alfred

Static'ify a variable.

Submitted by: Matt Emmerton <matt@gsicomp.on.ca>


104397 03-Oct-2002 anholt

Correct an indentation.

Noticed by: phk


104324 01-Oct-2002 phk

Fix two misindents.

Spotted by: FlexeLint


103779 22-Sep-2002 silby

Remove all DELAY(1) calls around MII operations in the XL driver.
According to the MII specification, the delay produced by our
reads alone are sufficient for correct operation.

This reduces the time mii_tick takes from 10ms to ~1ms here. That's
still a lot, but much better than before.

Submitted by: Harti Brandt <brandt@fokus.gmd.de>
MFC after: 3 weeks


103764 21-Sep-2002 nsouch

Cleanup of amdpm(4).

Add of NVIDIA nForce (nfpm) smbus support.

Obtained from: Thomas D. Dean <tomdean@speakeasy.org>


103685 20-Sep-2002 mbr

Fix the support for the AN985/983 chips, which do not set the
RXSTATE to STOPPED, but to WAIT. This should fix hangs which
could only be solved by replugging the cable.

Submitted by: jhb
Reviewed by: phk
MFC after: 2 weeks


103684 20-Sep-2002 mbr

Enable the automatic TX underrun recovery for the ADMtek chips.
This solves cvsup update on my laptop which aborts after a while
without this patch.

PR: 34236
Reviewed by: phk
MFC after: 2 weeks


103592 19-Sep-2002 peter

simos.c needs a to be updated from the old pci shims. Yell loudly but
stop breaking alpha LINT.


103564 18-Sep-2002 ambrisko

Clarify comment to "Code borrowed from if_fxp.c" to deal with running
out of fragments.

Suggested by: jhb


103340 15-Sep-2002 anholt

Fix i810 after i830 commit.

Submitted by: David Dawes <dawes@XFree86.Org>


103272 13-Sep-2002 anholt

Fix an i830/i845 test that shouldn't get hit in normal use and remove a printf.

Submitted by: David Dawes <dawes@XFree86.Org>


103243 12-Sep-2002 anholt

Add AGP support for Intel i830M and i845 thanks to patches from moto kawasaki
<kawasaki@mbg.sphere.ne.jp> and David Dawes <dawes@XFree86.org>.


103238 11-Sep-2002 ambrisko

Only probe one PHY on the D-Link 580 version of the card (ie rev 0x12).
The 550 version is location at address 1 but since it works right we
let the code find whatever PHY it can.

Fix a fragment issue on TX. If the number of frags are more then the
driver has allocated then bring all the frags together into one packet
and send it out. Code derived from the fxp driver.

Tested and found by: Francois Tigeot <francois.tigeot@nic.fr>
Hellmuth Michaelis <hm@kts.org>

MFC after: 1 week


103139 09-Sep-2002 ticso

add missing \n to printf

Approved by: gallatin (mentor)


103020 06-Sep-2002 iwasaki

Add support for Corega FEther CB-TXD (CardBus 100M/10M).


102930 04-Sep-2002 markm

Make consistent; turn spaces into tabs where there is a mixture.


102537 28-Aug-2002 joe

Add a device description for Intel 82801CA/CAM (ICH3) USB controller
USB-C.

PR: kern/41963


102480 27-Aug-2002 bde

Include <sys/lockmgr.h> for old lock interfaces instead of depending on
namespace pollution in <sys/lock.h>.


102412 25-Aug-2002 charnier

Replace various spelling with FALLTHROUGH which is lint()able


102382 25-Aug-2002 alc

o Retire vm_page_zero_fill() and vm_page_zero_fill_area(). Ever since
pmap_zero_page() and pmap_zero_page_area() were modified to accept
a struct vm_page * instead of a physical address, vm_page_zero_fill()
and vm_page_zero_fill_area() have served no purpose.


102336 24-Aug-2002 alfred

style: put return types on a line by themselves.


102335 23-Aug-2002 alfred

style:
put return values on a line by themselves.
fix some paste issues where whitespace was used instead of tabs.


102334 23-Aug-2002 alfred

Put return values from functions on a line by themselves.

Ok'd previously by: wpaul


102113 19-Aug-2002 ambrisko

Don't read the PCI config space during mii operations. Instead save whether
or not we have to limit the PHY detection in the softc structure. Then
just check the flag.

Suggested by: jdp
Reviewed by: jdp
MFC after: 3 days


102089 19-Aug-2002 phk

Remove the SIS_LOCK/SIS_UNLOCK from sis_attach(). It makes WITNESS
barf and there seem to be little room for contention during attach.


102056 18-Aug-2002 joe

Use uhci_pci_match to return the device description and rework the
vendor description code.


102055 18-Aug-2002 joe

Add a comment to remind that uhci_pci_match will never return NULL.
Don't display the "New UHCI DeviceId" message unless booting verbosely.
Use a switch statement for the vendor match code.


102052 18-Aug-2002 sobomax

Increase size of ifnet.if_flags from 16 bits (short) to 32 bits (int). To avoid
breaking application ABI use unused ifreq.ifru_flags[1] for upper 16 bits in
SIOCSIFFLAGS and SIOCGIFFLAGS ioctl's.

Reviewed by: -hackers, -net


102038 18-Aug-2002 joe

Consolidate the device recognition code.


102000 16-Aug-2002 ambrisko

Revert change to detect multiply PHYs in mii code. There might be cases
when this is needed. Work around bogus second PHY in the DFE-580 card
via a change in the if_ste.c driver.

Suggested by: jdp
Reviewed by: jdp
MFC after: 3 days


101952 15-Aug-2002 joe

UHCI_DEBUG -> USB_DEBUG.


101896 15-Aug-2002 silby

Improve handling of TX errors. Early reports indicate that this
elimiates the driver lockup problem reported by many.

Concepts used were taken from Via's if_fet driver. Verification
and implementation were done by Thomas Nystrom.

Submitted by: Thomas Nystrom <thn@saeab.se>
MFC after: 3 days


101647 10-Aug-2002 alc

o Use the VM_ALLOC_WIRED flag instead of calling vm_page_wire().


101493 07-Aug-2002 ambrisko

Fixes for the D-Link DFE-580 card.

This is pretty much fixes any issue I can find:
- Watchdog timeouts were due to starting the TX DMA engine
before we had a packet ready for it. So the first packet
sent never got out only if we sent more then one packet
at a time did the others make it out and not blow up.
Of course reseting the chip then caused us not to transmit
the first packet again ie. catch-22. This required logic changes.
- Combine interrupts on TX packets being queued up.
- Don't keep running around the RX ring since we might get
out of sync so only go around once per receive
- Let the RX engine recover via the poll interface which is
similar to the TX interface. This way the chip wakes
up with no effort when we read enough packets.
- Do better hand-shaking on RX & TX packets so they don't
start of to soon.
- Force a duplex setting when the link comes up after
an ste_init or it will default to half-duplex and be
really slow. This only happens on subsequent ste_init.
The first one worked.
- Don't call stat_update for every overflow. We only monitor
the collisions so the tick interval is good enough for that.
Just read in the collision stats to minimize bus reads.
- Don't read the miibus every tick since it uses delays and
delays are not good for performance.
- Tie link events directly to the miibus code so the port
gets set correctly if someone changes the port settings.
- Reduce the extreme number of {R,T}FD's. They would consume
130K of kernel memory for each NIC.
- Set the TX_THRESH to wait for the DMA engine to complete
before running the TX FIFO. This hurts peak TX performance
but under bi-directional load the DMA engine can't keep up
with the FIFO. Testing shows that we end up in the case
anyways (a la dc(4) issues but worse since the RX engine hogs
everything).
- When stopping the card do a reset since the reset verifies the
card has stopped. Otherwise on heavy RX load the RX DMA engine
is still stuffing packets into memory. If that happens after
we free the DMA area memory bits get scribled in memory and
bad things happen.

This card still has seemingly unfixable issues under heavy RX load in
which the card takes over the PCI bus.

Sponsored by: Vernier Networks
MFC after: 1 week


101464 07-Aug-2002 luigi

Use new interface for ether_input().
Remove some unnecessary assignments to mbuf fields in sis_newbuf(),
the "length" fields are of no use while the mbuf is in the receive ring.

MFC after: 3 days


101375 05-Aug-2002 silby

Make sure to set the DMA transfer length register, plus one
small style fix.

Submitted by: Thomas Nystrom <thn@saeab.se>


101340 04-Aug-2002 luigi

Use m_getcl() to allocate mbuf+cluster for the receive ring.

Remove the sis_quick variable, as it was there for testing purposes
only.

MFC after: 3 days


101336 04-Aug-2002 phk

Repond properly to NGM_TEXT_CONFIG messages.


101108 31-Jul-2002 silby

Make sure to set both sets of registers which control the RX and TX buffer
sizes. Previously, the end result was at the mercy of the card's default
setting. This change will reduce the number of buffer underruns for
some users.

PR: kern/37929
Submitted by: Thomas Nystrom <thn@saeab.se>
MFC after: 7 days


100957 30-Jul-2002 jhb

If we get 0xffff back when reading the status register, assume the card
has gone away instead of spinning in the interrupt handler. This stops
my machine from hanging when I eject a rl(4)-based cardbus card.

Reviewed by: imp


100422 21-Jul-2002 alc

o If the page returned by vm_page_grab(VM_ALLOC_ZERO) isn't prezeroed,
zero it.

Reviewed by: dfr, peter


100381 19-Jul-2002 jhb

Add PCI IDs for the A, B, and C UHCI controllers in the ICH4.

Sponsored by: The Weather Channel


100212 17-Jul-2002 jhb

- Use more correct values to initialize the AGP controller during setup.
The value we use is still questionable for 440BX chipsets.
- When flushing the TLB just toggle the bit in question instead of writing
a magic value that could trash other unrelated bits.


99988 14-Jul-2002 alc

o Lock page queue accesses by vm_page_wire().


99927 13-Jul-2002 alc

o Complete the locking of page queue accesses by vm_page_unwire().
o Assert that the page queues lock is held in vm_page_unwire().
o Make vm_page_lock_queues() and vm_page_unlock_queues() visible
to kernel loadable modules.


99165 30-Jun-2002 luigi

Fix if_timer logic to make sure that there is always a timeout
pending if there are packets queued for transmission.

Several drivers still have the same problem.

MFC after: 3 days


99164 30-Jun-2002 luigi

Fix if_timer logic to make sure that there is always a timeout
pending if there are packets queued for transmission.

MFC after: 3 days


99163 30-Jun-2002 luigi

Make sure that if_timer does not get reset if there are packets
still queued for transmission. This should solve the problem of
the device stalling on transmissions if some link event prevents
transmission.

There are other drivers which have the same problem and need to be
fixed in the same way.

MFC after: 3 days


99058 29-Jun-2002 alfred

catch up with mextfree callback change when TI_PRIVATE_JUMBOS is defined.

Pointed out by: kdm


99013 29-Jun-2002 peter

Remove a couple of __P() stragglers.


99008 29-Jun-2002 alfred

catch up with mextadd callback taking a void argument instead of a caddr_t.


98995 28-Jun-2002 alfred

remove or replace caddr_t with void.
make the mbuf external free function take a void * rather than caddr_t.


98849 26-Jun-2002 ken

At long last, commit the zero copy sockets code.

MAKEDEV: Add MAKEDEV glue for the ti(4) device nodes.

ti.4: Update the ti(4) man page to include information on the
TI_JUMBO_HDRSPLIT and TI_PRIVATE_JUMBOS kernel options,
and also include information about the new character
device interface and the associated ioctls.

man9/Makefile: Add jumbo.9 and zero_copy.9 man pages and associated
links.

jumbo.9: New man page describing the jumbo buffer allocator
interface and operation.

zero_copy.9: New man page describing the general characteristics of
the zero copy send and receive code, and what an
application author should do to take advantage of the
zero copy functionality.

NOTES: Add entries for ZERO_COPY_SOCKETS, TI_PRIVATE_JUMBOS,
TI_JUMBO_HDRSPLIT, MSIZE, and MCLSHIFT.

conf/files: Add uipc_jumbo.c and uipc_cow.c.

conf/options: Add the 5 options mentioned above.

kern_subr.c: Receive side zero copy implementation. This takes
"disposable" pages attached to an mbuf, gives them to
a user process, and then recycles the user's page.
This is only active when ZERO_COPY_SOCKETS is turned on
and the kern.ipc.zero_copy.receive sysctl variable is
set to 1.

uipc_cow.c: Send side zero copy functions. Takes a page written
by the user and maps it copy on write and assigns it
kernel virtual address space. Removes copy on write
mapping once the buffer has been freed by the network
stack.

uipc_jumbo.c: Jumbo disposable page allocator code. This allocates
(optionally) disposable pages for network drivers that
want to give the user the option of doing zero copy
receive.

uipc_socket.c: Add kern.ipc.zero_copy.{send,receive} sysctls that are
enabled if ZERO_COPY_SOCKETS is turned on.

Add zero copy send support to sosend() -- pages get
mapped into the kernel instead of getting copied if
they meet size and alignment restrictions.

uipc_syscalls.c:Un-staticize some of the sf* functions so that they
can be used elsewhere. (uipc_cow.c)

if_media.c: In the SIOCGIFMEDIA ioctl in ifmedia_ioctl(), avoid
calling malloc() with M_WAITOK. Return an error if
the M_NOWAIT malloc fails.

The ti(4) driver and the wi(4) driver, at least, call
this with a mutex held. This causes witness warnings
for 'ifconfig -a' with a wi(4) or ti(4) board in the
system. (I've only verified for ti(4)).

ip_output.c: Fragment large datagrams so that each segment contains
a multiple of PAGE_SIZE amount of data plus headers.
This allows the receiver to potentially do page
flipping on receives.

if_ti.c: Add zero copy receive support to the ti(4) driver. If
TI_PRIVATE_JUMBOS is not defined, it now uses the
jumbo(9) buffer allocator for jumbo receive buffers.

Add a new character device interface for the ti(4)
driver for the new debugging interface. This allows
(a patched version of) gdb to talk to the Tigon board
and debug the firmware. There are also a few additional
debugging ioctls available through this interface.

Add header splitting support to the ti(4) driver.

Tweak some of the default interrupt coalescing
parameters to more useful defaults.

Add hooks for supporting transmit flow control, but
leave it turned off with a comment describing why it
is turned off.

if_tireg.h: Change the firmware rev to 12.4.11, since we're really
at 12.4.11 plus fixes from 12.4.13.

Add defines needed for debugging.

Remove the ti_stats structure, it is now defined in
sys/tiio.h.

ti_fw.h: 12.4.11 firmware.

ti_fw2.h: 12.4.11 firmware, plus selected fixes from 12.4.13,
and my header splitting patches. Revision 12.4.13
doesn't handle 10/100 negotiation properly. (This
firmware is the same as what was in the tree previously,
with the addition of header splitting support.)

sys/jumbo.h: Jumbo buffer allocator interface.

sys/mbuf.h: Add a new external mbuf type, EXT_DISPOSABLE, to
indicate that the payload buffer can be thrown away /
flipped to a userland process.

socketvar.h: Add prototype for socow_setup.

tiio.h: ioctl interface to the character portion of the ti(4)
driver, plus associated structure/type definitions.

uio.h: Change prototype for uiomoveco() so that we'll know
whether the source page is disposable.

ufs_readwrite.c:Update for new prototype of uiomoveco().

vm_fault.c: In vm_fault(), check to see whether we need to do a page
based copy on write fault.

vm_object.c: Add a new function, vm_object_allocate_wait(). This
does the same thing that vm_object allocate does, except
that it gives the caller the opportunity to specify whether
it should wait on the uma_zalloc() of the object structre.

This allows vm objects to be allocated while holding a
mutex. (Without generating WITNESS warnings.)

vm_object_allocate() is implemented as a call to
vm_object_allocate_wait() with the malloc flag set to
M_WAITOK.

vm_object.h: Add prototype for vm_object_allocate_wait().

vm_page.c: Add page-based copy on write setup, clear and fault
routines.

vm_page.h: Add page based COW function prototypes and variable in
the vm_page structure.

Many thanks to Drew Gallatin, who wrote the zero copy send and receive
code, and to all the other folks who have tested and reviewed this code
over the years.


97748 02-Jun-2002 schweikh

Fix typo in the BSD copyright: s/withough/without/

Spotted and suggested by: des
MFC after: 3 weeks


96677 15-May-2002 silby

Enhance the use of the watchdog timer in this driver so that it will
allow recovery from transmission lockups which occur in the middle
of the descriptor list, rather than just at the beginning.

For some unknown reason, Rhine II chips have a tendency to stop
transmitting while under heavy load, possibly due to collisions.
Whether this behavior is due to a hardware bug or a driver glitch
is unknown as of now.

In either case, this change allows the driver to gracefully recover
from such situations.

Special thanks go to The Anarcat <anarcat@anarcat.dyndns.org>, who
bugged me into looking at this and to
Dominic Marks <dominic_marks@btinternet.com>, who performed a great
deal of testing to help characterize this problem.

MFC after: 3 days


96112 06-May-2002 jhb

Add support for the D-Link DFE-690TXD Cardbus card which has a RealTek 8139
with its own PCI ID.


96111 06-May-2002 iwasaki

Add suspend/resume code mostly merged from fxp/rl driver.
This is temporary hack, better and generalized solution probably
should be implemented at lower layer(MII or PCI?).
Tested by: shoko.araki@soliton.co.jp
MFC after: 1 week


95975 03-May-2002 phk

Don't grab the lock until somewhat later in attach to avoid a lock
reversal.


95702 29-Apr-2002 phk

Move us yet closer to IFM_* definitions in NetBSD.


95673 28-Apr-2002 phk

Follow NetBSD and s/IFM_1000_TX/IFM_1000_T/


95533 26-Apr-2002 mike

Move the new byte order function prototypes from <sys/param.h> to
<sys/endian.h>. This puts us in line with NetBSD and OpenBSD.


95528 26-Apr-2002 phk

Redo the pps bit to avoid digging into the private bits of the timecounter.


95523 26-Apr-2002 phk

Simplify the RFC2783 and PPS_SYNC timestamp collection API.


95075 19-Apr-2002 semenu

Move tx(4) driver to sys/dev/tx. BTW split hardware structures and constants
into if_txreg.h.

MFC after: 1 week


94883 16-Apr-2002 luigi

Add DEVICE_POLLING support to the "rl" driver.
The diffs are very similar to the ones for the "sis" driver.

MFC After: 5 days


94790 15-Apr-2002 cokane

Fix some nits in AMD AGP driver. Remove excess malloc and move a bzero
out of the way, so it won't cause trouble.

Submitted by: Frank Mayher <frank@exit.com>
MFC after: 1 week


94400 11-Apr-2002 wpaul

Nortel Networks sells a RealTek 8139-based NIC that's basically
the same thing as the SMC 1211, but with their own vendor ID.
Update the device list to support this NIC. (Discovered these
cards lying around the lab at work.)


94149 07-Apr-2002 wpaul

Teach the rlphy driver how to do parallel link detection. If the link partner
doesn't support NWAY, the RealTek PHY (both the integrated ones on 8139
chips and the RTL8201L 10/100 PHY) will not report the link speed via
the ANLPAR or BMSR registers. For the 8201L, we need to look in magic
vendor-specific PHY register 0x19. For the 8139 MAC+PHY combo, we have
to be able to test the RL_MEDIASTAT register.

The changes to rlphy.c are based largely on the patch from PR 30836,
however I tried to eliminate some magic numbers by creating an entry
for the 8201 PHY in miidevs.

Also updated if_rl.c to allow the rlphy driver to read the RL_MEDIASTAT
register via the rl_miibus_readreg() routine.


93818 04-Apr-2002 jhb

Change callers of mtx_init() to pass in an appropriate lock type name. In
most cases NULL is passed, but in some cases such as network driver locks
(which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used.

Tested on: i386, alpha, sparc64


93040 23-Mar-2002 nsouch

smbus_alloc_bus is not part of the smbus interface anymore


93023 23-Mar-2002 nsouch

Major rework of the iicbus/smbus framework:

- VIA chipset SMBus controllers added
- alpm driver updated
- Support for dynamic modules added
- bktr FreeBSD smbus updated but not tested
- cleanup


92739 20-Mar-2002 alfred

Remove __P.


92734 19-Mar-2002 peter

Cast pointers to uintptr_t rather than u_int32_t. This doesn't work too
well on machines with 64 bit pointers.


92467 17-Mar-2002 bde

Work around a PLX9050 bug that causes system lockup in certain systems,
depending on the MMIO addresses allocated to the board.

PR: 30965, 20845 (maybe)
Submitted by: Daniela Squassoni <daniela@cyclades.com>
Tested by: Arjan Knepper <arjan@jak.nl>
Scott Klement <klemscot@klements.com>


91265 26-Feb-2002 peter

Fix warning; amdsmb_abort() is not used.


90767 17-Feb-2002 joe

Fix a formatting error.


90766 17-Feb-2002 joe

KNF style the code, ready for an MFC.


90764 17-Feb-2002 joe

KNF style the code, ready for an MFC.


90548 11-Feb-2002 silby

Remove mbuf exhaustion warning messages; these are handled by the
mbuf system in a rate-limited fashion now.

MFC after: 3 days


90531 11-Feb-2002 joe

Fix some bugs in the ohci driver with respect to irq setup failure.

Submitted by: nyan


90340 07-Feb-2002 luigi

Use ETHER_CRC_LEN instead of SIS_CRC_SIZE

Suggested-by: Archie, Doug Ambrisko


90339 07-Feb-2002 luigi

Fix a bug in the driver -- the chip will always include the CRC
in the received packet size, but the upper level routines want
the length without it.

Reported-by: Doug Ambrisko, ambrisko@freebsd.org


90328 06-Feb-2002 ambrisko

Fix support for 630ET support. We don't need the Linux part to set the
mii access mode. Fix the device ID and make it read the mac via sis_read_mac.

Reviewed by: imp
MFC after: 1 week


90270 05-Feb-2002 benno

Correctly identify the Intel 82830 AGP bridge.


90102 02-Feb-2002 bde

Merged cy_pcireg.h into the one file that uses it (cy_pci.c).


90101 02-Feb-2002 bde

Fixed breakage of interrupt setup in previous commit. It used an
uninitialized variable in the !CY_PCI_FASTINTR case (*blush*).


89436 16-Jan-2002 ambrisko

Forgot one part of the VLAN support for the dc(4) driver.

Pointed out by: Shin-ichi YOSHIMOTO <yosimoto@waishi.jp>


89431 16-Jan-2002 ambrisko

Add VLAN for the dc(4) driver (ie long frame). The patch is 2 parts.
One to notify the system that the MTU for VLAN can be 1500 so the vlan
will automatically be configured with a 1500 MTU the other is to ignore
the error case if the received frame is to long.

The frame size notification came from code in the SIS driver, and
the support for long frames derived from the NetBSD Tulip driver.

Tested on: 4 port D-Link adapter DFE-570TX 4 Intel 21143
Netgear card with 82c169 PNIC 10/100BaseTX

Reviewed by: ru (manpage), wpaul (not objected to), archie
Approved by: imp
Obtained from: NetBSD


89374 14-Jan-2002 wpaul

Fix mind-o: compare sc->sis_rev instead of 'command' when trying to
decide how to read the station address.


89296 12-Jan-2002 wpaul

Add support for newer integrated SiS 900 controllers on the 635 and 735
motherboard chipsets. We need to force the chip to reload its MAC address
into the receive filter, and enable software access mode for the PHY.

PR: kern/33294


88323 21-Dec-2001 pirzyk

Add support for the Intel 82443MX chipset

PR: kern/33032
MFC after: 1 month


88214 19-Dec-2001 wpaul

Fix the "conexant chips don't work in full duplexmode" problem. According
to Phil Kernick:

"The problem is that in full duplex mode, the Conexant chip always reports a
carrier lost error, even when the frame is successfully sent. So, if we
have a Conexant chip, then ignore carrier lost when in full duplex
mode."

Since the Xircom chips seem to have the same issue and since we already
have a workaround for this, just expand the workaround test to also
check for DC_IS_CONEXANT().


88213 19-Dec-2001 wpaul

Fix compiler warning in dc_intr(): if the only code that does a "goto"
to a label is inside an #ifdef block, then the label should *also* be
inside an #ifdef block. Hide the "done:" label which is only used if
DEVICE_POLLING is enabled under #ifdef DEVICE_POLLING.


88185 19-Dec-2001 mdodd

Allow retrieval of the virtual address of the AGP aperture
using agp_get_info().

MFC after: 1 week


88079 17-Dec-2001 silby

Fix a problem where stats overflow interrupts would cause
a major slowdown, and re-enable stats overflow interrupts.

For future reference, the bug was in our code, and not
some bug in the 3com chips.

Reviewed by: wpaul
MFC after: 2 days


87994 15-Dec-2001 archie

Fix access-after-free bug added in revision 1.31.

Detected by: INVARIANTS
MFC after: 2 days


87973 15-Dec-2001 peter

Patch up some existing style bugs and some that crept in with the
DEVICE_POLLING stuff.


87902 14-Dec-2001 luigi

Device Polling code for -current.

Non-SMP, i386-only, no polling in the idle loop at the moment.

To use this code you must compile a kernel with

options DEVICE_POLLING

and at runtime enable polling with

sysctl kern.polling.enable=1

The percentage of CPU reserved to userland can be set with

sysctl kern.polling.user_frac=NN (default is 50)

while the remainder is used by polling device drivers and netisr's.
These are the only two variables that you should need to touch. There
are a few more parameters in kern.polling but the default values
are adequate for all purposes. See the code in kern_poll.c for
more details on them.

Polling in the idle loop will be implemented shortly by introducing
a kernel thread which does the job. Until then, the amount of CPU
dedicated to polling will never exceed (100-user_frac).
The equivalent (actually, better) code for -stable is at

http://info.iet.unipi.it/~luigi/polling/

and also supports polling in the idle loop.

NOTE to Alpha developers:
There is really nothing in this code that is i386-specific.
If you move the 2 lines supporting the new option from
sys/conf/{files,options}.i386 to sys/conf/{files,options} I am
pretty sure that this should work on the Alpha as well, just that
I do not have a suitable test box to try it. If someone feels like
trying it, I would appreciate it.

NOTE to other developers:
sure some things could be done better, and as always I am open to
constructive criticism, which a few of you have already given and
I greatly appreciated.
However, before proposing radical architectural changes, please
take some time to possibly try out this code, or at the very least
read the comments in kern_poll.c, especially re. the reason why I
am using a soft netisr and cannot (I believe) replace it with a
simple timeout.

Quick description of files touched by this commit:

sys/conf/files.i386
new file kern/kern_poll.c
sys/conf/options.i386
new option
sys/i386/i386/trap.c
poll in trap (disabled by default)
sys/kern/kern_clock.c
initialization and hardclock hooks.
sys/kern/kern_intr.c
minor swi_net changes
sys/kern/kern_poll.c
the bulk of the code.
sys/net/if.h
new flag
sys/net/if_var.h
declaration for functions used in device drivers.
sys/net/netisr.h
NETISR_POLL
sys/dev/fxp/if_fxp.c
sys/dev/fxp/if_fxpvar.h
sys/pci/if_dc.c
sys/pci/if_dcreg.h
sys/pci/if_sis.c
sys/pci/if_sisreg.h
device driver modifications


87846 14-Dec-2001 luigi

Remove printf's on mbuf/cluster allocation failures. There are now
equivalent and less dangerous (rate limited) messages in
the mbuf allocation code.

MFC after: 3 days


87638 11-Dec-2001 luigi

Avoid an unnecessary copy of a packet if it is already in a single mbuf.
Introduce an additional device flag for those NICs which require the
transmit buffers to be aligned to 32-bit boundaries.

(the equivalen fix for STABLE is slightly simpler because there are
no supported chips which require this alignment there.)


87599 10-Dec-2001 obrien

Update to C99, s/__FUNCTION__/__func__/,
also don't use ANSI string concatenation.


87479 07-Dec-2001 cokane

This patch will fix the lockups associated with AMD 751,761,762 based AGP
controllers. There still seems to be some issues with the DRI copying code
for some adapters, at least it doesn't hang the system now. Input would be
appreciated.

PR: 32301
Obtained from: Eric Anhlot <eanholt@gladstone.uoregon.edu>, Joe <joeo@nks.net>


87472 07-Dec-2001 peter

MFS (merge from stable): rev 1.13.4.13, fix ordering of IFF_RUNNING mods.
The reason we are required to commit to -current first is so that later
MFC's do not risk the loss of existing bug fixes. Even if this was not
strictly required in -current, it should still be fixed there too.


87471 07-Dec-2001 peter

MFS (merge from stable): rev 1.9.2.28, fix ordering of IFF_RUNNING mods.
The reason we are required to commit to -current first is so that later
MFC's do not risk the loss of existing bug fixes. Even if this was not
strictly required in -current, it should still be fixed there too.


87392 05-Dec-2001 guido

Add suspend/resume hooks to this driver; necessary to overcome
problems on HP Omnibook 500.

MFC after: 1 week


87390 05-Dec-2001 jhay

Add VLAN support.

MFC after: 7 days


87330 04-Dec-2001 luigi

Remove error messages on mbuf allocation failures, now
this is done more safely in kern/subr_mbuf.c

Two-days'-delay-thanks-to: @home shutting down service


87276 03-Dec-2001 brooks

Don't pass an interface pointer to VLAN_INPUT{,_TAG}. Get it from the
mbuf instead.

Suggested by: fenner


87102 29-Nov-2001 luigi

Per jlemon request, reintroduce some printf() when an
mbuf allocation fails, and fix (i hope) a couple of style bugs.

I believe these printf() are extremely dangerous because now they can
occur on every incoming packet and are not rate limited. They were
meant to warn the sysadmin about lack of resources, but now they
can become a nice way to panic your system under load.

Other drivers (e.g. the fxp driver) have nothing like this.

There is a pending discussion on putting this kind of warnings
elsewhere, and I hope we can fix this soon.


87099 29-Nov-2001 luigi

For i386 architecture, remove an expensive m_devget() (and the
underlying unaligned bcopy) on incoming packets that are already
available (albeit unaligned) in a buffer.
The performance improvement varies, depending on CPU and memory
speed, but can be quite large especially on slow CPUs. I have seen
over 50% increase on forwarding speed on the sis driver for the
486/133 (embedded systems), which does exactly the same thing.

The behaviour is controlled by a sysctl variable, hw.dc_quick which
defaults to 1. Set it to 0 to restore the old behaviour.

After running a few experiments (in userland, though) I am convinced
that doing the m_devget() is detrimental to performance in almost
all cases.

Even if your CPU has degraded performance with misaligned data,
the bcopy() in the driver has the same overhead due to misaligment
as the one that you save in the uiomove(), plus you do one extra
copy and pollute the cache.

But more often than not, you do not even have to touch the payload,
e.g. when you are forwarding packets, and even in the often-cited
case of NFS, you often end up passing a pointer to the payload to
the disk controller.

In any case, you can play with the sysctl variable to toggle between
the two behaviours, and see if it makes a difference.

MFC-after: 3 days


87059 28-Nov-2001 luigi

Remove the need for an expensive m_devget on the i386, which does not
have alignment problems.

On small boxes (e.g. the net4501 from Soekris, featuring a 486/133)
this provides huge performance benefits: the peak forwarding rate
with avg.sized packets goes up by 50-70% because of this change
alone. Faster CPUs might benefit less from this change, but in any
case the CPU has better things to do than waste time on useless
memory-to-memory copies.

Several drivers (for Tulip-like cards) might benefit from a similar
change.

Right now the new behaviour is controlled by a sysctl variable,
hw.sis_quick which defaults to 1 (on), you can set it to 0 to
reintroduce the old behaviour (and compare the results). The
variable is only there to show how much you can gain with this
change, it will go away soon.

Also, slightly simplify the code to initialize the ring buffers,
and remove a couple of dangerous printf's which could trigger on
any packet in case of mbuf shortage.

MFC-after: 3 days


86984 27-Nov-2001 luigi

Fix a bug in the driver -- under load, the receive unit could become
idle and the driver would not detect the event, requiring userland
to cycle the interface to bring it up again.
The fix consists in adding SIS_IMR_RX_IDLE to the interrupt mask and
add a command in sis_intr() to restart the receiver when this happens.

While at it, make the test of status bits more efficient.


86976 27-Nov-2001 ru

Don't automatically unbind/deallocate memory when releasing.
This fixes the VT switching problem with the i810 X driver.

Explained by: David Dawes <dawes@XFree86.Org>
Reviewed by: dfr


86822 23-Nov-2001 iwasaki

Add suspend/resume code mostly merged from fxp driver.


86364 14-Nov-2001 jhb

Remove ifnet.if_mpsafe for now. If this is needed, it won't be needed
until much later when the network stack locking is farther along.

Approved by: jlemon


86192 08-Nov-2001 kuriyama

Add support for Intel's i820/i840/i845/i850/i860 chipset.

Submitted by: nork@cityfujisawa.ne.jp (Norikatsu Shigemura)
PR: kern/31559, kern/31825
MFC after: 1 week


86160 06-Nov-2001 peter

Add AMD766 OHCI USB controller. Remove unused VENDORID lists.


86128 06-Nov-2001 phk

This file was part of something grander, which doesn't seem to be
around anymore.


86007 04-Nov-2001 phk

Remove unneeded call to cdevsw_add()


85959 03-Nov-2001 peter

No FreeBSD/vax here either.


85945 03-Nov-2001 peter

Add ICH3 (82801CA/CAM) and 460GX


85571 27-Oct-2001 luigi

Enable round-robin arbitration between transmit and receive unit
in the 21143, instead of giving priority to the receive unit.
This gives a 10-15% performance improvement in the forwarding rate
under heavy load.

Reviewed-by: Bill Paul


85495 25-Oct-2001 luigi

Defs for three (unused so far) bits in PCI command/status register
were off by one bit.


85303 22-Oct-2001 alc

Implement TCP/IP checksum off-loading on send for the 3c905B and later
generation cards.


85254 20-Oct-2001 mjacob

Remove this driver from FreeBSD.

Jonathon Lemon's driver (gx) is at least as fast and has more features
and is likely to be better supported.

It is also possible that Intel might support this chipset in FreeBSD
with their own driver. Somewhat secretive and furtive rumblings from
certain Yahoo employees have indicated that this might happen soon.

I'm a little unhappy at the lack of discussion on the net list about
this, or on developers, or on hackers, or the lack of mention on
audit. This then leaves me to try and figure out the right thing
to do.

I've concluded that the right thing to do is to remove wx from FreeBSD,
as this is probably best for FreeBSD.


84963 15-Oct-2001 mjacob

Whack on this soon to be deprecated driver.
What the heck, the OpenBSD version will benefit.

1. Add wx_txint_delay as a tunable (defaults to 5000 now, or ~5ms) and switch
to using delayed TXDW interrupts. Since the chip continues to reload the
TIDV with this value for each descriptor written back, this allows continued
deferral of the actual interrupt until the last packet completes (assuming
that 5ms between multiple packets transmitting is reasonable).

2. Add two other SYSCTL entities:

hw.wx.dump_stats
hw.wx.clear_stats

to be used, hackey hackey, to get the watchdog routine to dump/clear
the current softc statistics.

Usage would be:

sysctl -w hw.wx.dump_stats=UNIT

to cause the current stats to be dumped for UNIT.

3. Attempt to clean up wx_detach routine so we don't panic. Well, things
still panic, but given that the code is just like other NIC drivers,
I suspect it's actually something elsewhere, like e1000phy, that's actually
blowing up.

4. Skip the entire test for runt packets- after doing somet thinking
and experimenting, I believe that the chip only doesn't like it if
the whole frame to xmit is < 16 bytes- each TFD can be some fragment
of that. This should improve performance a chunk because of all of the
(14 byte ETHERHEADER + DATA) mbuf chains.

5. Keep track of total frame length. Try not to xmit an odd byte frame-
this is supposed to get around some dumb Cisco switch problems.

6. On the last packet, also set Interrupt Delay && Report Packet Sent
(see #1 above)

7. Attempt to do xmit garbage collection *first* in order to avoid setting
IFF_OACTIVE if at all possible.

MFC after: 1 week


84694 09-Oct-2001 mjacob

Note that this driver is soon to be deprecated and removed from FreeBSD.


84387 02-Oct-2001 mjacob

Let's not kid ourselves- we don't *really* support jumbframes yet.
We only support the size of frame we are currently allocating, which
is MCLBYTES - sizeof (struct ether_header) usable, so don't set an
MTU that would go over this.


84384 02-Oct-2001 mjacob

Various fixes and improvements- some from the folks at Sitara Networks (thx)


84338 02-Oct-2001 mjacob

Remove all OpenBSD/NetBSD code. It was the right place to start from, but
it now really gets in the way.

This allows us to fix several problems- not least of which was problems
of ordering about when you'd have a device softc for an miibus child
available or not. Move some steps of things around.

Put the ifnet/arpcom structure at the head of the softc (PR 29249).

Don't do tx gc in the interrupt service routine- that seems to make
things a bit more efficient.

Enable jumbo support by default- but this version of 'jumbo' is broken
because it really is just using multiple tfd/rfd's to match a packet,
which will never be > CLSIZE anyway.

This should begin the first steps toward cleaning this driver up.

PR: 29249
MFC after: 1 week


84147 29-Sep-2001 jlemon

Do not call mii_pollstat() from within device tick routines; the status
information is updated by mii_tick().

Pointed out by: wpaul (a while back)


84024 27-Sep-2001 luigi

Fix typo in a comment.

MFC-after: 3 days


83849 23-Sep-2001 alc

Implement TCP/IP checksum off-loading on receive. Announce
rxcsum capabilities.

Reviewed by: wpaul


83699 20-Sep-2001 cokane

Add probe line for the AMD 761 northbridge chip. At least it detects now,
seems to set up memory spaces correctly. This change actually did work for
me using -STABLE, XFree86 4.0.3 ~ some snapshot of DRI awhile back. I sent
mail to dfr to no avail, perhaps someone else would like to test it with
DRI.

Anyway, people have been nagging me about this change for awhile, so here's
the commit.


83630 18-Sep-2001 jlemon

Have the driver advertise that it is capable of hardware checksums, and
allow the user to control the setting. (checksums are enabled by default)


83553 16-Sep-2001 murray

SMBus support for the AMD 756 power management unit. See smbus(4),
amdpm(4) and smb(4).

This device can be used with userland programs such as sysutils/lmmon
to retrieve sensor information from the motherboard.

PR: kern/23989
Obtained from: Matthew C. Forman <mcf@dmu.ac.uk>
Based on: alpm(4)


83366 12-Sep-2001 julian

KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after: ha ha ha ha


83122 05-Sep-2001 brooks

Update tx(4) to always enable vlan(4) support.

Approved by: semenu


83115 05-Sep-2001 brooks

Make vlan(4) loadable, unloadable, and clonable. As a side effect,
interfaces must now always enable VLAN support.

Reviewed by: jlemon
MFC after: 3 weeks


82978 04-Sep-2001 wpaul

Add support for Conexant LANfinity miniPCI controllers. People who have
laptops with this chip should test this and report back as I don't have
access to this hardware myself. People with -stable systems should try
the patch at:

http://www.freebsd.org/~wpaul/conexant.patch.gz

Submitted by: Phil Kernick <Phil@Kernick.org>


82970 04-Sep-2001 sos

Remove long overdue obsolete file ide_pcireg.h


82622 31-Aug-2001 jlemon

The fxp driver has lived in dev/fxp for some time, remove old files.


82573 30-Aug-2001 dfr

Recognise VIA Apollo KT133A bridge.

PR: 30061
Submitted by: John Merryweather Cooper <jmcoopr@webmail.bmi.net>
MFC after: 1 week


82446 28-Aug-2001 wpaul

Add support for the 3c656B cardbus adapter. This is one half of a
dual function card. It needs pretty much the same flags as the 656C,
except that it seems to need both the INVERT_MII_PWR and INVERT_LED_PWR
flags set. Tested with cardbus in -current as of today.

Also added support for the 3c656, which looks to be the same as
the 656B, except it doesn't need the EEPROM_8BIT flag. I think. This
one is untested, but the added support should not break any of the
other cards.


82305 24-Aug-2001 mjacob

John Polstra

bogus additional write to WXREG_IMASK that enabled *all* interrupt causes
while I was trying to disable the chip. Oops.


82214 23-Aug-2001 wpaul

Fix a bug in the ste_setmulti() routine. The NIC has 4 16-bit multicast
hash registers, not 2 32-bit ones. This would prevent the multicasr filter
from being programmed correctly in some cases.


81798 16-Aug-2001 wpaul

After one more day of testing, make what I hope are the final tweaks to
prevent/workaround TX lockups in this driver. The secret seems to be to
not let the TX DMA queue become too full. If we have too many packets
in the queue, we should wait for them to drain a bit before trying to
queue more. This should prevent the lockup from occurring, and if it
does occur, there is special code in sf_start() to kick the NIC in the
head and get it going again.

Special thanks to Glen Neff for helping me test this fix.


81737 16-Aug-2001 wpaul

Still more changes to try to prevent TX lockups. Will wait for one more
night of testing before merging to -stable.

Also added to code to detect TX underruns and automatically increase the
TX threshold to avoid them. Carefully placed diagnostig printf() about
this under #ifdef DIAGNOSTIC to avoid getting any panicky e-mails from
confused users, like I always do with the xl and dc drivers.


81714 15-Aug-2001 wpaul

Tweak the interrupt handler so that we call the txeof handler more often,
to hopefully prevent the TX DMA queue from filling up and never getting
flushed.


81713 15-Aug-2001 wpaul

Convert the if_sis and if_rl drivers to use the bus_dma API instead of
calling vtophys() and contigmalloc()/contigfree() directly. Hopefully,
I have shaken out all of the problems with busdma on the alpha now.
(Everything seems to work as expected.)

Also, change the max RX DMA limit to 1024 bytes instead of "unlimited,"
as the latter seems not to work correctly on the alpha that I tested.
(At 100Mbps, all attempts to receive frames yield RX errors.)


81594 13-Aug-2001 semenu

Fix an bug in FreeBSD attach routine - attaching MII interfaces before doing
common_attach is wrong as common attach initialize some fileds used by
mediainit routine. This was hard to notify because loading driver as kld
lead to mediainit routine being called after common_attach, though probe_phy
is called before.

MFC after: 1 week


81593 13-Aug-2001 semenu

Add support for 802.1Q VLAN and oversized ethernet frames.

PR: kern/29235
Submitted by: Peter Jeremy <peter.jeremy@alcatel.com.au>
Reviewed by: Yar Tikhiy <yar@FreeBSD.org>
MFC after: 1 week


80459 27-Jul-2001 wpaul

Pacify users who get all bent out of shape when they see the "xl%d: command
never completed" message. The RX reset takes longer complete than it
used to, a lot longer in fact than xl_wait() is prepared to wait.
When we do the RX reset in xl_reset(), this cases xl_wait() to time out
and whine. We wait a little extra time now after the RX reset, which
should silence the warning.

Thanks to obrien for finally getting me a box with a NIC that
causes this problem for me to tinker with.


80307 25-Jul-2001 brooks

IFT_8021_VLAN -> IFT_L2VLAN per if_vlan_var.h rev 1.9. With this change
LINT compiles, but doesn't link.


80203 23-Jul-2001 kris

s/adress/address/

Inspired by: OpenBSD
MFC After: 1 week


79648 12-Jul-2001 wpaul

Deal with the condition where we lose link in the middle of transmitting
a bunch of frames. In this case, the dc_link flag is cleared, and dc_start()
stops draining the if_snd send queue, which results in lots of 'no buffers
available' errors being reported to applications. The whole idea behind
not draining the send queue until the link comes up was to avoid having
the gratuitous ARP being lost while we're waiting for autoneg to complete
after the interface is first brought up. As an optimization, change the
test in dc_start() so that we only bail if dc_link is not set _and_ there
are less than 10 packets in the send queue. If the queue has many frames
in it, we need to drain them. If the queue has a small number of frames
in it, we can hold off on sending them until the link comes up.

MFC after: 1 week


79472 09-Jul-2001 wpaul

Apply patch supplied by Jonathan Chen: use the correct arguments to
pci_enable_io(). We need to use SYS_RES_IOPORT/SYS_RES_MEMORY instead
of PCIM_CMD_PORTEN/PCIM_CMD_MEMEN.


79339 05-Jul-2001 jhb

Make these compile again by adding proc.h include for GIANT_REQUIRED
that is in included vm headers.


79317 05-Jul-2001 benno

Set vendor string correctly for the Apple KeyLargo.

Forgotten by: benno
Spotted by: n_hibma


79088 02-Jul-2001 benno

Add device ID for the OHCI controller in the Apple KeyLargo chip.


78677 23-Jun-2001 semenu

Add initializetion of NVCTL register with EEPROM stored value.
This fix hazardous very slow work for one of my cards.

MFC after: 1 week


78508 20-Jun-2001 bmilekic

Change m_devget()'s outdated and unused `offset' argument to actually mean
something: offset into the first mbuf of the target chain before copying
the source data over.

Make drivers using m_devget() with a first argument "data - ETHER_ALIGN"
to use the offset argument to pass ETHER_ALIGN in. The way it was previously
done is potentially dangerous if the source data was at the top of a page
and the offset caused the previous page to be copied (if the
previous page has not yet been appropriately mapped).

The old `offset' argument in m_devget() is not used anywhere (it's always
0) and dates back to ~1995 (and earlier?) when support for ethernet trailers
existed. With that support gone, it was merely collecting dust.

Tested on alpha by: jlemon
Partially submitted by: jlemon
Reviewed by: jlemon
MFC after: 3 weeks


78255 15-Jun-2001 peter

Fix warning:
298: warning: assignment makes pointer from integer without a cast


78254 15-Jun-2001 peter

Fix warnings:
412: warning: long unsigned int format, unsigned int arg (arg 3)
418: warning: long unsigned int format, unsigned int arg (arg 3)
424: warning: long unsigned int format, unsigned int arg (arg 3)


77786 05-Jun-2001 wpaul

Fix mindo:

PCN_BCR_CLRBIT(sc, PCN_BCR_MIICTL, PCN_MIICTL_DANAS);

should be:

PCN_BCR_SETBIT(sc, PCN_BCR_MIICTL, PCN_MIICTL_DANAS);

Turning this bit on is what disables MII autoneg, not turning it off.
Without this, manually setting the media doesn't work.

Noticed by: Jim Browne <jbrowne@jbrowne.com>


77558 01-Jun-2001 wpaul

Grrr. Fix PR 27742 correctly this time. (At least I got -stable right.)


77548 31-May-2001 wpaul

Close PR #27742: allow the xl driver to receive VLAN tagged frames by
setting the 'max packet size' register in window 3. This only
works for cards based on the cyclone or newer chipsets (i.e. it
won't work with the original 3c905/boomerang cards).

There is a trick which will work with the boomerang, which is to turn
on the 'large packets ok' bit in the MAC control register, however this
lets the chip accept any frame up to 4K in length, which is larger than
the mbuf cluster buffers we use to receive frames. If somebody sends us
such a frame and the chip DMAs it to us, it could write past the end
of the cluster buffer and clobber something.

PR: kern/27742


77058 23-May-2001 phk

Vlan tags are 12 bits, mask off anything above since the chip doesn't
seem to do so for us.

PR: 27567
Submitted by: Koji HINO hino@ccm.cl.nec.co.jp
MFC after: 1 week


76916 21-May-2001 kuriyama

Add description for 82801BA controller.

MFC after: 1 week


76827 19-May-2001 alfred

Introduce a global lock for the vm subsystem (vm_mtx).

vm_mtx does not recurse and is required for most low level
vm operations.

faults can not be taken without holding Giant.

Memory subsystems can now call the base page allocators safely.

Almost all atomic ops were removed as they are covered under the
vm mutex.

Alpha and ia64 now need to catch up to i386's trap handlers.

FFS and NFS have been tested, other filesystems will need minor
changes (grabbing the vm lock when twiddling page properties).

Reviewed (partially) by: jake, jhb


76586 14-May-2001 wpaul

Close PR 22208: bring chip out of suspend mode, because Windows might
have put the chip to sleep at shutdown. This is really only for the
VT6102, but it doesn't hurt the older chips.


76539 13-May-2001 imp

I'll be making some rather substantial changes to the pci attachment
of the pcic class of devices. Go ahead and move it to the "usual"
place. I say "usual" in quotes since it isn't exactly right (not in
dev/blah), but it is closer than before.


76480 11-May-2001 wpaul

Disable the 'stats counter overflow' interrupts since they can happen
much more often that expected and negatively impact performance when
running at 100mbps. I need to figure out if there's a better way to
handle this, but for now this shouldn't hurt anything.


76412 09-May-2001 wpaul

The sk driver developed a bug when the multicast code was changed to
use TAILQ macros. The sk_attach_xmac() routine calls sk_init_xmac()
before doing the transceiver probe, but *before* ether_ifattach()
is called. This causes sk_init_xmac() to call sk_setmulti(), which
tries to do a TAILQ_FOREACH(), which it can't do because ether_ifattach()
hasn't done a TAILQ_INIT() yet. This causes a NULL pointer dereference
and panic in sk_setmulti() at driver load/initialization time.

Fixed by calling ether_ifattach() before the MII probe.

The code in RELENG_4 still uses the old way of enumerating the
multicast list and doesn't have this problem. Yet.


76350 08-May-2001 imp

Ricoh RL5C46x cardbus bridges have the bits for 3E0 and 3E2. The
RL5C47x cards do not. Only set them for that set of bridges.

Submitted by: shiba (Takeshi Shibagaki-san)


76349 08-May-2001 imp

Add some additional register definitions for some work I have in progress.


76306 06-May-2001 nyan

Move unused functions into #if 0 ... #endif.


76033 26-Apr-2001 wpaul

Fix the definitions for memory bank sizes, which I somehow got wrong.
The constant I was using was correct, but I mislabeled it as 256K when
it should have been 512K. This doesn't actually change the code, but
it clarifies things somewhat.

Submitted by: Chuck Cranor <chuck@research.att.com>


75639 17-Apr-2001 imp

Move setting of TI113X_PCI_CARD_CONTROL register sooner


75638 17-Apr-2001 imp

Minor comment that missed the last change


75637 17-Apr-2001 imp

When booting, turn on the 3E0 compatibility address for ricoh cardbus
parts. This is based on the newcard code that turns it off :-). We
can now reboot after NEWCARD or Windows and have OLDCARD work. Add
support for the RL5C466 while I'm at it.

Treat TI1031 the same as the CLPD6832. It doesn't work yet, but sucks
less than it did before.

Also add a few #defines for other changes in the pipe.


75436 11-Apr-2001 imp

Fix minor typo in comment. 112x -> 12xx


75360 09-Apr-2001 mjacob

Several things:

1. Pick up MII/PHY support for Livengood copper part (10/100/1000) from
Parag Patel. It was a fairly complete but not quite platform independent
job.

2. Finish silly offset differences that LIVENGOOD vs. WISEMAN registers
have (so the !)$*!)$*!$ fiber LIVENGOOD now works too).

3. Ansify the source.

So- we now suppor tthe PRO1000F and PRO1000T adapters.


75359 09-Apr-2001 mjacob

Add in MII support for LICENGOOD copper part (10/100/1000). Add in some
more flags for verbose as well as debug printing.


75358 09-Apr-2001 mjacob

Pick up changes from Parag Patel and Kachun Lee, and self:

1. The offsets for some registers change in LIVENGOOD. Gratuitously.

2. Define LIVENGOOD and LIVENGOOD_CU part numbers. Add some more
specific LIVENGOOD defaults.

3. Add definitions for PHY support for the copper LIVENGOOD part
(10/100/1000).


74810 26-Mar-2001 phk

Send the remains (such as I have located) of "block major numbers" to
the bit-bucket.


74773 25-Mar-2001 peter

Remove some unused stuff


74285 15-Mar-2001 peter

Add a placeholder for the ServerWorks OSB4 device id. The SMBus
interface on this chip is compatable with the PIIX4. The catch is that
this interferes with isab0 which wants to attach to the same PCI node.
It seems to work, but we only tested it on systems with no ISA cards.


73963 07-Mar-2001 wpaul

Remember to actually program the MAC address into the unicast filter
in vr_init(). The VIA Rhine chip happens to be able to automatically
read its station address from the EEPROM automatically when reset,
so you don't need to program the filter if you want to keep using the
factory default address, but if you want to change it with "ifconfig vr0
ether xx:xx:xx:xx:xx:xx" then we need to manually set it in the init
routine.


73929 07-Mar-2001 jhb

Grab the process lock while calling psignal and before calling psignal.


73280 01-Mar-2001 markm

Turn on interrupt-entropy harvesting for all/any mass storage devices
I could find. I have no doubt missed a couple.

Interrupt entropy harvesting is still conditional on the
kern.random.sys.harvest_interrupt sysctl.


73183 27-Feb-2001 mjacob

A better mousetrap: use device hints, as in:

hint.fxp.0.prefer_iomap="1"

to set IO vs. Memory space mapping.


73111 26-Feb-2001 wpaul

Workaround to prevent VMware from melting down. The pseudo PCnet interface
in VMware reports 0x00000000 in the PCI subsystem ID register, but
0x10001000 when you read the mirror registers in I/O space. This causes
pcn_probe() to think it's found a card in 32-bit mode, and performing
a 32-bit I/O access makes on a 16-bit port makes VMware go boom. Special
case the 0x10001000 value until somebody at VMware grows a clue.

Finally discovered by: Andrew Gallatin


72915 22-Feb-2001 wpaul

Apply patch to allow TX underrun handling without issuing a complete
chip reset. Just temporarily turn off the transmitter instead.

Submitted by: Stephen McKay <mckay@freebsd.org>


72813 21-Feb-2001 wpaul

Big round of minor updates:

- Use pci_get_powerstate()/pci_set_powerstate() in all the other drivers
that need them so we don't have to fiddle with the PCI power management
registers directly.
- Use pci_enable_busmaster()/pci_enable_io() to turn on busmastering and
PIO/memory mapped accesses.
- Add support to the RealTek driver for the D-Link DFE-530TX+ which has
a RealTek 8139 with its own PCI ID. (Submitted by Jason Wright)
- Have the SiS 900/National DP83815 driver be sure to disable PME
mode in sis_reset(). This apparently fixes a problem on some
motherboards where the DP83815 chip fails to receive packets.
(Submitted by Chuck McCrobie <mccrobie@cablespeed.com>)


72745 20-Feb-2001 imp

Take luigi's suggestion and move the check for nothing to do to before the
lock so we don't have lots of null lock/release pairs.


72743 20-Feb-2001 imp

Add DC_UNLOCK before first return. This caused returns when dc was on
a shared interrupt.

Pointed out by tegge.


72645 18-Feb-2001 asmodai

Preceed/preceeding are not english words. Use precede and preceding.


72633 18-Feb-2001 luigi

Add a check in the interrupt service routine to return quickly in
case there is nothing to do. This happens normally when the card shares
the interrupt line with other devices.

This code saves a couple of microseconds per interrupt even on a
fast CPU. You normally would not care, except under heavy tinygram
traffic where you can have some 50-100.000 interrupts per second...

On passing, correct a spelling error.


72200 09-Feb-2001 bmilekic

Change and clean the mutex lock interface.

mtx_enter(lock, type) becomes:

mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks)
mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized)

similarily, for releasing a lock, we now have:

mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN.
We change the caller interface for the two different types of locks
because the semantics are entirely different for each case, and this
makes it explicitly clear and, at the same time, it rids us of the
extra `type' argument.

The enter->lock and exit->unlock change has been made with the idea
that we're "locking data" and not "entering locked code" in mind.

Further, remove all additional "flags" previously passed to the
lock acquire/release routines with the exception of two:

MTX_QUIET and MTX_NOSWITCH

The functionality of these flags is preserved and they can be passed
to the lock/unlock routines by calling the corresponding wrappers:

mtx_{lock, unlock}_flags(lock, flag(s)) and
mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN
locks, respectively.

Re-inline some lock acq/rel code; in the sleep lock case, we only
inline the _obtain_lock()s in order to ensure that the inlined code
fits into a cache line. In the spin lock case, we inline recursion and
actually only perform a function call if we need to spin. This change
has been made with the idea that we generally tend to avoid spin locks
and that also the spin locks that we do have and are heavily used
(i.e. sched_lock) do recurse, and therefore in an effort to reduce
function call overhead for some architectures (such as alpha), we
inline recursion for this case.

Create a new malloc type for the witness code and retire from using
the M_DEV type. The new type is called M_WITNESS and is only declared
if WITNESS is enabled.

Begin cleaning up some machdep/mutex.h code - specifically updated the
"optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN
and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently
need those.

Finally, caught up to the interface changes in all sys code.

Contributors: jake, jhb, jasone (in no particular order)


72197 09-Feb-2001 wpaul

Apply patch to add support for the intergrated ethernet in the SiS630E
chipset. The MAC address is stored in the APC CMOS RAM and we have to
commit trememdous evil in order to read it. The code to do this is only
activated on the i386 platform. Thanks to Cameron Grant for providing
access to a test box for me to tinker with.

This will fix the problem where the sis driver ends up with a station
address of 00:00:00:00:00:00 on boards that use the 630E chipset.


72134 07-Feb-2001 semenu

Add support for SMC9432FTX card, possibly othe fiber optic SMC9432 family
cards will work too.


72117 07-Feb-2001 imp

Move ti1031 to the 16-bit bridge section


72084 06-Feb-2001 phk

Convert if_multiaddrs from LIST to TAILQ so that it can be traversed
backwards in the three drivers which want to do that.

Reviewed by: mikeh


72012 04-Feb-2001 phk

Another round of the <sys/queue.h> FOREACH transmogriffer.

Created with: sed(1)
Reviewed by: md5(1)


71999 04-Feb-2001 phk

Mechanical change to use <sys/queue.h> macro API instead of
fondling implementation details.

Created with: sed(1)
Reviewed by: md5(1)


71998 04-Feb-2001 phk

Use <sys/queue.h> macro API.


71962 03-Feb-2001 phk

Use LIST_FOREACH() to traverse ifp->if_multiaddrs list, instead of
<sys/queue.h> implementation details.

Created with: /usr/sbin/sed
Reviewed with: /sbin/md5


71892 01-Feb-2001 bde

Converted to new-bus.

Reviewed by: imp


71828 30-Jan-2001 jhay

The ar and sr devices have moved to sys/dev/.


71611 25-Jan-2001 peter

Disable cy - it is now completely broken and needs non-trivial work.


71599 24-Jan-2001 jhay

Newbusify ar(4).


71485 23-Jan-2001 mjacob

Allow fxp to configure in I/O space if the user wants it and specifies
an override as a loader settable variable (fxp_iomap). fxp_iomap is
a bitmap of fxp units that should be configured to use PCI I/O space
in stead of PCI Memory space.

Reviewed by: Kees Jan Koster <dutchman@tccn.cs.kun.nl>, dg@freebsd.org


71344 21-Jan-2001 phk

Update these netgraph drivers in current so that these changes can be
MFC'ed i due time. I can't test it under current right now because
netgraph seems to do unethical things with mutexes.

musycc:
Add status per channel.
Reduce printf chattyness
Keep error counters line if_mn does.
Increase descriptor count.

if_mn:
Support experimental unframed E1 lines.

These two drivers should share more code relating to framed channelized
TDM media in general (T1/E1/E3/T3, Sonet). Anyone interested email me.


71276 20-Jan-2001 wpaul

Check the return value of sf_encap() and handle errors accordingly.


71275 20-Jan-2001 wpaul

Set the OACTIVE flag if vr_encap() fails.


71272 20-Jan-2001 wpaul

Silence compiler warnings.


71271 19-Jan-2001 wpaul

Bug fixes that I've put together while working on a project in the office:

if_vr: handle the case where vr_encap() returns failure: bust out of the
packet sending loop instead of panicking. Also add some missing
newlines to some printf()s.

if_dc: The miibus_read and miibus_write methods keep swapping in and
out of MII mode by fiddling with CSR6 for cards with MII PHYs.
This is a hack to support the original Macronix 98713 card which
has built-in NWAY that uses an MII-like management interface
even though it uses serial transceivers. Conditionalize this
so that we only do this on 98713 chips, since it does bad things
to genuine tulip chips (and maybe other clones).


71228 19-Jan-2001 bmilekic

Implement MTX_RECURSE flag for mtx_init().
All calls to mtx_init() for mutexes that recurse must now include
the MTX_RECURSE bit in the flag argument variable. This change is in
preparation for an upcoming (further) mutex API cleanup.
The witness code will call panic() if a lock is found to recurse but
the MTX_RECURSE bit was not set during the lock's initialization.

The old MTX_RECURSE "state" bit (in mtx_lock) has been renamed to
MTX_RECURSED, which is more appropriate given its meaning.

The following locks have been made "recursive," thus far:
eventhandler, Giant, callout, sched_lock, possibly some others declared
in the architecture-specific code, all of the network card driver locks
in pci/, as well as some other locks in dev/ stuff that I've found to
be recursive.

Reviewed by: jhb


71139 17-Jan-2001 peter

Use pci_get_revid() rather than groping around the PCI register space
using the removed compatability register names. (this broke LINT)


71135 17-Jan-2001 peter

Special case for compiling LINT - just give a warning and continue on.
At least we have a chance at getting test compile coverage for the rest
of the kernel now.


71134 17-Jan-2001 peter

Remove unneeded (and compile-breaking) #include "alpm.h"


70855 09-Jan-2001 mjacob

moved isp_pci.c from pci to dev/isp


70820 09-Jan-2001 mjacob

add missing length argument


70784 08-Jan-2001 julian

Part 2 of the netgraph rewrite.
This is mostly cosmetic changes, (though I caught a bug or two while
makeing them)
Reviewed by: archie@freebsd.org


70700 06-Jan-2001 julian

Rewrite of netgraph to start getting ready for SMP.
This version is functional and is aproaching solid..
notice I said APROACHING. There are many node types I cannot test
I have tested: echo hole ppp socket vjc iface tee bpf async tty
The rest compile and "Look" right. More changes to follow.
DEBUGGING is enabled in this code to help if people have problems.


70610 02-Jan-2001 imp

Add device id for the OZ Micro 6832. I didn't try to init it like the
Cirrus Logic parts that end in 6832, but maybe some machines will need
that in the future.


70606 02-Jan-2001 nsouch

Remove old PCI compatibility.

Submitted by: Andrew Gallatin <gallatin@freebsd.org>


70488 29-Dec-2000 mjacob

Set up to do a local interrupt fielding before calling common code-
allows us to grab lock as we should.


70254 21-Dec-2000 bmilekic

* Rename M_WAIT mbuf subsystem flag to M_TRYWAIT.
This is because calls with M_WAIT (now M_TRYWAIT) may not wait
forever when nothing is available for allocation, and may end up
returning NULL. Hopefully we now communicate more of the right thing
to developers and make it very clear that it's necessary to check whether
calls with M_(TRY)WAIT also resulted in a failed allocation.
M_TRYWAIT basically means "try harder, block if necessary, but don't
necessarily wait forever." The time spent blocking is tunable with
the kern.ipc.mbuf_wait sysctl.
M_WAIT is now deprecated but still defined for the next little while.

* Fix a typo in a comment in mbuf.h

* Fix some code that was actually passing the mbuf subsystem's M_WAIT to
malloc(). Made it pass M_WAITOK instead. If we were ever to redefine the
value of the M_WAIT flag, this could have became a big problem.


70185 19-Dec-2000 assar

un-staticize M_AGP so that it can be used in agp*.c


70168 18-Dec-2000 wpaul

Add power state manipulation to the fxp driver. Some people have
claimed that their Intel NIC is comatose after a warm boot from Windoze.
This is most likely due to the card getting put in the D3 state. This
should bring it back to life.


70167 18-Dec-2000 wpaul

Use pci_get_powerstate()/pci_set_powerstate() which now exists in the
PCI code. This saves each driver from having to grovel around looking
for the right registers to twiddle.

I should eventually convert the other PCI drivers to do this; for now,
these three are ones which I know need power state handling.


70159 18-Dec-2000 julian

Divorce the kernel binary ABI version number from the message
format version number. (userland programs should not need to be
recompiled when the netgraph kernel internal ABI is changed.

Also fix modules that don;t handle the fact that a caller may not supply
a return message pointer. (benign at the moment because the calling code
checks, but that will change)


70068 15-Dec-2000 bmilekic

Make sure to check if MGET(HDR) returned NULL, even when called with M_WAIT.
This fixes the possibility of a NULL pointer dereference in the case where
there are no mbufs or mbuf clusters left.

Approved by: phk


69982 13-Dec-2000 julian

I really hate it when part of a patch gets left out.
This was still sitting in my commit tree.
Luckily I always compare my before and after trees...


69953 13-Dec-2000 msmith

Next round of PCI subsystem updates:

- Break out the /dev/pci driver into a separate file.
- Kill the COMPAT_OLDPCI support.
- Make the EISA bridge attach a bit more like the old code; explicitly
check for the existence of eisa0/isa0 and only attach if they don't
already exist. Only make one bus_generic_attach() pass over the
bridge, once both busses are attached. Note that the stupid Intel
bridge's class is entirely unpredictable.
- Add prototypes and re-layout the core PCI modules in line with
current coding standards (not a major whitespace change, just moving
the module data to the top of the file).
- Remove redundant type-2 bridge support from the core PCI code; the
PCI-CardBus code does this itself internally. Remove the now
entirely redundant header-class-specific support, as well as the
secondary and subordinate bus number fields. These are bridge
attributes now.
- Add support for PCI Extended Capabilities.
- Add support for PCI Power Management. The interface currently
allows a driver to query and set the power state of a device.
- Add helper functions to allow drivers to enable/disable busmastering
and the decoding of I/O and memory ranges.
- Use PCI_SLOTMAX and PCI_FUNCMAX rather than magic numbers in some
places.
- Make the PCI-PCI bridge code a little more paranoid about valid
I/O and memory decodes.
- Add some more PCI register definitions for the command and status
registers. Correct another bogus definition for type-1 bridges.


69951 13-Dec-2000 msmith

Remove a couple of leftover unused variables.


69927 12-Dec-2000 jhb

Add a missing include of <sys/proc.h>.


69922 12-Dec-2000 julian

Reviewed by: Archie@freebsd.org
This clears out my outstanding netgraph changes.
There is a netgraph change of design in the offing and this is to some
extent a superset of soem of the new functionality and some of the old
functionality that may be removed.

This code works as before, but allows some new features that I want to
work with and evaluate. It is the basis for a version of netgraph
with integral locking for SMP use.

This is running on my test machine with no new problems :-)


69783 08-Dec-2000 msmith

Next phase in the PCI subsystem cleanup.

- Move PCI core code to dev/pci.
- Split bridge code out into separate modules.
- Remove the descriptive strings from the bridge drivers. If you
want to know what a device is, use pciconf. Add support for
broadly identifying devices based on class/subclass, and for
parsing a preloaded device identification database so that if
you want to waste the memory, you can identify *anything* we know
about.
- Remove machine-dependant code from the core PCI code. APIC interrupt
mapping is performed by shadowing the intline register in machine-
dependant code.
- Bring interrupt routing support to the Alpha
(although many platforms don't yet support routing or mapping
interrupts entirely correctly). This resulted in spamming
<sys/bus.h> into more places than it really should have gone.
- Put sys/dev on the kernel/modules include path. This avoids
having to change *all* the pci*.h includes.


69781 08-Dec-2000 dwmalone

Convert more malloc+bzero to malloc+M_ZERO.

Submitted by: josh@zipperup.org
Submitted by: Robert Drehmel <robd@gmx.net>


69774 08-Dec-2000 phk

Staticize some malloc M_ instances.


69649 06-Dec-2000 mjacob

Restore a sense of cleanly supporting multiple platforms. That is,
place the LOCKing macros within the areas within if_wxvar.h that
is set aside for them. Put any platform specific data also in those
areas.

For ease of maintenance purposes, merge in the OpenBSD version codebase here.


69648 06-Dec-2000 mjacob

Move $FreeBSD id up to top of file for multi-OS ease of support reasons.


69596 05-Dec-2000 mjacob

Remove more printfs and use either isp_prt or device_printf. Remember
to set ISP_LOGINFO if bootverbose is set.


69583 04-Dec-2000 wpaul

Initialize/grab the mutex earlier in the attach phase, so that
bailing out to the fail: label where we release/destroy the mutex
will work without exploding.


69553 03-Dec-2000 nsayer

We now have the ability to assign the correct IRQ when PNP-OS is turned
on. So stop failing the attach if the IRQ is unassigned. With this
patch, I can now boot with PNP-OS YES in my BIOS no differently than
PNP-OS NO (which is a good thing since Windows hangs with PNP-OS NO).

Obtained from: msmith


69490 01-Dec-2000 imp

Add device ID for the 3c565C card. I followed exactly the 3c575c, but
further tweaks may be necessary down the road. This does nothing with
the serial side of the card.


69486 01-Dec-2000 jlemon

Add identifier for Compaq HotPlug host->pci bridge.

Submitted by: Steve Harrington <sgh@home.com>


69480 01-Dec-2000 gallatin

Convert the pcib_{read,write}_config args from signed to unsigned,
like the args to the config space accessors these functions replaced.

This reduces the likelyhood of overflow when the args are used in
macros on the alpha. This prevents memory management faults when
probing the pci bus on sables, multias and nonames.

Approved by: dfr
Tested by: Bernd Walter <ticso@cicely8.cicely.de>


69295 28-Nov-2000 mdodd

Reduce code duplication by using the GET_RESOURCE_LIST bus method and related
generic resource_list management functions.

I'll deal with the EISA bits later.

Not objected to by: new-bus


69154 25-Nov-2000 jlemon

Change the driver to allocate its own callout structure, and modify
the interface to use callout_* instead of timeout(). Also add an
IS_MPSAFE #define (currently off) which will mark the driver as mpsafe
to the upper layers.


69152 25-Nov-2000 jlemon

Lock down the network interface queues. The queue mutex must be obtained
before adding/removing packets from the queue. Also, the if_obytes and
if_omcasts fields should only be manipulated under protection of the mutex.

IF_ENQUEUE, IF_PREPEND, and IF_DEQUEUE perform all necessary locking on
the queue. An IF_LOCK macro is provided, as well as the old (mutex-less)
versions of the macros in the form _IF_ENQUEUE, _IF_QFULL, for code which
needs them, but their use is discouraged.

Two new macros are introduced: IF_DRAIN() to drain a queue, and IF_HANDOFF,
which takes care of locking/enqueue, and also statistics updating/start
if necessary.


69146 25-Nov-2000 jlemon

Don't attach the interface twice. While I'm here, add a driver
mutex.


69127 24-Nov-2000 roger

Print a warning when we detect a Realtek 8139B chip
(identified by the IO map being 256 bytes long instead of 128)

This chip works very unreliably on my Lanner embedded PC with the rl driver.
Lots of watchdog timeouts or poor performance.

Forcing the media type to 10 Meg (ifconfig rl0 media 10baseT/UTP) is a good
workaround.

This looks very similar to the problem reported in PR kern/18790

It is interesting to note that the linux driver has lots of special
case code for this chip.


69067 23-Nov-2000 wpaul

Update the probe some more to deal with 16/32 bit issues. If the chip
is already in 32-bit mode, we need to be able to detect this and still
read the chip ID code. Detecting 32-bit mode is actually a little
tricky, since we want to avoid turning it on accidentally. The easiest
way to do it is to just try and read the PCI subsystem ID from the
bus control registers using 16-bit accesses and compare that with the
value read from PCI config space. If they match, then we know we're in
16-bit mode, otherwise we assume 32-bit mode.


68837 16-Nov-2000 wpaul

When checking the device code in the probe routine, leave the chip in
16-bit mode. Technically, pcn_probe() is destructive because once the
chip goes into 32-bit mode, the only way to get it out again is a
hardware reset. And once the device is in 32-bit mode, the lnc driver
won't be able to talk to it. So if pcn_probe() is called before the
lnc probe routine, and pcn_probe() rejects the chip as one it doesn't
support, the lnc driver will be SOL.

I don't like this. I think it's a design flaw that you can't switch
the chip out of 32-bit mode once it's selected. The only 'right'
solution is for the pcn driver to support all of the PCI devices
in 32-bit mode, however I don't have samples of all the PCnet series
cards for testing.


68725 14-Nov-2000 wpaul

Add support for the Accton EN2242 MiniPCI adapter. This is just an
ADMtek Centaur chip, so all we need is the PCI ID.

Submitted by: Scott Lang <scottl@FreeBSD.org>


68621 11-Nov-2000 bmilekic

Change MEXTADD usage to pass the two new arguments.

Reviewed by: jlemon


68530 09-Nov-2000 pb

Add missing delay after card reset.

This fixes randoms lockups when probing the card at boot time, when
more than 1 similar card is found in the machine.

Reviewed by: semenu


68495 08-Nov-2000 sanpei

add a couple ESS Technology products(pci device id only).

FreeBSD src/sys/dev/sound/pcm/solo.c
NetBSD syssrc/sys/dev/pci/pcidevs
OpenBSD src/sys/dev/pci/pcidevs


68494 08-Nov-2000 sanpei

add Texas Instruments TSB12LV22 OHCI IEEE 1394 Host Controller

Obtained from: OpenBSD src/sys/dev/pci/pcidevs


68493 08-Nov-2000 sanpei

add Aureal Inc. AU8820/AU8830 Audio controller

Obtained from: OpenBSD src/sys/dev/pci/pcidevs


68433 07-Nov-2000 kjc

newbusify the en atm driver.


68317 04-Nov-2000 bde

Added used include of <machine/bus.h> -- don't depend on evil namespace
pollution in <sys/mutex.h>. This was half fixed in rev.1.3 of
midwayreg.h. The pollution exposed the bug that this driver was using
toy versions of the bus space macros under FreeBSD. Disabling the
toy versions made this driver compile but dependent on the pollution.
There was still a toy version of bus_space_read_1() in unreachable code.


68270 03-Nov-2000 wpaul

Create a pcn_setfilt() routine that twiddles the promiscuous mode
and nobroadcast bits in the mode register and call it both from
pcn_init() and pcn_ioctl(). Sometimes we need to force the state
of the nobroadcast bit after switching out of promisc mode.


68268 03-Nov-2000 wpaul

Grrrr. Remember to bzero() the mediainfo structures after we allocate
them. If we leave garbage in them, the dc_apply_fixup() routine may
try to follow bogus pointers when applying the reset fixup.

Noticed by: Andrew Gallatin


68227 02-Nov-2000 sanpei

add support for 3Com 3c575TX Fast Etherlink XL.

Device information for 3C575-TX is from NetBSD,
sys/dev/cardbus/if_ex_cardbus.c file.

Reviewed by: wpaul, imp


68216 02-Nov-2000 wpaul

Fix a couple of cases where I tried to release the I/O space resource twice
(once as as an I/O space resource and once as an IRQ resource). There was
a problem with this in if_rl too, which is how I found it.


68215 01-Nov-2000 wpaul

Fix 8-bit EEPROM breakage: compare against 0x8129, not 8129.


68021 31-Oct-2000 markm

Convert the de driver into a loadable module. Still missing is an
unload method. Lots of old cruft is removed.

Thanks to WPaul for large clue-injection and debugging services.

Reviewed by: wpaul


68015 31-Oct-2000 wpaul

Call dc_apply_fixup() in dc_setcfg() for the MII case.


68013 30-Oct-2000 wpaul

Grrr. The 'reg' variable in dc_apply_fixup() needs to be a u_int32_t, not
a u_int8_t. Pass the conical hat. This should fix certain cardbus 21143
cards that require SROM h0h0magic in order to enable their transceivers.


67931 30-Oct-2000 wpaul

Fix support for cardbus cards:
- Add DRIVER_MODULE() declaration to make this driver a
child of cardbus
- Handle different width EEPROMs

The CIS parser still barfs when scanning this card, but it seems to
probe/attach correctly anyway. I can't do a traffic test just yet
since I don't have a proper crossover cable handy.


67896 29-Oct-2000 gallatin

Unmask cypress ata controllers. This bug was hidden before
the addition of the serverworks isab support because the
cypress case was the last one in the switch


67885 29-Oct-2000 phk

Weaken a bogus dependency on <sys/proc.h> in <sys/buf.h> by #ifdef'ing
the offending inline function (BUF_KERNPROC) on it being #included
already.

I'm not sure BUF_KERNPROC() is even the right thing to do or in the
right place or implemented the right way (inline vs normal function).

Remove consequently unneeded #includes of <sys/proc.h>


67882 29-Oct-2000 phk

Remove unneeded #include <sys/proc.h> lines.


67866 29-Oct-2000 darrenr

fix warning compile error about unused variable


67863 29-Oct-2000 phk

Fix params passed to pci_porten() and pci_memen().


67820 28-Oct-2000 msmith

Unconditionally turning on the I/O and memory enable bits in the PCI
command register is too aggressive. Revert to the previous behaviour, but
leave the new behaviour available as an undocumented option. It's not
clear what the Right, Right Thing is to do here, but the more conservative
approach is safer.


67778 28-Oct-2000 peter

Fix typo s/DE_DEVICEID_FE2500/DC_DEVICEID_FE2500/


67771 28-Oct-2000 wpaul

Add PCI IDs for some additional cardbus cards. Yes, there really is
a RealTek 8139 cardbus device. Unfortunately it doesn't quite work yet
because the CIS parser barfs on it.

Submitted by msmith, with some small tweaks by me.


67763 28-Oct-2000 msmith

Allow PCI busses to be connected to host bridges detected by ACPI as well.


67708 27-Oct-2000 phk

Convert all users of fldoff() to offsetof(). fldoff() is bad
because it only takes a struct tag which makes it impossible to
use unions, typedefs etc.

Define __offsetof() in <machine/ansi.h>

Define offsetof() in terms of __offsetof() in <stddef.h> and <sys/types.h>

Remove myriad of local offsetof() definitions.

Remove includes of <stddef.h> in kernel code.

NB: Kernelcode should *never* include from /usr/include !

Make <sys/queue.h> include <machine/ansi.h> to avoid polluting the API.

Deprecate <struct.h> with a warning. The warning turns into an error on
01-12-2000 and the file gets removed entirely on 01-01-2001.

Paritials reviews by: various.
Significant brucifications by: bde


67668 27-Oct-2000 wpaul

Yet another bug fix/optimization for the Davicom DM9100/9102: increase
the PCI latency timer value to 0x80. Davicom's Linux driver does this,
and it drastically reduces the number of TX underruns in my tests. (Note:
this is done only for the Davicom chips. I'm not sure it's a good idea to
do it for all of them.)

Again, still waiting on confirmation before merging to stable.


67595 25-Oct-2000 wpaul

Set the DC_TX_INTR_ALWAYS and DC_TX_STORENFWD flags for the Davicom
DM9100/DM9102 chips. Do not set DC_TX_ONE. The DC_TX_USE_TX_INTR flag
causes dc_encap() to set the 'interrupt on TX completion' bit only
once every 64 packets. This is an attempt to reduce the number
of interrupts generated by the chip. You're supposed to get a 'no more
TX buffers left' interrupt once you hit the last packet whether you
ask for one or not, however it seems the Davicom chip doesn't generate
this interrupt, or at least it doesn't generate it under the same
circumstances. The result is that if you transmit n packets, where
n is less than 64, and then wait 5 seconds, you'll get a watchdog
timeout whether you want one or not. The DC_TX_INTR_ALWAYS causes
dc_encap() to request an interrupt for every frame.

I'm still waiting on confirmation from a couple of users to see if this
fixes their problems with the Davicom DM9102 before I merge this into
-stable, but this fixed the problem for me in my own testing so I'm
willing to make the change to -current right away.


67594 25-Oct-2000 wpaul

Add a missing SK_UNLOCK() to sk_attach_xmac().


67549 25-Oct-2000 mjacob

Whoops! Forgot to commit this when I committed the other (turnin on locks)
change. Sorry about that.


67440 22-Oct-2000 phk

Make LINT compile again.


67427 22-Oct-2000 imp

Make usual 1-line cardbus support modification.

I'm committing this over an Intel PRO-100 CardBus II card.


67405 21-Oct-2000 bmilekic

(Introduce something sitting in my repo for 3 weeks now...)

Have if_ti stop "hiding" the softc pointer in the buffer region. Rather,
use the available void * passed to the free routine and pass the softc
pointer through there.

To note: in MEXTADD(), TI_JUMBO_FRAMELEN should probably be TI_JLEN. I left it
unchanged, because this way I'm sure to not damage anything in this respect...


67389 20-Oct-2000 jon

remove old pccbb bridge code.
(argh, I thought I already did this in the original commmit)


67380 20-Oct-2000 archie

Add actual URL for XMAC II datasheet in comments.


67379 20-Oct-2000 ache

Add i815 host to PCI bridge ID


67376 20-Oct-2000 ache

Add i815 IDs


67365 20-Oct-2000 jhb

Catch up to moving headers:
- machine/ipl.h -> sys/ipl.h
- machine/mutex.h -> sys/mutex.h


67363 20-Oct-2000 jhb

Remove unnecessary machine/mutex.h include.


67314 19-Oct-2000 jon

NEWCARD/Cardbus -

This commit adds support for Xircom X3201 based cardbus cards.
Support for the TDK 78Q2120 MII is also added.
IBM Etherjet, Intel and Xircom cards uses these chips.

Note that as a result of this commit, some Intel/DEC 21143 based cardbus
cards will also attach, but not get link. That is being looked at.


67312 19-Oct-2000 msmith

Write the routed interrupt back to PCI configuration space.


67295 18-Oct-2000 peter

This didn't compile. Fix typo: s/rmang_get_start/rman_get_start/


67268 18-Oct-2000 mdodd

Use appropriate resource management accessors instead of directly
referencing structure members.

Use rman_get_size() instead of end - start + 1.


67233 16-Oct-2000 imp

Add support for cardbus card's chips. This will make the 3c575 cards
work once the rest of the cardbus infrastructure has been committed.

Submitted by: Jonathan Chen <jon@spook.org>


67232 16-Oct-2000 mjacob

Very early and very *very* lightly tested support for LIVENGOOD chipset
(followon to WISEMAN). Presumably some flavors are also no multimode copper
as well.


67231 16-Oct-2000 imp

When wierdreset flag is set, turn on the DISADVFD flag when we reset
rather than all the flags. This prevents setting being read from ROM,
which is a problem. If this breaks anything, it will only break the
3C556B cards minipci cards, which mainly exist at rpi as far as rpi
has been able to tell.

Submitted by: Louis Gerbarg <gerbal@rpi.edu>


67222 16-Oct-2000 imp

Forgot to commit this last night.

Define interrupt routing method.

Submitted by: msmith


67219 16-Oct-2000 wpaul

Remove an errant splimp() that I missed when I went through this driver
the first time.


67205 16-Oct-2000 gallatin

The previous commit broke kernel builds on alpha (and probably ia64).
#ifdef away the offending code until somebody with more newbus fu than
me can figure out where to put a default function that returns 255
without touching each alpha chipset driver..


67197 16-Oct-2000 ru

Added support for i815.


67184 16-Oct-2000 imp

When a pci device hasn't had an interrupt routed to it (signified by
the intline of 255) go ahead and route the interrupt when we allocate
an interrupt.

Submitted by: msmith


67177 15-Oct-2000 wpaul

Fix one instance of XL_LOCK() that should have been XL_UNLOCK(). After
doing this so many times, I guess I was entitled to at least one typo.
Thanks to all who spotted this.


67164 15-Oct-2000 phk

Remove unneeded #include <machine/clock.h>


67125 14-Oct-2000 alc

Recognize the ServerWorks IB6566 south bridge.


67102 14-Oct-2000 wpaul

Clean up a few things in dc_setcfg() pointed out to be me by
aaron@openbsd.com on IRC earlier today.


67090 13-Oct-2000 cp

Make mutex name reflect device driver name.
Destroy mutex when detaching the device.
Submitted by: John Baldwin <jhb@FreeBSD.ORG>


67089 13-Oct-2000 wpaul

Use device_get_nameunit(dev) as the mutex string when calling
mtx_init() instead of hard-coded string constant. Also remember to do
the mutex changes to the ste driver, which I forgot in the first commit.


67087 13-Oct-2000 wpaul

First round of converting network drivers from spls to mutexes. This
takes care of all the 10/100 and gigE PCI drivers that I've done.
Next will be the wireless drivers, then the USB ones. I may pick up
some stragglers along the way. I'm sort of playing this by ear: if
anyone spots any places where I've screwed up horribly, please let me
know.


66997 12-Oct-2000 bmilekic

Make if_sk stop using the "hide the softc structure in the jumbo buffer"
now that the mbuf system can handle passing it to the driver itself.

Reviewed by: wpaul
Tested by: wpaul (Bill Paul) with "jumbograms" enabled


66842 09-Oct-2000 msmith

Validate the PCI bus number that we fetch from our parent, since there's no
guarantee that everything attached to *it* is a PCI bus.


66771 06-Oct-2000 wpaul

When leaving suspend mode after enabling/disabling the promisc mode bit,
make sure the chip is restarted by issuing a start command to the command
register. Sometimes the receiver doesn't restart after leaving suspend
mode.


66690 05-Oct-2000 wpaul

Add the card ID for the Am79c975 PCnet/FAST III card. This is a variant
of the Am79c973 with "AlertIT Technology," whatever that is. Also mention
support for the PCnet/FAST III cards in the documentation. The
PCnet/FAST III chips have integrated 10/100 PHYs.


66684 05-Oct-2000 jhb

- Add another PCI Id for a Lucent Win Modem.
- Change the chip description to use mixed-case so it is consistent and
doesn't yell at the user during boot.


66681 05-Oct-2000 wpaul

Add support for parsing the media blocks from the SROM on 21143
adapters. This is necessary in order to make this driver work with
the built-in ethernet on the alpha Miata machines. These systems
have a 21143-PC chip on-board and optional daughtercards with either
a 10/100 MII transceiver or a 10baseT/10base2 transceiver. In both
cases, you need to twiddle the GPIO bits on the controller in order
to turn the transceivers on, and you have to read the media info
from the SROM in order to find out what bits to twiddle.


66615 04-Oct-2000 jasone

Convert lockmgr locks from using simple locks to using mutexes.

Add lockdestroy() and appropriate invocations, which corresponds to
lockinit() and must be called to clean up after a lockmgr lock is no
longer needed.


66592 03-Oct-2000 wpaul

Add support for the AMD Am79c976 PCnet/PRO controller chip. For now
this just involves adding the chip ID to the supported list: the PCnet/PRO
is compatible with the PCnet/FAST+ and friends and should "just work"
with this driver.

Also try to handle mbuf allocation failures in the receive handler
more gracefully.


66515 02-Oct-2000 archie

Add definition for PCIS_SERIALBUS_SMBUS PCI device subclass.
Remove cut & paste leftovers.


66467 29-Sep-2000 jhb

Recognize the ATI Rage128-LF Mobility AGP video adapter.


66466 29-Sep-2000 jhb

Spelling police in a comment: Defalut -> Default.


66416 28-Sep-2000 peter

Get out the roto-rooter and clean up the abuse of nexus ivars by the
i386/isa/pcibus.c. This gets -current running again on multiple host->pci
machines after the most recent nexus commits. I had discussed this with
Mike Smith, but ended up doing it slightly differently to what we
discussed as it turned out cleaner this way. Mike was suggesting creating
a new resource (SYS_RES_PCIBUS) or something and using *_[gs]et_resource(),
but IMHO that wasn't ideal as SYS_RES_* is meant to be a global platform
property, not a quirk of a given implementation. This does use the ivar
methods but does so properly. It also now prints the physical pci bus that
a host->pci bridge (pcib) corresponds to.


66281 23-Sep-2000 jasone

Don't #include <sys/proc.h>, since machine/mutex.h does it now.


66277 22-Sep-2000 ps

Remove the NCPU, NAPIC, NBUS, NINTR config options. Make NAPIC,
NBUS, NINTR dynamic and set NCPU to a maximum of 16 under SMP.

Reviewed by: peter


66210 22-Sep-2000 wpaul

Typo in comment (decent performances -> decent performance).


66208 22-Sep-2000 wpaul

Make pcn_miibus_readreg() latch onto the first PHY that it finds (as
a result of mii_phy_probe()) and use that rather than hardcoding a
constant. The hardcoded way was too specific to the particular card
I had and caused PHY probing to fail on at least one laptop with a
built-in AMD chip.

Reported by: rjk@grauel.com (Richard J Kuhns)


66189 21-Sep-2000 mjacob

some copyright cleanups


66188 21-Sep-2000 wpaul

Add the PCI device ID for the on-board ethernet controllers on the
Intel 815E motherboard, which I believe is an i82562. Seems to work
just fine with the fxp driver.


66132 20-Sep-2000 wpaul

Remove one debug line that snuck in by accident.


66131 20-Sep-2000 wpaul

Add a new driver for the AMD PCnet/FAST, FAST+ and Home PCI adapters.
Previously, these cards were supported by the lnc driver (and they
still are, but the pcn driver will claim them first), which is fine
except the lnc driver runs them in 16-bit LANCE compatibility mode.
The pcn driver runs these chips in 32-bit mode and uses the RX alignment
feature to achieve zero-copy receive. (Which puts it in the same
class as the xl, fxp and tl chipsets.) This driver is also MI, so it
will work on the x86 and alpha platforms. (The lnc driver is still
needed to support non-PCI cards. At some point, I'll need to newbusify
it so that it too will me MI.)

The Am79c978 HomePNA adapter is also supported.


66107 20-Sep-2000 sos

Clean up the VIA id's a bit and add the K[TX]133 chipsets


66089 20-Sep-2000 wpaul

If this is a Davicom DM9102A and we're enabling the homePNA link, force
dc_link to 1 and don't activate the tick routine. Without this, dc_start()
always thinks the link is down and never transmits in homePNA mode.


66045 18-Sep-2000 dg

Removed NetBSD support, which bit-rotted long ago.
Changed new SMP locking macros given the new situation.


66011 17-Sep-2000 dg

Added a couple more missing FXP_SPLVAR()'s.


66010 17-Sep-2000 dg

As a minor optimization, do suspended checking more like it was originally
in the PR - before the while loop.


66009 17-Sep-2000 dg

Added missing FXP_SPLVAR() to fxp_intr().


66008 17-Sep-2000 dg

Attempt to replicate the new fxp SMP locking in the changes committed
in the previous (APM suspend/resume) commit.


66007 17-Sep-2000 dg

Added support for APM suspend/resume.

PR: 18756
Submitted by: mike ryan <msr@elision.org>, with modifications by me.


66006 17-Sep-2000 cp

Add include of proc.h to make compile without SMP defined. This
change is likely interm, the include happens automagically
when SMP is defined.

Obtained from: Jason Evans.


65983 17-Sep-2000 cp

Add locking to make able to run without the Giant lock being held. This
is enabling as all entries are still called with Giant being held.
Maintaining compatability with NetBSD makes what should be very simple
kinda ugly.

Reviewed by: Jason Evans


65944 16-Sep-2000 gibbs

Add PCIM_CMD_MWRICEN, the bit in the command register in PCI space
that enables memory write and invalidate cycles on a bus master.


65930 16-Sep-2000 phk

Make LINT compile again.


65822 13-Sep-2000 jhb

- Remove the inthand2_t type and use the equivalent driver_intr_t type from
newbus for referencing device interrupt handlers.
- Move the 'struct intrec' type which describes interrupt sources into
sys/interrupt.h instead of making it just be a x86 structure.
- Don't create 'ithd' and 'intrec' typedefs, instead, just use 'struct ithd'
and 'struct intrec'
- Move the code to translate new-bus interrupt flags into an interrupt thread
priority out of the x86 nexus code and into a MI ithread_priority()
function in sys/kern/kern_intr.c.
- Remove now-uneeded x86-specific headers from sys/dev/ata/ata-all.c and
sys/pci/pci_compat.c.


65588 07-Sep-2000 mjacob

Per msmith's request, don't attach to Qlogic 12160 id'd cards that have
a certain SubVendorID.


65584 07-Sep-2000 wpaul

Special-case the LED twiddling code so that it doesn't do anything
on the NEC VersaPro NoteBook PC. This 21143 implementation has no LEDs,
and flipping the LED control bits somehow stops it from establishing
a link. We check the subsystem ID and don't flip the LED control
bits for the NEC NIC.


65557 07-Sep-2000 jasone

Major update to the way synchronization is done in the kernel. Highlights
include:

* Mutual exclusion is used instead of spl*(). See mutex(9). (Note: The
alpha port is still in transition and currently uses both.)

* Per-CPU idle processes.

* Interrupts are run in their own separate kernel threads and can be
preempted (i386 only).

Partially contributed by: BSDi (BSD/OS)
Submissions by (at least): cp, dfr, dillon, grog, jake, jhb, sheldonh


65491 05-Sep-2000 phk

Register resources in a more opportune order for the hardware.


65458 05-Sep-2000 peter

Add compaq hotplug PCI device id.
Tidy up some loose ends. Be a little more consistent how the ign driver
probes with the rest of the drivers in this file.


65457 05-Sep-2000 peter

When dumping the 'found devices' list in verbose mode, actually show the
bus/slot/function numbers. The old PCI code used other markers or
something, but without it here under the new pci code it is very hard to
tell which device is which (this only affects bootverbose mode).


65399 03-Sep-2000 peter

Fix pci-pci bridges (I hope).
In the nexus case, there are no ivars for children of nexus devices,
and we were passing data in from before the device existed, hence ivars
are convenient as the softc doesn't really exist yet.
However, for pci->pci bridges, the pcib occupies a pci device itself,
which *does* already have ivars. However, softc is available and stable
at this point since we've been identified and are locating the bus during
attach. So, use softc for this version of pcib devices for storing the
physical bus number in.


65350 02-Sep-2000 wpaul

Define some more bits in CSR15 needed for previous change.


65349 01-Sep-2000 wpaul

Make the blinkylights on non-MII 21143 cards work. We need to enable
the link and activity LED control bits in CSR15 in order for the
controller to drive the LEDs correctly. This was largely done for the
ZNYX multiport cards, but should also work with the DEC DE500-BA
and other non-MII cards.


65347 01-Sep-2000 msmith

If a base address register has been set up by the BIOS, but the relevant
enable bit hasn't been set in the command register, set the bit and
honour the register. It seems that quite a few lazy BIOS writers
aren't bothering to do this, which upsets the existing code and causes
us to miss out on properly-configured devices.


65304 31-Aug-2000 peter

Take a shot at fixing multiple pci busses on i386.
pcib_set_bus() cannot be used on the new child because it is
meant to be used on the *pci* device (it looks at the parent internally)
not the pcib being added. Bite the bullet and use ivars for the bus
number to avoid any doubts about whether the softc is consistant between
probe and attach. This should not break the Alpha code.


65299 31-Aug-2000 peter

Remove duplicate static definition of pci_devclass


65242 30-Aug-2000 imp

Add a detach method to allow this device to be unloaded.


65191 29-Aug-2000 imp

Add TI-1031 id. It doesn't work yet, but it is nice to have it.
These were on cards that were pci pccard (not cardbus) bridges that
lived in SparcUltras that picked up on ebay.


65176 28-Aug-2000 dfr

* Completely rewrite the alpha busspace to hide the implementation from
the drivers.
* Remove legacy inx/outx support from chipset and replace with macros
which call busspace.
* Rework pci config accesses to route through the pcib device instead of
calling a MD function directly.

With these changes it is possible to cleanly support machines which have
more than one independantly numbered PCI busses. As a bonus, the new
busspace implementation should be measurably faster than the old one.


65170 28-Aug-2000 wpaul

Add support for the 3Com 556 and 556B mini-pci adapters used on some
laptops. I've checked that this still works with the other cards and
it works with the 3c556 that I have access to, but I want to check that
it works with the 556B mentioned in PR #20878 before I close out the PR
and merge to -stable.


65141 27-Aug-2000 mjacob

remove clause 3 licence


65070 25-Aug-2000 kuriyama

Correct messages for VIA Apollo Pro133A.


64963 22-Aug-2000 wpaul

Fix up the sis driver, largely to improve the NatSemi DP83815 support:

- Modify the driver to poll the link state and positively set the
MAC to full or half duplex as needed. Previously, it was possible
for the MAC to remain in half duplex even though the PHY had negotiated
full duplex with its link partner, which would result in bursty
performance.

- Program some of the NatSemi's registers as specified by the datasheet.
The manual says these are necessary for "optimum perofrmance," though
a couple of them are marked as reserved in the register map. *shrug*

- Select the TX DMA burst size correctly for 10 and 100mbps modes.
Previously I was using 64 bytes in both modes, which worked in
100mbps mode, but resulting in spotty performance in 10mbps.
32 bytes works much better; without this change, the natsemi
chip yields piss poor performance at 10mbps.

With these fixes, the NatSemi chip finally performs to my satisfaction.
I should be merging the support for this controller into -stable shortly.

Phew.


64837 19-Aug-2000 dwmalone

Replace the mbuf external reference counting code with something
that should be better.

The old code counted references to mbuf clusters by using the offset
of the cluster from the start of memory allocated for mbufs and
clusters as an index into an array of chars, which did the reference
counting. If the external storage was not a cluster then reference
counting had to be done by the code using that external storage.

NetBSD's system of linked lists of mbufs was cosidered, but Alfred
felt it would have locking issues when the kernel was made more
SMP friendly.

The system implimented uses a pool of unions to track external
storage. The union contains an int for counting the references and
a pointer for forming a free list. The reference counts are
incremented and decremented atomically and so should be SMP friendly.
This system can track reference counts for any sort of external
storage.

Access to the reference counting stuff is now through macros defined
in mbuf.h, so it should be easier to make changes to the system in
the future.

The possibility of storing the reference count in one of the
referencing mbufs was considered, but was rejected 'cos it would
often leave extra mbufs allocated. Storing the reference count in
the cluster was also considered, but because the external storage
may not be a cluster this isn't an option.

The size of the pool of reference counters is available in the
stats provided by "netstat -m".

PR: 19866
Submitted by: Bosko Milekic <bmilekic@dsuper.net>
Reviewed by: alfred (glanced at by others on -net)


64547 11-Aug-2000 wpaul

Fix a bug brought to light by the people working on SMPng. I don't quite
understand exactly what it is about SMPng that tickles this bug. What I
do know is that the foo_init() routine in most drivers is often called
twice when an interface is brought up. One time is due to the ifconfig(8)
command calling the SIOCSIFFLAGS ioctl to set the IFF_UP flag, and another
is probably due to the kernel calling ifp->if_init at some point. In any
case, the SMPng changes seem to affect the timing of these two events in
such a way that there is a significant delay before any packets are sent
onto the wire after the interface is first brought up. This manifested
itself locally as an SMPng test machine which failed to obtain an address
via DHCP when booting up.

It looks like the second call to fxp_init() is happening faster now than
it did before, and I think it catches the chip while it's in the process
of dealing with the configuration command from the first call. Whatever
the case, a FXP_CSR_SCB_CNA interrupt event is now generated shortly after
the second fxp_init() call. (This interrupt is apparently never generated
by a non-SMPng kernel, so nobody noticed.)

There are two problems with this: first, fxp_intr() does not handle the
FXP_CSR_SCB_CNA interrupt event (it never tests for it or does anything
to deal with it), and second, the meaning of FXP_CSR_SCB_CNA is not
documented in the driver. (Apparently it means "command unit not active.")
Bad coder. No biscuit.

The fix is to have the FXP_CSR_SCB_CNA interrupt handled just like the
FXP_SCB_STATACK_CXTNO interrupt. This prevents the state machine for
the configuration/RX filter programming stuff from getting wedged for
several seconds and preventing packet transmission.

Noticed by: jhb


64347 07-Aug-2000 wpaul

Close PR 20438. Make fix for preserving LED settings conditional on
presence Intel 21143 chip.


64191 03-Aug-2000 sanpei

Add the ESS Solo-1 to generic chip match.

Solo-1 Datasheet(vendor/device info at P.33)
http://www.alsa-project.org/alsa/ftp/manuals/ess/DsSolo1.pdf


64139 02-Aug-2000 wpaul

Add support for the Netgear GA620T copper gigabit card.


64137 02-Aug-2000 wpaul

Add call to bus_generic_attach() at the end of sk_attach(). It turns out that
if you kldload this driver, all the subordinate devices are probed/attached
as expected. But this is not the case when the driver is statically compiled
into the kernel. Since I do most of my testing with modules, I failed to
notice this. I'm not sure if it's intended behavior or not. I think it may
be, but it seems a little counter-intuitive.


64134 02-Aug-2000 wpaul

Grrrr. Add definition for DC_WDOG_CTLWREN. I made this change yesterday
but stupidly only commited to if_dc.c.


64107 01-Aug-2000 wpaul

Apply patch supplied by John Hood <jhood@sitaranetworks.com> to fix problems
with LEDs on some cards being stomped on when clearing the "jabber disable"
bit. Using DC_SETBIT() has an unwanted side effect of setting a write enable
bit in the watchdog timer register which we really want to be cleared when
we do a write.


64086 01-Aug-2000 mjacob

Part of major rewrite for core version 2.0- clarification of
mdvec structure, removal of printf/CFGPRINTF in place of isp_prt
calls. Parameterization of RQUEST_QUEUE_LEN/RESULT_QUEUE_LEN.


63985 28-Jul-2000 peter

"Fix" cast qualifier warnings using the uintptr_t intermediate trick.


63911 27-Jul-2000 asmodai

Document the 0x12258086 PCI id.
This is in fact an Intel Orion chipset (82454KX/GX) which has been used
in HP NetServer's LS4 range.
HP Probably relabeled the DID. That's the only explanation I can find
plausible to this `mystery'.


63901 26-Jul-2000 wpaul

Use a custom Tigon 2 firmware image, hopefully temporarily. This is
the 12.4.11 firmware with a few changes to the link handling code merged
in from the 12.4.13 release. I'm doing this because the 12.4.13 firmware
doesn't seem to handle 10/100 link settings properly on 1000baseT cards.
Note that the revision codes still identify the firmware as 12.4.13
because both ti_fw2.h and ti_fw.h have to have the same revision values,
and I wanted to keep the 12.4.13 firmware for Tigon 1 cards.

It's nice to have firmware source.


63702 20-Jul-2000 wpaul

Tweak probe message so that 1000baseSX and 1000baseT cards are
explicitly identified.


63699 20-Jul-2000 wpaul

Update the Tigon driver to support 1000baseTX gigE over copper AceNIC
cards. This basically involves switching to the 12.4.13 firmware, plus
a couple of minor tweaks to the driver.

Also changed the jumbo buffer allocation scheme just a little to avoid
'failed to allocate jumbo buffer' conditions in certain cases.


63525 19-Jul-2000 gallatin

Fix an alpha-only race which causes the transmit side of the chip to
lock up under moderate to heavy load.

The status & command fields share a 32-bit longword. The programming
API of the eepro apparently requires that you update the command field
of a transmit slot that you've already given to the card. This means
the card could be updating the status field of the same longword at
the same time. Since alphas can only operate on 32-bit chunks of
memory, both the status & command fields are loaded from memory &
operated on in registers when the following line of C is executed:

sc->cbl_last->cb_command &= ~FXP_CB_COMMAND_S;

The race is caused by the card DMA'ing up the status at just the wrong
time -- after it has been loaded into a register & before it has been
written back. The old value of the status is written back, clobbering
the status the card just DMA'ed up. The fact that the card has sent
this frame is missed & the transmit engine appears to hang.

Luckily, as numerous people on the freebsd-alpha list pointed out, the
load-locked/store-conditional instructions used by the atomic
functions work with respect changes in memory due to I/O devices. We
now use them to safely update the command field.

Tested by: Bernd Walter <ticso@mail.cicely.de>


63380 18-Jul-2000 mjacob

Keep interrupts blocked for all of isp_pci_attach. Redo DMA routines
for target mode for cleanliness and accuracy.


63326 17-Jul-2000 wpaul

Add the PCI IDs for the Macronix 98727 and 98732 parts. These are
3.3volt PCI/cardbus chipsets similar to the 98715 (and they have
512-bit hash tables). Also update the man page to mention the 98727/98732
and the SOHOware SFA110A Rev B4 card with the 98715AEC-C chip.


63229 15-Jul-2000 wpaul

Apply patch to the dc driver to handle Macronix MX98715AEC-C/D/E chips,
which differ slightly from the Macronix MX98715AEC chip on the sample
adapter that I have in that the multicast hash table is only 128 bits
wide instead of 512. New adapters are popping up with this chip, and
due to improper handling of the smaller hash table, broadcast packets
were not being received correctly.


63166 14-Jul-2000 wpaul

Close PR# 19904: remember to call sf_setmulti() when initializing the
interface so the multicast filter will be programmed correctly.


63103 14-Jul-2000 wpaul

sis_miibus_writereg() was checking for SIS_TYPE_900 and phy != 0 twice
due to a small cut & paste-o on my part. It happens this didn't hurt
anything, but it's still wrong.


63090 13-Jul-2000 archie

Make all Ethernet drivers attach using ether_ifattach() and detach using
ether_ifdetach().

The former consolidates the operations of if_attach(), ng_ether_attach(),
and bpfattach(). The latter consolidates the corresponding detach operations.

Reviewed by: julian, freebsd-net


63010 12-Jul-2000 dfr

Add support for Intel's i810 chipset with integrated graphics. An
associated patch to XFree86 allows the X server to work with this chipset
on FreeBSD. Additional work will include porting the Linux 3D driver.

Submitted by: Ruslan Ermilov <ru@FreeBSD.org>


62924 10-Jul-2000 phk

Newbusify this driver at an expense of 40 extra lines of code.


62832 09-Jul-2000 mjacob

Thanks for Andrew Gallatin pointing out that freeing contigmalloc'd
items via free is bad.


62793 08-Jul-2000 gallatin

use contigfree() rather than free() to free memory allocated with
contigmalloc().

reviewed by: wpaul


62681 06-Jul-2000 wpaul

Fix a minor bug in the MAC address unscrambling code.
(Some shift rights should have been shift lefts.)


62672 06-Jul-2000 wpaul

Add support for the National Semiconductor DP83815 fast ethernet
controller chip. This chip is currently being used on the NetGear
FA312-TX adapter, which I guess is a replacement for the FA310-TX
(PNIC-based).

I added support for this chip by modifying the sis driver since
the SiS 900 and the NS DP83815 have almost the same programming
interface (the RX filter programming and PHY access methods are
different, but the general configuration, DMA scheme and register
layout are identical).

I would have had this done a lot sooner, but getting the damn MAC
address out of the EEPROM proved to be more complicated than expected.


62653 05-Jul-2000 wpaul

Close PR# 19617: add support for VIA VT6102 NICs to VIA Rhine driver.


62493 04-Jul-2000 mjacob

Change startup locking. Use new isp_handle_index function
for indexing off of handles to get dma maps.


62467 03-Jul-2000 phk

Account for packets we clean out when we disconnect.


62183 27-Jun-2000 alfred

use warnings
use strict
add 'usage'


62045 25-Jun-2000 mjacob

If swdpio1 doesn't clear, we have a reversed (or disconnected) cable. Change
the message to indicate that it could also be a disconnected cable, and
return okay from wx_hw_intialize *anyway*. This allows us to contineu to
set the station address and when we do get link up, we're ready to roll.


61906 21-Jun-2000 semenu

Added support for SMC9432BTX cards.


61820 19-Jun-2000 dg

Implemented some optimizations which result in 14 fewer instructions in the
receive path.


61801 18-Jun-2000 dg

Added support for the i82559ER (10/100Mbps NIC for embedded applications).

Product device ID provided by: Les Biffle <les@ns3.safety.net>


61785 18-Jun-2000 mjacob

Clean up firmware load issues and remove darn near all config options.
Force alphas to prefer mem mapping as the default.

Basically, we have a pointer to a function which we can call which will
return us a pointer to firmware for the card we have. We call this function
(if it's non-NULL) with the address of our mdvec f/w pointer.

The way this works is that if ispfw (as a module or a static) is loaded,
it initializes the pointer in isp_pci, so we can call into to it to fetch
a pointer to a f/w set.

If ispfw is MOD_UNLOADed, it's retained a pointer to our mdvec f/w pointers,
which then get zeroed out so we don't have any references to data that's
now gone from kernel memory. Removing the f/w saves ~360KBytes.

Alas, there is no autounload mechanism that works for is here.


61721 16-Jun-2000 mjacob

Fix this driver to (finally) work with switches. Some more black
magic from the linux driver.


61545 11-Jun-2000 asmodai

Add support for the Accton EN1217.

PR: 18735
Submitted by: Adoal Xu <adoal@iname.com>


61503 10-Jun-2000 dfr

Release resources properly in detach.


61501 10-Jun-2000 dfr

Fix the AMD 751 AGP minidriver so that it works with my test code.


61452 09-Jun-2000 dfr

A driver for programming the AGP hardware. This is only very lightly
tested on Intel BX chipsets only. The other agp minidrivers are totally
untested.

The programming api is a subset of the Linux api and is only intended to
be enough for the X server to use. There is also an in-kernel api for the
use of other kernel modules such as the 3D DRI.


61451 09-Jun-2000 dfr

Nuke the useless chip driver. It gets in the way when you want to load
a functional driver for the device.


61363 07-Jun-2000 wpaul

When I tweaked if_dc.c to alter the polling interval for non-MII
21143 chips, I accidentally removed the DC_MII_REDUCED_POLL flag
for all 21143 cards. This caused problems with timer-instigated
TCP retransmits, which happened to occur at the same time as an
MII poll tick on MII-based cards (e.g. D-Link DFE-570TX). Fixed this,
plus made some other cleanups. The autoneg fixes for the non-MII
cards still work. Also tested the PNIC II now that I have one again.


61317 06-Jun-2000 wpaul

- Call mii_pollstat() after we bring up the link on a 1000baseTX card
after autoneg so we make sure to set the link state and duplex mode
correctly.
- Make sure to set the 'ignore pause frames' bit on the XMAC.
- Small linewrap fix.


61110 31-May-2000 wpaul

Rework the support for the internal autonegotiation on the 21143 and
workalike chips (Macronix 98713A/98715 and PNIC II). Timing is somewhat
critical: you need to bring the link as soon as possible after NWAY
is done, and the old one second polling interval was too long. Now
we poll every 10th of a second until NWAY completes (at which point
we return to the 1 second interval again to keep an eye on the link
state).

I tested all the other cards I had on hand to make sure I didn't bust
any of them and they seem to work (including the MII-based 21143 card).
This should fix some autoneg problems with DE500-BA cards and the
built-in 10/100 ethernet on some alpha systems.

(Now before anyone asks why I never noticed this before, the old code
worked just find with the Intel swich I used for testing back in NY.
Apparently not all switches are as picky about the timing.)


61047 28-May-2000 peter

Encapsulate the old PCI compatability support and APIs completely under
"options COMPAT_OLDPCI". This option already existed, but now also tidies
up the declarations in #include <pci/pci*.h>. It is amazing how much stuff
was using the old pre-FreeBSD 3.x names and going silently undetected.


61046 28-May-2000 peter

Make this compile without depending on the FreeBSD 2.2 compatability
defines.


61043 28-May-2000 peter

Do not depend on FreeBSD 2.2 compatability defines.
s/PCI_MAP_REG_START/PCIR_MAPS/


61042 28-May-2000 peter

Fix some leakage from inside #ifdef PCI_COMPAT (the FreeBSD 2.2 compat
stuff).


61041 28-May-2000 peter

Use the correct register name. s/PCI_COMMAND_STATUS_REG/PCIR_COMMAND/


61040 28-May-2000 peter

Use the correct name for the PCI command register (PCIR_COMMAND). Don't
use constant that used to be a variable in our (very) old pci code.


61039 28-May-2000 peter

Use the correct register names. s/PCI_COMMAND_STATUS_REG/PCIR_COMMAND/


61001 28-May-2000 peter

ncr.c is no longer a COMPAT_OLDPCI device - remove the warning.


60974 27-May-2000 dfr

Update to use newbus and busspace.


60938 26-May-2000 jake

Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by: msmith and others


60862 24-May-2000 kuriyama

Add OPTi 82C700 chipset.

Submitted by: sanpei@sanpei.org
PR: kern/18155 (part of)


60847 24-May-2000 kuriyama

Add 440MX chipset.

Submitted by: YOSHIMURA Hideaki <hideakiy@cs-tokyo01.chuosystem.co.jp>
References: [bsd-nomads:13764]


60837 24-May-2000 archie

Avoid double-call to bpf_mtap(). This is now handled in ether_input().


60833 23-May-2000 jake

Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by: phk
Reviewed by: phk
Approved by: mdodd


60769 22-May-2000 imp

It turns out that I was wrong. The chip in my machine is not a
CXD1847A, but a CXD1947A. I checked by visual inspection after
prompting from onoe-san.


60768 22-May-2000 kuriyama

CXD1847A and CXD1947A have same product ID.

Approved by: imp (original CXD1847A addition)


60686 18-May-2000 dfr

Print the correct value for the map type on a verbose boot.

PR: kern/18662
Submitted by: tamaru@ap.t.u-tokyo.ac.jp


60555 14-May-2000 paul

Remove if_pci_p.c from old location.


60536 14-May-2000 archie

Move code to handle BPF and bridging for incoming Ethernet packets out
of the individual drivers and into the common routine ether_input().
Also, remove the (incomplete) hack for matching ethernet headers
in the ip_fw code.

The good news: net result of 1016 lines removed, and this should make
bridging now work with *all* Ethernet drivers.

The bad news: it's nearly impossible to test every driver, especially
for bridging, and I was unable to get much testing help on the mailing
lists.

Reviewed by: freebsd-net


60528 13-May-2000 dfr

Use bus_space for all register accesses.


60403 11-May-2000 jhb

Only display the 'Disable PNP-OS BIOS option' message on the i386 arch.
Alpha's don't have a PNP BIOS option.

Reviewed by: n_hibma


60191 07-May-2000 n_hibma

Do the attach (and detach) properly. Store the cookies.

This is a first step to make usb unloadable.


60116 07-May-2000 mjacob

Update 'hose' (actually, MCPCIA instance #) for Alpha Rawhide systems.
We have *got* to fix this bogosity of trying to steal part of the PCI
address space for this stuff.


60102 06-May-2000 jlemon

Bounce a copy of the mbuf to the bpf listener when we submit the frames
for transmit to the adapter, not when we receive a transmit interrupt
indicating that they were sent. This fix now allows tcpdump to produce
sane results by recording the timestamp at the point where the mbuf was
actually transmitted.


60043 05-May-2000 wpaul

Apply patch to rl_rxeof() to really enforce payload alignment in
the case where we receive a packet that wraps from the end of the
RX buffer back to the start. This fixes an unaligned access trap on
the alpha with NFS.


60041 05-May-2000 phk

Separate the struct bio related stuff out of <sys/buf.h> into
<sys/bio.h>.

<sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall
not be made a nested include according to bdes teachings on the
subject of nested includes.

Diskdrivers and similar stuff below specfs::strategy() should no
longer need to include <sys/buf.> unless they need caching of data.

Still a few bogus uses of struct buf to track down.

Repocopy by: peter


59874 01-May-2000 peter

Add $FreeBSD$


59783 30-Apr-2000 bde

Fixed the type of some ivar access functions. Ivars have type uintptr_t,
not u_long. On i386's with 64-bit longs, returning u_longs indirectly
in (more than) the space reserved for uintptr_t's tended to corrupt the
previous frame pointer in the stack frame, so it was not easy to debug.
The type mismatches are hidden by the bogus cast in DEVMETHOD().


59759 29-Apr-2000 peter

Add a missing MODULE_DEPEND() on miibus.. I was working from
KMODDEPS which this driver didn't have.


59758 29-Apr-2000 peter

Depend on miibus.

Note that if_aue doesn't strictly depend on usb because it uses the
method interface for calls rather than using internal symbols, and
because it's a child driver of usb and therefore will not try and do
anything unless the parent usb code is loaded at some point. if_aue does
strictly depend on miibus as it will fail to link if it is missing.


59728 28-Apr-2000 julian

Two simple changes to the kernel internal API for netgraph modules,
to support future work in flow-control and 'packet reject/replace'
processing modes.

reviewed by: phk, archie


59629 25-Apr-2000 phk

Ignore tulip chips on LanMedia WAN cards.


59605 24-Apr-2000 wpaul

Update the Tigon firmware to 12.3.21. This fixes a few bugs and adds support
for cards with 2MB of on-board SRAM.


59478 22-Apr-2000 wpaul

Reoganize/update the SysKonnect driver:

- Break out the support for the XMAC II's PHY into an miibus driver.

- Reorganize the probe/attach stuff using newbus. Each XMAC is now
attached to the parent GEnesis controller using newbus. This is
necessary since each XMAC must also have an attached miibus, and
the miibus read/write register routines need to be able to get
at the softc struct for each XMAC, not the one for the parent
controller. This allows me to get rid of the grotty code I added
for selecting the unit numbers for the ifnet interfaces: the unit
numbers are now derived from the newbus-assigned unit numbers,
which should track with the ifnet interface numbers. I think.
At the very least, there should never be any collisions.

- Add support for the SK-9821 and SK-9822 1000baseTX adapters. Special
thanks to SysKonnect for loaning me two adapters for testing.


59410 20-Apr-2000 imp

Add TI-1211 chipset from datasheet info


59391 19-Apr-2000 phk

Remove ~25 unneeded #include <sys/conf.h>
Remove ~60 unneeded #include <sys/malloc.h>


59368 18-Apr-2000 phk

Remove unneeded <sys/buf.h> includes.

Due to some interesting cpp tricks in lockmgr, the LINT kernel shrinks
by 924 bytes.


59169 12-Apr-2000 nyan

Set the value of rid variable for bus_alloc_resource(dev, SYS_RES_IOPORT,...)
to PCI_BASE_ADDR0 (== 0x10).

Tested by: Brian Somers <brian@Awfulhak.org>


59164 12-Apr-2000 semenu

Driver is now using miibus, and newbus.

PR: kern/17601


59093 08-Apr-2000 dfr

* Factor out the object system from new-bus so that it can be used by
non-device code.
* Re-implement the method dispatch to improve efficiency. The new system
takes about 40ns for a method dispatch on a 300Mhz PII which is only
10ns slower than a direct function call on the same hardware.

This changes the new-bus ABI slightly so make sure you re-compile any
driver modules which you use.


59083 07-Apr-2000 nyan

Newbusify amd driver.

Some error messages are added by Brian Somers <brian@Awfulhak.org>.


58838 30-Mar-2000 iwasaki

Fix typo in description of Cirrus Logic PD6832 PCI-CardBus Bridge.
This don't hurt anything.
PCI/CardBus Bridge -> PCI-CardBus Bridge

Submitted by: Takeshi Shibagaki <sibagaki@lsi.melco.co.jp>
Obtained from: bsd-nomads ML in Japan


58801 29-Mar-2000 wpaul

Two fixes for the RealTek:

- Only call m_pullup() when necessary.

- Check return value from rl_encap() in rl_start() to avoid panic when
we run out of mbufs. (Fixes PR kern/17582)

PR: kern/17582


58765 29-Mar-2000 cpiazza

Add NVidia GeForce 2 and Quadro 2

Ids and names were taken from nv4_disp.inf in the latest windows drivers.


58715 28-Mar-2000 dg

Added support for cards and on-motherboard NICs that use an SEEPROM
address size that is different than the standard 6bits. This fixes
support for the Compaq NC3121 card, certain newer Intel Pro/100+
cards, and should also fix integrated NICs on SuperMicro and Compaq
motherboards.
The auto-sizing algorithm was taken from NetBSD (thanks!), which I
think got it from Linux originally.
Thanks also to Andrew Sparrow <spadger@best.com> and Joe Moore
<jomor@ahpcns.com> for supplying me with unworking Compaq and Intel
cards to develop and test the fixes with.


58701 27-Mar-2000 imp

Ahhrggg. Put the test for the compat shims AFTER the file that includes
them.

Pointed out by: bde


58700 27-Mar-2000 phk

Allow reuse of hooks.
Remove debugging printfs.
Now compatible with ports/net/mpd-netgraph


58699 27-Mar-2000 imp

This file is obsolete, having long since been copied to sys/dev/adw/adw_pci.c

Pointed out by: gibbs


58698 27-Mar-2000 jlemon

Add support for offloading IP/TCP/UDP checksums to NIC hardware which
supports them.


58695 27-Mar-2000 imp

Per conversations in -current, add #error to these drivers when you don't
have the right compatibility shims enabled. ISA drivers to follow later.


58571 25-Mar-2000 imp

More fully initialize cardbus bridges. We now call the new generic
cardbus bridge init routine for all cardbuses. This routine attempts
to compensate for BIOSes that do not setup the cardbus bridge into
legacy mode. Since this is becoming more common, and cardbus pci
cards have appeared on the market, this makes sense.

Do some TI113x specific initialization. This came in as part of the
patch. Report TI1[1234]XX specific config registers protected by
bootverbose.

Minor code cleanup while I'm here. I've also removed the unused code
present in the original patches, and cleaned it up slightly in places
as well.

The original patches supported more than one card, but these patches
support just one. We should likely revisit this in the future.

This makes the Compaq card that Walnut Creek CD purchased for me work
in my bouncer box.

This is a MFC candidate. However, I'd like to get some airtime on
these patches on as many laptops as possible before doing the MFC. It
does change things somewhat. In theory, apart from the minor TI
tweaks, this shouldn't change anything if the bridge is in legacy mode
already.

Submitted by: sanpei@sanpei.org (MIHIRA Yoshiro)


58567 25-Mar-2000 imp

Two new chips found in Steve Passe's Protoge' laptop:
Lucent 56Flex DVS LTMOTEM (winmodem and unsupported)
Cinemaster C 3.0 DVD Decoder


58533 24-Mar-2000 billf

Add Mach64-LB graphics accelerator

Submitted by: Brandon Martus <bmartus@chc-chimes.com> (unwittingly)
Obtained from: NetBSD (syssrc/sys/dev/pci/pcidevs)


58377 20-Mar-2000 phk

Isolate the Timecounter internals in their own two files.

Make the public interface more systematically named.

Remove the alternate method, it doesn't do any good, only ruins performance.

Add counters to profile the usage of the 8 access functions.

Apply the beer-ware to my code.

The weird +/- counts are caused by two repocopies behind the scenes:
kern/kern_clock.c -> kern/kern_tc.c
sys/time.h -> sys/timetc.h
(thanks peter!)


58339 20-Mar-2000 peter

A fairly simple newbusification of if_de


58332 20-Mar-2000 peter

Unused definitions.


58320 20-Mar-2000 peter

Bandaid for src/sys/modules which broke world


58287 19-Mar-2000 peter

Connect the ISA and PCI compatability shims to an option. In this case
it's options COMPAT_OLDISA and COMPAT_OLDPCI. This is meant to be a
fairly strong incentive to update the older drivers to newbus, but doesn't
(quite) leave anybody hanging with no hardware support. I was talking with
a few folks and I was encouraged to simply break or disable the shims but
that was a bit too drastic for my liking.


58244 18-Mar-2000 n_hibma

Print the PCI resources even if they are disabled. This shows more clearly
when the BIOS is forgetful about initialising the USB controllers.


58186 18-Mar-2000 wpaul

Update Tigon firmware yet again, this time to version 12.3.20.


58124 15-Mar-2000 mjacob

Alpha 8200 port: Until we fix things better, determine which alpha CPU
platform we're running on so we know how many bits to reserve at the top
end for the 'hose' value. It turns out that there's *just* enough room
to support all possible hoses on TurboLaser.
Reviewed by: gallatin@freebsd.org, dfr@free3bsd.org


58121 15-Mar-2000 n_hibma

Add an ID for the SiS 5571.

Remove the unnecessary use of parent.


58112 15-Mar-2000 peter

Remove left over pci_ide* after wd removal.


57967 13-Mar-2000 phk

Updates for new FALC chips and other nits.

(And try to make it first post-freeze commit :-)


57923 12-Mar-2000 cpiazza

Recognize newer NVidia graphics cards. (GeForce and Quadro families)

Approved by: jkh


57901 11-Mar-2000 msmith

Teach the 'dc' driver how to pick up settings left over by the
SRM on alpha systems. This is an expedient if not entirely
elegant solution to the problem.

Submitted by: gallatin
Approved by: jkh


57871 09-Mar-2000 rwatson

Introduce ethernet bridge support for if_dc

Approved by: jkh


57678 01-Mar-2000 phk

Fix a initialization bug.
Report xmit queue length.
Remove old magic and clean up some printfs.


57616 29-Feb-2000 billf

'driver support' -> 'driver supports'


57583 29-Feb-2000 mjacob

Clean up defines for correct 12160/1080 exclusion. Final 4.0.
approved: JKH


57555 28-Feb-2000 bde

Fixed configuration of fast interrupts for the pci cy driver. They were
an early newbus casualty. The fix in rev.1.28 didn't work because the
most important part of it used a wrong macro name.

Approved by: jkh


57519 26-Feb-2000 phk

Implement queue-limiting based on bandwidth.

Approved by: jkh


57392 22-Feb-2000 billf

o No need to print the vendor/device ID for things that matched succesfully.
o ``<device name>'' versus ``device name'' for things that fall under nomatch.

Reviewed by: dfr (in principle)
Approved by: Baron von Hubbard


57382 21-Feb-2000 billf

Add the ESS Maestro and the ATI Mobility-1 to the generic chip match and
the vga match (respectivly, though they aren't much different anymore..)

These can be found on newer Dell laptops.

Approved by: Sir Hubbard


57358 20-Feb-2000 n_hibma

Move the warning on wrong IRQ values to the right place, before any
resource allocation is attempted.

It will present the user with a message that he has to switch on USB
support in his BIOS.


57332 19-Feb-2000 dfr

Remove the vga-pci driver. It serves no purpose and it hides the hardware
from useful drivers such as the 3D DRI drivers I will be porting for
hardware accelerated OpenGL. The hardware will still be reported during
boot using the nomatch system.

Approved by: jkh


57286 17-Feb-2000 imp

Add the VIA 82C596B PCI ISA south bridge on my ASUS P3V133.

Approved by: jkh


57249 16-Feb-2000 mjacob

Include the file that defines PCIM_CMD_BUSMASTEREN.


57248 16-Feb-2000 msmith

Ensure that the busmaster enable bit is set; we can't assume that all
BIOS code will get this right (and some certainly doesn't).

Submitted by: W. Gerald Hicks <jhix@mindspring.com>
Approved by: jkh


57214 15-Feb-2000 mjacob

If the CDB length is greater than 12 for parallel SCSI, ispscsicmd has
made the initial queue entry a EXTENDED CMD queue entry, so we have to
go straight to continuation segments for any data segments.

approved: jkh


57161 12-Feb-2000 peter

Do a trivial conversion of xrpu to newbus.

Reviewed by: phk ("commit it!" :-)
Pre-Approved by: jkh


57152 11-Feb-2000 mjacob

Add in 12160 (Ultra3) support. Redo things to use the newbus code.

Approved: jkh@freebsd.org

PR: 16141


57101 10-Feb-2000 wpaul

Update the Tigon driver to use the 12.3.18 firmware release from Alteon.
(No changes to the driver code itself.)

Approved by: jkh


57074 09-Feb-2000 mdodd

Remove the old copy of this file. It is now active in its new location.

Implicit Approval by: jkh


57021 07-Feb-2000 n_hibma

Add PCI Id's for i810 chipsets.

PR: 16517
Submitted by: SAKIYAMA Nobuo <sakichan@lares.dti.ne.jp>
Approved by: jhk


57009 06-Feb-2000 n_hibma

Disable the generation of SMIs (System Management Interrupts). Always set
the PIRQD bit.

This fixes the problem of uhub0 hanging forever during boot when USB
keyboard support is switched on in the BIOS on motherboards with Intel
chipsets (UHCI).

Approved by: The Sheep


56987 04-Feb-2000 n_hibma

Commit missing bits, forgotten when committing support for suspend/resume
for USB.

Call uhci_power when suspending and resuming.

Approved by: The One.


56964 02-Feb-2000 peter

Update the pci->pcic compatability module to newbus. This is a simple
conversion to eliminate the compatability shims without making any
significant changes. This eliminates the shim warnings.

Obtained from: n_himba (tweaked by me, don't blame him for this)
Approved by: jkh


56943 01-Feb-2000 peter

Spell "pci_delete_resource" correctly.

Approved by: jkh (who must be very sick of requests now :-)


56921 31-Jan-2000 n_hibma

bus_release_resource is spellt like bus_release_resource not like
bus_delete_resource.

Fixes a problem when the probe succeeded, but the attach failed. The
release of the resources was done inproperly.

Approved by: jkh


56858 29-Jan-2000 peter

Remove #include "wd.h" and #if NWDC > 0 as that's always true as this
file is 'optional wdc' (note wd.h has both NWDC and NWD in it because
of config quirks)


56839 29-Jan-2000 peter

Put a FYI in the compatability shims so that people are aware that they
are using an old unconverted driver. Most (if not all) of the drivers
for common hardware are newbus these days. However, we don't want
to encourage people to take the easy way out and write new drivers
using the shims. This is just passive "encouragement".

Reviewed by: phk


56670 27-Jan-2000 yokota

Add more PCI VGA graphics card descriptions.

PR: 10095, 15299, 13850, 16356
Submitted by: Alex Zepeda, Vladimir Kushnir, Alex Vasylenko, Alex.
Obtained from: XFree86 and NetBSD


56632 26-Jan-2000 n_hibma

Properly teardown the allocated and initialised stuff when an error
occurs (OHCIwas already done for UHCI).

Get rid of the usbus variable. It is confusing.

Align uhci_pci.c and ohci_pci.c again.


56630 26-Jan-2000 n_hibma

Don't set ivars until we checked the return value from device_add_child.


56575 25-Jan-2000 mjacob

put things in place for jumbograms


56572 25-Jan-2000 mjacob

define jumbo packet size


56541 24-Jan-2000 wpaul

Add support for DM9102A boards with Davicom DM9801 HomePNA PHYs.


56480 23-Jan-2000 peter

Fix some warnings.


56446 23-Jan-2000 groudier

Add 53C895A and 53C1510D device description to the ncr chip table.


56423 23-Jan-2000 mjacob

Correctly put the place to mark EOP where we actually do the packet
transmission- this handles the odd and rare case of a list terminating
with a zero length mbuf.


56421 23-Jan-2000 mjacob

add PREVIOUS index macro for transmit side


56415 23-Jan-2000 mjacob

Remove some debugging code, replace one line that had spaces with tabs,
and fix a silly botch for reinit.


56414 23-Jan-2000 mjacob

Get rid of the WX_XMIT_SMALL code- we've fixed that problem. Restructure
the receive code so that it correctly chains receive descriptors together
and handles the case that only a part of a packet is done at the time
we get here.


56409 23-Jan-2000 mjacob

Add a pointer in the softc that will point to partially received packet.
Set up index increments for receive descriptors based on whether
the PADDED_CELL define is set.


56408 23-Jan-2000 mjacob

Add in a define for the optimal cache line size.


56370 21-Jan-2000 n_hibma

Add ID for the AMD-756 OHCI controller


56343 20-Jan-2000 n_hibma

Properly remove interrupts if initialisation fails.


56295 19-Jan-2000 wpaul

Add support for the Davicom DM9102A 10/100 ethernet controller chip.
This is just to make sure we initialize the chip correctly: we need to
make the sure the port select bit in CSR6 is set properly so that we
use the internal PHY for 10/100 support. (The eval boards I have also
include an external HomePNA PHY, but I need to play with that more
before I can support it.)


56210 18-Jan-2000 mjacob

add a R_PREV_IDX macro


56206 18-Jan-2000 wpaul

Add the vendor/device ID for the Farallon PN9000SX gigabit ethernet
card, which is apparently also a Tigon 2 device.


56060 15-Jan-2000 wpaul

Fix the tl driver so it doesn't run off the end of the RX descriptor list
and panic in out of mbufs condition.


56026 15-Jan-2000 mjacob

Remove compile warning not seen when compiling with target mode enabled.


56009 15-Jan-2000 mjacob

Redo FC target mode dma routine to try and generate an extra CTIO
in the not so odd case of Moving Data *AND* Sending Status in last CTIO *AND*
status is a CHECK CONDITION *AND* we have Sense Data to send.


55953 14-Jan-2000 peter

Pre 4.0 tidy up.

Collect together the components of several drivers and export eisa from
the i386-only area (It's not, it's on some alphas too). The code hasn't
been updated to work on the Alpha yet, but that can come later.

Repository copies were done a while ago.
Moving these now keeps them in consistant place across the 4.x series
as the newbusification progresses.

Submitted by: mdodd


55946 14-Jan-2000 gibbs

The error status for a scsi status error is "CAM_SCSI_STATUS_ERROR", not 0.


55888 13-Jan-2000 peter

Remove duplicate DEC 21050 PCI-PCI bridge (0x00011011)
Add an entry for the Toshiba Fast Infra Red controller (0x07011179)


55887 13-Jan-2000 mdodd

Add a few devices IDs and clarify the SiS 85c496 entry.


55869 13-Jan-2000 gallatin

add entries for several DEC PCI-PCI bridges & the Cypress PCI-ISA bridge found
on newer alpha workstations and servers


55866 12-Jan-2000 wpaul

Reintroduce the dc_coal() workaround routine for coalescing outbound
packets into a single buffer, and set the DC_TX_COALESCE flag for the
Davicom DM9102 chip. I thought I had escaped this problem, but... This
chip appears to silently corrupt or discard transmitted frames when
using scatter/gather DMA (i.e. DMAing each packet fragment in place
with a separate descriptor). The only way to insure reliable transmission
is to coalesce transmitted packets into a single cluster buffer. (There
may also be an alignment constraint here, but mbuf cluster buffers are
naturally aligned on 2K boundaries, which seems to be good enough.)

The DM9102 driver for Linux written by Davicom also uses this workaround.
Unfortunately, the Davicom datasheet has no errata section describing
this or any other apparently known defect.

Problem noted by: allan_chou@davicom.com.tw


55770 10-Jan-2000 yokota

Added PCIR_BIOS (0x30).


55699 10-Jan-2000 gibbs

Avoid setting DPARCKEN until I can figure out why it causes
spurious parity errors on some controllers.


55686 09-Jan-2000 wpaul

Close PR# 15986: issue an RX reset command when initializing the interface,
but only for those cards that don't use miibus (i.e. all the 10mbps only
cards, and the 100baseFX card).

PR: kern/15986


55593 08-Jan-2000 peter

Show the port/mem/irq of pci devices too.


55590 08-Jan-2000 peter

Clean up the cfgmech/pci_mechanism debris. The reason for the existance
of this is no longer an issue as we have a replacement driver for the
one that needed it.

Reviewed by: dfr


55587 08-Jan-2000 gibbs

Turn on parity error reporting before configuring external sram. This
makes it a little easier to notice that parity checking an 8bit sram
isn't working.

Turn on scb and internal data-path parity checking for all pci chips types.
We were only doing this for ultra2 chips.

After clearing the parity interrupt status, clear the BRKADRINT. This
avoids seeing a bogus BRKADRINT interrupt after external SCB probing
once normal interrupts are enabled.


55582 08-Jan-2000 gibbs

Really enable external SCB ram on Ultra2 capable controllers.

Don't even bother to look for SCB ram on controllers < aic7870.

Clear any parity errors generated by looking at external SCB ram.


55580 07-Jan-2000 gibbs

Add detection logic for the U160 family of adaptec controllers. These
controllers will run at U2 speeds until I can complete the U160 support
for this driver.

Correct a termination buglet for the 2940UW-Pro.

Be more paranoid in how we probe and enable external ram, fast external
ram timing and external ram parity checking. We should now work on
20ns and 8bit SRAM parts.

Perform initial setup for the DT feature on cards that support it.

Factorize and clean up code. Use tables where it makes sense, etc.

Add some delays in dealing with the board control logic. I've never
seen this code fail, but with the ever increasing speed of processors,
its better to insert deterministic delays just to be safe. This stuff
is only touched during probe and attach, so the extra delay is of no
concern.


55536 07-Jan-2000 billf

Fix paste-o in NeoMagic audio probe.

Submitted by: cg


55464 05-Jan-2000 peter

Zap pci_map_dense() and pci_map_bwx() - they were for compatability but
are not used. All the drivers that use memory mapped IO on the Alpha have
been ported already.


55410 04-Jan-2000 mjacob

Add first pass of the Intel Gigabit Ethernet (wiseman) driver. This
driver seems relatively functional, but could use some souping up,
particularly in the performance area. This has both NetBSD and FreeBSD
attachment code and a fair amount of effort has been put into making
it easy to port to different *BSD platforms.

The basic design is a one tfd per mbuf transmit (with no transmit
related interrupts- tfds are gc'd as needed). The receive ring
uses a 2K buffer per rfd with a +2 byte adjust for the ethernet
header (so the payload is aligned). There's support that *almost*
works for doing large packets- the rfd chaining code works, but there's
some problem with getting good checksums at the IP reassembly level
(ditto for doing short tfd's too).

The chip has support for TCP checksums insertion for transmit and
TCP checksum calculation on receive (for both you have to do some
appropriate backoff && twiddling), but this isn't in place.

This is nearly entirely reverse engineered from the released Intel
driver, so there's a lot of "We have to do this but do not know why"
stuff. There is somebody who has the chip specs who works in FreeBSD
but they're being a bit standoffish about even sharing hints which
is somewhat annoying. It's also apparent that all I had to work with
were the first rev boards.

This driver has been lightly tested on intel && alpha, but only
point-to-point. There may be some issues with switches- use of
boot time environment variables that override EEPROM settings
(e.g., 'set wx_ilos=1' which inverts the sense of optical signal
loss) may help with this.

I had this out for review for three weeks, and nobody said anything
negative or positive, ergo, this checkin has no 'reviewed by' field
which I would have preferred.


55383 04-Jan-2000 mjacob

Add in an isp_tdebug environment variable. Clean up some debugging
printouts for clarity.


55369 03-Jan-2000 mjacob

Support target mode operations. This involves having some variant
dma mapping callback routines to select from as target mode
entries are handled a fair bit differently from normal initiator
mode entries.


55340 03-Jan-2000 wpaul

It appears that under certain circumstances that I still can't quite pin
down, the dc driver and receiver can fall out of sync with one another,
resulting in a condition where the chip continues to receive packets
but the driver never notices. Normally, the receive handler checks each
descriptor starting from the current producer index to see if the chip
has relinquished ownership, indicating that a packet has been received.
The driver hands the packet off to ether_input() and then prepares the
descriptor to receive another frame before moving on to the next
descriptor in the ring. But sometimes, the chip appears to skip a
descriptor. This leaves the driver testing the status word in a descriptor
that never gets updated. The driver still gets "RX done" interrupts but
never advances further into the RX ring, until the ring fills up and the
chip interrupts again to signal an error condition. Sometimes, the
driver will remain in this desynchronized state, resulting in spotty
performance until the interface is reset.

Fortunately, it's fairly simple to detect this condition: if we call
the rxeof routine but the number of received packets doesn't increase,
we suspect that there could be a problem. In this case, we call a new
routine called dc_rx_resync(), which scans ahead in the RX ring to see
if there's a frame waiting for us somewhere beyond that the driver thinks
is the current producer index. If it finds one, it bumps up the index
and calls the rxeof handler again to snarf up the packet and bring the
driver back in sync with the chip. (It may actually do this several times
in the event that there's more than one "hole" in the ring.)

So far the only card supported by if_dc which has exhibited this problem
is a LinkSys LNE100TX v2.0 (82c115 PNIC II), and it only seems to happen
on one particular system, however the fix is general enough and has low
enough overhead that we may as well apply it for all supported chipsets.
I also implemented the same fix for the 3Com xl driver, which is apparently
vulnerable to the same problem.

Problem originally noted and patch tested by: Matt Dillon


55332 03-Jan-2000 billf

Update NeoMagic entries.

Obtained from: NetBSD's pcidevs and billf's Dell laptop.


55282 31-Dec-1999 billf

Fill in the blanks for some of the Texas Instruments cardbus controllers.

Obtained from: NetBSD (syssrc/sys/dev/pci/pcidevs)


55213 29-Dec-1999 billf

Copy Texas Instruments cardbus controllers from pcisupport.c, the pcisupport.c
probes are at the 'chip' level and will get overridden by pcic_p if it is
compiled in. It's still nice to get the better probe message if it's not...

Requested by: imp


55207 29-Dec-1999 billf

Add the Texas Instruments PCI14xx pccard/cardbus controllers device ids.


55206 29-Dec-1999 peter

Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot). This is consistant with the other
BSD's who made this change quite some time ago. More commits to come.


55203 29-Dec-1999 billf

Add the Id for the NeoMagic 256ZX, the display from which I'm seeing this..


55170 28-Dec-1999 billf

Fix a small typo in the comments.


55088 24-Dec-1999 bde

Removed unnecessary const poisoning (redundant casting) which was added
in rev.1.4.


55058 23-Dec-1999 wpaul

Fix problem reported by Matt Dillon. Occasionally, very small received
frames would be handled incorrectly due to bad usage of m_pullup() in
the case where the frame wraps from the end of the receive buffer back
the beginning.

Also, when manually extending small packets to pad them to the minimum
frame length during transmission, zero out the pad area to make some
really paranoid people happy.


54966 21-Dec-1999 eivind

Add #ifdef notyet around uncalled code that is later going to become DDB
commands.

Discussed with: phk (driver author)


54952 21-Dec-1999 eivind

Change incorrect NULLs to 0s


54697 16-Dec-1999 wpaul

Update the xl driver to recognize yet another 3c905B/3c905C class NIC:
the 3c450-TX HomeConnect. Like the 3cSOHO100-TX OfficeConnect, this NIC
uses the same ASIC as the 3c905B/3c905C but is targeted for a particular
market segment (home users). It is somewhat less expensive than the
3c905B/3c905C ($49, according to the 3Com web site), comes with its
own custom driver kit and is bundled with various goofy Windows software
packages designed to demonstrate the niftyness of home networking (networked
game demos, etc...).

Changes are:

- Add PCI ID to list in if_xlreg.h.
- Update xl_devs table in if_xl.c.
- Update xl_choose_xcvr() to consider the HomeConnect the
same as all the other 10baseT/100baseTX cards.


54671 16-Dec-1999 mjacob

Add Dual LVD bus (1280) support


54577 13-Dec-1999 wpaul

Fix some problems reported by Mike Pritchard:

- Add a flag DC_TX_INTR_ALWAYS which causes the transmit code to
request a TX done interrupt for every packet. The PNIC seems to need
this to insure that the sent TX buffers get reaped in a timely fashion.

- Try to unreset the SIA as soon as possible after resetting the whole
chip.

- Change dcphy to support either 10/100 or 10Mbps only NICs. The
built-in 21143 ethernet in Compaq Presario machines is 10Mbps only
and it doesn't work right if we try to advertise 100Mbps modes during
autoneg. When restricted to only 10mbps modes, it works fine.

Note that for now, I detect this condition by checking the PCI
subsystem ID on this NIC (which has a Compaq vendor/device ID).
Yes, I know that's what the SROM is supposed to be for. I'm deliberately
ignoring the SROM wherever possible. Sue me.

The latter two fixes allow if_dc to work correctly with the built-in
ethernet on certain Compaq Presario boxes. There are liable to be quite
a few people using these as their home systems who might want to try
FreeBSD; may as well be nice to them.

Now if anybody out there has an Alpha miata with 10Mbps ethernet and
can show me the output from pciconf -l on their system, I'd be grateful.


54496 12-Dec-1999 peter

Remove some horrible #if 0'd code that has no hope of working now. It
used to edit the old-style isa_devtab config tables to insert a mapping
for a pci device into the isa tables so that the wdc driver could probe
it later. This has been #if 0'd since April.


54472 12-Dec-1999 gibbs

When booting verbose, indicate if we are using manual termination
settings for U2 cards.

Don't assume that all aic7859 cards are 2930CUs.


54412 10-Dec-1999 peter

Make the usb and ide/ata device identification a little saner. Rather than
attaching to the device via chip*, use the newbus nomatch method to report
the device. This leaves them unattached so that a driver can be easily
loaded to grab them later.


54322 08-Dec-1999 ken

[ repository copy of sys/pci/pci_ioctl.h to sys/sys/pciio.h happened in the
background ]

Rename sys/pci/pci_ioctl.h to sys/sys/pciio.h to make it easier for
userland programs to use this interface. Reformat the file, and add a
BSD-style copyright to it.

Add a new man page for pci(4). The PCIOCGETCONF, PCIOCREAD, and PCIOCWRITE
ioctls are documented, but the PCIOCATTACHED ioctl is not documented
because it is not implemented.

Change includes of <pci/pci_ioctl.h> to <sys/pciio.h> or remove them
altogether. In many cases, pci_ioctl.h was unused.

Reviewed by: steve


54268 07-Dec-1999 wpaul

Spruce up the Sundance ST201 driver:

- Convert to using TX descritor polling similar to the xl driver (the
ST201 is a clone of the 3c90xB chipset and offers the same transmit
polling scheme). This should reduce TX overhad a little.

- Make sure to reset PHY when switching mode, as in the starfire driver.

- Fix instances of free() that should be contigfree().

- Remove dead code.


54266 07-Dec-1999 wpaul

Tweak the DC_REDUCED_MII_POLL code in dc_mii_tick() for the DC_IS_INTEL()
case. The idea is to reduce how often we call mii_tick(), however currently
it may not be called often enough, which prevents autonegotiation from
being driven correctly.

This should improve the chances of successfully autonegotiating media
settings on non-MII 21143 NICs. (Still waiting for confirmation from
some testers, but the code is clearly wrong in any case.)


54213 06-Dec-1999 gibbs

Simplify my license.

Don't arbitrarily limit the initiator ID of the card to something <= 7.

Fix a bug in the checksum code that would incorrectly prevent a valid
checksum of zero. (cp)

Don't touch rely on seeprom data when configuring termination. We may
not have seeprom data. (cp)

Treat all ULTRA2 capable adapters the same way when reading or writing
the BRDCTL register. We previously only did this correctly for aic7890/91
chips. This should correct some problems with termination settings on
aic7896/97 adapters. (cp)

Changes marked with "(cp)"
Pointed out by: Chuck Paterson <cp@bsdi.com>


54161 05-Dec-1999 wpaul

Modify the Adaptec "starfire" driver to reset the PHY on the MII bus
before selecting a mode. The Seeq PHY chips on the Adaptec cards that
use the AIC-6915 controller seem to need it in order to get them to
change modes correctly.

This corrects a problem that I noticed where my ANA-62022 board failed
to correctly program the full duplex bit in the macconfig1 register
when the interface was brought up. Running ifconfig sf0 would mask this
problem in some cases because polling the PHY status would cause the
miibus code to notice that full duplex was now needed and the statchg
callback would be invoked to configure the duplex setting. However it
would still get it wrong other times.

Also changed sf_miibus_statchg() to program the IPG register to match
the duplex setting in accordance with Adaptec manual's recommendations
(0x15 for full duplex, 0x11 for half duplex).


54153 05-Dec-1999 peter

Raise the pci compat driver match priority a bit so that it's not
quite so close to the chip* drivers.


54151 05-Dec-1999 peter

Lower (a lot!) the chip* probe so it doesn't steal the pci ID from
ide_pci which still uses the pci driver compat shims.


54134 04-Dec-1999 wpaul

Add the if_dc driver and remove all of the al, ax, dm, pn and mx drivers
which it replaces. The new driver supports all of the chips supported
by the ones it replaces, as well as many DEC/Intel 21143 10/100 cards.

This also completes my quest to convert things to miibus and add
Alpha support.


54073 03-Dec-1999 mdodd

Remove the 'ivars' arguement to device_add_child() and
device_add_child_ordered(). 'ivars' may now be set using the
device_set_ivars() function.

This makes it easier for us to change how arbitrary data structures are
associated with a device_t. Eventually we won't be modifying device_t
to add additional pointers for ivars, softc data etc.

Despite my best efforts I've probably forgotten something so let me know
if this breaks anything. I've been running with this change for months
and its been quite involved actually isolating all the changes from
the rest of the local changes in my tree.

Reviewed by: peter, dfr


54050 03-Dec-1999 n_hibma

Fix the 'usb0: USB revision unknown, not supported' people have been seeing
by identifying the version in the PCI drivers.

The OHCI driver just presets this to 1.0 as it is not specified in the
PCI registers anywhere. This should be revisited once USB 2.0 is in
wide spread use.


53982 01-Dec-1999 julian

Add NULL for new entrypoint.


53906 30-Nov-1999 peter

Make the pci driver compat shim return a preference for probe
rather than an "it's mine!" so that other newbus-aware drivers can
bid for the device too. This should allow the sym driver to out-bid
the ncr driver for devices it supports without having to modify ncr.c
at all. ncr would then function as a catch-all.


53826 28-Nov-1999 eivind

Add the PCI id for the TI PCI-1251B PCI-CardBus bridge.

Submitted by: Martin Blapp <mb@imp.ch>


53680 24-Nov-1999 sos

Add 3 more parts of the VIA 82C686.


53648 24-Nov-1999 archie

Change the prototype of the strto* routines to make the second
parameter a char ** instead of a const char **. This make these
kernel routines consistent with the corresponding libc userland
routines.

Which is actually 'correct' is debatable, but consistency and
following the spec was deemed more important in this case.

Reviewed by (in concept): phk, bde


53588 22-Nov-1999 n_hibma

Feh, kind of went wrong the previous commit. dev should child (in some
cases) plus a typo.


53544 22-Nov-1999 n_hibma

Move the pretty printing of the description for USB controllers to
pci_probe_nomatch, so it won't be in the way when loading USB as a module.

The reason for them being there in the first place is that every
motherboard comes with USB kit and this way it looks more pretty (peter).
The real solution will be to define some method of detaching a driver
after it has attached.


53543 22-Nov-1999 n_hibma

Remove some bogus bus methods peter added. We are hardly doing
anything as a bus.


53511 21-Nov-1999 bp

Add text for Rendition Verite V1000 and V2000 video cards.


53484 21-Nov-1999 mjacob

Fix dmasetup functions to have 16 bit queue indices. Get the chip revision
out of the PCI CLASS reg and store it in the softc. Use the getenv_quad
function to get a WWN override from the environment. Look for a config
value for same. Make slightly less lame the wwn seed construction.


53476 21-Nov-1999 kuriyama

s/Brige/Bridge/.


53468 20-Nov-1999 wpaul

Minor tweak: the subsystem device ID code for the quad port 62044 card
is documented to be 0x18 in the Adaptec manual, however there appears to
be a newer board rev with code 0x19. I added a #define for this and
updated the probe code so that this board will be properly identified
in the probe messages. (Currently it's just identified generically as
an AIC-6915 chip.)


53461 20-Nov-1999 peter

Allow NULL for startp and/or countp in bus_get_resource() so that you can
get one of the two without having to use a dummy variable.


53341 18-Nov-1999 imp

Initial import of cardbus bridge driver (cbb) from the latest
newconfig code. This is a raw import and doesn't compile yet.

Obtained from: newconfig project


53303 17-Nov-1999 phk

Do timeouts in terms of hz

Spotted by: julian


53223 16-Nov-1999 wpaul

Fix usage of m_pullup().


52903 05-Nov-1999 gallatin

Remove calls to alpha_register_pci_scsi(). After Mike's recent boot
changes, it no longer exists and is preventing alpha kernels from building.

reviewed by: msmith


52853 03-Nov-1999 gallatin

now that a map's base addr is 64-bits, the alpha multi-hose hack needs
to be cast to 64-bits in pci_add_map. This should allow XP1000s and
DS20s to boot -current again.


52841 03-Nov-1999 phk

Remove compat cruft.


52800 02-Nov-1999 phk

New driver: Nx64kbit/s E1/T1 cards based on Munich32x&Falc54.

This is a netgraph driver.


52758 01-Nov-1999 wpaul

Do some more work on the mxphy pseudo-driver to make it better at media
detection and remove the long delays that I had used previously. Everything
should be handled by timeouts now.


52685 30-Oct-1999 mjacob

Organize things to cope with the (possible) lack of downloadable
firmware a bit better.


52644 30-Oct-1999 phk

Change useracc() and kernacc() to use VM_PROT_{READ|WRITE|EXECUTE} for the
"rw" argument, rather than hijacking B_{READ|WRITE}.

Fix two bugs (physio & cam) resulting by the confusion caused by this.

Submitted by: Tor.Egge@fast.no
Reviewed by: alc, ken (partly)


52636 29-Oct-1999 phk

Don't test boolean return against != 1.
Don't needlessly assign the error variable in an if statement.


52623 29-Oct-1999 semenu

Added code to enable BusMaster operations.
Kurt D. Starsinic <kstar@chapin.edu> had reported
this patch fixing strange behaviour (like timeouts
and RX/TX DMAs stopping errors).


52615 29-Oct-1999 imp

I'm told this makes more laptops work with the new attachment code.

Submitted by: archie cobbs


52590 28-Oct-1999 dfr

Fix some resource allocation peculiarities of the intpm device.


52529 26-Oct-1999 alc

Add text for the VIA 82C686 southbridge used by some Athlon and PII boards.


52508 26-Oct-1999 dfr

Make sure we add an interrupt resource if intline!=255.


52505 26-Oct-1999 kuriyama

Add NeoMagic MagicMedia 256AV.


52494 25-Oct-1999 wpaul

Small tweak: just reset the transmit block instead of doing a global reset
in xl_init(). This achieves the effect that I wanted without totally
resetting the chip.


52480 25-Oct-1999 alc

Add text for the AMD-751 host-to-PCI and PCI-to-PCI (AGP) bridges.


52475 25-Oct-1999 imp

Sony CXD1847A FireWire Host Controller


52426 21-Oct-1999 wpaul

Make some tweaks to the RealTek driver:

- Fix a bug in rl_rxeof() handler: in the case where the packet wraps
from the end of the receive buffer back to the beginning, we need to
insure that at least sizeof(ether_header) bytes make it into the first
mbuf. If we don't, then doing eh = mtod(m, struct ether_header *)
loses. To avoid this, we use m_pullup() to suck at least MHLEN -
RL_ETHER_ALIGN bytes into the first mbuf, which should also help
small packets fit into a single mbuf.

Pointed out by: Philip A. Prindeville <philipp@zembu.com>

- Make the transmit threshold autotuning: start off with a small value
and jack it up when TX underruns are detected.

- Also improve TX error recovery: kick the chip in the head with a
reset/init sequence to make sure it recovers afer a transmit error.


52351 17-Oct-1999 mjacob

Add in inclusion of machine/md_var.h (so alpha_scsi_bus_register or what
have you is prototyped). Removed code versions in md struct- not used
any more. Allocate transfer dma maps and xflist stuff in mbxdmasetup based
upon isp->isp_maxcmds. Allow for multiple calls to mbxdmasetup (for
isp_reset cases).


52328 17-Oct-1999 jhay

Add support for the PCI version of the Digi SYNC/570i cards.


52327 17-Oct-1999 dfr

Correct a stupid type which prevented us from working with any device
which needed port resources.


52282 16-Oct-1999 wpaul

Convert the mx driver to miibus.

In order to make this work, I created a pseudo-PHY driver to deal with
Macronix chips that use the built-in NWAY support and symbol mode port.
This is actually all of them, with the exception of the original MX98713
which presents its NWAY support via the MII serial interface.

The mxphy driver actually manipulates the controller registers directly
rather than using the miibus_readreg()/miibus_writereg() bus interface
since there are no MII registers to read. The mx driver itself pretends
that the NWAY interface is a PHY locayed at MII address 31 for the sole
purpose of allowing the mxphy_probe() routine to know when it needs to
attach to a host controller.


52244 14-Oct-1999 wpaul

Make some small tweaks:

- When setting/clearing promisc mode, just update the filter, don't
reset the whole interface.

- Call xl_init() in xl_ifmedia_upd() when setting miibus media modes. This
fixes a problem with the 3c905B-COMBO where switching from 10base5/AUI
or 10base2/BNC to a 10/100 mode doesn't always work right.

- Attempt to reset the interface in xl_init() so that we know we're getting
the receive and transmit rings reset properly.


52243 14-Oct-1999 dfr

* Implement bus_set/get/delete_resource for pci.
* Change the hack used on the alpha for mapping devices into DENSE or
BWX memory spaces to a simpler one. Its still a hack and should be
a seperate api to explicitly map the resource.
* Add $FreeBSD$ as necessary.


52175 12-Oct-1999 gallatin

allow pci_ioctl to work with multi-hose alphas.
Rather than teaching pci_ioctl about hoses, we just pass down a magic number
& let the platform code figure out what the hose is based on what the bus
number is.

concept approved by dfr


52138 11-Oct-1999 mjacob

remove unnecessary includes


52063 09-Oct-1999 peter

Add the 16550 programming interface code for PCIS_SIMPLECOMM_UART.


52053 09-Oct-1999 mdodd

Remove old copies. These files now live in src/sys/dev/buslogic


52047 09-Oct-1999 mdodd

Remove these files as they now live in sys/dev/dpt/


52025 08-Oct-1999 roger

No longer required, following the move of the driver to /sys/dev/bktr


51989 07-Oct-1999 n_hibma

remove the use of uhci_reset to wake up the controller after
resume/suspend (->resume is broken again, will be fixed properly ASAP)

style fixes


51972 07-Oct-1999 msmith

Be much more selective in claiming devices that might be IDE controllers.

The old algorithm was:

if class == storage and subclass != SCSI device must be IDE

This results in claiming 'raid' and 'other' storage devices as IDE,
which is typically not the case.

Reviewed by: sos


51957 05-Oct-1999 n_hibma

Removal of sys/device.h

- Move intrhook stuff into kernel.h
- Remove all occurrences of #device <device.h>
- Add kernel.h were necessary (nowhere)
- delete device.h

This file contained the structures for cfdata (old style config) and is no
longer used. It was included by most drivers.

It confuses the remote debugger as the definition of 'struct device' in
device.h is found before the one in bus_private.h.


51916 03-Oct-1999 gallatin

A band-aid to prevent multi-hose alpha chipsets (aka tsunami) from
panic'ing because the hose is not filled in. We should probably extend the
pciioctl interface to take hoses into account..


51914 03-Oct-1999 n_hibma

Check for a valid irq number before calling BUS_SETUP_INTR.

Requested-By: msmith


51845 01-Oct-1999 roger

Backout part of the changes made in 1.111

For unknown devices the output will now be
pci0: unknown card (vendor=0x109e, dev=0x0878) at 14.1 irq 19
instead of
pci0: unknown card DD^0878 (vendor=0x109e, dev=0x0878) at 14.1 irq 19

Before this change, the code used to take the PCI vendor id and translate it
into a three letter ASCII name.
For PnP devices, the vendor id _does_ map to a nice ASCII name
(eg Creative Labs PnP ID maps to "CTL", ESS PnP ID maps to "ESS")

But there is no such mapping for PCI devices, as can be seen by the
example above where the Brooktree PCI vendor ID maps to "DD^"

The PCI Special Interest Group confirmed they do not have any mappings
from vendor ID to ASCII.


51821 30-Sep-1999 gallatin

Make the fxp driver work on alpha, rather than panic the machine on boot
and/or when using the card.

o Convert the driver to using bus_space. This allows alphas with
fxp's to boot, rather than panic'ing because rman_get_virtual()
doesn't really return a virtual address on alphas.

o Fix an alpha unaligned access error caused by some misfeature of
gcc/egcs: if link_addr & rbd_addr in the fxp_rfa struct are 32 bit
quantities, egcs will assume they are naturally aligned. So it will do
a ldl & some shifty/masky to twiddle 16 bit values in fxp_lwcopy().
However, if they are 16-bit aligned, the ldl will actually be done on
a 16-bit aligned value & we will panic with an unaligned access
error... Changing their definition to an array of chars seems to fix
this. I obtained this from NetBSD.

I've tested this on both i386 & alpha.


51697 26-Sep-1999 peter

These files live on in sys/dev/pcm/pci/es1370*


51682 26-Sep-1999 wpaul

Update the Starfire driver comments and man page to include the URL of
the AIC-6915 Programmer's Manual which I finally found online at Adaptec's
site.


51658 25-Sep-1999 phk

Remove five now unused fields from struct cdevsw. They should never
have been there in the first place. A GENERIC kernel shrinks almost 1k.

Add a slightly different safetybelt under nostop for tty drivers.

Add some missing FreeBSD tags


51657 25-Sep-1999 wpaul

Change contigmalloc() lower memory bound from 1MB to 0 to improve
chances of allocations succeeding on systems with small amounts of
RAM.

Pointed out by: bde


51646 25-Sep-1999 phk

Remove NBPF conditionality of bpf calls in most of our network drivers.

This means that we will not have to have a bpf and a non-bpf version
of our driver modules.

This does not open any security hole, because the bpf core isn't loadable

The drivers left unchanged are the "cross platform" drivers where the respective
maintainers are urged to DTRT, whatever that may be.

Add a couple of missing FreeBSD tags.


51641 25-Sep-1999 wpaul

Call sk_start() at the end of sk_intr() if there's packets in the
interface send queue that need to be processed.


51583 23-Sep-1999 wpaul

As suggested by phk, unconditionalize BPF support in these drivers. Since
there are stubs compiled into the kernel if BPF support is not enabled,
there aren't any problems with unresolved symbols. The modules in /modules
are compiled with BPF support enabled anyway, so the most this will do is
bloat GENERIC a little.


51555 22-Sep-1999 roger

Delete the README file from /sys/pci.
Important information is now in the bktr man page


51553 22-Sep-1999 roger

Bt848 driver now moved to /sys/dev/bktr


51536 22-Sep-1999 wpaul

Update the Tigon driver firmware images to the latest release from
Alteon (12.6.15).


51533 22-Sep-1999 wpaul

Tweak these for what I hope is the last time: change the DRIVER_MODULE()
declaration for the interface driver from "foo" to "if_foo" but leave the
declaration for the miibus attached to the interface driver alone. This
lets the internal module name be "if_foo" while still allowing the miibus
instances to attach to "foo."

This should allow ifconfig to autoload driver modules again without
breaking the miibus attach.


51530 22-Sep-1999 wpaul

Spruce up the ADMtek driver: conver to newbus, miibus and add support
for the AN985 "Centaur" chip, which is apparently the next genetation
of the "Comet." The AN985 is also a tulip clone and is similar to the
AL981 except that it uses a 99C66 EEPROM and a serial MII interface
(instead of direct access to the PHY registers).

Also updated various documentation to mention the AN985 and created
a loadable module.

I don't think there are any cards that use this chip on the market yet:
the datasheet I got from ADMtek has boxes with big X's in them where the
diagrams should be, and the sample boards I got have chips without any
artwork on them.


51481 20-Sep-1999 wpaul

Close PR #13665. I managed to figure out the problem, no thanks to the
submitter, who *still* hasn't bothered to answer me back.

The thing which the submitter completely failed to mention is that
his 3c900B-TPO card has the transceiver selection in the EEPROM set
to "auto." You can tweak the setting using the 3C90XCFG.EXE utility
that 3Com provides with the card. I'm not sure if it's supposed to
default to auto or if the user fiddled with it. Currently, the xl
driver only does autoselection for 10/100 NICs (i.e. those with NWAY
autonegotiation capabilities). For the 10baseT, 10base5, 10base2,
10baseFL and 100baseFX cards, the driver sets the default media to
whatever the EEPROM transceiver selector says. The problem is that
the "auto" selection is mistakenly identified as "10/100 NWAY
autoselection mode" and this is not handled correctly: the default
media ends up being chosen as 100baseTX, which doesn't work because
we've only added 10baseT media types to the ifmedia word. This leads
to a panic in ifmedia_set() (something else which the submitter never
bothered to mention).

A workaround for this is to re-run the 3C90XCFG.EXE utility and change
the transceiver selection to something besides "auto." I have also
patched the driver to watch for the "auto" setting in the non-miibus
case and select a reasonable default based on the card type instead of
falling through to 100baseTX and exploding.

PR: misc/13665


51473 20-Sep-1999 wpaul

Un-do the changes to the DRIVER_MODULE() declarations in these drivers.
This whole idea isn't going to work until somebody makes the bus/kld
code smarter. The idea here is to change the module's internal name
from "foo" to "if_foo" so that ifconfig can tell a network driver from
a non-network one. However doing this doesn't work correctly no matter
how you slice it. For everything to work, you have to change the name
in both the driver_t struct and the DRIVER_MODULE() declaration. The
problems are:

- If you change the name in both places, then the kernel thinks that
the device's name is now "if_foo", so you get things like:

if_foo0: <FOO ethernet> irq foo at device foo on pcifoo
if_foo0: Ethernet address: foo:foo:foo:foo:foo:foo

This is bogus. Now the device name doesn't agree with the logical
interface name. There's no reason for this, and it violates the
principle of least astonishment.

- If you leave the name in the driver_t struct as "foo" and only
change the names in the DRIVER_MODULE() declaration to "if_foo" then
attaching drivers to child devices doesn't work because the names don't
agree. This breaks miibus: drivers that need to have miibuses and PHY
drivers attached never get them.

In other words: damned if you do, damned if you don't.

This needs to be thought through some more. Since the drivers that
use miibus are broken, I have to change these all back in order to
make them work again. Yes this will stop ifconfig from being able
to demand load driver modules. On the whole, I'd rather have that
than having the drivers not work at all.


51455 20-Sep-1999 wpaul

Grrr. Okay, changing the devnames was a bad idea. Put them back the way
they were.


51453 20-Sep-1999 wpaul

Fix the strings in the driver_t structs so that they match the new names
in the DRIVER_MODULES() declarations. *sigh*


51450 20-Sep-1999 obrien

Goofed and didn't change the second DRIVER_MODULE() linking these with
the miibus.

Noticed by: wpaul


51446 20-Sep-1999 obrien

Change the name we register with DRIVER_MODULE() to include the leading
"if_".

Reviewed by: msmith, wpaul


51442 20-Sep-1999 peter

Make if_ed work again on pci, isa, isapnp. The hack to make it work on
PCCARD is pretty revolting but should buy us time while the pccard driver
angle is sorted out. A commit for the MCA ed attachment will follow
shortly.


51441 20-Sep-1999 wpaul

Add an alternate transmit strategy for 3c90xB adapters based on the transmit
strategy used in the 3Com Linux driver. The new strategy is to use transmit
descriptor polling -- that is, the NIC polls the descriptors to see when
new packets are available for transmission. The advantage to the new scheme
is that no register accesses are needed in the transmit routine. The old
scheme requires several register accesses to stall the TX engine, update the
TX DMA list pointer register, then unstall the TX engine. Hopefully the new
scheme will provide improved transmit performance with less CPU overhead.

This only affects the 3c90xB or 3c90xC cards, not the 3c90x cards. This
means the original 3c900 and 3c905 cards are unaffected. Newer cards include
the 3c900B series, the 3c905B, 3c980, 3c980B, 3c905C and 3c905C, and the
3cSOHO100-TX OfficeConnect.


51439 19-Sep-1999 wpaul

Make some small performance tweaks to the tl driver. This should hopefully
close PR #13757, however I'm waiting on user feedback before declaring the
PR officially closed. Among other things, this improves UDP transmit
performance, and tx underruns are now detected and the TX start threshold
adjusted accordingly.


51432 19-Sep-1999 wpaul

Convert the VIA Rhine driver to miibus.


51360 18-Sep-1999 wpaul

Clean up two cases of the alpha vtophys() hack that should be
using alpha_XXX_dmamap() but aren't.


51359 18-Sep-1999 wpaul

Fix the mechanism used to choose the unit numbers for the IP interfaces
attached by the SysKonnect driver. Use ifunit() to scan for existing
skN interfaces and pick the first unused one.


51356 17-Sep-1999 roger

Update to driver release 1.74

Bug fix: xmradio nolonger experiences a 6Mhz offset after running FXTV

New feature: Automatic Tuner selection for AVerMedia cards with
configuration EEPROMs on (ie the Bt878 based cards)


51354 17-Sep-1999 wpaul

Patch if_vr to add bridging support.

PR: 12385
Submitted by: lyndon@orthanc.ab.ca


51352 17-Sep-1999 wpaul

Remember to account for ETHER_ALIGN when setting the maxmimum packet
length for mini receive ring. The max length was MHLEN, however the mbufs
are actually shortened to MHLEN - ETHER_ALIGN to force payload alignment.

PR: 13793


51351 17-Sep-1999 roger

Sync with driver release 1.74


51336 17-Sep-1999 wpaul

Fix sf_probe() to detect the card type properly. I botched the reading
of the subsystem ID when I converted to newbus. The driver still detects
the chipset and still works but fails to identify the exact card.


51302 15-Sep-1999 wpaul

Dangit: mispelled TORNADO in one place.


51301 15-Sep-1999 wpaul

3Com has produced their own Linux driver for the 3c90x/3c90xB series cards.
It's GPL'ed of course, but looking over it tonight I learned of Yet Another
Fast EtherLink XL Adapter: the 3c980C server adapter. This is basically
an updated version of the 3c980 that uses the Tornado ASIC instead of the
earlier Hurricane ASIC. The only change here is to add the new PCI device
ID (0x9805) and corresponding table entries.


51235 13-Sep-1999 ken

Get rid of a stray printf on boot. (BRDCTL = ...)

Approved by: gibbs


51123 10-Sep-1999 roger

Update to driver 1.73
Add new hauppauge Tuner Type 6
Add Aims Labs Video Highway Xtreme card type


51089 08-Sep-1999 peter

Add a pointer to "controller miibus0" for people who will not read the
commit messages or GENERIC and insist on running -CURRENT.
It probably won't work, but it's worth a try.


51064 07-Sep-1999 wpaul

Fix comment: RX underrun -> RX overrun.


51042 06-Sep-1999 wpaul

Fix an instance of FOO_RX_LIST_CNT that should have been FOO_TX_LIST_CNT.


51031 06-Sep-1999 wpaul

Remember to re-arm the timeout for the tick routine.


51030 06-Sep-1999 wpaul

Fix definitions for RID and RES if we're not using IOSPACE. I copied the
two lines and forgot to change them for the !IOSPACE case. Not a big deal
since PCI memory mapped mode is off by default, but I still feel silly.


50988 06-Sep-1999 wpaul

Whups, forgot one $Id$ -> $FreeBSD$ conversion.


50987 06-Sep-1999 peter

Recognise the new 82559 chip id as used on the InBusiness 10/100 adapter.
I have an 82559 card with the same id as the other 8255[78] chips, but
that was made with a date code of 0699 (June 99). The submitter shows
this working with the probe etc, but doesn't actually say it works as
on the ethernet. :-) Assuming it does, this is a RELENG_3 merge candidate.
Submitted by: Steven E Lumos <slumos@sam.ISRI.UNLV.EDU>


50986 06-Sep-1999 wpaul

This commit adds driver support for PCI fast ethernet NICs based on
the Davicom DM9100 and DM9102 chipsets, including the Jaton Corporation
XPressNet. Datasheet is available from www.davicom8.com.

The DM910x chips are still more tulip clones. The API is reproduced
pretty faithfully, unfortunately the performance is pretty bad. The
transmitter seems to have a lot of problems DMAing multi-fragment
packets. The only way to make it work reliably is to coalesce transmitted
packets into a single contiguous buffer. The Linux driver (written by
Davicom) actually does something similar to this. I can't recomment this
NIC as anything more than a "connectivity solution."

This driver uses newbus and miibus and is supported on both i386
and alpha platforms.


50974 05-Sep-1999 wpaul

This commit adds driver support for the Silicon Integrated Systems
SiS 900 and SiS 7016 PCI fast ethernet chipsets. Full manuals for the
SiS chips can be found at www.sis.com.tw.

This is a fairly simple chipset. The receiver uses a 128-bit multicast
hash table and single perfect entry for the station address. Transmit and
receive DMA and FIFO thresholds are easily tuneable. Documentation is
pretty decent and performance is not bad, even on my crufty 486. This
driver uses newbus and miibus and is supported on both the i386 and
alpha architectures.


50863 03-Sep-1999 wpaul

#ifdef out the definition for the small packet RX ring. I ended up only
using one RX ring because of the alignment issue, so we may as well save
a few K of memory by not allocating space for it.


50852 03-Sep-1999 peter

Commit a checkpoint of an updated if_ed driver. This is pretty much
Doug Rabson's work, with a few tweaks from Warner Losh and I. There are
still some quirks to resolve, but the old driver is presently breaking
the build.


50827 03-Sep-1999 luoqi

Handle for passthru resource release correctly.


50750 01-Sep-1999 roger

Update to driver 1.72.
Fix a bug where video capture locks up on channel changes.
Many thanks to Juha for solving this.

Submitted by: Juha Nurmela <Juha.Nurmela@quicknet.inet.fi>


50722 01-Sep-1999 wpaul

Just when I thought it was safe. In the original 3c905-TX NICs, the
external NatSemi PHY chip was programmed to respond to MII address 24.
In the 3c905B ASICs, the transceiver is internal but it's still mapped
to MII address 24. But *some* 3Com 3c905B ASIC revisions map the
transceiver control registers to *all* MII addresses (0 through 31).
The miibus code probes for PHYs at all MII addresses and because of
this unusual behavior, it will attempt to map the same PHY registers
several times over, which doesn't work.

Naturally, the 3c905B NIC that I tested happened not to exhibit this
behavior.

The fix is to tweak xl_miibus_readreg() and xl_miibus_writereg()
to only respond when attempting to read from MII address 24. This
is safe to do since the 3Com documentation indicates that the PHY
and/or internal transceiver will always be mapped to address 24,
and there are no 3Com XL NICs with more than one PHY.


50703 31-Aug-1999 wpaul

Convert the RealTek 8139 driver to newbus and miibus in one swell foop.
Also set it up to be compiled as a module.


50694 31-Aug-1999 roger

Oops. I undid the $Id: -> $FreBSD: change.
Put it back to $FreeBSD:


50693 31-Aug-1999 roger

Update to driver release 1.71

New Features:
Greatly improved VBI capture support. (mainly for the AleVT port)
Supports select() on /dev/vbi
Improved RISC program for RGB+VBI capture to capture both evenodd
VBI data even when only capturing even only (or odd only) video
Based on code from Juha Nurmela <Juha.Nurmela@quicknet.inet.fi>

Support for Hauppauge 627 and Temic 4006
Submitted by: Maurice Castro <maurice@atum.castro.aus.net>

Bug Fix:
Fix bug in AverMedia card detection.


50685 31-Aug-1999 wpaul

Add splimp protection to wb_tick().


50684 31-Aug-1999 wpaul

Make sure to free resources on failure correctly in a couple of places
in ste_attach().


50683 31-Aug-1999 peter

Fix a couple of things that weren't quite right for not using
PN_RX_BUG_WAR - it was freeing memory that may not have been allocated,
and unconditionally bzero'ing the mbufs even if the workaround wasn't
enabled.


50675 30-Aug-1999 wpaul

Convert the Adaptec and Winbond drivers to miibus.


50661 30-Aug-1999 gibbs

Add support for the aic7859 which is found on the 2930CU.

Break out the detection logic for the aic7855 and properly report
these chips as 7855s instead of 7850s.

The 2940AU_CN is an aic7860 based card, not aic7860.

Not setting CACHETHEN turned out to be a bad idea. It can cause
spurious corruption under heavy PCI load with multiple masters.


50659 30-Aug-1999 nsayer

MFS: Change path to perl.


50642 30-Aug-1999 roger

Add #include <sys/select.h> ready for select() support in bt848 driver


50579 29-Aug-1999 wpaul

Convert the 3Com XL driver to miibus. This one is a little tricky
due to the fact that there are non-MII cards supported by the same
driver and I don't have all of the cards available for testing. There's
also the 3c905B-COMBO which has MII, AUI and BNC media ports all in one
package. Supporting the COMBO is difficult because we have to add the
10base5 and 10base2 media types to the same ifmedia struct as the
MII-attached types, however there is no way to force the miibus and
child PHYs into existence before xl_attach() completes, so there is
no ifmedia struct available in xl_attach(). What we do inistead is
use the mediainit method as a callback: when a child PHY is attached,
it calls the miibus mediainit routine which selects a default media.
This routing also calls the NIC driver's mediainit method (if it
implements one) at which point we can safely add the other media
types.


50573 29-Aug-1999 roger

Add Voodoo 3 identification.
pciconf on my Vodoo3 2000 also shows sub-system vendor id/model with
card=0x0030121a


50548 29-Aug-1999 bde

Don't restrict our requests for contiguous memory to addresses >= 1MB.
This fixes, at least, panics in ncr_attach() on i386's with about 5MB
of memory. The restriction was a hack to leave some low memory for ISA
DMA, but on i386's we now allocate pages from the top down, so all the
restriction did was cause our allocations to fail when there is no free
memory above 1MB.


50477 28-Aug-1999 peter

$Id$ -> $FreeBSD$


50468 27-Aug-1999 wpaul

Make some cleanups related to miibus.


50462 27-Aug-1999 wpaul

Convert the ThunderLAN driver to miibus. This took me a while because I
had to get the ML 6692 PHY driver working correctly, which is harder than
it sounds. "Bitrate" ThunderLAN devices should still be supported (i.e
the older 10Mbps Netflex 3/P, which use the TNETE110 chip that has no
MII support). The ThunderLAN has an internal PHY which makes things a
little complicated, but these are the basic rules:

- For devices with just the ThunderLAN, the internal PHY is used to
provide 10baseT, and 10base5/10baseT support. Autonegotiation will
work, but only with 10baseT links. The only thing that really gets
negotiated is whether the link is full or half duplex.

- For devices with the ThunderLAN and an external 10/100 PHY (like the
Compaq Netelligent 100Mbps cards, or the internal Netflex 3/P with
100Mbps upgrade daughter card), the external PHY is used for 10baseT
and 100baseTX modes. The internal PHY is still used to support
10base5/10base2, though you have to select them manual with ifconfig.

- For devices with the ThunderLAN and the ML6692 PHY, both the internal
and external PHYs are used, though it will appear as though the 6692
PHY will be used to support 10baseT and 100baseTX modes. In reality,
the internal PHY will be used for 10baseT, but this fact will be hidden
from the user. The 10base5/10base2 modes can also be selected manually
as with above.


50392 26-Aug-1999 wpaul

Properly re-enable the transmitter in the TX error handler.


50294 24-Aug-1999 wpaul

Change PN_RXLEN from 1518 bytes to 1536 bytes. The chip always DMAs data
in 4 byte chunks. It turns out that with the 82c169C on the Netgear
FA-310TX Rev D2, if you tell the chip you have reserved a buffer of 1518
bytes, it will actually treat it as 1516 bytes since 1518 is divisible
by four. Consequently, a packet of 1514 bytes will always end up consuming
two buffers: the last coupleof bytes will spill over into the next
descriptor. This causes the pn_rx_bug_war() routine to trip unnecessarily.

I'm not sure if the 82c169B or 82c168 chips behave the same way; I'll
have to check them. In any case, this change should work just as well
with them. Note that the FA-310TX Rev D2 also has a Broadcom PHY
instead of a Level One LXT970 PHY, however this shouldn't make any
difference as far as the driver is concerned.

This change also allows me to do a way with one rounding overation in
pn_rx-buf_war().


50275 24-Aug-1999 bde

Cast pointers to uintptr_t instead of casting them to u_long, and/or vice
versa. Cosmetic.


50255 23-Aug-1999 n_hibma

Reset the UHCI controller when the device comes back from suspend.

This should be replaced by proper support for suspend one day (global
suspend).

Submitted-by: Christopher Masto <chris@netmonger.net>


50254 23-Aug-1999 phk

Convert DEVFS hooks in (most) drivers to make_dev().

Diskslice/label code not yet handled.

Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers)

Add the correct hook for devfs to kern_conf.c

The net result of this excercise is that a lot less files depends on DEVFS,
and devtoname() gets more sensible output in many cases.

A few drivers had minor additional cleanups performed relating to cdevsw
registration.

A few drivers don't register a cdevsw{} anymore, but only use make_dev().


50174 22-Aug-1999 peter

Slightly sanitize the isa/eisa bridge detection. The pci->eisa bridge
logic (I use the term loosely) was a bit whacky.


50135 21-Aug-1999 msmith

Clean up after removing sys/eventhandler.h from sys/systm.h at the last
minute. This should cover all of the missed cases (and should let LINT
build again).


50133 21-Aug-1999 billf

Add missing include.

Submitted by: Mitsuru IWASAKI <iwasaki@jp.FreeBSD.org>
Reviewed by: Alex Perel <veers@disturbed.net>


50130 21-Aug-1999 wpaul

Remove MII/PHY related junk from here. It's not needed anymore.


50128 21-Aug-1999 wpaul

This commit adds device driver support for the Sundance Technologies ST201
PCI fast ethernet controller. Currently, the only card I know that uses
this chip is the D-Link DFE-550TX. (Don't ask me where to buy these: the
only cards I have are samples sent to me by D-Link.)

This driver is the first to make use of the miibus code once I'm sure
it all works together nicely, I'll start converting the other drivers.

The Sundance chip is a clone of the 3Com 3c90x Etherlink XL design
only with its own register layout. Support is provided for ifmedia,
hardware multicast filtering, bridging and promiscuous mode.


50107 21-Aug-1999 msmith

Implement a new generic mechanism for attaching handler functions to
events, in order to pave the way for removing a number of the ad-hoc
implementations currently in use.

Retire the at_shutdown family of functions and replace them with
new event handler lists.

Rework kern_shutdown.c to take greater advantage of the use of event
handlers.

Reviewed by: green


50097 21-Aug-1999 wpaul

Fix power management register definitions.


50055 19-Aug-1999 peter

Replace the tulip_delay_300ns() with a DELAY(1). Hammering the PCI bus
to achieve a delay is pretty mean.

Andrew reports:
"The tulip_delay_300ns() is, well, bloody stupid on machines with a
heavily loaded PCI bus. It tries to do a delay by assuming PCI reads
will take a certain amount of time & issues a large amount of
(expensive, 5% CPU when your PCI bus is heavily loaded) pci reads.

Locally, we've replaced the calls to tulip_delay_300ns(sc) in the EMIT
macros with a simple DELAY(1) and not seen any problems. Plus we've
gained about 50Mb/sec throughput on our gigabit network cards because
of the added PCI bus bandwidth available."

Also, I do not understand why, but this change appears to stop the
Transmit Fifo underrun on one of my systems (but not the Alpha PC164SX).
This shouldn't make that much of a difference since the mii bus isn't
touched all that often, but perhaps when it does get accessed and hence
hammers the register, it was causing the chip to get upset.

Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>


50040 19-Aug-1999 wpaul

Small tweak: in xl_rxeof(), rxstat should be u_int32_t, not u_int16_t.


50010 18-Aug-1999 n_hibma

1) rename dev->self to be consistent
2) use device_printf
3) properly tear down and disable interrupts when init fails


49934 16-Aug-1999 gibbs

Differentiate between aic7895C chips and their earlier brethren
via the PCI revid register.


49905 16-Aug-1999 mjacob

Set some correct return values. Prefer I/O map all the time unless configured
otherwise.


49863 16-Aug-1999 gibbs

Fix a long standing bug in the auto-termination control settings for
the aic7890/91/96/97 cards. This could cause the system to go into
a long retry/recovery loop during probe.

Fix the alignment argument to bus_dma_tag_create().

Don't set the CACHETHEN bit in dscommand0 for Ultra2 controllers
until we know more about its behavior. The description for this
bit makes it sound like it could cause problems with certain
PCI chipsets.


49860 16-Aug-1999 gibbs

Properly set the alignment argument to bus_dma_tag_create(). If we
don't care about the alignment, set it to 1, meaning single byte alignment.


49780 14-Aug-1999 wpaul

Minor glitch in ti_newbuf_jumbo(): m_adj() was being called on
m instead of m_new.

Submitted by: Kenneth D. Merry <ken@kdm.org>


49612 10-Aug-1999 wpaul

Small tweak: remember to free the tx ring data (which is malloc()ed) if
we have to bail out of vr_attach().


49611 10-Aug-1999 wpaul

Convert the Winbond driver to newbus and have it compiled as a module.


49610 10-Aug-1999 wpaul

Convert the VIA Rhine driver to newbus and set it up to be compiled as
a module. Also modified the code to work on FreeBSD/alpha and added
device vr0 to the alpha GENERIC config.

While I was in the neighborhood, I noticed that I was still using
#define NFPX 1 in all of the Makefiles that I'd copied from the fxp
module. I don't really use #define Nfoo X so it didn't matter, but
I decided to customize this correctly anyway.


49589 10-Aug-1999 mdodd

Add support for the Am79C978. (AMD PCHome/PCI Ethernet adapter)

See: http://www.amd.com/products/npd/overview/homenetworking/intro.html

PR: kern/12275
Submitted by: Robert Watson <robert@cyrus.watson.org>


49579 09-Aug-1999 mdodd

chip0: <PCI to 0x80 bridge (vendor=10e0 device=8849)> at device 0.0 on pci0

Isn't really that useful.

chip0: <PCI to Other bridge (vendor=10e0 device=8849)> at device 0.0 on pci0

is more in keeping with the spirit of the rest of the code.

Previous behavior with regard to truely unknown bridges unchanged.

"<Anti-Bill> Tell you what: you have commit privs now. You do it."


49575 09-Aug-1999 peter

A little more tidying up.


49572 09-Aug-1999 peter

Expand a heap of macros that obscure readability and are no longer needed
here, and do a bit of general tidy up.


49568 09-Aug-1999 peter

More pre-lite2 support zapped and some more tidy-up.


49567 09-Aug-1999 peter

Unifdef -D__FreeBSD__ - and remove pre-lite2 support.


49566 09-Aug-1999 peter

Unifdef -U__NetBSD__


49563 09-Aug-1999 peter

Unifdef -U__bsdi__


49562 09-Aug-1999 peter

s/Id/FreeBSD/


49561 09-Aug-1999 peter

Strip __FreeBSD_version >= 300000 conditionals.


49560 09-Aug-1999 peter

Merge changes from NetBSD rev 1.82 -> 1.86 via vendor branch.
Among the changes: 1.84: support compex 4-port cards.


49541 08-Aug-1999 peter

s/TULUP/TULIP/ - from vendor branch.


49389 02-Aug-1999 wpaul

Minor tweak for last commit: insert extra delay between issuing master
reset and RX/TX resets.


49384 02-Aug-1999 wpaul

Perform an RX reset and TX reset in xl_reset() along with the master
reset command.

I observed some anomalous behavior while testing a 3c905C with a
Dell PowerEdge 4300/500 dual PIII 500Mhz system. The NIC would seem
to work correctly most of the time but would sometimes fail to receive
certain packets, in particular NFS create requests. I could mount
an NFS filesystem from the PowerEdge and do an ls on it, but trying
to do a "touch foo" would hang. Monitoring traffic from another host
revealed that the client was properly sending an NFS create request
but the server was not receiving it. It *did* receive it when I
ran the same test with an Intel fxp card.

I don't understand the exact mechanics of this strange behavior, but
resetting the receiver and transmitter seems to get rid of it. I used
to perform an RX and TX reset in xl_init(), but stopped doing it there
because on 3c905B and later cards this causes the autoneg session to
restart, which would lead to the NIC waiting a long time before exchanging
traffic after being brought up the first time. Apparently the receiver
and transmitter resets should be performed at least once when initializing
the card.

Hopefully this will cure problems that people have been having with the
3c905C -- this was the only strange behavior that I have observed with
the 3c905C so far which does not appear with the 3c905B or 3c905.


49195 29-Jul-1999 mdodd

Alter the behavior of sys/kern/subr_bus.c:device_print_child()

- device_print_child() either lets the BUS_PRINT_CHILD
method produce the entire device announcement message or
it prints "foo0: not found\n"

Alter sys/kern/subr_bus.c:bus_generic_print_child() to take on
the previous behavior of device_print_child() (printing the
"foo0: <FooDevice 1.1>" bit of the announce message.)

Provide bus_print_child_header() and bus_print_child_footer()
to actually print the output for bus_generic_print_child().
These functions should be used whenever possible (unless you can
just use bus_generic_print_child())

The BUS_PRINT_CHILD method now returns int instead of void.

Modify everything else that defines or uses a BUS_PRINT_CHILD
method to comply with the above changes.

- Devices are 'on' a bus, not 'at' it.
- If a custom BUS_PRINT_CHILD method does the same thing
as bus_generic_print_child(), use bus_generic_print_child()
- Use device_get_nameunit() instead of both
device_get_name() and device_get_unit()
- All BUS_PRINT_CHILD methods return the number of
characters output.

Reviewed by: dfr, peter


49157 28-Jul-1999 dfr

Add support for SYS_RES_DENSE and SYS_RES_BWX resource types. These are
equivalent to SYS_RES_MEMORY for x86 but for alpha, the rman_get_virtual()
address of the resource is initialised to point into either dense-mapped
or bwx-mapped space respectively, allowing direct memory pointers to be
used to device memory.

Reviewed by: Andrew Gallatin <gallatin@cs.duke.edu>


49142 28-Jul-1999 wpaul

Convert the PNIC driver to newbus.


49133 27-Jul-1999 wpaul

Roar! Finish what I started last night: somehow only the header file change
got committed.


49130 27-Jul-1999 mdodd

Case matters.

DEv_METHOD to DEV_METHOD.


49129 27-Jul-1999 mdodd

Implement the BUS_PROBE_NOMATCH method for the PCI bus.

This function is called for each device for which no driver
was found.

Output is similar to the eisa_probe_nomatch() function but with the
added benefit of displaying the assigned IRQ (since PCI gives us
this information up front.)

Output is like so:

pci0: unknown card CPQ0508 (vendor=0x0e11, dev=0x0508) at 11.0 irq 9
pci0: unknown card DFZ0508 (vendor=0x10da, dev=0x0508) at 11.0 irq 9
pci0: unknown card DBL0508 (vendor=0x104c, dev=0x0508) at 11.0 irq 9
pci0: unknown card DDM0011 (vendor=0x108d, dev=0x0011) at 11.0 irq 9

I'm not happy with the 3 lines of macro cruft that got added but
I consider it a temporary annoyance as those bits will be moved to
some place where PCI, EISA and ISAPNP code will be able to use them.

(Not surprisingly, this message is longer than the code in question.)

Reviewed by: peter, dfr


49128 27-Jul-1999 wpaul

On FreeBSD/i386, when you use the SYS_RES_MEMORY resource to allocate
a PCI memory mapped region, rman_get_bushandle() returns what happens
to be a kernel virtual address pointing to the base of the PCI shared
memory window. However this is not the behavior on all platforms:
the only thing you should do with the bushandle is pass it to the
bus_spare_read()/bus_space_write() routines. If you actually do want
the kernel virtual address of the base of the PCI memory window, you
need to use rman_get_virtual().

The problem is that at the moment, rman_get_virtual() returns a physical
address, which is bad. In order to get the kernel virtual address we
need, we have to play with it a little.

Presumeably this behavior will be changed, but in the meantime the
Tigon driver won't work. So for the moment, I'm adding a kludge to
make things happy on the alpha: the correct kernel virtual address
is calculated from the value returned by rman_get_virtual(). This
should be removed once rman_get_virtual() starts doing the right
thing.

This should make the Tigon actuall work on the alpha now.


49078 25-Jul-1999 peter

Make this compile on the Alpha. I'm not 100% sure about this but I
think it's ok. ti_bhandle is fetched from newbus on both the Alpha
and x86, the Alpha-only ti_vhandle is gone.


49077 25-Jul-1999 wpaul

Remember to clear the IFF_RUNNING and IFF_OACTIVE flags in sf_stop() and
sk_stop().


49076 25-Jul-1999 wpaul

This commit adds device driver support for Adaptec Duralink PCI fast
ethernet controllers based on the AIC-6915 "Starfire" controller chip.
There are single port, dual port and quad port cards, plus one 100baseFX
card. All are 64-bit PCI devices, except one single port model.

The Starfire would be a very nice chip were it not for the fact that
receive buffers have to be longword aligned. This requires buffer
copying in order to achieve proper payload alignment on the alpha.
Payload alignment is enforced on both the alpha and x86 platforms.
The Starfire has several different DMA descriptor formats and transfer
mechanisms. This driver uses frame descriptors for transmission which
can address up to 14 packet fragments, and a single fragment descriptor
for receive. It also uses the producer/consumer model and completion
queues for both transmit and receive. The transmit ring has 128
descriptors and the receive ring has 256.

This driver supports both FreeBSD/i386 and FreeBSD/alpha, and uses newbus
so that it can be compiled as a loadable kernel module. Support for BPF
and hardware multicast filtering is included.


49066 24-Jul-1999 wpaul

Convert the ASIX and Macronix drivers to newbus.


49064 24-Jul-1999 nsouch

Update intpm driver.

PR: kern/12631
Submitted by: Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp>


49036 23-Jul-1999 wpaul

Clean up the buffer allocation code a bit. Make sure to initialize certain
critical mbuf fields to sane values. Simplify the use of ETHER_ALIGN to
enforce payload alignment, and turn it on on the x86 as well as alpha
since it helps with NFS which wants the payload to be longword aligned
even though the hardware doesn't require it.

This fixes a problem with the ti driver causing an unaligned access trap
on the Alpha due to m_adj() sometimes not setting the alignment correctly
because of incomplete mbuf initialization.


49035 23-Jul-1999 wpaul

Grrr. Return the rman_get_bustag()/rman_get_bushandle() lines to their
proper place in ti_attach(). I'm positive I typed them in there, but
they must have fallen victim to a drive-by cut & pasting.


49017 23-Jul-1999 wpaul

One last tweak before I turn in for the evening: the driver name in
the driver_t declaration should be "skc" not "sk". Technically, "skc"
is the parent PCI device (the SysKonnect GEnesis controller) and "sk0"
and "sk1" are the network interfaces that get attached to it.


49012 23-Jul-1999 wpaul

Dangit. Somehow the pmap_kextract hack for alpha snuck back into these
files. Change them back to alpha_XXX_dmamap().

Pointed out by: Andrew Gallatin


49011 23-Jul-1999 wpaul

Convert the Alteon Tigon gigabit ethernet driver to newbus. Also upgrade
to the latest firmware release from Alteon (12.3.12).


49010 23-Jul-1999 wpaul

Some more small newbus cleanups. Remember to free all resources in case
of failures in foo_attach(), simplify iospace/memspace things a little.


49003 22-Jul-1999 julian

Revert out part of the last patch that can be done better elsewhere.
The complexity added isn't worth it.


49001 22-Jul-1999 wpaul

Remove the definitions for the SiS 900 chip. This is not a RealTek
clone after all. I have the datasheets for this part; hopefully I can
write a proper driver soon.


49000 22-Jul-1999 julian

fix braino..
accidentally replaced PAGE_MASK with PAGE_SIZE.
(PAGE_MASK is PAGE_SIZE - 1)
bug does not manifest itself on our hardware.....


48999 22-Jul-1999 wpaul

Well, it seems that loading a PCI driver module after the system has
been booted works too -- very neat. However I don't want the system to
stop for 5 seconds when the MII autoprobe is triggered in the xl and
tl drivers since that's lame. Instead, only use the hard delay when
we've been cold booted. If not, use the timeout mechanism instead.
(The SysKonnect driver doesn't use the same autonegotiation scheme, so
no change is required there.)


48992 22-Jul-1999 wpaul

Convert the ThunderLAN driver to newbus. Also add splimp() protection to
tl_stats_update().


48987 22-Jul-1999 wpaul

Fix a small mind-o: one instance of SYS_RES_IOPORT should have been
SYS_RES_MEMOTY in sk_detatch().


48973 22-Jul-1999 wpaul

Convert the SysKonnect gigabit ethernet driver to newbus.


48972 22-Jul-1999 wpaul

Small tweak to newbus changes: return error status on failure correctly
in xl_attach() (not a problem if the attach never fails, but if it does
the function would still return 0, which is wrong).


48955 21-Jul-1999 peter

Hopefully make the CMD640B workaround actually work.


48950 20-Jul-1999 julian

Slight cleanups of the Cyrix 5530 UDMA code.
Also includes a workaround fro an apparent chip bug
where UDMA mode 2 can overpower the UDMA engine enough that it will
hog the PCI bus to the exclusion of the processor.


48947 20-Jul-1999 wpaul

Convert the xl driver to newbus. It is now possible to make this driver
into a loadable module, and all of the platform dependencies are gone
(except for the alpha_XXX_dmamap() thing, which is another issue -- I
still don't know how to use the busdma stuff with a network driver).

Also increase the delay in xl_reset(); testing on a 486/66 with a 3c905C
shows that reading the EEPROM fails immediately after a reset. Waiting
a little longer after the reset completes seems to fix it.


48832 16-Jul-1999 msmith

Add support for multiple PCI busses directly connected to the nexus.
This is only partially complete, but allows 450NX-based systems with
more than one PCI bus to be used again.

Submitted by: dfr


48813 14-Jul-1999 wpaul

Make a few other cleanups while I'm in the area. Typo in comment, unused
structure members, etc. No functional changes.


48812 14-Jul-1999 wpaul

Revert some changes I had made to try and cut down on the number of TX EOF
interrupts that were scheduled. Testing shows it didn't really do very much
and it makes the code a little more complicated (which is never a good thing).

Also fix the rambuffer offset initialization for the 512K/64K SRAM case
(512K total using 64K chips). It should be 0. The only case with a
non-standard rambuffer offset address is 1024K/64K according to the
SysKonnect manual. (My card has the 1024/64 configuration and I don't know
which card uses the 512/64 configuration, if any, so I'm not sure that
this was really a problem for anyone.)


48799 13-Jul-1999 phk

dont allow open if no device was found.


48781 12-Jul-1999 roger

Bug fixes
Change number of VBI lines from 16 to 12 for NTSC formats.
Juha.Nurmela@quicknet.inet.fi found/fixed bug in VBI_SLEEP.

New features
MSP3430G DBX initialisation from Matt Brown <matt@dqc.org>
STB Bt878 card identification.
Hauppauge Model Number identification.
Changes to probeCard() for better eeprom identification.
Experimental TDA9850 initialisation code, from Linux bttv.

Cross Platform Changes
The driver has been reorgainsed based ideas from Brad Parker's port to Linux
to seperate OS Dependant and Independant sections.
I have backends for FreeBSD 2.2.x/3.x and 4.x newbus, BSDI, OpenBSD and NetBSD.

This commit has FreeBSD 2.2.8/2.2-stable/3.x and FreeBSD 4.x newbus backends.

Some code submitted by: Juha.Nurmela@quicknet.inet.fi
Matt Brown <matt@dqc.org>
Brad Parker <brad@parker.boston.ma.us>

Some code obtained from: Linux bttv driver


48745 11-Jul-1999 wpaul

Make the Winbond ethernet driver work on FreeBSD/alpha. Also added
bridging support while I was in the area.


48712 09-Jul-1999 wpaul

if_sk.c: use pci_port_t instead of u_short
if_skreg.h: use alpha_XXX_dmamap() instead of pmap_kextract hackery on
alpha platform


48693 09-Jul-1999 wpaul

This commit adds driver support for the SysKonnect SK-984x series
gigabit ethernet adapters. This includes two single port cards
(single mode and multimode fiber) and two dual port cards (also single
mode and multimode fiber). SysKonnect is currently the only
vendor with a dual port gigabit ethernet NIC.

The ports on dual port adapters are treated as separate network
interfaces. Thus, if you have an SK-9844 dual port SX card, you
should have both sk0 and sk1 interfaces attached. Dual port cards
are implemented using two XMAC II chips connected to a single
SysKonnect GEnesis controller. Hence, dual port cards are really
one PCI device, as opposed to two separate PCI devices connected
through a PCI to PCI bridge. Note that SysKonnect's drivers use
the two ports for failover purposes rather that as two separate
interfaces, plus they don't support jumbo frames. This applies to
their Linux driver too. :)

Support is provided for hardware multicast filtering, BPF and
jumbo frames. The SysKonnect cards support TCP checksum offload
however this feature is not currently enabled (hopefully it will
be once we get checksum offload support).

There are still a few things that need to be implemeted, like
the ability to communicate with the on-board LM80 voltage/temperature
monitor, but I wanted to get the driver under CVS control and into
-current so people could bang on it.

A big thanks for SysKonnect for making all their programming info
for these cards (and for their FDDI and token ring cards) available
without NDA (see www.syskonnect.com).


48675 08-Jul-1999 wpaul

Grrr.... forgot one line from the previous fix.


48673 07-Jul-1999 wpaul

Fix a potential race condition that can occur in xl_start(). If the NIC
clears out the transmit queue and zeroes the downlist pointer register,
but xl_txeof() isn't called before xl_start() tries to queue more packets,
xl_start() will think that the DMA is still in progress and not update
the downlist register again, thus causing packets to sit in the transmit
queue forever.

Patch provided by: Russell T Hunt <alaric@MIT.EDU>


48645 06-Jul-1999 des

Rename bpfilter to bpf.


48611 06-Jul-1999 mjacob

add in a boot environment isp_disable flag


48605 05-Jul-1999 mjacob

Wow- too much breakage..wait until you compile it, buckwheat...


48604 05-Jul-1999 mjacob

Oops- got sense of ifdef wrong


48600 05-Jul-1999 mjacob

add ISP_DISABLE_2200_SUPPORT defines; Add reference to 2200 F/W


48597 05-Jul-1999 wpaul

Remove ti_refill_rx_rings() and associated stuff; replace dirty RX buffers
in ti_rxeof() instead. This doesn't really seem to provide much in the
way of a performance boost, and I'm pretty sure it can cause mbuf leakage
in some extreme cases.


48557 04-Jul-1999 phk

Remove cmaj and bmaj args from DEV_DRIVER_MODULE.


48547 04-Jul-1999 peter

Minor nit - pn_cachesize is not a PN_RX_BUG_WAR varible.
Also, a minor tweak to get better struct packing.


48528 03-Jul-1999 peter

Eliminate a bunch of #include "pci.h" and #if NPCI > 0 around entire
files. config will leave the whole file out if configured to do so.


48523 03-Jul-1999 peter

Only have the pci component compiled if pci is specified at config.
Remove #if NPCI > 0 as a result.


48511 03-Jul-1999 phk

Bail after 5 attempts to read very noisy signals.


48489 02-Jul-1999 mjacob

Remove pre-CAM code. Add in getenv_int calls for variables isp_mem_map,
isp_io_map, isp_no_fwload, isp_fwload, isp_no_nvram, isp_fcduplex
which are all bitmaps of isp instances that should or shouldn't
map memory space, I/O space, not load f/w, load f/w, ignore nvram,
not ignore nvarm, set full duplex mode. Also have an isp_seed value
that we can use to generate a pseudo seed for a synthetic WWN.
Other minor cosmetic cleanup. Add in support for the Qlogic ISP
2200. Very important change where we actually check now to see
whether we were successful in mapping request and response queues
(and fibre channel scratch space).


48443 02-Jul-1999 peter

Change the cast in pci_map_port() from u_short * to pci_port_t * so it
compiles cleanly on the Alpha. (On the alpha, the port type is an int,
not a short).
Cast a couple of pointers to ints via 'uintptr_t' rather than 'unsigned
int' since uintptr_t is long (64 bit) on Alpha, as are pointers.


48432 01-Jul-1999 peter

#include <machine/md_var.h> to bring the prototype for
alpha_platform_assign_pciintr() into scope (!).


48424 01-Jul-1999 peter

#include <machine/md_var.h> to get prototype for alpha_register_pci_scsi().


48337 29-Jun-1999 roger

Stop signals being generated after meteor_close.
Update METEORSSIGNAL to disable signals by setting the signal to 0.

PR: i386/10533
Submitted by: Frode Vatvedt Fjeld <frodef@dslab7.cs.uit.no>


48197 24-Jun-1999 mjacob

(corrections for type change in softc)


48162 24-Jun-1999 jlemon

Allow the Ross host to PCI bridge to appear as a PCI bus. This permits
my Compaq 3000 to recognize the secondary bus.


48156 24-Jun-1999 jlemon

Compaq Smart RAID driver for -current. Based on the original ida.c
driver by Mark Dawson. This probably needs some work, but is stable
enough to boot a RAID-only configuration, and survive `make world'.


48101 22-Jun-1999 phk

Pass the current timecounter to pps_event().


48056 20-Jun-1999 wpaul

Tweak FIFO and DMA thresholds to improve performance and reduce likelyhood
of RX FIFO overruns.

Submitted by: bde


48028 19-Jun-1999 wpaul

Fix up the RealTek 8139 driver to work on FreeBSD/alpha. This involves a
few changes:

- there was a bug in rl_list_tx_init(): it was calculating the registers
to initialize incorrectly. Not a problem on the x86 where unaligned
access are allowed, but a problem on the alpha.

- set rl_btag accordingly depending on the machine type

- rl_rxeof() needs to be sure to longword-align the packet data. This
is a little tricky since we copy the data out of the receive buffer
using m_devget(), however there's no way to tell m_devget() to fill
in the mbufs starting at a particular offset. To get around this,
we tell m_devget to copy bytes+2 bytes starting at offset offset-2. This
results in the proper alignment, and we can trim off the two leading
bytes afterwards with m_adj(). We also allocate some extra space before
the start of the receive buffer so that we don't get into trouble in
the case where offset == 0.

- redefine vtophys() in if_rlreg.h for the alpha.

Making this chipset work on the alpha is sort of the inverse of putting
a jet engine on a rowboat (putting a propeller on a 747?) but when
you can get these things for $5 a pop, it's hard to stop people from
buying them.


48011 19-Jun-1999 wpaul

Add a transmit descriptor usage counter and use it to absolutely,
positively not let ti_encap() fill up the TX ring all the way and wrap
around. This fixes a potential transmit lockup where a really fast
machine (or particular TX traffic pattern) can overrun the end of the
ring.

Reported by: John Plevyak <jplevyak@inktomi.com>


47951 16-Jun-1999 n_hibma

Remove option USBVERBOSE
Add the options for debugging used in dev/usb/*.c

Submitted by: Kazu


47949 16-Jun-1999 wpaul

Grrr! The PNIC II's multicast hash table is only 128 bits wide, not 512
like the original PNIC and the MX98715A (from which the PNIC II is derived).
This requires special handling. Save the card type, and in mx_calchash(),
if we see that the card is a PNIC, return only the low 7 bits of the
hash instead of the low 9 bits.


47944 16-Jun-1999 billf

Fix non-benign typo.

Submitted by: Daniel Baker <dbaker@cuckoo.com>


47926 15-Jun-1999 des

Kill option FAILSAFE.

PR: i386/12187
Approved by: bde


47922 15-Jun-1999 roger

Add VIA Apollo Master VT82c570 chipset. (I have 2 of these)
Also, Apollo IDE controller has device ID of 1571 and 0571


47918 15-Jun-1999 newton

Ensoniq AudioPCI sound cards haven't worked since the newbus integration
because they haven't been able to attach. Now fixed.

Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>


47895 13-Jun-1999 n_hibma

1) Add the USB controllers (will now print pretty strings when no usb
support is compiled in)
2) Add probing for generic USB host controllers as well so we get them all
3) make the returned strings look alike in the whole file


47894 13-Jun-1999 n_hibma

Shorten the strings a bit (remove 'Host')


47891 13-Jun-1999 roger

Removed checking for unit>NBKTR.
No longer need when using device_get_softc.
(also fixed bug where loadable bktr module could only access 1st device)


47884 12-Jun-1999 roger

Updated to use the new 4.x newbus API
Also removed the BSDI support (for now)
This allows the driver to be loaded/unloaded as a KLD
and loaded in the boot loader phase whithout making a custom kernel.


47856 09-Jun-1999 ache

Add detection code for NVidia Riva 128,TNT,TNT2
(TNT2 from me)

PR: 12094
Submitted by: Ilya Naumov camel@avias.com


47735 04-Jun-1999 roger

Fix the cdevsw_add change made by PHK.
(It was accidentally added to the BSDI bktr_probe and not the
FreeBSD bktr_probe)


47723 04-Jun-1999 mharo

Add the 3Dfx Voodoo Banshee


47681 01-Jun-1999 wpaul

Change the warning message issued if pci_map_port() fails. I think this
happens if you have a BIOS with a 'Plug & Play OS' setting and you leave
it set to 'Yes.' This is wrong for FreeBSD (and LoseNT): it should be set
to 'No.' Apparently it's still possible to map the iobase of the NIC and
have the card work by reading the config space manually (which is what
the driver does if pci_map_port() fails) but we need to warn the user to
do fix their machine anyway. Anyway, warn the user to check the 'Plug &
Play OS' setting in their BIOS if mapping the io space fails.


47674 01-Jun-1999 roger

Updated to support new Meteor/PPB cards (PCI-PCI Bridge).
The driver now identifies the IBM PCI-PCI Bridge fitted to newer
Matrox cards and initialises it.

Sumitted by: Anton Berezin <tobez@plab.ku.dk>
The Protein Laboratory, University of Copenhagen


47646 31-May-1999 roger

On the new Meteor cards, the Philips SAA 7116 is connected to the PCI bus
via an IBM PCI-PCI bridge (82351 or 82352 or 82353)

The driver must identify if it is on a secondary PCI bus, which is
created via the IBM PCI-PCI bridge. If it is, then it must initialise
the IBM PCI-PCI bridge correctly.

To do this, the following new functions are added.
Because they use the pcici_t tag, they are considered 2.2 compatibility APIs
pcici_t * pci_get_parent_from_tag(pcici_t tag);
int pci_get_bus_from_tag(pcici_t tag);

(The _from_tag suffix is used to prevent clashes with similarly named
newbus PCI API functions)

Submitted by: Anton Berezin <tobez@plab.ku.dk>
Reviewed by: Doug Rabson <dfr@nlsystems.com>
Reworked by: Me (roger)


47640 31-May-1999 phk

Simplify cdevsw registration.

The cdevsw_add() function now finds the major number(s) in the
struct cdevsw passed to it. cdevsw_add_generic() is no longer
needed, cdevsw_add() does the same thing.

cdevsw_add() will print an message if the d_maj field looks bogus.

Remove nblkdev and nchrdev variables. Most places they were used
bogusly. Instead check a dev_t for validity by seeing if devsw()
or bdevsw() returns NULL.

Move bdevsw() and devsw() functions to kern/kern_conf.c

Bump __FreeBSD_version to 400006

This commit removes:
72 bogus makedev() calls
26 bogus SYSINIT functions

if_xe.c bogusly accessed cdevsw[], author/maintainer please fix.

I4b and vinum not changed. Patches emailed to authors. LINT
probably broken until they catch up.


47632 30-May-1999 wpaul

Add support for SiS 900 chipset (PCI ID 0x1039/0x0900), which appears to
be yet another rebadged RealTek 8139.


47628 30-May-1999 wpaul

Whoops, forgot to update xl_mediacheck() to account for the 3c905C.


47627 30-May-1999 wpaul

Head for the hills friends and neighbors, 3Com has yet another 3c90X
chipset. First you thrilled to the 3c905, then you trembled at the
3c905B, now gaze in wonder at: the 3c905C! This appears to be another
3c90X series chip called the Tornado (PCI ID 0x10B7/0x9200) and should
be equivalent (from the driver API perspective) to the 3c905B, so all
we have to do is add the PCI ID to the list.


47625 30-May-1999 phk

This commit should be a extensive NO-OP:

Reformat and initialize correctly all "struct cdevsw".

Initialize the d_maj and d_bmaj fields.

The d_reset field was not removed, although it is never used.

I used a program to do most of this, so all the files now use the
same consistent format. Please keep it that way.

Vinum and i4b not modified, patches emailed to respective authors.


47612 30-May-1999 dfr

In pci_alloc_resource() only check start and end to see if its a default.


47589 28-May-1999 wpaul

Fix support for the PNIC II. Earlier I had assumed that the PNIC II was
similar to the PNIC I (supported by the pn driver). In fact, it's really
a Macronix 98715A with wake on LAN support added. According to LinkSys,
the PNIC II was jointly developed by Lite-On and Macronis. I get the
feeling Macronix did most of the work. (The datasheet has the Macronix
logo on it, and is in fact nearly identical to the 98715 datasheet, except
for the extra wake on LAN registers.) In any case, the PNIC II works just
fine with the Macronix driver.

The changes are:

- Move PCI ID for the PNIC II from the pn driver to the mx driver.
- Mention PNIC II support in mx.4.
- Mention PNIC II support in RELNOTES.TXT and HARDWARE.TXT.


47548 27-May-1999 yokota

Print some diagnostic messages for the PCI-ISA bridge,
if bootverbose > 0.

Reviewed by: dfr


47544 27-May-1999 roger

Move BX PCI-PCI (AGP) bridge from chip_match to pcib_match
so it is reported correctly in dmesg.

Add 440 LX and 440 BX to the descriptions as these are the names
in common usage


47531 26-May-1999 gallatin

Remove redundant redefinition of vtophys(). This is already in if_pnreg.h


47530 26-May-1999 gallatin

Forgotten in previous commit:
Allow chipset drivers to specify the direct-mapped DMA window's mask in
preparation for tsunami support. Previous chipsets' direct-mapped DMA
mask was always 1024*1024*1024. The Tsunami chipset needs it to be
2*1024*1024*1024

Reviewed by: Doug Rabson <dfr@nlsystems.com>


47529 26-May-1999 gallatin

Allow chipset drivers to specify the direct-mapped DMA window's mask in
preparation for tsunami support. Previous chipsets' direct-mapped DMA
mask was always 1024*1024*1024. The Tsunami chipset needs it to be
2*1024*1024*1024

These changes should not affect the i386 port

Reviewed by: Doug Rabson <dfr@nlsystems.com>


47528 26-May-1999 wpaul

Two small tweaks:

- Clear the IFF_OACTIVE flag when al_txeof() runs down the last TX mbuf chain.
- Mark the workaround for the transmitter stalling bug with
#ifdef AL_TX_STALL_WAR/#endif.


47525 26-May-1999 gibbs

Ignore subvendor and subdevice ids for all ai7880 parts. These chips
only support 'mirroring' the vendor and device ids, so we don't
lose any information. Certain revisions of the aic7880 will not
perform the mirroring so to match all possiblities would double
the number of table entries. This change also allows us to match
things like the 2944B which I missed in the original table.


47521 26-May-1999 roger

Identify Intel 440 LX chipset motherboards


47505 25-May-1999 gibbs

All cards using aic789X chips use the new eeprom format.
Corrects bogus negotiation values on aic7890 based controllers.

PR: 11872


47496 25-May-1999 roger

Add OPTi 82c822 host to PCI bridge

This is an old OPTi chipset.
If you use a Bt878 card with this chipset, be sure to enable
the SIS/VIA chipset compatiblity mode workaround.

Tested By: Ben Laurie <ben@algroup.co.uk>


47492 25-May-1999 roger

Rename 849 to 849A (the correct name for the IC)


47491 25-May-1999 roger

Add support for the Bt878/Bt879's Intel 430 FX and
SIS/VIA/ OPTi chipset PCI bus workarounds.

These make the Bt878/879 chips stabler on certain
older and non-intel motherboards.

Use options BKTR_430_FX_MODE
or options BKTR_SIS_VIA_MODE
to enable these modes.

Also rename 849 to 849A


47458 24-May-1999 wpaul

Fix bug that can cause transmit corruption. There are actually two 'rings'
in the transmit code: the TX descriptor ring, and a 'shadow' ring of mbuf
pointers, one for each TX descriptor. When transmitting a packet that
consists of several fragments in an mbuf chain, we link each fragment
to a descriptor in the TX ring, but we only save a pointer to the mbuf
chain. This pointer is saved in the shadow ring entry which corresponds
to the first fragment in the packet. Later, ti_txeof() can release the
whole chain with a single m_freem() call. (We need the second ring to
keep track of the virtual addresses of the mbuf chains.)

The problem with this is that the Tigon isn't actually through with the
mbuf chain until it reaches the last fragment (which has the TI_BDFLAG_END
bit set), however the current scheme releases the mbuf chain as soon as
the first fragment is consumed. This is wrong, since the mbufs can then
be yanked out from under the Tigon and modified before the other fragments
can be transmitted.

The fix is to make a one line change to ti_encap() so that it saves the
mbuf chain pointer in the shadow ring entry that corresponds to the last
fragment in TX ring instead of the first. This prevents the mbufs from
being released until the last fragment is transmitted.

Painstakingly diagnosed and fixed by: Robert Picco <picco@mail.wevinc.com>
Brought to my attention by: dg


47439 23-May-1999 roger

Added rgb_vbi_prog() to capture VBI data and video at the
same time. To capture VBI data, /dev/vbi must be opened
before starting video capture.
A partly on code from Hiroki Mori <mori@infocity.co.jp>


47411 22-May-1999 gibbs

First cut at a driver for the amd53c974 PCI SCSI host adapter. This
driver lacks error recovery and still needs more testing, but it's
about time I got it under revision control.

Submitted by: Tekram Inc.
Bus Space/DMA and cleanup: gibbs


47384 22-May-1999 semenu

Move arpcom structure be the first in softc structure. Needed
for ether_ioctl.

PR: pending/11754


47380 22-May-1999 bde

Restored rev.1.76 which was clobbered by rev.1.77.


47376 21-May-1999 wpaul

Remove some #ifdef'ed code. The ADMtek doesn't have a 'enable reception of
broadcast frames' bit, so we don't need any code in al_init() to set/clear
it.


47374 21-May-1999 ken

Fix a memory leak and a double free that could happen in certain error
cases. These were unlikely to happen in normal operation.

Noticed by: "Christopher R. Bowman" <crb@ChrisBowman.com>


47351 21-May-1999 wpaul

Ack! Cut & paste-o: xl -> al


47350 21-May-1999 wpaul

This commit adds driver support for PCI fast ethernet cards based on the
ADMtek AL981 "Comet" chipset. The AL981 is yet another DEC tulip clone,
except with simpler receive filter options. The AL981 has a built-in
transceiver, power management support, wake on LAN and flow control.
This chip performs extremely well; it's on par with the ASIX chipset
in terms of speed, which is pretty good (it can do 11.5MB/sec with TCP
easily).

I would have committed this driver sooner, except I ran into one problem
with the AL981 that required a workaround. When the chip is transmitting
at full speed, it will sometimes wedge if you queue a series of packets
that wrap from the end of the transmit descriptor list back to the
beginning. I can't explain why this happens, and none of the other tulip
clones behave this way. The workaround this is to just watch for the end
of the transmit ring and make sure that al_start() breaks out of its
packet queuing loop and waiting until the current batch of transmissions
completes before wrapping back to the start of the ring. Fortunately, this
does not significantly impact transmit performance.

This is one of those things that takes weeks of analysis just to come
up with two or three lines of code changes.


47342 20-May-1999 n_hibma

Add comment about split in driver


47339 20-May-1999 gallatin

Add support for multiple PCI "hoses" used on various alpha platforms.
The specific intent of this commit is to pave the way for importing
Compaq XP1000 support. These changes should not affect the i386 port.

Reviewed by: Doug Rabson <dfr@nlsystems.com>
(actually, he walked me through most of it & deserves more than reviewd-by
credit )


47327 19-May-1999 roger

Updated Australian channel frequencies

Submitted by: Ivan Brawley <brawley@internode.com.au>


47307 18-May-1999 peter

Move pcibus (host -> pci bus) probe/attach routines from nexus
to pcibus.c. pci_cfgopen() becomes static and there are no more
bus #ifdef's in nexus.c.


47298 18-May-1999 roger

Bt848 driver release 1.65
Change Intel GPIO mask to hopefully stop turning the Intel Camera off
Fixed tuner selection on Hauppauge card with tuner 0x0a
Replaced none tuner with no tuner for Theo de Raadt <deraadt@openbsd.org>.

Ivan Brawley <brawley@internode.com.au> added
the Australian channel frequencies.


47275 17-May-1999 gibbs

Add a masking scheme to allow for detection of unknown cards using a
chip we think we understand.

Correct identification entry for the AHA2950U2.


47192 14-May-1999 gibbs

Use a lookup table for device matching instead of a switch on a 64bit
value. EGCS generates poor code for sparse switch statements on 64bit
values.

Requested by: bde


47159 14-May-1999 gibbs

Take the subvendor and subdevice ids into account during device probe.
Sync up device Ids with the master Adaptec list.

Add probe support for the 2940 Pro although it isn't obvious that
all of the termination support is correct for this adapter yet.


47125 13-May-1999 wpaul

Remove unneeded line of code that got left behind when I converted this
driver to use bus_space_read_foo()/bus_space_write_foo(). The line is not
visible unless you compile the driver to use PCI memory mapped mode, which
not done by default, but it should be fixed anyway.


47102 13-May-1999 bde

memcmp -> bcmp. memcmp doesn't exist in the kernel, but unfortunately
it exists as a gcc builtin provided the kernel is not compiled with
-O0 or -fno-builtin.


47019 11-May-1999 peter

Take a shot at handling INTR_FAST and INTR_EXCL for CY_PCI_FASTINTR.
Bruce suggested a patch before but that was based on the old DRIVER_TYPE_*
interfaces.


46993 11-May-1999 peter

Use the probe priority mechanism to make sure the chip* probes do not
displace a real driver.
Revert rev 1.109.
Pick up a few things from elsewhere (a couple of SiS id's).

As an *experiment*, have the chip* driver claim (for reporting purposes)
IDE controllers if there isn't another PCI-aware ide or ata driver to
grab them. I've exported the match function since it could be used from
the ata-all.c code replacing ata_pcimatch() - but I have not touched the
ata code. I'd like to catch a few more devices this way, including USB
and other bridges etc.


46964 11-May-1999 mjacob

Clean up 2.2.X support (which might have to be cleaned up again
after some of the previous commits). Add in support for the 1240
dual channel ISP card. Try the dance of unmapping a PCI interrupt
if we don't configure (if that ever works it'll be helpful).


46934 10-May-1999 paul

Set the bus master bit.
Submitted by: Ted Faber


46917 10-May-1999 dfr

Add missing suspend/resume methods.


46909 10-May-1999 peter

Fix 'assignment used as truth value' on alpha.


46896 10-May-1999 peter

#include "pci.h" for the build dir, not <pci.h>


46895 10-May-1999 n_hibma

Remove VIA USB controller (was '#if 0' out), to make sure
no one adds it back. Chip handled by uhci_pci.c .


46879 10-May-1999 bde

Detect PCI device IDs for latest boards. Simplified the ID comparisons.

Submitted by: Ivan Passos <ivan@cyclades.com> (rewritten by me)


46877 10-May-1999 roger

Support LifeView FlyVideo 98 cards. Use EEPROM for card autodetection.Use
bttv's audio mux values.

Automatically locate the EEPROM i2c address and read the subsystem_vendor_id
from EEPROM and not the PCI registers.

Add NSMBUS checks around smbus/iicbus i2c bus code

Add GPIO mask for the audio mux to each card type.
Add CARD_ZOLTRIX and CARD_KISS from mailing list searches.

Tested by: Paul Reece <paul@fastlane.net.au>,
Ivan Brawley <brawley@internode.com.au> and
Gilad Rom <rom_glsa@ein-hashofet.co.il>


46876 10-May-1999 roger

Update card type to support GPIO mask

Add NSMBUS checks around smbus/iicbus i2c bus code.


46875 10-May-1999 roger

Add #if (NSMBUS>0) checks around smbus/iicbus i2c bus code.


46851 10-May-1999 peter

#if 0 some unused code (debug?) to quiet a warning.


46843 09-May-1999 se

Really support Ultra-2 chips. Symbios redefined a register that
was available to the programmer to hold chip state information:

Use the SDID register instead of CTEST3. This change actually
simplifies the SCRIPTS code, but I'm not absolutely sure, that
it is OK for all variants of NCR chips around and all device
combinations. I have had this code running on several systems
with 53c810, 875 and 895 controllers for several months.

Suggested by: Gerard Roudier <groudier@club-internet.fr>


46832 09-May-1999 peter

For the ioctl that reads the pci configuration, look up the name and unit
on the fly so that we can see the driver assignment of new pci devices
as well in the 'pciconf -l' display.


46831 09-May-1999 peter

GC unused variable in struct.


46814 09-May-1999 peter

Missing revision markers.


46813 09-May-1999 peter

Simplify the COMPAT_PCI_DRIVER/DATA_SET hack. We can add:
#define COMPAT_PCI_DRIVER(name,data) DATA_SET(pcidevice_set,data)
.. to 2.2.x and 3.x if people think it's worth it. Driver writers can do
this if it's not defined. (The reason for this is that I'm trying to
progressively eliminate use of linker_sets where it hurts modularity and
runtime load capability, and these DATA_SET's keep getting in the way.)


46804 09-May-1999 peter

Make the pci vga detection work so that the card is claimed and it's
interrupt configuration reported. (I just discovered my vga card is
being configured for irq 5... :-) This is just reporting. The vga_isa
driver does the real work using the isa compat mappings.


46801 09-May-1999 peter

Argh, don't clobber the pci device list if there are multiple busses!
(An AGP counts as a PCI bus, it seems...)
This stopped 'pciconf -l' from working on AGP or PCI->PCI bridge systems.


46782 09-May-1999 peter

Fix two warnings.


46781 09-May-1999 peter

Fix warnings.


46777 09-May-1999 phk

fix some DRIVER_TYPE / INTR_TYPE confusions.


46743 08-May-1999 dfr

Move the declaration of the interrupt type from the driver structure
to the BUS_SETUP_INTR call.


46735 08-May-1999 peter

Fix a typo (eisa<->isa) and some minor cosmetics.


46730 08-May-1999 peter

Print 'irq nn' on the device attach line like the old pci code did.
However, we are not printing 'int a/b/c/d' yet, is it worth it on non-SMP
systems? (It's useful when tracing PCI->IO-APIC routing on SMP systems)


46712 08-May-1999 peter

GC pci_bushigh() - no longer used.


46701 08-May-1999 peter

Oops, committed wrong version..


46699 08-May-1999 peter

Fix a couple of newbus merge problems:
Restore 0x710110b9 ("AcerLabs M15x3 Power Management Unit") - but only
if NALPM == 0.
Restore 0x00051166 ("Ross (?) host to PCI bridge") so that
fixbushigh_Ross() gets called.
Delete generic_pci_bridge(), it's been replaced by other mechanisms (see
the isab and pcib match/probes and the pci_bridge_type() function)


46651 07-May-1999 peter

Update intpm driver.

PR: 11531
Submitted by: Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp>


46645 07-May-1999 peter

Minor style nit (this minor style.9 violation caused a grep miss here)


46612 07-May-1999 julian

My 5520 turned out to be a 5510 in disguise.. correct the probe message.


46591 06-May-1999 peter

Fix a goof on my part; s/struct moduledata */struct module */


46590 06-May-1999 peter

Fix some variable naming confusion


46587 06-May-1999 julian

Add Cyrix (NatSemi) 5520 and 5530 PCI-ISA bridges.


46581 06-May-1999 ken

Add a number of interrelated CAM feature enhancements and bug fixes.

NOTE: These changes will require recompilation of any userland
applications, like cdrecord, xmcd, etc., that use the CAM passthrough
interface. A make world is recommended.

camcontrol.[c8]:
- We now support two new commands, "tags" and "negotiate".

- The tags commands allows users to view the number of tagged
openings for a device as well as a number of other related
parameters, and it allows users to set tagged openings for
a device.

- The negotiate command allows users to enable and disable
disconnection and tagged queueing, set sync rates, offsets
and bus width. Note that not all of those features are
available for all controllers. Only the adv, ahc, and ncr
drivers fully support all of the features at this point.
Some cards do not allow the setting of sync rates, offsets and
the like, and some of the drivers don't have any facilities to
do so. Some drivers, like the adw driver, only support enabling
or disabling sync negotiation, but do not support setting sync
rates.

- new description in the camcontrol man page of how to format a disk
- cleanup of the camcontrol inquiry command
- add support in the 'devlist' command for skipping unconfigured devices if
-v was not specified on the command line.
- make use of the new base_transfer_speed in the path inquiry CCB.
- fix CCB bzero cases

cam_xpt.c, cam_sim.[ch], cam_ccb.h:

- new flags on many CCB function codes to designate whether they're
non-immediate, use a user-supplied CCB, and can only be passed from
userland programs via the xpt device. Use these flags in the transport
layer and pass driver to categorize CCBs.

- new flag in the transport layer device matching code for device nodes
that indicates whether a device is unconfigured

- bump the CAM version from 0x10 to 0x11

- Change the CAM ioctls to use the version as their group code, so we can
force users to recompile code even when the CCB size doesn't change.

- add + fill in a new value in the path inquiry CCB, base_transfer_speed.
Remove a corresponding field from the cam_sim structure, and add code to
every SIM to set this field to the proper value.

- Fix the set transfer settings code in the transport layer.

scsi_cd.c:

- make some variables volatile instead of just casting them in various
places
- fix a race condition in the changer code
- attach unless we get a "logical unit not supported" error. This should
fix all of the cases where people have devices that return weird errors
when they don't have media in the drive.

scsi_da.c:

- attach unless we get a "logical unit not supported" error

scsi_pass.c:

- for immediate CCBs, just malloc a CCB to send the user request in. This
gets rid of the 'held' count problem in camcontrol tags.

scsi_pass.h:

- change the CAM ioctls to use the CAM version as their group code.

adv driver:

- Allow changing the sync rate and offset separately.

adw driver

- Allow changing the sync rate and offset separately.

aha driver:

- Don't return CAM_REQ_CMP for SET_TRAN_SETTINGS CCBs.

ahc driver:

- Allow setting offset and sync rate separately

bt driver:

- Don't return CAM_REQ_CMP for SET_TRAN_SETTINGS CCBs.

NCR driver:

- Fix the ultra/ultra 2 negotiation bug
- allow setting both the sync rate and offset separately

Other HBA drivers:
- Put code in to set the base_transfer_speed field for
XPT_GET_TRAN_SETTINGS CCBs.

Reviewed by: gibbs, mjacob (isp), imp (aha)


46573 06-May-1999 peter

Missing 'int' in declaration of variables.


46568 06-May-1999 peter

Add sufficient braces to keep egcs happy about potentially ambiguous
if/else nesting.


46561 06-May-1999 wpaul

Tweak the Macronix driver to hopefully make it more reliable:

- Change to the same transmit scheme as the PNIC driver.
- Dynamically set the cache alignment, and set burst size the same as
the PNIC driver in mx_init().
- Enable 'store and forward' mode by default. This is the slowest option
and it does reduce 100Mbps performance somewhat, but it's the most
reliable setting I can find. I'm more interested in having the driver
work reliably than trying to squeeze the best performance out of it.
The reason I'm doing this is that on *some* systems you may see a lot
of transmit underruns (which I can't explain: these are *fast* test
systems) and these errors seem to cause unusual and decidedly
non-tulip-like behavior. In normal 10Mbps mode, performance is fine
(you can easily saturate a 10Mbps link).

Also tweak some of the other drivers:

- Increase the size of the TX ring for the Winbond, ASIX, VIA Rhine
and PNIC drivers.
- Set a larger value for ifq_maxlen in the ThunderLAN driver. The setting
of TL_TX_LIST_CNT - 1 is too low (the ThunderLAN driver only allocates
20 transmit descriptors, and I don't want to fiddle with that now
because the ThunderLAN's descriptor structure is an oddball size
compared to the others).


46514 05-May-1999 wpaul

Dynamically increase TX start threshold if TX underruns are detected.


46448 04-May-1999 wpaul

Fix the media selection for the 3c900B-FL 10baseFL adapter. It actually
uses the AUI port with an on-board AUI to 10baseFL transceiver, not the
10baseT port like I had earlier suspected. The 3c900B-FL should be properly
supported now.


46364 03-May-1999 wpaul

Upgrade firmware images Alteon's latest release (12.3.10). This fixes a
bug in the stats accounting (nicSendBDs counter was bogus when TX ring was
configured to be in host memory).

Update if_tireg.h to look for new firmware fix level.


46356 03-May-1999 dfr

Changes to support diskless booting on the alpha:
* Make the network code in the bootstrap more chatty (helps debugging)
* Add nfs root stuff to cpu_rootconf(). I also added a check to make sure
it really was netbooting which allows the use of the same kernel for local
and network boots.
* Tweak the de driver so that it takes the speed setting from the console
for the alpha (some PWSs have broken de chipsets). This is the same
behaviour as NetBSD/alpha.

Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>


46335 02-May-1999 peter

Make this compile with CY_PCI_FASTINTR again.


46253 02-May-1999 nate

- Added PCI identification support for the TI1251 PCI/CardBus bridge.
With this addition my ThinkPad 600E works with the stock FreeBSD
PCMCIA code.


46236 01-May-1999 n_hibma

Move the disabling of interrupts right before the allocation of the
resource. Avoids useless interrupts occurring between the allocation
of the interrupt resource and the final initialisation of the
kernel. Cause of these interrupts is unknown (a resuming device?).


46204 30-Apr-1999 wpaul

Bunch of updates:

- Try to unbreak what I broke by screwing with the tx queuing again.
I'm waiting for a few more people to test out this code and report back
before I move it into current. Hopefully it will be soon. Basically I
reverted to the old TX queuing strategy.

- Add experimental support for the 3c900B-FL (10mbps ST fiber). The card
should be detected properly and the 10baseFL mode supported, but again
I'm still waiting for word from a tester to see if this actually works.
It shouldn't affect the other cards though; all the differences are in
media selection.

- Set the TX start threshold register to get better performance.

- Increase the size of the RX and TX rings. UDP performance was pretty
bad because the TX ring was too small. Should be substantially better
now (I can saturate the link with either TCP or UDP now).

- Change some of the #defines to reflect proper 3Com ASIC names (boomerang,
cyclone, krakatoa, hurricane).

- Simplify and reorganize interrupt handler; ack all interrupts right
away and then process them. This avoids a potential race condition.
(Noted by Matt Dillon.)

- Reorganize the bridging code to eliminate using a goto to jump into
the middle of an if() {} clause. Sorry, that just made my brain itch.

- Use m_adj() in xl_rxeof().

- Make the payload alignment in xl_newbuf() the default (instead of
just conditionally defined for the alpha) to improve NFS performance
(avoids need for nfs_realign()).


46199 30-Apr-1999 roger

My last commit accidentally undid the changes made in rev 1.68
regarding COMPAT_PCI_DRIVER. Put them back.


46177 29-Apr-1999 wpaul

Add a test to ti_encap() to try and prevent the transmit producer index
from ever catching up to the transmit consumer index. We can't let this
happen because ti_txeof() depends on the assumption that producer == consumer
means the ring is empty, and producer != consumer means the ring has some
number of active descriptors in it.


46176 29-Apr-1999 roger

Added initial code for VBI capture based on work by
Hiroki Mori <mori@infocity.co.jp> and reworked by myself.
This allows software decoding of teletext, intercast and
subtitles via /dev/vbi.


46175 29-Apr-1999 roger

Add support for VBI capture from /dev/vbi.
This will allow software teletext/intercast/subtitles decoding
while watching a TV station.

Based on code from Hiroki Mori <mori@infocity.co.jp> but reworked by
myself.


46174 29-Apr-1999 roger

Added new cards: NEC PK-UG-X017 and I/O DATA GV-BCTV2/PCI
Added new tuner: ALPS_TSBH1 (plus FM Radio for ALPS_TSCH5)
Added support for BCTV audio mux.

Submitted by Hiroki Mori <mori@infocity.co.jp>


46164 29-Apr-1999 roger

Fix crashes caused by rows=0 or columns=0.
Add new #ifdef. By defining BKTR_NO_MSP_RESET you can prevent the
MSP34xx being reset by the bt848 driver. This is handy
if you pre-initialise the MSP34xx stereo audio chip in another
operating system first (eg MS Windows).
Suggested by: Randal Hopper<aa8vb@ipass.net>
Suggested by: Yuri Gindin <yuri@xpert.com>


46153 28-Apr-1999 dt

s/static foo_devsw_installed = 0;/static int foo_devsw_installed;/.
(Edited automatically)


46024 24-Apr-1999 peter

Use COMPAT_PCI_DRIVER() for registration if it exists. This shouldn't
hurt the driver portability to 3.x too much for where drivers are shared.


46023 24-Apr-1999 peter

Replace the pcidevice_set linker set based configuration mechanism for old
style pci drivers with a simple one-line change to use a module that
registers itself under new-bus and should in theory enable just about all
of the pci drivers to be loadable (kldload and loader(8)) but without
having the impact of converting the APIs yet.

This also fixes the problem of having undefined variables when only
new-style pci drivers are present.


46022 24-Apr-1999 peter

Zap some #if 0 code for wired PCI devices. This will look quite different
under new-bus.


45969 23-Apr-1999 gibbs

ahc_pci.c:
Convert to new bus and bus dma.
Use latest PCI API.

bt_pci.c:
Fix a few bugs in how resourses are released left over from
when this driver was converted to new bus.


45897 21-Apr-1999 peter

Stage 1 of a cleanup of the i386 interrupt registration mechanism.
Interrupts under the new scheme are managed by the i386 nexus with the
awareness of the resource manager. There is further room for optimizing
the interfaces still. All the users of register_intr()/intr_create()
should be gone, with the exception of pcic and i386/isa/clock.c.


45862 20-Apr-1999 kato

Recognize PC-98 16-bits bus (C-bus) as ISA bus. Because class number
of the C-bus is not assigned, PCI to C-bus bridges were recognized as
generic PCI bridges.


45793 18-Apr-1999 jkh

Add entries for Intel 82443GX chipset.

Submitted by: Steinar Haug <sthaug@nethelp.no>


45791 18-Apr-1999 peter

Implement an EISA new-bus framework. The old driver probe mechanism
had a quirk that made a shim rather hard to implement properly and it was
just easier to convert the drivers in one go. The changes to the
buslogic driver go beyond just this - the whole driver was new-bus'ed
including pci and isa. I have only tested the EISA part of this so far.

Submitted by: Doug Rabson <dfr@nlsystems.com>


45749 17-Apr-1999 dfr

Probe the SiS 85c503 as a PCI-ISA bridge.


45739 17-Apr-1999 peter

Well folks, this is it - The second stage of the removal for build support
for LKM's..


45720 16-Apr-1999 peter

Bring the 'new-bus' to the i386. This extensively changes the way the
i386 platform boots, it is no longer ISA-centric, and is fully dynamic.
Most old drivers compile and run without modification via 'compatability
shims' to enable a smoother transition. eisa, isapnp and pccard* are
not yet using the new resource manager. Once fully converted, all drivers
will be loadable, including PCI and ISA.

(Some other changes appear to have snuck in, including a port of Soren's
ATA driver to the Alpha. Soren, back this out if you need to.)

This is a checkpoint of work-in-progress, but is quite functional.

The bulk of the work was done over the last few years by Doug Rabson and
Garrett Wollman.

Approved by: core


45707 16-Apr-1999 ghelmer

Add bridging support (tested in 3.1-RELEASE by Steven Vetzal
<svetzal@icom.ca>).


45693 15-Apr-1999 wpaul

- Close PR #11136: add PCI ID for another new cyclone device: the
3c900B-TPC (twisted pair and coax). Treated similarly to the
3c900B-COMBO, except no AUI port.

- Fix media selection so that it's possible to select the AUI and BNC
ports on the 3c905B-COMBO. This board is now fully supported.

- Change TX queueing strategy to hopefully be more efficient by avoiding
register accesses in xl_start(). Should provide small performance
improvement and a little better reliability.


45692 15-Apr-1999 alex

Added missing newline to "no ports found!" message.


45686 14-Apr-1999 wpaul

Grrr. Make all modes work properly with the 82c168 chip and built-in
transceiver. Note in the manual page that autoselection doesn't
work on the 82c168 because the built-in NWAY support is horribly
broken. Manual mode selection works fine, but autoneg is broken for
everything except maybe 10Mbps half-duplex. There's no simple way
to fix this at the moment, so I have to settle for documenting the
bug for now. Fortunately, there aren't anywhere near as many 82c168
boards around as there are 82c169s.


45667 13-Apr-1999 peter

Build the functionality of the wdc_p hack into the ide_pci.c code.
All it did was match a specific device ID and turn on a quirk for
the wdc driver.

Incidently, at line 1462 there is a return that prevents the generic
ide_pci code from trying to look at the device. I'd be interested
to know if we can take out the return and let the generic code "see" it.
I've left the return in because that's the way it worked before.

(Be sure to rerun config after cvsup or you'll get undefined files!)


45666 13-Apr-1999 peter

Shoot the LKM support in the old wd/wdc/atapi driver set in the head and
perform a cleanup/unifdef sweep over it to tidy things up. The atapi
code is permanently attached to the wd driver and is always probed.

I will add an extra option bit in the flags to disable an atapi probe on
either the master or slave if needed, if people want this.

Remember, this driver is destined to die some time. It's possible that
it will loose all atapi support down the track and only be used for
dumb non-ATA disks and all ata/atapi devices will be handled by the new
ata system.

ATAPI, ATAPI_STATIC and CMD640 are no longer options, all are implicit.

Previously discussed with: sos


45657 13-Apr-1999 wpaul

Some more fixes:

- It turns out that the 'promiscuous mode' bug what I discovered with the
PNIC is not restricted to promiscuous mode. I've been doing some remote
debugging for someone with a P75 system, and at 100Mbps, the receiver
screws up even when the NIC is in normal mode. Thus, enable the workaround
for this bug all the time. Note that the workaround is still not enabled
for the PNIC II, since I haven't tested one yet.

- Set the 'arbitration' bit in the bus configuration register and set the
maximum burst size to 16 longwords. This seems to fix problems with
transmit corruption on the P75 system mentioned above. (It probably hurts
performance a bit too, but I've given up trying to make the PNIC perform
well.)


45633 12-Apr-1999 wpaul

Merge in some updates for the RealTek driver, mainly:

- Rewrite the transmit section to be a little less bogus.
- Set ifq_maxlen correctly. RL_TX_LIST_CNT - 1 is wrong, because for the
RealTek, RL_TX_LIST_CNT is 4. Set it to IFQ_MAXLEN instead.


45631 12-Apr-1999 wpaul

Grr... don't touch the PN_GEN (general purpose) register in pn_setcfg()
unless this is a NIC without an MII-based PHY (i.e. an older LinkSys
LNE100TX).


45629 12-Apr-1999 wpaul

Add support for the 3cSOHO100-TX, which is a "hurricane" chipset
(cut-down version of the "cyclone" for the small office/home office
"cheap bastard" market). Basically the same as a 3c905B but without
Wake-on-LAN, ROM socket, etc...


45610 12-Apr-1999 wpaul

Minor tweak: move initialiation of busctl register to before setting of
the cache alignment bits.


45601 11-Apr-1999 wpaul

Some small updates:

- Wait longer for the reset to complete in xl_attach() to try and avoid
'command never completed' warnings.

- Clean up a few odds and ends in xl_attach().

- Add PCI ID for the 3c905B-COMBO (a new card). Right now this is
treated as a 3c905B; I need to dig up one of these cards for testing
before I can make the AUI and BNC ports work.

- Add a hack to force reading the I/O address directly from the PCI
registers if pci_map_port() fails. I SHOULD NOT HAVE TO DO THIS:
SOMEBODY WITH MORE PCI CLUES THAN I SHOULD INVESTIGATE WHY THIS
HAPPENS.


45593 11-Apr-1999 n_hibma

Changed pci_config_read() to pci_map_port(). Pointed out by Doug Rabson.


45584 11-Apr-1999 wpaul

Enable the promiscuous mode workaround for the PNIC 82c168 chip, which
appears to need it.


45573 11-Apr-1999 eivind

Staticize.


45571 11-Apr-1999 eivind

pci_register_lkm can fail gracefully, so let it do that when there is
no more memory (M_WAITOK -> M_NOWAIT). It may be called early enough
during boot that M_WAITOK isn't OK. (In theory - right now it isn't called
from anywhere).


45551 10-Apr-1999 wpaul

Finally add support for the older 82c168 PNIC chip with the built-in
transceiver. Thanks to Brian Walenze for donating a NIC with this chip
on it (LinkSys didn't really sell that many of them and they're not
in production anymore). The driver now distinguishes between the
82c168 and 82c169 when probing. If no MII transceiver is detected,
it switches over to using the internal one.


45484 08-Apr-1999 wpaul

Make ASIX driver work on FreeBSD/alpha, add to GENERIC.


45482 08-Apr-1999 wpaul

Add PCI IDs for the Compex RL100-TX, which uses the Macronix 98713 chip.


45407 07-Apr-1999 msmith

Remove inactive pmap_setdevram()/pmap_setvidram consumer code.


45394 06-Apr-1999 n_hibma

fix typo


45391 06-Apr-1999 wpaul

Remove teensy-weensy bit of debug code that crept in.

Oh, I forgot to mention: this driver also works on FreeBSD/alpha (big
thanks to Andrew Gallatin). And there is a 2.2.x version available for
those who stubbornly refuse to upgrade.


45386 06-Apr-1999 wpaul

Add driver support for gigabit ethernet adapters based on the Alteon
Networks Tigon 1 and Tigon 2 chipsets. There are a _lot_ of OEM'ed
gigabit ethernet adapters out there which use the Alteon chipset so
this driver covers a fair amount of hardware. I know that it works with
the Alteon AceNIC, 3Com 3c985 and Netgear GA620, however it should also
work with the DEC/Compaq EtherWORKS 1000, Silicon Graphics Gigabit
ethernet board, NEC Gigabit Ethernet board and maybe even the IBM and
and Sun boards. The Netgear board is the cheapest (~$350US) but still
yields fairly good performance.

Support is provided for jumbo frames with all adapters (just set the
MTU to something larger than 1500 bytes), as well as hardware multicast
filtering and vlan tagging (in conjunction with the vlan support in
-current, which I should merge into -stable soon). There are some hooks
for checksum offload support, but they're turned off for now since
FreeBSD doesn't have an officially sanctioned way to support checksum
offloading (yet).

I have not added the 'device ti0' entry to GENERIC since the driver
with all the firmware compiled in is quite large, and it doesn't really
fit into the category of generic hardware.


45280 04-Apr-1999 mjacob

Read the board revision and trim cache line size back from 16 to 1
for early revision 2100 boards. Make sure to turn ROM off for these
boards.


45233 01-Apr-1999 nsayer

Import PCI pccard bridge chip probing from PAO. Hopeful prelude for
broadening chipset support in -current.

Reviewed by: joerg
Obtained from: PAO


45213 01-Apr-1999 wpaul

Make the Macronix driver work on FreeBSD/alpha and add to GENERIC.
Like the PNIC, we have to copy packet headers in the receive handler
because the chip will only DMA to longword aligned buffers.

Also do some mindor cleanups.


45198 31-Mar-1999 wpaul

Shorten device names so that the pci probe lines don't exceed 80 chars
and wrap to a second line.

Put 'command never completed' message inside #ifdef DIAGNOSTIC/#endif to
stop people worrying about it (it's harmless).


45189 31-Mar-1999 nsayer

Add support for bridging to if_tx.c

PR: 10534
Submitted by: nsayer


45166 31-Mar-1999 wpaul

Insert ifmedia_set() that I forgot and put in the vtophys() hack for
the alpha. Now the ThunderLAN driver works on the alpha (both my
sample cards check out.) Update the alpha GENERIC config to include
ThunderLAN driver now that I've tested it.


45157 30-Mar-1999 wpaul

Fix a line wrap bogon.


45155 30-Mar-1999 wpaul

Various updates for the ThunderLAN driver:

- When trying to map ports, if mapping TL_PCI_LOIO or TL_PCI_LOMEM fails,
try mapping the other one. Apparently, some ThunderLAN parts swap these
two registers while others don't.

- Add support for bitrate (non-MII) PHYs. If no MII-based PHY is found,
program the chip for bitrate mode. This is required for the TNETE110
part, which doesn't have MII support. (It's also obsolete, but there
are still some people out there who have them.) With this change and the
change above, the Compaq Netflex-3/P 10baseT/BNC board works correctly.
(Thanks to Matthew Dodd for getting me one of these cards.)

- Convert to bus_space_foo() for register accesses.

- Add changes to support FreeBSD/Alpha. I still have to actually test
this in my Alpha box so I'm not going to update /sys/alpha/conf/GENERIC
yet.


45072 28-Mar-1999 grog

Add support for SiS 5591/5595 chipset.

Contributed-by: "Richard Seaman, Jr." <dick@tar.com>

Tested-by: Chris Piazza <cpiazza@home.net>
Tugrul Galatali <tugrul@ianai.BlackSun.org>
grog

This code includes lots of stuff for verbose probing. I'm not 100%
sure that the output of the verbose probe is correct, but everything
else works fine, and -CURRENT was broken for the 5591 before, so I'm
committing it anyway.


45068 27-Mar-1999 n_hibma

Cleaning up of code, remove unneeded cruft and make
code more compact.


45062 27-Mar-1999 wpaul

Make the xl and pn drivers work on FreeBSD/alpha and add them to
sys/alpha/conf/GENERIC.

Note: the PNIC ignores the lower few bits of the RX buffer DMA address,
which means we have to add yet another kludge to make it happy. Since
we can't offset the packet data, we copy the first few bytes of the
received data into a separate mbuf with proper alignment. This puts
the IP header where it needs to be to prevent unaligned accesses.

Also modified the PNIC driver to use a non-interrupt driven TX
strategy. This improves performance somewhat on x86/SMP systems where
interrupt delivery doesn't seem to be as fast with an SMP kernel as
with a UP kernel.


45041 25-Mar-1999 mjacob

enable 1080 LVD support


44977 23-Mar-1999 n_hibma

Check whether the PIRQD enable bit is set in LegSup and if not, set it.
On my PIIX4 chip rev 1 this is required. Have not had any complaints from
other people so it might be a problem with this stepping.


44967 23-Mar-1999 gibbs

Add support for the 3950U2B controller.

Recognize aic7895 controllers that have been "acquired" by a RAIDPort
card as normal aic7895s.

Recognize the aic7815 Raid Parity/Memory controller chip and notify
the user that it's RAID functionality will be ignored.


44907 20-Mar-1999 wes

Turn on PCI bus mastering in driver attach routine
to avoid hanging the system if the BIOS has not
initialized the interface.

PR: 10150
Reviewed by: dg


44829 17-Mar-1999 luigi

MF22... add bridging support to the device drivers. Without this
bridging cannot work on -current/releng3!


44820 17-Mar-1999 mjacob

Prep for 1080/1240 support. Those fine h/w engineers at Qlogic
gave yet another internal register layout model for what is
*still* the same architecture. I hope they saved billyuns of gates
'coz otherwise this is *really* annoying.


44738 14-Mar-1999 peter

Merge NetBSD 1.80->1.82 changes from vendor branch into mainline.


44737 14-Mar-1999 semenu

Implemented workaround for EPIC's Application Note 7-15 (concerning
chip int. and ext. clock synchronisation). Fixed workaround for
transmit threshold underrun. Added volatile keyword to CSR_READ_* and
CSR_WRITE_* macroses. Added DELAYs to eliminate randomness caused
by processor speed. Fixed all TXCON and RXCON registers to be accessed
only when chip is idle, as manual told. Changed epic_init_phy to
drop link by isolating and going loopback, should should force link
partner to restart autonegotiation.

PR: kern/10535, kern/9742, kern/10575
Submitted by: Peter Jeremy, David Greenman


44719 13-Mar-1999 peter

set if_snd.ifq_maxlen to something reasonable - note that if_de.c has
a wierd double-queue arrangement.. It always empties the if_snd queue
then puts the transmit packets into a different queue that is limited
by the number of TX descriptors and does it's own discards...
This should stop the boot-time XXX warning anyway.


44684 12-Mar-1999 phk

Fix Typo.


44666 11-Mar-1999 phk

Make even more of the PPSAPI implementations generic.

FLL support in hardpps()

Various magic shuffles and improved comments

Style fixes from Bruce.


44608 09-Mar-1999 andreas

Fix from author of the driver:

The i++ loop from 1..1000 is too small on very fast machines like
PII 450 MHz. Increasing the loop from 1..100000 lets the machine
access PHY. After this patch it's possible to use a SMC PCI card
on a HP Kayak XA series PC Workstation. Workaround until this fix
was to enable debugging in the driver (#define EPIC_DEBUG 1).

Without that patch you get an undefined state:
while true
do
ifconfig -a | grep status:
done
The status messages flaps between twwo values, but not
"connected".

Obtained from: Ustimenko Semen <semen@iclub.nsu.ru>


44505 05-Mar-1999 gibbs

Add untested code to support the aha2930U2W.

Modify to deal with changes in the storage of user negotiation settings.


44377 01-Mar-1999 luigi

Fix handling of IFF_ALLMULTI. The code did not call
tulip_addr_filter() on SIOCSIFFLAGS, and was nuking the IFF_ALLMULTI
on entering tulip_addr_filter(). As a result it was impossible to run
a multicast router on a machine with a "de" interface.


44294 26-Feb-1999 wpaul

Remove call to DELAY() from xl_wait(), since xl_wait() is in the
interrupt handler codepath. Having the delay there didn't really
accomplish much anyway.


44292 26-Feb-1999 wpaul

Add PCI device ID for the PNIC II.


44252 25-Feb-1999 roger

My changes:
Added autodetection of MMAC Osprey 100 card for
Jan Schmidt <mmedia@rz.uni-greifswald.de>. The MMAC card has an EEPROM
which contains an ASCII string beginning with "MMAC".
Corrected Hauppauge Audio Mux Mute value from 0x01 to 0x04.
Fixed a typo.

Sumitted change:
Added ALPS Tuner Type submitted by Hiroki Mori <mori@infocity.co.jp>

Submitted by: Roger Hardiman and Hiroki Mori <mori@infocity.co.jp>


44238 23-Feb-1999 wpaul

Add support for still more cheapo 10/100 cards: Delta Electronics and
Addtron appear to have their own VIA Rhine II and RealTek 8139 boards
with custom PCI vendor and device IDs. This commit updates the PCI
vendor and device lists in the vr and rl drivers so that we can probe
the additional devices.

Found by: nosing around the PCI vendor and device code list at:
http://www.halcyon.com/scripts/jboemler/pci/pcicode


44224 23-Feb-1999 wpaul

Dangit... made a typo in the NEXPTR register definition (0x55 -> 0x45).


44222 23-Feb-1999 wpaul

Minor updates for the ASIX AX88141, which is a newer version of the
AX88140A with power management and magic packet support. Correct the
addresses of the PCI power management registers and add some code to
detect the revision ID of the AX88141 and identify it in the probe
messages.

No other changes are needed since the AX88141 is functionally
identical to the AX88140A.


44181 21-Feb-1999 dfr

Add support for Compaq ProLiant 1200 host to PCI bridge.

Obtained from: 2.2 branch
Reviewed by: Benjamin Lewis <bhlewis@gte.net>


44128 18-Feb-1999 n_hibma

Moved [uo]hci_pci.c from /sys/dev/pci to /sys/pci after Soren
threatened to send Bruce. These files are no longer shared
with NetBSD anyway.

Requires a config and make depend.


44119 18-Feb-1999 n_hibma

Undo Nicolas' changes (1.91->1.92, added USB controller in pcisupport.c).
Please don't.


43973 13-Feb-1999 nsouch

Add alpm.c, Aladdin Power Management SMBus support for the SMBus framework.

Update pcisupport.c with NALPM and Aladdin USB detection printf.


43936 12-Feb-1999 julian

Improved reporting of autodetected speed and duplex.
Now should be able to report speed for cards using NatSemi PHY.
(if you have one please let me know if it works as I
only have the Intel version)

Reviewed by: David Greenman <dg@root.com>


43916 11-Feb-1999 wpaul

Do not issue RX and TX reset commands in xl_stop() and xl_init(). On the
3c905B, the RX and TX reset commands also reset the cyclone chip's internal
PHY, which causes it to restart its autonegotiation session. This takes a
second or two to complete, which makes the interface seem to stop responding
for a few seconds every time you do something that reinitializes it.

Issuing the RX and TX resets on the older 3c905 boomerang adapters doesn't
cause any delay because the boomerang chip requires an external PHY.

This should fix the problem where people doing network installs via 3c905B
cards experience a delay after the interface is first initialized, among
other things.


43915 11-Feb-1999 julian

Define more registers and fix incorrect (but unused) register bit definitions.


43912 11-Feb-1999 julian

Define more registers in the PHY unit and use them to report back
the result of the media auto negotiation.

Reviewed by: David Greenman <dg@freebsd.org>


43890 11-Feb-1999 roger

Added ioctl REMOTE_GETKEY for Hauppauge Infra-Red Remote Control.
Submitted by Roger Hardiman.

Added ioctl TVTUNER_GETCHANSET to discover which regions the bktr driver
supports. Submitted by Vsevolod Lobko <seva@alex-ua.com>

Added BT848_GPIO_SET_EN,BT848_GPIO_SET_DATA (and GETs) to allow user land
control of the GPIO pins. This allows a Radio module on the GPIO port
to be controlled. Submitted by Vsevolod Lobko <seva@alex-ua.com>
The kernel option BKTR_GPIO_ACCESS must be used to enable the GPIO ioctls.

Submitted by: Roger Hardiman and Vsevolod Lobko <seva@alex-ua.com>


43882 11-Feb-1999 gibbs

Set the ultra enable bits in the adaptor's scratch ram area only after
we finish modifying our in kernel version during seeprom configuration.


43794 09-Feb-1999 mjacob

Cleanup. Set all PCI parameters of importance. Set a define that will
allow us via config options prefer mem space to I/O space.


43771 08-Feb-1999 roger

Added detection for bt848a chips


43770 08-Feb-1999 roger

Added check to bktr_mmap() from OpenBSD driver.
Improved MSP34xx reset for bt848 Hauppauge boards.
Added detection for Bt848a.
Vsevolod Lobko<seva@sevasoft.alex-ua.com> added more XUSSR channels.
Submitted by: parts from Vsevolod Lobko<seva@sevasoft.alex-ua.com>
Obtained from: parts from OpenBSD


43692 06-Feb-1999 peter

Back out rev 1.89. The #include is necessary for the #if that tests
the value that config(8) provides when intpm is configured. It seems
that somebody forgot to rerun config at the time and commented this out
instead.


43515 01-Feb-1999 wpaul

Remember to initialize ifp->if_snd.ifq_maxlen.


43416 30-Jan-1999 mjacob

roll internal release tag


43391 29-Jan-1999 bde

Removed a bogus cast to v_caddr_t. This is part of terminating
v_caddr_t with extreme prejudice. Here the bogons were originally
the same as for c_caddr_t (half-baked K&R support), but rev.1.95
changed one wrong cast and one harmless cast to 2 wrong casts,
and rev.1.96 only fixed the originally wrong cast.


43386 29-Jan-1999 bde

Removed bogus casts to c_caddr_t. This is part of terminating
c_caddr_t with extreme prejudice. Here the original casts to
caddr_t were to support K&R compilers (or missing prototypes),
but the relevant source files require an ANSI compiler.


43353 28-Jan-1999 roger

Support for MSP3410D / MSP3415D Stereo/Mono audio using the audio format
Auto Detection Mode. This leaves MSP3400C owners still unsupported.
Thanks to Gerd Knorr <kraxel@cs.tu-berlin.de> for providing some early
assistance and sample code in the linux bttv driver.
Nicolas Souchu <nsouch@freebsd.org> ported the msp_read/write/reset
functions to smbus/iicbus.

METEOR_INPUT_DEV2 now selects a composite camera on the SVIDEO port.
For true SVIDEO, use METEOR_INPUT_DEV_SVIDEO.
If you get a monochrome image from the SVIDEO port, you have
seleted the wrong input type.

Tested by: Johan Larsson<gozer@ludd.luth.se>


43351 28-Jan-1999 dillon

Fix warnings related to -Wall -Wcast-qual


43311 28-Jan-1999 dillon

Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile


43309 27-Jan-1999 dillon

Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile.

This commit includes significant work to proper handle const arguments
for the DDB symbol routines.


43295 27-Jan-1999 dillon

Fix warnings preparing for -Wall -Wcast-qual

Also disable one usb module in LINT due to fatal compilation errors,
temporary.


43288 27-Jan-1999 dillon

Add missing declarations to fix error with LINT compile


43235 26-Jan-1999 wpaul

When selecting the correct EEPROM offset to use for probing the station
address, account for cards which report the Texas Instruments PCI vendor ID
in addition to Compaq and Olicom. (I don't actually have a card that
reports the TI vendor/device ID, but it appears that some Racore adapters
work this way, and failing to account for it when we have the ID listed
in the supported devices list is a bug.)


43217 26-Jan-1999 peter

Check if the intpm controller is configured first before stopping
recognition of the 82371AB device.


43203 25-Jan-1999 nsouch

Terminate commit for the Intel PIIX4 SMBus support. Already committed files
are sys/pci/intpm*

Submitted by: Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp>


43193 25-Jan-1999 torstenb

Identify the TI1250 PCMCIA/CardBus bridge. It seems that it's compatible
to the TI1131. At least it works in my Compaq Armada 7800.


43166 24-Jan-1999 nsouch

SMBus support for the Intel PIIX4 power management unit. See smbus(4),
iicbus(4) and smb(4).

User programs are available to retrieve SDRAM and sensor info, contact
the author.

Submitted by: Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp>
Reviewed by: Mike Smith <msmith@freebsd.org>


43099 23-Jan-1999 roger

Added detection of Hauppauge IR remote control.
and MSP34xx Audio chip. Fixed i2c read error.
Hauppauge supplied details of new Tuner Types.
Added tuner type 0x1a.
Danny Braniss <danny@cs.huji.ac.il> submitted Bt878
AverMedia detection with PCI subsystem vendor id.


43098 23-Jan-1999 roger

Submitted by: Roger Hardiman <roger@cs.strath.ac.uk>
Updated to support Hauppauge IR Remote Control


43062 22-Jan-1999 wpaul

Multicast code isn't quite correct. The RealTek wants the upper six bits
of the CRC as the multicast hash table bit, not the lower six bits. Plus
we have to flip on all bits in the table for multicast mode.

Pointed out by: Kazushi SUGYO <k-sugyou@nwsl.mesh.ad.jp>


42867 19-Jan-1999 se

Fix problem with zero valued map registers followed by valid map entries.
The previous code just ignored the invalid map register, but this gave
surprising results because of the way pci_map_port() associated the map
register offset supplied with a map entry in the map array.


42743 17-Jan-1999 bde

Pass the unit number to the DMA cookie lookup routine and use it
to look up cookies properly, at least for standard controllers.
Cookies are used so that we don't have to pass around lots of args.
All of the dmainit functions use the unit number so it is essential
that we pass them a cookie with the correct unit number.

This may break working configurations if there are bugs in the
dmainit functions like the ones I just fixed for VIA chipsets.

Broken in: rev 1.4 of ide_pci.c and rev.1.139 of wd.c.


42742 17-Jan-1999 bde

Fixed a 2-bit error in initializing MWDMA mode for VIA chipsets.
Prefetch/postwrite was enabled for the wrong controller. (VIA
is bitwise big endian and we confused ourself by shifting left
instead of right.)

Extracted from: last set of patches from the author
(john hood <cgull@smoke.marlboro.vt.us>) on 7 Feb 1998


42738 16-Jan-1999 wpaul

Small cosmetic tweak: in rl_rxeof(), use the constant RX_CMD_EMPTY_RXBUF
instead of the magic number 1.


42737 16-Jan-1999 wpaul

Remove the code that manually pads frames to at least 60 bytes;
the ASIX chip supports auto-padding.


42736 16-Jan-1999 bde

Fixed a 1-bit error in initializing UDMA mode for VIA chipsets.
Instead of initializing UDMA mode, we turned it off and made sure that
it stays off by turning on the "UDMA enable by SET FEATURES" disable.

The damage was limited by bugs in cookie lookup, and suitable
initialization by some BIOSes. The cookie list has slaves before
masters, and the unit number is ignored when cookies are looked up,
so cookie lookup always finds cookies for slaves and the bug only
clobbers slaves, so the bug was harmless for common configurations
with no slaves or only non-UDMA slaves. UDMA initialization for
masters actually worked if the BIOS turns on the UDMA mode bit and
turns off the "UDMA enable by SET FEATURES" disable.


42718 16-Jan-1999 wpaul

Stability fixes:

- In wb_rxeof(), if the received packet is less than MINCLSIZE bytes,
copy it to an mbuf chain so as to be more frugal in our use of mbuf
clusters.

- The Winbond chip, like the ASIX, wants the 'TX interrupt request'
bit set in the _first_ fragment of a transmitted frame, not the
last. (At least the Winbond manual states this unambiguously; too
bad I wasn't paying attention when I read it the first time.)

- Turn off the transmit threshold mechanism (initialize the threshold
to 0). This effectively puts the chip in 'store and forward' mode
which seems to cut down on transmit errors a little. It may also
reduce transmit performace a bit, but I'm willing to do that if it
means better reliability.


42717 16-Jan-1999 wpaul

Fix some stability problems:

- Normally, the driver allocates an mbuf cluster for each receive
descriptor. This is because we have to be prepared to accomodate up to
1500 bytes (a cluster buffer can hold up to 2K). However, using up a
whole cluster buffer for a tiny packet is a bit of a waste. Also,
it seems to me that sometimes mbufs will linger in the kernel for
a while after being passed out of the driver, which means we might
drain the mbuf cluster pool. The cluster pool is smaller than the
mbuf pool in general, so we do the following: if the packet is less
that MINCLSIZE bytes, then we copy it into a small mbuf chain and
leave the mbuf cluster in place for another go-round. This saves
mbuf clusters in some cases while still allowing them to be used
for heavy traffic exchanges with lots of full-sized frames.

- The transmit descriptor has a bit in the control word which allows
the driver to request that a 'TX OK' interrupt be generated when
a frame has been completed. Sometimes, a frame can be fragmented
across several descriptors. The manual for the real DEC 21140A says
that if this happens, the 'TX interrupt request' bit is only valid
in the descriptor of the last fragment. With the ASIX chip, it seems
the 'TX interrupt request' bit is only valid in the descriptor of
the _first_ fragment. Actually, the manual contains conflicting
information, but I think it's supposed to be the first fragment.
To play it safe, set the bit in both the first and last fragment to
be sure that we get a TX OK interrupt. Without this fix, the driver
can sometimes be late in releasing mbufs from the transmit queue
after transmission.


42715 16-Jan-1999 msmith

Spell "ctlr" consistently.


42709 16-Jan-1999 msmith

Fix breakage in rev 1.19; the second argument to ide_pci_candma is a
controller number, not a unit number. Make this clear.


42691 15-Jan-1999 bde

Use a fast interrupt handler for the PCI version of the cy driver
if option CY_PCI_FASTINTR is configured and mapping the irq to a
fastintr is possible. Unfortunately, this has to be optional because
pci_map_int_right() doesn't handle the INTR_EXCL flag right --
INTR_EXCL is honoured even if the interrupt needs to be non-exclusive
for other devices to work.


42654 14-Jan-1999 jdp

Replace includes of <sys/kernel.h> with includes of
<sys/linker_set.h> in those files that use only the linker set
definitions.


42614 13-Jan-1999 bde

Let drivers specify interrupt flags (INTR_EXCL and/or INTR_FAST)
using the new pci_map_int_right() variant of pci_map_int(). Fast
interrupts work for PCI devices if and only if they are exclusive.
(The PCI interrupt mux doesn't support fast interrupts and can't
support a mixture of fast and slow interrupts even in principle.)

Don't assume that intrmask_t == unsigned in pci_map_int().


42613 13-Jan-1999 julian

Add support for the ACER LABS Aladin chipset UDMA controller.
Submitted by: Lee Cremeans <lee@st-lcremean.tidalwave.net>


42558 12-Jan-1999 eivind

Switch type of vxintr instead of using the previous casts.

Requested by: bde


42557 12-Jan-1999 eivind

Remove 'pci_bridgeto' - it was just an empty placeholder.


42556 12-Jan-1999 eivind

Remove unused variable.


42555 12-Jan-1999 eivind

Silence warning by casting vxintr to correct type


42554 12-Jan-1999 eivind

Clean out warnings introduced in last commit.


42541 11-Jan-1999 bde

Fixed minor style bugs in previous commit.


42540 11-Jan-1999 bde

Updated for not-so-new version of Cyclom-Y PCI boards (with a custom
register for the PLX id). Merge the vendor's modification of the 2.2.*
release version into -current for reference. Will be cleaned up in next
commit.

Obtained from: ftp://ftp.cyclades.com/pub/cyclades/cyclom-y/freebsd/3.0/cyy30.tar.gz


42538 11-Jan-1999 julian

remove some unused variables


42537 11-Jan-1999 julian

Add support for the Cyrix Cx5530 PCI/ISA bridge which also includes
a PCI UDMA IDE controller.


42491 10-Jan-1999 wpaul

Tweak the vr_start() and vr_rxeof() routines a little to improve
performance and reliability a little. There was a condition before
where transmission would stall during periods of heavy traffic
exchange between two hosts. Also set the 'want interrupt' bit in
receive descriptor control words.


42458 10-Jan-1999 mjacob

Amazingly stupid forgetfullness had me forgetting to turn on FIFO bursts
for the 1XX0 cards. That cost > 50% performance.


42444 09-Jan-1999 wpaul

Add driver support (and man page) for PCI fast ethernet cards based
on the ASIX AX88140A chip. Update /sys/conf/files, RELNOTES.TXT,
/sys/i388/i386/userconfig.c, sysinstall/devices.c, GENERIC and LINT
accordingly.

For now, the only board that I know of that uses this chip is the
Alfa Inc. GFC2204. (Its predecessor, the GFC2202, was a DEC tulip card.)
Thanks again to Ulf for obtaining the board for me. If anyone runs
across another, please feel free to update the man page and/or the
release notes. (The same applies for the other drivers.)

FreeBSD should now have support for all of the DEC tulip workalike
chipsets currently on the market (Macronix, Lite-On, Winbond, ASIX).
And unless I'm mistaken, it should also have support for all PCI fast
ethernet chipsets in general (except maybe the SMC FEAST chip, which
nobody seems to ever use, including SMC). Now if only we could convince
3Com, Intel or whoever to cough up some documentation for gigabit
ethernet hardware.

Also updated RELNOTEX.TXT to mention that the SVEC PN102TX is supported
by the Macronix driver (assuming you actually have an SVEC PN102TX with
a Macronix chip on it; I tried to order a PN102TX once and got a box
labeled 'Hawking Technology PN102TX' that had a VIA Rhine board inside
it).


42426 09-Jan-1999 kjc

cleanup: remove part of the code for 2.1.

add two functions to get the MAC address of the card.

Obtained from: ALTQ


42352 06-Jan-1999 wpaul

Add some tweaks to mx_mii_readreg(), mx_phy_readreg(), mx_phy_writereg()
and mx_setcfg() so that we can read the internal MII registers on the
MX98713 chip correctly. With these changes, media autoselection now
works correctly on the original 98713. All Macronix chips should now
be properly supported (unless there's a surprise waiting in the 98725).

Thanks to Ulf Zimmermann for providing a 98713 board.


42296 05-Jan-1999 wpaul

GRRRR! Apparently, the promiscuous mode chip bug which I thought was
isolated to revision 33 PNIC chips is also present in revision 32 chips.
Cards with rev. 32 chips include the LinkSys LNE100TX and the Matrox
FastNIC 10/100. This accounts for all the cards that I have to test
with.

(I was never able to personally trip the bug on this chip rev, but today
one of the guys in the lab did it with the software they're working on
for their cellular IP project, which uses BPF and promiscuous mode
extensively.)

This commit enables the promiscuous mode software workaround code for
both revison 32 and revision 33 chips. It's possible all of the PNIC
chips suffer from this bug, but these are the only two revs where I
know for a fact it exists.


42260 03-Jan-1999 wpaul

Minor bug: in the case where allocating a fresh mbuf for the receive ring
fails, we need to set the descriptor status word so that the 'OWN' bit
is set again so that the chip can reuse it. Previously, this wasn't being
done.


42213 31-Dec-1998 wpaul

This commit adds a software workaround for a hardware bug in certain PNIC
chip revisions. (A buggy taiwanese chip? I'm just shocked; shocked I tell
you.) So far I have only observed the anomalous behavior on board with
PCI revision 33 chips. At the moment, this seems to include only the
Netgear FA310-TX rev D1 boards with chips labeled NGMC169B. (Possibly this
means it's an 82c169B part from Lite-On.)

The bug only manifests itself in promiscuous mode, and usually only at
10Mbps half-duplex. (I have not observed the problem in full-duplex mode,
and I don't think it ever happens at 100Mbps.) The bug appears to be in
the receiver DMA engine. Normally, the chip is programmed with a linked
list of receiver descriptors, each with a receive buffer capable of holding
a complete full-sized ethernet frame. During periods of heavy traffic
(i.e. ping -c 100 -f 8100 <otherhost>), the receiver will sometimes appear
to upload its entire FIFO memory contents instead of just uploading the
desired received frame. The uploaded data will span several receive
buffers, in spite of the fact that the chip has been told to only use
one descriptor per frame, and appears to consist of previously transmitted
frames with the correct received frame appended to the end.

Unfortunately, there is no way to determine exactly how much data is
uploaded when this happens; the chip doesn't tell you anything except the
size of the desired received frame, and the amount of bogus data varies.
Sometimes, the desired frame is also split across multiple buffers.

The workaround is ugly and nasty. The driver assembles all of the data
from the bogus frames into a single buffer. The receive buffers are always
zeroed out, and we program the chip to always include the receive CRC
at the end of each frame. We therefore know that we can start from the
end of the buffer and scan back until we encounter a non-zero data byte,
and say conclusively that this is the end of the desired frame. We can
then subtract the frame length from this address to determine the real
start of the frame, and copy it into an mbuf and pass it on.

This is kludgy and time consuming, but it's better than dropping frames.
It's not too bad since the problem only happens at 10Mbps.

The workaround is only enabled for chips with PCI revision == 33. The
LinkSys LNE100TX and Matrox FastNIC 10/100 cards use a revision 32 chip
and work fine in promiscuous mode. Netgear support has confirmed that
they "have some previous knowledge of problems in promiscuous mode" but
didn't have a workaround. The people at Lite-On who would be able to
suggest a possible fix are on vacation. So, I decided to implement a
workaround of my own until I hear from them. I suppose this problem made
it through Netgear's QA department since Windows doesn't normally use
promiscuous mode, and if Windows doesn't need the feature than it can't
possibly be important, right? Grrr.


42198 31-Dec-1998 luigi

Add Joachim Kuebart's ES1370 driver. With my Shuttle HOT-255 card,
this has a problem with capture but i am not sure if it is related
to the mixer or what else.
But in the meantime, this is ok to listen to mpegs.

I also have a much simpler version of the driver in the works which
reuses a lot more of the existing "pcm" routines. Next year...


42155 30-Dec-1998 hoek

Silence -Wtrigraph.

Submitted by: Bradley Dunn <bradley@dunn.org> (pr: kern/8817)


42146 29-Dec-1998 wpaul

Fix the tl_start() routine; sometimes the tl_tx_tail pointer was not
being updated correctly.


42132 28-Dec-1998 mjacob

clarify headers;ansify


42071 27-Dec-1998 foxfair

Turn the VIA chipset ,<<IDE/USB>> controller probing off.
It might cause some problem and something like USB has its
own driver.


42053 24-Dec-1998 wpaul

One more time: another case where we need to trim the CRC manually.


42051 24-Dec-1998 wpaul

Grrrr... The RealTek 8139 is yet another chip that includes the ethernet
CRC in received frames, which we need to trim manually.


42048 24-Dec-1998 wpaul

The VIA Rhine appears to be yet another chip that always includes the
ethernet CRC in received frames and has no option to turn this behavior
off. Trim the CRC off manually in vr_rxeof().


42046 24-Dec-1998 wpaul

Fix a small bug in xl_start(): when queuing a packet onto the end of
an existing chain, don't forget to move xl_tx_tail to point to the new
tail end.


42032 23-Dec-1998 foxfair

Add Matrox Mystique 1064/1164SG chips info. By the datasheet from Matrox,
they use the same value in the VID register.

PR kern/9137: Matrox Mystique chip name typo error
Submitted by: Alex D. Chen <dhchen@Canvas.dorm7.nccu.edu.tw>


42012 22-Dec-1998 gibbs

Staticize the overrun buffer so that they are not shared between
cards of different bus types as each bus type may have a different
bus mapping.

Submitted by: Eivind Eklund <eivind@yes.no>


41972 21-Dec-1998 msmith

Check for DMA capbility is against unit,not controller.

Submitted by: Lee Cremeans <lee@st-lcremean.tidalwave.net>


41958 20-Dec-1998 bde

Remove a vestige of the amd driver.

Forgotten by: msmith


41939 19-Dec-1998 foxfair

Add more non-Intel family ((new)) chipset, just like VIA technology MVP3
AcerLabs Aladdin-V. It makes the PCI probing work when system booting. I
will try to merge some additional funtion(i.e. wdc1 problem cause tons of
PR appear :<) ASAP if I could.

Remind me if something wrong after committing, thanks!


41937 19-Dec-1998 julian

Remove the bogus charracters "42" from the beginning of the first line.
looks like "editor turd".


41934 19-Dec-1998 wpaul

Trim the ethernet CRC from received frames manually in wb_rxeof().
The Winbond chip always includes the CRC with every received frame,
and I can't find anything in the Winbond manual that indicates you can
program it not to do this.


41932 19-Dec-1998 msmith

Fix for bogus BIOS configuration of the 450NX PCI interface on some
systems (eg. Dell 6300).

PR: kern/8928
Submitted by: David Malone <dwmalone@maths.tcd.ie>


41930 19-Dec-1998 msmith

Support for Intel 450NX-based systems with more than one PCI bus (ie.
most of them).

Many thanks to Kevin Van Maren for the work here, Intel for lending us
a 450NX system to work this out on, and several other folks for testing
the patches. See the PR for an extensive discussion of the nature of
the problem and resolution.

PR: kern/8928
Submitted by: Kevin Van Maren <vanmaren@fast.cs.utah.edu>


41926 18-Dec-1998 wpaul

Correct the definition for PN_NETCFG_NO_RXCRC: it's 0x20000000, not
0x02000000. This error was causing the chip to always include the
ethernet CRC along with every received frame (the driver turns on
PN_NETCFG_NO_RXCRC, but it was frobbing the wrong bit).


41837 16-Dec-1998 eivind

vxalloc() can return NULL. Deal with it.


41817 15-Dec-1998 gibbs

Pull in new ccb_hdr list types.


41785 14-Dec-1998 n_hibma

Removed probe for VIA 82C586B OHCI controller (is done in ohci_pci.c now)


41771 14-Dec-1998 dillon

probe function changed from returning char * to const char *.


41767 14-Dec-1998 dillon

Fix uninitialized variable warning by preinitializing 'class' to 0. This
wasn't a bug, just added to silence a warning.


41766 14-Dec-1998 dillon

pci_device pd_probe function changed from returning char * to returning
const char *. Originally I was going to add casts from const char * to
char * in some of the pci device drivers, but the reality is that the
pci device probes return constant quoted strings.


41656 10-Dec-1998 wpaul

Silence gcc -Wall -ansi -pedantic.

Pointed out by: Eivind


41651 10-Dec-1998 wpaul

Silence gcc -Wall -ansi -pedantic and fix minor bug in xl_txeof().

Pointed out by: Eivind


41633 10-Dec-1998 archie

Eliminate compiler warning.


41631 10-Dec-1998 archie

Eliminate compiler warning.


41609 09-Dec-1998 eivind

Check return value of malloc.


41608 09-Dec-1998 eivind

Bailing out when malloc returns != NULL will not help anybody.


41607 09-Dec-1998 eivind

Adjust prototype to match definition (by adding a 'const').


41591 07-Dec-1998 archie

The "easy" fixes for compiling the kernel -Wunused: remove unreferenced static
and local variables, goto labels, and functions declared but not defined.


41569 07-Dec-1998 wpaul

if_rl.c: make a small tweak to properly handle the Accton MPX 5030/5038
as a RealTek 8139
if_rlreg.h: use bus_space_read_X() in CSR_READ_X() macros instead of
directly calling inb()/outb() etc...
rl.4 + RELNOTES.TXT: mention that SMC EtherEZ PCI 1211-TX is supported
by the RealTek driver


41526 05-Dec-1998 wpaul

Add sanity check to foo_start() routines: in the unlikely (though
apparently possible) event that the transmit start routine is
called with and empty if_snd queue, bail out instead of dereferencing
unilitialized transmit list pointers and panicking.


41515 05-Dec-1998 mjacob

trivial header fix


41514 04-Dec-1998 archie

Examine all occurrences of sprintf(), strcat(), and str[n]cpy()
for possible buffer overflow problems. Replaced most sprintf()'s
with snprintf(); for others cases, added terminating NUL bytes where
appropriate, replaced constants like "16" with sizeof(), etc.

These changes include several bug fixes, but most changes are for
maintainability's sake. Any instance where it wasn't "immediately
obvious" that a buffer overflow could not occur was made safer.

Reviewed by: Bruce Evans <bde@zeta.org.au>
Reviewed by: Matthew Dillon <dillon@apollo.backplane.com>
Reviewed by: Mike Spengler <mks@networkcs.com>


41511 04-Dec-1998 wpaul

Put back some missing chip identification code that got lost somehow
during a trek through RCS. The Macronix 98713 and 98713A both have the
same PCI device ID but different revision numbers, and we need to be
able to tell one from the other. The 98715 and 98715A chips have the
same device ID as the 98725 chip but different revision numbers, however
we lump them into the same category except when identifying them during
the PCI probe output.

The main reason we need tell the chips apart is that the Macronix app
notes say you have to write a special magic number into one of the
registers in order to put the chip in normal operating mode. The 98713
requires one magic value, while all the others require a different one.


41510 04-Dec-1998 archie

Fix typo: expression needs parentheses
PR: 8280 (3/3 patches contained in this PR)
Submitted by: Sakari Jalovaara <sja@tekla.fi>


41502 04-Dec-1998 wpaul

An early Christmas present: add driver support for a whole bunch of
PCI fast ethernet adapters, plus man pages.

if_pn.c: Netgear FA310TX model D1, LinkSys LNE100TX, Matrox FastNIC 10/100,
various other PNIC devices

if_mx.c: NDC Communications SOHOware SFA100 (Macronix 98713A), various
other boards based on the Macronix 98713, 98713A, 98715, 98715A
and 98725 chips

if_vr.c: D-Link DFE530-TX, other boards based on the VIA Rhine and
Rhine II chips (note: the D-Link and certain other cards
that actually use a Rhine II chip still return the PCI
device ID of the Rhine I. I don't know why, and it doesn't
really matter since the driver treats both chips the same
anyway.)

if_wb.c: Trendware TE100-PCIE and various other cards based on the
Winbond W89C840F chip (the Trendware card is identical to
the sample boards Winbond sent me, so who knows how many
clones there are running around)

All drivers include support for ifmedia, BPF and hardware multicast
filtering.

Also updated GENERIC, LINT, RELNOTES.TXT, userconfig and
sysinstall device list.

I also have a driver for the ASIX AX88140A in the works.


41443 01-Dec-1998 sos

The Neomagic chip is a 2160 not a 3160.


41377 28-Nov-1998 msmith

Alias Adaptec as a vendor of Cogent NICs.


41365 26-Nov-1998 n_hibma

Removed probes for USB chips 82371xB (done in dev/pci/uhci_pci.c)


41273 20-Nov-1998 wpaul

Add missing return statement to rl_phy_writereg(). This bug didn't actually
hurt anything, but it's still a bug.

Pointed out by: Jason Wright <jason@thought.net>


41243 18-Nov-1998 wpaul

The Accton 1207D adapter uses a chip called the MXP 5030 (or 5038)
which is either a RealTek 8139 in disguise or a RealTek workalike.
This commit fixes the PCI vendor/device ID for this device
and updates the description string to reflect the actual identity
of the device.

I also changed the transmit encapsulation routine to always to
buffer copies on transmit. We end up doing this 99% of the time
anyway. I also tweaked the code that pads packets out to the minimum
length (60) bytes. I was fixing up the m_pkthdr.len value but not
m_len. I don't think this makes that much difference in the grand
scheme of things, but it makes me feel better.


41239 18-Nov-1998 wpaul

Fix a minor bug in xl_attach() where the list buffer region is rounded
to a longword boundary.

Noticed by: Jason Wright <jason@thought.net>


41100 11-Nov-1998 msmith

Consign the 'amd' driver to the Attic.


41049 10-Nov-1998 gibbs

Convert to change in ISA compatiblity port handling in the base bt driver.


41033 09-Nov-1998 peter

ifioctl takes a u_long rather than an int on 3.0


41030 09-Nov-1998 peter

s/%#p/%p/ to fix a warning. This looks like a leftover of once being
%#x, which causes a leading 0x to be prepended. %p has this by default
and the '#' is ignored by the kernel prinf code for %p.


41029 09-Nov-1998 peter

Fix a warning (#include the apic_next_irq() prototype for APIC_IO)


41004 08-Nov-1998 dfr

* Fix a couple of places in the device pager where an address was
truncated to 32 bits.
* Change the calling convention of the device mmap entry point to
pass a vm_offset_t instead of an int for the offset allowing
devices with a larger memory map than (1<<32) to be supported
on the alpha (/dev/mem is one such).

These changes are required to allow the X server to mmap the various
I/O regions used for device port and memory access on the alpha.


40991 07-Nov-1998 nsouch

Return to previous check_for_i2c_devices() behaviour.
Cast the cmd parameter to unsigned char in every smbus call.

Submitted by: Roger Hardiman <roger@cs.strath.ac.uk>


40944 06-Nov-1998 peter

If this is going to have checks for kernel versions, it might as well
do it so that it works. This code should run on 2.2.x now.


40856 03-Nov-1998 julian

In the cyrix Cx5530, there are null (empty) Base address registers before the
base register that controls Ultra-DMA, so we need to examine all possible
base registers instead of just giving up at the first empty one.
Also, looking at the source code to the BIOS, I see that they are also
checking for 0xffffffff as an invalid value so do the same. Stefan may like
to clean this up, but at least now I can find my PCI IDE registers.


40804 01-Nov-1998 semenu

Ported to OpenBSD. sys/pci/smc83c170.h renamed to sys/pci/if_txvar.h to be
like others.


40795 31-Oct-1998 wpaul

Increase the size of the tx and rx rings from 10 to 20 descriptors
and increase the tx interrupt threshold to 4. This fixes performance
problems on slower systems.

Also fix a mind-o in the rx ring init routine: I used the TX
constant instead of the RX. This isn't a problem as long as the
rings are the same size, but if they aren't hijinx will ensue.


40781 31-Oct-1998 nsouch

Brooktree driver ported to the new I2C framework. See iicbus(4) for more info.


40778 31-Oct-1998 dfr

* Fix vga_probe() so that it doesn't report a non-vga display adapter as
a vga.
* Fix broken logic in syscons for a failed probe.
* Fix AlphaStation 500/600 so that non-serial consoles are supported.

Submitted by: Thomas Valentino Crimi <tcrimi+@andrew.cmu.edu> (vga bits),
Andrew Gallatin <gallatin@cs.duke.edu> (AS500/AS600)


40749 30-Oct-1998 gibbs

Do not disable the ISA compatibility window if it is the same value as
that set for our PCI IO address space. This can happen on the BT-946.


40629 24-Oct-1998 phk

Update and add timekeeping code.


40594 22-Oct-1998 wpaul

Close PR #8409:

Fix syntax errors inside #ifdef FORCE_AUTONEG_TFOUR.


40588 22-Oct-1998 wpaul

Close PR #8384:

Revert the transmission packet queueing strategy changes. Clearly I missed
something while debugging this, although I never encountered any problems
on my test machines.

Also make one other minor change: jack up the TX reclaim threshold for
3c90xB adapters in order to stave off 'transmission error: 82' errors.

Document the existence of the tx reclaim register (for inspecting the
current reclaim threshold) in register window 5 (if_xlreg.h).


40559 22-Oct-1998 dg

Defer rundown (m_freem) of completed transmit buffers for no longer
than 1 second.


40528 19-Oct-1998 wpaul

Modify the transmit packet queuing strategy a bit to be a little less
agressive. With the old code, if a descriptor chain was already on its
way to the chip, xl_start() would try to splice new chains onto the end
of the current chain by stopping the transmitter, modifying the tail
pointer of the current chain to point to the head of the new chain, then
restart the transmitter. The manual says you're allowed to do this and
it works, but I'm not too keen on it anymore.

The new code waits until the eixsting chain has been sent and then
queues the next waiting chain in the 'transmit ok' handler.

Performance still looks good one way or the other.


40516 18-Oct-1998 wpaul

Add driver support for PCI fast ethernet adapters based on the
RealTek 8129/8139 chipset like I've been threatening. Update kernel
configs, userconfig.c, relnotes and sysinstall. No man page yet;
comming soon.

I consider this driver stable enough that I want to give it some
exposure in -current.


40418 15-Oct-1998 gibbs

Honor CAM_TAG_ACTION_NONE.


40339 14-Oct-1998 peter

Revert part of previous commit. vaddr_t doesn't exist on FreeBSD. This
didn't affect the x86 kernel due to #ifdefs. It broke FreeBSD/Alpha
kernel compiles though.


40290 13-Oct-1998 peter

Update from NetBSD if_de.c 1.72 to 1.80. This is mostly bugfixes, and
looks like it will have most effect on decoding device capabilities and
configuration.

Approved by: jkh


40206 11-Oct-1998 dg

Clear out transmit descriptor memory in fxp_attach when it's malloced.
fxp_stop is called as the first thing in fxp_init, and if the tx desc
list has junk in it, the system may panic. This bug showed up as a side
effect of the changes in rev 1.56, but has been in the code since the
beginning.


40190 10-Oct-1998 dg

Fixed mbuf leak in fxp_stop().


40163 10-Oct-1998 peter

Attempt to work around the page fault in tulip_txput(). I've been running
this myself for ages, but wasn't able to get any feedback from the people
that I sent it to for testing.

Guy Helmer <ghelmer@scl.ameslab.gov> has given it a shot (before getting on
a plane, thanks!) and it appears to stop his reproducable page fault panic
in the testing he was able to do.


40097 09-Oct-1998 wpaul

Add support for yet another "cyclone" board, with PCI device id 0x905A.
This is a 100BaseFX board with SC fiber media connectors. I don't actually
have one of these but I've been told it works with the xl driver.

Submitted by: Jason Wright from the openbsd group


40065 08-Oct-1998 wpaul

Correctly update the tail pointer of the transmit queue in tl_start()
(one-liner). I have yet to actually encounter any problems due to this
bug, but why take chances.


40030 07-Oct-1998 gibbs

ahc_pci.c:
Disable DPARCKEN in the DSCOMMAND0 register on the aic7890/91/96/97.
Parity checking is broken for some chip/MB combinations and this
is the work around recommended by Adaptec.

dpt_pci.c:
Remove a superflous '{' that prevented DPT_ALLOW_MEMIO from working.

pcireg.h:
Add a definition for Parity Error Reponse bit in the PCI Space
command register.


40024 07-Oct-1998 gibbs

Add support for the ASC3550 AdvanSys SCSI Host Controller (aka 940UW).


40004 06-Oct-1998 dfr

Add functions for accessing dense and bwx memory for pci devices. These
routines are necessary to allow the use of certain types of hardware on
the alpha, particularly a Myrinet card.

Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>


39957 04-Oct-1998 wpaul

Force the ThunderLAN driver to use PIO mode by default instead of
memory mapped mode. There are some laptop docking stations with
built-in tlan chips where memory mapped mode doesn't work correctly.

Pointed out by: jmb


39856 01-Oct-1998 sos

Oops, forgot /* */ around Id string


39842 30-Sep-1998 sos

Hauppauge Tech Support confirmed all Hauppauge 878 PAL/SECAM boards
will use PLL mode. Added to card probe. Thanks to Ken and Fred.

Submitted by: Roger Hardiman <roger@cs.strath.ac.uk>


39841 30-Sep-1998 sos

Hauppauge Tech Support confirmed all Hauppauge 878 PAL/SECAM boards
will use PLL mode. Added to card probe. Thanks to Ken and Fred.

Submitted by: Roger Hardiman <roger@cs.strath.ac.uk>


39838 30-Sep-1998 sos

Changed tuner code to autodetect tuner i2c address.
Addresses were incorrectly hardcoded.

Submitted by: Roger Hardiman <roger@cs.strath.ac.uk>


39757 29-Sep-1998 bde

FIxed printf format errors (an new one that is only detected on systems
with pointers smaller than u_longs, and 2 possibly-truncating casts in
the same printf).


39687 26-Sep-1998 dfr

Update SimOS scsi driver to use CAM.


39683 26-Sep-1998 dfr

Add hooks so that the alpha can detect which disk has the root partition.


39682 26-Sep-1998 dfr

Don't set script to vaddr2 on the alpha - it can't access scripts in device
memory using simple pointers.


39647 25-Sep-1998 wpaul

Apply patch graciously provided by Jason Wright <jason@thought.net> from
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.


39627 24-Sep-1998 wpaul

Small tweak: force another reset of the adapter after probing for all the
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.


39624 24-Sep-1998 peter

Minimal change for #if __FreeBSD__ >= 3 to check __FreeBSD_version instead.


39621 24-Sep-1998 peter

Change #if __FreeBSD__ >= 3 to #if __FreeBSD_version >= 300000 to aid
bootstrapping from a 2.2.x system.


39583 23-Sep-1998 wpaul

Overhaul the ThunderLAN driver. This update includes the following
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


39574 22-Sep-1998 ken

A fix from Justin for the NCR bug that caused panics on 875 (and possibly
other) chips.

The script pointer was getting set to NULL instead of the right value.

Submitted by: gibbs


39554 22-Sep-1998 gibbs

Bring back the cleanups from revs 1.121 and rev.1.122 of ncr.c.

Noticed by: bde


39532 20-Sep-1998 ken

Alpha patches for the NCR driver from Doug Rabson. I've tested these on an
NCR 810a, and they seem to work fine on the i386 as well.

Reviewed by: gibbs
Submitted by: dfr


39467 18-Sep-1998 gibbs

Set QUIRK_NOMSG for all devices as was the case in the non-CAM version
of the driver. Why this is necessary (and how identify message handling
is performed when this is set) I don't comprehend...


39445 18-Sep-1998 mjacob

(requested by gibbs) Remove the SCSI_CAM option (and rework the isp driver
that had depended on it for compilation within or without CAM to use
__FreeBSD_version instead).


39438 17-Sep-1998 gibbs

Really correct ncr_freeze_devq now. We scan backwards from the current
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.


39435 17-Sep-1998 mjacob

A major amount of cleaning up:
+ 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).


39390 17-Sep-1998 gibbs

Use %p with (void *) casts to print pointers with printf.


39386 16-Sep-1998 gibbs

Fix a regression that caused the script to spam itself by copying something
of size sizeof(struct timeval) that is really of size sizeof(ticks).

Make another attempt at fixing the queue full case.


39379 16-Sep-1998 msmith

Add 450NX chipset components.


39366 16-Sep-1998 gibbs

Fix a bug in ncr_freeze_devq() which is called when we see a queue
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.


39365 16-Sep-1998 mjacob

Alpha port related fixes from Doug Rabson.
Submitted by: dfr


39346 16-Sep-1998 dfr

Some workarounds for a common DEC pci-pci bridge found on alphas.
Fix printf format errors which show up on the alpha.


39345 16-Sep-1998 dfr

Port de driver to alpha.


39310 15-Sep-1998 gibbs

Correct printf format bugs.


39266 15-Sep-1998 gibbs

Obsoleted by CAM.


39247 15-Sep-1998 gibbs

Convert ISP pci front end to CAM/bus space/dma.

Convert ncr driver to CAM.


39234 15-Sep-1998 gibbs

Conver the DPT driver to CAM. The dpt_control interface is not yet
functional, but will be in another day or so.


39231 15-Sep-1998 gibbs

Revive PCIConf.

Submitted by: "Kenneth D. Merry" <ken@plutotech.com>


39223 15-Sep-1998 gibbs

Mylex/Buslogic MultiMaster SCSI-Host Adapter Driver for CAM.


39222 15-Sep-1998 gibbs

Move to new name, convert to CAM, add support for new chips, and
correct lots of eeprom/auto-termination bugs.


39217 15-Sep-1998 gibbs

Advance Systems SCSI Host Adapter driver for CAM. Currently only support
the 8bit SCSI AdvanSys products.


39041 10-Sep-1998 sos

Changed METEORSINPUT for Hauppauge cards with bt878.
Also fixed video_open defines and 878 support.

Submitted by: Fred Templin <templin@erg.sri.com>


39040 10-Sep-1998 sos

Correct SECAM B-Delay and add XUSSR channel set.

Submitted by: Vsevolod Lobko <seva@alex-ua.com>


38957 08-Sep-1998 wpaul

- If the OACTIVE flag is set on entry to xl_start(), check to see if the
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.


38888 06-Sep-1998 tegge

Maintain a mapping from irq number to (ioapic number, int pin) tuple,
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.


38882 06-Sep-1998 wpaul

Patch the transmit error handler to avoid following NULL pointers and
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>


38810 04-Sep-1998 wpaul

Modify the xl_mediacheck() routine to also test for the case where the
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.


38730 01-Sep-1998 wpaul

"xl%d: chip is is in D%d power mode " -> "xl%d: chip is in D%d power mode "


38708 31-Aug-1998 sos

Fixed bug in Miro Tuner detection. Missing Goto.
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>


38707 31-Aug-1998 sos

Renamed BT848[SG]CAPAREA to BT848_[SG]CAPAREA.
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>


38706 31-Aug-1998 sos

Added Capture Area ioctl - BT848[SG]CAPAREA.
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>


38697 31-Aug-1998 wpaul

Fix handling of ENOBUFS condition. During reception, the filled mbuf
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.


38660 30-Aug-1998 wpaul

Change the autonegotiation waiting period from 3 seconds to 5. This
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.)


38526 24-Aug-1998 wpaul

- #define mask of enabled interrupts/indications in if_xlreg.h instead of
constructing local copy in xl_init()
- disable interrupts on entry to xl_intr(), re-enable them on exit.
- fix a few typos in some comments


38469 21-Aug-1998 wpaul

Increase the number of descriptors (and, as a consequence, the number
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>


38457 20-Aug-1998 wpaul

Fix small printf() bogon (forgot newline, and the message was longer that
80 cols).


38442 19-Aug-1998 wpaul

Make two changes:

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>


38412 18-Aug-1998 bde

Fixed printf format errors.


38407 17-Aug-1998 bde

Fixed printf format errors (none detected in GENERIC again).


38363 16-Aug-1998 wpaul

Import the (Fast) Etherlink XL driver. I'm reasonally confident in its
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.)


38354 16-Aug-1998 bde

Use [u]intptr_t instead of [u_]long for casts between pointers and
integers. Don't forget to cast to (void *) as well.


38304 13-Aug-1998 gibbs

Use "baseclass" instead of "class" for storing the contents of PCI register
0xB so that C++ programs can use the PCI conf interface.


38232 10-Aug-1998 bde

Use [u]intptr_t instead of [unsigned] long to convert and/or represent
pointers.

This finishes fixing conversions between pointers and integers of
possibly different sizes in GENERIC.


38224 10-Aug-1998 bde

Fixed the formatting of some tables (mainly the one produced by ps
in ddb) which I broke by changing %8[l]x to %8p. Hacked the central
printf routine to not add an "0x" prefix for %p formats if the field
width is nonzero. The tables are still horribly misformatted on
64-bit machines.

Use %p instead of %8p to print pointers when the field width isn't
important.


38211 10-Aug-1998 sos

Support the PAL version of the BT878 based Haupauge WinTV/PCI.

Submitted by: Matthias Scheler <tron@netbsd.org>


38195 08-Aug-1998 jkh

A few misc changes to get the spigot and meteor board working in 3.0.

Submitted by: Jim Lowe <james@miller.cs.uwm.edu>


38184 08-Aug-1998 sos

Updated Hauppauge detection code for Tuner ID 0x0a for newer NTSC
WinCastTV 404 with Bt878 chipset. Tidied up PAL default in video_open()

Submitted by: Roger Hardiman <roger@cs.strath.ac.uk>


38159 07-Aug-1998 dfr

Remove a stupid hack of mine which prevented PCI io memory access on the alpha.


38115 05-Aug-1998 eivind

Update DPT driver from 1.4.3 to 1.4.5

Submitted by: Simon Shapiro <shimon@simon-shapiro.org>


38066 04-Aug-1998 dg

Implemented a more sophisticated mechanism for handling transmitter
interrupts which now defers them until the transmit queue if filled
up with completed buffers. This has two advantages: first, it reduces
the number of transmitter interrupts to just 1/120th of the rate
that they occured previously, and two, running down many buffers
at once has much improved cache effects.


38065 04-Aug-1998 wpaul

Fix this thing to work properly with multiple tlan adapters; increment
unit count correctly.

Problem reported by Larry Baird <lab@gta.com>.


38030 03-Aug-1998 wpaul

Updates for the ThunderLAN driver:

- probe for PHYs by checking the BMSR (phy status) register instead
of the vendor ID register.

- fix the autonegotiation routine so that it figures out the autonegotiated
modes correctly.

- add tweaks to support the Olicom OC-2326 now that I've actually had
a chance to test one

o Olicom appears to encode the ethernet address in the EEPROM
in 16-bit chunks in network byte order. If we detect an
Olicom card (based on the PCI vendor ID), byte-swap the station
address accordingly.

XXX The Linux driver does not do this. I find this odd since
the README from the Linux driver indicates that patches to
support the Olicom cards came from somebody at Olicom; you'd
think if anyone would get that right, it'd be them. Regardless,
I accepted the word of the disgnoatic program that came bundled
with the card as gospel and fixed the attach routine to make
the station address match what it says.

o The version of the 2326 card that I got for testing is a
strange beast: the card does not look like the picture on
the box in which it was packed. For one thing, the picture
shows what looks like an external NS 83840A PHY, but the
actual card doesn't have one. The card has a TNETE100APCM
chip, which appears to have not only the usual internal
tlan 10Mbps PHY at MII address 32, but also a 10/100 PHY
at MII address 0. Curiously, this PHY's vendor and device ID
registers always return 0x0000. I suspect that this is
a mutant version of the ThunderLAN chip with 100Mbps support.
This combination behaves a little strangely and required the
following changes:

- The internal PHY has to be enabled in tl_softreset().
- The internal PHY doesn't seem to come to life after
detecting the 100Mbps PHY unless it's reset twice.
- If you want to use 100Mbps modes, you have to isolate
the internal PHY.
- If you want to use 10Mbps modes, you have to un-isolate
the internal PHY.

The latter two changes are handled at the end of tl_init(): if
the PHY vendor ID is 0x0000 (which should not be possible if we
have a real external PHY), then tl_init() forces the internal
PHY's BMCR register to the proper values.


38007 02-Aug-1998 dg

Added 82555B support for media status.


38006 02-Aug-1998 dg

Reordered fxp_softc for optimal cacheline behavior.


38005 02-Aug-1998 dg

Killed unused variable/assignment.


37842 22-Jul-1998 dfr

Add a call to a platform-specific irq remapping function for alpha platforms
which don't record the correct irqs in PCI config space.

Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>


37841 22-Jul-1998 dfr

On the alpha, ports may be allocated above 64k.
Change the port address argument to pci_map_port to pci_port_t* which is
defined as u_int on the alpha, u_short on i386. This is a stopgap with a
hopefully limited lifetime.

Discussed with: Stefan Esser <se@freebsd.org>


37782 20-Jul-1998 msmith

Add support for PCNet PCI chips that only work when we talk to them as ISA
devices. Specifically fix the case for the Hitachi version as used in
their VisionBook models.

Submitted by: Ted Faber <faber@isi.edu>


37713 16-Jul-1998 gibbs

Correct SEEPROM checksum calculation when multiple checksum attemps are made.

Pointed out by: "Jose M. Alcaide" <jose@we.lc.ehu.es>


37649 15-Jul-1998 bde

Cast pointers to uintptr_t/intptr_t instead of to u_long/long,
respectively. Most of the longs should probably have been
u_longs, but this changes is just to prevent warnings about
casts between pointers and integers of different sizes, not
to fix poorly chosen types.


37646 14-Jul-1998 sos

Add support for the AVer Media range of cards.


37637 14-Jul-1998 bde

Avoid some casts of pointers to integers (of possibly different sizes).


37631 14-Jul-1998 ahasty

I checked in the wrong version yesterday . The correct version is 1.38

Amancio


37626 13-Jul-1998 wpaul

Declare pointers to CSR register space to be volatile. This seems to
cure the problems I was having with interrupts not being acknowledged
on time. This fixes a problem I observed where starting two ping -f
processes at 10Mbps would cause an adapter check due to TX GO commands
being issued before TXEOC interrupts were being acked.

Also fix a small problem with tl_start(): the mechanism I was using
to queue new packets onto the TX chain was bogus.

Change adapter check handler so that it resets card state after
tl_softreset() is stored.

Moved all EEPROM-related macro definitions into if_tlreg.h.

Don't allow an autoneg session to start until after the TX queue has
been drained, and don't transmit anything until after the autoneg
session is complete.

Also add support for two more Compaq ThunderLAN-based cards, and three
cards from Olicom which also use the ThunderLAN chip. The only thing
different about the Olicom cards is that they store the station address
at a different location within the EEPROM.


37618 13-Jul-1998 bde

Fixed printf format errors (only 1 left in GENERIC now).


37611 13-Jul-1998 ahasty

Improved Hauppauge's tuner detection and bt878 support

Amancio


37607 12-Jul-1998 se

Remove unused member reselet from struct tstamp.


37605 12-Jul-1998 se

Fix size of time stamps (had been time_t before the variable "time" was
hidden). Now "ticks" are used, which are 4 byte, not 8 byte in size.
The size mismatch did not matter due to sufficient padding at the end
of the structure that holds time stamps (there is an unused member).

The fix suggested by Bruce Evans used "sizeof (ticks_t)", but I prefer
to use "sizeof ticks", and didn't seem to object in his last mail on
this topic.

Submitted by: bde


37555 11-Jul-1998 bde

Fixed printf format errors.


37492 08-Jul-1998 peter

Merge changes from vendor branch.


37470 07-Jul-1998 bde

Changed `#if defined(i386)' to `#ifdef __i386__'.

`#if defined(ONE_THING)' is a style bug, and i386 instead of __i386__
is a bug, since i386 is never defined when the kernel is compiled
by with the default flags (`gcc -ansi ...'). Here the bug disabled
the call to pmap_setvidram(), so ISA video memory was not mapped
WC on 686's. The bug may have been masked by bugs in the committer's
version of gcc - `gcc -ansi' incorrectly defines i386 for gcc = the
version of egcs on the 2.2.6 cdrom.


37441 06-Jul-1998 gibbs

Attempt to load serial eeprom contents in both 93c46 and 93c56/66 mode before
giving up.

PR: 6966


37372 04-Jul-1998 semenu

Fix some strange errors of shutting transmitter up when start
transmition after software reset with no link estabilished yet.
Fix TX DMA stop method (queue last packet to stop).

PR: i386/6578


37284 30-Jun-1998 jmg

document PCI_QUIET that prevents pci from compiling in so many strings


37101 21-Jun-1998 bde

Removed unused includes.


37094 21-Jun-1998 bde

Removed unused includes.


37034 17-Jun-1998 bde

Don't declare isa device structs or isa interrupt handlers in <sys/conf>,
and don't depend on them being declared there. This will cause lots of
warnings for a few minutes until config is updated. Interrupt handlers
should never have been configured by config, and the machine generated
declarations get in the way of changing the arg type from int to void *.


37028 17-Jun-1998 bde

Fixed a misdeclaration. This unhides type mismatches which will be
fixed soon.


36945 13-Jun-1998 peter

Merge changes from vendor branch;
- connector selection values (should fix aui/bnc),
- non-shifting version of crc calculation using a table,
- interrupt mask adjustments,
- add some brackets where a #ifdef could break an if(),
- don't reset the card unless it's up.


36849 10-Jun-1998 dfr

Add initial support for the FreeBSD/alpha kernel. This is very much a
work in progress and has never booted a real machine. Initial
development and testing was done using SimOS (see
http://simos.stanford.edu for details). On the SimOS simulator, this
port successfully reaches single-user mode and has been tested with
loads as high as one copy of /bin/ls :-).

Obtained from: partly from NetBSD/alpha


36767 08-Jun-1998 bde

Fixed pedantic semantics errors (bitfields not of type int, signed int
or unsigned int (this doesn't change the struct layout, size or
alignment in any of the files changed in this commit, at least for
gcc on i386's. Using bitfields of type u_char may affect size and
alignment but not packing)).


36757 08-Jun-1998 jkoshy

Fix spelling in printf().


36749 08-Jun-1998 dyson

Disable attempted write combining support. This probably
causes more trouble than help (for now.)


36735 07-Jun-1998 dfr

This commit fixes various 64bit portability problems required for
FreeBSD/alpha. The most significant item is to change the command
argument to ioctl functions from int to u_long. This change brings us
inline with various other BSD versions. Driver writers may like to
use (__FreeBSD_version == 300003) to detect this change.

The prototype FreeBSD/alpha machdep will follow in a couple of days
time.


36663 05-Jun-1998 ahasty

Reviewed by: hasty@star-gate.com
Submitted by: Roger Hardiman <roger@cs.strath.ac.uk>

I left out a line of code from Roger's last patch :(


36579 02-Jun-1998 eivind

o Return error when the controller can't accept commands.
o Make driver less chatty on boot (only announce version under
bootverbose)

Submitted by: Simon Shapiro <shimon@simon-shapiro.org>


36501 31-May-1998 wpaul

Add a short delay in the read loop in tl_eeprom_getbyte(). On some
systems, you have to allow the delay or else you end up misreading
some of the bits.

Patch provided by: Yoshihiko Someya <zb9y-smy@asahi-net.or.jp>


36475 30-May-1998 phk

Add minimum driver for XC6200 based cards. Currently it knows about
the HOT1 from www.vcc.com.


36464 29-May-1998 wpaul

Don't program the antonegotiation advertisement register in tl_setmode().
I had a reason for doing this, but it violates the principle of least
astonishment. (At some point I may put this back but attach it to one of
the LINK flags so the behavior can be toggled on and off.)

Also replace my tl_calchash() with a much less disgusting and substantially
smaller one supplied by Bill Fenner.


36400 26-May-1998 wpaul

Ignore 'invalid' interrupts that occur while the interface is down.
These are probably generated by other PCI devices sharing the TLAN's
interrupt. The programmer's guide says to simply re-enable interrupts
and return if one of these is detected.

Prompted by bug report from: Bill Fenner


36334 24-May-1998 ahasty

Reviewed by: hasty@freebsd.org
Submitted by: hasty@star-gate.com

Eliminate NTSC default setting if user choses a different video format.


36317 24-May-1998 wpaul

Fix a mind-o in tl_setmulti(): when setting a bit in the upper
32 bits of the 64-bit hash table, we have to use a 32-bit shift,
not 31.

Pointed out by: Bill Fenner


36302 22-May-1998 wpaul

Remove 2.2.x compatibility code and #ifdefs. Once the shakedown period
in -current is over, I'll put a 2.2.x specific version in the RELENG_2_2
branch. If somebody wants a 2.2 version of this driver now, they can check
out the previous version from CVS or ask me via e-mail.

Gee people, I didn't mean to stir up such a controversy. I just wanted
to make sure I could get this thing to work with both kernel versions
and didn't want to have to maintain two separate copies. All ya hadda
do was ask. :)


36282 21-May-1998 jkh

Yeargh! After all that, I forgot to remove the #include.


36281 21-May-1998 jkh

Don't use __FreeBSD_version explicitly - none of the other
drivers here do and it also blows up in building GENERIC during
a release build if you try and include <osreldate.h> (which shot
my SNAP dead - argh!). Use __FreeBSD__ instead.


36270 21-May-1998 wpaul

Add Texas Instruments TNET100 'ThunderLAN' PCI NIC driver to the tree.
This driver supports the following cards/integrated ethernet controllers:

Compaq Netelligent 10, Compaq Netelligent 10/100, Compaq Netelligent 10/100,
Compaq Netelligent 10/100 Proliant, Compaq Netelligent 10/100 Dual Port,
Compaq NetFlex-3/P Integrated, Compaq NetFlex-3/P Integrated,
Compaq NetFlex 3/P w/ BNC, Compaq Deskpro 4000 5233MMX.

It should also support Texas Instruments NICs that use the ThunderLAN
chip, though I don't have any to test. If you've got a card that uses
the ThunderLAN chip but isn't listed in the PCI vendor/product list in
if_tl.c, try adding it and see what happens.

The driver supports any MII compliant PHY at 10 or 100Mbps speeds in
full or half duplex. (Those I've personally tested are the National
Semiconductor DP83840A (Prosignia server), the Level 1 LXT970 (Deskpro
desktop), and the ThunderLAN's internal 10baseT PHY.) Autonegotiation,
hardware multicast filtering, BPF and ifmedia support are included.

This chip is pretty fast; Prosignia servers with NCR SCSI, ThunderLAN
ethernet and FreeBSD make for a nice combination.


36172 19-May-1998 ahasty

Reviewed by: ahasty@freebsd.org
Submitted by: Roger Hardiman <roger@cs.strath.ac.uk>
options BROOKTREE_SYSTEM_DEFAULT=BROOKTREE_PAL
in the kernel config file makes the driver's video_open() function
select PAL rather than NTSC. This fixed all the hangs on my
Dual Crystal card when using a PAL video signal.

As a result, you can loose the tsleep (of 2 seconds - now 0.25!!)
which I previously added. (Unless someone else wanted the 0.25
second tsleep).


36090 16-May-1998 ahasty

1.31 Randall Hopper <rhh@ct.picker.com>
submitted ioctl to clear the video buffer
prior to starting video capture
Amancio : clean up yuv12 so that it does not
affect rgb capture. Basically, fxtv after
capturing in yuv12 mode , switching to rgb
would cause the video capture to be too bright.
1.32 disable inverse gamma function for rgb and yuv
capture. fixed meteor brightness ioctl it now
converts the brightness value from unsigned to
signed.
1.33 added sysctl: hw.bt848.tuner, hw.bt848.reverse_mute,
hw.bt848.card
card takes a value from 0 to bt848_max_card
tuner takes a value from 0 to bt848_max_tuner
reverse_mute : 0 no effect, 1 reverse tuner
mute function some tuners are wired reversed :(


35932 11-May-1998 dyson

Attempt to set write combining mode for graphics devices.


35841 08-May-1998 bde

Translated to C (parameters in a function definition have the same scope
as variables declared in the main block in the function, so shadowing
of parameters by variables declared in the main block is not just an
obfuscation).

Found by: lint


35680 04-May-1998 kato

Added another PCI to C-bus (ISA bus like 16 bit bus of PC-98) bridge.


35663 04-May-1998 kato

Add NEC PC-98 chipsets.


35644 03-May-1998 phk

Patches are given here for pcisupport.c to recognise most of VIA
Technologies' Socket 7 chipsets. This covers all of the Apollo chipsets
except the Master (82C570) and the MVP3, and it also covers the cheap
VXPro and VXTWO knockoffs of the VP1 and VPX.

PR: 6481
Reviewed by: phk
Submitted by: Lee Cremeans <lcremean@tidalwave.net>


35628 02-May-1998 se

Add PCI device IDs for Intel BX PCI chip-set components.

Submitted by: Steinar Haug <sthaug@nethelp.no>


35389 22-Apr-1998 mjacob

Add support for the Qlogic ISP SCSI && FC/AL Adapters


35313 19-Apr-1998 ahasty

Forgot to add opt_bktr.h


35259 18-Apr-1998 ahasty

Reviewed by: Amancio
Submitted by: Roger Hardiman <roger@cs.strath.ac.uk>
Roger Hardiman <roger@cs.strath.ac.uk> :
Revised autodetection code to correctly handle both
old and new VideoLogic Captivator PCI cards.
Added tsleep of 2 seconds to initialistion code for PAL users.
Corrected clock selection code on format change.

--- Amancio


35256 17-Apr-1998 des

Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108.


35210 15-Apr-1998 bde

Support compiling with `gcc -ansi'.


35170 13-Apr-1998 semenu

Fixed autonegotiation. Card registers are now accessed via memory
not i/o space.


35057 06-Apr-1998 ahasty

take out opt_bktr.h from brooktree848.c


35050 05-Apr-1998 ahasty

Reviewed by: Amancio
Submitted by: Frank Nobis <fn@Radio-do.de>

Mods to view german cable tv and minor fix to correctly identify bt849.


34990 01-Apr-1998 tegge

Add two workarounds for broken MP tables:

- Attempt to handle PCI devices where the interrupt is
an ISA/EISA interrupt according to the mp table.

- Attempt to handle multiple IO APIC pins connected to
the same PCI or ISA/EISA interrupt source. Print a
warning if this happens, since performance is suboptimal.
This workaround is only used for PCI devices.

With these two workarounds, the -SMP kernel is capable of running on
my Asus P/I-P65UP5 motherboard when version 1.4 of the MP table is disabled.


34961 30-Mar-1998 phk

Eradicate the variable "time" from the kernel, using various measures.
"time" wasn't a atomic variable, so splfoo() protection were needed
around any access to it, unless you just wanted the seconds part.

Most uses of time.tv_sec now uses the new variable time_second instead.

gettime() changed to getmicrotime(0.

Remove a couple of unneeded splfoo() protections, the new getmicrotime()
is atomic, (until Bruce sets a breakpoint in it).

A couple of places needed random data, so use read_random() instead
of mucking about with time which isn't random.

Add a new nfs_curusec() function.

Mark a couple of bogosities involving the now disappeard time variable.

Update ffs_update() to avoid the weird "== &time" checks, by fixing the
one remaining call that passwd &time as args.

Change profiling in ncr.c to use ticks instead of time. Resolution is
the same.

Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call
hzto() which subtracts time" sequences.

Reviewed by: bde


34924 28-Mar-1998 bde

Moved some #includes from <sys/param.h> nearer to where they are actually
used.


34917 27-Mar-1998 se

Add two VLSI chip set components: 82C592 and 82C593
Submitted by: Warner Losh <imp@village.org>


34645 17-Mar-1998 danny

PR: i386/6040
Submitted by: nakagawa@jp.freebsd.org
Add new PCI NE2000 (VIA VT86C926)


34480 11-Mar-1998 julian

Add EISA support for DPT drivers
Submitted by: Matthew Dodd
Reviewd by: shimon@simon-shapiro.org (DPT author)


34317 08-Mar-1998 peter

merge benfor branch changes onto mainline.


34266 08-Mar-1998 julian

Reviewed by: dyson@freebsd.org (john Dyson), dg@root.com (david greenman)
Submitted by: Kirk McKusick (mcKusick@mckusick.com)
Obtained from: WHistle development tree


34047 05-Mar-1998 jkh

Correct minor typo
Confirmed by: Ustimenko Semen <semen@iclub.nsu.ru>


34032 04-Mar-1998 semenu

*** empty log message ***


34014 03-Mar-1998 dg

Added support for the 82553 and 'B' 82555 PHY.


33987 02-Mar-1998 jkh

Update the information in this file slightly.


33945 01-Mar-1998 sos

Undo the previous commit which was NOT for -current.
Rearrange a few lines for better order.


33942 01-Mar-1998 asami

Add Intel 430TX chipset, namely 82439TX system controller and four
incarnations of 82371AB (P/I bridge, IDE, USB and power management).

Tested by: jkh


33940 01-Mar-1998 bde

Restored half of the ANSI semantic errors fix which was clobbered
by the previous commit.


33893 27-Feb-1998 se

Add PCI device ID of Surecom NE-34


33850 26-Feb-1998 ahasty

Radio support for bt848 cards from Flemming Jacobsen <fj@trw.nl>

Amancio


33830 25-Feb-1998 bde

Added missing #include of "opt_devfs.h".

Fixed pedantic semantics errors (in ANSI C, static arrays must have
a size, and static objects should be consistently declared as static
unless you know more than anyone should have to know about the
linkage rules).


33787 24-Feb-1998 sos

Add the Intel 82371SB USB host controller to the known list.


33692 20-Feb-1998 jkh

Update to "stable-167" release; totally reimplements media detection.
Submitted by: Ustimenko Semen <semen@iclub.nsu.ru>


33676 20-Feb-1998 bde

Removed unused #includes.


33638 20-Feb-1998 ahasty

Move Luigi's I2CWR ioctl from the video_ioctl section to the
tuner_ioctl section. Changed Major device from 79 to 92 and reserved
our Major device number -- hasty@star-gate.com


33222 10-Feb-1998 eivind

Staticize. (Diffs by me & and Simon in cooperation.)


33181 09-Feb-1998 eivind

Staticize.


33178 09-Feb-1998 eivind

Add #include "opt_devfs.h".


33160 07-Feb-1998 nate

- Removed typo in Copyright and added Id.


33134 06-Feb-1998 eivind

Back out DIAGNOSTIC changes.


33108 04-Feb-1998 eivind

Turn DIAGNOSTIC into a new-style option.


33095 04-Feb-1998 jkh

MF22: update to newest version from author.


33068 04-Feb-1998 eivind

Make FAILSAFE a new-style option.


33066 04-Feb-1998 eivind

Re-add my DEVFS changes after they were stomped on. This time, I throw away
the DEVFS tokens (as they weren't used anywhere anyway).


33025 02-Feb-1998 ahasty

Bugs/Enhancements:

1. Takeshi Ohashi <ohashi@atohasi.mickey.ai.kyutech.ac.jp> submitted
code to support bktr_read . /usr/src/share/examples/rgb24.c now works 8)

2. Flemming Jacobsen <fj@schizo.dk.tfs.com> submitted code to support
radio available with in some bt848 based cards;additionally, wrote
code to correctly recognized his bt848 card.
3. Roger Hardiman <roger@cs.strath.ac.uk> submitted various fixes to smooth
out the microcode and made all modes consistent.

4. Added supported for yuv12 so we know can capture raw streams and feed it
to mpeg_encoder . The upshot is that we can now mpeg encode more and save
nearly 100 percent of the disk requirements previously for programs such
as fxtv first save the raw video image to disk then converted to a
format suitable for mpeg_encode.


32996 01-Feb-1998 bde

Removed ifdef for <sys/sockio.h> vs <sys/ioctl.h>. <sys/sockio.h> is
a BSD4.4Lite1 feature, not a FreeBSD feature. <sys/ioctl.h> is a
compatibility misfeature.

Moved NPCI ifdef. This file didn't compile if NPCI <= 0. It shouldn't
be configured in that case, but it is easy to support (mis)configuration
of drivers without buses by generating null objects, and many drivers
do it.

Removed unused includes.


32926 31-Jan-1998 eivind

Attempt at making this use DEVFS properly. (Now it should at least work.)


32869 29-Jan-1998 jkh

Update to version stable-165
Submitted by: Ustimenko Semen <semen@iclub.nsu.ru>


32801 26-Jan-1998 julian

Add Simon Shapiro's DPT driver
this shouldn't break anything existing.
Userland utilities to follow.


32726 24-Jan-1998 eivind

Make all file-system (MFS, FFS, NFS, LFS, DEVFS) related option new-style.

This introduce an xxxFS_BOOT for each of the rootable filesystems.
(Presently not required, but encouraged to allow a smooth move of option *FS
to opt_dontuse.h later.)

LFS is temporarily disabled, and will be re-enabled tomorrow.


32679 21-Jan-1998 jkh

Driver for the new SMC 9432TX cards.

Submitted by: Ustimenko Semen <semen@iclub.nsu.ru>


32657 20-Jan-1998 nate

- Support for multiple PD6832 controllers. Each found 6832 is assigned
and initializes the next two ports in order starting at 03e0. This
also patches pcic_p.h to reduce the I/O ports mapped from 4 to 2.

Submitted by: Ted Faber <faber@ISI.EDU>


32506 14-Jan-1998 kato

Include pc98.h instead of isa.h when PC98 is defined.


32350 08-Jan-1998 eivind

Make INET a proper option.

This will not make any of object files that LINT create change; there
might be differences with INET disabled, but hardly anything compiled
before without INET anyway. Now the 'obvious' things will give a
proper error if compiled without inet - ipx_ip, ipfw, tcp_debug. The
only thing that _should_ work (but can't be made to compile reasonably
easily) is sppp :-(

This commit move struct arpcom from <netinet/if_ether.h> to
<net/if_arp.h>.


32136 31-Dec-1997 ahasty

Reviewed by: Amancio Hasty
Submitted by: Jonathan Hanna <pangolin@rogers.wave.ca>
The patch is for a Hauppauge Win/TV dbx with FM. I still need to
config OVERRIDE_TUNER, but it works nicely.


31847 19-Dec-1997 dyson

Correct the check for multiword dma. It was incorrectly checking
for multiword dma mode 4 (which doesn't exist.)
Submitted by: John Hood


31742 15-Dec-1997 eivind

Throw options IPX, IPXIP and IPTUNNEL into opt_ipx.h.

The #ifdef IPXIP in netipx/ipx_if.h is OK (used from ipx_usrreq.c and
ifconfig.c only).

I also fixed a typo IPXTUNNEL -> IPTUNNEL (and #ifdef'ed out the code
inside, as it never could have compiled - doh.)


31504 02-Dec-1997 se

Fix size of start queue to 32 entries, independent of the default
number of tags (NCR_SCSI_DFLT_TAGS), which is 0 in the FAILSAFE case.
This should fix the incompatibility between kernel and ncrcontrol,
which is the result of FAILSAFE being defined in the kernel config
file, invisible to the build of ncrcontrol. (See kern/5133, which
should be fixed by this change.)


31503 02-Dec-1997 nate

- Add necessary include files and fix bugs in last.


31502 02-Dec-1997 nate

- Bring in code removed from /sys/pccard/pcic.c, including DEVICE IDs, and
more bootverbose code.
- Style nits.

No significant functional changes.


31496 02-Dec-1997 nate

- Framework for PCI/CardBus controllers running in PCMCIA emulation
mode. Currently, the only supported controller is the Cirrus Logic
PD6832, but others can be supported with docs on them.

Submitted by: Ted Faber <faber@ISI.EDU>


31447 29-Nov-1997 dg

Shuffle things a bit for better cacheline behavior.


31350 22-Nov-1997 bde

Ifdefed a conditionally used #include.

Staticized.


31347 22-Nov-1997 msmith

Add Winbond W89C940 ID to the list.
Submitted by: Micha Class <michael_class@hpbbse.bbn.hp.com>


31267 18-Nov-1997 bde

Removed unused #includes.

Police <> vs "" #include style.


31186 16-Nov-1997 ahasty

Reviewed by: Amancio Hasty
Submitted by: Amancio Hasty <hasty@star-gate.com>
Added yuv12 support for mpeg encoding and Randall Hopper's fixed for Temporal
Decimation


31113 11-Nov-1997 wollman

Attempt to tell the user precisely what sort of VGA-like PCI device is
in their system. The list comes originally from XFree86's SuperProbe
program.


31041 08-Nov-1997 peter

Merge 971020 stuff.. Check 21142? SROM CRC.


31017 07-Nov-1997 phk

Rename some local variables to avoid shadowing other local variables.

Found by: -Wshadow


31016 07-Nov-1997 phk

Remove a bunch of variables which were unused both in GENERIC and LINT.

Found by: -Wunused


30995 06-Nov-1997 markm

Rats. Committed the wrong version.
Move the declarations to the top of the ioctl() function so this compiles.


30980 06-Nov-1997 markm

1) Add the IOCTL for Luigi's BT848 -> I2C bus driver.
2) Fix temporal decimation, disable it when
doing CAP_SINGLEs, and in dual-field capture, don't
capture fields for different frames

Submitted by: Luigi Rizzo & Randall Hopper


30856 30-Oct-1997 eivind

Improve PAL support and fix mux selector values.

This make the Miro PCTV work for me, including audio, and should
hopefully fix the other audio problems some people have been having.

Reviewed by: ahasty & Luigi Rizzo (freebsd-multimedia)


30813 28-Oct-1997 bde

Removed unused #includes.


30706 25-Oct-1997 phk

Recognize even more of the Znyx 314 cards.


30655 23-Oct-1997 dg

Rewrote fxp_start() for better clarity and efficiency.


30557 18-Oct-1997 peter

Add an $Id$


30556 18-Oct-1997 peter

Merge in changes from Matt. Accton EN12xx support, bugfixes. There is
a change that might have an effect on the problems some have seen
with older chips, it looks like the driver may have mistakenly thought
there was an SIA when there isn't.


30550 18-Oct-1997 peter

This commit was generated by cvs2svn to compensate for changes in r30549,
which included commits to RCS files with non-trunk default branches.


30516 17-Oct-1997 wollman

Oops... back out the change to recognize the TI 1131; there's a better place.


30515 17-Oct-1997 wollman

Teach the PCI code about the TI 1131 and NeoMagic NM2160 in my laptop.


30505 17-Oct-1997 dg

Fixed a bug where input packets were counted twice - messing up the
stats.


30342 12-Oct-1997 peter

Attempt to support IPX.

Suggested patch by: Vasily V. Grechishnikov <bazilio@ied-vorstu.ac.ru>
(plus cut/paste, whitespace and typo fixes)


30267 10-Oct-1997 asami

Add IDs for Intel 82371MX/82437MX (mobile PCI chipset).

Reviewed by: se


30216 08-Oct-1997 markm

Despam 1.11, 1.12 and 1.13 caused by no sync between author/committer/CURRENT


30193 07-Oct-1997 markm

Latest round of patches from the author.

This driver includes the following patches submitted by:

1.0 Hideyuki Suzuki <hideyuki@sat.t.u-tokyo.ac.jp>
Japanese Cable support

2.0 Keith Sklower <sklower@CS.Berkeley.EDU>
Minor update to the BSDI section so it compiles cleanly on BSDI

3.0 Joao Carlos Mendes Luis <jonny@coppe.ufrj.br>
ioctl interface to select video format , NTSC, PAL, etc...


30081 03-Oct-1997 peter

Nuke these two out of date readme files. This stuff should be in de(4)
man pages rather than hidden here anyway.


29998 30-Sep-1997 dg

Killed a gratuitous assignment in a NetBSD case.


29997 30-Sep-1997 dg

Two changes which should make the system less suseptible to receiver
overruns (not that it was a problem, but it could be):

1) Doubled the number of receive buffers in the DMA chain to 64.
2) Do packet receive processing before transmit in the interrupt routine.


29974 29-Sep-1997 dg

Work around a bug in the 82557 NIC where the receiver will lock up
if it is in 10Mbps mode and gets certain types of garbage prior to
the packet header. The work-around involves reprogramming the
multicast filter if nothing is received in some number of seconds
(currently set at 15). As a side effect, implemented complete support
for multicasting rather than the previous 'receive all multicasts'
hack, since we now have the ability to program the filter table.
Fixed a serious bug which crept in with the timeout() changes;
the cookie was only saved on the first timeout() call in fxp_init()
and wasn't updated in the most common place in fxp_stats_update()
when the timeout was rescheduled. This bug would have resulted in
an eventual panic if fxp_stop() was called (which happens when any
interface flags are changed, for example).
Fixed a bug in Alpha support that would have caused the TxCB
descriptor chain to span a page boundry, causing serious problems
if the pages didn't happen to be contiguous.
Removed some gratuitous bit masking that was left over from an
older implementation.
Fixed a bug where too much was copied from the configuration
template, spilling over into memory that followed it.
Fixed handling of if_timer...it was cleared too early in some cases.


29786 24-Sep-1997 phk

Remove the 82371 IDE devices.
Add Intel 82439TX System Controller (MTXC)
fix a whitespace problem.


29681 21-Sep-1997 gibbs

Update for new callout interface.


29636 20-Sep-1997 dyson

Addition of support of the slightly rogue Promise IDE interface(Dyson), support
of multiple PCI IDE controllers(Dyson), and some updates and cleanups from
John Hood, who originally made our IDE DMA stuff work :-).

I have run tests with 7 IDE drives connected to my system, all in DMA
mode, with no errors. Modulo any bugs, this stuff makes IDE look
really good (within it's limitations.)

Submitted by: John Hood <cgull@smoke.marlboro.vt.us>


29627 20-Sep-1997 peter

``oops''. I cut/pasted the original free()'s based on mark's suggestion
rather than extracting the diff from Mark's patch, but it turns out that
I was freeing one allocation twice due to a previous cut/paste braino.
My botch, not Mark's.

Pointed out by: Mark Valentine <mv@pobox.com>


29570 18-Sep-1997 peter

Missed a place where the extra descriptor buffers would need to be
freed.

Submitted by: Mark Valentine <mark@linus.demon.co.uk>


29368 14-Sep-1997 peter

Update select -> poll in drivers.


29306 11-Sep-1997 peter

malloc() the rx and tx descriptors seperately rather than as part of the
large (over 4KB) softc struct. The descriptor array is accessed by
busmaster dma and must be physically contiguous in memory. malloc() of
a block greater than a page is only virtually contiguous, and not
necessarily physically contigious.

contigmalloc() could do this, but that is a bit on the overkill side.

I'm not sure of the origins of the problem report and diagnosis, I learned
of the problem via mail forwarded from Jim Shankland <jas@flyingfox.com>.

Jim said that Matt Thomas's workaround was to reduce the number of
transmit descriptors from 128 to 32, but I was concerned that it might
cost performance. Anyway, this change is my fault, not Jim's. :-)

Reviewed by: davidg


29292 10-Sep-1997 se

Treat "reservation conflict" status similar to "busy".


29253 09-Sep-1997 se

Remove scaling of tp->period, since the value is assumed to be in
tenth of a nanoseconds by ncrcontrol


29233 09-Sep-1997 markm

Amancio's latest in the Brooktree driver.
This fixes the european frequency set, separates this further from the
Meteor driver and fixes bugs.


29138 05-Sep-1997 dg

Changes to support NetBSD and the new ifmedia extensions.
Submitted by: Jason Thorpe <thorpej@netbsd.org>


29113 04-Sep-1997 sos

Upgrade of EIDE DMA support, Johns comments:

* lots of fixes to error handling-- mostly works now
* improve DMA timing config for Triton chipsets-- PIIX4 and UDMA drive
still untested
* generally improve DMA config in many ways-- mostly cleanup
* clean up boot-time messages
* rewrite PRD generation algorithm
* first wd timeout is now longer, to handle drive spinup

Submitted by: John Hood <cgull@smoke.marlboro.vt.us>


29112 04-Sep-1997 sos

No longer needed, superceded by ide-pci.c ide-pcireg.h


29041 02-Sep-1997 bde

Removed unused #includes.


29024 02-Sep-1997 bde

Added used #include - don't depend on <sys/mbuf.h> including
<sys/malloc.h> (unless we only use the bogusly shared M*WAIT flags).


28960 31-Aug-1997 se

Prepare for 64bit programming environment (e.g. Alpha):

Use "ncrcmd" or "u_int32_t" instead of "u_long", where appropriate.

Submitted by: Gerard Roudier <groudier@club-internet.fr>


28959 31-Aug-1997 se

Remove debug printf() that had been ommited by accident.


28958 31-Aug-1997 se

Fix problem with early revision 53c825a and 53c875 chips, which
could cause a solid system lockup in the driver attach:

These chips do not abort an access to the internal SRAM, when
the driver set the software reset bit in the istat register. But
the chip will never acknowledge the requested PCI bus transfer
in the situation, causing an infinite wait and a lockout of other
bus-masters.

The problem has been reported for rev 0x11 of the 53c825a and
rev 0x01 of the 53c875.
Revisions 0x13 of the 53c825a and 0x03 of the 53c875 are known
to support SRAM accesses, even in the software reset state.


28919 30-Aug-1997 itojun

Scsi RESERVATION CONFLICT and BUSY support for Tekram scsi cards.
Checked with DC390. Pls mail me if you have any trouble with this patch.


28645 24-Aug-1997 se

Go back to previous definition of FE_CACHE_SET, since the problem
caused by read-multiple on the 53c810a should have been fixed by
adjusting the alignment of the global header in rev 1.104 of ncr.c.


28636 23-Aug-1997 se

Some cleanup and a fix for an assumed chip bug:
- Do not malloc SCRIPTS memory for those parts of the microcode that
are to be loaded into the on-chip SRAM of the 53c825a or 875 ...
- Modify ncr_chip_lookup to make adding new entries easier.
- Disable use of on-chip SRAM for the 53c825 rev 0x10 to 0x12, since
there seems to be a problem with rev 0x11, while 0x13 is known to
work. (Tested by Chuck Robey <chuckr@glue.umd.edu>).

This code will be merged into 2.2-stable after a few more days of
testing in -current.


28634 23-Aug-1997 se

Minor corrections to the code added in rev. 1.100 and 1.101:
- fix features of 53c860
- correctly adjust data structure to cache line boundary (32 bytes)

Submitted by: Gerard Roudier <groudier@club-internet.fr>


28520 21-Aug-1997 fsmp

Yank the casts.


28517 21-Aug-1997 fsmp

Reorder function decls alphabetically.


28508 21-Aug-1997 fsmp

Add a cast to eliminate a compiler warning.


28505 21-Aug-1997 fsmp

A few more casts and a function declaration for warning free kernel builds.


28283 17-Aug-1997 fsmp

Added frequencies for north american HRC cable.

Submitted by: Yixin Jin <yjin@rain.cs.ucla.edu> (I think)
Resubmitted by: Kenneth Merry <ken@gt.ed.net>


28255 16-Aug-1997 dyson

SMP Natoma motherboards cannot know if you are booting a UP or SMP OS. This
mod makes sure that the Natoma chipset is set into the correct mode. In
the case of my P6DNF, when booting a UP kernel, I see a substantial improvement
in the latency of certain operations. It appears that the cache hit
latency is curiously improved the most, per lat_mem_rd.


28210 14-Aug-1997 danny

Add the NetVin 5000 series NE2000 PCI card vendor and device IDs.


28073 11-Aug-1997 se

Fix problem in the DC390_DefaultEEprom subroutine, which could lead
to spurious wites outside an alloccated array in the case of generic
AMD SCSI cards.

PR: kern/4217
Submitted by: Erik H. Moe <ehm@cris.com>


28030 10-Aug-1997 phk

Fix the VLSI chipset name from "Eagle" to "Eagle II".


27988 08-Aug-1997 phk

Add ID's for 5 VLSI chips. They're not very friendly, so this info was
found by taking my HP800CT apart, perusing HPs (Very good!) service
manual and inference from a bad gif file I found in Finland.
Sigh... But it's a nice machine :-)


27943 06-Aug-1997 se

Remove two features that have been reported to cause problems with
certain variants of the NCR chip from FE_CACHE_SET: FE_CLSE (enable
cache-line size register) and FE_ERMP (enable read-multiple). They
will be re-enabled, if a fix for the underlying problem (a restriction
in the memory to memory move logic of some chips) has been implemented.


27862 03-Aug-1997 peter

Merge Matt's if_de.c changes in.


27860 03-Aug-1997 peter

This commit was generated by cvs2svn to compensate for changes in r27859,
which included commits to RCS files with non-trunk default branches.


27845 02-Aug-1997 bde

Removed unused #includes.


27762 29-Jul-1997 se

Fix problem caused by a chunk of the previous patch having been
applied to the wrong source code lines (non-fatal, since it just
made an auto variable become visible at the global level).


27756 29-Jul-1997 sos

Add support for busmaster DMA on some PCI IDE chipsets.

I changed a few bits here and there, mainly renaming wd82371.c
to ide_pci.c now that it's supposed to handle different chipsets.

It runs on my P6 natoma board with two Maxtor drives, and also
on a Fujitsu machine I have at work with an Opti chipset and
a Quantum drive.

Submitted by:cgull@smoke.marlboro.vt.us <John Hood>

Original readme:

*** WARNING ***

This code has so far been tested on exactly one motherboard with two
identical drives known for their good DMA support.

This code, in the right circumstances, could corrupt data subtly,
silently, and invisibly, in much the same way that older PCI IDE
controllers do. It's ALPHA-quality code; there's one or two major
gaps in my understanding of PCI IDE still. Don't use this code on any
system with data that you care about; it's only good for hack boxes.
Expect that any data may be silently and randomly corrupted at any
moment. It's a disk driver. It has bugs. Disk drivers with bugs
munch data. It's a fact of life.

I also *STRONGLY* recommend getting a copy of your chipset's manual
and the ATA-2 or ATA-3 spec and making sure that timing modes on your
disk drives and IDE controller are being setup correctly by the BIOS--
because the driver makes only the lamest of attempts to do this just
now.

*** END WARNING ***

that said, i happen to think the code is working pretty well...

WHAT IT DOES:

this code adds support to the wd driver for bus mastering PCI IDE
controllers that follow the SFF-8038 standard. (all the bus mastering
PCI IDE controllers i've seen so far do follow this standard.) it
should provide busmastering on nearly any current P5 or P6 chipset,
specifically including any Intel chipset using one of the PIIX south
bridges-- this includes the '430FX, '430VX, '430HX, '430TX, '440LX,
and (i think) the Orion '450GX chipsets. specific support is also
included for the VIA Apollo VP-1 chipset, as it appears in the
relabeled "HXPro" incarnation seen on cheap US$70 taiwanese
motherboards (that's what's in my development machine). it works out
of the box on controllers that do DMA mode2; if my understanding is
correct, it'll probably work on Ultra-DMA33 controllers as well.
it'll probably work on busmastering IDE controllers in PCI slots, too,
but this is an area i am less sure about.

it cuts CPU usage considerably and improves drive performance
slightly. usable numbers are difficult to come by with existing
benchmark tools, but experimentation on my K5-P90 system, with VIA
VP-1 chipset and Quantum Fireball 1080 drives, shows that disk i/o on
raw partitions imposes perhaps 5% cpu load. cpu load during
filesystem i/o drops a lot, from near 100% to anywhere between 30% and
70%. (the improvement may not be as large on an Intel chipset; from
what i can tell, the VIA VP-1 may not be very efficient with PCI I/O.)
disk performance improves by 5% or 10% with these drives.

real, visible, end-user performance improvement on a single user
machine is about nil. :) a kernel compile was sped up by a whole three
seconds. it *does* feel a bit better-behaved when the system is
swapping heavily, but a better disk driver is not the fix for *that*
problem.

THE CODE:

this code is a patch to wd.c and wd82371.c, and associated header
files. it should be considered alpha code; more work needs to be
done.

wd.c has fairly clean patches to add calls to busmaster code, as
implemented in wd82371.c and potentially elsewhere (one could imagine,
say, a Mac having a different DMA controller).

wd82371.c has been considerably reworked: the wddma interface that it
presents has been changed (expect more changes), many bugs have been
fixed, a new internal interface has been added for supporting
different chipsets, and the PCI probe has been considerably extended.

the interface between wd82371.c and wd.c is still fairly clean, but
i'm not sure it's in the right place. there's a mess of issues around
ATA/ATAPI that need to be sorted out, including ATAPI support, CD-ROM
support, tape support, LS-120/Zip support, SFF-8038i DMA, UltraDMA,
PCI IDE controllers, bus probes, buggy controllers, controller timing
setup, drive timing setup, world peace and kitchen sinks. whatever
happens with all this and however it gets partitioned, it is fairly
clear that wd.c needs some significant rework-- probably a complete
rewrite.

timing setup on disk controllers is something i've entirely punted on.
on my development machine, it appears that the BIOS does at least some
of the necessary timing setup. i chose to restrict operation to
drives that are already configured for Mode4 PIO and Mode2 multiword
DMA, since the timing is essentially the same and many if not most
chipsets use the same control registers for DMA and PIO timing.

does anybody *know* whether BIOSes are required to do timing setup for
DMA modes on drives under their care?

error recovery is probably weak. early on in development, i was
getting drive errors induced by bugs in the driver; i used these to
flush out the worst of the bugs in the driver's error handling, but
problems may remain. i haven't got a drive with bad sectors i can
watch the driver flail on.

complaints about how wd82371.c has been reindented will be ignored
until the FreeBSD project has a real style policy, there is a
mechanism for individual authors to match it (indent flags or an emacs
c-mode or whatever), and it is enforced. if i'm going to use a source
style i don't like, it would help if i could figure out what it *is*
(style(9) is about half of a policy), and a way to reasonably
duplicate it. i ended up wasting a while trying to figure out what
the right thing to do was before deciding reformatting the whole thing
was the worst possible thing to do, except for all the other
possibilities.

i have maintained wd.c's indentation; that was not too hard,
fortunately.

TO INSTALL:

my dev box is freebsd 2.2.2 release. fortunately, wd.c is a living
fossil, and has diverged very little recently. included in this
tarball is a patch file, 'otherdiffs', for all files except wd82371.c,
my edited wd82371.c, a patch file, 'wd82371.c-diff-exact', against the
2.2.2 dist of 82371.c, and another patch file,
'wd82371.c-diff-whitespace', generated with diff -b (ignore
whitespace). most of you not using 2.2.2 will probably have to use
this last patchfile with 'patch --ignore-whitespace'. apply from the
kernel source tree root. as far as i can tell, this should apply
cleanly on anything from -current back to 2.2.2 and probably back to
2.2.0. you, the kernel hacker, can figure out what to do from here.
if you need more specific directions, you probably should not be
experimenting with this code yet.

to enable DMA support, set flag 0x2000 for that drive in your config
file or in userconfig, as you would the 32-bit-PIO flag. the driver
will then turn on DMA support if your drive and controller pass its
tests. it's a bit picky, probably. on discovering DMA mode failures
or disk errors or transfers that the DMA controller can't deal with,
the driver will fall back to PIO, so it is wise to setup the flags as
if PIO were still important.

'controller wdc0 at isa? port "IO_WD1" bio irq 14 flags 0xa0ffa0ff
vector wdintr' should work with nearly any PCI IDE controller.

i would *strongly* suggest booting single-user at first, and thrashing
the drive a bit while it's still mounted read-only. this should be
fairly safe, even if the driver goes completely out to lunch. it
might save you a reinstall.

one way to tell whether the driver is really using DMA is to check the
interrupt count during disk i/o with vmstat; DMA mode will add an
extremely low number of interrupts, as compared to even multi-sector
PIO.

boot -v will give you a copious register dump of timing-related info
on Intel and VIAtech chipsets, as well as PIO/DMA mode information on
all hard drives. refer to your ATA and chipset documentation to
interpret these.

WHAT I'D LIKE FROM YOU and THINGS TO TEST:

reports. success reports, failure reports, any kind of reports. :)
send them to cgull+ide@smoke.marlboro.vt.us.

i'd also like to see the kernel messages from various BIOSes (boot -v;
dmesg), along with info on the motherboard and BIOS on that machine.

i'm especially interested in reports on how this code works on the
various Intel chipsets, and whether the register dump works
correctly. i'm also interested in hearing about other chipsets.

i'm especially interested in hearing success/failure reports for PCI
IDE controllers on cards, such as CMD's or Promise's new busmastering
IDE controllers.

UltraDMA-33 reports.

interoperation with ATAPI peripherals-- FreeBSD doesn't work with my
old Hitachi IDE CDROM, so i can't tell if I've broken anything. :)

i'd especially like to hear how the drive copes in DMA operation on
drives with bad sectors. i haven't been able to find any such yet.

success/failure reports on older IDE drives with early support for DMA
modes-- those introduced between 1.5 and 3 years ago, typically
ranging from perhaps 400MB to 1.6GB.

failure reports on operation with more than one drive would be
appreciated. the driver was developed with two drives on one
controller, the worst-case situation, and has been tested with one
drive on each controller, but you never know...

any reports of messages from the driver during normal operation,
especially "reverting to PIO mode", or "dmaverify odd vaddr or length"
(the DMA controller is strongly halfword oriented, and i'm curious to
know if any FreeBSD usage actually needs misaligned transfers).

performance reports. beware that bonnie's CPU usage reporting is
useless for IDE drives; the best test i've found has been to run a
program that runs a spin loop at an idle priority and reports how many
iterations it manages, and even that sometimes produces numbers i
don't believe. performance reports of multi-drive operation are
especially interesting; my system cannot sustain full throughput on
two drives on separate controllers, but that may just be a lame
motherboard.

THINGS I'M STILL MISSING CLUE ON:

* who's responsible for configuring DMA timing modes on IDE drives?
the BIOS or the driver?

* is there a spec for dealing with Ultra-DMA extensions?

* are there any chipsets or with bugs relating to DMA transfer that
should be blacklisted?

* are there any ATA interfaces that use some other kind of DMA
controller in conjunction with standard ATA protocol?

FINAL NOTE:

after having looked at the ATA-3 spec, all i can say is, "it's ugly".
*especially* electrically. the IDE bus is best modeled as an
unterminated transmission line, these days.

for maximum reliability, keep your IDE cables as short as possible and
as few as possible. from what i can tell, most current chipsets have
both IDE ports wired into a single buss, to a greater or lesser
degree. using two cables means you double the length of this bus.

SCSI may have its warts, but at least the basic analog design of the
bus is still somewhat reasonable. IDE passed beyond the veil two
years ago.

--John Hood, cgull@smoke.marlboro.vt.us


27744 28-Jul-1997 se

Add support for loading the SCRIPTS microcode into the on-chip RAM
of the Symbios 53c825A, 53c875 and 53c895 SCSI chips.

Submitted by: Gerard Roudier <groudier@club-internet.fr>


27687 25-Jul-1997 dg

Added support for the Seeq 80c24 PHY; does nothing except disable the
unsupported warning message for it.


27684 25-Jul-1997 se

Add Ultra-SCSI support and enable more features for advanced
Symbios/NCR SCSI chips (no-flush option, large fifo, ...).

Submitted by: Gerard Roudier <groudier@club-internet.fr>


27514 18-Jul-1997 se

Assign correct chip set register dump functions to Triton II device IDs.

PR: i386/4092
Submitted by: Steve Bauer <sbauer@rock.sdsmt.edu>


27512 18-Jul-1997 se

Fix "unexpected phase change" interrupt handler: Do not access the
dstat register twice, pass the value read the first time to the fixup
code instead.

Submitted by: Gerard Roudier <groudier@club-internet.fr>


27128 01-Jul-1997 bde

Don't cast function pointers to (void *). This will cause warnings.
They should be fixed when similar warnings for the general interrupt
attach routines are fixed.

Removed unused #include.


26998 27-Jun-1997 gibbs

Modify my copyright notice to allow the sequencer to be used with GPLed
software (aka Linux).


26946 25-Jun-1997 fsmp

Modified to use renamed get_pci_apic_irq() -> pci_apic_pin() function.


26798 22-Jun-1997 peter

Superceded by dc21040reg.h


26797 22-Jun-1997 peter

Initial set of patches to get it to compile on >= 3.0. Most of the
changes relative to the 2.2 compatable version are include file
related, the new multicast interface (!) and the new PCI interface.

This should work "as-is" but has not been tested (I have not been able
to get a dc21x4x based card for testing).


26791 22-Jun-1997 peter

This commit was generated by cvs2svn to compensate for changes in r26790,
which included commits to RCS files with non-trunk default branches.


26672 16-Jun-1997 dg

Minor optimization in fxp_intr.


26651 14-Jun-1997 fsmp

Added 2 new defines:
- OVERRIDE_TUNER: allows you to manually choose the tuner type for those
cards that fail to probe properly. See source for legal
values.
- OVERRIDE_DBX: allows you to manually choose DBX or NO DBX for those
cards that fail to probe properly.
0 == no DBX circuit present, 1 == DBX circuit present.


26623 13-Jun-1997 dg

Added support for the Intel 82555 PHY chip which is being used on newer
Pro/100B cards. Full duplex should work now, although it hasn't been
tested.


26568 11-Jun-1997 se

Add device IDs for new Symbios SCSI chips (53c875J,885,895,896), which
should work with no driver changes, though not all features are currently
used.

Remove code that was conditional on NEW_SCSICONF not being defined. This
was temporary code, that at a time got excluded correctly, until the new
scsiconf became the default, and NEW_SCSICONF was no longer specified.

Add support for quirks defined in scsiconf.c. For now only the HP3724/5
needs an entry, since that drive can't be used with tags.


26391 02-Jun-1997 se

Move call of pci_addcfg() before test of cfg->subordinatebus, since the
device probe of a host to PCI bridge may modify that value, based on
its knowledge of device specific registers. This makes the Intel XXpress
work, as verified by: Terje Marthinussen <terjem@cc.uit.no>.


26347 01-Jun-1997 peter

PCI_CLASS_MASS_STORAGE (under PCI_COMPAT) was used in a driver in LINT
still (stallion.c).


26287 30-May-1997 se

Add code to correctly probe all buses on the Intel XXPRESS motherboard.
Add a few Intel PCI chip-set names (VX) and fix Orion entries.


26286 30-May-1997 se

Remove use of intrec*, use void* instead.
Disable test entries for wired PCI devices on bus 1.


26253 28-May-1997 se

Add one more compatibility define to make the Adaptec driver compile
with option AHC_ALLOW_MEMIO again ....


26232 28-May-1997 se

Define command register enable bits, which are required for a consitency
test added to pci_compat.c


26231 28-May-1997 se

Add consistency check to the functions that map port or memory ranges:
Return failure, if the enable bit corresponding to the map type has not
been set in the command register. This feature was requested by Justin
Gibbs, who pointed out that some early PCI to PCI bridges do not correctly
support memory windows (I assume because of the risk of deadlocks that
have been taken care of in the PCI 2.2 spec) and that some BIOS clears
the memory address decode enable bit in the command register of the PCI
device, if it finds them behind such a bridge.


26230 28-May-1997 se

Two minor changes to the code that builds the pci map array:
1) Stop at the first map register that contains a zero value.
2) When testing for the map size work up from low values, since
this works around a bug in some BusLogic SCSI card, which has
the 16 upper port base address bits hardwired to zero.

The config register dump printed in the bootverbose case has
been slightly rearranged.


26202 27-May-1997 fsmp

Minor cleanup of APIC_IO code.

Submitted by: Stefan Esser <se@freebsd.org>


26186 27-May-1997 fsmp

Add support for APIC_IO to pci IRQ configuration.

The support for APIC_IO was lost in the new set of pci modules. This patch
restores the ability to build SMP/APIC_IO kernels.


26160 26-May-1997 se

This file has been made obsolete by the new PCI code.


26159 26-May-1997 se

Completely replace the PCI bus driver code to make it better reflect
reality. There will be a new call interface, but for now the file
pci_compat.c (which is to be deleted, after all drivers are converted)
provides an emulation of the old PCI bus driver functions. The only
change that might be visible to drivers is, that the type pcici_t
(which had been meant to be just a handle, whose exact definition
should not be relied on), has been converted into a pcicfgregs* .

The Tekram AMD SCSI driver bogusly relied on the definition of pcici_t
and has been converted to just call the PCI drivers functions to access
configuration space register, instead of inventing its own ...

This code is by no means complete, but assumed to be fully operational,
and brings the official code base more in line with my development code.

A new generic device descriptor data type has to be agreed on. The PCI
code will then use that data type to provide new functionality:

1) userconfig support
2) "wired" PCI devices
3) conflicts checking against ISA/EISA
4) maps will depend on the command register enable bits
5) PCI to Anything bridges can be defined as devices,
and are probed like any "standard" PCI device.

The following features are currently missing, but will be added back,
soon:

1) unknown device probe message
2) suppression of "mirrored" devices caused by ancient, broken chip-sets

This code relies on generic shared interrupt support just commited to
kern_intr.c (plus the modifications of isa.c and isa_device.h).


25604 09-May-1997 kjc

This commit was generated by cvs2svn to compensate for changes in r25603,
which included commits to RCS files with non-trunk default branches.


25497 05-May-1997 jmg

use frames instead of fields, and restore full meteor compatibility for
generalized pixel support.

Submitted by: Amancio Hasty


25417 03-May-1997 phk

Initialize PCI/CardBus bridges.

Tested on: HP Omnibook 800 / TI PCI1130
Reviewed by: se


25333 01-May-1997 fsmp

Fixed omission of reference to ioctl_bt848.h when installing on 2.2.


25329 01-May-1997 fsmp

1.15 4/18/97 John-Mark Gurney <gurney_j@resnet.uoregon.edu>
Added [SR]RGBMASKs ioctl for byte swapping.

1.16 4/20/97 Randall Hopper <rhh@ct.picker.com>
Generalized RGBMASK ioctls for general pixel
format setting [SG]ACTPIXFMT, and added query API
to return driver-supported pix fmts GSUPPIXFMT.

1.17 4/21/97 hasty@rah.star-gate.com
Clipping support added.

1.18 4/23/97 Clean up after failed CAP_SINGLEs where bt
interrupt isn't delivered, and fixed fixing
CAP_SINGLEs that for ODD_ONLY fields.

Submitted by: individuals in above log messages.


25259 28-Apr-1997 se

Move CMD640 option from kernel Makefile into opt_wd.h

Submitted by: Wolfgang Helbig <helbig@mx.ba-stuttgart.de>


25164 26-Apr-1997 peter

Man the liferafts! Here comes the long awaited SMP -> -current merge!

There are various options documented in i386/conf/LINT, there is more to
come over the next few days.

The kernel should run pretty much "as before" without the options to
activate SMP mode.

There are a handful of known "loose ends" that need to be fixed, but
have been put off since the SMP kernel is in a moderately good condition
at the moment.

This commit is the result of the tinkering and testing over the last 14
months by many people. A special thanks to Steve Passe for implementing
the APIC code!


25121 24-Apr-1997 se

Add definition of PCI_SUBID_REG2, the subvendor/device ID for
a header type 2 device.


25112 23-Apr-1997 se

Add preliminary support for PCI config header type 2:
Fetch subvendor/device ID from config space register 0x40.


25094 23-Apr-1997 dg

Check that the received packet length indicated by the card is at least
large enough to contain the ethernet header. There appears to be a
condition where the card can return "0" in some failure cases, and this
causes bad things to happen (a panic).


25048 20-Apr-1997 bde

Fixed the type of timeout functions and removed casts that hid the
type mismatches. There was no problem in practice (at least on 386's).

Removed NetBSD-related TIMEOUT macro. NetBSD uses the same BSD4.4Lite
timeout interface as FreeBSD. As a concession to portability, declare
the timeout function without using the FreeBSD timeout_t typedef.


25039 20-Apr-1997 phk

The bit of the cardbus bridge support code se and I have been able to agree
on so far... :-)
Reviewed by: se


24995 18-Apr-1997 davidn

Rearrange pci network card identification for easier additions.
Added KTI NE2000 clone.


24991 17-Apr-1997 fsmp

Amancio:
This patch fixes the problem of vic only capturing an even or odd frame plus
the my early patch for missing frames with resolutions higher than 320x240
in rgb mode.

The yuv422 patch introduces a minor bug in that a green line appears at the
bottom of the captured window . There is no easy work around for this right
now.

Reviewed by: various bt848 hackers
Submitted by: Amancio Hasty <hasty@rah.star-gate.com>


24646 05-Apr-1997 phk

Recognize ZNYX 314 cards that have a MAC address with the low bit set.


24621 04-Apr-1997 kato

Deleted <pc98/pc98/pc98_device.h>.


24528 02-Apr-1997 fsmp

PAL support: magic numbers moved into format_params structure.
Revised AFC interface.
Fixed DMA_PROG_ALLOC size misdefinition.

Submitted by: richard@cogsci.ed.ac.uk (Richard Tobin)


24352 28-Mar-1997 phk

Don't break the nice symmetry of these messages with undue '>' chars.


24282 25-Mar-1997 se

Fix printing of map sizes: large numbers got a negative sign before.


24281 25-Mar-1997 se

Improve probe message for generic PCI->xxx bridge chips.

Submitted by: phk


24280 25-Mar-1997 se

Add a few vendor IDs and class and sub-class encodings.

Submitted by: phk


24264 25-Mar-1997 dg

Made a couple of minor optimizations that improve performance of the
common case of the interrupt routine by about 20%.


24246 25-Mar-1997 fsmp

"Louis A. Mamakos" <louie@TransSys.COM> new bt848 struct
Randall Hopper <rhh@ct.picker.com> GHUE/GBRIGHT bug
Louis Mamakos made a new bt848 struct, including massive changes to the entire
body of code, substituting array offsets with struct members.

Randall Hopper aadded fixes of BT848_GHUE & BT848_GBRIG.

I (fsmp):
added polled hardware i2c routines,
removed all existing software i2c routines.
added eeprom support.


24204 24-Mar-1997 bde

Don't include <sys/ioctl.h> in the kernel. Stage 2: include
<sys/sockio.h> instead of <sys/ioctl.h> in network files.


24203 24-Mar-1997 bde

Don't include <sys/ioctl.h> in the kernel. Stage 1: don't include
it when it is not used. In most cases, the reasons for including it
went away when the special ioctl headers became self-sufficient.


24134 23-Mar-1997 kato

Added Accton EN1207-TX support.


24101 22-Mar-1997 bde

Fixed some invalid (non-atomic) accesses to `time', mostly ones of the
form `tv = time'. Use a new function gettime(). The current version
just forces atomicicity without fixing precision or efficiency bugs.
Simplified some related valid accesses by using the central function.


24087 21-Mar-1997 fsmp

Submitted by: Michael Petry <petry@netwolf.NetMasters.com>
Michael submitted code to activate the audio muxes.

fsmp:
extended those changes for different boards.
auto-detection of board types.
auto-detection of tuner types.
auto-detection of stereo option.


24079 21-Mar-1997 dg

Added support for newer cards that have the DP83840A PHY chip.
Fixed a bug in fxp_mdi_write - a hex number was missing a preceding 0x
and this was causing the routine to not wait for a PHY write to complete.
Added support for link0, link1, and link2 flags to toggle auto-
negotiation, 10/100, and half/full duplex:

link0 disable auto-negotiation

When set, these flags then have meaning:

-link1 10Mbps
link1 100Mbps
-link2 half duplex
link2 full duplex

...needs a manual page.


24061 20-Mar-1997 kato

Added Allied Telesis CenterCOM LA100-PCI support. Currently, full
duplex mode doesn't work.


24046 19-Mar-1997 fsmp

additions for table-driven frequency calculation.
addition of colorbar ioctl.
removed unneeded disable_intr()/enable_intr() wrappers in i2c code.
minor cleanup.


23972 17-Mar-1997 fsmp

Submitted by: Doug White <dwhite@gdi.uoregon.edu>

I broke the cable tuning with my 'TEST_A' code. Remove TEST_A define
till I finish this change for both tuning modes. Note that this
will effectively break the new TVTUNER_SETFREQ/TVTUNER_GETFREQ ioctl()s.
These aren't used by anyone but me yet (attempt to provide full resolution
fine tuning for "fringe" stations) so it should be no problem


23964 17-Mar-1997 dg

Fixed two deficiencies in the driver that have existed since it was
written:

1) Full duplex mode is now supported (and works!)
2) The 10Mbps-only PCI Pro/10 should now work (untested, however)

Thanks to Justin Gibbs for providing a PCI bus analyzer trace while the
Intel Windows driver was configuring the board...this made it possible
to figure out the mystery bit that I wasn't setting in the PHY for full
duplex to work.


23935 16-Mar-1997 fsmp

Submitted by: Amancio Hasty <hasty@rah.star-gate.com>

addition of bt848 specific ioctl()s for hue/bright/contrast/satu/satv.

patches by Amancio Hasty to fix "screen freeze" problem.


23930 16-Mar-1997 gibbs

The register definitions are now in the compile directory.


23744 11-Mar-1997 se

Add support for the buggy CMD640B PCI EIDE controller chip, which
can't perform overlapping commands on both of its channels.

To enable the CMD640B work-around, the kernel must be compiled with
"options CMD640". Without that option there should be no difference
in the code produced compared to the previous revision of wd.c.

Submitted by: Wolfgang Helbig <helbig@ba-stuttgart.de>


23599 10-Mar-1997 markm

Initial import of the Brooktree PCI-TV drivers. I have not tested
these, they may not even compile. I am importing them on behalf
of the submitters.
Submitted by: amancio, smp


23100 25-Feb-1997 gibbs

Make it clearer how the termination settings from the PCI probe are used by
the ahc_init routine.


23040 23-Feb-1997 joerg

Add support for the SMC9332BDT that's using the DE21140A chip. This
is merely a stop-gap measure until we can import an upgraded driver
from Matt Thomas.

Closes PR # 2696, and most likely also 2767.

OKed by: core


22975 22-Feb-1997 peter

Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.


22453 09-Feb-1997 gibbs

ULTRAENB->FAST20


22309 05-Feb-1997 dg

Fixed missing ioport offset from the reading/updating of the PLX
interrupt control/status register.

Submitted by: Brian McGovern <bmcgover@cisco.com>


22283 05-Feb-1997 ache

Fix misspelled variable name, -current build stopper


22260 04-Feb-1997 se

Add interface revision field to pci_register_lkm parameter list.pci.c pcibus.h
This parameter is intended to allow new kernels to work with old LKM binaries,
provided the revision ID is incremented whenever the PCI LKM interface is
changed. The revision ID does not at all protect against changes in data
structures accesses by the driver.


22257 04-Feb-1997 dg

Changed several configuration options:

Disabled the DMA byte counters - I had it this way originally and this is
the recommended setting.
Set crscdt to CRS only (0) since this is what it should be for an MII PHY.
Also fixed some comments.


22255 04-Feb-1997 dg

Do "selective" reset rather than full reset...the manual specifically
says not to do the full reset because it can lock up the PCI bus if the
chip is active. Added various PORT command definitions to facilitate
this.


22253 04-Feb-1997 dg

Don't include the short-frames counter in with the input errors. This
counter is incremented on all short frames, including those that are
the result of collisions.


22081 29-Jan-1997 gibbs

Add 1997 to my copyright.

Change the autotermination code slightly to be more careful on narrow
adapters.


21993 25-Jan-1997 se

Remove element pb_maxirq from struct pcibus.


21988 25-Jan-1997 se

Improve on previous fix: Clean up getirq() as well, and remove redundant
warning messages.


21985 24-Jan-1997 gibbs

Add the definition for the CFAUTOTERM bit in the aic78xx SEEPROM.

Add auto-termination support as well as support for setting the high byte
termination. Booting with '-v' will display the settings that the driver
chose. If you stick narrow devices onto the external wide port, you had
better make sure that your converter cable terminates the bus, you have a
wide device on there that terminates the bus, or you manually set the
termination properly in SCSI-Select instead of using "Automatic". The
code will get the setting right regardless if you *don't* have internal
wide devices in this type of configuration. Unfortunatly this is a limitation
of the design of the Adaptec cards.


21965 23-Jan-1997 se

Make IRQ 0 invalid in pci_map_int(), since it is hardwired to the
programmable interval timer chip in PC systems.


21949 22-Jan-1997 gibbs

Be smarter about enabling memory mapped I/O. The AHC_ALLOW_MEMIO option
should not be required anymore.

Turn on ULTRA for cards that don't have a BIOS or SEEPROM.


21936 21-Jan-1997 se

Add PCI LKM support:
The new function pci_register_lkm (struct pci_device *dvp) appends the
driver to the list of known PCI drivers, and initiates a PCI bus rescan.


21934 21-Jan-1997 se

Add PCI LKM support.


21830 17-Jan-1997 joerg

This mega-merge brings Matt Thomas' 960801 FDDI driver (almost) up
to -current.

Thanks goes to Ulrike Nitzsche <ulrike@ifw-dresden.de> for giving me
a chance to test this. Only the PCI driver is tested though.

One final patch will follow in a separate commit. This is so that
everything up to here can be dragged into 2.2, if we decide so.

Reviewed by: joerg
Submitted by: Matt Thomas <matt@3am-software.com>


21827 17-Jan-1997 joerg

This commit was generated by cvs2svn to compensate for changes in r21826,
which included commits to RCS files with non-trunk default branches.


21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


21666 13-Jan-1997 wollman

Use the new if_multiaddrs list for multicast addresses rather than the
previous hackery involving struct in_ifaddr and arpcom. Get rid of the
abominable multi_kludge. Update all network interfaces to use the
new machanism. Distressingly few Ethernet drivers program the multicast
filter properly (assuming the hardware has one, which it usually does).


21375 06-Jan-1997 sos

Fix typo..


21351 05-Jan-1997 se

Fix NetBSD pr kern/3067, which also applies to FreeBSD:
NCR driver dies when "xmcd" accesses the CD-ROM drive

Restrict cacheing of INQUIRY results to LUN 0.

Thanks to Dave Huang <khym@bga.com> for reporting the problem
and suggesting a fix, though I chose a slightly different one.


21179 02-Jan-1997 se

Add Intel VX chip set specific detection and register dump code.
Submitted by: brianc@netrover.com (Brian Campbell)


20874 23-Dec-1996 bde

Don't redefine SCSI_NCR_DFLT_TAGS even in if FAILSAFE is defined.


20741 21-Dec-1996 se

Improve negotiation messages:

Print MB/s instead of MHz (now takes WIDE into account).
Remove extranous "\n" from WIDE negotiation messages.


20723 21-Dec-1996 se

Add PCI IDs of the ProLAN and Compex PCI NE2000 clones.
Based on information sent by Peter Mutsaers <plm@xs4all.nl>.


20719 20-Dec-1996 se

Fix bug that would stop probing for SCSI devices
after the first found, if multiple LUNs are tried.
Change probe message to just the SCSI chip id,
similar to what the NCR driver prints.
Change the driver name to "amd" in all places.

Thanks to Nick Sayer <nsayer@quack.kfu.com> for
doing some debugging, for sending a boot message
log that shows the driver is functional, and for
pointing out there still were places that needed
the driver name to be corrected.


20630 18-Dec-1996 se

Add include of <vm/pmap.h> to make this driver compile under -current.
Cleanup to make it compile cleanly in LINT.
Submitted by: bde


20629 18-Dec-1996 se

Rename DIAGNOSTIC to DMA_DIAGNOSTIC.
Submitted by: bde


20615 18-Dec-1996 se

Add code to fill the EEPROM buffer with default values, if no EEPROM
was found, or if there was a checksum mismatch.
This patch should allow the driver to be used with any AMD 53c974
based SCSI card, or with the AMD SCSI+Ethernet Combo Chip found on
some motherboards.


20614 18-Dec-1996 se

Make compile under FreeBSD-current (3.0-DEVELOPMENT).


20549 16-Dec-1996 se

Fix "opt_ncr.h" changes:
- put #include into #ifdef KERNEL or ncrcontrol won't build
- rename SCSI_DEBUG_FLAGS to SCSI_NCR_DEBUG


20538 15-Dec-1996 se

This commit was generated by cvs2svn to compensate for changes in r20537,
which included commits to RCS files with non-trunk default branches.


20535 15-Dec-1996 se

Fix typo


20517 15-Dec-1996 se

Include "opt_ncr.h" for option settings.


20514 15-Dec-1996 se

Do not limit to 1 LUN if FAILSAVE is set. Seems that CDROM drives
are now only probed for LUN 0, unless there is a specific entry in
scsi_conf.c.


20435 14-Dec-1996 se

General cleanup and new features for 53c875 based cards, especially the
Tekram DC390W/U/F, whose config EEPROM can now be dumped, if the kernel
is built with option NCR_TEKRAM_EEPROM.

Other changes:

- add brackets to expansion of OUTB/W/L macro arguments.
- remove unused NCB structure element ns_async
- support sync. SCSI offset of 16 (instead of only 8) on 825A and 875
- correctly identify 53c810A and 53c825A chips
- preserve SCSI BIOS settings of PCI performance options
- remove (already disabled) support for NCR reset because of command timeout
- reverse order of reading of SCSI and DMA specific interrupt cause registers
- add definition of Tekram config EEPROM contents (not currently used)


20390 13-Dec-1996 jkh

Close PR#2198:

I've added an installation from optical disk drive facility.
This enables FreeBSD to be installed from an optical disk, which
may be formatted in "super floppy" style or sliced into MSDOS-FS
and UFS partitions.

Note: ncr.c should be reviewed by Stefan Esser <se@freebsd.org>
and cd.c by Joerg Wunsch <joerg@freebsd.org> before bringing this
into 2.2.

Submitted-By: Shunsuke Akiyama <akiyama@kme.mei.co.jp>


20276 10-Dec-1996 dg

1) Implement SIOCSIFMTU in ether_ioctl(), and change ether_ioctl's return
type to be int so that errors can be returned.
2) Use the new SIOCSIFMTU ether_ioctl support in the few drivers that are
using ether_ioctl().
3) In if_fxp.c: treat if_bpf as a token, not as a pointer. Don't bother
testing for FXP_NTXSEG being reached in fxp_start()...just check for
non-NULL 'm'. Change fxp_ioctl() to use ether_ioctl().


20095 02-Dec-1996 guido

Some imporvemnets to the vx driver.
1. 'connector_table' is shortened to 'conn_tab'.
2. More reliable connector change code.
3. Display message like "vx0: selected bnc. (link1)"
when the connector changed by link[012].
4. Handle MII properly.
5. Potentially slightly better performance.
6. Fixed a silly typo.

Submitted by: Naoki Hamada <nao@sbl.cl.nec.co.jp>


20060 01-Dec-1996 rgrimes

Cosmetic code cleanup from Matt's latest driver.

a) Removal of private typedefs tulip_uint*_t, use standard u_int_*_t.

b) Change [Dd][Cc]21.4. to just 21.4., seems Dec has done this to all
of the drivers for all OS's. (Did they get in trouble with someone?)
[The few that remain can either not be eliminated, or are waiting for
additional driver functional changes that will remove them.]

c) Move some code from dc21040.h into the driver, later a whole block of that
code and more will move to devar.h, but for now this makes it easier
to study diffs.

d) Add a big bold comment to the README.de file about it not reflecting
reality anymore.

Note that these are all cosmetic changes and should be no functional
change in the driver whatsoever. If _anyone_ spots a problem introduced
by this please let me know ASAP!


19845 18-Nov-1996 dg

Fixed obsolete comment.


19806 16-Nov-1996 gibbs

AHC_FORCE_PIO -> AHC_ALLOW_MEMIO


19737 14-Nov-1996 asami

Some more updates.

wdreg.h: Delete wd_ctlr macro. PC98 version of wd.c treats it as a
variable.

GENERIC98: Delete ep0 entry. Current ep driver write I/O port 0x100.
This clobbers ICW of i8259, because upper 8bits of address line is not
masked on mother board.

if_fe.c: Merge from revision 1.18 of sys/i386/isa/if_fe.c.

pc98.c: Globalize dmapageport, because SCSI driver use this
variable.

wd82371.c: Yet another merge.

These are 2.2 candidates.

Submitted by: The FreeBSD(98) Development Team


19717 13-Nov-1996 jhay

Oops I forgot to add the official id for this card.


19696 12-Nov-1996 se

Add support for header type == 1 devices (PCI 2.1 compatible PCI to PCI
bridges with support for 64 bit memory addresses and 32 bit I/O addresses).

The code is not complete. It ignores the upper half of the long addresses.
This is not a problem on PC compatible systems, but has to be fixed for
real computers.


19695 12-Nov-1996 se

Fix PCI to PCI bridge register bit field masks.

Thanks to "Mike Durian" <durian@plutotech.com> for the very good
problem report and his support as a beta tester of this patch.


19627 11-Nov-1996 gibbs

Clean up the memory mapped/Programmed I/O stuff so that the driver completely
uses one or the other. This required some changes to the ahc_reset()
function, and how early the probes had to allocate their softc.

Turn the AHC_IN/OUT* macros into inline functions and lowercase their names
to indicate this change. Geting AHC_OUTSB to work as a macro doing
conditional memory mapped I/O would have been too gross.

Be smart about the STPWEN control bit in SCFRCTL1. It should only be set
if the low byte of the bus is to be terminated. We figure this out either
by "caching" the value left over from the BIOS setup before we reset the card
or by using the values stored in the seeprom if it is availible.


19610 10-Nov-1996 dg

Put the packet error printf inside #ifdef DIAGNOSTIC.


19548 08-Nov-1996 se

Only access the specific interrupt status registers if required.
This follows more closely the suggestions in the latest NCR docs, and has
been running on my system for weeks with no problem. It does improve the
quality of diagnostic messages and does allow to better understand the
sequence of events in case of an error.

This should go into 2.2 and 2.1.6.


19423 05-Nov-1996 gibbs

Clean up some code having to do with the 398X cards. We can't rely on the
7810 being either the last of the first device to be probed, so use a counting
scheme instead to determine when one card ends and another begins. There may
be a better way to do this by decoding the PCI tag, which I will investigate
later.

2.2 Candidate.


19410 04-Nov-1996 guido

New vx driver for:

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


19242 29-Oct-1996 jhay

Add support for the SDL RISCom N2pci cards. Bring in the enhancements
made to the Arnet driver.


19222 28-Oct-1996 gibbs

Add basic support for the 398X cards as multi-channel SCSI host adapters.
This involves expanding the support of the SEEPROM routines to deal with
the larger SEEPROMs on these cards and providing a mechanism to share
SCB arrays between multiple controllers.

Most of the 398X support came from Dan Eischer.

ahc_data -> ahc_softc

Clean up some more type bogons I missed from the last pass.


19167 25-Oct-1996 gibbs

- KNF cleanup.
- Add support for memory mapped I/O.


19104 22-Oct-1996 se

Definitions for ioctl() accesses to PCI config space registers.

Submitted by: wollman


19101 22-Oct-1996 se

Add support for ioctl() accesses to PCI config space registers.
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


18946 15-Oct-1996 bde

Updated #includes to 4.4lite style.


18922 14-Oct-1996 se

pci_map_mem() did a too restrictive check on the mapping type:
PCI_MAP_MEMORY_TYPE_32BIT_1M should be accepted as well as
PCI_MAP_MEMORY_TYPE_32BIT (and now is).
(Problem reported by David Greenman.)


18919 14-Oct-1996 se

Move the initialization of np->ns_sync and ns_async out of ncr_getclock(),
which does no longer get called for non-Ultra cards.
Fix suggested by Gerard Roudier, slightly modified by me.


18901 13-Oct-1996 dg

Changes to add support for the PCI version of the Cyclades Cyclom-Y
serial adapter, and support for multiple Cyclom controllers.


18892 12-Oct-1996 bde

Removed nested include if <sys/socket.h> from <net/if.h> and
<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>.


18886 12-Oct-1996 se

Fix previous commit: The INB/OUTB macros require np->vaddr to be
initialized, or a kernel panic will occur.

Submitted by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>


18875 11-Oct-1996 se

Improve support of SCSI cards based on the 53c860 and 53c875.
Still no support for Ultra-SCSI and other new features, but the code
should now correctly initialize the clock pre-scaler (based on freqency
measurement results, if necessary).

Fix support of 16 targets for WIDE SCSI.

Disable bus reset in case no progress is made for too long ("ncr dead"
message), which did not work too well with scanners and other slow devices.


18857 10-Oct-1996 wollman

Implement the 802.3 MIB in a way that uses the generic interface
defined in if_mib.h.


18848 10-Oct-1996 pst

The recent change to clock.h to include opt_cpu.h (bug!!!) uncovered a
compile error in ncrcontrol.c -- ncr.c should not be including clock.h
when not compiled for the kernel.


18762 06-Oct-1996 gibbs

Bring aic7xxx driver bug fixes from 'SCSI' into current.


18657 03-Oct-1996 dg

Added multicast support (BPF cookie bug was already fixed).

Submitted by: Steven McCanne <mccanne@cs.berkeley.edu>


18553 29-Sep-1996 dg

Backed out one of my "performance optimizations" as it results in sometimes
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.


18462 22-Sep-1996 dg

Fixed a bug with the management of the pointer to the first TxCB in the
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.


18417 20-Sep-1996 dg

Fixed a bug in the receive buffer allocation code that resulted in a
panic if an mbuf cluster couldn't be allocated. This was caused by a
failure to re-initialize m_data when the old mbuf/mbcluster was recycled.


18407 20-Sep-1996 dg

Add back shutdown support, this time using the at_shutdown() mechanism.


18403 20-Sep-1996 dg

When the devconf stuff was ripped out of the kernel, the ripper neglected
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).


18384 19-Sep-1996 dg

Implemented a better, dynamic, mechanism for adjusting the transmit
threshold.


18359 18-Sep-1996 dg

Increased transmit threshold to 1024 bytes to fix a problem with underruns
on machines with poor PCI performance.


18357 18-Sep-1996 dg

Updated driver to a newer version from Matt Thomas, preserving our local
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)


18313 16-Sep-1996 rgrimes

Re-enable conf82371fb2 now that I have verified that it works, even if
it only prints 2 bits out of hundreds. (Minimizing the diff between
-head and 2.1.5.)


18233 10-Sep-1996 bde

Removed more devconf leftovers.


18207 10-Sep-1996 bde

Updated #includes to 4.4Lite style.


18186 09-Sep-1996 rgrimes

Remove the portion of revision 1.36 that added the #ifdef's for CPU
types as per discussions with Stefan Esser.


18158 08-Sep-1996 phk

Various cleanups for remanents of devconf.


18124 07-Sep-1996 bde

Preserve volatility in casts of np->reg. Cosmetic.


18084 06-Sep-1996 phk

Remove devconf, it never grew up to be of any use.


18077 06-Sep-1996 rgrimes

Partial merge of RELENG_2_1_0 -> HEAD (addition of Intel 82439HX chip text).


18065 05-Sep-1996 se

Fix Orion specific code by moving config_orion() to a place where it does
not depend on bootverbose being true.

Include only register specifications for those chip sets that apply to
a cpu that might boot this a particular kernel (ie. make the Saturn code
depend on I486_CPU being defined, the Pentium chip sets on I586_CPU ...)


18064 05-Sep-1996 se

Fix code that deals with multiple host to PCI bridges by making the next
one use the highest seen bus number plus 1 as its starting point.


18001 02-Sep-1996 se

Correct previous Orion specific fix: The configuration register
access function always returns a DWORD aligned DWORD ...


18000 02-Sep-1996 se

Add preliminary support for the Orion PCI chip set. It is special in the
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".


17877 28-Aug-1996 bde

Use "" instead of <> for a header in the current directory.

Don't #include an unused header from i386/isa. Headers from there
shouldn't be included in "isa-independent" files anyway.


17850 27-Aug-1996 se

Put back the initialization of the time constants of the SCSI and Sync.
logic clock signal, which had been erroneously commented out by the
previous commit. This will re-enable support for sync. transfer negotiation,
which depends on one of those values.


17836 26-Aug-1996 se

Set clock prescale based on BIOS supplied value instead of trying to
calculate an optimum value from (constant) parameters.
This should set the SCNTL3 register of the 53c860 and 53c875 to twice
the divider it used to be, since cards based on those chips seem to use
an 80MHz clock instead of the Clock Doubler feature and a 40MHz clock.


17455 06-Aug-1996 phk

Megacommit to straigthen out ETHER_ mess.

I'm pretty convinced after looking at this that the majority of our
drivers are confused about the in/exclusion of ETHER_CRC_LEN :-(


17454 06-Aug-1996 phk

Use ether_ioctl() to do a lot of grunt work.


17449 05-Aug-1996 se

Send out a period of "0" if negotiating asynchronous transfers (offset = 0).
A value of "255" used to be sent, and though it should not matter, there
appear to be a few devices that want both values to be zero for asynch.


17218 18-Jul-1996 se

FINALLY: PCI support for the Lance Ethernet driver.

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


17108 12-Jul-1996 bde

Don't use NULL in non-pointer contexts.


16471 18-Jun-1996 bde

Removed unused #includes of <i386/isa/icu.h> and <i386/isa/icu.h>. icu.h
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).


16363 14-Jun-1996 asami

The Great PC98 Merge.

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


16357 14-Jun-1996 dg

Updated this driver to a newer version from Matt. This should fix several
bugs related to support of dc21041 chips and other problems.

Submitted by: Matt Thomas <matt@3am-software.com>


16322 12-Jun-1996 gpalmer

Clean up -Wunused warnings.

Reviewed by: bde


16289 11-Jun-1996 alex

Detach the device at shutdown.

Add a prototype for ed_attach_NE2000_pci (this really belongs somewhere
else, but where?).


16248 09-Jun-1996 asami

Scan PCI buses in order the BIOS has assigned them. This is sometimes
necessary to boot from a SCSI disk connected to a twin-channel adapter,
and you have multiple of them (disks and adapters).

Reviewed by: se


16200 08-Jun-1996 gibbs

Only assume the scratch ram is valid (we were initialized by the BIOS)
if SCSIID is something other than 0.


16167 07-Jun-1996 jkh

Here is a patch that fix a few problems with the RGB version of
the meteor card.
Submitted-by: james


16063 01-Jun-1996 gpalmer

Set ifnet.baudrate for ethernet / FDDI interfaces too. Makes
SNMP slightly more informative

Reviewed by: Garrett Wollman


16000 30-May-1996 gibbs

Merge in changes for NetBSD/OpenBSD.

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>


15881 23-May-1996 gibbs

Correct a botched commit from yesturday. It helps to bring over the
right patch file.<sigh>


15849 21-May-1996 wollman

Let the user know what errors are experienced on received packets.
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.


15845 21-May-1996 gibbs

It seems that the aic78X0 chips will either have their scratch ram
as all 0s or all 1s after POST if there is no BIOS installed.


15813 18-May-1996 se

Add support for NE2000 compatible PCI Ethernet cards. The PCI probe
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


15812 18-May-1996 se

Fix range check to actually test the variable that will be used as
an index later.

Submitted by: Erich Stefan Boleyn <erich@uruk.org>


15802 17-May-1996 jkh

A patch for the meteor device driver. It fixes:
1) A spelling error pointed out by Paco Hope.
2) A bug in the range checking routing pointed out by Jim Bray.
3) Enables the setting of frames per second.
Submitted-By: Jim Lowe <james@miller.cs.uwm.edu>


15752 12-May-1996 gibbs

Fix a brain-o. The scratch ram on aic78X0 controllers is initialized to 0x00
not 0xff after POST, so test for that when trying to determine if a BIOS
intialized the card for us.


15743 12-May-1996 gibbs

Free our device information in one error case in the driver probe.


15741 12-May-1996 gibbs

Add missing '+ io_port' to two outbs.
Add missing splx() in one error case during probes.
Remove unnecessary return and break.

Submitted by: Noriyuki Soda <soda@sra.co.jp>


15712 10-May-1996 gibbs

The aic78X0 cards have 0xff in all bytes of scratch ram after POST. If
a BIOS was not installed, this will still be true by the time we probe
the chip. We use this heuristic to determine if we should use the left
over scratch ram target settings for controllers that don't have an
SEEPROM. We also "snapshot" the host adapter SCSI id and whether ultra
is enabled or not and use these values if a BIOS was installed. The card
will act as if a BIOS was installed even if there wasn't one if you warm
reboot, but since the scratch ram area is still valid in this case, its
hardly worth the effort of writing a shutdown routing that clears out
the scratch ram. This should make users of motherboard controllers
happy.


15583 03-May-1996 phk

Another sweep over the pmap/vm macros, this time with more focus on
the usage. I'm not satisfied with the naming, but now at least there is
less bogus stuff around.


15545 02-May-1996 phk

Removed $Log$


15543 02-May-1996 phk

removed:
CLBYTES PD_SHIFT PGSHIFT NBPG PGOFSET CLSIZELOG2 CLSIZE pdei()
ptei() kvtopte() ptetov() ispt() ptetoav() &c &c
new:
NPDEPG

Major macro cleanup.


15378 25-Apr-1996 asami

Fix logic bug in pci bridge code. For a PCI-PCI bridge, secondary
should be <= than subordinate, not the other way around.

They are both true if the bridge is not cascaded (i.e., twin-channel
scsi/e-net adapters won't be affected by this bug), which is probably why
it was unnoticed until today.


15332 20-Apr-1996 gibbs

Add PCI IDs for the aic7860 (basically an aic7850 Ultra) and the aic7855
(HP motherboard aic7850 controllers).

Properly handle 4 bit controller SCSI IDs.

Update my copyright.


15261 14-Apr-1996 se

Update PCI bus code from my current sources:

- always use pci_conf_read() and pci_conf_write(). (This is required to
simulate non-existant devices in my system for PCI bridge code tests.)

- reorder some functions (put the main functions at the end).

- correct off by one bug in the code dealing with unitialized PCI to PCI
bridge chips. (Bug found by ASAMI Satoshi.)

- print function number for multi-function devices.


15132 08-Apr-1996 dg

Removed sections 3 and 4 from my copyright.


15117 07-Apr-1996 bde

Removed never-used #includes of <machine/cpu.h>. Many were apparently
copied from bad examples.


15116 07-Apr-1996 bde

Removed now-unused #includes of <machine/cpu.h>. They were for bootverbose
being declared in the wrong place.


14938 31-Mar-1996 gibbs

ncr.c:
Use new XS_SELTIMEOUT error code for selection timeouts.

aic7870.c:
Move SCB walking code to aic7xxx.c and make it work for all card types.

The flag AHC_EXTSCB is no longer needed since the SCBs are walked in
all cases now.


14886 28-Mar-1996 jkh

A bug fix and a couple of new modes for the meteor driver.
Submitted-By: Jim Lowe <james@miller.cs.uwm.edu>


14877 28-Mar-1996 scrappy

Using devfs_add_devswf() instead of devfs_add_devsw()

Reviewed by: julian@freebsd.org


14769 23-Mar-1996 fenner

Eliminate reference to ac_ipaddr in FreeBSD case.


14703 19-Mar-1996 bde

Fixed unsigned longs that should have been vm_offset_t.

vm_offset_t is currently unsigned long but should probably be plain
unsigned for i386's to match the choice of minimal types to represent
for fixed-width types in Lite2. Anyway, it shouldn't be assumed
to be unsigned long.

I only fixed the type mismatches that were detected when I changed
vm_offset_t to unsigned. Only pointer type mismatches were detected.


14560 11-Mar-1996 se

If FAILSAFE is defined, then:
- Do not enable tagged commands by default
- Probe only 1 LUN
- Do not negotiate sync. transfer with CDROM drives

Defining FAILSAFE will result in a driver that will tolerate
marginal hardware for the price of a slight loss of performance
It is intended for use in install kernels.


14556 11-Mar-1996 se

Do WIDE negotiation before sync. transfer speed negotiation,
if a drive supports both features.
Pointed out by Gerard Goudier, who knew section 5.6.23 of
the SCSI-2 standard requires this order of actions ...


14515 11-Mar-1996 gibbs

Be more careful in how we set SCSICONF. It was possible for a controller
set to a device id above 7 to screw up the data fifo setting.


14453 10-Mar-1996 gibbs

aic7870.c, ncr.c:
Cleanse the SCSI subsystem of its internally defined types
u_int32, u_int16, u_int8, int32, int16, int8.
Use the system defined *_t types instead.

aic7870.c:
Handle Seeprom data a little better.


14320 02-Mar-1996 jkh

Hopefully, this will fix the problems that some people have been having with
the S-Video input. It also has code in the driver for the meteor RGB support
and some other bug fixes. I don't have a meteor RGB but I have been told
that it works.
Submitted by: Jim Lowe <james@miller.cs.uwm.edu>


14153 19-Feb-1996 se

Remove limit of port I/O addresses to 65K, since PCI specifies 32 bit
port addresses (even though the PC architecture doesn't support them).

Add code to limit the I/O map size based on the lowest set bit of the
address. This cures the problem with the BT946C only having a 16 bit
map register, in voiolation of the PCI specs, without giving up the
general support of >65K port regions.


14152 19-Feb-1996 se

Restore two lines that were erronously deleted with the removal of
the NCR_NO_DISCONNECT option in the previous patch.


14151 18-Feb-1996 se

Make SIMPLE TAG messages the default.
Remove bogus NCR_NO_DISCONNECT option, which actually never was useful.


14140 18-Feb-1996 gibbs

Add PCI ID for older revision Buslogic 946 cards

Submitted by: greg@greg.rim.or.jp


14133 17-Feb-1996 se

Add generic PCI to PCI bridge support.
Improve verbose boot messages for unidentified chips.


14111 16-Feb-1996 gibbs

Allow I/O port ranges above the standard ISA one so the PCI probe will succeed.

Reviewed by: Richard J Kuhns <rjk@sparcmill.grauel.com>


14068 12-Feb-1996 gibbs

Correct the PCI ID for the Buslogic 946.


13937 06-Feb-1996 wollman

Clean up Ethernet drivers:
- fill in and use ifp->if_softc
- use if_bpf rather than private cookie variables
- change bpf interface to take advantage of this
- call ether_ifattach() directly from Ethernet drivers
- delete kludge in if_attach() that did this indirectly


13930 05-Feb-1996 jkh

Fix METEOR_TEST_VIDEO case.
Submitted by: Jim Lowe <james@miller.cs.uwm.edu>


13815 01-Feb-1996 jkh

Sync with latest Meteor and Spigot sources from James.
Submitted by: Jim Lowe <james@miller.cs.uwm.edu>


13809 31-Jan-1996 se

Slight modification of ncr_setmaxtags: set usrtags=0 for drives
that don't announce support for command queues.

SCSI_NCR_DFLT_TAGS can be specified in the kernel config file
and sets the default number of tags per disk drive.
A value of 0 means "no tags".

Minor correction in debug messages: Values from the msg_in
buffer were being printed in the msg_out trace message ...


13765 30-Jan-1996 mpp

Fix a bunch of spelling errors in the comment fields of
a bunch of system include files.


13759 30-Jan-1996 wollman

Fix a logic error in determining whether something is page-aligned
that became evident while I was thinking about something else.
(No, I am not working on the wd driver itself.)


13721 30-Jan-1996 se

Add heuristic to detect multi-function devices that don't announce this
feature in the header type register, though it is required by the PCI spec.
This should correctly probe both functions of the Intel 82371FB chip,
without the need for a special case based on the device ID.


13695 29-Jan-1996 gibbs

Update copyright.


13672 28-Jan-1996 wollman

Implement a prototype interface to bus-master IDE DMA on the Triton
chipset. This does not attempt to do anything special with the timing
on the hope that the BIOS will have done the right thing already. The
actual interface from the wd driver to the new facility is not
implemented yet (this commit being an attempt at prodding someone else
to do it because looking at the wd driver always confuses the h*** out of me).


13668 28-Jan-1996 jkh

3c590 driver for FreeBSD
Submitted by: Frederick Earl Gray <fgray@owlnet.rice.edu>


13656 27-Jan-1996 wollman

Decode configuration for the IDE part of the Triton chipset. This
includes a hack in the probe code: the 82371FB is a multifuction
device, but doesn't properly set the configuration bit which
indicates this. So, we just hard-wire all 82371FBs as multifunction
devices.

This does not actually make the bus-master IDE stuff work, although
if anyone wants to work on that, I have the databooks that tell
how to use it.


13638 26-Jan-1996 phk

The last part of the ether_sprint -> %6D change.
Sorry for the delay.
(%D is for hexdumping.)


13634 25-Jan-1996 wollman

Correctly identify the various parts of the Triton chipset.


13633 25-Jan-1996 se

Add support for multi-function devices.


13619 24-Jan-1996 phk

Use new printf features rather than local kludges.


13614 24-Jan-1996 wollman

Disable $Log$


13597 23-Jan-1996 se

Make PCI interrupt handlers return void like everybody else does.

Reviewed by: davidg


13596 23-Jan-1996 wollman

Spelling error: Busting -> Bursting.


13591 23-Jan-1996 wollman

Got the sense of the L1 cache enabled test wrong; fixed.


13590 23-Jan-1996 wollman

Add support for dumping the configuration of the Intel
82371FB PCI ISA IDE Xcellerator (sic) chip. The IDE function
will not be done until Stefan tells me how to access it.


13566 22-Jan-1996 wollman

Add register definitions for Intel 82437FX (Triton System Controller)


13529 21-Jan-1996 jkh

Newest version of the Matrox Meteor driver. Tested with various MBONE
tools and found to work better with both nv and vic.
Submitted by: Jim Lowe <james@miller.cs.uwm.edu>


13497 19-Jan-1996 se

Fix bad typo: > was used instead of >> ...

Submitted by: Matt Thomas <matt@lkg.dec.com>


13496 19-Jan-1996 se

Improve PCI probe messages by printing the bus number.
Add missing newline to PCI to PCI bridge message.

Submitted by: Matt Thomas <matt@lkg.dec.com>


13481 18-Jan-1996 se

Change default value of MAX_LUN from 1 to 8.


13448 15-Jan-1996 se

Back out patch 1.53. The problem report that had made me commit this
change turned out to have been caused by some other change, and the
patch should have had no effect at all (just made the code a little
longer).


13447 15-Jan-1996 se

Disable handshake timeout. Some devices don't send an ACK for several
seconds ...

Submitted by: wolf


13437 15-Jan-1996 dg

This driver really is for the Pro/100B and not for the Pro/100 (and in fact
doesn't even work with a Pro/100)...updated to reflect this.


13432 15-Jan-1996 se

Make the NCR driver on the boot floppy kernel not negotiate synch. SCSI
transfers for CDROM drives.


13377 10-Jan-1996 se

Add back initialization of "ncrp[unit]" since ncrcontrol relies on it.


13367 09-Jan-1996 ats

Add the pci-numbers for the 3c595 10/100Mb card to the driver.


13364 09-Jan-1996 se

Add back nncr and ncrp for now. ncrcontrol relies on them.
(To be replaced by sysctl accesses some time ...)

Remove a backward jump from the NCR script, which allowed a SCSI target
to receive any number of NOP messages it desired. If a target indeed
does such a silly thing, make it fail at the next instruction, instead
of causing a timeout a few seconds later.


13361 09-Jan-1996 gibbs

Don't bother setting the DSCommand register. Adaptec's own BIOS doesn't.


13318 07-Jan-1996 gibbs

Write the cahesize and latency timer values back into configuration
space (whoops!).

Add a missing argument to the cachesize/lattime printf.

Set the CACHETHEN bit in DSCommand.


13181 03-Jan-1996 gibbs

The long awaited stability patch set for the aic7xxx driver:

Simplify the initialization of adapters by pulling all card specific
initialization to the card specific modules.

Set the Latency timer and Burst len to good values if thery are not
initialized during post or are reset during chip reset.

Properly identify and handle external SCB SRAM. The code was false
id'ing 255 SCBs on aic7880 chips.

Reviewed by: David Greenman <davidg@FreeBSd.org>


13176 03-Jan-1996 dg

Reworked the stop/reset code to properly run-down allocated buffers and
made the code detect and handle wedged cards.


13075 28-Dec-1995 se

Preserve SIGP bit when clearing INTF condition.

Submitted by: Gerard Roudier <groudier@htlm.fr>


12915 18-Dec-1995 dg

Added prototype for fxp_scb_wait() and fixed a bug where the wrong pointer
was passed in one case.


12879 16-Dec-1995 bde

Completed function declarations and/or added prototypes and/or added
#includes to get prototypes.

pci now uses a different interrupt handler type for interrupts that it
dispatches and the isa interrupt handler type for the interrupts that
it handles.


12872 15-Dec-1995 se

Fix the off-by-one error in the calculation of the valid port range.
Reduce default value of pcicb_membase to 0x2000000 (from 0x4000000)
since this seems to be the lower bound used by many systems.

Submitted by: Mihoko Tanaka <m_tanaka@pa.yokogawa.co.jp>


12824 14-Dec-1995 peter

Change the generic "btintr" function's name to "bt_intr" - the same as
all the other bt_XXX() functions in i386/scsi/bt*.

This the important effect of forcing a link error if the user is
still using the old "vector btintr" which is dangerously wrong
after Justin's updates to the driver.

The correct isa vector line for the bt driver is "vector bt_isa_intr".
Justin mentioned this in the commit message and updated LINT and
GENERIC. This change is to enforce that.. :-)


12820 14-Dec-1995 phk

Another mega commit to staticize things.


12794 12-Dec-1995 gibbs

PCI portion of the Buslogic SCSI driver. Needs to be tested and more
PCI ids for Buslogic products added.


12678 08-Dec-1995 phk

Julian forgot to make the *devsw structures static.


12675 08-Dec-1995 julian

Pass 3 of the great devsw changes
most devsw referenced functions are now static, as they are
in the same file as their devsw structure. I've also added DEVFS
support for nearly every device in the system, however
many of the devices have 'incorrect' names under DEVFS
because I couldn't quickly work out the correct naming conventions.
(but devfs won't be coming on line for a month or so anyhow so that doesn't
matter)

If you "OWN" a device which would normally have an entry in /dev
then search for the devfs_add_devsw() entries and munge to make them right..
check out similar devices to see what I might have done in them in you
can't see what's going on..
for a laugh compare conf.c conf.h defore and after... :)
I have not doen DEVFS entries for any DISKSLICE devices yet as that will be
a much more complicated job.. (pass 5 :)

pass 4 will be to make the devsw tables of type (cdevsw * )
rather than (cdevsw)
seems to work here..
complaints to the usual places.. :)


12662 07-Dec-1995 dg

Untangled the vm.h include file spaghetti.


12651 06-Dec-1995 se

Set default burst length limit to 32 bytes, since this seems to be
an acceptable value for all current chip sets (just a hint to PCI
device drivers, used in the NCR driver, for example).
Add PCI Vendor ID of ACER.


12641 05-Dec-1995 bde

Renamed TRUE (which has value 2) to M_TR to avoid a clash with the
the boolean TRUE.


12633 05-Dec-1995 dg

Increased the number of Tx segments from 13 to 29 to reduce the need to
recopy to near zero. Wrote the necessary code to recopy the mbuf chain
into another buffer if there are too many mbufs in the chain.


12628 05-Dec-1995 dg

all:
Removed ifnet.if_init and ifnet.if_reset as they are generally unused.
Change the parameter passed to if_watchdog to be a ifnet * rather than
a unit number. All of this is an attempt to move toward not needing an
array of softc pointers (which is usually static in size) to point to
the driver softc.

if_ed.c:
Changed some of the argument passing to some functions to make a little
more sense.

if_ep.c, if_vx.c:
Killed completely bogus use of if_timer. It was being set in such a way
that the interface was being reset once per second (blech!).


12562 01-Dec-1995 dg

Fix minor bug that would cause the packet statistics updates to stop
working under extremely rare circumstances. Also added some additional
comments..


12525 29-Nov-1995 julian

missed one..
thanks jim..
(actually I was already aware I'd missed it, but hadn't started
searching for it :)


12523 29-Nov-1995 bde

Restored my old changes which were clobbered by the previous commit.

Added prototypes. The previous version wouldn't have compiled if
prototypes were in scope.


12518 29-Nov-1995 asami

'see" -> "see" (in the comment).

Noticed by: hilit19.el (stop laughing! ;)


12511 29-Nov-1995 jkh

A batch of Jim Lowe's patches:
o Add signed/unsigned functionality to the matrox meteor device driver.
o Apply a few fixes to the sound driver.
o Add a ``SPIGOT_UNSECURE'' compile time definition so, if one defines
SPIGOT_UNSECURE in their conf file, then they can use the spigot w/o
root. There is a warning that this allows users access to the IO
page which is probably not secure.
Submitted by: james


12510 28-Nov-1995 dg

Device driver for Intel Pro/100 PCI Fast Ethernet controller.


12454 21-Nov-1995 bde

Made pci.c compile again. It unfortunately depends on the isa interrupt
interface. Adding prototypes just made the dependency explicit.


12453 21-Nov-1995 bde

Completed function declarations and/or added prototypes.


12429 20-Nov-1995 phk

Mega commit for sysctl.
Convert the remaining sysctl stuff to the new way of doing things.
the devconf stuff is the reason for the large number of files.
Cleaned up some compiler warnings while I were there.


12341 17-Nov-1995 dg

Set flag to stop backoff counter from counting when carrier activity is
detected. This dramatically reduces the collision rate (about 1/10th of
what is was previously).

Submitted by: Matt Thomas <matt@lkg.dec.com>


12293 14-Nov-1995 phk

statizice some internal magic.


12139 07-Nov-1995 gibbs

Remove uneccessary increment of the unit number.


12094 05-Nov-1995 gibbs

Conform to new probe/attach interface exported by aic7xxx.c.

Use ahcintr directly as interrupt handler.


12075 04-Nov-1995 bde

Fixed the type of feaintr(). The type of an EISA interrupt handler is
incompatible with the type of a PCI interrupt handler.

Fixed the type of pdc_pci_ifintr(). The type of a PCI interrupt handler
is too generic to pass arbitrary struct pointers.


12074 04-Nov-1995 bde

Fixed the type of ahcintr(). The type of an ISA interrupt handler is
incompatible with the type of a PCI interrupt handler. A new entry
point `ahc_pci_intr()' is used for PCI. ISA and PCI interrupts are
penalized equally (:-) by calling a common handler `ahc_intr()'. This
should be reorganized. Some strings now name the wrong function...


12054 04-Nov-1995 julian

Submitted by: bde

IFF_NOTRAILERS doesn't exist any more in current
(driver came from 2.0.5)
now compiles again.


11949 31-Oct-1995 julian

Reviewed by: not yet
Submitted by: fgray@rice.edu
this driver hasn't been checked but as a separate module, bringing it in won't
break anything else and it't the best way of testing it......

julian


11921 29-Oct-1995 phk

Second batch of cleanup changes.
This time mostly making a lot of things static and some unused
variables here and there.


11831 26-Oct-1995 gibbs

Recognize the aic7880 and 3940 Ultra.

If RAMENB is set in devconfig, walk the external SCBs. Some Intel Xpress
motherboards set this bit.

For external SCBs for the 3940. It doesn't set RAMPS or RAMENB, but does
have the ram.


11797 26-Oct-1995 dg

From Matt Thomas:

"I screwed the initialization of the burstsize. Right now it will default
to 0 (which can cause corruption problems on high latency PCI buses). It
should be set to 8 longwords to avoid problems with certain PCI chipsets."

Submitted by: Matt Thomas <matt@lkg.dec.com>


11460 13-Oct-1995 wollman

Say goodbye to IFF_NOTRAILERS. Support for trailers was officially
dropped for 4.4, but for some reason this flag lived on. (Until
today, that is.)


11337 08-Oct-1995 gibbs

Identify the 2940 *Ultra* SCSI adapter. We treat it as a normal 2940
for now since I don't have any documentation on this card yet and it
is software compatible with the earlier cards.

The 2940 *Ultra* is Adaptec's push to take SCSI to 20MHz bus rates. Its
based on the aic7880 chip which is the successor to the aic7870.


11323 07-Oct-1995 dg

Add SIOCGIFADDR support.


11132 02-Oct-1995 dg

Check for failure to map the interrupt. Not doing so will guarantee that
the machine will wedge later.


11130 02-Oct-1995 dg

Fixed bug where wrong thing was being checked for NULL before calling
free(), resulting in a panic. This happend whenever an irq had already
been allocated by another device (like something on the ISA bus).


11070 29-Sep-1995 dg

Latest version from Matt Thomas. This version works with the newer
DC21041 NICs and with ZNYX cards.

Submitted by: Matt Thomas


10936 21-Sep-1995 se

Add preliminary support for the 53c860 and 53c875 ULTRA SCSI chips,
and for the 53c810ap, the improved version of the 53c810.
The driver should work with all those controllers, but doesn't know
about any of their advanced features.


10748 14-Sep-1995 se

Add vendor ID of Compaq, now that I found what it is ...


10730 14-Sep-1995 se

Remove '#ifdef undef' that was only supposed to be in my local test version.


10727 14-Sep-1995 se

Do not include the verbose boot messages, if PCI_QUIET is defined.


10726 14-Sep-1995 se

Minor changes to the PCI probe messages.


10677 11-Sep-1995 se

Introduce NCB_SCRIPT_PHYS and CCB_PHYS macros to find physical addresses
of NCR script labels and of command control block structure components.
This allows for easy modification of the actual virtual to physical
mapping operator used ...
Make all applicable references to physical address values use the above
macros instead of calls to vtophys().


10673 11-Sep-1995 se

Put back p_script component into NCR control block.
The driver currently doesn't use it, but ncrcontrol needs it
to print some script addresses relative to the script start.


10641 08-Sep-1995 se

Perl script to convert NCR script address into label+offset.
Useful to find the failed NCR instruction ...


10639 08-Sep-1995 se

Don't use vtophys() for constant addresses, cache the translations in
the NCR control block (ncb) and command control block (ccb) instead.


10629 08-Sep-1995 se

Applied patches that make the driver compile on NetBSD again.
They shouldn't affect FreeBSD, since they are within #ifdef NETBSD
directives.
Changed the HAD_ERROR return code into COMPLETE according to a comment
in "/sys/scsi/scsiconf.h"

Submitted by: Andreas Wrede <andreas@planix.com>


10624 08-Sep-1995 bde

Fix benign type mismatches in devsw functions. 82 out of 299 devsw
functions were wrong.


10605 07-Sep-1995 se

Add support for 16 targets on WIDE SCSI bus.
This seems to work fine on my 53c810, but really should be tested on
a 53c825 with at least one target set to an ID >= 8.
The script is now copied to memory mapped using vm_page_alloc_contig(),
since it has to be physically contigous. This must be changed, if the
driver is converted into a loadable module !
Two of the probe messages are suppressed, unless "bootverbose" is set.


10604 07-Sep-1995 se

Remove support for PCI bridge classes, since this
dealt with by code in pci.c now.


10603 07-Sep-1995 se

Make mapping messages depend on bootverbose flag.
Add PCI subclass to unknown device message.


10602 07-Sep-1995 se

Add description of Intel 82425EX PCI system controller chip (Aries ?).

Submitted by: Danny J. Zerkel <dzerkel@feephi.phofarm.com>


10570 05-Sep-1995 gibbs

Detect external SRAM.
Count the number of detected 3940 controllers. Tag all even controllers
as being the "B Channel".


10567 05-Sep-1995 se

The NCR script has grown beyond one page (4KB). Since malloc() returns
contiguous memory in virtual space, but doesn't guarantee any particular
physical layout of pages, the script may be not contguous in physical
memory. This made the first write command fail in very rare cases.
This has been fixed by checking the region returned by malloc() for
being contiguous, but there should be a physical memory allocate
and later mapping to virtual memory instead.

A few assertions and error messages are improved.


10416 29-Aug-1995 jkh

Fixes for issues raised by Bruce Evans.
Submitted by: Jim Lowe <james>


10391 28-Aug-1995 jkh

Kernel components of Matrox Meteor driver.
Submitted by: Mark Tinguely <tinguely@plains.nodak.edu> and Jim Lowe <james>


10205 23-Aug-1995 gibbs

Remove hard coded assumption that SCSI busses have 7 targets.

This change forces the controller drivers to allocate a scsibus_data struct
via a call to scsi_alloc_bus(), fill in the adapter_link field, and optionally
modify any other fields of the struct. Scsi_alloc_bus() initializes all fields
to the default, so the changes in most drivers are very minimal. For drivers
that support Wide controllers, the maxtarg field will have to be updated to
allow probing of all targets (for an example, look at the aic7xxx driver).

Scsi_attachdevs() now takes a scsibus_data* as its argument instead of an
sc_link*. This allows us to expand the role of the scsibus_data struct for
other bus level configuration setings (max number of transactions, current
transaction opennings, etc for better tagged queuing support).

Reviewed by: Rodney Grimes <rgrimes>, Peter Dufault <dufault>, Julian Elischer <julian>


10125 20-Aug-1995 gibbs

Correct the PCI ID for the Adaptec 7850 chips.


10072 15-Aug-1995 se

Print more information in case of unspecific error condition.
Do not print "in getcc reselect by" message unless DEBUG_RESTART is set.


10061 15-Aug-1995 se

Add more chip set register decodings:
ISA GAT mode and hidden refresh seem to cause reliability problems
on Saturn based systems and are now reported when booting with '-v'.

Submitted by: Danny J. Zerkel <dzerkel@feephi.phofarm.com>


10043 13-Aug-1995 se

Return an extended status of XS_TIMEOUT (instead of XS_DRIVER_STUFFUP)
in case of an unspecific error (most likely software timeout after
SCSI bus reset).
This will make the generic SCSI code retry the failed command.


9769 29-Jul-1995 dg

Initialize "name" to quiet compiler.


9739 27-Jul-1995 se

Add a few chip set IDs.


9738 27-Jul-1995 se

Add config messages for the Intel 82378 chip.

Submitted by: Danny J. Zerkel <dzerkel@feephi.phofarm.com>


9737 27-Jul-1995 se

Add a few vendor IDs.


9736 27-Jul-1995 se

Get rid of references to the linker supplied set length field.
Use the terminating NULL pointer as the end of list marker instead.


9538 16-Jul-1995 bde

Fix compiler warnings (systm.h wasn't included).


9429 07-Jul-1995 se

Put back second case of CC handler in NCR script.


9399 04-Jul-1995 gibbs

Add PCI Id for the 3940 controller.


9364 28-Jun-1995 se

Changes to support some CDROM drives and the Quantum Grand-Prix
series of hard disk drives, which don't accept any SCSI message
within an REQUEST SENSE command (i.e. even not an IDENTIFY to set
the LUN).
This patch obviates the need for QUIRK_NOMSG and thus all of the
device_tab[] entries in the NCR driver.


9363 28-Jun-1995 se

Change message "not supported" to "no driver assigned", because
people tend to assume their devices won't work if they see this
message, though it may indicate that those devices just don't
need any PCI driver (e.g. devices that emulate an ISA card, or
that have been initialised by the BIOS and need no further care).


9362 28-Jun-1995 se

Give more detailed information about the type of bridge devices
found when probing the PCI bus.


9361 28-Jun-1995 se

Failure of the consistency checks for BIOS assigned mappings of busses
connected via PCI to PCI bridges is considered non fatal for now.


9355 28-Jun-1995 se

Corrections and additions to the PCI chip set configurations log.

Submitted by: "Danny J. Zerkel" <dzerkel@feephi.phofarm.com>


9349 28-Jun-1995 dg

Fixed bug that was fixed in 1.28.2.1/1.29 a little differently; the
difference is more or less cosmetic.

Submitted by: Matt Thomas


9202 11-Jun-1995 rgrimes

Merge RELENG_2_0_5 into HEAD


8876 30-May-1995 rgrimes

Remove trailing whitespace.


8754 26-May-1995 dg

Fixed bugs in multicast address handling (flag was set in wrong register,
etc.). The tulip_start routine was rewritten to use less stack space (I've
been having problems with wcarchive overflowing the stack and this should
help a little). This version also has preliminary NetBSD support.

Rod Grimes helped in testing this version of the driver. Thanks Rod. It's
additionally been extensively tested here and on wcarchive.

Submitted by: Matt Thomas


8699 22-May-1995 dg

There are two serious bugs in if_de.c. The first should not matter
to most users (the wrong length is passed to ether_input). The
second is more serious. The multicast hash algorithm uses the wrong
(low) bits instead of the right (high) bits. This is only an issue
if you use >12 multicast addresses but if you are using IP multicast
then it might affect you...

Submitted by: Matt Thomas


8694 22-May-1995 dg

Fixed bug in bpf/multicast support that caused multicast packets to get
thrown out if bpfilter support and no BPF listener. (submitted by Bill
Fenner)
Removed unused variable and changed another from a stack variable to a
static - the variable was a rather large array of structs that consumed
a lot of stack space. (me)


8296 05-May-1995 dg

Fixed mbuf leak and panic that occurred when packets got too memory
fragmented.
Added support for Cogent em100 boards.
Fixed bug that caused BPF to toggle the card to UTP.
Various other improvements.

Submitted by: Matt Thomas and David Greenman


8263 04-May-1995 dg

bzero the malloced pci_devconf structure. This should fix the problem with
several of freefall's recent crashes.


7925 18-Apr-1995 jkh

Matt says that no pre-2.3 pass boards were supposed to ship, but I certainly
got a 2.2 version DC21040 chip in my SMC ethernet card! He suggests bumping
the check all the way down to 2.0 since it's pre-2.0 we're actually guarding
against.
Submitted by: Matt Thomas <matt@lkg.dec.com>


7901 17-Apr-1995 dg

Changed minimum supported rev of DC21040 to pass 2.2.


7854 15-Apr-1995 gibbs

kernel.h -> sys/kernel.h


7791 13-Apr-1995 dg

Various changes from Matt Thomas to improve media selection and fix
support for the DC21140.


7689 09-Apr-1995 dg

From Matt Thomas: Added support for 100Mb cards (such as the DEC DE-500-XA
and SMC 9332).


7631 05-Apr-1995 dg

From Matt Thomas: Finished EISA support.


7542 01-Apr-1995 dg

Patch from Matt Thomas to fix mbuf leak in FDDI driver.


7533 31-Mar-1995 gibbs

Mask the call to ahc_attach with an splbio/splx pair. This allows us
to poll succesfully even if we are sharing the interrupt.

Register the interrupt handler before the attach.

This commit makes the 294x PCI shared interrupt compliant. This has
been tested with an aic7870 motherboard controller and a 294x in the
same machine shareing an irq.


7505 31-Mar-1995 se

Include <stddef.h> for standard definition of offsetof() instead of
defining it explicitly in the driver.


7375 25-Mar-1995 bde

Remove wrong redeclarations of printf() and bzero(). Include the correct
header to declare DELAY().


7374 25-Mar-1995 bde

Make untested NS code at least compile so that it doesn't break LINT. A
struct member had an old name.


7373 25-Mar-1995 bde

Forward-declare kern_devconf for use in a prototype. Some drivers
include <pci/pcivar.h> without including <sys/devconf.h> and other
drivers include <pci/pcivar.h> before including <sys/devconf.h> if
certain identifiers are defined.

The devconf headers have convoluted interdependencies. <sys/devconf.h>
includes <machine/devconf.h> which includes <pci/pcivar.h>. Most
drivers include <sys/devconf.h> so even isa drivers depend on
<pci/pcivar.h>. For similar reasons, most drivers depend on another
pci header, on an isa header and on two scsi headers.


7265 23-Mar-1995 dg

Restore my changes to initialize the kdc_shutdown routine pointer. Stefan
clobbered it in his previous commit and not having it causes the machine
to panic during reboot (as well as not doing the important shutdown callout).


7250 22-Mar-1995 se

Set request sense data size from xp->req_sense_length if != 0.

Submitted by: Wolfgang Stanglmeier <wolf@kintaro.cologne.de>


7245 22-Mar-1995 se

Remove use of unitialised variable xp->req_sense_length.

Submitted by: Wolfgang Stanglmeier <wolf@kintaro.cologne.de>


7233 21-Mar-1995 se

Completely new PCI code:

1) Supports PCI to PCI bridge devices (and tries to initialise them,
even if the BIOS is brain dead).
2) Supports shared PCI interrupts. Interrupt handlers now MUST return
'0' if they found nothing to do, '1' otherwise.

New features tested with i486 systems based on the Intel Saturn and
a DEC 4channel Ethernet card only, but expected to work on most systems.

The option PCI_REMAP has been removed !

Submitted by: Wolfgang Stanglmeier <wolf@kintaro.cologne.de>


7232 21-Mar-1995 se

Stylistic changes. Update Wolfgang's e-mail address.

Submitted by: Wolfgang Stanglmeier <wolf@kintaro.cologne.de>


7230 21-Mar-1995 se

Silence "gcc -Wall".

Submitted by: Wolfgang Stanglmeier <wolf@kintaro.cologne.de>


7229 21-Mar-1995 se

Cosmetic changes.

Submitted by: Wolfgang Stnglmeier <wolf@kintaro.cologne.de>


7228 21-Mar-1995 se

Major cleanup: Stylistic changes, 386BSD specific code removed.
Adaptec to new PCI code.

Submitted by: Wolfgang Stnglmeier <wolf@kintaro.cologne.de>


7104 17-Mar-1995 dg

Added a new field to the pci_device struct called pd_shutdown to specify
a device specific shutdown routine for devconf. Assign the value of this
to the kern_devconf struct. Implement a device shutdown routine for if_de
that disables the device. This will stop the device from corrupting memory
after a reboot.


7089 16-Mar-1995 se

Prepare for shared interrupts (required by the new PCI code that adds
support for PCI PCI bridges, e.g. found on 4ch. Ethernet cards).

Submitted by: Wolfgang Stanglmeier <wolf@kintaro.cologne.de>


7081 16-Mar-1995 se

Make ncr.c compile again (PRINT_ADDR() had been patched
into the middle of a printf() by a buggy diff ...).

Submitted by: rgrimes


7072 15-Mar-1995 se

Conditionalise debug message.

Submitted by: Peter Dufault <dufault@hda.com>


7055 14-Mar-1995 dg

Added support for generic FDDI and the DEC DEFEA and DEFPA FDDI adapters.

Submitted by: Matt Thomas


6856 03-Mar-1995 se

Reduce burst length to 4 DWORDs for now, since there seem to
be 486 chip sets that can't tolerate bursts > cache line size.
This should really made dependent on the particular buggy
chip sets, but for now we'll play safe ...


6844 02-Mar-1995 se

Disable vga_attach() code, as it always should have been.


6842 02-Mar-1995 se

Speed up PCI attach code by ommiting test if its result is ignored anyway.


6768 27-Feb-1995 se

Add code to deal with PCI-PCI bridge chips, especially the DEC 21050.
Try to deduce maximum number of PCI buses in system (working around
chip set bugs).
Better check for devices at multiple addresses (aliases).

Reviewed by: se
Submitted by: <wolf@kintaro.cologne.de> Wolfgang Stanglmeier


6767 27-Feb-1995 se

First try to add support for PCI-PCI bridge chips (written for the
DEC 21050 chip in particular, don't have specs of other such chips).

This should add support for Multiple-Ethernet PCI cards (e.g. Znyx 314).

Reviewed by: se
Submitted by: <wolf@kintaro.cologne.de> Wolfgang Stanglmeier


6766 27-Feb-1995 se

Delete bogus semicolon in macro definition.


6705 25-Feb-1995 se

Make people happy, who claim to better know how "interupt"
is to be spelled :).

Submitted by: <wolf@kintaro.cologne.de> Wolfgang Stanglmeier


6704 25-Feb-1995 se

Deal with systems, that lack a fully decoded PCI configuration space.

Submitted by: <wolf@kintaro.cologne.de> Wolfgang Stanglmeier


6632 22-Feb-1995 se

Cleanup for compatibility with another OS.

Submitted by: wolf


6630 22-Feb-1995 se

New PCI attach code:

PCI BIOS mappings are retained, except if option PCI_REMAP
is specified in the kernel config file.
There is now a list of attach addresses, and the first
address that seems to make some device registers appear
is chosen.

Reviewed by: se
Submitted by: wolf


6526 17-Feb-1995 se

Improve diagnostics:

Test for correct execution of cache test script by NCR,
and give meaningful error description if it fails.
(A cache problem was reported before.)
Don't wait forever for cache test to complete (to protect
against faulty hardware).

Submitted by: wolf


6460 15-Feb-1995 se

For the sake of people, who like to move pci_configure()
before isa_configure() in autoconf.c:

ncr_intr() protected by splbio()/splx()

Submitted by: wolf


6401 14-Feb-1995 se

ncr.c:

New config option "NCR_IOMAPPED" makes the driver use port I/O.
Put back in 53c815 defines, submitted by Mikael Hybsch <micke@dynas.se>.
These had got lost between cvs rev. 1.14 and now ...

pci.c:

Really write config space register.
Assign ports starting at 0xbc00.

Submitted by: wolf
Reviewed by: se


6398 14-Feb-1995 se

Verify that NCR was mapped to uncached address.

Submitted by: wolf@kintaro.cologne.de <Wolfgang Stanglmeier>


6363 14-Feb-1995 phk

YFfix.


6360 14-Feb-1995 phk

YFfix


6350 14-Feb-1995 wollman

Make capitalization consistent with other devices registered in
the database. Also, distinguish between VGA-like display devices
and everything else.


6302 10-Feb-1995 se

Block interrupts in more places and warn about the NCR exception handler
being called at inappropriate times (should never happen !).

Reviewed by: se
Submitted by: wolf@kintaro.cologne.de (Wolfgang Stanglmeier)


6295 10-Feb-1995 dg

Turn on "Capture Effect" avoidence. This modifies the collision algorithm
so that the interface won't have the effect of blocking other senders
during bulk transfers (i.e. hogging the ethernet). It improves performance
in all of my tests by reducing collisions and I believe it to be a Good
Thing.


6282 09-Feb-1995 se

Try to detect overlapping PCI memory assignment.
(This can only happen with devices that are mapped
by the BIOS.)

Reviewed by: se
Submitted by: wolf (Wolfgang Stanglmeier)


6215 06-Feb-1995 se

Add short delay after NCR reset.

Submitted by: wolf@kintaro.cologne.de (Wolfgang Stanglmeier)


6179 04-Feb-1995 se

Disable I/O port accesses in case the BIOS enabled them.
Clear all output lines except ATN and ACK when waiting
for target phase change.

Submitted by: wolf (Wolfgang Stanglmeier)


6154 03-Feb-1995 gibbs

#include<kernel.h> to quiet a compiler warning having to do with the
DATA_SET (pcidevice_set, ahc_device) macro. Maybe this will allow
the aic7870 to be probed again. I don't have a PCI machine here
to test it.


6140 02-Feb-1995 se

Removed misleading copyright note. This file contains just
definitions taken from the PCI specs. Part of them were typed
in by Wolfgang Stanglmeier, the (at that time unneeded) rest
by Charles Hannum (thanks !).


6136 02-Feb-1995 se

Disable disconnect after drive timeouts, since these
may be the result of reselect following too fast for
the driver to notice. Not the final solution, but the
problem has been seen only with very few devices.

Reviewed by: se
Submitted by: wolf (Wolfgang Stanglmeier)


6132 02-Feb-1995 dg

Reapplied all of Stefan's changes. What a mess - the files were modified
and moved at the same time. This made it *very* difficult to fix the
revision log lossage that happend when the files were moved. SIGH.


6131 02-Feb-1995 dg

Fixed up include paths after copying these in the repository.


6100 01-Feb-1995 se

Reviewed by: se
Submitted by: wolf (Wolfgang Stanglmeier)
Files moved here from sys/i386/pci, since they are meant to be
architecture independent.


5776 22-Jan-1995 gibbs

Change the string returned in the aic7870 motherboard probe case. Change
#define to a more appropriate name.


5649 16-Jan-1995 gibbs

Add $Id. Recognize motherboard aic7870 based controllers.


5563 13-Jan-1995 gibbs

Add in aic7770.c (EISA/VL Adaptors) and aic7870.c (PCI adaptor) dependancies
for the ahc driver.


5545 12-Jan-1995 se

Submitted by: Mikael Hybsch <micke@dynas.se>

Add support for NCR 53c815 PCI SCSI chip.


5197 22-Dec-1994 dg

Restore my changes in rev 1.11 that Garrett killed in his commit.


5195 22-Dec-1994 wollman

Move ARP interface initialization into if_ether.c:arp_ifinit().


5193 22-Dec-1994 se

Add support for -v option passed to boot loader (bootverbose).
Reviewed by:
Submitted by:
Obtained from:


5154 18-Dec-1994 dg

Unbogify the size being passed to bzero when clearing struct softc.


5034 11-Dec-1994 dg

The physical memory allocated for input DMA must be contiguous. The driver
worked in the past only because of good fortune. Anyway, use the contig alloc
routine I wrote awhile ago (vm_page_alloc_contig) for the sound code to do
this allocation. Also, specify read+write on the permissions to pmap_enter().
Specifying just read can have unexpected consquences.


4875 30-Nov-1994 dg

Fix bug I introduced that broke BPF support. Caused by a byte order problem
in an if () expression. Problem fixed by removing the test for ETHERTYPE_*
before passing packet to higher layers.


4856 28-Nov-1994 se

Really deactivated the code that puts scsi stats into dk0.
This should have been disabled for some time, but I had screwed up ...
This made spurious values appear for fd0 in systat, when there was
NCR SCSI activity.


4796 24-Nov-1994 dg

Moved conversion of ether_type to host byte order out of ethernet drivers
and into ether_input(). It was silly to have bpf want this one way and
ether_input want it another way. Ripped out trailer support from the few
remaining drivers that still had it.


4772 22-Nov-1994 dg

Bunch of fixes from Matt Thomas:

1) make #includes correct
2) fix bugs in address check macros
3) fixed bugs in, and enabled, recopy if heavily fragmented code
4) moved call to bpf tap to be before enqueing packet (probably gratuitous)
5) fixed bug that caused "abnormal interrupt" at boot time/first use
6) added support for reading Zynx address ROM
7) fixed bug that caused broadcasts to not work shortly after booting (only
manifested if not using multicast - e.g. not in FreeBSD 2.0)
8) fixed spelling errors in comments

Submitted by: Matt Thomas


4437 13-Nov-1994 dg

Added support for SIOCSIFMTU ioctl. Fixed bug that caused panic at boot time
related to interrupts being enabled before the device attach. The interrupt
should be mapped *after* the device attach.


4335 10-Nov-1994 dg

Added missing call to bpf on the transmit side. Nuked revision log.


4322 09-Nov-1994 dg

Fixed bug that somehow made it into here: the ifp must be stored in the
mbuf header for received packets. Minor performance optimizations. Removed
#ifdef MULTICAST's as this isn't optional in our kernel.


4100 02-Nov-1994 se

Submitted by:
Added hooks for "lsdev" ...
PCI devices should need no individual code for lsdev.


4000 30-Oct-1994 ats

Submitted by: Paul F. Werkowski
Add a quirk line for the SONY SDT-5000 like it is done for the WangDAT tapes.


3994 29-Oct-1994 jkh

Make this documentation more sane in the context of 2.0.


3939 27-Oct-1994 se

Change some compile time defaults, which may be overridden from the
kernel config file by options lines.
Now the default settings are FAST SCSI, max. 4 TAGS, WIDE transfers,
if supported by the hardware ...


3870 25-Oct-1994 se

Modified fifth parameter (imask) to register_intr() according to
new definition of that function.


3862 25-Oct-1994 se

Added decoding of chipset registers for Pentium 90/100 CPUs.


3669 17-Oct-1994 phk

#ifdef'ed the verbose probe messages. Only until I find a good way of
making it run-time selectable, then it will be back (at will).


3633 15-Oct-1994 se

Fixed typo and message format change to avoid line wrapping.


3599 14-Oct-1994 se

Submitted by: "Randall W. Dean" <rwd@osf.org>
Fixed typo in initialisation of DMODE:
PCI burst length now really 16 transfers as advertised ...


3553 13-Oct-1994 se

Submitted by: Wolfgang Stanglmeier <wolf@dentaro.GUN.de>
removed PCI mapping call from vga_attach() in pcisupport.c.


3552 13-Oct-1994 se

Submitted by: Wolfgang Stanglmeier <wolf@dentaro.GUN.de>
Debugging option changed, getirr() removed.


3543 12-Oct-1994 se

Submitted by: Matt Thomas <thomas@lkg.dec.com>
Preliminary FAST Ethernet support added (DEC21140).


3541 12-Oct-1994 se

Submitted by: Bruce Evans <bde@zeta.org.au>
Function getirr() could clobber interrupt controller state.


3535 12-Oct-1994 se

Small corrections:
pci config line now without irq
boot message changed


3533 12-Oct-1994 se

Submitted by: Wolfgang Stanglmeier <wolf@dentaro.GUN.de>
Bug fixed, that caused system hang on first interrupt on some motherboards.

New version of PCI bus configuration code, now supports dynamic interrupt
configuration (using BIOS supplied values).
NCR SCSI and DEC Ethernet driver patched to use this feature.
*** Remove PCI IRQ specifications from your kernel config file ! ***


3532 12-Oct-1994 se

Submitted by: Wolfgang Stanglmeier <wolf@dentaro.GUN.de>
Name change: pci_intel.c -> pcisupport.c


3531 12-Oct-1994 se

Submitted by: Wolfgang Stanglmeier <wolf@dentaro.GUN.de>
Files merged and name change: pci_device.h + pcibios.h -> pcireg.h


3529 12-Oct-1994 se

Submitted by: Wolfgang Stanglmeier <wolf@dentaro.GUN.de>
Name change: ncr_reg.h -> ncrreg.h


3278 01-Oct-1994 wollman

Add Matt Thomas's DC21040 PCI Ethernet driver. (This is turning out
to be quite a popular chip, so expect to see a number of products
based on it.)


3251 01-Oct-1994 wollman

Correct DEC -> Digital Equipment Corporation.


3166 28-Sep-1994 se

Submitted by: Wolfgang Stanglmeier <wolf@dentaro.GUN.de>
New version with improved support for WIDE SCSI using the NCR 53c825.
Test for buggy secondary cache implementations.
PCI Int to IRQ mapping now specified per slot.


3043 24-Sep-1994 rgrimes

Add missing closing comment. I have taken the non-knf format
of this code up with the authors and they are looking at converting it,
but until then leave the format alone.


2826 16-Sep-1994 dg

Removed inclusion of pio.h and cpufunc.h (cpufunc.h is included from
systm.h). Merged functionality of pio.h into cpufunc.h. Cleaned up some
related code.


2815 16-Sep-1994 se

Submitted by: Wolfgang Stanglmeier <wolf@dentaro.GUN.de> + <se>
Improved bus probing, symbolic names for registers..
Chip set parameters get dumped for intel PCI chip sets
(82424+82434 only, for now).


2814 16-Sep-1994 se

Submitted by: Wolfgang Stanglmeier <wolf@dentaro.GUN.de>
New version with support for the NCR 53c810 and 53c825.
Support for WIDE SCSI devices.


2753 14-Sep-1994 wollman

Added a bit of missing functionality to make this work correctly on a
wider variety of systems. Include the deivers from pci_intel.c in
pci_config.c (I hope this is what was intended; my system works ok).
Use pmap_mapdev(). Automatically map any large linear frame buffers
or whatnot in VGA-style devices which ordinarily would not have their
own drivers, and don't call not_supported() for them. (This shuts up
complaints about my Matrox card.) Include the beginnings of what could
eventually become dynamically-loadable PCI devices. Allow for the
possibility of PCI devices simply providing a PCI veneer over an existing
ISA device, and shut up about them, too.
Make autoconfiguration text conform more to the style of other supported
buses.


2435 01-Sep-1994 se

Submitted by: Wolfgang Stanglmeier <wolf@dentaro.GUN.de>
Merged in changes required for NetBSD support (by mycroft@gnu.ai.mit.edu)
and support for multiple NCR chips.


2433 01-Sep-1994 se

This commit was generated by cvs2svn to compensate for changes in r2432,
which included commits to RCS files with non-trunk default branches.