Lines Matching +full:start +full:- +full:year
1 // SPDX-License-Identifier: GPL-2.0-only
48 const u8 *bp = ((u8 *) dm) + dm->length; in dmi_string_nosave()
52 while (--s > 0 && *bp) in dmi_string_nosave()
96 * (SMBIOS < 3.0 only) OR we reach an end-of-table marker (SMBIOS in dmi_decode_table()
101 (data - buf + sizeof(struct dmi_header)) <= dmi_len) { in dmi_decode_table()
109 data += dm->length; in dmi_decode_table()
110 while ((data - buf < dmi_len - 1) && (data[0] || data[1])) in dmi_decode_table()
112 if (data - buf < dmi_len - 1) in dmi_decode_table()
119 * 7.45 End-of-Table (Type 127) [SMBIOS reference spec v3.0.0] in dmi_decode_table()
120 * For tables behind a 64-bit entry point, we have no item in dmi_decode_table()
121 * count and no exact table length, so stop on end-of-table in dmi_decode_table()
122 * marker. For tables behind a 32-bit entry point, we have in dmi_decode_table()
123 * seen OEM structures behind the end-of-table marker on in dmi_decode_table()
126 if (!dmi_num && dm->type == DMI_ENTRY_END_OF_TABLE) in dmi_decode_table()
131 if (dmi_len > data - buf) in dmi_decode_table()
132 dmi_len = data - buf; in dmi_decode_table()
145 return -ENOMEM; in dmi_walk_early()
179 if (dmi_ident[slot] || dm->length <= string) in dmi_save_ident()
196 if (dmi_ident[slot] || dm->length < index) in dmi_save_release()
200 major = (u8 *) dm + index - 1; in dmi_save_release()
224 if (dmi_ident[slot] || dm->length < index + 16) in dmi_save_uuid()
244 * the UUID are supposed to be little-endian encoded. The specification in dmi_save_uuid()
261 if (dmi_ident[slot] || dm->length <= index) in dmi_save_type()
285 dev->type = type; in dmi_save_one_device()
287 dev->name = (char *)(dev + 1); in dmi_save_one_device()
288 dev->device_data = NULL; in dmi_save_one_device()
289 list_add(&dev->list, &dmi_devices); in dmi_save_one_device()
294 int i, count = (dm->length - sizeof(struct dmi_header)) / 2; in dmi_save_devices()
312 if (dm->length < 0x05) in dmi_save_oem_strings_devices()
326 dev->type = DMI_DEV_TYPE_OEM_STRING; in dmi_save_oem_strings_devices()
327 dev->name = devname; in dmi_save_oem_strings_devices()
328 dev->device_data = NULL; in dmi_save_oem_strings_devices()
330 list_add(&dev->list, &dmi_devices); in dmi_save_oem_strings_devices()
339 data = dmi_alloc(dm->length); in dmi_save_ipmi_device()
343 memcpy(data, dm, dm->length); in dmi_save_ipmi_device()
349 dev->type = DMI_DEV_TYPE_IPMI; in dmi_save_ipmi_device()
350 dev->name = "IPMI controller"; in dmi_save_ipmi_device()
351 dev->device_data = data; in dmi_save_ipmi_device()
353 list_add_tail(&dev->list, &dmi_devices); in dmi_save_ipmi_device()
370 dev->instance = instance; in dmi_save_dev_pciaddr()
371 dev->segment = segment; in dmi_save_dev_pciaddr()
372 dev->bus = bus; in dmi_save_dev_pciaddr()
373 dev->devfn = devfn; in dmi_save_dev_pciaddr()
376 dev->dev.type = type; in dmi_save_dev_pciaddr()
377 dev->dev.name = (char *)&dev[1]; in dmi_save_dev_pciaddr()
378 dev->dev.device_data = dev; in dmi_save_dev_pciaddr()
380 list_add(&dev->dev.list, &dmi_devices); in dmi_save_dev_pciaddr()
388 if (dm->length < 0x0B) in dmi_save_extended_devices()
406 if (dm->length < 0x11) in dmi_save_system_slot()
415 if (dm->type != DMI_ENTRY_MEM_DEVICE) in count_mem_devices()
427 if (dm->type != DMI_ENTRY_MEM_DEVICE || dm->length < 0x13) in save_mem_devices()
433 dmi_memdev[nr].handle = get_unaligned(&dm->handle); in save_mem_devices()
445 else if (size != 0x7fff || dm->length < 0x20) in save_mem_devices()
470 switch (dm->type) { in dmi_decode()
528 c += scnprintf(buf + c, len - c, "%c", *p); in print_filtered()
530 c += scnprintf(buf + c, len - c, "\\x%02x", *p & 0xff); in print_filtered()
539 c += print_filtered(buf + c, len - c, in dmi_format_ids()
541 c += scnprintf(buf + c, len - c, " "); in dmi_format_ids()
542 c += print_filtered(buf + c, len - c, in dmi_format_ids()
547 c += scnprintf(buf + c, len - c, "/"); in dmi_format_ids()
548 c += print_filtered(buf + c, len - c, board); in dmi_format_ids()
550 c += scnprintf(buf + c, len - c, ", BIOS "); in dmi_format_ids()
551 c += print_filtered(buf + c, len - c, in dmi_format_ids()
553 c += scnprintf(buf + c, len - c, " "); in dmi_format_ids()
554 c += print_filtered(buf + c, len - c, in dmi_format_ids()
560 * SMBIOS header must start 16 bytes before the DMI header, so take a
579 pr_debug("SMBIOS version fixup (2.%d->2.%d)\n", in dmi_present()
584 pr_debug("SMBIOS version fixup (2.%d->2.%d)\n", 51, 6); in dmi_present()
625 * Check for the SMBIOS 3.0 64-bit entry point signature. Unlike the legacy
626 * 32-bit entry point, there is no embedded DMI header (_DMI_) in here.
659 * allowed to define both the 64-bit entry point (smbios3) and in dmi_scan_machine()
660 * the 32-bit entry point (smbios), in which case they should in dmi_scan_machine()
662 * table pointed to by the 64-bit entry point should contain a in dmi_scan_machine()
663 * superset of the table contents pointed to by the 32-bit entry in dmi_scan_machine()
665 * This implies that the 64-bit entry point should have in dmi_scan_machine()
667 * have the 64-bit entry point, but fail to decode it, fall in dmi_scan_machine()
705 * Same logic as above, look for a 64-bit entry point in dmi_scan_machine()
706 * first, and if not found, fall back to 32-bit entry point. in dmi_scan_machine()
723 * out-of-range bytes so there is no chance of falsely in dmi_scan_machine()
746 memcpy(buf, attr->private + pos, count); in raw_table_read()
757 int ret = -ENOMEM; in dmi_init()
765 * dmi-sysfs. in dmi_init()
806 * dmi_setup - scan and setup DMI system information
824 * dmi_matches - check if dmi_system_id structure matches system DMI data
831 for (i = 0; i < ARRAY_SIZE(dmi->matches); i++) { in dmi_matches()
832 int s = dmi->matches[i].slot; in dmi_matches()
840 dmi->matches[i].substr, NULL); in dmi_matches()
844 if (dmi->matches[i].exact_match) { in dmi_matches()
846 dmi->matches[i].substr)) in dmi_matches()
850 dmi->matches[i].substr)) in dmi_matches()
862 * dmi_is_end_of_table - check for end-of-table marker
867 return dmi->matches[0].slot == DMI_NONE; in dmi_is_end_of_table()
871 * dmi_check_system - check system DMI data
873 * All non-null elements of the list must match
893 if (d->callback && d->callback(d)) in dmi_check_system()
902 * dmi_first_match - find dmi_system_id structure matching system DMI data
904 * All non-null elements of the list must match
928 * dmi_get_system_info - return DMI data value
941 * dmi_name_in_serial - Check if string is in the DMI product serial information
953 * dmi_name_in_vendors - Check if string is in the DMI system or board vendor name
970 * dmi_find_device - find onboard device by type/name
984 const struct list_head *head = from ? &from->list : &dmi_devices; in dmi_find_device()
987 for (d = head->next; d != &dmi_devices; d = d->next) { in dmi_find_device()
991 if (((type == DMI_DEV_TYPE_ANY) || (dev->type == type)) && in dmi_find_device()
992 ((name == NULL) || (strcmp(dev->name, name) == 0))) in dmi_find_device()
1001 * dmi_get_date - parse a DMI date
1003 * @yearp: optional out parameter for the year
1015 * On return, year, month and day are guaranteed to be in the
1020 int year = 0, month = 0, day = 0; in dmi_get_date() local
1031 * Determine year first. We assume the date string resembles in dmi_get_date()
1032 * mm/dd/yy[yy] but the original code extracted only the year in dmi_get_date()
1041 year = simple_strtoul(y, &e, 10); in dmi_get_date()
1042 if (y != e && year < 100) { /* 2-digit year */ in dmi_get_date()
1043 year += 1900; in dmi_get_date()
1044 if (year < 1996) /* no dates < spec 1.0 */ in dmi_get_date()
1045 year += 100; in dmi_get_date()
1047 if (year > 9999) /* year should fit in %04d */ in dmi_get_date()
1048 year = 0; in dmi_get_date()
1063 *yearp = year; in dmi_get_date()
1073 * dmi_get_bios_year - get a year out of DMI_BIOS_DATE field
1075 * Returns year on success, -ENXIO if DMI is not selected,
1082 int year; in dmi_get_bios_year() local
1084 exists = dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL); in dmi_get_bios_year()
1086 return -ENODATA; in dmi_get_bios_year()
1088 return year ? year : -ERANGE; in dmi_get_bios_year()
1093 * dmi_walk - Walk the DMI table and get called back for every record
1097 * Returns 0 on success, -ENXIO if DMI is not selected or not present,
1106 return -ENXIO; in dmi_walk()
1110 return -ENOMEM; in dmi_walk()
1120 * dmi_match - compare a string to the dmi field (if exists)
1169 * dmi_memdev_type - get the memory type
1190 * dmi_memdev_handle - get the DMI handle of a memory slot