aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/53c700.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/53c700.h')
-rw-r--r--drivers/scsi/53c700.h34
1 files changed, 23 insertions, 11 deletions
diff --git a/drivers/scsi/53c700.h b/drivers/scsi/53c700.h
index 7f22a06fe5ec..97ebe71b701b 100644
--- a/drivers/scsi/53c700.h
+++ b/drivers/scsi/53c700.h
@@ -12,7 +12,7 @@
12#include <asm/io.h> 12#include <asm/io.h>
13 13
14#include <scsi/scsi_device.h> 14#include <scsi/scsi_device.h>
15 15#include <scsi/scsi_cmnd.h>
16 16
17/* Turn on for general debugging---too verbose for normal use */ 17/* Turn on for general debugging---too verbose for normal use */
18#undef NCR_700_DEBUG 18#undef NCR_700_DEBUG
@@ -76,11 +76,16 @@ struct NCR_700_SG_List {
76 #define SCRIPT_RETURN 0x90080000 76 #define SCRIPT_RETURN 0x90080000
77}; 77};
78 78
79/* We use device->hostdata to store negotiated parameters. This is 79struct NCR_700_Device_Parameters {
80 * supposed to be a pointer to a device private area, but we cannot 80 /* space for creating a request sense command. Really, except
81 * really use it as such since it will never be freed, so just use the 81 * for the annoying SCSI-2 requirement for LUN information in
82 * 32 bits to cram the information. The SYNC negotiation sequence looks 82 * cmnd[1], this could be in static storage */
83 * like: 83 unsigned char cmnd[MAX_COMMAND_SIZE];
84 __u8 depth;
85};
86
87
88/* The SYNC negotiation sequence looks like:
84 * 89 *
85 * If DEV_NEGOTIATED_SYNC not set, tack and SDTR message on to the 90 * If DEV_NEGOTIATED_SYNC not set, tack and SDTR message on to the
86 * initial identify for the device and set DEV_BEGIN_SYNC_NEGOTATION 91 * initial identify for the device and set DEV_BEGIN_SYNC_NEGOTATION
@@ -98,19 +103,26 @@ struct NCR_700_SG_List {
98#define NCR_700_DEV_BEGIN_SYNC_NEGOTIATION (1<<17) 103#define NCR_700_DEV_BEGIN_SYNC_NEGOTIATION (1<<17)
99#define NCR_700_DEV_PRINT_SYNC_NEGOTIATION (1<<19) 104#define NCR_700_DEV_PRINT_SYNC_NEGOTIATION (1<<19)
100 105
106static inline char *NCR_700_get_sense_cmnd(struct scsi_device *SDp)
107{
108 struct NCR_700_Device_Parameters *hostdata = SDp->hostdata;
109
110 return hostdata->cmnd;
111}
112
101static inline void 113static inline void
102NCR_700_set_depth(struct scsi_device *SDp, __u8 depth) 114NCR_700_set_depth(struct scsi_device *SDp, __u8 depth)
103{ 115{
104 long l = (long)SDp->hostdata; 116 struct NCR_700_Device_Parameters *hostdata = SDp->hostdata;
105 117
106 l &= 0xffff00ff; 118 hostdata->depth = depth;
107 l |= 0xff00 & (depth << 8);
108 SDp->hostdata = (void *)l;
109} 119}
110static inline __u8 120static inline __u8
111NCR_700_get_depth(struct scsi_device *SDp) 121NCR_700_get_depth(struct scsi_device *SDp)
112{ 122{
113 return ((((unsigned long)SDp->hostdata) & 0xff00)>>8); 123 struct NCR_700_Device_Parameters *hostdata = SDp->hostdata;
124
125 return hostdata->depth;
114} 126}
115static inline int 127static inline int
116NCR_700_is_flag_set(struct scsi_device *SDp, __u32 flag) 128NCR_700_is_flag_set(struct scsi_device *SDp, __u32 flag)