move some constants around
PATCH 1/1 move some constants around
We should try to keep all constants in include/scsi/scsi.h instead of drivers/scsi/scsi.h. Also tidy up include/scsi/scsi.h a bit.
drivers/scsi/scsi.h +0 -52
@@ -63,57 +63,12 @@#define sense_error (sense) ((sense) & 0xf)#define sense_valid (sense) ((sense) & 0x80); -#define NEEDS_RETRY 0x2001 -#define SUCCESS 0x2002 -#define FAILED 0x2003 -#define QUEUED 0x2004 -#define SOFT_ERROR 0x2005 -#define ADD_TO_MLQUEUE 0x2006#define IDENTIFY_BASE 0x80#define IDENTIFY (can_disconnect, lun) (IDENTIFY_BASE |\ ((can_disconnect) ? 0x40 : 0) |\ ((lun) & 0x07)) -/* host byte codes */ -#define DID_OK 0x00/* NO error */ -#define DID_NO_CONNECT 0x01/* Couldn't connect before timeout period */ -#define DID_BUS_BUSY 0x02/* BUS stayed busy through time out period */ -#define DID_TIME_OUT 0x03/* TIMED OUT for other reason */ -#define DID_BAD_TARGET 0x04/* BAD target. */ -#define DID_ABORT 0x05/* Told to abort for some other reason */ -#define DID_PARITY 0x06/* Parity error */ -#define DID_ERROR 0x07/* Internal error */ -#define DID_RESET 0x08/* Reset by somebody. */ -#define DID_BAD_INTR 0x09/* Got an interrupt we weren't expecting. */ -#define DID_PASSTHROUGH 0x0a/* Force command past mid-layer */ -#define DID_SOFT_ERROR 0x0b/* The low level driver just wish a retry */ -#define DRIVER_OK 0x00/* Driver status */ - -/* -* These indicate the error that occurred, and what is available. -*/ - -#define DRIVER_BUSY 0x01 -#define DRIVER_SOFT 0x02 -#define DRIVER_MEDIA 0x03 -#define DRIVER_ERROR 0x04 - -#define DRIVER_INVALID 0x05 -#define DRIVER_TIMEOUT 0x06 -#define DRIVER_HARD 0x07 -#define DRIVER_SENSE 0x08 - -#define SUGGEST_RETRY 0x10 -#define SUGGEST_ABORT 0x20 -#define SUGGEST_REMAP 0x30 -#define SUGGEST_DIE 0x40 -#define SUGGEST_SENSE 0x80 -#define SUGGEST_IS_OK 0xff - -#define DRIVER_MASK 0x0f -#define SUGGEST_MASK 0xf0 -/* * SCSI command sets */
@@ -145,13 +100,6 @@extern int print_msg (const unsigned char *);extern const char *scsi_sense_key_string (unsigned char );extern const char *scsi_extd_sense_format (unsigned char ,unsigned char ); - -/* -* Definitions and prototypes used for scsi mid-level queue. -*/ -#define SCSI_MLQUEUE_HOST_BUSY 0x1055 -#define SCSI_MLQUEUE_DEVICE_BUSY 0x1056 -#define SCSI_MLQUEUE_EH_RETRY 0x1057/* * Legacy dma direction interfaces.
include/scsi/scsi.h +87 -40
174 lines not on this page · raw message
Quoted 2 lines · Christoph Hellwig
We should try to keep all constants in
include/scsi/scsi.hinstead ofdrivers/scsi/scsi.h. Also tidy upinclude/scsi/scsi.ha bit.
The original design purpose of include/scsi/scsi.h versus drivers/scsi/scsi.h was to have constants that are meaningful in user space (such as constants defined in the SCSI standard) in <scsi/scsi.h>, while kernel-internal stuff lived in drivers/scsi/scsi.h.
Thus, I do not see this move as an improvement.
Andries
Quoted 4 lines
/*
* This header file contains public constants and structures used by
* the scsi code for linux.
*/
Quoted 10 lines · Andries Brouwer
Quoted 2 lines · Christoph Hellwig
We should try to keep all constants in
include/scsi/scsi.hinstead ofdrivers/scsi/scsi.h. Also tidy upinclude/scsi/scsi.ha bit.The original design purpose of
include/scsi/scsi.hversusdrivers/scsi/scsi.hwas to have constants that are meaningful in user space (such as constants defined in the SCSI standard) in <scsi/scsi.h>, while kernel-internal stuff lived indrivers/scsi/scsi.h.
The current design purpose of include/scsi/ is to be for the kernel only. glibc has it's own scsi/ headers. and drivers/scsi/scsi.h is going away completly (slowly).
Quoted 3 lines · Christoph Hellwig
The current design purpose of
include/scsi/is to be for the kernel only. glibc has it's own scsi/ headers. anddrivers/scsi/scsi.his going away completly (slowly).
Yes, I see that that is what you are doing.
Pity.
One of the projects that has been delayed far too much is the project of giving Linux headers that can be used in user space. There were only few of those.
Now you are polluting even those few.
Andries
Quoted 8 lines · Andries Brouwer
Quoted 3 lines · Christoph Hellwig
The current design purpose of
include/scsi/is to be for the kernel only. glibc has it's own scsi/ headers. anddrivers/scsi/scsi.his going away completly (slowly).
Quoted 8 lines
Yes, I see that that is what you are doing.
Pity.One of the projects that has been delayed far too much is the project of giving Linux headers that can be used in user space. There were only few of those.
Now you are polluting even those few.
Yes. Oh well :( More work for me, when I tackle that project...
Jeff