aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/tws
Commit message (Collapse)AuthorAgeFilesLines
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-168-16/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | 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
* twe/tws: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-061-3/+1
|
* tws: fix "set but not used" in the tws driverRobert Wing2022-01-093-2/+4
| | | | | | | | With __diagused, these warnings were still emitted since INVARIANTS was defined but TWS_DEBUG was not. Fixes: a21f086a3316 ("Fix "set but not used" in the tws driver") Differential Revision: https://reviews.freebsd.org/D33784
* Fix "set but not used" in the tws driverScott Long2021-12-033-10/+7
| | | | Sponsored by: Rubicon Communications, LLC ("Netgate")
* Make tws(4) use xpt_alloc_ccb()/xpt_free_ccb() instead of malloc/free.Edward Tomasz Napierala2020-11-231-2/+3
| | | | | | | | | | | Reviewed by: imp MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26841 Notes: svn path=/head/; revision=367952
* tws: clean up empty lines in .c and .h filesMateusz Guzik2020-09-019-104/+3
| | | | Notes: svn path=/head/; revision=365092
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-3/+2
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* Extract eventfilter declarations to sys/_eventfilter.hConrad Meyer2019-05-201-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header pollution substantially. EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c files into appropriate headers (e.g., sys/proc.h, powernv/opal.h). As a side effect of reduced header pollution, many .c files and headers no longer contain needed definitions. The remainder of the patch addresses adding appropriate includes to fix those files. LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by sys/mutex.h since r326106 (but silently protected by header pollution prior to this change). No functional change (intended). Of course, any out of tree modules that relied on header pollution for sys/eventhandler.h, sys/lock.h, or sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped. Notes: svn path=/head/; revision=347984
* Add a bounds check to the tws(4) passthrough ioctl handler.Mark Johnston2019-01-051-2/+6
| | | | | | | | | | | | | | | | | tws_passthru() was doing a copyin of a user-specified request without validating its length, so a malicious request could overrun the buffer. By default, the tws(4) device file is only accessible as root. admbug: 825 Reported by: Anonymous of the Shellphish Grill Team Reviewed by: delphij MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18536 Notes: svn path=/head/; revision=342787
* Remove support for versions prior to FreeBSD 7.0 from twa(4)Warner Losh2018-11-133-20/+0
| | | | | | | | | This was for pre-7.0 CAM support. Neither the CAM nor the busdma changes over the years have not been ifdef'd. The code cannot build on 6.x anymore. Support for 6.4 ended in 2010, so remove them. Notes: svn path=/head/; revision=340418
* sys/dev: further 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. Notes: svn path=/head/; revision=326255
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-208-8/+24
| | | | | | | | | | | | | | | | | 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=326022
* Increase the number of LUNs this hardware can support.Josh Paetzel2017-05-171-1/+1
| | | | | | | | | | | | Experimentally we know this value works, but the hardware may support an even higher value. PR: 213876 Reported by: J.Catrysse@proximedia.be MFC after: 1 week Notes: svn path=/head/; revision=318401
* 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
* Remove NULL checks after M_WAITOK allocations from tws(4).Edward Tomasz Napierala2016-08-091-16/+0
| | | | | | | MFC after: 1 month Notes: svn path=/head/; revision=303872
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-032-3/+3
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* Replace several bus_alloc_resource() calls with bus_alloc_resource_any()Justin Hibbits2016-02-271-2/+2
| | | | | | | | | | | Most of these are BARs, and we allocate them in their entirety. The one outlier in this is amdsbwd, which calls bus_set_resource() prior. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D5370 (partial) Notes: svn path=/head/; revision=296135
* Replace several bus_alloc_resource() calls using default arguments with ↵Justin Hibbits2016-02-191-2/+2
| | | | | | | | | | | | bus_alloc_resource_any() Since these calls only use default arguments, bus_alloc_resource_any() is the right call. Differential Revision: https://reviews.freebsd.org/D5306 Notes: svn path=/head/; revision=295790
* CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenJung-uk Kim2015-05-221-2/+2
| | | | | | | | | | | | | years for head. However, it is continuously misused as the mpsafe argument for callout_init(9). Deprecate the flag and clean up callout_init() calls to make them more consistent. Differential Revision: https://reviews.freebsd.org/D2613 Reviewed by: jhb MFC after: 2 weeks Notes: svn path=/head/; revision=283291
* Use struct thread * directly instead of d_thread_t. This driver is notJohn Baldwin2015-01-052-4/+4
| | | | | | | | | likely to be merged back to stable/4. Reviewed by: delphij Notes: svn path=/head/; revision=276715
* Prevent overflow issues in timeout processingSteven Hartland2014-11-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Switch from timeout(9) to callout(9). In addition, do not teardown theJohn Baldwin2014-09-226-21/+27
| | | | | | | | | | IRQ handler while resetting the controller and add some missing teardown actions in detach. Reviewed by: delphij Notes: svn path=/head/; revision=272000
* Free the static DMA buffer holding the command ring during detach as wellJohn Baldwin2014-07-011-0/+13
| | | | | | | as if attach fails. Notes: svn path=/head/; revision=268109
* Get rid of the 'chan' from softc structure and use the latterXin LI2014-02-273-5/+3
| | | | | | | | | | | directly as sleep channel. PR: kern/174684 Submitted by: jmg MFC after: 2 weeks Notes: svn path=/head/; revision=262572
* Re-do r255853. Along with adding back the API/ABI changes from theScott Long2013-09-252-5/+6
| | | | | | | | | | | original, this hides the contents of cam_compat.h from ktrace/kdump/truss, avoiding problems there. There are no user-servicable parts in there, so no need for those tools to be groping around in there. Approved by: re Notes: svn path=/head/; revision=255871
* Revert r255853 pending fixes to build errors in usr.bin/kdumpGlen Barber2013-09-252-6/+5
| | | | | | | Approved by: re (implicit) Notes: svn path=/head/; revision=255865
* Update the CAM API for FreeBSD 10:Scott Long2013-09-242-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | - Remove the timeout_ch field. It's been deprecated since FreeBSD 7.0; MPSAFE drivers should be managing their own timeout storage. The remaining non-MPSAFE drivers have been modified to also manage their own storage, and should be considered for updating to MPSAFE (or removal) during the FreeBSD 10.x lifecycle. - Add fields related to soft timeouts and quality of service, to be used in upcoming work. - Add room for more flags in the CCB header and path_inq structures. - Begin support for extended 64-bit LUNs. - Bump the CAM version number to 0x18, but add compat shims. Tested with camcontrol and smartctl. Reviewed by: nathanw, ken, kib Approved by: re Obtained from: Netflix Notes: svn path=/head/; revision=255853
* Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIScott Long2013-08-121-15/+2
| | | | | | | | | | | | | | | | | | | | 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
* Fix typo in the definition of the TWS_DATA_CCB.Konstantin Belousov2013-05-231-1/+1
| | | | | | | Submitted by: Andreas Turriff <maillist@turriff.net> Notes: svn path=/head/; revision=250936
* MFprojects/camlock r248982:Alexander Motin2013-04-141-1/+1
| | | | | | | | | | | Stop abusing xpt_periph in random plases that really have no periph related to CCB, for example, bus scanning. NULL value is fine in such cases and it is correctly logged in debug messages as "noperiph". If at some point we need some real XPT periphs (alike to pmpX now), quite likely they will be per-bus, and not a single global instance as xpt_periph now. Notes: svn path=/head/; revision=249468
* Slightly tune locking to not call xpt_alloc_ccb() that is allowed to sleepAlexander Motin2013-04-012-7/+4
| | | | | | | while holding the SIM mutex. Notes: svn path=/head/; revision=248973
* Fix typo.Kevin Lo2013-03-011-1/+1
| | | | Notes: svn path=/head/; revision=247551
* Reform the busdma API so that new types may be added without modifyingKonstantin Belousov2013-02-122-37/+13
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Integrate changes from LSI vendor driver 10.80.00.005 to FreeBSD.Xin LI2012-10-195-39/+68
| | | | | | | | | PR: kern/172833 Submitted by: "Charles O'Donnell" <cao bus net> MFC after: 1 week Notes: svn path=/head/; revision=241753
* Use CAM_SEL_TIMEOUT and CAM_DEV_NOT_THERE to report missing targets orJim Harris2012-09-241-2/+2
| | | | | | | | | | | | | LUNs respectively. This removes a huge number of error messages from CAM during bus scans. Copied almost verbatim from mav's commit r237460. Submitted by: Mike Tancsa <mike at sentex dot net> MFC after: 3 days Notes: svn path=/head/; revision=240901
* Specify MTX_RECURSE for the controller's io_lock. Without it, tws(4)Jim Harris2012-09-241-1/+1
| | | | | | | | | | | | immediately panics on boot with INVARIANTS enabled. The driver already clearly expects to be able to recurse on this mutex - the main I/O is always recursing on this lock. Reported and tested by: Mike Tancsa <mike at sentex dot net> MFC after: 1 week Notes: svn path=/head/; revision=240900
* Convert a number of drivers to obtaining their parent DMA tag from theirScott Long2012-03-121-1/+1
| | | | | | | PCI device attachment. Notes: svn path=/head/; revision=232854
* Match surrounding style.Xin LI2012-01-161-1/+1
| | | | | | | Noticed by: avg Notes: svn path=/head/; revision=230200
* Don't forget to release queue lock when allocation of memory failed.Xin LI2012-01-031-0/+1
| | | | | | | | | Submitted by: Sascha Wildner <saw online de> Obtained from: DragonFly MFC after: 2 weeks Notes: svn path=/head/; revision=229416
* Do not define bool/true/false if the symbols already exist.Matthew D Fleming2011-12-121-0/+4
| | | | | | | | MFC after: 2 weeks Sponsored by: Isilon Systems, LLC Notes: svn path=/head/; revision=228443
* - There's no need to overwrite the default device method with the defaultMarius Strobl2011-11-221-6/+4
| | | | | | | | | | | | | 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
* Don't expose a constant array into global namespace.Xin LI2011-10-282-2/+1
| | | | | | | | Reported by: Ruslan Yakovlev <quazi bk ru> via yongari MFC after: 3 days Notes: svn path=/head/; revision=226887
* Return BUS_PROBE_DEFAULT instead of 0 (BUS_PROBE_SPECIFIC), allowingXin LI2011-10-171-1/+1
| | | | | | | | | vendor provided driver to override in kernel driver. MFC after: 3 days Notes: svn path=/head/; revision=226476
* Add the 9750 SATA+SAS 6Gb/s RAID controller card driver, tws(4). ManyXin LI2011-10-049-0/+4544
thanks for their contiued support to FreeBSD. This is version 10.80.00.003 from codeset 10.2.1 [1] Obtained from: LSI http://kb.lsi.com/Download16574.aspx [1] Notes: svn path=/head/; revision=226026