hyperv/vmbus: Move channel packet flags definition to vmbus.h

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7176
This commit is contained in:
Sepherosa Ziehau 2016-07-15 06:49:45 +00:00
parent 66e132bd0f
commit 1680fb300c
6 changed files with 17 additions and 23 deletions

View File

@ -129,8 +129,6 @@ typedef enum {
HV_VMBUS_PACKET_TYPE_ADDITIONAL_DATA = 0xd
} hv_vmbus_packet_type;
#define HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED 1
#define HW_MACADDR_LEN 6
/*

View File

@ -47,6 +47,8 @@ struct vmbus_gpa {
uint64_t gpa_page;
} __packed;
#define VMBUS_CHANPKT_FLAG_RC 0x0001 /* report completion */
#define VMBUS_CHAN_SGLIST_MAX 32
#define VMBUS_CHAN_PRPLIST_MAX 32

View File

@ -185,8 +185,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *sc)
ret = hv_vmbus_channel_send_packet(sc->hn_prichan, init_pkt,
sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt,
HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, VMBUS_CHANPKT_FLAG_RC);
if (ret != 0) {
goto cleanup;
}
@ -279,8 +278,7 @@ hv_nv_init_send_buffer_with_net_vsp(struct hn_softc *sc)
ret = hv_vmbus_channel_send_packet(sc->hn_prichan, init_pkt,
sizeof(nvsp_msg), (uint64_t)init_pkt,
HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, VMBUS_CHANPKT_FLAG_RC);
if (ret != 0) {
goto cleanup;
}
@ -474,8 +472,7 @@ hv_nv_negotiate_nvsp_protocol(struct hn_softc *sc, netvsc_dev *net_dev,
/* Send the init request */
ret = hv_vmbus_channel_send_packet(sc->hn_prichan, init_pkt,
sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt,
HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, VMBUS_CHANPKT_FLAG_RC);
if (ret != 0)
return (-1);
@ -604,8 +601,7 @@ hv_nv_connect_to_vsp(struct hn_softc *sc)
/*
* TODO: BUGBUG - We have to wait for the above msg since the netvsp
* uses KMCL which acknowledges packet (completion packet)
* since our Vmbus always set the
* HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED flag
* since our Vmbus always set the VMBUS_CHANPKT_FLAG_RC flag
*/
/* sema_wait(&NetVscChannel->channel_init_sema); */
@ -822,8 +818,7 @@ hv_nv_on_send(struct hv_vmbus_channel *chan, netvsc_packet *pkt)
} else {
ret = hv_vmbus_channel_send_packet(chan,
&send_msg, sizeof(nvsp_msg), (uint64_t)(uintptr_t)pkt,
HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, VMBUS_CHANPKT_FLAG_RC);
}
return (ret);

View File

@ -1168,8 +1168,7 @@ hv_rf_on_device_add(struct hn_softc *sc, void *additl_info,
ret = hv_vmbus_channel_send_packet(sc->hn_prichan, init_pkt,
sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt,
HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, VMBUS_CHANPKT_FLAG_RC);
if (ret != 0) {
device_printf(dev, "Fail to allocate subchannel\n");
goto out;

View File

@ -362,7 +362,7 @@ storvsc_send_multichannel_request(struct storvsc_softc *sc, int max_chans)
VSTOR_PKT_SIZE,
(uint64_t)(uintptr_t)request,
HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
VMBUS_CHANPKT_FLAG_RC);
/* wait for 5 seconds */
ret = sema_timedwait(&request->synch_sema, 5 * hz);
@ -433,7 +433,7 @@ hv_storvsc_channel_init(struct storvsc_softc *sc)
VSTOR_PKT_SIZE,
(uint64_t)(uintptr_t)request,
HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
VMBUS_CHANPKT_FLAG_RC);
if (ret != 0)
goto cleanup;
@ -467,7 +467,7 @@ hv_storvsc_channel_init(struct storvsc_softc *sc)
VSTOR_PKT_SIZE,
(uint64_t)(uintptr_t)request,
HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
VMBUS_CHANPKT_FLAG_RC);
if (ret != 0)
goto cleanup;
@ -510,7 +510,7 @@ hv_storvsc_channel_init(struct storvsc_softc *sc)
VSTOR_PKT_SIZE,
(uint64_t)(uintptr_t)request,
HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
VMBUS_CHANPKT_FLAG_RC);
if ( ret != 0)
goto cleanup;
@ -546,7 +546,7 @@ hv_storvsc_channel_init(struct storvsc_softc *sc)
VSTOR_PKT_SIZE,
(uint64_t)(uintptr_t)request,
HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
VMBUS_CHANPKT_FLAG_RC);
if (ret != 0) {
goto cleanup;
@ -636,7 +636,7 @@ hv_storvsc_host_reset(struct storvsc_softc *sc)
VSTOR_PKT_SIZE,
(uint64_t)(uintptr_t)&sc->hs_reset_req,
HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
VMBUS_CHANPKT_FLAG_RC);
if (ret != 0) {
goto cleanup;
@ -700,7 +700,7 @@ hv_storvsc_io_request(struct storvsc_softc *sc,
VSTOR_PKT_SIZE,
(uint64_t)(uintptr_t)request,
HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
VMBUS_CHANPKT_FLAG_RC);
}
mtx_lock(&request->softc->hs_lock);

View File

@ -690,7 +690,7 @@ vmbus_chan_send_sglist(struct hv_vmbus_channel *chan,
pad_pktlen = roundup2(pktlen, VMBUS_CHANPKT_SIZE_ALIGN);
pkt.cp_hdr.cph_type = HV_VMBUS_PACKET_TYPE_DATA_USING_GPA_DIRECT;
pkt.cp_hdr.cph_flags = HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED;
pkt.cp_hdr.cph_flags = VMBUS_CHANPKT_FLAG_RC;
pkt.cp_hdr.cph_data_ofs = hlen >> VMBUS_CHANPKT_SIZE_SHIFT;
pkt.cp_hdr.cph_len = pad_pktlen >> VMBUS_CHANPKT_SIZE_SHIFT;
pkt.cp_hdr.cph_xactid = xactid;
@ -732,7 +732,7 @@ vmbus_chan_send_prplist(struct hv_vmbus_channel *chan,
pad_pktlen = roundup2(pktlen, VMBUS_CHANPKT_SIZE_ALIGN);
pkt.cp_hdr.cph_type = HV_VMBUS_PACKET_TYPE_DATA_USING_GPA_DIRECT;
pkt.cp_hdr.cph_flags = HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED;
pkt.cp_hdr.cph_flags = VMBUS_CHANPKT_FLAG_RC;
pkt.cp_hdr.cph_data_ofs = hlen >> VMBUS_CHANPKT_SIZE_SHIFT;
pkt.cp_hdr.cph_len = pad_pktlen >> VMBUS_CHANPKT_SIZE_SHIFT;
pkt.cp_hdr.cph_xactid = xactid;