summaryrefslogtreecommitdiff
path: root/sys/dev/twa
AgeCommit message (Collapse)Author
2021-11-25twa: RemoveWarner Losh
Belatedly remove twa(4). It was supposed to go before 13.0, but was overlooked. Sponsored by: Netflix Relnotes: yes Reviewed by: scottl Differential Revision: https://reviews.freebsd.org/D33114
2020-09-01twa: clean up empty lines in .c and .h filesMateusz Guzik
Notes: svn path=/head/; revision=365087
2020-04-18twa(4) deprecation noticeWarner Losh
Notes: svn path=/head/; revision=360063
2020-02-26Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki
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
2019-04-19remove the 4GB boundary requirement on PCI DMA segmentsTycho Nightingale
Reviewed by: kib Discussed with: jhb Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D19867 Notes: svn path=/head/; revision=346386
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-03-01Update tw_cl_share.h to allow 255 LUNsWarner Losh
TW_CL_MAX_NUM_LUNS should not be 16 but I presume 255. I have a 3ware controller with more than 16 volumes (LUN's) and otherwise all LUN's above the 16'th are not working. Submitted by: jcatrysse <j.catrysse@proximedia.be> Pull Request: https://github.com/freebsd/freebsd/pull/100 Notes: svn path=/head/; revision=314469
2017-01-05In the same vein as r311350, fix whitespace in handling of XPT_PATH_INQ inRavi Pokala
several more drivers. Sponsored by: Panasas Notes: svn path=/head/; revision=311351
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-02-19Replace several bus_alloc_resource() calls using default arguments with ↵Justin Hibbits
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
2015-05-22CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than tenJung-uk Kim
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
2013-10-30Adjust various SCSI drivers to handle either a 32-bit or 64-bit lun_id_t,Nathan Whitehorn
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
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-04-14MFprojects/camlock r248982:Alexander Motin
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
2013-03-21Fix twa(4) after the r246713. The driver copies data around toKonstantin Belousov
satisfy some alignment restrictions. Do not set TW_OSLI_REQ_FLAGS_CCB flag for mapped data, pass the csio->data_ptr in the req->data. Do not put the ccb pointer into req->data ever, ccb is stored in req->orig_req already. Submitted by: Shuichi KITAGUCHI <ki@hh.iij4u.or.jp> PR: kern/177020 Notes: svn path=/head/; revision=248583
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
2012-11-09Give tw_osl_dbg_printf format string to pacify clang warning.Roman Divacky
Notes: svn path=/head/; revision=242827
2012-06-22Return CAM_SEL_TIMEOUT and CAM_DEV_NOT_THERE instead of CAM_TID_INVALIDAlexander Motin
and CAM_LUN_INVALID for case of missing devices. In removes tons of error messages from CAM during bus scans. Reported and tested by: Mike Tancsa <mike@sentex.net> MFC after: 3 days Notes: svn path=/head/; revision=237460
2012-03-07Use bus_get_dma_tag() to inherit the 4G boundary restriction from theJohn Baldwin
parent PCI bus and remove the home-grown version in this driver. Notes: svn path=/head/; revision=232669
2011-12-15s/timout/timeoutKevin Lo
Notes: svn path=/head/; revision=228526
2011-11-22- There's no need to overwrite the default device method with the defaultMarius Strobl
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
2011-11-07Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.Ed Schouten
This means that their use is restricted to a single C file. Notes: svn path=/head/; revision=227293
2010-09-04Fix a compile problem introduced with r212008 on 32bit:Bjoern A. Zeeb
Both deadline and current_time are time_seconds (+ utc_offset()) casted to unsigned long long. No need to cast to or print as pointers. MFC after: 4 days Notes: svn path=/head/; revision=212210
2010-08-30Drain watchdog callouts before detaching. This prevents a panic whileXin LI
unloading the kernel module. Submitted by: Tom Cough Notes: svn path=/head/; revision=212028
2010-08-30Vendor update to version 3.80.06.003 to fix a panic with ZFS when underXin LI
heavy I/O load. Many thanks to LSI for continuing to support FreeBSD. PR: kern/149968 Submitted by: LSI (Tom Couch) Reported by: Kai Kockro <kkockro web de> Tested by: Kai Kockro, jpaetzel MFC after: 7 days Notes: svn path=/head/; revision=212008
2010-07-09Don't use pack() for structures that is used purely for software state.Xin LI
Otherwise the resulting, unaligned mutex structure would trigger panic. Submitted by: Tom Cough <tom.couch lsi.com> Reported/Tested by: jhb MFC after: 3 days Notes: svn path=/head/; revision=209860
2010-06-17Remove an unused comment.Xin LI
Notes: svn path=/head/; revision=209268
2010-06-09Apply driver update from LSI. Many thanks to LSI for continuing toXin LI
support FreeBSD. 1) Timeout ioctl command timeouts. Do not reset the controller if ioctl command completed successfully. 2) Remove G66_WORKAROUND code (this bug never shipped). 3) Remove unnecessary interrupt lock (intr_lock). 4) Timeout firmware handshake for PChip reset (don't wait forever). 5) Handle interrupts inline. 6) Unmask command interrupt ONLY when adding a command to the pending queue. 7) Mask command interrupt ONLY after removing the last command from the pending queue. 8) Remove TW_OSLI_DEFERRED_INTR_USED code. 9) Replace controller "state" with separate data fields to avoid races: TW_CLI_CTLR_STATE_ACTIVE ctlr->active TW_CLI_CTLR_STATE_INTR_ENABLED ctlr->interrupts_enabled TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY ctlr->internal_req_busy TW_CLI_CTLR_STATE_GET_MORE_AENS ctlr->get_more_aens TW_CLI_CTLR_STATE_RESET_IN_PROGRESS ctlr->reset_in_progress TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS ctlr->reset_phase1_in_progress 10) Fix "req" leak in twa_action() when simq is frozen and req is NOT null. 11) Replace softc "state" with separate data fields to avoid races: TW_OSLI_CTLR_STATE_OPEN sc->open TW_OSLI_CTLR_STATE_SIMQ_FROZEN sc->simq_frozen 12) Fix reference to TW_OSLI_REQ_FLAGS_IN_PROGRESS in tw_osl_complete_passthru() 13) Use correct CAM status values. Change CAM_REQ_CMP_ERR to CAM_REQ_INVALID. Remove use of CAM_RELEASE_SIMQ for physical data addresses. 14) Do not freeze/ release the simq with non I/O commands. When it is appropriate to temporarily freeze the simq with an I/O command use: xpt_freeze_simq(sim, 1); ccb->ccb_h.status |= CAM_RELEASE_SIMQ; otherwise use: xpt_freeze_simq(sim, 1); xpt_release_simq(sim, 1); Submitted by: Tom Couch <tom.couch lsi.com> PR: kern/147695 MFC after: 3 days Notes: svn path=/head/; revision=208969
2010-01-28MFp4: Large set of CAM inprovements.Alexander Motin
- 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
2009-09-22Change the command argument to ioctl routines to u_long to avoidRoman Divacky
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
2009-05-20We no longer need to use d_thread_t, migrate to struct thread *.Warner Losh
Notes: svn path=/head/; revision=192450
2009-04-14Use si_drv1 instead of dev2unit() in twe(4) and twa(4)Ed Schouten
Reviewed by: scottl Notes: svn path=/head/; revision=191060
2009-03-23Reenable 64-bit DMA for twa(4) controllers, but use a boundary of 4GB toJohn Baldwin
prevent individual transactions from crossing a 4GB address boundary. Due to bus_size_t type limitations, the driver uses a 2GB boundary in PAE kernels. Reviewed by: scottl MFC after: 1 week Notes: svn path=/head/; revision=190329
2008-10-06Limit DMA memory to lower addressable 4GB, without this patch, weXin LI
can reliably provoke data corruption on systems equipped with a plenty of memory during high load. Reported by: gnn via iXsystems MFC candidate: RELENG_7_1, RELENG_7 Notes: svn path=/head/; revision=183660
2008-09-27Replace all calls to minor() with dev2unit().Ed Schouten
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
2007-10-12Deferred interrupts don't work yet, disable them.Scott Long
Submitted by: Manjunath Ranganathaiah Notes: svn path=/head/; revision=172587
2007-10-09Update to version 3.70.03.007 from the vendor. This adds support for newScott Long
SAS-enabled cards. It also makes the driver MPSAFE, eliminating some problems that resulted from CAM becoming MPSAFE. Many thanks to 3Ware/AMCC for continuing to support FreeBSD. Submitted by: Manjunath Ranganathaiah Approved by: re Notes: svn path=/head/; revision=172496
2007-06-17Prepare for future integration between CAM and newbus. xpt_bus_registerScott Long
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
2007-05-19Minor update to version 3.70.03.007Scott Long
Notes: svn path=/head/; revision=169742
2007-05-10The version string scheme embeds the freebsd major release version,Scott Long
something that I wasn't aware of with the last import. Adjust the string accordingly for 7-CURRENT. Notes: svn path=/head/; revision=169452
2007-05-09Import version 3.60.03.006 of the TWA driver:Scott Long
This patch does the following: - Remove un-necessary code that is not even compiling into the driver under TW_OSL_NON_DMA_MEM_ALLOC_PER_REQUEST defines. - Remove bundled firmware image and associated "files" entry for tw_cl_fwimg.c - Remove bundled firmware flashing routines. We now have tw_update userspace FreeBSD controller flash utility. - Fix driver crash on load due to shared interrupt. - Fix 2 lock leaks for Giant lock. - Fix CCB leak. - Add support for 9650SE controllers. Many thanks to 3Ware/AMCC for continuing to support FreeBSD. Notes: svn path=/head/; revision=169400
2007-04-15Remove Giant from CAM. Drivers (SIMs) now register a mutex that CAM willScott Long
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
2007-02-23o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati
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
2006-12-11Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed.Matt Jacob
PR: 106543 Reviewed by: Adam Radford MFC after: 3 days Notes: svn path=/head/; revision=165106
2006-11-022nd and final commit that moves us to CAM_NEW_TRAN_CODEMatt Jacob
as the default. Reviewed by multitudes. Notes: svn path=/head/; revision=163896
2006-10-31The first of 3 major steps to move the CAM layer forward to usingMatt Jacob
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
2006-10-02Use utc_offset() where applicable, and hide the internals of itPoul-Henning Kamp
as static variables. Notes: svn path=/head/; revision=162970
2006-10-02First part of a little cleanup in the calendar/timezone/RTC handling.Poul-Henning Kamp
Move relevant variables to <sys/clock.h> and fix #includes as necessary. Use libkern's much more time- & spamce-efficient BCD routines. Notes: svn path=/head/; revision=162954
2006-04-30Remove header pollution.Scott Long
Notes: svn path=/head/; revision=158180
2005-11-08twa corresponding to the 9.3.0.1 release on the 3ware website. This driver hasVinod Kashyap
support for the 9xxxSX controllers, along with the earlier 9xxxS series controllers. Notes: svn path=/head/; revision=152213