History log of /freebsd-current/sys/dev/fxp/if_fxpreg.h
Revision Date Author Comments
# 95ee2897 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# b61a5730 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD

The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# 0e4a3d93 18-Dec-2018 Mark Johnston <markj@FreeBSD.org>

Remove a use of a negative array index from fxp(4).

This fixes a warning seen when compiling amd64 GENERIC with clang 7.
Also remove the workaround added in r337324. clang 7 and gcc 4.2
generate the same code with or without the code change.

Reviewed by: imp (previous version)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D18603


# 718cf2cc 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

sys/dev: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.


# aa6b24dc 23-Dec-2014 Warner Losh <imp@FreeBSD.org>

Add Intel vendor ID to the device table to make it more uniform so
that all the pnp info to match the device is in the fxp_ident_table.


# 52ee8ac0 30-Mar-2014 Pyun YongHyeon <yongari@FreeBSD.org>

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.

In collaboration with: rmacklem
MFC after: 2 weeks


# 8262183e 27-Mar-2012 Pyun YongHyeon <yongari@FreeBSD.org>

Load entire EEPROM contents in device attach time and verify
whether the checksum of EEPROM is valid or not. Because driver
heavily relies on EEPROM information when it selectively enables
features/workarounds, it would be helpful to know whether driver
sees valid EEPROM.
While I'm here remove all other EEPROM accesses since the entire
EEPROM is loaded at device attach time.

MFC after: 2 weeks


# 1845b5c3 26-Nov-2010 Marius Strobl <marius@FreeBSD.org>

Fix and implement missing parts of flow control support. This also removes
the dev.fxp.%d.noflow tunable as the same effect can now be achieved with
ifconfig(8) by setting the flowcontrol media option as desired (besides
the tunable never having a chance to actually enable flow control support
so far).
In joint forces with: yongari


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 14d379e5 17-May-2010 Pyun YongHyeon <yongari@FreeBSD.org>

MFC r207832:
Export hardware MAC statistics through sysctl node. Previously
fxp(4) already used to extract most hardware MAC statistics but it
didn't show them. With this change, all MAC statistics counters
are exported. Because there are a couple of new counters for 82558
and 82559, enable extended MAC statistics functionality to get
these counters. Accoring to public data sheet, 82559 MAC statistics
return 24 DWORD counters(3 counters are unknown at this moment) so
increase MAC counter structure to meet the MAC statistics block size.
The completion of MAC counter dump is now checked against
FXP_STATS_DR_COMPLETE status code which is appended at the end of
status block. Previously fxp(4) ignored the status of the
FXP_SCB_COMMAND_CU_DUMPRESET command. fxp(4) does not wait for the
completion of pending command before issuing
FXP_SCB_COMMAND_CU_DUMPRESET. Instead it skips the command and try
it next time. This scheme may show better performance but there is
chance to loose updated counters after stopping controller. So make
sure to update MAC statistics in fxp_stop().
While I'm here move sysctl node creation to fxp_sysctl_node().

Tested by: Larry Baird < lab <> gta dot com >


# 8da9c507 09-May-2010 Pyun YongHyeon <yongari@FreeBSD.org>

Export hardware MAC statistics through sysctl node. Previously
fxp(4) already used to extract most hardware MAC statistics but it
didn't show them. With this change, all MAC statistics counters
are exported. Because there are a couple of new counters for 82558
and 82559, enable extended MAC statistics functionality to get
these counters. Accoring to public data sheet, 82559 MAC statistics
return 24 DWORD counters(3 counters are unknown at this moment) so
increase MAC counter structure to meet the MAC statistics block size.
The completion of MAC counter dump is now checked against
FXP_STATS_DR_COMPLETE status code which is appended at the end of
status block. Previously fxp(4) ignored the status of the
FXP_SCB_COMMAND_CU_DUMPRESET command. fxp(4) does not wait for the
completion of pending command before issuing
FXP_SCB_COMMAND_CU_DUMPRESET. Instead it skips the command and try
it next time. This scheme may show better performance but there is
chance to loose updated counters after stopping controller. So make
sure to update MAC statistics in fxp_stop().
While I'm here move sysctl node creation to fxp_sysctl_node().

