summaryrefslogtreecommitdiff
path: root/sys/dev/ida/ida_disk.c
Commit message (Collapse)AuthorAgeFilesLines
* 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/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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-271-0/+2
| | | | | | | | | | | | | | | 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
* Rework the DMA handling in ida(4) and add locking to make this driverJohn Baldwin2012-08-271-6/+3
| | | | | | | | | | | | | | | | | | MPSAFE. - Preallocate a full set of QCBs during attach rather than allocating new ones on demand to avoid allocations in the I/O path. - Remove the explicit bus space tag/handle and use bus_*() on the relevant 'struct resource' instead. - Defer logical drive probing to an intrhook. - Fix ida_detach() to detach and delete child devices (logical drives). - Update the DMA handling to support EINPROGRESS by moving the work to submit a mapped request into the bus_dma callback routine as well as add support for freezing the queue when EINPROGRESS is encountered. Tested by: Marco Steinbach coco executive-computing de Notes: svn path=/head/; revision=239740
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386Yoshihiro Takahashi2005-05-291-2/+0
| | | | | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr) Notes: svn path=/head/; revision=146734
* Add missing <sys/module.h> includesPoul-Henning Kamp2004-05-301-0/+1
| | | | Notes: svn path=/head/; revision=129879
* Change the disk(9) API in order to make device removal more robust.Poul-Henning Kamp2004-02-181-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* - Add comments.Matthew N. Dodd2004-01-151-3/+3
| | | | | | | | | - Add more command defines and data structures. - Re-organize struct ida_drive_info to factor out struct ida_drive_info which will be used elsewhere. Notes: svn path=/head/; revision=124539
* Initialize drive device_t in softc.Matthew N. Dodd2004-01-131-0/+1
| | | | Notes: svn path=/head/; revision=124500
* Initialize bp->bio_driver1 in idad_strategy().Matthew N. Dodd2003-08-081-0/+1
| | | | | | | | | | | Removed by accident in 1.38. This fixes the trap 12 everyone was seeing in ida_construct_qcb(). PR: kern/53245 Notes: svn path=/head/; revision=118678
* Use bioq_flush() to drain a bio queue with a specific error code.Poul-Henning Kamp2003-04-011-1/+2
| | | | | | | | | | | 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-081-9/+1
| | | | | | | | | | | 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
* NO_GEOM cleanup:Poul-Henning Kamp2003-02-231-66/+15
| | | | | | | | | Move ida driver to "struct disk *" centric api. Retire major number 109. Notes: svn path=/head/; revision=111337
* Fix the detach code to actually detach the disk instance createdPoul-Henning Kamp2003-02-231-5/+1
| | | | | | | during attach. Notes: svn path=/head/; revision=111336
* Remove a goto the very next statement.Poul-Henning Kamp2003-02-231-3/+0
| | | | Notes: svn path=/head/; revision=111335
* NO_GEOM cleanup:Poul-Henning Kamp2003-02-211-3/+5
| | | | | | | | | | | | | | | | Retire the "d_dump_t" and use the "dumper_t" type instead. Dumper_t takes a void * as first arg which is more general than the dev_t taken by d_dump_t. (Remember: we could have net-dumpers if somebody wrote us one!) Define the convention for GEOM controlled disk devices to be that the first argument to the dumper function is the struct disk pointer. Change device drivers accordingly. Notes: svn path=/head/; revision=111220
* Update to new crashdump APIPaul Saab2003-02-071-38/+9
| | | | Notes: svn path=/head/; revision=110483
* (This commit touches about 15 disk device drivers in a very consistentPoul-Henning Kamp2002-09-201-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and predictable way, and I apologize if I have gotten it wrong anywhere, getting prior review on a patch like this is not feasible, considering the number of people involved and hardware availability etc.) If struct disklabel is the messenger: kill the messenger. Inside struct disk we had a struct disklabel which disk drivers used to communicate certain metrics to the disklayer above (GEOM or the disk mini-layer). This commit changes this communication to use four explicit fields instead. Amongst the benefits is that the fields do not get overwritten by wrong or bogus on-disk disklabels. Once that is clear, <sys/disk.h> which is included in the drivers no longer need to pull <sys/disklabel.h> and <sys/diskslice.h> in, the few places that needs them, have gotten explicit #includes for them. The disklabel inside struct disk is now only for internal use in the disk mini-layer, so instead of embedding it, we malloc it as we need it. This concludes (modulus any mistakes) the series of disklabel related commits. I belive it all amounts to a NOP for all the rest of you :-) Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=103714
* Here follows the new kernel dumping infrastructure.Poul-Henning Kamp2002-03-311-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Caveats: The new savecore program is not complete in the sense that it emulates enough of the old savecores features to do the job, but implements none of the options yet. I would appreciate if a userland hacker could help me out getting savecore to do what we want it to do from a users point of view, compression, email-notification, space reservation etc etc. (send me email if you are interested). Currently, savecore will scan all devices marked as "swap" or "dump" in /etc/fstab _or_ any devices specified on the command-line. All architectures but i386 lack an implementation of dumpsys(), but looking at the i386 version it should be trivial for anybody familiar with the platform(s) to provide this function. Documentation is quite sparse at this time, more to come. Details: ATA and SCSI drivers should work as the dump formatting code has been removed. The IDA, TWE and AAC have not yet been converted. Dumpon now opens the device and uses ioctl(DIOCGKERNELDUMP) to set the device as dumpdev. To implement the "off" argument, /dev/null is used as the device. Savecore will fail if handed any options since they are not (yet) implemented. All devices marked "dump" or "swap" in /etc/fstab will be scanned and dumps found will be saved to diskfiles named from the MD5 hash of the header record. The header record is dumped in readable format in the .info file. The kernel is not saved. Only complete dumps will be saved. All maintainer rights for this code are disclaimed: feel free to improve and extend. Sponsored by: DARPA, NAI Labs Notes: svn path=/head/; revision=93496
* No need to conditionalize on pci being in the kernel for thisWarner Losh2002-03-201-2/+0
| | | | Notes: svn path=/head/; revision=92820
* Fix a signed bug in the crashdump code for systems with > 2GB of ram.Paul Saab2001-11-131-1/+1
| | | | | | | Reviewed by: peter Notes: svn path=/head/; revision=86313
* KSE Milestone 2Julian Elischer2001-09-121-2/+2
| | | | | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha Notes: svn path=/head/; revision=83366
* Fix warning: 186: warning: label `done' defined but not usedPeter Wemm2001-06-151-1/+0
| | | | Notes: svn path=/head/; revision=78246
* Make the disk mini-layer check for and handle zero-length transfersPoul-Henning Kamp2001-05-061-6/+0
| | | | | | | instead of the underlying drivers. Notes: svn path=/head/; revision=76324
* Actually biofinish(struct bio *, struct devstat *, int error) is more generalPoul-Henning Kamp2001-05-061-2/+1
| | | | | | | | | than the bioerror(). Most of this patch is generated by scripts. Notes: svn path=/head/; revision=76322
* Last commit was broken.. It always prints '[CTRL-C to abort]'.Paul Saab2001-03-281-12/+2
| | | | | | | | | | Move duplicate code for printing the status of the dump and checking for abort into a separate function. Pointy hat to: me Notes: svn path=/head/; revision=74890
* Change the dump routines to only abort if control-c is pressed.Paul Saab2001-03-271-1/+3
| | | | | | | | | | If any other key is pressed, print a message stating that control-c is how to abort. Reviewed by: peter Notes: svn path=/head/; revision=74841
* Send the remains (such as I have located) of "block major numbers" toPoul-Henning Kamp2001-03-261-2/+0
| | | | | | | the bit-bucket. Notes: svn path=/head/; revision=74810
* Add crashdump support.Jonathan Lemon2001-02-261-2/+64
| | | | | | | Tested by: ps Notes: svn path=/head/; revision=73113
* Remove unneeded #include <machine/clock.h>Poul-Henning Kamp2000-10-151-1/+0
| | | | Notes: svn path=/head/; revision=67164
* The DEC version of the Smart controller has its configuration informationJonathan Lemon2000-07-271-2/+4
| | | | | | | | | | stored at a different location in the PCI space, so adjust accordingly. Also, when using more than two smart controllers in one machine, the disks were assigned the wrong drive number; fix this as well. Notes: svn path=/head/; revision=63934
* Separate the struct bio related stuff out of <sys/buf.h> intoPoul-Henning Kamp2000-05-051-1/+1
| | | | | | | | | | | | | | | | | | <sys/bio.h>. <sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall not be made a nested include according to bdes teachings on the subject of nested includes. Diskdrivers and similar stuff below specfs::strategy() should no longer need to include <sys/buf.> unless they need caching of data. Still a few bogus uses of struct buf to track down. Repocopy by: peter Notes: svn path=/head/; revision=60041
* - Fix a problem with the cdevsw struct that prevented the kernel fromMatthew N. Dodd2000-04-221-51/+48
| | | | | | | | | | | | booting on a RAID volume. - Change 'id_foo' and 'idfoo' to 'idad_foo' and 'idadfoo'. This makes names more consistent with the devices that the code belongs to (more in line with the style used in the amr/mlx driver.) Reviewed by: jlemon Notes: svn path=/head/; revision=59485
* Remove ~25 unneeded #include <sys/conf.h>Poul-Henning Kamp2000-04-191-1/+0
| | | | | | | Remove ~60 unneeded #include <sys/malloc.h> Notes: svn path=/head/; revision=59391
* Complete the bio/buf divorce for all code below devfs::strategyPoul-Henning Kamp2000-04-151-15/+15
| | | | | | | | | | | | | Exceptions: Vinum untouched. This means that it cannot be compiled. Greg Lehey is on the case. CCD not converted yet, casts to struct buf (still safe) atapi-cd casts to struct buf to examine B_PHYS Notes: svn path=/head/; revision=59249
* Change the maximum I/O transfer size to DFLTPHYS. This should fixJonathan Lemon2000-04-131-1/+1
| | | | | | | write corruption that some users were experiencing. Notes: svn path=/head/; revision=59213
* Move B_ERROR flag to b_ioflags and call it BIO_ERROR.Poul-Henning Kamp2000-04-021-2/+2
| | | | | | | | | | | | | | | | (Much of this done by script) Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED. Move b_pblkno and b_iodone_chain to struct bio while we transition, they will be obsoleted once bio structs chain/stack. Add bio_queue field for struct bio aware disksort. Address a lot of stylistic issues brought up by bde. Notes: svn path=/head/; revision=58934
* Remove B_READ, B_WRITE and B_FREEBUF and replace them with a newPoul-Henning Kamp2000-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | field in struct buf: b_iocmd. The b_iocmd is enforced to have exactly one bit set. B_WRITE was bogusly defined as zero giving rise to obvious coding mistakes. Also eliminate the redundant struct buf flag B_CALL, it can just as efficiently be done by comparing b_iodone to NULL. Should you get a panic or drop into the debugger, complaining about "b_iocmd", don't continue. It is likely to write on your disk where it should have been reading. This change is a step in the direction towards a stackable BIO capability. A lot of this patch were machine generated (Thanks to style(9) compliance!) Vinum users: Greg has not had time to test this yet, be careful. Notes: svn path=/head/; revision=58345
* Cosmetic fix: "id" -> "idad" for devstat.Jonathan Lemon2000-03-081-1/+1
| | | | | | | Missed in prior (approved) commit by: jlemon Notes: svn path=/head/; revision=57833
* Add support for older EISA compaq cards and newer Smart 4200 cards.Jonathan Lemon2000-03-081-84/+43
| | | | | | | | | | | | Change disk names to `idad' to avoid naming conflicts with the controller, and enable the new disk code to pick up the drives. Tested by: david.w.james@bt.com (existing compaq support) Reviewed by: msmith Approved by: jordan Notes: svn path=/head/; revision=57828
* Revamp the devstat priority system. All disks now have the same priority.Kenneth D. Merry1999-12-081-1/+2
| | | | | | | | | | | | | | | | | | | | | The same goes for CD drivers and tape drivers. In systems with mixed IDE and SCSI, devices in the same priority class will be sorted in attach order. Also, the 'CCD' priority is now the 'ARRAY' priority, and a number of drivers have been modified to use that priority. This includes the necessary changes to all drivers, except the ATA drivers. Soren will modify those separately. This does not include and does not require any change in the devstat version number, since no known userland applications use the priority enumerations. Reviewed by: msmith, sos, phk, jlemon, mjacob, bde Notes: svn path=/head/; revision=54279
* Call id_drvinit() from attach, not probe as the OS hasn't necessarilyPeter Wemm1999-11-081-2/+2
| | | | | | | decided which driver to use until attach. Use DRIVER_MODULE(). Notes: svn path=/head/; revision=53004
* Removal of sys/device.hNick Hibma1999-10-051-1/+0
| | | | | | | | | | | | | | | | - Move intrhook stuff into kernel.h - Remove all occurrences of #device <device.h> - Add kernel.h were necessary (nowhere) - delete device.h This file contained the structures for cfdata (old style config) and is no longer used. It was included by most drivers. It confuses the remote debugger as the definition of 'struct device' in device.h is found before the one in bus_private.h. Notes: svn path=/head/; revision=51957
* Remove five now unused fields from struct cdevsw. They should neverPoul-Henning Kamp1999-09-251-5/+0
| | | | | | | | | | | have been there in the first place. A GENERIC kernel shrinks almost 1k. Add a slightly different safetybelt under nostop for tty drivers. Add some missing FreeBSD tags Notes: svn path=/head/; revision=51658
* Use devstat_end_transaction_buf() rather than Use devstat_end_transaction()Poul-Henning Kamp1999-09-181-3/+1
| | | | Notes: svn path=/head/; revision=51376
* We don't need to pass the diskname argument all over the diskslice/labelPoul-Henning Kamp1999-08-281-2/+2
| | | | | | | code, we can find the name from any convenient dev_t Notes: svn path=/head/; revision=50511
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Spring cleaning around strategy and disklabels/slices:Poul-Henning Kamp1999-08-141-6/+4
| | | | | | | | | | | | | | | | | Introduce BUF_STRATEGY(struct buf *, int flag) macro, and use it throughout. please see comment in sys/conf.h about the flag argument. Remove strategy argument from all the diskslice/label/bad144 implementations, it should be found from the dev_t. Remove bogus and unused strategy1 routines. Remove open/close arguments from dssize(). Pick them up from dev_t. Remove unused and unfinished setgeom support from diskslice/label/bad144 code. Notes: svn path=/head/; revision=49771
* Remove cmaj and bmaj args from DEV_DRIVER_MODULE.Poul-Henning Kamp1999-07-041-3/+2
| | | | Notes: svn path=/head/; revision=48557
* Compaq Smart RAID driver for -current. Based on the original ida.cJonathan Lemon1999-06-241-0/+331
driver by Mark Dawson. This probably needs some work, but is stable enough to boot a RAID-only configuration, and survive `make world'. Notes: svn path=/head/; revision=48156