aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/enic
diff options
context:
space:
mode:
authorRoopa Prabhu <roprabhu@cisco.com>2011-03-29 16:35:56 -0400
committerDavid S. Miller <davem@davemloft.net>2011-03-31 00:39:24 -0400
commit18714ff8de7a000e7642561cabaf8ace8d082e9f (patch)
tree75b64d03c61e2e85c31c951bb0af21d7d7c0e74a /drivers/net/enic
parent9085fd09859fafbde17380b93d317a13c23c39af (diff)
enic: Add wrapper routines for new fw devcmds for port profile handling
This patch adds wrapper routines to new port profile related fw devcmds and removes the old ones 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/enic_dev.c62
-rw-r--r--drivers/net/enic/enic_dev.h7
2 files changed, 63 insertions, 6 deletions
diff --git a/drivers/net/enic/enic_dev.c b/drivers/net/enic/enic_dev.c
index 37ad3a1c82ee..90687b14e60f 100644
--- a/drivers/net/enic/enic_dev.c
+++ b/drivers/net/enic/enic_dev.c
@@ -177,24 +177,24 @@ int enic_vnic_dev_deinit(struct enic *enic)
177 return err; 177 return err;
178} 178}
179 179
180int enic_dev_init_prov(struct enic *enic, struct vic_provinfo *vp) 180int enic_dev_init_prov2(struct enic *enic, struct vic_provinfo *vp)
181{ 181{
182 int err; 182 int err;
183 183
184 spin_lock(&enic->devcmd_lock); 184 spin_lock(&enic->devcmd_lock);
185 err = vnic_dev_init_prov(enic->vdev, 185 err = vnic_dev_init_prov2(enic->vdev,
186 (u8 *)vp, vic_provinfo_size(vp)); 186 (u8 *)vp, vic_provinfo_size(vp));
187 spin_unlock(&enic->devcmd_lock); 187 spin_unlock(&enic->devcmd_lock);
188 188
189 return err; 189 return err;
190} 190}
191 191
192int enic_dev_init_done(struct enic *enic, int *done, int *error) 192int enic_dev_deinit_done(struct enic *enic, int *status)
193{ 193{
194 int err; 194 int err;
195 195
196 spin_lock(&enic->devcmd_lock); 196 spin_lock(&enic->devcmd_lock);
197 err = vnic_dev_init_done(enic->vdev, done, error); 197 err = vnic_dev_deinit_done(enic->vdev, status);
198 spin_unlock(&enic->devcmd_lock); 198 spin_unlock(&enic->devcmd_lock);
199 199
200 return err; 200 return err;
@@ -219,3 +219,57 @@ void enic_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
219 enic_del_vlan(enic, vid); 219 enic_del_vlan(enic, vid);
220 spin_unlock(&enic->devcmd_lock); 220 spin_unlock(&enic->devcmd_lock);
221} 221}
222
223int enic_dev_enable2(struct enic *enic, int active)
224{
225 int err;
226
227 spin_lock(&enic->devcmd_lock);
228 err = vnic_dev_enable2(enic->vdev, active);
229 spin_unlock(&enic->devcmd_lock);
230
231 return err;
232}
233
234int enic_dev_enable2_done(struct enic *enic, int *status)
235{
236 int err;
237
238 spin_lock(&enic->devcmd_lock);
239 err = vnic_dev_enable2_done(enic->vdev, status);
240 spin_unlock(&enic->devcmd_lock);
241
242 return err;
243}
244
245int enic_dev_status_to_errno(int devcmd_status)
246{
247 switch (devcmd_status) {
248 case ERR_SUCCESS:
249 return 0;
250 case ERR_EINVAL:
251 return -EINVAL;
252 case ERR_EFAULT:
253 return -EFAULT;
254 case ERR_EPERM:
255 return -EPERM;
256 case ERR_EBUSY:
257 return -EBUSY;
258 case ERR_ECMDUNKNOWN:
259 case ERR_ENOTSUPPORTED:
260 return -EOPNOTSUPP;
261 case ERR_EBADSTATE:
262 return -EINVAL;
263 case ERR_ENOMEM:
264 return -ENOMEM;
265 case ERR_ETIMEDOUT:
266 return -ETIMEDOUT;
267 case ERR_ELINKDOWN:
268 return -ENETDOWN;
269 case ERR_EINPROGRESS:
270 return -EINPROGRESS;
271 case ERR_EMAXRES:
272 default:
273 return (devcmd_status < 0) ? devcmd_status : -1;
274 }
275}
diff --git a/drivers/net/enic/enic_dev.h b/drivers/net/enic/enic_dev.h
index 495f57fcb887..d5f681337626 100644
--- a/drivers/net/enic/enic_dev.h
+++ b/drivers/net/enic/enic_dev.h
@@ -35,7 +35,10 @@ int enic_dev_set_ig_vlan_rewrite_mode(struct enic *enic);
35int enic_dev_enable(struct enic *enic); 35int enic_dev_enable(struct enic *enic);
36int enic_dev_disable(struct enic *enic); 36int enic_dev_disable(struct enic *enic);
37int enic_vnic_dev_deinit(struct enic *enic); 37int enic_vnic_dev_deinit(struct enic *enic);
38int enic_dev_init_prov(struct enic *enic, struct vic_provinfo *vp); 38int enic_dev_init_prov2(struct enic *enic, struct vic_provinfo *vp);
39int enic_dev_init_done(struct enic *enic, int *done, int *error); 39int enic_dev_deinit_done(struct enic *enic, int *status);
40int enic_dev_enable2(struct enic *enic, int arg);
41int enic_dev_enable2_done(struct enic *enic, int *status);
42int enic_dev_status_to_errno(int devcmd_status);
40 43
41#endif /* _ENIC_DEV_H_ */ 44#endif /* _ENIC_DEV_H_ */