Tested by: Larry Baird < lab <> gta dot com >


# bd4fa9d9 01-Dec-2008 Pyun YongHyeon <yongari@FreeBSD.org>

Add VLAN hardware tag insertion/stripping support. Tx/Rx checksum
offload for VLAN frames are also supported. The VLAN hardware
assistance is available only on 82550/82551 based controllers.
While I'm here change the confusing name of bit1 in byte 22 of
configuration block to vlan_drop_en. The bit controls whether
hardware strips VLAN tagged frame or not. Special thanks to wpaul
who sent valuable VLAN related information to me.

Tested on: i386, sparc64


# 7137cea0 26-Nov-2008 Pyun YongHyeon <yongari@FreeBSD.org>

Add basic WOL support for 82550/82551/82558 and 82559 based
controllers. ICH based controllers are treated as 82559. 82557,
earlier revision of 82558 and 82559ER have no WOL capability.
o WOL support requires help of a firmware so add check whether
hardware is capable of handling magic frames by reading EEPROM.
o Enable accepting WOL frames only when hardware is about to
suspend or shutdown. Previously fxp(4) used to allow receipt of
magic frame under normal operation mode which could cause
hardware hang if magic frame is received by hardware. Datasheet
clearly states driver should not allow WOL frames under normal
operation mode.
o Disable WOL frame reception in device attach so have fxp(4)
immunize against system hang which can be triggered by magic
packets when the hardware is not in fully initialized state.
o Don't reset all hardware configuration data in fxp_stop()
otherwise important configuration data is lost and this would
reset WOL configuration to default state which in turn cause
hardware hang on receipt of magic frames. To fix the issue,
preserve hardware configuration data by issuing a selective
reset.
o Explicitly disable interrupts after issuing selective reset as
reset may unmask interrupts.

Tested by: Alexey Shuvaev < shuvaev <> physik DOT uni-wuerzburg DOT de >


# c21e84e4 26-Nov-2008 Pyun YongHyeon <yongari@FreeBSD.org>

Implement TSO for 82550/82551 controllers.
o Configure controller to use dynamic TBD as TSO requires that
operation mode.
o Add a dummy TBD to tx_cb_u as TSO can access one more TBD in TSO
operation.
o Increase a DMA segment size to 4096 to hold a full IP segment
with link layer header.
o Unlike other TSO capable controllers, 82550/82551 does not
modify the first IP packet in TSO operation so driver should
create an IP packet with proper header. Subsequent IP packets
are generated from the header information in the first IP packet
header. Likewise pseudo checksum also should be computed by
driver for the first packet.
o TSO requires one more TBD to hold total TCP payload. To make
code simple for TSO/non-TSO case, increase the index of the
first available TBD array.
o Remove KASSERT that checks the size of a DMA segment should be
less than or equal to MCLBYTES as it's no longer valid in TSO.
o Tx threshold and number of TBDs field is used to store MSS in
TSO. So don't set the Tx threshold in TSO case.


# f56e7f74 24-Nov-2008 Pyun YongHyeon <yongari@FreeBSD.org>

Whitespace fix.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 507feeaf 22-Apr-2005 Maxime Henrion <mux@FreeBSD.org>

Be more conservative when enabling extended features. There are fxp(4)
NICs out there that have an utterly bogus revision ID.

Reported by: Denis Shaposhnikov <dsh@vlink.ru>


# de571603 21-Apr-2005 Maxime Henrion <mux@FreeBSD.org>

Add a microcode to implement receive bundling for 82551 chipsets with
a revision ID of 0x0f (D102 E-step).

