Commit Graph

338 Commits

Author SHA1 Message Date
dyoung d424839018 Include opt_ata.h for ATADEBUG definition instead of #defining it
unconditionally.
2007-04-08 06:58:47 +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
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
bouyer 4a1c74e813 Yet another broken seagate drive. 2006-11-09 19:43:05 +00:00
thorpej f0c0486c7b Use the new prop_dictionary_util functions. 2006-10-26 05:04:18 +00:00
thorpej 3c6ae35ab2 - Add a new disk ioctl (DIOCGDISKINFO) to get the disk-info dictionary
for the disk.
- Add a new function, disk_ioctl(), that does generic disk ioctl handling.
  DIOCGDISKINFO is handled here now, and others will be added in the future.
- In the wd driver, fill in the dk_info member of struct disk and use the
  new disk_ioctl() function.
2006-10-25 04:04:45 +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
thorpej 1edb40635e - Define disk information, disk geometry, and disk partition dictionary
schemas.  Disk information and disk geometry are designed to replace
  information currently conveyed to user space using struct disklabel.
- Add a dk_info member to struct disk; a reference to a disk information
  dictionary.  This dictionary is to be allocated and the reference stored
  in struct disk by individual drivers.
- disk_detach0() will release dk_info if non-NULL.
- Convert the wd(4) driver to stash geometry and other disk properties
  as the "disk-info" property in its properties dictionary.  This needs
  some cleanup, but will serve as an example of what to do with other
  disk drivers.
2006-09-22 04:48:38 +00:00
christos ca960afcce Oops, this is not ready yet. 2006-08-27 23:51:31 +00:00
christos 72c8baf57c Add missing initializer 2006-08-27 23:50:53 +00:00
lukem 755b4414f2 If there's any wd quirks in use, display them. 2006-08-01 07:19:07 +00:00
gendalia 109f1d8570 Add yet another broken 160GB seagate drive. Mine. ST3160021A. 2006-06-24 04:49:40 +00:00
bouyer 02ace2fe6c Adjust quirk entry for seagate drives. Should fix kern/33637 by Shigeya
Suzuki.
2006-06-05 18:22:23 +00:00
bouyer 38038ac6c0 Add yet another broken 160Gb seagate drive. I though we had found all of
them ... reported by Damian Lubosch on current-users.
2006-05-18 19:42:09 +00:00
cherry 45a06839c0 Backing out previous commit for more review. 2006-04-05 02:40:57 +00:00
cherry fb6529c627 Sleeps hard disk just before system shutdown.
Some hardware (eg: Apple iBooks) don't do this automatically
and the harddisk behaves as if the power plug were pulled.

Closes PR: kern/32766
2006-04-04 07:11:45 +00:00
thorpej 39cd836ee1 Use device_unit(). 2006-03-28 17:38:24 +00:00
yamt ec5a93183a merge yamt-uio_vmspace branch.
- use vmspace rather than proc or lwp where appropriate.
  the latter is more natural to specify an address space.
  (and less likely to be abused for random purposes.)
