Home | History | Annotate | Download | only in smbios

Lines Matching refs:structure

58  * Find specific structure type within SMBIOS
60 * @v type Structure type to search for
61 * @v structure SMBIOS structure descriptor to fill in
65 struct smbios_structure *structure ) {
79 while ( ( ( offset + sizeof ( structure->header ) ) < smbios.len )
82 /* Read next SMBIOS structure header */
83 copy_from_user ( &structure->header, smbios.address, offset,
84 sizeof ( structure->header ) );
87 strings_offset = ( offset + structure->header.len );
89 DBG ( "SMBIOS structure at offset %zx with length "
91 structure->header.len );
96 DBG ( "SMBIOS structure at offset %zx has "
100 structure->strings_len = ( terminator_offset - strings_offset);
102 DBG ( "SMBIOS structure at offset %zx has type %d, length %x, "
103 "strings length %zx\n", offset, structure->header.type,
104 structure->header.len, structure->strings_len );
106 /* If this is the structure we want, return */
107 if ( structure->header.type == type ) {
108 structure->offset = offset;
112 /* Move to next SMBIOS structure */
117 DBG ( "SMBIOS structure type %d not found\n", type );
122 * Copy SMBIOS structure
124 * @v structure SMBIOS structure descriptor
125 * @v data Buffer to hold SMBIOS structure
129 int read_smbios_structure ( struct smbios_structure *structure,
134 if ( len > structure->header.len )
135 len = structure->header.len;
136 copy_from_user ( data, smbios.address, structure->offset, len );
141 * Find indexed string within SMBIOS structure
143 * @v structure SMBIOS structure descriptor
149 int read_smbios_string ( struct smbios_structure *structure,
151 size_t strings_start = ( structure->offset + structure->header.len );
152 size_t strings_end = ( strings_start + structure->strings_len );