aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mlx
Commit message (Collapse)AuthorAgeFilesLines
* Extract eventfilter declarations to sys/_eventfilter.hConrad Meyer2019-05-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header pollution substantially. EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c files into appropriate headers (e.g., sys/proc.h, powernv/opal.h). As a side effect of reduced header pollution, many .c files and headers no longer contain needed definitions. The remainder of the patch addresses adding appropriate includes to fix those files. LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by sys/mutex.h since r326106 (but silently protected by header pollution prior to this change). No functional change (intended). Of course, any out of tree modules that relied on header pollution for sys/eventhandler.h, sys/lock.h, or sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped. Notes: svn path=/head/; revision=347984
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-276-0/+12
| | | | | | | | | | | | | | | 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
* Remove references to EISA support in mlx. The driver never supportedWarner Losh2017-02-161-1/+1
| | | | | | | the EISA cards and EISA bus support is being removed. Notes: svn path=/head/; revision=313827
* 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
* sys/dev: extend use of the howmany() macro when available.Pedro F. Giffuni2016-04-261-1/+1
| | | | | | | | We have a howmany() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read. Notes: svn path=/head/; revision=298646
* sys/dev: use our nitems() macro when it is avaliable through param.h.Pedro F. Giffuni2016-04-191-1/+1
| | | | | | | | | | No functional change, only trivial cases are done in this sweep, Drivers that can get further enhancements will be done independently. Discussed in: freebsd-current Notes: svn path=/head/; revision=298307
* Remove MAXBSIZE use from drivers where it has nothing to do.Alexander Motin2015-03-222-2/+4
| | | | | | | | | | 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
* Add missing calls to bus_dmamap_unload() when freeing static DMAJohn Baldwin2014-06-131-0/+7
| | | | | | | | | allocations. Reviewed by: scottl Notes: svn path=/head/; revision=267446
* Remove FreeBSD 4.x compat shims. Verified by md5.John Baldwin2012-09-265-117/+40
| | | | Notes: svn path=/head/; revision=240963
* Add locking to mlx(4) to make it MPSAFE along with some other fixes:John Baldwin2012-09-175-245/+299
| | | | | | | | | | | | | | | | | | | | | | | | | | - Use callout(9) rather than timeout(9). - Add a mutex as an I/O lock that protects the adapter and is used for the I/O path. - Add an sx lock as a configuration lock that protects the relationship of configured volumes. - Freeze the request queue when a DMA load is deferred with EINPROGRESS and unfreeze the queue when the DMA callback is invoked. - Explicitly poll the hardware while waiting to submit a command to allow completed commands to free up slots in the command ring. - Remove driver-wide 'initted' variable from mlx_*_fw_handshake() routines. That state should be per-controller instead. Add it as an argument since the first caller knows when it is the first caller. - Remove explicit bus_space tag/handle and use bus_*() rather than bus_space_*(). - Move duplicated PCI device ID probing into a mlx_pci_match() routine. - Don't check for PCIM_CMD_MEMEN (the PCI bus will enable that when allocating the resource) and use pci_enable_busmaster() rather than manipulating the register directly. Tested by: no one despite multiple requests (hope it works) Notes: svn path=/head/; revision=240608
* Correct a typo.Xin LI2012-08-031-1/+1
| | | | | | | | | Reported by: Sascha Wildner <swildner dragonflybsd org> Reviewed by: scottl MFC after: 3 days Notes: svn path=/head/; revision=238997
* 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 unused variable count.Kevin Lo2012-02-271-2/+1
| | | | | | | This variable is initialized but not used. Notes: svn path=/head/; revision=232219
* - There's no need to overwrite the default device method with the defaultMarius Strobl2011-11-221-3/+1
| | | | | | | | | | | | | 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
* Temporarily revert the new-bus locking for 8.0 release. It will beJohn Baldwin2009-08-201-2/+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/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Separate the parallel scsi knowledge out of the core of the XPT, andScott Long2009-07-102-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | modularize it so that new transports can be created. Add a transport for SATA Add a periph+protocol layer for ATA Add a driver for AHCI-compliant hardware. Add a maxio field to CAM so that drivers can advertise their max I/O capability. Modify various drivers so that they are insulated from the value of MAXPHYS. The new ATA/SATA code supports AHCI-compliant hardware, and will override the classic ATA driver if it is loaded as a module at boot time or compiled into the kernel. The stack now support NCQ (tagged queueing) for increased performance on modern SATA drives. It also supports port multipliers. ATA drives are accessed via 'ada' device nodes. ATAPI drives are accessed via 'cd' device nodes. They can all be enumerated and manipulated via camcontrol, just like SCSI drives. SCSI commands are not translated to their ATA equivalents; ATA native commands are used throughout the entire stack, including camcontrol. See the camcontrol manpage for further details. Testing this code may require that you update your fstab, and possibly modify your BIOS to enable AHCI functionality, if available. This code is very experimental at the moment. The userland ABI/API has changed, so applications will need to be recompiled. It may change further in the near future. The 'ada' device name may also change as more infrastructure is completed in this project. The goal is to eventually put all CAM busses and devices until newbus, allowing for interesting topology and management options. Few functional changes will be seen with existing SCSI/SAS/FC drivers, though the userland ABI has still changed. In the future, transports specific modules for SAS and FC may appear in order to better support the topologies and capabilities of these technologies. The modularization of CAM and the addition of the ATA/SATA modules is meant to break CAM out of the mold of being specific to SCSI, letting it grow to be a framework for arbitrary transports and protocols. It also allows drivers to be written to support discrete hardware without jeopardizing the stability of non-related hardware. While only an AHCI driver is provided now, a Silicon Image driver is also in the works. Drivers for ICH1-4, ICH5-6, PIIX, classic IDE, and any other hardware is possible and encouraged. Help with new transports is also encouraged. Submitted by: scottl, mav Approved by: re Notes: svn path=/head/; revision=195534
* Convert mlx(4) and mly(4) to si_drv1 instead of dev2unit().Ed Schouten2009-04-181-7/+5
| | | | Notes: svn path=/head/; revision=191242
* Replace all calls to minor() with dev2unit().Ed Schouten2008-09-271-3/+3
| | | | | | | | | | | | | | | | | | 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
* Make mlxcontrol work with more than one system drive:Stephane E. Potvin2008-09-121-1/+1
| | | | | | | | | | | | | | | | - When searching for the next system drive, return the next one instead of always returning the first one. - Plug fd lead and make sure that the MLX_NEXT_CHILD ioctl is called on the controller fd, not the disk's one. While there, fix a cut-n-pase error in a warning. Reviewed by: jhb Approved by: kan (mentor) MFC after: 1 month Notes: svn path=/head/; revision=182965
* 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 missing parenthesis around error handling code upon attachingChristian S.J. Peron2005-07-301-1/+2
| | | | | | | | | | | | | mlx devices. This fixes an issue where mlx device drives fail to be detected at system boot. This is a RELENG_6 candidate. Submitted by: oliver PR: kern/84163 Notes: svn path=/head/; revision=148570
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386Yoshihiro Takahashi2005-05-292-4/+0
| | | | | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr) Notes: svn path=/head/; revision=146734
* plug resource leakSam Leffler2005-03-311-2/+4
| | | | | | | | Submitted by: mdodd Noticed by: Coverity Prevent analysis tool Notes: svn path=/head/; revision=144436
* fix potential null ptr derefSam Leffler2005-03-311-1/+1
| | | | | | | Noticed by: Coverity Prevent analysis tool Notes: svn path=/head/; revision=144434
* avoid null ptr derefSam Leffler2005-03-311-1/+1
| | | | | | | Noticed by: Coverity Prevent analysis tool Notes: svn path=/head/; revision=144433
* Don't call mlx_free() i mlx_attach() in case of failure. Doing soPoul-Henning Kamp2005-03-262-10/+1
| | | | | | | | | in mlx_attach_pci() is much cleaner. Inspired by: Coverity Notes: svn path=/head/; revision=144161
* If mlx_attach() returns an error, don't free sc again.David Schultz2005-03-181-3/+1
| | | | | | | | Spotted by: Ted Unangst using the Coverity Prevent static analysis tool Reviewed by: scottl Notes: svn path=/head/; revision=143788
* Use BUS_PROBE_DEFAULT for pci probe return valueWarner Losh2005-03-051-1/+1
| | | | Notes: svn path=/head/; revision=143158
* Don't use PAGE_SIZE to calculate controller-specific attributes.Scott Long2004-11-252-2/+3
| | | | | | | | | PR: kern/21220 Submitted by: Dennis Lindroos MFC After: 1 week Notes: svn path=/head/; revision=138090
* 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
* Add missing <sys/module.h> includesPoul-Henning Kamp2004-05-302-0/+2
| | | | Notes: svn path=/head/; revision=129879
* Convert callers to the new bus_alloc_resource_any(9) API.Nate Lawson2004-03-172-4/+8
| | | | | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde Notes: svn path=/head/; revision=127135
* Change another pointer name that was missed in the previous commit.Scott Long2004-03-011-1/+1
| | | | | | | Spotted by: njl Notes: svn path=/head/; revision=126463
* Check and free the actual pointer the was used in a malloc instead ofScott Long2004-03-011-2/+2
| | | | | | | | | checking and freeing a different pointer that may or may not have been assigned the same value. This should fix panics under load that were recently reported. Notes: svn path=/head/; revision=126461
* Don't free meo until we're finished using it.Colin Percival2004-02-221-1/+1
| | | | | | | | Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor), scottl Notes: svn path=/head/; revision=126113
* Device megapatch 4/6:Poul-Henning Kamp2004-02-211-1/+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-211-2/+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-182-15/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Prepare for locking mlx(4) by cleaning up the use of busdma. No realScott Long2003-09-022-155/+243
| | | | | | | functional changes should result from this. Notes: svn path=/head/; revision=119665
* Use __FBSDID().David E. O'Brien2003-08-242-3/+6
| | | | | | | Also some minor style cleanups. Notes: svn path=/head/; revision=119418
* 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=119285
* Don't provide a mutex in the S/G list dma tag since it will never be defered.Scott Long2003-08-091-7/+9
| | | | | | | Fix some nearby style. Notes: svn path=/head/; revision=118707
* Mega busdma API commit.Scott Long2003-07-012-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg. Lockfunc allows a driver to provide a function for managing its locking semantics while using busdma. At the moment, this is used for the asynchronous busdma_swi and callback mechanism. Two lockfunc implementations are provided: busdma_lock_mutex() performs standard mutex operations on the mutex that is specified from lockfuncarg. dftl_lock() is a panic implementation and is defaulted to when NULL, NULL are passed to bus_dma_tag_create(). The only time that NULL, NULL should ever be used is when the driver ensures that bus_dmamap_load() will not be deferred. Drivers that do not provide their own locking can pass busdma_lock_mutex,&Giant args in order to preserve the former behaviour. sparc64 and powerpc do not provide real busdma_swi functions, so this is largely a noop on those platforms. The busdma_swi on is64 is not properly locked yet, so warnings will be emitted on this platform when busdma callback deferrals happen. If anyone gets panics or warnings from dflt_lock() being called, please let me know right away. Reviewed by: tmm, gibbs Notes: svn path=/head/; revision=117126
* Use bioq_flush() to drain a bio queue with a specific error code.Poul-Henning Kamp2003-04-013-3/+6
| | | | | | | | | | | Retain the mistake of not updating the devstat API for now. Spell bioq_disksort() consistently with the remaining bioq_*(). #include <geom/geom_disk.h> where this is more appropriate. Notes: svn path=/head/; revision=112946
* Centralize the devstat handling for all GEOM disk device driversPoul-Henning Kamp2003-03-085-12/+2
| | | | | | | | | | | in geom_disk.c. As a side effect this makes a lot of #include <sys/devicestat.h> lines not needed and some biofinish() calls can be reduced to biodone() again. Notes: svn path=/head/; revision=111979
* Gigacommit to improve device-driver source compatibility betweenPoul-Henning Kamp2003-03-031-13/+5
| | | | | | | | | | | | | | | | branches: Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values. This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386. Approved by: re(scottl) Notes: svn path=/head/; revision=111815
* Chase the musical variable names.John Baldwin2003-02-251-2/+2
| | | | | | | | Pointy hat to: jhb Reported by: des Notes: svn path=/head/; revision=111509
* Limit the maximum I/O size to 8 pages for version 2 controllers. ThisJohn Baldwin2003-02-251-4/+8
| | | | | | | | | fixes problems with some mlx(4) cards in Alpha machines. Reviewed by: msmith (ages ago) Notes: svn path=/head/; revision=111499
* Fix a small fat-finger: s/mlxd/mxld/.John Baldwin2003-02-251-1/+1
| | | | | | | Reported by: Bob Willcox <bob@immure.com> Notes: svn path=/head/; revision=111497