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);
-
-};
-
-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 */
+ int ring_size;
};
/* Interface */
struct hv_netvsc_packet *packet);
void netvsc_linkstatus_callback(struct hv_device *device_obj,
unsigned int status);
+int netvsc_recv_callback(struct hv_device *device_obj,
+ struct hv_netvsc_packet *packet);
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);
+void rndis_filter_device_remove(struct hv_device *dev);
+int rndis_filter_receive(struct hv_device *dev,
+ struct hv_netvsc_packet *pkt);
+int rndis_filter_send(struct hv_device *dev,
+ struct hv_netvsc_packet *pkt);
#define NVSP_INVALID_PROTOCOL_VERSION ((u32)0xFFFFFFFF)
union rndis_message_container msg;
};
+
+struct rndis_filter_packet {
+ void *completion_ctx;
+ void (*completion)(void *context);
+ struct rndis_message msg;
+};
+
/* Handy macros */
/* get the size of an RNDIS message. Pass in the message type, */
#define NDIS_PACKET_TYPE_MAC_FRAME 0x00000800
-/* Interface */
-
-extern int rndis_filter_init(struct netvsc_driver *driver);
#endif /* _HYPERV_NET_H */