aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/hptmv
Commit message (Collapse)AuthorAgeFilesLines
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2717-17/+51
| | | | | | | | | | | | | | | 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
* hptmv: avoid gcc variably-modified warningRyan Libby2017-07-061-2/+2
| | | | | | | | | | | | | | gcc produces a "variably modified X at file scope" warning for structures that use these size definitions. PR: 211540 Reviewed by: markj Approved by: markj (mentor) Sponsored by: Dell EMC Isilon Differential revision: https://reviews.freebsd.org/D11416 Notes: svn path=/head/; revision=320714
* sys/dev: Replace zero with NULL for pointers.Pedro F. Giffuni2017-02-204-10/+10
| | | | | | | | | | | Makes things easier to read, plus architectures may set NULL to something different than zero. Found with: devel/coccinelle MFC after: 3 weeks Notes: svn path=/head/; revision=313982
* Remove dead mentions of CAM target mode APIs from drivers.Alexander Motin2017-02-191-4/+0
| | | | | | | This makes grepping kernel for target mode implementation much easier. Notes: svn path=/head/; revision=313949
* 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
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-035-6/+6
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* sys: use our roundup2/rounddown2() macros when param.h is available.Pedro F. Giffuni2016-04-211-2/+2
| | | | | | | | | | | | | rounddown2 tends to produce longer lines than the original code and when the code has a high indentation level it was not really advantageous to do the replacement. This tries to strike a balance between readability using the macros and flexibility of having the expressions, so not everything is converted. Notes: svn path=/head/; revision=298433
* hptmv(4) Fix potential buffer overflow in hpt_set_info.Sean Bruno2016-04-181-4/+11
| | | | | | | | | | | | | | While here, adjust some whitespace and yeild some useful debug info. This is untested on this hardware, testing requests to -scsi went unanswered. PR: 206585 Submitted by: cturt@hardenedbsd.org MFC after: 2 weeks Notes: svn path=/head/; revision=298231
* 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-1/+1
| | | | | | | | | | | | 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
* hptmv(4): Fix broken sysctl(9) API assumptionsConrad Meyer2015-11-071-6/+3
| | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=290519
* Various fixes to hptmv(4):John Baldwin2014-08-056-377/+192
| | | | | | | | | | | | | | | | | - Replace the global driver lock with a per-instance device lock. - Use the per-instance device lock instead of Giant for the CAM sim lock. - Add global locks to protect the adapter list and DPC queues. - Use wakeup() and mtx_sleep() to wait for certain events like the controller going idle rather than polling via timeouts passed to tsleep(). - Use callout(9) instead of timeout(9). - Mark the interrupt handler MPSAFE. - Remove compat shims for FreeBSD versions older than 8.0. Reviewed by: Steve Chang <ychang@highpoint-tech.com> Notes: svn path=/head/; revision=269617
* Pull in r267961 and r267973 again. Fix for issues reported will follow.Hans Petter Selasky2014-06-281-1/+1
| | | | Notes: svn path=/head/; revision=267992
* Revert r267961, r267973:Glen Barber2014-06-271-1/+1
| | | | | | | | | | | | | These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory Notes: svn path=/head/; revision=267985
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifHans Petter Selasky2014-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=267961
* Apply vendor fixes to the High Point drivers:Xin LI2014-06-111-2/+9
| | | | | | | | | | | | | | | | | | - Don't call xpt_free_path() in os_query_remove_device() and always return TRUE. - Update os_buildsgl() to support build logical SG table which will be used by lower RAID module. - Return CAM_SEL_TIMEOUTstatus for SCSIcommand failed as target missing. Many thanks to HighPoint for providing this driver update. Submitted by: Steve Chang Reviewed by: mav MFC after: 3 days Notes: svn path=/head/; revision=267368
* Re-do r255853. Along with adding back the API/ABI changes from theScott Long2013-09-252-2/+4
| | | | | | | | | | | 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-4/+2
| | | | | | | Approved by: re (implicit) Notes: svn path=/head/; revision=255865
* Update the CAM API for FreeBSD 10:Scott Long2013-09-242-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Fxi a bunch of typos.Eitan Adler2013-05-101-3/+3
| | | | | | | | PR: misc/174625 Submitted by: Jeremy Chadwick <jdc@koitsu.org> Notes: svn path=/head/; revision=250460
* Move hptmv and mpt drivers shutdown a bit later to the SHUTDOWN_PRI_LASTAlexander Motin2013-04-241-2/+4
| | | | | | | | | | stage of shutdown_post_sync. That should allow CAM to do final cache flush at the SHUTDOWN_PRI_DEFAULT without using polling magic. MFC after: 3 days Notes: svn path=/head/; revision=249849
* Reform the busdma API so that new types may be added without modifyingKonstantin Belousov2013-02-121-73/+34
| | | | | | | | | | | | | | | | | | | | | | | | 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
* It seems that what the code really meant is that when a write is completed,Xin LI2012-09-071-1/+1
| | | | | | | | | | | do a BUS_DMASYNC_POSTWRITE over the DMA map. The way it currently is would only do POSTREAD for read transactions. Submitted by: Sascha Wildner MFC after: 1 month Notes: svn path=/head/; revision=240210
* Adding missing dependancies for loading hptiop(4), hptmv(4) and isp(4) as ↵Eitan Adler2012-06-011-0/+1
| | | | | | | | | | | | | | | modules. PR: kern/166239 Submitted by: Pavel Timofeev <timp87@gmail.com> Discussed on: -stable, -scsi Reviewed by: scottl No objection from: mjacob Approved by: cperciva MFC after: 3 days Notes: svn path=/head/; revision=236379
* 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
* Remove spurious 8bit chars, turning files into plain ASCII.Ulrich Spörlein2012-01-151-1/+1
| | | | Notes: svn path=/head/; revision=230133
* - Just use cam_calc_geometry(9) on newer version of FreeBSD rather thanMarius Strobl2011-11-231-5/+10
| | | | | | | | duplicating it. - In hptmv(4) and hptrr(4) use __FBSDID and DEVMETHOD_END. Notes: svn path=/head/; revision=227912
* - Merge changes to the base system to support OFED. These includeJeff Roberson2011-03-211-2/+2
| | | | | | | | a wider arg2 for sysctl, updates to vlan code, IFT_INFINIBAND, and other miscellaneous small features. Notes: svn path=/head/; revision=219819
* Report transport type in XPT_PATH_INQ.Alexander Motin2010-06-191-0/+4
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=209341
* Remove extraneous semicolons, no functional changes.Martin Blapp2010-01-071-1/+1
| | | | | | | | Submitted by: Marc Balmer <marc@msys.ch> MFC after: 1 week Notes: svn path=/head/; revision=201758
* MFp4:Alexander Motin2009-06-241-197/+0
| | | | | | | | | Remove unused ATAPI definitions, conflicting with ata.h. Submitted by: scottl Notes: svn path=/head/; revision=194900
* Use DEVICE_SHUTDOWN(9) mechanism for shutdown handler.Xin LI2009-04-091-8/+2
| | | | | | | Suggested by: jhb Notes: svn path=/head/; revision=190863
* When multiple cards are present, register a shutdown handler for each cardXin LI2009-04-071-8/+9
| | | | | | | | | | | instead of just register one for the first adapter. Without doing this there would be some data loss upon shutdown because data could be ignored when flushing to disk. MFC after: 3 days Notes: svn path=/head/; revision=190810
* Update driver to vendor's version 1.16 plus some local changes:Xin LI2009-04-0718-3637/+4175
| | | | | | | | | | | | | | | | | | - override_kernel_driver() has been removed since this is an in-tree version of driver. - __DATE__ and __TIME__ removed from version string to make binary update builders happy. - Utilize pause(9) for __FreeBSDversion >= 700033 (redo 167086). - Utilize kproc_suspend_check() for __FreeBSDversion >= 800002. (redo 172836). - Don't read past end of pVDevice (redo 143787). - Make sure that controller and channel are initialized (redo 169823). - Don't include cam/cam_xpt_periph.h (redo 158177). MFC After: 3 days Notes: svn path=/head/; revision=190809
* Rename the kthread_xxx (e.g. kthread_create()) callsJulian Elischer2007-10-201-1/+1
| | | | | | | | | | | | | | to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls. Notes: svn path=/head/; revision=172836
* 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
* Perhaps a better fix- make the called function do the (possible never reached)Matt Jacob2007-05-211-8/+11
| | | | | | | | | initialization. Do a token amount of style cleanup. Poked by: bde Notes: svn path=/head/; revision=169823
* Make gcc 4.2 happy by initiatlizing controller && channel priorMatt Jacob2007-05-201-1/+1
| | | | | | | | | to a call to a function which *might* then initialize them. MFC after: 3 days Notes: svn path=/head/; revision=169798
* 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
* Use pause() rather than tsleep() on stack variables and function pointers.John Baldwin2007-02-272-12/+12
| | | | Notes: svn path=/head/; revision=167086
* 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
* - Use a regular mutex rather than a spin mutex. This driver doesn't needJohn Baldwin2007-01-041-9/+3
| | | | | | | | | | | | | a spin mutex since it doesn't have an INTR_FAST interrupt handler. Beyond that the driver is still under Giant anyway. - Remove unneeded locking during attach across operations that can't be called with locks held (such as bus_dma_tag_create()). MFC after: 1 week Not objected to by: scottl Notes: svn path=/head/; revision=165774
* Since DELAY() was moved, most <machine/clock.h> #includes have beenPoul-Henning Kamp2006-05-161-1/+0
| | | | | | | unnecessary. Notes: svn path=/head/; revision=158651
* Remove some header polution.Scott Long2006-04-301-1/+0
| | | | Notes: svn path=/head/; revision=158177
* Fix -Wundef.Ruslan Ermilov2005-12-042-3/+3
| | | | Notes: svn path=/head/; revision=153072
* Don't augment the DRIVER_VERSION "v1.12" with __DATE__ and __TIME__.Jens Schweikhardt2005-11-131-1/+1
| | | | | | | | | | This is the only file of > 1700 files in a buildkernel here doing that. It makes reproducible builds (same source => same binary) impossible. Spotted by: devel/ccache Notes: svn path=/head/; revision=152374
* Fix a typo that broke LINT.Scott Long2005-09-081-1/+1
| | | | Notes: svn path=/head/; revision=149878
* Import new version of the HPTMV driver from Highpoint. The major changeScott Long2005-09-0720-3299/+5257
| | | | | | | | | | | here is the support for amd64, as well as possible support for PAE. Many thanks to Highpoint for continuing to support FreeBSD. Obtained from: Steve Chang @ Highpoint MFC After: 3 days. Notes: svn path=/head/; revision=149871
* 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
* check copyin return value (and while we're at it copyout too)Sam Leffler2005-03-311-8/+14
| | | | | | | Noticed by: Coverity Prevent analysis tool Notes: svn path=/head/; revision=144371