Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export slot id for more slot types #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions dmidecode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2161,6 +2161,10 @@ static void dmi_slot_id(u8 code1, u8 code2, u8 type)
case 0x21: /* PCI Express Mini */
case 0x22: /* PCI Express Mini */
case 0x23: /* PCI Express Mini */
case 0x24: /* PCI Express Gen 4 SFF-8639 (U.2) */
case 0x25: /* PCI Express Gen 5 SFF-8639 (U.2) */
case 0x26: /* OCP NIC 3.0 Small Form Factor (SFF) */
case 0x27: /* OCP NIC 3.0 Large Form Factor (LFF) */
case 0xA5: /* PCI Express */
case 0xA6: /* PCI Express */
case 0xA7: /* PCI Express */
Expand Down Expand Up @@ -2192,6 +2196,8 @@ static void dmi_slot_id(u8 code1, u8 code2, u8 type)
case 0xC2: /* PCI Express 5 */
case 0xC3: /* PCI Express 5 */
case 0xC4: /* PCI Express 6+ */
case 0xC5: /* Enterprise and Datacenter 1U E1 Form Factor Slot (EDSFF E1.S, E1.L) */
case 0xC6: /* Enterprise and Datacenter 3" E3 Form Factor Slot (EDSFF E3.S, E3.L) */
pr_attr("ID", "%u", code1);
break;
case 0x07: /* PCMCIA */
Expand Down
5 changes: 3 additions & 2 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,11 @@ void *mem_chunk(off_t base, size_t len, const char *devmem)
/*
* Safety check: if running as root, devmem is expected to be a
* character device file.
* TODO: Remove this check
*/
if ((fd = open(devmem, O_RDONLY)) == -1
|| fstat(fd, &statbuf) == -1
|| (geteuid() == 0 && !S_ISCHR(statbuf.st_mode)))
|| fstat(fd, &statbuf) == -1)
// || (geteuid() == 0 && !S_ISCHR(statbuf.st_mode)))
{
fprintf(stderr, "Can't read memory from %s\n", devmem);
if (fd == -1)
Expand Down