Commit Graph

1219 Commits

Author SHA1 Message Date
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
tsutsui be8757ef61 Add __attribute__((__packed__)) to all command structures. 2007-07-01 05:17:28 +00:00
dsl 716dbe1abc The cd ioctl definitions are not condusive to being called from within
the kernel (eg from withthe linux compat code).
Add CDIOCREADSUBCHANNEL_BUF and CDIOREADTOCENTRIES_BUF which are like the
  existing ioctls withoutthe _BUF, except that the data area immediately
  follows the control structure (and is fixed length).
Modify scsipi/cd.c so that it only ever has one 'struct cd_formatted_toc'
  allocated on the stack (maybe this info ought to be in the softc)
  structure since even one 800 byte on-stack buffer isn't overly friendly.
cdplay(1) still seems able to read the track-list of an ATAPI cd.
2007-06-30 22:16:38 +00:00
dsl d60a214b3b Remove a load of unnecessary casts now that 'addr' is 'void *'. 2007-06-30 16:00:55 +00:00
ad 59d979c5f1 Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-12 18:18:22 +00:00
yamt 5b23251544 fix fallout from caddr_t changes. 2007-03-04 15:17:20 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
jnemeth 7cab5bde24 add support devctl properties 2007-03-03 02:44:44 +00:00
thorpej ebd626809e TRUE -> true, FALSE -> false 2007-03-01 17:31:35 +00:00
thorpej 712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
bouyer 786853f62a The SEAGATE ST318203LSUN18G announces DT only capabilitie although it also
supports ST. Because of this the HBA doesn't initiate sync/wide negotiation,
so add PQUIRK_CAP_SYNC | PQUIRK_CAP_WIDE16 for this drive; fix
problem reported by Havard Eidnes.
2007-02-17 17:01:29 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
reinoud e54557c432 Fix for atapi devices that have 32 bit databusses selected. The devices
won't error out but will return garbage data. Implemented by generalising
the odd-check for PIO selection to check for 4 byte alignment in offset and
size.

Note that this check could be relaxed by checking if the ATAPI/ide bus
width is 16 for the device but its unknown to me if that information is
available here.
2007-01-23 20:10:06 +00:00
martin 73ebab4e1a The previous fix for PR 34202 was wrong (some sizeof used the union, not
the command block) - but instead of fixing this, we can now revert it
completley: the real fix has been applied to ../ic/wdc.c in rev. 1.244,
removing the alignement constraints.
2007-01-14 09:29:24 +00:00
cube 4cdd8aada6 Complete initializers so those files compile. 2007-01-13 18:42:45 +00:00
martin 9be3ef677b On Christos' request, reinstantiate the packed->__packed__ part of the
backed out change.
2006-12-01 21:36:56 +00:00
martin 035130a4dd Fix PR kern/34202 differently, by aligning the variables "the traditional
way".
2006-12-01 21:23:57 +00:00
martin d5c3b27938 Back out align(4) for all struct decls - it breaks various things all
over the tree (for example esiop on sparc64 won't boot any more).
2006-12-01 21:11:26 +00:00
christos 409998ac55 Prevent kernel crashes caused by umass devices that return bogus mode sense
data, such as the "Cooler Master". From Rhialto. While there, clean up some
debugging code and make the offset unsigned.
2006-11-30 17:59:35 +00:00
christos d048649c18 Add a quirk for Initio drives (from Rhialto) 2006-11-30 17:39:25 +00:00
christos d5272d5b35 PR/34202: Dave Huang: Accessing cd device on alpha causes kernel trap
From the PR:
  Since struct scsipi_read_discinfo_data is an odd number of bytes long
  (35 bytes), ti ends up being unaligned. wdc_datain_pio() uses
  bus_space_read_multi_4() to read the response from the drive, and
  since ti is unaligned, it causes an unaligned access fault.

Add __aligned__(4) to all the structures.
2006-11-30 16:23:20 +00:00
drochner c054c36959 restore a nice little feature which got lost in some previous commit:
the d_typename field of the default disklabel is initialized with
text from the SCSI inquiry, so that one gets at least a vague idea which
disk he is dealing with
2006-11-29 21:06:49 +00:00
itohy e73f75f98e If the block size reported by Read Capacity looks valid, just use it.
Use Request Sense only if Read Capacity succeeded and did not return
valid block size.
Discussed on tech-kern.
Fix the easier part of NetBSD PR kern/26537.
(The harder part is the device hangs on large (>= 8KB) transfer.
Possibly umass BBB problem?)

Remove scsipi_size() and scsipi_validate_secsize() from scsipi_base.c
and add their functions to sd.c since they are used only by sd.c.

Use SCSI term `block' instead of `sector' where applicable.
2006-11-26 05:01:09 +00:00
scw 79017e8016 - Call disk_blocksize(9) once we know the disk's physical block size.
- bounds_check_with_label() has been fixed, so no need to fake the
  raw partition's size in terms of DEV_BSIZE units.
2006-11-25 12:06:31 +00:00
scw e34c588b57 - Call disk_blocksize(9) when we determine the physical block size of the
media. (Will this ever be anything other than 2048?)
- bounds_check_with_label() has been fixed, so put the correct partition
  size in the default disklabel.
2006-11-25 12:03:38 +00:00
he e004bf7e3b This file needs to know the size of "struct device", so include
<sys/device.h> here.  This should allow the sparc GENERIC_SUN4U and
sparc64 kernels to build sata_subr.c again.
2006-11-23 08:44:42 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
reinoud c4b555df90 Implement/add bufq strategy setting by dkctl for the CD class devices.
Though its hardly advisable to change the CD strategy setting to anything
other than `disksort' or `prioscan' it ought to be possible.
2006-11-14 14:56:55 +00:00
skrll ebb445db43 Remove the boot-from-disk hppa hack now that a real fix has been found. 2006-10-30 16:15:56 +00:00
reinoud 8b52dc54b3 Implement another class of `unit not ready' sense handling that is not
fatal.. A `long write in progress' is a retry again later command that is
issued when a device returns immediately after a write request but needs
some time before it can handle read requests.
2006-10-28 01:24:29 +00:00
christos e1ae6bce13 - don't allocate huge arrays on the stack
- no bogus ; after }; in block statements!
2006-10-27 21:58:59 +00:00
scw 4526a898c6 Validate the sector size returned by READ CAPACITY. If it looks bogus
print a warning and fallback to a suitable default.

