diff options
author | Roopa Prabhu <roprabhu@cisco.com> | 2011-03-29 16:35:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-31 00:39:24 -0400 |
commit | 18714ff8de7a000e7642561cabaf8ace8d082e9f (patch) | |
tree | 75b64d03c61e2e85c31c951bb0af21d7d7c0e74a /drivers/net/enic | |
parent | 9085fd09859fafbde17380b93d317a13c23c39af (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.c | 62 | ||||
-rw-r--r-- | drivers/net/enic/enic_dev.h | 7 |
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 | ||
180 | int enic_dev_init_prov(struct enic *enic, struct vic_provinfo *vp) | 180 | int 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 | ||
192 | int enic_dev_init_done(struct enic *enic, int *done, int *error) | 192 | int 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 | |||
223 | int 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 | |||
234 | int 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 | |||
245 | int 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); | |||
35 | int enic_dev_enable(struct enic *enic); | 35 | int enic_dev_enable(struct enic *enic); |
36 | int enic_dev_disable(struct enic *enic); | 36 | int enic_dev_disable(struct enic *enic); |
37 | int enic_vnic_dev_deinit(struct enic *enic); | 37 | int enic_vnic_dev_deinit(struct enic *enic); |
38 | int enic_dev_init_prov(struct enic *enic, struct vic_provinfo *vp); | 38 | int enic_dev_init_prov2(struct enic *enic, struct vic_provinfo *vp); |
39 | int enic_dev_init_done(struct enic *enic, int *done, int *error); | 39 | int enic_dev_deinit_done(struct enic *enic, int *status); |
40 | int enic_dev_enable2(struct enic *enic, int arg); | ||
41 | int enic_dev_enable2_done(struct enic *enic, int *status); | ||
42 | int enic_dev_status_to_errno(int devcmd_status); | ||
40 | 43 | ||
41 | #endif /* _ENIC_DEV_H_ */ | 44 | #endif /* _ENIC_DEV_H_ */ |