1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-22 16:42:56 -08:00
Commit Graph

71 Commits

Author SHA1 Message Date
jsg
e6c7c102cf correct indentation; no functional change
ok tb@
2024-04-23 13:34:50 +00:00
kettenis
3f533fe166 Print information about (legacy) Multiple Message MSIs.
ok kevlo@, dlg@
2024-02-01 18:26:45 +00:00
kettenis
54f9e5713d Fix (and simplify) link speed reporting.
ok jsg@
2023-04-16 17:26:14 +00:00
kn
dcbed439e4 Zap unused variables/functions under /usr/src/*bin/
OK deraadt
2021-10-25 19:54:29 +00:00
deraadt
b7041c0781 For open/openat, if the flags parameter does not contain O_CREAT, the
3rd (variadic) mode_t parameter is irrelevant.  Many developers in the past
have passed mode_t (0, 044, 0644, or such), which might lead future people
to copy this broken idiom, and perhaps even believe this parameter has some
meaning or implication or application. Delete them all.
This comes out of a conversation where tb@ noticed that a strange (but
intentional) pledge behaviour is to always knock-out high-bits from
mode_t on a number of system calls as a safety factor, and his bewilderment
that this appeared to be happening against valid modes (at least visually),
but no sorry, they are all irrelevant junk.  They could all be 0xdeafbeef.
ok millert
2021-10-24 21:24:15 +00:00
jsg
1e22210c88 recognise more pci capabilities
from PCI Code and ID Assignment Specification
2021-07-16 09:14:17 +00:00
beck
bc5a8259a4 Change the error reporting pattern throughout the tree when unveil
fails to report the path that the failure occured on. Suggested by
deraadt@ after some tech discussion.

Work done and verified by Ashton Fagg <ashton@fagg.id.au>

ok deraadt@ semarie@ claudio@
2021-07-12 15:09:18 +00:00
jsg
fe9e6f0359 decode multimedia class 2021-05-30 02:24:43 +00:00
jan
8c95b155ac Avoid print for NULL pointer
The subclass arrays have to be empty.

OK deraadt@
2021-03-05 20:06:39 +00:00
jan
911d903bc3 add missing PCI classes
OK dlg@
2021-03-05 12:57:20 +00:00
dlg
976be7085a revert the previous, it makes everything think it can do 16.0 GT/s.
i'll have to find real pci4 hardware to test with.
2021-01-17 11:54:15 +00:00
dlg
3bcd28033c pcie4 can do 16.0 GT/s. sounds like a lot. 2021-01-17 11:38:18 +00:00
dlg
4adaa1147b dump the max payload size and max read request size in the pcie cap. 2021-01-17 11:16:22 +00:00
dlg
e1c925b0a5 if getting the vpd data fails, don't try and parse the vpd data.
pointed out by jsg@
2021-01-06 23:43:43 +00:00
dlg
4b96984bb8 a first cut at requesting and parsing vpd info.
reading vpd stuff is useful when you're trying to get support
information about a pci device, eg, if you want a serial number,
or firmware versions, or specific part name or number, it's likely
available via vpd. also, im sick of having the diff in my tree.

this relies on the new PCIOCGETVPD ioctl i just committed to the
kernel.

it's a very quick and dirty implementation, hopefully someone will
pick it up and polish it a bit.

tested by hrvoje popovski on a variety of cards
ok jmatthew@
2020-06-22 05:54:26 +00:00
mestre
c8d17636e0 pcidump(8) only opens devices in O_RDONLY from /dev, and additionally writes a
`romfile' if -r is used, but since I'm only unveiling after that file is
actually opened there's no need to unveil it as well.

OK deraadt@ kn@
2019-11-30 14:02:29 +00:00
deraadt
df69c215c7 When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.
2019-06-28 13:32:41 +00:00
dlg
1f43da813d dump pcie Device Serial Number capability values 2019-06-02 02:37:12 +00:00
jmatthew
dda8f56e64 add some msi and msi-x details
ok dlg@ kettenis@
2019-04-02 07:01:29 +00:00
dlg
262d46aa1c separate fields with commas
some values are strings now, which makes it hard to read when these
values are next to the label for the next field.
2019-03-12 01:46:21 +00:00
dlg
c962f35716 split the clas/subclass/interface/revision output over 2 lines 2019-03-11 01:16:16 +00:00
dlg
06b03c88d3 teach pcidump about pci class and subclass names
i wanted to know if some devices are pci bridges or hosts, and found
looking up the values in pcireg.h to be a bit tedious.
2019-03-11 01:06:38 +00:00
dlg
557040b27f use \t instead of a literal tab in a format string 2019-02-19 21:32:42 +00:00
dlg
374253ac95 convert a series of if statements checking the cap type to switch 2019-02-19 21:29:45 +00:00
kettenis
4719bcb463 Print BARs for bridges as well.
ok deraadt@
2018-04-08 13:55:40 +00:00
otto
3025e2fb66 assorted warning fixes; ok millert@ 2017-08-31 12:03:02 +00:00
jsg
ec0b242072 PCI Express extendeded capability 0x1c is LN Requester according to the
PCI-SIG Lightweight Notification (LN) Protocol ECN document.

From Masanobu SAITOH.
2017-06-16 05:19:15 +00:00
jsg
d1a52e20c0 When an array of PCIe extended cability strings was added it missed
some offsets, leading to the wrong strings being used in some cases.
Add the missing strings.

ok mpi@ deraadt@ millert@
2017-05-18 05:12:34 +00:00
mlarkin
8e37be7614 More PCI extended capabilities handling in pcidump.
From  Simon Mages

ok deraadt@
2017-03-25 07:33:46 +00:00
deraadt
f9804a945d Print PCIe Extended Capabilities, from Simon Mages
ok kettenis mlarkin
2017-03-16 22:05:44 +00:00
dlg
a04043068d s/Signaled/Signalled/ 2017-01-04 03:35:29 +00:00
guenther
71073a546a Move up the <stdio.h> include so <dev/pci/*.h> have NULL
ok deraadt@
2016-08-27 04:38:48 +00:00
kettenis
7b4098eb1c Print PME# state together with the PCI power state when enabled/asserted. 2015-12-01 19:10:09 +00:00
kettenis
3a2eabfe81 Print PCI power state when the -v option is given.
ok deraadt@, mpi@
2015-11-21 17:52:10 +00:00
deraadt
b9fc9a728f Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)
2015-01-16 06:39:28 +00:00
guenther
5ad04d3516 Use errc/warnc to simplify code.
Also, in 'ftp', always put the error message last, after the hostname/ipaddr.

ok jsing@ krw@ millert@
2014-05-20 01:25:23 +00:00
deraadt
311a3a9481 missing protos and an unused variable 2013-11-12 19:48:53 +00:00
jsg
e1b2e8d405 use version two of the PCIe capability when displaying link speeds
ok mpi@
2013-08-30 06:46:39 +00:00
kettenis
59b862941c Fix typo. 2013-06-15 19:45:03 +00:00
jsg
48e4789bfe avoid what would be a leak if reused elsewhere but isn't in this
case as the memory is freed on exit.

ok krw@ kettenis@
2012-07-03 13:09:25 +00:00
jsg
271436a77a The PCIe link speed values are printed in GT/s not Gb/s. 2012-05-16 13:01:50 +00:00
jsg
d5fc1bc805 recognise 8.0 GT/s link speed for PCI Express 3.0 2012-05-16 12:58:39 +00:00
jsg
73746b6cb0 Add an entry for "Advanced Capabilities for Conventional PCI"
to the list of capabilities, present in recent Intel chipsets.

ok kettenis@
2011-01-13 14:29:26 +00:00
jsg
6bdb5af846 fix an off by one
ok kettenis@
2011-01-13 14:17:21 +00:00
kettenis
0054379caf Add SATA capability. Use nitems() to decide if a capability is known or not.
ok krw@, deraadt@, dlg@, jsg@
2011-01-12 20:17:56 +00:00
jmc
8f524c6d6f add -xxx to usage(); 2010-12-19 23:23:21 +00:00
kettenis
5d2ed882d6 Add -xxx option that print PCIe extended config space.
ok mikeb@, deraadt@
2010-12-19 23:06:10 +00:00
kettenis
d01993f357 Add an ioctl to figure out the non-sticky bits in PCI BARs used for determining
the size of those BARs.  Make pcidump use this new ioctl to print the size
of PCI BARs.

ok deraadt@, miod@
2010-09-05 18:14:33 +00:00
jsg
58cbacc395 Show PCIe link speed/width, earlier version ok miod@/kettenis@ then
tweaked to show both negotiated and capable as well as fixing a mask
after comments from damien@

ok deraadt@
2010-08-02 10:17:10 +00:00
kettenis
8b86f50e88 On amd64 and i386, dump the VGA BIOS found at the canonical address 0xc0000
if a VGA device doesn't have its expansion ROM base address register set.

ok oga@, miod@
2010-03-01 19:00:47 +00:00