From: Markus Lidel <Markus.Lidel@shadowconnect.com>

Resync with the post-2.6.6 changes in mainline.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/message/i2o/scsi-osm.c |  110 ---------------------------------
 25-akpm/include/linux/i2o-dev.h        |   50 +++++++--------
 25-akpm/include/linux/i2o.h            |   34 +++++-----
 3 files changed, 44 insertions(+), 150 deletions(-)

diff -puN drivers/message/i2o/scsi-osm.c~i2o-resync-with-post-266-changes drivers/message/i2o/scsi-osm.c
--- 25/drivers/message/i2o/scsi-osm.c~i2o-resync-with-post-266-changes	Thu Jul 29 14:30:19 2004
+++ 25-akpm/drivers/message/i2o/scsi-osm.c	Thu Jul 29 14:30:19 2004
@@ -653,6 +653,7 @@ static int i2o_scsi_queuecommand(struct 
 };
 
 #if 0
+FIXME
 /**
  *	i2o_scsi_abort	-	abort a running command
  *	@SCpnt: command to abort
@@ -664,7 +665,7 @@ static int i2o_scsi_queuecommand(struct 
  *	Locks: no locks are held or needed
  */
 
-int i2o_scsi_abort(Scsi_Cmnd * SCpnt)
+int i2o_scsi_abort(struct scsi_cmnd * SCpnt)
 {
 	struct i2o_controller *c;
 	struct Scsi_Host *host;
@@ -699,108 +700,9 @@ int i2o_scsi_abort(Scsi_Cmnd * SCpnt)
 	return status;
 }
 
-/**
- *	i2o_scsi_bus_reset		-	Issue a SCSI reset
- *	@SCpnt: the command that caused the reset
- *
- *	Perform a SCSI bus reset operation. In I2O this is just a message
- *	we pass. I2O can do clever multi-initiator and shared reset stuff
- *	but we don't support this.
- *
- *	Locks: called with no lock held, requires no locks.
- */
-
-static int i2o_scsi_bus_reset(Scsi_Cmnd * SCpnt)
-{
-	int tid;
-	struct i2o_controller *c;
-	struct Scsi_Host *host;
-	struct i2o_scsi_host *hostdata;
-	u32 m;
-	void *msg;
-	unsigned long timeout;
-
-
-	/*
-	 *	Find the TID for the bus
-	 */
-
-
-	host = SCpnt->device->host;
-
-	spin_unlock_irq(host->host_lock);
-
-	printk(KERN_WARNING "i2o_scsi: Attempting to reset the bus.\n");
-
-	hostdata = (struct i2o_scsi_host *)host->hostdata;
-	tid = hostdata->bus_task;
-	c = hostdata->controller;
-
-	/*
-	 *	Now send a SCSI reset request. Any remaining commands
-	 *	will be aborted by the IOP. We need to catch the reply
-	 *	possibly ?
-	 */
-
-	timeout = jiffies+2*HZ;
-	do
-	{
-		m = le32_to_cpu(I2O_POST_READ32(c));
-		if(m != 0xFFFFFFFF)
-			break;
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(1);
-		mb();
-	}
-	while(time_before(jiffies, timeout));
-
-
-	msg = c->msg_virt + m;
-	i2o_raw_writel(FOUR_WORD_MSG_SIZE|SGL_OFFSET_0, msg);
-	i2o_raw_writel(I2O_CMD_SCSI_BUSRESET<<24|HOST_TID<<12|tid, msg+4);
-	i2o_raw_writel(scsi_context|0x80000000, msg+8);
-	/* We use the top bit to split controller and unit transactions */
-	/* Now store unit,tid so we can tie the completion back to a specific device */
-	__raw_writel(c->unit << 16 | tid, msg+12);
-	wmb();
-
-	/* We want the command to complete after we return */
-	spin_lock_irq(host->host_lock);
-	i2o_post_message(c,m);
-
-	/* Should we wait for the reset to complete ? */
-	return SUCCESS;
-}
 #endif
 
 /**
- *	i2o_scsi_host_reset	-	host reset callback
- *	@SCpnt: command causing the reset
- *
- *	An I2O controller can be many things at once. While we can
- *	reset a controller the potential mess from doing so is vast, and
- *	it's better to simply hold on and pray
- */
-
-static int i2o_scsi_host_reset(struct scsi_cmnd * SCpnt)
-{
-	return FAILED;
-}
-#if 0
-
-/**
- *	i2o_scsi_device_reset	-	device reset callback
- *	@SCpnt: command causing the reset
- *
- *	I2O does not (AFAIK) support doing a device reset
- */
-
-static int i2o_scsi_device_reset(Scsi_Cmnd * SCpnt)
-{
-	return FAILED;
-}
-
-/**
  *	i2o_scsi_bios_param	-	Invent disk geometry
  *	@sdev: scsi device
  *	@dev: block layer device
@@ -827,9 +729,6 @@ static int i2o_scsi_bios_param(struct sc
 	return 0;
 }
 
-
-#endif
-
 static struct scsi_host_template i2o_scsi_host_template = {
 	.proc_name		= "SCSI-OSM",
 	.name			= "I2O SCSI Peripheral OSM",
@@ -837,13 +736,8 @@ static struct scsi_host_template i2o_scs
 	.queuecommand		= i2o_scsi_queuecommand,
 /*
 	.eh_abort_handler	= i2o_scsi_abort,
-	.eh_bus_reset_handler	= i2o_scsi_bus_reset,
-	.eh_device_reset_handler= i2o_scsi_device_reset,
 */
