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

Supported ioctls

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

DLPI supports the following ioctls:

  • DL_IOC_DRIVER_OPTIONS

  • DL_IOC_HDR_INFO

  • DL_HP_SET_DRV_PARAM_IOCTL

  • DL_HP_GET_DRV_PARAM_IOCTL

  • DLPI_SET_NOLOOPBACK

For all ioctls, either an M_IOCACK or M_IOCNACK message is sent to the DLS user, and if an error occurs, the ioc_error field is set.

DL_IOC_DRIVER_OPTIONS

DL_IOC_DRIVER_OPTIONS negotiates the options between DLPI and a DLS user. In other words, this ioctl negotiates the features with an instance of the driver.

NOTE: This ioctl is valid for in-kernel STREAMS DLPI users only.

DLS user sets the feature bits about which it wants to enquire. DLPI compares the DLS user’s feature with the driver’s feature and its own internal capability. After the comparison, DLPI clears the bits in driver_ops_type (defined later in this section) that are not supported or not understood by DLPI or driver.

The DLS user that negotiates the driver features and header template must also request for link event notifications using the DL_HP_NOTIFY_EVENT_REQ primitive (see “DL_HP_NOTIFY_EVENT_REQ”).

Format

typedef struct {
uint32_t driver_ops_type;
uint32_t driver_ops_type_1;
uint32_t driver_ops_type_2;
} driver_ops_t;

Parameters

driver_ops_type

  • Features supported by XPORT. The features are bit wise flags. The values are defined in Table 3-1 “DLS User Feature Bits”.

    Table 3-1 DLS User Feature Bits

    Constant

    ValueDescription

    DRIVER_CKO_IN

    0x00000001

    DLPI user inquires if the driver supports inbound IPv4/IPv6 CKO. DLPI differentiates between IPv4 and IPv6.

    DRIVER_CKO_OUT

    0x00000002DLPI user inquires if the driver supports outbound IPv4/IPv6 CKO. DLPI differentiates between IPv4 and IPv6.

    DRIVER_CKO_OUT_DF

    0x00000004

    DLPI user inquires if the driver does not support CKO for multifragmented packets.
    DRIVER_COW0x00000008Not supported.

    DRIVER_LFP

    0x00000010

    Not supported.

    DRIVER_LNP

    0x00000020

    Not supported.

    DRIVER_PRI

    0x00000040Reserved for future use.

    DRIVER_TRAIN

    0x00000080

    DLPI user inquires if the driver supports packet trains.

    DRIVER_LLC

    0x00000100Reserved for future use.

    DRIVER_FASTPATH_IN

    0x00000200

    DLPI user inquires if the driver supports inbound fastpath.

     

driver_ops_type_1

  • This parameter is reserved. You must set this value to 0 (zero).

driver_ops_type_2

  • This parameter is reserved. You must set this value to 0 (zero).

State

The message is valid in DL_IDLE or DL_UNBOUND. If the message is not in either of these states, DLPI returns ioc_error as EBUSY.

New State

The resulting state is unchanged.

Response

If the driver does not support any of the options supported by the transport layer, EOPNOTSUPP is returned.If the associated information is invalid, EINVAL is returned.

DL_IOC_HDR_INFO

DL_IOC_HDR_INFO permits the transport layer (like TCP/IP) to request a Link Layer header template from DLPI on a per-stream basis, thus avoiding the construction of header every time.

NOTE: This ioctl is valid for in-kernel STREAMS DLPI users only.

The header template enables transport layer to add the Link Layer header before sending the packet to DLPI.

After receiving the DL_IOC_HDR_INFO ioctl, DLPI constructs the MAC+LLC header template with Out-Of-Packet (OOP) data template. The OOP data template can be used by transport layer to communicate additional information to DLPI or the driver.

In response to DL_IOC_HDR_INFO, DLPI returns the OOP header and the Link Layer header template. The mblk containing the MAC/LLC and OOP header is the last (third) mblk in the M_IOCACK response.

