|
|
A driver should not attempt to access any devices other than those controlled by the driver itself.
#define SPIN_IN_MICROSECS 10000 /* .01 seconds */ODDI drivers should use the suspend(D3oddi) function in this case.<driver writes to memory-mapped register or calls outb(D3), etc.>
/* give register/device time to catch up */
drv_usecwait (SPIN_IN_MICROSECS);
<check register or continue with multipart programming of device>
If the driver needs to busy-spin a longer period, use a timeout (see ``Timeouts'') or release processor control and block. Delays and busy-waits can increase the preemption latency that is experienced by high-priority processes. This is especially important in a realtime environment, where short and bounded preemption latency can be critical.
Drivers that use MDI 2 and later versions can use the mdi_open_file(D3mdi), mdi_close_file(D3mdi), and, for MDI 2.1 and later, mdi_read_file(D3mdi) to download code to the adapter.
MDI version 2 drivers can use the mdi_open_file(D3mdi) and mdi_close_file(D3mdi) functions to download code to the hardware. MDI version 2.1 adds the mdi_read_file(D3mdi) function that allows larger amounts of data to be downloaded.