Lines Matching refs:cdev
86 struct i40e_client_instance *cdev = pf->cinst; in i40e_notify_client_of_vf_msg() local
88 if (!cdev || !cdev->client) in i40e_notify_client_of_vf_msg()
90 if (!cdev->client->ops || !cdev->client->ops->virtchnl_receive) { in i40e_notify_client_of_vf_msg()
95 if (!test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) { in i40e_notify_client_of_vf_msg()
99 cdev->client->ops->virtchnl_receive(&cdev->lan_info, cdev->client, in i40e_notify_client_of_vf_msg()
112 struct i40e_client_instance *cdev = pf->cinst; in i40e_notify_client_of_l2_param_changes() local
115 if (!cdev || !cdev->client) in i40e_notify_client_of_l2_param_changes()
117 if (!cdev->client->ops || !cdev->client->ops->l2_param_change) { in i40e_notify_client_of_l2_param_changes()
122 if (!test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) { in i40e_notify_client_of_l2_param_changes()
128 memcpy(&cdev->lan_info.params, ¶ms, sizeof(struct i40e_params)); in i40e_notify_client_of_l2_param_changes()
129 cdev->client->ops->l2_param_change(&cdev->lan_info, cdev->client, in i40e_notify_client_of_l2_param_changes()
171 struct i40e_client_instance *cdev = pf->cinst; in i40e_notify_client_of_netdev_close() local
173 if (!cdev || !cdev->client) in i40e_notify_client_of_netdev_close()
175 if (!cdev->client->ops || !cdev->client->ops->close) { in i40e_notify_client_of_netdev_close()
180 if (!test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) { in i40e_notify_client_of_netdev_close()
184 cdev->client->ops->close(&cdev->lan_info, cdev->client, reset); in i40e_notify_client_of_netdev_close()
185 clear_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state); in i40e_notify_client_of_netdev_close()
186 i40e_client_release_qvlist(&cdev->lan_info); in i40e_notify_client_of_netdev_close()
198 struct i40e_client_instance *cdev = pf->cinst; in i40e_notify_client_of_vf_reset() local
200 if (!cdev || !cdev->client) in i40e_notify_client_of_vf_reset()
202 if (!cdev->client->ops || !cdev->client->ops->vf_reset) { in i40e_notify_client_of_vf_reset()
207 if (!test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) { in i40e_notify_client_of_vf_reset()
211 cdev->client->ops->vf_reset(&cdev->lan_info, cdev->client, vf_id); in i40e_notify_client_of_vf_reset()
223 struct i40e_client_instance *cdev = pf->cinst; in i40e_notify_client_of_vf_enable() local
225 if (!cdev || !cdev->client) in i40e_notify_client_of_vf_enable()
227 if (!cdev->client->ops || !cdev->client->ops->vf_enable) { in i40e_notify_client_of_vf_enable()
233 &cdev->state)) { in i40e_notify_client_of_vf_enable()
237 cdev->client->ops->vf_enable(&cdev->lan_info, cdev->client, num_vfs); in i40e_notify_client_of_vf_enable()
250 struct i40e_client_instance *cdev = pf->cinst; in i40e_vf_client_capable() local
253 if (!cdev || !cdev->client) in i40e_vf_client_capable()
255 if (!cdev->client->ops || !cdev->client->ops->vf_capable) { in i40e_vf_client_capable()
260 if (!test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) in i40e_vf_client_capable()
263 capable = cdev->client->ops->vf_capable(&cdev->lan_info, in i40e_vf_client_capable()
264 cdev->client, in i40e_vf_client_capable()
272 struct i40e_client_instance *cdev = pf->cinst; in i40e_client_update_msix_info() local
274 if (!cdev || !cdev->client) in i40e_client_update_msix_info()
277 cdev->lan_info.msix_count = pf->num_iwarp_msix; in i40e_client_update_msix_info()
278 cdev->lan_info.msix_entries = &pf->msix_entries[pf->iwarp_base_vector]; in i40e_client_update_msix_info()
339 struct i40e_client_instance *cdev = NULL; in i40e_client_add_instance() local
343 cdev = kzalloc(sizeof(*cdev), GFP_KERNEL); in i40e_client_add_instance()
344 if (!cdev) in i40e_client_add_instance()
347 cdev->lan_info.pf = (void *)pf; in i40e_client_add_instance()
348 cdev->lan_info.netdev = vsi->netdev; in i40e_client_add_instance()
349 cdev->lan_info.pcidev = pf->pdev; in i40e_client_add_instance()
350 cdev->lan_info.fid = pf->hw.pf_id; in i40e_client_add_instance()
351 cdev->lan_info.ftype = I40E_CLIENT_FTYPE_PF; in i40e_client_add_instance()
352 cdev->lan_info.hw_addr = pf->hw.hw_addr; in i40e_client_add_instance()
353 cdev->lan_info.ops = &i40e_lan_ops; in i40e_client_add_instance()
354 cdev->lan_info.version.major = I40E_CLIENT_VERSION_MAJOR; in i40e_client_add_instance()
355 cdev->lan_info.version.minor = I40E_CLIENT_VERSION_MINOR; in i40e_client_add_instance()
356 cdev->lan_info.version.build = I40E_CLIENT_VERSION_BUILD; in i40e_client_add_instance()
357 cdev->lan_info.fw_maj_ver = pf->hw.aq.fw_maj_ver; in i40e_client_add_instance()
358 cdev->lan_info.fw_min_ver = pf->hw.aq.fw_min_ver; in i40e_client_add_instance()
359 cdev->lan_info.fw_build = pf->hw.aq.fw_build; in i40e_client_add_instance()
360 set_bit(__I40E_CLIENT_INSTANCE_NONE, &cdev->state); in i40e_client_add_instance()
362 if (i40e_client_get_params(vsi, &cdev->lan_info.params)) in i40e_client_add_instance()
365 mac = list_first_entry(&cdev->lan_info.netdev->dev_addrs.list, in i40e_client_add_instance()
368 ether_addr_copy(cdev->lan_info.lanmac, mac->addr); in i40e_client_add_instance()
372 pf->cinst = cdev; in i40e_client_add_instance()
374 cdev->lan_info.msix_count = pf->num_iwarp_msix; in i40e_client_add_instance()
375 cdev->lan_info.msix_entries = &pf->msix_entries[pf->iwarp_base_vector]; in i40e_client_add_instance()
377 if (i40e_register_auxiliary_dev(&cdev->lan_info, "iwarp")) in i40e_client_add_instance()
383 kfree(cdev); in i40e_client_add_instance()
406 struct i40e_client_instance *cdev; in i40e_client_subtask() local
412 cdev = pf->cinst; in i40e_client_subtask()
419 if (!cdev || !cdev->client) in i40e_client_subtask()
422 client = cdev->client; in i40e_client_subtask()
427 if (!test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) { in i40e_client_subtask()
430 set_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state); in i40e_client_subtask()
431 ret = client->ops->open(&cdev->lan_info, client); in i40e_client_subtask()
435 &cdev->state); in i40e_client_subtask()
444 i40e_client_update_vsi_ctxt(&cdev->lan_info, client, in i40e_client_subtask()
448 i40e_client_update_vsi_ctxt(&cdev->lan_info, client, in i40e_client_subtask()
739 struct i40e_client_instance *cdev = pf->cinst; in i40e_client_device_unregister() local
741 if (!cdev) in i40e_client_device_unregister()
747 if (test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) { in i40e_client_device_unregister()
748 cdev->client->ops->close(&cdev->lan_info, cdev->client, false); in i40e_client_device_unregister()
749 clear_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state); in i40e_client_device_unregister()
750 i40e_client_release_qvlist(&cdev->lan_info); in i40e_client_device_unregister()