Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/hyperv/netvsc/hv_net_vsc.c
Show First 20 Lines • Show All 841 Lines • ▼ Show 20 Lines | |||||
* In the FreeBSD Hyper-V virtual world, this function deals exclusively | * In the FreeBSD Hyper-V virtual world, this function deals exclusively | ||||
* with virtual addresses. | * with virtual addresses. | ||||
*/ | */ | ||||
static void | static void | ||||
hv_nv_on_receive(netvsc_dev *net_dev, struct hn_rx_ring *rxr, | hv_nv_on_receive(netvsc_dev *net_dev, struct hn_rx_ring *rxr, | ||||
struct vmbus_channel *chan, const struct vmbus_chanpkt_hdr *pkthdr) | struct vmbus_channel *chan, const struct vmbus_chanpkt_hdr *pkthdr) | ||||
{ | { | ||||
const struct vmbus_chanpkt_rxbuf *pkt; | const struct vmbus_chanpkt_rxbuf *pkt; | ||||
const nvsp_msg *nvsp_msg_pkt; | const struct hn_nvs_hdr *nvs_hdr; | ||||
netvsc_packet vsc_pkt; | netvsc_packet vsc_pkt; | ||||
netvsc_packet *net_vsc_pkt = &vsc_pkt; | netvsc_packet *net_vsc_pkt = &vsc_pkt; | ||||
int count = 0; | int count = 0; | ||||
int i = 0; | int i = 0; | ||||
int status = nvsp_status_success; | int status = nvsp_status_success; | ||||
nvsp_msg_pkt = VMBUS_CHANPKT_CONST_DATA(pkthdr); | /* Make sure that this is a RNDIS message. */ | ||||
nvs_hdr = VMBUS_CHANPKT_CONST_DATA(pkthdr); | |||||
/* Make sure this is a valid nvsp packet */ | if (__predict_false(nvs_hdr->nvs_type != HN_NVS_TYPE_RNDIS)) { | ||||
if (nvsp_msg_pkt->hdr.msg_type != nvsp_msg_1_type_send_rndis_pkt) { | if_printf(rxr->hn_ifp, "nvs type %u, not RNDIS\n", | ||||
if_printf(rxr->hn_ifp, "packet hdr type %u is invalid!\n", | nvs_hdr->nvs_type); | ||||
nvsp_msg_pkt->hdr.msg_type); | |||||
return; | return; | ||||
} | } | ||||
pkt = (const struct vmbus_chanpkt_rxbuf *)pkthdr; | pkt = (const struct vmbus_chanpkt_rxbuf *)pkthdr; | ||||
if (pkt->cp_rxbuf_id != NETVSC_RECEIVE_BUFFER_ID) { | if (pkt->cp_rxbuf_id != NETVSC_RECEIVE_BUFFER_ID) { | ||||
if_printf(rxr->hn_ifp, "rxbuf_id %d is invalid!\n", | if_printf(rxr->hn_ifp, "rxbuf_id %d is invalid!\n", | ||||
pkt->cp_rxbuf_id); | pkt->cp_rxbuf_id); | ||||
▲ Show 20 Lines • Show All 175 Lines • Show Last 20 Lines |