Author: sephe
Date: Wed Mar  2 02:27:13 2016
New Revision: 296293
URL: https://svnweb.freebsd.org/changeset/base/296293

Log:
  hyperv/hn: Pass channel to hv_nv_on_receive_completion()
  
  While I'm here, staticize this function.
  
  Submitted by: Hongjiang Zhang <honzhan microsoft com>
  Modified by:  sephe
  MFC after:    1 week
  Sponsored by: Microsoft OSTC

Modified:
  head/sys/dev/hyperv/netvsc/hv_net_vsc.c
  head/sys/dev/hyperv/netvsc/hv_net_vsc.h

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c     Wed Mar  2 02:12:01 2016        
(r296292)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c     Wed Mar  2 02:27:13 2016        
(r296293)
@@ -62,6 +62,8 @@ static int  hv_nv_destroy_rx_buffer(netv
 static int  hv_nv_connect_to_vsp(struct hv_device *device);
 static void hv_nv_on_send_completion(netvsc_dev *net_dev,
     struct hv_device *device, hv_vm_packet_descriptor *pkt);
+static void hv_nv_on_receive_completion(struct hv_vmbus_channel *chan,
+    uint64_t tid, uint32_t status);
 static void hv_nv_on_receive(netvsc_dev *net_dev,
     struct hv_device *device, struct hv_vmbus_channel *chan,
     hv_vm_packet_descriptor *pkt);
@@ -911,7 +913,7 @@ hv_nv_on_receive(netvsc_dev *net_dev, st
         * messages (not just data messages) will trigger a response
         * message back to the host.
         */
-       hv_nv_on_receive_completion(device, vm_xfer_page_pkt->d.transaction_id,
+       hv_nv_on_receive_completion(chan, vm_xfer_page_pkt->d.transaction_id,
            status);
 }
 
@@ -920,8 +922,8 @@ hv_nv_on_receive(netvsc_dev *net_dev, st
  *
  * Send a receive completion packet to RNDIS device (ie NetVsp)
  */
-void
-hv_nv_on_receive_completion(struct hv_device *device, uint64_t tid,
+static void
+hv_nv_on_receive_completion(struct hv_vmbus_channel *chan, uint64_t tid,
     uint32_t status)
 {
        nvsp_msg rx_comp_msg;
@@ -936,7 +938,7 @@ hv_nv_on_receive_completion(struct hv_de
 
 retry_send_cmplt:
        /* Send the completion */
-       ret = hv_vmbus_channel_send_packet(device->channel, &rx_comp_msg,
+       ret = hv_vmbus_channel_send_packet(chan, &rx_comp_msg,
            sizeof(nvsp_msg), tid, HV_VMBUS_PACKET_TYPE_COMPLETION, 0);
        if (ret == 0) {
                /* success */

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.h     Wed Mar  2 02:12:01 2016        
(r296292)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h     Wed Mar  2 02:27:13 2016        
(r296293)
@@ -1095,8 +1095,6 @@ typedef struct hn_softc {
 extern int hv_promisc_mode;
 
 void netvsc_linkstatus_callback(struct hv_device *device_obj, uint32_t status);
-void hv_nv_on_receive_completion(struct hv_device *device,
-    uint64_t tid, uint32_t status);
 netvsc_dev *hv_nv_on_device_add(struct hv_device *device,
     void *additional_info);
 int hv_nv_on_device_remove(struct hv_device *device,
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to