提交 f33213ec 编写于 作者: M Markus Lidel 提交者: Linus Torvalds

[PATCH] I2O: Lindent run and replacement of printk through osm printing functions

Lindent run and replaced printk() through the corresponding osm_*() function
Signed-off-by: NMarkus Lidel <Markus.Lidel@shadowconnect.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 9e87545f
...@@ -44,8 +44,8 @@ config I2O_EXT_ADAPTEC_DMA64 ...@@ -44,8 +44,8 @@ config I2O_EXT_ADAPTEC_DMA64
config I2O_CONFIG config I2O_CONFIG
tristate "I2O Configuration support" tristate "I2O Configuration support"
depends on PCI && I2O depends on I2O
help ---help---
Say Y for support of the configuration interface for the I2O adapters. Say Y for support of the configuration interface for the I2O adapters.
If you have a RAID controller from Adaptec and you want to use the If you have a RAID controller from Adaptec and you want to use the
raidutils to manage your RAID array, you have to say Y here. raidutils to manage your RAID array, you have to say Y here.
...@@ -74,7 +74,7 @@ config I2O_BUS ...@@ -74,7 +74,7 @@ config I2O_BUS
config I2O_BLOCK config I2O_BLOCK
tristate "I2O Block OSM" tristate "I2O Block OSM"
depends on I2O depends on I2O
help ---help---
Include support for the I2O Block OSM. The Block OSM presents disk Include support for the I2O Block OSM. The Block OSM presents disk
and other structured block devices to the operating system. If you and other structured block devices to the operating system. If you
are using an RAID controller, you could access the array only by are using an RAID controller, you could access the array only by
...@@ -87,7 +87,7 @@ config I2O_BLOCK ...@@ -87,7 +87,7 @@ config I2O_BLOCK
config I2O_SCSI config I2O_SCSI
tristate "I2O SCSI OSM" tristate "I2O SCSI OSM"
depends on I2O && SCSI depends on I2O && SCSI
help ---help---
Allows direct SCSI access to SCSI devices on a SCSI or FibreChannel Allows direct SCSI access to SCSI devices on a SCSI or FibreChannel
I2O controller. You can use both the SCSI and Block OSM together if I2O controller. You can use both the SCSI and Block OSM together if
you wish. To access a RAID array, you must use the Block OSM driver. you wish. To access a RAID array, you must use the Block OSM driver.
...@@ -99,7 +99,7 @@ config I2O_SCSI ...@@ -99,7 +99,7 @@ config I2O_SCSI
config I2O_PROC config I2O_PROC
tristate "I2O /proc support" tristate "I2O /proc support"
depends on I2O depends on I2O
help ---help---
If you say Y here and to "/proc file system support", you will be If you say Y here and to "/proc file system support", you will be
able to read I2O related information from the virtual directory able to read I2O related information from the virtual directory
/proc/i2o. /proc/i2o.
......
...@@ -443,7 +443,6 @@ static struct class_interface i2o_device_class_interface = { ...@@ -443,7 +443,6 @@ static struct class_interface i2o_device_class_interface = {
* Note that the minimum sized reslist is 8 bytes and contains * Note that the minimum sized reslist is 8 bytes and contains
* ResultCount, ErrorInfoSize, BlockStatus and BlockSize. * ResultCount, ErrorInfoSize, BlockStatus and BlockSize.
*/ */
static int i2o_parm_issue(struct i2o_device *i2o_dev, int cmd, void *oplist, static int i2o_parm_issue(struct i2o_device *i2o_dev, int cmd, void *oplist,
int oplen, void *reslist, int reslen) int oplen, void *reslist, int reslen)
{ {
......
...@@ -117,10 +117,9 @@ int i2o_driver_register(struct i2o_driver *drv) ...@@ -117,10 +117,9 @@ int i2o_driver_register(struct i2o_driver *drv)
i2o_driver_notify_controller_add(drv, c); i2o_driver_notify_controller_add(drv, c);
list_for_each_entry(i2o_dev, &c->devices, list) list_for_each_entry(i2o_dev, &c->devices, list)
i2o_driver_notify_device_add(drv, i2o_dev); i2o_driver_notify_device_add(drv, i2o_dev);
} }
rc = driver_register(&drv->driver); rc = driver_register(&drv->driver);
if (rc) if (rc)
destroy_workqueue(drv->event_queue); destroy_workqueue(drv->event_queue);
......
...@@ -152,7 +152,7 @@ int i2o_msg_post_wait_mem(struct i2o_controller *c, u32 m, unsigned long ...@@ -152,7 +152,7 @@ int i2o_msg_post_wait_mem(struct i2o_controller *c, u32 m, unsigned long
list_add(&wait->list, &i2o_exec_wait_list); list_add(&wait->list, &i2o_exec_wait_list);
wait_event_interruptible_timeout(wq, wait->complete, wait_event_interruptible_timeout(wq, wait->complete,
timeout * HZ); timeout * HZ);
wait->wq = NULL; wait->wq = NULL;
} }
......
...@@ -940,7 +940,6 @@ static void i2o_block_request_fn(struct request_queue *q) ...@@ -940,7 +940,6 @@ static void i2o_block_request_fn(struct request_queue *q)
INIT_WORK(&dreq->work, i2o_block_delayed_request_fn, INIT_WORK(&dreq->work, i2o_block_delayed_request_fn,
dreq); dreq);
osm_info("transfer error\n");
if (!queue_delayed_work(i2o_block_driver.event_queue, if (!queue_delayed_work(i2o_block_driver.event_queue,
&dreq->work, &dreq->work,
I2O_BLOCK_RETRY_TIME)) I2O_BLOCK_RETRY_TIME))
...@@ -1042,8 +1041,8 @@ static struct i2o_block_device *i2o_block_device_alloc(void) ...@@ -1042,8 +1041,8 @@ static struct i2o_block_device *i2o_block_device_alloc(void)
static int i2o_block_probe(struct device *dev) static int i2o_block_probe(struct device *dev)
{ {
struct i2o_device *i2o_dev = to_i2o_device(dev); struct i2o_device *i2o_dev = to_i2o_device(dev);
struct i2o_block_device *i2o_blk_dev;
struct i2o_controller *c = i2o_dev->iop; struct i2o_controller *c = i2o_dev->iop;
struct i2o_block_device *i2o_blk_dev;
struct gendisk *gd; struct gendisk *gd;
struct request_queue *queue; struct request_queue *queue;
static int unit = 0; static int unit = 0;
......
...@@ -64,40 +64,38 @@ ...@@ -64,40 +64,38 @@
/* I2O Block OSM mempool struct */ /* I2O Block OSM mempool struct */
struct i2o_block_mempool { struct i2o_block_mempool {
kmem_cache_t *slab; kmem_cache_t *slab;
mempool_t *pool; mempool_t *pool;
}; };
/* I2O Block device descriptor */ /* I2O Block device descriptor */
struct i2o_block_device { struct i2o_block_device {
struct i2o_device *i2o_dev; /* pointer to I2O device */ struct i2o_device *i2o_dev; /* pointer to I2O device */
struct gendisk *gd; struct gendisk *gd;
spinlock_t lock; /* queue lock */ spinlock_t lock; /* queue lock */
struct list_head open_queue; /* list of transfered, but unfinished struct list_head open_queue; /* list of transfered, but unfinished
requests */ requests */
unsigned int open_queue_depth; /* number of requests in the queue */ unsigned int open_queue_depth; /* number of requests in the queue */
int rcache; /* read cache flags */ int rcache; /* read cache flags */
int wcache; /* write cache flags */ int wcache; /* write cache flags */
int flags; int flags;
u16 power; /* power state */ u16 power; /* power state */
int media_change_flag; /* media changed flag */ int media_change_flag; /* media changed flag */
}; };
/* I2O Block device request */ /* I2O Block device request */
struct i2o_block_request struct i2o_block_request {
{
struct list_head queue; struct list_head queue;
struct request *req; /* corresponding request */ struct request *req; /* corresponding request */
struct i2o_block_device *i2o_blk_dev; /* I2O block device */ struct i2o_block_device *i2o_blk_dev; /* I2O block device */
struct device *dev; /* device used for DMA */ struct device *dev; /* device used for DMA */
int sg_nents; /* number of SG elements */ int sg_nents; /* number of SG elements */
struct scatterlist sg_table[I2O_MAX_PHYS_SEGMENTS]; /* SG table */ struct scatterlist sg_table[I2O_MAX_PHYS_SEGMENTS]; /* SG table */
}; };
/* I2O Block device delayed request */ /* I2O Block device delayed request */
struct i2o_block_delayed_request struct i2o_block_delayed_request {
{
struct work_struct work; struct work_struct work;
struct request_queue *queue; struct request_queue *queue;
}; };
......
...@@ -368,9 +368,9 @@ static int i2o_cfg_swul(unsigned long arg) ...@@ -368,9 +368,9 @@ static int i2o_cfg_swul(unsigned long arg)
i2o_dma_free(&c->pdev->dev, &buffer); i2o_dma_free(&c->pdev->dev, &buffer);
return_ret: return_ret:
return ret; return ret;
return_fault: return_fault:
ret = -EFAULT; ret = -EFAULT;
goto return_ret; goto return_ret;
}; };
...@@ -519,7 +519,8 @@ static int i2o_cfg_evt_get(unsigned long arg, struct file *fp) ...@@ -519,7 +519,8 @@ static int i2o_cfg_evt_get(unsigned long arg, struct file *fp)
#ifdef CONFIG_I2O_EXT_ADAPTEC #ifdef CONFIG_I2O_EXT_ADAPTEC
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long arg) static int i2o_cfg_passthru32(struct file *file, unsigned cmnd,
unsigned long arg)
{ {
struct i2o_cmd_passthru32 __user *cmd; struct i2o_cmd_passthru32 __user *cmd;
struct i2o_controller *c; struct i2o_controller *c;
...@@ -646,8 +647,9 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long ar ...@@ -646,8 +647,9 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long ar
flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR */ ) { flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR */ ) {
// TODO 64bit fix // TODO 64bit fix
if (copy_from_user if (copy_from_user
(p->virt, (void __user *)(unsigned long)sg[i].addr_bus, (p->virt,
sg_size)) { (void __user *)(unsigned long)sg[i].
addr_bus, sg_size)) {
printk(KERN_DEBUG printk(KERN_DEBUG
"%s: Could not copy SG buf %d FROM user\n", "%s: Could not copy SG buf %d FROM user\n",
c->name, i); c->name, i);
...@@ -738,11 +740,12 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long ar ...@@ -738,11 +740,12 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long ar
return rcode; return rcode;
} }
static long i2o_cfg_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg) static long i2o_cfg_compat_ioctl(struct file *file, unsigned cmd,
unsigned long arg)
{ {
int ret; int ret;
lock_kernel(); lock_kernel();
switch (cmd) { switch (cmd) {
case I2OGETIOPS: case I2OGETIOPS:
ret = i2o_cfg_ioctl(NULL, file, cmd, arg); ret = i2o_cfg_ioctl(NULL, file, cmd, arg);
break; break;
...@@ -1136,6 +1139,7 @@ static int __init i2o_config_old_init(void) ...@@ -1136,6 +1139,7 @@ static int __init i2o_config_old_init(void)
osm_err("can't register device.\n"); osm_err("can't register device.\n");
return -EBUSY; return -EBUSY;
} }
return 0; return 0;
} }
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
*/ */
#define OSM_NAME "proc-osm" #define OSM_NAME "proc-osm"
#define OSM_VERSION "$Rev$" #define OSM_VERSION "1.145"
#define OSM_DESCRIPTION "I2O ProcFS OSM" #define OSM_DESCRIPTION "I2O ProcFS OSM"
#define I2O_MAX_MODULES 4 #define I2O_MAX_MODULES 4
......
...@@ -117,13 +117,13 @@ u32 i2o_cntxt_list_add(struct i2o_controller * c, void *ptr) ...@@ -117,13 +117,13 @@ u32 i2o_cntxt_list_add(struct i2o_controller * c, void *ptr)
unsigned long flags; unsigned long flags;
if (!ptr) if (!ptr)
printk(KERN_ERR "%s: couldn't add NULL pointer to context list!" osm_err("%s: couldn't add NULL pointer to context list!\n",
"\n", c->name); c->name);
entry = kmalloc(sizeof(*entry), GFP_ATOMIC); entry = kmalloc(sizeof(*entry), GFP_ATOMIC);
if (!entry) { if (!entry) {
printk(KERN_ERR "%s: Could not allocate memory for context " osm_err("%s: Could not allocate memory for context list element"
"list element\n", c->name); "\n", c->name);
return 0; return 0;
} }
...@@ -142,7 +142,7 @@ u32 i2o_cntxt_list_add(struct i2o_controller * c, void *ptr) ...@@ -142,7 +142,7 @@ u32 i2o_cntxt_list_add(struct i2o_controller * c, void *ptr)
spin_unlock_irqrestore(&c->context_list_lock, flags); spin_unlock_irqrestore(&c->context_list_lock, flags);
pr_debug("%s: Add context to list %p -> %d\n", c->name, ptr, context); osm_debug("%s: Add context to list %p -> %d\n", c->name, ptr, context);
return entry->context; return entry->context;
}; };
...@@ -174,11 +174,11 @@ u32 i2o_cntxt_list_remove(struct i2o_controller * c, void *ptr) ...@@ -174,11 +174,11 @@ u32 i2o_cntxt_list_remove(struct i2o_controller * c, void *ptr)
spin_unlock_irqrestore(&c->context_list_lock, flags); spin_unlock_irqrestore(&c->context_list_lock, flags);
if (!context) if (!context)
printk(KERN_WARNING "%s: Could not remove nonexistent ptr " osm_warn("%s: Could not remove nonexistent ptr %p\n", c->name,
"%p\n", c->name, ptr); ptr);
pr_debug("%s: remove ptr from context list %d -> %p\n", c->name, osm_debug("%s: remove ptr from context list %d -> %p\n", c->name,
context, ptr); context, ptr);
return context; return context;
}; };
...@@ -208,11 +208,10 @@ void *i2o_cntxt_list_get(struct i2o_controller *c, u32 context) ...@@ -208,11 +208,10 @@ void *i2o_cntxt_list_get(struct i2o_controller *c, u32 context)
spin_unlock_irqrestore(&c->context_list_lock, flags); spin_unlock_irqrestore(&c->context_list_lock, flags);
if (!ptr) if (!ptr)
printk(KERN_WARNING "%s: context id %d not found\n", c->name, osm_warn("%s: context id %d not found\n", c->name, context);
context);
pr_debug("%s: get ptr from context list %d -> %p\n", c->name, context, osm_debug("%s: get ptr from context list %d -> %p\n", c->name, context,
ptr); ptr);
return ptr; return ptr;
}; };
...@@ -240,11 +239,11 @@ u32 i2o_cntxt_list_get_ptr(struct i2o_controller * c, void *ptr) ...@@ -240,11 +239,11 @@ u32 i2o_cntxt_list_get_ptr(struct i2o_controller * c, void *ptr)
spin_unlock_irqrestore(&c->context_list_lock, flags); spin_unlock_irqrestore(&c->context_list_lock, flags);
if (!context) if (!context)
printk(KERN_WARNING "%s: Could not find nonexistent ptr " osm_warn("%s: Could not find nonexistent ptr %p\n", c->name,
"%p\n", c->name, ptr); ptr);
pr_debug("%s: get context id from context list %p -> %d\n", c->name, osm_debug("%s: get context id from context list %p -> %d\n", c->name,
ptr, context); ptr, context);
return context; return context;
}; };
...@@ -324,10 +323,9 @@ static int i2o_iop_quiesce(struct i2o_controller *c) ...@@ -324,10 +323,9 @@ static int i2o_iop_quiesce(struct i2o_controller *c)
/* Long timeout needed for quiesce if lots of devices */ /* Long timeout needed for quiesce if lots of devices */
if ((rc = i2o_msg_post_wait(c, m, 240))) if ((rc = i2o_msg_post_wait(c, m, 240)))
printk(KERN_INFO "%s: Unable to quiesce (status=%#x).\n", osm_info("%s: Unable to quiesce (status=%#x).\n", c->name, -rc);
c->name, -rc);
else else
pr_debug("%s: Quiesced.\n", c->name); osm_debug("%s: Quiesced.\n", c->name);
i2o_status_get(c); // Entered READY state i2o_status_get(c); // Entered READY state
...@@ -365,10 +363,9 @@ static int i2o_iop_enable(struct i2o_controller *c) ...@@ -365,10 +363,9 @@ static int i2o_iop_enable(struct i2o_controller *c)
/* How long of a timeout do we need? */ /* How long of a timeout do we need? */
if ((rc = i2o_msg_post_wait(c, m, 240))) if ((rc = i2o_msg_post_wait(c, m, 240)))
printk(KERN_ERR "%s: Could not enable (status=%#x).\n", osm_err("%s: Could not enable (status=%#x).\n", c->name, -rc);
c->name, -rc);
else else
pr_debug("%s: Enabled.\n", c->name); osm_debug("%s: Enabled.\n", c->name);
i2o_status_get(c); // entered OPERATIONAL state i2o_status_get(c); // entered OPERATIONAL state
...@@ -432,10 +429,9 @@ static int i2o_iop_clear(struct i2o_controller *c) ...@@ -432,10 +429,9 @@ static int i2o_iop_clear(struct i2o_controller *c)
&msg->u.head[1]); &msg->u.head[1]);
if ((rc = i2o_msg_post_wait(c, m, 30))) if ((rc = i2o_msg_post_wait(c, m, 30)))
printk(KERN_INFO "%s: Unable to clear (status=%#x).\n", osm_info("%s: Unable to clear (status=%#x).\n", c->name, -rc);
c->name, -rc);
else else
pr_debug("%s: Cleared.\n", c->name); osm_debug("%s: Cleared.\n", c->name);
/* Enable all IOPs */ /* Enable all IOPs */
i2o_iop_enable_all(); i2o_iop_enable_all();
...@@ -570,14 +566,13 @@ static int i2o_iop_reset(struct i2o_controller *c) ...@@ -570,14 +566,13 @@ static int i2o_iop_reset(struct i2o_controller *c)
* can't read one in the given ammount of time, we assume the * can't read one in the given ammount of time, we assume the
* IOP could not reboot properly. * IOP could not reboot properly.
*/ */
pr_debug("%s: Reset in progress, waiting for reboot...\n", osm_debug("%s: Reset in progress, waiting for reboot...\n",
c->name); c->name);
m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_RESET); m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_RESET);
while (m == I2O_QUEUE_EMPTY) { while (m == I2O_QUEUE_EMPTY) {
if (time_after(jiffies, timeout)) { if (time_after(jiffies, timeout)) {
printk(KERN_ERR "%s: IOP reset timeout.\n", osm_err("%s: IOP reset timeout.\n", c->name);
c->name);
rc = -ETIMEDOUT; rc = -ETIMEDOUT;
goto exit; goto exit;
} }
...@@ -635,29 +630,29 @@ static int i2o_iop_activate(struct i2o_controller *c) ...@@ -635,29 +630,29 @@ static int i2o_iop_activate(struct i2o_controller *c)
rc = i2o_status_get(c); rc = i2o_status_get(c);
if (rc) { if (rc) {
printk(KERN_INFO "%s: Unable to obtain status, " osm_info("%s: Unable to obtain status, attempting a reset.\n",
"attempting a reset.\n", c->name); c->name);
rc = i2o_iop_reset(c); rc = i2o_iop_reset(c);
if (rc) if (rc)
return rc; return rc;
} }
if (sb->i2o_version > I2OVER15) { if (sb->i2o_version > I2OVER15) {
printk(KERN_ERR "%s: Not running version 1.5 of the I2O " osm_err("%s: Not running version 1.5 of the I2O Specification."
"Specification.\n", c->name); "\n", c->name);
return -ENODEV; return -ENODEV;
} }
switch (sb->iop_state) { switch (sb->iop_state) {
case ADAPTER_STATE_FAULTED: case ADAPTER_STATE_FAULTED:
printk(KERN_CRIT "%s: hardware fault\n", c->name); osm_err("%s: hardware fault\n", c->name);
return -EFAULT; return -EFAULT;
case ADAPTER_STATE_READY: case ADAPTER_STATE_READY:
case ADAPTER_STATE_OPERATIONAL: case ADAPTER_STATE_OPERATIONAL:
case ADAPTER_STATE_HOLD: case ADAPTER_STATE_HOLD:
case ADAPTER_STATE_FAILED: case ADAPTER_STATE_FAILED:
pr_debug("%s: already running, trying to reset...\n", c->name); osm_debug("%s: already running, trying to reset...\n", c->name);
rc = i2o_iop_reset(c); rc = i2o_iop_reset(c);
if (rc) if (rc)
return rc; return rc;
...@@ -707,20 +702,18 @@ static int i2o_iop_systab_set(struct i2o_controller *c) ...@@ -707,20 +702,18 @@ static int i2o_iop_systab_set(struct i2o_controller *c)
res->flags = IORESOURCE_MEM; res->flags = IORESOURCE_MEM;
res->start = 0; res->start = 0;
res->end = 0; res->end = 0;
printk(KERN_INFO "%s: requires private memory resources.\n", osm_info("%s: requires private memory resources.\n", c->name);
c->name);
root = pci_find_parent_resource(c->pdev, res); root = pci_find_parent_resource(c->pdev, res);
if (root == NULL) if (root == NULL)
printk(KERN_WARNING "%s: Can't find parent resource!\n", osm_warn("%s: Can't find parent resource!\n", c->name);
c->name);
if (root && allocate_resource(root, res, sb->desired_mem_size, sb->desired_mem_size, sb->desired_mem_size, 1 << 20, /* Unspecified, so use 1Mb and play safe */ if (root && allocate_resource(root, res, sb->desired_mem_size, sb->desired_mem_size, sb->desired_mem_size, 1 << 20, /* Unspecified, so use 1Mb and play safe */
NULL, NULL) >= 0) { NULL, NULL) >= 0) {
c->mem_alloc = 1; c->mem_alloc = 1;
sb->current_mem_size = 1 + res->end - res->start; sb->current_mem_size = 1 + res->end - res->start;
sb->current_mem_base = res->start; sb->current_mem_base = res->start;
printk(KERN_INFO "%s: allocated %ld bytes of PCI memory" osm_info("%s: allocated %ld bytes of PCI memory at "
" at 0x%08lX.\n", c->name, "0x%08lX.\n", c->name,
1 + res->end - res->start, res->start); 1 + res->end - res->start, res->start);
} }
} }
...@@ -730,20 +723,18 @@ static int i2o_iop_systab_set(struct i2o_controller *c) ...@@ -730,20 +723,18 @@ static int i2o_iop_systab_set(struct i2o_controller *c)
res->flags = IORESOURCE_IO; res->flags = IORESOURCE_IO;
res->start = 0; res->start = 0;
res->end = 0; res->end = 0;
printk(KERN_INFO "%s: requires private memory resources.\n", osm_info("%s: requires private memory resources.\n", c->name);
c->name);
root = pci_find_parent_resource(c->pdev, res); root = pci_find_parent_resource(c->pdev, res);
if (root == NULL) if (root == NULL)
printk(KERN_WARNING "%s: Can't find parent resource!\n", osm_warn("%s: Can't find parent resource!\n", c->name);
c->name);
if (root && allocate_resource(root, res, sb->desired_io_size, sb->desired_io_size, sb->desired_io_size, 1 << 20, /* Unspecified, so use 1Mb and play safe */ if (root && allocate_resource(root, res, sb->desired_io_size, sb->desired_io_size, sb->desired_io_size, 1 << 20, /* Unspecified, so use 1Mb and play safe */
NULL, NULL) >= 0) { NULL, NULL) >= 0) {
c->io_alloc = 1; c->io_alloc = 1;
sb->current_io_size = 1 + res->end - res->start; sb->current_io_size = 1 + res->end - res->start;
sb->current_mem_base = res->start; sb->current_mem_base = res->start;
printk(KERN_INFO "%s: allocated %ld bytes of PCI I/O at" osm_info("%s: allocated %ld bytes of PCI I/O at 0x%08lX"
" 0x%08lX.\n", c->name, ".\n", c->name, 1 + res->end - res->start,
1 + res->end - res->start, res->start); res->start);
} }
} }
...@@ -787,10 +778,10 @@ static int i2o_iop_systab_set(struct i2o_controller *c) ...@@ -787,10 +778,10 @@ static int i2o_iop_systab_set(struct i2o_controller *c)
PCI_DMA_TODEVICE); PCI_DMA_TODEVICE);
if (rc < 0) if (rc < 0)
printk(KERN_ERR "%s: Unable to set SysTab (status=%#x).\n", osm_err("%s: Unable to set SysTab (status=%#x).\n", c->name,
c->name, -rc); -rc);
else else
pr_debug("%s: SysTab set.\n", c->name); osm_debug("%s: SysTab set.\n", c->name);
i2o_status_get(c); // Entered READY state i2o_status_get(c); // Entered READY state
...@@ -814,7 +805,7 @@ static int i2o_iop_online(struct i2o_controller *c) ...@@ -814,7 +805,7 @@ static int i2o_iop_online(struct i2o_controller *c)
return rc; return rc;
/* In READY state */ /* In READY state */
pr_debug("%s: Attempting to enable...\n", c->name); osm_debug("%s: Attempting to enable...\n", c->name);
rc = i2o_iop_enable(c); rc = i2o_iop_enable(c);
if (rc) if (rc)
return rc; return rc;
...@@ -833,7 +824,7 @@ void i2o_iop_remove(struct i2o_controller *c) ...@@ -833,7 +824,7 @@ void i2o_iop_remove(struct i2o_controller *c)
{ {
struct i2o_device *dev, *tmp; struct i2o_device *dev, *tmp;
pr_debug("%s: deleting controller\n", c->name); osm_debug("%s: deleting controller\n", c->name);
i2o_driver_notify_controller_remove_all(c); i2o_driver_notify_controller_remove_all(c);
...@@ -882,8 +873,7 @@ static int i2o_systab_build(void) ...@@ -882,8 +873,7 @@ static int i2o_systab_build(void)
systab = i2o_systab.virt = kmalloc(i2o_systab.len, GFP_KERNEL); systab = i2o_systab.virt = kmalloc(i2o_systab.len, GFP_KERNEL);
if (!systab) { if (!systab) {
printk(KERN_ERR "i2o: unable to allocate memory for System " osm_err("unable to allocate memory for System Table\n");
"Table\n");
return -ENOMEM; return -ENOMEM;
} }
memset(systab, 0, i2o_systab.len); memset(systab, 0, i2o_systab.len);
...@@ -895,8 +885,8 @@ static int i2o_systab_build(void) ...@@ -895,8 +885,8 @@ static int i2o_systab_build(void)
i2o_status_block *sb; i2o_status_block *sb;
if (count >= num_controllers) { if (count >= num_controllers) {
printk(KERN_ERR "i2o: controller added while building " osm_err("controller added while building system table"
"system table\n"); "\n");
break; break;
} }
...@@ -910,9 +900,8 @@ static int i2o_systab_build(void) ...@@ -910,9 +900,8 @@ static int i2o_systab_build(void)
* it is techninically not part of the I2O subsystem... * it is techninically not part of the I2O subsystem...
*/ */
if (unlikely(i2o_status_get(c))) { if (unlikely(i2o_status_get(c))) {
printk(KERN_ERR "%s: Deleting b/c could not get status" osm_err("%s: Deleting b/c could not get status while "
" while attempting to build system table\n", "attempting to build system table\n", c->name);
c->name);
i2o_iop_remove(c); i2o_iop_remove(c);
continue; // try the next one continue; // try the next one
} }
...@@ -994,7 +983,7 @@ int i2o_status_get(struct i2o_controller *c) ...@@ -994,7 +983,7 @@ int i2o_status_get(struct i2o_controller *c)
timeout = jiffies + I2O_TIMEOUT_STATUS_GET * HZ; timeout = jiffies + I2O_TIMEOUT_STATUS_GET * HZ;
while (status_block[87] != 0xFF) { while (status_block[87] != 0xFF) {
if (time_after(jiffies, timeout)) { if (time_after(jiffies, timeout)) {
printk(KERN_ERR "%s: Get status timeout.\n", c->name); osm_err("%s: Get status timeout.\n", c->name);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
...@@ -1043,8 +1032,8 @@ static int i2o_hrt_get(struct i2o_controller *c) ...@@ -1043,8 +1032,8 @@ static int i2o_hrt_get(struct i2o_controller *c)
rc = i2o_msg_post_wait_mem(c, m, 20, &c->hrt); rc = i2o_msg_post_wait_mem(c, m, 20, &c->hrt);
if (rc < 0) { if (rc < 0) {
printk(KERN_ERR "%s: Unable to get HRT (status=%#x)\n", osm_err("%s: Unable to get HRT (status=%#x)\n", c->name,
c->name, -rc); -rc);
return rc; return rc;
} }
...@@ -1058,8 +1047,8 @@ static int i2o_hrt_get(struct i2o_controller *c) ...@@ -1058,8 +1047,8 @@ static int i2o_hrt_get(struct i2o_controller *c)
return i2o_parse_hrt(c); return i2o_parse_hrt(c);
} }
printk(KERN_ERR "%s: Unable to get HRT after %d tries, giving up\n", osm_err("%s: Unable to get HRT after %d tries, giving up\n", c->name,
c->name, I2O_HRT_GET_TRIES); I2O_HRT_GET_TRIES);
return -EBUSY; return -EBUSY;
} }
...@@ -1073,7 +1062,6 @@ void i2o_iop_free(struct i2o_controller *c) ...@@ -1073,7 +1062,6 @@ void i2o_iop_free(struct i2o_controller *c)
kfree(c); kfree(c);
}; };
/** /**
* i2o_iop_release - release the memory for a I2O controller * i2o_iop_release - release the memory for a I2O controller
* @dev: I2O controller which should be released * @dev: I2O controller which should be released
...@@ -1109,8 +1097,8 @@ struct i2o_controller *i2o_iop_alloc(void) ...@@ -1109,8 +1097,8 @@ struct i2o_controller *i2o_iop_alloc(void)
c = kmalloc(sizeof(*c), GFP_KERNEL); c = kmalloc(sizeof(*c), GFP_KERNEL);
if (!c) { if (!c) {
printk(KERN_ERR "i2o: Insufficient memory to allocate a I2O " osm_err("i2o: Insufficient memory to allocate a I2O controller."
"controller.\n"); "\n");
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
memset(c, 0, sizeof(*c)); memset(c, 0, sizeof(*c));
......
...@@ -179,7 +179,10 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c) ...@@ -179,7 +179,10 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c)
return -ENOMEM; return -ENOMEM;
} }
if (i2o_dma_alloc(dev, &c->out_queue, MSG_POOL_SIZE, GFP_KERNEL)) { if (i2o_dma_alloc
(dev, &c->out_queue,
I2O_MAX_OUTBOUND_MSG_FRAMES * I2O_OUTBOUND_MSG_FRAME_SIZE *
sizeof(u32), GFP_KERNEL)) {
i2o_pci_free(c); i2o_pci_free(c);
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -156,8 +156,8 @@ struct i2o_controller { ...@@ -156,8 +156,8 @@ struct i2o_controller {
struct pci_dev *pdev; /* PCI device */ struct pci_dev *pdev; /* PCI device */
unsigned int promise:1; /* Promise controller */ unsigned int promise:1; /* Promise controller */
unsigned int adaptec:1; /* DPT / Adaptec controller */ unsigned int adaptec:1; /* DPT / Adaptec controller */
unsigned int raptor:1; /* split bar */ unsigned int raptor:1; /* split bar */
unsigned int no_quiesce:1; /* dont quiesce before reset */ unsigned int no_quiesce:1; /* dont quiesce before reset */
unsigned int short_req:1; /* use small block sizes */ unsigned int short_req:1; /* use small block sizes */
...@@ -174,7 +174,7 @@ struct i2o_controller { ...@@ -174,7 +174,7 @@ struct i2o_controller {
/* Dynamic LCT related data */ /* Dynamic LCT related data */
struct i2o_dma status; /* status of IOP */ struct i2o_dma status; /* IOP status block */
struct i2o_dma hrt; /* HW Resource Table */ struct i2o_dma hrt; /* HW Resource Table */
i2o_lct *lct; /* Logical Config Table */ i2o_lct *lct; /* Logical Config Table */
...@@ -186,7 +186,7 @@ struct i2o_controller { ...@@ -186,7 +186,7 @@ struct i2o_controller {
struct i2o_io in_queue; /* inbound message queue Host->IOP */ struct i2o_io in_queue; /* inbound message queue Host->IOP */
struct i2o_dma out_queue; /* outbound message queue IOP->Host */ struct i2o_dma out_queue; /* outbound message queue IOP->Host */
unsigned int battery:1; /* Has a battery backup */ unsigned int battery:1; /* Has a battery backup */
unsigned int io_alloc:1; /* An I/O resource was allocated */ unsigned int io_alloc:1; /* An I/O resource was allocated */
unsigned int mem_alloc:1; /* A memory resource was allocated */ unsigned int mem_alloc:1; /* A memory resource was allocated */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册