Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] Make FC, FDDI, HIPPI and TR tristate
From: David Miller @ 2007-12-29  8:18 UTC (permalink / raw)
  To: jengelh; +Cc: jgarzik, netdev
In-Reply-To: <Pine.LNX.4.64.0712282348280.29013@fbirervta.pbzchgretzou.qr>

From: Jan Engelhardt <jengelh@computergmbh.de>
Date: Sat, 29 Dec 2007 00:45:12 +0100 (CET)

> Turn CONFIG_FC, CONFIG_FDDI, CONFIG_HIPPI and CONFIG_TR into tristate
> so they can be built as modules. This will allow CONFIG_LLC to be
> built as a module too, overall reducing the core kernel image size.

You can't just do things like this.

Now, you have to go over the whole tree and look for
CONFIG_FOO ifdefs in this group and change them all into:

#if defined(CONFIG_FOO) || defined(CONFIG_FOO_MODULE)

as we already do for things like IPV6.

This is most important in cases where these ifdefs
guard inclusion of members into core networking
datastructures, or control the definition of global
CPP macro defines, etc.

One particular instance that needs fixing is the
CONFIG_TR ifdef check in include/linux/netdevice.h

I'd like you to grep over the whole tree looking for
other potential problems like this before resubmitting
this patch.

^ permalink raw reply

* Re: [PATCH] Make FC, FDDI, HIPPI and TR tristate
From: David Miller @ 2007-12-29  8:19 UTC (permalink / raw)
  To: jengelh; +Cc: bunk, jgarzik, netdev
In-Reply-To: <Pine.LNX.4.64.0712290140090.29013@fbirervta.pbzchgretzou.qr>

From: Jan Engelhardt <jengelh@computergmbh.de>
Date: Sat, 29 Dec 2007 01:41:23 +0100 (CET)

> 
> On Dec 29 2007 02:09, Adrian Bunk wrote:
> >On Sat, Dec 29, 2007 at 12:45:12AM +0100, Jan Engelhardt wrote:
> >> Turn CONFIG_FC, CONFIG_FDDI, CONFIG_HIPPI and CONFIG_TR into tristate
> >> so they can be built as modules. This will allow CONFIG_LLC to be
> >> built as a module too, overall reducing the core kernel image size.
> >>...
> >
> >Just an example of code you have to fix if you do this:
> >
> >$ grep -r "#ifdef CONFIG_TR" net/
> 
> Ah, thank you for reminding me. For lec.c, would it be ok to do
> 
> #if defined(CONFIG_TR) || defined(CONFIG_TR_MODULE)
> #	define WITH_TR 1
> #endif

We don't have a WITH_IPV6, we open code the ifdef check
all over the tree.

For consistency you should do that here too.  Please don't
add new ad-hoc macros to deal with situations like this.
If it's really a problem it should be handled globally in
the confines of the config system, not on a case-by-case
basis.

^ permalink raw reply

* Top 9 kernel oopses/warnings for the week of December 29th, 2007
From: Arjan van de Ven @ 2007-12-29 11:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, Linus Torvalds, netdev

The http://www.kerneloops.org website collects kernel oops and
warning reports from various mailing lists and bugzillas as well as
with a client users can install to auto-submit oopses.
Below is a top 10 list of the oopses collected in the last 7 days.
(Reports prior to 2.6.23 have been omitted in collecting the top 10)

It has been a quiet week due to the holidays, only 55 oops traces
have been collected.

Rank 1: sysctl_head_finish
	sysctl table check failed
	Reported 7 times
	Only reported for the proprietary madwifi driver
	More info: http://www.kerneloops.org/search.php?search=sysctl_head_finish
	
Rank 2: __ieee80211_rx
	Warning at net/mac80211/rx.c:1672
	Reported 5 times
	Only seen in 2.6.24-rc6 so far
	Johannes has diagnosed this as a driver bug in the iwlwifi drivers
	More info: http://www.kerneloops.org/search.php?search=__ieee80211_rx
	
Rank 3: rb_erase
	Null pointer dereference
	Reported 4 times
	Only seen in 2.6.24-rc6 so far
	(Note: the reported removed the oops end marker manually; may be duplicate reports)
	More info: http://www.kerneloops.org/guilty.php?version=2.6.24-rc6&guilty=rb_erase&start=1574400&end=1574400

Rank 4: remove_proc_entry
	Warning at fs/proc/generic.c:736
	Reported 4 times for 2.6.24-rc4 and rc5 (Mandrake)
	Seems to be a module unload issue
	More info: http://www.kerneloops.org/search.php?search=remove_proc_entry
	
Rank 5: aes_encrypt
	Invalid kernel pointer oops
	Reported 2 times for 2.6.23.11
	More info: http://www.kerneloops.org/search.php?search=aes_encrypt
	
Rank 6: cascade
	BUG statement at kernel/timer.c:606
	Reported 2 times for 2.6.23 (Gentoo)
	More info: http://www.kerneloops.org/search.php?search=cascade
	
Rank 7: kref_put
	Kernel paging request
	Reported 2 times, only for 2.6.24-rc6-mm1
	Diagnosed as a bug in the md-subsystem, patch available
	More info: http://www.kerneloops.org/search.php?search=kref_put
	More info: http://article.gmane.org/gmane.linux.kernel/618056
	
Rank 8: device_release
	Warning at drivers/base/core.c:107
	Reported 2 times last week, 6 incidents total
	Seems to be a bug in the MTD physmap driver and the hgafb driver
	More info: http://article.gmane.org/gmane.linux.kernel/618076
	More info: http://article.gmane.org/gmane.linux.kernel/618076
	
Rank 9: mutex_lock
	Null pointer dereference
	Reported 2 times, of which one was a duplicate report
	Seems to be related to running PPP over a bluetooth link
	More info: http://www.kerneloops.org/guilty.php?version=2.6.24-rc6&guilty=mutex_lock&start=1574400&end=1574400
	

kerneloops.org news:
* As of 2.6.24-rc6, oopses have a unique identifier which makes it possible to filter out duplicate
   reports of (and replies to) the same oops. Unfortunately some reporters remove this line from
   their reports to lkml.

^ permalink raw reply

* [PATCH] proc: fix ->open'less usage due to ->proc_fops flip
From: Alexey Dobriyan @ 2007-12-29 12:45 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, netdev, devel

NOTE, NOTE, NOTE:

please, drop proc-remove-useless-checks-in-proc_register.patch
before applying this one!
-----------------------------------------------------
[PATCH] proc: fix ->open'less usage due to ->proc_fops flip

Typical PDE creation code looks like:

	pde = create_proc_entry("foo", 0, NULL);
	if (pde)
		pde->proc_fops = &foo_proc_fops;

Notice that PDE is first created, only then ->proc_fops is set up to
final value. This is a problem because right after creation
a) PDE is fully visible in /proc , and
b) ->proc_fops are proc_file_operations which do not have ->open callback. So, it's
   possible to ->read without ->open (see one class of oopses below).

The fix is new API called proc_create() which makes sure ->proc_fops are
set up before gluing PDE to main tree. Typical new code looks like:

	pde = proc_create("foo", 0, NULL, &foo_proc_fops);
	if (!pde)
		return -ENOMEM;

Fix most networking users for a start.

In the long run, create_proc_entry() for regular files will go.



