aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@steeleye.com>2006-07-11 17:49:34 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-07-12 09:20:01 -0400
commite8bf39417b578a11e2ee2cd16e794a5b2d40757b (patch)
tree7e20aa4b9c483b62a91cf3e5f6a2bc51074c507c /drivers/message
parenta0e1b6ef3b851fe6f1dcc259432e83de79ce5e7f (diff)
[SCSI] scsi_transport_sas: kill the use of channel
Using the port_id for the channel is completely unnecessary since the host_id/target_id are constructed to be globally unique. Also move the mptsas driver on to virtual channel 1 for its raid devices. Acked-by: "Moore, Eric" <Eric.Moore@lsil.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message')
-rw-r--r--drivers/message/fusion/mptbase.h1
-rw-r--r--drivers/message/fusion/mptsas.c56
2 files changed, 21 insertions, 36 deletions
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index 0b555e2309f4..014e1de0f7cb 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -634,7 +634,6 @@ typedef struct _MPT_ADAPTER
634 u16 handle; 634 u16 handle;
635 int sas_index; /* index refrencing */ 635 int sas_index; /* index refrencing */
636 MPT_SAS_MGMT sas_mgmt; 636 MPT_SAS_MGMT sas_mgmt;
637 int num_ports;
638 struct work_struct sas_persist_task; 637 struct work_struct sas_persist_task;
639 638
640 struct work_struct fc_setup_reset_work; 639 struct work_struct fc_setup_reset_work;
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 0fb7d5881f4f..b28e930528e8 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -67,6 +67,11 @@
67#define my_VERSION MPT_LINUX_VERSION_COMMON 67#define my_VERSION MPT_LINUX_VERSION_COMMON
68#define MYNAM "mptsas" 68#define MYNAM "mptsas"
69 69
70/*
71 * Reserved channel for integrated raid
72 */
73#define MPTSAS_RAID_CHANNEL 1
74
70MODULE_AUTHOR(MODULEAUTHOR); 75MODULE_AUTHOR(MODULEAUTHOR);
71MODULE_DESCRIPTION(my_NAME); 76MODULE_DESCRIPTION(my_NAME);
72MODULE_LICENSE("GPL"); 77MODULE_LICENSE("GPL");
@@ -644,16 +649,13 @@ mptsas_sas_enclosure_pg0(MPT_ADAPTER *ioc, struct mptsas_enclosure *enclosure,
644static int 649static int
645mptsas_slave_configure(struct scsi_device *sdev) 650mptsas_slave_configure(struct scsi_device *sdev)
646{ 651{
647 struct Scsi_Host *host = sdev->host;
648 MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata;
649 652
650 /* 653 if (sdev->channel == MPTSAS_RAID_CHANNEL)
651 * RAID volumes placed beyond the last expected port. 654 goto out;
652 * Ignore sending sas mode pages in that case.. 655
653 */ 656 sas_read_port_mode_page(sdev);
654 if (sdev->channel < hd->ioc->num_ports)
655 sas_read_port_mode_page(sdev);
656 657
658 out:
657 return mptscsih_slave_configure(sdev); 659 return mptscsih_slave_configure(sdev);
658} 660}
659 661
@@ -682,10 +684,7 @@ mptsas_target_alloc(struct scsi_target *starget)
682 684
683 hd->Targets[target_id] = vtarget; 685 hd->Targets[target_id] = vtarget;
684 686
685 /* 687 if (starget->channel == MPTSAS_RAID_CHANNEL)
686 * RAID volumes placed beyond the last expected port.
687 */
688 if (starget->channel == hd->ioc->num_ports)
689 goto out; 688 goto out;
690 689
691 rphy = dev_to_rphy(starget->dev.parent); 690 rphy = dev_to_rphy(starget->dev.parent);
@@ -736,7 +735,7 @@ mptsas_target_destroy(struct scsi_target *starget)
736 if (!starget->hostdata) 735 if (!starget->hostdata)
737 return; 736 return;
738 737
739 if (starget->channel == hd->ioc->num_ports) 738 if (starget->channel == MPTSAS_RAID_CHANNEL)
740 goto out; 739 goto out;
741 740
742 rphy = dev_to_rphy(starget->dev.parent); 741 rphy = dev_to_rphy(starget->dev.parent);
@@ -776,10 +775,7 @@ mptsas_slave_alloc(struct scsi_device *sdev)
776 starget = scsi_target(sdev); 775 starget = scsi_target(sdev);
777 vdev->vtarget = starget->hostdata; 776 vdev->vtarget = starget->hostdata;
778 777
779 /* 778 if (sdev->channel == MPTSAS_RAID_CHANNEL)
780 * RAID volumes placed beyond the last expected port.
781 */
782 if (sdev->channel == hd->ioc->num_ports)
783 goto out; 779 goto out;
784 780
785 rphy = dev_to_rphy(sdev->sdev_target->dev.parent); 781 rphy = dev_to_rphy(sdev->sdev_target->dev.parent);
@@ -1728,7 +1724,6 @@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc)
1728 hba = NULL; 1724 hba = NULL;
1729 } 1725 }
1730 mutex_unlock(&ioc->sas_topology_mutex); 1726 mutex_unlock(&ioc->sas_topology_mutex);
1731 ioc->num_ports = port_info->num_phys;
1732 1727
1733 for (i = 0; i < port_info->num_phys; i++) { 1728 for (i = 0; i < port_info->num_phys; i++) {
1734 mptsas_sas_phy_pg0(ioc, &port_info->phy_info[i], 1729 mptsas_sas_phy_pg0(ioc, &port_info->phy_info[i],
@@ -1977,7 +1972,7 @@ mptsas_scan_sas_topology(MPT_ADAPTER *ioc)
1977 if (!ioc->raid_data.pIocPg2->NumActiveVolumes) 1972 if (!ioc->raid_data.pIocPg2->NumActiveVolumes)
1978 goto out; 1973 goto out;
1979 for (i=0; i<ioc->raid_data.pIocPg2->NumActiveVolumes; i++) { 1974 for (i=0; i<ioc->raid_data.pIocPg2->NumActiveVolumes; i++) {
1980 scsi_add_device(ioc->sh, ioc->num_ports, 1975 scsi_add_device(ioc->sh, MPTSAS_RAID_CHANNEL,
1981 ioc->raid_data.pIocPg2->RaidVolume[i].VolumeID, 0); 1976 ioc->raid_data.pIocPg2->RaidVolume[i].VolumeID, 0);
1982 } 1977 }
1983 out: 1978 out:
@@ -2283,35 +2278,26 @@ mptsas_hotplug_work(void *arg)
2283 mptsas_set_rphy(phy_info, rphy); 2278 mptsas_set_rphy(phy_info, rphy);
2284 break; 2279 break;
2285 case MPTSAS_ADD_RAID: 2280 case MPTSAS_ADD_RAID:
2286 sdev = scsi_device_lookup( 2281 sdev = scsi_device_lookup(ioc->sh, MPTSAS_RAID_CHANNEL,
2287 ioc->sh, 2282 ev->id, 0);
2288 ioc->num_ports,
2289 ev->id,
2290 0);
2291 if (sdev) { 2283 if (sdev) {
2292 scsi_device_put(sdev); 2284 scsi_device_put(sdev);
2293 break; 2285 break;
2294 } 2286 }
2295 printk(MYIOC_s_INFO_FMT 2287 printk(MYIOC_s_INFO_FMT
2296 "attaching raid volume, channel %d, id %d\n", 2288 "attaching raid volume, channel %d, id %d\n",
2297 ioc->name, ioc->num_ports, ev->id); 2289 ioc->name, MPTSAS_RAID_CHANNEL, ev->id);
2298 scsi_add_device(ioc->sh, 2290 scsi_add_device(ioc->sh, MPTSAS_RAID_CHANNEL, ev->id, 0);
2299 ioc->num_ports,
2300 ev->id,
2301 0);
2302 mpt_findImVolumes(ioc); 2291 mpt_findImVolumes(ioc);
2303 break; 2292 break;
2304 case MPTSAS_DEL_RAID: 2293 case MPTSAS_DEL_RAID:
2305 sdev = scsi_device_lookup( 2294 sdev = scsi_device_lookup(ioc->sh, MPTSAS_RAID_CHANNEL,
2306 ioc->sh, 2295 ev->id, 0);
2307 ioc->num_ports,
2308 ev->id,
2309 0);
2310 if (!sdev) 2296 if (!sdev)
2311 break; 2297 break;
2312 printk(MYIOC_s_INFO_FMT 2298 printk(MYIOC_s_INFO_FMT
2313 "removing raid volume, channel %d, id %d\n", 2299 "removing raid volume, channel %d, id %d\n",
2314 ioc->name, ioc->num_ports, ev->id); 2300 ioc->name, MPTSAS_RAID_CHANNEL, ev->id);
2315 vdevice = sdev->hostdata; 2301 vdevice = sdev->hostdata;
2316 vdevice->vtarget->deleted = 1; 2302 vdevice->vtarget->deleted = 1;
2317 mptsas_target_reset(ioc, vdevice->vtarget); 2303 mptsas_target_reset(ioc, vdevice->vtarget);