~ubuntu-branches/ubuntu/hardy/linux-backports-modules-2.6.24/hardy-security

« back to all changes in this revision

Viewing changes to updates/wireless/iwlwifi/mac80211/patches/net_sch_fifo.patch

  • Committer: Bazaar Package Importer
  • Author(s): , Ben Collins
  • Date: 2008-04-02 06:59:04 UTC
  • Revision ID: james.westby@ubuntu.com-20080402065904-e5knh2gn2hms3xbb
Tags: 2.6.24-14.11
[Ben Collins]

* iwlwifi: Update to iwlwifi-1.2.25 and mac80211-10.0.4
  - LP: #200950
* ubuntu: Slight cleanups to module hiearchy and Makefiles
* mac80211: Enable LED triggers
* iwlwifi: Add LED trigger support (rx and tx only)
  - LP: #176090

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Add pfifo_qdisc if kernel doesn't support explicit CONFIG_NET_SCHED_FIFO
 
2
diff -Nupr pre/net/mac80211/Makefile post/net/mac80211/Makefile
 
3
--- pre/net/mac80211/Makefile   2007-04-19 08:48:55.000000000 -0700
 
4
+++ post/net/mac80211/Makefile  2007-04-19 08:50:09.000000000 -0700
 
5
@@ -4,6 +4,7 @@ mac80211-objs-$(CONFIG_MAC80211_LEDS) +=
 
6
 mac80211-objs-$(CONFIG_MAC80211_DEBUGFS) += debugfs.o debugfs_sta.o debugfs_netdev.o debugfs_key.o
 
7
 
 
8
 mac80211-objs := \
 
9
+       fifo_qdisc.o \
 
10
        ieee80211.o \
 
11
        ieee80211_ioctl.o \
 
12
        sta_info.o \
 
13
diff -Nupr pre/net/mac80211/fifo_qdisc.c post/net/mac80211/fifo_qdisc.c
 
14
--- pre/net/mac80211/fifo_qdisc.c       1969-12-31 16:00:00.000000000 -0800
 
15
+++ post/net/mac80211/fifo_qdisc.c      2007-04-19 08:49:47.000000000 -0700
 
16
@@ -0,0 +1,102 @@
 
17
+/*
 
18
+ * Copyright 2005, Devicescape Software, Inc.
 
19
+ *
 
20
+ * This program is free software; you can redistribute it and/or modify
 
21
+ * it under the terms of the GNU General Public License version 2 as
 
22
+ * published by the Free Software Foundation.
 
23
+ *
 
24
+ * If building without CONFIG_NET_SCHED we need a simple
 
25
+ * fifo qdisc to install by default as the sub-qdisc.
 
26
+ * This is a simple replacement for sch_fifo.
 
27
+ */
 
28
+
 
29
+#include <linux/skbuff.h>
 
30
+#include <net/pkt_sched.h>
 
31
+#include <net/mac80211.h>
 
32
+#include "ieee80211_i.h"
 
33
+#include "wme.h"
 
34
+
 
35
+static int pfifo_enqueue(struct sk_buff *skb, struct Qdisc* qd)
 
36
+{
 
37
+       struct sk_buff_head *q = qdisc_priv(qd);
 
38
+
 
39
+       if (skb_queue_len(q) > qd->dev->tx_queue_len) {
 
40
+               qd->qstats.drops++;
 
41
+               kfree_skb(skb);
 
42
+               return NET_XMIT_DROP;
 
43
+       }
 
44
+
 
45
+       skb_queue_tail(q, skb);
 
46
+       qd->q.qlen++;
 
47
+       qd->bstats.bytes += skb->len;
 
48
+       qd->bstats.packets++;
 
49
+
 
50
+       return NET_XMIT_SUCCESS;
 
51
+}
 
52
+
 
53
+
 
54
+static int pfifo_requeue(struct sk_buff *skb, struct Qdisc* qd)
 
55
+{
 
56
+       struct sk_buff_head *q = qdisc_priv(qd);
 
57
+
 
58
+       skb_queue_head(q, skb);
 
59
+       qd->q.qlen++;
 
60
+       qd->bstats.bytes += skb->len;
 
61
+       qd->bstats.packets++;
 
62
+
 
63
+       return NET_XMIT_SUCCESS;
 
64
+}
 
65
+
 
66
+
 
67
+static struct sk_buff *pfifo_dequeue(struct Qdisc* qd)
 
68
+{
 
69
+       struct sk_buff_head *q = qdisc_priv(qd);
 
70
+
 
71
+       return skb_dequeue(q);
 
72
+}
 
73
+
 
74
+
 
75
+static int pfifo_init(struct Qdisc* qd, struct rtattr *opt)
 
76
+{
 
77
+       struct sk_buff_head *q = qdisc_priv(qd);
 
78
+
 
79
+       skb_queue_head_init(q);
 
80
+       return 0;
 
81
+}
 
82
+
 
83
+
 
84
+static void pfifo_reset(struct Qdisc* qd)
 
85
+{
 
86
+       struct sk_buff_head *q = qdisc_priv(qd);
 
87
+
 
88
+       skb_queue_purge(q);
 
89
+       qd->q.qlen = 0;
 
90
+}
 
91
+
 
92
+
 
93
+static int pfifo_dump(struct Qdisc *qd, struct sk_buff *skb)
 
94
+{
 
95
+       return skb->len;
 
96
+}
 
97
+
 
98
+
 
99
+struct Qdisc_ops pfifo_qdisc_ops =
 
100
+{
 
101
+       .next = NULL,
 
102
+       .cl_ops = NULL,
 
103
+       .id = "ieee80211_pfifo",
 
104
+       .priv_size = sizeof(struct sk_buff_head),
 
105
+
 
106
+       .enqueue = pfifo_enqueue,
 
107
+       .dequeue = pfifo_dequeue,
 
108
+       .requeue = pfifo_requeue,
 
109
+       .drop = NULL,
 
110
+
 
111
+       .init = pfifo_init,
 
112
+       .reset = pfifo_reset,
 
113
+       .destroy = NULL,
 
114
+       .change = NULL,
 
115
+
 
116
+       .dump = pfifo_dump,
 
117
+};
 
118
+