% sudo python2 /usr/src/tools/bus_space/examples/am79c900_diag.py
INFO:root:ethernet address = 00:0c:29:d9:ef:0d
DEBUG:root:DMA memory: size = 0x8000 (TX buffers: 4, RX buffers: 16)
DEBUG:root:DMA memory: CPU address: 0x8013cc000, device address: 0x133f6000
DEBUG:root:Waiting for initialization to complete
INFO:root:DHCP discovery packet sent
DEBUG:root:Waiting 2 seconds for an offer to be received
DEBUG:root:RX #0: broadcast packet: length 66
DEBUG:root:RX #1: broadcast packet: length 64
DEBUG:root:RX 2: packet from 00:50:56:e8:00:8e!
INFO:root:Our IP address = 172.16.188.134
DEBUG:root:RX #3: broadcast packet: length 64
DEBUG:root:RX #4: broadcast packet: length 64
This looks ok to me modulo the one lingering WAITOK allocation under the busdma mutex. I don't see any reason not to use an sx lock for that though, in which case you could avoid the refactoring needed to do preallocation.
This is a WAITOK allocation unless you explicitly specify BUS_DMA_NOWAIT.