Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 6 Jul 2009 21:03:44 +0000 (14:03 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 6 Jul 2009 21:03:44 +0000 (14:03 -0700)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
  ieee1394: sbp2: add support for disks >2 TB (and 16 bytes long CDBs)
  firewire: sbp2: add support for disks >2 TB (and 16 bytes long CDBs)
  firewire: core: do not DMA-map stack addresses

1  2 
drivers/firewire/sbp2.c
drivers/ieee1394/sbp2.c

diff --combined drivers/firewire/sbp2.c
index 24c45635376a746ba9ae3e69ef53cfa7da1ab514,d27cb058da82eda9ad7bf3e9e5e0ba6448d0adb7..8d51568ee14344ee1e9e4ac11f690ae7a2c1d6a2
@@@ -200,6 -200,12 +200,12 @@@ static struct fw_device *target_device(
  #define SBP2_RETRY_LIMIT              0xf             /* 15 retries */
  #define SBP2_CYCLE_LIMIT              (0xc8 << 12)    /* 200 125us cycles */
  
+ /*
+  * There is no transport protocol limit to the CDB length,  but we implement
+  * a fixed length only.  16 bytes is enough for disks larger than 2 TB.
+  */
+ #define SBP2_MAX_CDB_SIZE             16
  /*
   * The default maximum s/g segment size of a FireWire controller is
   * usually 0x10000, but SBP-2 only allows 0xffff. Since buffers have to
@@@ -312,7 -318,7 +318,7 @@@ struct sbp2_command_orb 
                struct sbp2_pointer next;
                struct sbp2_pointer data_descriptor;
                __be32 misc;
-               u8 command_block[12];
+               u8 command_block[SBP2_MAX_CDB_SIZE];
        } request;
        struct scsi_cmnd *cmd;
        scsi_done_fn_t done;
@@@ -1136,7 -1142,7 +1142,7 @@@ static int sbp2_probe(struct device *de
                return -ENOMEM;
  
        tgt = (struct sbp2_target *)shost->hostdata;
 -      unit->device.driver_data = tgt;
 +      dev_set_drvdata(&unit->device, tgt);
        tgt->unit = unit;
        kref_init(&tgt->kref);
        INIT_LIST_HEAD(&tgt->lu_list);
        if (fw_device_enable_phys_dma(device) < 0)
                goto fail_shost_put;
  
+       shost->max_cmd_len = SBP2_MAX_CDB_SIZE;
        if (scsi_add_host(shost, &unit->device) < 0)
                goto fail_shost_put;
  
  static int sbp2_remove(struct device *dev)
  {
        struct fw_unit *unit = fw_unit(dev);
 -      struct sbp2_target *tgt = unit->device.driver_data;
 +      struct sbp2_target *tgt = dev_get_drvdata(&unit->device);
  
        sbp2_target_put(tgt);
        return 0;
@@@ -1251,7 -1259,7 +1259,7 @@@ static void sbp2_reconnect(struct work_
  
  static void sbp2_update(struct fw_unit *unit)
  {
 -      struct sbp2_target *tgt = unit->device.driver_data;
 +      struct sbp2_target *tgt = dev_get_drvdata(&unit->device);
        struct sbp2_logical_unit *lu;
  
        fw_device_enable_phys_dma(fw_parent_device(unit));
diff --combined drivers/ieee1394/sbp2.c
index 83b734aec923f795a5e4d79dcc162e68f5efaf5d,f599f493473946561f6a96aae546a6d8b92619b4..52b25f8b111d73fad2b4e6b1252b823854190ec2
@@@ -718,7 -718,7 +718,7 @@@ static int sbp2_remove(struct device *d
        struct scsi_device *sdev;
  
        ud = container_of(dev, struct unit_directory, device);
 -      lu = ud->device.driver_data;
 +      lu = dev_get_drvdata(&ud->device);
        if (!lu)
                return 0;
  
  
  static int sbp2_update(struct unit_directory *ud)
  {
 -      struct sbp2_lu *lu = ud->device.driver_data;
 +      struct sbp2_lu *lu = dev_get_drvdata(&ud->device);
  
        if (sbp2_reconnect_device(lu) != 0) {
                /*
@@@ -815,7 -815,7 +815,7 @@@ static struct sbp2_lu *sbp2_alloc_devic
        atomic_set(&lu->state, SBP2LU_STATE_RUNNING);
        INIT_WORK(&lu->protocol_work, NULL);
  
 -      ud->device.driver_data = lu;
 +      dev_set_drvdata(&ud->device, lu);
  
        hi = hpsb_get_hostinfo(&sbp2_highlevel, ud->ne->host);
        if (!hi) {
        }
  
        shost->hostdata[0] = (unsigned long)lu;
+       shost->max_cmd_len = SBP2_MAX_CDB_SIZE;
  
        if (!scsi_add_host(shost, &ud->device)) {
                lu->shost = shost;
@@@ -1051,7 -1052,7 +1052,7 @@@ static void sbp2_remove_device(struct s
                hpsb_unregister_addrspace(&sbp2_highlevel, hi->host,
                                          lu->status_fifo_addr);
  
 -      lu->ud->device.driver_data = NULL;
 +      dev_set_drvdata(&lu->ud->device, NULL);
  
        module_put(hi->host->driver->owner);
  no_hi: