#ifndef _FCOEIO_H_
#define _FCOEIO_H_
#include <sys/ethernet.h>
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
#define FCOEIO_CMD ('G'<< 8 | 2009)
#define FCOEIO_SUB_CMD ('X' << 8)
#define FCOEIO_CREATE_FCOE_PORT (FCOEIO_SUB_CMD + 0x01)
#define FCOEIO_DELETE_FCOE_PORT (FCOEIO_SUB_CMD + 0x02)
#define FCOEIO_GET_FCOE_PORT_LIST (FCOEIO_SUB_CMD + 0x03)
#define FCOE_MAX_MAC_NAME_LEN 32
#define FCOEIO_XFER_NONE 0x00
#define FCOEIO_XFER_READ 0x01
#define FCOEIO_XFER_WRITE 0x02
#define FCOEIO_XFER_RW (FCOEIO_XFER_READ | FCOEIO_XFER_WRITE)
typedef enum {
FCOEIOE_INVAL_ARG = 5,
FCOEIOE_BUSY,
FCOEIOE_ALREADY,
FCOEIOE_PWWN_CONFLICTED,
FCOEIOE_NWWN_CONFLICTED,
FCOEIOE_CREATE_MAC,
FCOEIOE_OPEN_MAC,
FCOEIOE_CREATE_PORT,
FCOEIOE_NEED_JUMBO_FRAME,
FCOEIOE_MAC_NOT_FOUND,
FCOEIOE_OFFLINE_FAILURE,
FCOEIOE_MORE_DATA
} fcoeio_stat_t;
#define FCOEIO_MAX_BUF_LEN 0x10000
typedef struct fcoeio {
uint16_t fcoeio_xfer;
uint16_t fcoeio_cmd;
uint16_t fcoeio_flags;
uint16_t fcoeio_cmd_flags;
uint32_t fcoeio_ilen;
uint32_t fcoeio_olen;
uint32_t fcoeio_alen;
fcoeio_stat_t fcoeio_status;
uint64_t fcoeio_ibuf;
uint64_t fcoeio_obuf;
uint64_t fcoeio_abuf;
} fcoeio_t;
typedef enum {
FCOE_CLIENT_INITIATOR = 0,
FCOE_CLIENT_TARGET
} fcoe_cli_type_t;
#define FCOE_WWN_SIZE 8
typedef struct fcoeio_create_port_param {
uchar_t fcp_pwwn[FCOE_WWN_SIZE];
uchar_t fcp_nwwn[FCOE_WWN_SIZE];
uint32_t fcp_nwwn_provided;
uint32_t fcp_pwwn_provided;
uint32_t fcp_force_promisc;
fcoe_cli_type_t fcp_port_type;
datalink_id_t fcp_mac_linkid;
uint32_t fcp_rsvd0;
} fcoeio_create_port_param_t;
typedef struct fcoeio_delete_port_param {
datalink_id_t fdp_mac_linkid;
uint32_t fdp_rsvd0;
} fcoeio_delete_port_param_t;
typedef struct fcoe_port_instance {
uchar_t fpi_pwwn[FCOE_WWN_SIZE];
datalink_id_t fpi_mac_linkid;
uint32_t fpi_rsvd0;
uint8_t fpi_mac_factory_addr[ETHERADDRL];
uint16_t fpi_mac_promisc;
uint8_t fpi_mac_current_addr[ETHERADDRL];
uint16_t fpi_rsvd1;
fcoe_cli_type_t fpi_port_type;
uint32_t fpi_mtu_size;
} fcoe_port_instance_t;
typedef struct fcoe_port_list {
uint64_t numPorts;
fcoe_port_instance_t ports[1];
} fcoe_port_list_t;
#ifdef __cplusplus
}
#endif
#endif