return hostdata->iop->name;
}
+#if 0
+/**
+ * i2o_retry_run - retry on timeout
+ * @f: unused
+ *
+ * Retry congested frames. This actually needs pushing down into
+ * i2o core. We should only bother the OSM with this when we can't
+ * queue and retry the frame. Or perhaps we should call the OSM
+ * and its default handler should be this in the core, and this
+ * call a 2nd "I give up" handler in the OSM ?
+ */
+
+static void i2o_retry_run(unsigned long f)
+{
+ int i;
+ unsigned long flags;
+
+ spin_lock_irqsave(&retry_lock, flags);
+ for (i = 0; i < retry_ct; i++)
+ i2o_post_message(retry_ctrl[i], virt_to_bus(retry[i]));
+ retry_ct = 0;
+ spin_unlock_irqrestore(&retry_lock, flags);
+}
+
+/**
+ * flush_pending - empty the retry queue
+ *
+ * Turn each of the pending commands into a NOP and post it back
+ * to the controller to clear it.
+ */
+
+static void flush_pending(void)
+{
+ int i;
+ unsigned long flags;
+
+ spin_lock_irqsave(&retry_lock, flags);
+ for (i = 0; i < retry_ct; i++) {
+ retry[i][0] &= ~0xFFFFFF;
+ retry[i][0] |= I2O_CMD_UTIL_NOP << 24;
+ i2o_post_message(retry_ctrl[i], virt_to_bus(retry[i]));
+ }
+ retry_ct = 0;
+ spin_unlock_irqrestore(&retry_lock, flags);
+}
+#endif
+
/**
* i2o_scsi_reply - SCSI OSM message reply handler
* @c: controller issuing the reply
struct device *dev;
u8 as, ds, st;
- cmd = i2o_cntxt_list_get(c, le32_to_cpu(msg->u.s.tcntxt));
+ cmd = i2o_cntxt_list_get(c, readl(&msg->u.s.tcntxt));
if (msg->u.head[0] & (1 << 13)) {
- struct i2o_message __iomem *pmsg; /* preserved message */
+ struct i2o_message *pmsg; /* preserved message */
u32 pm;
- int err = DID_ERROR;
- pm = le32_to_cpu(msg->body[3]);
+ pm = readl(&msg->body[3]);
- pmsg = i2o_msg_in_to_virt(c, pm);
+ pmsg = c->in_queue.virt + pm;
- printk(KERN_ERR "IOP fail.\n");
- printk(KERN_ERR "From %d To %d Cmd %d.\n",
+ printk("IOP fail.\n");
+ printk("From %d To %d Cmd %d.\n",
(msg->u.head[1] >> 12) & 0xFFF,
msg->u.head[1] & 0xFFF, msg->u.head[1] >> 24);
- printk(KERN_ERR "Failure Code %d.\n", msg->body[0] >> 24);
+ printk("Failure Code %d.\n", msg->body[0] >> 24);
if (msg->body[0] & (1 << 16))
- printk(KERN_ERR "Format error.\n");
+ printk("Format error.\n");
if (msg->body[0] & (1 << 17))
- printk(KERN_ERR "Path error.\n");
+ printk("Path error.\n");
if (msg->body[0] & (1 << 18))
- printk(KERN_ERR "Path State.\n");
+ printk("Path State.\n");
if (msg->body[0] & (1 << 18))
- {
- printk(KERN_ERR "Congestion.\n");
- err = DID_BUS_BUSY;
- }
+ printk("Congestion.\n");
- printk(KERN_DEBUG "Failing message is %p.\n", pmsg);
+ printk("Failing message is %p.\n", pmsg);
cmd = i2o_cntxt_list_get(c, readl(&pmsg->u.s.tcntxt));
if (!cmd)
return 1;
- cmd->result = err << 16;
+ printk("Aborted %ld\n", cmd->serial_number);
+ cmd->result = DID_ERROR << 16;
cmd->scsi_done(cmd);
/* Now flush the message by making it a NOP */
* Low byte is device status, next is adapter status,
* (then one byte reserved), then request status.
*/
- ds = (u8) le32_to_cpu(msg->body[0]);
- as = (u8) (le32_to_cpu(msg->body[0]) >> 8);
- st = (u8) (le32_to_cpu(msg->body[0]) >> 24);
+ ds = (u8) readl(&msg->body[0]);
+ as = (u8) (readl(&msg->body[0]) >> 8);
+ st = (u8) (readl(&msg->body[0]) >> 24);
/*
* Is this a control request coming back - eg an abort ?
if (!cmd) {
if (st)
printk(KERN_WARNING "SCSI abort: %08X",
- le32_to_cpu(msg->body[0]));
+ readl(&msg->body[0]));
printk(KERN_INFO "SCSI abort completed.\n");
return -EFAULT;
}
switch (st) {
case 0x06:
- count = le32_to_cpu(msg->body[1]);
+ count = readl(&msg->body[1]);
if (count < cmd->underflow) {
int i;
printk(KERN_ERR "SCSI: underflow 0x%08X 0x%08X"
"\n", count, cmd->underflow);
- printk(KERN_DEBUG "Cmd: ");
+ printk("Cmd: ");
for (i = 0; i < 15; i++)
- printk(KERN_DEBUG "%02X ",
- cmd->cmnd[i]);
- printk(KERN_DEBUG ".\n");
+ printk("%02X ", cmd->cmnd[i]);
+ printk(".\n");
cmd->result = (DID_ERROR << 16);
}
break;
default:
- error = le32_to_cpu(msg->body[0]);
+ error = readl(&msg->body[0]);
printk(KERN_ERR "scsi-osm: SCSI error %08x\n", error);
* If a I2O controller is added, we catch the notification to add a
* corresponding Scsi_Host.
*/
-static void i2o_scsi_notify_controller_add(struct i2o_controller *c)
+void i2o_scsi_notify_controller_add(struct i2o_controller *c)
{
struct i2o_scsi_host *i2o_shost;
int rc;
rc = scsi_add_host(i2o_shost->scsi_host, &c->device);
if (rc) {
- printk(KERN_ERR "scsi-osm: Could not add SCSI " "host\n");
+ printk(KERN_ERR "scsi-osm: Could not add SCSI "
+ "host\n");
scsi_host_put(i2o_shost->scsi_host);
return;
}
* If a I2O controller is removed, we catch the notification to remove the
* corresponding Scsi_Host.
*/
-static void i2o_scsi_notify_controller_remove(struct i2o_controller *c)
+void i2o_scsi_notify_controller_remove(struct i2o_controller *c)
{
struct i2o_scsi_host *i2o_shost;
i2o_shost = i2o_scsi_get_host(c);
struct i2o_device *i2o_dev;
struct device *dev;
int tid;
- struct i2o_message __iomem *msg;
+ struct i2o_message *msg;
u32 m;
u32 scsi_flags, sg_flags;
- u32 __iomem *mptr;
- u32 __iomem *lenptr;
+ u32 *mptr, *lenptr;
u32 len, reqlen;
int i;
* Returns 0 if the command is successfully aborted or negative error code
* on failure.
*/
-static int i2o_scsi_abort(struct scsi_cmnd *SCpnt)
+int i2o_scsi_abort(struct scsi_cmnd *SCpnt)
{
struct i2o_device *i2o_dev;
struct i2o_controller *c;
- struct i2o_message __iomem *msg;
+ struct i2o_message *msg;
u32 m;
int tid;
int status = FAILED;