MFC after: 2 weeks
Tested by: pav


# 74d1ed23 05-Mar-2005 Maxime Henrion <mux@FreeBSD.org>

Cleanup: u_intXX_t -> uintX_t conversion.


# 098ca2bd 05-Jan-2005 Warner Losh <imp@FreeBSD.org>

Start each of the license/copyright comments with /*-, minor shuffle of lines


# 4d340ec4 14-May-2003 Maxime Henrion <mux@FreeBSD.org>

GCC 3.3 complains about anonymous structures in unions, so
give the fxp_ipcb structure a name in the fxp_rfa structure.

Submitted by: peter
Approved by: re (jhb)


# 72490791 12-May-2003 Maxime Henrion <mux@FreeBSD.org>

Fix the unaligned access problems that some people saw on alpha
by using a __packed keyword for the fxp_rfa structure. The Intel
guys who designed this structure with unaligned fields deserve
to be shot.

Tested by: kris
Approved by: re@ (jhb)


# d45d97d1 06-Apr-2003 Maxime Henrion <mux@FreeBSD.org>

Revert the s/u_int/u_int8_t/ changes, we can't really use other
integer types than int with bit-fields in a portable way.

Prodded by: bde


# 6835a8ac 05-Apr-2003 Maxime Henrion <mux@FreeBSD.org>

Correct the definition of the link_addr and rbd_addr fields
in struct fxp_rfa. This should have been committed with my
last endianness fixes.


# 467295e0 05-Apr-2003 Maxime Henrion <mux@FreeBSD.org>

- Use __FXP_BITFIELDX macros to make the configuration bitfield
endian safe.
- Change some u_int to u_int8_t which make more sense here since
we're really defining bytes. That produces the same code due to
how bitfields work.
- Add the definition of the vlan_drop_en bit (not used yet).
- Add some useful comments.

Obtained from: NetBSD


# c2a2b443 03-Apr-2003 Maxime Henrion <mux@FreeBSD.org>

Fix fxp(4), this changed shouldn't have crept in.

Pointy hat to: mux
Reported by: Pawel Worach <pawel.worach@nordea.com>


# e609b4d7 03-Apr-2003 Maxime Henrion <mux@FreeBSD.org>

Remove all the bogus volatile qualifiers from the structs definitions
and associated evil casts to discard them.


# b2badf02 02-Apr-2003 Maxime Henrion <mux@FreeBSD.org>

Convert the fxp(4) driver to the busdma API.

This patch is rather big because I had to significantly redesign
the driver to make the busdma conversion possible. Most notably,
hardware and software structures were carefully splitted to get
rid of all the structs overlapping evilness.

Special thanks to phk and Richard Puga <puga@mauibuilt.com> for
providing me with fxp(4) hardware to do this work.

Thanks to marcel for testing this on ia64, and to Fred Clift
<fclift@verio.net> for testing this on alpha.

Tested on: i386, ia64, alpha


# c8bca6dc 26-Feb-2003 Bill Paul <wpaul@FreeBSD.org>

As previously threatened, add TCP/IP checksum offload support to
the fxp driver. This is enabled only for the 82550/82551 chips
(PCI revision code 12 or 13). RX and TX checksum offload are
both supported. Transmit offload is limited to TCP and UDP only
right now: there seems to be a problem with IP header checksumming
on transmit in some cases.

This chip has hardware VLAN support as well. I hope to enable
support for this eventually.


# 3ceb2520 24-Oct-2001 Jonathan Lemon <jlemon@FreeBSD.org>

. Add structure definition for microcode download.
Submitted by: Marko Zec <zec@tel.fer.hr>

. Add some PCI chip revision entries.
. Make size of txcb dependent on pointer size rather than arch #define


# 00c4116b 27-Aug-2001 Jonathan Lemon <jlemon@FreeBSD.org>

Systems based on the ICH2/ICH2-M chip from Intel have a defect where
the chip can cause a PCI protocol violation in under certain scenarios.
The workaround is to rewrite the EEPROM to disable Dynamic Standby Mode.

Once the EEPROM is rewritten, the system needs to be rebooted in order
to pick up the new settings.

This has been tested on several ICH2/ICH2-M systems, found in 815E based
boards, and usually identified by the presence of the 82562 ET/EM PHY.

Thanks to: Mike Tansca, Paul Saab for samples of the problematic boards.


# dedabebf 15-May-2001 Jonathan Lemon <jlemon@FreeBSD.org>

Use " |= " to enable special media handling for fxp with no MII, instead
of " &= ". Also change the MII PHY device mask to check the correct bits.

Cookie to: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
Pointy hat to: me


# e310a419 12-May-2001 Jonathan Lemon <jlemon@FreeBSD.org>

Add a few more register definitions.


# 3bd07cfd 14-Mar-2001 Jonathan Lemon <jlemon@FreeBSD.org>

Add some performance features to the fxp driver. If the chip is not
a 82557 (e.g.: a newer chip) then:

+ enable MWI, if the PCI configuration indicates the system supports it
+ enable usage of extended TxCB, for better performance
+ enable hardware flow control. FC frames will be passed up to the
host only if promiscuous mode is enabled.


# f7788e8e 12-Mar-2001 Jonathan Lemon <jlemon@FreeBSD.org>

Convert the fxp driver to miibus, which involves ripping out the PHY
logic and media bits. Support for Intel PHYs can now be found in
dev/mii/inphy.c.

Clean up the driver, and add various 82558 and 82559 specific bits.


# b2f5cb03 21-Sep-2000 Bill Paul <wpaul@FreeBSD.org>

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.


# 55ce7b51 18-Jun-2000 David Greenman <dg@FreeBSD.org>

Added support for the i82559ER (10/100Mbps NIC for embedded applications).

Product device ID provided by: Les Biffle <les@ns3.safety.net>


# 4fc1dda9 30-Sep-1999 Andrew Gallatin <gallatin@FreeBSD.org>

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.


# dd68ef16 06-Sep-1999 Peter Wemm <peter@FreeBSD.org>

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>


# c3aac50f 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# da15ec8b 11-Feb-1999 Julian Elischer <julian@FreeBSD.org>

Define more registers and fix incorrect (but unused) register bit definitions.


# f1bf08c2 11-Feb-1999 Julian Elischer <julian@FreeBSD.org>

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>


# a09bee1a 08-Jun-1998 Bruce Evans <bde@FreeBSD.org>

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)).


# 92924291 03-Mar-1998 David Greenman <dg@FreeBSD.org>

Added support for the 82553 and 'B' 82555 PHY.


# 397f9dfe 29-Sep-1997 David Greenman <dg@FreeBSD.org>

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.


# ba8c6fd5 05-Sep-1997 David Greenman <dg@FreeBSD.org>

Changes to support NetBSD and the new ifmedia extensions.
Submitted by: Jason Thorpe <thorpej@netbsd.org>


# 854d1421 13-Jun-1997 David Greenman <dg@FreeBSD.org>

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.


# 6ebc3153 21-Mar-1997 David Greenman <dg@FreeBSD.org>

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.


# dccee1a1 17-Mar-1997 David Greenman <dg@FreeBSD.org>

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.


# 6875d254 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.


# 33d14d86 04-Feb-1997 David Greenman <dg@FreeBSD.org>

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.


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

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.


# 58b248e2 07-Apr-1996 David Greenman <dg@FreeBSD.org>

Removed sections 3 and 4 from my copyright.


# 23a0ed7c 05-Dec-1995 David Greenman <dg@FreeBSD.org>

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.


# a17c678e 28-Nov-1995 David Greenman <dg@FreeBSD.org>

Device driver for Intel Pro/100 PCI Fast Ethernet controller.