1588
1589
1590static int cciss_eh_device_reset_handler(struct scsi_cmnd *scsicmd)
1591{
1592 int rc;
1593 CommandList_struct *cmd_in_trouble;
1594 ctlr_info_t **c;
1595 int ctlr;
1596
1597
1598 c = (ctlr_info_t **) &scsicmd->device->host->hostdata[0];
1599 if (c == NULL)
1600 return FAILED;
1601 ctlr = (*c)->ctlr;
1602 printk(KERN_WARNING "cciss%d: resetting tape drive or medium changer.\n", ctlr);
1603
1604
1605 cmd_in_trouble = (CommandList_struct *) scsicmd->host_scribble;
1606 if (cmd_in_trouble == NULL) {
1607 return FAILED;
1608 }
1609
1610 rc = sendcmd(CCISS_RESET_MSG, ctlr, NULL, 0, 2, 0, 0,
1611 (unsigned char *) &cmd_in_trouble->Header.LUN.LunAddrBytes[0],
1612 TYPE_MSG);
1613
1614 (*c)->access.set_intr_mask(*c, CCISS_INTR_ON);
1615 if (rc == 0)
1616 return SUCCESS;
1617 printk(KERN_WARNING "cciss%d: resetting device failed.\n", ctlr);
1618 return FAILED;
1619}
1620
1621static int cciss_eh_abort_handler(struct scsi_cmnd *scsicmd)
1622{
1623 int rc;
1624 CommandList_struct *cmd_to_abort;
1625 ctlr_info_t **c;
1626 int ctlr;
1627
1628