From c3d3378bc22b18fc9ad162bb0c3e32768ef2979c Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 26 Apr 2009 08:39:06 +0000 Subject: [PATCH] Made show_login_info() work for InfiniBand HCA's with more than two ports. show_login_info() produces the information that can be retrieved from /sys/class/infiniband_srpt/srpt-*/login_info. Note: as of today there do not yet exist any InfiniBand HCA's with more than two ports. Thanks to Frank Zago for reporting this issue. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@799 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 9309dcbdb..3f8a3e9b4 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -2107,7 +2107,7 @@ static ssize_t show_login_info(struct device *dev, for (i = 0; i < sdev->device->phys_port_cnt; i++) { sport = &sdev->port[i]; - len += sprintf(buf, + len += sprintf(buf + len, "tid_ext=%016llx,ioc_guid=%016llx,pkey=ffff," "dgid=%04x%04x%04x%04x%04x%04x%04x%04x," "service_id=%016llx\n", @@ -2122,7 +2122,6 @@ static ssize_t show_login_info(struct device *dev, be16_to_cpu(((__be16 *) sport->gid.raw)[6]), be16_to_cpu(((__be16 *) sport->gid.raw)[7]), (unsigned long long) mellanox_ioc_guid); - buf += len; } return len;