BUG: unable to handle kernel NULL pointer dereference at virtual address 00000024
printing eip: c1188c1b *pdpt = 000000002929e001 *pde = 0000000000000000 
Oops: 0002 [#1] PREEMPT SMP DEBUG_PAGEALLOC
last sysfs file: /sys/block/sda/sda1/dev
Modules linked in: foo af_packet ipv6 cpufreq_ondemand loop serio_raw psmouse k8temp hwmon sr_mod cdrom

Pid: 24679, comm: cat Not tainted (2.6.24-rc3-mm1 #2)
EIP: 0060:[<c1188c1b>] EFLAGS: 00210002 CPU: 0
EIP is at mutex_lock_nested+0x75/0x25d
EAX: 000006fe EBX: fffffffb ECX: 00001000 EDX: e9340570
ESI: 00000020 EDI: 00200246 EBP: e9340570 ESP: e8ea1ef8
 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Process cat (pid: 24679, ti=E8EA1000 task=E9340570 task.ti=E8EA1000)
Stack: 00000000 c106f7ce e8ee05b4 00000000 00000001 458003d0 f6fb6f20 fffffffb 
       00000000 c106f7aa 00001000 c106f7ce 08ae9000 f6db53f0 00000020 00200246 
       00000000 00000002 00000000 00200246 00200246 e8ee05a0 fffffffb e8ee0550 
Call Trace:
 [<c106f7ce>] seq_read+0x24/0x28a
 [<c106f7aa>] seq_read+0x0/0x28a
 [<c106f7ce>] seq_read+0x24/0x28a
 [<c106f7aa>] seq_read+0x0/0x28a
 [<c10818b8>] proc_reg_read+0x60/0x73
 [<c1081858>] proc_reg_read+0x0/0x73
 [<c105a34f>] vfs_read+0x6c/0x8b
 [<c105a6f3>] sys_read+0x3c/0x63
 [<c10025f2>] sysenter_past_esp+0x5f/0xa5
 [<c10697a7>] destroy_inode+0x24/0x33
 =======================
INFO: lockdep is turned off.
Code: 75 21 68 e1 1a 19 c1 68 87 00 00 00 68 b8 e8 1f c1 68 25 73 1f c1 e8 84 06 e9 ff e8 52 b8 e7 ff 83 c4 10 9c 5f fa e8 28 89 ea ff <f0> fe 4e 04 79 0a f3 90 80 7e 04 00 7e f8 eb f0 39 76 34 74 33 
EIP: [<c1188c1b>] mutex_lock_nested+0x75/0x25d SS:ESP 0068:e8ea1ef8

Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
---

 fs/proc/generic.c       |   40 ++++++++++++++++++++++++++++++++++++----
 fs/proc/proc_net.c      |    7 +------
 fs/proc/root.c          |    1 +
 include/linux/proc_fs.h |    6 +++++-
 4 files changed, 43 insertions(+), 11 deletions(-)

--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -558,7 +558,7 @@ static int proc_register(struct proc_dir_entry * dir, struct proc_dir_entry * dp
 	return 0;
 }
 
-static struct proc_dir_entry *proc_create(struct proc_dir_entry **parent,
+static struct proc_dir_entry *__proc_create(struct proc_dir_entry **parent,
 					  const char *name,
 					  mode_t mode,
 					  nlink_t nlink)
@@ -601,7 +601,7 @@ struct proc_dir_entry *proc_symlink(const char *name,
 {
 	struct proc_dir_entry *ent;
 
-	ent = proc_create(&parent,name,
+	ent = __proc_create(&parent,name,
 			  (S_IFLNK | S_IRUGO | S_IWUGO | S_IXUGO),1);
 
 	if (ent) {
@@ -626,7 +626,7 @@ struct proc_dir_entry *proc_mkdir_mode(const char *name, mode_t mode,
 {
 	struct proc_dir_entry *ent;
 
-	ent = proc_create(&parent, name, S_IFDIR | mode, 2);
+	ent = __proc_create(&parent, name, S_IFDIR | mode, 2);
 	if (ent) {
 		if (proc_register(parent, ent) < 0) {
 			kfree(ent);
@@ -660,7 +660,7 @@ struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode,
 		nlink = 1;
 	}
 
-	ent = proc_create(&parent,name,mode,nlink);
+	ent = __proc_create(&parent,name,mode,nlink);
 	if (ent) {
 		if (proc_register(parent, ent) < 0) {
 			kfree(ent);
@@ -670,6 +670,38 @@ struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode,
 	return ent;
 }
 
+struct proc_dir_entry *proc_create(const char *name, mode_t mode,
+				   struct proc_dir_entry *parent,
+				   const struct file_operations *proc_fops)
+{
+	struct proc_dir_entry *pde;
+	nlink_t nlink;
+
+	if (S_ISDIR(mode)) {
+		if ((mode & S_IALLUGO) == 0)
+			mode |= S_IRUGO | S_IXUGO;
+		nlink = 2;
+	} else {
+		if ((mode & S_IFMT) == 0)
+			mode |= S_IFREG;
+		if ((mode & S_IALLUGO) == 0)
+			mode |= S_IRUGO;
+		nlink = 1;
+	}
+
+	pde = __proc_create(&parent, name, mode, nlink);
+	if (!pde)
+		goto out;
+	pde->proc_fops = proc_fops;
+	if (proc_register(parent, pde) < 0)
+		goto out_free;
+	return pde;
+out_free:
+	kfree(pde);
+out:
+	return NULL;
+}
+
 void free_proc_entry(struct proc_dir_entry *de)
 {
 	unsigned int ino = de->low_ino;
--- a/fs/proc/proc_net.c
+++ b/fs/proc/proc_net.c
@@ -29,12 +29,7 @@
 struct proc_dir_entry *proc_net_fops_create(struct net *net,
 	const char *name, mode_t mode, const struct file_operations *fops)
 {
-	struct proc_dir_entry *res;
-
-	res = create_proc_entry(name, mode, net->proc_net);
-	if (res)
-		res->proc_fops = fops;
-	return res;
+	return proc_create(name, mode, net->proc_net, fops);
 }
 EXPORT_SYMBOL_GPL(proc_net_fops_create);
 
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
@@ -232,6 +232,7 @@ void pid_ns_release_proc(struct pid_namespace *ns)
 EXPORT_SYMBOL(proc_symlink);
 EXPORT_SYMBOL(proc_mkdir);
 EXPORT_SYMBOL(create_proc_entry);
+EXPORT_SYMBOL(proc_create);
 EXPORT_SYMBOL(remove_proc_entry);
 EXPORT_SYMBOL(proc_root);
 EXPORT_SYMBOL(proc_root_fs);
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -124,6 +124,7 @@ void de_put(struct proc_dir_entry *de);
 
 extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode,
 						struct proc_dir_entry *parent);
+struct proc_dir_entry *proc_create(const char *name, mode_t mode, struct proc_dir_entry *parent, const struct file_operations *proc_fops);
 extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent);
 
 extern struct vfsmount *proc_mnt;
@@ -216,7 +217,10 @@ static inline void proc_flush_task(struct task_struct *task)
 
 static inline struct proc_dir_entry *create_proc_entry(const char *name,
 	mode_t mode, struct proc_dir_entry *parent) { return NULL; }

^ permalink raw reply

* Re: skbuff data pointer alignment requirement
From: Jarek Poplawski @ 2007-12-29 13:04 UTC (permalink / raw)
  To: netdev
In-Reply-To: <a967d7d00712281653m5b1a937ch898a5b48f8ee1887@mail.gmail.com>

On Fri, Dec 28, 2007 at 04:53:24PM -0800, Keyur Chudgar wrote:
> Hi Jarek,
> 
> > Do you mean hardware requirements of an architecture or a specific driver?
> I meant any hardware requirements of an architecture.
> 
> > So, if you have more than one network card, is it needed by all of them,
> > while other (not network) drivers are happy with default allocations?
> Yes. So, anything related to skbuff data block, will need specific alignment
> requirements, while others (non-network drivers) will work as default.

Hi Keyur,

It seems this is rather unusual case, probably something new, because 
considering the number of various architectures available on Linux it
looks like the first which requires this feature. Then, of course,
your proposal would make sense, but you should simply name this
hardware in your patch description. On the other hand, if it's
something very uncommon, it could be hard for you to convince somebody
to merge this change.

Regards,
Jarek P.

^ permalink raw reply

* Re: Top 9 kernel oopses/warnings for the week of December 29th, 2007
From: Ingo Molnar @ 2007-12-29 13:17 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: linux-kernel, akpm, Linus Torvalds, netdev
In-Reply-To: <477630CF.5070609@linux.intel.com>


* Arjan van de Ven <arjan@linux.intel.com> wrote:

> kerneloops.org news:
>
> * As of 2.6.24-rc6, oopses have a unique identifier which makes it 
>   possible to filter out duplicate reports of (and replies to) the 
>   same oops. Unfortunately some reporters remove this line from their 
>   reports to lkml.

i'd not mind printing out the bootup-ID as a regular part of the oops, 
as long as it's put into an unintrusive place, preferably without adding 
a new line. (just use an empty spot somewhere)

for example:

Call Trace: (ID afbf0104e2079481)
 [<ffffffff805079f6>] sysdev_driver_unregister+0x5b/0x91
 [<ffffffff806f2ef4>] cpufreq_register_driver+0x15a/0x19b
 [<ffffffff80cb0586>] powernowk8_init+0x86/0x94

	Ingo

^ permalink raw reply

* Re: 2.6.24-rc6-mm1
From: Torsten Kaiser @ 2007-12-29 16:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Neil Brown, J. Bruce Fields, netdev, Herbert Xu
In-Reply-To: <20071228150746.42b3bbc0.akpm@linux-foundation.org>

On Dec 29, 2007 12:07 AM, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Fri, 28 Dec 2007 23:53:49 +0100 "Torsten Kaiser" <just.for.lkml@googlemail.com> wrote:
> > On Dec 23, 2007 5:27 PM, Torsten Kaiser <just.for.lkml@googlemail.com> wrote:
[snip]
> > [ 7620.708561] Pid: 5698, comm: nfsv4-svc Not tainted 2.6.24-rc3-mm2 #2
[snip]
> That looks like a sunrpc bug.  git-nfsd has bene mucking around in there a
> bit.

Please note, that this report is still against 2.6.24-rc3-mm2. The
only new thing about that was, that slub_debug=FZP does not catch the
cause...

> > The cause, why I am resending this: I just got a crash with
> > 2.6.24-rc6-mm1, again looking network related:
> >
> > [93436.933356] WARNING: at include/net/dst.h:165 dst_release()
> > [93436.936685] Pid: 8079, comm: konqueror Not tainted 2.6.24-rc6-mm1 #11
> > [93436.939292]
> > [93436.939293] Call Trace:
> > [93436.939304]  [<ffffffff80531d2d>] skb_release_all+0xdd/0x110
> > [93436.939307]  [<ffffffff80531311>] __kfree_skb+0x11/0xa0
> > [93436.939309]  [<ffffffff805313b7>] kfree_skb+0x17/0x30
> > [93436.939312]  [<ffffffff805a0b48>] unix_release_sock+0x128/0x250
> > [93436.939315]  [<ffffffff805a0c91>] unix_release+0x21/0x30
> > [93436.939318]  [<ffffffff8052b144>] sock_release+0x24/0x90
> > [93436.939320]  [<ffffffff8052b656>] sock_close+0x26/0x50
> > [93436.939324]  [<ffffffff8029f921>] __fput+0xc1/0x230
> > [93436.939327]  [<ffffffff8029fe46>] fput+0x16/0x20
> > [93436.939329]  [<ffffffff8029c576>] filp_close+0x56/0x90
> > [93436.939331]  [<ffffffff8029de46>] sys_close+0xa6/0x110
> > [93436.939335]  [<ffffffff8020b57b>] system_call_after_swapgs+0x7b/0x80

>From code inspection I would blame the patch "[SKBUFF]: Free old skb
properly in skb_morph" from Herbert Xu. (CC added)

Mostly it only shuffles code around, the only real change seems to be this hunk:
@@ -441,7 +446,7 @@ static struct sk_buff *__skb_clone(struct sk_buff
*n, struct sk_buff *skb)
  */
 struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src)
 {
-	skb_release_data(dst);
+	skb_release_all(dst);
 	return __skb_clone(dst, src);
 }
 EXPORT_SYMBOL_GPL(skb_morph);

Using sbk_release_all instead only skb_release_data (with is called
automatically from the new sbk_release_all) will add a new call to
dst_release(skb->dst); (first line in sbk_release_all)
Could that explain the above underflow warning?

(I do not have any clue about the inner workings of the network core,
I just looked for code changes, that might be relevant...)

> > [93436.947241] general protection fault: 0000 [1] SMP
> > [93436.947243] last sysfs file:
> > /sys/devices/pci0000:00/0000:00:0f.0/0000:01:00.1/irq
> > [93436.947245] CPU 1
> > [93436.947246] Modules linked in: radeon drm nfsd exportfs w83792d
> > ipv6 tuner tea5767 tda8290 tuner_xc2028 tda9887 tuner_simple mt20xx
> > tea5761 tvaudio msp3400 bttv ir_common compat_ioctl32 videobuf_dma_sg
> > videobuf_core btcx_risc tveeprom usbhid videodev v4l2_common hid
> > v4l1_compat pata_amd sg i2c_nforce2
> > [93436.947257] Pid: 8079, comm: konqueror Not tainted 2.6.24-rc6-mm1 #11
> > [93436.947259] RIP: 0010:[<ffffffff80531438>]  [<ffffffff80531438>]
> > skb_drop_list+0x18/0x30
> > [93436.947262] RSP: 0018:ffff810005f4fda8  EFLAGS: 00010286
> > [93436.947263] RAX: ab1ed5ca5b74e7de RBX: ab1ed5ca5b74e7de RCX: 000000000000d135
> > [93436.947265] RDX: ffff81011d089a80 RSI: 0000000000000001 RDI: ffff81011d089a88
> > [93436.947266] RBP: ffff810005f4fdb8 R08: 0000000000000001 R09: 0000000000000006
> > [93436.947268] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8100de02c500
> > [93436.947269] R13: ffff81011c188a00 R14: 0000000000000001 R15: ffff81011c189198
> > [93436.947271] FS:  00007fb5bde0d700(0000) GS:ffff81007ff22000(0000)
> > knlGS:0000000000000000
> > [93436.947273] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> > [93436.947274] CR2: 00007fb5bdd76000 CR3: 00000000664d5000 CR4: 00000000000006e0
> > [93436.947276] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> > [93436.947277] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> > [93436.947279] Process konqueror (pid: 8079, threadinfo
> > ffff810005f4e000, task ffff8100a1dec000)
> > [93436.947281] Stack:  ffff810005f4fdd8 ffff810116c86140
> > ffff810005f4fdd8 ffffffff805314ae
> > [93436.947284]  ffff810116c86140 ffff8100de02c500 ffff810005f4fdf8
> > ffffffff80531cf0
> > [93436.947286]  ffff8100de02c500 ffff81011c188b48 ffff810005f4fe18
> > ffffffff80531311
> > [93436.947288] Call Trace:
> > [93436.947290]  [<ffffffff805314ae>] skb_release_data+0x5e/0xa0
> > [93436.947293]  [<ffffffff80531cf0>] skb_release_all+0xa0/0x110
> > [93436.947295]  [<ffffffff80531311>] __kfree_skb+0x11/0xa0
> > [93436.947297]  [<ffffffff805313b7>] kfree_skb+0x17/0x30
> > [93436.947299]  [<ffffffff805a0b48>] unix_release_sock+0x128/0x250
> > [93436.947302]  [<ffffffff805a0c91>] unix_release+0x21/0x30
> > [93436.947304]  [<ffffffff8052b144>] sock_release+0x24/0x90
> > [93436.947307]  [<ffffffff8052b656>] sock_close+0x26/0x50
> > [93436.947309]  [<ffffffff8029f921>] __fput+0xc1/0x230
> > [93436.947312]  [<ffffffff8029fe46>] fput+0x16/0x20
> > [93436.947314]  [<ffffffff8029c576>] filp_close+0x56/0x90
> > [93436.947316]  [<ffffffff8029de46>] sys_close+0xa6/0x110
> > [93436.947319]  [<ffffffff8020b57b>] system_call_after_swapgs+0x7b/0x80
> > [93436.947322]
> > [93436.947322]
> > [93436.947323] Code: 48 8b 18 48 89 c7 e8 5d ff ff ff 48 85 db 75 ed
> > 48 83 c4 08
> > [93436.947328] RIP  [<ffffffff80531438>] skb_drop_list+0x18/0x30
> > [93436.947330]  RSP <ffff810005f4fda8>
> > [93436.947332] ---[ end trace befb7cc3528ab3b1 ]---
>
> Yes, that looks more networking-related.

I would hope this OOPS was caused by the same error, trying to release
the same list twice.

Torsten

^ permalink raw reply

* [PATCH] Fix broken ip= parsing
From: Thomas Bogendoerfer @ 2007-12-29 17:08 UTC (permalink / raw)
  To: linux-kernel, netdev; +Cc: horms, davem

Commit a6c05c3d064dbb83be88cba3189beb5db9d2dfc3 breaks ip= parsing
completly, because ic_enable is never set. The patch below puts
back the way ic_enable was set before.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---

 net/ipv4/ipconfig.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 420f56a..4266528 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -1440,6 +1440,7 @@ static int __init ip_auto_config_setup(char *addrs)
 	int num = 0;
 
 	ic_set_manually = 1;
+	ic_enable = *addrs;
 
 	if (ic_proto_name(addrs))
 		return 1;

^ permalink raw reply related

* RE: [PATCH 1/3] [NET] phy/fixed.c: rework to not duplicate PHY layerfunctionality
From: Joakim Tjernlund @ 2007-12-29 17:13 UTC (permalink / raw)
  To: 'Vitaly Bordug', 'Paul Mackerras'
  Cc: netdev, 'linuxppc-dev'
In-Reply-To: <20071206225121.31080.86606.stgit@localhost.localdomain>

> -----Original Message-----
> From: 
> linuxppc-dev-bounces+joakim.tjernlund=transmode.se@ozlabs.org 
> [mailto:linuxppc-dev-bounces+joakim.tjernlund=transmode.se@ozl
> abs.org] On Behalf Of Vitaly Bordug
> Sent: den 6 december 2007 23:51
> To: Paul Mackerras
> Cc: netdev@vger.kernel.org; linuxppc-dev
> Subject: [PATCH 1/3] [NET] phy/fixed.c: rework to not 
> duplicate PHY layerfunctionality
> 
> 
> With that patch fixed.c now fully emulates MDIO bus, thus no need
> to duplicate PHY layer functionality. That, in turn, drastically
> simplifies the code, and drops down line count.
> 
> As an additional bonus, now there is no need to register MDIO bus
> for each PHY, all emulated PHYs placed on the platform fixed MDIO bus.
> There is also no more need to pre-allocate PHYs via .config option,
> this is all now handled dynamically.
> 
> 
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>
> Acked-by: Jeff Garzik <jeff@garzik.org>

What happened to this patch set? Is it sitting in a tree somewhere waiting
for 2.4.25 or does it need more work?

 Jocke


^ permalink raw reply

* Re: Top 9 kernel oopses/warnings for the week of December 29th, 2007
From: Linus Torvalds @ 2007-12-29 19:18 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: linux-kernel, akpm, netdev
In-Reply-To: <477630CF.5070609@linux.intel.com>



On Sat, 29 Dec 2007, Arjan van de Ven wrote:
>
> It has been a quiet week due to the holidays, only 55 oops traces
> have been collected.

This would be more useful if it was more readable. As it is, you seem to 
have some formatting errors in your automation, where the things are 
incorrectly grouped:

> Rank 1: sysctl_head_finish
> 	sysctl table check failed
> 	Reported 7 times
> 	Only reported for the proprietary madwifi driver
> 	More info: http://www.kerneloops.org/search.php?search=sysctl_head_finish
> 	Rank 2: __ieee80211_rx
> 	Warning at net/mac80211/rx.c:1672

ie notice how that "Rank 2" got reported as if it was part of the "Rank 1" 
issue. 

		Linus

^ permalink raw reply

* Re: Top 9 kernel oopses/warnings for the week of December 29th, 2007
From: Arjan van de Ven @ 2007-12-29 19:31 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, akpm, netdev
In-Reply-To: <alpine.LFD.0.9999.0712291116190.2778@woody.linux-foundation.org>

Linus Torvalds wrote:
> 
> On Sat, 29 Dec 2007, Arjan van de Ven wrote:
>> It has been a quiet week due to the holidays, only 55 oops traces
>> have been collected.
> 
> This would be more useful if it was more readable. As it is, you seem to 
> have some formatting errors in your automation, where the things are 
> incorrectly grouped:

this is manual made; I'll blame thunderbird for now

let me see if I can send it again without corruption

> 
>> Rank 1: sysctl_head_finish
>> 	sysctl table check failed
>> 	Reported 7 times
>> 	Only reported for the proprietary madwifi driver
>> 	More info: http://www.kerneloops.org/search.php?search=sysctl_head_finish
>> 	Rank 2: __ieee80211_rx
>> 	Warning at net/mac80211/rx.c:1672
> 
> ie notice how that "Rank 2" got reported as if it was part of the "Rank 1" 
> issue. 
> 
> 		Linus


^ permalink raw reply

* Re: Top 9 kernel oopses/warnings for the week of December 29th, 2007
From: Arjan van de Ven @ 2007-12-29 19:34 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, akpm, netdev
In-Reply-To: <alpine.LFD.0.9999.0712291116190.2778@woody.linux-foundation.org>

Linus Torvalds wrote:
> 
> On Sat, 29 Dec 2007, Arjan van de Ven wrote:
>> It has been a quiet week due to the holidays, only 55 oops traces
>> have been collected.
> 
> This would be more useful if it was more readable. As it is, you seem to 
> have some formatting errors in your automation, where the things are 
> incorrectly grouped:
> 
>> Rank 1: sysctl_head_finish
>> 	sysctl table check failed
>> 	Reported 7 times
>> 	Only reported for the proprietary madwifi driver
>> 	More info: http://www.kerneloops.org/search.php?search=sysctl_head_finish
>> 	Rank 2: __ieee80211_rx
>> 	Warning at net/mac80211/rx.c:1672
> 
> ie notice how that "Rank 2" got reported as if it was part of the "Rank 1" 
> issue. 
> 


hmmm.. the copy in my Sent folder looks fine, as does the one in the lkml archive:
http://lkml.org/lkml/2007/12/29/41

This is distinctly weird.

^ permalink raw reply

* Re: Top 9 kernel oopses/warnings for the week of December 29th, 2007
From: Björn Steinbrink @ 2007-12-29 19:36 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Arjan van de Ven, linux-kernel, akpm, netdev
In-Reply-To: <alpine.LFD.0.9999.0712291116190.2778@woody.linux-foundation.org>

On 2007.12.29 11:18:18 -0800, Linus Torvalds wrote:
> 
> 
> On Sat, 29 Dec 2007, Arjan van de Ven wrote:
> >
> > It has been a quiet week due to the holidays, only 55 oops traces
> > have been collected.
> 
> This would be more useful if it was more readable. As it is, you seem to 
> have some formatting errors in your automation, where the things are 
> incorrectly grouped:
> 
> > Rank 1: sysctl_head_finish
> > 	sysctl table check failed
> > 	Reported 7 times
> > 	Only reported for the proprietary madwifi driver
> > 	More info: http://www.kerneloops.org/search.php?search=sysctl_head_finish
> > 	Rank 2: __ieee80211_rx
> > 	Warning at net/mac80211/rx.c:1672
> 
> ie notice how that "Rank 2" got reported as if it was part of the "Rank 1" 
> issue. 

Shows up correctly here. Random guess is that your MUA treats tabs like
spaces when it sees format=flowed. The lines between the different ranks
weren't empty but had a single tab. And for whatever reason (I don't see
any trailing spaces), Arjan's mail had a format=flowed header.

AFAIK, only SPACE CRLF is valid for line-continuation with
format=flowed, not TAB CRLF.  So the above formatting would be the
result of a pointless format=flowed header meeting a MUA that was too
eager searching for line continuations.

Björn

^ permalink raw reply

* Re: Top 9 kernel oopses/warnings for the week of December 29th, 2007
From: Linus Torvalds @ 2007-12-29 19:52 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: linux-kernel, akpm, netdev
In-Reply-To: <4776A13C.1080405@linux.intel.com>



On Sat, 29 Dec 2007, Arjan van de Ven wrote:
> 
> hmmm.. the copy in my Sent folder looks fine, as does the one in the lkml
> archive:
> http://lkml.org/lkml/2007/12/29/41
> 
> This is distinctly weird.

Ahh, it seems to be a alpine bug. Probably brought on by alpine trying to 
highlight the web addresses.

It doesn't always happen - between Rank 3 and Rank 4, you have an empty 
line, and alpine reacted correctly to that one, but the "empty" line 
between Rank 1 and Rank 2 actually contained a single TAB, and that 
apparently made alpine really confused.

So never mind. I'll make a bug-report on alpine, it wasn't a bug in your 
email.

		Linus

^ permalink raw reply

* Re: Top 9 kernel oopses/warnings for the week of December 29th, 2007
From: Martin Josefsson @ 2007-12-29 21:53 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Arjan van de Ven, linux-kernel, akpm, netdev
In-Reply-To: <alpine.LFD.0.9999.0712291147400.2778@woody.linux-foundation.org>

On Sat, 29 Dec 2007, Linus Torvalds wrote:

> Ahh, it seems to be a alpine bug. Probably brought on by alpine trying to
> highlight the web addresses.
>
> It doesn't always happen - between Rank 3 and Rank 4, you have an empty
> line, and alpine reacted correctly to that one, but the "empty" line
> between Rank 1 and Rank 2 actually contained a single TAB, and that
> apparently made alpine really confused.
>
> So never mind. I'll make a bug-report on alpine, it wasn't a bug in your
> email.

FYI, exactly the same thing happens with pine.

/Martin

^ permalink raw reply

* Re: Top 9 kernel oopses/warnings for the week of December 29th, 2007
From: Geert Uytterhoeven @ 2007-12-29 22:21 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Arjan van de Ven, linux-kernel, akpm, netdev
In-Reply-To: <alpine.LFD.0.9999.0712291147400.2778@woody.linux-foundation.org>

On Sat, 29 Dec 2007, Linus Torvalds wrote:
> On Sat, 29 Dec 2007, Arjan van de Ven wrote:
> > hmmm.. the copy in my Sent folder looks fine, as does the one in the lkml
> > archive:
> > http://lkml.org/lkml/2007/12/29/41
> > 
> > This is distinctly weird.
> 
> Ahh, it seems to be a alpine bug. Probably brought on by alpine trying to 
> highlight the web addresses.
> 
> It doesn't always happen - between Rank 3 and Rank 4, you have an empty 
> line, and alpine reacted correctly to that one, but the "empty" line 
> between Rank 1 and Rank 2 actually contained a single TAB, and that 
> apparently made alpine really confused.
> 
> So never mind. I'll make a bug-report on alpine, it wasn't a bug in your 
> email.

The bug is also present in the original branch, called pine 4.64 ;-)

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply

* Re: [PATCH] Fix broken ip= parsing
From: Adrian McMenamin @ 2007-12-29 22:54 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: linux-kernel, netdev, horms, davem
In-Reply-To: <20071229170849.C2E68C2EEE@solo.franken.de>

On 29/12/2007, Thomas Bogendoerfer <tsbogend@alpha.franken.de> wrote:
> Commit a6c05c3d064dbb83be88cba3189beb5db9d2dfc3 breaks ip= parsing
> completly, because ic_enable is never set. The patch below puts
> back the way ic_enable was set before.
>
> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> ---
>
This patch certainly fixes the problem I was having with NFS root - I
had a working setup that stopped (though at the same time as I updated
my Busybox setup so I thought this was my mistake).

Please apply.

Tested by: Adrian McMenamin <adrian@mcmen.demon.co.uk>

^ permalink raw reply

* Re: [Bugme-new] [Bug 9661] New: Booting from nfsroot fails
From: Andrew Morton @ 2007-12-29 23:14 UTC (permalink / raw)
  To: bugs; +Cc: bugme-daemon, netdev, Simon Horman, David S. Miller
In-Reply-To: <bug-9661-10286@http.bugzilla.kernel.org/>

On Sat, 29 Dec 2007 11:54:07 -0800 (PST) bugme-daemon@bugzilla.kernel.org wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=9661
> 
>            Summary: Booting from nfsroot fails
>            Product: Networking
>            Version: 2.5
>      KernelVersion: 2.6.24-rc6-git4
>           Platform: All
>         OS/Version: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: blocking
>           Priority: P1
>          Component: IPV4
>         AssignedTo: shemminger@linux-foundation.org
>         ReportedBy: bugs@psycast.de
> 
> 
> Most recent kernel where this bug did not occur: 2.6.24-rc6-git3
> Distribution: Debian GNU Linux 4.0/Etch
> Hardware Environment: Intel DG965SS, 4GB RAM, onboard e1000, no HDD
> Software Environment: Debian GNU Linux 4.0r2 x86_64
> Problem Description: Starting with -git4 release the System won't boot from
> network. Booting with root=/dev/nfs ip=dhcp for example ends in asking the user
> to insert a boot floppy. This is obviously not the expected result when booting
> from network. 
> 
> The cause seem to be the changeset a6c05c3d064dbb83be88cba3189beb5db9d2dfc3.
> Looking at the code I found that ic_enable doesn't get set as expected. This
> prevents the kernel from initializing the ip configuration. 
> 
> The patch & my LK conf (for reference) are attached. This may be not the ideal
> way of solving this, there are probably better ones. This one "Works For Me" :)

Thanks for the fix, but please send patches via email and not via bugzilla?

Suitable recipients for this one would be

netdev@vger.kernel.org
Simon Horman <horms@verge.net.au>
"David S. Miller" <davem@davemloft.net>

^ permalink raw reply

* [PATCH net-2.6.25 1/7][ATM]: atm is no longer experimental
From: chas williams - CONTRACTOR @ 2007-12-30  1:06 UTC (permalink / raw)
  To: netdev; +Cc: davem

commit f57512af6142cf14bd15012c4c627f9ebef0582a
Author: Robert P. J. Day <rpjday@mindspring.com>
Date:   Fri Oct 26 07:27:07 2007 -0400

    [ATM]: atm is no longer experimental
    
    From: Robert P. J. Day <rpjday@mindspring.com>
    Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>

diff --git a/net/atm/Kconfig b/net/atm/Kconfig
index 21ff276..754ea10 100644
--- a/net/atm/Kconfig
+++ b/net/atm/Kconfig
@@ -1,10 +1,9 @@
 #
-# Asynchronous Transfer Mode (ATM) (EXPERIMENTAL)
+# Asynchronous Transfer Mode (ATM)
 #
 
 config ATM
-	tristate "Asynchronous Transfer Mode (ATM) (EXPERIMENTAL)"
-	depends on EXPERIMENTAL
+	tristate "Asynchronous Transfer Mode (ATM)"
 	---help---
 	  ATM is a high-speed networking technology for Local Area Networks
 	  and Wide Area Networks.  It uses a fixed packet size and is
@@ -20,7 +19,7 @@ config ATM
 	  further details.
 
 config ATM_CLIP
-	tristate "Classical IP over ATM (EXPERIMENTAL)"
+	tristate "Classical IP over ATM"
 	depends on ATM && INET
 	help
 	  Classical IP over ATM for PVCs and SVCs, supporting InARP and
@@ -29,7 +28,7 @@ config ATM_CLIP
 	  (LANE)" below.
 
 config ATM_CLIP_NO_ICMP
-	bool "Do NOT send ICMP if no neighbour (EXPERIMENTAL)"
+	bool "Do NOT send ICMP if no neighbour"
 	depends on ATM_CLIP
 	help
 	  Normally, an "ICMP host unreachable" message is sent if a neighbour
@@ -39,7 +38,7 @@ config ATM_CLIP_NO_ICMP
 	  such neighbours are silently discarded instead.
 
 config ATM_LANE
-	tristate "LAN Emulation (LANE) support (EXPERIMENTAL)"
+	tristate "LAN Emulation (LANE) support"
 	depends on ATM
 	help
 	  LAN Emulation emulates services of existing LANs across an ATM
@@ -48,7 +47,7 @@ config ATM_LANE
 	  ELAN and Ethernet segments. You need LANE if you want to try MPOA.
 
 config ATM_MPOA
-	tristate "Multi-Protocol Over ATM (MPOA) support (EXPERIMENTAL)"
+	tristate "Multi-Protocol Over ATM (MPOA) support"
 	depends on ATM && INET && ATM_LANE!=n
 	help
 	  Multi-Protocol Over ATM allows ATM edge devices such as routers,

^ permalink raw reply related

* [PATCH net-2.6.25 2/7][ATM]: Convert struct class_device to struct device
From: chas williams - CONTRACTOR @ 2007-12-30  1:06 UTC (permalink / raw)
  To: netdev; +Cc: davem

commit 03c544e08cfe22f0c8a952c0aed1265917dca469
Author: Kay Sievers <kay.sievers@vrfy.org>
Date:   Fri Oct 26 07:28:29 2007 -0400

    [ATM]: Convert struct class_device to struct device
    
    Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
    Cc: Tony Jones <tonyj@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>

diff --git a/net/atm/atm_sysfs.c b/net/atm/atm_sysfs.c
index 9ef07ed..1b88311 100644
--- a/net/atm/atm_sysfs.c
+++ b/net/atm/atm_sysfs.c
@@ -9,13 +9,15 @@
 
 #define to_atm_dev(cldev) container_of(cldev, struct atm_dev, class_dev)
 
-static ssize_t show_type(struct class_device *cdev, char *buf)
+static ssize_t show_type(struct device *cdev,
+			 struct device_attribute *attr, char *buf)
 {
 	struct atm_dev *adev = to_atm_dev(cdev);
 	return sprintf(buf, "%s\n", adev->type);
 }
 
-static ssize_t show_address(struct class_device *cdev, char *buf)
+static ssize_t show_address(struct device *cdev,
+			    struct device_attribute *attr, char *buf)
 {
 	char *pos = buf;
 	struct atm_dev *adev = to_atm_dev(cdev);
@@ -28,7 +30,8 @@ static ssize_t show_address(struct class_device *cdev, char *buf)
 	return pos - buf;
 }
 
-static ssize_t show_atmaddress(struct class_device *cdev, char *buf)
+static ssize_t show_atmaddress(struct device *cdev,
+			       struct device_attribute *attr, char *buf)
 {
 	unsigned long flags;
 	char *pos = buf;
@@ -54,7 +57,8 @@ static ssize_t show_atmaddress(struct class_device *cdev, char *buf)
 	return pos - buf;
 }
 
-static ssize_t show_carrier(struct class_device *cdev, char *buf)
+static ssize_t show_carrier(struct device *cdev,
+			    struct device_attribute *attr, char *buf)
 {
 	char *pos = buf;
 	struct atm_dev *adev = to_atm_dev(cdev);
@@ -65,7 +69,8 @@ static ssize_t show_carrier(struct class_device *cdev, char *buf)
 	return pos - buf;
 }
 
-static ssize_t show_link_rate(struct class_device *cdev, char *buf)
+static ssize_t show_link_rate(struct device *cdev,
+			      struct device_attribute *attr, char *buf)
 {
 	char *pos = buf;
 	struct atm_dev *adev = to_atm_dev(cdev);
@@ -90,22 +95,23 @@ static ssize_t show_link_rate(struct class_device *cdev, char *buf)
 	return pos - buf;
 }
 
-static CLASS_DEVICE_ATTR(address, S_IRUGO, show_address, NULL);
-static CLASS_DEVICE_ATTR(atmaddress, S_IRUGO, show_atmaddress, NULL);
-static CLASS_DEVICE_ATTR(carrier, S_IRUGO, show_carrier, NULL);
-static CLASS_DEVICE_ATTR(type, S_IRUGO, show_type, NULL);
-static CLASS_DEVICE_ATTR(link_rate, S_IRUGO, show_link_rate, NULL);
-
-static struct class_device_attribute *atm_attrs[] = {
-	&class_device_attr_atmaddress,
-	&class_device_attr_address,
-	&class_device_attr_carrier,
-	&class_device_attr_type,
-	&class_device_attr_link_rate,
+static DEVICE_ATTR(address, S_IRUGO, show_address, NULL);
+static DEVICE_ATTR(atmaddress, S_IRUGO, show_atmaddress, NULL);
+static DEVICE_ATTR(carrier, S_IRUGO, show_carrier, NULL);
+static DEVICE_ATTR(type, S_IRUGO, show_type, NULL);
+static DEVICE_ATTR(link_rate, S_IRUGO, show_link_rate, NULL);
+
+static struct device_attribute *atm_attrs[] = {
+	&dev_attr_atmaddress,
+	&dev_attr_address,
+	&dev_attr_carrier,
+	&dev_attr_type,
+	&dev_attr_link_rate,
 	NULL
 };
 
-static int atm_uevent(struct class_device *cdev, struct kobj_uevent_env *env)
+
+static int atm_uevent(struct device *cdev, struct kobj_uevent_env *env)
 {
 	struct atm_dev *adev;
 
@@ -122,7 +128,7 @@ static int atm_uevent(struct class_device *cdev, struct kobj_uevent_env *env)
 	return 0;
 }
 
-static void atm_release(struct class_device *cdev)
+static void atm_release(struct device *cdev)
 {
 	struct atm_dev *adev = to_atm_dev(cdev);
 
@@ -131,25 +137,25 @@ static void atm_release(struct class_device *cdev)
 
 static struct class atm_class = {
 	.name		= "atm",
-	.release	= atm_release,
-	.uevent		= atm_uevent,
+	.dev_release	= atm_release,
+	.dev_uevent		= atm_uevent,
 };
 
 int atm_register_sysfs(struct atm_dev *adev)
 {
-	struct class_device *cdev = &adev->class_dev;
+	struct device *cdev = &adev->class_dev;
 	int i, j, err;
 
 	cdev->class = &atm_class;
-	class_set_devdata(cdev, adev);
+	dev_set_drvdata(cdev, adev);
 
-	snprintf(cdev->class_id, BUS_ID_SIZE, "%s%d", adev->type, adev->number);
-	err = class_device_register(cdev);
+	snprintf(cdev->bus_id, BUS_ID_SIZE, "%s%d", adev->type, adev->number);
+	err = device_register(cdev);
 	if (err < 0)
 		return err;
 
 	for (i = 0; atm_attrs[i]; i++) {
-		err = class_device_create_file(cdev, atm_attrs[i]);
+		err = device_create_file(cdev, atm_attrs[i]);
 		if (err)
 			goto err_out;
 	}
@@ -158,16 +164,16 @@ int atm_register_sysfs(struct atm_dev *adev)
 
 err_out:
 	for (j = 0; j < i; j++)
-		class_device_remove_file(cdev, atm_attrs[j]);
-	class_device_del(cdev);
+		device_remove_file(cdev, atm_attrs[j]);
+	device_del(cdev);
 	return err;
 }
 
 void atm_unregister_sysfs(struct atm_dev *adev)
 {
-	struct class_device *cdev = &adev->class_dev;
+	struct device *cdev = &adev->class_dev;
 
-	class_device_del(cdev);
+	device_del(cdev);
 }
 
 int __init atm_sysfs_init(void)
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 2096e5c..a3d07c2 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -359,7 +359,7 @@ struct atm_dev {
 	struct proc_dir_entry *proc_entry; /* proc entry */
 	char *proc_name;		/* proc entry name */
 #endif
-	struct class_device class_dev;	/* sysfs class device */
+	struct device class_dev;	/* sysfs device */
 	struct list_head dev_list;	/* linkage */
 };
 
@@ -461,7 +461,7 @@ static inline void atm_dev_put(struct atm_dev *dev)
 		BUG_ON(!test_bit(ATM_DF_REMOVED, &dev->flags));
 		if (dev->ops->dev_close)
 			dev->ops->dev_close(dev);
-		class_device_put(&dev->class_dev);
+		put_device(&dev->class_dev);
 	}
 }
 

^ permalink raw reply related

* [PATCH net-2.6.25 3/7][ATM]: [he] This patch removes the ancient version string.
From: chas williams - CONTRACTOR @ 2007-12-30  1:06 UTC (permalink / raw)
  To: netdev; +Cc: davem

commit 41d6b7e20dd6d57bec4f14697f654c8211ff5d57
Author: Adrian Bunk <bunk@stusta.de>
Date:   Fri Oct 26 07:29:47 2007 -0400

    [ATM]: [he] This patch removes the ancient version string.
    
    Signed-off-by: Adrian Bunk <bunk@stusta.de>
    Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>

diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index d33aba6..4f1c7e6 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -1,5 +1,3 @@
-/* $Id: he.c,v 1.18 2003/05/06 22:57:15 chas Exp $ */
-
 /*
 
   he.c
@@ -99,10 +97,6 @@
 #define HPRINTK(fmt,args...)	do { } while (0)
 #endif /* HE_DEBUG */
 
-/* version definition */
-
-static char *version = "$Id: he.c,v 1.18 2003/05/06 22:57:15 chas Exp $";
-
 /* declarations */
 
 static int he_open(struct atm_vcc *vcc);
@@ -366,7 +360,7 @@ he_init_one(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent)
 	struct he_dev *he_dev = NULL;
 	int err = 0;
 
-	printk(KERN_INFO "he: %s\n", version);
+	printk(KERN_INFO "ATM he driver\n");
 
 	if (pci_enable_device(pci_dev))
 		return -EIO;
@@ -2933,7 +2927,7 @@ he_proc_read(struct atm_dev *dev, loff_t *pos, char *page)
 
 	left = *pos;
 	if (!left--)
-		return sprintf(page, "%s\n", version);
+		return sprintf(page, "ATM he driver\n");
 
 	if (!left--)
 		return sprintf(page, "%s%s\n\n",

^ permalink raw reply related

* [PATCH net-2.6.25 4/7][ATM]: [br2864] routed support
From: chas williams - CONTRACTOR @ 2007-12-30  1:07 UTC (permalink / raw)
  To: netdev; +Cc: davem

commit fea6b121bcc150fc91186e5012466c91944ce64d
Author: Eric Kinzie <ekinzie@cmf.nrl.navy.mil>
Date:   Fri Oct 26 08:05:08 2007 -0400

    [ATM]: [br2864] routed support
    
    From: Eric Kinzie <ekinzie@cmf.nrl.navy.mil>
    Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>

diff --git a/include/linux/atmbr2684.h b/include/linux/atmbr2684.h
index 969fb6c..ccdab6c 100644
--- a/include/linux/atmbr2684.h
+++ b/include/linux/atmbr2684.h
@@ -14,6 +14,9 @@
 #define BR2684_MEDIA_FDDI	(3)
 #define BR2684_MEDIA_802_6	(4)	/* 802.6 */
 
+					/* used only at device creation:  */
+#define BR2684_FLAG_ROUTED	(1<<16) /* payload is routed, not bridged */
+
 /*
  * Is there FCS inbound on this VC?  This currently isn't supported.
  */
@@ -36,13 +39,21 @@
 #define BR2684_ENCAPS_AUTODETECT (2)	/* Unsuported */
 
 /*
+ * Is this VC bridged or routed?
+ */
+
+#define BR2684_PAYLOAD_ROUTED   (0)
+#define BR2684_PAYLOAD_BRIDGED  (1)
+
+
+/*
  * This is for the ATM_NEWBACKENDIF call - these are like socket families:
  * the first element of the structure is the backend number and the rest
  * is per-backend specific
  */
 struct atm_newif_br2684 {
 	atm_backend_t	backend_num;	/* ATM_BACKEND_BR2684 */
-	int		media;		/* BR2684_MEDIA_* */
+	int		media;		/* BR2684_MEDIA_*, flags in upper bits */
 	char		ifname[IFNAMSIZ];
 	int		mtu;
 };
@@ -95,6 +106,11 @@ struct br2684_filter_set {
 	struct br2684_filter filter;
 };
 
+enum br2684_payload {
+        p_routed = BR2684_PAYLOAD_ROUTED,
+        p_bridged = BR2684_PAYLOAD_BRIDGED,
+};
+
 #define BR2684_SETFILT	_IOW( 'a', ATMIOC_BACKEND + 0, \
 				struct br2684_filter_set)
 
diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index ba6428f..d9bb2a1 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -1,7 +1,8 @@
 /*
-Experimental ethernet netdevice using ATM AAL5 as underlying carrier
-(RFC1483 obsoleted by RFC2684) for Linux 2.4
-Author: Marcell GAL, 2000, XDSL Ltd, Hungary
+Ethernet netdevice using ATM AAL5 as underlying carrier
+(RFC1483 obsoleted by RFC2684) for Linux
+Authors: Marcell GAL, 2000, XDSL Ltd, Hungary
+         Eric Kinzie, 2006-2007, US Naval Research Laboratory
 */
 
 #include <linux/module.h>
@@ -39,9 +40,27 @@ static void skb_debug(const struct sk_buff *skb)
 #define skb_debug(skb)	do {} while (0)
 #endif
 
+#define BR2684_ETHERTYPE_LEN	2
+#define BR2684_PAD_LEN		2
+
+#define LLC		0xaa, 0xaa, 0x03
+#define SNAP_BRIDGED	0x00, 0x80, 0xc2
+#define SNAP_ROUTED	0x00, 0x00, 0x00
+#define PID_ETHERNET	0x00, 0x07
+#define ETHERTYPE_IPV4	0x08, 0x00
+#define ETHERTYPE_IPV6	0x86, 0xdd
+#define PAD_BRIDGED	0x00, 0x00
+
+static unsigned char ethertype_ipv4[] =
+	{ ETHERTYPE_IPV4 };
+static unsigned char ethertype_ipv6[] =
+	{ ETHERTYPE_IPV6 };
 static unsigned char llc_oui_pid_pad[] =
-    { 0xAA, 0xAA, 0x03, 0x00, 0x80, 0xC2, 0x00, 0x07, 0x00, 0x00 };
-#define PADLEN	(2)
+	{ LLC, SNAP_BRIDGED, PID_ETHERNET, PAD_BRIDGED };
+static unsigned char llc_oui_ipv4[] =
+	{ LLC, SNAP_ROUTED, ETHERTYPE_IPV4 };
+static unsigned char llc_oui_ipv6[] =
+	{ LLC, SNAP_ROUTED, ETHERTYPE_IPV6 };
 
 enum br2684_encaps {
 	e_vc  = BR2684_ENCAPS_VC,
@@ -69,6 +88,7 @@ struct br2684_dev {
 	struct list_head brvccs; /* one device <=> one vcc (before xmas) */
 	struct net_device_stats stats;
 	int mac_was_set;
+	enum br2684_payload payload;
 };
 
 /*
@@ -136,6 +156,7 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
 {
 	struct atm_vcc *atmvcc;
 	int minheadroom = (brvcc->encaps == e_llc) ? 10 : 2;
+
 	if (skb_headroom(skb) < minheadroom) {
 		struct sk_buff *skb2 = skb_realloc_headroom(skb, minheadroom);
 		brvcc->copies_needed++;
@@ -146,11 +167,32 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
 		}
 		skb = skb2;
 	}
-	skb_push(skb, minheadroom);
-	if (brvcc->encaps == e_llc)
-		skb_copy_to_linear_data(skb, llc_oui_pid_pad, 10);
-	else
-		memset(skb->data, 0, 2);
+
+	if (brvcc->encaps == e_llc) {
+		if (brdev->payload == p_bridged) {
+			skb_push(skb, sizeof(llc_oui_pid_pad));
+			skb_copy_to_linear_data(skb, llc_oui_pid_pad, sizeof(llc_oui_pid_pad));
+		} else if (brdev->payload == p_routed) {
+			unsigned short prot = ntohs(skb->protocol);
+
+			skb_push(skb, sizeof(llc_oui_ipv4));
+			switch (prot) {
+				case ETH_P_IP:
+					skb_copy_to_linear_data(skb, llc_oui_ipv4, sizeof(llc_oui_ipv4));
+					break;
+				case ETH_P_IPV6:
+					skb_copy_to_linear_data(skb, llc_oui_ipv6, sizeof(llc_oui_ipv6));
+					break;
+				default:
+					dev_kfree_skb(skb);
+					return 0;
+			}
+		}
+	} else {
+		skb_push(skb, 2);
+		if (brdev->payload == p_bridged)
+			memset(skb->data, 0, 2);
+	}
 	skb_debug(skb);
 
 	ATM_SKB(skb)->vcc = atmvcc = brvcc->atmvcc;
@@ -299,7 +341,6 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
 	struct br2684_vcc *brvcc = BR2684_VCC(atmvcc);
 	struct net_device *net_dev = brvcc->device;
 	struct br2684_dev *brdev = BRPRIV(net_dev);
-	int plen = sizeof(llc_oui_pid_pad) + ETH_HLEN;
 
 	pr_debug("br2684_push\n");
 
@@ -320,35 +361,50 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
 	atm_return(atmvcc, skb->truesize);
 	pr_debug("skb from brdev %p\n", brdev);
 	if (brvcc->encaps == e_llc) {
+
+		if (skb->len > 7 && skb->data[7] == 0x01)
+			__skb_trim(skb, skb->len - 4);
+
+		/* accept packets that have "ipv[46]" in the snap header */
+		if ((skb->len >= (sizeof(llc_oui_ipv4)))
+		    && (memcmp(skb->data, llc_oui_ipv4, sizeof(llc_oui_ipv4) - BR2684_ETHERTYPE_LEN) == 0)) {
+			if (memcmp(skb->data + 6, ethertype_ipv6, sizeof(ethertype_ipv6)) == 0)
+				skb->protocol = __constant_htons(ETH_P_IPV6);
+			else if (memcmp(skb->data + 6, ethertype_ipv4, sizeof(ethertype_ipv4)) == 0)
+				skb->protocol = __constant_htons(ETH_P_IP);
+			else {
+				brdev->stats.rx_errors++;
+				dev_kfree_skb(skb);
+				return;
+			}
+			skb_pull(skb, sizeof(llc_oui_ipv4));
+			skb_reset_network_header(skb);
+			skb->pkt_type = PACKET_HOST;
+
 		/* let us waste some time for checking the encapsulation.
 		   Note, that only 7 char is checked so frames with a valid FCS
 		   are also accepted (but FCS is not checked of course) */
-		if (memcmp(skb->data, llc_oui_pid_pad, 7)) {
+		} else if ((skb->len >= sizeof(llc_oui_pid_pad)) &&
+		           (memcmp(skb->data, llc_oui_pid_pad, 7) == 0)) {
+			skb_pull(skb, sizeof(llc_oui_pid_pad));
+			skb->protocol = eth_type_trans(skb, net_dev);
+		} else {
 			brdev->stats.rx_errors++;
 			dev_kfree_skb(skb);
 			return;
 		}
 
-		/* Strip FCS if present */
-		if (skb->len > 7 && skb->data[7] == 0x01)
-			__skb_trim(skb, skb->len - 4);
 	} else {
-		plen = PADLEN + ETH_HLEN;	/* pad, dstmac,srcmac, ethtype */
 		/* first 2 chars should be 0 */
 		if (*((u16 *) (skb->data)) != 0) {
 			brdev->stats.rx_errors++;
 			dev_kfree_skb(skb);
 			return;
 		}
-	}
-	if (skb->len < plen) {
-		brdev->stats.rx_errors++;
-		dev_kfree_skb(skb);	/* dev_ not needed? */
-		return;
+		skb_pull(skb, BR2684_PAD_LEN + ETH_HLEN); /* pad, dstmac, srcmac, ethtype */
+		skb->protocol = eth_type_trans(skb, net_dev);
 	}
 
-	skb_pull(skb, plen - ETH_HLEN);
-	skb->protocol = eth_type_trans(skb, net_dev);
 #ifdef CONFIG_ATM_BR2684_IPFILTER
 	if (unlikely(packet_fails_filter(skb->protocol, brvcc, skb))) {
 		brdev->stats.rx_dropped++;
@@ -482,25 +538,52 @@ static void br2684_setup(struct net_device *netdev)
 	INIT_LIST_HEAD(&brdev->brvccs);
 }
 
+static void br2684_setup_routed(struct net_device *netdev)
+{
+	struct br2684_dev *brdev = BRPRIV(netdev);
+	brdev->net_dev = netdev;
+
+	netdev->hard_header_len = 0;
+	my_eth_mac_addr = netdev->set_mac_address;
+	netdev->set_mac_address = br2684_mac_addr;
+	netdev->hard_start_xmit = br2684_start_xmit;
+	netdev->get_stats = br2684_get_stats;
+	netdev->addr_len = 0;
+	netdev->mtu = 1500;
+	netdev->type = ARPHRD_PPP;
+	netdev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
+	netdev->tx_queue_len = 100;
+	INIT_LIST_HEAD(&brdev->brvccs);
+}
+
 static int br2684_create(void __user *arg)
 {
 	int err;
 	struct net_device *netdev;
 	struct br2684_dev *brdev;
 	struct atm_newif_br2684 ni;
+	enum br2684_payload payload;
 
 	pr_debug("br2684_create\n");
 
 	if (copy_from_user(&ni, arg, sizeof ni)) {
 		return -EFAULT;
 	}
+
+	if (ni.media & BR2684_FLAG_ROUTED)
+		payload = p_routed;
+	else
+		payload = p_bridged;
+	ni.media &= 0xffff; /* strip flags */
+
 	if (ni.media != BR2684_MEDIA_ETHERNET || ni.mtu != 1500) {
 		return -EINVAL;
 	}
 
 	netdev = alloc_netdev(sizeof(struct br2684_dev),
 			      ni.ifname[0] ? ni.ifname : "nas%d",
-			      br2684_setup);
+			      (payload == p_routed) ?
+			       br2684_setup_routed : br2684_setup);
 	if (!netdev)
 		return -ENOMEM;
 
@@ -516,6 +599,7 @@ static int br2684_create(void __user *arg)
 	}
 
 	write_lock_irq(&devs_lock);
+	brdev->payload = payload;
 	brdev->number = list_empty(&br2684_devs) ? 1 :
 	    BRPRIV(list_entry_brdev(br2684_devs.prev))->number + 1;
 	list_add_tail(&brdev->br2684_devs, &br2684_devs);
@@ -601,14 +685,14 @@ static int br2684_seq_show(struct seq_file *seq, void *v)
 		   brdev->mac_was_set ? "set" : "auto");
 
 	list_for_each_entry(brvcc, &brdev->brvccs, brvccs) {
-		seq_printf(seq, "  vcc %d.%d.%d: encaps=%s"
-				    ", failed copies %u/%u"
-				    "\n", brvcc->atmvcc->dev->number,
-				    brvcc->atmvcc->vpi, brvcc->atmvcc->vci,
-				    (brvcc->encaps == e_llc) ? "LLC" : "VC"
-				    , brvcc->copies_failed
-				    , brvcc->copies_needed
-				    );
+		seq_printf(seq, "  vcc %d.%d.%d: encaps=%s payload=%s"
+			        ", failed copies %u/%u"
+			        "\n", brvcc->atmvcc->dev->number,
+				      brvcc->atmvcc->vpi, brvcc->atmvcc->vci,
+				      (brvcc->encaps == e_llc) ? "LLC" : "VC",
+				      (brdev->payload == p_bridged) ? "bridged" : "routed",
+				      brvcc->copies_failed,
+				      brvcc->copies_needed);
 #ifdef CONFIG_ATM_BR2684_IPFILTER
 #define b1(var, byte)	((u8 *) &brvcc->filter.var)[byte]
 #define bs(var)		b1(var, 0), b1(var, 1), b1(var, 2), b1(var, 3)

^ permalink raw reply related

* [PATCH net-2.6.25 5/7][ATM]: [br2864] whitespace cleanup
From: chas williams - CONTRACTOR @ 2007-12-30  1:07 UTC (permalink / raw)
  To: netdev; +Cc: davem

commit 6b11f93a718dc916198feb1099ae0cef39ce3936
Author: Chas Williams <chas@vger.cmf.nrl.navy.mil>
Date:   Sat Oct 27 08:33:40 2007 -0400

    [ATM]: [br2864] whitespace cleanup
    
    Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>

diff --git a/include/linux/atmbr2684.h b/include/linux/atmbr2684.h
index ccdab6c..52bf72a 100644
--- a/include/linux/atmbr2684.h
+++ b/include/linux/atmbr2684.h
@@ -15,7 +15,7 @@
 #define BR2684_MEDIA_802_6	(4)	/* 802.6 */
 
 					/* used only at device creation:  */
-#define BR2684_FLAG_ROUTED	(1<<16) /* payload is routed, not bridged */
+#define BR2684_FLAG_ROUTED	(1<<16)	/* payload is routed, not bridged */
 
 /*
  * Is there FCS inbound on this VC?  This currently isn't supported.
@@ -45,17 +45,16 @@
 #define BR2684_PAYLOAD_ROUTED   (0)
 #define BR2684_PAYLOAD_BRIDGED  (1)
 
-
 /*
  * This is for the ATM_NEWBACKENDIF call - these are like socket families:
  * the first element of the structure is the backend number and the rest
  * is per-backend specific
  */
 struct atm_newif_br2684 {
-	atm_backend_t	backend_num;	/* ATM_BACKEND_BR2684 */
-	int		media;		/* BR2684_MEDIA_*, flags in upper bits */
-	char		ifname[IFNAMSIZ];
-	int		mtu;
+	atm_backend_t backend_num;	/* ATM_BACKEND_BR2684 */
+	int media;		/* BR2684_MEDIA_*, flags in upper bits */
+	char ifname[IFNAMSIZ];
+	int mtu;
 };
 
 /*
@@ -66,10 +65,10 @@ struct atm_newif_br2684 {
 #define BR2684_FIND_BYNUM	(1)
 #define BR2684_FIND_BYIFNAME	(2)
 struct br2684_if_spec {
-	int method;			/* BR2684_FIND_* */
+	int method;		/* BR2684_FIND_* */
 	union {
-		char		ifname[IFNAMSIZ];
-		int		devnum;
+		char ifname[IFNAMSIZ];
+		int devnum;
 	} spec;
 };
 
@@ -79,16 +78,16 @@ struct br2684_if_spec {
  * is per-backend specific
  */
 struct atm_backend_br2684 {
-	atm_backend_t	backend_num;	/* ATM_BACKEND_BR2684 */
+	atm_backend_t backend_num;	/* ATM_BACKEND_BR2684 */
 	struct br2684_if_spec ifspec;
-	int	fcs_in;		/* BR2684_FCSIN_* */
-	int	fcs_out;	/* BR2684_FCSOUT_* */
-	int	fcs_auto;	/* 1: fcs_{in,out} disabled if no FCS rx'ed */
-	int	encaps;		/* BR2684_ENCAPS_* */
-	int	has_vpiid;	/* 1: use vpn_id - Unsupported */
-	__u8	vpn_id[7];
-	int	send_padding;	/* unsupported */
-	int	min_size;	/* we will pad smaller packets than this */
+	int fcs_in;		/* BR2684_FCSIN_* */
+	int fcs_out;		/* BR2684_FCSOUT_* */
+	int fcs_auto;		/* 1: fcs_{in,out} disabled if no FCS rx'ed */
+	int encaps;		/* BR2684_ENCAPS_* */
+	int has_vpiid;		/* 1: use vpn_id - Unsupported */
+	__u8 vpn_id[7];
+	int send_padding;	/* unsupported */
+	int min_size;		/* we will pad smaller packets than this */
 };
 
 /*
@@ -97,8 +96,8 @@ struct atm_backend_br2684 {
  * efficient per-if in/out filters, this support will be removed
  */
 struct br2684_filter {
-	__be32	prefix;		/* network byte order */
-	__be32	netmask;	/* 0 = disable filter */
+	__be32 prefix;		/* network byte order */
+	__be32 netmask;		/* 0 = disable filter */
 };
 
 struct br2684_filter_set {
@@ -107,8 +106,8 @@ struct br2684_filter_set {
 };
 
 enum br2684_payload {
-        p_routed = BR2684_PAYLOAD_ROUTED,
-        p_bridged = BR2684_PAYLOAD_BRIDGED,
+	p_routed = BR2684_PAYLOAD_ROUTED,
+	p_bridged = BR2684_PAYLOAD_BRIDGED,
 };
 
 #define BR2684_SETFILT	_IOW( 'a', ATMIOC_BACKEND + 0, \
diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index d9bb2a1..f5a3794 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -1,9 +1,10 @@
 /*
-Ethernet netdevice using ATM AAL5 as underlying carrier
-(RFC1483 obsoleted by RFC2684) for Linux
-Authors: Marcell GAL, 2000, XDSL Ltd, Hungary
-         Eric Kinzie, 2006-2007, US Naval Research Laboratory
-*/
+ * Ethernet netdevice using ATM AAL5 as underlying carrier
+ * (RFC1483 obsoleted by RFC2684) for Linux
+ *
+ * Authors: Marcell GAL, 2000, XDSL Ltd, Hungary
+ *          Eric Kinzie, 2006-2007, US Naval Research Laboratory
+ */
 
 #include <linux/module.h>
 #include <linux/init.h>
@@ -51,28 +52,24 @@ static void skb_debug(const struct sk_buff *skb)
 #define ETHERTYPE_IPV6	0x86, 0xdd
 #define PAD_BRIDGED	0x00, 0x00
 
-static unsigned char ethertype_ipv4[] =
-	{ ETHERTYPE_IPV4 };
-static unsigned char ethertype_ipv6[] =
-	{ ETHERTYPE_IPV6 };
+static unsigned char ethertype_ipv4[] = { ETHERTYPE_IPV4 };
+static unsigned char ethertype_ipv6[] = { ETHERTYPE_IPV6 };
 static unsigned char llc_oui_pid_pad[] =
-	{ LLC, SNAP_BRIDGED, PID_ETHERNET, PAD_BRIDGED };
-static unsigned char llc_oui_ipv4[] =
-	{ LLC, SNAP_ROUTED, ETHERTYPE_IPV4 };
-static unsigned char llc_oui_ipv6[] =
-	{ LLC, SNAP_ROUTED, ETHERTYPE_IPV6 };
+			{ LLC, SNAP_BRIDGED, PID_ETHERNET, PAD_BRIDGED };
+static unsigned char llc_oui_ipv4[] = { LLC, SNAP_ROUTED, ETHERTYPE_IPV4 };
+static unsigned char llc_oui_ipv6[] = { LLC, SNAP_ROUTED, ETHERTYPE_IPV6 };
 
 enum br2684_encaps {
-	e_vc  = BR2684_ENCAPS_VC,
+	e_vc = BR2684_ENCAPS_VC,
 	e_llc = BR2684_ENCAPS_LLC,
 };
 
 struct br2684_vcc {
-	struct atm_vcc  *atmvcc;
+	struct atm_vcc *atmvcc;
 	struct net_device *device;
-	/* keep old push,pop functions for chaining */
-	void (*old_push)(struct atm_vcc *vcc,struct sk_buff *skb);
-	/* void (*old_pop)(struct atm_vcc *vcc,struct sk_buff *skb); */
+	/* keep old push, pop functions for chaining */
+	void (*old_push) (struct atm_vcc * vcc, struct sk_buff * skb);
+	/* void (*old_pop)(struct atm_vcc *vcc, struct sk_buff *skb); */
 	enum br2684_encaps encaps;
 	struct list_head brvccs;
 #ifdef CONFIG_ATM_BR2684_IPFILTER
@@ -85,7 +82,7 @@ struct br2684_dev {
 	struct net_device *net_dev;
 	struct list_head br2684_devs;
 	int number;
-	struct list_head brvccs; /* one device <=> one vcc (before xmas) */
+	struct list_head brvccs;	/* one device <=> one vcc (before xmas) */
 	struct net_device_stats stats;
 	int mac_was_set;
 	enum br2684_payload payload;
@@ -104,7 +101,7 @@ static LIST_HEAD(br2684_devs);
 
 static inline struct br2684_dev *BRPRIV(const struct net_device *net_dev)
 {
-	return (struct br2684_dev *) net_dev->priv;
+	return (struct br2684_dev *)net_dev->priv;
 }
 
 static inline struct net_device *list_entry_brdev(const struct list_head *le)
@@ -114,7 +111,7 @@ static inline struct net_device *list_entry_brdev(const struct list_head *le)
 
 static inline struct br2684_vcc *BR2684_VCC(const struct atm_vcc *atmvcc)
 {
-	return (struct br2684_vcc *) (atmvcc->user_back);
+	return (struct br2684_vcc *)(atmvcc->user_back);
 }
 
 static inline struct br2684_vcc *list_entry_brvcc(const struct list_head *le)
@@ -152,7 +149,7 @@ static struct net_device *br2684_find_dev(const struct br2684_if_spec *s)
  * otherwise false
  */
 static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
-	struct br2684_vcc *brvcc)
+			   struct br2684_vcc *brvcc)
 {
 	struct atm_vcc *atmvcc;
 	int minheadroom = (brvcc->encaps == e_llc) ? 10 : 2;
@@ -171,21 +168,24 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
 	if (brvcc->encaps == e_llc) {
 		if (brdev->payload == p_bridged) {
 			skb_push(skb, sizeof(llc_oui_pid_pad));
-			skb_copy_to_linear_data(skb, llc_oui_pid_pad, sizeof(llc_oui_pid_pad));
+			skb_copy_to_linear_data(skb, llc_oui_pid_pad,
+						sizeof(llc_oui_pid_pad));
 		} else if (brdev->payload == p_routed) {
 			unsigned short prot = ntohs(skb->protocol);
 
 			skb_push(skb, sizeof(llc_oui_ipv4));
 			switch (prot) {
-				case ETH_P_IP:
-					skb_copy_to_linear_data(skb, llc_oui_ipv4, sizeof(llc_oui_ipv4));
-					break;
-				case ETH_P_IPV6:
-					skb_copy_to_linear_data(skb, llc_oui_ipv6, sizeof(llc_oui_ipv6));
-					break;
-				default:
-					dev_kfree_skb(skb);
-					return 0;
+			case ETH_P_IP:
+				skb_copy_to_linear_data(skb, llc_oui_ipv4,
+							sizeof(llc_oui_ipv4));
+				break;
+			case ETH_P_IPV6:
+				skb_copy_to_linear_data(skb, llc_oui_ipv6,
+							sizeof(llc_oui_ipv6));
+				break;
+			default:
+				dev_kfree_skb(skb);
+				return 0;
 			}
 		}
 	} else {
@@ -198,13 +198,14 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
 	ATM_SKB(skb)->vcc = atmvcc = brvcc->atmvcc;
 	pr_debug("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, atmvcc, atmvcc->dev);
 	if (!atm_may_send(atmvcc, skb->truesize)) {
-		/* we free this here for now, because we cannot know in a higher
-			layer whether the skb point it supplied wasn't freed yet.
-			now, it always is.
-		*/
+		/*
+		 * We free this here for now, because we cannot know in a higher
+		 * layer whether the skb pointer it supplied wasn't freed yet.
+		 * Now, it always is.
+		 */
 		dev_kfree_skb(skb);
 		return 0;
-		}
+	}
 	atomic_add(skb->truesize, &sk_atm(atmvcc)->sk_wmem_alloc);
 	ATM_SKB(skb)->atm_options = atmvcc->atm_options;
 	brdev->stats.tx_packets++;
@@ -214,10 +215,9 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
 }
 
 static inline struct br2684_vcc *pick_outgoing_vcc(struct sk_buff *skb,
-	struct br2684_dev *brdev)
+						   struct br2684_dev *brdev)
 {
-	return list_empty(&brdev->brvccs) ? NULL :
-	    list_entry_brvcc(brdev->brvccs.next); /* 1 vcc/dev right now */
+	return list_empty(&brdev->brvccs) ? NULL : list_entry_brvcc(brdev->brvccs.next);	/* 1 vcc/dev right now */
 }
 
 static int br2684_start_xmit(struct sk_buff *skb, struct net_device *dev)
@@ -241,11 +241,10 @@ static int br2684_start_xmit(struct sk_buff *skb, struct net_device *dev)
 		/*
 		 * We should probably use netif_*_queue() here, but that
 		 * involves added complication.  We need to walk before
-		 * we can run
+		 * we can run.
+		 *
+		 * Don't free here! this pointer might be no longer valid!
 		 */
-		/* don't free here! this pointer might be no longer valid!
-		dev_kfree_skb(skb);
-		*/
 		brdev->stats.tx_errors++;
 		brdev->stats.tx_fifo_errors++;
 	}
@@ -259,12 +258,11 @@ static struct net_device_stats *br2684_get_stats(struct net_device *dev)
 	return &BRPRIV(dev)->stats;
 }
 
-
 /*
  * We remember when the MAC gets set, so we don't override it later with
  * the ESI of the ATM card of the first VC
  */
-static int (*my_eth_mac_addr)(struct net_device *, void *);
+static int (*my_eth_mac_addr) (struct net_device *, void *);
 static int br2684_mac_addr(struct net_device *dev, void *p)
 {
 	int err = my_eth_mac_addr(dev, p);
@@ -275,7 +273,7 @@ static int br2684_mac_addr(struct net_device *dev, void *p)
 
 #ifdef CONFIG_ATM_BR2684_IPFILTER
 /* this IOCTL is experimental. */
-static int br2684_setfilt(struct atm_vcc *atmvcc, void __user *arg)
+static int br2684_setfilt(struct atm_vcc *atmvcc, void __user * arg)
 {
 	struct br2684_vcc *brvcc;
 	struct br2684_filter_set fs;
@@ -285,13 +283,12 @@ static int br2684_setfilt(struct atm_vcc *atmvcc, void __user *arg)
 	if (fs.ifspec.method != BR2684_FIND_BYNOTHING) {
 		/*
 		 * This is really a per-vcc thing, but we can also search
-		 * by device
+		 * by device.
 		 */
 		struct br2684_dev *brdev;
 		read_lock(&devs_lock);
 		brdev = BRPRIV(br2684_find_dev(&fs.ifspec));
-		if (brdev == NULL || list_empty(&brdev->brvccs) ||
-		    brdev->brvccs.next != brdev->brvccs.prev)  /* >1 VCC */
+		if (brdev == NULL || list_empty(&brdev->brvccs) || brdev->brvccs.next != brdev->brvccs.prev)	/* >1 VCC */
 			brvcc = NULL;
 		else
 			brvcc = list_entry_brvcc(brdev->brvccs.next);
@@ -309,15 +306,16 @@ static inline int
 packet_fails_filter(__be16 type, struct br2684_vcc *brvcc, struct sk_buff *skb)
 {
 	if (brvcc->filter.netmask == 0)
-		return 0;			/* no filter in place */
+		return 0;	/* no filter in place */
 	if (type == htons(ETH_P_IP) &&
-	    (((struct iphdr *) (skb->data))->daddr & brvcc->filter.
+	    (((struct iphdr *)(skb->data))->daddr & brvcc->filter.
 	     netmask) == brvcc->filter.prefix)
 		return 0;
 	if (type == htons(ETH_P_ARP))
 		return 0;
-	/* TODO: we should probably filter ARPs too.. don't want to have
-	 *   them returning values that don't make sense, or is that ok?
+	/*
+	 * TODO: we should probably filter ARPs too.. don't want to have
+	 * them returning values that don't make sense, or is that ok?
 	 */
 	return 1;		/* drop */
 }
@@ -367,10 +365,17 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
 
 		/* accept packets that have "ipv[46]" in the snap header */
 		if ((skb->len >= (sizeof(llc_oui_ipv4)))
-		    && (memcmp(skb->data, llc_oui_ipv4, sizeof(llc_oui_ipv4) - BR2684_ETHERTYPE_LEN) == 0)) {
-			if (memcmp(skb->data + 6, ethertype_ipv6, sizeof(ethertype_ipv6)) == 0)
+		    &&
+		    (memcmp
+		     (skb->data, llc_oui_ipv4,
+		      sizeof(llc_oui_ipv4) - BR2684_ETHERTYPE_LEN) == 0)) {
+			if (memcmp
+			    (skb->data + 6, ethertype_ipv6,
+			     sizeof(ethertype_ipv6)) == 0)
 				skb->protocol = __constant_htons(ETH_P_IPV6);
-			else if (memcmp(skb->data + 6, ethertype_ipv4, sizeof(ethertype_ipv4)) == 0)
+			else if (memcmp
+				 (skb->data + 6, ethertype_ipv4,
+				  sizeof(ethertype_ipv4)) == 0)
 				skb->protocol = __constant_htons(ETH_P_IP);
 			else {
 				brdev->stats.rx_errors++;
@@ -380,12 +385,13 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
 			skb_pull(skb, sizeof(llc_oui_ipv4));
 			skb_reset_network_header(skb);
 			skb->pkt_type = PACKET_HOST;
-
-		/* let us waste some time for checking the encapsulation.
-		   Note, that only 7 char is checked so frames with a valid FCS
-		   are also accepted (but FCS is not checked of course) */
+			/*
+			 * Let us waste some time for checking the encapsulation.
+			 * Note, that only 7 char is checked so frames with a valid FCS
+			 * are also accepted (but FCS is not checked of course).
+			 */
 		} else if ((skb->len >= sizeof(llc_oui_pid_pad)) &&
-		           (memcmp(skb->data, llc_oui_pid_pad, 7) == 0)) {
+			   (memcmp(skb->data, llc_oui_pid_pad, 7) == 0)) {
 			skb_pull(skb, sizeof(llc_oui_pid_pad));
 			skb->protocol = eth_type_trans(skb, net_dev);
 		} else {
@@ -401,7 +407,7 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
 			dev_kfree_skb(skb);
 			return;
 		}
-		skb_pull(skb, BR2684_PAD_LEN + ETH_HLEN); /* pad, dstmac, srcmac, ethtype */
+		skb_pull(skb, BR2684_PAD_LEN + ETH_HLEN);	/* pad, dstmac, srcmac, ethtype */
 		skb->protocol = eth_type_trans(skb, net_dev);
 	}
 
@@ -428,11 +434,12 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
 	netif_rx(skb);
 }
 
-static int br2684_regvcc(struct atm_vcc *atmvcc, void __user *arg)
+/*
+ * Assign a vcc to a dev
+ * Note: we do not have explicit unassign, but look at _push()
+ */
+static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg)
 {
-/* assign a vcc to a dev
-Note: we do not have explicit unassign, but look at _push()
-*/
 	int err;
 	struct br2684_vcc *brvcc;
 	struct sk_buff *skb;
@@ -451,7 +458,7 @@ Note: we do not have explicit unassign, but look at _push()
 	net_dev = br2684_find_dev(&be.ifspec);
 	if (net_dev == NULL) {
 		printk(KERN_ERR
-		    "br2684: tried to attach to non-existant device\n");
+		       "br2684: tried to attach to non-existant device\n");
 		err = -ENXIO;
 		goto error;
 	}
@@ -467,13 +474,15 @@ Note: we do not have explicit unassign, but look at _push()
 	}
 	if (be.fcs_in != BR2684_FCSIN_NO || be.fcs_out != BR2684_FCSOUT_NO ||
 	    be.fcs_auto || be.has_vpiid || be.send_padding || (be.encaps !=
-	    BR2684_ENCAPS_VC && be.encaps != BR2684_ENCAPS_LLC) ||
-	    be.min_size != 0) {
+							       BR2684_ENCAPS_VC
+							       && be.encaps !=
+							       BR2684_ENCAPS_LLC)
+	    || be.min_size != 0) {
 		err = -EINVAL;
 		goto error;
 	}
-	pr_debug("br2684_regvcc vcc=%p, encaps=%d, brvcc=%p\n", atmvcc, be.encaps,
-		brvcc);
+	pr_debug("br2684_regvcc vcc=%p, encaps=%d, brvcc=%p\n", atmvcc,
+		 be.encaps, brvcc);
 	if (list_empty(&brdev->brvccs) && !brdev->mac_was_set) {
 		unsigned char *esi = atmvcc->dev->esi;
 		if (esi[0] | esi[1] | esi[2] | esi[3] | esi[4] | esi[5])
@@ -486,7 +495,7 @@ Note: we do not have explicit unassign, but look at _push()
 	brvcc->device = net_dev;
 	brvcc->atmvcc = atmvcc;
 	atmvcc->user_back = brvcc;
-	brvcc->encaps = (enum br2684_encaps) be.encaps;
+	brvcc->encaps = (enum br2684_encaps)be.encaps;
 	brvcc->old_push = atmvcc->push;
 	barrier();
 	atmvcc->push = br2684_push;
@@ -517,7 +526,7 @@ Note: we do not have explicit unassign, but look at _push()
 	}
 	__module_get(THIS_MODULE);
 	return 0;
-    error:
+      error:
 	write_unlock_irq(&devs_lock);
 	kfree(brvcc);
 	return err;
@@ -556,7 +565,7 @@ static void br2684_setup_routed(struct net_device *netdev)
 	INIT_LIST_HEAD(&brdev->brvccs);
 }
 
-static int br2684_create(void __user *arg)
+static int br2684_create(void __user * arg)
 {
 	int err;
 	struct net_device *netdev;
@@ -574,7 +583,7 @@ static int br2684_create(void __user *arg)
 		payload = p_routed;
 	else
 		payload = p_bridged;
-	ni.media &= 0xffff; /* strip flags */
+	ni.media &= 0xffff;	/* strip flags */
 
 	if (ni.media != BR2684_MEDIA_ETHERNET || ni.mtu != 1500) {
 		return -EINVAL;
@@ -583,7 +592,7 @@ static int br2684_create(void __user *arg)
 	netdev = alloc_netdev(sizeof(struct br2684_dev),
 			      ni.ifname[0] ? ni.ifname : "nas%d",
 			      (payload == p_routed) ?
-			       br2684_setup_routed : br2684_setup);
+			      br2684_setup_routed : br2684_setup);
 	if (!netdev)
 		return -ENOMEM;
 
@@ -612,16 +621,16 @@ static int br2684_create(void __user *arg)
  * -ENOIOCTLCMD for any unrecognized ioctl
  */
 static int br2684_ioctl(struct socket *sock, unsigned int cmd,
-	unsigned long arg)
+			unsigned long arg)
 {
 	struct atm_vcc *atmvcc = ATM_SD(sock);
 	void __user *argp = (void __user *)arg;
+	atm_backend_t b;
 
 	int err;
-	switch(cmd) {
+	switch (cmd) {
 	case ATM_SETBACKEND:
-	case ATM_NEWBACKENDIF: {
-		atm_backend_t b;
+	case ATM_NEWBACKENDIF:
 		err = get_user(b, (atm_backend_t __user *) argp);
 		if (err)
 			return -EFAULT;
@@ -633,7 +642,6 @@ static int br2684_ioctl(struct socket *sock, unsigned int cmd,
 			return br2684_regvcc(atmvcc, argp);
 		else
 			return br2684_create(argp);
-		}
 #ifdef CONFIG_ATM_BR2684_IPFILTER
 	case BR2684_SETFILT:
 		if (atmvcc->push != br2684_push)
@@ -641,6 +649,7 @@ static int br2684_ioctl(struct socket *sock, unsigned int cmd,
 		if (!capable(CAP_NET_ADMIN))
 			return -EPERM;
 		err = br2684_setfilt(atmvcc, argp);
+
 		return err;
 #endif /* CONFIG_ATM_BR2684_IPFILTER */
 	}
@@ -648,19 +657,18 @@ static int br2684_ioctl(struct socket *sock, unsigned int cmd,
 }
 
 static struct atm_ioctl br2684_ioctl_ops = {
-	.owner	= THIS_MODULE,
-	.ioctl	= br2684_ioctl,
+	.owner = THIS_MODULE,
+	.ioctl = br2684_ioctl,
 };
 
-
 #ifdef CONFIG_PROC_FS
-static void *br2684_seq_start(struct seq_file *seq, loff_t *pos)
+static void *br2684_seq_start(struct seq_file *seq, loff_t * pos)
 {
 	read_lock(&devs_lock);
 	return seq_list_start(&br2684_devs, *pos);
 }
 
-static void *br2684_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+static void *br2684_seq_next(struct seq_file *seq, void *v, loff_t * pos)
 {
 	return seq_list_next(v, &br2684_devs, pos);
 }
@@ -673,7 +681,7 @@ static void br2684_seq_stop(struct seq_file *seq, void *v)
 static int br2684_seq_show(struct seq_file *seq, void *v)
 {
 	const struct br2684_dev *brdev = list_entry(v, struct br2684_dev,
-			br2684_devs);
+						    br2684_devs);
 	const struct net_device *net_dev = brdev->net_dev;
 	const struct br2684_vcc *brvcc;
 	DECLARE_MAC_BUF(mac);
@@ -686,20 +694,18 @@ static int br2684_seq_show(struct seq_file *seq, void *v)
 
 	list_for_each_entry(brvcc, &brdev->brvccs, brvccs) {
 		seq_printf(seq, "  vcc %d.%d.%d: encaps=%s payload=%s"
-			        ", failed copies %u/%u"
-			        "\n", brvcc->atmvcc->dev->number,
-				      brvcc->atmvcc->vpi, brvcc->atmvcc->vci,
-				      (brvcc->encaps == e_llc) ? "LLC" : "VC",
-				      (brdev->payload == p_bridged) ? "bridged" : "routed",
-				      brvcc->copies_failed,
-				      brvcc->copies_needed);
+			   ", failed copies %u/%u"
+			   "\n", brvcc->atmvcc->dev->number,
+			   brvcc->atmvcc->vpi, brvcc->atmvcc->vci,
+			   (brvcc->encaps == e_llc) ? "LLC" : "VC",
+			   (brdev->payload == p_bridged) ? "bridged" : "routed",
+			   brvcc->copies_failed, brvcc->copies_needed);
 #ifdef CONFIG_ATM_BR2684_IPFILTER
 #define b1(var, byte)	((u8 *) &brvcc->filter.var)[byte]
 #define bs(var)		b1(var, 0), b1(var, 1), b1(var, 2), b1(var, 3)
-			if (brvcc->filter.netmask != 0)
-				seq_printf(seq, "    filter=%d.%d.%d.%d/"
-						"%d.%d.%d.%d\n",
-						bs(prefix), bs(netmask));
+		if (brvcc->filter.netmask != 0)
+			seq_printf(seq, "    filter=%d.%d.%d.%d/"
+				   "%d.%d.%d.%d\n", bs(prefix), bs(netmask));
 #undef bs
 #undef b1
 #endif /* CONFIG_ATM_BR2684_IPFILTER */
@@ -709,9 +715,9 @@ static int br2684_seq_show(struct seq_file *seq, void *v)
 
 static const struct seq_operations br2684_seq_ops = {
 	.start = br2684_seq_start,
-	.next  = br2684_seq_next,
-	.stop  = br2684_seq_stop,
-	.show  = br2684_seq_show,
+	.next = br2684_seq_next,
+	.stop = br2684_seq_stop,
+	.show = br2684_seq_show,
 };
 
 static int br2684_proc_open(struct inode *inode, struct file *file)
@@ -720,15 +726,15 @@ static int br2684_proc_open(struct inode *inode, struct file *file)
 }
 
 static const struct file_operations br2684_proc_ops = {
-	.owner   = THIS_MODULE,
-	.open    = br2684_proc_open,
-	.read    = seq_read,
-	.llseek  = seq_lseek,
+	.owner = THIS_MODULE,
+	.open = br2684_proc_open,
+	.read = seq_read,
+	.llseek = seq_lseek,
 	.release = seq_release,
 };
 
 extern struct proc_dir_entry *atm_proc_root;	/* from proc.c */
-#endif
+#endif /* CONFIG_PROC_FS */
 
 static int __init br2684_init(void)
 {

^ permalink raw reply related

* [PATCH net-2.6.25 6/7][ATM]: [ambassador] kmalloc + memset conversion to kzalloc
From: chas williams - CONTRACTOR @ 2007-12-30  1:08 UTC (permalink / raw)
  To: netdev; +Cc: davem

commit 87c1811be8f1c6587ed3b57d23f93c7e91afdde7
Author: Joonwoo Park <joonwpark81@gmail.com>
Date:   Tue Nov 27 09:43:04 2007 -0500

    [ATM]: [ambassador] kmalloc + memset conversion to kzalloc
    
    Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
    Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>

diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
index b34b382..7b44a59 100644
--- a/drivers/atm/ambassador.c
+++ b/drivers/atm/ambassador.c
@@ -2163,7 +2163,6 @@ static int __devinit amb_init (amb_dev * dev)
 static void setup_dev(amb_dev *dev, struct pci_dev *pci_dev) 
 {
       unsigned char pool;
-      memset (dev, 0, sizeof(amb_dev));
       
       // set up known dev items straight away
       dev->pci_dev = pci_dev; 
@@ -2253,7 +2252,7 @@ static int __devinit amb_probe(struct pci_dev *pci_dev, const struct pci_device_
 		goto out_disable;
 	}
 
-	dev = kmalloc (sizeof(amb_dev), GFP_KERNEL);
+	dev = kzalloc(sizeof(amb_dev), GFP_KERNEL);
 	if (!dev) {
 		PRINTK (KERN_ERR, "out of memory!");
 		err = -ENOMEM;

^ permalink raw reply related

* [PATCH net-2.6.25 7/7][ATM]: [he] fixing compilation when you define USE_RBPS_POOL/USE_RBPL_POOL
From: chas williams - CONTRACTOR @ 2007-12-30  1:08 UTC (permalink / raw)
  To: netdev; +Cc: davem

commit 62024377f1da8a3f5b49cfd60d892c778f5a5741
Author: Jorge Boncompte <jorge@dti2.net>
Date:   Thu Dec 13 16:14:40 2007 -0500

    [ATM]: [he] fixing compilation when you define USE_RBPS_POOL/USE_RBPL_POOL
    
    Signed-off-by: Jorge Boncompte <jorge@dti2.net>
    Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>

diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index 3b64a99..20df4bb 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -1643,6 +1643,8 @@ he_stop(struct he_dev *he_dev)
 
 	if (he_dev->rbpl_base) {
 #ifdef USE_RBPL_POOL
+		int i;
+
 		for (i = 0; i < CONFIG_RBPL_SIZE; ++i) {
 			void *cpuaddr = he_dev->rbpl_virt[i].virt;
 			dma_addr_t dma_handle = he_dev->rbpl_base[i].phys;
@@ -1665,6 +1667,8 @@ he_stop(struct he_dev *he_dev)
 #ifdef USE_RBPS
 	if (he_dev->rbps_base) {
 #ifdef USE_RBPS_POOL
+		int i;
+
 		for (i = 0; i < CONFIG_RBPS_SIZE; ++i) {
 			void *cpuaddr = he_dev->rbps_virt[i].virt;
 			dma_addr_t dma_handle = he_dev->rbps_base[i].phys;

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox