Commit Graph

715 Commits

Author SHA1 Message Date
pgoyette
e38abff020 Avoid calling bufq_free() from critical section. 2016-11-20 02:34:27 +00:00
pgoyette
b6d0aa6f21 Remove some debug printf's that slipped through. Thanks, wiz! 2016-09-27 08:05:34 +00:00
pgoyette
916bdfa5d4 Modularize the ld driver and all of its attachments. Ensure that all
parents are capable of rescan (or otherwise provide a means of attaching
children post-initialization).
2016-09-27 03:33:32 +00:00
jdolecek
e90b5bdddb modify ldattach() to have default strategy as a parameter 2016-09-16 15:20:50 +00:00
christos
5a86cfc800 CID 1364758: Integer handling issues, avoid sign extension to 64 bits. 2016-08-05 06:54:22 +00:00
jakllsch
e30127d7a8 Space before tab and trailing whitespace fixes. 2016-07-22 12:55:34 +00:00
jakllsch
91be397f74 Add ATA8-ACS Long Logical Sector Feature Set support to wd(4). 2016-07-22 04:08:10 +00:00
jakllsch
4821310465 Call wd_params_to_properties() after softc is sufficently
initialized.
2016-07-21 19:05:03 +00:00
jakllsch
580ae47a86 Remove unused 'params' argument of local function wd_params_to_properties() 2016-07-21 18:54:13 +00:00
msaitoh
5457a8e2a4 - Use aprint*() more in xxx_attach().
- Add missing aprint_naive("\n").
- Remove extra spaces and tabs.
- KNF.
2016-07-14 10:19:05 +00:00
bouyer
01a30830e3 Add a new config_detach() flag, DETACH_POWEROFF, which is set when
detaching devices at shutdown time with RB_POWERDOWN.
When detaching wd(4), put the drive in standby before detach
for DETACH_POWEROFF.
Fix PR kern/51252
2016-06-19 09:35:06 +00:00
christos
ee17f398d4 move scsipi_strvis -> libkern:strnvisx()
change the prototype to match userland
fix sizes of strings passed to it
2016-05-02 19:18:29 +00:00
christos
e7ae23fd9e include "ioconf.h" to get the 'void <driver>attach(int count);' prototype. 2015-08-20 14:40:16 +00:00
mlelstv
6f00c789e1 Use C99-style initializers for struct dkdriver. 2015-04-26 15:15:19 +00:00
riastradh
233f556c2e Convert sys/dev to use <sys/rndsource.h>. 2015-04-13 16:33:23 +00:00
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
christos
3be6bb2414 Centralize wedge ioctls in disk_ioctl. 2014-12-31 17:06:48 +00:00
mlelstv
64c07f5206 support DIOCMWEDGES ioctl. 2014-11-04 07:51:54 +00:00
mlelstv
aba91938d6 The partition size is always computed in native blocks. The code also assumes
that native blocks are always DEVB_SIZE (a few lines earlier) which makes
the current calculation a no-op.
2014-10-11 14:05:11 +00:00
matt
50ba60c0f2 g/u_int[0-9]*_t/ s/u_int/uint/g 2014-09-10 07:04:48 +00:00
tls
ea6af427bd Merge tls-earlyentropy branch into HEAD. 2014-08-10 16:44:32 +00:00
dholland
88b56804ff Drop the old discard/trim ioctls from wd.c. 2014-07-25 08:34:27 +00:00
dholland
7c5b45490e Implement d_discard for wd. 2014-07-25 08:22:08 +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
christos
268d7559ce kill sprintf 2014-03-25 16:19:13 +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
drochner
7ab7c82097 play the addref/delref game on suspend, prevents crash if the disk/CF Card
is eg. in a PCMCIA adapter and not mounted
2013-10-30 15:41:14 +00:00
drochner
958a129dbd -recognize CF cards by the magic value in inquiry data
-kill CFG_ATAPI_MASK, didn't see anything in the specs supporting
 that it exists
2013-10-30 15:37:49 +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
4c12d81ae9 Don't return EPASSTHROUGH when succeeding in ODIOCGDINFO or ODIOCGDEFLABEL 2013-08-19 14:58:57 +00:00
blymn
ce0d56725b Make sure a channel has drives attached before resetting it otherwise
wdc_reset will panic the kernel due to a null derefrence of ch_drives.
2013-08-07 12:50:17 +00:00
soren
2d96a254f8 TRIM showed up sometime between ATA-7 and ATA-8. 2013-08-06 19:13:13 +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
b66aa8a3bf Wait for DRDY after the PMP commands and don't wait before.
Should fix the worst part of PR kern/47793.
2013-05-03 20:02:08 +00:00
jakllsch
305bcb916e Also print port multiplier port number when register accesses fail. 2013-04-17 12:22:43 +00:00
bouyer
d672ee0cfa Fix kernel dump on ahci controller, by making sure we won't sleep
while dumping:
- introduce ata_delay() which either use delay() or kpause()
  depending on flags. use it in sata_reset_interface() and
  some ahci functions
- kill ATA_NOSLEEP, it was tested but never set. use ATA_POLL instead.
- reduce delay while polling in ahci, to speed up the dump

Should fix PR kern/41095
2013-04-03 17:15:07 +00:00
jakllsch
4637996056 Add argument to wdccommandext() to allow the entire contents of the
device/head register to be specified.  Needed for upcoming port multipler
support in mvsata(4).
2013-02-03 20:13:27 +00:00
riastradh
bc01998d73 Initialize b_resid before biodone in wdioctlstrategy error branch.
Otherwise we may panic when physio's biodone callback kasserts
something about b_resid, since nothing will have initialized it.
2013-01-09 22:03:49 +00:00
riastradh
6eb4026e2b Name the ATA SECURITY commands. 2013-01-09 17:55:04 +00:00
rkujawa
b53ade0bc2 Introduce WDC_CAPABILITY_NO_AUXCTL flag. For lame controllers that don't
have aux control registers (driver coming soon).
2012-11-19 22:22:56 +00:00
abs
6a65e108a0 Allow setting ATADEBUG_MASK to default value of atadebug_mask 2012-11-01 13:46:52 +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
drochner
5724e77fda Implement experimental support to pass notifications that a file
was deleted from the filesystem to the disk driver, commonly
known as "discard" or "trim".
fs/driver support is in ffs and ata wd for now.
This is what was posted here:
http://mail-index.netbsd.org/tech-kern/2012/02/28/msg012813.html
with minor cleanup, and the global switch replaced by a mount option.
2012-10-19 17:09:06 +00:00
bouyer
45b66ef963 If ch_ndrives is > 0, then ch_drive is not supposed to be NULL. 2012-08-04 21:21:09 +00:00
bouyer
b174797739 Make this compile again after DRIVET rename 2012-08-01 09:38:55 +00:00
bouyer
f815d4c9ca 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-08-01 09:02:03 +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
db53477265 Remove ata_channel->ata_drives, it's redundant with the pointer in
ata_drive_datas.  Originally part of a commit by bouyer@.
2012-07-29 21:10:50 +00:00