summaryrefslogtreecommitdiff
path: root/sys/dev/sym
AgeCommit message (Collapse)Author
2025-10-16style(9): white space after ; and around binary operatorsDavid E. O'Brien
in for() loops. Also, use 'while', where only the conditional test of 'for' was used. Reviewed by: sjg
2023-08-18sym(4): Add __diagused to nseg of getbaddrcb()Marius Strobl
The parameter is only used when compiling with INVARIANTS.
2023-08-16sys: Remove $FreeBSD$: one-line .c patternWarner Losh
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16sys: Remove $FreeBSD$: one-line .c comment patternWarner Losh
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
2023-08-16sys: Remove $FreeBSD$: two-line .h patternWarner Losh
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2022-05-06sym: Remove unused devclass argument to DRIVER_MODULE.John Baldwin
2022-04-09sym(4): Fix a typo in a source code commentGordon Bergling
- s/explicitely/explicitly/ MFC after: 3 days
2021-12-03Fix "set but not used" for the sym driver.Scott Long
Sponsored by: Rubicon Communications, LLC ("Netgate")
2021-01-22sym(4): handle mixed tagged/untagged commands gracefullyMarius Strobl
Handle the case of a tagged command arriving when there's an untagged one still outstanding gracefully instead of panicing. While at it: - Replace fancy arithmetics with a simple assignment as busy_itl can only ever be either 0 or 1. - Fix a comment typo in sym_free_ccb().
2021-01-22sym(4): fix nits reported by CoverityMarius Strobl
- In ___dma_getp(), remove dead code. [1] - In sym_sir_bad_scsi_status(), add missing FALLTHROUGH. [2] While at it: - For getbaddrcb(), remove __unused from the nseg argument as it's in fact used when compiling with INVARIANTS. - In sym_int_sir(), ensure in all branches that cp is not NULL before using it. Reported by: Coverity CID: 1008861 [1], 114996 [2]
2021-01-16sym(4): Remove remainder of SYM_SETUP_LP_PROBE_MAP supportMarius Strobl
Missed in 221ac8f4cd823a2b047c2807e2cf744c7176dd1f and r339575 respectively.
2020-11-28Make MAXPHYS tunable. Bump MAXPHYS to 1M.Konstantin Belousov
Replace MAXPHYS by runtime variable maxphys. It is initialized from MAXPHYS by default, but can be also adjusted with the tunable kern.maxphys. Make b_pages[] array in struct buf flexible. Size b_pages[] for buffer cache buffers exactly to atop(maxbcachebuf) (currently it is sized to atop(MAXPHYS)), and b_pages[] for pbufs is sized to atop(maxphys) + 1. The +1 for pbufs allow several pbuf consumers, among them vmapbuf(), to use unaligned buffers still sized to maxphys, esp. when such buffers come from userspace (*). Overall, we save significant amount of otherwise wasted memory in b_pages[] for buffer cache buffers, while bumping MAXPHYS to desired high value. Eliminate all direct uses of the MAXPHYS constant in kernel and driver sources, except a place which initialize maxphys. Some random (and arguably weird) uses of MAXPHYS, e.g. in linuxolator, are converted straight. Some drivers, which use MAXPHYS to size embeded structures, get private MAXPHYS-like constant; their convertion is out of scope for this work. Changes to cam/, dev/ahci, dev/ata, dev/mpr, dev/mpt, dev/mvs, dev/siis, where either submitted by, or based on changes by mav. Suggested by: mav (*) Reviewed by: imp, mav, imp, mckusick, scottl (intermediate versions) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27225 Notes: svn path=/head/; revision=368124
2020-09-01sym: clean up empty lines in .c and .h filesMateusz Guzik
Notes: svn path=/head/; revision=365148
2020-02-03Remove sparc64 kernel supportWarner Losh
Remove all sparc64 specific files Remove all sparc64 ifdefs Removee indireeect sparc64 ifdefs Notes: svn path=/head/; revision=357455
2018-10-22Remove the long obsolete SYM_SETUP_LP_PROBE_MAP option. It's not beenWarner Losh
needed for almost 20 years, and is totally useless now that ncr(4) has been removed. Relnotes: yes Notes: svn path=/head/; revision=339575
2017-11-27sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni
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
2017-08-07o Replace __riscv__ with __riscvRuslan Bukin
o Replace __riscv64 with (__riscv && __riscv_xlen == 64) This is required to support new GCC 7.1 compiler. This is compatible with current GCC 6.1 compiler. RISC-V is extensible ISA and the idea here is to have built-in define per each extension, so together with __riscv we will have some subset of these as well (depending on -march string passed to compiler): __riscv_compressed __riscv_atomic __riscv_mul __riscv_div __riscv_muldiv __riscv_fdiv __riscv_fsqrt __riscv_float_abi_soft __riscv_float_abi_single __riscv_float_abi_double __riscv_cmodel_medlow __riscv_cmodel_medany __riscv_cmodel_pic __riscv_xlen Reviewed by: ngie Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D11901 Notes: svn path=/head/; revision=322168
2017-02-20sys/dev: Replace zero with NULL for pointers.Pedro F. Giffuni
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
2017-02-19Remove dead mentions of CAM target mode APIs from drivers.Alexander Motin
This makes grepping kernel for target mode implementation much easier. Notes: svn path=/head/; revision=313949
2017-01-04Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)Alan Somers
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
2016-06-01Add a riscv define.Ruslan Bukin
Submitted by: Yukishige Shibata <y-shibat@mtd.biglobe.ne.jp> Notes: svn path=/head/; revision=301123
2016-05-13Fix a bug in r298340: "sim" was referenced after being unset.Mark Johnston
Notes: svn path=/head/; revision=299694
2016-05-03sys/dev: minor spelling fixes.Pedro F. Giffuni
Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
2016-04-26sys/dev: extend use of the howmany() macro when available.Pedro F. Giffuni
We have a howmany() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read. Notes: svn path=/head/; revision=298646
2016-04-21sys: use our roundup2/rounddown2() macros when param.h is available.Pedro F. Giffuni
rounddown2 tends to produce longer lines than the original code and when the code has a high indentation level it was not really advantageous to do the replacement. This tries to strike a balance between readability using the macros and flexibility of having the expressions, so not everything is converted. Notes: svn path=/head/; revision=298433
2016-04-20sym(4): Don't double-free 'sim' in failure caseConrad Meyer
Reported by: Coverity CID: 1006106 Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=298340
2016-04-10Cleanup unnecessary semicolons from the kernel.Pedro F. Giffuni
Found with devel/coccinelle. Notes: svn path=/head/; revision=297793
2015-10-08Add the arm64 define.Konstantin Belousov
Reviewed by: andrew, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3796 Notes: svn path=/head/; revision=289036
2014-11-21Prevent overflow issues in timeout processingSteven Hartland
Previously, any timeout value for which (timeout * hz) will overflow the signed integer, will give weird results, since callout(9) routines will convert negative values of ticks to '1'. For unsigned integer overflow we will get sufficiently smaller timeout values than expected. Switch from callout_reset, which requires conversion to int based ticks to callout_reset_sbt to avoid this. Also correct isci to correctly resolve ccb timeout. This was based on the original work done by Eygene Ryabinkin <rea@freebsd.org> back in 5 Aug 2011 which used a macro to help avoid the overlow. Differential Revision: https://reviews.freebsd.org/D1157 Reviewed by: mav, davide MFC after: 1 month Sponsored by: Multiplay Notes: svn path=/head/; revision=274819
2014-07-07Remove ia64.Marcel Moolenaar
This includes: o All directories named *ia64* o All files named *ia64* o All ia64-specific code guarded by __ia64__ o All ia64-specific makefile logic o Mention of ia64 in comments and documentation This excludes: o Everything under contrib/ o Everything under crypto/ o sys/xen/interface o sys/sys/elf_common.h Discussed at: BSDcan Notes: svn path=/head/; revision=268351
2014-06-10Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases,John Baldwin
don't create a map before calling bus_dmamem_alloc() (such maps were leaked). It is believed that the extra destroy of the map was generally harmless since bus_dmamem_alloc() often uses special maps for which bus_dmamap_destroy() is a no-op (e.g. on x86). Reviewed by: scottl Notes: svn path=/head/; revision=267340
2013-12-25In sys/dev/sym/sym_hipd.c, remove static functions sym_que_first(),Dimitry Andric
sym_que_last() and sym_remque_tail(), which are all unused since r53790. MFC after: 3 days Notes: svn path=/head/; revision=259880
2013-08-12Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIScott Long
command register. The lazy BAR allocation code in FreeBSD sometimes disables this bit when it detects a range conflict, and will re-enable it on demand when a driver allocates the BAR. Thus, the bit is no longer a reliable indication of capability, and should not be checked. This results in the elimination of a lot of code from drivers, and also gives the opportunity to simplify a lot of drivers to use a helper API to set the busmaster enable bit. This changes fixes some recent reports of disk controllers and their associated drives/enclosures disappearing during boot. Submitted by: jhb Reviewed by: jfv, marius, achadd, achim MFC after: 1 day Notes: svn path=/head/; revision=254263
2013-06-05- Flag sym(4) as supporting unmapped I/O; all necessary conversion actuallyMarius Strobl
already has been done as part of r246713. - Revert a part of r251402 in order to appease clang. Notes: svn path=/head/; revision=251403
2013-06-05Handle/mark/nuke unused arguments.Marius Strobl
Notes: svn path=/head/; revision=251402
2013-06-04CAM_DEV_QFREEZE handling should only be done on request submission butMarius Strobl
neither on completion nor by SIM drivers in the first place. This issue has been revealed by r249466. Reviewed by: mav MFC after: 3 days Notes: svn path=/head/; revision=251394
2013-02-25Don't try and negotiate sync mode if either period or offset are zero.Matt Jacob
PR: kern/163064 Partially Submitted by: Peter <pmc@citylink.dinoex.sub.org> MFC after: 1 month Notes: svn path=/head/; revision=247266
2013-02-12Reform the busdma API so that new types may be added without modifyingKonstantin Belousov
every architecture's busdma_machdep.c. It is done by unifying the bus_dmamap_load_buffer() routines so that they may be called from MI code. The MD busdma is then given a chance to do any final processing in the complete() callback. The cam changes unify the bus_dmamap_load* handling in cam drivers. The arm and mips implementations are updated to track virtual addresses for sync(). Previously this was done in a type specific way. Now it is done in a generic way by recording the list of virtuals in the map. Submitted by: jeff (sponsored by EMC/Isilon) Reviewed by: kan (previous version), scottl, mjacob (isp(4), no objections for target mode changes) Discussed with: ian (arm changes) Tested by: marius (sparc64), mips (jmallet), isci(4) on x86 (jharris), amd64 (Fabian Keil <freebsd-listen@fabiankeil.de>) Notes: svn path=/head/; revision=246713
2013-01-11Use better arm memory barrierWarner Losh
Notes: svn path=/head/; revision=245275
2013-01-10Clang complains about the comparision of fak < 0 always beingWarner Losh
false. It is right. Delete it because on the next line we catch all 'negative' cases with the test > 2, since 'negative' numbers are just really big unsigned numbers and we do an identical action. Notes: svn path=/head/; revision=245263
2012-12-13Add memory barrier macros for ARMOleksandr Tymoshenko
Notes: svn path=/head/; revision=244170
2012-07-19Revert the use of BUS_DMA_ALLOCNOW when creating the DMA tag for userMarius Strobl
data introduced in r236061. Using that flag doesn't make that much sense on this case as the DMA maps using it are also created during sym_pci_attach(). Moreover, due to the maxsegsz parameter used, doing so may exhaust the bounce pages pool on architectures requiring bounce pages. [1] While at it, use a slightly more appropriate maxsegsz parameter. PR: 169526 Submitted by: Mike Watters [1] MFC after: 3 days Notes: svn path=/head/; revision=238621
2012-06-14Fix a braino in r236469; the number of DMA tags required for handlingMarius Strobl
MAXPHYS should be based on PAGE_SIZE rather than SYM_CONF_DMA_BOUNDARY. While at it, reuse the SYM_CONF_MAX_SG macro for specifying the maximum number of DMA tags so sym(4) itself doesn't size memory beyond what's required for handling MAXPHYS. PR: 168928 MFC after: 3 days Notes: svn path=/head/; revision=237101
2012-06-02Take advantage of nitems().Marius Strobl
MFC after: 3 days Notes: svn path=/head/; revision=236488
2012-05-26Remove extraneous empty lines.Marius Strobl
MFC after: 3 day Notes: svn path=/head/; revision=236063
2012-05-26- When creating the DMA tag for user data, don't ask for more segmentsMarius Strobl
than required for handling MAXPHYS and report the resulting maximum I/O size to CAM instead of implicitly limiting it to DFLTPHYS. - Move the variables of sym_action2() out of nested scope as required by style(9) and remove extraneous curly braces. - Replace a magic value for PCIR_COMMAND with the appropriate macro. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. Tested with a HBA donated by wilko. MFC after: 3 days Notes: svn path=/head/; revision=236061
2011-10-07Merge from r225950:Marius Strobl
Set the sense residual properly. Reviewed by: ken Notes: svn path=/head/; revision=226095
2011-04-22More spelling fixes.Marius Strobl
Submitted by: N.J. Mann Notes: svn path=/head/; revision=220950
2011-04-22- Correct spelling. [1]Marius Strobl
- Remove variables which are unused besides initialization. [2] Submitted by: brucec [1], Christoph Mallon [2] Notes: svn path=/head/; revision=220944
2011-02-21Fix typos - remove duplicate "the".Rebecca Cran
PR: bin/154928 Submitted by: Eitan Adler <lists at eitanadler.com> MFC after: 3 days Notes: svn path=/head/; revision=218909