aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/twe
Commit message (Collapse)AuthorAgeFilesLines
* twe: Remove driverWarner Losh2023-05-117-4315/+0
| | | | Sponsored by: Netflix
* twe(4): Fix a common typo in a source code commentGordon Bergling2022-06-051-1/+1
| | | | | | - s/independant/independent/ MFC after: 3 days
* twe/tws: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-061-5/+2
|
* twe: Use devclass_find in twe_report debug function.John Baldwin2022-04-211-1/+1
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D34999
* The TWE driver should have been marked with gone_in for FreeBSD 13.x,Scott Long2022-02-261-0/+2
| | | | | | but was missed. Mark it for gone_in 14.0. The hardware hasn't been produced or supported in over 20 years, and even back then it was known to be electrically unreliable and prone to catastrophic failure.
* Fix "set but not used" in twe.Scott Long2022-02-261-2/+8
|
* Create wrapper for Giant taken for newbusWarner Losh2021-12-101-5/+5
| | | | | | | | | | | Create a wrapper for newbus to take giant and for busses to take it too. bus_topo_lock() should be called before interacting with newbus routines and unlocked with bus_topo_unlock(). If you need the topology lock for some reason, bus_topo_mtx() will provide that. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D31831
* twe: clean up empty lines in .c and .h filesMateusz Guzik2020-09-015-20/+9
| | | | Notes: svn path=/head/; revision=365093
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-1/+1
| | | | | | | | | | | | | | | | | | | 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
* Ever since the block layer expanded its command syntax beyond justScott Long2020-02-071-1/+5
| | | | | | | | | | | BIO_READ and BIO_WRITE, we've handled this expanded syntax poorly in drivers when the driver doesn't support a particular command. Do a sweep and fix that. Reported by: imp Notes: svn path=/head/; revision=357647
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-277-0/+14
| | | | | | | | | | | | | | | 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: minor spelling fixes.Pedro F. Giffuni2016-05-032-2/+2
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* Remove MAXBSIZE use from drivers where it has nothing to do.Alexander Motin2015-03-222-4/+6
| | | | | | | | | | In some cases limits are just not needed, in others -- DFLTPHYS is the right constant to use instead. MFC after: 1 month Notes: svn path=/head/; revision=280347
* Remove remaining 4.x compat shims. No resulting changes (verified byJohn Baldwin2012-09-074-53/+35
| | | | | | | md5). Notes: svn path=/head/; revision=240209
* - Explicitly call twe_done() to poll the hardware when looping inJohn Baldwin2012-09-052-16/+20
| | | | | | | | | | | | | | | | | twe_start() to simulate the behavior on 4.x where the driver dropped spl to allow interrupts to run to free up space in the command queue. Be careful to only poll if we are going to make at least one more attempt to queue the current command. Also, when polling, be careful to not call twe_startio() to queue more commands to avoid recursion. - Move the buffer for formatting AEN messages into the softc instead of using a single driver-wide static buffer. Requested by: scottl (1) Tested by: Mike Tancsa @ Sentex Notes: svn path=/head/; revision=240137
* Add locking to the twe(4) driver and make it MPSAFE:John Baldwin2012-08-134-180/+196
| | | | | | | | | | | | | | | | | | | | | | - Add per-controller configuration (sx) and I/O (mutex) locks. The configuration lock protects the relationship of volumes and drives while the I/O lock protects access to the controller's registers and the main I/O path. - Remove some checks for M_WAITOK malloc()'s failing. - Remove the explicit bus space tag/handle from the softc and use bus_*() rather than bus_space_*(). - Reuse the existing new-bus sysctl context instead of creating a new one. - Remove compat shims for FreeBSD 4.x. - Use pci_enable_busmaster() rather than doing it by hand, and rely on bus_alloc_resource() to enable PCI I/O decoding. Tested by: Mike Tancsa mike sentex net Reviewed by: scottl (partially) MFC after: 1 month Notes: svn path=/head/; revision=239244
* 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
* - There's no need to overwrite the default device method with the defaultMarius Strobl2011-11-221-5/+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
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.Ed Schouten2011-11-071-1/+1
| | | | | | | This means that their use is restricted to a single C file. Notes: svn path=/head/; revision=227293
* Teach twe driver to report array stripe size to GEOM.Alexander Motin2009-12-253-2/+11
| | | | Notes: svn path=/head/; revision=200991
* Change the command argument to ioctl routines to u_long to avoidRoman Divacky2009-09-222-2/+2
| | | | | | | | | | | truncating the command to 32bit on 64bit archs where int is 32bit (ie. amd64). Approved by: scottl Approved by: ed (mentor, implicit) Notes: svn path=/head/; revision=197409
* Temporarily revert the new-bus locking for 8.0 release. It will beJohn Baldwin2009-08-201-6/+0
| | | | | | | | | reintroduced after HEAD is reopened for commits by re@. Approved by: re (kib), attilio Notes: svn path=/head/; revision=196403
* Make the newbus subsystem Giant free by adding the new newbus sxlock.Attilio Rao2009-08-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The newbus lock is responsible for protecting newbus internIal structures, device states and devclass flags. It is necessary to hold it when all such datas are accessed. For the other operations, softc locking should ensure enough protection to avoid races. Newbus lock is automatically held when virtual operations on the device and bus are invoked when loading the driver or when the suspend/resume take place. For other 'spourious' operations trying to access/modify the newbus topology, newbus lock needs to be automatically acquired and dropped. For the moment Giant is also acquired in some key point (modules subsystem) in order to avoid problems before the 8.0 release as module handlers could make assumptions about it. This Giant locking should go just after the release happens. Please keep in mind that the public interface can be expanded in order to provide more support, if there are really necessities at some point and also some bugs could arise as long as the patch needs a bit of further testing. Bump __FreeBSD_version in order to reflect the newbus lock introduction. Reviewed by: ed, hps, jhb, imp, mav, scottl No answer by: ariff, thompsa, yongari Tested by: pho, G. Trematerra <giovanni dot trematerra at gmail dot com>, Brandon Gooch <jamesbrandongooch at gmail dot com> Sponsored by: Yahoo! Incorporated Approved by: re (ksmith) Notes: svn path=/head/; revision=196037
* We no longer need to use d_thread_t, migrate to struct thread *.Warner Losh2009-05-201-3/+3
| | | | Notes: svn path=/head/; revision=192450
* Use si_drv1 instead of dev2unit() in twe(4) and twa(4)Ed Schouten2009-04-141-4/+2
| | | | | | | Reviewed by: scottl Notes: svn path=/head/; revision=191060
* Replace all calls to minor() with dev2unit().Ed Schouten2008-09-271-2/+2
| | | | | | | | | | | | | | | | | | After I removed all the unit2minor()/minor2unit() calls from the kernel yesterday, I realised calling minor() everywhere is quite confusing. Character devices now only have the ability to store a unit number, not a minor number. Remove the confusion by using dev2unit() everywhere. This commit could also be considered as a bug fix. A lot of drivers call minor(), while they should actually be calling dev2unit(). In -CURRENT this isn't a problem, but it turns out we never had any problem reports related to that issue in the past. I suspect not many people connect more than 256 pieces of the same hardware. Reviewed by: kib Notes: svn path=/head/; revision=183397
* Add missing \n.Christian Brueffer2008-02-121-1/+1
| | | | | | | | | | PR: 120341 Submitted by: CyberLeo <cyberleo@cyberleo.net> Approved by: rwatson (mentor), aradford@amcc.com MFC after: 3 days Notes: svn path=/head/; revision=176200
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-231-1/+2
| | | | | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@ Notes: svn path=/head/; revision=166901
* Normalize a significant number of kernel malloc type names:Robert Watson2005-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | - Prefer '_' to ' ', as it results in more easily parsed results in memory monitoring tools such as vmstat. - Remove punctuation that is incompatible with using memory type names as file names, such as '/' characters. - Disambiguate some collisions by adding subsystem prefixes to some memory types. - Generally prefer lower case to upper case. - If the same type is defined in multiple architecture directories, attempt to use the same name in additional cases. Not all instances were caught in this change, so more work is required to finish this conversion. Similar changes are required for UMA zone names. Notes: svn path=/head/; revision=151897
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386Yoshihiro Takahashi2005-05-291-1/+0
| | | | | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr) Notes: svn path=/head/; revision=146734
* Use correct flags for bus_dma_tag_create().Scott Long2005-03-061-4/+4
| | | | Notes: svn path=/head/; revision=143191
* Use BUS_PROBE_DEFAULT in preference to 0. Also for vx, returnWarner Losh2005-03-011-1/+1
| | | | | | | | BUS_PROBE_LOW_PRIORITY in stead of ifdef for devices that xl and vx both support so that xl will snarf them on up. Notes: svn path=/head/; revision=142880
* Undoing recent changes to make 3ware's i386 tools work on amd64, since there areVinod Kashyap2005-02-172-59/+0
| | | | | | | now amd64 versions of CLI and 3DM2 available. Notes: svn path=/head/; revision=142025
* Fix crashdumps on twe. The twe_immediate_request() path was not onlyScott Long2005-02-082-12/+25
| | | | | | | | | | | | | | | copying data to a temporary buffer before the I/O, but also copying that temporary buffer back to the original data location after the I/O. When you're dumping kernel heap and stack and protected pages, this is very very bad. A belated thanks to Robert Watson for donating hardware for this (and future) work. MFC after: 3 days Notes: svn path=/head/; revision=141492
* Recognize the 32-bit form of the twe binary passthrough ioctl()s so thatPeter Wemm2004-12-172-0/+59
| | | | | | | | | | there is some hope for the 32-bit management utilities to run. I've used the cli successfully, but 3dm2 doesn't work for other reasons. Of course, a native binary of the 3dm2 and cli would be much better, but that doesn't exist. Notes: svn path=/head/; revision=138982
* Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp2004-06-162-5/+5
| | | | | | | Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
* Fix for a problem seen only on 6xxx series controllers, where-in theVinod Kashyap2004-06-113-8/+17
| | | | | | | | | | | | driver tries to submit the same request repeatedly, on finding the controller cmd queue to be full. Submitted by:ps, vkashyap Reviewed by:re Approved by:re Notes: svn path=/head/; revision=130358
* Add missing <sys/module.h> includesPoul-Henning Kamp2004-05-301-0/+1
| | | | Notes: svn path=/head/; revision=129879
* 1. Fixed potential problem that would cause out-of-order requests in ↵Vinod Kashyap2004-05-123-11/+7
| | | | | | | | | | | | | twe_startio. 2. Changed version. Submitted by: scottl Reviewed by: vkashyap Approved by: re Notes: svn path=/head/; revision=129144
* 1. Better handle a return value of EINPROGRESS from bus_dmamap_load.Vinod Kashyap2004-03-253-22/+38
| | | | | | | | | | 2. Check for bad return value from twe_map_request in places where there was no checking. Reviewed by: ps Notes: svn path=/head/; revision=127415
* Convert callers to the new bus_alloc_resource_any(9) API.Nate Lawson2004-03-171-2/+4
| | | | | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde Notes: svn path=/head/; revision=127135
* Check that twed_sc is non-NULL before dereferencing it, not after.Colin Percival2004-02-221-2/+2
| | | | | | | | Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor) Notes: svn path=/head/; revision=126115
* Fix off-by-one error: sc->twe_drive is an array of TWE_MAX_UNITS elements.Colin Percival2004-02-221-1/+1
| | | | | | | | Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor) Notes: svn path=/head/; revision=126099
* Device megapatch 4/6:Poul-Henning Kamp2004-02-211-0/+2
| | | | | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags. Notes: svn path=/head/; revision=126080
* Device megapatch 1/6:Poul-Henning Kamp2004-02-212-3/+0
| | | | | | | | | | Free approx 86 major numbers with a mostly automatically generated patch. A number of strategic drivers have been left behind by caution, and a few because they still (ab)use their major number. Notes: svn path=/head/; revision=126076
* Change the disk(9) API in order to make device removal more robust.Poul-Henning Kamp2004-02-181-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the "struct disk" were owned by the device driver and this gave us problems when the device disappared and the users of that device were not immediately disappearing. Now the struct disk is allocate with a new call, disk_alloc() and owned by geom_disk and just abandonned by the device driver when disk_create() is called. Unfortunately, this results in a ton of "s/\./->/" changes to device drivers. Since I'm doing the sweep anyway, a couple of other API improvements have been carried out at the same time: The Giant awareness flag has been flipped from DISKFLAG_NOGIANT to DISKFLAG_NEEDSGIANT A version number have been added to disk_create() so that we can detect, report and ignore binary drivers with old ABI in the future. Manual page update to follow shortly. Notes: svn path=/head/; revision=125975
* After extensive QA cycles at 3ware, bring the driver in-line with all thePaul Saab2003-12-027-157/+183
| | | | | | | | | | | | | | | | | | | | | | | | issues which they found and asked to be changed so 3ware can offcially support the driver. Summary of the most significant changes: - TWE_OVERRIDE is no longer supported - If twe_getparam failed, bogus data would be returned to the caller - Cache the device unit in the twe_drive structure to aid debugging - Add the 3ware driver version. - Proper return error codes for many functions. - Track the minimum queue length statistics - 4.x compat: use the cached unit number from the twe_drive structure instead of the the cached si_drv2. 3ware found that after many loads and unloads that si_drv2 became corrupted. This did not happen in -current. Submitted by: Vinod Kashyap (with modifications by me) Approved by: re (rwatson) Notes: svn path=/head/; revision=123103
* Correct the structure packing.Paul Saab2003-11-061-14/+14
| | | | | | | Reported by: Vinod Kashyap <vkashyap@3WARE.com> Notes: svn path=/head/; revision=122168
* Prefer new location of pci include files (which have only been in theWarner Losh2003-08-221-2/+2
| | | | | | | | tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD. Notes: svn path=/head/; revision=119287
* Don't tsleep on NULLPaul Saab2003-08-191-2/+2
| | | | Notes: svn path=/head/; revision=119124