-	.eh_host_reset_handler	= i2o_scsi_host_reset,
-/*
 	.bios_param		= i2o_scsi_bios_param,
-*/
 	.can_queue		= I2O_SCSI_CAN_QUEUE,
 	.sg_tablesize		= 8,
 	.cmd_per_lun		= 6,
diff -puN include/linux/i2o-dev.h~i2o-resync-with-post-266-changes include/linux/i2o-dev.h
--- 25/include/linux/i2o-dev.h~i2o-resync-with-post-266-changes	Thu Jul 29 14:30:19 2004
+++ 25-akpm/include/linux/i2o-dev.h	Thu Jul 29 14:30:19 2004
@@ -1,13 +1,13 @@
 /*
  * I2O user space accessible structures/APIs
- * 
+ *
  * (c) Copyright 1999, 2000 Red Hat Software
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation; either version 
- * 2 of the License, or (at your option) any later version.  
- * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
  *************************************************************************
  *
  * This header file defines the I2O APIs that are available to both
@@ -53,24 +53,24 @@ struct i2o_cmd_passthru32
 struct i2o_cmd_passthru
 {
 	unsigned int iop;	/* IOP unit number */
-	void *msg;		/* message */
+	void __user *msg;		/* message */
 };
 
 struct i2o_cmd_hrtlct
 {
-	unsigned int iop;	/* IOP unit number */
-	void *resbuf;		/* Buffer for result */
-	unsigned int *reslen;	/* Buffer length in bytes */
+	unsigned int iop;		/* IOP unit number */
+	void __user *resbuf;		/* Buffer for result */
+	unsigned int __user *reslen;	/* Buffer length in bytes */
 };
 
 struct i2o_cmd_psetget
 {
 	unsigned int iop;	/* IOP unit number */
 	unsigned int tid;	/* Target device TID */
-	void *opbuf;		/* Operation List buffer */
+	void __user *opbuf;	/* Operation List buffer */
 	unsigned int oplen;	/* Operation List buffer length in bytes */
-	void *resbuf;		/* Result List buffer */
-	unsigned int *reslen;	/* Result List buffer length in bytes */
+	void __user *resbuf;	/* Result List buffer */
+	unsigned int __user *reslen;	/* Result List buffer length in bytes */
 };
 
 struct i2o_sw_xfer
@@ -79,10 +79,10 @@ struct i2o_sw_xfer
 	unsigned char flags;	/* Flags field */
 	unsigned char sw_type;	/* Software type */
 	unsigned int sw_id;	/* Software ID */
-	void *buf;		/* Pointer to software buffer */
-	unsigned int *swlen;	/* Length of software data */
-	unsigned int *maxfrag;	/* Maximum fragment count */
-	unsigned int *curfrag;	/* Current fragment count */
+	void __user *buf;	/* Pointer to software buffer */
+	unsigned int __user *swlen;	/* Length of software data */
+	unsigned int __user *maxfrag;	/* Maximum fragment count */
+	unsigned int __user *curfrag;	/* Current fragment count */
 };
 
 struct i2o_html
@@ -90,9 +90,9 @@ struct i2o_html
 	unsigned int iop;	/* IOP unit number */
 	unsigned int tid;	/* Target device ID */
 	unsigned int page;	/* HTML page */
