From: Haiyang Zhang <haiyangz@microsoft.com>
To: haiyangz@microsoft.com, hjanssen@microsoft.com,
kys@microsoft.com, v-abkane@microsoft.com, gregkh@suse.de,
linux-kernel@vger.kernel.org, devel@linuxdriverproject.org,
virtualization@lists.osdl.org
Subject: [PATCH 3/8] staging: hv: move netvsc_send_recv_completion() to clean up forward declaration
Date: Thu, 21 Apr 2011 12:30:42 -0700 [thread overview]
Message-ID: <1303414247-22118-4-git-send-email-haiyangz@microsoft.com> (raw)
In-Reply-To: <1303414247-22118-1-git-send-email-haiyangz@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
drivers/staging/hv/netvsc.c | 87 +++++++++++++++++++++----------------------
1 files changed, 42 insertions(+), 45 deletions(-)
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index edd2f4e..ea3c72e 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -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)
{
@@ -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)
{
@@ -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;
--
1.6.3.2
next prev parent reply other threads:[~2011-04-21 19:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-21 19:30 [PATCH 0/8] staging: hv: clean up forward declarations and camel cases in netvsc.c Haiyang Zhang
2011-04-21 19:30 ` [PATCH 1/8] staging: hv: move netvsc_initialize() to clean up forward declaration Haiyang Zhang
2011-04-21 19:30 ` [PATCH 2/8] staging: hv: move netvsc_receive_completion() " Haiyang Zhang
2011-04-21 19:30 ` Haiyang Zhang [this message]
2011-04-21 19:30 ` [PATCH 4/8] staging: hv: move netvsc_destroy_recv_buf() " Haiyang Zhang
2011-04-21 19:30 ` [PATCH 5/8] staging: hv: move netvsc_destroy_send_buf() " Haiyang Zhang
2011-04-21 19:30 ` [PATCH 6/8] staging: hv: move netvsc_device_add() " Haiyang Zhang
2011-04-21 19:30 ` [PATCH 7/8] staging: hv: clean up unused forward declarations Haiyang Zhang
2011-04-21 19:30 ` [PATCH 8/8] staging: hv: convert function name NetVscDisconnectFromVsp to lower case Haiyang Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1303414247-22118-4-git-send-email-haiyangz@microsoft.com \
--to=haiyangz@microsoft.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@suse.de \
--cc=hjanssen@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=v-abkane@microsoft.com \
--cc=virtualization@lists.osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®