ns_add_status Network Service
Purpose
Adds a status filter for the routing of asynchronous status.
Syntax
#include <sys/cdli.h>
#include <sys/ndd.h>
int ns_add_status (nddp, statfilter, len, ns_statuser)
struct ndd * nddp;
caddr_t statfilter;
int len;
struct ns_statuser * ns_statuser;
struct ndd * nddp;
caddr_t statfilter;
int len;
struct ns_statuser * ns_statuser;
Parameters
Item | Description |
---|---|
nddp | Specifies a pointer to the ndd structure to which this add request applies. |
statfilter | Specifies a pointer to the status filter. |
len | Specifies the length, in bytes, of the value of the statfilter parameter. |
ns_statuser | Specifies a pointer to an ns_statuser structure that defines this user. |
Description
The ns_add_status network service registers a status filter. The add request is passed on to the nd_add_status function of the demuxer for the specified network device driver (NDD). This network service enables the user to receive asynchronous status information from the specified device.
Note: The user's status processing
function is specified by the isr field of the ns_statuser structure.
The network demuxer calls the user's status processing function directly
when asynchronous status information becomes available. Consequently;
the status processing function cannot be a scheduled routine. The
caller of the ns_add_status network service is responsible
for relinquishing status filters before calling the ns_free network
service.
Examples
The following example illustrates the ns_add_status network service:
struct ns_statuser user;
struct ns_com_status filter;
filter.filtertype = NS_STATUS_MASK;
filter.mask = NDD_HARD_FAIL;
filter.sid = 0;
user.isr = status_fn;
user.isr_data = whatever_makes_sense;
error = ns_add_status(nddp, &filter, sizeof(filter), &user);
Return Values
Item | Description |
---|---|
0 | Indicates the operation was successful. |
The network demuxer may supply other return values.