Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
Browse files Browse the repository at this point in the history
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (60 commits)
  [SCSI] libsas: make ATA functions selectable by a config option
  [SCSI] bsg: unexport sg v3 helper functions
  [SCSI] bsg: fix bsg_unregister_queue
  [SCSI] bsg: make class backlinks
  [SCSI] 3w-9xxx: add support for 9690SA
  [SCSI] bsg: fix bsg_register_queue error path
  [SCSI] ESP: Increase ESP_BUS_TIMEOUT to 275.
  [SCSI] libsas: fix scr_read/write users and update the libata documentation
  [SCSI] mpt fusion: update Kconfig help
  [SCSI] scsi_transport_sas: add destructor for bsg
  [SCSI] iscsi_tcp: buggered kmalloc()
  [SCSI] qla2xxx: Update version number to 8.02.00-k2.
  [SCSI] qla2xxx: Add ISP25XX support.
  [SCSI] qla2xxx: Use pci_try_set_mwi().
  [SCSI] qla2xxx: Use PCI-X/PCI-Express read control interfaces.
  [SCSI] qla2xxx: Re-factor isp_operations to static structures.
  [SCSI] qla2xxx: Validate mid-layer 'underflow' during check-condition handling.
  [SCSI] qla2xxx: Correct setting of 'current' and 'supported' speeds during FDMI registration.
  [SCSI] qla2xxx: Generalize iIDMA support.
  [SCSI] qla2xxx: Generalize FW-Interface-2 support.
  ...
  • Loading branch information
Linus Torvalds committed Jul 22, 2007
2 parents 7578634 + b914217 commit e6f194d
Show file tree
Hide file tree
Showing 73 changed files with 3,661 additions and 1,307 deletions.
5 changes: 3 additions & 2 deletions Documentation/DocBook/libata.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,9 @@ void (*irq_clear) (struct ata_port *);

