- Don't call m_adj() to make RX buffer's _payload_ on longword aligned,
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 23 Dec 2006 03:41:55 +0000 (03:41 +0000)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 23 Dec 2006 03:41:55 +0000 (03:41 +0000)
commit7caafb854066c0e4515f3cc0c3dbf0a75cd55249
tree5e34f3044f1de5d20b27a01660ca3570d39d40f9
parent31eb408a35dee17fd08ec7c95917334d1beb8db2
- Don't call m_adj() to make RX buffer's _payload_ on longword aligned,
  because some re(4) chips (e.g. RTL8101E) require RX buffer to be
  8-bytes aligned.  This change shows no noticeable performance change.
Reported-by: Joe Talbott <josepht@cstone.net>
- Avoid writing extra hardware registers by writing 2 bytes to IDR4
  instead instead of writing 4 bytes, bacause:
  1) the extra two registers after IDR5 are reserved.
  2) accessing arpcom.ac_enaddr[6,7] should be invalid.
- Add a flag field in re_softc and re_hwrev.  Currently only one flag,
  RE_F_HASMPC, is defined.  This flag is used to indicate whether the
  hardware has MPC register or not, so we can avoid writing to MPC's
  position, if that position is reserved.
- Move descriptor ring address setting up before RX/TX enabling, since
  some re(4) chips (e.g. RTL8101E) will try accessing descriptor ring
  immediately after RX/TX is enabled, which results in intermittent
  kernel panic or system hanging.
Paniced-by: Joe Talbott <josepht@cstone.net>
- Avoid calling re_init(), if hw.reX.tx_moderation is changed but NIC
  is not up yet.
- Const-fy global hardware id arrays and nuke unused macro while I'm here.

Thank Joe Talbott <josepht@cstone.net> to help debugging and provide
valuable information (esp. locating the problematic RX/TX enabling :)

Thank dillon@ to provide debugging hints.

Tested-by:
  Joe Talbott <josepht@cstone.net> (RTL8101E)
  swildner@ (onboard RTL8169S) (*)
  me (RTL8169S)

# (*) swildner@'s card is still half broken even after this commit :\
sys/dev/netif/re/if_re.c
sys/dev/netif/re/if_revar.h