Commit Graph

429 Commits

Author SHA1 Message Date
Poul-Henning Kamp
749e11661c Mark some arguments __unused. 2002-03-11 08:04:59 +00:00
Hidetoshi Shimokawa
0c7658478e Add support for Simplified Direct Access Device in scsi_op_desc(). 2002-03-11 03:08:17 +00:00
John Baldwin
a854ed9893 Simple p_ucred -> td_ucred changes to start using the per-thread ucred
reference.
2002-02-27 18:32:23 +00:00
Poul-Henning Kamp
af91f4fa16 GC: BIO_ORDERED going away. 2002-02-22 09:18:46 +00:00
Hidetoshi Shimokawa
8b798fba96 - Add support for Simplified Direct Access Device, mostly for
Firewire/SBP-II devices.

- Add quirk for Logitec USB/Firewire HDD.

MFC after: 3 days.
2002-02-21 11:58:47 +00:00
Mike Barcroft
fd8e4ebc8c o Move NTOHL() and associated macros into <sys/param.h>. These are
deprecated in favor of the POSIX-defined lowercase variants.
o Change all occurrences of NTOHL() and associated marcros in the
  source tree to use the lowercase function variants.
o Add missing license bits to sparc64's <machine/endian.h>.
  Approved by: jake
o Clean up <machine/endian.h> files.
o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>.
o Remove prototypes for non-existent bswapXX() functions.
o Include <machine/endian.h> in <arpa/inet.h> to define the
  POSIX-required ntohl() family of functions.
o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>,
  and <sys/param.h>.
o Prepend underscores to the ntohl() family to help deal with
  complexities associated with having MD (asm and inline) versions, and
  having to prevent exposure of these functions in other headers that
  happen to make use of endian-specific defines.
o Create weak aliases to the canonical function name to help deal with
  third-party software forgetting to include an appropriate header.
o Remove some now unneeded pollution from <sys/types.h>.
o Add missing <arpa/inet.h> includes in userland.