- fix a swdmover race.
2006-03-01 12:38:10 +00:00
thorpej 3ddf26777f Use device_is_active() rather than testing dv_flags for DVF_ACTIVE
directly.
2006-02-20 16:50:36 +00:00
abs 2287ad2061 cast 16bit atap_capacity to u_int64_t before << 16. (assigned to
a u_int64_t variable). Fixes 1 to 2 TB disks in qemu. Tested with
1200GB and to a lesser extent 2047GB sparse files. For reference
an empty FFS1 filesystem on a 1200GB sparse file uses 19GB of disk.
2006-01-15 19:51:06 +00:00
yamt 2addc3084c remove B_EINTR as it isn't used anymore. 2006-01-07 00:26:58 +00:00
yamt 690d424f28 - add simple functions to allocate/free a buffer for i/o.
- make bufpool static.
2006-01-04 10:13:05 +00:00
yamt 9297401d54 - add ioctls to set/get disk bufq strategy.
- implement them for some drivers.
2005-12-26 10:36:47 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
martin b1134bf887 Rework the funny "user_strat: No ioctl" error messages - the functions
have not been called user_strat for quite some time and the message is
confusing if you do not know the code.
2005-11-01 20:44:04 +00:00
yamt aec75b1cc6 - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
  have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
  from sys/bufq.h to sys/bufq_impl.h.
  (is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c.  (not tested)
2005-10-15 17:29:10 +00:00
riz 1ea801e91a Fix typo in comment from previous revision. 2005-09-05 22:55:31 +00:00
bouyer 9c2d1acf94 Use a pmatch(9) expression which should catch all present and future
seagate drives larger than 200GB for the WD_QUIRK_FORCE_LBA48 quirks.
Based on infos from
http://www.seagate.com/support/kb/disc/howto/interpret_model.html
2005-09-05 21:09:08 +00:00
bouyer f0a1379350 Add quirk for ST3200826A. From rudolf (netbsd at eq.cz) on tech-kern. 2005-09-05 20:42:37 +00:00
bouyer 02f20190a2 wd->atabus->ata_bio() should handle the multi-sector PIO transfers just fine,
and in a better way than what is done in wddump() (which also does it
for DMA transfers, limiting the dump speed significantly). So remove
code splitting transfers in wd->sc_multi chunks from wddump(), and call
wd->atabus->ata_bio() with the whole transfers.

Problem reported by Frank Kardel, and patch tested by him.
2005-08-29 19:05:54 +00:00
briggs 8826927f06 ST3300831A also needs WD_QUIRK_FORCE_LBA48. 2005-08-26 00:09:03 +00:00
bouyer 6f6f287c39 Add a comment explaining why we have WD_QUIRK_FORCE_LBA48, instead of always
using LBA48 for sector 0xffffff.
2005-08-25 19:06:35 +00:00
dsainty 867423adde Force LBA48 access to ST3160827AS drives. Without this change the entire
system hangs whenever a read or write request to sector 0xfffffff occurs.

The hang appears to happen when:

status = bus_space_read_1(wdr->cmd_iot, wdr->cmd_iohs[wd_status], 0);

is executed in __wdcwait(), and it is not possible to enter the debugger or
make the system respond at all after this point.

Whilst not necessarily the most prudent solution to handling the large number
of drives that exhibit this problem, it is currently the popular workaround.

[An alternative approach is to just always drop to LBA48 if the request
happens to pass by sector 0xfffffff and the drive reported as larger than
0xfffffff sectors.  My understanding is that the 32 bit addressing below
0x10000000 is purely there as a performance booster, not to resolve a
compatibility issue.]
2005-07-02 04:29:01 +00:00
bouyer 19abf3be02 The ST3160023A* also need the LBA48 quirk. From Timo Schoeler. 2005-06-19 18:26:40 +00:00
bouyer 69baf4357d Use pmatch() metacharacters to match both SATA and PATA versions of seagate
drives in the quirk table.
2005-06-16 20:03:35 +00:00
martti ec63076a4b Added LBA48 quirk for Seagate ST3200822AS. Tested by Teemu Rinta-aho. 2005-06-16 05:47:17 +00:00
christos 9b1843d7c2 - remove casts [to avoid volatile]
- sprinkle const
- avoid shadowed variables
2005-05-29 22:11:28 +00:00
bouyer 04f2acc1f3 Add another broken seagate device to the quirk list.
Problem reported by rudolf <netbsd at eq.cz> on netbsd-help@
2005-05-16 15:36:57 +00:00
yamt 99229e5d39 introduce a function to drain bufq and use it where appropriate. 2005-03-31 11:28:53 +00:00
perry f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
bouyer 3d94454016 Some drives reports ATA version < 4, and still support (and need) the
WDCC_FLUSHCACHE command. So for drive < ATA4, test WDC_CMD2_FC in atap_cmd_set2
before returning ENODEV.
Problem reported and fix tested by Michael Gerhards on port-sparc64.
2004-11-18 22:14:53 +00:00
yamt 05f25dcc2a move buffer queue related stuffs from buf.h to their own header, bufq.h. 2004-10-28 07:07:35 +00:00
bouyer b31a120195 Add a WD_QUIRK_FORCE_LBA48 quirck, which forces all access to use LBA48.
Use it for ST3200822A, which has a broken firmware and return an error
when accessing sector 0xfffffff with a LBA command.
Patch tested by David Brownlee.
2004-09-28 18:22:33 +00:00
thorpej cc79c7aeb0 Add support for wedges to the ATA disk driver. 2004-09-25 03:34:02 +00:00
bouyer cdc0918196 In case of error, reset the channel with AT_RST_NOCMD. We know the reset
won't abort any command at this point.
2004-09-16 20:52:43 +00:00
drochner b4b2fd9326 make the software managed bad-sector list optional
(kernel option WD_SOFTBADSECT)
2004-08-30 09:34:41 +00:00
thorpej 335b799580 atastart() (called only at splbio(), and from interrupts) can change
drive_flags, to make sure all drive_flags manipulations are done at
splbio().
2004-08-21 00:28:34 +00:00
thorpej 709a2d87fc Rename the ata_bustype "ata_reset_channel" member to "ata_reset_drive"
to reflect the new reality after Manuel added the bus reset ioctls.
2004-08-20 17:19:44 +00:00
thorpej 46f4277564 WDCDEBUG -> ATADEBUG. 2004-08-13 04:10:49 +00:00