Commit Graph

1411 Commits

Author SHA1 Message Date
christos c182898b0d We have three sets of DTYPE_ constants in the kernel:
altq		Drop 		Type
	disklabel	Disk 		Type
	file		Descriptor	Type
(not to mention constants that contain the string DTYPE).
Let's make them two, by changing the disklabel one to be DisK TYPE since the
other disklabel constants seem to do that. Not many userland programs use
these constants (and the ones that they do are mostly in ifdefs). They will
be fixed shortly.
2015-01-02 19:42:05 +00:00
christos c60db2e923 make more drivers use disk_ioctl, and add a dev parameter to it so that
we can merge the "easy" disklabel ioctls to it. Ultimately all this will
go do dk_ioctl once all the drivers have been converted.
2014-12-31 19:52:04 +00:00
mlelstv 308b0467c4 forgot this one. disk_set_info includes the functionality of disk_blocksize. 2014-12-31 19:37:35 +00:00
christos 3be6bb2414 Centralize wedge ioctls in disk_ioctl. 2014-12-31 17:06:48 +00:00
mlelstv bdddf44518 disk_blocksize and disk_set_info relay the same information
to the disk subsystem.

Make disk_set_info also set blocksize shift values.
Remove every call to disk_blocksize.

Keep disk_blocksize for ABI compatibility, make it also set dg_secsize.
2014-12-31 08:24:50 +00:00
joerg 1436102dc9 Use size for the size argument of memcmp, not the result of a compare. 2014-11-18 17:03:41 +00:00
christos 91ba1e35a8 PR/49054: Add a quirk for the ES-6600 RAID controller which does not do
INQUIRY3 properly. Unfortunately looking at the length does not solve
the problem since other devices send greater lengths too.
2014-11-17 18:43:48 +00:00
mlelstv 64c07f5206 support DIOCMWEDGES ioctl. 2014-11-04 07:51:54 +00:00
snj f0a7346d21 src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
2014-10-18 08:33:23 +00:00
christos 1f0b2731c3 PR/49054: Uwe Toenjes: Some RAID controllers return more bytes in the
scsi 3 inquiry command than expected by the size of the scsi 3 inquiry
packet. This can be detected by looking at the additional_length field
returned by the scsi 2 inquiry. If that's the case, avoid doing the
scsi 3 inquiry because we can't handle the extra bytes later.
XXX: Pullup -7
2014-10-06 14:42:08 +00:00
justin 5fae769668 Use uint32_t for blocksize as per other uses and to fix warnings 2014-10-03 00:00:11 +00:00
matt 42ec0ad229 Don't use new as a variable name. 2014-09-05 05:30:42 +00:00
matt b2614afc67 Don't nest structure definitions. 2014-09-05 05:30:23 +00:00
tls ea6af427bd Merge tls-earlyentropy branch into HEAD. 2014-08-10 16:44:32 +00:00
dholland f9228f4225 Add d_discard to all struct cdevsw instances I could find.
All have been set to "nodiscard"; some should get a real implementation.
2014-07-25 08:10:31 +00:00
dholland 8c70ef39af Add d_discard to all struct bdevsw instances I could find.
I've set them all to nodiscard. Some of them (wd, dk, vnd, ld,
raidframe, maybe cgd) should be implemented for real.
2014-07-25 08:02:18 +00:00
dholland da7427b662 "peripheral", not "peripherial". 2014-07-13 17:12:23 +00:00
hannken f0a9c7e255 Prevent detaching an open device unless forced. 2014-07-12 12:13:01 +00:00
martin 71c0010c51 Fix PR kern/48550 by aligning the single instance of scsipi_read_cd_cap_data
that we found misaligned in the wild so far properly for the ahcisata
driver. Also point at PR kern/48754 for the real issue.
2014-04-18 06:23:32 +00:00
martin 93c2e669d7 PR kern/48550: additional initialization and sanity checking on the reported
blocksize of the medium.
2014-03-19 15:48:23 +00:00
dholland a68f9396b6 Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
2014-03-16 05:20:22 +00:00
skrll 842c96bd4c Don't probe beyond chan_ntargets in atapi_probe_bus in the "all" case.
PR/48626: ahci_atapi_probe_device panic with kmemguard
2014-03-05 08:45:13 +00:00
martin b083a17f72 Mark a diagnostic-only variable 2013-10-25 16:01:56 +00:00
martin 6a2419fedf Turn a few __unused into __diagused 2013-10-25 11:35:55 +00:00
martin 4fc0fb89a3 Mark a potentially unused variable 2013-10-19 19:10:12 +00:00
christos 11beb626a3 Pass the device name in, so we can debug what deferred drivers did not work. 2013-10-12 16:49:00 +00:00
skrll 36b20552e1 Remove unnecessary initialisation of error 2013-09-28 09:01:36 +00:00
skrll 0591a04731 Don't return EPASSTHROUGH when succeeding in ODIOCGDINFO or ODIOCGDEFLABEL 2013-09-28 09:00:26 +00:00
kiyohara e7fba601e4 Reset variable error to 0 before handle each ioctl cmd. Or returns EPASSTHROUGH
when some cmds. (e.g. ODIOCGDINFO)
2013-09-26 16:00:54 +00:00
martin 303dfad990 Remove unused variable 2013-09-15 13:53:51 +00:00
martin 2ef755c84e Remove unused variables 2013-09-12 12:26:13 +00:00
kardel 7c088e1695 bump command timeout to 5 minutes. several
types of changers (Overland PowerLoader, Dell
PowerVault) have been exceeding the 100 sec
limit aborting a perfectly (slowly) progressing
operation.
2013-08-09 19:58:44 +00:00
reinoud d840ba4944 Small patch to clarify last_lba and now using size confusingly. No functional
change.
2013-07-02 15:05:53 +00:00
tls 5819ac2839 Convert the entropy pool framework from pseudo-callout-driven to
soft interrupt driven operation.

