diff options
-rw-r--r-- | drivers/net/enic/enic.h | 2 | ||||
-rw-r--r-- | drivers/net/enic/enic_main.c | 33 | ||||
-rw-r--r-- | drivers/net/enic/vnic_vic.h | 31 |
3 files changed, 47 insertions, 19 deletions
diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h index 577067eef652..a937f49d9db7 100644 --- a/drivers/net/enic/enic.h +++ b/drivers/net/enic/enic.h | |||
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | #define DRV_NAME "enic" | 33 | #define DRV_NAME "enic" |
34 | #define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver" | 34 | #define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver" |
35 | #define DRV_VERSION "1.4.1.9" | 35 | #define DRV_VERSION "1.4.1.10" |
36 | #define DRV_COPYRIGHT "Copyright 2008-2010 Cisco Systems, Inc" | 36 | #define DRV_COPYRIGHT "Copyright 2008-2010 Cisco Systems, Inc" |
37 | 37 | ||
38 | #define ENIC_BARS_MAX 6 | 38 | #define ENIC_BARS_MAX 6 |
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) |
diff --git a/drivers/net/enic/vnic_vic.h b/drivers/net/enic/vnic_vic.h index 7e46e5e8600f..f700f5d9e81d 100644 --- a/drivers/net/enic/vnic_vic.h +++ b/drivers/net/enic/vnic_vic.h | |||
@@ -24,14 +24,29 @@ | |||
24 | /* Note: String field lengths include null char */ | 24 | /* Note: String field lengths include null char */ |
25 | 25 | ||
26 | #define VIC_PROVINFO_CISCO_OUI { 0x00, 0x00, 0x0c } | 26 | #define VIC_PROVINFO_CISCO_OUI { 0x00, 0x00, 0x0c } |
27 | #define VIC_PROVINFO_LINUX_TYPE 0x2 | 27 | #define VIC_PROVINFO_GENERIC_TYPE 0x4 |
28 | 28 | ||
29 | enum vic_linux_prov_tlv_type { | 29 | enum vic_generic_prov_tlv_type { |
30 | VIC_LINUX_PROV_TLV_PORT_PROFILE_NAME_STR = 0, | 30 | VIC_GENERIC_PROV_TLV_PORT_PROFILE_NAME_STR = 0, |
31 | VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR = 1, /* u8[6] */ | 31 | VIC_GENERIC_PROV_TLV_CLIENT_MAC_ADDR = 1, |
32 | VIC_LINUX_PROV_TLV_CLIENT_NAME_STR = 2, | 32 | VIC_GENERIC_PROV_TLV_CLIENT_NAME_STR = 2, |
33 | VIC_LINUX_PROV_TLV_HOST_UUID_STR = 8, | 33 | VIC_GENERIC_PROV_TLV_CLUSTER_PORT_NAME_STR = 3, |
34 | VIC_LINUX_PROV_TLV_CLIENT_UUID_STR = 9, | 34 | VIC_GENERIC_PROV_TLV_CLUSTER_PORT_UUID_STR = 4, |
35 | VIC_GENERIC_PROV_TLV_CLUSTER_UUID_STR = 5, | ||
36 | VIC_GENERIC_PROV_TLV_CLUSTER_NAME_STR = 7, | ||
37 | VIC_GENERIC_PROV_TLV_HOST_UUID_STR = 8, | ||
38 | VIC_GENERIC_PROV_TLV_CLIENT_UUID_STR = 9, | ||
39 | VIC_GENERIC_PROV_TLV_INCARNATION_NUMBER = 10, | ||
40 | VIC_GENERIC_PROV_TLV_OS_TYPE = 11, | ||
41 | VIC_GENERIC_PROV_TLV_OS_VENDOR = 12, | ||
42 | VIC_GENERIC_PROV_TLV_CLIENT_TYPE = 15, | ||
43 | }; | ||
44 | |||
45 | enum vic_generic_prov_os_type { | ||
46 | VIC_GENERIC_PROV_OS_TYPE_UNKNOWN = 0, | ||
47 | VIC_GENERIC_PROV_OS_TYPE_ESX = 1, | ||
48 | VIC_GENERIC_PROV_OS_TYPE_LINUX = 2, | ||
49 | VIC_GENERIC_PROV_OS_TYPE_WINDOWS = 3, | ||
35 | }; | 50 | }; |
36 | 51 | ||
37 | struct vic_provinfo { | 52 | struct vic_provinfo { |