}
static void esp_cmd_is_done(struct esp *esp, struct esp_cmd_entry *ent,
- struct scsi_cmnd *cmd, unsigned int result)
+ struct scsi_cmnd *cmd, unsigned char host_byte)
{
struct scsi_device *dev = cmd->device;
int tgt = dev->id;
esp->active_cmd = NULL;
esp_unmap_dma(esp, cmd);
esp_free_lun_tag(ent, dev->hostdata);
- cmd->result = result;
+ cmd->result = 0;
+ set_host_byte(cmd, host_byte);
+ if (host_byte == DID_OK) {
+ set_msg_byte(cmd, ent->message);
+ set_status_byte(cmd, ent->status);
+ }
if (ent->eh_done) {
complete(ent->eh_done);
esp_maybe_execute_command(esp);
}
-static unsigned int compose_result(unsigned int status, unsigned int message,
- unsigned int driver_code)
-{
- return (status | (message << 8) | (driver_code << 16));
-}
-
static void esp_event_queue_full(struct esp *esp, struct esp_cmd_entry *ent)
{
struct scsi_device *dev = ent->cmd->device;
* all bets are off.
*/
esp_schedule_reset(esp);
- esp_cmd_is_done(esp, ent, cmd, (DID_ERROR << 16));
+ esp_cmd_is_done(esp, ent, cmd, DID_ERROR);
return 0;
}
esp->target[dev->id].flags |= ESP_TGT_CHECK_NEGO;
scsi_esp_cmd(esp, ESP_CMD_ESEL);
- esp_cmd_is_done(esp, ent, cmd, (DID_BAD_TARGET << 16));
+ esp_cmd_is_done(esp, ent, cmd, DID_BAD_TARGET);
return 1;
}
ent->flags |= ESP_CMD_FLAG_AUTOSENSE;
esp_autosense(esp, ent);
} else {
- esp_cmd_is_done(esp, ent, cmd,
- compose_result(ent->status,
- ent->message,
- DID_OK));
+ esp_cmd_is_done(esp, ent, cmd, DID_OK);
}
} else if (ent->message == DISCONNECT) {
esp_log_disconnect("Disconnecting tgt[%d] tag[%x:%x]\n",