Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | |||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
#include <sys/buf_ring.h> | #include <sys/buf_ring.h> | ||||
#include <net/if.h> | #include <net/if.h> | ||||
#include <net/if_arp.h> | #include <net/if_arp.h> | ||||
#include <net/ethernet.h> | #include <net/ethernet.h> | ||||
#include <net/if_dl.h> | #include <net/if_dl.h> | ||||
#include <net/if_media.h> | #include <net/if_media.h> | ||||
#include <net/rndis.h> | |||||
#include <net/bpf.h> | #include <net/bpf.h> | ||||
#include <net/if_var.h> | #include <net/if_var.h> | ||||
#include <net/if_types.h> | #include <net/if_types.h> | ||||
#include <net/if_vlan_var.h> | #include <net/if_vlan_var.h> | ||||
#include <netinet/in_systm.h> | #include <netinet/in_systm.h> | ||||
#include <netinet/in.h> | #include <netinet/in.h> | ||||
Show All 23 Lines | |||||
#include <machine/in_cksum.h> | #include <machine/in_cksum.h> | ||||
#include <dev/hyperv/include/hyperv.h> | #include <dev/hyperv/include/hyperv.h> | ||||
#include <dev/hyperv/include/hyperv_busdma.h> | #include <dev/hyperv/include/hyperv_busdma.h> | ||||
#include <dev/hyperv/include/vmbus_xact.h> | #include <dev/hyperv/include/vmbus_xact.h> | ||||
#include <dev/hyperv/netvsc/hv_net_vsc.h> | #include <dev/hyperv/netvsc/hv_net_vsc.h> | ||||
#include <dev/hyperv/netvsc/hv_rndis.h> | |||||
#include <dev/hyperv/netvsc/hv_rndis_filter.h> | #include <dev/hyperv/netvsc/hv_rndis_filter.h> | ||||
#include <dev/hyperv/netvsc/ndis.h> | #include <dev/hyperv/netvsc/ndis.h> | ||||
#include "vmbus_if.h" | #include "vmbus_if.h" | ||||
/* Short for Hyper-V network interface */ | /* Short for Hyper-V network interface */ | ||||
#define NETVSC_DEVNAME "hn" | #define NETVSC_DEVNAME "hn" | ||||
▲ Show 20 Lines • Show All 692 Lines • ▼ Show 20 Lines | hn_tx_done(struct hn_send_ctx *sndc, struct hn_softc *sc, | ||||
if (txr->hn_txdone_cnt >= HN_EARLY_TXEOF_THRESH) { | if (txr->hn_txdone_cnt >= HN_EARLY_TXEOF_THRESH) { | ||||
txr->hn_txdone_cnt = 0; | txr->hn_txdone_cnt = 0; | ||||
if (txr->hn_oactive) | if (txr->hn_oactive) | ||||
hn_txeof(txr); | hn_txeof(txr); | ||||
} | } | ||||
} | } | ||||
void | void | ||||
netvsc_channel_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr) | hn_chan_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr) | ||||
{ | { | ||||
#if defined(INET) || defined(INET6) | #if defined(INET) || defined(INET6) | ||||
tcp_lro_flush_all(&rxr->hn_lro); | tcp_lro_flush_all(&rxr->hn_lro); | ||||
#endif | #endif | ||||
/* | /* | ||||
* NOTE: | * NOTE: | ||||
* 'txr' could be NULL, if multiple channels and | * 'txr' could be NULL, if multiple channels and | ||||
▲ Show 20 Lines • Show All 419 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Called when we receive a data packet from the "wire" on the | * Called when we receive a data packet from the "wire" on the | ||||
* specified device | * specified device | ||||
* | * | ||||
* Note: This is no longer used as a callback | * Note: This is no longer used as a callback | ||||
*/ | */ | ||||
int | int | ||||
netvsc_recv(struct hn_rx_ring *rxr, const void *data, int dlen, | hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int dlen, | ||||
const struct hn_recvinfo *info) | const struct hn_recvinfo *info) | ||||
{ | { | ||||
struct ifnet *ifp = rxr->hn_ifp; | struct ifnet *ifp = rxr->hn_ifp; | ||||
struct mbuf *m_new; | struct mbuf *m_new; | ||||
int size, do_lro = 0, do_csum = 1; | int size, do_lro = 0, do_csum = 1; | ||||
int hash_type; | int hash_type; | ||||
if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) | if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) | ||||
▲ Show 20 Lines • Show All 809 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
hn_ndis_version_sysctl(SYSCTL_HANDLER_ARGS) | hn_ndis_version_sysctl(SYSCTL_HANDLER_ARGS) | ||||
{ | { | ||||
struct hn_softc *sc = arg1; | struct hn_softc *sc = arg1; | ||||
char verstr[16]; | char verstr[16]; | ||||
snprintf(verstr, sizeof(verstr), "%u.%u", | snprintf(verstr, sizeof(verstr), "%u.%u", | ||||
NDIS_VERSION_MAJOR(sc->hn_ndis_ver), | HN_NDIS_VERSION_MAJOR(sc->hn_ndis_ver), | ||||
NDIS_VERSION_MINOR(sc->hn_ndis_ver)); | HN_NDIS_VERSION_MINOR(sc->hn_ndis_ver)); | ||||
return sysctl_handle_string(oidp, verstr, sizeof(verstr), req); | return sysctl_handle_string(oidp, verstr, sizeof(verstr), req); | ||||
} | } | ||||
static int | static int | ||||
hn_check_iplen(const struct mbuf *m, int hoff) | hn_check_iplen(const struct mbuf *m, int hoff) | ||||
{ | { | ||||
const struct ip *ip; | const struct ip *ip; | ||||
int len, iphlen, iplen; | int len, iphlen, iplen; | ||||
▲ Show 20 Lines • Show All 977 Lines • Show Last 20 Lines |