cvs commit: src/sys/dev/netif/xl if_xl.c if_xlreg.h
Sepherosa Ziehau
sephe at crater.dragonflybsd.org
Mon Sep 26 19:45:31 PDT 2005
sephe 2005/09/26 19:41:29 PDT
DragonFly src repository
Modified files:
sys/dev/netif/xl if_xl.c if_xlreg.h
Log:
- 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
Revision Changes Path
1.35 +209 -151 src/sys/dev/netif/xl/if_xl.c
1.8 +1 -1 src/sys/dev/netif/xl/if_xlreg.h
http://www.dragonflybsd.org/cvsweb/src/sys/dev/netif/xl/if_xl.c.diff?r1=1.34&r2=1.35&f=u
http://www.dragonflybsd.org/cvsweb/src/sys/dev/netif/xl/if_xlreg.h.diff?r1=1.7&r2=1.8&f=u
More information about the Commits
mailing list