diff options
author | scameron@beardog.cca.cpqcorp.net <scameron@beardog.cca.cpqcorp.net> | 2009-06-08 17:02:17 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-06-08 23:47:42 -0400 |
commit | b57695fe131b13d3f2460cfeb9175cff673ed337 (patch) | |
tree | 5c1310fdbca48957c1496de418f80ff4f48dc259 /drivers/block/cciss_scsi.c | |
parent | 5390cfc3fea49d015ae1eed8551c0bf00489b50e (diff) |
cciss: simplify interface of sendcmd() and sendcmd_withirq()
Simplify interfaces of sendcmd() and sendcmd_withirq() so that they
provide only one way to address commands instead of three ways.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cca.cpqcorp.net>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/block/cciss_scsi.c')
-rw-r--r-- | drivers/block/cciss_scsi.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c index 134fdf25d7f4..007ab8aea85b 100644 --- a/drivers/block/cciss_scsi.c +++ b/drivers/block/cciss_scsi.c | |||
@@ -44,26 +44,9 @@ | |||
44 | #define CCISS_ABORT_MSG 0x00 | 44 | #define CCISS_ABORT_MSG 0x00 |
45 | #define CCISS_RESET_MSG 0x01 | 45 | #define CCISS_RESET_MSG 0x01 |
46 | 46 | ||
47 | /* some prototypes... */ | ||
48 | static int sendcmd( | ||
49 | __u8 cmd, | ||
50 | int ctlr, | ||
51 | void *buff, | ||
52 | size_t size, | ||
53 | unsigned int use_unit_num, /* 0: address the controller, | ||
54 | 1: address logical volume log_unit, | ||
55 | 2: address is in scsi3addr */ | ||
56 | unsigned int log_unit, | ||
57 | __u8 page_code, | ||
58 | unsigned char *scsi3addr, | ||
59 | int cmd_type); | ||
60 | |||
61 | static int fill_cmd(CommandList_struct *c, __u8 cmd, int ctlr, void *buff, | 47 | static int fill_cmd(CommandList_struct *c, __u8 cmd, int ctlr, void *buff, |
62 | size_t size, | 48 | size_t size, |
63 | unsigned int use_unit_num, /* 0: address the controller, | 49 | __u8 page_code, unsigned char *scsi3addr, |
64 | 1: address logical volume log_unit, | ||
65 | 2: periph device address is scsi3addr */ | ||
66 | unsigned int log_unit, __u8 page_code, unsigned char *scsi3addr, | ||
67 | int cmd_type); | 50 | int cmd_type); |
68 | 51 | ||
69 | static int sendcmd_core(ctlr_info_t *h, CommandList_struct *c); | 52 | static int sendcmd_core(ctlr_info_t *h, CommandList_struct *c); |
@@ -1616,7 +1599,7 @@ static int wait_for_device_to_become_ready(ctlr_info_t *h, | |||
1616 | waittime = waittime * 2; | 1599 | waittime = waittime * 2; |
1617 | 1600 | ||
1618 | /* Send the Test Unit Ready */ | 1601 | /* Send the Test Unit Ready */ |
1619 | rc = fill_cmd(c, TEST_UNIT_READY, h->ctlr, NULL, 0, 0, 0, 0, | 1602 | rc = fill_cmd(c, TEST_UNIT_READY, h->ctlr, NULL, 0, 0, |
1620 | lunaddr, TYPE_CMD); | 1603 | lunaddr, TYPE_CMD); |
1621 | if (rc == 0) { | 1604 | if (rc == 0) { |
1622 | rc = sendcmd_core(h, c); | 1605 | rc = sendcmd_core(h, c); |
@@ -1680,7 +1663,7 @@ static int cciss_eh_device_reset_handler(struct scsi_cmnd *scsicmd) | |||
1680 | return FAILED; | 1663 | return FAILED; |
1681 | memcpy(lunaddr, &cmd_in_trouble->Header.LUN.LunAddrBytes[0], 8); | 1664 | memcpy(lunaddr, &cmd_in_trouble->Header.LUN.LunAddrBytes[0], 8); |
1682 | /* send a reset to the SCSI LUN which the command was sent to */ | 1665 | /* send a reset to the SCSI LUN which the command was sent to */ |
1683 | rc = sendcmd(CCISS_RESET_MSG, ctlr, NULL, 0, 2, 0, 0, lunaddr, | 1666 | rc = sendcmd(CCISS_RESET_MSG, ctlr, NULL, 0, 0, lunaddr, |
1684 | TYPE_MSG); | 1667 | TYPE_MSG); |
1685 | /* sendcmd turned off interrupts on the board, turn 'em back on. */ | 1668 | /* sendcmd turned off interrupts on the board, turn 'em back on. */ |
1686 | (*c)->access.set_intr_mask(*c, CCISS_INTR_ON); | 1669 | (*c)->access.set_intr_mask(*c, CCISS_INTR_ON); |
@@ -1708,8 +1691,7 @@ static int cciss_eh_abort_handler(struct scsi_cmnd *scsicmd) | |||
1708 | cmd_to_abort = (CommandList_struct *) scsicmd->host_scribble; | 1691 | cmd_to_abort = (CommandList_struct *) scsicmd->host_scribble; |
1709 | if (cmd_to_abort == NULL) /* paranoia */ | 1692 | if (cmd_to_abort == NULL) /* paranoia */ |
1710 | return FAILED; | 1693 | return FAILED; |
1711 | rc = sendcmd(CCISS_ABORT_MSG, ctlr, &cmd_to_abort->Header.Tag, | 1694 | rc = sendcmd(CCISS_ABORT_MSG, ctlr, &cmd_to_abort->Header.Tag, 0, 0, |
1712 | 0, 2, 0, 0, | ||
1713 | (unsigned char *) &cmd_to_abort->Header.LUN.LunAddrBytes[0], | 1695 | (unsigned char *) &cmd_to_abort->Header.LUN.LunAddrBytes[0], |
1714 | TYPE_MSG); | 1696 | TYPE_MSG); |
1715 | /* sendcmd turned off interrupts on the board, turn 'em back on. */ | 1697 | /* sendcmd turned off interrupts on the board, turn 'em back on. */ |