Skip to contentSkip to conversation

Preliminary expander support for aic94xx

RFC New James Bottomley 1 participant 1 message Mar 14, 2006 SCSI

lore
Share & tools
lore
#0 lore raw

RFC 1/1 Preliminary expander support for aic94xx

This is dependent on the previously posted transport class expander patch, but now it makes aic94xx handle expanders in a reasonable fashion.

With this, the driver should be useable by almost all SAS (not SATA) configurations ... as long as you don't try and remove it as a module ...

James

drivers/scsi/sas/sas_discover.c +15 -1
index c10b453..8b568ad 100644
@@ -230,7 +230,21 @@ static int sas_get_port_device(struct sa
 
 	sas_init_dev(dev);
 
-	rphy = dev->dev_type == SAS_END_DEV ? sas_end_device_alloc(phy->phy) : sas_rphy_alloc(phy->phy);
+	switch (dev->dev_type) {
+	case SAS_END_DEV:
+		rphy = sas_end_device_alloc(phy->phy);
+		break;
+	case EDGE_DEV:
+		rphy = sas_expander_alloc(phy->phy, SAS_EDGE_EXPANDER_DEVICE);
+		break;
+	case FANOUT_DEV:
+		rphy = sas_expander_alloc(phy->phy, SAS_FANOUT_EXPANDER_DEVICE);
+		break;
+	default:
+		rphy = sas_rphy_alloc(phy->phy);
+		break;
+	}
+
 	if (!rphy) {
 		spin_unlock_irqrestore(&port->phy_list_lock, flags);
 		kfree(dev);
drivers/scsi/sas/sas_expander.c +92 -16

207 lines not on this page · raw message

include/scsi/sas/sas_expander.h +2 -15
index bd00e1c..e83b41c 100644
@@ -70,13 +70,13 @@ struct ex_phy {
 	u8   virtual:1;
 
 	int  last_da_index;
+
+	struct sas_phy *phy;
 };
 
 struct expander_device {
 	struct list_head children;
 
-	int    level;
-
 	u16    ex_change_count;
 	u16    max_route_indexes;
 	u8     num_phys;
@@ -84,20 +84,7 @@ struct expander_device {
 	u8     conf_route_table:1;
 	u8     enclosure_logical_id[8];
 
-	char   vendor_id[8+1];
-	char   product_id[16+1];
-	char   product_rev[4+1];
-	char   component_vendor_id[8+1];
-	u16    component_id;
-	u8     component_revision_id;
-
 	struct ex_phy *ex_phy;
-
-	struct bin_attribute smp_bin_attr;
-	void *smp_req;
-	int   smp_req_size;
-	int   smp_portal_pid;
-	struct semaphore smp_sema;
 };
 
 int  sas_discover_root_expander(struct domain_device *dev);