patch-2.3.41 linux/drivers/i2o/i2o_core.c

Next file: linux/drivers/net/Space.c
Previous file: linux/drivers/fc4/socal.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.40/linux/drivers/i2o/i2o_core.c linux/drivers/i2o/i2o_core.c
@@ -1411,24 +1411,30 @@
 	}
 	memset(status, 0, 4);
 	
-	msg[0]= EIGHT_WORD_MSG_SIZE| TRL_OFFSET_6;
+	msg[0]= EIGHT_WORD_MSG_SIZE| SGL_OFFSET_6;
 	msg[1]= I2O_CMD_OUTBOUND_INIT<<24 | HOST_TID<<12 | ADAPTER_TID;
 	msg[2]= core_context;
 	msg[3]= 0x0106;			/* Transaction context */
 	msg[4]= 4096;			/* Host page frame size */
-	msg[5]= MSG_FRAME_SIZE<<16|0x80;	/* Outbound msg frame size and Initcode */
+	/* Frame size is in words. Pick 128, its what everyone elses uses and
+	   other sizes break some adapters. */
+	msg[5]= (MSG_FRAME_SIZE>>2)<<16|0x80;	/* Outbound msg frame size and Initcode */
 	msg[6]= 0xD0000004;		/* Simple SG LE, EOB */
-	msg[7]= virt_to_phys(status);
+	msg[7]= virt_to_bus(status);
 
 	i2o_post_message(c,m);
 	
 	barrier();	
 	time=jiffies;
-	while(status[0]!=I2O_CMD_OUTBOUND_INIT_COMPLETE)
+	while(status[0]<0x02)
 	{
 		if((jiffies-time)>=5*HZ)
 		{
-			printk(KERN_ERR "%s: Outbound Q initialize timeout.\n",
+			if(status[0]==0x00)
+				printk(KERN_ERR "%s: Ignored queue initialize request.\n",
+					c->name);
+			else
+				printk(KERN_ERR "%s: Outbound queue initialize timeout.\n",
 					c->name);
 			kfree(status);
 			return -ETIMEDOUT;
@@ -1437,6 +1443,13 @@
 		barrier();
 	}
 
+	if(status[0] != I2O_CMD_OUTBOUND_INIT_COMPLETE)
+	{
+		printk(KERN_ERR "%s: Outbound queue initialize rejected (%d).\n",
+			c->name, status[0]);
+		kfree(status);
+		return -EINVAL;
+	}
 	/* Alloc space for IOP's outbound queue message frames */
 
 	c->page_frame = kmalloc(MSG_POOL_SIZE, GFP_KERNEL);

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