The DLS user must renegotiate the feature and request DLPI to build a new header template when it receives a DL_LINK_UP_IND event (see “DL_LINK_UP_IND”) from DLPI, because the link state changes may be due to the driver feature changes. These changes can impact the header template.

NOTE: The stream must register for receiving link event notifications. In addition, the stream must rebuild the MAC/LLC header templates on every LINKUP events.

The M_IOCTL message block that contains DL_IOC_HDR_INFO is followed by one M_PROTO message block containing the following structure.

Format

typedef struct {
ulong dl_primitive;
ulong dl_dest_addr_length;
ulong dl_dest_addr_offset;
dl_priority_t  dl_priority;
} dl_unitdata_req_t;

Parameters

dl_primitive

  • DL_UNITDATA_REQ

dl_dest_addr_length

  • Length of the Data Link Service Access Point (DLSAP) address of the destination DLS user. If the destination user is implemented using DLPI, this address is the full DLSAP address returned on the DL_BIND_ACK primitive.

dl_dest_addr_offset

  • Offset from the beginning of the M_PROTO message block where the destination DLSAP address begins.

dl_priority

  • Priority value within the supported range for the specified data link service data unit (DLSDU).

    DLPI does not support priority messages. Therefore, this value must be set to 0 (zero).

State

The message is valid in DL_IDLE or DL_UNBOUND state. If the stream is not in either of these states, ioc_error is set to EBUSY.

New State

The resulting state is unchanged.

Response

If the driver does not support fast path, EINVAL is returned.If the dl_unitdata_req_t structure in the b_cont of the ioctl is invalid (if b_cont is NULL), EINVAL is returned.

DL_HP_SET_DRV_PARAM_IOCTL

DL_HP_SET_DRV_PARAM_IOCTL is a DLPI defined transparent ioctl. You can use it to set the driver parameters.

This ioctl provides an interface to set Speed, Duplex mode, autoneg/auto sense, and Maximum Transmission Unit (MTU). In addition, you can use it to reset MTU of an interface.

Before using DL_HP_SET_DRV_PARAM_IOCTL, please note the following points:

  • DLPI does not interpret the request of this ioctl. The request must be used between the driver’s user space application and the driver.

  • The driver user space application can request DLPI to serialize this request by setting the DL_HP_SERIALIZE bit in the dl_request element, if another DL_HP_SET_DRV_PARAM_IOCTL on the same interface is in progress.

  • The drivers can define their own dl_request by using other bits that are not defined by DLPI.

  • If the ioctl fails, DLPI frees the b_cont mblk_t that contains the data associated with the ioctl.

Format

typededef struct dl_hp_set_drv_param_ioctl {
dl_hp_drv_param_req_type_t dl_request;
uint32_t dl_speed;
dl_hp_duplex_mode_t dl_duplex;
dl_hp_autoneg_sense_t dl_autoneg;
uint32_t dl_mtu;
uint64_t dl_value1;
uint64_t dl_value2;
uint64_t dl_value3;
uint32_t dl_reserved1[2];
uint32_t dl_reserved2[2];
} dl_hp_set_drv_param_ioctl_t;

Parameters

dl_request

Table 3-2 dl_hp_drv_param_req_type_t Enumeration

Constant

Value

Description

DL_HP_DRV_SPEED

0x1

dl_speed value is valid.

DL_HP_DRV_DUPLEX

0x2

dl_duplex value is valid.

DL_HP_DRV_AUTONEG

0x4

dl_autoneg value is valid.

DL_HP_DRV_MTU

0x8

dl_mtu value is valid.

DL_HP_DRV_RESET_MTU

0x10

Resets the MTU.

DL_HP_VALUE1

0x20

dl_value1 is valid.

DL_HP_VALUE2

0x40

dl_value2 is valid.

DL_HP_VALUE3

0x80

dl_value3 is valid.

DL_HP_RESERVED1

0x100

dl_reserved1[0] is valid.

DL_HP_RESERVED20x200

