freebsd-src/sys/conf
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
..
defines
files Take the support for the 8139C+/8169/8169S/8110S chips out of the 2003-09-08 02:11:25 +00:00
files.alpha Hook-up the uart(4) driver to the build. For a detailed description 2003-09-06 23:23:26 +00:00
files.amd64 Hook-up the uart(4) driver to the build. For a detailed description 2003-09-06 23:23:26 +00:00
files.i386 Hook-up the uart(4) driver to the build. For a detailed description 2003-09-06 23:23:26 +00:00
files.ia64 Hook-up the uart(4) driver to the build. For a detailed description 2003-09-06 23:23:26 +00:00
files.pc98 Add proper pc98 MD files. Add a commented out cbus attachment for 2003-09-07 05:05:40 +00:00
files.powerpc Hook grackle system controller/heathrow interrupt controller to PPC build. 2003-06-28 08:53:49 +00:00
files.sparc64 Hook-up the uart(4) driver to the build. For a detailed description 2003-09-06 23:23:26 +00:00
kern.mk Update the kernel compile flags inside the .if ${MACHINE_ARCH} == "amd64" 2003-05-30 01:06:58 +00:00
kern.post.mk Fix logic in Makefile.i386,v 1.249: only back up ${DESTDIR}${KODIR} 2003-08-07 19:12:06 +00:00
kern.pre.mk Now that the pci include file location migration has been completed, 2003-08-22 15:41:44 +00:00
kmod.mk Hook-up the uart(4) driver to the build. For a detailed description 2003-09-06 23:23:26 +00:00
kmod_syms.awk Our awk does not implement the ARGIND variable, so we were attempting 2002-08-06 19:31:04 +00:00
ldscript.alpha Use the new freebsd output format from Binutils 2.13.1. 2002-10-11 19:38:04 +00:00
ldscript.amd64 Sync up with the files in the hammer branch in the p4 tree to get basic 2003-05-01 02:59:24 +00:00
ldscript.i386 Add two symbols start_ctors and stop_ctors to allow us to find the 2003-01-06 07:37:15 +00:00
ldscript.ia64 Load the kernel at a 64M instead of 5M. The advantage of this is that 2003-09-06 05:15:36 +00:00
ldscript.powerpc Page align the data segment. 2001-10-08 10:43:34 +00:00
ldscript.sparc64 Use the same SEARCH_DIR as other platforms. 2003-06-07 18:23:50 +00:00
majors Reserve 184 for dumb console driver(dcons) which can be found in 2003-08-27 07:35:12 +00:00
majors.awk Add necessary awk magic to create a table of major numbers allocated 2003-02-27 08:52:11 +00:00
Makefile.alpha Bump the config version to force people to upgrade their config(8) 2003-04-15 21:29:11 +00:00
Makefile.amd64 Add ddb machdep bits. 2003-05-30 01:03:43 +00:00
Makefile.i386 Bump the config version to force people to upgrade their config(8) 2003-04-15 21:29:11 +00:00
Makefile.ia64 Revamp of the syscall path, exception and context handling. The 2003-05-16 21:26:42 +00:00
Makefile.pc98 Bump the config version to force people to upgrade their config(8) 2003-04-15 21:29:11 +00:00
Makefile.powerpc Bump the config version to force people to upgrade their config(8) 2003-04-15 21:29:11 +00:00
Makefile.sparc64 Bump the config version to force people to upgrade their config(8) 2003-04-15 21:29:11 +00:00
makeLINT.mk Implemented "nooption" and "nomakeoption" config(8) tokens. 2003-02-26 23:36:59 +00:00
makeLINT.sed Implemented "nooption" and "nomakeoption" config(8) tokens. 2003-02-26 23:36:59 +00:00
newvers.sh ARGH. I *knew* I'd eventually accidently commit this. Change 5.1-XP back 2003-07-23 20:07:49 +00:00
NOTES Improved English, proper spacing and capitalization for the serial 2003-09-07 19:19:49 +00:00
options Add support for the Coda 6.x venus<->kernel interface. This extends 2003-09-07 07:43:10 +00:00
options.alpha Add option NO_SIO to work-around the hardcoded dependency on sio(4). 2003-08-25 03:43:08 +00:00
options.amd64 Moved the syscons options, kbd options and DEV_SPLASH to the MI options 2003-06-18 15:25:01 +00:00
options.i386 Detect Geode CPUs and initialize the 27MHz timecounter "Geode". 2003-08-31 16:20:34 +00:00
options.ia64 Picking PAGE_SHIFT as a global option is a bad idea. Instead call the 2003-08-23 03:38:36 +00:00
options.pc98 Initiate de-orbit burn for fpu-less operation. 386+387 is still 2003-07-22 08:11:17 +00:00
options.powerpc Options that go into homonymous headers shouldn't specify the header name. 2003-04-12 09:40:37 +00:00
options.sparc64 Hook syscons and the creator driver up to the sparc64. This compiles but 2003-08-24 01:54:06 +00:00
systags.sh