aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/enic/vnic_vic.h
diff options
context:
space:
mode:
authorScott Feldman <scofeldm@cisco.com>2010-05-18 01:50:19 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-18 01:50:19 -0400
commitf8bd909183acffad68780b10c1cdf36161cfd5d1 (patch)
treeaefec6e6f1e67e93bc1b2ec223f974a4cd34f00f /drivers/net/enic/vnic_vic.h
parent57b610805ce92dbd79fc97509f80fa5391b99623 (diff)
net: Add ndo_{set|get}_vf_port support for enic dynamic vnics
Add enic ndo_{set|get}_vf_port ops to support setting/getting port-profile for enic dynamic devices. Enic dynamic devices are just like normal enic eth devices except dynamic enics require an extra configuration step to assign a port-profile identifier to the interface before the interface is useable. Once a port-profile is assigned, link comes up on the interface and is ready for I/O. The port-profile is used to configure the network port assigned to the interface. The network port configuration includes VLAN membership, QoS policies, and port security settings typical of a data center network. A dynamic enic initially has a zero-mac address. Before a port-profile is assigned, a valid non-zero unicast mac address should be assign to the dynamic enic interface. Signed-off-by: Scott Feldman <scofeldm@cisco.com> Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Diffstat (limited to 'drivers/net/enic/vnic_vic.h')
-rw-r--r--drivers/net/enic/vnic_vic.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/drivers/net/enic/vnic_vic.h b/drivers/net/enic/vnic_vic.h
new file mode 100644
index 00000000000..085c2a274cb
--- /dev/null
+++ b/drivers/net/enic/vnic_vic.h
@@ -0,0 +1,59 @@
1/*
2 * Copyright 2010 Cisco Systems, Inc. All rights reserved.
3 *
4 * This program is free software; you may redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
9 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
10 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
11 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
12 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
13 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
14 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
15 * SOFTWARE.
16 *
17 */
18
19#ifndef _VNIC_VIC_H_
20#define _VNIC_VIC_H_
21
22/* Note: All integer fields in NETWORK byte order */
23
24/* Note: String field lengths include null char */
25
26#define VIC_PROVINFO_CISCO_OUI { 0x00, 0x00, 0x0c }
27#define VIC_PROVINFO_LINUX_TYPE 0x2
28
29enum vic_linux_prov_tlv_type {
30 VIC_LINUX_PROV_TLV_PORT_PROFILE_NAME_STR = 0,
31 VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR = 1, /* u8[6] */
32 VIC_LINUX_PROV_TLV_CLIENT_NAME_STR = 2,
33 VIC_LINUX_PROV_TLV_HOST_UUID_STR = 8,
34 VIC_LINUX_PROV_TLV_CLIENT_UUID_STR = 9,
35};
36
37struct vic_provinfo {
38 u8 oui[3]; /* OUI of data provider */
39 u8 type; /* provider-specific type */
40 u32 length; /* length of data below */
41 u32 num_tlvs; /* number of tlvs */
42 struct vic_provinfo_tlv {
43 u16 type;
44 u16 length;
45 u8 value[0];
46 } tlv[0];
47} __attribute__ ((packed));
48
49#define VIC_PROVINFO_MAX_DATA 1385
50#define VIC_PROVINFO_MAX_TLV_DATA (VIC_PROVINFO_MAX_DATA - \
51 sizeof(struct vic_provinfo))
52
53struct vic_provinfo *vic_provinfo_alloc(gfp_t flags, u8 *oui, u8 type);
54void vic_provinfo_free(struct vic_provinfo *vp);
55int vic_provinfo_add_tlv(struct vic_provinfo *vp, u16 type, u16 length,
56 void *value);
57size_t vic_provinfo_size(struct vic_provinfo *vp);
58
59#endif /* _VNIC_VIC_H_ */