diff options
Diffstat (limited to 'drivers/net/enic/vnic_dev.c')
-rw-r--r-- | drivers/net/enic/vnic_dev.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/drivers/net/enic/vnic_dev.c b/drivers/net/enic/vnic_dev.c index fb35d8b17668..c089b362a36f 100644 --- a/drivers/net/enic/vnic_dev.c +++ b/drivers/net/enic/vnic_dev.c | |||
@@ -408,10 +408,17 @@ int vnic_dev_fw_info(struct vnic_dev *vdev, | |||
408 | if (!vdev->fw_info) | 408 | if (!vdev->fw_info) |
409 | return -ENOMEM; | 409 | return -ENOMEM; |
410 | 410 | ||
411 | memset(vdev->fw_info, 0, sizeof(struct vnic_devcmd_fw_info)); | ||
412 | |||
411 | a0 = vdev->fw_info_pa; | 413 | a0 = vdev->fw_info_pa; |
414 | a1 = sizeof(struct vnic_devcmd_fw_info); | ||
412 | 415 | ||
413 | /* only get fw_info once and cache it */ | 416 | /* only get fw_info once and cache it */ |
414 | err = vnic_dev_cmd(vdev, CMD_MCPU_FW_INFO, &a0, &a1, wait); | 417 | err = vnic_dev_cmd(vdev, CMD_MCPU_FW_INFO, &a0, &a1, wait); |
418 | if (err == ERR_ECMDUNKNOWN) { | ||
419 | err = vnic_dev_cmd(vdev, CMD_MCPU_FW_INFO_OLD, | ||
420 | &a0, &a1, wait); | ||
421 | } | ||
415 | } | 422 | } |
416 | 423 | ||
417 | *fw_info = vdev->fw_info; | 424 | *fw_info = vdev->fw_info; |
@@ -419,25 +426,6 @@ int vnic_dev_fw_info(struct vnic_dev *vdev, | |||
419 | return err; | 426 | return err; |
420 | } | 427 | } |
421 | 428 | ||
422 | int vnic_dev_hw_version(struct vnic_dev *vdev, enum vnic_dev_hw_version *hw_ver) | ||
423 | { | ||
424 | struct vnic_devcmd_fw_info *fw_info; | ||
425 | int err; | ||
426 | |||
427 | err = vnic_dev_fw_info(vdev, &fw_info); | ||
428 | if (err) | ||
429 | return err; | ||
430 | |||
431 | if (strncmp(fw_info->hw_version, "A1", sizeof("A1")) == 0) | ||
432 | *hw_ver = VNIC_DEV_HW_VER_A1; | ||
433 | else if (strncmp(fw_info->hw_version, "A2", sizeof("A2")) == 0) | ||
434 | *hw_ver = VNIC_DEV_HW_VER_A2; | ||
435 | else | ||
436 | *hw_ver = VNIC_DEV_HW_VER_UNKNOWN; | ||
437 | |||
438 | return 0; | ||
439 | } | ||
440 | |||
441 | int vnic_dev_spec(struct vnic_dev *vdev, unsigned int offset, unsigned int size, | 429 | int vnic_dev_spec(struct vnic_dev *vdev, unsigned int offset, unsigned int size, |
442 | void *value) | 430 | void *value) |
443 | { | 431 | { |