diff options
Diffstat (limited to 'drivers/message/i2o')
-rw-r--r-- | drivers/message/i2o/Kconfig | 22 | ||||
-rw-r--r-- | drivers/message/i2o/device.c | 18 | ||||
-rw-r--r-- | drivers/message/i2o/exec-osm.c | 4 | ||||
-rw-r--r-- | drivers/message/i2o/i2o_scsi.c | 24 | ||||
-rw-r--r-- | drivers/message/i2o/iop.c | 2 |
5 files changed, 27 insertions, 43 deletions
diff --git a/drivers/message/i2o/Kconfig b/drivers/message/i2o/Kconfig index f4ac21e5771e..5afa0e393ecf 100644 --- a/drivers/message/i2o/Kconfig +++ b/drivers/message/i2o/Kconfig @@ -1,9 +1,6 @@ -menu "I2O device support" - depends on PCI - -config I2O - tristate "I2O support" +menuconfig I2O + tristate "I2O device support" depends on PCI ---help--- The Intelligent Input/Output (I2O) architecture allows hardware @@ -25,9 +22,10 @@ config I2O If unsure, say N. +if I2O + config I2O_LCT_NOTIFY_ON_CHANGES bool "Enable LCT notification" - depends on I2O default y ---help--- Only say N here if you have a I2O controller from SUN. The SUN @@ -39,7 +37,6 @@ config I2O_LCT_NOTIFY_ON_CHANGES config I2O_EXT_ADAPTEC bool "Enable Adaptec extensions" - depends on I2O default y ---help--- Say Y for support of raidutils for Adaptec I2O controllers. You also @@ -57,7 +54,7 @@ config I2O_EXT_ADAPTEC_DMA64 config I2O_CONFIG tristate "I2O Configuration support" - depends on I2O + depends on VIRT_TO_BUS ---help--- 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 @@ -78,7 +75,6 @@ config I2O_CONFIG_OLD_IOCTL config I2O_BUS tristate "I2O Bus Adapter OSM" - depends on I2O ---help--- Include support for the I2O Bus Adapter OSM. The Bus Adapter OSM provides access to the busses on the I2O controller. The main purpose @@ -89,7 +85,7 @@ config I2O_BUS config I2O_BLOCK tristate "I2O Block OSM" - depends on I2O && BLOCK + depends on BLOCK ---help--- Include support for the I2O Block OSM. The Block OSM presents disk and other structured block devices to the operating system. If you @@ -102,7 +98,7 @@ config I2O_BLOCK config I2O_SCSI tristate "I2O SCSI OSM" - depends on I2O && SCSI + depends on SCSI ---help--- 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 @@ -114,7 +110,6 @@ config I2O_SCSI config I2O_PROC tristate "I2O /proc support" - depends on I2O ---help--- If you say Y here and to "/proc file system support", you will be able to read I2O related information from the virtual directory @@ -123,5 +118,4 @@ config I2O_PROC To compile this support as a module, choose M here: the module will be called i2o_proc. -endmenu - +endif # I2O diff --git a/drivers/message/i2o/device.c b/drivers/message/i2o/device.c index b9df143e4ff1..489d7c5c4965 100644 --- a/drivers/message/i2o/device.c +++ b/drivers/message/i2o/device.c @@ -62,7 +62,7 @@ int i2o_device_claim(struct i2o_device *dev) { int rc = 0; - down(&dev->lock); + mutex_lock(&dev->lock); rc = i2o_device_issue_claim(dev, I2O_CMD_UTIL_CLAIM, I2O_CLAIM_PRIMARY); if (!rc) @@ -72,7 +72,7 @@ int i2o_device_claim(struct i2o_device *dev) pr_debug("i2o: claim of device %d failed %d\n", dev->lct_data.tid, rc); - up(&dev->lock); + mutex_unlock(&dev->lock); return rc; } @@ -96,7 +96,7 @@ int i2o_device_claim_release(struct i2o_device *dev) int tries; int rc = 0; - down(&dev->lock); + mutex_lock(&dev->lock); /* * If the controller takes a nonblocking approach to @@ -118,7 +118,7 @@ int i2o_device_claim_release(struct i2o_device *dev) pr_debug("i2o: claim release of device %d failed %d\n", dev->lct_data.tid, rc); - up(&dev->lock); + mutex_unlock(&dev->lock); return rc; } @@ -198,7 +198,7 @@ static struct i2o_device *i2o_device_alloc(void) return ERR_PTR(-ENOMEM); INIT_LIST_HEAD(&dev->list); - init_MUTEX(&dev->lock); + mutex_init(&dev->lock); dev->device.bus = &i2o_bus_type; dev->device.release = &i2o_device_release; @@ -326,7 +326,7 @@ int i2o_device_parse_lct(struct i2o_controller *c) u16 table_size; u32 buf; - down(&c->lct_lock); + mutex_lock(&c->lct_lock); kfree(c->lct); @@ -335,7 +335,7 @@ int i2o_device_parse_lct(struct i2o_controller *c) lct = c->lct = kmalloc(table_size * 4, GFP_KERNEL); if (!lct) { - up(&c->lct_lock); + mutex_unlock(&c->lct_lock); return -ENOMEM; } @@ -408,7 +408,7 @@ int i2o_device_parse_lct(struct i2o_controller *c) i2o_device_remove(dev); } - up(&c->lct_lock); + mutex_unlock(&c->lct_lock); return 0; } @@ -485,7 +485,7 @@ int i2o_parm_field_get(struct i2o_device *i2o_dev, int group, int field, u8 *resblk; /* 8 bytes for header */ int rc; - resblk = kmalloc(buflen + 8, GFP_KERNEL | GFP_ATOMIC); + resblk = kmalloc(buflen + 8, GFP_KERNEL); if (!resblk) return -ENOMEM; diff --git a/drivers/message/i2o/exec-osm.c b/drivers/message/i2o/exec-osm.c index 5278aad92bc4..c13b9321e7ab 100644 --- a/drivers/message/i2o/exec-osm.c +++ b/drivers/message/i2o/exec-osm.c @@ -537,7 +537,7 @@ static int i2o_exec_lct_notify(struct i2o_controller *c, u32 change_ind) struct device *dev; struct i2o_message *msg; - down(&c->lct_lock); + mutex_lock(&c->lct_lock); dev = &c->pdev->dev; @@ -561,7 +561,7 @@ static int i2o_exec_lct_notify(struct i2o_controller *c, u32 change_ind) i2o_msg_post(c, msg); - up(&c->lct_lock); + mutex_unlock(&c->lct_lock); return 0; }; diff --git a/drivers/message/i2o/i2o_scsi.c b/drivers/message/i2o/i2o_scsi.c index 1045c8a518bb..aa6fb9429d58 100644 --- a/drivers/message/i2o/i2o_scsi.c +++ b/drivers/message/i2o/i2o_scsi.c @@ -377,12 +377,8 @@ static int i2o_scsi_reply(struct i2o_controller *c, u32 m, osm_err("SCSI error %08x\n", error); dev = &c->pdev->dev; - if (cmd->use_sg) - dma_unmap_sg(dev, cmd->request_buffer, cmd->use_sg, - cmd->sc_data_direction); - else if (cmd->SCp.dma_handle) - dma_unmap_single(dev, cmd->SCp.dma_handle, cmd->request_bufflen, - cmd->sc_data_direction); + + scsi_dma_unmap(cmd); cmd->scsi_done(cmd); @@ -664,21 +660,15 @@ static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt, if (sgl_offset != SGL_OFFSET_0) { /* write size of data addressed by SGL */ - *mptr++ = cpu_to_le32(SCpnt->request_bufflen); + *mptr++ = cpu_to_le32(scsi_bufflen(SCpnt)); /* Now fill in the SGList and command */ - if (SCpnt->use_sg) { - if (!i2o_dma_map_sg(c, SCpnt->request_buffer, - SCpnt->use_sg, + + if (scsi_sg_count(SCpnt)) { + if (!i2o_dma_map_sg(c, scsi_sglist(SCpnt), + scsi_sg_count(SCpnt), SCpnt->sc_data_direction, &mptr)) goto nomem; - } else { - SCpnt->SCp.dma_handle = - i2o_dma_map_single(c, SCpnt->request_buffer, - SCpnt->request_bufflen, - SCpnt->sc_data_direction, &mptr); - if (dma_mapping_error(SCpnt->SCp.dma_handle)) - goto nomem; } } diff --git a/drivers/message/i2o/iop.c b/drivers/message/i2o/iop.c index 3305c12372a2..a1ec16a075c6 100644 --- a/drivers/message/i2o/iop.c +++ b/drivers/message/i2o/iop.c @@ -1067,7 +1067,7 @@ struct i2o_controller *i2o_iop_alloc(void) INIT_LIST_HEAD(&c->devices); spin_lock_init(&c->lock); - init_MUTEX(&c->lct_lock); + mutex_init(&c->lct_lock); device_initialize(&c->device); |