<sect2><title>SATA phy read/write</title>
<programlisting>
u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg);
void (*scr_write) (struct ata_port *ap, unsigned int sc_reg,
int (*scr_read) (struct ata_port *ap, unsigned int sc_reg,
u32 *val);
int (*scr_write) (struct ata_port *ap, unsigned int sc_reg,
u32 val);
</programlisting>

Expand Down
2 changes: 1 addition & 1 deletion block/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ endif # BLOCK

config BLK_DEV_BSG
bool "Block layer SG support v4 (EXPERIMENTAL)"
depends on (SCSI=y) && EXPERIMENTAL
depends on EXPERIMENTAL
---help---
Saying Y here will enable generic SG (SCSI generic) v4 support
for any block device.
Expand Down
61 changes: 23 additions & 38 deletions block/bsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,24 +932,34 @@ void bsg_unregister_queue(struct request_queue *q)
{
struct bsg_class_device *bcd = &q->bsg_dev;

WARN_ON(!bcd->class_dev);
if (!bcd->class_dev)
return;

mutex_lock(&bsg_mutex);
sysfs_remove_link(&q->kobj, "bsg");
class_device_destroy(bsg_class, MKDEV(bsg_major, bcd->minor));
class_device_unregister(bcd->class_dev);
put_device(bcd->dev);
bcd->class_dev = NULL;
bcd->dev = NULL;
list_del_init(&bcd->list);
bsg_device_nr--;
mutex_unlock(&bsg_mutex);
}
EXPORT_SYMBOL_GPL(bsg_unregister_queue);

int bsg_register_queue(struct request_queue *q, const char *name)
int bsg_register_queue(struct request_queue *q, struct device *gdev,
const char *name)
{
struct bsg_class_device *bcd, *__bcd;
dev_t dev;
int ret = -EMFILE;
struct class_device *class_dev = NULL;
const char *devname;

if (name)
devname = name;
else
devname = gdev->bus_id;

/*
* we need a proper transport to send commands, not a stacked device
Expand Down Expand Up @@ -982,56 +992,38 @@ int bsg_register_queue(struct request_queue *q, const char *name)
bsg_minor_idx = 0;

bcd->queue = q;
bcd->dev = get_device(gdev);
dev = MKDEV(bsg_major, bcd->minor);
class_dev = class_device_create(bsg_class, NULL, dev, bcd->dev, "%s", name);
class_dev = class_device_create(bsg_class, NULL, dev, gdev, "%s",
devname);
if (IS_ERR(class_dev)) {
ret = PTR_ERR(class_dev);
goto err;
goto err_put;
}
bcd->class_dev = class_dev;

if (q->kobj.sd) {
ret = sysfs_create_link(&q->kobj, &bcd->class_dev->kobj, "bsg");
if (ret)
goto err;
goto err_unregister;
}

list_add_tail(&bcd->list, &bsg_class_list);
bsg_device_nr++;

mutex_unlock(&bsg_mutex);
return 0;

err_unregister:
class_device_unregister(class_dev);
err_put:
put_device(gdev);
err:
if (class_dev)
class_device_destroy(bsg_class, MKDEV(bsg_major, bcd->minor));
mutex_unlock(&bsg_mutex);
return ret;
}
EXPORT_SYMBOL_GPL(bsg_register_queue);

static int bsg_add(struct class_device *cl_dev, struct class_interface *cl_intf)
{
int ret;
struct scsi_device *sdp = to_scsi_device(cl_dev->dev);
struct request_queue *rq = sdp->request_queue;

if (rq->kobj.parent)
ret = bsg_register_queue(rq, kobject_name(rq->kobj.parent));
else
ret = bsg_register_queue(rq, kobject_name(&sdp->sdev_gendev.kobj));
return ret;
}

static void bsg_remove(struct class_device *cl_dev, struct class_interface *cl_intf)
{
bsg_unregister_queue(to_scsi_device(cl_dev->dev)->request_queue);
}

static struct class_interface bsg_intf = {
.add = bsg_add,
.remove = bsg_remove,
};

static struct cdev bsg_cdev = {
.kobj = {.name = "bsg", },
.owner = THIS_MODULE,
Expand Down Expand Up @@ -1069,16 +1061,9 @@ static int __init bsg_init(void)
if (ret)
goto unregister_chrdev;

ret = scsi_register_interface(&bsg_intf);
if (ret)
goto remove_cdev;

printk(KERN_INFO BSG_DESCRIPTION " version " BSG_VERSION
" loaded (major %d)\n", bsg_major);
return 0;
remove_cdev:
printk(KERN_ERR "bsg: failed register scsi interface %d\n", ret);
cdev_del(&bsg_cdev);
unregister_chrdev:
unregister_chrdev_region(MKDEV(bsg_major, 0), BSG_MAX_DEVS);
destroy_bsg_class:
Expand Down
13 changes: 5 additions & 8 deletions block/scsi_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ int blk_verify_command(unsigned char *cmd, int has_write_perm)
}
EXPORT_SYMBOL_GPL(blk_verify_command);

int blk_fill_sghdr_rq(request_queue_t *q, struct request *rq,
struct sg_io_hdr *hdr, int has_write_perm)
static int blk_fill_sghdr_rq(request_queue_t *q, struct request *rq,
struct sg_io_hdr *hdr, int has_write_perm)
{
memset(rq->cmd, 0, BLK_MAX_CDB); /* ATAPI hates garbage after CDB */

Expand All @@ -238,22 +238,20 @@ int blk_fill_sghdr_rq(request_queue_t *q, struct request *rq,

return 0;
}
EXPORT_SYMBOL_GPL(blk_fill_sghdr_rq);

/*
* unmap a request that was previously mapped to this sg_io_hdr. handles
* both sg and non-sg sg_io_hdr.
*/
int blk_unmap_sghdr_rq(struct request *rq, struct sg_io_hdr *hdr)
static int blk_unmap_sghdr_rq(struct request *rq, struct sg_io_hdr *hdr)
{
blk_rq_unmap_user(rq->bio);
blk_put_request(rq);
return 0;
}
EXPORT_SYMBOL_GPL(blk_unmap_sghdr_rq);

int blk_complete_sghdr_rq(struct request *rq, struct sg_io_hdr *hdr,
struct bio *bio)
static int blk_complete_sghdr_rq(struct request *rq, struct sg_io_hdr *hdr,
struct bio *bio)
{
int r, ret = 0;

Expand Down Expand Up @@ -287,7 +285,6 @@ int blk_complete_sghdr_rq(struct request *rq, struct sg_io_hdr *hdr,

return r;
}
EXPORT_SYMBOL_GPL(blk_complete_sghdr_rq);

static int sg_io(struct file *file, request_queue_t *q,
struct gendisk *bd_disk, struct sg_io_hdr *hdr)
Expand Down
2 changes: 1 addition & 1 deletion drivers/firewire/fw-sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,7 @@ static struct device_attribute *sbp2_scsi_sysfs_attrs[] = {
static struct scsi_host_template scsi_driver_template = {
.module = THIS_MODULE,
.name = "SBP-2 IEEE-1394",
.proc_name = (char *)sbp2_driver_name,
.proc_name = sbp2_driver_name,
.queuecommand = sbp2_scsi_queuecommand,
.slave_alloc = sbp2_scsi_slave_alloc,
.slave_configure = sbp2_scsi_slave_configure,
Expand Down
1 change: 1 addition & 0 deletions drivers/message/fusion/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ config FUSION_FC
LSIFC929
LSIFC929X
LSIFC929XL
Brocade FC 410/420

config FUSION_SAS
tristate "Fusion MPT ScsiHost drivers for SAS"
Expand Down
Loading

0 comments on commit e6f194d

Please sign in to comment.