Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jul 2016 05:03:05 +0000 (UTC)
From:      Sepherosa Ziehau <sephe@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r303066 - in head/sys/dev/hyperv: include netvsc
Message-ID:  <201607200503.u6K535Oc043849@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sephe
Date: Wed Jul 20 05:03:04 2016
New Revision: 303066
URL: https://svnweb.freebsd.org/changeset/base/303066

Log:
  hyperv/vmbus: Get rid of unnecessary definition.
  
  MFC after:	1 week
  Sponsored by:	Microsoft OSTC
  Differential Revision:	https://reviews.freebsd.org/D7240

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

Modified: head/sys/dev/hyperv/include/hyperv.h
==============================================================================
--- head/sys/dev/hyperv/include/hyperv.h	Wed Jul 20 04:49:01 2016	(r303065)
+++ head/sys/dev/hyperv/include/hyperv.h	Wed Jul 20 05:03:04 2016	(r303066)
@@ -58,8 +58,6 @@
 #include <amd64/include/atomic.h>
 #include <dev/hyperv/include/hyperv_busdma.h>
 
-typedef uint8_t	hv_bool_uint8_t;
-
 #define HV_S_OK			0x00000000
 #define HV_E_FAIL		0x80004005
 #define HV_ERROR_NOT_SUPPORTED	0x80070032
@@ -90,8 +88,6 @@ struct hyperv_guid {
 
 int	hyperv_guid2str(const struct hyperv_guid *, char *, size_t);
 
-#define HW_MACADDR_LEN	6
-
 /*
  * Common defines for Hyper-V ICs
  */

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.h	Wed Jul 20 04:49:01 2016	(r303065)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h	Wed Jul 20 05:03:04 2016	(r303066)
@@ -53,6 +53,7 @@
 #include <netinet/in.h>
 #include <netinet/tcp_lro.h>
 
+#include <net/ethernet.h>
 #include <net/if.h>
 #include <net/if_media.h>
 
@@ -1065,12 +1066,12 @@ typedef struct netvsc_dev_ {
 	nvsp_msg				channel_init_packet;
 
 	nvsp_msg				revoke_packet;
-	/*uint8_t				hw_mac_addr[HW_MACADDR_LEN];*/
+	/*uint8_t				hw_mac_addr[ETHER_ADDR_LEN];*/
 
 	/* Holds rndis device info */
 	void					*extension;
 
-	hv_bool_uint8_t				destroy;
+	uint8_t					destroy;
 	/* Negotiated NVSP version */
 	uint32_t				nvsp_version;
 
@@ -1109,7 +1110,7 @@ typedef void (*pfn_on_send_rx_completion
 #endif
 
 typedef struct netvsc_packet_ {
-	hv_bool_uint8_t            is_data_pkt;      /* One byte */
+	uint8_t                    is_data_pkt;      /* One byte */
 	uint16_t		   vlan_tci;
 	uint32_t status;
 
@@ -1140,7 +1141,7 @@ typedef struct netvsc_packet_ {
 
 typedef struct {
 	uint8_t		mac_addr[6];  /* Assumption unsigned long */
-	hv_bool_uint8_t	link_state;
+	uint8_t		link_state;
 } netvsc_device_info;
 
 #ifndef HN_USE_TXDESC_BUFRING

Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c	Wed Jul 20 04:49:01 2016	(r303065)
+++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c	Wed Jul 20 05:03:04 2016	(r303066)
@@ -699,7 +699,7 @@ cleanup:
 static inline int
 hv_rf_query_device_mac(rndis_device *device)
 {
-	uint32_t size = HW_MACADDR_LEN;
+	uint32_t size = ETHER_ADDR_LEN;
 
 	return (hv_rf_query_device(device,
 	    RNDIS_OID_802_3_PERMANENT_ADDRESS, device->hw_mac_addr, &size));
@@ -1126,7 +1126,7 @@ hv_rf_on_device_add(struct hn_softc *sc,
 		    "hv_rf_send_offload_request failed, ret=%d\n", ret);
 	}
 	
-	memcpy(dev_info->mac_addr, rndis_dev->hw_mac_addr, HW_MACADDR_LEN);
+	memcpy(dev_info->mac_addr, rndis_dev->hw_mac_addr, ETHER_ADDR_LEN);
 
 	hv_rf_query_device_link_status(rndis_dev);
 	

Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.h
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_rndis_filter.h	Wed Jul 20 04:49:01 2016	(r303065)
+++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.h	Wed Jul 20 05:03:04 2016	(r303066)
@@ -31,6 +31,8 @@
 #ifndef __HV_RNDIS_FILTER_H__
 #define __HV_RNDIS_FILTER_H__
 
+#include <sys/param.h>
+#include <net/ethernet.h>
 
 /*
  * Defines
@@ -103,7 +105,7 @@ typedef struct rndis_device_ {
 
 	STAILQ_HEAD(RQ, rndis_request_)	myrequest_list;
 
-	uint8_t				hw_mac_addr[HW_MACADDR_LEN];
+	uint8_t				hw_mac_addr[ETHER_ADDR_LEN];
 } rndis_device;
 
 /*



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