summaryrefslogtreecommitdiff
path: root/sys/scsi/sd.c
Commit message (Collapse)AuthorAgeFilesLines
* Obsoleted by CAM.Justin T. Gibbs1998-09-151-1065/+0
| | | | Notes: svn path=/head/; revision=39266
* Remove the SLICE code.Søren Schmidt1998-09-141-259/+1
| | | | | | | | This clearly needs alot more thought, and we dont need this to hunt us down in 3.0-RELEASE. Notes: svn path=/head/; revision=39187
* remove bdevsw arg from dsopen();Poul-Henning Kamp1998-08-231-2/+2
| | | | | | | | Forgotten by: julian Reviewed by: bde Notes: svn path=/head/; revision=38493
* Added a flags arg to dsopen() and updated drivers. The DSO_ONESLICEBruce Evans1998-07-301-2/+2
| | | | | | | | | | | | | | and DSO_NOLABELS flags prevent searching for slices and labels respectively. Current drivers don't set these flags. When DSO_NOLABELS is set, the in-core label for the whole disk is cloned to create an in-core label for each slice. This gives the correct result (a good in-core label for the compatibility slice) if DSO_ONESLICE is set or only one slice is found, but usually gives broken labels otherwise, so DSO_ONESLICE should be set if DSO_NOLABELS is set. Notes: svn path=/head/; revision=37974
* Centralized and optimized handling of large sectors. CentralizedBruce Evans1998-07-291-55/+5
| | | | | | | | | | checking of transfer sizes and alignments. Old version tested with 2K-sectors on od disks by: Shunsuke Akiyama <akiyama@kme.mei.co.jp>. Notes: svn path=/head/; revision=37944
* Set the disk type to SCSI in the in-core label for the whole disk.Bruce Evans1998-07-281-1/+2
| | | | Notes: svn path=/head/; revision=37924
* If object pointers need to be cast to [unsigned] integers, then castBruce Evans1998-07-141-3/+3
| | | | | | | | | | to [u]intptr_t instead of to [u_]long. Don't cast pointers to integers just to do ordinary pointer arithmetic on them, especially when the casts use gcc's feature of casting lvalues. Notes: svn path=/head/; revision=37638
* SLICE probing becomes asynchronous. It can now be triggered byJulian Elischer1998-07-131-5/+3
| | | | | | | | | | | interupt level events. This needs a lot of cleanup, but has been working here for a month or two.. originally needed for CAM integration but that hasn't happenned yet. The probing state machines for each handler should be replaced by a more generic state-service. It's still quite messy in there.. Notes: svn path=/head/; revision=37616
* Fixed printf format errors.Bruce Evans1998-07-111-20/+22
| | | | Notes: svn path=/head/; revision=37555
* There is no such thing any more as "struct bdevsw".Julian Elischer1998-07-041-8/+26
| | | | | | | | | | | | | | | | | | | | | There is only cdevsw (which should be renamed in a later edit to deventry or something). cdevsw contains the union of what were in both bdevsw an cdevsw entries. The bdevsw[] table stiff exists and is a second pointer to the cdevsw entry of the device. it's major is in d_bmaj rather than d_maj. some cleanup still to happen (e.g. dsopen now gets two pointers to the same cdevsw struct instead of one to a bdevsw and one to a cdevsw). rawread()/rawwrite() went away as part of this though it's not strictly the same patch, just that it involves all the same lines in the drivers. cdroms no longer have write() entries (they did have rawwrite (?)). tapes no longer have support for bdev operations. Reviewed by: Eivind Eklund and Mike Smith Changes suggested by eivind. Notes: svn path=/head/; revision=37389
* Added used include of "ioconf.h" - don't depend on pollution inBruce Evans1998-06-171-1/+3
| | | | | | | | <sys/conf.h>. I'm fixing isa interrupt handler configuration and this is just a quick fix to keep SCSI configuration unharmed. Notes: svn path=/head/; revision=37033
* This commit fixes various 64bit portability problems required forDoug Rabson1998-06-071-6/+6
| | | | | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time. Notes: svn path=/head/; revision=36735
* An effort to make SLICE/DEVFS play with SCSI.Julian Elischer1998-05-071-79/+102
| | | | | | | | | | | Apparently I didn't make my plans to make dev_t and devsw[] go away under DEVFS quite clear enough to Peter Dufault as he stitched the SCSI system together using them when he redid the configuration side of things. This made is rather an effort to remove all vestiges of dev_t and devsw[] entries from sd.c in DEVFS/SLICE mode. Notes: svn path=/head/; revision=35827
* cleanup: remove duplicated dump code.Julian Elischer1998-05-071-125/+39
| | | | | | | fix oversight on SLICE ioctl code. Notes: svn path=/head/; revision=35822
* Add dump support to the DEVFS/slice code.Julian Elischer1998-05-061-2/+101
| | | | | | | | | now we can actually catch our crashes :-) Submitted by: Luoqi Chen <luoqi@chen.ml.org> (the man who's everywhere) Notes: svn path=/head/; revision=35812
* Fixed spelling of "fictitious" in diagnostics and commentsDag-Erling Smørgrav1998-04-271-3/+3
| | | | | | | PR: kern/6429 Notes: svn path=/head/; revision=35475
* close() is no longer a SLICE method.Julian Elischer1998-04-221-4/+11
| | | | | | | | Close is simply an open with no-read and no-write once internal to SLICE (it still exports a close to the rest of the kernel) Notes: svn path=/head/; revision=35386
* Add changes and code to implement a functional DEVFS.Julian Elischer1998-04-191-6/+207
| | | | | | | | | | | | | | | | | | | | | | | | This code will be turned on with the TWO options DEVFS and SLICE. (see LINT) Two labels PRE_DEVFS_SLICE and POST_DEVFS_SLICE will deliniate these changes. /dev will be automatically mounted by init (thanks phk) on bootup. See /sys/dev/slice/slice.4 for more info. All code should act the same without these options enabled. Mike Smith, Poul Henning Kamp, Soeren, and a few dozen others This code does not support the following: bad144 handling. Persistance. (My head is still hurting from the last time we discussed this) ATAPI flopies are not handled by the SLICE code yet. When this code is running, all major numbers are arbitrary and COULD be dynamically assigned. (this is not done, for POLA only) Minor numbers for disk slices ARE arbitray and dynamically assigned. Notes: svn path=/head/; revision=35319
* Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108.Dag-Erling Smørgrav1998-04-171-2/+2
| | | | Notes: svn path=/head/; revision=35256
* Support compiling with `gcc -ansi'.Bruce Evans1998-04-151-2/+2
| | | | Notes: svn path=/head/; revision=35210
* Add HW_WDOG to LINT, and turn it into a new-style option.Eivind Eklund1998-02-161-1/+2
| | | | Notes: svn path=/head/; revision=33445
* Make all file-system (MFS, FFS, NFS, LFS, DEVFS) related option new-style.Eivind Eklund1998-01-241-1/+2
| | | | | | | | | | | This introduce an xxxFS_BOOT for each of the rootable filesystems. (Presently not required, but encouraged to allow a smooth move of option *FS to opt_dontuse.h later.) LFS is temporarily disabled, and will be re-enabled tomorrow. Notes: svn path=/head/; revision=32726
* If available, use the device's LOGICAL blocksize as reported byJulian Elischer1997-12-291-53/+69
| | | | | | | | | | | | | | | | the "READ_CAPACITY" command, rather than the physical blocksize reported in the physical geometry code-page. Also don't print out worrying bogus messages when probing a device that has no media. There's no point in printing out something that is unknowable. It just confuses things. Move the check for valid blocksize out of 'open()' to the subroutine that actually finds this out, thus probe/attach can also report and act on the problem. Notes: svn path=/head/; revision=32080
* back out previous commitJulian Elischer1997-12-281-24/+13
| | | | | | | got a better version. Notes: svn path=/head/; revision=32050
* Move the sector size check to the right place,Julian Elischer1997-12-281-14/+25
| | | | | | | | also cope with some drives that return funny values. The correct fix will come in a few days. Notes: svn path=/head/; revision=32048
* Use ENOIOCTL instead of -1 (= ERESTART) for diskslice ioctls that areBruce Evans1997-12-061-2/+2
| | | | | | | not handled at a particular level. Notes: svn path=/head/; revision=31578
* In all such uses of struct buf: 's/b_un.b_addr/b_data/g'Poul-Henning Kamp1997-12-021-2/+2
| | | | Notes: svn path=/head/; revision=31493
* Fixed the sector size frobbing in sd_strategy() at least not toBruce Evans1997-11-231-8/+7
| | | | | | | | | | | break for the usual sector size. dscheck() adjusts b_bcount to handle EOF, so we must scale it and not preserve it. i/o beyond the end of partitions has been broken since rev.1.96. Not fixed in: od driver Notes: svn path=/head/; revision=31366
* Remove a bunch of variables which were unused both in GENERIC and LINT.Poul-Henning Kamp1997-11-071-1/+6
| | | | | | | Found by: -Wunused Notes: svn path=/head/; revision=31016
* Remove the call to scsi_start_unit() from sd_open(). It was causingJoerg Wunsch1997-10-121-6/+7
| | | | | | | | | | | | | | | | | much grieve to owners of IBM drives when used in conjunction with tagged command queuing, and didn't serve any purpose at all (since experiments have proven that it simply didn't work). Instead, call scsi_start_unit() once in sd_attach(), so in case the drive has been configured to `remote start', it will spin up there. (If it has spun down later, it must have been because of administrator action (scsi(8)) anyway.) While i was at it, bump the timeout for scsi_start_unit() to 30 seconds. 10 seconds were way too few for most drives. Notes: svn path=/head/; revision=30321
* Convert to use the new bufq* functions for dealing with bufferJustin T. Gibbs1997-09-211-6/+6
| | | | | | | queues. Notes: svn path=/head/; revision=29682
* Revert the logic behind my last change, and use a function calledJoerg Wunsch1997-09-131-5/+5
| | | | | | | | | | `is_physical_memory()' now for the decision whether to dump some region of memory or not. Suggested by: davidg Notes: svn path=/head/; revision=29330
* Do not ever try to coredump adapter memory regions.Joerg Wunsch1997-09-101-3/+7
| | | | | | | | | | | | PR: 4486 Submitted by: tegge@idi.ntnu.no (Tor Egge) Implement a function is_adapter_memory() in order to determine what should nto be dumped at all. Currently, only populated with the ``ISA memory hole''. Adapter regions of other busses should be added. Notes: svn path=/head/; revision=29280
* Removed unused #includes.Bruce Evans1997-09-021-5/+1
| | | | Notes: svn path=/head/; revision=29041
* Teach both disk drivers how to cope with a hardware watchdogJulian Elischer1997-08-091-2/+11
| | | | | | | | | | while dumping core.. I'm tired of getting 1/2 of a core-dump conditional on -DHW_WDOG for now this will migrate to 2.2 as that's where I need it. Notes: svn path=/head/; revision=28000
* Introduce an advisory exclusive lock on the scsi link structure.Tor Egge1997-06-251-1/+18
| | | | | | | | | | | Change sd_open, sd_close and sd_ioctl to use this lock to ensure serialization of some critical operations, thus avoiding some race conditions. Ideas picked from NetBSD (ccd and sd devices). This fixes one of the problems noted in PR kern/3688. Reviewed by: "Justin T. Gibbs" <gibbs@plutotech.com> Notes: svn path=/head/; revision=26939
* Remove old code in #if 0, leftovers from the days before != 512byteSøren Schmidt1997-05-011-29/+6
| | | | | | | sector support. Notes: svn path=/head/; revision=25359
* Don't include <sys/ioctl.h> in the kernel. Stage 1: don't includeBruce Evans1997-03-241-2/+1
| | | | | | | | it when it is not used. In most cases, the reasons for including it went away when the special ioctl headers became self-sufficient. Notes: svn path=/head/; revision=24203
* Removed nested #includes of <scsi/scsi_debug.h> and <scsi/scsi_driver.h>Bruce Evans1997-03-231-1/+3
| | | | | | | from <scsi/scsiconf.h> and fixed everything that depended on them. Notes: svn path=/head/; revision=24136
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notPeter Wemm1997-02-221-1/+1
| | | | | | | ready for it yet. Notes: svn path=/head/; revision=22975
* This is the kernel Lite/2 commit. There are some requisite userlandJohn Dyson1997-02-101-1/+2
| | | | | | | | | | | | | | | | | | changes, so don't expect to be able to run the kernel as-is (very well) without the appropriate Lite/2 userland changes. The system boots and can mount UFS filesystems. Untested: ext2fs, msdosfs, NFS Known problems: Incorrect Berkeley ID strings in some files. Mount_std mounts will not work until the getfsent library routine is changed. Reviewed by: various people Submitted by: Jeffery Hsu <hsu@freebsd.org> Notes: svn path=/head/; revision=22521
* Moved PC-98 routine in sd_get_parms() to pc98_machdep.c.KATO Takenori1997-02-041-34/+3
| | | | Notes: svn path=/head/; revision=22263
* Removed `Debugger("no slices")'. It's normal and harmless to have noBruce Evans1997-01-291-5/+2
| | | | | | | | | slices in sd_open() after a media change when the previous sd_open() discards the previous slices and then fails. sd_open() just handles media changes poorly and fails too often. Notes: svn path=/head/; revision=22095
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Removed all references to b_cylinder (aka b_cylin). It was evil andBruce Evans1996-12-011-2/+2
| | | | | | | | hasn't been used for a year or two since disksort() started sorting on b_pblkno. Notes: svn path=/head/; revision=20070
* This update adds the support for != 512 byte sector SCSI devices toSøren Schmidt1996-12-011-7/+80
| | | | | | | | | | | | | | | | | | | the sd & od drivers. There is also slight changes to fdisk & newfs in order to comply with different sectorsizes. Currently sectors of size 512, 1024 & 2048 are supported, the only restriction beeing in fdisk, which hunts for the sectorsize of the device. This is based on patches to od.c and the other system files by John Gumb & Barry Scott, minor changes and the sd.c patches by me. There also exist some patches for the msdos filesys code, but I havn't been able to test those (yet). John Gumb (john@talisker.demon.co.uk) Barry Scott (barry@scottb.demon.co.uk) Notes: svn path=/head/; revision=20061
* Changed cncheckc() interface so that it is 8-bit clean - return -1Bruce Evans1996-09-141-3/+3
| | | | | | | instead of 0 if there is no input. Notes: svn path=/head/; revision=18290
* Remove devconf, it never grew up to be of any use.Poul-Henning Kamp1996-09-061-24/+1
| | | | Notes: svn path=/head/; revision=18084
* Second phase of merge, get rid of more machine-independent-dependencies.Satoshi Asami1996-09-031-1/+4
| | | | | | | | | Get rid of pc98/pc98/pc98_device.h. Submitted by: The FreeBSD(98) Development Team Notes: svn path=/head/; revision=18010
* The sd and od drivers didn't check for negative block numbers (like wd.cPeter Wemm1996-08-021-3/+3
| | | | | | | | | | | does) before calling dscheck(). dscheck() doesn't appreciate this and calls Debugger() and returns without setting bp->b_error. This can happen when there is a casting error and offsets > 2G are converted to negative off_t's in the disk tools. (dumpfs used to do this). Notes: svn path=/head/; revision=17390