busdma(9) fixes for bfe(4):
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 14 Jul 2007 08:01:24 +0000 (08:01 +0000)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 14 Jul 2007 08:01:24 +0000 (08:01 +0000)
commit28488fd3fed69428311f0723a48ec31eae1f83af
treec1a7e228db4442c6df391e353383c19f00910801
parent4343fdc9768b9bce984f9beb366a15d7ceb7faf0
busdma(9) fixes for bfe(4):
- Set low address of the top level dma tag to 1Gbytes, due to chipset limit.
- TX/RX rings need to be aligned on 4Kbytes.
- Correct dma map syncing direction.
- In bfe_txeof() and bfe_tx_ring_free(), unload dma map for all TX descs
  instead of only for the TX desc holding the mbuf.
- In bfe_start():
  o  If number of free TX desc is less then 2, set IFF_OACTIVE and leave
  o  Pass reference of mbuf pointer into bfe_encap(), since the passed in
     mbuf may be defragmented, i.e. changed.
- In bfe_encap():
  o  Assert that caller has make certain there is at least 2 free TX descs.
  o  Before setting up TX descs, count number of mbufs in the mbuf chain,
     and do defragmentation if there are not enough free TX descs.
  o  After above changes, number of free TX descs will never be less than 2
     when setting up TX descs; assert that.
  o  mbuf chain is always drained after setting up TX descs, nuke the goofy
     if (m != NULL)

Obtained-from: FreeBSD (w/ modification)
Tested-by: Jörg Anslik <joerg@anslik.de>
Approved-by: dillon@
sys/dev/netif/bfe/if_bfe.c