Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

miocack(9f) [sunos man page]

miocack(9F)						   Kernel Functions for Drivers 					       miocack(9F)

NAME
miocack - Positively acknowledge an M_IOCTL message SYNOPSIS
#include <sys/stream.h> #include <sys/strsun.h> void miocack(queue_t *wq, mblk_t *mp, intcount, int rval); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
wq Write queue associated with the read queue to send the M_IOCACK on. mp M_IOCTL message. count Value to set the ioc_count of the iocblk(9S) to. rval Value to set the ioc_rval of the iocblk(9S) to. DESCRIPTION
The miocack() function converts an M_IOCTL message into a M_IOCACK message and sends the resulting message upstream. To convert the message, miocack() changes the message type to M_IOCACK, sets the 'ioc_count' and 'ioc_rval' members of the iocblk(9S) asso- ciated with mp to the passed-in values, and clears the 'ioc_error' field. If the caller specifies a non-zero value for count, it is expected that the caller has already set 'mp->b_cont' field to point to a message block with a length of at least count bytes. Callers that only need to perform the message conversion, or need to perform additional steps between the conversion and the sending of the M_IOCACK should use mioc2ack(9F). RETURN VALUES
None. CONTEXT
This function can be called from user, kernel or interrupt context. NOTES
Callers must not hold any locks across a miocack() that can be acquired as part of put(9E) processing. SEE ALSO
mioc2ack(9F), put(9E), iocblk(9S) STREAMS Programming Guide SunOS 5.10 9 June 2004 miocack(9F)

Check Out this Related Man Page

put(9E) 							Driver Entry Points							   put(9E)

NAME
put - receive messages from the preceding queue SYNOPSIS
#include <sys/types.h> #include <sys/stream.h> #include <sys/stropts.h> #include <sys/ddi.h> #include <sys/sunddi.h> int prefixrput(queue_t *q, mblk_t *mp); /* read side */ int prefixwput(queue_t *q, mblk_t *mp); /* write side */ INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI). This entry point is required for STREAMS. ARGUMENTS
q Pointer to the queue(9S) structure. mp Pointer to the message block. DESCRIPTION
The primary task of the put() routine is to coordinate the passing of messages from one queue to the next in a stream. The put() routine is called by the preceding stream component (stream module, driver, or stream head). put() routines are designated ``write'' or ``read'' depending on the direction of message flow. With few exceptions, a streams module or driver must have a put() routine. One exception is the read side of a driver, which does not need a put() routine because there is no component downstream to call it. The put() routine is always called before the component's correspond- ing srv(9E) (service) routine, and so put() should be used for the immediate processing of messages. A put() routine must do at least one of the following when it receives a message: o pass the message to the next component on the stream by calling the putnext(9F) function; o process the message, if immediate processing is required (for example, to handle high priority messages); or o enqueue the message (with the putq(9F) function) for deferred processing by the service srv(9E) routine. Typically, a put() routine will switch on message type, which is contained in the db_type member of the datab structure pointed to by mp. The action taken by the put() routine depends on the message type. For example, a put() routine might process high priority messages, enqueue normal messages, and handle an unrecognized M_IOCTL message by changing its type to M_IOCNAK (negative acknowledgement) and sending it back to the stream head using the qreply(9F) function. The putq(9F) function can be used as a module's put() routine when no special processing is required and all messages are to be enqueued for the srv(9E) routine. RETURN VALUES
Ignored. CONTEXT
put() routines do not have user context. SEE ALSO
srv(9E), putctl(9F), putctl1(9F), putnext(9F), putnextctl(9F), putnextctl1(9F), putq(9F), qreply(9F), queue(9S), streamtab(9S) Writing Device Drivers STREAMS Programming Guide SunOS 5.10 12 Nov 1992 put(9E)
Man Page