aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/pciconf
Commit message (Collapse)AuthorAgeFilesLines
* Replace literal uses of /usr/local in C sources with _PATH_LOCALBASEStefan Eßer2020-10-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Literal references to /usr/local exist in a large number of files in the FreeBSD base system. Many are in contributed software, in configuration files, or in the documentation, but 19 uses have been identified in C source files or headers outside the contrib and sys/contrib directories. This commit makes it possible to set _PATH_LOCALBASE in paths.h to use a different prefix for locally installed software. In order to avoid changes to openssh source files, LOCALBASE is passed to the build via Makefiles under src/secure. While _PATH_LOCALBASE could have been used here, there is precedent in the construction of the path used to a xauth program which depends on the LOCALBASE value passed on the compiler command line to select a non-default directory. This could be changed in a later commit to make the openssh build consistently use _PATH_LOCALBASE. It is considered out-of-scope for this commit. Reviewed by: imp MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D26942 Notes: svn path=/head/; revision=367075
* pciconf: print PCIe CTL max read request.Konstantin Belousov2020-09-301-0/+24
| | | | | | | | | | | To not complicate existing parsers, the value is printed on a new output line. Sponsored by: Mellanox Technologies/NVIDIA Networking MFC after: 1 week Notes: svn path=/head/; revision=366300
* When printing out the contents of the VSEC, include the contents of theScott Long2020-03-201-2/+4
| | | | | | | | | headers. Device documentation often times give offsets relative to the start of the entire VSEC, not just the post-header data area, so this change makes it easier to correlate offsets. Notes: svn path=/head/; revision=359187
* Print out some newly added PCIe extended capabilities and subclasses.Konstantin Belousov2020-02-202-0/+39
| | | | | | | | | | | Taken from https://pcisig.com/sites/default/files/files/PCI_Code-ID_r_1_11__v24_Jan_2019.pdf Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 1 week Notes: svn path=/head/; revision=358175
* pciconf: List names of all known extended PCIe capabilities.Konstantin Belousov2020-02-171-0/+15
| | | | | | | | | | | | | Some ids are redundand because the list_ecaps() function decodes them by explicit switch case. But listing them all makes it easier to not miss ecaps, while not changing the functionality. Initial submission by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 3 days Notes: svn path=/head/; revision=358022
* Fix a spacing error from the previous commit for -ll mode. Add a littleScott Long2020-01-151-3/+4
| | | | | | | more space padding to that mode to give the columns a consistent offset. Notes: svn path=/head/; revision=356762
* Add a compact columnar output format, available by specifying a second '-l'Scott Long2020-01-022-18/+46
| | | | | | | | | | command line option. Thanks to the removal of unnecessary information and the organization into columns, this helps the output be more legible on both 80 column displays and non-80 column displays. imp@ provided the idea on this. Notes: svn path=/head/; revision=356267
* Add accessors for the Vendor Specific Extended Capability (VSEC)Scott Long2019-12-134-9/+36
| | | | | | | | | | | | | Parse out the VSEC. If the user invokes a second -c command line option, do a hex dump of the vendor data. Reviewed by: imp MFC after: 3 days Sponsored by: Intel Differential Revision: http://reviews.freebsd.org/D22808 Notes: svn path=/head/; revision=355741
* Fix the botched field ordering in the last commit. While here, fixScott Long2019-10-133-27/+29
| | | | | | | | | | | | whitespace, and also reorder the fields so they are easier to read on an 80 column display (the lines wrapped even before these changes). Also fix non-standard nomenclature in the Caps code, and update the man page. Reported by: rpokala Notes: svn path=/head/; revision=353462
* Change from the non-standard nomenclature of "chip" and "card" to theScott Long2019-10-121-4/+4
| | | | | | | | | | | | | standard nomenclature of "device" and "vendor" with the "sub" variants. This changes the printed format, so anything that scrapes and parses this will need to be adapted. No compatibility shims are provided, but this will not be MFC'd. Reviewed by: jhb, emaste, gtetlow Approved by: jhb, emaste, gtetlow Notes: svn path=/head/; revision=353456
* Report Clock Power Management support and status.Alexander Motin2019-08-231-0/+5
| | | | | | | | | | Since we already report ASPM, why not to go further. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=351422
* pciconf: report PCI Gen4 speedsAndrew Gallatin2019-07-231-0/+2
| | | | | | | | | | | | PCIe gen4 runs at 16GT/s. Report this as the speed of Gen4 links. Reviewed by: imp MFC after: 7 days Sponsored by: Netflix Notes: svn path=/head/; revision=350245
* Require write access when mmapping BAR.Konstantin Belousov2018-08-031-1/+1
| | | | | | | | | | | | | | | | | This actually makes the rights requirements for accessing PCI config space and BARs using /dev/pci same. Since unchanged /dev/pci mode only allows write open for root, default configuration de-facto limits the BAR read to root only. In particular, state-changing reads of the registers are limited to root. Discussed with: se Suggested and reviewed by: jhb (kernel part) Sponsored by: The FreeBSD Foundation MFC after: 12 days Differential revision: https://reviews.freebsd.org/D16580 Notes: svn path=/head/; revision=337269
* Fix word-size dumping.Konstantin Belousov2018-08-031-1/+1
| | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 12 days Notes: svn path=/head/; revision=337268
* Add -D option to pciconf(8) to mmap and dump content of the device BAR.Konstantin Belousov2018-08-012-27/+194
| | | | | | | | | | Discussed with: imp, jhb Sponsored by: The FreeBSD Foundation, Mellanox Technologies MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D15583 Notes: svn path=/head/; revision=337054
* Remove dead code (comma is either 0 or 1 for sure, no need to test).Warner Losh2018-01-052-5/+5
| | | | | | | | | Close /dev/pci when we're done with it. CID: 1007450, 1007449, 1008615, 1008614 Notes: svn path=/head/; revision=327581
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-202-0/+4
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Add constants and descriptions for some new PCI class definitionsScott Long2017-03-131-0/+3
| | | | Notes: svn path=/head/; revision=315190
* pciconf(8): Replace an assert with errxConrad Meyer2017-02-111-1/+2
| | | | | | | | | | | | The condition can be hit with simple user input, so it isn't an invariant. Just error out. PR: 217003 Reported by: Vladislav V. Prodan <admin at support.od.ua> Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=313647
* pciconf(8): Reallow trailing colon in selectorsConrad Meyer2017-01-121-4/+1
| | | | | | | | | | | | | Reallow device selectors to have a trailing colon, as documented in the manual page. This was broken along with some unrelated cleanups in r295806. PR: 215979 Reported by: David Boyd <David.Boyd49 at twc.com> Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=311953
* Add names for some DASP devices.Alexander Motin2016-10-211-0/+3
| | | | | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 1 week Notes: svn path=/head/; revision=307731
* Fix some logic in PCIe HotPlug; display EI statusEric van Gyzen2016-08-051-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | The interpretation of the Electromechanical Interlock Status was inverted, so we disengaged the EI if a card was inserted. Fix it to engage the EI if a card is inserted. When displaying the slot capabilites/status with pciconf: - We inverted the sense of the Power Controller Control bit, saying the power was off when it was really on (according to this bit). Fix that. - Display the status of the Electromechanical Interlock: EI(engaged) EI(disengaged) Reviewed by: jhb MFC after: 3 days Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D7426 Notes: svn path=/head/; revision=303788
* Don't repeat the the word 'the'Eitan Adler2016-05-171-1/+1
| | | | | | | | | | (one manual change to fix grammar) Confirmed With: db Approved by: secteam (not really, but this is a comment typo fix) Notes: svn path=/head/; revision=300050
* Output information about PCI-e devices with slots.John Baldwin2016-04-021-2/+42
| | | | | | | | In particular this includes additional information on HotPlug capable slots. Notes: svn path=/head/; revision=297501
* Various updates to the PCI-express capability output.John Baldwin2016-04-021-11/+17
| | | | | | | | | | | | | | | | - Group the output so that it follows the capability register set more closely. The first line now contains device information and the second line contains link information. As a result, ARI status is now output on the first line, and the link width is moved down to the second line of link information. - Only read the DEVICE_CAP2 register to check for ARI if the capability version is >= 2. - Don't output any link information if the link capability and status registers are zero. - Label the MSI interrupt index value as "MSI" instead of "IRQ". Notes: svn path=/head/; revision=297500
* pciconf: Silence a GCC warning.Pedro F. Giffuni2016-02-261-1/+1
| | | | | | | | | Fix the build on sparc64 and powerpc. Taken from: wma Notes: svn path=/head/; revision=296132
* Change format string in pciconf EA to jxWojciech Macek2016-02-261-3/+3
| | | | | | | Fix compilation error introduced by r296081 Notes: svn path=/head/; revision=296090
* Add support for Enhanced Allocation in pciconfWojciech Macek2016-02-261-0/+138
| | | | | | | | | | | | | | * Modified pciconf to print EA capability structure * Added register description to pcireg.h Obtained from: Semihalf Sponsored by: Cavium Approved by: cognet (mentor) Reviewed by: jhb Differential revision: https://reviews.freebsd.org/D5440 Notes: svn path=/head/; revision=296081
* Fix possible out-of-bounds access detected by Ulrich Spörleins "scan-build".Stefan Eßer2016-02-191-19/+15
| | | | | | | | | | | | | | Some invalid PCI device selectors could cause read access to an initialized variable next to the array (local loop index variable). While here, the parser has been made more strict with regard to the syntax of PCI device selectors as documented in the man-page. E.g. "pci:" used to be interpreted as "pci0:0". MFC after: 3 days Notes: svn path=/head/; revision=295806
* Use __unused instead of casting to void to silence the unused parameterStefan Eßer2016-02-182-10/+4
| | | | | | | | | | | warning. Fix the indentation of 2 lines to conform with the style of this file. Submitted by: jhb Notes: svn path=/head/; revision=295769
* Make WARNS=6 safe.Stefan Eßer2016-02-183-10/+19
| | | | | | | Tested with Clang 3.7.1, GCC 4.2.1 and GCC 4.8.5 on amd64. Notes: svn path=/head/; revision=295760
* Add a new -B flag for use with list mode (-l) that lists details aboutJohn Baldwin2015-11-232-13/+241
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bridges. Currently this includes information about what resources a bridge decodes on the upstream side for use by downstream devices including bus numbers, I/O port resources, and memory resources. Windows and bus ranges are enumerated for both PCI-PCI bridges and PCI-CardBus bridges. To simplify the implementation, all enumeration is done by reading the appropriate config space registers directly rather than querying the bridge driver in the kernel via new ioctls. This does result in a few limitations. First, an unimplemented window in a PCI-PCI bridge cannot be accurately detected as accurate detection requires writing to the window base register. That is not safe for pciconf(8). Instead, this assumes that any window where both the base and limit read as all zeroes is unimplemented. Second, the PCI-PCI bridge driver in a tree has a few quirks for PCI-PCI bridges that use subtractive decoding but do not indicate that via the progif config register. The list of quirks is duplicated in pciconf's source. Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D4171 Notes: svn path=/head/; revision=291225
* Note if relaxed ordering or no snoop is enabled for each PCI-express device.John Baldwin2015-11-051-0/+4
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=290412
* Prefer pciids database from ports if presentBaptiste Daroussin2015-09-063-4/+10
| | | | | | | | | | | | Given the pciids database on ports is updated more often than the one in base prefer this version if present, otherwise read the one from base. MFC after: 1 week Relnotes: yes Differential Revision: https://reviews.freebsd.org/D3391 Notes: svn path=/head/; revision=287522
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-274-45/+118
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge from head@274682Simon J. Gerraty2014-11-191-3/+3
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=274683
| * \ Merge head from 7/28Simon J. Gerraty2014-08-191-0/+1
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * | | Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | | Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | | Merge headSimon J. Gerraty2014-04-283-33/+227
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265044
| * \ \ \ Merge from headSimon J. Gerraty2013-09-051-20/+50
| |\ \ \ \ | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=255263
| * \ \ \ \ sync from headSimon J. Gerraty2013-04-121-1/+1
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=249429
| * | | | | | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | | | | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | | | | Sync with HEAD.David E. O'Brien2013-02-082-13/+15
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246555
| * \ \ \ \ \ \ Sync from headSimon J. Gerraty2012-11-043-37/+134
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545