diff options
| author | Jake Freeland <jfree@FreeBSD.org> | 2025-09-04 02:42:48 +0000 |
|---|---|---|
| committer | Jake Freeland <jfree@FreeBSD.org> | 2025-09-04 02:42:48 +0000 |
| commit | 4f6f4aacaf97f301e5c5646649a1217ca8099349 (patch) | |
| tree | 391147fd865ba092471904b0d6a43ff8c1d74547 /sys/dev/pci | |
| parent | 9404c479946c00b6ac94253d2037c47251dc606c (diff) | |
Diffstat (limited to 'sys/dev/pci')
| -rw-r--r-- | sys/dev/pci/pci_user.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/pci/pci_user.c b/sys/dev/pci/pci_user.c index 5090ecb3dd7c..9768030995e7 100644 --- a/sys/dev/pci/pci_user.c +++ b/sys/dev/pci/pci_user.c @@ -80,6 +80,8 @@ struct pci_conf32 { char pd_name[PCI_MAXNAMELEN + 1]; /* device name */ u_int32_t pd_unit; /* device unit number */ int pd_numa_domain; /* device NUMA domain */ + u_int32_t pc_reported_len;/* length of PCI data reported */ + char pc_spare[64]; /* space for future fields */ }; struct pci_match_conf32 { @@ -885,8 +887,11 @@ pci_conf_for_copyout(const struct pci_conf *pcp, union pci_conf_union *pcup, strlcpy(pcup->pc32.pd_name, pcp->pd_name, sizeof(pcup->pc32.pd_name)); pcup->pc32.pd_unit = (uint32_t)pcp->pd_unit; - if (cmd == PCIOCGETCONF32) + if (cmd == PCIOCGETCONF32) { pcup->pc32.pd_numa_domain = pcp->pd_numa_domain; + pcup->pc32.pc_reported_len = + (uint32_t)offsetof(struct pci_conf32, pc_spare); + } return; #endif /* COMPAT_FREEBSD32 */ @@ -1326,6 +1331,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *t break; } + dinfo->conf.pc_reported_len = + offsetof(struct pci_conf, pc_spare); + pci_conf_for_copyout(&dinfo->conf, &pcu, cmd); error = copyout(&pcu, (caddr_t)cio->matches + |