dl_reserved1[1] is valid.

DL_HP_RESERVED3

0x400

DL_HP_RESERVED3 is reserved by DLPI.

DL_HP_RESERVED4

0x800

DL_HP_RESERVED4 is reserved by DLPI.

DL_HP_SERIALIZE

0x40000000

Requests DLPI to serialize the request.

 

dl_speed

  • Speed of the underlying link in Mbits/sec.

dl_duplex

Table 3-3 dl_hp_duplex_mode_t Enumeration

Constant

Value

DL_HP_HALF_DUPLEX

0x1

DL_HP_FULL_DUPLEX

0x2

 

dl_autoneg

Table 3-4 dl_hp_autoneg_sense_t Enumeration

Constant

Value

DL_HP_AUTONEG_SENSE_ON

0x1

DL_HP_AUTONEG_SENSE_OFF

0x2

 

dl_mtu

  • MTU of the interface.

dl_value1

  • 64 bit value for driver extension.

dl_value2

  • 64 bit value for driver extension.

dl_value3

  • 64 bit value for driver extension.

dl_reserved1 [2]

  • 32 bit value for driver extension.

dl_reserved2 [2]

  • This parameter is reserved for DLPI.

State

The message is valid in DL_IDLE or DL_UNBOUND.

New State

The resulting state is unchanged.

Response

If the ioctl is successfully processed, 0 (zero) is returned.

If the process fails, an error (see Table 2-2 “Error Return Values”) is returned.

DL_HP_GET_DRV_PARAM_IOCTL

DL_HP_GET_DRV_PARAM_IOCTL is a DLPI defined transparent ioctl that retrieves the driver parameters.

Before using DL_HP_GET_DRV_PARAM_IOCTL, please note the following points:

  • DLPI does not interpret the request of this ioctl. You must use this request between the driver’s user space application and the driver.

  • The DL_HP_SERIALIZE bit is ignored for DL_HP_GET_DRV_PARAM_IOCTL.

  • The drivers can define their own dl_request by using other bits that are not defined by DLPI.

Format

typededef struct dl_hp_get_drv_param_ioctl {
dl_hp_drv_param_req_type_t dl_request;
uint32_t dl_speed;
dl_hp_duplex_mode_t dl_duplex;
dl_hp_autoneg_sense_t dl_autoneg;
uint32_t dl_mtu;
uint64_t dl_value1;
uint64_t dl_value2;
uint64_t dl_value3;
uint32_t dl_reserved1[2];
uint32_t dl_reserved2[2];
} dl_hp_get_drv_param_ioctl_t;

Parameters

dl_request

dl_speed

  • Speed of the underlying link in Mbits/sec.

dl_duplex

dl_autoneg

dl_mtu

  • MTU of the interface (in bytes).

dl_value1

  • 64 bit value for driver extension.

dl_value2

  • 64 bit value for driver extension.

dl_value3

  • 64 bit value for driver extension.

dl_reserved1 [2]

  • 32 bit value for driver extension.

dl_reserved2 [2]

  • This parameter is reserved for DLPI.

State

The message is valid in DL_IDLE or DL_UNBOUND.

New State

The resulting state is unchanged.

Response

If the ioctl is successfully processed, 0 (zero) is returned.

If the process fails, error (see Table 2-1 “dl_hp_event_t Enumeration”) is returned.

DLPI_SET_NOLOOPBACK

The DLPI_SET_NOLOOPBACK IOCTL contains an M_IOCTL message block with ioc_cmd set to DLPI_SET_NOLOOPBACK, and the b_cont of the M_IOCTL message block contains a uint32_t value.

If uint32_t value is set to 1 (one), DLPI/driver does not loopback, multicast, and broadcast packets for this stream. If uint32_t is set to 0 (zero), the ioctl enables DLPI/driver to loopback, multicast, and broadcast packets.

State

The message is valid in all the states.

New State

The resulting state is unchanged.

Reason for Failure

If data is not provided, EINVAL is returned.

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