Commit cc0ea2db authored by Alice Michael's avatar Alice Michael Committed by Jeff Kirsher

iavf: rename iavf_client.h defines to match driver name

The defines in iavf_client.h were still vastly i40e, and they
should be iavf.
Signed-off-by: default avatarAlice Michael <alice.michael@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 8821b3fa
...@@ -244,7 +244,7 @@ struct iavf_adapter { ...@@ -244,7 +244,7 @@ struct iavf_adapter {
int num_iwarp_msix; int num_iwarp_msix;
int iwarp_base_vector; int iwarp_base_vector;
u32 client_pending; u32 client_pending;
struct i40e_client_instance *cinst; struct iavf_client_instance *cinst;
struct msix_entry *msix_entries; struct msix_entry *msix_entries;
u32 flags; u32 flags;
......
...@@ -10,19 +10,19 @@ ...@@ -10,19 +10,19 @@
static static
const char iavf_client_interface_version_str[] = IAVF_CLIENT_VERSION_STR; const char iavf_client_interface_version_str[] = IAVF_CLIENT_VERSION_STR;
static struct i40e_client *vf_registered_client; static struct iavf_client *vf_registered_client;
static LIST_HEAD(i40e_devices); static LIST_HEAD(i40e_devices);
static DEFINE_MUTEX(iavf_device_mutex); static DEFINE_MUTEX(iavf_device_mutex);
static u32 iavf_client_virtchnl_send(struct i40e_info *ldev, static u32 iavf_client_virtchnl_send(struct iavf_info *ldev,
struct i40e_client *client, struct iavf_client *client,
u8 *msg, u16 len); u8 *msg, u16 len);
static int iavf_client_setup_qvlist(struct i40e_info *ldev, static int iavf_client_setup_qvlist(struct iavf_info *ldev,
struct i40e_client *client, struct iavf_client *client,
struct i40e_qvlist_info *qvlist_info); struct iavf_qvlist_info *qvlist_info);
static struct i40e_ops iavf_lan_ops = { static struct iavf_ops iavf_lan_ops = {
.virtchnl_send = iavf_client_virtchnl_send, .virtchnl_send = iavf_client_virtchnl_send,
.setup_qvlist = iavf_client_setup_qvlist, .setup_qvlist = iavf_client_setup_qvlist,
}; };
...@@ -33,11 +33,11 @@ static struct i40e_ops iavf_lan_ops = { ...@@ -33,11 +33,11 @@ static struct i40e_ops iavf_lan_ops = {
* @params: client param struct * @params: client param struct
**/ **/
static static
void iavf_client_get_params(struct iavf_vsi *vsi, struct i40e_params *params) void iavf_client_get_params(struct iavf_vsi *vsi, struct iavf_params *params)
{ {
int i; int i;
memset(params, 0, sizeof(struct i40e_params)); memset(params, 0, sizeof(struct iavf_params));
params->mtu = vsi->netdev->mtu; params->mtu = vsi->netdev->mtu;
params->link_up = vsi->back->link_up; params->link_up = vsi->back->link_up;
...@@ -57,7 +57,7 @@ void iavf_client_get_params(struct iavf_vsi *vsi, struct i40e_params *params) ...@@ -57,7 +57,7 @@ void iavf_client_get_params(struct iavf_vsi *vsi, struct i40e_params *params)
**/ **/
void iavf_notify_client_message(struct iavf_vsi *vsi, u8 *msg, u16 len) void iavf_notify_client_message(struct iavf_vsi *vsi, u8 *msg, u16 len)
{ {
struct i40e_client_instance *cinst; struct iavf_client_instance *cinst;
if (!vsi) if (!vsi)
return; return;
...@@ -81,8 +81,8 @@ void iavf_notify_client_message(struct iavf_vsi *vsi, u8 *msg, u16 len) ...@@ -81,8 +81,8 @@ void iavf_notify_client_message(struct iavf_vsi *vsi, u8 *msg, u16 len)
**/ **/
void iavf_notify_client_l2_params(struct iavf_vsi *vsi) void iavf_notify_client_l2_params(struct iavf_vsi *vsi)
{ {
struct i40e_client_instance *cinst; struct iavf_client_instance *cinst;
struct i40e_params params; struct iavf_params params;
if (!vsi) if (!vsi)
return; return;
...@@ -110,7 +110,7 @@ void iavf_notify_client_l2_params(struct iavf_vsi *vsi) ...@@ -110,7 +110,7 @@ void iavf_notify_client_l2_params(struct iavf_vsi *vsi)
void iavf_notify_client_open(struct iavf_vsi *vsi) void iavf_notify_client_open(struct iavf_vsi *vsi)
{ {
struct iavf_adapter *adapter = vsi->back; struct iavf_adapter *adapter = vsi->back;
struct i40e_client_instance *cinst = adapter->cinst; struct iavf_client_instance *cinst = adapter->cinst;
int ret; int ret;
if (!cinst || !cinst->client || !cinst->client->ops || if (!cinst || !cinst->client || !cinst->client->ops ||
...@@ -119,10 +119,10 @@ void iavf_notify_client_open(struct iavf_vsi *vsi) ...@@ -119,10 +119,10 @@ void iavf_notify_client_open(struct iavf_vsi *vsi)
"Cannot locate client instance open function\n"); "Cannot locate client instance open function\n");
return; return;
} }
if (!(test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cinst->state))) { if (!(test_bit(__IAVF_CLIENT_INSTANCE_OPENED, &cinst->state))) {
ret = cinst->client->ops->open(&cinst->lan_info, cinst->client); ret = cinst->client->ops->open(&cinst->lan_info, cinst->client);
if (!ret) if (!ret)
set_bit(__I40E_CLIENT_INSTANCE_OPENED, &cinst->state); set_bit(__IAVF_CLIENT_INSTANCE_OPENED, &cinst->state);
} }
} }
...@@ -132,7 +132,7 @@ void iavf_notify_client_open(struct iavf_vsi *vsi) ...@@ -132,7 +132,7 @@ void iavf_notify_client_open(struct iavf_vsi *vsi)
* *
* Return 0 on success or < 0 on error * Return 0 on success or < 0 on error
**/ **/
static int iavf_client_release_qvlist(struct i40e_info *ldev) static int iavf_client_release_qvlist(struct iavf_info *ldev)
{ {
struct iavf_adapter *adapter = ldev->vf; struct iavf_adapter *adapter = ldev->vf;
enum iavf_status err; enum iavf_status err;
...@@ -162,7 +162,7 @@ static int iavf_client_release_qvlist(struct i40e_info *ldev) ...@@ -162,7 +162,7 @@ static int iavf_client_release_qvlist(struct i40e_info *ldev)
void iavf_notify_client_close(struct iavf_vsi *vsi, bool reset) void iavf_notify_client_close(struct iavf_vsi *vsi, bool reset)
{ {
struct iavf_adapter *adapter = vsi->back; struct iavf_adapter *adapter = vsi->back;
struct i40e_client_instance *cinst = adapter->cinst; struct iavf_client_instance *cinst = adapter->cinst;
if (!cinst || !cinst->client || !cinst->client->ops || if (!cinst || !cinst->client || !cinst->client->ops ||
!cinst->client->ops->close) { !cinst->client->ops->close) {
...@@ -172,7 +172,7 @@ void iavf_notify_client_close(struct iavf_vsi *vsi, bool reset) ...@@ -172,7 +172,7 @@ void iavf_notify_client_close(struct iavf_vsi *vsi, bool reset)
} }
cinst->client->ops->close(&cinst->lan_info, cinst->client, reset); cinst->client->ops->close(&cinst->lan_info, cinst->client, reset);
iavf_client_release_qvlist(&cinst->lan_info); iavf_client_release_qvlist(&cinst->lan_info);
clear_bit(__I40E_CLIENT_INSTANCE_OPENED, &cinst->state); clear_bit(__IAVF_CLIENT_INSTANCE_OPENED, &cinst->state);
} }
/** /**
...@@ -181,13 +181,13 @@ void iavf_notify_client_close(struct iavf_vsi *vsi, bool reset) ...@@ -181,13 +181,13 @@ void iavf_notify_client_close(struct iavf_vsi *vsi, bool reset)
* *
* Returns cinst ptr on success, NULL on failure * Returns cinst ptr on success, NULL on failure
**/ **/
static struct i40e_client_instance * static struct iavf_client_instance *
iavf_client_add_instance(struct iavf_adapter *adapter) iavf_client_add_instance(struct iavf_adapter *adapter)
{ {
struct i40e_client_instance *cinst = NULL; struct iavf_client_instance *cinst = NULL;
struct iavf_vsi *vsi = &adapter->vsi; struct iavf_vsi *vsi = &adapter->vsi;
struct netdev_hw_addr *mac = NULL; struct netdev_hw_addr *mac = NULL;
struct i40e_params params; struct iavf_params params;
if (!vf_registered_client) if (!vf_registered_client)
goto out; goto out;
...@@ -205,7 +205,7 @@ iavf_client_add_instance(struct iavf_adapter *adapter) ...@@ -205,7 +205,7 @@ iavf_client_add_instance(struct iavf_adapter *adapter)
cinst->lan_info.netdev = vsi->netdev; cinst->lan_info.netdev = vsi->netdev;
cinst->lan_info.pcidev = adapter->pdev; cinst->lan_info.pcidev = adapter->pdev;
cinst->lan_info.fid = 0; cinst->lan_info.fid = 0;
cinst->lan_info.ftype = I40E_CLIENT_FTYPE_VF; cinst->lan_info.ftype = IAVF_CLIENT_FTYPE_VF;
cinst->lan_info.hw_addr = adapter->hw.hw_addr; cinst->lan_info.hw_addr = adapter->hw.hw_addr;
cinst->lan_info.ops = &iavf_lan_ops; cinst->lan_info.ops = &iavf_lan_ops;
cinst->lan_info.version.major = IAVF_CLIENT_VERSION_MAJOR; cinst->lan_info.version.major = IAVF_CLIENT_VERSION_MAJOR;
...@@ -213,7 +213,7 @@ iavf_client_add_instance(struct iavf_adapter *adapter) ...@@ -213,7 +213,7 @@ iavf_client_add_instance(struct iavf_adapter *adapter)
cinst->lan_info.version.build = IAVF_CLIENT_VERSION_BUILD; cinst->lan_info.version.build = IAVF_CLIENT_VERSION_BUILD;
iavf_client_get_params(vsi, &params); iavf_client_get_params(vsi, &params);
cinst->lan_info.params = params; cinst->lan_info.params = params;
set_bit(__I40E_CLIENT_INSTANCE_NONE, &cinst->state); set_bit(__IAVF_CLIENT_INSTANCE_NONE, &cinst->state);
cinst->lan_info.msix_count = adapter->num_iwarp_msix; cinst->lan_info.msix_count = adapter->num_iwarp_msix;
cinst->lan_info.msix_entries = cinst->lan_info.msix_entries =
...@@ -250,8 +250,8 @@ void iavf_client_del_instance(struct iavf_adapter *adapter) ...@@ -250,8 +250,8 @@ void iavf_client_del_instance(struct iavf_adapter *adapter)
**/ **/
void iavf_client_subtask(struct iavf_adapter *adapter) void iavf_client_subtask(struct iavf_adapter *adapter)
{ {
struct i40e_client *client = vf_registered_client; struct iavf_client *client = vf_registered_client;
struct i40e_client_instance *cinst; struct iavf_client_instance *cinst;
int ret = 0; int ret = 0;
if (adapter->state < __IAVF_DOWN) if (adapter->state < __IAVF_DOWN)
...@@ -269,13 +269,13 @@ void iavf_client_subtask(struct iavf_adapter *adapter) ...@@ -269,13 +269,13 @@ void iavf_client_subtask(struct iavf_adapter *adapter)
dev_info(&adapter->pdev->dev, "Added instance of Client %s\n", dev_info(&adapter->pdev->dev, "Added instance of Client %s\n",
client->name); client->name);
if (!test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cinst->state)) { if (!test_bit(__IAVF_CLIENT_INSTANCE_OPENED, &cinst->state)) {
/* Send an Open request to the client */ /* Send an Open request to the client */
if (client->ops && client->ops->open) if (client->ops && client->ops->open)
ret = client->ops->open(&cinst->lan_info, client); ret = client->ops->open(&cinst->lan_info, client);
if (!ret) if (!ret)
set_bit(__I40E_CLIENT_INSTANCE_OPENED, set_bit(__IAVF_CLIENT_INSTANCE_OPENED,
&cinst->state); &cinst->state);
else else
/* remove client instance */ /* remove client instance */
...@@ -357,9 +357,9 @@ int iavf_lan_del_device(struct iavf_adapter *adapter) ...@@ -357,9 +357,9 @@ int iavf_lan_del_device(struct iavf_adapter *adapter)
* @client: pointer to the registered client * @client: pointer to the registered client
* *
**/ **/
static void iavf_client_release(struct i40e_client *client) static void iavf_client_release(struct iavf_client *client)
{ {
struct i40e_client_instance *cinst; struct iavf_client_instance *cinst;
struct i40e_device *ldev; struct i40e_device *ldev;
struct iavf_adapter *adapter; struct iavf_adapter *adapter;
...@@ -369,12 +369,12 @@ static void iavf_client_release(struct i40e_client *client) ...@@ -369,12 +369,12 @@ static void iavf_client_release(struct i40e_client *client)
cinst = adapter->cinst; cinst = adapter->cinst;
if (!cinst) if (!cinst)
continue; continue;
if (test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cinst->state)) { if (test_bit(__IAVF_CLIENT_INSTANCE_OPENED, &cinst->state)) {
if (client->ops && client->ops->close) if (client->ops && client->ops->close)
client->ops->close(&cinst->lan_info, client, client->ops->close(&cinst->lan_info, client,
false); false);
iavf_client_release_qvlist(&cinst->lan_info); iavf_client_release_qvlist(&cinst->lan_info);
clear_bit(__I40E_CLIENT_INSTANCE_OPENED, &cinst->state); clear_bit(__IAVF_CLIENT_INSTANCE_OPENED, &cinst->state);
dev_warn(&adapter->pdev->dev, dev_warn(&adapter->pdev->dev,
"Client %s instance closed\n", client->name); "Client %s instance closed\n", client->name);
...@@ -392,7 +392,7 @@ static void iavf_client_release(struct i40e_client *client) ...@@ -392,7 +392,7 @@ static void iavf_client_release(struct i40e_client *client)
* @client: pointer to the registered client * @client: pointer to the registered client
* *
**/ **/
static void iavf_client_prepare(struct i40e_client *client) static void iavf_client_prepare(struct iavf_client *client)
{ {
struct i40e_device *ldev; struct i40e_device *ldev;
struct iavf_adapter *adapter; struct iavf_adapter *adapter;
...@@ -415,8 +415,8 @@ static void iavf_client_prepare(struct i40e_client *client) ...@@ -415,8 +415,8 @@ static void iavf_client_prepare(struct i40e_client *client)
* *
* Return 0 on success or < 0 on error * Return 0 on success or < 0 on error
**/ **/
static u32 iavf_client_virtchnl_send(struct i40e_info *ldev, static u32 iavf_client_virtchnl_send(struct iavf_info *ldev,
struct i40e_client *client, struct iavf_client *client,
u8 *msg, u16 len) u8 *msg, u16 len)
{ {
struct iavf_adapter *adapter = ldev->vf; struct iavf_adapter *adapter = ldev->vf;
...@@ -442,13 +442,13 @@ static u32 iavf_client_virtchnl_send(struct i40e_info *ldev, ...@@ -442,13 +442,13 @@ static u32 iavf_client_virtchnl_send(struct i40e_info *ldev,
* *
* Return 0 on success or < 0 on error * Return 0 on success or < 0 on error
**/ **/
static int iavf_client_setup_qvlist(struct i40e_info *ldev, static int iavf_client_setup_qvlist(struct iavf_info *ldev,
struct i40e_client *client, struct iavf_client *client,
struct i40e_qvlist_info *qvlist_info) struct iavf_qvlist_info *qvlist_info)
{ {
struct virtchnl_iwarp_qvlist_info *v_qvlist_info; struct virtchnl_iwarp_qvlist_info *v_qvlist_info;
struct iavf_adapter *adapter = ldev->vf; struct iavf_adapter *adapter = ldev->vf;
struct i40e_qv_info *qv_info; struct iavf_qv_info *qv_info;
enum iavf_status err; enum iavf_status err;
u32 v_idx, i; u32 v_idx, i;
size_t msg_size; size_t msg_size;
...@@ -499,11 +499,11 @@ static int iavf_client_setup_qvlist(struct i40e_info *ldev, ...@@ -499,11 +499,11 @@ static int iavf_client_setup_qvlist(struct i40e_info *ldev,
/** /**
* iavf_register_client - Register a i40e client driver with the L2 driver * iavf_register_client - Register a i40e client driver with the L2 driver
* @client: pointer to the i40e_client struct * @client: pointer to the iavf_client struct
* *
* Returns 0 on success or non-0 on error * Returns 0 on success or non-0 on error
**/ **/
int iavf_register_client(struct i40e_client *client) int iavf_register_client(struct iavf_client *client)
{ {
int ret = 0; int ret = 0;
...@@ -550,11 +550,11 @@ EXPORT_SYMBOL(iavf_register_client); ...@@ -550,11 +550,11 @@ EXPORT_SYMBOL(iavf_register_client);
/** /**
* iavf_unregister_client - Unregister a i40e client driver with the L2 driver * iavf_unregister_client - Unregister a i40e client driver with the L2 driver
* @client: pointer to the i40e_client struct * @client: pointer to the iavf_client struct
* *
* Returns 0 on success or non-0 on error * Returns 0 on success or non-0 on error
**/ **/
int iavf_unregister_client(struct i40e_client *client) int iavf_unregister_client(struct iavf_client *client)
{ {
int ret = 0; int ret = 0;
......
...@@ -17,86 +17,86 @@ ...@@ -17,86 +17,86 @@
__stringify(IAVF_CLIENT_VERSION_MINOR) "." \ __stringify(IAVF_CLIENT_VERSION_MINOR) "." \
__stringify(IAVF_CLIENT_VERSION_BUILD) __stringify(IAVF_CLIENT_VERSION_BUILD)
struct i40e_client_version { struct iavf_client_version {
u8 major; u8 major;
u8 minor; u8 minor;
u8 build; u8 build;
u8 rsvd; u8 rsvd;
}; };
enum i40e_client_state { enum iavf_client_state {
__I40E_CLIENT_NULL, __IAVF_CLIENT_NULL,
__I40E_CLIENT_REGISTERED __IAVF_CLIENT_REGISTERED
}; };
enum i40e_client_instance_state { enum iavf_client_instance_state {
__I40E_CLIENT_INSTANCE_NONE, __IAVF_CLIENT_INSTANCE_NONE,
__I40E_CLIENT_INSTANCE_OPENED, __IAVF_CLIENT_INSTANCE_OPENED,
}; };
struct i40e_ops; struct iavf_ops;
struct i40e_client; struct iavf_client;
/* HW does not define a type value for AEQ; only for RX/TX and CEQ. /* HW does not define a type value for AEQ; only for RX/TX and CEQ.
* In order for us to keep the interface simple, SW will define a * In order for us to keep the interface simple, SW will define a
* unique type value for AEQ. * unique type value for AEQ.
*/ */
#define I40E_QUEUE_TYPE_PE_AEQ 0x80 #define IAVF_QUEUE_TYPE_PE_AEQ 0x80
#define I40E_QUEUE_INVALID_IDX 0xFFFF #define IAVF_QUEUE_INVALID_IDX 0xFFFF
struct i40e_qv_info { struct iavf_qv_info {
u32 v_idx; /* msix_vector */ u32 v_idx; /* msix_vector */
u16 ceq_idx; u16 ceq_idx;
u16 aeq_idx; u16 aeq_idx;
u8 itr_idx; u8 itr_idx;
}; };
struct i40e_qvlist_info { struct iavf_qvlist_info {
u32 num_vectors; u32 num_vectors;
struct i40e_qv_info qv_info[1]; struct iavf_qv_info qv_info[1];
}; };
#define I40E_CLIENT_MSIX_ALL 0xFFFFFFFF #define IAVF_CLIENT_MSIX_ALL 0xFFFFFFFF
/* set of LAN parameters useful for clients managed by LAN */ /* set of LAN parameters useful for clients managed by LAN */
/* Struct to hold per priority info */ /* Struct to hold per priority info */
struct i40e_prio_qos_params { struct iavf_prio_qos_params {
u16 qs_handle; /* qs handle for prio */ u16 qs_handle; /* qs handle for prio */
u8 tc; /* TC mapped to prio */ u8 tc; /* TC mapped to prio */
u8 reserved; u8 reserved;
}; };
#define I40E_CLIENT_MAX_USER_PRIORITY 8 #define IAVF_CLIENT_MAX_USER_PRIORITY 8
/* Struct to hold Client QoS */ /* Struct to hold Client QoS */
struct i40e_qos_params { struct iavf_qos_params {
struct i40e_prio_qos_params prio_qos[I40E_CLIENT_MAX_USER_PRIORITY]; struct iavf_prio_qos_params prio_qos[IAVF_CLIENT_MAX_USER_PRIORITY];
}; };
struct i40e_params { struct iavf_params {
struct i40e_qos_params qos; struct iavf_qos_params qos;
u16 mtu; u16 mtu;
u16 link_up; /* boolean */ u16 link_up; /* boolean */
}; };
/* Structure to hold LAN device info for a client device */ /* Structure to hold LAN device info for a client device */
struct i40e_info { struct iavf_info {
struct i40e_client_version version; struct iavf_client_version version;
u8 lanmac[6]; u8 lanmac[6];
struct net_device *netdev; struct net_device *netdev;
struct pci_dev *pcidev; struct pci_dev *pcidev;
u8 __iomem *hw_addr; u8 __iomem *hw_addr;
u8 fid; /* function id, PF id or VF id */ u8 fid; /* function id, PF id or VF id */
#define I40E_CLIENT_FTYPE_PF 0 #define IAVF_CLIENT_FTYPE_PF 0
#define I40E_CLIENT_FTYPE_VF 1 #define IAVF_CLIENT_FTYPE_VF 1
u8 ftype; /* function type, PF or VF */ u8 ftype; /* function type, PF or VF */
void *vf; /* cast to iavf_adapter */ void *vf; /* cast to iavf_adapter */
/* All L2 params that could change during the life span of the device /* All L2 params that could change during the life span of the device
* and needs to be communicated to the client when they change * and needs to be communicated to the client when they change
*/ */
struct i40e_params params; struct iavf_params params;
struct i40e_ops *ops; struct iavf_ops *ops;
u16 msix_count; /* number of msix vectors*/ u16 msix_count; /* number of msix vectors*/
/* Array down below will be dynamically allocated based on msix_count */ /* Array down below will be dynamically allocated based on msix_count */
...@@ -104,66 +104,66 @@ struct i40e_info { ...@@ -104,66 +104,66 @@ struct i40e_info {
u16 itr_index; /* Which ITR index the PE driver is suppose to use */ u16 itr_index; /* Which ITR index the PE driver is suppose to use */
}; };
struct i40e_ops { struct iavf_ops {
/* setup_q_vector_list enables queues with a particular vector */ /* setup_q_vector_list enables queues with a particular vector */
int (*setup_qvlist)(struct i40e_info *ldev, struct i40e_client *client, int (*setup_qvlist)(struct iavf_info *ldev, struct iavf_client *client,
struct i40e_qvlist_info *qv_info); struct iavf_qvlist_info *qv_info);
u32 (*virtchnl_send)(struct i40e_info *ldev, struct i40e_client *client, u32 (*virtchnl_send)(struct iavf_info *ldev, struct iavf_client *client,
u8 *msg, u16 len); u8 *msg, u16 len);
/* If the PE Engine is unresponsive, RDMA driver can request a reset.*/ /* If the PE Engine is unresponsive, RDMA driver can request a reset.*/
void (*request_reset)(struct i40e_info *ldev, void (*request_reset)(struct iavf_info *ldev,
struct i40e_client *client); struct iavf_client *client);
}; };
struct i40e_client_ops { struct iavf_client_ops {
/* Should be called from register_client() or whenever the driver is /* Should be called from register_client() or whenever the driver is
* ready to create a specific client instance. * ready to create a specific client instance.
*/ */
int (*open)(struct i40e_info *ldev, struct i40e_client *client); int (*open)(struct iavf_info *ldev, struct iavf_client *client);
/* Should be closed when netdev is unavailable or when unregister /* Should be closed when netdev is unavailable or when unregister
* call comes in. If the close happens due to a reset, set the reset * call comes in. If the close happens due to a reset, set the reset
* bit to true. * bit to true.
*/ */
void (*close)(struct i40e_info *ldev, struct i40e_client *client, void (*close)(struct iavf_info *ldev, struct iavf_client *client,
bool reset); bool reset);
/* called when some l2 managed parameters changes - mss */ /* called when some l2 managed parameters changes - mss */
void (*l2_param_change)(struct i40e_info *ldev, void (*l2_param_change)(struct iavf_info *ldev,
struct i40e_client *client, struct iavf_client *client,
struct i40e_params *params); struct iavf_params *params);
/* called when a message is received from the PF */ /* called when a message is received from the PF */
int (*virtchnl_receive)(struct i40e_info *ldev, int (*virtchnl_receive)(struct iavf_info *ldev,
struct i40e_client *client, struct iavf_client *client,
u8 *msg, u16 len); u8 *msg, u16 len);
}; };
/* Client device */ /* Client device */
struct i40e_client_instance { struct iavf_client_instance {
struct list_head list; struct list_head list;
struct i40e_info lan_info; struct iavf_info lan_info;
struct i40e_client *client; struct iavf_client *client;
unsigned long state; unsigned long state;
}; };
struct i40e_client { struct iavf_client {
struct list_head list; /* list of registered clients */ struct list_head list; /* list of registered clients */
char name[IAVF_CLIENT_STR_LENGTH]; char name[IAVF_CLIENT_STR_LENGTH];
struct i40e_client_version version; struct iavf_client_version version;
unsigned long state; /* client state */ unsigned long state; /* client state */
atomic_t ref_cnt; /* Count of all the client devices of this kind */ atomic_t ref_cnt; /* Count of all the client devices of this kind */
u32 flags; u32 flags;
#define I40E_CLIENT_FLAGS_LAUNCH_ON_PROBE BIT(0) #define IAVF_CLIENT_FLAGS_LAUNCH_ON_PROBE BIT(0)
#define I40E_TX_FLAGS_NOTIFY_OTHER_EVENTS BIT(2) #define IAVF_TX_FLAGS_NOTIFY_OTHER_EVENTS BIT(2)
u8 type; u8 type;
#define I40E_CLIENT_IWARP 0 #define IAVF_CLIENT_IWARP 0
struct i40e_client_ops *ops; /* client ops provided by the client */ struct iavf_client_ops *ops; /* client ops provided by the client */
}; };
/* used by clients */ /* used by clients */
int iavf_register_client(struct i40e_client *client); int iavf_register_client(struct iavf_client *client);
int iavf_unregister_client(struct i40e_client *client); int iavf_unregister_client(struct iavf_client *client);
#endif /* _IAVF_CLIENT_H_ */ #endif /* _IAVF_CLIENT_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment