Lines Matching refs:ae_dev
16 struct hnae3_ae_dev *ae_dev; in hnae3_unregister_ae_algo_prepare() local
21 list_for_each_entry(ae_dev, &hnae3_ae_dev_list, node) { in hnae3_unregister_ae_algo_prepare()
22 if (!hnae3_get_bit(ae_dev->flag, HNAE3_DEV_INITED_B)) in hnae3_unregister_ae_algo_prepare()
25 pci_id = pci_match_id(ae_algo->pdev_id_table, ae_dev->pdev); in hnae3_unregister_ae_algo_prepare()
29 device_lock(&ae_dev->pdev->dev); in hnae3_unregister_ae_algo_prepare()
30 pci_disable_sriov(ae_dev->pdev); in hnae3_unregister_ae_algo_prepare()
31 device_unlock(&ae_dev->pdev->dev); in hnae3_unregister_ae_algo_prepare()
53 struct hnae3_ae_dev *ae_dev, in hnae3_set_client_init_flag() argument
56 if (!client || !ae_dev) in hnae3_set_client_init_flag()
61 hnae3_set_bit(ae_dev->flag, HNAE3_KNIC_CLIENT_INITED_B, inited); in hnae3_set_client_init_flag()
64 hnae3_set_bit(ae_dev->flag, HNAE3_ROCE_CLIENT_INITED_B, inited); in hnae3_set_client_init_flag()
73 struct hnae3_ae_dev *ae_dev) in hnae3_get_client_init_flag() argument
79 inited = hnae3_get_bit(ae_dev->flag, in hnae3_get_client_init_flag()
83 inited = hnae3_get_bit(ae_dev->flag, in hnae3_get_client_init_flag()
94 struct hnae3_ae_dev *ae_dev) in hnae3_init_client_instance() argument
100 hnae3_get_bit(ae_dev->flag, HNAE3_DEV_INITED_B))) { in hnae3_init_client_instance()
104 ret = ae_dev->ops->init_client_instance(client, ae_dev); in hnae3_init_client_instance()
106 dev_err(&ae_dev->pdev->dev, in hnae3_init_client_instance()
113 struct hnae3_ae_dev *ae_dev) in hnae3_uninit_client_instance() argument
117 hnae3_get_bit(ae_dev->flag, HNAE3_DEV_INITED_B))) in hnae3_uninit_client_instance()
120 if (hnae3_get_client_init_flag(client, ae_dev)) { in hnae3_uninit_client_instance()
121 ae_dev->ops->uninit_client_instance(client, ae_dev); in hnae3_uninit_client_instance()
123 hnae3_set_client_init_flag(client, ae_dev, 0); in hnae3_uninit_client_instance()
130 struct hnae3_ae_dev *ae_dev; in hnae3_register_client() local
145 list_for_each_entry(ae_dev, &hnae3_ae_dev_list, node) { in hnae3_register_client()
149 int ret = hnae3_init_client_instance(client, ae_dev); in hnae3_register_client()
151 dev_err(&ae_dev->pdev->dev, in hnae3_register_client()
166 struct hnae3_ae_dev *ae_dev; in hnae3_unregister_client() local
188 list_for_each_entry(ae_dev, &hnae3_ae_dev_list, node) { in hnae3_unregister_client()
189 hnae3_uninit_client_instance(client, ae_dev); in hnae3_unregister_client()
204 struct hnae3_ae_dev *ae_dev; in hnae3_register_ae_algo() local
216 list_for_each_entry(ae_dev, &hnae3_ae_dev_list, node) { in hnae3_register_ae_algo()
217 id = pci_match_id(ae_algo->pdev_id_table, ae_dev->pdev); in hnae3_register_ae_algo()
222 dev_err(&ae_dev->pdev->dev, "ae_algo ops are null\n"); in hnae3_register_ae_algo()
225 ae_dev->ops = ae_algo->ops; in hnae3_register_ae_algo()
227 ret = ae_algo->ops->init_ae_dev(ae_dev); in hnae3_register_ae_algo()
229 dev_err(&ae_dev->pdev->dev, in hnae3_register_ae_algo()
235 hnae3_set_bit(ae_dev->flag, HNAE3_DEV_INITED_B, 1); in hnae3_register_ae_algo()
241 ret = hnae3_init_client_instance(client, ae_dev); in hnae3_register_ae_algo()
243 dev_err(&ae_dev->pdev->dev, in hnae3_register_ae_algo()
259 struct hnae3_ae_dev *ae_dev; in hnae3_unregister_ae_algo() local
267 list_for_each_entry(ae_dev, &hnae3_ae_dev_list, node) { in hnae3_unregister_ae_algo()
268 if (!hnae3_get_bit(ae_dev->flag, HNAE3_DEV_INITED_B)) in hnae3_unregister_ae_algo()
271 id = pci_match_id(ae_algo->pdev_id_table, ae_dev->pdev); in hnae3_unregister_ae_algo()
279 hnae3_uninit_client_instance(client, ae_dev); in hnae3_unregister_ae_algo()
281 ae_algo->ops->uninit_ae_dev(ae_dev); in hnae3_unregister_ae_algo()
282 hnae3_set_bit(ae_dev->flag, HNAE3_DEV_INITED_B, 0); in hnae3_unregister_ae_algo()
283 ae_dev->ops = NULL; in hnae3_unregister_ae_algo()
295 int hnae3_register_ae_dev(struct hnae3_ae_dev *ae_dev) in hnae3_register_ae_dev() argument
302 if (!ae_dev) in hnae3_register_ae_dev()
307 list_add_tail(&ae_dev->node, &hnae3_ae_dev_list); in hnae3_register_ae_dev()
311 id = pci_match_id(ae_algo->pdev_id_table, ae_dev->pdev); in hnae3_register_ae_dev()
316 dev_err(&ae_dev->pdev->dev, "ae_algo ops are null\n"); in hnae3_register_ae_dev()
320 ae_dev->ops = ae_algo->ops; in hnae3_register_ae_dev()
322 ret = ae_dev->ops->init_ae_dev(ae_dev); in hnae3_register_ae_dev()
324 dev_err(&ae_dev->pdev->dev, in hnae3_register_ae_dev()
330 hnae3_set_bit(ae_dev->flag, HNAE3_DEV_INITED_B, 1); in hnae3_register_ae_dev()
338 ret = hnae3_init_client_instance(client, ae_dev); in hnae3_register_ae_dev()
340 dev_err(&ae_dev->pdev->dev, in hnae3_register_ae_dev()
350 list_del(&ae_dev->node); in hnae3_register_ae_dev()
360 void hnae3_unregister_ae_dev(struct hnae3_ae_dev *ae_dev) in hnae3_unregister_ae_dev() argument
366 if (!ae_dev) in hnae3_unregister_ae_dev()
372 if (!hnae3_get_bit(ae_dev->flag, HNAE3_DEV_INITED_B)) in hnae3_unregister_ae_dev()
375 id = pci_match_id(ae_algo->pdev_id_table, ae_dev->pdev); in hnae3_unregister_ae_dev()
380 hnae3_uninit_client_instance(client, ae_dev); in hnae3_unregister_ae_dev()
382 ae_algo->ops->uninit_ae_dev(ae_dev); in hnae3_unregister_ae_dev()
383 hnae3_set_bit(ae_dev->flag, HNAE3_DEV_INITED_B, 0); in hnae3_unregister_ae_dev()
384 ae_dev->ops = NULL; in hnae3_unregister_ae_dev()
387 list_del(&ae_dev->node); in hnae3_unregister_ae_dev()