Add a polling mode of operation -- now we can ask hardware random number
generators to top us up just when we need it (bcm2835_rng and amdpm
converted as examples).

Fix a stall noticed with repeated reads from /dev/random while testing.
2013-06-13 00:55:01 +00:00
christos 7b845fa9dc phase 1 of disk geometry cleanup:
- centralize the geometry -> plist code so that we don't have
	  n useless copies of it.
2013-05-29 00:47:48 +00:00
jakllsch d673e87705 Clamp sectors per unit in the default disklabel to the maximum value,
instead of allowing it to wrap, as is already done in wd(4).
2013-04-16 21:01:09 +00:00
wiz 421208e162 Add detach support. From martin@.
"Works for me."

Addresses PR 44283.
2013-04-07 18:50:33 +00:00
martin de625c77c3 Prompted by PR kern/47646, zero the value buffer before running the
GET_CONFIGURATION command and check for an unexpectedly large feature
length answer afterwards.
2013-03-15 16:16:12 +00:00
chs cbab9cadce split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
2012-10-27 17:17:22 +00:00
bouyer d7a08d3db1 If the controller supports more than 256 commands per target,
clamp it to 256 (maximum number of tags in SCSI). Newer controllers
(such as mpii(4), and mfi(4) when fixed to announce tagged queuing support)
support more than 256 outstanding commands and don't use the scsi tag,
but at this time scsipi will always allocate a tag, and panic if a periph
tries to send more than 256 commands.
2012-08-21 14:19:02 +00:00
bouyer ed5b6baaab Move a check for the drive type to the right place. This bug would cause
ATA drives to not be detected when the PATA (or emulated PATA) bus is shared
with an ATAPI device.
Should fix the problem reported by various peoples.
Thanks to Onno van der Linden and vanoven@free.fr for pointing out the
code in error.
2012-07-31 15:59:57 +00:00
bouyer 9edd4d81c5 Apply back changes that were reverted on Jul 24 and Jul 26 (general ata/wdc
cleanup and SATA PMP support), now that I'm back to fix the fallouts.
2012-07-31 15:50:31 +00:00
jakllsch 102f7b2016 Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@
2012-07-26 20:49:44 +00:00
jakllsch 5b9a15ee6c Revert dsl@'s changes of Sun, 15 Jul 2012 10:55:35 +0000 and
Sun, 15 Jul 2012 10:56:50 +0000, excepting the kernel version bump.
First step in reverting regressions to ata(4) subsystem during the addition of
port multiplier support.
2012-07-24 14:04:28 +00:00
dsl c9fe3ca8c3 Some namespace protection (and add greppablity).
Prefix the DRIVE_ and DRIVET_ constants from atavar.h with ATA_.
Don't use an enum for drive_type - you don't know how big it will be.
Move driver_type to avoid implicit structure padding (esp on arm).
This change is purely lexical and mechanical.

