Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP DLPI Programmer's Guide: HP-UX 11i v2 > Chapter 3 DLPI Input/Output Controls

ioctl Processing

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

User space applications can send an ioctl command after obtaining a valid file descriptor and attaching itself to a specific PPA with which it needs to communicate. To send an ioctl command, you can use the I_STR ioctl.

You can create the I_STR ioctl by passing the following to the ioctl()(2) system call:

  • I_STR as the second parameter

  • Address to a strioctl structure as the third parameter

The strioctl structure contains the following members:

struct strioctl {
int ic_cmd;
int ic_timout;
int ic_len;
char *ic_dp;
};

The description of the members of the strioctl structure is as follows:

ic_cmd

  • Command to be sent downstream

ic_timout

  • Timeout period for positive acknowledgement (ACK) or negative acknowledgement (NAK)

ic_len

  • Length of the data that is passed

ic_dp

  • Pointer to the data that is passed

The I_STR ioctl causes the stream head to create an M_IOCTL message that includes the associated information (passed in ic_dp) required by DLPI or the device driver to process the command (passed in ic_cmd). The associated information is passed as the second message block following the M_IOCTL message block.

All the ioctl commands with an I_STR request are passed to the driver instance and DLPI through the ioc_cmd field (present in iocblk structure).

The STREAMS kernel modules that reside on top of DLPI (transport layer) can generate ioctl by constructing an M_IOCTL message block that contains the iocblk structure.

NOTE: The ioc_cmd field of the iocblk structure is set to appropriate command supported by device driver or DLPI.

The b_cont of the M_IOCTL message block can point to the associated information required by the driver or DLPI.

For more information, see STREAMS/UX for the HP 9000 Reference Manual.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2007 Hewlett-Packard Development Company, L.P.