[SCSI] libsas: Allow expander T-T attachments
authorLuben Tuikov <ltuikov@yahoo.com>
Thu, 22 Sep 2011 16:41:36 +0000 (09:41 -0700)
committerJames Bottomley <JBottomley@Parallels.com>
Sun, 2 Oct 2011 17:23:11 +0000 (12:23 -0500)
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>
drivers/scsi/libsas/sas_expander.c
include/scsi/libsas.h
include/scsi/sas.h

index f84084bba2f0ea19f19b5f073120fc8ff34612d0..e8d0115a025a31b628f37a4e5dcedd870f38ecfb 100644 (file)
@@ -329,6 +329,7 @@ static void ex_assign_report_general(struct domain_device *dev,
        dev->ex_dev.ex_change_count = be16_to_cpu(rg->change_count);
        dev->ex_dev.max_route_indexes = be16_to_cpu(rg->route_indexes);
        dev->ex_dev.num_phys = min(rg->num_phys, (u8)MAX_EXPANDER_PHYS);
+       dev->ex_dev.t2t_supp = rg->t2t_supp;
        dev->ex_dev.conf_route_table = rg->conf_route_table;
        dev->ex_dev.configuring = rg->configuring;
        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,
        };
        struct domain_device *parent = child->parent;
 
-       sas_printk("%s ex %016llx phy 0x%x <--> %s ex %016llx phy 0x%x "
-                  "has %c:%c routing link!\n",
+       sas_printk("%s ex %016llx (T2T supp:%d) phy 0x%x <--> %s ex %016llx "
+                  "(T2T supp:%d) phy 0x%x has %c:%c routing link!\n",
 
                   ex_type[parent->dev_type],
                   SAS_ADDR(parent->sas_addr),
+                  parent->ex_dev.t2t_supp,
                   parent_phy->phy_id,
 
                   ex_type[child->dev_type],
                   SAS_ADDR(child->sas_addr),
+                  child->ex_dev.t2t_supp,
                   child_phy->phy_id,
 
                   ra_char[parent_phy->routing_attr],
@@ -1238,10 +1241,15 @@ static int sas_check_parent_topology(struct domain_device *child)
                                        sas_print_parent_topology_bug(child, parent_phy, child_phy);
                                        res = -ENODEV;
                                }
-                       } else if (parent_phy->routing_attr == TABLE_ROUTING &&
-                                  child_phy->routing_attr != SUBTRACTIVE_ROUTING) {
-                               sas_print_parent_topology_bug(child, parent_phy, child_phy);
-                               res = -ENODEV;
+                       } else if (parent_phy->routing_attr == TABLE_ROUTING) {
+                               if (child_phy->routing_attr == SUBTRACTIVE_ROUTING ||
+                                   (child_phy->routing_attr == TABLE_ROUTING &&
+                                    child_ex->t2t_supp && parent_ex->t2t_supp)) {
+                                       /* All good */;
+                               } else {
+                                       sas_print_parent_topology_bug(child, parent_phy, child_phy);
+                                       res = -ENODEV;
+                               }
                        }
                        break;
                case FANOUT_DEV:
index af0a1deac9301fd5766546bcea595bb1ce93ad58..ac9d80c93c68af6731e2088e58d268356946085e 100644 (file)
@@ -142,8 +142,11 @@ struct expander_device {
        u16    ex_change_count;
        u16    max_route_indexes;
        u8     num_phys;
+
+       u8     t2t_supp:1;
        u8     configuring:1;
        u8     conf_route_table:1;
+
        u8     enclosure_logical_id[8];
 
        struct ex_phy *ex_phy;
index a3001add0c662fe514f6e2094957b0d381feabfa..07d504f3981ce5603b9b061fa12bf451139f48dc 100644 (file)
@@ -349,7 +349,12 @@ struct report_general_resp {
 
        u8      conf_route_table:1;
        u8      configuring:1;
-       u8      _r_b:6;
+       u8      config_others:1;
+       u8      orej_retry_supp:1;
+       u8      stp_cont_awt:1;
+       u8      self_config:1;
+       u8      zone_config:1;
+       u8      t2t_supp:1;
 
        u8      _r_c;
 
@@ -536,7 +541,12 @@ struct report_general_resp {
        u8      _r_a;
        u8      num_phys;
 
-       u8      _r_b:6;
+       u8      t2t_supp:1;
+       u8      zone_config:1;
+       u8      self_config:1;
+       u8      stp_cont_awt:1;
+       u8      orej_retry_supp:1;
+       u8      config_others:1;
        u8      configuring:1;
        u8      conf_route_table:1;
 
This page took 0.027903 seconds and 5 git commands to generate.