aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEric Moore <eric.moore@lsil.com>2006-07-06 13:23:14 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-07-09 11:17:21 -0400
commitdc22f16d4e46cee699c3835cc6e2a8005023517f (patch)
tree14494814ee6e3581ad5b6e2399bb562ac7f9b58e /drivers
parenta507c6a2d91c52615bd3bb5a8ff439d9e8530939 (diff)
[SCSI] mptsas: use unnumbered port API and remove driver porttracking
This allows us to be rid of the machinery in mptsas for creating and tracking port numbers. Since mptsas is merely inventing the numbers, the SAS transport class may as well do it instead. Signed-off-by: Eric Moore <Eric.Moore@lsil.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/message/fusion/mptbase.h1
-rw-r--r--drivers/message/fusion/mptsas.c38
2 files changed, 16 insertions, 23 deletions
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index a5ce10b67d02..0b555e2309f4 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -644,7 +644,6 @@ typedef struct _MPT_ADAPTER
644 struct work_struct fc_rescan_work; 644 struct work_struct fc_rescan_work;
645 char fc_rescan_work_q_name[KOBJ_NAME_LEN]; 645 char fc_rescan_work_q_name[KOBJ_NAME_LEN];
646 struct workqueue_struct *fc_rescan_work_q; 646 struct workqueue_struct *fc_rescan_work_q;
647 u8 port_serial_number;
648} MPT_ADAPTER; 647} MPT_ADAPTER;
649 648
650/* 649/*
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index f7bd8b11ed3b..0fb7d5881f4f 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -144,7 +144,6 @@ struct mptsas_devinfo {
144 * Specific details on ports, wide/narrow 144 * Specific details on ports, wide/narrow
145 */ 145 */
146struct mptsas_portinfo_details{ 146struct mptsas_portinfo_details{
147 u8 port_id; /* port number provided to transport */
148 u16 num_phys; /* number of phys belong to this port */ 147 u16 num_phys; /* number of phys belong to this port */
149 u64 phy_bitmask; /* TODO, extend support for 255 phys */ 148 u64 phy_bitmask; /* TODO, extend support for 255 phys */
150 struct sas_rphy *rphy; /* transport layer rphy object */ 149 struct sas_rphy *rphy; /* transport layer rphy object */
@@ -350,10 +349,10 @@ mptsas_port_delete(struct mptsas_portinfo_details * port_details)
350 port_info = port_details->port_info; 349 port_info = port_details->port_info;
351 phy_info = port_info->phy_info; 350 phy_info = port_info->phy_info;
352 351
353 dsaswideprintk((KERN_DEBUG "%s: [%p]: port=%02d num_phys=%02d " 352 dsaswideprintk((KERN_DEBUG "%s: [%p]: num_phys=%02d "
354 "bitmask=0x%016llX\n", 353 "bitmask=0x%016llX\n",
355 __FUNCTION__, port_details, port_details->port_id, 354 __FUNCTION__, port_details, port_details->num_phys,
356 port_details->num_phys, port_details->phy_bitmask)); 355 port_details->phy_bitmask));
357 356
358 for (i = 0; i < port_info->num_phys; i++, phy_info++) { 357 for (i = 0; i < port_info->num_phys; i++, phy_info++) {
359 if(phy_info->port_details != port_details) 358 if(phy_info->port_details != port_details)
@@ -462,9 +461,8 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
462 * phy be removed by firmware events. 461 * phy be removed by firmware events.
463 */ 462 */
464 dsaswideprintk((KERN_DEBUG 463 dsaswideprintk((KERN_DEBUG
465 "%s: [%p]: port=%d deleting phy = %d\n", 464 "%s: [%p]: deleting phy = %d\n",
466 __FUNCTION__, port_details, 465 __FUNCTION__, port_details, i));
467 port_details->port_id, i));
468 port_details->num_phys--; 466 port_details->num_phys--;
469 port_details->phy_bitmask &= ~ (1 << phy_info->phy_id); 467 port_details->phy_bitmask &= ~ (1 << phy_info->phy_id);
470 memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo)); 468 memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo));
@@ -493,7 +491,6 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
493 goto out; 491 goto out;
494 port_details->num_phys = 1; 492 port_details->num_phys = 1;
495 port_details->port_info = port_info; 493 port_details->port_info = port_info;
496 port_details->port_id = ioc->port_serial_number++;
497 if (phy_info->phy_id < 64 ) 494 if (phy_info->phy_id < 64 )
498 port_details->phy_bitmask |= 495 port_details->phy_bitmask |=
499 (1 << phy_info->phy_id); 496 (1 << phy_info->phy_id);
@@ -525,12 +522,8 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
525 mptsas_get_port(phy_info_cmp); 522 mptsas_get_port(phy_info_cmp);
526 port_details->starget = 523 port_details->starget =
527 mptsas_get_starget(phy_info_cmp); 524 mptsas_get_starget(phy_info_cmp);
528 port_details->port_id =
529 phy_info_cmp->port_details->port_id;
530 port_details->num_phys = 525 port_details->num_phys =
531 phy_info_cmp->port_details->num_phys; 526 phy_info_cmp->port_details->num_phys;
532// port_info->port_serial_number--;
533 ioc->port_serial_number--;
534 if (!phy_info_cmp->port_details->num_phys) 527 if (!phy_info_cmp->port_details->num_phys)
535 kfree(phy_info_cmp->port_details); 528 kfree(phy_info_cmp->port_details);
536 } else 529 } else
@@ -554,11 +547,11 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
554 if (!port_details) 547 if (!port_details)
555 continue; 548 continue;
556 dsaswideprintk((KERN_DEBUG 549 dsaswideprintk((KERN_DEBUG
557 "%s: [%p]: phy_id=%02d port_id=%02d num_phys=%02d " 550 "%s: [%p]: phy_id=%02d num_phys=%02d "
558 "bitmask=0x%016llX\n", 551 "bitmask=0x%016llX\n",
559 __FUNCTION__, 552 __FUNCTION__,
560 port_details, i, port_details->port_id, 553 port_details, i, port_details->num_phys,
561 port_details->num_phys, port_details->phy_bitmask)); 554 port_details->phy_bitmask));
562 dsaswideprintk((KERN_DEBUG"\t\tport = %p rphy=%p\n", 555 dsaswideprintk((KERN_DEBUG"\t\tport = %p rphy=%p\n",
563 port_details->port, port_details->rphy)); 556 port_details->port, port_details->rphy));
564 } 557 }
@@ -1608,11 +1601,7 @@ static int mptsas_probe_one_phy(struct device *dev,
1608 if (phy_info->sas_port_add_phy) { 1601 if (phy_info->sas_port_add_phy) {
1609 1602
1610 if (!port) { 1603 if (!port) {
1611 port = sas_port_alloc(dev, 1604 port = sas_port_alloc_num(dev);
1612 phy_info->port_details->port_id);
1613 dsaswideprintk((KERN_DEBUG
1614 "sas_port_alloc: port=%p dev=%p port_id=%d\n",
1615 port, dev, phy_info->port_details->port_id));
1616 if (!port) { 1605 if (!port) {
1617 error = -ENOMEM; 1606 error = -ENOMEM;
1618 goto out; 1607 goto out;
@@ -1625,6 +1614,9 @@ static int mptsas_probe_one_phy(struct device *dev,
1625 goto out; 1614 goto out;
1626 } 1615 }
1627 mptsas_set_port(phy_info, port); 1616 mptsas_set_port(phy_info, port);
1617 dsaswideprintk((KERN_DEBUG
1618 "sas_port_alloc: port=%p dev=%p port_id=%d\n",
1619 port, dev, port->port_identifier));
1628 } 1620 }
1629 dsaswideprintk((KERN_DEBUG "sas_port_add_phy: phy_id=%d\n", 1621 dsaswideprintk((KERN_DEBUG "sas_port_add_phy: phy_id=%d\n",
1630 phy_info->phy_id)); 1622 phy_info->phy_id));
@@ -1939,7 +1931,8 @@ mptsas_delete_expander_phys(MPT_ADAPTER *ioc)
1939 expander_sas_address) 1931 expander_sas_address)
1940 continue; 1932 continue;
1941#ifdef MPT_DEBUG_SAS_WIDE 1933#ifdef MPT_DEBUG_SAS_WIDE
1942 dev_printk(KERN_DEBUG, &port->dev, "delete\n"); 1934 dev_printk(KERN_DEBUG, &port->dev,
1935 "delete port (%d)\n", port->port_identifier);
1943#endif 1936#endif
1944 sas_port_delete(port); 1937 sas_port_delete(port);
1945 mptsas_port_delete(phy_info->port_details); 1938 mptsas_port_delete(phy_info->port_details);
@@ -2185,7 +2178,8 @@ mptsas_hotplug_work(void *arg)
2185 ioc->name, ds, ev->channel, ev->id, phy_info->phy_id); 2178 ioc->name, ds, ev->channel, ev->id, phy_info->phy_id);
2186 2179
2187#ifdef MPT_DEBUG_SAS_WIDE 2180#ifdef MPT_DEBUG_SAS_WIDE
2188 dev_printk(KERN_DEBUG, &port->dev, "delete\n"); 2181 dev_printk(KERN_DEBUG, &port->dev,
2182 "delete port (%d)\n", port->port_identifier);
2189#endif 2183#endif
2190 sas_port_delete(port); 2184 sas_port_delete(port);
2191 mptsas_port_delete(phy_info->port_details); 2185 mptsas_port_delete(phy_info->port_details);