aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mlx
Commit message (Collapse)AuthorAgeFilesLines
* Use bus_generic_detach to detach and delete child devices during detachJohn Baldwin2025-01-021-10/+4
| | | | | | | This is simpler and more robust than individual calls to device_delete_child. Differential Revision: https://reviews.freebsd.org/D47972
* Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin2024-12-061-3/+2
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
* mlx(4): Stop checking for failures from malloc(M_WAITOK)Zhenlei Huang2024-09-031-2/+2
| | | | | MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852
* newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh2024-07-251-1/+1
| | | | Sponsored by: Netflix
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-162-4/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-164-8/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-126-6/+6
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* mlx(4): Fix a common typo in a source code commentGordon Bergling2022-06-051-1/+1
| | | | | | - s/independant/independent/ MFC after: 3 days
* mlx: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-064-9/+2
|
* mlx: Use devclass_find to lookup the devclass for mlxd.John Baldwin2022-04-211-1/+1
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D34994
* Create wrapper for Giant taken for newbusWarner Losh2021-12-101-4/+4
| | | | | | | | | | | Create a wrapper for newbus to take giant and for busses to take it too. bus_topo_lock() should be called before interacting with newbus routines and unlocked with bus_topo_unlock(). If you need the topology lock for some reason, bus_topo_mtx() will provide that. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D31831
* sysbeep: Adjust interface to take a duration as a sbtWarner Losh2021-11-031-3/+3
| | | | | | | | Change the 'period' argument to 'duration' and change its type to sbintime_t so we can more easily express different durations. Reviewed by: tsoome, glebius Differential Revision: https://reviews.freebsd.org/D32619
* Ever since the block layer expanded its command syntax beyond justScott Long2020-02-071-0/+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
* 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