diff options
author | Bryan O'Sullivan <bos@pathscale.com> | 2006-07-01 07:35:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-01 12:55:59 -0400 |
commit | e8a88f09f21c55a7e7f570290ecde570e2c37771 (patch) | |
tree | 26a41167c95a5cccfcc7af0d8008ceaec539b37d /drivers/infiniband/hw/ipath | |
parent | 9edbd990bb60dd7678f7f4f8ca3d92e03a1f0e67 (diff) |
[PATCH] IB/ipath: report correct device identification information in /sys
Signed-off-by: Robert Walsh <robert.walsh@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/infiniband/hw/ipath')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_layer.c | 31 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_layer.h | 6 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_mad.c | 6 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_verbs.c | 14 |
4 files changed, 35 insertions, 22 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_layer.c b/drivers/infiniband/hw/ipath/ipath_layer.c index 4b51b97de899..0f8b5290ff19 100644 --- a/drivers/infiniband/hw/ipath/ipath_layer.c +++ b/drivers/infiniband/hw/ipath/ipath_layer.c | |||
@@ -341,18 +341,26 @@ u32 ipath_layer_get_nguid(struct ipath_devdata *dd) | |||
341 | 341 | ||
342 | EXPORT_SYMBOL_GPL(ipath_layer_get_nguid); | 342 | EXPORT_SYMBOL_GPL(ipath_layer_get_nguid); |
343 | 343 | ||
344 | int ipath_layer_query_device(struct ipath_devdata *dd, u32 * vendor, | 344 | u32 ipath_layer_get_majrev(struct ipath_devdata *dd) |
345 | u32 * boardrev, u32 * majrev, u32 * minrev) | ||
346 | { | 345 | { |
347 | *vendor = dd->ipath_vendorid; | 346 | return dd->ipath_majrev; |
348 | *boardrev = dd->ipath_boardrev; | 347 | } |
349 | *majrev = dd->ipath_majrev; | ||
350 | *minrev = dd->ipath_minrev; | ||
351 | 348 | ||
352 | return 0; | 349 | EXPORT_SYMBOL_GPL(ipath_layer_get_majrev); |
350 | |||
351 | u32 ipath_layer_get_minrev(struct ipath_devdata *dd) | ||
352 | { | ||
353 | return dd->ipath_minrev; | ||
354 | } | ||
355 | |||
356 | EXPORT_SYMBOL_GPL(ipath_layer_get_minrev); | ||
357 | |||
358 | u32 ipath_layer_get_pcirev(struct ipath_devdata *dd) | ||
359 | { | ||
360 | return dd->ipath_pcirev; | ||
353 | } | 361 | } |
354 | 362 | ||
355 | EXPORT_SYMBOL_GPL(ipath_layer_query_device); | 363 | EXPORT_SYMBOL_GPL(ipath_layer_get_pcirev); |
356 | 364 | ||
357 | u32 ipath_layer_get_flags(struct ipath_devdata *dd) | 365 | u32 ipath_layer_get_flags(struct ipath_devdata *dd) |
358 | { | 366 | { |
@@ -375,6 +383,13 @@ u16 ipath_layer_get_deviceid(struct ipath_devdata *dd) | |||
375 | 383 | ||
376 | EXPORT_SYMBOL_GPL(ipath_layer_get_deviceid); | 384 | EXPORT_SYMBOL_GPL(ipath_layer_get_deviceid); |
377 | 385 | ||
386 | u32 ipath_layer_get_vendorid(struct ipath_devdata *dd) | ||
387 | { | ||
388 | return dd->ipath_vendorid; | ||
389 | } | ||
390 | |||
391 | EXPORT_SYMBOL_GPL(ipath_layer_get_vendorid); | ||
392 | |||
378 | u64 ipath_layer_get_lastibcstat(struct ipath_devdata *dd) | 393 | u64 ipath_layer_get_lastibcstat(struct ipath_devdata *dd) |
379 | { | 394 | { |
380 | return dd->ipath_lastibcstat; | 395 | return dd->ipath_lastibcstat; |
diff --git a/drivers/infiniband/hw/ipath/ipath_layer.h b/drivers/infiniband/hw/ipath/ipath_layer.h index aff755141e73..5dcffc7e53cc 100644 --- a/drivers/infiniband/hw/ipath/ipath_layer.h +++ b/drivers/infiniband/hw/ipath/ipath_layer.h | |||
@@ -144,11 +144,13 @@ int ipath_layer_want_buffer(struct ipath_devdata *dd); | |||
144 | int ipath_layer_set_guid(struct ipath_devdata *, __be64 guid); | 144 | int ipath_layer_set_guid(struct ipath_devdata *, __be64 guid); |
145 | __be64 ipath_layer_get_guid(struct ipath_devdata *); | 145 | __be64 ipath_layer_get_guid(struct ipath_devdata *); |
146 | u32 ipath_layer_get_nguid(struct ipath_devdata *); | 146 | u32 ipath_layer_get_nguid(struct ipath_devdata *); |
147 | int ipath_layer_query_device(struct ipath_devdata *, u32 * vendor, | 147 | u32 ipath_layer_get_majrev(struct ipath_devdata *); |
148 | u32 * boardrev, u32 * majrev, u32 * minrev); | 148 | u32 ipath_layer_get_minrev(struct ipath_devdata *); |
149 | u32 ipath_layer_get_pcirev(struct ipath_devdata *); | ||
149 | u32 ipath_layer_get_flags(struct ipath_devdata *dd); | 150 | u32 ipath_layer_get_flags(struct ipath_devdata *dd); |
150 | struct device *ipath_layer_get_device(struct ipath_devdata *dd); | 151 | struct device *ipath_layer_get_device(struct ipath_devdata *dd); |
151 | u16 ipath_layer_get_deviceid(struct ipath_devdata *dd); | 152 | u16 ipath_layer_get_deviceid(struct ipath_devdata *dd); |
153 | u32 ipath_layer_get_vendorid(struct ipath_devdata *); | ||
152 | u64 ipath_layer_get_lastibcstat(struct ipath_devdata *dd); | 154 | u64 ipath_layer_get_lastibcstat(struct ipath_devdata *dd); |
153 | u32 ipath_layer_get_ibmtu(struct ipath_devdata *dd); | 155 | u32 ipath_layer_get_ibmtu(struct ipath_devdata *dd); |
154 | int ipath_layer_enable_timer(struct ipath_devdata *dd); | 156 | int ipath_layer_enable_timer(struct ipath_devdata *dd); |
diff --git a/drivers/infiniband/hw/ipath/ipath_mad.c b/drivers/infiniband/hw/ipath/ipath_mad.c index ff09df2d262e..8f765341d03d 100644 --- a/drivers/infiniband/hw/ipath/ipath_mad.c +++ b/drivers/infiniband/hw/ipath/ipath_mad.c | |||
@@ -85,7 +85,7 @@ static int recv_subn_get_nodeinfo(struct ib_smp *smp, | |||
85 | { | 85 | { |
86 | struct nodeinfo *nip = (struct nodeinfo *)&smp->data; | 86 | struct nodeinfo *nip = (struct nodeinfo *)&smp->data; |
87 | struct ipath_devdata *dd = to_idev(ibdev)->dd; | 87 | struct ipath_devdata *dd = to_idev(ibdev)->dd; |
88 | u32 vendor, boardid, majrev, minrev; | 88 | u32 vendor, majrev, minrev; |
89 | 89 | ||
90 | if (smp->attr_mod) | 90 | if (smp->attr_mod) |
91 | smp->status |= IB_SMP_INVALID_FIELD; | 91 | smp->status |= IB_SMP_INVALID_FIELD; |
@@ -105,9 +105,11 @@ static int recv_subn_get_nodeinfo(struct ib_smp *smp, | |||
105 | nip->port_guid = nip->sys_guid; | 105 | nip->port_guid = nip->sys_guid; |
106 | nip->partition_cap = cpu_to_be16(ipath_layer_get_npkeys(dd)); | 106 | nip->partition_cap = cpu_to_be16(ipath_layer_get_npkeys(dd)); |
107 | nip->device_id = cpu_to_be16(ipath_layer_get_deviceid(dd)); | 107 | nip->device_id = cpu_to_be16(ipath_layer_get_deviceid(dd)); |
108 | ipath_layer_query_device(dd, &vendor, &boardid, &majrev, &minrev); | 108 | majrev = ipath_layer_get_majrev(dd); |
109 | minrev = ipath_layer_get_minrev(dd); | ||
109 | nip->revision = cpu_to_be32((majrev << 16) | minrev); | 110 | nip->revision = cpu_to_be32((majrev << 16) | minrev); |
110 | nip->local_port_num = port; | 111 | nip->local_port_num = port; |
112 | vendor = ipath_layer_get_vendorid(dd); | ||
111 | nip->vendor_id[0] = 0; | 113 | nip->vendor_id[0] = 0; |
112 | nip->vendor_id[1] = vendor >> 8; | 114 | nip->vendor_id[1] = vendor >> 8; |
113 | nip->vendor_id[2] = vendor; | 115 | nip->vendor_id[2] = vendor; |
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.c b/drivers/infiniband/hw/ipath/ipath_verbs.c index 18375e831744..e04c7619f9fe 100644 --- a/drivers/infiniband/hw/ipath/ipath_verbs.c +++ b/drivers/infiniband/hw/ipath/ipath_verbs.c | |||
@@ -568,18 +568,15 @@ static int ipath_query_device(struct ib_device *ibdev, | |||
568 | struct ib_device_attr *props) | 568 | struct ib_device_attr *props) |
569 | { | 569 | { |
570 | struct ipath_ibdev *dev = to_idev(ibdev); | 570 | struct ipath_ibdev *dev = to_idev(ibdev); |
571 | u32 vendor, boardrev, majrev, minrev; | ||
572 | 571 | ||
573 | memset(props, 0, sizeof(*props)); | 572 | memset(props, 0, sizeof(*props)); |
574 | 573 | ||
575 | props->device_cap_flags = IB_DEVICE_BAD_PKEY_CNTR | | 574 | props->device_cap_flags = IB_DEVICE_BAD_PKEY_CNTR | |
576 | IB_DEVICE_BAD_QKEY_CNTR | IB_DEVICE_SHUTDOWN_PORT | | 575 | IB_DEVICE_BAD_QKEY_CNTR | IB_DEVICE_SHUTDOWN_PORT | |
577 | IB_DEVICE_SYS_IMAGE_GUID; | 576 | IB_DEVICE_SYS_IMAGE_GUID; |
578 | ipath_layer_query_device(dev->dd, &vendor, &boardrev, | 577 | props->vendor_id = ipath_layer_get_vendorid(dev->dd); |
579 | &majrev, &minrev); | 578 | props->vendor_part_id = ipath_layer_get_deviceid(dev->dd); |
580 | props->vendor_id = vendor; | 579 | props->hw_ver = ipath_layer_get_pcirev(dev->dd); |
581 | props->vendor_part_id = boardrev; | ||
582 | props->hw_ver = boardrev << 16 | majrev << 8 | minrev; | ||
583 | 580 | ||
584 | props->sys_image_guid = dev->sys_image_guid; | 581 | props->sys_image_guid = dev->sys_image_guid; |
585 | 582 | ||
@@ -1121,11 +1118,8 @@ static ssize_t show_rev(struct class_device *cdev, char *buf) | |||
1121 | { | 1118 | { |
1122 | struct ipath_ibdev *dev = | 1119 | struct ipath_ibdev *dev = |
1123 | container_of(cdev, struct ipath_ibdev, ibdev.class_dev); | 1120 | container_of(cdev, struct ipath_ibdev, ibdev.class_dev); |
1124 | int vendor, boardrev, majrev, minrev; | ||
1125 | 1121 | ||
1126 | ipath_layer_query_device(dev->dd, &vendor, &boardrev, | 1122 | return sprintf(buf, "%x\n", ipath_layer_get_pcirev(dev->dd)); |
1127 | &majrev, &minrev); | ||
1128 | return sprintf(buf, "%d.%d\n", majrev, minrev); | ||
1129 | } | 1123 | } |
1130 | 1124 | ||
1131 | static ssize_t show_hca(struct class_device *cdev, char *buf) | 1125 | static ssize_t show_hca(struct class_device *cdev, char *buf) |