aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/enic/enic_res.c
diff options
context:
space:
mode:
authorVasanthy Kolluri <vkolluri@cisco.com>2010-06-24 06:50:12 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-25 23:46:40 -0400
commit383ab92f11dd78d365ed05cf4d83ca2acc069a1f (patch)
tree484b3957d2a28a7f5a67e37871fc729484e67d59 /drivers/net/enic/enic_res.c
parent99ef563901a18d44a6c2eadd2b958e2e83aeca51 (diff)
enic: Clean up: Add wrapper routines for firmware devcmd calls
Add wrapper routines that issue devcmds to firmware and ensure that a devcmd lock is held for each devcmd call. Signed-off-by: Scott Feldman <scofeldm@cisco.com> Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com> Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/enic/enic_res.c')
-rw-r--r--drivers/net/enic/enic_res.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 9b18840cba9..04cfc4e3f06 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -103,17 +103,7 @@ int enic_get_vnic_config(struct enic *enic)
103 return 0; 103 return 0;
104} 104}
105 105
106void enic_add_multicast_addr(struct enic *enic, u8 *addr) 106int enic_add_vlan(struct enic *enic, u16 vlanid)
107{
108 vnic_dev_add_addr(enic->vdev, addr);
109}
110
111void enic_del_multicast_addr(struct enic *enic, u8 *addr)
112{
113 vnic_dev_del_addr(enic->vdev, addr);
114}
115
116void enic_add_vlan(struct enic *enic, u16 vlanid)
117{ 107{
118 u64 a0 = vlanid, a1 = 0; 108 u64 a0 = vlanid, a1 = 0;
119 int wait = 1000; 109 int wait = 1000;
@@ -122,9 +112,11 @@ void enic_add_vlan(struct enic *enic, u16 vlanid)
122 err = vnic_dev_cmd(enic->vdev, CMD_VLAN_ADD, &a0, &a1, wait); 112 err = vnic_dev_cmd(enic->vdev, CMD_VLAN_ADD, &a0, &a1, wait);
123 if (err) 113 if (err)
124 printk(KERN_ERR PFX "Can't add vlan id, %d\n", err); 114 printk(KERN_ERR PFX "Can't add vlan id, %d\n", err);
115
116 return err;
125} 117}
126 118
127void enic_del_vlan(struct enic *enic, u16 vlanid) 119int enic_del_vlan(struct enic *enic, u16 vlanid)
128{ 120{
129 u64 a0 = vlanid, a1 = 0; 121 u64 a0 = vlanid, a1 = 0;
130 int wait = 1000; 122 int wait = 1000;
@@ -133,6 +125,8 @@ void enic_del_vlan(struct enic *enic, u16 vlanid)
133 err = vnic_dev_cmd(enic->vdev, CMD_VLAN_DEL, &a0, &a1, wait); 125 err = vnic_dev_cmd(enic->vdev, CMD_VLAN_DEL, &a0, &a1, wait);
134 if (err) 126 if (err)
135 printk(KERN_ERR PFX "Can't delete vlan id, %d\n", err); 127 printk(KERN_ERR PFX "Can't delete vlan id, %d\n", err);
128
129 return err;
136} 130}
137 131
138int enic_set_nic_cfg(struct enic *enic, u8 rss_default_cpu, u8 rss_hash_type, 132int enic_set_nic_cfg(struct enic *enic, u8 rss_default_cpu, u8 rss_hash_type,
@@ -304,11 +298,6 @@ void enic_init_vnic_resources(struct enic *enic)
304 enic->config.intr_timer_type, 298 enic->config.intr_timer_type,
305 mask_on_assertion); 299 mask_on_assertion);
306 } 300 }
307
308 /* Clear LIF stats
309 */
310
311 vnic_dev_stats_clear(enic->vdev);
312} 301}
313 302
314int enic_alloc_vnic_resources(struct enic *enic) 303int enic_alloc_vnic_resources(struct enic *enic)