aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/enic/enic_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/enic/enic_main.c')
-rw-r--r--drivers/net/enic/enic_main.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 21be989e6a14..9befd54ce6e1 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1252,7 +1252,10 @@ static int enic_set_port_profile(struct enic *enic, u8 *mac)
1252{ 1252{
1253 struct vic_provinfo *vp; 1253 struct vic_provinfo *vp;
1254 u8 oui[3] = VIC_PROVINFO_CISCO_OUI; 1254 u8 oui[3] = VIC_PROVINFO_CISCO_OUI;
1255 u16 os_type = VIC_GENERIC_PROV_OS_TYPE_LINUX;
1255 char uuid_str[38]; 1256 char uuid_str[38];
1257 char client_mac_str[18];
1258 u8 *client_mac;
1256 int err; 1259 int err;
1257 1260
1258 err = enic_vnic_dev_deinit(enic); 1261 err = enic_vnic_dev_deinit(enic);
@@ -1270,37 +1273,47 @@ static int enic_set_port_profile(struct enic *enic, u8 *mac)
1270 return -EADDRNOTAVAIL; 1273 return -EADDRNOTAVAIL;
1271 1274
1272 vp = vic_provinfo_alloc(GFP_KERNEL, oui, 1275 vp = vic_provinfo_alloc(GFP_KERNEL, oui,
1273 VIC_PROVINFO_LINUX_TYPE); 1276 VIC_PROVINFO_GENERIC_TYPE);
1274 if (!vp) 1277 if (!vp)
1275 return -ENOMEM; 1278 return -ENOMEM;
1276 1279
1277 vic_provinfo_add_tlv(vp, 1280 vic_provinfo_add_tlv(vp,
1278 VIC_LINUX_PROV_TLV_PORT_PROFILE_NAME_STR, 1281 VIC_GENERIC_PROV_TLV_PORT_PROFILE_NAME_STR,
1279 strlen(enic->pp.name) + 1, enic->pp.name); 1282 strlen(enic->pp.name) + 1, enic->pp.name);
1280 1283
1281 if (!is_zero_ether_addr(enic->pp.mac_addr)) 1284 if (!is_zero_ether_addr(enic->pp.mac_addr))
1282 vic_provinfo_add_tlv(vp, 1285 client_mac = enic->pp.mac_addr;
1283 VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR,
1284 ETH_ALEN, enic->pp.mac_addr);
1285 else 1286 else
1286 vic_provinfo_add_tlv(vp, 1287 client_mac = mac;
1287 VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR, 1288
1288 ETH_ALEN, mac); 1289 vic_provinfo_add_tlv(vp,
1290 VIC_GENERIC_PROV_TLV_CLIENT_MAC_ADDR,
1291 ETH_ALEN, client_mac);
1292
1293 sprintf(client_mac_str, "%pM", client_mac);
1294 vic_provinfo_add_tlv(vp,
1295 VIC_GENERIC_PROV_TLV_CLUSTER_PORT_UUID_STR,
1296 sizeof(client_mac_str), client_mac_str);
1289 1297
1290 if (enic->pp.set & ENIC_SET_INSTANCE) { 1298 if (enic->pp.set & ENIC_SET_INSTANCE) {
1291 sprintf(uuid_str, "%pUB", enic->pp.instance_uuid); 1299 sprintf(uuid_str, "%pUB", enic->pp.instance_uuid);
1292 vic_provinfo_add_tlv(vp, 1300 vic_provinfo_add_tlv(vp,
1293 VIC_LINUX_PROV_TLV_CLIENT_UUID_STR, 1301 VIC_GENERIC_PROV_TLV_CLIENT_UUID_STR,
1294 sizeof(uuid_str), uuid_str); 1302 sizeof(uuid_str), uuid_str);
1295 } 1303 }
1296 1304
1297 if (enic->pp.set & ENIC_SET_HOST) { 1305 if (enic->pp.set & ENIC_SET_HOST) {
1298 sprintf(uuid_str, "%pUB", enic->pp.host_uuid); 1306 sprintf(uuid_str, "%pUB", enic->pp.host_uuid);
1299 vic_provinfo_add_tlv(vp, 1307 vic_provinfo_add_tlv(vp,
1300 VIC_LINUX_PROV_TLV_HOST_UUID_STR, 1308 VIC_GENERIC_PROV_TLV_HOST_UUID_STR,
1301 sizeof(uuid_str), uuid_str); 1309 sizeof(uuid_str), uuid_str);
1302 } 1310 }
1303 1311
1312 os_type = htons(os_type);
1313 vic_provinfo_add_tlv(vp,
1314 VIC_GENERIC_PROV_TLV_OS_TYPE,
1315 sizeof(os_type), &os_type);
1316
1304 err = enic_dev_init_prov(enic, vp); 1317 err = enic_dev_init_prov(enic, vp);
1305 vic_provinfo_free(vp); 1318 vic_provinfo_free(vp);
1306 if (err) 1319 if (err)