aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/enic/vnic_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/enic/vnic_dev.c')
-rw-r--r--drivers/net/enic/vnic_dev.c58
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
533void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr) 533int 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
548void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr) 550int 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
563int vnic_dev_raise_intr(struct vnic_dev *vdev, u16 intr) 567int 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
689int 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
708int 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
731int 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
685int vnic_dev_link_status(struct vnic_dev *vdev) 739int vnic_dev_link_status(struct vnic_dev *vdev)
686{ 740{
687 if (vdev->linkstatus) 741 if (vdev->linkstatus)