Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266546
b: refs/heads/master
c: f7a7e7a
h: refs/heads/master
v: v3
  • Loading branch information
Vasanthakumar Thiagarajan authored and Kalle Valo committed Aug 31, 2011
1 parent a292a3e commit a004187
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 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: 3ce6ff501c92e15314f450edc2e93653a7325780
refs/heads/master: f7a7e7ae5db1d436805de7fe19c51b5b2657c63e
24 changes: 12 additions & 12 deletions trunk/drivers/net/wireless/ath/ath6kl/htc.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,13 +381,7 @@ static int htc_setup_send_scat_list(struct htc_target *target,

cred_pad = htc_get_credit_padding(target->tgt_cred_sz,
&len, endpoint);
if (cred_pad < 0) {
status = -EINVAL;
break;
}

if (rem_scat < len) {
/* exceeds what we can transfer */
if (cred_pad < 0 || rem_scat < len) {
status = -ENOSPC;
break;
}
Expand Down Expand Up @@ -416,18 +410,18 @@ static int htc_setup_send_scat_list(struct htc_target *target,
}

/* Roll back scatter setup in case of any failure */
if (status || (scat_req->scat_entries < HTC_MIN_HTC_MSGS_TO_BUNDLE)) {
if (scat_req->scat_entries < HTC_MIN_HTC_MSGS_TO_BUNDLE) {
for (i = scat_req->scat_entries - 1; i >= 0; i--) {
packet = scat_req->scat_list[i].packet;
if (packet) {
packet->buf += HTC_HDR_LENGTH;
list_add(&packet->list, queue);
}
}
return -EINVAL;
return -EAGAIN;
}

return 0;
return status;
}

/*
Expand All @@ -447,8 +441,10 @@ static void htc_issue_send_bundle(struct htc_endpoint *endpoint,
struct htc_target *target = endpoint->target;
struct hif_scatter_req *scat_req = NULL;
int n_scat, n_sent_bundle = 0, tot_pkts_bundle = 0;
int status;

while (true) {
status = 0;
n_scat = get_queue_depth(queue);
n_scat = min(n_scat, target->msg_per_bndl_max);

Expand All @@ -471,8 +467,9 @@ static void htc_issue_send_bundle(struct htc_endpoint *endpoint,
scat_req->len = 0;
scat_req->scat_entries = 0;

if (htc_setup_send_scat_list(target, endpoint, scat_req,
n_scat, queue)) {
status = htc_setup_send_scat_list(target, endpoint,
scat_req, n_scat, queue);
if (status == -EAGAIN) {
hif_scatter_req_add(target->dev->ar, scat_req);
break;
}
Expand All @@ -486,6 +483,9 @@ static void htc_issue_send_bundle(struct htc_endpoint *endpoint,
"send scatter total bytes: %d , entries: %d\n",
scat_req->len, scat_req->scat_entries);
ath6kldev_submit_scat_req(target->dev, scat_req, false);

if (status)
break;
}

*sent_bundle = n_sent_bundle;
Expand Down

0 comments on commit a004187

Please sign in to comment.