opnsense-src/sys/dev
Bill Paul a94100fa9b 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).
2003-09-08 02:11:25 +00:00
..
aac Commands submitted through the management interface won't have scatter/ 2003-09-01 20:44:18 +00:00
acpica Don't free the buffer if it wasn't actually allocated. 2003-09-04 15:55:41 +00:00
adlink Be less confusing in a comment. 2003-09-05 11:05:41 +00:00
advansys Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
agp PCI header files live in dev/pci. 2003-08-23 19:32:18 +00:00
aha Use __FBSDID(). 2003-08-24 17:55:58 +00:00
ahb Make this at least compile on 64 bit platforms. Its been breaking 2003-07-30 20:09:22 +00:00
aic Use __FBSDID(). 2003-08-24 17:55:58 +00:00
aic7xxx Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
amd Prefer new location of pci include files (which have only been in the 2003-08-22 05:54:52 +00:00
amr Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
an Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
ar Use __FBSDID(). 2003-08-24 17:55:58 +00:00
asr Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
ata Forgotten in previous commit to atapi-cd.c: Add #ifndef BURN_BRIDGES 2003-09-05 11:08:55 +00:00
ath Add support for the experimental radiotap capture format. With this 2003-09-05 22:22:49 +00:00
atkbdc Use __FBSDID(). 2003-08-24 17:55:58 +00:00
awi Fix off-by-one error in array bounds check. 2003-09-05 11:09:26 +00:00
bge Use __FBSDID(). 2003-08-24 17:55:58 +00:00
bktr Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
buslogic Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
cardbus Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
ciss Prefer new location of pci include files (which have only been in the 2003-08-22 05:54:52 +00:00
cm Use __FBSDID(). 2003-08-24 17:55:58 +00:00
cnw Use __FBSDID(). 2003-08-24 17:55:58 +00:00
cs Use __FBSDID(). 2003-08-24 17:55:58 +00:00
ct Use __FBSDID(). 2003-08-24 17:55:58 +00:00
cy Use __FBSDID(). 2003-06-11 06:34:30 +00:00
dc Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
de Prefer new location of pci include files (which have only been in the 2003-08-22 07:20:27 +00:00
dec Use __FBSDID(). 2003-08-24 17:55:58 +00:00
dgb Remove a few ushorts I missed in my earlier pass. 2003-08-15 14:55:50 +00:00
digi Use __FBSDID(). 2003-08-24 17:55:58 +00:00
dpt Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
drm Comment out a couple of __inline__s until we can get inlines to be actually 2003-08-24 22:04:12 +00:00
ed Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
eisa Use __FBSDID(). 2003-08-24 17:55:58 +00:00
em Add support for new devices. 2003-08-27 21:52:37 +00:00
en Use __FBSDID(). 2003-08-24 17:55:58 +00:00
ep Style fixes of the whitespace variety. Fix long lines and tabs. 2003-08-30 08:10:58 +00:00
ex Use __FBSDID(). 2003-08-24 17:55:58 +00:00
exca When we went to the set_flags interface for the memory resource, we 2003-08-29 05:27:36 +00:00
fatm Remove duplicate SCM ID. 2003-08-24 20:18:11 +00:00
fb Use __FBSDID(). 2003-08-24 17:55:58 +00:00
fdc Put the device cloning functions for disk-drivers under #ifndef BURN_BRIDGES. 2003-09-05 10:40:16 +00:00
fe Use __FBSDID(). 2003-08-24 17:55:58 +00:00
firewire Fix byte order of multi-byte scsi_status information. 2003-08-29 13:36:17 +00:00
fxp change timeout to be MPSAFE 2003-09-05 22:37:31 +00:00
gem Preparatory commit to allow prototypes in ofw_machdep.h to contain 2003-09-02 20:24:42 +00:00
gfb Use __FBSDID(). 2003-08-24 17:55:58 +00:00
gx Use __FBSDID(). 2003-08-24 17:55:58 +00:00
harp Use __FBSDID(). 2003-08-24 17:55:58 +00:00
hatm Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
hea Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
hfa Use __FBSDID(). 2003-08-24 17:55:58 +00:00
hifn Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
hme Preparatory commit to allow prototypes in ofw_machdep.h to contain 2003-09-02 20:24:42 +00:00
ic The uart(4) driver is an universal driver for various UART hardware. 2003-09-06 23:13:47 +00:00
ichsmb Update the comment to indicate ICH5 support 2003-08-31 19:23:00 +00:00
ida Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
idt Use __FBSDID(). 2003-08-24 17:55:58 +00:00
ie Use __FBSDID(). 2003-08-24 17:55:58 +00:00
iicbus Use __FBSDID(). 2003-08-24 17:55:58 +00:00
iir Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
ips Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
isp Move the inclusion of <machine/ofw_machdep.h> after the inclusion of 2003-09-02 19:52:31 +00:00
ispfw Use __FBSDID(). 2003-08-24 17:55:58 +00:00
joy Use __FBSDID(). 2003-08-24 17:55:58 +00:00
kbd Use __FBSDID(). 2003-08-24 17:55:58 +00:00
lge Use __FBSDID(). 2003-08-24 17:55:58 +00:00
lmc Use __FBSDID(). 2003-08-24 17:55:58 +00:00
lnc Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
matcd Use __FBSDID(). 2003-08-24 17:55:58 +00:00
mc146818 Add missing $FreeBSD$ 2000-05-01 19:54:26 +00:00
mca Use __FBSDID(). 2003-08-24 17:55:58 +00:00
mcd Use __FBSDID(). 2003-08-24 17:55:58 +00:00
md Consistently use the BSD u_int and u_short instead of the SYSV uint and 2003-08-07 15:04:27 +00:00
mii Take the support for the 8139C+/8169/8169S/8110S chips out of the 2003-09-08 02:11:25 +00:00
mk48txx Use __FBSDID(). 2003-08-24 17:55:58 +00:00
mlx Prepare for locking mlx(4) by cleaning up the use of busdma. No real 2003-09-02 08:30:31 +00:00
mly Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
mpt Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
mse Use __FBSDID(). 2003-06-02 16:32:55 +00:00
musycc Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
my Use __FBSDID(). 2003-08-24 17:55:58 +00:00
ncv Use __FBSDID(). 2003-08-24 17:55:58 +00:00
nge Use __FBSDID(). 2003-08-24 17:55:58 +00:00
nmdm Use __FBSDID(). 2003-08-24 17:55:58 +00:00
nsp Use __FBSDID(). 2003-08-24 17:55:58 +00:00
null Use __FBSDID(). 2003-08-24 17:55:58 +00:00
ofw Use __FBSDID(). 2003-08-24 17:55:58 +00:00
owi Check in the known good version of the wi driver, with prism/symbol 2003-08-24 05:42:49 +00:00
patm Use __FBSDID(). 2003-08-24 17:55:58 +00:00
pccard Whacked out CIS configurations can cause us to not have any child. When 2003-09-05 03:08:08 +00:00
pccbb Add newly discovered ENE Technologies CardBus bridges to the list: 2003-08-22 08:49:56 +00:00
pcf fix another LP64 problem. READ_IVAR takes a pointer to an uintptr_t, not 2003-06-20 07:22:54 +00:00
pci Bring back PCIR_HEADERTYPE as an alias for PCIR_HDRTYPE under BURN_BRIDGES 2003-09-03 17:48:22 +00:00
pcic Use __FBSDID(). 2003-08-24 17:55:58 +00:00
pdq Use __FBSDID(). 2003-08-24 17:55:58 +00:00
ppbus Use __FBSDID(). 2003-08-24 17:55:58 +00:00
ppc Forgot an added file in the last commit. 2003-08-01 05:02:55 +00:00
pst Use __FBSDID(). 2003-08-24 17:55:58 +00:00
puc Enhance puc(4) to support uart(4). This includes: 2003-09-06 21:48:50 +00:00
raidframe Use __FBSDID(). 2003-08-24 17:55:58 +00:00
random Use __FBSDID(). 2003-08-24 17:55:58 +00:00
ray Use __FBSDID(). 2003-08-24 17:55:58 +00:00
rc Consistently use the BSD u_int and u_short instead of the SYSV uint and 2003-08-07 15:04:27 +00:00
re Take the support for the 8139C+/8169/8169S/8110S chips out of the 2003-09-08 02:11:25 +00:00
rndtest Use __FBSDID(). 2003-08-24 17:55:58 +00:00
rp Use __FBSDID(). 2003-08-24 17:55:58 +00:00
sab Use __FBSDID(). 2003-08-24 18:03:45 +00:00
safe Prefer new location of pci include files (which have only been in the 2003-08-22 07:08:17 +00:00
sbni Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
sbsh Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
scd Use __FBSDID(). 2003-08-24 18:03:45 +00:00
sf Prefer new location of pci include files (which have only been in the 2003-08-22 07:20:27 +00:00
si Use __FBSDID(). 2003-08-24 18:03:45 +00:00
sio Remove a duplicate comment. 2003-08-28 03:54:49 +00:00
sk Prefer new location of pci include files (which have only been in the 2003-08-22 07:20:27 +00:00
smbus No need for a separate nfpm driver now - amdpm handles both. 2003-09-06 13:58:06 +00:00
sn Use __FBSDID(). 2003-08-24 18:03:45 +00:00
snc Use __FBSDID(). 2003-08-24 18:03:45 +00:00
snp Use __FBSDID(). 2003-08-24 18:03:45 +00:00
sound update my email address. 2003-09-07 16:28:03 +00:00
speaker Use __FBSDID(). 2003-06-02 16:32:55 +00:00
sr Use __FBSDID(). 2003-08-24 18:17:24 +00:00
stg Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
streams Use __FBSDID(). 2003-08-24 18:17:24 +00:00
sym Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
syscons Fix the alpha kernel build. 2003-08-25 21:32:00 +00:00
tdfx Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
tga Use __FBSDID(). 2003-08-24 17:55:58 +00:00
ti Prefer new location of pci include files (which have only been in the 2003-08-22 07:20:27 +00:00
trm Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
twe Prefer new location of pci include files (which have only been in the 2003-08-22 07:08:17 +00:00
tx Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
txp Use __FBSDID(). 2003-08-24 17:55:58 +00:00
uart Remove the assumption that a bus_space_handle_t is an I/O address 2003-09-07 21:51:03 +00:00
ubsec Use __FBSDID(). 2003-08-24 17:55:58 +00:00
usb Recognize the OHCI USB device on Opteron-based nForce3 motherboards 2003-09-03 07:40:17 +00:00
utopia Generate events when the carrier goes up or down. 2003-07-30 08:35:58 +00:00
vinum Use __FBSDID(). 2003-08-24 17:55:58 +00:00
vr Prefer new location of pci include files (which have only been in the 2003-08-22 07:20:27 +00:00
vx Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
wds Use __FBSDID(). 2003-08-24 17:55:58 +00:00
wi o add experimental radiotap capture format 2003-09-05 22:29:30 +00:00
wl Use __FBSDID(). 2003-08-24 17:55:58 +00:00
xe Use __FBSDID(). 2003-08-24 17:55:58 +00:00
zs Use __FBSDID(). 2003-08-24 17:55:58 +00:00