hyperv/vmbus: Remove needed bits

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7002
This commit is contained in:
Sepherosa Ziehau 2016-07-12 08:55:08 +00:00
parent af3be0bfa5
commit 250ca4ca3b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=302637
3 changed files with 1 additions and 73 deletions

View File

@ -43,47 +43,6 @@
#include <dev/hyperv/vmbus/vmbus_reg.h>
#include <dev/hyperv/vmbus/vmbus_var.h>
/*
* Globals
*/
hv_vmbus_connection hv_vmbus_g_connection =
{ .connect_state = HV_DISCONNECTED };
/**
* Send a connect request on the partition service connection
*/
int
hv_vmbus_connect(struct vmbus_softc *sc)
{
/**
* Make sure we are not connecting or connected
*/
if (hv_vmbus_g_connection.connect_state != HV_DISCONNECTED) {
return (-1);
}
/**
* Initialize the vmbus connection
*/
hv_vmbus_g_connection.connect_state = HV_CONNECTING;
hv_vmbus_g_connection.connect_state = HV_CONNECTED;
return (0);
}
/**
* Send a disconnect request on the partition service connection
*/
int
hv_vmbus_disconnect(void)
{
hv_vmbus_g_connection.connect_state = HV_DISCONNECTED;
return (0);
}
static __inline void
vmbus_event_flags_proc(struct vmbus_softc *sc, volatile u_long *event_flags,
int flag_cnt)

View File

@ -97,20 +97,6 @@ typedef struct hv_vmbus_channel_packet_multipage_buffer {
hv_vmbus_multipage_buffer range;
} __packed hv_vmbus_channel_packet_multipage_buffer;
/*
* VM Bus connection states
*/
typedef enum {
HV_DISCONNECTED,
HV_CONNECTING,
HV_CONNECTED,
HV_DISCONNECTING
} hv_vmbus_connect_state;
typedef struct {
hv_vmbus_connect_state connect_state;
} hv_vmbus_connection;
typedef union {
uint32_t as_uint32_t;
struct {
@ -172,12 +158,6 @@ typedef struct {
uint8_t rsvd_z4[1984];
} hv_vmbus_monitor_page;
/**
* Global variables
*/
extern hv_vmbus_connection hv_vmbus_g_connection;
/*
* Private, VM Bus functions
*/
@ -242,10 +222,4 @@ void hv_vmbus_child_device_register(struct vmbus_softc *,
int hv_vmbus_child_device_unregister(
struct hv_device *child_dev);
/**
* Connection interfaces
*/
int hv_vmbus_connect(struct vmbus_softc *);
int hv_vmbus_disconnect(void);
#endif /* __HYPERV_PRIV_H__ */

View File

@ -1169,12 +1169,8 @@ vmbus_doattach(struct vmbus_softc *sc)
sc->vmbus_flags |= VMBUS_FLAG_SYNIC;
/*
* Connect to VMBus in the root partition
* Initialize vmbus, e.g. connect to Hypervisor.
*/
ret = hv_vmbus_connect(sc);
if (ret != 0)
goto cleanup;
ret = vmbus_init(sc);
if (ret != 0)
goto cleanup;
@ -1271,7 +1267,6 @@ vmbus_detach(device_t dev)
hv_vmbus_release_unattached_channels(sc);
vmbus_disconnect(sc);
hv_vmbus_disconnect();
if (sc->vmbus_flags & VMBUS_FLAG_SYNIC) {
sc->vmbus_flags &= ~VMBUS_FLAG_SYNIC;