diff options
-rw-r--r-- | drivers/infiniband/core/device.c | 9 | ||||
-rw-r--r-- | include/rdma/ib_verbs.h | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index 5c155fa91eec..760ef603a468 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c | |||
@@ -311,6 +311,15 @@ static int read_port_immutable(struct ib_device *device) | |||
311 | return 0; | 311 | return 0; |
312 | } | 312 | } |
313 | 313 | ||
314 | void ib_get_device_fw_str(struct ib_device *dev, char *str, size_t str_len) | ||
315 | { | ||
316 | if (dev->get_dev_fw_str) | ||
317 | dev->get_dev_fw_str(dev, str, str_len); | ||
318 | else | ||
319 | str[0] = '\0'; | ||
320 | } | ||
321 | EXPORT_SYMBOL(ib_get_device_fw_str); | ||
322 | |||
314 | /** | 323 | /** |
315 | * ib_register_device - Register an IB device with IB core | 324 | * ib_register_device - Register an IB device with IB core |
316 | * @device:Device to register | 325 | * @device:Device to register |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 7e440d41487a..1dc3d0d90202 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -1956,6 +1956,7 @@ struct ib_device { | |||
1956 | * in fast paths. | 1956 | * in fast paths. |
1957 | */ | 1957 | */ |
1958 | int (*get_port_immutable)(struct ib_device *, u8, struct ib_port_immutable *); | 1958 | int (*get_port_immutable)(struct ib_device *, u8, struct ib_port_immutable *); |
1959 | void (*get_dev_fw_str)(struct ib_device *, char *str, size_t str_len); | ||
1959 | }; | 1960 | }; |
1960 | 1961 | ||
1961 | struct ib_client { | 1962 | struct ib_client { |
@@ -1991,6 +1992,8 @@ struct ib_client { | |||
1991 | struct ib_device *ib_alloc_device(size_t size); | 1992 | struct ib_device *ib_alloc_device(size_t size); |
1992 | void ib_dealloc_device(struct ib_device *device); | 1993 | void ib_dealloc_device(struct ib_device *device); |
1993 | 1994 | ||
1995 | void ib_get_device_fw_str(struct ib_device *device, char *str, size_t str_len); | ||
1996 | |||
1994 | int ib_register_device(struct ib_device *device, | 1997 | int ib_register_device(struct ib_device *device, |
1995 | int (*port_callback)(struct ib_device *, | 1998 | int (*port_callback)(struct ib_device *, |
1996 | u8, struct kobject *)); | 1999 | u8, struct kobject *)); |