Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Oct 2016 07:02:17 +0000 (UTC)
From:      Sepherosa Ziehau <sephe@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r307482 - stable/11/sys/dev/hyperv/netvsc
Message-ID:  <201610170702.u9H72HP7001627@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sephe
Date: Mon Oct 17 07:02:17 2016
New Revision: 307482
URL: https://svnweb.freebsd.org/changeset/base/307482

Log:
  MFC 304724,304728
  
  304724
      hyperv/hn: Remove the redundant rid setting for RNDIS HALT.
  
      Sponsored by:   Microsoft
      Differential Revision:  https://reviews.freebsd.org/D7595
  
  304728
      hyperv/hn: Log a warning for RESET_CMPLT.
  
      RESET is not used by the hn(4) at all, and RESET_CMPLT does not even
      have a rid to match with the pending requests.  So, let's put it
      onto an independent switch branch and log a warning about it.
  
      Sponsored by:   Microsoft
      Differential Revision:  https://reviews.freebsd.org/D7602

Modified:
  stable/11/sys/dev/hyperv/netvsc/hv_rndis_filter.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/hyperv/netvsc/hv_rndis_filter.c
==============================================================================
--- stable/11/sys/dev/hyperv/netvsc/hv_rndis_filter.c	Mon Oct 17 06:56:58 2016	(r307481)
+++ stable/11/sys/dev/hyperv/netvsc/hv_rndis_filter.c	Mon Oct 17 07:02:17 2016	(r307482)
@@ -324,16 +324,9 @@ hv_rf_receive_response(rndis_device *dev
 			memcpy(&request->response_msg, response,
 			    response->msg_len);
 		} else {
-			if (response->ndis_msg_type == REMOTE_NDIS_RESET_CMPLT) {
-				/* Does not have a request id field */
-				request->response_msg.msg.reset_complete.status =
-				    STATUS_BUFFER_OVERFLOW;
-			} else {
-				request->response_msg.msg.init_complete.status =
-				    STATUS_BUFFER_OVERFLOW;
-			}
+			request->response_msg.msg.init_complete.status =
+			    STATUS_BUFFER_OVERFLOW;
 		}
-
 		sema_post(&request->wait_sema);
 	}
 }
@@ -566,29 +559,40 @@ hv_rf_on_receive(struct hn_softc *sc, st
 
 	rndis_hdr = data;
 	switch (rndis_hdr->ndis_msg_type) {
-
 	/* data message */
 	case REMOTE_NDIS_PACKET_MSG:
 		hv_rf_receive_data(rxr, data, dlen);
 		break;
+
 	/* completion messages */
 	case REMOTE_NDIS_INITIALIZE_CMPLT:
 	case REMOTE_NDIS_QUERY_CMPLT:
 	case REMOTE_NDIS_SET_CMPLT:
-	case REMOTE_NDIS_RESET_CMPLT:
 	case REMOTE_NDIS_KEEPALIVE_CMPLT:
 		hv_rf_receive_response(rndis_dev, rndis_hdr);
 		break;
+
 	/* notification message */
 	case REMOTE_NDIS_INDICATE_STATUS_MSG:
 		hv_rf_receive_indicate_status(rndis_dev, rndis_hdr);
 		break;
+
+	case REMOTE_NDIS_RESET_CMPLT:
+		/*
+		 * Reset completed, no rid.
+		 *
+		 * NOTE:
+		 * RESET is not issued by hn(4), so this message should
+		 * _not_ be observed.
+		 */
+		if_printf(sc->hn_ifp, "RESET CMPLT received\n");
+		break;
+
 	default:
-		printf("hv_rf_on_receive():  Unknown msg_type 0x%x\n",
+		if_printf(sc->hn_ifp, "unknown RNDIS message 0x%x\n",
 			rndis_hdr->ndis_msg_type);
 		break;
 	}
-
 	return (0);
 }
 
@@ -928,7 +932,6 @@ static int
 hv_rf_halt_device(rndis_device *device)
 {
 	rndis_request *request;
-	rndis_halt_request *halt;
 	int i, ret;
 
 	/* Attempt to do a rndis device halt */
@@ -941,12 +944,6 @@ hv_rf_halt_device(rndis_device *device)
 	/* initialize "poor man's semaphore" */
 	request->halt_complete_flag = 0;
 
-	/* Set up the rndis set */
-	halt = &request->request_msg.msg.halt_request;
-	halt->request_id = atomic_fetchadd_int(&device->new_request_id, 1);
-	/* Increment to get the new value (call above returns old value) */
-	halt->request_id += 1;
-	
 	ret = hv_rf_send_request(device, request, REMOTE_NDIS_HALT_MSG);
 	if (ret != 0) {
 		return (-1);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610170702.u9H72HP7001627>