Lines Matching defs:client
49 void hnae3_set_client_init_flag(struct hnae3_client *client,
53 if (!client || !ae_dev)
56 switch (client->type) {
69 static int hnae3_get_client_init_flag(struct hnae3_client *client,
74 switch (client->type) {
90 static int hnae3_init_client_instance(struct hnae3_client *client,
95 /* check if this client matches the type of ae_dev */
96 if (!(hnae3_client_match(client->type) &&
101 ret = ae_dev->ops->init_client_instance(client, ae_dev);
104 "fail to instantiate client, ret = %d\n", ret);
109 static void hnae3_uninit_client_instance(struct hnae3_client *client,
112 /* check if this client matches the type of ae_dev */
113 if (!(hnae3_client_match(client->type) &&
117 if (hnae3_get_client_init_flag(client, ae_dev)) {
118 ae_dev->ops->uninit_client_instance(client, ae_dev);
120 hnae3_set_client_init_flag(client, ae_dev, 0);
124 int hnae3_register_client(struct hnae3_client *client)
129 if (!client)
133 /* one system should only have one client for every type */
135 if (client_tmp->type == client->type)
139 list_add_tail(&client->node, &hnae3_client_list);
141 /* initialize the client on every matched port */
143 /* if the client could not be initialized on current port, for
146 int ret = hnae3_init_client_instance(client, ae_dev);
160 void hnae3_unregister_client(struct hnae3_client *client)
166 if (!client)
170 /* one system should only have one client for every type */
172 if (client_tmp->type == client->type) {
180 pr_err("client %s does not exist!\n", client->name);
184 /* un-initialize the client on every matched port */
186 hnae3_uninit_client_instance(client, ae_dev);
189 list_del(&client->node);
202 struct hnae3_client *client;
234 /* check the client list for the match with this ae_dev type and
235 * initialize the figure out client instance
237 list_for_each_entry(client, &hnae3_client_list, node) {
238 ret = hnae3_init_client_instance(client, ae_dev);
257 struct hnae3_client *client;
272 /* check the client list for the match with this ae_dev type and
273 * un-initialize the figure out client instance
275 list_for_each_entry(client, &hnae3_client_list, node)
276 hnae3_uninit_client_instance(client, ae_dev);
296 struct hnae3_client *client;
331 /* check the client list for the match with this ae_dev type and
332 * initialize the figure out client instance
334 list_for_each_entry(client, &hnae3_client_list, node) {
335 ret = hnae3_init_client_instance(client, ae_dev);
361 struct hnae3_client *client;
376 list_for_each_entry(client, &hnae3_client_list, node)
377 hnae3_uninit_client_instance(client, ae_dev);