aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ppbus
Commit message (Collapse)AuthorAgeFilesLines
* Internal scheduling priorities: Always use symbolic onesOlivier Certner2025-07-282-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Replace priorities specified by a base priority and some hardcoded offset value by symbolic constants. Hardcoded offsets prevent changing the difference between priorities without changing their relative ordering, and is generally a dangerous practice since the resulting priority may inadvertently belong to a different selection policy's range. Since RQ_PPQ is 4, differences of less than 4 are insignificant, so just remove them. These small differences have not been changed for years, so it is likely they have no real meaning (besides having no practical effect). One can still consult the changes history to recover them if ever needed. No functional change (intended). MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45390 (cherry picked from commit 8ecc41918066422d6788a67251b22d11a6efeddf)
* net: Remove unneeded NULL check for the allocated ifnetZhenlei Huang2024-07-121-4/+0
| | | | | | | | | | | | | Change 4787572d0580 made if_alloc_domain() never fail, then also do the wrappers if_alloc(), if_alloc_dev(), and if_gethandle(). No functional change intended. Reviewed by: kp, imp, glebius, stevek MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45740 (cherry picked from commit aa3860851b9f6a6002d135b1cac7736e0995eedc)
* sys: Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-1610-17/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-167-14/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-1214-14/+14
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* Mechanically convert if_plip(4) to IfAPIJustin Hibbits2023-02-061-49/+43
| | | | | Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37854
* ppbus/ppc: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-067-21/+10
|
* Remove unused iicbb_devclass.John Baldwin2022-05-061-1/+1
|
* lpt: Mark ppbus in lptout unused.John Baldwin2022-04-131-1/+1
| | | | | It is used both in an assertion under INVARIANTS as well as in a custom debug trace.
* ppi_probe: eliminate unused variable ppiWarner Losh2022-04-051-4/+0
| | | | Sponsored by: Netflix
* ppbus(4): Fix a typo in source code commentGordon Bergling2021-11-191-1/+1
| | | | | | | - s/quering/querying/ Obtained from: NetBSD MFC after: 3 days
* ppbus: Set the lock for pps interface, update to latest apiWarner Losh2021-09-013-2/+15
| | | | | | | | | | | Since we take a lock when we enter the ioctl, we need to set driver_mtx in the pps structure so it can be dropped while sleeping during a call to timepps_fetch() with a non-zero timeout (PPS_CANWAIT feature). MFC After: 5 days Sponsored by: Netflix Reviewed by: ian Differential Revision: https://reviews.freebsd.org/D31763
* ppbus: Fix the direction of the PPISEPPA ioctlMark Johnston2021-01-191-1/+1
| | | | | PR: 252711 Submitted by: Eugene <merfi@nearly.ru>
* ppbus: clean up empty lines in .c and .h filesMateusz Guzik2020-09-0111-27/+0
| | | | Notes: svn path=/head/; revision=365176
* Miscellaneous typo fixesEd Maste2020-02-071-1/+1
| | | | | | | | Submitted by: Gordon Bergling <gbergling_gmail.com> Differential Revision: https://reviews.freebsd.org/D23453 Notes: svn path=/head/; revision=357664
* Remove vpo.4Warner Losh2020-02-024-2147/+0
| | | | | | | | | | | | | | | | The Parallel Port SCSI adapter was interesting for 100MB ZIP drives, but is no longer used or maintained. Remove it from the tree. The Parallel Port microsequencer (microseq.9) is now mostly unused in the tree, but remains. PPI still refrences it, but doesn't use its full functionality. Relnotes: Yes Reviewed by: rgrimes@, Ihor Antonov Discussed on: arch@ Differential Revision: https://reviews.freebsd.org/D23389 Notes: svn path=/head/; revision=357394
* Add deprecation notice to vpo.4Warner Losh2020-02-021-0/+1
| | | | | | | | | | | | | | | This driver has seen no real changes for almost 20 years. It's for hardware that's 25 years old. It has no reports of active use, nor has it been seen in the NYCBug dmesg database at all. Schedule its removal for 13.0. Reviewed by: rgrimes@ (earlier version) Relnote: Yes MFC After: 3 days Differential Revision: https://reviews.freebsd.org/D23403 Notes: svn path=/head/; revision=357393
* Use callout_func_t instead of the deprecated timeout_t.John Baldwin2019-12-101-1/+1
| | | | | | | | Reviewed by: kib, imp Differential Revision: https://reviews.freebsd.org/D22752 Notes: svn path=/head/; revision=355601
* SPDX: use the Beerware identifier.Pedro F. Giffuni2017-11-301-0/+2
| | | | Notes: svn path=/head/; revision=326408
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2718-0/+36
| | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=326255
* spdx: initial adoption of licensing ID tags.Pedro F. Giffuni2017-11-181-0/+2
| | | | | | | | | | | | | | | | | | | | 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. Initially, only tag files that use BSD 4-Clause "Original" license. RelNotes: yes Differential Revision: https://reviews.freebsd.org/D13133 Notes: svn path=/head/; revision=325966
* Remove register keyword from sys/ and ANSIfy prototypesEd Maste2017-05-172-4/+4
| | | | | | | | | | | | | | | A long long time ago the register keyword told the compiler to store the corresponding variable in a CPU register, but it is not relevant for any compiler used in the FreeBSD world today. ANSIfy related prototypes while here. Reviewed by: cem, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D10193 Notes: svn path=/head/; revision=318389
* sys/dev: Replace zero with NULL for pointers.Pedro F. Giffuni2017-02-202-3/+3
| | | | | | | | | | | Makes things easier to read, plus architectures may set NULL to something different than zero. Found with: devel/coccinelle MFC after: 3 weeks Notes: svn path=/head/; revision=313982
* Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)Alan Somers2017-01-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are fixed-length strings. AFAICT the only place they're read is in sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated. However, the kernel doesn't null-terminate them. A bunch of copy-pasted code uses strncpy to write them, and doesn't guarantee null-termination. For at least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually overflows. You can see the result by doing "camcontrol negotiate da0 -v". This change null-terminates those fields everywhere they're set in the kernel. It also shortens a few strings to ensure they'll fit within the 16-character field. PR: 215474 Reported by: Coverity CID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005 CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000 CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014 CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021 CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027 CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187 CID: 1010035 1010036 1010042 1010041 1010040 1010039 Reviewed by: imp, sephe, slm MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9037 Differential Revision: https://reviews.freebsd.org/D9038 Notes: svn path=/head/; revision=311305
* With clang 3.9.0, compiling ppbus(4) results in the following warnings:Dimitry Andric2016-09-033-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | sys/dev/ppbus/ppb_1284.c:296:46: error: implicit conversion from 'int' to 'char' changes value from 144 to -112 [-Werror,-Wconstant-conversion] if ((error = do_peripheral_wait(bus, SELECT | nBUSY, 0))) { ~~~~~~~~~~~~~~~~~~ ~~~~~~~^~~~~~~ sys/dev/ppbus/ppb_1284.c:785:48: error: implicit conversion from 'int' to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion] if (do_1284_wait(bus, nACK | SELECT | PERROR | nBUSY, ~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ sys/dev/ppbus/ppb_1284.c:786:29: error: implicit conversion from 'int' to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion] nACK | SELECT | PERROR | nBUSY)) { ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ This is because nBUSY is 0x80, so the plain char argument is wrapped to a negative value. Fix this in a minimal fashion, by using uint8_t in a few places. Reviewed by: emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D7771 Notes: svn path=/head/; revision=305345
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-034-13/+13
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* Fix debug printfWarner Losh2016-03-161-1/+1
| | | | Notes: svn path=/head/; revision=296944
* Make sure we check for CAM_CDB_POINTER for all drivers. Also, for theWarner Losh2016-03-151-5/+11
| | | | | | | | | drivers I've touched, filter out CAM_CDB_PHYS. Differential Revision: https://reviews.freebsd.org/D5585 Notes: svn path=/head/; revision=296891
* Mechanically convert to if_inc_counter().Gleb Smirnoff2014-09-191-11/+11
| | | | Notes: svn path=/head/; revision=271849
* The r48589 promised to remove implicit inclusion of if_var.h soon. PrepareGleb Smirnoff2013-10-261-0/+1
| | | | | | | | | | | to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=257176
* Clean up SIOCSIFDSTADDR usage from ifnet drivers. The ioctl itself isGleb Smirnoff2013-09-111-1/+0
| | | | | | | | | | | extremely outdated, and I doubt that it was ever used for ifnet drivers. It was used for AF_INET sockets in pre-FreeBSD time. Approved by: re (hrs) Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=255471
* Add const qualifier to the dst parameter of the ifnet if_output method.Gleb Smirnoff2013-04-261-2/+2
| | | | Notes: svn path=/head/; revision=249925
* - Corrrect mispellings of word usefulGabor Kovesdan2013-04-171-1/+1
| | | | | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de> (via private mail) Notes: svn path=/head/; revision=249585
* - Correct mispellings of the word occurrenceGabor Kovesdan2013-04-171-1/+1
| | | | | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de> (via private mail) Notes: svn path=/head/; revision=249582
* Rename device_delete_all_children() into device_delete_children().Hans Petter Selasky2011-11-221-1/+1
| | | | | | | | Suggested by: jhb @ and marius @ MFC after: 1 week Notes: svn path=/head/; revision=227849
* - There's no need to overwrite the default device method with the defaultMarius Strobl2011-11-221-4/+1
| | | | | | | | | | | | | one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9) since r52045) but even recently added device drivers do this unnecessarily. Discussed with: jhb, marcel - While at it, use DEVMETHOD_END. Discussed with: jhb - Also while at it, use __FBSDID. Notes: svn path=/head/; revision=227843
* - Use ppb_assert_locked() rather than using explicit mtx_assert callAttilio Rao2011-11-224-34/+12
| | | | | | | | | - Make ppbus code agnostic in regard of INVARIANTS option MFC after: 2 weeks Notes: svn path=/head/; revision=227814
* Introduce macro stubs in the mutex implementation that will be alwaysAttilio Rao2011-11-201-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | defined and will allow consumers, willing to provide options, file and line to locking requests, to not worry about options redefining the interfaces. This is typically useful when there is the need to build another locking interface on top of the mutex one. The introduced functions that consumers can use are: - mtx_lock_flags_ - mtx_unlock_flags_ - mtx_lock_spin_flags_ - mtx_unlock_spin_flags_ - mtx_assert_ - thread_lock_flags_ Spare notes: - Likely we can get rid of all the 'INVARIANTS' specification in the ppbus code by using the same macro as done in this patch (but this is left to the ppbus maintainer) - all the other locking interfaces may require a similar cleanup, where the most notable case is sx which will allow a further cleanup of vm_map locking facilities - The patch should be fully compatible with older branches, thus a MFC is previewed (infact it uses all the underlying mechanisms already present). Comments review by: eadler, Ben Kaduk Discussed with: kib, jhb MFC after: 1 month Notes: svn path=/head/; revision=227758
* Move the device_delete_all_children() function from usb_util.cHans Petter Selasky2011-11-191-8/+2
| | | | | | | | | | | to kern/subr_bus.c. Simplify this function so that it no longer depends on malloc() to execute. Identify a few other places where it makes sense to use device_delete_all_children(). MFC after: 1 week Notes: svn path=/head/; revision=227701
* Add missing va_end() to clean up after va_start().Christian Brueffer2011-10-071-0/+1
| | | | | | | | | CID: 4725 Found with: Coverity Prevent(tm) MFC after: 1 week Notes: svn path=/head/; revision=226116
* Tag mbufs of all incoming frames or packets with the interface's FIBBjoern A. Zeeb2011-07-031-0/+4
| | | | | | | | | | | | setting (either default or if supported as set by SIOCSIFFIB, e.g. from ifconfig). Submitted by: Alexander V. Chernikov (melifaro ipfw.ru) Reviewed by: julian MFC after: 2 weeks Notes: svn path=/head/; revision=223741
* bus_add_child: change type of order parameter to u_intAndriy Gapon2010-09-101-1/+1
| | | | | | | | | | | | | This reflects actual type used to store and compare child device orders. Change is mostly done via a Coccinelle (soon to be devel/coccinelle) semantic patch. Verified by LINT+modules kernel builds. Followup to: r212213 MFC after: 10 days Notes: svn path=/head/; revision=212413
* Add new tunable 'net.link.ifqmaxlen' to set default send interfaceMaxim Sobolev2010-05-031-1/+1
| | | | | | | | | | | | | queue length. The default value for this parameter is 50, which is quite low for many of today's uses and the only way to modify this parameter right now is to edit if_var.h file. Also add read-only sysctl with the same name, so that it's possible to retrieve the current value. MFC after: 1 month Notes: svn path=/head/; revision=207554
* MFp4: Large set of CAM inprovements.Alexander Motin2010-01-281-37/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Unify bus reset/probe sequence. Whenever bus attached at boot or later, CAM will automatically reset and scan it. It allows to remove duplicate code from many drivers. - Any bus, attached before CAM completed it's boot-time initialization, will equally join to the process, delaying boot if needed. - New kern.cam.boot_delay loader tunable should help controllers that are still unable to register their buses in time (such as slow USB/ PCCard/ CardBus devices), by adding one more event to wait on boot. - To allow synchronization between different CAM levels, concept of requests priorities was extended. Priorities now split between several "run levels". Device can be freezed at specified level, allowing higher priority requests to pass. For example, no payload requests allowed, until PMP driver enable port. ATA XPT negotiate transfer parameters, periph driver configure caching and so on. - Frozen requests are no more counted by request allocation scheduler. It fixes deadlocks, when frozen low priority payload requests occupying slots, required by higher levels to manage theit execution. - Two last changes were holding proper ATA reinitialization and error recovery implementation. Now it is done: SATA controllers and Port Multipliers now implement automatic hot-plug and should correctly recover from timeouts and bus resets. - Improve SCSI error recovery for devices on buses without automatic sense reporting, such as ATAPI or USB. For example, it allows CAM to wait, while CD drive loads disk, instead of immediately return error status. - Decapitalize diagnostic messages and make them more readable and sensible. - Teach PMP driver to limit maximum speed on fan-out ports. - Make boot wait for PMP scan completes, and make rescan more reliable. - Fix pass driver, to return CCB to user level in case of error. - Increase number of retries in cd driver, as device may return several UAs. Notes: svn path=/head/; revision=203108
* Check pointer for NULL before dereferencing it, not after.Christian Brueffer2009-10-222-4/+9
| | | | | | | | | PR: 138387, 138388 Submitted by: Patroklos Argyroudis <argp@census-labs.com> MFC after: 1 week Notes: svn path=/head/; revision=198358
* Correct a copy/paste bug in a comment. lptclose() checks once a second toJohn Baldwin2009-10-131-1/+1
| | | | | | | see if the ppc hardware has gone idle rather than four times a second. Notes: svn path=/head/; revision=198028
* When the timeout backoff hits the maximum value, leave it capped at theJohn Baldwin2009-10-051-1/+1
| | | | | | | | | | | maximum value rather than setting it to the result of a boolean expression that is always true. Submitted by: Joseph Kong MFC after: 1 month Notes: svn path=/head/; revision=197772
* Lock bus scan.Alexander Motin2009-09-221-3/+4
| | | | Notes: svn path=/head/; revision=197420
* Fix iSCSI initiator and vpo driver operation, broken by CAM changes.Alexander Motin2009-08-181-0/+2
| | | | | | | | Reviewed by: scottl, Danny Braniss Approved by: re (rwatson) Notes: svn path=/head/; revision=196352