summaryrefslogtreecommitdiff
path: root/sys/dev/twe/twe.c
Commit message (Collapse)AuthorAgeFilesLines
* twe: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-13/+6
| | | | Notes: svn path=/head/; revision=365093
* 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-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: minor spelling fixes.Pedro F. Giffuni2016-05-031-1/+1
| | | | | | | 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-221-1/+1
| | | | | | | | | | 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-071-11/+14
| | | | | | | md5). Notes: svn path=/head/; revision=240209
* - Explicitly call twe_done() to poll the hardware when looping inJohn Baldwin2012-09-051-16/+19
| | | | | | | | | | | | | | | | | 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-131-57/+103
| | | | | | | | | | | | | | | | | | | | | | - 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
* Teach twe driver to report array stripe size to GEOM.Alexander Motin2009-12-251-2/+3
| | | | Notes: svn path=/head/; revision=200991
* Change the command argument to ioctl routines to u_long to avoidRoman Divacky2009-09-221-1/+1
| | | | | | | | | | | 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
* 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
* Undoing recent changes to make 3ware's i386 tools work on amd64, since there areVinod Kashyap2005-02-171-36/+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-081-9/+24
| | | | | | | | | | | | | | | 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-171-0/+36
| | | | | | | | | | 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
* Fix for a problem seen only on 6xxx series controllers, where-in theVinod Kashyap2004-06-111-3/+7
| | | | | | | | | | | | 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
* 1. Fixed potential problem that would cause out-of-order requests in ↵Vinod Kashyap2004-05-121-5/+5
| | | | | | | | | | | | | 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-251-17/+19
| | | | | | | | | | 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
* 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
* After extensive QA cycles at 3ware, bring the driver in-line with all thePaul Saab2003-12-021-48/+100
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Don't tsleep on NULLPaul Saab2003-08-191-2/+2
| | | | Notes: svn path=/head/; revision=119124
* Fix the busdma support in twe to support EINPROGRESS and enable it forPaul Saab2003-08-121-53/+52
| | | | | | | use with PAE kernels. Notes: svn path=/head/; revision=118816
* Properly support the 3ware generic API.Paul Saab2003-08-051-59/+92
| | | | | | | | | | | | | | - Build SGL's for ATA_PASSTHROUGH commands - Fallback to using the sgl_offset when the opcode is unknown for building SGL's/ - Add ioctl calls for adding and removing units. - Define previously undefined AEN's - Allocate memory for the ioctl payload in multiples of 512bytes. MFC after: 1 week Notes: svn path=/head/; revision=118508
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-2/+2
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-2/+2
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* Replace (ab)uses of "NULL" where "0" is really meant.Archie Cobbs2002-08-221-1/+1
| | | | Notes: svn path=/head/; revision=102291
* Update for the 6.9 firmware family (6xxx controllers), as well as forMike Smith2002-03-071-13/+57
| | | | | | | | | | | | the upcoming 7.4 family (7xxx controllers). - improved error reporting and handling - more diagnostic output - add extra command packet definitions - merge sources again with -stable Notes: svn path=/head/; revision=91790
* Fix some unused warnings. One function is only used ifPeter Wemm2002-02-271-0/+8
| | | | | | | TWE_SHUTDOWN_NOTIFICATION is defined, the other two are never used. Notes: svn path=/head/; revision=91449
* Minor updates:Mike Smith2001-05-071-21/+31
| | | | | | | | | | | - Rework of twe_report_request to use the command status value rather than the flags register. (Joel Jacobson @ 3ware) - Update to match some changes in -current vs. stable. MFC in: 1 week Notes: svn path=/head/; revision=76340
* Typo fix; use & to test for bits set in the status register.Mike Smith2001-02-261-1/+1
| | | | | | | Submitted by: Joel Jacobson <jake@3ware.com> Notes: svn path=/head/; revision=73104
* Remove a prototype for an unused and undefined debugging function.John Baldwin2001-01-231-1/+0
| | | | Notes: svn path=/head/; revision=71476
* - add support for crashdumps (courtesy of ps and Y!)Mike Smith2000-12-031-164/+171
| | | | | | | | | | - standardise error reporting for commands - simplify the driver-to-controller bio transfer - add bio in/out accounting - correctly preserve the command ID in twe_ioctl (thanks to joel@3ware) Notes: svn path=/head/; revision=69543
* If we can't get a command to back the bio we just took off the queue,Mike Smith2000-11-031-1/+3
| | | | | | | | put the bio back, otherwise we'll drop it when we bail. This was causing bio lossage under load, leading to eventual system lockup. Notes: svn path=/head/; revision=68289
* Add a missing newline to a diagnostic.Mike Smith2000-10-271-1/+1
| | | | Notes: svn path=/head/; revision=67683
* Major update to the 'twe' driver.Mike Smith2000-10-251-1003/+844
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Layout reorganisation to enhance portability. The driver now has a relatively MI 'core' and a FreeBSD-specific layer over the top. Since the NetBSD people have already done their own port, this is largely just to help me with the BSD/OS port. - Request ID allocation changed to improve performance (I'd been considering switching to this approach after having failed to come up with a better way to dynamically allocate request IDs, and seeing Andy Doran use it in the NetBSD port of the driver convinced me that I was wasting my time doing it any other way). Now we just allocate all the requests up front. - Maximum request count bumped back to 255 after characterisation of a firmware issue (off-by-one causing it to crash with 256 outstanding commands). - Control interface implemented. This allows 3ware's '3dm' utility to talk to the controller. 3dm will be available from 3ware shortly. - Controller soft-reset feature added; if the controller signals a firmware or protocol error, the controller will be reset and all outstanding commands will be retried. Notes: svn path=/head/; revision=67555
* Remove unneeded #include <machine/clock.h>Poul-Henning Kamp2000-10-151-1/+0
| | | | Notes: svn path=/head/; revision=67164
* Initial import of a driver for the 3ware Escalade family of ATA RAIDMike Smith2000-05-241-0/+1898
controllers. Notes: svn path=/head/; revision=60894