Lines Matching refs:used_bytes

765 	size_t used_bytes;  in efx_bootcfg_copy_sector()
776 &used_bytes); in efx_bootcfg_copy_sector()
782 if ((used_bytes < 2) || in efx_bootcfg_copy_sector()
783 (sector[used_bytes - 1] != EFX_DHCP_END)) { in efx_bootcfg_copy_sector()
791 if (rc != 0 || used_bytes == 0) { in efx_bootcfg_copy_sector()
794 used_bytes = 2; in efx_bootcfg_copy_sector()
796 EFSYS_ASSERT(used_bytes >= 2); /* checksum and EFX_DHCP_END */ in efx_bootcfg_copy_sector()
797 EFSYS_ASSERT(used_bytes <= sector_length); in efx_bootcfg_copy_sector()
805 if (sector[used_bytes - 1] != EFX_DHCP_END) { in efx_bootcfg_copy_sector()
806 if (used_bytes >= sector_length) { in efx_bootcfg_copy_sector()
808 used_bytes = 1; in efx_bootcfg_copy_sector()
810 sector[used_bytes] = EFX_DHCP_END; in efx_bootcfg_copy_sector()
811 ++used_bytes; in efx_bootcfg_copy_sector()
818 if (used_bytes > data_size) { in efx_bootcfg_copy_sector()
826 memcpy(data + 1, sector + 1, used_bytes - 1); in efx_bootcfg_copy_sector()
829 if (used_bytes < data_size) in efx_bootcfg_copy_sector()
830 (void) memset(data + used_bytes, 0, data_size - used_bytes); in efx_bootcfg_copy_sector()
860 size_t used_bytes; in efx_bootcfg_read() local
931 &used_bytes); in efx_bootcfg_read()
932 if (rc != 0 || used_bytes == 0) { in efx_bootcfg_read()
935 used_bytes = 2; in efx_bootcfg_read()
938 EFSYS_ASSERT(used_bytes >= 2); /* checksum and EFX_DHCP_END */ in efx_bootcfg_read()
939 EFSYS_ASSERT(used_bytes <= sector_length); in efx_bootcfg_read()
948 if (payload[used_bytes - 1] != EFX_DHCP_END) { in efx_bootcfg_read()
949 if (used_bytes >= sector_length) in efx_bootcfg_read()
950 used_bytes = 1; in efx_bootcfg_read()
952 payload[used_bytes] = EFX_DHCP_END; in efx_bootcfg_read()
953 ++used_bytes; in efx_bootcfg_read()
960 if (used_bytes > size) { in efx_bootcfg_read()
969 memcpy(data + 1, payload + 1, used_bytes - 1); in efx_bootcfg_read()
974 if (used_bytes < size) in efx_bootcfg_read()
975 (void) memset(data + used_bytes, 0, size - used_bytes); in efx_bootcfg_read()
1022 size_t used_bytes; in efx_bootcfg_write() local
1051 if ((rc = efx_dhcp_verify(data, size, &used_bytes)) != 0) in efx_bootcfg_write()
1058 if ((used_bytes < 2) || ((uint8_t)data[used_bytes - 1] != in efx_bootcfg_write()
1066 if (used_bytes > MIN(sector_length, BOOTCFG_MAX_SIZE)) { in efx_bootcfg_write()
1097 (void) memcpy(partn_data + sector_offset, data, used_bytes); in efx_bootcfg_write()
1099 checksum = efx_dhcp_csum(data, used_bytes); in efx_bootcfg_write()