diff options
Diffstat (limited to 'drivers/scsi/libsas/sas_expander.c')
-rw-r--r-- | drivers/scsi/libsas/sas_expander.c | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index f42b0e15410f..446b85110a1f 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c | |||
@@ -183,21 +183,21 @@ static char sas_route_char(struct domain_device *dev, struct ex_phy *phy) | |||
183 | } | 183 | } |
184 | } | 184 | } |
185 | 185 | ||
186 | static enum sas_dev_type to_dev_type(struct discover_resp *dr) | 186 | static enum sas_device_type to_dev_type(struct discover_resp *dr) |
187 | { | 187 | { |
188 | /* This is detecting a failure to transmit initial dev to host | 188 | /* This is detecting a failure to transmit initial dev to host |
189 | * FIS as described in section J.5 of sas-2 r16 | 189 | * FIS as described in section J.5 of sas-2 r16 |
190 | */ | 190 | */ |
191 | if (dr->attached_dev_type == NO_DEVICE && dr->attached_sata_dev && | 191 | if (dr->attached_dev_type == SAS_PHY_UNUSED && dr->attached_sata_dev && |
192 | dr->linkrate >= SAS_LINK_RATE_1_5_GBPS) | 192 | dr->linkrate >= SAS_LINK_RATE_1_5_GBPS) |
193 | return SATA_PENDING; | 193 | return SAS_SATA_PENDING; |
194 | else | 194 | else |
195 | return dr->attached_dev_type; | 195 | return dr->attached_dev_type; |
196 | } | 196 | } |
197 | 197 | ||
198 | static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) | 198 | static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) |
199 | { | 199 | { |
200 | enum sas_dev_type dev_type; | 200 | enum sas_device_type dev_type; |
201 | enum sas_linkrate linkrate; | 201 | enum sas_linkrate linkrate; |
202 | u8 sas_addr[SAS_ADDR_SIZE]; | 202 | u8 sas_addr[SAS_ADDR_SIZE]; |
203 | struct smp_resp *resp = rsp; | 203 | struct smp_resp *resp = rsp; |
@@ -238,7 +238,7 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) | |||
238 | /* Handle vacant phy - rest of dr data is not valid so skip it */ | 238 | /* Handle vacant phy - rest of dr data is not valid so skip it */ |
239 | if (phy->phy_state == PHY_VACANT) { | 239 | if (phy->phy_state == PHY_VACANT) { |
240 | memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE); | 240 | memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE); |
241 | phy->attached_dev_type = NO_DEVICE; | 241 | phy->attached_dev_type = SAS_PHY_UNUSED; |
242 | if (!test_bit(SAS_HA_ATA_EH_ACTIVE, &ha->state)) { | 242 | if (!test_bit(SAS_HA_ATA_EH_ACTIVE, &ha->state)) { |
243 | phy->phy_id = phy_id; | 243 | phy->phy_id = phy_id; |
244 | goto skip; | 244 | goto skip; |
@@ -259,7 +259,7 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) | |||
259 | /* help some expanders that fail to zero sas_address in the 'no | 259 | /* help some expanders that fail to zero sas_address in the 'no |
260 | * device' case | 260 | * device' case |
261 | */ | 261 | */ |
262 | if (phy->attached_dev_type == NO_DEVICE || | 262 | if (phy->attached_dev_type == SAS_PHY_UNUSED || |
263 | phy->linkrate < SAS_LINK_RATE_1_5_GBPS) | 263 | phy->linkrate < SAS_LINK_RATE_1_5_GBPS) |
264 | memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE); | 264 | memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE); |
265 | else | 265 | else |
@@ -292,13 +292,13 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) | |||
292 | 292 | ||
293 | out: | 293 | out: |
294 | switch (phy->attached_dev_type) { | 294 | switch (phy->attached_dev_type) { |
295 | case SATA_PENDING: | 295 | case SAS_SATA_PENDING: |
296 | type = "stp pending"; | 296 | type = "stp pending"; |
297 | break; | 297 | break; |
298 | case NO_DEVICE: | 298 | case SAS_PHY_UNUSED: |
299 | type = "no device"; | 299 | type = "no device"; |
300 | break; | 300 | break; |
301 | case SAS_END_DEV: | 301 | case SAS_END_DEVICE: |
302 | if (phy->attached_iproto) { | 302 | if (phy->attached_iproto) { |
303 | if (phy->attached_tproto) | 303 | if (phy->attached_tproto) |
304 | type = "host+target"; | 304 | type = "host+target"; |
@@ -311,8 +311,8 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) | |||
311 | type = "ssp"; | 311 | type = "ssp"; |
312 | } | 312 | } |
313 | break; | 313 | break; |
314 | case EDGE_DEV: | 314 | case SAS_EDGE_EXPANDER_DEVICE: |
315 | case FANOUT_DEV: | 315 | case SAS_FANOUT_EXPANDER_DEVICE: |
316 | type = "smp"; | 316 | type = "smp"; |
317 | break; | 317 | break; |
318 | default: | 318 | default: |
@@ -833,7 +833,7 @@ static struct domain_device *sas_ex_discover_end_dev( | |||
833 | } else | 833 | } else |
834 | #endif | 834 | #endif |
835 | if (phy->attached_tproto & SAS_PROTOCOL_SSP) { | 835 | if (phy->attached_tproto & SAS_PROTOCOL_SSP) { |
836 | child->dev_type = SAS_END_DEV; | 836 | child->dev_type = SAS_END_DEVICE; |
837 | rphy = sas_end_device_alloc(phy->port); | 837 | rphy = sas_end_device_alloc(phy->port); |
838 | /* FIXME: error handling */ | 838 | /* FIXME: error handling */ |
839 | if (unlikely(!rphy)) | 839 | if (unlikely(!rphy)) |
@@ -932,11 +932,11 @@ static struct domain_device *sas_ex_discover_expander( | |||
932 | 932 | ||
933 | 933 | ||
934 | switch (phy->attached_dev_type) { | 934 | switch (phy->attached_dev_type) { |
935 | case EDGE_DEV: | 935 | case SAS_EDGE_EXPANDER_DEVICE: |
936 | rphy = sas_expander_alloc(phy->port, | 936 | rphy = sas_expander_alloc(phy->port, |
937 | SAS_EDGE_EXPANDER_DEVICE); | 937 | SAS_EDGE_EXPANDER_DEVICE); |
938 | break; | 938 | break; |
939 | case FANOUT_DEV: | 939 | case SAS_FANOUT_EXPANDER_DEVICE: |
940 | rphy = sas_expander_alloc(phy->port, | 940 | rphy = sas_expander_alloc(phy->port, |
941 | SAS_FANOUT_EXPANDER_DEVICE); | 941 | SAS_FANOUT_EXPANDER_DEVICE); |
942 | break; | 942 | break; |
@@ -1013,7 +1013,7 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id) | |||
1013 | if (sas_dev_present_in_domain(dev->port, ex_phy->attached_sas_addr)) | 1013 | if (sas_dev_present_in_domain(dev->port, ex_phy->attached_sas_addr)) |
1014 | sas_ex_disable_port(dev, ex_phy->attached_sas_addr); | 1014 | sas_ex_disable_port(dev, ex_phy->attached_sas_addr); |
1015 | 1015 | ||
1016 | if (ex_phy->attached_dev_type == NO_DEVICE) { | 1016 | if (ex_phy->attached_dev_type == SAS_PHY_UNUSED) { |
1017 | if (ex_phy->routing_attr == DIRECT_ROUTING) { | 1017 | if (ex_phy->routing_attr == DIRECT_ROUTING) { |
1018 | memset(ex_phy->attached_sas_addr, 0, SAS_ADDR_SIZE); | 1018 | memset(ex_phy->attached_sas_addr, 0, SAS_ADDR_SIZE); |
1019 | sas_configure_routing(dev, ex_phy->attached_sas_addr); | 1019 | sas_configure_routing(dev, ex_phy->attached_sas_addr); |
@@ -1022,10 +1022,10 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id) | |||
1022 | } else if (ex_phy->linkrate == SAS_LINK_RATE_UNKNOWN) | 1022 | } else if (ex_phy->linkrate == SAS_LINK_RATE_UNKNOWN) |
1023 | return 0; | 1023 | return 0; |
1024 | 1024 | ||
1025 | if (ex_phy->attached_dev_type != SAS_END_DEV && | 1025 | if (ex_phy->attached_dev_type != SAS_END_DEVICE && |
1026 | ex_phy->attached_dev_type != FANOUT_DEV && | 1026 | ex_phy->attached_dev_type != SAS_FANOUT_EXPANDER_DEVICE && |
1027 | ex_phy->attached_dev_type != EDGE_DEV && | 1027 | ex_phy->attached_dev_type != SAS_EDGE_EXPANDER_DEVICE && |
1028 | ex_phy->attached_dev_type != SATA_PENDING) { | 1028 | ex_phy->attached_dev_type != SAS_SATA_PENDING) { |
1029 | SAS_DPRINTK("unknown device type(0x%x) attached to ex %016llx " | 1029 | SAS_DPRINTK("unknown device type(0x%x) attached to ex %016llx " |
1030 | "phy 0x%x\n", ex_phy->attached_dev_type, | 1030 | "phy 0x%x\n", ex_phy->attached_dev_type, |
1031 | SAS_ADDR(dev->sas_addr), | 1031 | SAS_ADDR(dev->sas_addr), |
@@ -1049,11 +1049,11 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id) | |||
1049 | } | 1049 | } |
1050 | 1050 | ||
1051 | switch (ex_phy->attached_dev_type) { | 1051 | switch (ex_phy->attached_dev_type) { |
1052 | case SAS_END_DEV: | 1052 | case SAS_END_DEVICE: |
1053 | case SATA_PENDING: | 1053 | case SAS_SATA_PENDING: |
1054 | child = sas_ex_discover_end_dev(dev, phy_id); | 1054 | child = sas_ex_discover_end_dev(dev, phy_id); |
1055 | break; | 1055 | break; |
1056 | case FANOUT_DEV: | 1056 | case SAS_FANOUT_EXPANDER_DEVICE: |
1057 | if (SAS_ADDR(dev->port->disc.fanout_sas_addr)) { | 1057 | if (SAS_ADDR(dev->port->disc.fanout_sas_addr)) { |
1058 | SAS_DPRINTK("second fanout expander %016llx phy 0x%x " | 1058 | SAS_DPRINTK("second fanout expander %016llx phy 0x%x " |
1059 | "attached to ex %016llx phy 0x%x\n", | 1059 | "attached to ex %016llx phy 0x%x\n", |
@@ -1067,7 +1067,7 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id) | |||
1067 | memcpy(dev->port->disc.fanout_sas_addr, | 1067 | memcpy(dev->port->disc.fanout_sas_addr, |
1068 | ex_phy->attached_sas_addr, SAS_ADDR_SIZE); | 1068 | ex_phy->attached_sas_addr, SAS_ADDR_SIZE); |
1069 | /* fallthrough */ | 1069 | /* fallthrough */ |
1070 | case EDGE_DEV: | 1070 | case SAS_EDGE_EXPANDER_DEVICE: |
1071 | child = sas_ex_discover_expander(dev, phy_id); | 1071 | child = sas_ex_discover_expander(dev, phy_id); |
1072 | break; | 1072 | break; |
1073 | default: | 1073 | default: |
@@ -1111,8 +1111,8 @@ static int sas_find_sub_addr(struct domain_device *dev, u8 *sub_addr) | |||
1111 | phy->phy_state == PHY_NOT_PRESENT) | 1111 | phy->phy_state == PHY_NOT_PRESENT) |
1112 | continue; | 1112 | continue; |
1113 | 1113 | ||
1114 | if ((phy->attached_dev_type == EDGE_DEV || | 1114 | if ((phy->attached_dev_type == SAS_EDGE_EXPANDER_DEVICE || |
1115 | phy->attached_dev_type == FANOUT_DEV) && | 1115 | phy->attached_dev_type == SAS_FANOUT_EXPANDER_DEVICE) && |
1116 | phy->routing_attr == SUBTRACTIVE_ROUTING) { | 1116 | phy->routing_attr == SUBTRACTIVE_ROUTING) { |
1117 | 1117 | ||
1118 | memcpy(sub_addr, phy->attached_sas_addr,SAS_ADDR_SIZE); | 1118 | memcpy(sub_addr, phy->attached_sas_addr,SAS_ADDR_SIZE); |
@@ -1130,8 +1130,8 @@ static int sas_check_level_subtractive_boundary(struct domain_device *dev) | |||
1130 | u8 sub_addr[8] = {0, }; | 1130 | u8 sub_addr[8] = {0, }; |
1131 | 1131 | ||
1132 | list_for_each_entry(child, &ex->children, siblings) { | 1132 | list_for_each_entry(child, &ex->children, siblings) { |
1133 | if (child->dev_type != EDGE_DEV && | 1133 | if (child->dev_type != SAS_EDGE_EXPANDER_DEVICE && |
1134 | child->dev_type != FANOUT_DEV) | 1134 | child->dev_type != SAS_FANOUT_EXPANDER_DEVICE) |
1135 | continue; | 1135 | continue; |
1136 | if (sub_addr[0] == 0) { | 1136 | if (sub_addr[0] == 0) { |
1137 | sas_find_sub_addr(child, sub_addr); | 1137 | sas_find_sub_addr(child, sub_addr); |
@@ -1208,7 +1208,7 @@ static int sas_check_ex_subtractive_boundary(struct domain_device *dev) | |||
1208 | int i; | 1208 | int i; |
1209 | u8 *sub_sas_addr = NULL; | 1209 | u8 *sub_sas_addr = NULL; |
1210 | 1210 | ||
1211 | if (dev->dev_type != EDGE_DEV) | 1211 | if (dev->dev_type != SAS_EDGE_EXPANDER_DEVICE) |
1212 | return 0; | 1212 | return 0; |
1213 | 1213 | ||
1214 | for (i = 0; i < ex->num_phys; i++) { | 1214 | for (i = 0; i < ex->num_phys; i++) { |
@@ -1218,8 +1218,8 @@ static int sas_check_ex_subtractive_boundary(struct domain_device *dev) | |||
1218 | phy->phy_state == PHY_NOT_PRESENT) | 1218 | phy->phy_state == PHY_NOT_PRESENT) |
1219 | continue; | 1219 | continue; |
1220 | 1220 | ||
1221 | if ((phy->attached_dev_type == FANOUT_DEV || | 1221 | if ((phy->attached_dev_type == SAS_FANOUT_EXPANDER_DEVICE || |
1222 | phy->attached_dev_type == EDGE_DEV) && | 1222 | phy->attached_dev_type == SAS_EDGE_EXPANDER_DEVICE) && |
1223 | phy->routing_attr == SUBTRACTIVE_ROUTING) { | 1223 | phy->routing_attr == SUBTRACTIVE_ROUTING) { |
1224 | 1224 | ||
1225 | if (!sub_sas_addr) | 1225 | if (!sub_sas_addr) |
@@ -1245,8 +1245,8 @@ static void sas_print_parent_topology_bug(struct domain_device *child, | |||
1245 | struct ex_phy *child_phy) | 1245 | struct ex_phy *child_phy) |
1246 | { | 1246 | { |
1247 | static const char *ex_type[] = { | 1247 | static const char *ex_type[] = { |
1248 | [EDGE_DEV] = "edge", | 1248 | [SAS_EDGE_EXPANDER_DEVICE] = "edge", |
1249 | [FANOUT_DEV] = "fanout", | 1249 | [SAS_FANOUT_EXPANDER_DEVICE] = "fanout", |
1250 | }; | 1250 | }; |
1251 | struct domain_device *parent = child->parent; | 1251 | struct domain_device *parent = child->parent; |
1252 | 1252 | ||
@@ -1321,8 +1321,8 @@ static int sas_check_parent_topology(struct domain_device *child) | |||
1321 | if (!child->parent) | 1321 | if (!child->parent) |
1322 | return 0; | 1322 | return 0; |
1323 | 1323 | ||
1324 | if (child->parent->dev_type != EDGE_DEV && | 1324 | if (child->parent->dev_type != SAS_EDGE_EXPANDER_DEVICE && |
1325 | child->parent->dev_type != FANOUT_DEV) | 1325 | child->parent->dev_type != SAS_FANOUT_EXPANDER_DEVICE) |
1326 | return 0; | 1326 | return 0; |
1327 | 1327 | ||
1328 | parent_ex = &child->parent->ex_dev; | 1328 | parent_ex = &child->parent->ex_dev; |
@@ -1341,8 +1341,8 @@ static int sas_check_parent_topology(struct domain_device *child) | |||
1341 | child_phy = &child_ex->ex_phy[parent_phy->attached_phy_id]; | 1341 | child_phy = &child_ex->ex_phy[parent_phy->attached_phy_id]; |
1342 | 1342 | ||
1343 | switch (child->parent->dev_type) { | 1343 | switch (child->parent->dev_type) { |
1344 | case EDGE_DEV: | 1344 | case SAS_EDGE_EXPANDER_DEVICE: |
1345 | if (child->dev_type == FANOUT_DEV) { | 1345 | if (child->dev_type == SAS_FANOUT_EXPANDER_DEVICE) { |
1346 | if (parent_phy->routing_attr != SUBTRACTIVE_ROUTING || | 1346 | if (parent_phy->routing_attr != SUBTRACTIVE_ROUTING || |
1347 | child_phy->routing_attr != TABLE_ROUTING) { | 1347 | child_phy->routing_attr != TABLE_ROUTING) { |
1348 | sas_print_parent_topology_bug(child, parent_phy, child_phy); | 1348 | sas_print_parent_topology_bug(child, parent_phy, child_phy); |
@@ -1366,7 +1366,7 @@ static int sas_check_parent_topology(struct domain_device *child) | |||
1366 | } | 1366 | } |
1367 | } | 1367 | } |
1368 | break; | 1368 | break; |
1369 | case FANOUT_DEV: | 1369 | case SAS_FANOUT_EXPANDER_DEVICE: |
1370 | if (parent_phy->routing_attr != TABLE_ROUTING || | 1370 | if (parent_phy->routing_attr != TABLE_ROUTING || |
1371 | child_phy->routing_attr != SUBTRACTIVE_ROUTING) { | 1371 | child_phy->routing_attr != SUBTRACTIVE_ROUTING) { |
1372 | sas_print_parent_topology_bug(child, parent_phy, child_phy); | 1372 | sas_print_parent_topology_bug(child, parent_phy, child_phy); |
@@ -1619,8 +1619,8 @@ static int sas_ex_level_discovery(struct asd_sas_port *port, const int level) | |||
1619 | struct domain_device *dev; | 1619 | struct domain_device *dev; |
1620 | 1620 | ||
1621 | list_for_each_entry(dev, &port->dev_list, dev_list_node) { | 1621 | list_for_each_entry(dev, &port->dev_list, dev_list_node) { |
1622 | if (dev->dev_type == EDGE_DEV || | 1622 | if (dev->dev_type == SAS_EDGE_EXPANDER_DEVICE || |
1623 | dev->dev_type == FANOUT_DEV) { | 1623 | dev->dev_type == SAS_FANOUT_EXPANDER_DEVICE) { |
1624 | struct sas_expander_device *ex = | 1624 | struct sas_expander_device *ex = |
1625 | rphy_to_expander_device(dev->rphy); | 1625 | rphy_to_expander_device(dev->rphy); |
1626 | 1626 | ||
@@ -1720,7 +1720,7 @@ static int sas_get_phy_change_count(struct domain_device *dev, | |||
1720 | } | 1720 | } |
1721 | 1721 | ||
1722 | static int sas_get_phy_attached_dev(struct domain_device *dev, int phy_id, | 1722 | static int sas_get_phy_attached_dev(struct domain_device *dev, int phy_id, |
1723 | u8 *sas_addr, enum sas_dev_type *type) | 1723 | u8 *sas_addr, enum sas_device_type *type) |
1724 | { | 1724 | { |
1725 | int res; | 1725 | int res; |
1726 | struct smp_resp *disc_resp; | 1726 | struct smp_resp *disc_resp; |
@@ -1849,7 +1849,7 @@ static int sas_find_bcast_dev(struct domain_device *dev, | |||
1849 | SAS_DPRINTK("Expander phys DID NOT change\n"); | 1849 | SAS_DPRINTK("Expander phys DID NOT change\n"); |
1850 | } | 1850 | } |
1851 | list_for_each_entry(ch, &ex->children, siblings) { | 1851 | list_for_each_entry(ch, &ex->children, siblings) { |
1852 | if (ch->dev_type == EDGE_DEV || ch->dev_type == FANOUT_DEV) { | 1852 | if (ch->dev_type == SAS_EDGE_EXPANDER_DEVICE || ch->dev_type == SAS_FANOUT_EXPANDER_DEVICE) { |
1853 | res = sas_find_bcast_dev(ch, src_dev); | 1853 | res = sas_find_bcast_dev(ch, src_dev); |
1854 | if (*src_dev) | 1854 | if (*src_dev) |
1855 | return res; | 1855 | return res; |
@@ -1866,8 +1866,8 @@ static void sas_unregister_ex_tree(struct asd_sas_port *port, struct domain_devi | |||
1866 | 1866 | ||
1867 | list_for_each_entry_safe(child, n, &ex->children, siblings) { | 1867 | list_for_each_entry_safe(child, n, &ex->children, siblings) { |
1868 | set_bit(SAS_DEV_GONE, &child->state); | 1868 | set_bit(SAS_DEV_GONE, &child->state); |
1869 | if (child->dev_type == EDGE_DEV || | 1869 | if (child->dev_type == SAS_EDGE_EXPANDER_DEVICE || |
1870 | child->dev_type == FANOUT_DEV) | 1870 | child->dev_type == SAS_FANOUT_EXPANDER_DEVICE) |
1871 | sas_unregister_ex_tree(port, child); | 1871 | sas_unregister_ex_tree(port, child); |
1872 | else | 1872 | else |
1873 | sas_unregister_dev(port, child); | 1873 | sas_unregister_dev(port, child); |
@@ -1887,8 +1887,8 @@ static void sas_unregister_devs_sas_addr(struct domain_device *parent, | |||
1887 | if (SAS_ADDR(child->sas_addr) == | 1887 | if (SAS_ADDR(child->sas_addr) == |
1888 | SAS_ADDR(phy->attached_sas_addr)) { | 1888 | SAS_ADDR(phy->attached_sas_addr)) { |
1889 | set_bit(SAS_DEV_GONE, &child->state); | 1889 | set_bit(SAS_DEV_GONE, &child->state); |
1890 | if (child->dev_type == EDGE_DEV || | 1890 | if (child->dev_type == SAS_EDGE_EXPANDER_DEVICE || |
1891 | child->dev_type == FANOUT_DEV) | 1891 | child->dev_type == SAS_FANOUT_EXPANDER_DEVICE) |
1892 | sas_unregister_ex_tree(parent->port, child); | 1892 | sas_unregister_ex_tree(parent->port, child); |
1893 | else | 1893 | else |
1894 | sas_unregister_dev(parent->port, child); | 1894 | sas_unregister_dev(parent->port, child); |
@@ -1916,8 +1916,8 @@ static int sas_discover_bfs_by_root_level(struct domain_device *root, | |||
1916 | int res = 0; | 1916 | int res = 0; |
1917 | 1917 | ||
1918 | list_for_each_entry(child, &ex_root->children, siblings) { | 1918 | list_for_each_entry(child, &ex_root->children, siblings) { |
1919 | if (child->dev_type == EDGE_DEV || | 1919 | if (child->dev_type == SAS_EDGE_EXPANDER_DEVICE || |
1920 | child->dev_type == FANOUT_DEV) { | 1920 | child->dev_type == SAS_FANOUT_EXPANDER_DEVICE) { |
1921 | struct sas_expander_device *ex = | 1921 | struct sas_expander_device *ex = |
1922 | rphy_to_expander_device(child->rphy); | 1922 | rphy_to_expander_device(child->rphy); |
1923 | 1923 | ||
@@ -1970,8 +1970,8 @@ static int sas_discover_new(struct domain_device *dev, int phy_id) | |||
1970 | list_for_each_entry(child, &dev->ex_dev.children, siblings) { | 1970 | list_for_each_entry(child, &dev->ex_dev.children, siblings) { |
1971 | if (SAS_ADDR(child->sas_addr) == | 1971 | if (SAS_ADDR(child->sas_addr) == |
1972 | SAS_ADDR(ex_phy->attached_sas_addr)) { | 1972 | SAS_ADDR(ex_phy->attached_sas_addr)) { |
1973 | if (child->dev_type == EDGE_DEV || | 1973 | if (child->dev_type == SAS_EDGE_EXPANDER_DEVICE || |
1974 | child->dev_type == FANOUT_DEV) | 1974 | child->dev_type == SAS_FANOUT_EXPANDER_DEVICE) |
1975 | res = sas_discover_bfs_by_root(child); | 1975 | res = sas_discover_bfs_by_root(child); |
1976 | break; | 1976 | break; |
1977 | } | 1977 | } |
@@ -1979,16 +1979,16 @@ static int sas_discover_new(struct domain_device *dev, int phy_id) | |||
1979 | return res; | 1979 | return res; |
1980 | } | 1980 | } |
1981 | 1981 | ||
1982 | static bool dev_type_flutter(enum sas_dev_type new, enum sas_dev_type old) | 1982 | static bool dev_type_flutter(enum sas_device_type new, enum sas_device_type old) |
1983 | { | 1983 | { |
1984 | if (old == new) | 1984 | if (old == new) |
1985 | return true; | 1985 | return true; |
1986 | 1986 | ||
1987 | /* treat device directed resets as flutter, if we went | 1987 | /* treat device directed resets as flutter, if we went |
1988 | * SAS_END_DEV to SATA_PENDING the link needs recovery | 1988 | * SAS_END_DEVICE to SAS_SATA_PENDING the link needs recovery |
1989 | */ | 1989 | */ |
1990 | if ((old == SATA_PENDING && new == SAS_END_DEV) || | 1990 | if ((old == SAS_SATA_PENDING && new == SAS_END_DEVICE) || |
1991 | (old == SAS_END_DEV && new == SATA_PENDING)) | 1991 | (old == SAS_END_DEVICE && new == SAS_SATA_PENDING)) |
1992 | return true; | 1992 | return true; |
1993 | 1993 | ||
1994 | return false; | 1994 | return false; |
@@ -1998,7 +1998,7 @@ static int sas_rediscover_dev(struct domain_device *dev, int phy_id, bool last) | |||
1998 | { | 1998 | { |
1999 | struct expander_device *ex = &dev->ex_dev; | 1999 | struct expander_device *ex = &dev->ex_dev; |
2000 | struct ex_phy *phy = &ex->ex_phy[phy_id]; | 2000 | struct ex_phy *phy = &ex->ex_phy[phy_id]; |
2001 | enum sas_dev_type type = NO_DEVICE; | 2001 | enum sas_device_type type = SAS_PHY_UNUSED; |
2002 | u8 sas_addr[8]; | 2002 | u8 sas_addr[8]; |
2003 | int res; | 2003 | int res; |
2004 | 2004 | ||
@@ -2032,7 +2032,7 @@ static int sas_rediscover_dev(struct domain_device *dev, int phy_id, bool last) | |||
2032 | 2032 | ||
2033 | sas_ex_phy_discover(dev, phy_id); | 2033 | sas_ex_phy_discover(dev, phy_id); |
2034 | 2034 | ||
2035 | if (ata_dev && phy->attached_dev_type == SATA_PENDING) | 2035 | if (ata_dev && phy->attached_dev_type == SAS_SATA_PENDING) |
2036 | action = ", needs recovery"; | 2036 | action = ", needs recovery"; |
2037 | SAS_DPRINTK("ex %016llx phy 0x%x broadcast flutter%s\n", | 2037 | SAS_DPRINTK("ex %016llx phy 0x%x broadcast flutter%s\n", |
2038 | SAS_ADDR(dev->sas_addr), phy_id, action); | 2038 | SAS_ADDR(dev->sas_addr), phy_id, action); |