aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/enic/enic_main.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-25 19:59:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-25 19:59:51 -0400
commitb1cdc4670b9508fcd47a15fbd12f70d269880b37 (patch)
treefea9e2650170886d539488f8b1e064f6ca60ad36 /drivers/net/enic/enic_main.c
parentce7d0226198aac42ed311dd2783232adc16b296d (diff)
parentf925b1303e0672effc78547353bd2ddfe11f5b5f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (63 commits) drivers/net/usb/asix.c: Fix pointer cast. be2net: Bug fix to avoid disabling bottom half during firmware upgrade. proc_dointvec: write a single value hso: add support for new products Phonet: fix potential use-after-free in pep_sock_close() ath9k: remove VEOL support for ad-hoc ath9k: change beacon allocation to prefer the first beacon slot sock.h: fix kernel-doc warning cls_cgroup: Fix build error when built-in macvlan: do proper cleanup in macvlan_common_newlink() V2 be2net: Bug fix in init code in probe net/dccp: expansion of error code size ath9k: Fix rx of mcast/bcast frames in PS mode with auto sleep wireless: fix sta_info.h kernel-doc warnings wireless: fix mac80211.h kernel-doc warnings iwlwifi: testing the wrong variable in iwl_add_bssid_station() ath9k_htc: rare leak in ath9k_hif_usb_alloc_tx_urbs() ath9k_htc: dereferencing before check in hif_usb_tx_cb() rt2x00: Fix rt2800usb TX descriptor writing. rt2x00: Fix failed SLEEP->AWAKE and AWAKE->SLEEP transitions. ...
Diffstat (limited to 'drivers/net/enic/enic_main.c')
-rw-r--r--drivers/net/enic/enic_main.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index e125113759a5..6586b5c7e4b6 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1034,9 +1034,10 @@ static int enic_set_port_profile(struct enic *enic, u8 request, u8 *mac,
1034{ 1034{
1035 struct vic_provinfo *vp; 1035 struct vic_provinfo *vp;
1036 u8 oui[3] = VIC_PROVINFO_CISCO_OUI; 1036 u8 oui[3] = VIC_PROVINFO_CISCO_OUI;
1037 unsigned short *uuid; 1037 u8 *uuid;
1038 char uuid_str[38]; 1038 char uuid_str[38];
1039 static char *uuid_fmt = "%04X%04X-%04X-%04X-%04X-%04X%04X%04X"; 1039 static char *uuid_fmt = "%02X%02X%02X%02X-%02X%02X-%02X%02X-"
1040 "%02X%02X-%02X%02X%02X%02X%0X%02X";
1040 int err; 1041 int err;
1041 1042
1042 if (!name) 1043 if (!name)
@@ -1058,20 +1059,24 @@ static int enic_set_port_profile(struct enic *enic, u8 request, u8 *mac,
1058 ETH_ALEN, mac); 1059 ETH_ALEN, mac);
1059 1060
1060 if (instance_uuid) { 1061 if (instance_uuid) {
1061 uuid = (unsigned short *)instance_uuid; 1062 uuid = instance_uuid;
1062 sprintf(uuid_str, uuid_fmt, 1063 sprintf(uuid_str, uuid_fmt,
1063 uuid[0], uuid[1], uuid[2], uuid[3], 1064 uuid[0], uuid[1], uuid[2], uuid[3],
1064 uuid[4], uuid[5], uuid[6], uuid[7]); 1065 uuid[4], uuid[5], uuid[6], uuid[7],
1066 uuid[8], uuid[9], uuid[10], uuid[11],
1067 uuid[12], uuid[13], uuid[14], uuid[15]);
1065 vic_provinfo_add_tlv(vp, 1068 vic_provinfo_add_tlv(vp,
1066 VIC_LINUX_PROV_TLV_CLIENT_UUID_STR, 1069 VIC_LINUX_PROV_TLV_CLIENT_UUID_STR,
1067 sizeof(uuid_str), uuid_str); 1070 sizeof(uuid_str), uuid_str);
1068 } 1071 }
1069 1072
1070 if (host_uuid) { 1073 if (host_uuid) {
1071 uuid = (unsigned short *)host_uuid; 1074 uuid = host_uuid;
1072 sprintf(uuid_str, uuid_fmt, 1075 sprintf(uuid_str, uuid_fmt,
1073 uuid[0], uuid[1], uuid[2], uuid[3], 1076 uuid[0], uuid[1], uuid[2], uuid[3],
1074 uuid[4], uuid[5], uuid[6], uuid[7]); 1077 uuid[4], uuid[5], uuid[6], uuid[7],
1078 uuid[8], uuid[9], uuid[10], uuid[11],
1079 uuid[12], uuid[13], uuid[14], uuid[15]);
1075 vic_provinfo_add_tlv(vp, 1080 vic_provinfo_add_tlv(vp,
1076 VIC_LINUX_PROV_TLV_HOST_UUID_STR, 1081 VIC_LINUX_PROV_TLV_HOST_UUID_STR,
1077 sizeof(uuid_str), uuid_str); 1082 sizeof(uuid_str), uuid_str);
@@ -1127,6 +1132,14 @@ static int enic_set_vf_port(struct net_device *netdev, int vf,
1127 switch (request) { 1132 switch (request) {
1128 case PORT_REQUEST_ASSOCIATE: 1133 case PORT_REQUEST_ASSOCIATE:
1129 1134
1135 /* If the interface mac addr hasn't been assigned,
1136 * assign a random mac addr before setting port-
1137 * profile.
1138 */
1139
1140 if (is_zero_ether_addr(netdev->dev_addr))
1141 random_ether_addr(netdev->dev_addr);
1142
1130 if (port[IFLA_PORT_PROFILE]) 1143 if (port[IFLA_PORT_PROFILE])
1131 name = nla_data(port[IFLA_PORT_PROFILE]); 1144 name = nla_data(port[IFLA_PORT_PROFILE]);
1132 1145