Lines Matching refs:rc
146 efx_rc_t rc;
148 if ((rc = tlv_validate_state(cursor)) != 0)
154 rc = ENOENT;
161 if ((rc = tlv_validate_state(cursor)) != 0)
171 EFSYS_PROBE1(fail1, efx_rc_t, rc);
173 return (rc);
180 efx_rc_t rc;
184 if ((rc = tlv_validate_state(cursor)) != 0)
190 EFSYS_PROBE1(fail1, efx_rc_t, rc);
192 return (rc);
200 efx_rc_t rc;
202 rc = tlv_rewind(cursor);
203 while (rc == 0) {
207 rc = tlv_advance(cursor);
209 return (rc);
216 efx_rc_t rc;
220 rc = EINVAL;
224 rc = EINVAL;
232 rc = EFAULT;
239 rc = EFAULT;
253 EFSYS_PROBE1(fail1, efx_rc_t, rc);
255 return (rc);
307 efx_rc_t rc;
311 if ((rc = tlv_find(cursor, TLV_TAG_END)) != 0)
321 EFSYS_PROBE1(fail1, efx_rc_t, rc);
323 return (rc);
330 efx_rc_t rc;
332 if ((rc = tlv_validate_state(cursor)) != 0)
335 if ((rc = tlv_require_end(cursor)) != 0)
344 EFSYS_PROBE1(fail1, efx_rc_t, rc);
410 efx_rc_t rc;
412 if ((rc = tlv_validate_state(cursor)) != 0)
415 if ((rc = tlv_require_end(cursor)) != 0)
419 rc = EINVAL;
427 rc = ENOSPC;
450 EFSYS_PROBE1(fail1, efx_rc_t, rc);
452 return (rc);
461 efx_rc_t rc;
463 if ((rc = tlv_validate_state(cursor)) != 0)
467 rc = EINVAL;
473 if ((rc = tlv_require_end(cursor)) != 0)
493 EFSYS_PROBE1(fail1, efx_rc_t, rc);
495 return (rc);
511 efx_rc_t rc;
513 if ((rc = tlv_validate_state(cursor)) != 0)
517 rc = EINVAL;
521 rc = EINVAL;
528 if ((rc = tlv_require_end(cursor)) != 0)
539 rc = ENOSPC;
581 EFSYS_PROBE1(fail1, efx_rc_t, rc);
583 return (rc);
613 efx_rc_t rc;
629 rc = EFAULT;
634 rc = EFAULT;
654 EFSYS_PROBE1(fail1, efx_rc_t, rc);
656 return (rc);
672 efx_rc_t rc;
677 rc = EINVAL;
682 if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)partn_data,
684 rc = EFAULT;
688 rc = EINVAL;
696 rc = EFBIG;
702 rc = EINVAL;
707 if ((rc = tlv_find(&cursor, TLV_TAG_PARTITION_TRAILER)) != 0) {
708 rc = EINVAL;
713 if ((rc = tlv_advance(&cursor)) != 0) {
714 rc = EINVAL;
718 rc = EINVAL;
724 rc = EINVAL;
734 rc = EINVAL;
759 EFSYS_PROBE1(fail1, efx_rc_t, rc);
761 return (rc);
785 efx_rc_t rc;
793 rc = EINVAL;
799 if ((rc = tlv_init_cursor(&cursor, buf,
811 if ((rc = tlv_insert(
815 if ((rc = tlv_advance(&cursor)) != 0)
822 if ((rc = tlv_insert(&cursor, TLV_TAG_PARTITION_TRAILER,
826 if ((rc = tlv_update_partition_len_and_cks(&cursor)) != 0)
830 if ((rc = ef10_nvram_buffer_validate(partn_type,
849 EFSYS_PROBE1(fail1, efx_rc_t, rc);
851 return (rc);
871 efx_rc_t rc;
874 if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)bufferp,
876 rc = EFAULT;
880 rc = EINVAL;
884 if ((rc = tlv_advance(&cursor)) != 0) {
885 rc = EINVAL;
890 if ((rc = tlv_require_end(&cursor)) != 0)
902 EFSYS_PROBE1(fail1, efx_rc_t, rc);
904 return (rc);
917 efx_rc_t rc;
922 if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)bufferp,
924 rc = EFAULT;
942 rc = EINVAL;
959 EFSYS_PROBE1(fail1, efx_rc_t, rc);
961 return (rc);
1011 efx_rc_t rc;
1015 if ((rc = tlv_init_cursor_at_offset(&cursor, (uint8_t *)bufferp,
1038 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1040 return (rc);
1056 efx_rc_t rc;
1061 rc = ENOSPC;
1065 if ((rc = tlv_init_cursor_at_offset(&cursor, (uint8_t *)bufferp,
1072 rc = ENOSPC;
1087 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1089 return (rc);
1103 efx_rc_t rc;
1106 if ((rc = tlv_init_cursor_at_offset(&cursor, (uint8_t *)bufferp,
1111 rc = tlv_insert(&cursor, tag, (uint8_t *)valuep, length);
1113 if (rc != 0)
1124 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1126 return (rc);
1140 efx_rc_t rc;
1143 if ((rc = tlv_init_cursor_at_offset(&cursor, (uint8_t *)bufferp,
1148 rc = tlv_modify(&cursor, tag, (uint8_t *)valuep, length);
1150 if (rc != 0) {
1162 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1164 return (rc);
1176 efx_rc_t rc;
1181 if ((rc = tlv_init_cursor_at_offset(&cursor, (uint8_t *)bufferp,
1186 if ((rc = tlv_delete(&cursor)) != 0)
1194 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1196 return (rc);
1205 efx_rc_t rc;
1208 if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)bufferp,
1210 rc = EFAULT;
1214 if ((rc = tlv_require_end(&cursor)) != 0)
1217 if ((rc = tlv_update_partition_len_and_cks(&cursor)) != 0)
1227 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1229 return (rc);
1252 efx_rc_t rc;
1257 rc = EINVAL;
1262 if ((rc = ef10_nvram_partn_read_mode(enp, partn, seg_offset, seg_data,
1269 if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)seg_data,
1271 rc = EFAULT;
1275 rc = EINVAL;
1283 rc = EFBIG;
1289 if ((rc = ef10_nvram_partn_read_mode(enp, partn,
1298 if ((rc = tlv_find(&cursor, TLV_TAG_PARTITION_TRAILER)) != 0) {
1299 rc = EINVAL;
1304 if ((rc = tlv_advance(&cursor)) != 0) {
1305 rc = EINVAL;
1309 rc = EINVAL;
1321 rc = EAGAIN;
1331 rc = EINVAL;
1358 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1360 return (rc);
1380 efx_rc_t rc;
1385 rc = EINVAL;
1390 if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)seg_data,
1392 rc = EFAULT;
1395 if ((rc = tlv_find(&cursor, tag)) != 0) {
1396 rc = ENOENT;
1408 rc = ENOMEM;
1426 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1428 return (rc);
1445 efx_rc_t rc;
1448 if ((rc = ef10_nvram_partn_size(enp, partn, &partn_size)) != 0)
1452 rc = ENOENT;
1458 rc = ENOMEM;
1472 if ((rc = ef10_nvram_read_tlv_segment(enp, partn, 0,
1475 } while ((rc == EAGAIN) && (retry > 0));
1477 if (rc != 0) {
1479 if (rc == EAGAIN)
1480 rc = EIO;
1485 if ((rc = ef10_nvram_buf_read_tlv(enp, seg_data, partn_size,
1507 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1509 return (rc);
1519 efx_rc_t rc;
1528 if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)seg_data,
1530 rc = EFAULT;
1534 rc = EINVAL;
1542 rc = EFBIG;
1547 if ((rc = tlv_find(&cursor, TLV_TAG_PARTITION_TRAILER)) != 0) {
1548 rc = EINVAL;
1552 if ((rc = tlv_advance(&cursor)) != 0) {
1553 rc = EINVAL;
1557 rc = EINVAL;
1568 rc = EINVAL;
1579 rc = EINVAL;
1584 rc = EINVAL;
1589 rc = tlv_rewind(&cursor);
1590 rc = tlv_advance(&cursor);
1592 while (rc == 0) {
1601 rc = EINVAL;
1605 rc = tlv_advance(&cursor);
1607 if (rc != 0)
1635 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1637 return (rc);
1659 efx_rc_t rc;
1662 if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)seg_data,
1664 rc = EFAULT;
1668 rc = EINVAL;
1674 if ((rc = tlv_find(&cursor, tag)) == 0) {
1676 if ((rc = tlv_modify(&cursor, tag,
1681 rc = tlv_find(&cursor, TLV_TAG_PARTITION_TRAILER);
1682 if (rc != 0) {
1683 rc = EINVAL;
1686 if ((rc = tlv_insert(&cursor, tag,
1688 rc = EINVAL;
1694 if ((rc = tlv_find(&cursor, TLV_TAG_PARTITION_TRAILER)) != 0) {
1695 rc = EINVAL;
1703 rc = ENOSPC;
1735 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1737 return (rc);
1774 efx_rc_t rc;
1788 rc = EINVAL;
1795 rc = EINVAL;
1801 if ((rc = ef10_nvram_buf_write_tlv(*seg_datap,
1827 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1829 return (rc);
1865 efx_rc_t rc;
1874 if ((rc = ef10_nvram_partn_size(enp, partn, &partn_size)) != 0)
1879 rc = ENOMEM;
1888 if ((rc = ef10_nvram_partn_lock(enp, partn)) != 0)
1895 rc = ef10_nvram_segment_write_tlv(enp, partn, tag, data, size,
1898 if (rc != 0) {
1917 rc = ENOSPC;
1922 if ((rc = ef10_nvram_partn_erase(enp, partn, 0, partn_size)) != 0)
1926 if ((rc = ef10_nvram_partn_write(enp, partn, 0, partn_data,
1954 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1956 return (rc);
1969 efx_rc_t rc;
1971 if ((rc = efx_mcdi_nvram_info(enp, partn, sizep,
1978 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1980 return (rc);
1988 efx_rc_t rc;
1990 if ((rc = efx_mcdi_nvram_update_start(enp, partn)) != 0)
1996 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1998 return (rc);
2011 efx_rc_t rc;
2016 if ((rc = efx_mcdi_nvram_read(enp, partn, offset,
2029 EFSYS_PROBE1(fail1, efx_rc_t, rc);
2031 return (rc);
2080 efx_rc_t rc;
2083 if ((rc = efx_mcdi_nvram_info(enp, partn, NULL, NULL,
2088 if ((rc = efx_mcdi_nvram_erase(enp, partn, offset, size)) != 0)
2092 rc = EINVAL;
2096 if ((rc = efx_mcdi_nvram_erase(enp, partn, offset,
2113 EFSYS_PROBE1(fail1, efx_rc_t, rc);
2115 return (rc);
2128 efx_rc_t rc;
2130 if ((rc = efx_mcdi_nvram_info(enp, partn, NULL, NULL,
2140 rc = EINVAL;
2150 if ((rc = efx_mcdi_nvram_write(enp, partn, offset,
2167 EFSYS_PROBE1(fail1, efx_rc_t, rc);
2169 return (rc);
2179 efx_rc_t rc;
2184 rc = efx_mcdi_nvram_update_finish(enp, partn, reboot, verify_resultp);
2185 if (rc != 0)
2191 EFSYS_PROBE1(fail1, efx_rc_t, rc);
2193 return (rc);
2204 efx_rc_t rc;
2215 if ((rc = ef10_nvram_partn_write_segment_tlv(enp,
2224 EFSYS_PROBE1(fail1, efx_rc_t, rc);
2226 return (rc);
2393 efx_rc_t rc;
2399 rc = ENOMEM;
2403 if ((rc = efx_mcdi_nvram_partitions(enp, (caddr_t)partns, size,
2410 if ((rc = ef10_nvram_partn_to_type(enp, partns[i], &type)) != 0)
2413 if ((rc = efx_mcdi_nvram_test(enp, partns[i])) != 0)
2426 EFSYS_PROBE1(fail1, efx_rc_t, rc);
2427 return (rc);
2439 efx_rc_t rc;
2444 if ((rc = efx_mcdi_nvram_metadata(enp, partn, subtypep,
2451 EFSYS_PROBE1(fail1, efx_rc_t, rc);
2453 return (rc);
2463 efx_rc_t rc;
2465 if ((rc = efx_mcdi_nvram_info(enp, partn, NULL, NULL,
2469 if ((rc = ef10_nvram_partn_lock(enp, partn)) != 0)
2484 EFSYS_PROBE1(fail1, efx_rc_t, rc);
2486 return (rc);
2495 efx_rc_t rc;
2497 if ((rc = ef10_nvram_partn_unlock(enp, partn, verify_resultp)) != 0)
2503 EFSYS_PROBE1(fail1, efx_rc_t, rc);
2505 return (rc);