patch-2.3.99-pre6 linux/drivers/i2o/i2o_config.c

Next file: linux/drivers/i2o/i2o_core.c
Previous file: linux/drivers/i2o/i2o_block.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre5/linux/drivers/i2o/i2o_config.c linux/drivers/i2o/i2o_config.c
@@ -85,11 +85,21 @@
 {
 	u32 *msg = (u32 *)m;
 
-	if (msg[0] & (1<<13))
+	if (msg[0] & MSG_FAIL) {
+		u32 *preserved_msg = (u32*)(c->mem_offset + msg[7]);
+
 		printk(KERN_ERR "i2o_config: IOP failed to process the msg.\n");
-        
-	if (msg[4] >> 24)  // RegStatus != SUCCESS
-		i2o_report_status(KERN_INFO,"i2o_config",msg);
+
+		/* Release the preserved msg frame by resubmitting it as a NOP */
+
+		preserved_msg[0] = THREE_WORD_MSG_SIZE | SGL_OFFSET_0;
+		preserved_msg[1] = I2O_CMD_UTIL_NOP << 24 | HOST_TID << 12 | 0;
+		preserved_msg[2] = 0;
+		i2o_post_message(c, msg[7]);
+	}
+
+	if (msg[4] >> 24)  // ReqStatus != SUCCESS
+		i2o_report_status(KERN_INFO,"i2o_config", msg);
 
 	if(m->function == I2O_CMD_UTIL_EVT_REGISTER)
 	{
@@ -166,6 +176,9 @@
 struct i2o_handler cfg_handler=
 {
 	i2o_cfg_reply,
+	NULL,
+	NULL,
+	NULL,
 	"Configuration",
 	0,
 	0xffffffff	// All classes
@@ -409,14 +422,14 @@
 		return -ENOMEM;
 	}
 
-        len = i2o_issue_params(i2o_cmd, c, kcmd.tid, 
-       			ops, kcmd.oplen, res, 65536);
-        i2o_unlock_controller(c);
+	len = i2o_issue_params(i2o_cmd, c, kcmd.tid, 
+				ops, kcmd.oplen, res, 65536);
+	i2o_unlock_controller(c);
 	kfree(ops);
         
 	if (len < 0) {
 		kfree(res);
-		return len; /* -DetailedStatus */
+		return -EAGAIN;
 	}
 
 	put_user(len, kcmd.reslen);
@@ -749,7 +762,7 @@
 
 	/* Device exists? */
 	for(d = iop->devices; d; d = d->next)
-		if(d->lct_data->tid == kdesc.tid)
+		if(d->lct_data.tid == kdesc.tid)
 			break;
 
 	if(!d)
@@ -903,7 +916,7 @@
 #endif
 {
 	printk(KERN_INFO "I2O configuration manager v 0.04.\n");
-	printk(KERN_INFO "  (C) Copyright 1999 Red Hat Software");
+	printk(KERN_INFO "  (C) Copyright 1999 Red Hat Software\n");
 	
 	if((page_buf = kmalloc(4096, GFP_KERNEL))==NULL)
 	{

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)