4.2  WindNet STREAMS Services Accessible from Interrupt Context

In a real-time environment where interrupt lock-out time should be kept to the smallest duration possible, it is important for driver interrupt handlers to defer interrupt processing to background tasks. Given this constraint, drivers that require interrupt access to WindNet STREAMS routines are allowed to schedule the execution of STREAMS routines only to a background task. The STREAMS routines themselves handle this internally. These routines are listed below:

qenable( )
Schedules a STREAMS queue service procedure specified by the queue that has been passed to qenable( ).

One typical use of this routine by a hardware driver is illustrated by the driver's receive interrupt handler. The interrupt handler issues the necessary commands to the hardware device and defers non-critical processing to a background task by invoking qenable( ). In this case, the queue read service procedure for the STREAMS device driver can be used to finish the processing of the hardware interrupt, and to pass the received packet upstream. For more information, see the manual entry for qenable( ).

putq( )
Schedules a STREAMS queue service procedure and places a message in the queue. For hardware drivers that can receive data and put it into STREAMS buffers directly, this routine offers the capability of queuing a message for the STREAMS driver and deferring the interrupt processing to the queue service procedure. The typical usage provided for qenable( ) is applicable to putq( ). For more information, see the manual entry for putq( ).

freeb( )
Returns a STREAMS buffer to the free pool. One typical use of freeb( ) by a hardware driver is illustrated by the driver's transmit interrupt handler. The interrupt handler invokes freeb( ) each time a STREAMS buffer of data is transmitted to the network. For more information, see the manual entry for freeb( ).