Skip to content

Commit 8f71bb8

Browse files
Stephen M. CameronJens Axboe
authored andcommitted
cciss: get rid of message related magic numbers
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
1 parent e363e01 commit 8f71bb8

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

‎drivers/block/cciss.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2569,7 +2569,7 @@ static int fill_cmd(ctlr_info_t *h, CommandList_struct *c, __u8 cmd, void *buff,
25692569
}
25702570
} else if (cmd_type == TYPE_MSG) {
25712571
switch (cmd) {
2572-
case 0: /* ABORT message */
2572+
case CCISS_ABORT_MSG:
25732573
c->Request.CDBLen = 12;
25742574
c->Request.Type.Attribute = ATTR_SIMPLE;
25752575
c->Request.Type.Direction = XFER_WRITE;
@@ -2579,16 +2579,16 @@ static int fill_cmd(ctlr_info_t *h, CommandList_struct *c, __u8 cmd, void *buff,
25792579
/* buff contains the tag of the command to abort */
25802580
memcpy(&c->Request.CDB[4], buff, 8);
25812581
break;
2582-
case 1: /* RESET message */
2582+
case CCISS_RESET_MSG:
25832583
c->Request.CDBLen = 16;
25842584
c->Request.Type.Attribute = ATTR_SIMPLE;
25852585
c->Request.Type.Direction = XFER_NONE;
25862586
c->Request.Timeout = 0;
25872587
memset(&c->Request.CDB[0], 0, sizeof(c->Request.CDB));
25882588
c->Request.CDB[0] = cmd; /* reset */
2589-
c->Request.CDB[1] = 0x03; /* reset a target */
2589+
c->Request.CDB[1] = CCISS_RESET_TYPE_TARGET;
25902590
break;
2591-
case 3: /* No-Op message */
2591+
case CCISS_NOOP_MSG:
25922592
c->Request.CDBLen = 1;
25932593
c->Request.Type.Attribute = ATTR_SIMPLE;
25942594
c->Request.Type.Direction = XFER_WRITE;

‎drivers/block/cciss_cmd.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ typedef struct _ReadCapdata_struct_16
142142
#define BMIC_CACHE_FLUSH 0xc2
143143
#define CCISS_CACHE_FLUSH 0x01 /* C2 was already being used by CCISS */
144144

145+
#define CCISS_ABORT_MSG 0x00
146+
#define CCISS_RESET_MSG 0x01
147+
#define CCISS_RESET_TYPE_CONTROLLER 0x00
148+
#define CCISS_RESET_TYPE_BUS 0x01
149+
#define CCISS_RESET_TYPE_TARGET 0x03
150+
#define CCISS_RESET_TYPE_LUN 0x04
151+
#define CCISS_NOOP_MSG 0x03
152+
145153
/* Command List Structure */
146154
#define CTLR_LUNID "\0\0\0\0\0\0\0\0"
147155

0 commit comments

Comments
 (0)