aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/device_handler
diff options
context:
space:
mode:
authorMoger, Babu <Babu.Moger@netapp.com>2011-12-01 15:01:28 -0500
committerJames Bottomley <JBottomley@Parallels.com>2011-12-15 01:55:00 -0500
commita315969e8d699682adf449813de84b7f2358f64d (patch)
treea6d5fc463e3bcafab96a32df7d93cb4923d9d5e4 /drivers/scsi/device_handler
parent4f10143f6e8cd62460920211e1b24b0915d0ab00 (diff)
[SCSI] scsi_dh_hp_sw: Adding the match function for hp_sw device handler
This patch introduces the match function for hp_sw device handler. Included the check for TPGS bit before proceeding further per Hannes comment. The match function was introduced by commit 6c3633d08acf514e2e89aa95d2346ce9d64d719a Signed-off-by: Babu Moger <babu.moger@netapp.com> Acked-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/device_handler')
-rw-r--r--drivers/scsi/device_handler/scsi_dh_hp_sw.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/scsi/device_handler/scsi_dh_hp_sw.c b/drivers/scsi/device_handler/scsi_dh_hp_sw.c
index 0f86a18b157d..084062bb8ee9 100644
--- a/drivers/scsi/device_handler/scsi_dh_hp_sw.c
+++ b/drivers/scsi/device_handler/scsi_dh_hp_sw.c
@@ -320,6 +320,24 @@ static const struct scsi_dh_devlist hp_sw_dh_data_list[] = {
320 {NULL, NULL}, 320 {NULL, NULL},
321}; 321};
322 322
323static bool hp_sw_match(struct scsi_device *sdev)
324{
325 int i;
326
327 if (scsi_device_tpgs(sdev))
328 return false;
329
330 for (i = 0; hp_sw_dh_data_list[i].vendor; i++) {
331 if (!strncmp(sdev->vendor, hp_sw_dh_data_list[i].vendor,
332 strlen(hp_sw_dh_data_list[i].vendor)) &&
333 !strncmp(sdev->model, hp_sw_dh_data_list[i].model,
334 strlen(hp_sw_dh_data_list[i].model))) {
335 return true;
336 }
337 }
338 return false;
339}
340
323static int hp_sw_bus_attach(struct scsi_device *sdev); 341static int hp_sw_bus_attach(struct scsi_device *sdev);
324static void hp_sw_bus_detach(struct scsi_device *sdev); 342static void hp_sw_bus_detach(struct scsi_device *sdev);
325 343
@@ -331,6 +349,7 @@ static struct scsi_device_handler hp_sw_dh = {
331 .detach = hp_sw_bus_detach, 349 .detach = hp_sw_bus_detach,
332 .activate = hp_sw_activate, 350 .activate = hp_sw_activate,
333 .prep_fn = hp_sw_prep_fn, 351 .prep_fn = hp_sw_prep_fn,
352 .match = hp_sw_match,
334}; 353};
335 354
336static int hp_sw_bus_attach(struct scsi_device *sdev) 355static int hp_sw_bus_attach(struct scsi_device *sdev)