Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 249666
b: refs/heads/master
c: 4130886
h: refs/heads/master
v: v3
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed May 17, 2011
1 parent b2b4b98 commit 2a1b4a7
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 133 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5ca7252a7e2be5e05772f202d94e173b7224e7a9
refs/heads/master: 41308862d18ebba47e4b863a7b967dc7e5477fb9
101 changes: 101 additions & 0 deletions trunk/drivers/staging/hv/hyperv_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,105 @@
#ifndef _HYPERV_NET_H
#define _HYPERV_NET_H

#include "hyperv.h"

/* Fwd declaration */
struct hv_netvsc_packet;

/* Represent the xfer page packet which contains 1 or more netvsc packet */
struct xferpage_packet {
struct list_head list_ent;

/* # of netvsc packets this xfer packet contains */
u32 count;
};

/* The number of pages which are enough to cover jumbo frame buffer. */
#define NETVSC_PACKET_MAXPAGE 4

/*
* Represent netvsc packet which contains 1 RNDIS and 1 ethernet frame
* within the RNDIS
*/
struct hv_netvsc_packet {
/* Bookkeeping stuff */
struct list_head list_ent;

struct hv_device *device;
bool is_data_pkt;

/*
* Valid only for receives when we break a xfer page packet
* into multiple netvsc packets
*/
struct xferpage_packet *xfer_page_pkt;

union {
struct {
u64 recv_completion_tid;
void *recv_completion_ctx;
void (*recv_completion)(void *context);
} recv;
struct {
u64 send_completion_tid;
void *send_completion_ctx;
void (*send_completion)(void *context);
} send;
} completion;

/* This points to the memory after page_buf */
void *extension;

u32 total_data_buflen;
/* Points to the send/receive buffer where the ethernet frame is */
u32 page_buf_cnt;
struct hv_page_buffer page_buf[NETVSC_PACKET_MAXPAGE];
};

/* Represents the net vsc driver */
struct netvsc_driver {
/* Must be the first field */
/* Which is a bug FIXME! */
struct hv_driver base;

u32 ring_buf_size;
u32 req_ext_size;

/*
* This is set by the caller to allow us to callback when we
* receive a packet from the "wire"
*/
int (*recv_cb)(struct hv_device *dev,
struct hv_netvsc_packet *packet);
void (*link_status_change)(struct hv_device *dev, u32 status);

/* Specific to this driver */
int (*send)(struct hv_device *dev, struct hv_netvsc_packet *packet);

void *ctx;
};

static inline
struct netvsc_driver *drv_to_netvscdrv(struct device_driver *d)
{
struct hv_driver *hvdrv = drv_to_hv_drv(d);
return container_of(hvdrv, struct netvsc_driver, base);
}

struct netvsc_device_info {
unsigned char mac_adr[6];
bool link_state; /* 0 - link up, 1 - link down */
};

/* Interface */
int netvsc_device_add(struct hv_device *device, void *additional_info);
int netvsc_device_remove(struct hv_device *device);
int netvsc_initialize(struct hv_driver *drv);
int rndis_filter_open(struct hv_device *dev);
int rndis_filter_close(struct hv_device *dev);
int rndis_filte_device_add(struct hv_device *dev,
void *additional_info);
int rndis_filter_device_remove(struct hv_device *dev);


#endif /* _HYPERV_NET_H */
1 change: 0 additions & 1 deletion trunk/drivers/staging/hv/netvsc.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

#include <linux/list.h>
#include "hyperv.h"
#include "netvsc_api.h"


#define NVSP_INVALID_PROTOCOL_VERSION ((u32)0xFFFFFFFF)
Expand Down
129 changes: 0 additions & 129 deletions trunk/drivers/staging/hv/netvsc_api.h

This file was deleted.

1 change: 0 additions & 1 deletion trunk/drivers/staging/hv/netvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@

#include "hyperv.h"
#include "hyperv_net.h"
#include "netvsc_api.h"

struct net_device_context {
/* point back to our device context */
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/staging/hv/rndis_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

#include "hyperv.h"
#include "hyperv_net.h"
#include "netvsc_api.h"
#include "rndis_filter.h"

/* Data types */
Expand Down

0 comments on commit 2a1b4a7

Please sign in to comment.