Update to 6.99.9 - this wasn't done when the SATA PMP changes
were made - I'm sure they warranted a bump.
2012-07-15 10:55:27 +00:00
bouyer 03c9df05c6 Add sata Port MultiPlier (PMP) support to the ata bus layer,
as described in
http://mail-index.netbsd.org/tech-kern/2012/06/23/msg013442.html
PMP support in integrated to the atabus layer.
struct ata_channel's ch_drive[] is not dynamically allocated, and ch_ndrive
(renamed to ch_ndrives) closely reflects the size of the ch_drive[] array.
Add helper functions atabus_alloc_drives() and atabus_free_drives()
to manage ch_drive[]/ch_ndrives.
Add wdc_maxdrives to struct wdc_softc so that bus front-end can specify
how much drive they really support (master/slave or single).
ata_reset_drive() callback gains a uint32_t *sigp argument which,
when not NULL, will contain the signature of the device being reset.
While there, some cosmetic changes:
- added a drive_type enum to ata_drive_datas, and stop encoding the
  probed drive type in drive_flags (we were out of drive flags anyway).
- rename DRIVE_ATAPIST to DRIVE_ATAPIDSCW to better reflect what this
  really is
- remove ata_channel->ata_drives, it's redundant with the pointer in
  ata_drive_datas
- factor out the interpretation of SATA signatures in sata_interpet_sig()

propagate these changes to the ATA HBA drivers, and add support for PMP
to ahcisata(4) and siisata(4).

Thanks to:
- Protocase (http://www.protocase.com/) which provided a system
  with lots of controllers, SATA PMP and drive slots
- Conservation Genomics Laboratory, Department of Biology, New Mexico State
  University for hosting the above system
- Brook Milligan, who set up remote access and has been very responsive
  when SATA cable move was needed
2012-07-02 18:15:44 +00:00
riastradh 3c457d56bb Take the kernel lock in atapibusdetach just like atapibuschilddet.
Fixes kassert in scsipi_lookup_periph when I press the power button
on one of my laptops (and maybe another one) to power it off.

ok mrg
2012-06-24 07:48:01 +00:00
jakllsch ba222d7fde Fix locking issue triggered by drvctr -r of a scsibus(4).
Pullup to netbsd-6 should be requested.
2012-05-13 01:03:13 +00:00
martin a4c413ac1a When ejecting a medium, invalidate the in core disklabel - it is not
meaningfull anymore. This makes the following cdclose() use silent
mode and finally fixes PR kern/43785.
2012-05-06 17:23:10 +00:00
martin 11c99eb4d6 In cdopen: make the test for media presence always silent. In all cases
requiring a message, we will most likely get that from the spinup attempt
anyway.
This avoids the spurious "Check Condition on CDB, Not Ready, Medium Not
Present, Tray Closed" messages at boot/shutdown time.
2012-05-06 16:42:19 +00:00