diff options
author | Luben Tuikov <ltuikov@yahoo.com> | 2011-09-22 12:41:36 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-10-02 13:23:11 -0400 |
commit | ffaac8f45bfb2dffb78179baa5740de34058eef8 (patch) | |
tree | 653f9eae24129d54ce4df0a67bc883ed16d93dac | |
parent | 41e9a69641fb3fa86fa9277a179f3ad261d072f7 (diff) |
[SCSI] libsas: Allow expander T-T attachments
Allow expander table-to-table attachments for
expanders that support it.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/libsas/sas_expander.c | 20 | ||||
-rw-r--r-- | include/scsi/libsas.h | 3 | ||||
-rw-r--r-- | include/scsi/sas.h | 14 |
3 files changed, 29 insertions, 8 deletions
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index f84084bba2f0..e8d0115a025a 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c | |||
@@ -329,6 +329,7 @@ static void ex_assign_report_general(struct domain_device *dev, | |||
329 | dev->ex_dev.ex_change_count = be16_to_cpu(rg->change_count); | 329 | dev->ex_dev.ex_change_count = be16_to_cpu(rg->change_count); |
330 | dev->ex_dev.max_route_indexes = be16_to_cpu(rg->route_indexes); | 330 | dev->ex_dev.max_route_indexes = be16_to_cpu(rg->route_indexes); |
331 | dev->ex_dev.num_phys = min(rg->num_phys, (u8)MAX_EXPANDER_PHYS); | 331 | dev->ex_dev.num_phys = min(rg->num_phys, (u8)MAX_EXPANDER_PHYS); |
332 | dev->ex_dev.t2t_supp = rg->t2t_supp; | ||
332 | dev->ex_dev.conf_route_table = rg->conf_route_table; | 333 | dev->ex_dev.conf_route_table = rg->conf_route_table; |
333 | dev->ex_dev.configuring = rg->configuring; | 334 | dev->ex_dev.configuring = rg->configuring; |
334 | memcpy(dev->ex_dev.enclosure_logical_id, rg->enclosure_logical_id, 8); | 335 | memcpy(dev->ex_dev.enclosure_logical_id, rg->enclosure_logical_id, 8); |
@@ -1133,15 +1134,17 @@ static void sas_print_parent_topology_bug(struct domain_device *child, | |||
1133 | }; | 1134 | }; |
1134 | struct domain_device *parent = child->parent; | 1135 | struct domain_device *parent = child->parent; |
1135 | 1136 | ||
1136 | sas_printk("%s ex %016llx phy 0x%x <--> %s ex %016llx phy 0x%x " | 1137 | sas_printk("%s ex %016llx (T2T supp:%d) phy 0x%x <--> %s ex %016llx " |
1137 | "has %c:%c routing link!\n", | 1138 | "(T2T supp:%d) phy 0x%x has %c:%c routing link!\n", |
1138 | 1139 | ||
1139 | ex_type[parent->dev_type], | 1140 | ex_type[parent->dev_type], |
1140 | SAS_ADDR(parent->sas_addr), | 1141 | SAS_ADDR(parent->sas_addr), |
1142 | parent->ex_dev.t2t_supp, | ||
1141 | parent_phy->phy_id, | 1143 | parent_phy->phy_id, |
1142 | 1144 | ||
1143 | ex_type[child->dev_type], | 1145 | ex_type[child->dev_type], |
1144 | SAS_ADDR(child->sas_addr), | 1146 | SAS_ADDR(child->sas_addr), |
1147 | child->ex_dev.t2t_supp, | ||
1145 | child_phy->phy_id, | 1148 | child_phy->phy_id, |
1146 | 1149 | ||
1147 | ra_char[parent_phy->routing_attr], | 1150 | ra_char[parent_phy->routing_attr], |
@@ -1238,10 +1241,15 @@ static int sas_check_parent_topology(struct domain_device *child) | |||
1238 | sas_print_parent_topology_bug(child, parent_phy, child_phy); | 1241 | sas_print_parent_topology_bug(child, parent_phy, child_phy); |
1239 | res = -ENODEV; | 1242 | res = -ENODEV; |
1240 | } | 1243 | } |
1241 | } else if (parent_phy->routing_attr == TABLE_ROUTING && | 1244 | } else if (parent_phy->routing_attr == TABLE_ROUTING) { |
1242 | child_phy->routing_attr != SUBTRACTIVE_ROUTING) { | 1245 | if (child_phy->routing_attr == SUBTRACTIVE_ROUTING || |
1243 | sas_print_parent_topology_bug(child, parent_phy, child_phy); | 1246 | (child_phy->routing_attr == TABLE_ROUTING && |
1244 | res = -ENODEV; | 1247 | child_ex->t2t_supp && parent_ex->t2t_supp)) { |
1248 | /* All good */; | ||
1249 | } else { | ||
1250 | sas_print_parent_topology_bug(child, parent_phy, child_phy); | ||
1251 | res = -ENODEV; | ||
1252 | } | ||
1245 | } | 1253 | } |
1246 | break; | 1254 | break; |
1247 | case FANOUT_DEV: | 1255 | case FANOUT_DEV: |
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index af0a1deac930..ac9d80c93c68 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h | |||
@@ -142,8 +142,11 @@ struct expander_device { | |||
142 | u16 ex_change_count; | 142 | u16 ex_change_count; |
143 | u16 max_route_indexes; | 143 | u16 max_route_indexes; |
144 | u8 num_phys; | 144 | u8 num_phys; |
145 | |||
146 | u8 t2t_supp:1; | ||
145 | u8 configuring:1; | 147 | u8 configuring:1; |
146 | u8 conf_route_table:1; | 148 | u8 conf_route_table:1; |
149 | |||
147 | u8 enclosure_logical_id[8]; | 150 | u8 enclosure_logical_id[8]; |
148 | 151 | ||
149 | struct ex_phy *ex_phy; | 152 | struct ex_phy *ex_phy; |
diff --git a/include/scsi/sas.h b/include/scsi/sas.h index a3001add0c66..07d504f3981c 100644 --- a/include/scsi/sas.h +++ b/include/scsi/sas.h | |||
@@ -349,7 +349,12 @@ struct report_general_resp { | |||
349 | 349 | ||
350 | u8 conf_route_table:1; | 350 | u8 conf_route_table:1; |
351 | u8 configuring:1; | 351 | u8 configuring:1; |
352 | u8 _r_b:6; | 352 | u8 config_others:1; |
353 | u8 orej_retry_supp:1; | ||
354 | u8 stp_cont_awt:1; | ||
355 | u8 self_config:1; | ||
356 | u8 zone_config:1; | ||
357 | u8 t2t_supp:1; | ||
353 | 358 | ||
354 | u8 _r_c; | 359 | u8 _r_c; |
355 | 360 | ||
@@ -536,7 +541,12 @@ struct report_general_resp { | |||
536 | u8 _r_a; | 541 | u8 _r_a; |
537 | u8 num_phys; | 542 | u8 num_phys; |
538 | 543 | ||
539 | u8 _r_b:6; | 544 | u8 t2t_supp:1; |
545 | u8 zone_config:1; | ||
546 | u8 self_config:1; | ||
547 | u8 stp_cont_awt:1; | ||
548 | u8 orej_retry_supp:1; | ||
549 | u8 config_others:1; | ||
540 | u8 configuring:1; | 550 | u8 configuring:1; |
541 | u8 conf_route_table:1; | 551 | u8 conf_route_table:1; |
542 | 552 | ||