summaryrefslogtreecommitdiff
path: root/sys/dev/asr/asr.c
Commit message (Collapse)AuthorAgeFilesLines
* Garbage collect the asr driver. Hardware for it has not been produced inScott Long2015-01-021-3849/+0
| | | | | | | | | | | | roughly 10 years, and the driver has not enjoyed any significant maintenance since long before that. Despite well-meaning efforts from a number of people, myself included, it never made the jump to 64-bit and was relegated to the back-corners of i386. Now its frailty is hampering forward progress with Clang. Any renewed engineering efforts are of course welcome and can happen outside of the tree. No MFC of this is planned. Notes: svn path=/head/; revision=276526
* Fix build with asr driverSteven Hartland2014-11-221-20/+19
| | | | | | | | | | | | This was broken by r274819 as asr is not in GENERIC because its not 64bit safe. MFC after: 1 month X-MFC-With: r274819 Sponsored by: Multiplay Notes: svn path=/head/; revision=274852
* Prevent overflow issues in timeout processingSteven Hartland2014-11-211-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Adjust various SCSI drivers to handle either a 32-bit or 64-bit lun_id_t,Nathan Whitehorn2013-10-301-2/+3
| | | | | | | | | | mostly by adjustments to debugging printf() format specifiers. For high numbered LUNs, also switch to printing them in hex as per SAM-5. MFC after: 2 weeks Notes: svn path=/head/; revision=257381
* Re-do r255853. Along with adding back the API/ABI changes from theScott Long2013-09-251-9/+24
| | | | | | | | | | | 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-251-24/+9
| | | | | | | Approved by: re (implicit) Notes: svn path=/head/; revision=255865
* Update the CAM API for FreeBSD 10:Scott Long2013-09-241-9/+24
| | | | | | | | | | | | | | | | | | | | | | | | | - 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-3/+1
| | | | | | | | | | | | | | | | | | | | 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
* Replace homegrown list implementation in sys/dev/asr/asr.c withDimitry Andric2012-04-201-11/+11
| | | | | | | | | | | STAILQ(). While here, fix another clang warning about a switch which tests an enum type for a regular integer value. Submitted by: jhb MFC after: 1 week Notes: svn path=/head/; revision=234503
* 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
* Merge from r225950:Marius Strobl2011-10-131-0/+14
| | | | | | | | | Set the sense residual properly. Reviewed by: ken Notes: svn path=/head/; revision=226350
* Don't zero 'Info' after setting it up in the ASR_IOCTL_COMPAT case.Brian Somers2010-11-251-2/+2
| | | | | | | MFC after: 2 days Notes: svn path=/head/; revision=215843
* MFp4: Large set of CAM inprovements.Alexander Motin2010-01-281-1/+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
* Unmark the ASR Compat IOCTLs as BURN_BRIDGES, per scottl@Warner Losh2009-05-091-2/+0
| | | | Notes: svn path=/head/; revision=191939
* Replace all calls to minor() with dev2unit().Ed Schouten2008-09-271-1/+1
| | | | | | | | | | | | | | | | | | 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
* Prepare for future integration between CAM and newbus. xpt_bus_registerScott Long2007-06-171-1/+1
| | | | | | | | | | now takes a device_t to be the parent of the bus that is being created. Most SIMs have been updated with a reasonable argument, but a few exceptions just pass NULL for now. This argument isn't used yet and the newbus integration likely won't be ready until after 7.0-RELEASE. Notes: svn path=/head/; revision=170872
* Remove Giant from CAM. Drivers (SIMs) now register a mutex that CAM willScott Long2007-04-151-1/+2
| | | | | | | | | | | | | | use to synchornize and protect all data objects that are used for that SIM. Drivers that are not yet MPSAFE register Giant and operate as usual. RIght now, no drivers are MPSAFE, though a few will be changed in the coming week as this work settles down. The driver API has changed, so all CAM drivers will need to be recompiled. The userland API has not changed, so tools like camcontrol do not need to be recompiled. Notes: svn path=/head/; revision=168752
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-231-1/+1
| | | | | | | | | | | | | | | | 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
* Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed.Matt Jacob2006-12-111-0/+2
| | | | | | | | PR: 106543 MFC after: 3 days Notes: svn path=/head/; revision=165102
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningRobert Watson2006-11-061-1/+2
| | | | | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net> Notes: svn path=/head/; revision=164033
* 2nd and final commit that moves us to CAM_NEW_TRAN_CODEMatt Jacob2006-11-021-20/+0
| | | | | | | | | as the default. Reviewed by multitudes. Notes: svn path=/head/; revision=163896
* The first of 3 major steps to move the CAM layer forward to usingMatt Jacob2006-10-311-4/+35
| | | | | | | | | | | | | | | | | | | | | | | | the CAM_NEW_TRAN_CODE that has been in the tree for some years now. This first step consists solely of adding to or correcting CAM_NEW_TRAN_CODE pieces in the kernel source tree such that a both a GENERIC (at least on i386) and a LINT build with CAM_NEW_TRAN_CODE as an option will compile correctly and run (at least with some the h/w I have). After a short settle time, the other pieces (making CAM_NEW_TRAN_CODE the default and updating libcam and camcontrol) will be brought in. This will be an incompatible change in that the size of structures related to XPT_PATH_INQ and XPT_{GET,SET}_TRAN_SETTINGS change in both size and content. However, basic system operation and basic system utilities work well enough with this change. Reviewed by: freebsd-scsi and specific stakeholders Notes: svn path=/head/; revision=163816
* Remove various bits of conditional Alpha code and fixup a few comments.John Baldwin2006-05-121-5/+0
| | | | Notes: svn path=/head/; revision=158471
* Give the asr softc list global a proper name.Scott Long2006-02-121-5/+5
| | | | Notes: svn path=/head/; revision=155562
* Squash a couple more invalid long casts.Scott Long2006-02-051-2/+2
| | | | Notes: svn path=/head/; revision=155331
* Squash another use of vtophys. Instead of creating separate busdma objectsScott Long2006-02-041-39/+42
| | | | | | | | for doing static memory transfers, start collecting them into a single object. Notes: svn path=/head/; revision=155307
* Add the start of busdma infrastructure to this driver. Convert theScott Long2006-02-041-10/+111
| | | | | | | ASR_resetIOPR function to use it. Notes: svn path=/head/; revision=155286
* Now that the U32 type is a really 32-bits wide, eliminate a bunch of otherScott Long2006-02-041-7/+7
| | | | | | | bad assumptions and long values. Notes: svn path=/head/; revision=155284
* Fix a possible memory leak in asr_attach.Scott Long2006-02-041-5/+12
| | | | Notes: svn path=/head/; revision=155274
* Don't allocate an asr_ccb in asr_attach, it hasn't been needed for years.Scott Long2006-01-141-9/+1
| | | | Notes: svn path=/head/; revision=154365
* Replace bogus code with real code.Scott Long2006-01-141-10/+4
| | | | Notes: svn path=/head/; revision=154364
* Rename driver_t variables. Use device_printf() instead of homerolled printf.Scott Long2006-01-141-39/+39
| | | | | | | Use the provided softc instead of rolling our own. Notes: svn path=/head/; revision=154363
* Only create the rdpti alias if the asr device creation succeeds.Scott Long2005-04-291-1/+2
| | | | Notes: svn path=/head/; revision=145658
* Make life easier on those trying to use the asr utilities by automaticallyScott Long2005-04-011-0/+1
| | | | | | | | | creating the /dev/dpti%d entry that the software expects. This is just a band-aid until either someone (hopefully) rewrites the utilities, or all asr/dpt cards in existance get blasted into the sun. Notes: svn path=/head/; revision=144505
* Bring back some of the ioctl junk that was removed in rev 1.59 as aOlivier Houchard2005-03-171-2/+121
| | | | | | | | | | i386-only kernel option, ASR_COMPAT, and under BURN_BRIDGES. It is really ugly, but raidutils depends on it. Discussed with: scottl Notes: svn path=/head/; revision=143729
* Use BUS_PROBE_DEFAULT for pci probe return valueWarner Losh2005-03-051-1/+1
| | | | Notes: svn path=/head/; revision=143163
* - Set the CAM status to CAM_SCSI_STATUS_ERROR rather than CAM_REQ_CMPMarius Strobl2004-08-021-11/+8
| | | | | | | | | | | | | | | | | in case of a CHECK CONDITION. - Make this driver return SCSI status information. - While here, factor out the clearing of the CAM status from every element of the switch statement to only once before the switch. This fixes burning CDs with recent cdrecord 2.01 alpha versions and burners attached to asr(4) controllers but there could have been other applications and da(4) etc. also affected. Reviewed by: gibbs, scottl MFC after: 2 weeks Notes: svn path=/head/; revision=133041
* Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp2004-06-161-7/+7
| | | | | | | Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
* Add missing <sys/module.h> includesPoul-Henning Kamp2004-05-301-0/+1
| | | | Notes: svn path=/head/; revision=129879
* Update the version history in the driver to note everything that has happenedScott Long2004-05-051-5/+10
| | | | | | | over the last three weeks. Notes: svn path=/head/; revision=128964
* Roto-till the ioctl code. Remove all the groping around in the x86 BIOSScott Long2004-05-051-109/+10
| | | | | | | | | | segment, remove the groping around in the Option ROM segments, remove the bogus tests for bcopy vs. copyout. There really is no reason for a management app to know these things other than to create l33t info tables for the user. Notes: svn path=/head/; revision=128945
* Convert the asr driver to use the bus_space API. This does not representScott Long2004-05-051-89/+151
| | | | | | | | | a significant functional change, but it further cleans up the code and brings it closer to being portable. Thanks to Don Bowman for helping to test this. Notes: svn path=/head/; revision=128944
* Fix a typo from rev 1.56 that somehow escaped my testing.Scott Long2004-05-041-10/+10
| | | | Notes: svn path=/head/; revision=128908
* Remove the static reservation of the asr major numberScott Long2004-05-021-2/+0
| | | | Notes: svn path=/head/; revision=128813
* Remove the defAlignLong and getAlignLong macros. I guess that the originalScott Long2004-05-021-103/+91
| | | | | | | | | | intent was to make sure that message structs allocated off of the stack were 4-byte aligned. However, the macros as defined did absolutely nothing. And since I2O forces you to manually copy messages down to the hardware, there really is no point of enforced alignment anyways. Notes: svn path=/head/; revision=128812
* Remove the bogus printing of the asr control device major number. AlsoScott Long2004-05-021-2/+1
| | | | | | | | | | rename the control device from rasr%d to asr%d. This starts us down the path of divorcing ourselves from a very bogus design in the management apps. Since the apps are open source now, they will likely be updated and fixed before 5.3. Notes: svn path=/head/; revision=128807
* Correctly test *Reply_Ptr in ASR_resetIOP(). Thanks to dhartmei for pointingScott Long2004-05-011-1/+1
| | | | | | | this out. Notes: svn path=/head/; revision=128794
* Re-indent some silly sub-blocks in asr_attach().Scott Long2004-05-011-147/+129
| | | | Notes: svn path=/head/; revision=128793
* Remove ASR_get_sc() and reference the softc in the dev_t. For some nefariousScott Long2004-05-011-23/+8
| | | | | | | | reason, the I2O protocol requires knowledge of all I2O devices in the system, so we can't get rid of the evil linked-list of softc's yet. Notes: svn path=/head/; revision=128792
* Remove the DOMINO and MODE0 device attachments. They never did anything.Scott Long2004-05-011-128/+20
| | | | | | | Remove a bunch of obfuscating macros. Notes: svn path=/head/; revision=128791