summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorRupesh Gujare <rupesh.gujare@atmel.com>2013-08-01 18:40:03 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-02 11:56:56 +0800
commit2dc2ee5ccdaf88b41bf9c025acf14ebdc2959a21 (patch)
tree9f46566abf1440197f206c877b45f9b99fb8d139 /drivers/staging
parent4d6c9e57027940b6b492abac4c1b67710e38f366 (diff)
staging: ozwpan: Drop oldest ISOC frame instead of dropping latest.
In case of ISOC transfer, if TX queue is full then we start dropping latest frame, instead we should drop oldest frame & add latest frame to TX queue. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/ozwpan/ozpd.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/staging/ozwpan/ozpd.c b/drivers/staging/ozwpan/ozpd.c
index 86876bda29a5..17fd7b2aa88e 100644
--- a/drivers/staging/ozwpan/ozpd.c
+++ b/drivers/staging/ozwpan/ozpd.c
@@ -844,9 +844,20 @@ int oz_send_isoc_unit(struct oz_pd *pd, u8 ep_num, const u8 *data, int len)
struct oz_tx_frame *isoc_unit = NULL;
int nb = pd->nb_queued_isoc_frames;
if (nb >= pd->isoc_latency) {
+ struct list_head *e;
+ struct oz_tx_frame *f;
oz_dbg(TX_FRAMES, "Dropping ISOC Unit nb= %d\n",
nb);
- goto out;
+ spin_lock(&pd->tx_frame_lock);
+ list_for_each(e, &pd->tx_queue) {
+ f = container_of(e, struct oz_tx_frame,
+ link);
+ if (f->skb != NULL) {
+ oz_tx_isoc_free(pd, f);
+ break;
+ }
+ }
+ spin_unlock(&pd->tx_frame_lock);
}
isoc_unit = oz_tx_frame_alloc(pd);
if (isoc_unit == NULL)