Commit Graph

282 Commits

Author SHA1 Message Date
thorpej c9b3657ce9 Add trailing ; to CFATTACH_DECL. 2002-10-02 16:33:28 +00:00
thorpej 387fc6dc87 Use CFATTACH_DECL(). 2002-09-30 20:37:04 +00:00
thorpej f818766afe Declare all cfattach structures const. 2002-09-27 20:31:45 +00:00
drochner 0766f7d128 Remove a check whether the drive is initialized before crashdump.
It prevents dumping on an otherwise unused disk and seems
unnecessary anyway - the driver will deal with initialization.
fixes my PR kern/18135
2002-09-27 17:17:53 +00:00
provos 0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
gehenna 77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +00:00
soren 9e129fde67 Add ATA SMART reporting support from Ben Collver in kern/12787. 2002-08-05 23:29:27 +00:00
wiz 5db23d2c5d enouth -> enough. 2002-07-26 01:00:39 +00:00
hannken 7de36862a8 Rename bufq_init() to bufq_alloc().
Add bufq_free() to remove a buffer queue.
Avoid MALLOC while holding a spinlock.

From Chuck Silvers.
2002-07-21 15:32:17 +00:00
hannken 10ff5e6607 Implement a new device buffer queue interface.
One basic struct, a function to setup a queue with a specific strategy and
three macros to put buf's into the queue, get and remove the next buf or
get the next buf without removal.

The BUFQ_XXX interface will be removed in the future.
The B_ORDERED flag is not longer supported.

Approved by: Jason R. Thorpe <thorpej@wasabisystems.com>
2002-07-16 18:03:17 +00:00
yamt ec594e3ef5 do previous differently for wddump case. 2002-06-28 16:50:30 +00:00
yamt 2d80988a26 - remove big buffers on stack. discussed on tech-kern.
- constify.
2002-06-28 16:40:50 +00:00
bouyer cd3578d7ef More copyright fixes, pointed out by Thomas. Thanks ! 2002-04-23 20:41:13 +00:00
bouyer 10b49b13b9 In wdc_exec_command(), for data commands, read the status register after
the data transfer. This is mandatory for data out commands (although none are
used for now), and not forbiddend for data in commands. Also record if we
did transfers any data.
May solve kern/16159 by making the probe more robust in face of fake identify.
2002-04-09 21:17:53 +00:00
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