fcoeio
fcoeio_t fcoeio;
(void) memset(&fcoeio, 0, sizeof (fcoeio));
fcoeio.fcoeio_cmd = FCOEIO_CREATE_FCOE_PORT;
fcoeio.fcoeio_ilen = sizeof (param);
fcoeio.fcoeio_xfer = FCOEIO_XFER_WRITE;
fcoeio.fcoeio_ibuf = (uintptr_t)¶m;
if (ioctl(fcoe_fd, FCOEIO_CMD, &fcoeio) != 0) {
switch (fcoeio.fcoeio_status) {
fcoeio_t fcoeio;
(void) memset(&fcoeio, 0, sizeof (fcoeio));
fcoeio.fcoeio_cmd = FCOEIO_DELETE_FCOE_PORT;
fcoeio.fcoeio_ilen = sizeof (fcoeio_delete_port_param_t);
fcoeio.fcoeio_olen = sizeof (uint64_t);
fcoeio.fcoeio_xfer = FCOEIO_XFER_RW;
fcoeio.fcoeio_ibuf = (uintptr_t)&fc_del_port;
fcoeio.fcoeio_obuf = (uintptr_t)&is_target;
io_ret = ioctl(fcoe_fd, FCOEIO_CMD, &fcoeio);
switch (fcoeio.fcoeio_status) {
fcoeio_t fcoeio;
(void) memset(&fcoeio, 0, sizeof (fcoeio));
fcoeio.fcoeio_cmd = FCOEIO_GET_FCOE_PORT_LIST;
fcoeio.fcoeio_olen = bufsize;
fcoeio.fcoeio_xfer = FCOEIO_XFER_READ;
fcoeio.fcoeio_obuf = (uintptr_t)inportlist;
if (ioctl(fcoe_fd, FCOEIO_CMD, &fcoeio) != 0) {
if (fcoeio.fcoeio_status == FCOEIOE_MORE_DATA) {
switch (fcoeio.fcoeio_status) {
static int fcoe_copyin_iocdata(intptr_t data, int mode, fcoeio_t **fcoeio,
static int fcoe_copyout_iocdata(intptr_t data, int mode, fcoeio_t *fcoeio,
fcoe_copyin_iocdata(intptr_t data, int mode, fcoeio_t **fcoeio,
*fcoeio = kmem_zalloc(sizeof (fcoeio_t), KM_SLEEP);
if (ddi_copyin((void *)data, *fcoeio, sizeof (fcoeio_t), mode) != 0) {
if ((*fcoeio)->fcoeio_ilen > FCOEIO_MAX_BUF_LEN ||
(*fcoeio)->fcoeio_alen > FCOEIO_MAX_BUF_LEN ||
(*fcoeio)->fcoeio_olen > FCOEIO_MAX_BUF_LEN) {
if ((*fcoeio)->fcoeio_ilen) {
*ibuf = kmem_zalloc((*fcoeio)->fcoeio_ilen, KM_SLEEP);
if (ddi_copyin((void *)(unsigned long)(*fcoeio)->fcoeio_ibuf,
*ibuf, (*fcoeio)->fcoeio_ilen, mode) != 0) {
if ((*fcoeio)->fcoeio_alen) {
*abuf = kmem_zalloc((*fcoeio)->fcoeio_alen, KM_SLEEP);
if (ddi_copyin((void *)(unsigned long)(*fcoeio)->fcoeio_abuf,
*abuf, (*fcoeio)->fcoeio_alen, mode) != 0) {
if ((*fcoeio)->fcoeio_olen) {
*obuf = kmem_zalloc((*fcoeio)->fcoeio_olen, KM_SLEEP);
kmem_free(*abuf, (*fcoeio)->fcoeio_alen);
kmem_free(*ibuf, (*fcoeio)->fcoeio_ilen);
kmem_free(*fcoeio, sizeof (fcoeio_t));
fcoe_copyout_iocdata(intptr_t data, int mode, fcoeio_t *fcoeio, void *obuf)
if (fcoeio->fcoeio_olen) {
(void *)(unsigned long)fcoeio->fcoeio_obuf,
fcoeio->fcoeio_olen, mode) != 0) {
if (ddi_copyout(fcoeio, (void *)data, sizeof (fcoeio_t), mode) != 0) {
fcoeio_t *fcoeio;
ret = fcoe_copyin_iocdata(data, mode, &fcoeio, &ibuf, &abuf, &obuf);
fcoeio->fcoeio_status = FCOEIOE_BUSY;
fcoeio->fcoeio_status = 0;
switch (fcoeio->fcoeio_cmd) {
if (fcoeio->fcoeio_ilen !=
fcoeio->fcoeio_xfer != FCOEIO_XFER_WRITE) {
fcoeio->fcoeio_status = FCOEIOE_INVAL_ARG;
fcoeio->fcoeio_status = FCOEIOE_CREATE_MAC;
fcoeio->fcoeio_status = FCOEIOE_ALREADY;
&fcoeio->fcoeio_status);
if (fcoeio->fcoeio_status == 0) {
fcoeio->fcoeio_status =
fcoeio->fcoeio_status = FCOEIOE_PWWN_CONFLICTED;
fcoeio->fcoeio_status = FCOEIOE_NWWN_CONFLICTED;
fcoeio->fcoeio_status = FCOEIOE_CREATE_PORT;
if (fcoeio->fcoeio_ilen < sizeof (fcoeio_delete_port_param_t) ||
fcoeio->fcoeio_olen != sizeof (uint64_t) ||
fcoeio->fcoeio_xfer != FCOEIO_XFER_RW) {
fcoeio->fcoeio_status = FCOEIOE_INVAL_ARG;
ret = fcoe_delete_port(ss->ss_dip, fcoeio,
if (fcoeio->fcoeio_xfer != FCOEIO_XFER_READ ||
fcoeio->fcoeio_olen < sizeof (fcoe_port_list_t)) {
fcoeio->fcoeio_status = FCOEIOE_INVAL_ARG;
list->numPorts = 1 + (fcoeio->fcoeio_olen -
fcoeio->fcoeio_status = FCOEIOE_MORE_DATA;
fcoeio->fcoeio_cmd, ret, fcoeio->fcoeio_status);
ret = fcoe_copyout_iocdata(data, mode, fcoeio, obuf);
} else if (fcoeio->fcoeio_status) {
(void) fcoe_copyout_iocdata(data, mode, fcoeio, obuf);
kmem_free(obuf, fcoeio->fcoeio_olen);
kmem_free(abuf, fcoeio->fcoeio_alen);
kmem_free(ibuf, fcoeio->fcoeio_ilen);
kmem_free(fcoeio, sizeof (fcoeio_t));
fcoe_delete_port(dev_info_t *parent, fcoeio_t *fcoeio, datalink_id_t linkid,
fcoeio->fcoeio_status = FCOEIOE_MAC_NOT_FOUND;
fcoeio->fcoeio_status = FCOEIOE_ALREADY;
fcoeio->fcoeio_status = FCOEIOE_OFFLINE_FAILURE;