19 #include <linux/kernel.h>
20 #include <linux/string.h>
21 #include <linux/errno.h>
22 #include <linux/types.h>
23 #include <linux/netdevice.h>
25 #include <linux/rtnetlink.h>
43 if (vf < 0 || vf >= enic->num_vfs) {
69 static int enic_set_port_profile(
struct enic *
enic,
int vf)
77 char client_mac_str[18];
97 if (!is_zero_ether_addr(pp->
mac_addr)) {
102 netdev_err(netdev,
"Cannot find pp mac address "
105 goto add_tlv_failure;
112 snprintf(client_mac_str,
sizeof(client_mac_str),
"%pM", client_mac);
115 sizeof(client_mac_str), client_mac_str);
121 sizeof(uuid_str), uuid_str);
128 sizeof(uuid_str), uuid_str);
133 sizeof(os_type), &os_type);
145 static int enic_unset_port_profile(
struct enic *enic,
int vf)
168 static int enic_pp_preassociate(
struct enic *enic,
int vf,
170 static int enic_pp_disassociate(
struct enic *enic,
int vf,
172 static int enic_pp_preassociate_rr(
struct enic *enic,
int vf,
174 static int enic_pp_associate(
struct enic *enic,
int vf,
177 static int (*enic_pp_handlers[])(
struct enic *enic,
int vf,
186 static const int enic_pp_handlers_count =
189 static int enic_pp_preassociate(
struct enic *enic,
int vf,
195 static int enic_pp_disassociate(
struct enic *enic,
int vf,
207 if (!is_zero_ether_addr(pp->
mac_addr))
214 return enic_unset_port_profile(enic, vf);
217 static int enic_pp_preassociate_rr(
struct enic *enic,
int vf,
232 prev_pp, restore_pp);
241 err = enic_set_port_profile(enic, vf);
256 static int enic_pp_associate(
struct enic *enic,
int vf,
271 enic_are_pp_different(prev_pp, pp))) {
273 enic,
vf, prev_pp, restore_pp);
281 enic,
vf, prev_pp, restore_pp);
294 if (!is_zero_ether_addr(pp->
mac_addr))
314 if (pp->
request >= enic_pp_handlers_count
315 || !enic_pp_handlers[pp->
request])
318 return enic_pp_handlers[pp->
request](enic,
vf, prev_pp, restore_pp);