RDMA: Rename port_callback to init_port

Most provider routines are callback routines which ib core invokes.
_callback suffix doesn't convey information about when such callback is
invoked. Therefore, rename port_callback to init_port.

Additionally, store the init_port function pointer in ib_device_ops, so
that it can be accessed in subsequent patches when binding rdma device to
net namespace.

Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
Parav Pandit
2018-12-18 14:28:30 +02:00
committed by Jason Gunthorpe
parent 081de9495c
commit ea4baf7f11
22 changed files with 35 additions and 42 deletions

View File

@@ -2504,6 +2504,12 @@ struct ib_device_ops {
*/
int (*get_hw_stats)(struct ib_device *device,
struct rdma_hw_stats *stats, u8 port, int index);
/*
* This function is called once for each port when a ib device is
* registered.
*/
int (*init_port)(struct ib_device *device, u8 port_num,
struct kobject *port_sysfs);
};
struct ib_device {
@@ -2620,9 +2626,7 @@ void ib_dealloc_device(struct ib_device *device);
void ib_get_device_fw_str(struct ib_device *device, char *str);
int ib_register_device(struct ib_device *device, const char *name,
int (*port_callback)(struct ib_device *, u8,
struct kobject *));
int ib_register_device(struct ib_device *device, const char *name);
void ib_unregister_device(struct ib_device *device);
int ib_register_client (struct ib_client *client);