Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 249101
b: refs/heads/master
c: 5fa9d3c
h: refs/heads/master
i:
  249099: e3d9541
v: v3
  • Loading branch information
Haiyang Zhang authored and Greg Kroah-Hartman committed Apr 25, 2011
1 parent 43e5f97 commit d36f55f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 46 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: 57991156b949cca02737e67d8fa3fa75f80720d9
refs/heads/master: 5fa9d3c51d15a3b573c76e385dd9149cc77e7598
87 changes: 42 additions & 45 deletions trunk/drivers/staging/hv/netvsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ static void netvsc_send_completion(struct hv_device *device,
static void netvsc_receive(struct hv_device *device,
struct vmpacket_descriptor *packet);

static void netvsc_send_recv_completion(struct hv_device *device,
u64 transaction_id);


static struct netvsc_device *alloc_net_device(struct hv_device *device)
{
Expand Down Expand Up @@ -835,6 +832,48 @@ static int netvsc_send(struct hv_device *device,
return ret;
}

static void netvsc_send_recv_completion(struct hv_device *device,
u64 transaction_id)
{
struct nvsp_message recvcompMessage;
int retries = 0;
int ret;

recvcompMessage.hdr.msg_type =
NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE;

/* FIXME: Pass in the status */
recvcompMessage.msg.v1_msg.send_rndis_pkt_complete.status =
NVSP_STAT_SUCCESS;

retry_send_cmplt:
/* Send the completion */
ret = vmbus_sendpacket(device->channel, &recvcompMessage,
sizeof(struct nvsp_message), transaction_id,
VM_PKT_COMP, 0);
if (ret == 0) {
/* success */
/* no-op */
} else if (ret == -1) {
/* no more room...wait a bit and attempt to retry 3 times */
retries++;
dev_err(&device->device, "unable to send receive completion pkt"
" (tid %llx)...retrying %d", transaction_id, retries);

if (retries < 4) {
udelay(100);
goto retry_send_cmplt;
} else {
dev_err(&device->device, "unable to send receive "
"completion pkt (tid %llx)...give up retrying",
transaction_id);
}
} else {
dev_err(&device->device, "unable to send receive "
"completion pkt - %llx", transaction_id);
}
}

/* Send a receive completion packet to RNDIS device (ie NetVsp) */
static void netvsc_receive_completion(void *context)
{
Expand Down Expand Up @@ -1069,48 +1108,6 @@ static void netvsc_receive(struct hv_device *device,
put_net_device(device);
}

static void netvsc_send_recv_completion(struct hv_device *device,
u64 transaction_id)
{
struct nvsp_message recvcompMessage;
int retries = 0;
int ret;

recvcompMessage.hdr.msg_type =
NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE;

/* FIXME: Pass in the status */
recvcompMessage.msg.v1_msg.send_rndis_pkt_complete.status =
NVSP_STAT_SUCCESS;

retry_send_cmplt:
/* Send the completion */
ret = vmbus_sendpacket(device->channel, &recvcompMessage,
sizeof(struct nvsp_message), transaction_id,
VM_PKT_COMP, 0);
if (ret == 0) {
/* success */
/* no-op */
} else if (ret == -1) {
/* no more room...wait a bit and attempt to retry 3 times */
retries++;
dev_err(&device->device, "unable to send receive completion pkt"
" (tid %llx)...retrying %d", transaction_id, retries);

if (retries < 4) {
udelay(100);
goto retry_send_cmplt;
} else {
dev_err(&device->device, "unable to send receive "
"completion pkt (tid %llx)...give up retrying",
transaction_id);
}
} else {
dev_err(&device->device, "unable to send receive "
"completion pkt - %llx", transaction_id);
}
}

static void netvsc_channel_cb(void *context)
{
int ret;
Expand Down

0 comments on commit d36f55f

Please sign in to comment.