#define pr_fmt(fmt) …
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/wait.h>
#include <linux/mm.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/slab.h>
#include <linux/netdevice.h>
#include <linux/if_ether.h>
#include <linux/vmalloc.h>
#include <linux/rtnetlink.h>
#include <linux/prefetch.h>
#include <linux/filter.h>
#include <asm/sync_bitops.h>
#include <asm/mshyperv.h>
#include "hyperv_net.h"
#include "netvsc_trace.h"
int netvsc_switch_datapath(struct net_device *ndev, bool vf)
{ … }
static void netvsc_subchan_work(struct work_struct *w)
{ … }
static struct netvsc_device *alloc_net_device(void)
{ … }
static void free_netvsc_device(struct rcu_head *head)
{ … }
static void free_netvsc_device_rcu(struct netvsc_device *nvdev)
{ … }
static void netvsc_revoke_recv_buf(struct hv_device *device,
struct netvsc_device *net_device,
struct net_device *ndev)
{ … }
static void netvsc_revoke_send_buf(struct hv_device *device,
struct netvsc_device *net_device,
struct net_device *ndev)
{ … }
static void netvsc_teardown_recv_gpadl(struct hv_device *device,
struct netvsc_device *net_device,
struct net_device *ndev)
{ … }
static void netvsc_teardown_send_gpadl(struct hv_device *device,
struct netvsc_device *net_device,
struct net_device *ndev)
{ … }
int netvsc_alloc_recv_comp_ring(struct netvsc_device *net_device, u32 q_idx)
{ … }
static int netvsc_init_buf(struct hv_device *device,
struct netvsc_device *net_device,
const struct netvsc_device_info *device_info)
{ … }
static int negotiate_nvsp_ver(struct hv_device *device,
struct netvsc_device *net_device,
struct nvsp_message *init_packet,
u32 nvsp_ver)
{ … }
static int netvsc_connect_vsp(struct hv_device *device,
struct netvsc_device *net_device,
const struct netvsc_device_info *device_info)
{ … }
void netvsc_device_remove(struct hv_device *device)
{ … }
#define RING_AVAIL_PERCENT_HIWATER …
#define RING_AVAIL_PERCENT_LOWATER …
static inline void netvsc_free_send_slot(struct netvsc_device *net_device,
u32 index)
{ … }
static void netvsc_send_tx_complete(struct net_device *ndev,
struct netvsc_device *net_device,
struct vmbus_channel *channel,
const struct vmpacket_descriptor *desc,
int budget)
{ … }
static void netvsc_send_completion(struct net_device *ndev,
struct netvsc_device *net_device,
struct vmbus_channel *incoming_channel,
const struct vmpacket_descriptor *desc,
int budget)
{ … }
static u32 netvsc_get_next_send_section(struct netvsc_device *net_device)
{ … }
static void netvsc_copy_to_send_buf(struct netvsc_device *net_device,
unsigned int section_index,
u32 pend_size,
struct hv_netvsc_packet *packet,
struct rndis_message *rndis_msg,
struct hv_page_buffer *pb,
bool xmit_more)
{ … }
void netvsc_dma_unmap(struct hv_device *hv_dev,
struct hv_netvsc_packet *packet)
{ … }
static int netvsc_dma_map(struct hv_device *hv_dev,
struct hv_netvsc_packet *packet,
struct hv_page_buffer *pb)
{ … }
static inline int netvsc_send_pkt(
struct hv_device *device,
struct hv_netvsc_packet *packet,
struct netvsc_device *net_device,
struct hv_page_buffer *pb,
struct sk_buff *skb)
{ … }
static inline void move_pkt_msd(struct hv_netvsc_packet **msd_send,
struct sk_buff **msd_skb,
struct multi_send_data *msdp)
{ … }
int netvsc_send(struct net_device *ndev,
struct hv_netvsc_packet *packet,
struct rndis_message *rndis_msg,
struct hv_page_buffer *pb,
struct sk_buff *skb,
bool xdp_tx)
{ … }
static int send_recv_completions(struct net_device *ndev,
struct netvsc_device *nvdev,
struct netvsc_channel *nvchan)
{ … }
static void recv_comp_slot_avail(const struct netvsc_device *nvdev,
const struct multi_recv_comp *mrc,
u32 *filled, u32 *avail)
{ … }
static void enq_receive_complete(struct net_device *ndev,
struct netvsc_device *nvdev, u16 q_idx,
u64 tid, u32 status)
{ … }
static int netvsc_receive(struct net_device *ndev,
struct netvsc_device *net_device,
struct netvsc_channel *nvchan,
const struct vmpacket_descriptor *desc)
{ … }
static void netvsc_send_table(struct net_device *ndev,
struct netvsc_device *nvscdev,
const struct nvsp_message *nvmsg,
u32 msglen)
{ … }
static void netvsc_send_vf(struct net_device *ndev,
const struct nvsp_message *nvmsg,
u32 msglen)
{ … }
static void netvsc_receive_inband(struct net_device *ndev,
struct netvsc_device *nvscdev,
const struct vmpacket_descriptor *desc)
{ … }
static int netvsc_process_raw_pkt(struct hv_device *device,
struct netvsc_channel *nvchan,
struct netvsc_device *net_device,
struct net_device *ndev,
const struct vmpacket_descriptor *desc,
int budget)
{ … }
static struct hv_device *netvsc_channel_to_device(struct vmbus_channel *channel)
{ … }
int netvsc_poll(struct napi_struct *napi, int budget)
{ … }
void netvsc_channel_cb(void *context)
{ … }
struct netvsc_device *netvsc_device_add(struct hv_device *device,
const struct netvsc_device_info *device_info)
{ … }