Lines Matching refs:rc

144 	efx_rc_t rc;  in tlv_advance()  local
146 if ((rc = tlv_validate_state(cursor)) != 0) in tlv_advance()
152 rc = ENOENT; in tlv_advance()
159 if ((rc = tlv_validate_state(cursor)) != 0) in tlv_advance()
169 EFSYS_PROBE1(fail1, efx_rc_t, rc); in tlv_advance()
171 return (rc); in tlv_advance()
178 efx_rc_t rc; in tlv_rewind() local
182 if ((rc = tlv_validate_state(cursor)) != 0) in tlv_rewind()
188 EFSYS_PROBE1(fail1, efx_rc_t, rc); in tlv_rewind()
190 return (rc); in tlv_rewind()
198 efx_rc_t rc; in tlv_find() local
200 rc = tlv_rewind(cursor); in tlv_find()
201 while (rc == 0) { in tlv_find()
205 rc = tlv_advance(cursor); in tlv_find()
207 return (rc); in tlv_find()
214 efx_rc_t rc; in tlv_validate_state() local
218 rc = EINVAL; in tlv_validate_state()
222 rc = EINVAL; in tlv_validate_state()
230 rc = EFAULT; in tlv_validate_state()
237 rc = EFAULT; in tlv_validate_state()
251 EFSYS_PROBE1(fail1, efx_rc_t, rc); in tlv_validate_state()
253 return (rc); in tlv_validate_state()
305 efx_rc_t rc; in tlv_require_end() local
309 if ((rc = tlv_find(cursor, TLV_TAG_END)) != 0) in tlv_require_end()
319 EFSYS_PROBE1(fail1, efx_rc_t, rc); in tlv_require_end()
321 return (rc); in tlv_require_end()
328 efx_rc_t rc; in tlv_block_length_used() local
330 if ((rc = tlv_validate_state(cursor)) != 0) in tlv_block_length_used()
333 if ((rc = tlv_require_end(cursor)) != 0) in tlv_block_length_used()
342 EFSYS_PROBE1(fail1, efx_rc_t, rc); in tlv_block_length_used()
408 efx_rc_t rc; in tlv_insert() local
410 if ((rc = tlv_validate_state(cursor)) != 0) in tlv_insert()
413 if ((rc = tlv_require_end(cursor)) != 0) in tlv_insert()
417 rc = EINVAL; in tlv_insert()
425 rc = ENOSPC; in tlv_insert()
448 EFSYS_PROBE1(fail1, efx_rc_t, rc); in tlv_insert()
450 return (rc); in tlv_insert()
459 efx_rc_t rc; in tlv_delete() local
461 if ((rc = tlv_validate_state(cursor)) != 0) in tlv_delete()
465 rc = EINVAL; in tlv_delete()
471 if ((rc = tlv_require_end(cursor)) != 0) in tlv_delete()
491 EFSYS_PROBE1(fail1, efx_rc_t, rc); in tlv_delete()
493 return (rc); in tlv_delete()
509 efx_rc_t rc; in tlv_modify() local
511 if ((rc = tlv_validate_state(cursor)) != 0) in tlv_modify()
515 rc = EINVAL; in tlv_modify()
519 rc = EINVAL; in tlv_modify()
526 if ((rc = tlv_require_end(cursor)) != 0) in tlv_modify()
537 rc = ENOSPC; in tlv_modify()
579 EFSYS_PROBE1(fail1, efx_rc_t, rc); in tlv_modify()
581 return (rc); in tlv_modify()
611 efx_rc_t rc; in tlv_update_partition_len_and_cks() local
627 rc = EFAULT; in tlv_update_partition_len_and_cks()
632 rc = EFAULT; in tlv_update_partition_len_and_cks()
652 EFSYS_PROBE1(fail1, efx_rc_t, rc); in tlv_update_partition_len_and_cks()
654 return (rc); in tlv_update_partition_len_and_cks()
670 efx_rc_t rc; in ef10_nvram_buffer_validate() local
675 rc = EINVAL; in ef10_nvram_buffer_validate()
680 if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)partn_data, in ef10_nvram_buffer_validate()
682 rc = EFAULT; in ef10_nvram_buffer_validate()
686 rc = EINVAL; in ef10_nvram_buffer_validate()
694 rc = EFBIG; in ef10_nvram_buffer_validate()
700 rc = EINVAL; in ef10_nvram_buffer_validate()
705 if ((rc = tlv_find(&cursor, TLV_TAG_PARTITION_TRAILER)) != 0) { in ef10_nvram_buffer_validate()
706 rc = EINVAL; in ef10_nvram_buffer_validate()
711 if ((rc = tlv_advance(&cursor)) != 0) { in ef10_nvram_buffer_validate()
712 rc = EINVAL; in ef10_nvram_buffer_validate()
716 rc = EINVAL; in ef10_nvram_buffer_validate()
722 rc = EINVAL; in ef10_nvram_buffer_validate()
732 rc = EINVAL; in ef10_nvram_buffer_validate()
757 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_buffer_validate()
759 return (rc); in ef10_nvram_buffer_validate()
783 efx_rc_t rc; in ef10_nvram_buffer_create() local
791 rc = EINVAL; in ef10_nvram_buffer_create()
797 if ((rc = tlv_init_cursor(&cursor, buf, in ef10_nvram_buffer_create()
809 if ((rc = tlv_insert( in ef10_nvram_buffer_create()
813 if ((rc = tlv_advance(&cursor)) != 0) in ef10_nvram_buffer_create()
820 if ((rc = tlv_insert(&cursor, TLV_TAG_PARTITION_TRAILER, in ef10_nvram_buffer_create()
824 if ((rc = tlv_update_partition_len_and_cks(&cursor)) != 0) in ef10_nvram_buffer_create()
828 if ((rc = ef10_nvram_buffer_validate(partn_type, in ef10_nvram_buffer_create()
847 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_buffer_create()
849 return (rc); in ef10_nvram_buffer_create()
869 efx_rc_t rc; in ef10_nvram_buffer_find_item_start() local
872 if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)bufferp, in ef10_nvram_buffer_find_item_start()
874 rc = EFAULT; in ef10_nvram_buffer_find_item_start()
878 rc = EINVAL; in ef10_nvram_buffer_find_item_start()
882 if ((rc = tlv_advance(&cursor)) != 0) { in ef10_nvram_buffer_find_item_start()
883 rc = EINVAL; in ef10_nvram_buffer_find_item_start()
888 if ((rc = tlv_require_end(&cursor)) != 0) in ef10_nvram_buffer_find_item_start()
900 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_buffer_find_item_start()
902 return (rc); in ef10_nvram_buffer_find_item_start()
915 efx_rc_t rc; in ef10_nvram_buffer_find_end() local
920 if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)bufferp, in ef10_nvram_buffer_find_end()
922 rc = EFAULT; in ef10_nvram_buffer_find_end()
940 rc = EINVAL; in ef10_nvram_buffer_find_end()
957 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_buffer_find_end()
959 return (rc); in ef10_nvram_buffer_find_end()
1009 efx_rc_t rc; in ef10_nvram_buffer_peek_item() local
1013 if ((rc = tlv_init_cursor_at_offset(&cursor, (uint8_t *)bufferp, in ef10_nvram_buffer_peek_item()
1036 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_buffer_peek_item()
1038 return (rc); in ef10_nvram_buffer_peek_item()
1054 efx_rc_t rc; in ef10_nvram_buffer_get_item() local
1059 rc = ENOSPC; in ef10_nvram_buffer_get_item()
1063 if ((rc = tlv_init_cursor_at_offset(&cursor, (uint8_t *)bufferp, in ef10_nvram_buffer_get_item()
1070 rc = ENOSPC; in ef10_nvram_buffer_get_item()
1085 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_buffer_get_item()
1087 return (rc); in ef10_nvram_buffer_get_item()
1101 efx_rc_t rc; in ef10_nvram_buffer_insert_item() local
1104 if ((rc = tlv_init_cursor_at_offset(&cursor, (uint8_t *)bufferp, in ef10_nvram_buffer_insert_item()
1109 rc = tlv_insert(&cursor, tag, (uint8_t *)valuep, length); in ef10_nvram_buffer_insert_item()
1111 if (rc != 0) in ef10_nvram_buffer_insert_item()
1122 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_buffer_insert_item()
1124 return (rc); in ef10_nvram_buffer_insert_item()
1138 efx_rc_t rc; in ef10_nvram_buffer_modify_item() local
1141 if ((rc = tlv_init_cursor_at_offset(&cursor, (uint8_t *)bufferp, in ef10_nvram_buffer_modify_item()
1146 rc = tlv_modify(&cursor, tag, (uint8_t *)valuep, length); in ef10_nvram_buffer_modify_item()
1148 if (rc != 0) { in ef10_nvram_buffer_modify_item()
1160 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_buffer_modify_item()
1162 return (rc); in ef10_nvram_buffer_modify_item()
1174 efx_rc_t rc; in ef10_nvram_buffer_delete_item() local
1179 if ((rc = tlv_init_cursor_at_offset(&cursor, (uint8_t *)bufferp, in ef10_nvram_buffer_delete_item()
1184 if ((rc = tlv_delete(&cursor)) != 0) in ef10_nvram_buffer_delete_item()
1192 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_buffer_delete_item()
1194 return (rc); in ef10_nvram_buffer_delete_item()
1203 efx_rc_t rc; in ef10_nvram_buffer_finish() local
1206 if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)bufferp, in ef10_nvram_buffer_finish()
1208 rc = EFAULT; in ef10_nvram_buffer_finish()
1212 if ((rc = tlv_require_end(&cursor)) != 0) in ef10_nvram_buffer_finish()
1215 if ((rc = tlv_update_partition_len_and_cks(&cursor)) != 0) in ef10_nvram_buffer_finish()
1225 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_buffer_finish()
1227 return (rc); in ef10_nvram_buffer_finish()
1250 efx_rc_t rc; in ef10_nvram_read_tlv_segment() local
1255 rc = EINVAL; in ef10_nvram_read_tlv_segment()
1260 if ((rc = ef10_nvram_partn_read_mode(enp, partn, seg_offset, seg_data, in ef10_nvram_read_tlv_segment()
1267 if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)seg_data, in ef10_nvram_read_tlv_segment()
1269 rc = EFAULT; in ef10_nvram_read_tlv_segment()
1273 rc = EINVAL; in ef10_nvram_read_tlv_segment()
1281 rc = EFBIG; in ef10_nvram_read_tlv_segment()
1287 if ((rc = ef10_nvram_partn_read_mode(enp, partn, in ef10_nvram_read_tlv_segment()
1296 if ((rc = tlv_find(&cursor, TLV_TAG_PARTITION_TRAILER)) != 0) { in ef10_nvram_read_tlv_segment()
1297 rc = EINVAL; in ef10_nvram_read_tlv_segment()
1302 if ((rc = tlv_advance(&cursor)) != 0) { in ef10_nvram_read_tlv_segment()
1303 rc = EINVAL; in ef10_nvram_read_tlv_segment()
1307 rc = EINVAL; in ef10_nvram_read_tlv_segment()
1319 rc = EAGAIN; in ef10_nvram_read_tlv_segment()
1329 rc = EINVAL; in ef10_nvram_read_tlv_segment()
1356 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_read_tlv_segment()
1358 return (rc); in ef10_nvram_read_tlv_segment()
1378 efx_rc_t rc; in ef10_nvram_buf_read_tlv() local
1383 rc = EINVAL; in ef10_nvram_buf_read_tlv()
1388 if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)seg_data, in ef10_nvram_buf_read_tlv()
1390 rc = EFAULT; in ef10_nvram_buf_read_tlv()
1393 if ((rc = tlv_find(&cursor, tag)) != 0) { in ef10_nvram_buf_read_tlv()
1394 rc = ENOENT; in ef10_nvram_buf_read_tlv()
1406 rc = ENOMEM; in ef10_nvram_buf_read_tlv()
1424 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_buf_read_tlv()
1426 return (rc); in ef10_nvram_buf_read_tlv()
1443 efx_rc_t rc; in ef10_nvram_partn_read_tlv() local
1446 if ((rc = ef10_nvram_partn_size(enp, partn, &partn_size)) != 0) in ef10_nvram_partn_read_tlv()
1450 rc = ENOENT; in ef10_nvram_partn_read_tlv()
1456 rc = ENOMEM; in ef10_nvram_partn_read_tlv()
1470 if ((rc = ef10_nvram_read_tlv_segment(enp, partn, 0, in ef10_nvram_partn_read_tlv()
1473 } while ((rc == EAGAIN) && (retry > 0)); in ef10_nvram_partn_read_tlv()
1475 if (rc != 0) { in ef10_nvram_partn_read_tlv()
1477 if (rc == EAGAIN) in ef10_nvram_partn_read_tlv()
1478 rc = EIO; in ef10_nvram_partn_read_tlv()
1483 if ((rc = ef10_nvram_buf_read_tlv(enp, seg_data, partn_size, in ef10_nvram_partn_read_tlv()
1505 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_partn_read_tlv()
1507 return (rc); in ef10_nvram_partn_read_tlv()
1517 efx_rc_t rc; in ef10_nvram_buf_segment_size() local
1526 if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)seg_data, in ef10_nvram_buf_segment_size()
1528 rc = EFAULT; in ef10_nvram_buf_segment_size()
1532 rc = EINVAL; in ef10_nvram_buf_segment_size()
1540 rc = EFBIG; in ef10_nvram_buf_segment_size()
1545 if ((rc = tlv_find(&cursor, TLV_TAG_PARTITION_TRAILER)) != 0) { in ef10_nvram_buf_segment_size()
1546 rc = EINVAL; in ef10_nvram_buf_segment_size()
1550 if ((rc = tlv_advance(&cursor)) != 0) { in ef10_nvram_buf_segment_size()
1551 rc = EINVAL; in ef10_nvram_buf_segment_size()
1555 rc = EINVAL; in ef10_nvram_buf_segment_size()
1566 rc = EINVAL; in ef10_nvram_buf_segment_size()
1577 rc = EINVAL; in ef10_nvram_buf_segment_size()
1582 rc = EINVAL; in ef10_nvram_buf_segment_size()
1587 rc = tlv_rewind(&cursor); in ef10_nvram_buf_segment_size()
1588 rc = tlv_advance(&cursor); in ef10_nvram_buf_segment_size()
1590 while (rc == 0) { in ef10_nvram_buf_segment_size()
1599 rc = EINVAL; in ef10_nvram_buf_segment_size()
1603 rc = tlv_advance(&cursor); in ef10_nvram_buf_segment_size()
1605 if (rc != 0) in ef10_nvram_buf_segment_size()
1633 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_buf_segment_size()
1635 return (rc); in ef10_nvram_buf_segment_size()
1657 efx_rc_t rc; in ef10_nvram_buf_write_tlv() local
1660 if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)seg_data, in ef10_nvram_buf_write_tlv()
1662 rc = EFAULT; in ef10_nvram_buf_write_tlv()
1666 rc = EINVAL; in ef10_nvram_buf_write_tlv()
1672 if ((rc = tlv_find(&cursor, tag)) == 0) { in ef10_nvram_buf_write_tlv()
1674 if ((rc = tlv_modify(&cursor, tag, in ef10_nvram_buf_write_tlv()
1679 rc = tlv_find(&cursor, TLV_TAG_PARTITION_TRAILER); in ef10_nvram_buf_write_tlv()
1680 if (rc != 0) { in ef10_nvram_buf_write_tlv()
1681 rc = EINVAL; in ef10_nvram_buf_write_tlv()
1684 if ((rc = tlv_insert(&cursor, tag, in ef10_nvram_buf_write_tlv()
1686 rc = EINVAL; in ef10_nvram_buf_write_tlv()
1692 if ((rc = tlv_find(&cursor, TLV_TAG_PARTITION_TRAILER)) != 0) { in ef10_nvram_buf_write_tlv()
1693 rc = EINVAL; in ef10_nvram_buf_write_tlv()
1701 rc = ENOSPC; in ef10_nvram_buf_write_tlv()
1733 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_buf_write_tlv()
1735 return (rc); in ef10_nvram_buf_write_tlv()
1772 efx_rc_t rc; in ef10_nvram_segment_write_tlv() local
1786 rc = EINVAL; in ef10_nvram_segment_write_tlv()
1793 rc = EINVAL; in ef10_nvram_segment_write_tlv()
1799 if ((rc = ef10_nvram_buf_write_tlv(*seg_datap, in ef10_nvram_segment_write_tlv()
1825 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_segment_write_tlv()
1827 return (rc); in ef10_nvram_segment_write_tlv()
1863 efx_rc_t rc; in ef10_nvram_partn_write_segment_tlv() local
1872 if ((rc = ef10_nvram_partn_size(enp, partn, &partn_size)) != 0) in ef10_nvram_partn_write_segment_tlv()
1877 rc = ENOMEM; in ef10_nvram_partn_write_segment_tlv()
1886 if ((rc = ef10_nvram_partn_lock(enp, partn)) != 0) in ef10_nvram_partn_write_segment_tlv()
1893 rc = ef10_nvram_segment_write_tlv(enp, partn, tag, data, size, in ef10_nvram_partn_write_segment_tlv()
1896 if (rc != 0) { in ef10_nvram_partn_write_segment_tlv()
1915 rc = ENOSPC; in ef10_nvram_partn_write_segment_tlv()
1920 if ((rc = ef10_nvram_partn_erase(enp, partn, 0, partn_size)) != 0) in ef10_nvram_partn_write_segment_tlv()
1924 if ((rc = ef10_nvram_partn_write(enp, partn, 0, partn_data, in ef10_nvram_partn_write_segment_tlv()
1952 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_partn_write_segment_tlv()
1954 return (rc); in ef10_nvram_partn_write_segment_tlv()
1967 efx_rc_t rc; in ef10_nvram_partn_size() local
1969 if ((rc = efx_mcdi_nvram_info(enp, partn, sizep, in ef10_nvram_partn_size()
1976 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_partn_size()
1978 return (rc); in ef10_nvram_partn_size()
1986 efx_rc_t rc; in ef10_nvram_partn_lock() local
1988 if ((rc = efx_mcdi_nvram_update_start(enp, partn)) != 0) in ef10_nvram_partn_lock()
1994 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_partn_lock()
1996 return (rc); in ef10_nvram_partn_lock()
2009 efx_rc_t rc; in ef10_nvram_partn_read_mode() local
2014 if ((rc = efx_mcdi_nvram_read(enp, partn, offset, in ef10_nvram_partn_read_mode()
2027 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_partn_read_mode()
2029 return (rc); in ef10_nvram_partn_read_mode()
2078 efx_rc_t rc; in ef10_nvram_partn_erase() local
2081 if ((rc = efx_mcdi_nvram_info(enp, partn, NULL, NULL, in ef10_nvram_partn_erase()
2086 if ((rc = efx_mcdi_nvram_erase(enp, partn, offset, size)) != 0) in ef10_nvram_partn_erase()
2090 rc = EINVAL; in ef10_nvram_partn_erase()
2094 if ((rc = efx_mcdi_nvram_erase(enp, partn, offset, in ef10_nvram_partn_erase()
2111 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_partn_erase()
2113 return (rc); in ef10_nvram_partn_erase()
2126 efx_rc_t rc; in ef10_nvram_partn_write() local
2128 if ((rc = efx_mcdi_nvram_info(enp, partn, NULL, NULL, in ef10_nvram_partn_write()
2138 rc = EINVAL; in ef10_nvram_partn_write()
2148 if ((rc = efx_mcdi_nvram_write(enp, partn, offset, in ef10_nvram_partn_write()
2165 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_partn_write()
2167 return (rc); in ef10_nvram_partn_write()
2177 efx_rc_t rc; in ef10_nvram_partn_unlock() local
2182 rc = efx_mcdi_nvram_update_finish(enp, partn, reboot, verify_resultp); in ef10_nvram_partn_unlock()
2183 if (rc != 0) in ef10_nvram_partn_unlock()
2189 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_partn_unlock()
2191 return (rc); in ef10_nvram_partn_unlock()
2202 efx_rc_t rc; variable
2213 if ((rc = ef10_nvram_partn_write_segment_tlv(enp,
2222 EFSYS_PROBE1(fail1, efx_rc_t, rc);
2224 return (rc);
2391 efx_rc_t rc; in ef10_nvram_test() local
2397 rc = ENOMEM; in ef10_nvram_test()
2401 if ((rc = efx_mcdi_nvram_partitions(enp, (caddr_t)partns, size, in ef10_nvram_test()
2408 if ((rc = ef10_nvram_partn_to_type(enp, partns[i], &type)) != 0) in ef10_nvram_test()
2411 if ((rc = efx_mcdi_nvram_test(enp, partns[i])) != 0) in ef10_nvram_test()
2424 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_test()
2425 return (rc); in ef10_nvram_test()
2437 efx_rc_t rc; variable
2442 if ((rc = efx_mcdi_nvram_metadata(enp, partn, subtypep,
2449 EFSYS_PROBE1(fail1, efx_rc_t, rc);
2451 return (rc);
2461 efx_rc_t rc; in ef10_nvram_partn_rw_start() local
2463 if ((rc = efx_mcdi_nvram_info(enp, partn, NULL, NULL, in ef10_nvram_partn_rw_start()
2467 if ((rc = ef10_nvram_partn_lock(enp, partn)) != 0) in ef10_nvram_partn_rw_start()
2482 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_partn_rw_start()
2484 return (rc); in ef10_nvram_partn_rw_start()
2493 efx_rc_t rc; in ef10_nvram_partn_rw_finish() local
2495 if ((rc = ef10_nvram_partn_unlock(enp, partn, verify_resultp)) != 0) in ef10_nvram_partn_rw_finish()
2501 EFSYS_PROBE1(fail1, efx_rc_t, rc); in ef10_nvram_partn_rw_finish()
2503 return (rc); in ef10_nvram_partn_rw_finish()