diff options
Diffstat (limited to 'drivers/net/hyperv/netvsc.c')
-rw-r--r-- | drivers/net/hyperv/netvsc.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index d9c4c0399c88..1cd77483da50 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c | |||
@@ -558,7 +558,7 @@ int netvsc_send(struct hv_device *device, | |||
558 | } | 558 | } |
559 | 559 | ||
560 | static void netvsc_send_recv_completion(struct hv_device *device, | 560 | static void netvsc_send_recv_completion(struct hv_device *device, |
561 | u64 transaction_id) | 561 | u64 transaction_id, u32 status) |
562 | { | 562 | { |
563 | struct nvsp_message recvcompMessage; | 563 | struct nvsp_message recvcompMessage; |
564 | int retries = 0; | 564 | int retries = 0; |
@@ -571,9 +571,7 @@ static void netvsc_send_recv_completion(struct hv_device *device, | |||
571 | recvcompMessage.hdr.msg_type = | 571 | recvcompMessage.hdr.msg_type = |
572 | NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE; | 572 | NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE; |
573 | 573 | ||
574 | /* FIXME: Pass in the status */ | 574 | recvcompMessage.msg.v1_msg.send_rndis_pkt_complete.status = status; |
575 | recvcompMessage.msg.v1_msg.send_rndis_pkt_complete.status = | ||
576 | NVSP_STAT_SUCCESS; | ||
577 | 575 | ||
578 | retry_send_cmplt: | 576 | retry_send_cmplt: |
579 | /* Send the completion */ | 577 | /* Send the completion */ |
@@ -613,6 +611,7 @@ static void netvsc_receive_completion(void *context) | |||
613 | bool fsend_receive_comp = false; | 611 | bool fsend_receive_comp = false; |
614 | unsigned long flags; | 612 | unsigned long flags; |
615 | struct net_device *ndev; | 613 | struct net_device *ndev; |
614 | u32 status = NVSP_STAT_NONE; | ||
616 | 615 | ||
617 | /* | 616 | /* |
618 | * Even though it seems logical to do a GetOutboundNetDevice() here to | 617 | * Even though it seems logical to do a GetOutboundNetDevice() here to |
@@ -627,6 +626,9 @@ static void netvsc_receive_completion(void *context) | |||
627 | /* Overloading use of the lock. */ | 626 | /* Overloading use of the lock. */ |
628 | spin_lock_irqsave(&net_device->recv_pkt_list_lock, flags); | 627 | spin_lock_irqsave(&net_device->recv_pkt_list_lock, flags); |
629 | 628 | ||
629 | if (packet->status != NVSP_STAT_SUCCESS) | ||
630 | packet->xfer_page_pkt->status = NVSP_STAT_FAIL; | ||
631 | |||
630 | packet->xfer_page_pkt->count--; | 632 | packet->xfer_page_pkt->count--; |
631 | 633 | ||
632 | /* | 634 | /* |
@@ -636,6 +638,7 @@ static void netvsc_receive_completion(void *context) | |||
636 | if (packet->xfer_page_pkt->count == 0) { | 638 | if (packet->xfer_page_pkt->count == 0) { |
637 | fsend_receive_comp = true; | 639 | fsend_receive_comp = true; |
638 | transaction_id = packet->completion.recv.recv_completion_tid; | 640 | transaction_id = packet->completion.recv.recv_completion_tid; |
641 | status = packet->xfer_page_pkt->status; | ||
639 | list_add_tail(&packet->xfer_page_pkt->list_ent, | 642 | list_add_tail(&packet->xfer_page_pkt->list_ent, |
640 | &net_device->recv_pkt_list); | 643 | &net_device->recv_pkt_list); |
641 | 644 | ||
@@ -647,7 +650,7 @@ static void netvsc_receive_completion(void *context) | |||
647 | 650 | ||
648 | /* Send a receive completion for the xfer page packet */ | 651 | /* Send a receive completion for the xfer page packet */ |
649 | if (fsend_receive_comp) | 652 | if (fsend_receive_comp) |
650 | netvsc_send_recv_completion(device, transaction_id); | 653 | netvsc_send_recv_completion(device, transaction_id, status); |
651 | 654 | ||
652 | } | 655 | } |
653 | 656 | ||
@@ -736,7 +739,8 @@ static void netvsc_receive(struct hv_device *device, | |||
736 | flags); | 739 | flags); |
737 | 740 | ||
738 | netvsc_send_recv_completion(device, | 741 | netvsc_send_recv_completion(device, |
739 | vmxferpage_packet->d.trans_id); | 742 | vmxferpage_packet->d.trans_id, |
743 | NVSP_STAT_FAIL); | ||
740 | 744 | ||
741 | return; | 745 | return; |
742 | } | 746 | } |
@@ -744,6 +748,7 @@ static void netvsc_receive(struct hv_device *device, | |||
744 | /* Remove the 1st packet to represent the xfer page packet itself */ | 748 | /* Remove the 1st packet to represent the xfer page packet itself */ |
745 | xferpage_packet = (struct xferpage_packet *)listHead.next; | 749 | xferpage_packet = (struct xferpage_packet *)listHead.next; |
746 | list_del(&xferpage_packet->list_ent); | 750 | list_del(&xferpage_packet->list_ent); |
751 | xferpage_packet->status = NVSP_STAT_SUCCESS; | ||
747 | 752 | ||
748 | /* This is how much we can satisfy */ | 753 | /* This is how much we can satisfy */ |
749 | xferpage_packet->count = count - 1; | 754 | xferpage_packet->count = count - 1; |
@@ -760,6 +765,7 @@ static void netvsc_receive(struct hv_device *device, | |||
760 | list_del(&netvsc_packet->list_ent); | 765 | list_del(&netvsc_packet->list_ent); |
761 | 766 | ||
762 | /* Initialize the netvsc packet */ | 767 | /* Initialize the netvsc packet */ |
768 | netvsc_packet->status = NVSP_STAT_SUCCESS; | ||
763 | netvsc_packet->xfer_page_pkt = xferpage_packet; | 769 | netvsc_packet->xfer_page_pkt = xferpage_packet; |
764 | netvsc_packet->completion.recv.recv_completion = | 770 | netvsc_packet->completion.recv.recv_completion = |
765 | netvsc_receive_completion; | 771 | netvsc_receive_completion; |