]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: ozwpan: set last_pkt_nb
authorRupesh Gujare <rgujare@ozmodevices.com>
Wed, 20 Jun 2012 12:36:09 +0000 (13:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Jun 2012 23:05:35 +0000 (16:05 -0700)
In case of trigeered ISOC mode set last_pkt_nb only when
we are ready to send data.

Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ozwpan/ozpd.c

index 6c566f58502475064a3f21b0402128e0c2726ee4..25a8a08586d6ec80f43ee1e110fae4e357d748c5 100644 (file)
@@ -419,6 +419,14 @@ void oz_set_more_bit(struct sk_buff *skb)
        struct oz_hdr *oz_hdr = (struct oz_hdr *)skb_network_header(skb);
        oz_hdr->control |= OZ_F_MORE_DATA;
 }
+/*------------------------------------------------------------------------------
+ * Context: softirq-serialized
+ */
+void oz_set_last_pkt_nb(struct oz_pd *pd, struct sk_buff *skb)
+{
+       struct oz_hdr *oz_hdr = (struct oz_hdr *)skb_network_header(skb);
+       oz_hdr->last_pkt_num = pd->trigger_pkt_num & OZ_LAST_PN_MASK;
+}
 /*------------------------------------------------------------------------------
  * Context: softirq
  */
@@ -537,6 +545,7 @@ static int oz_send_next_queued_frame(struct oz_pd *pd, int more_data)
                spin_unlock(&pd->tx_frame_lock);
                if (more_data)
                        oz_set_more_bit(skb);
+               oz_set_last_pkt_nb(pd, skb);
                if ((int)atomic_read(&g_submitted_isoc) <
                                                        OZ_MAX_SUBMITTED_ISOC) {
                        if (dev_queue_xmit(skb) < 0) {