aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsas
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-18 14:25:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-18 14:25:31 -0400
commit2cca775baecbfede2fec20c99add709232311fe7 (patch)
treeb0eefe80881d263ba7976174144ae4e9cf238425 /drivers/scsi/libsas
parenteddeb0e2d863e3941d8768e70cb50c6120e61fa0 (diff)
parent94795b61e84994a3b058f92d041d1fb3d869c7d5 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (137 commits) [SCSI] iscsi: bidi support for iscsi_tcp [SCSI] iscsi: bidi support at the generic libiscsi level [SCSI] iscsi: extended cdb support [SCSI] zfcp: Fix error handling for blocked unit for send FCP command [SCSI] zfcp: Remove zfcp_erp_wait from slave destory handler to fix deadlock [SCSI] zfcp: fix 31 bit compile warnings [SCSI] bsg: no need to set BSG_F_BLOCK bit in bsg_complete_all_commands [SCSI] bsg: remove minor in struct bsg_device [SCSI] bsg: use better helper list functions [SCSI] bsg: replace kobject_get with blk_get_queue [SCSI] bsg: takes a ref to struct device in fops->open [SCSI] qla1280: remove version check [SCSI] libsas: fix endianness bug in sas_ata [SCSI] zfcp: fix compiler warning caused by poking inside new semaphore (linux-next) [SCSI] aacraid: Do not describe check_reset parameter with its value [SCSI] aacraid: Fix down_interruptible() to check the return value [SCSI] sun3_scsi_vme: add MODULE_LICENSE [SCSI] st: rename flush_write_buffer() [SCSI] tgt: use KMEM_CACHE macro [SCSI] initio: fix big endian problems for auto request sense ...
Diffstat (limited to 'drivers/scsi/libsas')
-rw-r--r--drivers/scsi/libsas/sas_ata.c2
-rw-r--r--drivers/scsi/libsas/sas_scsi_host.c41
2 files changed, 42 insertions, 1 deletions
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index a4811e4106df..744f06d04a36 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -691,7 +691,7 @@ static int sas_discover_sata_dev(struct domain_device *dev)
691 /* incomplete response */ 691 /* incomplete response */
692 SAS_DPRINTK("sending SET FEATURE/PUP_STBY_SPIN_UP to " 692 SAS_DPRINTK("sending SET FEATURE/PUP_STBY_SPIN_UP to "
693 "dev %llx\n", SAS_ADDR(dev->sas_addr)); 693 "dev %llx\n", SAS_ADDR(dev->sas_addr));
694 if (!le16_to_cpu(identify_x[83] & (1<<6))) 694 if (!(identify_x[83] & cpu_to_le16(1<<6)))
695 goto cont1; 695 goto cont1;
696 res = sas_issue_ata_cmd(dev, ATA_SET_FEATURES, 696 res = sas_issue_ata_cmd(dev, ATA_SET_FEATURES,
697 ATA_FEATURE_PUP_STBY_SPIN_UP, 697 ATA_FEATURE_PUP_STBY_SPIN_UP,
diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c
index 1f8241563c6c..601ec5b6a7f6 100644
--- a/drivers/scsi/libsas/sas_scsi_host.c
+++ b/drivers/scsi/libsas/sas_scsi_host.c
@@ -24,6 +24,8 @@
24 */ 24 */
25 25
26#include <linux/kthread.h> 26#include <linux/kthread.h>
27#include <linux/firmware.h>
28#include <linux/ctype.h>
27 29
28#include "sas_internal.h" 30#include "sas_internal.h"
29 31
@@ -1064,6 +1066,45 @@ void sas_target_destroy(struct scsi_target *starget)
1064 return; 1066 return;
1065} 1067}
1066 1068
1069static void sas_parse_addr(u8 *sas_addr, const char *p)
1070{
1071 int i;
1072 for (i = 0; i < SAS_ADDR_SIZE; i++) {
1073 u8 h, l;
1074 if (!*p)
1075 break;
1076 h = isdigit(*p) ? *p-'0' : toupper(*p)-'A'+10;
1077 p++;
1078 l = isdigit(*p) ? *p-'0' : toupper(*p)-'A'+10;
1079 p++;
1080 sas_addr[i] = (h<<4) | l;
1081 }
1082}
1083
1084#define SAS_STRING_ADDR_SIZE 16
1085
1086int sas_request_addr(struct Scsi_Host *shost, u8 *addr)
1087{
1088 int res;
1089 const struct firmware *fw;
1090
1091 res = request_firmware(&fw, "sas_addr", &shost->shost_gendev);
1092 if (res)
1093 return res;
1094
1095 if (fw->size < SAS_STRING_ADDR_SIZE) {
1096 res = -ENODEV;
1097 goto out;
1098 }
1099
1100 sas_parse_addr(addr, fw->data);
1101
1102out:
1103 release_firmware(fw);
1104 return res;
1105}
1106EXPORT_SYMBOL_GPL(sas_request_addr);
1107
1067EXPORT_SYMBOL_GPL(sas_queuecommand); 1108EXPORT_SYMBOL_GPL(sas_queuecommand);
1068EXPORT_SYMBOL_GPL(sas_target_alloc); 1109EXPORT_SYMBOL_GPL(sas_target_alloc);
1069EXPORT_SYMBOL_GPL(sas_slave_configure); 1110EXPORT_SYMBOL_GPL(sas_slave_configure);