Fixes a problem on hp700 reported by skrll@
2006-10-20 07:11:50 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
riz cc84101104 Also print blksize with %u - this is what I get for eyeballing
a patch instead of applying it directly.  PR#33966.
2006-10-10 23:35:29 +00:00
riz 31568e4a8e Print an unsigned parameter with %lu, not %ld. From David A. Holland
in PR#33966.
2006-10-10 23:30:23 +00:00
scw 056c6fdd05 Some removable umass(4) devices don't respond to mode sense page 6, or
simply return zero for logical block size. In either case, use the sector
length reported by READ_CAPACITY instead of defaulting to 512 bytes.

This partially addresses the problems reported in PR port-i386/34707 and
PR kern/34737. Namely the incorrectly reported drive geometry and the
'hanging' issue.

However, since the device in question reports 2048-byte physical sectors
it will remain unusable until DEV_BSIZE is banished.
2006-10-09 21:29:14 +00:00
mlelstv e19fb1ec00 Use last track info only if it gives a sane value. Fixes PR#34688. 2006-10-08 07:50:16 +00:00
reinoud c3af0f9a94 In gcc4 structures are differently aligned compared to gcc3. Lots of
structures can thus be misaligned for DMA when declared on stack.

The current atapi code accepts the misaligned dma's only screw's them up.
This small patch disables DMA for the rare transactions that are
misaligned. Note that all bulk-transfers are aligned due to page sizes.

See PR kern/34689
2006-10-01 20:10:31 +00:00
itohy f87d591722 A little effort against kernel bloat....
Exclude ATA DMA support if no ATA DMA capable drivers are compiled in.
2006-09-30 15:56:17 +00:00
reinoud d1de30eaae Fix same panic problem as with cd.c when a scsi error happends on
read/write action. It would panic on a diagnosic assertion. When a scsi
read/write command fails, the whole extent is gone bad so mark all as not
done.
2006-09-14 17:54:34 +00:00
reinoud 2b551264c1 Aparently i've misread, backing out change. 2006-09-11 19:43:55 +00:00
reinoud 5411355304 Don't add one to the capacity returned of READ CAPACITY! it results in
reporting a sd* disc that is one sector too big (!) Normally not much a
problem in FFS since its clustered but other filingsystems *do* care.
2006-09-11 17:57:07 +00:00
reinoud 25522cfb86 Oeps! I overlooked the size argument of the SCSI call. It ought to be equal
to the number of bytes we are reading: READ_DISCINFO_BIGSIZE

sorry.
2006-09-08 00:33:18 +00:00
reinoud a5b62cb444 The size of struct scsipi_read_discinfo_data is not even due to the data[1]
pseudo array in the structure. The scsi command issued used
sizeof(scsipi_read_discinfo_data) but included thus the last byte that
wasn't going to be inspected anyway. Using the constant
READ_DISCINFO_BIGSIZE fixes the bug.

Even though SCSI adapters *should* accept odd lengths, the Sun U10
(sparc64's) crashes in bus_space_read_multi_stream_2(). That explains the
crash.

NOTE: somewhere in NetBSD/sparc64's atapibus support there is the
assumption on the even size; this needs to be fixed! (Hi Sparc64 portmaster
:-) )
2006-09-07 22:52:46 +00:00
itohy 0a30900857 Add PIOBM (busmastering transfer using ATA PIO mode) support.
The PIOBM is used by only one driver (will be added later,
stay tuned) and intruduce an attribute "ata_piobm" so that
it will be conditionally compiled in.
The "ata_dma" (busmastering transfer using ATA DMA mode) and
"ata_udma" (busmastering transfer using ATA Ultra DMA mode)
attributes are also added for consistency, but unused for now.
2006-09-07 12:34:41 +00:00
dogcow f2d329dca0 remove more vestiges of CCITT, LLC, HDLC, NS, and NSIP. 2006-09-07 02:40:31 +00:00
christos b231088be0 add missing initializer 2006-09-03 21:16:09 +00:00
christos 01edefa570 comment out unreachable code 2006-09-03 06:23:27 +00:00
christos 996634386c comment out unreachable code. 2006-09-03 06:22:05 +00:00
christos 4905e82e29 add missing initializer 2006-09-03 05:30:48 +00:00