Lines Matching defs:fcoeio

90 #include <sys/fcoe/fcoeio.h>
111 static int fcoe_copyin_iocdata(intptr_t data, int mode, fcoeio_t **fcoeio,
113 static int fcoe_copyout_iocdata(intptr_t data, int mode, fcoeio_t *fcoeio,
562 fcoe_copyin_iocdata(intptr_t data, int mode, fcoeio_t **fcoeio,
570 *fcoeio = kmem_zalloc(sizeof (fcoeio_t), KM_SLEEP);
571 if (ddi_copyin((void *)data, *fcoeio, sizeof (fcoeio_t), mode) != 0) {
576 if ((*fcoeio)->fcoeio_ilen > FCOEIO_MAX_BUF_LEN ||
577 (*fcoeio)->fcoeio_alen > FCOEIO_MAX_BUF_LEN ||
578 (*fcoeio)->fcoeio_olen > FCOEIO_MAX_BUF_LEN) {
583 if ((*fcoeio)->fcoeio_ilen) {
584 *ibuf = kmem_zalloc((*fcoeio)->fcoeio_ilen, KM_SLEEP);
585 if (ddi_copyin((void *)(unsigned long)(*fcoeio)->fcoeio_ibuf,
586 *ibuf, (*fcoeio)->fcoeio_ilen, mode) != 0) {
592 if ((*fcoeio)->fcoeio_alen) {
593 *abuf = kmem_zalloc((*fcoeio)->fcoeio_alen, KM_SLEEP);
594 if (ddi_copyin((void *)(unsigned long)(*fcoeio)->fcoeio_abuf,
595 *abuf, (*fcoeio)->fcoeio_alen, mode) != 0) {
601 if ((*fcoeio)->fcoeio_olen) {
602 *obuf = kmem_zalloc((*fcoeio)->fcoeio_olen, KM_SLEEP);
608 kmem_free(*abuf, (*fcoeio)->fcoeio_alen);
613 kmem_free(*ibuf, (*fcoeio)->fcoeio_ilen);
617 kmem_free(*fcoeio, sizeof (fcoeio_t));
622 fcoe_copyout_iocdata(intptr_t data, int mode, fcoeio_t *fcoeio, void *obuf)
624 if (fcoeio->fcoeio_olen) {
626 (void *)(unsigned long)fcoeio->fcoeio_obuf,
627 fcoeio->fcoeio_olen, mode) != 0) {
632 if (ddi_copyout(fcoeio, (void *)data, sizeof (fcoeio_t), mode) != 0) {
646 fcoeio_t *fcoeio;
648 ret = fcoe_copyin_iocdata(data, mode, &fcoeio, &ibuf, &abuf, &obuf);
661 fcoeio->fcoeio_status = FCOEIOE_BUSY;
669 fcoeio->fcoeio_status = 0;
671 switch (fcoeio->fcoeio_cmd) {
678 if (fcoeio->fcoeio_ilen !=
680 fcoeio->fcoeio_xfer != FCOEIO_XFER_WRITE) {
681 fcoeio->fcoeio_status = FCOEIOE_INVAL_ARG;
690 fcoeio->fcoeio_status = FCOEIOE_CREATE_MAC;
697 fcoeio->fcoeio_status = FCOEIOE_ALREADY;
702 &fcoeio->fcoeio_status);
706 if (fcoeio->fcoeio_status == 0) {
707 fcoeio->fcoeio_status =
739 fcoeio->fcoeio_status = FCOEIOE_PWWN_CONFLICTED;
741 fcoeio->fcoeio_status = FCOEIOE_NWWN_CONFLICTED;
759 fcoeio->fcoeio_status = FCOEIOE_CREATE_PORT;
773 if (fcoeio->fcoeio_ilen < sizeof (fcoeio_delete_port_param_t) ||
774 fcoeio->fcoeio_olen != sizeof (uint64_t) ||
775 fcoeio->fcoeio_xfer != FCOEIO_XFER_RW) {
776 fcoeio->fcoeio_status = FCOEIOE_INVAL_ARG;
782 ret = fcoe_delete_port(ss->ss_dip, fcoeio,
794 if (fcoeio->fcoeio_xfer != FCOEIO_XFER_READ ||
795 fcoeio->fcoeio_olen < sizeof (fcoe_port_list_t)) {
796 fcoeio->fcoeio_status = FCOEIOE_INVAL_ARG;
802 list->numPorts = 1 + (fcoeio->fcoeio_olen -
808 fcoeio->fcoeio_status = FCOEIOE_MORE_DATA;
823 fcoeio->fcoeio_cmd, ret, fcoeio->fcoeio_status);
827 ret = fcoe_copyout_iocdata(data, mode, fcoeio, obuf);
828 } else if (fcoeio->fcoeio_status) {
829 (void) fcoe_copyout_iocdata(data, mode, fcoeio, obuf);
833 kmem_free(obuf, fcoeio->fcoeio_olen);
837 kmem_free(abuf, fcoeio->fcoeio_alen);
842 kmem_free(ibuf, fcoeio->fcoeio_ilen);
845 kmem_free(fcoeio, sizeof (fcoeio_t));