- Factor out xl_dma_alloc() from xl_attach()
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 27 Sep 2005 02:41:29 +0000 (02:41 +0000)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 27 Sep 2005 02:41:29 +0000 (02:41 +0000)
commit5001d43632029a11f0ff7915c2f7bde66977b412
tree10688ad09857463bb6b19bb2d49d365992e562d2
parent38145d9ab9728feca5d26b4cf3c33038a6ca52be
- Factor out xl_dma_alloc() from xl_attach()
- Factor out xl_dma_free() from xl_detach()
- Allocate and deallocate RX/TX descriptor DMA map during device's attaching
  and detaching (i.e. in xl_dma_{alloc, free}()), instead of in xl_stop() and
  xl_list_{rx, tx}_init*().  This brings us:
  1) xl_init()'s failure chance is reduced
  2) In the original code, xl_stop() would destroy TX descriptor DMA map if
     xl_chain.xl_mbuf != NULL, but normally TX descriptor's xl_chain.xl_mbuf
     *is* NULL.  So "ifconfig xl0 down; ifconfig xl0 up" or xl_detach()
     promised TX descriptor DMA map leakage, which is fixed now
- After the above change, xl_list_tx_init*() will not fail, so do not return
  `int' from them.  Adjust their caller accordingly
- Add comment for xl_chain.xl_prev
- Minor style changes
sys/dev/netif/xl/if_xl.c
sys/dev/netif/xl/if_xlreg.h