Made show_login_info() work for InfiniBand HCA's with more than two
authorbvassche <bvassche@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Sun, 26 Apr 2009 08:39:06 +0000 (08:39 +0000)
committerbvassche <bvassche@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Sun, 26 Apr 2009 08:39:06 +0000 (08:39 +0000)
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: https://scst.svn.sourceforge.net/svnroot/scst/trunk@799 d57e44dd-8a1f-0410-8b47-8ef2f437770f

srpt/src/ib_srpt.c

index 9309dcb..3f8a3e9 100644 (file)
@@ -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;