Commit d9871158 authored by Haiyang Zhang's avatar Haiyang Zhang Committed by Greg Kroah-Hartman

staging: hv: convert dev_<loglevel> to netdev_<loglevel> in netvsc

Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c909ebbd
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/netdevice.h>
#include "hyperv_net.h" #include "hyperv_net.h"
...@@ -80,6 +81,7 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device) ...@@ -80,6 +81,7 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
{ {
struct nvsp_message *revoke_packet; struct nvsp_message *revoke_packet;
int ret = 0; int ret = 0;
struct net_device *ndev = dev_get_drvdata(&net_device->dev->device);
/* /*
* If we got a section count, it means we received a * If we got a section count, it means we received a
...@@ -107,7 +109,7 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device) ...@@ -107,7 +109,7 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
* have a leak rather than continue and a bugchk * have a leak rather than continue and a bugchk
*/ */
if (ret != 0) { if (ret != 0) {
dev_err(&net_device->dev->device, "unable to send " netdev_err(ndev, "unable to send "
"revoke receive buffer to netvsp\n"); "revoke receive buffer to netvsp\n");
return ret; return ret;
} }
...@@ -122,7 +124,7 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device) ...@@ -122,7 +124,7 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
* rather than continue and a bugchk * rather than continue and a bugchk
*/ */
if (ret != 0) { if (ret != 0) {
dev_err(&net_device->dev->device, netdev_err(ndev,
"unable to teardown receive buffer's gpadl\n"); "unable to teardown receive buffer's gpadl\n");
return ret; return ret;
} }
...@@ -151,10 +153,11 @@ static int netvsc_init_recv_buf(struct hv_device *device) ...@@ -151,10 +153,11 @@ static int netvsc_init_recv_buf(struct hv_device *device)
int t; int t;
struct netvsc_device *net_device; struct netvsc_device *net_device;
struct nvsp_message *init_packet; struct nvsp_message *init_packet;
struct net_device *ndev = dev_get_drvdata(&device->device);
net_device = get_outbound_net_device(device); net_device = get_outbound_net_device(device);
if (!net_device) { if (!net_device) {
dev_err(&device->device, "unable to get net device..." netdev_err(ndev, "unable to get net device..."
"device being destroyed?\n"); "device being destroyed?\n");
return -ENODEV; return -ENODEV;
} }
...@@ -163,7 +166,7 @@ static int netvsc_init_recv_buf(struct hv_device *device) ...@@ -163,7 +166,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
(void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO, (void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO,
get_order(net_device->recv_buf_size)); get_order(net_device->recv_buf_size));
if (!net_device->recv_buf) { if (!net_device->recv_buf) {
dev_err(&device->device, "unable to allocate receive " netdev_err(ndev, "unable to allocate receive "
"buffer of size %d\n", net_device->recv_buf_size); "buffer of size %d\n", net_device->recv_buf_size);
ret = -ENOMEM; ret = -ENOMEM;
goto cleanup; goto cleanup;
...@@ -178,7 +181,7 @@ static int netvsc_init_recv_buf(struct hv_device *device) ...@@ -178,7 +181,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
net_device->recv_buf_size, net_device->recv_buf_size,
&net_device->recv_buf_gpadl_handle); &net_device->recv_buf_gpadl_handle);
if (ret != 0) { if (ret != 0) {
dev_err(&device->device, netdev_err(ndev,
"unable to establish receive buffer's gpadl\n"); "unable to establish receive buffer's gpadl\n");
goto cleanup; goto cleanup;
} }
...@@ -202,7 +205,7 @@ static int netvsc_init_recv_buf(struct hv_device *device) ...@@ -202,7 +205,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
VM_PKT_DATA_INBAND, VM_PKT_DATA_INBAND,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
if (ret != 0) { if (ret != 0) {
dev_err(&device->device, netdev_err(ndev,
"unable to send receive buffer's gpadl to netvsp\n"); "unable to send receive buffer's gpadl to netvsp\n");
goto cleanup; goto cleanup;
} }
...@@ -214,7 +217,7 @@ static int netvsc_init_recv_buf(struct hv_device *device) ...@@ -214,7 +217,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
/* Check the response */ /* Check the response */
if (init_packet->msg.v1_msg. if (init_packet->msg.v1_msg.
send_recv_buf_complete.status != NVSP_STAT_SUCCESS) { send_recv_buf_complete.status != NVSP_STAT_SUCCESS) {
dev_err(&device->device, "Unable to complete receive buffer " netdev_err(ndev, "Unable to complete receive buffer "
"initialzation with NetVsp - status %d\n", "initialzation with NetVsp - status %d\n",
init_packet->msg.v1_msg. init_packet->msg.v1_msg.
send_recv_buf_complete.status); send_recv_buf_complete.status);
...@@ -266,10 +269,11 @@ static int netvsc_connect_vsp(struct hv_device *device) ...@@ -266,10 +269,11 @@ static int netvsc_connect_vsp(struct hv_device *device)
struct netvsc_device *net_device; struct netvsc_device *net_device;
struct nvsp_message *init_packet; struct nvsp_message *init_packet;
int ndis_version; int ndis_version;
struct net_device *ndev = dev_get_drvdata(&device->device);
net_device = get_outbound_net_device(device); net_device = get_outbound_net_device(device);
if (!net_device) { if (!net_device) {
dev_err(&device->device, "unable to get net device..." netdev_err(ndev, "unable to get net device..."
"device being destroyed?\n"); "device being destroyed?\n");
return -ENODEV; return -ENODEV;
} }
...@@ -360,7 +364,7 @@ int netvsc_device_remove(struct hv_device *device) ...@@ -360,7 +364,7 @@ int netvsc_device_remove(struct hv_device *device)
/* Wait for all send completions */ /* Wait for all send completions */
while (atomic_read(&net_device->num_outstanding_sends)) { while (atomic_read(&net_device->num_outstanding_sends)) {
dev_err(&device->device, dev_info(&device->device,
"waiting for %d requests to complete...\n", "waiting for %d requests to complete...\n",
atomic_read(&net_device->num_outstanding_sends)); atomic_read(&net_device->num_outstanding_sends));
udelay(100); udelay(100);
...@@ -403,10 +407,11 @@ static void netvsc_send_completion(struct hv_device *device, ...@@ -403,10 +407,11 @@ static void netvsc_send_completion(struct hv_device *device,
struct netvsc_device *net_device; struct netvsc_device *net_device;
struct nvsp_message *nvsp_packet; struct nvsp_message *nvsp_packet;
struct hv_netvsc_packet *nvsc_packet; struct hv_netvsc_packet *nvsc_packet;
struct net_device *ndev = dev_get_drvdata(&device->device);
net_device = get_inbound_net_device(device); net_device = get_inbound_net_device(device);
if (!net_device) { if (!net_device) {
dev_err(&device->device, "unable to get net device..." netdev_err(ndev, "unable to get net device..."
"device being destroyed?\n"); "device being destroyed?\n");
return; return;
} }
...@@ -435,7 +440,7 @@ static void netvsc_send_completion(struct hv_device *device, ...@@ -435,7 +440,7 @@ static void netvsc_send_completion(struct hv_device *device,
atomic_dec(&net_device->num_outstanding_sends); atomic_dec(&net_device->num_outstanding_sends);
} else { } else {
dev_err(&device->device, "Unknown send completion packet type- " netdev_err(ndev, "Unknown send completion packet type- "
"%d received!!\n", nvsp_packet->hdr.msg_type); "%d received!!\n", nvsp_packet->hdr.msg_type);
} }
...@@ -446,12 +451,12 @@ int netvsc_send(struct hv_device *device, ...@@ -446,12 +451,12 @@ int netvsc_send(struct hv_device *device,
{ {
struct netvsc_device *net_device; struct netvsc_device *net_device;
int ret = 0; int ret = 0;
struct nvsp_message sendMessage; struct nvsp_message sendMessage;
struct net_device *ndev = dev_get_drvdata(&device->device);
net_device = get_outbound_net_device(device); net_device = get_outbound_net_device(device);
if (!net_device) { if (!net_device) {
dev_err(&device->device, "net device (%p) shutting down..." netdev_err(ndev, "net device (%p) shutting down..."
"ignoring outbound packets\n", net_device); "ignoring outbound packets\n", net_device);
return -ENODEV; return -ENODEV;
} }
...@@ -487,7 +492,7 @@ int netvsc_send(struct hv_device *device, ...@@ -487,7 +492,7 @@ int netvsc_send(struct hv_device *device,
} }
if (ret != 0) if (ret != 0)
dev_err(&device->device, "Unable to send packet %p ret %d\n", netdev_err(ndev, "Unable to send packet %p ret %d\n",
packet, ret); packet, ret);
atomic_inc(&net_device->num_outstanding_sends); atomic_inc(&net_device->num_outstanding_sends);
...@@ -500,6 +505,7 @@ static void netvsc_send_recv_completion(struct hv_device *device, ...@@ -500,6 +505,7 @@ static void netvsc_send_recv_completion(struct hv_device *device,
struct nvsp_message recvcompMessage; struct nvsp_message recvcompMessage;
int retries = 0; int retries = 0;
int ret; int ret;
struct net_device *ndev = dev_get_drvdata(&device->device);
recvcompMessage.hdr.msg_type = recvcompMessage.hdr.msg_type =
NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE; NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE;
...@@ -519,19 +525,19 @@ static void netvsc_send_recv_completion(struct hv_device *device, ...@@ -519,19 +525,19 @@ static void netvsc_send_recv_completion(struct hv_device *device,
} else if (ret == -EAGAIN) { } else if (ret == -EAGAIN) {
/* no more room...wait a bit and attempt to retry 3 times */ /* no more room...wait a bit and attempt to retry 3 times */
retries++; retries++;
dev_err(&device->device, "unable to send receive completion pkt" netdev_err(ndev, "unable to send receive completion pkt"
" (tid %llx)...retrying %d\n", transaction_id, retries); " (tid %llx)...retrying %d\n", transaction_id, retries);
if (retries < 4) { if (retries < 4) {
udelay(100); udelay(100);
goto retry_send_cmplt; goto retry_send_cmplt;
} else { } else {
dev_err(&device->device, "unable to send receive " netdev_err(ndev, "unable to send receive "
"completion pkt (tid %llx)...give up retrying\n", "completion pkt (tid %llx)...give up retrying\n",
transaction_id); transaction_id);
} }
} else { } else {
dev_err(&device->device, "unable to send receive " netdev_err(ndev, "unable to send receive "
"completion pkt - %llx\n", transaction_id); "completion pkt - %llx\n", transaction_id);
} }
} }
...@@ -545,6 +551,7 @@ static void netvsc_receive_completion(void *context) ...@@ -545,6 +551,7 @@ static void netvsc_receive_completion(void *context)
u64 transaction_id = 0; u64 transaction_id = 0;
bool fsend_receive_comp = false; bool fsend_receive_comp = false;
unsigned long flags; unsigned long flags;
struct net_device *ndev = dev_get_drvdata(&device->device);
/* /*
* Even though it seems logical to do a GetOutboundNetDevice() here to * Even though it seems logical to do a GetOutboundNetDevice() here to
...@@ -553,7 +560,7 @@ static void netvsc_receive_completion(void *context) ...@@ -553,7 +560,7 @@ static void netvsc_receive_completion(void *context)
*/ */
net_device = get_inbound_net_device(device); net_device = get_inbound_net_device(device);
if (!net_device) { if (!net_device) {
dev_err(&device->device, "unable to get net device..." netdev_err(ndev, "unable to get net device..."
"device being destroyed?\n"); "device being destroyed?\n");
return; return;
} }
...@@ -599,12 +606,13 @@ static void netvsc_receive(struct hv_device *device, ...@@ -599,12 +606,13 @@ static void netvsc_receive(struct hv_device *device,
int i, j; int i, j;
int count = 0, bytes_remain = 0; int count = 0, bytes_remain = 0;
unsigned long flags; unsigned long flags;
struct net_device *ndev = dev_get_drvdata(&device->device);
LIST_HEAD(listHead); LIST_HEAD(listHead);
net_device = get_inbound_net_device(device); net_device = get_inbound_net_device(device);
if (!net_device) { if (!net_device) {
dev_err(&device->device, "unable to get net device..." netdev_err(ndev, "unable to get net device..."
"device being destroyed?\n"); "device being destroyed?\n");
return; return;
} }
...@@ -614,7 +622,7 @@ static void netvsc_receive(struct hv_device *device, ...@@ -614,7 +622,7 @@ static void netvsc_receive(struct hv_device *device,
* packet * packet
*/ */
if (packet->type != VM_PKT_DATA_USING_XFER_PAGES) { if (packet->type != VM_PKT_DATA_USING_XFER_PAGES) {
dev_err(&device->device, "Unknown packet type received - %d\n", netdev_err(ndev, "Unknown packet type received - %d\n",
packet->type); packet->type);
return; return;
} }
...@@ -625,7 +633,7 @@ static void netvsc_receive(struct hv_device *device, ...@@ -625,7 +633,7 @@ static void netvsc_receive(struct hv_device *device,
/* Make sure this is a valid nvsp packet */ /* Make sure this is a valid nvsp packet */
if (nvsp_packet->hdr.msg_type != if (nvsp_packet->hdr.msg_type !=
NVSP_MSG1_TYPE_SEND_RNDIS_PKT) { NVSP_MSG1_TYPE_SEND_RNDIS_PKT) {
dev_err(&device->device, "Unknown nvsp packet type received-" netdev_err(ndev, "Unknown nvsp packet type received-"
" %d\n", nvsp_packet->hdr.msg_type); " %d\n", nvsp_packet->hdr.msg_type);
return; return;
} }
...@@ -633,7 +641,7 @@ static void netvsc_receive(struct hv_device *device, ...@@ -633,7 +641,7 @@ static void netvsc_receive(struct hv_device *device,
vmxferpage_packet = (struct vmtransfer_page_packet_header *)packet; vmxferpage_packet = (struct vmtransfer_page_packet_header *)packet;
if (vmxferpage_packet->xfer_pageset_id != NETVSC_RECEIVE_BUFFER_ID) { if (vmxferpage_packet->xfer_pageset_id != NETVSC_RECEIVE_BUFFER_ID) {
dev_err(&device->device, "Invalid xfer page set id - " netdev_err(ndev, "Invalid xfer page set id - "
"expecting %x got %x\n", NETVSC_RECEIVE_BUFFER_ID, "expecting %x got %x\n", NETVSC_RECEIVE_BUFFER_ID,
vmxferpage_packet->xfer_pageset_id); vmxferpage_packet->xfer_pageset_id);
return; return;
...@@ -659,7 +667,7 @@ static void netvsc_receive(struct hv_device *device, ...@@ -659,7 +667,7 @@ static void netvsc_receive(struct hv_device *device,
* some of the xfer page packet ranges... * some of the xfer page packet ranges...
*/ */
if (count < 2) { if (count < 2) {
dev_err(&device->device, "Got only %d netvsc pkt...needed " netdev_err(ndev, "Got only %d netvsc pkt...needed "
"%d pkts. Dropping this xfer page packet completely!\n", "%d pkts. Dropping this xfer page packet completely!\n",
count, vmxferpage_packet->range_cnt + 1); count, vmxferpage_packet->range_cnt + 1);
...@@ -686,7 +694,7 @@ static void netvsc_receive(struct hv_device *device, ...@@ -686,7 +694,7 @@ static void netvsc_receive(struct hv_device *device,
xferpage_packet->count = count - 1; xferpage_packet->count = count - 1;
if (xferpage_packet->count != vmxferpage_packet->range_cnt) { if (xferpage_packet->count != vmxferpage_packet->range_cnt) {
dev_err(&device->device, "Needed %d netvsc pkts to satisy " netdev_err(ndev, "Needed %d netvsc pkts to satisy "
"this xfer page...got %d\n", "this xfer page...got %d\n",
vmxferpage_packet->range_cnt, xferpage_packet->count); vmxferpage_packet->range_cnt, xferpage_packet->count);
} }
...@@ -775,6 +783,7 @@ static void netvsc_channel_cb(void *context) ...@@ -775,6 +783,7 @@ static void netvsc_channel_cb(void *context)
struct vmpacket_descriptor *desc; struct vmpacket_descriptor *desc;
unsigned char *buffer; unsigned char *buffer;
int bufferlen = NETVSC_PACKET_SIZE; int bufferlen = NETVSC_PACKET_SIZE;
struct net_device *ndev = dev_get_drvdata(&device->device);
packet = kzalloc(NETVSC_PACKET_SIZE * sizeof(unsigned char), packet = kzalloc(NETVSC_PACKET_SIZE * sizeof(unsigned char),
GFP_ATOMIC); GFP_ATOMIC);
...@@ -784,7 +793,7 @@ static void netvsc_channel_cb(void *context) ...@@ -784,7 +793,7 @@ static void netvsc_channel_cb(void *context)
net_device = get_inbound_net_device(device); net_device = get_inbound_net_device(device);
if (!net_device) { if (!net_device) {
dev_err(&device->device, "net device (%p) shutting down..." netdev_err(ndev, "net device (%p) shutting down..."
"ignoring inbound packets\n", net_device); "ignoring inbound packets\n", net_device);
goto out; goto out;
} }
...@@ -805,7 +814,7 @@ static void netvsc_channel_cb(void *context) ...@@ -805,7 +814,7 @@ static void netvsc_channel_cb(void *context)
break; break;
default: default:
dev_err(&device->device, netdev_err(ndev,
"unhandled packet type %d, " "unhandled packet type %d, "
"tid %llx len %d\n", "tid %llx len %d\n",
desc->type, request_id, desc->type, request_id,
...@@ -834,7 +843,7 @@ static void netvsc_channel_cb(void *context) ...@@ -834,7 +843,7 @@ static void netvsc_channel_cb(void *context)
buffer = kmalloc(bytes_recvd, GFP_ATOMIC); buffer = kmalloc(bytes_recvd, GFP_ATOMIC);
if (buffer == NULL) { if (buffer == NULL) {
/* Try again next time around */ /* Try again next time around */
dev_err(&device->device, netdev_err(ndev,
"unable to allocate buffer of size " "unable to allocate buffer of size "
"(%d)!!\n", bytes_recvd); "(%d)!!\n", bytes_recvd);
break; break;
...@@ -861,6 +870,7 @@ int netvsc_device_add(struct hv_device *device, void *additional_info) ...@@ -861,6 +870,7 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
((struct netvsc_device_info *)additional_info)->ring_size; ((struct netvsc_device_info *)additional_info)->ring_size;
struct netvsc_device *net_device; struct netvsc_device *net_device;
struct hv_netvsc_packet *packet, *pos; struct hv_netvsc_packet *packet, *pos;
struct net_device *ndev = dev_get_drvdata(&device->device);
net_device = alloc_net_device(device); net_device = alloc_net_device(device);
if (!net_device) { if (!net_device) {
...@@ -892,7 +902,7 @@ int netvsc_device_add(struct hv_device *device, void *additional_info) ...@@ -892,7 +902,7 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
netvsc_channel_cb, device); netvsc_channel_cb, device);
if (ret != 0) { if (ret != 0) {
dev_err(&device->device, "unable to open channel: %d\n", ret); netdev_err(ndev, "unable to open channel: %d\n", ret);
goto cleanup; goto cleanup;
} }
...@@ -902,7 +912,7 @@ int netvsc_device_add(struct hv_device *device, void *additional_info) ...@@ -902,7 +912,7 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
/* Connect with the NetVsp */ /* Connect with the NetVsp */
ret = netvsc_connect_vsp(device); ret = netvsc_connect_vsp(device);
if (ret != 0) { if (ret != 0) {
dev_err(&device->device, netdev_err(ndev,
"unable to connect to NetVSP - %d\n", ret); "unable to connect to NetVSP - %d\n", ret);
goto close; goto close;
} }
......
...@@ -249,6 +249,7 @@ static void rndis_filter_receive_response(struct rndis_device *dev, ...@@ -249,6 +249,7 @@ static void rndis_filter_receive_response(struct rndis_device *dev,
struct rndis_request *request = NULL; struct rndis_request *request = NULL;
bool found = false; bool found = false;
unsigned long flags; unsigned long flags;
struct net_device *ndev = dev_get_drvdata(&dev->net_dev->dev->device);
spin_lock_irqsave(&dev->request_lock, flags); spin_lock_irqsave(&dev->request_lock, flags);
list_for_each_entry(request, &dev->req_list, list_ent) { list_for_each_entry(request, &dev->req_list, list_ent) {
...@@ -269,7 +270,7 @@ static void rndis_filter_receive_response(struct rndis_device *dev, ...@@ -269,7 +270,7 @@ static void rndis_filter_receive_response(struct rndis_device *dev,
memcpy(&request->response_msg, resp, memcpy(&request->response_msg, resp,
resp->msg_len); resp->msg_len);
} else { } else {
dev_err(&dev->net_dev->dev->device, netdev_err(ndev,
"rndis response buffer overflow " "rndis response buffer overflow "
"detected (size %u max %zu)\n", "detected (size %u max %zu)\n",
resp->msg_len, resp->msg_len,
...@@ -289,7 +290,7 @@ static void rndis_filter_receive_response(struct rndis_device *dev, ...@@ -289,7 +290,7 @@ static void rndis_filter_receive_response(struct rndis_device *dev,
complete(&request->wait_event); complete(&request->wait_event);
} else { } else {
dev_err(&dev->net_dev->dev->device, netdev_err(ndev,
"no rndis request found for this response " "no rndis request found for this response "
"(id 0x%x res type 0x%x)\n", "(id 0x%x res type 0x%x)\n",
resp->msg.init_complete.req_id, resp->msg.init_complete.req_id,
...@@ -349,20 +350,21 @@ int rndis_filter_receive(struct hv_device *dev, ...@@ -349,20 +350,21 @@ int rndis_filter_receive(struct hv_device *dev,
struct rndis_device *rndis_dev; struct rndis_device *rndis_dev;
struct rndis_message rndis_msg; struct rndis_message rndis_msg;
struct rndis_message *rndis_hdr; struct rndis_message *rndis_hdr;
struct net_device *ndev = dev_get_drvdata(&dev->device);
if (!net_dev) if (!net_dev)
return -EINVAL; return -EINVAL;
/* Make sure the rndis device state is initialized */ /* Make sure the rndis device state is initialized */
if (!net_dev->extension) { if (!net_dev->extension) {
dev_err(&dev->device, "got rndis message but no rndis device - " netdev_err(ndev, "got rndis message but no rndis device - "
"dropping this message!\n"); "dropping this message!\n");
return -ENODEV; return -ENODEV;
} }
rndis_dev = (struct rndis_device *)net_dev->extension; rndis_dev = (struct rndis_device *)net_dev->extension;
if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) { if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) {
dev_err(&dev->device, "got rndis message but rndis device " netdev_err(ndev, "got rndis message but rndis device "
"uninitialized...dropping this message!\n"); "uninitialized...dropping this message!\n");
return -ENODEV; return -ENODEV;
} }
...@@ -376,7 +378,7 @@ int rndis_filter_receive(struct hv_device *dev, ...@@ -376,7 +378,7 @@ int rndis_filter_receive(struct hv_device *dev,
/* Make sure we got a valid rndis message */ /* Make sure we got a valid rndis message */
if ((rndis_hdr->ndis_msg_type != REMOTE_NDIS_PACKET_MSG) && if ((rndis_hdr->ndis_msg_type != REMOTE_NDIS_PACKET_MSG) &&
(rndis_hdr->msg_len > sizeof(struct rndis_message))) { (rndis_hdr->msg_len > sizeof(struct rndis_message))) {
dev_err(&dev->device, "incoming rndis message buffer overflow " netdev_err(ndev, "incoming rndis message buffer overflow "
"detected (got %u, max %zu)..marking it an error!\n", "detected (got %u, max %zu)..marking it an error!\n",
rndis_hdr->msg_len, rndis_hdr->msg_len,
sizeof(struct rndis_message)); sizeof(struct rndis_message));
...@@ -409,7 +411,7 @@ int rndis_filter_receive(struct hv_device *dev, ...@@ -409,7 +411,7 @@ int rndis_filter_receive(struct hv_device *dev,
rndis_filter_receive_indicate_status(rndis_dev, &rndis_msg); rndis_filter_receive_indicate_status(rndis_dev, &rndis_msg);
break; break;
default: default:
dev_err(&dev->device, netdev_err(ndev,
"unhandled rndis message (type %u len %u)\n", "unhandled rndis message (type %u len %u)\n",
rndis_msg.ndis_msg_type, rndis_msg.ndis_msg_type,
rndis_msg.msg_len); rndis_msg.msg_len);
...@@ -505,6 +507,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev, ...@@ -505,6 +507,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
struct rndis_set_complete *set_complete; struct rndis_set_complete *set_complete;
u32 status; u32 status;
int ret, t; int ret, t;
struct net_device *ndev = dev_get_drvdata(&dev->net_dev->dev->device);
request = get_rndis_request(dev, REMOTE_NDIS_SET_MSG, request = get_rndis_request(dev, REMOTE_NDIS_SET_MSG,
RNDIS_MESSAGE_SIZE(struct rndis_set_request) + RNDIS_MESSAGE_SIZE(struct rndis_set_request) +
...@@ -530,7 +533,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev, ...@@ -530,7 +533,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
t = wait_for_completion_timeout(&request->wait_event, 5*HZ); t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
if (t == 0) { if (t == 0) {
dev_err(&dev->net_dev->dev->device, netdev_err(ndev,
"timeout before we got a set response...\n"); "timeout before we got a set response...\n");
/* /*
* We can't deallocate the request since we may still receive a * We can't deallocate the request since we may still receive a
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment