|
Finally my "Cyclades Cyclom-8Y" works correctly.
Cleanups:
- no more stupid arrays, we have softc structs, use them.
- no more global poll timeout that walks an array, timeouts are now cheap,
one poll per softc.
- sc_dev.dv_xname is the correct thing to print in diagnostic printfs.
- don't have bus-specific code in the generic attach for @#%$! sake, it
took 20 seconds to fix (I suspect that the workaround took much more
time to write).
- spltty, not splhigh.
- use pci_mapreg_map, not pci_{io,mem}_find + bus_space_map.
- use defines, not magic constants in a few places.
- KNF in a few places (much more work needed).
Now the interesting parts:
- when handling the interrupt, don't just ignore it when the tty is not
open. Read and discard the data. If we don't read it, the card will
interrupt again and again and again and ... (inspired by NetBSD).
- actually enable interrupts on PLX9050
- From FreeBSD: "Work around a PLX9050 bug that causes system lockup in
certain systems"
deraadt@ ok
|