aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ifb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ifb.c')
-rw-r--r--drivers/net/ifb.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index 43e3f33ed5e2..6469130c1413 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -1,4 +1,4 @@
1/* drivers/net/ifb.c: 1/* drivers/net/ifb.c:
2 2
3 The purpose of this driver is to provide a device that allows 3 The purpose of this driver is to provide a device that allows
4 for sharing of resources: 4 for sharing of resources:
@@ -8,8 +8,8 @@
8 an impression of sharing. 8 an impression of sharing.
9 9
10 2) Allows for queueing incoming traffic for shaping instead of 10 2) Allows for queueing incoming traffic for shaping instead of
11 dropping. 11 dropping.
12 12
13 The original concept is based on what is known as the IMQ 13 The original concept is based on what is known as the IMQ
14 driver initially written by Martin Devera, later rewritten 14 driver initially written by Martin Devera, later rewritten
15 by Patrick McHardy and then maintained by Andre Correa. 15 by Patrick McHardy and then maintained by Andre Correa.
@@ -21,9 +21,9 @@
21 modify it under the terms of the GNU General Public License 21 modify it under the terms of the GNU General Public License
22 as published by the Free Software Foundation; either version 22 as published by the Free Software Foundation; either version
23 2 of the License, or (at your option) any later version. 23 2 of the License, or (at your option) any later version.
24 24
25 Authors: Jamal Hadi Salim (2005) 25 Authors: Jamal Hadi Salim (2005)
26 26
27*/ 27*/
28 28
29 29
@@ -33,10 +33,10 @@
33#include <linux/etherdevice.h> 33#include <linux/etherdevice.h>
34#include <linux/init.h> 34#include <linux/init.h>
35#include <linux/moduleparam.h> 35#include <linux/moduleparam.h>
36#include <net/pkt_sched.h> 36#include <net/pkt_sched.h>
37 37
38#define TX_TIMEOUT (2*HZ) 38#define TX_TIMEOUT (2*HZ)
39 39
40#define TX_Q_LIMIT 32 40#define TX_Q_LIMIT 32
41struct ifb_private { 41struct ifb_private {
42 struct net_device_stats stats; 42 struct net_device_stats stats;
@@ -64,7 +64,7 @@ static struct net_device_stats *ifb_get_stats(struct net_device *dev);
64static int ifb_open(struct net_device *dev); 64static int ifb_open(struct net_device *dev);
65static int ifb_close(struct net_device *dev); 65static int ifb_close(struct net_device *dev);
66 66
67static void ri_tasklet(unsigned long dev) 67static void ri_tasklet(unsigned long dev)
68{ 68{
69 69
70 struct net_device *_dev = (struct net_device *)dev; 70 struct net_device *_dev = (struct net_device *)dev;
@@ -163,7 +163,7 @@ dropped:
163 stats->rx_dropped++; 163 stats->rx_dropped++;
164 return ret; 164 return ret;
165 } else { 165 } else {
166 /* 166 /*
167 * note we could be going 167 * note we could be going
168 * ingress -> egress or 168 * ingress -> egress or
169 * egress -> ingress 169 * egress -> ingress
@@ -199,7 +199,7 @@ static struct net_device_stats *ifb_get_stats(struct net_device *dev)
199 struct net_device_stats *stats = &dp->stats; 199 struct net_device_stats *stats = &dp->stats;
200 200
201 pr_debug("tasklets stats %ld:%ld:%ld:%ld:%ld:%ld:%ld:%ld:%ld \n", 201 pr_debug("tasklets stats %ld:%ld:%ld:%ld:%ld:%ld:%ld:%ld:%ld \n",
202 dp->st_task_enter, dp->st_txq_refl_try, dp->st_rxq_enter, 202 dp->st_task_enter, dp->st_txq_refl_try, dp->st_rxq_enter,
203 dp->st_rx2tx_tran dp->st_rxq_notenter, dp->st_rx_frm_egr, 203 dp->st_rx2tx_tran dp->st_rxq_notenter, dp->st_rx_frm_egr,
204 dp->st_rx_frm_ing, dp->st_rxq_check, dp->st_rxq_rsch ); 204 dp->st_rx_frm_ing, dp->st_rxq_check, dp->st_rxq_rsch );
205 205
@@ -250,7 +250,7 @@ static int __init ifb_init_one(int index)
250 free_netdev(dev_ifb); 250 free_netdev(dev_ifb);
251 dev_ifb = NULL; 251 dev_ifb = NULL;
252 } else { 252 } else {
253 ifbs[index] = dev_ifb; 253 ifbs[index] = dev_ifb;
254 } 254 }
255 255
256 return err; 256 return err;
@@ -260,32 +260,32 @@ static void ifb_free_one(int index)
260{ 260{
261 unregister_netdev(ifbs[index]); 261 unregister_netdev(ifbs[index]);
262 free_netdev(ifbs[index]); 262 free_netdev(ifbs[index]);
263} 263}
264 264
265static int __init ifb_init_module(void) 265static int __init ifb_init_module(void)
266{ 266{
267 int i, err = 0; 267 int i, err = 0;
268 ifbs = kmalloc(numifbs * sizeof(void *), GFP_KERNEL); 268 ifbs = kmalloc(numifbs * sizeof(void *), GFP_KERNEL);
269 if (!ifbs) 269 if (!ifbs)
270 return -ENOMEM; 270 return -ENOMEM;
271 for (i = 0; i < numifbs && !err; i++) 271 for (i = 0; i < numifbs && !err; i++)
272 err = ifb_init_one(i); 272 err = ifb_init_one(i);
273 if (err) { 273 if (err) {
274 i--; 274 i--;
275 while (--i >= 0) 275 while (--i >= 0)
276 ifb_free_one(i); 276 ifb_free_one(i);
277 } 277 }
278 278
279 return err; 279 return err;
280} 280}
281 281
282static void __exit ifb_cleanup_module(void) 282static void __exit ifb_cleanup_module(void)
283{ 283{
284 int i; 284 int i;
285 285
286 for (i = 0; i < numifbs; i++) 286 for (i = 0; i < numifbs; i++)
287 ifb_free_one(i); 287 ifb_free_one(i);
288 kfree(ifbs); 288 kfree(ifbs);
289} 289}
290 290
291module_init(ifb_init_module); 291module_init(ifb_init_module);