-	void *resbuf;		/* Buffer for reply HTML page */
-	unsigned int *reslen;	/* Length in bytes of reply buffer */
-	void *qbuf;		/* Pointer to HTTP query string */
+	void __user *resbuf;		/* Buffer for reply HTML page */
+	unsigned int __user *reslen;	/* Length in bytes of reply buffer */
+	void __user *qbuf;		/* Pointer to HTTP query string */
 	unsigned int qlen;	/* Length in bytes of query string buffer */
 };
 
@@ -360,13 +360,13 @@ typedef struct _i2o_status_block
 #define I2O_CLASS_PEER_TRANSPORT		0x091
 #define	I2O_CLASS_END				0xfff
 
-/* 
+/*
  *  Rest of 0x092 - 0x09f reserved for peer-to-peer classes
  */
 
 #define I2O_CLASS_MATCH_ANYCLASS		0xffffffff
 
-/* 
+/*
  *  Subclasses
  */
 
@@ -388,7 +388,7 @@ typedef struct _i2o_status_block
 #define I2O_PARAMS_TABLE_CLEAR			0x000A
 
 /*
- * I2O serial number conventions / formats 
+ * I2O serial number conventions / formats
  * (circa v1.5)
  */
 
@@ -399,7 +399,7 @@ typedef struct _i2o_status_block
 #define I2O_SNFORMAT_LAN48_MAC			4
 #define I2O_SNFORMAT_WAN			5
 
-/* 
+/*
  * Plus new in v2.0 (Yellowstone pdf doc)
  */
 
@@ -410,7 +410,7 @@ typedef struct _i2o_status_block
 #define I2O_SNFORMAT_UNKNOWN2			0xff
 
 /*
- *	I2O Get Status State values 
+ *	I2O Get Status State values
  */
 
 #define ADAPTER_STATE_INITIALIZING		0x01
diff -puN include/linux/i2o.h~i2o-resync-with-post-266-changes include/linux/i2o.h
--- 25/include/linux/i2o.h~i2o-resync-with-post-266-changes	Thu Jul 29 14:30:19 2004
+++ 25-akpm/include/linux/i2o.h	Thu Jul 29 14:30:19 2004
@@ -1,16 +1,16 @@
 /*
  * I2O kernel space accessible structures/APIs
- * 
+ *
  * (c) Copyright 1999, 2000 Red Hat Software
  *
- * This program is free software; you can redistribute it and/or 
- * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation; either version 
- * 2 of the License, or (at your option) any later version.  
- * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
  *************************************************************************
  *
- * This header file defined the I2O APIs/structures for use by 
+ * This header file defined the I2O APIs/structures for use by
  * the I2O kernel modules.
  *
  */
@@ -143,7 +143,7 @@ struct i2o_controller
 	char name[16];
 	int unit;
 	int type;
-	
+
 	struct pci_dev *pdev;			/* PCI device */
 
 	int		short_req:1;		/* use small block sizes */
@@ -529,7 +529,7 @@ static inline void i2o_dma_unmap(struct 
  *	Endian handling wrapped into the macro - keeps the core code
  *	cleaner.
  */
- 
+
 #define i2o_raw_writel(val, mem)	__raw_writel(cpu_to_le32(val), mem)
 
 
@@ -558,14 +558,14 @@ extern void i2o_debug_state(struct i2o_c
 /*
  *	Cache strategies
  */
- 
- 
+
+
 /*	The NULL strategy leaves everything up to the controller. This tends to be a
  *	pessimal but functional choice.
  */
 #define CACHE_NULL		0
 /*	Prefetch data when reading. We continually attempt to load the next 32 sectors
- *	into the controller cache. 
+ *	into the controller cache.
  */
 #define CACHE_PREFETCH		1
 /*	Prefetch data when reading. We sometimes attempt to load the next 32 sectors
@@ -599,12 +599,12 @@ extern void i2o_debug_state(struct i2o_c
 /*
  *	Ioctl structures
  */
- 
 
-#define 	BLKI2OGRSTRAT	_IOR('2', 1, int) 
-#define 	BLKI2OGWSTRAT	_IOR('2', 2, int) 
-#define 	BLKI2OSRSTRAT	_IOW('2', 3, int) 
-#define 	BLKI2OSWSTRAT	_IOW('2', 4, int) 
+
+#define 	BLKI2OGRSTRAT	_IOR('2', 1, int)
+#define 	BLKI2OGWSTRAT	_IOR('2', 2, int)
+#define 	BLKI2OSRSTRAT	_IOW('2', 3, int)
+#define 	BLKI2OSWSTRAT	_IOW('2', 4, int)
 
 
 /*
_