diff options
author | Roopa Prabhu <roprabhu@cisco.com> | 2011-03-29 16:36:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-31 00:39:25 -0400 |
commit | 756462f3434ec4807a61f884d59358092a03fc15 (patch) | |
tree | 0d953f99ae7a7e781e34e49ad2ab6aa706b21675 /drivers/net/enic | |
parent | 18714ff8de7a000e7642561cabaf8ace8d082e9f (diff) |
enic: Cleanups in port profile helper code
This patch does the following:
- Introduces a new macro VIC_PROVINFO_ADD_TLV
- Adds a new OS type in vic_generic_prov_os_type
- Changes some vic_provinfo* helper routine args to constants
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/enic')
-rw-r--r-- | drivers/net/enic/vnic_vic.c | 5 | ||||
-rw-r--r-- | drivers/net/enic/vnic_vic.h | 13 |
2 files changed, 14 insertions, 4 deletions
diff --git a/drivers/net/enic/vnic_vic.c b/drivers/net/enic/vnic_vic.c index 4725b79de0ef..24ef8cd40545 100644 --- a/drivers/net/enic/vnic_vic.c +++ b/drivers/net/enic/vnic_vic.c | |||
@@ -23,7 +23,8 @@ | |||
23 | 23 | ||
24 | #include "vnic_vic.h" | 24 | #include "vnic_vic.h" |
25 | 25 | ||
26 | struct vic_provinfo *vic_provinfo_alloc(gfp_t flags, u8 *oui, u8 type) | 26 | struct vic_provinfo *vic_provinfo_alloc(gfp_t flags, const u8 *oui, |
27 | const u8 type) | ||
27 | { | 28 | { |
28 | struct vic_provinfo *vp; | 29 | struct vic_provinfo *vp; |
29 | 30 | ||
@@ -47,7 +48,7 @@ void vic_provinfo_free(struct vic_provinfo *vp) | |||
47 | } | 48 | } |
48 | 49 | ||
49 | int vic_provinfo_add_tlv(struct vic_provinfo *vp, u16 type, u16 length, | 50 | int vic_provinfo_add_tlv(struct vic_provinfo *vp, u16 type, u16 length, |
50 | void *value) | 51 | const void *value) |
51 | { | 52 | { |
52 | struct vic_provinfo_tlv *tlv; | 53 | struct vic_provinfo_tlv *tlv; |
53 | 54 | ||
diff --git a/drivers/net/enic/vnic_vic.h b/drivers/net/enic/vnic_vic.h index f700f5d9e81d..9ef81f148351 100644 --- a/drivers/net/enic/vnic_vic.h +++ b/drivers/net/enic/vnic_vic.h | |||
@@ -47,6 +47,7 @@ enum vic_generic_prov_os_type { | |||
47 | VIC_GENERIC_PROV_OS_TYPE_ESX = 1, | 47 | VIC_GENERIC_PROV_OS_TYPE_ESX = 1, |
48 | VIC_GENERIC_PROV_OS_TYPE_LINUX = 2, | 48 | VIC_GENERIC_PROV_OS_TYPE_LINUX = 2, |
49 | VIC_GENERIC_PROV_OS_TYPE_WINDOWS = 3, | 49 | VIC_GENERIC_PROV_OS_TYPE_WINDOWS = 3, |
50 | VIC_GENERIC_PROV_OS_TYPE_SOLARIS = 4, | ||
50 | }; | 51 | }; |
51 | 52 | ||
52 | struct vic_provinfo { | 53 | struct vic_provinfo { |
@@ -61,14 +62,22 @@ struct vic_provinfo { | |||
61 | } tlv[0]; | 62 | } tlv[0]; |
62 | } __packed; | 63 | } __packed; |
63 | 64 | ||
65 | #define VIC_PROVINFO_ADD_TLV(vp, tlvtype, tlvlen, data) \ | ||
66 | do { \ | ||
67 | err = vic_provinfo_add_tlv(vp, tlvtype, tlvlen, data); \ | ||
68 | if (err) \ | ||
69 | goto add_tlv_failure; \ | ||
70 | } while (0) | ||
71 | |||
64 | #define VIC_PROVINFO_MAX_DATA 1385 | 72 | #define VIC_PROVINFO_MAX_DATA 1385 |
65 | #define VIC_PROVINFO_MAX_TLV_DATA (VIC_PROVINFO_MAX_DATA - \ | 73 | #define VIC_PROVINFO_MAX_TLV_DATA (VIC_PROVINFO_MAX_DATA - \ |
66 | sizeof(struct vic_provinfo)) | 74 | sizeof(struct vic_provinfo)) |
67 | 75 | ||
68 | struct vic_provinfo *vic_provinfo_alloc(gfp_t flags, u8 *oui, u8 type); | 76 | struct vic_provinfo *vic_provinfo_alloc(gfp_t flags, const u8 *oui, |
77 | const u8 type); | ||
69 | void vic_provinfo_free(struct vic_provinfo *vp); | 78 | void vic_provinfo_free(struct vic_provinfo *vp); |
70 | int vic_provinfo_add_tlv(struct vic_provinfo *vp, u16 type, u16 length, | 79 | int vic_provinfo_add_tlv(struct vic_provinfo *vp, u16 type, u16 length, |
71 | void *value); | 80 | const void *value); |
72 | size_t vic_provinfo_size(struct vic_provinfo *vp); | 81 | size_t vic_provinfo_size(struct vic_provinfo *vp); |
73 | 82 | ||
74 | #endif /* _VNIC_VIC_H_ */ | 83 | #endif /* _VNIC_VIC_H_ */ |