Lines Matching +full:start +full:- +full:year
1 // SPDX-License-Identifier: GPL-2.0-only
49 const u8 *bp = ((u8 *) dm) + dm->length; in dmi_string_nosave()
53 while (--s > 0 && *bp) in dmi_string_nosave()
97 * (SMBIOS < 3.0 only) OR we reach an end-of-table marker (SMBIOS in dmi_decode_table()
102 (data - buf + sizeof(struct dmi_header)) <= dmi_len) { in dmi_decode_table()
109 if (dm->length < sizeof(struct dmi_header)) { in dmi_decode_table()
112 data - buf, i); in dmi_decode_table()
121 data += dm->length; in dmi_decode_table()
122 while ((data - buf < dmi_len - 1) && (data[0] || data[1])) in dmi_decode_table()
124 if (data - buf < dmi_len - 1) in dmi_decode_table()
131 * 7.45 End-of-Table (Type 127) [SMBIOS reference spec v3.0.0] in dmi_decode_table()
132 * For tables behind a 64-bit entry point, we have no item in dmi_decode_table()
133 * count and no exact table length, so stop on end-of-table in dmi_decode_table()
134 * marker. For tables behind a 32-bit entry point, we have in dmi_decode_table()
135 * seen OEM structures behind the end-of-table marker on in dmi_decode_table()
138 if (!dmi_num && dm->type == DMI_ENTRY_END_OF_TABLE) in dmi_decode_table()
143 if (dmi_len > data - buf) in dmi_decode_table()
144 dmi_len = data - buf; in dmi_decode_table()
157 return -ENOMEM; in dmi_walk_early()
192 if (dmi_ident[slot] || dm->length <= string) in dmi_save_ident()
209 if (dmi_ident[slot] || dm->length < index) in dmi_save_release()
213 major = (u8 *) dm + index - 1; in dmi_save_release()
237 if (dmi_ident[slot] || dm->length < index + 16) in dmi_save_uuid()
257 * the UUID are supposed to be little-endian encoded. The specification in dmi_save_uuid()
274 if (dmi_ident[slot] || dm->length <= index) in dmi_save_type()
298 dev->type = type; in dmi_save_one_device()
300 dev->name = (char *)(dev + 1); in dmi_save_one_device()
301 dev->device_data = NULL; in dmi_save_one_device()
302 list_add(&dev->list, &dmi_devices); in dmi_save_one_device()
307 int i, count = (dm->length - sizeof(struct dmi_header)) / 2; in dmi_save_devices()
325 if (dm->length < 0x05) in dmi_save_oem_strings_devices()
339 dev->type = DMI_DEV_TYPE_OEM_STRING; in dmi_save_oem_strings_devices()
340 dev->name = devname; in dmi_save_oem_strings_devices()
341 dev->device_data = NULL; in dmi_save_oem_strings_devices()
343 list_add(&dev->list, &dmi_devices); in dmi_save_oem_strings_devices()
352 data = dmi_alloc(dm->length); in dmi_save_ipmi_device()
356 memcpy(data, dm, dm->length); in dmi_save_ipmi_device()
362 dev->type = DMI_DEV_TYPE_IPMI; in dmi_save_ipmi_device()
363 dev->name = "IPMI controller"; in dmi_save_ipmi_device()
364 dev->device_data = data; in dmi_save_ipmi_device()
366 list_add_tail(&dev->list, &dmi_devices); in dmi_save_ipmi_device()
383 dev->instance = instance; in dmi_save_dev_pciaddr()
384 dev->segment = segment; in dmi_save_dev_pciaddr()
385 dev->bus = bus; in dmi_save_dev_pciaddr()
386 dev->devfn = devfn; in dmi_save_dev_pciaddr()
389 dev->dev.type = type; in dmi_save_dev_pciaddr()
390 dev->dev.name = (char *)&dev[1]; in dmi_save_dev_pciaddr()
391 dev->dev.device_data = dev; in dmi_save_dev_pciaddr()
393 list_add(&dev->dev.list, &dmi_devices); in dmi_save_dev_pciaddr()
401 if (dm->length < 0x0B) in dmi_save_extended_devices()
419 if (dm->length < 0x11) in dmi_save_system_slot()
428 if (dm->type != DMI_ENTRY_MEM_DEVICE) in count_mem_devices()
440 if (dm->type != DMI_ENTRY_MEM_DEVICE || dm->length < 0x13) in save_mem_devices()
446 dmi_memdev[nr].handle = get_unaligned(&dm->handle); in save_mem_devices()
458 else if (size != 0x7fff || dm->length < 0x20) in save_mem_devices()
486 switch (dm->type) { in dmi_decode()
544 c += scnprintf(buf + c, len - c, "%c", *p); in print_filtered()
546 c += scnprintf(buf + c, len - c, "\\x%02x", *p & 0xff); in print_filtered()
555 c += print_filtered(buf + c, len - c, in dmi_format_ids()
557 c += scnprintf(buf + c, len - c, " "); in dmi_format_ids()
558 c += print_filtered(buf + c, len - c, in dmi_format_ids()
563 c += scnprintf(buf + c, len - c, "/"); in dmi_format_ids()
564 c += print_filtered(buf + c, len - c, board); in dmi_format_ids()
566 c += scnprintf(buf + c, len - c, ", BIOS "); in dmi_format_ids()
567 c += print_filtered(buf + c, len - c, in dmi_format_ids()
569 c += scnprintf(buf + c, len - c, " "); in dmi_format_ids()
570 c += print_filtered(buf + c, len - c, in dmi_format_ids()
576 * SMBIOS header must start 16 bytes before the DMI header, so take a
600 pr_debug("SMBIOS version fixup (2.%d->2.%d)\n", in dmi_present()
605 pr_debug("SMBIOS version fixup (2.%d->2.%d)\n", 51, 6); in dmi_present()
646 * Check for the SMBIOS 3.0 64-bit entry point signature. Unlike the legacy
647 * 32-bit entry point, there is no embedded DMI header (_DMI_) in here.
681 * allowed to define both the 64-bit entry point (smbios3) and in dmi_scan_machine()
682 * the 32-bit entry point (smbios), in which case they should in dmi_scan_machine()
684 * table pointed to by the 64-bit entry point should contain a in dmi_scan_machine()
685 * superset of the table contents pointed to by the 32-bit entry in dmi_scan_machine()
687 * This implies that the 64-bit entry point should have in dmi_scan_machine()
689 * have the 64-bit entry point, but fail to decode it, fall in dmi_scan_machine()
727 * Same logic as above, look for a 64-bit entry point in dmi_scan_machine()
728 * first, and if not found, fall back to 32-bit entry point. in dmi_scan_machine()
745 * out-of-range bytes so there is no chance of falsely in dmi_scan_machine()
771 int ret = -ENOMEM; in dmi_init()
779 * dmi-sysfs. in dmi_init()
820 * dmi_setup - scan and setup DMI system information
840 * dmi_matches - check if dmi_system_id structure matches system DMI data
847 for (i = 0; i < ARRAY_SIZE(dmi->matches); i++) { in dmi_matches()
848 int s = dmi->matches[i].slot; in dmi_matches()
856 dmi->matches[i].substr, NULL); in dmi_matches()
860 if (dmi->matches[i].exact_match) { in dmi_matches()
862 dmi->matches[i].substr)) in dmi_matches()
866 dmi->matches[i].substr)) in dmi_matches()
878 * dmi_is_end_of_table - check for end-of-table marker
883 return dmi->matches[0].slot == DMI_NONE; in dmi_is_end_of_table()
887 * dmi_check_system - check system DMI data
889 * All non-null elements of the list must match
909 if (d->callback && d->callback(d)) in dmi_check_system()
918 * dmi_first_match - find dmi_system_id structure matching system DMI data
920 * All non-null elements of the list must match
944 * dmi_get_system_info - return DMI data value
957 * dmi_name_in_serial - Check if string is in the DMI product serial information
969 * dmi_name_in_vendors - Check if string is in the DMI system or board vendor name
986 * dmi_find_device - find onboard device by type/name
1000 const struct list_head *head = from ? &from->list : &dmi_devices; in dmi_find_device()
1003 for (d = head->next; d != &dmi_devices; d = d->next) { in dmi_find_device()
1007 if (((type == DMI_DEV_TYPE_ANY) || (dev->type == type)) && in dmi_find_device()
1008 ((name == NULL) || (strcmp(dev->name, name) == 0))) in dmi_find_device()
1017 * dmi_get_date - parse a DMI date
1019 * @yearp: optional out parameter for the year
1031 * On return, year, month and day are guaranteed to be in the
1036 int year = 0, month = 0, day = 0; in dmi_get_date() local
1047 * Determine year first. We assume the date string resembles in dmi_get_date()
1048 * mm/dd/yy[yy] but the original code extracted only the year in dmi_get_date()
1057 year = simple_strtoul(y, &e, 10); in dmi_get_date()
1058 if (y != e && year < 100) { /* 2-digit year */ in dmi_get_date()
1059 year += 1900; in dmi_get_date()
1060 if (year < 1996) /* no dates < spec 1.0 */ in dmi_get_date()
1061 year += 100; in dmi_get_date()
1063 if (year > 9999) /* year should fit in %04d */ in dmi_get_date()
1064 year = 0; in dmi_get_date()
1079 *yearp = year; in dmi_get_date()
1089 * dmi_get_bios_year - get a year out of DMI_BIOS_DATE field
1091 * Returns year on success, -ENXIO if DMI is not selected,
1098 int year; in dmi_get_bios_year() local
1100 exists = dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL); in dmi_get_bios_year()
1102 return -ENODATA; in dmi_get_bios_year()
1104 return year ? year : -ERANGE; in dmi_get_bios_year()
1109 * dmi_walk - Walk the DMI table and get called back for every record
1113 * Returns 0 on success, -ENXIO if DMI is not selected or not present,
1122 return -ENXIO; in dmi_walk()
1126 return -ENOMEM; in dmi_walk()
1136 * dmi_match - compare a string to the dmi field (if exists)
1185 * dmi_memdev_type - get the memory type
1206 * dmi_memdev_handle - get the DMI handle of a memory slot