Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101569
b: refs/heads/master
c: feac6a0
h: refs/heads/master
i:
  101567: 25e295f
v: v3
  • Loading branch information
Martin Petermann authored and James Bottomley committed Jul 12, 2008
1 parent bbafab3 commit 09c3cd6
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5d4e226246331087799a01c267ec72e5931ff190
refs/heads/master: feac6a07c4a3578bffd6769bb4927e8a7e1f3ffe
2 changes: 0 additions & 2 deletions trunk/drivers/s390/scsi/zfcp_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ extern int zfcp_adapter_scsi_register(struct zfcp_adapter *);
extern void zfcp_adapter_scsi_unregister(struct zfcp_adapter *);
extern void zfcp_set_fcp_dl(struct fcp_cmnd_iu *, fcp_dl_t);
extern char *zfcp_get_fcp_rsp_info_ptr(struct fcp_rsp_iu *);
extern void set_host_byte(int *, char);
extern void set_driver_byte(int *, char);
extern char *zfcp_get_fcp_sns_info_ptr(struct fcp_rsp_iu *);
extern fcp_dl_t zfcp_get_fcp_dl(struct fcp_cmnd_iu *);

Expand Down
20 changes: 10 additions & 10 deletions trunk/drivers/s390/scsi/zfcp_fsf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3040,18 +3040,18 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
* DID_SOFT_ERROR by retrying the request for devices
* that allow retries.
*/
set_host_byte(&scpnt->result, DID_SOFT_ERROR);
set_driver_byte(&scpnt->result, SUGGEST_RETRY);
set_host_byte(scpnt, DID_SOFT_ERROR);
set_driver_byte(scpnt, SUGGEST_RETRY);
goto skip_fsfstatus;
}

if (unlikely(fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR)) {
set_host_byte(&scpnt->result, DID_ERROR);
set_host_byte(scpnt, DID_ERROR);
goto skip_fsfstatus;
}

/* set message byte of result in SCSI command */
scpnt->result |= COMMAND_COMPLETE << 8;
set_msg_byte(scpnt, COMMAND_COMPLETE);

/*
* copy SCSI status code of FCP_STATUS of FCP_RSP IU to status byte
Expand All @@ -3067,23 +3067,23 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
switch (fcp_rsp_info[3]) {
case RSP_CODE_GOOD:
/* ok, continue */
set_host_byte(&scpnt->result, DID_OK);
set_host_byte(scpnt, DID_OK);
break;
case RSP_CODE_LENGTH_MISMATCH:
/* hardware bug */
set_host_byte(&scpnt->result, DID_ERROR);
set_host_byte(scpnt, DID_ERROR);
goto skip_fsfstatus;
case RSP_CODE_FIELD_INVALID:
/* driver or hardware bug */
set_host_byte(&scpnt->result, DID_ERROR);
set_host_byte(scpnt, DID_ERROR);
goto skip_fsfstatus;
case RSP_CODE_RO_MISMATCH:
/* hardware bug */
set_host_byte(&scpnt->result, DID_ERROR);
set_host_byte(scpnt, DID_ERROR);
goto skip_fsfstatus;
default:
/* invalid FCP response code */
set_host_byte(&scpnt->result, DID_ERROR);
set_host_byte(scpnt, DID_ERROR);
goto skip_fsfstatus;
}
}
Expand All @@ -3104,7 +3104,7 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
scsi_set_resid(scpnt, fcp_rsp_iu->fcp_resid);
if (scsi_bufflen(scpnt) - scsi_get_resid(scpnt) <
scpnt->underflow)
set_host_byte(&scpnt->result, DID_ERROR);
set_host_byte(scpnt, DID_ERROR);
}

skip_fsfstatus:
Expand Down
24 changes: 1 addition & 23 deletions trunk/drivers/s390/scsi/zfcp_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,28 +107,6 @@ zfcp_set_fcp_dl(struct fcp_cmnd_iu *fcp_cmd, fcp_dl_t fcp_dl)
*zfcp_get_fcp_dl_ptr(fcp_cmd) = fcp_dl;
}

/*
* note: it's a bit-or operation not an assignment
* regarding the specified byte
*/
static inline void
set_byte(int *result, char status, char pos)
{
*result |= status << (pos * 8);
}

void
set_host_byte(int *result, char status)
{
set_byte(result, status, 2);
}

void
set_driver_byte(int *result, char status)
{
set_byte(result, status, 3);
}

static int
zfcp_scsi_slave_alloc(struct scsi_device *sdp)
{
Expand Down Expand Up @@ -196,7 +174,7 @@ zfcp_scsi_slave_configure(struct scsi_device *sdp)
static void
zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result)
{
set_host_byte(&scpnt->result, result);
set_host_byte(scpnt, result);
if ((scpnt->device != NULL) && (scpnt->device->host != NULL))
zfcp_scsi_dbf_event_result("fail", 4,
(struct zfcp_adapter*) scpnt->device->host->hostdata[0],
Expand Down
17 changes: 17 additions & 0 deletions trunk/include/scsi/scsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define _SCSI_SCSI_H

#include <linux/types.h>
#include <scsi/scsi_cmnd.h>

/*
* The maximum number of SG segments that we will put inside a
Expand Down Expand Up @@ -425,6 +426,22 @@ struct scsi_lun {
#define driver_byte(result) (((result) >> 24) & 0xff)
#define suggestion(result) (driver_byte(result) & SUGGEST_MASK)

static inline void set_msg_byte(struct scsi_cmnd *cmd, char status)
{
cmd->result |= status << 8;
}

static inline void set_host_byte(struct scsi_cmnd *cmd, char status)
{
cmd->result |= status << 16;
}

static inline void set_driver_byte(struct scsi_cmnd *cmd, char status)
{
cmd->result |= status << 24;
}


#define sense_class(sense) (((sense) >> 4) & 0x7)
#define sense_error(sense) ((sense) & 0xf)
#define sense_valid(sense) ((sense) & 0x80);
Expand Down

0 comments on commit 09c3cd6

Please sign in to comment.