#ifndef _HYPERV_NET_H
#define _HYPERV_NET_H
#include <linux/list.h>
#include <linux/hyperv.h>
#include <linux/rndis.h>
#include <linux/jhash.h>
#include <net/xdp.h>
#define OID_GEN_RECEIVE_SCALE_CAPABILITIES …
#define OID_GEN_RECEIVE_SCALE_PARAMETERS …
#define NDIS_OBJECT_TYPE_RSS_CAPABILITIES …
#define NDIS_OBJECT_TYPE_RSS_PARAMETERS …
#define NDIS_OBJECT_TYPE_OFFLOAD …
#define NDIS_RECEIVE_SCALE_CAPABILITIES_REVISION_2 …
#define NDIS_RECEIVE_SCALE_PARAMETERS_REVISION_2 …
struct ndis_obj_header { … } __packed;
#define NDIS_RSS_CAPS_MESSAGE_SIGNALED_INTERRUPTS …
#define NDIS_RSS_CAPS_CLASSIFICATION_AT_ISR …
#define NDIS_RSS_CAPS_CLASSIFICATION_AT_DPC …
#define NDIS_RSS_CAPS_USING_MSI_X …
#define NDIS_RSS_CAPS_RSS_AVAILABLE_ON_PORTS …
#define NDIS_RSS_CAPS_SUPPORTS_MSI_X …
#define NDIS_RSS_CAPS_HASH_TYPE_TCP_IPV4 …
#define NDIS_RSS_CAPS_HASH_TYPE_TCP_IPV6 …
#define NDIS_RSS_CAPS_HASH_TYPE_TCP_IPV6_EX …
struct ndis_recv_scale_cap { … } __packed;
#define NDIS_RSS_PARAM_FLAG_BASE_CPU_UNCHANGED …
#define NDIS_RSS_PARAM_FLAG_HASH_INFO_UNCHANGED …
#define NDIS_RSS_PARAM_FLAG_ITABLE_UNCHANGED …
#define NDIS_RSS_PARAM_FLAG_HASH_KEY_UNCHANGED …
#define NDIS_RSS_PARAM_FLAG_DISABLE_RSS …
#define NDIS_HASH_FUNC_TOEPLITZ …
#define NDIS_HASH_IPV4 …
#define NDIS_HASH_TCP_IPV4 …
#define NDIS_HASH_IPV6 …
#define NDIS_HASH_IPV6_EX …
#define NDIS_HASH_TCP_IPV6 …
#define NDIS_HASH_TCP_IPV6_EX …
#define NDIS_RSS_INDIRECTION_TABLE_MAX_SIZE_REVISION_2 …
#define NDIS_RSS_HASH_SECRET_KEY_MAX_SIZE_REVISION_2 …
#define ITAB_NUM …
#define ITAB_NUM_MAX …
struct ndis_recv_scale_param { … };
struct ndis_tcp_ip_checksum_info { … };
struct ndis_pkt_8021q_info { … };
struct hv_netvsc_packet { … };
#define NETVSC_HASH_KEYLEN …
struct netvsc_device_info { … };
enum rndis_device_state { … };
struct rndis_device { … };
struct rndis_message;
struct ndis_offload_params;
struct netvsc_device;
struct netvsc_channel;
struct net_device_context;
extern u32 netvsc_ring_bytes;
struct netvsc_device *netvsc_device_add(struct hv_device *device,
const struct netvsc_device_info *info);
int netvsc_alloc_recv_comp_ring(struct netvsc_device *net_device, u32 q_idx);
void netvsc_device_remove(struct hv_device *device);
int netvsc_send(struct net_device *net,
struct hv_netvsc_packet *packet,
struct rndis_message *rndis_msg,
struct hv_page_buffer *page_buffer,
struct sk_buff *skb,
bool xdp_tx);
void netvsc_linkstatus_callback(struct net_device *net,
struct rndis_message *resp,
void *data, u32 data_buflen);
int netvsc_recv_callback(struct net_device *net,
struct netvsc_device *nvdev,
struct netvsc_channel *nvchan);
void netvsc_channel_cb(void *context);
int netvsc_poll(struct napi_struct *napi, int budget);
void netvsc_xdp_xmit(struct sk_buff *skb, struct net_device *ndev);
u32 netvsc_run_xdp(struct net_device *ndev, struct netvsc_channel *nvchan,
struct xdp_buff *xdp);
unsigned int netvsc_xdp_fraglen(unsigned int len);
struct bpf_prog *netvsc_xdp_get(struct netvsc_device *nvdev);
int netvsc_xdp_set(struct net_device *dev, struct bpf_prog *prog,
struct netlink_ext_ack *extack,
struct netvsc_device *nvdev);
int netvsc_vf_setxdp(struct net_device *vf_netdev, struct bpf_prog *prog);
int netvsc_bpf(struct net_device *dev, struct netdev_bpf *bpf);
int netvsc_ndoxdp_xmit(struct net_device *ndev, int n,
struct xdp_frame **frames, u32 flags);
int rndis_set_subchannel(struct net_device *ndev,
struct netvsc_device *nvdev,
struct netvsc_device_info *dev_info);
int rndis_filter_open(struct netvsc_device *nvdev);
int rndis_filter_close(struct netvsc_device *nvdev);
struct netvsc_device *rndis_filter_device_add(struct hv_device *dev,
struct netvsc_device_info *info);
void rndis_filter_update(struct netvsc_device *nvdev);
void rndis_filter_device_remove(struct hv_device *dev,
struct netvsc_device *nvdev);
int rndis_filter_set_rss_param(struct rndis_device *rdev,
const u8 *key);
int rndis_filter_set_offload_params(struct net_device *ndev,
struct netvsc_device *nvdev,
struct ndis_offload_params *req_offloads);
int rndis_filter_receive(struct net_device *ndev,
struct netvsc_device *net_dev,
struct netvsc_channel *nvchan,
void *data, u32 buflen);
int rndis_filter_set_device_mac(struct netvsc_device *ndev,
const char *mac);
int netvsc_switch_datapath(struct net_device *nv_dev, bool vf);
#define NVSP_INVALID_PROTOCOL_VERSION …
#define NVSP_PROTOCOL_VERSION_1 …
#define NVSP_PROTOCOL_VERSION_2 …
#define NVSP_PROTOCOL_VERSION_4 …
#define NVSP_PROTOCOL_VERSION_5 …
#define NVSP_PROTOCOL_VERSION_6 …
#define NVSP_PROTOCOL_VERSION_61 …
enum { … };
enum { … };
struct nvsp_message_header { … };
struct nvsp_message_init { … } __packed;
struct nvsp_message_init_complete { … } __packed;
nvsp_message_init_uber __packed;
struct nvsp_1_message_send_ndis_version { … } __packed;
struct nvsp_1_message_send_receive_buffer { … } __packed;
struct nvsp_1_receive_buffer_section { … } __packed;
struct nvsp_1_message_send_receive_buffer_complete { … } __packed;
struct nvsp_1_message_revoke_receive_buffer { … };
struct nvsp_1_message_send_send_buffer { … } __packed;
struct nvsp_1_message_send_send_buffer_complete { … } __packed;
struct nvsp_1_message_revoke_send_buffer { … };
struct nvsp_1_message_send_rndis_packet { … } __packed;
struct nvsp_1_message_send_rndis_packet_complete { … };
nvsp_1_message_uber __packed;
struct nvsp_2_vsc_capability { … } __packed;
struct nvsp_2_send_ndis_config { … } __packed;
struct nvsp_2_alloc_rxbuf { … } __packed;
struct nvsp_2_alloc_rxbuf_comp { … } __packed;
struct nvsp_2_free_rxbuf { … } __packed;
nvsp_2_message_uber __packed;
struct nvsp_4_send_vf_association { … } __packed;
enum nvsp_vm_datapath { … };
struct nvsp_4_sw_datapath { … } __packed;
nvsp_4_message_uber __packed;
enum nvsp_subchannel_operation { … };
struct nvsp_5_subchannel_request { … } __packed;
struct nvsp_5_subchannel_complete { … } __packed;
struct nvsp_5_send_indirect_table { … } __packed;
nvsp_5_message_uber __packed;
enum nvsp_6_pd_api_op { … };
struct grp_affinity { … } __packed;
struct nvsp_6_pd_api_req { … } __packed;
struct nvsp_6_pd_api_comp { … } __packed;
struct nvsp_6_pd_buf { … } __packed;
struct nvsp_6_pd_batch_msg { … } __packed;
nvsp_6_message_uber __packed;
nvsp_all_messages __packed;
struct nvsp_message { … } __packed;
#define NETVSC_MTU …
#define NETVSC_MTU_MIN …
#define NETVSC_RECEIVE_BUFFER_SIZE …
#define NETVSC_RECEIVE_BUFFER_SIZE_LEGACY …
#define NETVSC_RECEIVE_BUFFER_DEFAULT …
#define NETVSC_SEND_BUFFER_SIZE …
#define NETVSC_SEND_BUFFER_DEFAULT …
#define NETVSC_INVALID_INDEX …
#define NETVSC_SEND_SECTION_SIZE …
#define NETVSC_RECV_SECTION_SIZE …
#define NETVSC_MIN_TX_SECTIONS …
#define NETVSC_DEFAULT_TX …
#define NETVSC_MIN_RX_SECTIONS …
#define NETVSC_DEFAULT_RX …
#define NETVSC_RECEIVE_BUFFER_ID …
#define NETVSC_SEND_BUFFER_ID …
#define NETVSC_SUPPORTED_HW_FEATURES …
#define VRSS_SEND_TAB_SIZE …
#define VRSS_CHANNEL_MAX …
#define VRSS_CHANNEL_DEFAULT …
#define RNDIS_MAX_PKT_DEFAULT …
#define RNDIS_PKT_ALIGN_DEFAULT …
#define NETVSC_XDP_HDRM …
#define NETVSC_MIN_OUT_MSG_SIZE …
#define NETVSC_MIN_IN_MSG_SIZE …
static inline u32 netvsc_rqstor_size(unsigned long ringbytes)
{ … }
#define NETVSC_MAX_XFER_PAGE_RANGES …
#define NETVSC_XFER_HEADER_SIZE(rng_cnt) …
#define NETVSC_MAX_PKT_SIZE …
struct multi_send_data { … };
struct recv_comp_data { … };
struct multi_recv_comp { … };
#define NVSP_RSC_MAX …
struct nvsc_rsc { … };
#define NVSC_RSC_VLAN …
#define NVSC_RSC_CSUM_INFO …
#define NVSC_RSC_HASH_INFO …
struct netvsc_stats_tx { … };
struct netvsc_stats_rx { … };
struct netvsc_ethtool_stats { … };
struct netvsc_ethtool_pcpu_stats { … };
struct netvsc_vf_pcpu_stats { … };
struct netvsc_reconfig { … };
#define HV_TCP4_L4HASH …
#define HV_TCP6_L4HASH …
#define HV_UDP4_L4HASH …
#define HV_UDP6_L4HASH …
#define HV_DEFAULT_L4HASH …
struct net_device_context { … };
static inline u32 netvsc_get_hash(struct sk_buff *skb,
const struct net_device_context *ndc)
{ … }
struct netvsc_channel { … };
struct netvsc_device { … };
struct rndis_initialize_request { … };
struct rndis_initialize_complete { … };
struct rndis_co_address_family { … };
struct rndis_halt_request { … };
struct rndis_query_request { … };
struct rndis_query_complete { … };
struct rndis_set_request { … };
struct rndis_set_complete { … };
struct rndis_reset_request { … };
struct rndis_reset_complete { … };
struct rndis_indicate_status { … };
struct rndis_diagnostic_info { … };
struct rndis_keepalive_request { … };
struct rndis_keepalive_complete { … };
struct rndis_packet { … };
struct rndis_oobd { … };
struct rndis_per_packet_info { … };
enum ndis_per_pkt_info_type { … };
enum rndis_per_pkt_info_interal_type { … };
#define RNDIS_PKTINFO_SUBALLOC …
#define RNDIS_PKTINFO_1ST_FRAG …
#define RNDIS_PKTINFO_LAST_FRAG …
#define RNDIS_PKTINFO_ID_V1 …
struct rndis_pktinfo_id { … };
struct ndis_object_header { … };
#define NDIS_OBJECT_TYPE_DEFAULT …
#define NDIS_OFFLOAD_PARAMETERS_REVISION_3 …
#define NDIS_OFFLOAD_PARAMETERS_REVISION_2 …
#define NDIS_OFFLOAD_PARAMETERS_REVISION_1 …
#define NDIS_OFFLOAD_PARAMETERS_NO_CHANGE …
#define NDIS_OFFLOAD_PARAMETERS_LSOV2_DISABLED …
#define NDIS_OFFLOAD_PARAMETERS_LSOV2_ENABLED …
#define NDIS_OFFLOAD_PARAMETERS_LSOV1_ENABLED …
#define NDIS_OFFLOAD_PARAMETERS_RSC_DISABLED …
#define NDIS_OFFLOAD_PARAMETERS_RSC_ENABLED …
#define NDIS_OFFLOAD_PARAMETERS_TX_RX_DISABLED …
#define NDIS_OFFLOAD_PARAMETERS_TX_ENABLED_RX_DISABLED …
#define NDIS_OFFLOAD_PARAMETERS_RX_ENABLED_TX_DISABLED …
#define NDIS_OFFLOAD_PARAMETERS_TX_RX_ENABLED …
#define NDIS_TCP_LARGE_SEND_OFFLOAD_V2_TYPE …
#define NDIS_TCP_LARGE_SEND_OFFLOAD_IPV4 …
#define NDIS_TCP_LARGE_SEND_OFFLOAD_IPV6 …
#define VERSION_4_OFFLOAD_SIZE …
#define OID_TCP_OFFLOAD_CURRENT_CONFIG …
#define OID_TCP_OFFLOAD_PARAMETERS …
#define OID_TCP_OFFLOAD_HARDWARE_CAPABILITIES …
#define OID_TCP_CONNECTION_OFFLOAD_CURRENT_CONFIG …
#define OID_TCP_CONNECTION_OFFLOAD_HARDWARE_CAPABILITIES …
#define OID_OFFLOAD_ENCAPSULATION …
#define NDIS_OFFLOAD_ENCAP_NONE …
#define NDIS_OFFLOAD_ENCAP_NULL …
#define NDIS_OFFLOAD_ENCAP_8023 …
#define NDIS_OFFLOAD_ENCAP_8023PQ …
#define NDIS_OFFLOAD_ENCAP_8023PQ_OOB …
#define NDIS_OFFLOAD_ENCAP_RFC1483 …
struct ndis_csum_offload { … };
struct ndis_lsov1_offload { … };
struct ndis_ipsecv1_offload { … };
struct ndis_lsov2_offload { … };
struct ndis_ipsecv2_offload { … };
struct ndis_rsc_offload { … };
struct ndis_encap_offload { … };
struct ndis_offload { … };
#define NDIS_OFFLOAD_SIZE …
#define NDIS_OFFLOAD_SIZE_6_0 …
#define NDIS_OFFLOAD_SIZE_6_1 …
struct ndis_offload_params { … };
struct ndis_tcp_lso_info { … };
#define NDIS_VLAN_PPI_SIZE …
#define NDIS_CSUM_PPI_SIZE …
#define NDIS_LSO_PPI_SIZE …
#define NDIS_HASH_PPI_SIZE …
#define NDIS_ALL_PPI_SIZE …
struct rndis_config_parameter_info { … };
#define RNDIS_CONFIG_PARAM_TYPE_INTEGER …
#define RNDIS_CONFIG_PARAM_TYPE_STRING …
struct rcondis_mp_create_vc { … };
struct rcondis_mp_create_vc_complete { … };
struct rcondis_mp_delete_vc { … };
struct rcondis_mp_delete_vc_complete { … };
struct rcondis_mp_query_request { … };
struct rcondis_mp_set_request { … };
struct rcondis_indicate_status { … };
struct rcondis_specific_parameters { … };
struct rcondis_media_parameters { … };
struct rndis_flowspec { … };
struct rcondis_call_manager_parameters { … };
struct rcondis_mp_activate_vc_request { … };
struct rcondis_mp_activate_vc_complete { … };
struct rcondis_mp_deactivate_vc_request { … };
struct rcondis_mp_deactivate_vc_complete { … };
rndis_message_container;
struct rndis_message { … };
#define RNDIS_MESSAGE_SIZE(msg) …
#define RNDIS_HEADER_SIZE …
#define RNDIS_AND_PPI_SIZE …
#define NDIS_PACKET_TYPE_DIRECTED …
#define NDIS_PACKET_TYPE_MULTICAST …
#define NDIS_PACKET_TYPE_ALL_MULTICAST …
#define NDIS_PACKET_TYPE_BROADCAST …
#define NDIS_PACKET_TYPE_SOURCE_ROUTING …
#define NDIS_PACKET_TYPE_PROMISCUOUS …
#define NDIS_PACKET_TYPE_SMT …
#define NDIS_PACKET_TYPE_ALL_LOCAL …
#define NDIS_PACKET_TYPE_GROUP …
#define NDIS_PACKET_TYPE_ALL_FUNCTIONAL …
#define NDIS_PACKET_TYPE_FUNCTIONAL …
#define NDIS_PACKET_TYPE_MAC_FRAME …
#define TRANSPORT_INFO_NOT_IP …
#define TRANSPORT_INFO_IPV4_TCP …
#define TRANSPORT_INFO_IPV4_UDP …
#define TRANSPORT_INFO_IPV6_TCP …
#define TRANSPORT_INFO_IPV6_UDP …
#define RETRY_US_LO …
#define RETRY_US_HI …
#define RETRY_MAX …
void netvsc_dma_unmap(struct hv_device *hv_dev,
struct hv_netvsc_packet *packet);
#endif