Commit Graph

268 Commits

Author SHA1 Message Date
christos c8ce02fd2c add the dma command ext translations. pointed out by manuel. 2002-01-14 02:17:59 +00:00
christos f9b7ffe292 Add LBA48 support based on patches from Keisuke YOSHIDA. KNF a bit while
I am there.
2002-01-13 17:24:28 +00:00
tsutsui 1267bddc09 Call malloc(9) with M_ZERO flag instead of memset() after malloc(). 2002-01-12 16:29:30 +00:00
bouyer bfc80822c7 Update my copyrigth. 2001-12-03 00:20:22 +00:00
bouyer 4ca5497111 Allow wd to attach to something else than wdc/pciide (like USB<->ATA bridges):
- move some functions from ata.c to ata_wdc.c or wdc.c.
- add callbacks to struct ata_bustype so that wd.c doesn't call directly
  functions from the lower level driver.
2001-12-03 00:11:15 +00:00
bouyer 4809ad42cb Clean up attach of wd/atapibus:
kill ata_atapi_attach. Change atapibus to use a struct scsipi_channel instead
of ata_atapi_attach as attach arch. Create a ata_device, compatible with
scsipi_channel, to attach wd.
2001-12-02 22:44:32 +00:00
bouyer cd8d64fe2b For ATAPI tape drives, poll for DSC (using a callout), to get the real
status of the command, and make sure the drive is ready for the next one.
2001-12-01 00:00:29 +00:00
lukem f61cbe7489 add RCSID 2001-11-13 12:51:12 +00:00
wiz cc0b68092e Correct various misspellings of 'transfer' and inflected forms. 2001-07-08 18:06:42 +00:00
toshii 4866f1a22b Fix typo. s/extention/extension/ 2001-07-05 08:38:24 +00:00
bjh21 4bc5a3b295 Add explicit support for IDE and SCSI adaptors which don't support interrupts.
On such adaptors, all transfers are done in polling mode.

