Lines Matching refs:fcio

876 	fcio_t				*fcio = &local_fcio;
905 bzero(fcio, sizeof (fcio_t));
906 fcio->fcio_flags = dfc->flag;
907 fcio->fcio_cmd = dfc->data1;
908 fcio->fcio_cmd_flags = dfc->data2;
909 fcio->fcio_xfer = dfc->data3;
910 fcio->fcio_errno = 0; /* dfc->buf4 on return */
913 fcio->fcio_ilen = dfc->buf1_size;
914 fcio->fcio_ibuf = kmem_zalloc(dfc->buf1_size, KM_SLEEP);
916 if (ddi_copyin(dfc->buf1, fcio->fcio_ibuf, fcio->fcio_ilen,
921 emlxs_fcio_xlate(dfc->data1), fcio->fcio_ilen);
929 fcio->fcio_olen = dfc->buf2_size;
930 fcio->fcio_obuf = kmem_zalloc(dfc->buf2_size, KM_SLEEP);
932 if (ddi_copyin(dfc->buf2, fcio->fcio_obuf, fcio->fcio_olen,
937 emlxs_fcio_xlate(dfc->data1), fcio->fcio_olen);
945 fcio->fcio_alen = dfc->buf3_size;
946 fcio->fcio_abuf = kmem_zalloc(dfc->buf3_size, KM_SLEEP);
948 if (ddi_copyin(dfc->buf3, fcio->fcio_abuf, fcio->fcio_alen,
953 emlxs_fcio_xlate(dfc->data1), fcio->fcio_alen);
967 switch (fcio->fcio_cmd) {
974 pm.pm_cmd_len = fcio->fcio_ilen;
975 pm.pm_cmd_buf = fcio->fcio_ibuf;
976 pm.pm_data_len = fcio->fcio_alen;
977 pm.pm_data_buf = fcio->fcio_abuf;
978 pm.pm_stat_len = fcio->fcio_olen;
979 pm.pm_stat_buf = fcio->fcio_obuf;
981 pm.pm_cmd_flags = fcio->fcio_cmd_flags;
986 fcio->fcio_errno = rval;
994 if (fcio->fcio_olen > pm.pm_stat_len) {
995 fcio->fcio_olen = pm.pm_stat_len;
1007 if (fcio->fcio_xfer != FCIO_XFER_READ ||
1008 fcio->fcio_olen != sizeof (fc_port_dev32_t)) {
1013 port_dev = (fc_port_dev32_t *)fcio->fcio_obuf;
1041 if (fcio->fcio_xfer != FCIO_XFER_READ ||
1042 fcio->fcio_olen != sizeof (fc_port_dev_t)) {
1047 port_dev = (fc_port_dev_t *)fcio->fcio_obuf;
1078 if (fcio->fcio_xfer != FCIO_XFER_WRITE ||
1079 fcio->fcio_ilen != 8) {
1086 if (bcmp((uint8_t *)fcio->fcio_ibuf, null_wwn, 8) == 0) {
1090 fcio->fcio_errno = rval;
1105 fcio->fcio_errno = rval;
1115 if (fcio->fcio_xfer != FCIO_XFER_WRITE ||
1116 fcio->fcio_ilen <= 0) {
1125 pm.pm_data_len = fcio->fcio_ilen;
1126 pm.pm_data_buf = fcio->fcio_ibuf;
1131 fcio->fcio_errno = rval;
1141 if (fcio->fcio_xfer != FCIO_XFER_READ ||
1142 fcio->fcio_olen < FC_FW_REV_SIZE) {
1151 pm.pm_data_len = fcio->fcio_olen;
1152 pm.pm_data_buf = fcio->fcio_obuf;
1157 fcio->fcio_errno = rval;
1167 if (fcio->fcio_xfer != FCIO_XFER_READ ||
1168 fcio->fcio_olen < FC_FCODE_REV_SIZE) {
1177 pm.pm_data_len = fcio->fcio_olen;
1178 pm.pm_data_buf = fcio->fcio_obuf;
1183 fcio->fcio_errno = rval;
1193 if (fcio->fcio_xfer != FCIO_XFER_WRITE ||
1194 fcio->fcio_ilen <= 0) {
1203 pm.pm_data_len = fcio->fcio_ilen;
1204 pm.pm_data_buf = fcio->fcio_ibuf;
1209 fcio->fcio_errno = rval;
1220 if (fcio->fcio_xfer != FCIO_XFER_READ ||
1221 fcio->fcio_olen <
1228 (fc_hba_adapter_attributes32_t *)fcio->fcio_obuf;
1263 if (fcio->fcio_xfer != FCIO_XFER_READ ||
1264 fcio->fcio_olen <
1271 (fc_hba_adapter_attributes_t *)fcio->fcio_obuf;
1314 if (fcio->fcio_xfer != FCIO_XFER_READ ||
1315 fcio->fcio_olen <
1322 (fc_hba_port_attributes32_t *)fcio->fcio_obuf;
1441 if (fcio->fcio_xfer != FCIO_XFER_READ ||
1442 fcio->fcio_olen <
1449 (fc_hba_port_attributes_t *)fcio->fcio_obuf;
1570 if (fcio->fcio_xfer != FCIO_XFER_READ ||
1571 fcio->fcio_olen < sizeof (fc_rnid_t)) {
1580 pm.pm_data_len = fcio->fcio_olen;
1581 pm.pm_data_buf = fcio->fcio_obuf;
1586 fcio->fcio_errno = rval;
1596 if (fcio->fcio_xfer != FCIO_XFER_WRITE ||
1597 fcio->fcio_ilen < sizeof (fc_rnid_t)) {
1606 pm.pm_data_len = fcio->fcio_ilen;
1607 pm.pm_data_buf = fcio->fcio_ibuf;
1612 fcio->fcio_errno = rval;
1621 if (fcio->fcio_xfer != FCIO_XFER_READ ||
1622 fcio->fcio_olen < sizeof (uint32_t)) {
1627 *(uint32_t *)fcio->fcio_obuf = emlxs_nport_count(port);
1642 if (fcio->fcio_xfer != FCIO_XFER_READ ||
1643 fcio->fcio_alen < sizeof (uint32_t)) {
1648 port_dev = (fc_port_dev32_t *)fcio->fcio_obuf;
1649 max_count = fcio->fcio_olen / sizeof (fc_port_dev32_t);
1654 *(uint32_t *)fcio->fcio_abuf = nport_count;
1659 fcio->fcio_errno = FC_NO_MAP;
1667 fcio->fcio_errno = FC_TOOMANY;
1717 if (fcio->fcio_xfer != FCIO_XFER_READ ||
1718 fcio->fcio_alen < sizeof (uint32_t)) {
1723 port_dev = (fc_port_dev_t *)fcio->fcio_obuf;
1724 max_count = fcio->fcio_olen / sizeof (fc_port_dev_t);
1729 *(uint32_t *)fcio->fcio_abuf = nport_count;
1734 fcio->fcio_errno = FC_NO_MAP;
1742 fcio->fcio_errno = FC_TOOMANY;
1791 if (fcio->fcio_ilen != sizeof (la_wwn_t) ||
1792 (fcio->fcio_xfer & FCIO_XFER_READ) == 0 ||
1793 (fcio->fcio_xfer & FCIO_XFER_WRITE) == 0) {
1799 wwpn = (uint8_t *)fcio->fcio_ibuf;
1804 (caddr_t)fcio->fcio_obuf, fcio->fcio_olen);
1810 (caddr_t)fcio->fcio_obuf,
1811 fcio->fcio_olen);
1825 if (fcio->fcio_ilen != 8 ||
1826 fcio->fcio_olen != 4 ||
1827 (fcio->fcio_xfer & FCIO_XFER_WRITE) == 0 ||
1828 (fcio->fcio_xfer & FCIO_XFER_READ) == 0) {
1834 wwpn = (uint8_t *)fcio->fcio_ibuf;
1835 statep = (uint32_t *)fcio->fcio_obuf;
1857 if (fcio->fcio_olen != 4 ||
1858 (fcio->fcio_xfer & FCIO_XFER_READ) == 0) {
1863 tp = (uint32_t *)fcio->fcio_obuf;
1894 if (fcio->fcio_ilen != sizeof (fc_portid_t) ||
1895 fcio->fcio_olen != sizeof (fc_rls_acc_t) ||
1896 fcio->fcio_xfer != FCIO_XFER_RW) {
1901 if ((fcio->fcio_cmd_flags != FCIO_CFLAGS_RLS_DEST_FPORT) &&
1902 (fcio->fcio_cmd_flags != FCIO_CFLAGS_RLS_DEST_NPORT)) {
1907 portid = (fc_portid_t *)fcio->fcio_ibuf;
1908 rls = (fc_rls_acc_t *)fcio->fcio_obuf;
1921 fcio->fcio_errno = rval;
1935 if (fcio->fcio_olen < MAXPATHLEN ||
1936 fcio->fcio_ilen != sizeof (uint32_t)) {
1941 index = *(uint32_t *)fcio->fcio_ibuf;
1942 path = (char *)fcio->fcio_obuf;
1945 fcio->fcio_errno = FC_BADPORT;
1959 if (fcio->fcio_xfer != FCIO_XFER_READ ||
1960 fcio->fcio_ilen < sizeof (uint32_t) ||
1961 fcio->fcio_olen < sizeof (fc_hba_port_attributes_t)) {
1966 index = *(uint32_t *)fcio->fcio_ibuf;
1970 fcio->fcio_errno = FC_OUTOFBOUNDS;
1984 if ((fcio->fcio_xfer != FCIO_XFER_READ) ||
1985 (fcio->fcio_ilen < 8) ||
1986 (fcio->fcio_olen < sizeof (fc_hba_port_attributes_t))) {
1991 wwpn = (uint8_t *)fcio->fcio_ibuf;
1995 fcio->fcio_errno = FC_NOMAP;
2002 fcio->fcio_errno = FC_NOMAP;
2009 port_attrs = (fc_hba_port_attributes_t *)fcio->fcio_obuf;
2120 if (fcio->fcio_olen < (strlen(port->spn)+1) ||
2121 (fcio->fcio_xfer & FCIO_XFER_READ) == 0) {
2126 (void) strcpy((caddr_t)fcio->fcio_obuf, (caddr_t)port->spn);
2133 if (fcio->fcio_olen < (strlen(port->snn)+1) ||
2134 (fcio->fcio_xfer & FCIO_XFER_READ) == 0) {
2139 (void) strcpy((caddr_t)fcio->fcio_obuf, (caddr_t)port->snn);
2149 fcio->fcio_errno = rval;
2161 if (fcio->fcio_olen != sizeof (uint32_t) ||
2162 fcio->fcio_xfer != FCIO_XFER_READ) {
2169 pm.pm_data_len = fcio->fcio_olen;
2170 pm.pm_data_buf = fcio->fcio_obuf;
2177 fcio->fcio_errno = rval;
2194 if (fcio->fcio_xfer != FCIO_XFER_READ) {
2209 fcio->fcio_errno = rval;
2219 if (fcio->fcio_olen != dump_size) {
2220 fcio->fcio_errno = FC_NOMEM;
2227 pm.pm_data_len = fcio->fcio_olen;
2228 pm.pm_data_buf = fcio->fcio_obuf;
2235 fcio->fcio_errno = rval;
2257 emlxs_fcio_xlate(fcio->fcio_cmd));
2263 "Unknown FCIO command. (0x%x)", fcio->fcio_cmd);
2270 if (rval != 0 && fcio->fcio_errno == 0) {
2271 fcio->fcio_errno = FC_FAILURE;
2274 if (fcio->fcio_ibuf) {
2275 if (ddi_copyout(fcio->fcio_ibuf, dfc->buf1, fcio->fcio_ilen,
2280 emlxs_fcio_xlate(dfc->data1), fcio->fcio_ilen);
2285 kmem_free(fcio->fcio_ibuf, fcio->fcio_ilen);
2288 if (fcio->fcio_obuf) {
2289 if (ddi_copyout(fcio->fcio_obuf, dfc->buf2, fcio->fcio_olen,
2294 emlxs_fcio_xlate(dfc->data1), fcio->fcio_olen);
2299 kmem_free(fcio->fcio_obuf, fcio->fcio_olen);
2302 if (fcio->fcio_abuf) {
2303 if (ddi_copyout(fcio->fcio_abuf, dfc->buf3, fcio->fcio_alen,
2308 emlxs_fcio_xlate(dfc->data1), fcio->fcio_alen);
2313 kmem_free(fcio->fcio_abuf, fcio->fcio_alen);
2316 if (ddi_copyout((void *)&fcio->fcio_errno, (void *)dfc->buf4,