Tested on:	alpha, i386
Reviewed by:	bde, jake, tmm
2002-02-18 20:35:27 +00:00
Brian S. Dean
18efad26c7 Add NO_6_BYTE quirk entry for the LaCie Ltd. 105311 80 Gig USB2 drive.
Submitted by:	Brian Schellenberger <bts@babbleon.org>
2002-02-18 13:35:30 +00:00
Poul-Henning Kamp
f67a6639a2 Remove spurious ';'
Obtained from:	~bde/sys.dif.gz
2002-02-10 21:36:13 +00:00
Maxim Sobolev
e6f56180e3 Add support of PhotoClip USB Camera (http://www.myphotoclip.com):
- Vendor&Device IDs for USB product,
- quirk for SCSI CAM.

PR:		34481
Submitted by:	Olexander Kunytsa <kunia@x-telecom.net>
MFC in:		3 days
2002-01-31 11:39:17 +00:00
Mike Smith
65c382562e Define the kern.cam sysctl in the cam layer, rather than multiply in several
peripheral drivers.  Remove Ken's comment to the effect that this needed
to be done.

Staticise camnet_ih and cambio_ih.
2002-01-09 03:39:04 +00:00
Mike Smith
1e050d0ca5 Staticise a debugging variable.
Submitted by:	non
2002-01-09 03:37:16 +00:00
Maxim Sobolev
1fc3a4a25d Add quirk for DIVA USB Mp3 Player.
PR:		kern/33638
Submitted by:	Olexander Kunytsa <kunia@x-telecom.net>
MFC after:	3 days
		(pending re's approval)
2002-01-08 21:07:46 +00:00
Kelly Yancey
9379ee7b50 Extend Olympus E-100RS quirk to cover entire E series of digital cameras. 2002-01-07 03:32:56 +00:00
John Baldwin
c86b6ff551 Change the preemption code for software interrupt thread schedules and
mutex releases to not require flags for the cases when preemption is
not allowed:

The purpose of the MTX_NOSWITCH and SWI_NOSWITCH flags is to prevent
switching to a higher priority thread on mutex releease and swi schedule,
respectively when that switch is not safe.  Now that the critical section
API maintains a per-thread nesting count, the kernel can easily check
whether or not it should switch without relying on flags from the
programmer.  This fixes a few bugs in that all current callers of
swi_sched() used SWI_NOSWITCH, when in fact, only the ones called from
fast interrupt handlers and the swi_sched of softclock needed this flag.
Note that to ensure that swi_sched()'s in clock and fast interrupt
handlers do not switch, these handlers have to be explicitly wrapped
in critical_enter/exit pairs.  Presently, just wrapping the handlers is
sufficient, but in the future with the fully preemptive kernel, the
interrupt must be EOI'd before critical_exit() is called.  (critical_exit()
can switch due to a deferred preemption in a fully preemptive kernel.)

I've tested the changes to the interrupt code on i386 and alpha.  I have
not tested ia64, but the interrupt code is almost identical to the alpha
code, so I expect it will work fine.  PowerPC and ARM do not yet have
interrupt code in the tree so they shouldn't be broken.  Sparc64 is
broken, but that's been ok'd by jake and tmm who will be fixing the
interrupt code for sparc64 shortly.

Reviewed by:	peter
Tested on:	i386, alpha
2002-01-05 08:47:13 +00:00
Chris D. Faulhaber
47453701a1 Add support for Nikon Coolpix E775 and E885 cameras.
PR:		33407 (E885)
Submitted by:	Brian Behlendorf <brian@hyperreal.org> (E885)
2002-01-01 13:28:43 +00:00
Noriaki Mitsunaga
499b1f4b70 o Add KLD support for scsi_low.
o Add KLD dependency of ncv, nsp and stg drivers to scsi_low.

Submitted by: takawata
2001-12-15 12:32:23 +00:00
Noriaki Mitsunaga
14f81be9aa Remove PAO3 dependent part where I missed to remove at last commit. 2001-12-10 02:07:34 +00:00
Ian Dowse
b7fee4d50b Add a NO_6_BYTE quirk for the D-series olympus digital cameras.
PR:		kern/31250
Submitted by:	Bryan Liesner <bleez@bellatlantic.net>
2001-12-09 21:38:33 +00:00
Kenneth D. Merry
5cd818b1b7 Bring the probe inquiry code in line with the SCSI spec.
It is legal to have a device with device type 0x1f, that just means
that the device is of unknown type.  Instead, only check the peripheral
qualifier when deciding whether or not to reject a device based on its
inquiry information.

Tested by:	julian
MFC after:	3 weeks
2001-11-27 03:34:22 +00:00
Ian Dowse
468a40eceb Back out 1.88 (NO_SYNC_CACHE quirk for Infortrend IFT-3102). Since
this device properly reports that the sync cache command is
unsupported, the bug is that we still complain about it on the
console.

Noticed by:	gibbs
2001-11-26 16:54:37 +00:00
David Greenman
136b546adf Disabled tagged commands for Hitachi Jura-C series with J8A8 firmware.
PR:		23536
Submitted by:	amagai@nue.org
2001-11-19 23:23:28 +00:00
Ian Dowse
c0bea86dc4 Back out revision 1.117; the correct solution is to upgrade the
firmware on the drive in question. The pattern also matched far
too many Hitachi drives.

Spotted by:	dg
2001-11-19 20:50:44 +00:00
Ian Dowse
39456c0351 Hitachi DK32 disks have problems with tagged queuing under load.
PR:		kern/23536
Submitted by:	Y.Amagai <amagai@nue.org>
MFC after:	1 week
2001-11-19 01:19:08 +00:00
Matt Jacob
3cf64d0fbb Be very generous with timeouts for synchronize cache. We may wait a very long
time in the cases where it really sends the drive out to lunch, but it also
allows us to catch very wierd edge cases of strange drives that might take
a very long time (emulated disk drives over a network, e.g.).
2001-11-17 18:26:00 +00:00
Ian Dowse
ff9fc44d6e The Infortrend IFT-3102 multihost U2 SCSI to U2 SCSI controller
doesn't support the synchronise cache command.

PR:		kern/21752
Submitted by:	Nick R. Colakovic <nickc@corp.firstindustrial.com>
MFC after:	1 week
2001-11-17 17:43:06 +00:00
Ian Dowse
d5abb1e452 Add quirk for Fujitsu M2513A MO drives. These drives hang at various
operations due to the synchronize cache command.

PR:		kern/21674
Submitted by:	W.Scholten <whs@xs4all.nl>
MFC after:	1 week
2001-11-17 14:46:22 +00:00
Paul Saab
817805d9c9 Fix a signed bug in the crashdump code for systems with > 2GB of ram.
Reviewed by:	peter
2001-11-13 01:08:54 +00:00
Kelly Yancey
9bf4b82fc9 Add quirk for Minolta 2330 Zoom digital camera.
Submitted by:	Jan Stocker <Jan.Stocker@t-online.de>
2001-11-07 23:11:13 +00:00
Kelly Yancey
66eb895778 Add quirk for Nikon Coolpix 995.
Submitted by:	Jos Vissers <jos@tunix.nl>
2001-11-07 21:47:49 +00:00
Kelly Yancey
33b6e7aabe Fix bug in scsi_read_write() where it might use 6-byte commands when
10/12-byte-specific flags where specified.

Reviewed by:	ken
MFC after:	1 day
2001-11-06 23:50:33 +00:00
Kelly Yancey
571ee57bdd Add quirk entry for Olympus E-100RS digital camera. This and the existing
quirk regarding the C- series makes me suspect that all Olympus models have
the same quirks, but I cannot prove it.

Submitted by:	Bernd Walter <ticso@cicely8.cicely.de>
2001-11-05 23:33:18 +00:00
Noriaki Mitsunaga
c6a39821ec Remove PAO3 dependent part.
This will not affect either -current nor -stable.
2001-11-03 08:55:34 +00:00
Scott Long
d36803e209 Add a quirk entry so that the Maxtor 3000LE USB drive will work.
Submitted by:	merry, Randy Bush <randy@psg.com>
MFC after:	3 days
2001-10-15 02:05:06 +00:00
Robert Watson
f7312ca2a9 o Modify access control code for the CAM SCSI pass-through device to
use securelevel_gt() instead of direct securelevel variable test.

Obtained from:	TrustedBSD Project
2001-09-26 20:13:16 +00:00
Robert Watson
f5ef42be31 s/securelvel/securelevel/ 2001-09-25 02:15:00 +00:00
Scott Long
ba3b337964 Add a quirk entry for the Sony CLIE memory stick device. This will become
useful once ATAPI support is turned on in the umass driver.
2001-09-19 00:35:09 +00:00
Matt Jacob
03fee89a1d The code that sees a drive (at mount time) not in buffered mode and
attempts to set buffered mode was printing out "unable to set buffered
mode" no matter what. Oops.

Spotted by:	Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
MFC after:	3 weeks
2001-09-14 19:00:51 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
Kenneth D. Merry
e41ea14875 Attach to a CD device even when the SCSI status is 'busy'.
Reported by:	Thomas Quinot <thomas@cuivre.fr.eu.org>
MFC after:	3 weeks
2001-09-03 05:04:47 +00:00
Nick Hibma
ed1038315a Add quirk entry for FujiFilm camera.
Submitted by:		Guido van Rooij <guido@gvr.org>
2001-09-02 20:44:49 +00:00
Nick Hibma
1db35f56de Add quirks for Kingbyte USB Pen drive.
Submitted by:		Eugene M. Kim <gene@nttmcl.com>
PR:			29530
2001-09-02 09:31:08 +00:00
Matt Jacob
16565c1c3d Take CAM_REQUEUE_REQ out of the class of things we were trying to honor
retry count on.

MFC after:	4 weeks
2001-08-30 20:54:00 +00:00
Matt Jacob
83e9f270b3 Clear SA_FLAG_ERR_PENDING for MTREW, MTERASE and MTRETENS ioctl cases.
Clear residual counts after a successful samount (the user doesn't
care that we got an N-kbyte residual on our test read).

Change a lot of error handling code.

1. If we end up in saerror, check more carefully about the kind of
error. If it is a CAM_SCSI_STATUS_ERROR and it is a read/write
command, we'll be handling this in saerror.  If it isn't a read/write
command, check to see whether this is just an EOM/EOP check condition-
if it is, just set residual and return normally. A residual and
then a NO SENSE check condiftion with the ASC of 0 and ASCQ of
between 1 and 4 are normal 'signifying' events, not errors per se,
and we shouldn't give the command to cam_periph_error to do something
relatively unpredictable with.

2. If we get a Bus Reset, had a BDR sent, or get the cam status of
CAM_REQUEUE_REQ, check the retry count on the command. The default
error handler, cam_periph_error, doesn't honor retry count in these
cases. This may change in the future, but for now, make sure we
set EIO and return without calling cam_periph_error if the retry
count for the command with an error is zero.

3. Clean up the pending error case goop and handle cases more
sensibly.

The rules are:

 If command was a Write:

  If we got a SSD_KEY_VOLUME_OVERFLOW, the resid is
  propagated and we set ENOSPC as the error.

  Else if we got an EOM condition- just mark EOM pending.

	And set a residual of zero. For the longest time I was just
        propagating residual from the sense data- but my tape
        comparison tests were always failing because all drives I
        tested with actually *do* write the data anyway- the EOM
        (early warning) condition occurred *prior* to all of the
        data going out to media- that is, it was still buffered by
        the drive. This case is described in SCSI-2, 10.2.14,
        paragraph #d for the meaning of 'information field'. A
        better fix for this would be to issue a WFM command of zero
        to cause the drive to flush any buffered data, but this
        would require a fairly extensive rewrite.

 Else if the command was a READ:

  If we got a SSD_KEY_BLANK_CHECK-
	If we have a One Filemark EOT model- mark EOM as pending,
	otherwise set EIO as the erorr.
  Else if we found a Filemark-
	If we're in Fixed Block mode- mark EOF pending.

 If we had an ILI (Incorrect Length Indicator)-
  If the residual is less than zero, whine about tape record
  being too big for user's buffer, otherwise if we were in
  Fixed Block mode, mark EIO as pending.

All 'pending' conditions mean that the command in question completes
without error indication. It had succeeded, but a signifying event
occurred during its execution which will apply to the *next* command
that would be exexcuted. Except for the one EOM case above, we always
propagate residual.

Now, way back in sastart- if we notice any of the PENDING bits set,
we don't run the command we've just pulled off the wait queue. Instead,
we then figure out it's disposition based upon a previous command's
association with a signifying event.

 If SA_FLAG_EOM_PENDING is set, we don't set an error. We just complete
 the command with residual set to the request count (not data moved,
 but no error). We continue on.

 If SA_FLAG_EOF_PENDING- if we have this, it's only because we're in
 Fixed Block mode- in which case we traverse all waiting buffers (which
 we can get in fixed block mode because physio has split things up) and
 mark them all as no error, but no data moved and complete them.

 If SA_FLAG_EIO_PENDING, just mark the buffer with an EIO error
 and complete it.

Then we clear all of the pending state bits- we're done.

MFC after:	4 weeks
2001-08-30 16:25:24 +00:00
Kelly Yancey
b530a320f8 Add interfaces for SCSI LOG SELECT and LOG SENSE commands.
Reviewed by:	ken
2001-08-27 01:29:30 +00:00
Nick Hibma
b4cf607bde Add quirks for the Olympus Digital Camera.
PR:		26295

Add quirks for the Microtech CameraMate.
2001-08-21 22:13:53 +00:00
Poul-Henning Kamp
4446bcb757 Eliminate the hot-spare 'r' in Arrray.
Submitted by:	Søren Schrøder <sch@chaos.dk>
2001-08-10 11:47:08 +00:00
Matt Jacob
c7ec439040 Kill the command (don't rerun it) if we had an AUTOSENSE failure.
If we had an AUTOSENSE failure, we don't know what SENSE DATA
we had for a CHECK CONDITION. It's far better to assume failure
in this case.
2001-07-30 00:44:32 +00:00
Matt Jacob
387c7c9d0e (Forced commit- last one missed the comments)
Handle both old and new TARGIOALLOCUNIT/TARGIOFREEUNIT cases- the new
one allows us to specify inquiry data we want to use.

Handle more of the CAM_DIS_DISCONNECT case.
2001-07-30 00:30:58 +00:00
Matt Jacob
17ff160058 (Forced commit- last commit was inadvertant in that it missed the comments)
Move TARGCTLIOALLOCUNIT to OTARGCTLIOALLOCUNIT, TARGCTLIOFREEUNIT
to OTARGCTLIOFREEUNIT and redefine old associated structure to be
old_ioc_alloc_unit- deprecation but preservation of binaries.

Add new structure for same- but this one contains a pointer to
user defined INQUIRY data so you can define what the target
device looks like to the outside world.
2001-07-30 00:27:54 +00:00
Matt Jacob
102d676930 backout last commit- inadvertant 2001-07-30 00:22:57 +00:00