2 * Definitions for the 'struct sk_buff' memory handlers in U-Boot.
5 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
7 * See file CREDITS for list of people who contributed to this
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 #include "u-boot_compat.h"
35 static struct sk_buff *sk_table[MAX_SKB];
38 struct sk_buff * alloc_skb(u32 size, int dummy)
41 struct sk_buff * ret = NULL;
43 for (i = 0; i < MAX_SKB; i++)
52 sk_table[i] = malloc(sizeof(struct sk_buff));
55 printf("alloc_skb: malloc failed\n");
59 memset(sk_table[i], 0, sizeof(struct sk_buff));
60 sk_table[i]->data = sk_table[i]->data_unaligned =
62 if (! sk_table[i]->data)
64 printf("alloc_skb: malloc failed\n");
70 sk_table[i]->data += 16 - ((u32)sk_table[i]->data & 15);
71 sk_table[i]->len = size;
83 printf("Unable to allocate skb!\n");
89 void dev_kfree_skb_any(struct sk_buff *skb)
93 for (i = 0; i < MAX_SKB; i++)
95 if (sk_table[i] != skb)
100 free(skb->data_unaligned);
108 printf("SKB allocation error!\n");
112 void skb_reserve(struct sk_buff *skb, unsigned int len)
117 void skb_put(struct sk_buff *skb, unsigned int len)
122 #endif /* CONFIG_SK98 */