Commit Graph

31 Commits

Author SHA1 Message Date
Matt Jacob
0e9d96d74e Tell about the full name we opened, not the unit.
Obtained from:	Sean Bruno
MFC after:	1 month
2009-09-19 20:36:43 +00:00
Sean Bruno
b0d0537558 A few enhancements I made while working on the Firewire target (sbp_targ).
Update the error handling in a couple of cases to exit gracefully if
certain mandatory conditions aren't met.

Reduce the maximum number of initiators to 8 for this example code.  While
1024 is more correct, this example code would act like it was stalled out
even though it was merely allocating the needed structures in init_ccbs()

Reviewed by:	scottl@freebsd.org
2009-09-07 23:16:27 +00:00
Matt Jacob
cd6dedfc61 Bump MAX_INITIATORS to 1024- the LSI-Logic can go even higher than
this for 'initiator id'- this is a stopgap until a sparse map is
added.

Make compat defines for offset format (FreeBSD 5 or less).

Add no-asyncio flag. There's some breakage with ASYNC I/O that every
now and then drops us into an infinite loop. This also then does
a fallback to no-asyncio if the AIO option isn't loaded/compiled into
the kernel.

A number of other chanes to try and track some breakage.
2006-09-27 15:38:13 +00:00
Matt Jacob
6070eb3f93 If we end up with a CTIO completing with CAM_REQUEUE_REQ,
be obliging and just redo the request instead of squawking
and dying.
2006-04-11 21:36:43 +00:00
Matt Jacob
441201ce65 Move the check for non-ATIO_CMD ahead of the cache chech so that
completion for unsupported commands doesn't abort.

Reviewed by:	nate
MFC after:	2 weeks
2006-03-25 18:18:26 +00:00
Matt Jacob
3a4d58a91a Make scsi_target actually compile after a structure member
change.

Obtained from:	Either Scott, Nate, Ken or A. Nagy
2006-03-22 17:00:14 +00:00
Matt Jacob
0fa274524a At least respond to REPORT LUNS with an ILLEGAL COMMAND response.
This keeps us from dumping core when modern OS' like Windows and Linux
see us.
2006-03-22 01:30:07 +00:00
Ruslan Ermilov
9cbda59000 Sort sections. 2005-01-21 08:36:40 +00:00
Pawel Jakub Dawidek
85aeaa6062 Typo. 2004-06-26 19:35:30 +00:00
Ruslan Ermilov
27431cdb25 Fixed static build. 2004-02-04 10:15:26 +00:00
Nate Lawson
f381ebd8a8 Note that REPORT_LUNS should be implemented to work better with Linux
and Windows as initiators.
2004-01-09 19:33:21 +00:00
Nate Lawson
4c1cc94ee3 Enable autosense by default. This shouldn't hurt SPI and is required
for FC.
2004-01-09 19:27:18 +00:00
Nate Lawson
daa66c2c60 Bump the max number of initiators to 256 from 16. This is appropriate for
fibre channel and shouldn't hurt SPI.
2004-01-09 19:26:30 +00:00
Hidetoshi Shimokawa
068d70bad8 - Enable 16byte commands.
- Fix printf warnings on 64bit architectures.
- Accept 'k', 'm' and etc. for -s option.

Reviewed by: njl
2003-10-18 04:54:08 +00:00
Hidetoshi Shimokawa
c4b3637b44 * scsi_cmds.c
- Fill in autosense data.
- Add compatibility for RELENG_4.

* scsi_target.c
- Raw device support
- Set correct value in c_descr->offset for CAM_DIR_NONE case.
- Support for CTIO abort.
2003-09-25 05:43:26 +00:00
Nate Lawson
031bacf859 kernel:
* Fix a bug where devices weren't cleaned up on close(): CAM_REQ_CMP != 0

user:
* Increase timeout in usermode to CAM_TIME_INFINITY.  The initiator is in
  charge of timeouts and the value was in ms, not seconds.
* Bring two debugging printfs under the debug flag
* Clean up man page to show increased testing on isp(4)

Submitted by:	gibbs (bugfixes)
2003-01-16 00:24:29 +00:00
Nate Lawson
2d696c643e Add check for AIO support before starting up. 2003-01-13 05:34:42 +00:00
Ruslan Ermilov
a7348c92db mdoc(7) police: markup overhaul.
Approved by:	re
2002-12-12 14:36:08 +00:00
Nate Lawson
5cc6190e87 Add a DPADD section to fix 'make checkdpadd'
Submitted by:	ru
Approved by:	re (previously)
2002-11-25 19:29:05 +00:00
Nate Lawson
c38b150ae4 New SCSI target emulator code
This code allows a user program to enable target mode on a SIM and
then emulate any number of devices (disks, tape drives, etc.)  All
decisions about device behavior (UA, CA, inquiry response) are left
to the usermode program and the kernel driver is merely a conduit
for CCBs.  This enables multiple concurrent target emulators, each
using its own backing store and IO model.

Also included is a user program that emulates a disk (RBC) using a
file as a backing store.  This provides functionality similar to
md(4) at the CAM layer.

Code has been tested on ahc(4) and should also work on isp(4) (and
other SIMs that gain target mode support).  It is a complete rewrite
of /sys/cam/scsi_target* and /usr/share/examples/scsi_target.

Design, comments from:	gibbs
Supported by:		Cryptography Research
Approved by:		re
2002-11-22 22:55:51 +00:00
Matt Jacob
633252a4e2 include paths.h for _PATH_DEV 2001-03-03 21:23:31 +00:00
David E. O'Brien
1a37aa566b Add `_PATH_DEVZERO'.
Use _PATH_* where where possible.
2000-12-09 09:35:55 +00:00
Matt Jacob
785b6ccaec Don't get stuck in a loop calling exit from an atexit routine. Clean
up cam_fill_ctio usage to passed atio flags. Clear periph_priv area
of new ctio so if the kernel is dumb enough to look at them (this is
a SECURITY hole) the panic will be obvious instead of subtle.
2000-07-18 04:39:36 +00:00
Matt Jacob
e2dc1289d2 Clean up after oneself on exit. 2000-07-17 02:05:45 +00:00
Matt Jacob
bf43e4b847 Whoops- more changes in last checkin than TARGIODEBUG-
some additional TARGIOCCLEAREXCEPTION ioctls added as
needed.

Obtained from:	gibbs@freebsd.org
2000-07-14 20:30:28 +00:00
Matt Jacob
97188b54ce Make use of the new TARGIODEBUG ioctl (i.e., add an option for it's use). 2000-07-14 20:26:59 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Justin T. Gibbs
8760939718 Add a cleanup handler called "atexit" to make sure we free up target
mode instances.

Print out exception information passed out from the kernel target mode
driver to this userland daemon.
1999-08-16 22:52:17 +00:00
Justin T. Gibbs
b3fae35ce8 Allocate a target mode instance to handle our target mode session, clean
it up on exit.  The address for attaching the emulator (path, target id,
lun) is now specified on the command line.  Some attempt at cathing
signals and cleaning up target mode instances is now made.
1999-03-05 23:12:02 +00:00
Justin T. Gibbs
bb4f7bfdbf Remove debugging printfs. 1998-12-10 04:00:03 +00:00
Justin T. Gibbs
9875eecf53 SCSI Target userland process example. Provides/Dumps the data related to
RECEIVE/SEND processor target requests to the "targ" sample target mode
driver.
1998-09-15 06:46:32 +00:00