/*
* Copyright (c) 2009, Microsoft Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place - Suite 330, Boston, MA 02111-1307 USA.
*
* Authors:
* Haiyang Zhang <haiyangz@microsoft.com>
* Hank Janssen <hjanssen@microsoft.com>
*/
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/slab.h>
#include "osd.h"
#include "logging.h"
#include "netvsc.h"
#include "rndis_filter.h"
#include "channel.h"
/* Globals */
static const char *driver_name = "netvsc";
/* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */
static const struct hv_guid netvsc_device_type = {
.data = {
0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46,
0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E
}
};
static int netvsc_device_add(struct hv_device *device, void *additional_info);
static int netvsc_device_remove(struct hv_device *device);
static void netvsc_cleanup(struct hv_driver *driver);
static void netvsc_channel_cb(void *context);
static int netvsc_init_send_buf(struct hv_device *device);
static int netvsc_init_recv_buf(struct hv_device *device);
static int netvsc_destroy_send_buf(struct netvsc_device *net_device);
static int netvsc_destroy_recv_buf(struct netvsc_device *net_device);
static int netvsc_connect_vsp(struct hv_device *device);
static void netvsc_send_completion(struct hv_device *device,
struct vmpacket_descriptor *packet);
static int netvsc_send(struct hv_device *device,
struct hv_netvsc_packet *packet);
static void netvsc_receive(struct hv_device *device,
struct vmpacket_descriptor *packet);
static