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