|
|
#include <sys/mdi.h>void mditx_interfaceMT( mditx_IFMT_t * txint, mblk_t * msg);
The service routine and interrupt routine call mditx_interfaceMT( ) with a NULL msg argument. The put( ) routine calls mditx_interface( ) with a non-NULL msg.
void
mditx_interfaceMT(mditx_IFMT_t * txint, mblk_t * msg)
{
int plev;
void * txr;
mblk_t * qmsg;
plev = lockb5(&txint->txlock);
while (txint->q->q_first
&& (txr = (*txint->get_txr)(txint->handle)) != NULL) {
qmsg = getq(txint->q);
unlockb(&txint->txlock, plev);
(*txint->process_msg)(txint->handle, txr, qmsg);
plev = lockb5(&txint->txlock);
}
if (msg != NULL) {
if (!txint->q->q_first
&& (txr = (*txint->get_txr)(txint->handle)) != NULL) {
unlockb(&txint->txlock, plev);
(*txint->process_msg)(txint->handle, txr, msg);
}
else {
unlockb(&txint->txlock, plev);
putq(txint->q, msg);
}
}
else
unlockb(&txint->txlock, plev);
return;
}