Ciprico Rimfire 3880 Network Card User Manual


 
User’s Guide 21020285 D
Chapter 4 Command Operation
Example ‘C’ Routines for Command List Page 4 - 25
{ /* First: check to see if the list is full */
if ( (clistpbin +1) % NPB == clistpbout)
{
/* If the list is full, then handle_full_list */
/* This may be a function call that waits for an open entry or you could
choose to return an error. */
if (!handle_full_list(pb,clist))
return;}
/* Second: put the Parameter Block into the next available location in the list
*/
clistpblist[clistpbin] = pb;
/* Third: increment the Parameter Block IN index */
clistpbin = (clistpbin + 1) % NPB;
/* Next issue a Command List Channel Attention */
/* This is a separate function called to issue a
Command List Channel Attention. */
issue_cl_channel_atn();
} /* put_parameter_block */
/
*________________________________________________________________
* get_status_block - Read a Status Block returned in the Command List
*_______________________________________________________________*
/
status_block get_status_block(clist)
command_list *clist;
(
status_block tsb;
/* First: check to see if a Status Block is available */
if (clistsbout == clistsbin)
{
/* If the list is empty there are no blocks to read. Check the adapter
* Status Port for any error conditions, and return.
*/
/*This routine could check the Status Port for 11H error code
(no active command list.) */
handle_empty_sb_list(clist);
return(EMPTY);
}
/* Second: read the Status Block into a temporary value so that it can be
returned at the end of the function.
*/
tsb = clistsblist[clistsbout];
/* Third: increment the Status Block OUT index. */
clistsbout = (clistsbout + 1) % NSB;
/* Next: return with the Status Block. */
return (tsb);
} /* get_status_block