OK'ed by Manuel on tech-kern.
2001-06-13 18:17:38 +00:00
drochner 06fc2f85cc Since __HAVE_OLD_DISKLABEL, DISKMINOR(u, p) isn't continuous over "p"
anymore. So we can't pass a range to vdevgone() but have to loop over the
partitions explicitely.
(otherwise the next device unit will be killed)
2001-05-06 18:30:56 +00:00
bouyer 937a7a3ed9 Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
  ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
  to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
  peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
  recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
  scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
  (no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
  set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
  the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
  will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
2001-04-25 17:53:04 +00:00
jdolecek 7f8c2c6de2 fix typo in comment - s/splio()/splbio()/ 2001-04-18 05:40:03 +00:00
jdolecek 745ab257dc Put back all header files defining ioctls 2001-04-11 19:07:36 +00:00
lukem 3aeb5f2f29 whitespace police 2001-02-24 01:59:46 +00:00
fvdl d040bd5908 Return error in the case of using ODIOCGDINFO or ODIOCGDEFLABEL when
the number of partitions is > OLDMAXPARTITIONS. This is better
than silently truncating the label (don't want to silently throw
away partitions when using an old disklabel binary on a label with
> 8 partitions). From Enami Tsugutomo.
2001-01-08 02:03:45 +00:00
fvdl e2d1c1f926 Adapt all disk devices in MI directories to handle ODIOC* calls
for ports that have bumped MAXPARTITIONS (and thus define
__HAVE_OLD_DISKLABEL).
2001-01-07 18:09:01 +00:00
lukem 146ab1ba9b s/pio/PIO/ and s/lba/LBA/ in messages output to users 2000-12-14 23:56:18 +00:00
thorpej 5297dab6a8 Use device_lookup() *more*. 2000-07-06 00:48:53 +00:00
thorpej cfaba33937 Use device_lookup(). 2000-07-06 00:43:04 +00:00
thorpej cde72a2c2b Garbage-collect __BDEVSW_DUMP_OLD_TYPE. 2000-07-05 23:31:12 +00:00
mrg 261538ecac remove include of <vm/vm.h> 2000-06-28 16:39:25 +00:00
bouyer 12d3bf8c1a Add a callback (*irqack), for controllers that need special action to ack
the interrupt once it has been ack'd on the drive.
2000-06-12 21:10:40 +00:00
bouyer e42c2ac5fb Ops, state should be RESET, not RECAL here. 2000-05-27 16:11:16 +00:00
bouyer 92a5f4d724 Sync my copyrigth notice 2000-05-15 08:32:07 +00:00
bouyer 2b86c61a31 - sync my copyrigth
- Add usefull message for obsolete error code (part of fix for kern/9856).
2000-05-15 08:31:33 +00:00
bouyer 73fe3e3323 Add dependancy to wdc for ata.c, so that 'atapibus at umass' will compile
without wdc or pciide. Closes kern/9842 from Gary Duzan.
2000-04-10 06:43:38 +00:00
augustss 7797648425 Change the initial field in struct ata_atapi_attach and struct scsipi_link
slightly to allow scsibus and atapibus to attach to the same device.
Furthermore, only attach a scsibus when the bus type is BUS_SCSI.
2000-04-02 17:25:52 +00:00
bouyer 26f6c9a9cf - DMA code cleanup: pciide_dma_finish() doesn't stop/unload the current DMA op
if an IRQ was not detected, unless the force flag was given. Use this to
  detect if the IRQ was for us (closer to shared IRQ for controllers which
  don't have their own IRQ handler in pciide.c) and to poll for DMA xfer.
  Also makes the timeout recovery code simpler.
- ATAPI cleanup: don't call controller-specific functions from atapiconf.c
  (wdc_*), so that it's possible to attach an atapibus to something else
  than a wdc/pciide (Hi Lennart :).
  Overload struct scsi_adapter with struct atapi_adapter, defined
  as struct scsi_adapter + atapi-specific callbacks. scsipi_link still points
  to an scsi_adapter, atapi code casts it to atapi_adapter if needed.
  Move atapi_softc to atapiconf.h so that it can be used by the underlying
  controller code (e.g. atapi_wdc.c).
  Add an atapi-specific callback *atapi_probedev(), which probe a drive
  in a controller-specific way, allocate the sc_link and fills in the
  ataparams if needed. It then calls atapi_probedev() (from atapiconf.c)
  to do the generic initialisations and attach the device.
- While I'm there merge and centralise the state definitions in atavar.h.
  It should now be possible to use a common ata/atapi routine to set the
  drive's modes (will do later).
2000-04-01 14:32:22 +00:00
augustss c62698f733 Fix a couple of misspelled comments. 2000-03-29 23:16:48 +00:00
bouyer ff2eb3a510 Remove unneeded assignement to nblks 2000-03-25 21:37:51 +00:00
thorpej fc96443d15 New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
  resource allocation.
- Insertion and removal of callouts is constant time, important as
  this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
2000-03-23 07:01:25 +00:00
thorpej fe551f0e64 Fix a bug in disksort_*() which caused non-optimal ordering when multiple
active partitions were on a single spindle.  Add a b_rawblkno member to
struct buf which contains the non-partition-relative block number to sort
by.
2000-02-07 20:16:47 +00:00
enami b1f85ee905 Don't put leading space, otherwise diskerr() prints unnecessary space
like this:
wd0h:  aborted command reading fsbn 650256 of 650256-650271 (wd0 bn 839056; cn 888 tn 13 sn 17), retrying
2000-01-25 09:33:12 +00:00
enami 29ffb365e2 Use format_bytes to convert drive capacity into human familier string (like
sd.c does).
2000-01-24 14:51:07 +00:00
thorpej dc59bc1db3 Update for sys/buf.h/disksort_*() changes. 2000-01-21 23:39:55 +00:00
bouyer 638e1a6958 Improve the downgrade logic:
- If UDMA 2 is failing try UDMA 1 first, it helps in some cases
- downgrade if we get an error in the first 4000 xfers, or if we get
  4 errors in 4000 xfers if the first 4000 went without troubles.

While I'm there commit a local change I have since some time to get my CD
probed: issue a "blanck" IDENTIFY before the one used to detect slave ghosts,
with my drive the first IDENTIFY following a controller reset fails with an
aborted command ...
2000-01-17 00:01:00 +00:00
leo 384bdc532b Implement the DIOCKLABEL ioctl. Through this ioctl it it possible keep the
disklabel on the last close or to drop it.
1999-12-23 21:23:19 +00:00
bouyer 8f56b89950 More WDCDEBUG_PRINT. 1999-11-26 12:39:43 +00:00
leo 0c76b12125 Give lp->d_type a value other than 'unknown'. When the model is "ST506",
the d_type field becomes DTYPE_ST506, otherwise it will be set to DTYPE_ESDI.
1999-11-10 14:11:34 +00:00
enami a2369d8e97 Cancel active transfers on aic/wdc detach.
Also makes LS-120 drive works for me again.
1999-10-20 15:22:24 +00:00
enami 67e874d814 Allow to detach wdc, atapibus, wd and cd. 1999-09-23 11:04:29 +00:00
enami c08940c49b Fix indentation of close curly brace. 1999-09-22 09:51:03 +00:00
bouyer 7e874499c9 Don't call wddone() from _wdstart(), the ata_wdc system will do it now.
call wd_flushcache() with the proper flags (especially don't set
AT_WAIT | AT_POLL).
1999-08-09 09:48:04 +00:00
bouyer c0da6c9129 Don't use C_NEEDDONE, it's deprecated. 1999-08-09 09:43:11 +00:00
bouyer fae9929734 - Add some debug printf (WDCPROBE) in _wdcreset_wait(), I've needed these
2 times in the past
- Set up timeout per xfer instead of per interrupt. This helps with
  PIO transfer (we would call timeout()/untimout() several times for a
  transfer).
- If we missed an interrupt for a PIO transfer, reset and restart it
  immedialy, don't try to recover and continue. If we missed an interrupt we
  may have lost a read/write cycle on the IDE bus. If this happens 1) we
  corrupt data and 2) we enter an interrupt loop at the end of the xfer, as
  the drive has some more data to read/write, but the host thinks the xfer is
  done.
This last change fix the (or at last some of the) 'lookup after lost interrupt'
some peoples have been experiencing.
1999-08-06 12:00:23 +00:00
bouyer 94d00cdb29 Bump timeout to 10s only for ATAPI devices, 1s is fine for IDE drives once
they are ready.
1999-04-15 09:41:09 +00:00
jonathan 380d12dfbd Complete bugfix in rev 1.3: increase read-parameter-block timeout to 10s
(as used for the hardware for which rev 1.3 was made.)
1999-04-14 22:23:15 +00:00
bouyer b43b844f6f - change the interrupt routines to take a 3rd arguments, set to 1 if we
are called from the interrupt or timeout handler, 0 otherwise.
- use this to know if we can busy-wait for wait_for_unbusy or wait_for_ready
This fixes a bug where CDs withot the DRQ_INTR capability would not busy-wait
for the CMDOUT phase.
While I'm there change 2 delay() to DELAY() for consistency, and
garbage-collect some old code from wdcintr() which has been ifdef'd out
for some time now.
1999-04-01 21:46:28 +00:00