staging: ozwpan: Revert last changes
authorXenia Ragiadakou <burzalodowa@gmail.com>
Fri, 24 May 2013 19:39:55 +0000 (22:39 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 May 2013 22:25:53 +0000 (15:25 -0700)
This patch reverts the changes made by the following patches:

commit id: edea341b0477ce5d53f7341f8b8cf8c91ad54ecf
[PATCH 1/4] ozwpan: replace alloc_skb with dev_alloc_skb in ozpd.c

commit id: b59983f525396a47cf8b28c13bbd5d5ff57859b8
[PATCH 2/4] ozwpan: replace alloc_skb with dev_alloc_skb in ozproto.c

commit id: 4422a6c14d0d0bfe519ec487693f1787f64b0b90
[PATCH 3/4] ozwpan: replace kfree_skb with dev_kfree_skb in ozpd.c

commit id: e241a8b61671b487e1a04b455dbd32ab965250ef
[PATCH 4/4] ozwpan: replace kfree_skb with dev_kfree_skb in ozproto.c

The reason of this revert is that dev_alloc_skb() is not defined
to be used in the allocation of socket buffers on the transmit path
but on the receive path.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ozwpan/ozpd.c
drivers/staging/ozwpan/ozproto.c

index 26db8e36b2814f8bafc0a98e0ac87def9d936f63..f8b9da080c4b65c5b079fcfe8d9eea9bdd5f41a6 100644 (file)
@@ -207,7 +207,7 @@ void oz_pd_destroy(struct oz_pd *pd)
                f = container_of(e, struct oz_tx_frame, link);
                e = e->next;
                if (f->skb != NULL)
-                       dev_kfree_skb(f->skb);
+                       kfree_skb(f->skb);
                oz_retire_frame(pd, f);
        }
        oz_elt_buf_term(&pd->elt_buff);
@@ -463,7 +463,7 @@ static struct sk_buff *oz_build_frame(struct oz_pd *pd, struct oz_tx_frame *f)
        /* Allocate skb with enough space for the lower layers as well
         * as the space we need.
         */
-       skb = dev_alloc_skb(f->total_size + OZ_ALLOCATED_SPACE(dev));
+       skb = alloc_skb(f->total_size + OZ_ALLOCATED_SPACE(dev), GFP_ATOMIC);
        if (skb == NULL)
                return NULL;
        /* Reserve the head room for lower layers.
@@ -491,7 +491,7 @@ static struct sk_buff *oz_build_frame(struct oz_pd *pd, struct oz_tx_frame *f)
        }
        return skb;
 fail:
-       dev_kfree_skb(skb);
+       kfree_skb(skb);
        return NULL;
 }
 /*------------------------------------------------------------------------------
@@ -553,7 +553,7 @@ static int oz_send_next_queued_frame(struct oz_pd *pd, int more_data)
                                                pd->nb_queued_isoc_frames);
                        return 0;
                } else {
-                       dev_kfree_skb(skb);
+                       kfree_skb(skb);
                        oz_trace2(OZ_TRACE_TX_FRAMES, "Dropping ISOC Frame>\n");
                        oz_event_log(OZ_EVT_TX_ISOC_DROP, 0, 0, NULL, 0);
                        return -1;
@@ -633,7 +633,7 @@ static int oz_send_isoc_frame(struct oz_pd *pd)
                pd->max_tx_size, &list);
        if (list.next == &list)
                return 0;
-       skb = dev_alloc_skb(total_size + OZ_ALLOCATED_SPACE(dev));
+       skb = alloc_skb(total_size + OZ_ALLOCATED_SPACE(dev), GFP_ATOMIC);
        if (skb == NULL) {
                oz_trace("Cannot alloc skb\n");
                oz_elt_info_free_chain(&pd->elt_buff, &list);
@@ -645,7 +645,7 @@ static int oz_send_isoc_frame(struct oz_pd *pd)
        skb->protocol = htons(OZ_ETHERTYPE);
        if (dev_hard_header(skb, dev, OZ_ETHERTYPE, pd->mac_addr,
                dev->dev_addr, skb->len) < 0) {
-               dev_kfree_skb(skb);
+               kfree_skb(skb);
                return -1;
        }
        oz_hdr = (struct oz_hdr *)skb_put(skb, total_size);
@@ -744,7 +744,7 @@ int oz_isoc_stream_create(struct oz_pd *pd, u8 ep_num)
  */
 static void oz_isoc_stream_free(struct oz_isoc_stream *st)
 {
-       dev_kfree_skb(st->skb);
+       kfree_skb(st->skb);
        kfree(st);
 }
 /*------------------------------------------------------------------------------
@@ -797,7 +797,8 @@ int oz_send_isoc_unit(struct oz_pd *pd, u8 ep_num, const u8 *data, int len)
                return 0;
        if (!skb) {
                /* Allocate enough space for max size frame. */
-               skb = dev_alloc_skb(pd->max_tx_size + OZ_ALLOCATED_SPACE(dev));
+               skb = alloc_skb(pd->max_tx_size + OZ_ALLOCATED_SPACE(dev),
+                               GFP_ATOMIC);
                if (skb == NULL)
                        return 0;
                /* Reserve the head room for lower layers. */
@@ -880,7 +881,7 @@ int oz_send_isoc_unit(struct oz_pd *pd, u8 ep_num, const u8 *data, int len)
                }
 
 out:   oz_event_log(OZ_EVT_TX_ISOC_DROP, 0, 0, NULL, 0);
-       dev_kfree_skb(skb);
+       kfree_skb(skb);
        return -1;
 
        }
index 1a5845866b08f725703958b6d883669cd9d84a0e..3badf1537adb344deb47c868608d6a91230c9659 100644 (file)
@@ -97,7 +97,7 @@ static void oz_send_conn_rsp(struct oz_pd *pd, u8 status)
        struct oz_elt_connect_rsp *body;
        int sz = sizeof(struct oz_hdr) + sizeof(struct oz_elt) +
                        sizeof(struct oz_elt_connect_rsp);
-       skb = dev_alloc_skb(sz + OZ_ALLOCATED_SPACE(dev));
+       skb = alloc_skb(sz + OZ_ALLOCATED_SPACE(dev), GFP_ATOMIC);
        if (skb == NULL)
                return;
        skb_reserve(skb, LL_RESERVED_SPACE(dev));
@@ -110,7 +110,7 @@ static void oz_send_conn_rsp(struct oz_pd *pd, u8 status)
        /* Fill in device header */
        if (dev_hard_header(skb, dev, OZ_ETHERTYPE, pd->mac_addr,
                        dev->dev_addr, skb->len) < 0) {
-               dev_kfree_skb(skb);
+               kfree_skb(skb);
                return;
        }
        oz_hdr->control = (OZ_PROTOCOL_VERSION<<OZ_VERSION_SHIFT);