]> Pileus Git - ~andy/linux/blobdiff - drivers/firewire/sbp2.c
Merge tag 'firewire-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee139...
[~andy/linux] / drivers / firewire / sbp2.c
index 0c92ed835e06f435d65fe9c6160cc5064df0ff90..000a29ffedaed767519f4f39ef3ca293bfeb3c5a 100644 (file)
@@ -66,7 +66,7 @@
  *
  * Concurrent logins are useful together with cluster filesystems.
  */
-static int sbp2_param_exclusive_login = 1;
+static bool sbp2_param_exclusive_login = 1;
 module_param_named(exclusive_login, sbp2_param_exclusive_login, bool, 0644);
 MODULE_PARM_DESC(exclusive_login, "Exclusive login to sbp2 device "
                 "(default = Y, use N for concurrent initiators)");
@@ -569,7 +569,7 @@ static int sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
        if (function == SBP2_LOGOUT_REQUEST && fw_device_is_shutdown(device))
                return 0;
 
-       orb = kzalloc(sizeof(*orb), GFP_ATOMIC);
+       orb = kzalloc(sizeof(*orb), GFP_NOIO);
        if (orb == NULL)
                return -ENOMEM;
 
@@ -1309,10 +1309,19 @@ static void sbp2_unmap_scatterlist(struct device *card_device,
 static unsigned int sbp2_status_to_sense_data(u8 *sbp2_status, u8 *sense_data)
 {
        int sam_status;
+       int sfmt = (sbp2_status[0] >> 6) & 0x03;
+
+       if (sfmt == 2 || sfmt == 3) {
+               /*
+                * Reserved for future standardization (2) or
+                * Status block format vendor-dependent (3)
+                */
+               return DID_ERROR << 16;
+       }
 
-       sense_data[0] = 0x70;
+       sense_data[0] = 0x70 | sfmt | (sbp2_status[1] & 0x80);
        sense_data[1] = 0x0;
-       sense_data[2] = sbp2_status[1];
+       sense_data[2] = ((sbp2_status[1] << 1) & 0xe0) | (sbp2_status[1] & 0x0f);
        sense_data[3] = sbp2_status[4];
        sense_data[4] = sbp2_status[5];
        sense_data[5] = sbp2_status[6];