diff options
Diffstat (limited to 'drivers/staging/ozwpan/ozpd.c')
-rw-r--r-- | drivers/staging/ozwpan/ozpd.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/staging/ozwpan/ozpd.c b/drivers/staging/ozwpan/ozpd.c index 772641011a44..26c104946a82 100644 --- a/drivers/staging/ozwpan/ozpd.c +++ b/drivers/staging/ozwpan/ozpd.c @@ -106,6 +106,7 @@ struct oz_pd *oz_pd_alloc(const u8 *mac_addr) if (pd) { int i; + atomic_set(&pd->ref_count, 2); for (i = 0; i < OZ_NB_APPS; i++) spin_lock_init(&pd->app_lock[i]); @@ -153,6 +154,7 @@ static void oz_pd_free(struct work_struct *work) list_for_each_safe(e, n, &pd->tx_queue) { struct oz_tx_frame *f = list_entry(e, struct oz_tx_frame, link); + if (f->skb != NULL) kfree_skb(f->skb); oz_retire_frame(pd, f); @@ -249,6 +251,7 @@ void oz_pd_heartbeat(struct oz_pd *pd, u16 apps) hrtimer_cancel(&pd->heartbeat); if (pd->mode & OZ_F_ISOC_ANYTIME) { int count = 8; + while (count-- && (oz_send_isoc_frame(pd) >= 0)) ; } @@ -752,6 +755,7 @@ int oz_send_isoc_unit(struct oz_pd *pd, u8 ep_num, const u8 *data, int len) } else { struct oz_hdr oz; struct oz_isoc_large iso; + spin_lock_bh(&pd->stream_lock); iso.frame_number = st->frame_num; st->frame_num += nb_units; @@ -774,8 +778,10 @@ int oz_send_isoc_unit(struct oz_pd *pd, u8 ep_num, const u8 *data, int len) if (!(pd->mode & OZ_F_ISOC_ANYTIME)) { struct oz_tx_frame *isoc_unit = NULL; int nb = pd->nb_queued_isoc_frames; + if (nb >= pd->isoc_latency) { struct oz_tx_frame *f; + oz_dbg(TX_FRAMES, "Dropping ISOC Unit nb= %d\n", nb); spin_lock(&pd->tx_frame_lock); |