15 #define BELT_AND_BRACES
65 static inline unsigned char get_next_SCp_byte(
struct scsi_pointer *SCp)
75 static inline void put_next_SCp_byte(
struct scsi_pointer *SCp,
unsigned char c)
82 static inline void init_SCp(
struct scsi_cmnd *SCpnt)
86 if (scsi_bufflen(SCpnt)) {
87 unsigned long len = 0;
89 SCpnt->
SCp.buffer = scsi_sglist(SCpnt);
90 SCpnt->
SCp.buffers_residual = scsi_sg_count(SCpnt) - 1;
91 SCpnt->
SCp.ptr = sg_virt(SCpnt->
SCp.buffer);
92 SCpnt->
SCp.this_residual = SCpnt->
SCp.buffer->length;
93 SCpnt->
SCp.phase = scsi_bufflen(SCpnt);
95 #ifdef BELT_AND_BRACES
101 unsigned i,
sg_count = scsi_sg_count(SCpnt);
106 if (scsi_bufflen(SCpnt) != len) {
108 "scsi%d.%c: bad request buffer "
109 "length %d, should be %ld\n",
110 SCpnt->
device->host->host_no,
112 scsi_bufflen(SCpnt), len);
118 min_t(
unsigned long, len,
119 scsi_bufflen(SCpnt));
125 SCpnt->
SCp.this_residual = 0;
126 SCpnt->
SCp.phase = 0;