diff options
Diffstat (limited to 'drivers/net/enic/vnic_dev.c')
-rw-r--r-- | drivers/net/enic/vnic_dev.c | 58 |
1 files changed, 56 insertions, 2 deletions
diff --git a/drivers/net/enic/vnic_dev.c b/drivers/net/enic/vnic_dev.c index d43a9d43bbf..2b3e16db5c8 100644 --- a/drivers/net/enic/vnic_dev.c +++ b/drivers/net/enic/vnic_dev.c | |||
@@ -530,7 +530,7 @@ void vnic_dev_packet_filter(struct vnic_dev *vdev, int directed, int multicast, | |||
530 | printk(KERN_ERR "Can't set packet filter\n"); | 530 | printk(KERN_ERR "Can't set packet filter\n"); |
531 | } | 531 | } |
532 | 532 | ||
533 | void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr) | 533 | int vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr) |
534 | { | 534 | { |
535 | u64 a0 = 0, a1 = 0; | 535 | u64 a0 = 0, a1 = 0; |
536 | int wait = 1000; | 536 | int wait = 1000; |
@@ -543,9 +543,11 @@ void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr) | |||
543 | err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a0, &a1, wait); | 543 | err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a0, &a1, wait); |
544 | if (err) | 544 | if (err) |
545 | printk(KERN_ERR "Can't add addr [%pM], %d\n", addr, err); | 545 | printk(KERN_ERR "Can't add addr [%pM], %d\n", addr, err); |
546 | |||
547 | return err; | ||
546 | } | 548 | } |
547 | 549 | ||
548 | void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr) | 550 | int vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr) |
549 | { | 551 | { |
550 | u64 a0 = 0, a1 = 0; | 552 | u64 a0 = 0, a1 = 0; |
551 | int wait = 1000; | 553 | int wait = 1000; |
@@ -558,6 +560,8 @@ void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr) | |||
558 | err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a0, &a1, wait); | 560 | err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a0, &a1, wait); |
559 | if (err) | 561 | if (err) |
560 | printk(KERN_ERR "Can't del addr [%pM], %d\n", addr, err); | 562 | printk(KERN_ERR "Can't del addr [%pM], %d\n", addr, err); |
563 | |||
564 | return err; | ||
561 | } | 565 | } |
562 | 566 | ||
563 | int vnic_dev_raise_intr(struct vnic_dev *vdev, u16 intr) | 567 | int vnic_dev_raise_intr(struct vnic_dev *vdev, u16 intr) |
@@ -682,6 +686,56 @@ int vnic_dev_init(struct vnic_dev *vdev, int arg) | |||
682 | return r; | 686 | return r; |
683 | } | 687 | } |
684 | 688 | ||
689 | int vnic_dev_init_done(struct vnic_dev *vdev, int *done, int *err) | ||
690 | { | ||
691 | u64 a0 = 0, a1 = 0; | ||
692 | int wait = 1000; | ||
693 | int ret; | ||
694 | |||
695 | *done = 0; | ||
696 | |||
697 | ret = vnic_dev_cmd(vdev, CMD_INIT_STATUS, &a0, &a1, wait); | ||
698 | if (ret) | ||
699 | return ret; | ||
700 | |||
701 | *done = (a0 == 0); | ||
702 | |||
703 | *err = (a0 == 0) ? a1 : 0; | ||
704 | |||
705 | return 0; | ||
706 | } | ||
707 | |||
708 | int vnic_dev_init_prov(struct vnic_dev *vdev, u8 *buf, u32 len) | ||
709 | { | ||
710 | u64 a0, a1 = len; | ||
711 | int wait = 1000; | ||
712 | u64 prov_pa; | ||
713 | void *prov_buf; | ||
714 | int ret; | ||
715 | |||
716 | prov_buf = pci_alloc_consistent(vdev->pdev, len, &prov_pa); | ||
717 | if (!prov_buf) | ||
718 | return -ENOMEM; | ||
719 | |||
720 | memcpy(prov_buf, buf, len); | ||
721 | |||
722 | a0 = prov_pa; | ||
723 | |||
724 | ret = vnic_dev_cmd(vdev, CMD_INIT_PROV_INFO, &a0, &a1, wait); | ||
725 | |||
726 | pci_free_consistent(vdev->pdev, len, prov_buf, prov_pa); | ||
727 | |||
728 | return ret; | ||
729 | } | ||
730 | |||
731 | int vnic_dev_deinit(struct vnic_dev *vdev) | ||
732 | { | ||
733 | u64 a0 = 0, a1 = 0; | ||
734 | int wait = 1000; | ||
735 | |||
736 | return vnic_dev_cmd(vdev, CMD_DEINIT, &a0, &a1, wait); | ||
737 | } | ||
738 | |||
685 | int vnic_dev_link_status(struct vnic_dev *vdev) | 739 | int vnic_dev_link_status(struct vnic_dev *vdev) |
686 | { | 740 | { |
687 | if (vdev->linkstatus) | 741 | if (vdev->linkstatus) |