diff options
author | James Bottomley <James.Bottomley@steeleye.com> | 2006-03-18 15:54:36 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-03-19 11:20:45 -0500 |
commit | f013db3284376070fc4c196e58d204180b8ed62a (patch) | |
tree | 727603f9b75c375ff123add7e1262e7948756aa8 /drivers/message/fusion/mptsas.c | |
parent | 6bdaa1f17dd32ec62345c7b57842f53e6278a2fa (diff) |
[SCSI] convert mptsas over to end_device/expander allocations
The conversion of mptsas should allow the elimination of the contained
flag in the sas transport class.
Acked-by: "Moore, Eric" <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message/fusion/mptsas.c')
-rw-r--r-- | drivers/message/fusion/mptsas.c | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index be4eb8a308b..010d4a39269 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c | |||
@@ -363,6 +363,14 @@ mptsas_sas_enclosure_pg0(MPT_ADAPTER *ioc, struct mptsas_enclosure *enclosure, | |||
363 | return error; | 363 | return error; |
364 | } | 364 | } |
365 | 365 | ||
366 | static int | ||
367 | mptsas_slave_configure(struct scsi_device *sdev) | ||
368 | { | ||
369 | sas_read_port_mode_page(sdev); | ||
370 | |||
371 | return mptscsih_slave_configure(sdev); | ||
372 | } | ||
373 | |||
366 | /* | 374 | /* |
367 | * This is pretty ugly. We will be able to seriously clean it up | 375 | * This is pretty ugly. We will be able to seriously clean it up |
368 | * once the DV code in mptscsih goes away and we can properly | 376 | * once the DV code in mptscsih goes away and we can properly |
@@ -486,7 +494,7 @@ static struct scsi_host_template mptsas_driver_template = { | |||
486 | .queuecommand = mptscsih_qcmd, | 494 | .queuecommand = mptscsih_qcmd, |
487 | .target_alloc = mptscsih_target_alloc, | 495 | .target_alloc = mptscsih_target_alloc, |
488 | .slave_alloc = mptsas_slave_alloc, | 496 | .slave_alloc = mptsas_slave_alloc, |
489 | .slave_configure = mptscsih_slave_configure, | 497 | .slave_configure = mptsas_slave_configure, |
490 | .target_destroy = mptscsih_target_destroy, | 498 | .target_destroy = mptscsih_target_destroy, |
491 | .slave_destroy = mptsas_slave_destroy, | 499 | .slave_destroy = mptsas_slave_destroy, |
492 | .change_queue_depth = mptscsih_change_queue_depth, | 500 | .change_queue_depth = mptscsih_change_queue_depth, |
@@ -1249,6 +1257,7 @@ static int mptsas_probe_one_phy(struct device *dev, | |||
1249 | (!phy_info->rphy)) { | 1257 | (!phy_info->rphy)) { |
1250 | 1258 | ||
1251 | struct sas_rphy *rphy; | 1259 | struct sas_rphy *rphy; |
1260 | struct sas_identify identify; | ||
1252 | 1261 | ||
1253 | ioc = phy_to_ioc(phy_info->phy); | 1262 | ioc = phy_to_ioc(phy_info->phy); |
1254 | 1263 | ||
@@ -1261,11 +1270,24 @@ static int mptsas_probe_one_phy(struct device *dev, | |||
1261 | mptsas_is_end_device(&phy_info->attached)) | 1270 | mptsas_is_end_device(&phy_info->attached)) |
1262 | return 0; | 1271 | return 0; |
1263 | 1272 | ||
1264 | rphy = sas_rphy_alloc(phy); | 1273 | mptsas_parse_device_info(&identify, &phy_info->attached); |
1274 | switch (identify.device_type) { | ||
1275 | case SAS_END_DEVICE: | ||
1276 | rphy = sas_end_device_alloc(phy); | ||
1277 | break; | ||
1278 | case SAS_EDGE_EXPANDER_DEVICE: | ||
1279 | case SAS_FANOUT_EXPANDER_DEVICE: | ||
1280 | rphy = sas_expander_alloc(phy, identify.device_type); | ||
1281 | break; | ||
1282 | default: | ||
1283 | rphy = NULL; | ||
1284 | break; | ||
1285 | } | ||
1265 | if (!rphy) | 1286 | if (!rphy) |
1266 | return 0; /* non-fatal: an rphy can be added later */ | 1287 | return 0; /* non-fatal: an rphy can be added later */ |
1267 | 1288 | ||
1268 | mptsas_parse_device_info(&rphy->identify, &phy_info->attached); | 1289 | rphy->identify = identify; |
1290 | |||
1269 | error = sas_rphy_add(rphy); | 1291 | error = sas_rphy_add(rphy); |
1270 | if (error) { | 1292 | if (error) { |
1271 | sas_rphy_free(rphy); | 1293 | sas_rphy_free(rphy); |
@@ -1654,6 +1676,7 @@ mptsas_hotplug_work(void *arg) | |||
1654 | struct mptsas_phyinfo *phy_info; | 1676 | struct mptsas_phyinfo *phy_info; |
1655 | struct sas_rphy *rphy; | 1677 | struct sas_rphy *rphy; |
1656 | struct scsi_device *sdev; | 1678 | struct scsi_device *sdev; |
1679 | struct sas_identify identify; | ||
1657 | char *ds = NULL; | 1680 | char *ds = NULL; |
1658 | struct mptsas_devinfo sas_device; | 1681 | struct mptsas_devinfo sas_device; |
1659 | VirtTarget *vtarget; | 1682 | VirtTarget *vtarget; |
@@ -1779,11 +1802,23 @@ mptsas_hotplug_work(void *arg) | |||
1779 | "attaching %s device, channel %d, id %d, phy %d\n", | 1802 | "attaching %s device, channel %d, id %d, phy %d\n", |
1780 | ioc->name, ds, ev->channel, ev->id, ev->phy_id); | 1803 | ioc->name, ds, ev->channel, ev->id, ev->phy_id); |
1781 | 1804 | ||
1782 | rphy = sas_rphy_alloc(phy_info->phy); | 1805 | mptsas_parse_device_info(&identify, &phy_info->attached); |
1806 | switch (identify.device_type) { | ||
1807 | case SAS_END_DEVICE: | ||
1808 | rphy = sas_end_device_alloc(phy_info->phy); | ||
1809 | break; | ||
1810 | case SAS_EDGE_EXPANDER_DEVICE: | ||
1811 | case SAS_FANOUT_EXPANDER_DEVICE: | ||
1812 | rphy = sas_expander_alloc(phy_info->phy, identify.device_type); | ||
1813 | break; | ||
1814 | default: | ||
1815 | rphy = NULL; | ||
1816 | break; | ||
1817 | } | ||
1783 | if (!rphy) | 1818 | if (!rphy) |
1784 | break; /* non-fatal: an rphy can be added later */ | 1819 | break; /* non-fatal: an rphy can be added later */ |
1785 | 1820 | ||
1786 | mptsas_parse_device_info(&rphy->identify, &phy_info->attached); | 1821 | rphy->identify = identify; |
1787 | if (sas_rphy_add(rphy)) { | 1822 | if (sas_rphy_add(rphy)) { |
1788 | sas_rphy_free(rphy); | 1823 | sas_rphy_free(rphy); |
1789 | break; | 1824 | break; |