Netdev List
 help / color / mirror / Atom feed
* [PATCH] sis190: fix compile error section type conflict
From: Li Zefan @ 2008-02-02  5:27 UTC (permalink / raw)
  To: romieu; +Cc: netdev, LKML, jgarzik


Fix the following compile error:

drivers/net/sis190.c:329: error: sis190_pci_tbl causes a section type conflict
make[2]: *** [drivers/net/sis190.o] Error 1
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>

---
 drivers/net/sis190.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index b570402..e48e4ad 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -326,7 +326,7 @@ static const struct {
 	{ "SiS 191 PCI Gigabit Ethernet adapter" },
 };
 
-static struct pci_device_id sis190_pci_tbl[] __devinitdata = {
+static const struct pci_device_id sis190_pci_tbl[] __devinitdata = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0190), 0, 0, 0 },
 	{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0191), 0, 0, 1 },
 	{ 0, },
-- 
1.5.4.rc3



^ permalink raw reply related

* Re: [git patches] net driver updates #2
From: David Miller @ 2008-02-02  5:49 UTC (permalink / raw)
  To: jeff; +Cc: netdev, linux-kernel
In-Reply-To: <20080201210338.GA11084@havoc.gtf.org>

From: Jeff Garzik <jeff@garzik.org>
Date: Fri, 1 Feb 2008 16:03:38 -0500

> This submit is based on top of Linus's tree, since I'm not sure what's
> going on with net-2.6.git and my previous (lost?) submission.
> 
> These changes do /not/ include anything from the previous submission,
> which was on top of net-2.6 -- but then you rebased, which probably made
> everything more difficult.  :)

Can you respin the tree with that previus submission init?

The best I'll be able to do is clone that entire tree in
order to pick the patches out, and from here in Australia
with a dodgy link I might not even finish before I have
to get on a plane back home on Monday :-)

I'll pull in this second set later tonight.

^ permalink raw reply

* Re: [git patches] net driver updates #2
From: David Miller @ 2008-02-02  5:52 UTC (permalink / raw)
  To: jeff; +Cc: netdev, linux-kernel
In-Reply-To: <20080201210338.GA11084@havoc.gtf.org>

From: Jeff Garzik <jeff@garzik.org>
Date: Fri, 1 Feb 2008 16:03:38 -0500

> Please pull from 'upstream2-davem' branch of

This is now pulled and pushed back out to net-2.6

Thanks!

^ permalink raw reply

* Re: kernel panic on 2.6.24 with esfq patch applied
From: Jarek Poplawski @ 2008-02-02  9:28 UTC (permalink / raw)
  To: Denys Fedoryshchenko; +Cc: netdev
In-Reply-To: <20080201131509.M52958@visp.net.lb>

Denys Fedoryshchenko wrote, On 02/01/2008 02:25 PM:

> Hi
> 
> Probably bug related to ESFQ, now i will unload module and will test more. 
> But probably not related, so if not difficult, please take a look.


Hi,

The main break seems to take place in HTB. Do you use HTB on IFB, BTW?
If not, maybe some exemplary rules from your script? (There are quite
a few modules loaded...)

Thanks,
Jarek P.

^ permalink raw reply

* Re: [PATCH] IPROUTE2: Add addrlabel subsystem.
From: Jarek Poplawski @ 2008-02-02  9:43 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki / 吉藤英明; +Cc: shemminger, netdev
In-Reply-To: <20080201.065754.116071721.yoshfuji@linux-ipv6.org>

YOSHIFUJI Hideaki / 吉藤英明 wrote, On 01/31/2008 08:57 PM:

> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
> ---
>  include/linux/if_addrlabel.h |   32 +++++
>  ip/Makefile                  |    2 +-
>  ip/ip.c                      |    5 +-
>  ip/ip_common.h               |    4 +
>  ip/ipaddrlabel.c             |  260 ++++++++++++++++++++++++++++++++++++++++++
>  ip/ipmonitor.c               |    4 +
>  6 files changed, 304 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/if_addrlabel.h b/include/linux/if_addrlabel.h
> new file mode 100644
> index 0000000..9fe79c9
> --- /dev/null
> +++ b/include/linux/if_addrlabel.h
> @@ -0,0 +1,32 @@
> +/*
> + * if_addrlabel.h - netlink interface for address labels
> + *
> + * Copyright (C)2007 USAGI/WIDE Project,  All Rights Reserved.
> + *

Hi,

Is this statement GPL compatible? And, maybe you could add a few words
about this to man ip too?

Regards,
Jarek P.

^ permalink raw reply

* Re: Still oopsing in nf_nat_move_storage()
From: Patrick McHardy @ 2008-02-02 10:26 UTC (permalink / raw)
  To: Chuck Ebbert; +Cc: Netdev, Netfilter Development Mailinglist
In-Reply-To: <47A3AE41.6070104@redhat.com>

Chuck Ebbert wrote:
> On 01/31/2008 01:03 PM, Chuck Ebbert wrote:
>> On 01/29/2008 12:18 PM, Patrick McHardy wrote:
>>> Chuck Ebbert wrote:
>>>> nf_nat_move_storage():
>>>> /usr/src/debug/kernel-2.6.23/linux-2.6.23.i686/net/ipv4/netfilter/nf_nat_core.c:612
>>>>
>>>>       87:       f7 47 64 80 01 00 00    testl  $0x180,0x64(%edi)
>>>>       8e:       74 39                   je     c9
>>>> <nf_nat_move_storage+0x65>
>>>>
>>>> line 612:
>>>>         if (!(ct->status & IPS_NAT_DONE_MASK))
>>>>                 return;
>>>>
>>>> ct is NULL
>>> The current kernel (and 2.6.23-stable) have:
>>>
>>>         if (!ct || !(ct->status & IPS_NAT_DONE_MASK))
>>>                 return;
>>>
>>> so it seems you're using an old version.
> 
> So, it is now oopsing after the test for NULL and only x86_64 is
> catching the invalid address because it is non-canonical. Checking
> for NULL is obviously not enough...


The addresses passed to ->move seems to be bogus, we're doing:

           t->move(ct, ct->ext + ct->ext->offset[i]);

without assigning the new ct->ext first, which is wrong for
two reasons:

- the new ext hasn't been assigned to the conntrack yet,
   so its moving within the same extension

- ct->ext + ct->ext->offset[i] should be (void *)ct->ext + ...

I'll fix it and send a patch after some testing. Still wondering
why this wasn't noticed before.

^ permalink raw reply

* Re: kernel panic on 2.6.24 with esfq patch applied
From: Corey Hickey @ 2008-02-02 10:23 UTC (permalink / raw)
  To: Denys Fedoryshchenko; +Cc: netdev
In-Reply-To: <20080201131509.M52958@visp.net.lb>

Denys Fedoryshchenko wrote:
> Hi
> 
> Probably bug related to ESFQ, now i will unload module and will test more. 
> But probably not related, so if not difficult, please take a look.
> 
> Feb  1 09:08:50 SERVER [12380.067104] BUG: unable to handle kernel NULL 
> pointer dereference
> Feb  1 09:08:50 SERVER at virtual address 00000008
> Feb  1 09:08:50 SERVER [12380.067140] printing eip: c01f10ed
> Feb  1 09:08:50 SERVER *pde = 00000000
> Feb  1 09:08:50 SERVER
> Feb  1 09:08:50 SERVER [12380.067162] Oops: 0000 [#1]
> Feb  1 09:08:50 SERVER SMP
> Feb  1 09:08:50 SERVER
> Feb  1 09:08:50 SERVER [12380.067181] Modules linked in:
> Feb  1 09:08:50 SERVER netconsole
> Feb  1 09:08:50 SERVER configfs
> Feb  1 09:08:50 SERVER iTCO_wdt
> Feb  1 09:08:50 SERVER nf_nat_pptp
> Feb  1 09:08:50 SERVER nf_conntrack_pptp
> Feb  1 09:08:50 SERVER nf_conntrack_proto_gre
> Feb  1 09:08:50 SERVER nf_nat_proto_gre
> Feb  1 09:08:50 SERVER sch_esfq

I'd rather you were using my recent patches to SFQ instead of ESFQ. I
was able to crash a 2.6.24 user-mode Linux with ESFQ as well; I don't
know if that's what you encountered, but the SFQ patches should be
better anyway.

http://fatooh.org/esfq-2.6/sfq-2.6.24.tar.bz2
http://fatooh.org/esfq-2.6/

-Corey

^ permalink raw reply

* Re: [PATCHv2 2.6.24] fib: fix route replacement, fib_info is shared
From: Julian Anastasov @ 2008-02-02 10:56 UTC (permalink / raw)
  To: Jarek Poplawski; +Cc: David S. Miller, netdev, Joonwoo Park
In-Reply-To: <20080129095245.GA2570@ff.dom.local>


	Hello,

On Tue, 29 Jan 2008, Jarek Poplawski wrote:

> ...On the other hand, I wonder how bad would be switching these two
> to avoid this error? After all "replace" with this "add or change"
> meaning looks quite permissive, and after all it was used before with
> no such errors, so, even if correct, it could still break some
> scripts...

	Agreed, what could break are scripts that add 2 equal 
alternative routes and checking for errors. BTW, I tried to add
more information and that is what I have finally:

http://www.ssi.bg/~ja/fib.txt

Regards

--
Julian Anastasov <ja@ssi.bg>

^ permalink raw reply

* Re: Still oopsing in nf_nat_move_storage()
From: Patrick McHardy @ 2008-02-02 11:02 UTC (permalink / raw)
  To: Chuck Ebbert; +Cc: Netdev, Netfilter Development Mailinglist, Thomas Woerner
In-Reply-To: <47A3AE41.6070104@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 959 bytes --]

Chuck Ebbert wrote:
> On 01/31/2008 01:03 PM, Chuck Ebbert wrote:
>> On 01/29/2008 12:18 PM, Patrick McHardy wrote:
>>> Chuck Ebbert wrote:
>>>> nf_nat_move_storage():
>>>> /usr/src/debug/kernel-2.6.23/linux-2.6.23.i686/net/ipv4/netfilter/nf_nat_core.c:612
>>>>
>>>>       87:       f7 47 64 80 01 00 00    testl  $0x180,0x64(%edi)
>>>>       8e:       74 39                   je     c9
>>>> <nf_nat_move_storage+0x65>
>>>>
>>>> line 612:
>>>>         if (!(ct->status & IPS_NAT_DONE_MASK))
>>>>                 return;
>>>>
>>>> ct is NULL
>>> The current kernel (and 2.6.23-stable) have:
>>>
>>>         if (!ct || !(ct->status & IPS_NAT_DONE_MASK))
>>>                 return;
>>>
>>> so it seems you're using an old version.
> 
> So, it is now oopsing after the test for NULL and only x86_64 is
> catching the invalid address because it is non-canonical. Checking
> for NULL is obviously not enough...


Could you try whether this patch fixes it please?


[-- Attachment #2: x --]
[-- Type: text/plain, Size: 2518 bytes --]

commit 6953954cc566c19a84b7ca9647c16dabe4646c03
Author: Patrick McHardy <kaber@trash.net>
Date:   Sat Feb 2 12:01:03 2008 +0100

    [NETFILTER]: nf_conntrack: fix ct_extend ->move operation
    
    The ->move operation has two bugs:
    
    - It is called with the same extension as source and destination,
      so it doesn't update the new extension.
    
    - The address of the old extension is calculated incorrectly,
      instead of (void *)ct->ext + ct->ext->offset[i] it uses
      ct->ext + ct->ext->offset[i].
    
    Should fix a crash on x86_64 reported by Chuck Ebbert <cebbert@redhat.com>
    and Thomas Woerner <twoerner@redhat.com>.
    
    Signed-off-by: Patrick McHardy <kaber@trash.net>

diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h
index 73b5711..49aac63 100644
--- a/include/net/netfilter/nf_conntrack_extend.h
+++ b/include/net/netfilter/nf_conntrack_extend.h
@@ -67,7 +67,7 @@ struct nf_ct_ext_type
 	void (*destroy)(struct nf_conn *ct);
 	/* Called when realloacted (can be NULL).
 	   Contents has already been moved. */
-	void (*move)(struct nf_conn *ct, void *old);
+	void (*move)(void *new, void *old);
 
 	enum nf_ct_ext_id id;
 
diff --git a/net/ipv4/netfilter/nf_nat_core.c b/net/ipv4/netfilter/nf_nat_core.c
index dd07362..0d5fa3a 100644
--- a/net/ipv4/netfilter/nf_nat_core.c
+++ b/net/ipv4/netfilter/nf_nat_core.c
@@ -600,10 +600,10 @@ static void nf_nat_cleanup_conntrack(struct nf_conn *ct)
 	spin_unlock_bh(&nf_nat_lock);
 }
 
-static void nf_nat_move_storage(struct nf_conn *conntrack, void *old)
+static void nf_nat_move_storage(void *new, void *old)
 {
-	struct nf_conn_nat *new_nat = nf_ct_ext_find(conntrack, NF_CT_EXT_NAT);
-	struct nf_conn_nat *old_nat = (struct nf_conn_nat *)old;
+	struct nf_conn_nat *new_nat = new;
+	struct nf_conn_nat *old_nat = old;
 	struct nf_conn *ct = old_nat->ct;
 
 	if (!ct || !(ct->status & IPS_NAT_DONE_MASK))
diff --git a/net/netfilter/nf_conntrack_extend.c b/net/netfilter/nf_conntrack_extend.c
index cf6ba66..8b9be1e 100644
--- a/net/netfilter/nf_conntrack_extend.c
+++ b/net/netfilter/nf_conntrack_extend.c
@@ -109,7 +109,8 @@ void *__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp)
 			rcu_read_lock();
 			t = rcu_dereference(nf_ct_ext_types[i]);
 			if (t && t->move)
-				t->move(ct, ct->ext + ct->ext->offset[i]);
+				t->move((void *)new + new->offset[i],
+					(void *)ct->ext + ct->ext->offset[i]);
 			rcu_read_unlock();
 		}
 		kfree(ct->ext);

^ permalink raw reply related

* [PATCH] Unbreak sky2 on 88E8039 with current git
From: Petr Vandrovec @ 2008-02-02 10:52 UTC (permalink / raw)
  To: shemminger; +Cc: netdev, linux-kernel

Hello,
  since I synced my tree to Linus's one two days ago, sky2's packet receiption
dies almost instantly.  Device still transmits packets, but no receive.  
Fortunately fix is simple, unfortunately I do not know why fix works...

Commit f03b865491c2f30f2a4d77cdafc69c978ceb38a0 (sky2: align IP header on Rx
if possible) stopped aligning receive buffers on devices which do not need
HANG_CHECK.  Unfortunately there is at least one device (mine, Yukon FE, rev 3)
which is not happy if receive buffer is not aligned.  I have no idea which
other chips/revisions are affected as well.

Without patch 'ping -f -b 192.168.101.255' RX count stops incrementing in less
than 50 packets.  With patch in place it can run like before, for hours...
Box is an AMD rev F processor, with nVidia's MCP61 chipset.
							Petr

gwy:/home/petr# lspci -vv -s 4:0.0  
04:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8039 PCI-E Fast Ethernet Controller (rev 14)
        Subsystem: Elitegroup Computer Systems Unknown device 8039
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 377
        Region 0: Memory at fdcfc000 (64-bit, non-prefetchable) [size=16K]
        Region 2: I/O ports at 8c00 [size=256]
        Capabilities: [48] Power Management version 2
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
                Status: D0 PME-Enable- DSel=0 DScale=1 PME-
        Capabilities: [50] Vital Product Data <?>
        Capabilities: [5c] Message Signalled Interrupts: Mask- 64bit+ Queue=0/1 Enable+
                Address: 00000000fee0300c  Data: 41c9
        Capabilities: [e0] Express (v1) Legacy Endpoint, MSI 00
                DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
                        ExtTag- AttnBtn- AttnInd- PwrInd- RBE- FLReset-
                DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
                        RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
                        MaxPayload 128 bytes, MaxReadReq 512 bytes
                DevSta: CorrErr+ UncorrErr+ FatalErr- UnsuppReq+ AuxPwr+ TransPend-
                LnkCap: Port #1, Speed 2.5GT/s, Width x1, ASPM L0s, Latency L0 <256ns, L1 unlimited
                        ClockPM- Suprise- LLActRep- BwNot-
                LnkCtl: ASPM Disabled; RCB 128 bytes Disabled- Retrain- CommClk+
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
        Capabilities: [100] Advanced Error Reporting <?>
        Kernel driver in use: sky2
        Kernel modules: sky2


Yukon FE, rev 3 needs receive buffers aligned, otherwise receiver hangs
almost instantly.  They were aligned before, so let's start aligning
them again - a bit suboptimal networking is much better than no networking
at all.

Signed-off-by: Petr Vandrovec <petr@vandrovec.name>

diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -1192,7 +1192,7 @@ static struct sk_buff *sky2_rx_alloc(struct sky2_port *sky2)
 	struct sk_buff *skb;
 	int i;
 
-	if (sky2->hw->flags & SKY2_HW_FIFO_HANG_CHECK) {
+	if (sky2->hw->flags & SKY2_HW_FIFO_RX_ALIGN) {
 		unsigned char *start;
 		/*
 		 * Workaround for a bug in FIFO that cause hang
@@ -2718,7 +2718,7 @@ static int __devinit sky2_init(struct sky2_hw *hw)
 		hw->flags = SKY2_HW_GIGABIT
 			| SKY2_HW_NEWER_PHY;
 		if (hw->chip_rev < 3)
-			hw->flags |= SKY2_HW_FIFO_HANG_CHECK;
+			hw->flags |= SKY2_HW_FIFO_HANG_CHECK | SKY2_HW_FIFO_RX_ALIGN;
 
 		break;
 
@@ -2745,10 +2745,12 @@ static int __devinit sky2_init(struct sky2_hw *hw)
 			dev_err(&hw->pdev->dev, "unsupported revision Yukon-EC rev A1\n");
 			return -EOPNOTSUPP;
 		}
-		hw->flags = SKY2_HW_GIGABIT | SKY2_HW_FIFO_HANG_CHECK;
+		hw->flags = SKY2_HW_GIGABIT | SKY2_HW_FIFO_HANG_CHECK | SKY2_HW_FIFO_RX_ALIGN;
 		break;
 
 	case CHIP_ID_YUKON_FE:
+		if (hw->chip_rev == 3)
+			hw->flags |= SKY2_HW_FIFO_RX_ALIGN;
 		break;
 
 	case CHIP_ID_YUKON_FE_P:
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
index 2bced1a..b5c1457 100644
--- a/drivers/net/sky2.h
+++ b/drivers/net/sky2.h
@@ -2049,6 +2049,7 @@ struct sky2_hw {
 #define SKY2_HW_NEW_LE		0x00000020	/* new LSOv2 format */
 #define SKY2_HW_AUTO_TX_SUM	0x00000040	/* new IP decode for Tx */
 #define SKY2_HW_ADV_POWER_CTL	0x00000080	/* additional PHY power regs */
+#define SKY2_HW_FIFO_RX_ALIGN	0x00000100
 
 	u8	     	     chip_id;
 	u8		     chip_rev;

^ permalink raw reply related

* [PATCH] NOTRACK only untracked
From: Dzianis Kahanovich @ 2008-02-02 16:58 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 480 bytes --]

There are modification of NOTRACK netfilter target to avoid creating new 
connection entries for packets, unrelated to any existing connection.

Best way to make new target (clone NOTRACK to NOTRACK-NEW and fix - to mix 
both), but I have enough motivation to this work ;)

PS There are not same patch with netfilter@vger.kernel.org. Verifyed and 
fixed. (& net-2.6.25)

PPS Idea about u32 was bad. Sorry.

-- 
WBR,
Denis Kaganovich,  mahatma@eu.by  http://mahatma.bspu.unibel.by

[-- Attachment #2: notrack-new.patch --]
[-- Type: text/plain, Size: 3131 bytes --]

diff -pruN net-2.6.orig/net/netfilter/Kconfig net-2.6.fixed/net/netfilter/Kconfig
--- net-2.6.orig/net/netfilter/Kconfig	2008-01-30 20:17:08.000000000 +0200
+++ net-2.6.fixed/net/netfilter/Kconfig	2008-02-02 14:37:22.000000000 +0200
@@ -375,6 +375,12 @@ config NETFILTER_XT_TARGET_NOTRACK
 	  If you want to compile it as a module, say M here and read
 	  <file:Documentation/kbuild/modules.txt>.  If unsure, say `N'.
 
+config NETFILTER_XT_TARGET_NOTRACK_NEW
+	bool "NOTRACK safe (only new)"
+	depends on NETFILTER_XT_TARGET_NOTRACK
+	help
+	  Slow but safe way to NOTRACK only new/untracked connections.
+
 config NETFILTER_XT_TARGET_RATEEST
 	tristate '"RATEEST" target support'
 	depends on NETFILTER_XTABLES
diff -pruN net-2.6.orig/net/netfilter/nf_conntrack_core.c net-2.6.fixed/net/netfilter/nf_conntrack_core.c
--- net-2.6.orig/net/netfilter/nf_conntrack_core.c	2008-01-30 20:17:08.000000000 +0200
+++ net-2.6.fixed/net/netfilter/nf_conntrack_core.c	2008-02-02 14:22:53.000000000 +0200
@@ -587,6 +587,9 @@ resolve_normal_ct(struct sk_buff *skb,
 	struct nf_conntrack_tuple tuple;
 	struct nf_conntrack_tuple_hash *h;
 	struct nf_conn *ct;
+#ifdef CONFIG_NETFILTER_XT_TARGET_NOTRACK_NEW
+	struct nf_conntrack_expect *exp;
+#endif
 
 	if (!nf_ct_get_tuple(skb, skb_network_offset(skb),
 			     dataoff, l3num, protonum, &tuple, l3proto,
@@ -598,6 +601,17 @@ resolve_normal_ct(struct sk_buff *skb,
 	/* look for tuple match */
 	h = nf_conntrack_find_get(&tuple);
 	if (!h) {
+#ifdef CONFIG_NETFILTER_XT_TARGET_NOTRACK_NEW
+		if(skb->nfctinfo == IP_CT_NEW) {
+		    exp = nf_ct_expect_find_get(&tuple);
+		    if(!exp){
+			skb->nfct = &nf_conntrack_untracked.ct_general;
+			nf_conntrack_get(skb->nfct);
+			return NULL;
+		    }
+		    nf_ct_expect_put(exp);
+		}
+#endif
 		h = init_conntrack(&tuple, l3proto, l4proto, skb, dataoff);
 		if (!h)
 			return NULL;
@@ -675,6 +689,12 @@ nf_conntrack_in(int pf, unsigned int hoo
 	ct = resolve_normal_ct(skb, dataoff, pf, protonum, l3proto, l4proto,
 			       &set_reply, &ctinfo);
 	if (!ct) {
+#ifdef CONFIG_NETFILTER_XT_TARGET_NOTRACK_NEW
+		if(skb->nfct == &nf_conntrack_untracked.ct_general){
+		    NF_CT_STAT_INC_ATOMIC(ignore);
+		    return NF_ACCEPT;
+		}
+#endif
 		/* Not valid part of a connection */
 		NF_CT_STAT_INC_ATOMIC(invalid);
 		return NF_ACCEPT;
diff -pruN net-2.6.orig/net/netfilter/xt_NOTRACK.c net-2.6.fixed/net/netfilter/xt_NOTRACK.c
--- net-2.6.orig/net/netfilter/xt_NOTRACK.c	2008-01-30 20:17:08.000000000 +0200
+++ net-2.6.fixed/net/netfilter/xt_NOTRACK.c	2008-02-02 14:22:02.000000000 +0200
@@ -21,6 +21,9 @@ notrack_tg(struct sk_buff *skb, const st
 	if (skb->nfct != NULL)
 		return XT_CONTINUE;
 
+#ifdef CONFIG_NETFILTER_XT_TARGET_NOTRACK_NEW
+	skb->nfctinfo = IP_CT_NEW;
+#else
 	/* Attach fake conntrack entry.
 	   If there is a real ct entry correspondig to this packet,
 	   it'll hang aroun till timing out. We don't deal with it
@@ -28,6 +31,7 @@ notrack_tg(struct sk_buff *skb, const st
 	skb->nfct = &nf_conntrack_untracked.ct_general;
 	skb->nfctinfo = IP_CT_NEW;
 	nf_conntrack_get(skb->nfct);
+#endif
 
 	return XT_CONTINUE;
 }

^ permalink raw reply

* Re: [PATCH] sis190: fix compile error section type conflict
From: Francois Romieu @ 2008-02-02 14:34 UTC (permalink / raw)
  To: Li Zefan; +Cc: netdev, LKML, jgarzik, Sam Ravnborg
In-Reply-To: <47A3FF3F.1040908@cn.fujitsu.com>

Li Zefan <lizf@cn.fujitsu.com> :
> Fix the following compile error:

I am not sure that it is the right fix. Please read the archive of
this week on l-k.

I'll submit the patch below to Jeff once I have tested it with real
hardware (sunday evening entertainment). Sam, is it ok to add your
s-o-b to it ?

Subject: [PATCH] sis190: fix section type conflict

The driver already contains __devinitdata which is not const.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Michael D. Setzer II <mikes@kuentos.guam.net>
Cc: Gabriel C <nix.or.die@googlemail.com>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Jan Engelhardt <jengelh@computergmbh.de>
Cc: Li Zefan <lizf@cn.fujitsu.com>
---
 drivers/net/sis190.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index b570402..0a5e024 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -1556,7 +1556,7 @@ static int __devinit sis190_get_mac_addr_from_eeprom(struct pci_dev *pdev,
 static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev,
 						  struct net_device *dev)
 {
-	static const u16 __devinitdata ids[] = { 0x0965, 0x0966, 0x0968 };
+	static const u16 __devinitconst ids[] = { 0x0965, 0x0966, 0x0968 };
 	struct sis190_private *tp = netdev_priv(dev);
 	struct pci_dev *isa_bridge;
 	u8 reg, tmp8;
-- 
1.5.3.3

^ permalink raw reply related

* Re: [PATCH] sis190: fix compile error section type conflict
From: Sam Ravnborg @ 2008-02-02 15:34 UTC (permalink / raw)
  To: Francois Romieu; +Cc: Li Zefan, netdev, LKML, jgarzik
In-Reply-To: <20080202143458.GA27978@electric-eye.fr.zoreil.com>

On Sat, Feb 02, 2008 at 03:34:58PM +0100, Francois Romieu wrote:
> Li Zefan <lizf@cn.fujitsu.com> :
> > Fix the following compile error:
> 
> I am not sure that it is the right fix. Please read the archive of
> this week on l-k.
> 
> I'll submit the patch below to Jeff once I have tested it with real
> hardware (sunday evening entertainment). Sam, is it ok to add your
> s-o-b to it ?
No - a s-o-b document the path of the patch. And it will not hit
Jeff via me. Although I know I said ths was to way to do it.
But you can add my:
Acked-by: Sam Ravnborg <sam@ravnborg.org>

If I posted the patch myself I do not remember - but then the s-o-b
would be correct.

	Sam

^ permalink raw reply

* FW: r8169 auto-negotiation problem
From: fgnijuhhu guduggurehug @ 2008-02-02 17:46 UTC (permalink / raw)
  To: netdev


Hello

I already posted my problem and what I did to solve it on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=461429 . In essence the 6.004.00-NAPI version from the Realtek site fixed it until now. My request is only that you try to get this version included in the kernel.
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

^ permalink raw reply

* [PATCH] [RFC] 3c509: convert to isa_driver and pnp_driver v2
From: Ondrej Zary @ 2008-02-02 18:25 UTC (permalink / raw)
  To: netdev; +Cc: Linux Kernel
In-Reply-To: <200801312012.43447.linux@rainbow-software.org>

Hello,
this is second version of the patch. Autoloading using udev works fine with 
PnP card. Hibernation now works both in PnP and ISA modes. The I/O address 
used for non-pnp ISA card detection is now not released as it's needed to 
wake up the card.

Manual irq and transceiver settings aren't implemented yet. Operation with 
multiple cards is not tested - I'll try 3 cards in both PnP and ISA modes. 
There is some code that is the same in each of the 4 probe functions (isa, 
pnp, eisa and mca), which should be probably separated into a function.

I have no EISA or MCA machine so I hope that I didn't break them.

--- linux-2.6.24-orig/drivers/net/3c509.c	2008-01-27 19:48:19.000000000 +0100
+++ linux-2.6.24-pentium/drivers/net/3c509.c	2008-02-02 14:01:04.000000000 +0100
@@ -69,10 +69,9 @@
 static int max_interrupt_work = 10;
 
 #include <linux/module.h>
-#ifdef CONFIG_MCA
 #include <linux/mca.h>
-#endif
-#include <linux/isapnp.h>
+#include <linux/isa.h>
+#include <linux/pnp.h>
 #include <linux/string.h>
 #include <linux/interrupt.h>
 #include <linux/errno.h>
@@ -97,20 +96,17 @@
 
 static char version[] __initdata = DRV_NAME ".c:" DRV_VERSION " " DRV_RELDATE " becker@scyld.com\n";
 
-#if defined(CONFIG_PM) && (defined(CONFIG_MCA) || defined(CONFIG_EISA))
-#define EL3_SUSPEND
-#endif
-
 #ifdef EL3_DEBUG
 static int el3_debug = EL3_DEBUG;
 #else
-static int el3_debug = 2;
+static int el3_debug = 20;
 #endif
 
 /* Used to do a global count of all the cards in the system.  Must be
  * a global variable so that the mca/eisa probe routines can increment
  * it */
 static int el3_cards = 0;
+#define EL3_MAX_CARDS 8
 
 /* To minimize the size of the driver source I only define operating
    constants if they are used several times.  You'll need the manual
@@ -119,7 +115,7 @@
 #define EL3_DATA 0x00
 #define EL3_CMD 0x0e
 #define EL3_STATUS 0x0e
-#define	 EEPROM_READ 0x80
+#define	EEPROM_READ 0x80
 
 #define EL3_IO_EXTENT	16
 
@@ -170,7 +166,6 @@
 
 struct el3_private {
 	struct net_device_stats stats;
-	struct net_device *next_dev;
 	spinlock_t lock;
 	/* skb send-queue */
 	int head, size;
@@ -179,12 +174,29 @@
 		EL3_MCA,
 		EL3_PNP,
 		EL3_EISA,
+		EL3_ISA,
 	} type;						/* type of device */
 	struct device *dev;
 };
-static int id_port __initdata = 0x110;	/* Start with 0x110 to avoid new sound cards.*/
-static struct net_device *el3_root_dev;
+static int id_port;
+static struct net_device *el3_devs[EL3_MAX_CARDS];
+//static __be16 el3_phys_addr[EL3_MAX_CARDS][3];
+
+static int isa_registered;
+#ifdef CONFIG_PNP
+static int pnp_registered;
+static int nopnp;
+#endif
+#ifdef CONFIG_EISA
+static int eisa_registered;
+#endif
+#ifdef CONFIG_MCA
+static int mca_registered;
+#endif
+
 
+static int __init el3_common_init(struct net_device *dev);
+static void el3_common_remove (struct net_device *dev);
 static ushort id_read_eeprom(int index);
 static ushort read_eeprom(int ioaddr, int index);
 static int el3_open(struct net_device *dev);
@@ -199,23 +211,301 @@
 static void el3_down(struct net_device *dev);
 static void el3_up(struct net_device *dev);
 static const struct ethtool_ops ethtool_ops;
-#ifdef EL3_SUSPEND
+#ifdef CONFIG_PM
 static int el3_suspend(struct device *, pm_message_t);
 static int el3_resume(struct device *);
-#else
-#define el3_suspend NULL
-#define el3_resume NULL
 #endif
 
 
 /* generic device remove for all device types */
-#if defined(CONFIG_EISA) || defined(CONFIG_MCA)
 static int el3_device_remove (struct device *device);
-#endif
 #ifdef CONFIG_NET_POLL_CONTROLLER
 static void el3_poll_controller(struct net_device *dev);
 #endif
 
+#ifdef CONFIG_ISA
+static int __devinit el3_isa_match(struct device *pdev,
+				   unsigned int ndev)
+{
+	struct net_device *dev;
+	struct el3_private *lp;
+	short lrs_state = 0xff, i;
+	int ioaddr, irq, if_port;
+	__be16 phys_addr[3];
+	static int current_tag;
+
+	if (!id_port) {
+		/* Select an open I/O location at 0x1*0 to do contention select. */
+		/* Start with 0x110 to avoid new sound cards.*/
+		for (id_port = 0x110 ; id_port < 0x200; id_port += 0x10) {
+			if (!request_region(id_port, 1, "3c509-control"))
+				continue;
+			outb(0x00, id_port);
+			outb(0xff, id_port);
+			if (inb(id_port) & 0x01)
+				break;
+			else
+				release_region(id_port, 1);
+		}
+		if (id_port >= 0x200) {
+			id_port = 0;
+			printk(" WARNING: No I/O port available for 3c509 activation.\n");
+			return 0;
+		}
+	}
+again:
+	/* Next check for all ISA bus boards by sending the ID sequence to the
+	   ID_PORT.  We find cards past the first by setting the 'current_tag'
+	   on cards as they are found.  Cards with their tag set will not
+	   respond to subsequent ID sequences. */
+
+	outb(0x00, id_port);
+	outb(0x00, id_port);
+	for(i = 0; i < 255; i++) {
+		outb(lrs_state, id_port);
+		lrs_state <<= 1;
+		lrs_state = lrs_state & 0x100 ? lrs_state ^ 0xcf : lrs_state;
+	}
+
+	/* For the first probe, clear all board's tag registers. */
+	if (current_tag == 0)
+		outb(0xd0, id_port);
+	else				/* Otherwise kill off already-found boards. */
+		outb(0xd8, id_port);
+
+	if (id_read_eeprom(7) != 0x6d50)
+		return 0;
+
+	/* Read in EEPROM data, which does contention-select.
+	   Only the lowest address board will stay "on-line".
+	   3Com got the byte order backwards. */
+	for (i = 0; i < 3; i++)
+		phys_addr[i] = htons(id_read_eeprom(i));
+
+#ifdef CONFIG_PNP
+	if (!nopnp) {
+		/* The ISA PnP 3c509 cards respond to the ID sequence too.
+		   This check is needed in order not to register them twice. */
+		for (i = 0; i < el3_cards; i++) {
+			if (!memcmp(phys_addr, el3_devs[i]->dev_addr, ETH_ALEN))
+			{
+				if (el3_debug > 3)
+					printk("3c509 with address %02x %02x %02x %02x %02x %02x was found by ISAPnP\n",
+						phys_addr[0] & 0xff, phys_addr[0] >> 8,
+						phys_addr[1] & 0xff, phys_addr[1] >> 8,
+						phys_addr[2] & 0xff, phys_addr[2] >> 8);
+				/* Set the adaptor tag so that the next card can be found. */
+				outb(0xd0 + ++current_tag, id_port);
+				goto again;
+			}
+		}
+	}
+#endif /* CONFIG_PNP */
+
+	{
+		unsigned int iobase = id_read_eeprom(8);
+		if_port = iobase >> 14;
+		ioaddr = 0x200 + ((iobase & 0x1f) << 4);
+	}
+	irq = id_read_eeprom(9) >> 12;
+
+	dev = alloc_etherdev(sizeof (struct el3_private));
+	if (!dev)
+		return -ENOMEM;
+
+	netdev_boot_setup_check(dev);
+
+	/* Set passed-in IRQ or I/O Addr. */
+	if (dev->irq > 1 && dev->irq < 16)
+			irq = dev->irq;
+
+	if (dev->base_addr) {
+		if (dev->mem_end == 0x3c509 	/* Magic key */
+		    && dev->base_addr >= 0x200  &&  dev->base_addr <= 0x3e0)
+			ioaddr = dev->base_addr & 0x3f0;
+		else if (dev->base_addr != ioaddr) {
+			free_netdev(dev);
+			return 0;
+		}
+	}
+
+	if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509-isa")) {
+		free_netdev(dev);
+		return 0;
+	}
+
+	/* Set the adaptor tag so that the next card can be found. */
+	outb(0xd0 + ++current_tag, id_port);
+
+	/* Activate the adaptor at the EEPROM location. */
+	outb((ioaddr >> 4) | 0xe0, id_port);
+
+	EL3WINDOW(0);
+	if (inw(ioaddr) != 0x6d50) {
+		free_netdev(dev);
+		return 0;
+	}
+
+	/* Free the interrupt so that some other card can use it. */
+	outw(0x0f00, ioaddr + WN0_IRQ);
+
+
+	memcpy(dev->dev_addr, phys_addr, sizeof(phys_addr));
+	dev->base_addr = ioaddr;
+	dev->irq = irq;
+	dev->if_port = if_port;
+	lp = netdev_priv(dev);
+	lp->type = EL3_ISA;
+	lp->dev = pdev;
+	dev_set_drvdata(pdev, dev);
+	if (el3_common_init(dev)) {
+		free_netdev(dev);
+		return 0;
+	}
+
+	el3_devs[el3_cards] = dev;
+	el3_cards++;
+	return 1;
+}
+
+static int __devexit el3_isa_remove(struct device *pdev,
+				    unsigned int ndev)
+{
+	el3_device_remove(pdev);
+	dev_set_drvdata(pdev, NULL);
+	return 0;
+}
+
+#ifdef CONFIG_PM
+static int el3_isa_suspend(struct device *dev, unsigned int n,
+			   pm_message_t state)
+{
+	int ret = el3_suspend(dev, state);
+	return ret;
+}
+
+static int el3_isa_resume(struct device *dev, unsigned int n)
+{
+	short lrs_state = 0xff, i;
+	struct net_device *ndev = dev_get_drvdata(dev);
+
+	/* Repeat the ID sequence */
+	outb(0x00, id_port);
+	outb(0x00, id_port);
+	for(i = 0; i < 255; i++) {
+		outb(lrs_state, id_port);
+		lrs_state <<= 1;
+		lrs_state = lrs_state & 0x100 ? lrs_state ^ 0xcf : lrs_state;
+	}
+	/* Enable the card */
+	outb((ndev->base_addr >> 4) | 0xe0, id_port);
+	return el3_resume(dev);
+}
+#endif
+
+static struct isa_driver el3_isa_driver = {
+	.match		= el3_isa_match,
+	.remove		= __devexit_p(el3_isa_remove),
+#ifdef CONFIG_PM
+	.suspend	= el3_isa_suspend,
+	.resume		= el3_isa_resume,
+#endif
+	.driver		= {
+		.name	= "3c509"
+	},
+};
+#endif
+
+#ifdef CONFIG_PNP
+static struct pnp_device_id el3_pnp_ids[] = {
+	{ .id = "TCM5090" }, /* 3Com Etherlink III (TP) */
+	{ .id = "TCM5091" }, /* 3Com Etherlink III */
+	{ .id = "TCM5094" }, /* 3Com Etherlink III (combo) */
+	{ .id = "TCM5095" }, /* 3Com Etherlink III (TPO) */
+	{ .id = "TCM5098" }, /* 3Com Etherlink III (TPC) */
+	{ .id = "PNP80f7" }, /* 3Com Etherlink III compatible */
+	{ .id = "PNP80f8" }, /* 3Com Etherlink III compatible */
+	{ .id = "" }
+};
+MODULE_DEVICE_TABLE(pnp, el3_pnp_ids);
+
+static int __devinit el3_pnp_probe(struct pnp_dev *pdev,
+				    const struct pnp_device_id *id)
+{
+	struct el3_private *lp;
+	short i;
+	int ioaddr, irq, if_port;
+	u16 phys_addr[3];
+	struct net_device *dev = NULL;
+	int err;
+
+	ioaddr = pnp_port_start(pdev, 0);
+	if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509-pnp"))
+		return -EBUSY;
+	irq = pnp_irq(pdev, 0);
+	EL3WINDOW(0);
+	for (i = 0; i < 3; i++)
+		phys_addr[i] = htons(read_eeprom(ioaddr, i));
+	if_port = read_eeprom(ioaddr, 8) >> 14;
+	dev = alloc_etherdev(sizeof (struct el3_private));
+	if (!dev) {
+		release_region(ioaddr, EL3_IO_EXTENT);
+		return -ENOMEM;
+	}
+	SET_NETDEV_DEV(dev, &pdev->dev);
+	netdev_boot_setup_check(dev);
+
+	memcpy(dev->dev_addr, phys_addr, sizeof(phys_addr));
+	dev->base_addr = ioaddr;
+	dev->irq = irq;
+	dev->if_port = if_port;
+	lp = netdev_priv(dev);
+	lp->dev = &pdev->dev;
+	lp->type = EL3_PNP;
+	pnp_set_drvdata (pdev, dev);
+	err = el3_common_init(dev);
+
+	if (err) {
+		pnp_set_drvdata (pdev, NULL);
+		free_netdev(dev);
+		return err;
+	}
+
+	el3_devs[el3_cards] = dev;
+	el3_cards++;
+	return 0;
+}
+
+static void __devexit el3_pnp_remove(struct pnp_dev *pdev)
+{
+	el3_common_remove(pnp_get_drvdata(pdev));
+	pnp_set_drvdata(pdev, NULL);
+}
+
+#ifdef CONFIG_PM
+static int el3_pnp_suspend(struct pnp_dev *pdev, pm_message_t state)
+{
+	return el3_suspend(&pdev->dev, state);
+}
+
+static int el3_pnp_resume(struct pnp_dev *pdev)
+{
+	return el3_resume(&pdev->dev);
+}
+#endif
+
+static struct pnp_driver el3_pnp_driver = {
+	.name		= "3c509",
+	.id_table	= el3_pnp_ids,
+	.probe		= el3_pnp_probe,
+	.remove		= __devexit_p(el3_pnp_remove),
+#ifdef CONFIG_PM
+	.suspend	= el3_pnp_suspend,
+	.resume		= el3_pnp_resume,
+#endif
+};
+#endif /* CONFIG_PNP */
+
 #ifdef CONFIG_EISA
 static struct eisa_device_id el3_eisa_ids[] = {
 		{ "TCM5092" },
@@ -273,43 +563,6 @@
 };
 #endif /* CONFIG_MCA */
 
-#if defined(__ISAPNP__)
-static struct isapnp_device_id el3_isapnp_adapters[] __initdata = {
-	{	ISAPNP_ANY_ID, ISAPNP_ANY_ID,
-		ISAPNP_VENDOR('T', 'C', 'M'), ISAPNP_FUNCTION(0x5090),
-		(long) "3Com Etherlink III (TP)" },
-	{	ISAPNP_ANY_ID, ISAPNP_ANY_ID,
-		ISAPNP_VENDOR('T', 'C', 'M'), ISAPNP_FUNCTION(0x5091),
-		(long) "3Com Etherlink III" },
-	{	ISAPNP_ANY_ID, ISAPNP_ANY_ID,
-		ISAPNP_VENDOR('T', 'C', 'M'), ISAPNP_FUNCTION(0x5094),
-		(long) "3Com Etherlink III (combo)" },
-	{	ISAPNP_ANY_ID, ISAPNP_ANY_ID,
-		ISAPNP_VENDOR('T', 'C', 'M'), ISAPNP_FUNCTION(0x5095),
-		(long) "3Com Etherlink III (TPO)" },
-	{	ISAPNP_ANY_ID, ISAPNP_ANY_ID,
-		ISAPNP_VENDOR('T', 'C', 'M'), ISAPNP_FUNCTION(0x5098),
-		(long) "3Com Etherlink III (TPC)" },
-	{	ISAPNP_ANY_ID, ISAPNP_ANY_ID,
-		ISAPNP_VENDOR('P', 'N', 'P'), ISAPNP_FUNCTION(0x80f7),
-		(long) "3Com Etherlink III compatible" },
-	{	ISAPNP_ANY_ID, ISAPNP_ANY_ID,
-		ISAPNP_VENDOR('P', 'N', 'P'), ISAPNP_FUNCTION(0x80f8),
-		(long) "3Com Etherlink III compatible" },
-	{ }	/* terminate list */
-};
-
-static __be16 el3_isapnp_phys_addr[8][3];
-static int nopnp;
-#endif /* __ISAPNP__ */
-
-/* With the driver model introduction for EISA devices, both init
- * and cleanup have been split :
- * - EISA devices probe/remove starts in el3_eisa_probe/el3_device_remove
- * - MCA/ISA still use el3_probe
- *
- * Both call el3_common_init/el3_common_remove. */
-
 static int __init el3_common_init(struct net_device *dev)
 {
 	struct el3_private *lp = netdev_priv(dev);
@@ -373,218 +626,6 @@
 	free_netdev (dev);
 }
 
-static int __init el3_probe(int card_idx)
-{
-	struct net_device *dev;
-	struct el3_private *lp;
-	short lrs_state = 0xff, i;
-	int ioaddr, irq, if_port;
-	__be16 phys_addr[3];
-	static int current_tag;
-	int err = -ENODEV;
-#if defined(__ISAPNP__)
-	static int pnp_cards;
-	struct pnp_dev *idev = NULL;
-	int pnp_found = 0;
-
-	if (nopnp == 1)
-		goto no_pnp;
-
-	for (i=0; el3_isapnp_adapters[i].vendor != 0; i++) {
-		int j;
-		while ((idev = pnp_find_dev(NULL,
-					    el3_isapnp_adapters[i].vendor,
-					    el3_isapnp_adapters[i].function,
-					    idev))) {
-			if (pnp_device_attach(idev) < 0)
-				continue;
-			if (pnp_activate_dev(idev) < 0) {
-__again:
-				pnp_device_detach(idev);
-				continue;
-			}
-			if (!pnp_port_valid(idev, 0) || !pnp_irq_valid(idev, 0))
-				goto __again;
-			ioaddr = pnp_port_start(idev, 0);
-			if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509 PnP")) {
-				pnp_device_detach(idev);
-				return -EBUSY;
-			}
-			irq = pnp_irq(idev, 0);
-			if (el3_debug > 3)
-				printk ("ISAPnP reports %s at i/o 0x%x, irq %d\n",
-					(char*) el3_isapnp_adapters[i].driver_data, ioaddr, irq);
-			EL3WINDOW(0);
-			for (j = 0; j < 3; j++)
-				el3_isapnp_phys_addr[pnp_cards][j] =
-					phys_addr[j] =
-						htons(read_eeprom(ioaddr, j));
-			if_port = read_eeprom(ioaddr, 8) >> 14;
-			dev = alloc_etherdev(sizeof (struct el3_private));
-			if (!dev) {
-					release_region(ioaddr, EL3_IO_EXTENT);
-					pnp_device_detach(idev);
-					return -ENOMEM;
-			}
-
-			SET_NETDEV_DEV(dev, &idev->dev);
-			pnp_cards++;
-
-			netdev_boot_setup_check(dev);
-			pnp_found = 1;
-			goto found;
-		}
-	}
-no_pnp:
-#endif /* __ISAPNP__ */
-
-	/* Select an open I/O location at 0x1*0 to do contention select. */
-	for ( ; id_port < 0x200; id_port += 0x10) {
-		if (!request_region(id_port, 1, "3c509"))
-			continue;
-		outb(0x00, id_port);
-		outb(0xff, id_port);
-		if (inb(id_port) & 0x01){
-			release_region(id_port, 1);
-			break;
-		} else
-			release_region(id_port, 1);
-	}
-	if (id_port >= 0x200) {
-		/* Rare -- do we really need a warning? */
-		printk(" WARNING: No I/O port available for 3c509 activation.\n");
-		return -ENODEV;
-	}
-
-	/* Next check for all ISA bus boards by sending the ID sequence to the
-	   ID_PORT.  We find cards past the first by setting the 'current_tag'
-	   on cards as they are found.  Cards with their tag set will not
-	   respond to subsequent ID sequences. */
-
-	outb(0x00, id_port);
-	outb(0x00, id_port);
-	for(i = 0; i < 255; i++) {
-		outb(lrs_state, id_port);
-		lrs_state <<= 1;
-		lrs_state = lrs_state & 0x100 ? lrs_state ^ 0xcf : lrs_state;
-	}
-
-	/* For the first probe, clear all board's tag registers. */
-	if (current_tag == 0)
-		outb(0xd0, id_port);
-	else				/* Otherwise kill off already-found boards. */
-		outb(0xd8, id_port);
-
-	if (id_read_eeprom(7) != 0x6d50) {
-		return -ENODEV;
-	}
-
-	/* Read in EEPROM data, which does contention-select.
-	   Only the lowest address board will stay "on-line".
-	   3Com got the byte order backwards. */
-	for (i = 0; i < 3; i++) {
-		phys_addr[i] = htons(id_read_eeprom(i));
-	}
-
-#if defined(__ISAPNP__)
-	if (nopnp == 0) {
-		/* The ISA PnP 3c509 cards respond to the ID sequence.
-		   This check is needed in order not to register them twice. */
-		for (i = 0; i < pnp_cards; i++) {
-			if (phys_addr[0] == el3_isapnp_phys_addr[i][0] &&
-			    phys_addr[1] == el3_isapnp_phys_addr[i][1] &&
-			    phys_addr[2] == el3_isapnp_phys_addr[i][2])
-			{
-				if (el3_debug > 3)
-					printk("3c509 with address %02x %02x %02x %02x %02x %02x was found by ISAPnP\n",
-						phys_addr[0] & 0xff, phys_addr[0] >> 8,
-						phys_addr[1] & 0xff, phys_addr[1] >> 8,
-						phys_addr[2] & 0xff, phys_addr[2] >> 8);
-				/* Set the adaptor tag so that the next card can be found. */
-				outb(0xd0 + ++current_tag, id_port);
-				goto no_pnp;
-			}
-		}
-	}
-#endif /* __ISAPNP__ */
-
-	{
-		unsigned int iobase = id_read_eeprom(8);
-		if_port = iobase >> 14;
-		ioaddr = 0x200 + ((iobase & 0x1f) << 4);
-	}
-	irq = id_read_eeprom(9) >> 12;
-
-	dev = alloc_etherdev(sizeof (struct el3_private));
-	if (!dev)
-		return -ENOMEM;
-
-	netdev_boot_setup_check(dev);
-
-	/* Set passed-in IRQ or I/O Addr. */
-	if (dev->irq > 1  &&  dev->irq < 16)
-			irq = dev->irq;
-
-	if (dev->base_addr) {
-		if (dev->mem_end == 0x3c509 	/* Magic key */
-		    && dev->base_addr >= 0x200  &&  dev->base_addr <= 0x3e0)
-			ioaddr = dev->base_addr & 0x3f0;
-		else if (dev->base_addr != ioaddr)
-			goto out;
-	}
-
-	if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509")) {
-		err = -EBUSY;
-		goto out;
-	}
-
-	/* Set the adaptor tag so that the next card can be found. */
-	outb(0xd0 + ++current_tag, id_port);
-
-	/* Activate the adaptor at the EEPROM location. */
-	outb((ioaddr >> 4) | 0xe0, id_port);
-
-	EL3WINDOW(0);
-	if (inw(ioaddr) != 0x6d50)
-		goto out1;
-
-	/* Free the interrupt so that some other card can use it. */
-	outw(0x0f00, ioaddr + WN0_IRQ);
-
-#if defined(__ISAPNP__)
- found:							/* PNP jumps here... */
-#endif /* __ISAPNP__ */
-
-	memcpy(dev->dev_addr, phys_addr, sizeof(phys_addr));
-	dev->base_addr = ioaddr;
-	dev->irq = irq;
-	dev->if_port = if_port;
-	lp = netdev_priv(dev);
-#if defined(__ISAPNP__)
-	lp->dev = &idev->dev;
-	if (pnp_found)
-		lp->type = EL3_PNP;
-#endif
-	err = el3_common_init(dev);
-
-	if (err)
-		goto out1;
-
-	el3_cards++;
-	lp->next_dev = el3_root_dev;
-	el3_root_dev = dev;
-	return 0;
-
-out1:
-#if defined(__ISAPNP__)
-	if (idev)
-		pnp_device_detach(idev);
-#endif
-out:
-	free_netdev(dev);
-	return err;
-}
-
 #ifdef CONFIG_MCA
 static int __init el3_mca_probe(struct device *device)
 {
@@ -678,7 +719,7 @@
 	edev = to_eisa_device (device);
 	ioaddr = edev->base_addr;
 
-	if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509"))
+	if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509-eisa"))
 		return -EBUSY;
 
 	/* Change the register set to the configuration window 0. */
@@ -721,10 +762,10 @@
 }
 #endif
 
-#if defined(CONFIG_EISA) || defined(CONFIG_MCA)
 /* This remove works for all device types.
  *
  * The net dev must be stored in the driver_data field */
+//#if defined(CONFIG_MCA) || defined(CONFIG_EISA)
 static int __devexit el3_device_remove (struct device *device)
 {
 	struct net_device *dev;
@@ -734,7 +775,7 @@
 	el3_common_remove (dev);
 	return 0;
 }
-#endif
+//#endif
 
 /* Read a word from the EEPROM using the regular EEPROM access register.
    Assume that we are in register window zero.
@@ -1450,7 +1491,7 @@
 }
 
 /* Power Management support functions */
-#ifdef EL3_SUSPEND
+#ifdef CONFIG_PM
 
 static int
 el3_suspend(struct device *pdev, pm_message_t state)
@@ -1500,12 +1541,12 @@
 	return 0;
 }
 
-#endif /* EL3_SUSPEND */
+#endif /* CONFIG_PM */
 
 /* Parameters that may be passed into the module. */
 static int debug = -1;
 static int irq[] = {-1, -1, -1, -1, -1, -1, -1, -1};
-static int xcvr[] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
+static int xcvr[] = {-1, -1, -1, -1, -1, -1, -1, -1};
 
 module_param(debug,int, 0);
 module_param_array(irq, int, NULL, 0);
@@ -1515,64 +1556,85 @@
 MODULE_PARM_DESC(irq, "IRQ number(s) (assigned)");
 MODULE_PARM_DESC(xcvr,"transceiver(s) (0=internal, 1=external)");
 MODULE_PARM_DESC(max_interrupt_work, "maximum events handled per interrupt");
-#if defined(__ISAPNP__)
+#ifdef CONFIG_PNP
 module_param(nopnp, int, 0);
 MODULE_PARM_DESC(nopnp, "disable ISA PnP support (0-1)");
-MODULE_DEVICE_TABLE(isapnp, el3_isapnp_adapters);
-#endif	/* __ISAPNP__ */
-MODULE_DESCRIPTION("3Com Etherlink III (3c509, 3c509B) ISA/PnP ethernet driver");
+#endif	/* CONFIG_PNP */
+MODULE_DESCRIPTION("3Com Etherlink III (3c509, 3c509B) ethernet driver");
 MODULE_LICENSE("GPL");
 
 static int __init el3_init_module(void)
 {
 	int ret = 0;
-	el3_cards = 0;
 
 	if (debug >= 0)
 		el3_debug = debug;
 
-	el3_root_dev = NULL;
-	while (el3_probe(el3_cards) == 0) {
-		if (irq[el3_cards] > 1)
-			el3_root_dev->irq = irq[el3_cards];
-		if (xcvr[el3_cards] >= 0)
-			el3_root_dev->if_port = xcvr[el3_cards];
-		el3_cards++;
+//	while (el3_probe(el3_cards) == 0) {
+//		if (irq[el3_cards] > 1)
+//			el3_root_dev->irq = irq[el3_cards];
+//		if (xcvr[el3_cards] >= 0)
+//			el3_root_dev->if_port = xcvr[el3_cards];
+//		el3_cards++;
+//	}
+
+#ifdef CONFIG_PNP
+	if (!nopnp) {
+		ret = pnp_register_driver(&el3_pnp_driver);
+		if (!ret)
+			pnp_registered = 1;
 	}
-
+#endif
+	ret = isa_register_driver(&el3_isa_driver, EL3_MAX_CARDS);
+	if (!ret)
+		isa_registered = 1;
 #ifdef CONFIG_EISA
 	ret = eisa_driver_register(&el3_eisa_driver);
+	if (!ret)
+		eisa_registeted = 1;
 #endif
 #ifdef CONFIG_MCA
-	{
-		int err = mca_register_driver(&el3_mca_driver);
-		if (ret == 0)
-			ret = err;
-	}
+	ret = mca_register_driver(&el3_mca_driver);
+	if (!ret)
+		mca_registered = 1;
+#endif
+
+#ifdef CONFIG_PNP
+	if (pnp_registered)
+		ret = 0;
+#endif
+	if (isa_registered)
+		ret = 0;
+#ifdef CONFIG_EISA
+	if (eisa_registered)
+		ret = 0;
+#endif
+#ifdef CONFIG_MCA
+	if (mca_registered)
+		ret = 0;
 #endif
 	return ret;
 }
 
 static void __exit el3_cleanup_module(void)
 {
-	struct net_device *next_dev;
-
-	while (el3_root_dev) {
-		struct el3_private *lp = netdev_priv(el3_root_dev);
-
-		next_dev = lp->next_dev;
-		el3_common_remove (el3_root_dev);
-		el3_root_dev = next_dev;
-	}
-
+#ifdef CONFIG_PNP
+	if (pnp_registered)
+		pnp_unregister_driver(&el3_pnp_driver);
+#endif
+	if (isa_registered)
+		isa_unregister_driver(&el3_isa_driver);
+	if (id_port)
+		release_region(id_port, 1);
 #ifdef CONFIG_EISA
-	eisa_driver_unregister (&el3_eisa_driver);
+	if (eisa_registered)
+		eisa_driver_unregister (&el3_eisa_driver);
 #endif
 #ifdef CONFIG_MCA
-	mca_unregister_driver(&el3_mca_driver);
+	if (mca_registered)
+		mca_unregister_driver(&el3_mca_driver);
 #endif
 }
 
 module_init (el3_init_module);
 module_exit (el3_cleanup_module);
-


-- 
Ondrej Zary

^ permalink raw reply

* Re: [PATCHv2 2.6.24] fib: fix route replacement, fib_info is shared
From: Jarek Poplawski @ 2008-02-02 19:21 UTC (permalink / raw)
  To: Julian Anastasov; +Cc: David S. Miller, netdev, Joonwoo Park
In-Reply-To: <Pine.LNX.4.58.0802021224460.3483@u.domain.uli>

On Sat, Feb 02, 2008 at 12:56:08PM +0200, Julian Anastasov wrote:
> 
> 	Hello,

Hi!

> On Tue, 29 Jan 2008, Jarek Poplawski wrote:
> 
> > ...On the other hand, I wonder how bad would be switching these two
> > to avoid this error? After all "replace" with this "add or change"
> > meaning looks quite permissive, and after all it was used before with
> > no such errors, so, even if correct, it could still break some
> > scripts...
> 
> 	Agreed, what could break are scripts that add 2 equal 
> alternative routes and checking for errors.

BTW, I would be glad if you could use this in some patch (unless you
have no time - then let me know)...

> BTW, I tried to add
> more information and that is what I have finally:
> 
> http://www.ssi.bg/~ja/fib.txt

Great! But, I hope more people will know about this if you send it as
a patch with a new thread. BTW#2: I've thought it maybe needs a bit of
cosmetcs like more uniform TOS or tos and "." or no "." after
paragraphs, or more consistent wrapping, but then I've exagerated with
this for sure. Anyway, below are some suggestions, but feel free to
skip them all!

Thanks,
Jarek P.


--- fib.txt.orig	2008-02-02 15:44:09.000000000 +0100
+++ fib.txt	2008-02-02 18:57:56.000000000 +0100
@@ -1,42 +1,55 @@
 
 		FIB - Forwarding Information Base
 
-- Routes are organized in routing tables
+- Routes are organized in routing tables.
+
 - For "fib_hash" algorithm routing tables have 33 zones (for prefix
-lengths 0..32), routing lookup walks them from 32 to 0 to find a
-node containing all routing information
-- Zones are implemented as hash tables where nodes are hashed by
-key (prefix=network) because there can be lots of prefixes in a zone.
+lengths 0..32), routing lookup walks them from 32 to 0 to find a node
+containing all routing information.
+
+- Zones are implemented as hash tables where nodes are hashed by key
+(prefix = network) because there can be lots of prefixes in a zone.
+
 - Nodes can be stored with other methods, eg. trie, where nodes are
-searched (we hope faster) by prefix and length, no zones are used
-in this case
-- Nodes have a list of aliases (tos+type+scope+fib_info ptr) sorted by
-decreasing TOS because TOS=0 must be a last hit when looking for route,
-TOS 0 matches packet with any TOS. type is unicast, local, prohibit, etc.
-scope is host, link, etc. Additionally, aliases with same TOS are
-sorted by fib_info priority (ascending).
-- fib_info is a structure containing protocol (kernel, boot, zebra, etc),
-prefsrc, priority (metric), metrics, nexthop(s). Fallback routes have
-higher value for priority, they are used if more priority routes
-disappear or their nexthops are dead.
-- fib_info structures are organized in 2 global hash tables, one
-keyed by prefsrc and another by nexthop_count+protocol+prefsrc+priority
-- fib_info is a shared structure, different aliases can point to same
-fib_info, even aliases from different prefixes, from different routing
-tables. By this way if fib_info contains multipath route then many
-aliases share same route path scheduling context.
-- Nexthop contains gateway, output device, scope and weight. Weight
+searched (we hope faster) by prefix and length; no zones are used in
+this case.
+
+- Nodes have a list of aliases (tos + type + scope + fib_info ptr)
+sorted by decreasing tos because tos = 0 must be the last hit when
+looking for a route (tos = 0 matches packet with any tos); type is:
+unicast, local, prohibit, etc.; scope is: host, link, etc.
+Additionally, aliases with the same tos are sorted by fib_info
+priority (ascending).
+
+- fib_info is a structure containing: protocol (kernel, boot, zebra,
+etc.), prefsrc, priority (metric), metrics, nexthop(s). Fallback
+routes have higher value for priority; they are used if routes with
+more priority disappear or their nexthops are dead.
+
+- fib_info structures are organized in 2 global hash tables, one keyed
+by prefsrc, and another by: nexthop_count + protocol + prefsrc +
+priority.
+
+- fib_info structure is shared: different aliases can point at the
+same fib_info, even aliases with different prefixes or from different
+routing tables. This way if fib_info contains multipath route, then
+many aliases share the same route path scheduling context.
+
+- Nexthop contains: gateway, output device, scope and weight; weight
 is used for path scheduling where nexthops have relative priority
-compared to other nexthops in multipath route.
-- There can be many aliases with same tos, there can be alternative
-routes (aliases) with same tos and priority (metric) but only one alias
-with particular tos, type, scope and fib_info can exist to avoid duplicate
-alternative routes.
-- The operation to replace route includes replacing of alias. The alias
-in node (table -> prefix/len) is matched by tos and fib_info priority and
-they can not be changed. The parameters that are changed are type, scope
-and fib_info (except priority).
-- The 'ip' tool maps route operations to NLM_F_* flags as follows: 
+compared to other nexthops in a multipath route.
+
+- There can be many alternative routes (aliases) with the same tos and
+priority (metric), but only one alias can exist with particular: tos,
+type, scope and fib_info - to avoid duplicate alternative routes.
+
+- The operation to replace a route includes replacing an alias. The
+alias in a node (table -> prefix/len) is matched by tos and fib_info
+priority, and they cannot be changed. The parameters that are
+changed are: type, scope and fib_info (except priority).
+
+- The 'ip' tool maps route operations to NLM_F_* flags as follows:
+
 	- ip route add		-> NLM_F_CREATE | NLM_F_EXCL
 		- add unique route
 	- ip route change	-> NLM_F_REPLACE
@@ -49,30 +62,33 @@ and fib_info (except priority).
 		- create new alternative route as last
 	- ip route test		-> NLM_F_EXCL
 		- check if route exists
-- By default, 'ip route add' adds no more than one route for particular
-prefix/len, tos and fib_info priority. This is guaranteed by the
-NLM_F_EXCL flag. Extension to this rule is the support for alternative
-routes where 'ip route prepend' and 'ip route append' which avoid the
-NLM_F_EXCL flag and allow many routes for prefix/len, tos and
-fib_info priority to be added. Still, there should be no more than one
-alternative route with same prefix/len, tos and all remaining fib_info
-parameters.
+
+- By default, 'ip route add' adds no more than one route for
+particular prefix/len, tos and fib_info priority. This is guaranteed
+by the NLM_F_EXCL flag. An extension to this rule is support for
+alternative routes with 'ip route prepend' and 'ip route append' which
+avoid the NLM_F_EXCL flag and allow many routes for prefix/len, tos
+and fib_info priority to be added. Still, there should be no more than
+one alternative route with the same prefix/len, tos and all remaining
+fib_info parameters.
+
 - As for the 'route' tool, it works just like 'ip route prepend' which
 allows alternative routes to be created.
+
 - Additionally, the IP stack can automatically add local or broadcast
-'proto kernel' routes when IP address is added and unicast subnet route
-when primary IP address for subnet is added. The routes are created in
-the 'ip route append' way in local or main table.
+'proto kernel' routes when IP address is added, and unicast subnet
+route when primary IP address for a subnet is added. The routes are
+created in the 'ip route append' way in local or main table.
 
-FIB tree:
+- FIB tree:
 
 * routing table
-	* node (prefix/len)
-		* alias (tos, type, scope)
-			-> fib_info (priority, protocol, prefsrc, metrics)
-				* nexthop (gateway, outdev, scope, weight)
-
-- one or many routing tables with fast access to multiple nodes, each
-node has list with aliases with unique parameters sorted by decreasing tos
-and increasing priority.
+  * node (prefix/len)
+    * alias (tos, type, scope)
+      -> fib_info (priority, protocol, prefsrc, metrics)
+         * nexthop (gateway, outdev, scope, weight)
+
+- One or more routing tables can exist with fast access to multiple
+nodes; each node has a list of aliases with unique parameters sorted
+by decreasing tos and increasing priority.
 

^ permalink raw reply

* Re: linux-2.6.24 compile error in drivers/net/b44.c
From: Miguel Botón @ 2008-02-02 19:58 UTC (permalink / raw)
  To: Li Zefan; +Cc: LKML, netdev, David Miller, zambrano, linville
In-Reply-To: <47A3F6DC.1000903@cn.fujitsu.com>

Li Zefan wrote:
> Add CCs:
> 
> CC: mboton@gmail.com
> CC: zambrano@broadcom.com
> CC: linville@tuxdriver.com
> 
> Li Zefan wrote:
>> drivers/net/b44.c: In function 'b44_remove_one':
>> drivers/net/b44.c:2231: error: implicit declaration of function 'ssb_pcihost_set_power_state'
>> make[2]: *** [drivers/net/b44.o] Error 1
>> make[1]: *** [drivers/net] Error 2
>>
>> I think it is caused by:
>>
>> CONFIG_SSB_PCIHOST=n
>> CONFIG_B44=y
>>
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

This patch should fix b44 errors when 'SSB_PCIHOST' is not enabled.

Signed-off-by: Miguel Botón <mboton@gmail.com>

diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index ea2a2b5..d081234 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -2228,7 +2228,9 @@ static void __devexit b44_remove_one(struct ssb_device *sdev)
 	unregister_netdev(dev);
 	ssb_bus_may_powerdown(sdev->bus);
 	free_netdev(dev);
+#ifdef B44_PCI
 	ssb_pcihost_set_power_state(sdev, PCI_D3hot);
+#endif
 	ssb_set_drvdata(sdev, NULL);
 }
 
@@ -2257,7 +2259,9 @@ static int b44_suspend(struct ssb_device *sdev, pm_message_t state)
 		b44_setup_wol(bp);
 	}
 
+#ifdef B44_PCI
 	ssb_pcihost_set_power_state(sdev, PCI_D3hot);
+#endif
 	return 0;
 }
 
--
	Miguel Botón

^ permalink raw reply related

* Re: [PATCH] Unbreak sky2 on 88E8039 with current git
From: Stephen Hemminger @ 2008-02-02 20:02 UTC (permalink / raw)
  To: Petr Vandrovec; +Cc: netdev, linux-kernel
In-Reply-To: <20080202105243.GA14581@vana.vc.cvut.cz>

On Sat, 2 Feb 2008 11:52:43 +0100
Petr Vandrovec <petr@vandrovec.name> wrote:

> Hello,
>   since I synced my tree to Linus's one two days ago, sky2's packet receiption
> dies almost instantly.  Device still transmits packets, but no receive.  
> Fortunately fix is simple, unfortunately I do not know why fix works...
> 
> Commit f03b865491c2f30f2a4d77cdafc69c978ceb38a0 (sky2: align IP header on Rx
> if possible) stopped aligning receive buffers on devices which do not need
> HANG_CHECK.  Unfortunately there is at least one device (mine, Yukon FE, rev 3)
> which is not happy if receive buffer is not aligned.  I have no idea which
> other chips/revisions are affected as well.
> 
> Without patch 'ping -f -b 192.168.101.255' RX count stops incrementing in less
> than 50 packets.  With patch in place it can run like before, for hours...
> Box is an AMD rev F processor, with nVidia's MCP61 chipset.
> 							Petr

I don't have a Yukon FE, but I believe that the Yukon FE does have a ram
buffer, so you HANG_CHECK should be enabled for that device. You can check
by running:
	ethtool -d eth0 | grep 'Ram Buffer'
With ram buffer (like XL, EC)
	
# ethtool -d eth0 | grep 'Ram Buffer'
Ram Buffer                   0x18

No ram buffer (like EC-U, FE+, ...)
# ethtool -d eth0 | grep 'Ram Buffer'
Ram Buffer                   0x00
-- 
Stephen Hemminger <stephen.hemminger@vyatta.com>

^ permalink raw reply

* Re: [PATCH] [RFC] 3c509: convert to isa_driver and pnp_driver v2
From: Jeff Garzik @ 2008-02-02 20:50 UTC (permalink / raw)
  To: Ondrej Zary; +Cc: netdev, Linux Kernel, Andrew Morton
In-Reply-To: <200802021925.36552.linux@rainbow-software.org>

Ondrej Zary wrote:
> Hello,
> this is second version of the patch. Autoloading using udev works fine with 
> PnP card. Hibernation now works both in PnP and ISA modes. The I/O address 
> used for non-pnp ISA card detection is now not released as it's needed to 
> wake up the card.
> 
> Manual irq and transceiver settings aren't implemented yet. Operation with 
> multiple cards is not tested - I'll try 3 cards in both PnP and ISA modes. 
> There is some code that is the same in each of the 4 probe functions (isa, 
> pnp, eisa and mca), which should be probably separated into a function.
> 
> I have no EISA or MCA machine so I hope that I didn't break them.

Looks pretty good at first glance...

I'll throw it in my queue.  Want to add a signed-off-by:  ?

	Jeff




^ permalink raw reply

* Re: [PATCH] [RFC] 3c509: convert to isa_driver and pnp_driver v2
From: Pekka Enberg @ 2008-02-02 21:07 UTC (permalink / raw)
  To: Ondrej Zary; +Cc: netdev, Linux Kernel, Jeff Garzik
In-Reply-To: <200802021925.36552.linux@rainbow-software.org>

Hi,

On Feb 2, 2008 8:25 PM, Ondrej Zary <linux@rainbow-software.org> wrote:
> +//static __be16 el3_phys_addr[EL3_MAX_CARDS][3];

[snip]

> +//#if defined(CONFIG_MCA) || defined(CONFIG_EISA)

[snip]

> +//     while (el3_probe(el3_cards) == 0) {
> +//             if (irq[el3_cards] > 1)
> +//                     el3_root_dev->irq = irq[el3_cards];
> +//             if (xcvr[el3_cards] >= 0)
> +//                     el3_root_dev->if_port = xcvr[el3_cards];
> +//             el3_cards++;
> +//     }

You might want to consider dropping these hunks...

^ permalink raw reply

* Re: [PATCH] [RFC] 3c509: convert to isa_driver and pnp_driver v2
From: Ondrej Zary @ 2008-02-02 21:08 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, Linux Kernel, Andrew Morton
In-Reply-To: <47A4D791.3050700@garzik.org>

On Saturday 02 February 2008 21:50:25 Jeff Garzik wrote:
> Ondrej Zary wrote:
> > Hello,
> > this is second version of the patch. Autoloading using udev works fine
> > with PnP card. Hibernation now works both in PnP and ISA modes. The I/O
> > address used for non-pnp ISA card detection is now not released as it's
> > needed to wake up the card.
> >
> > Manual irq and transceiver settings aren't implemented yet. Operation
> > with multiple cards is not tested - I'll try 3 cards in both PnP and ISA
> > modes. There is some code that is the same in each of the 4 probe
> > functions (isa, pnp, eisa and mca), which should be probably separated
> > into a function.
> >
> > I have no EISA or MCA machine so I hope that I didn't break them.
>
> Looks pretty good at first glance...
>
> I'll throw it in my queue.  Want to add a signed-off-by:  ?
>
> 	Jeff

I think that the ISA resume will not work with more than 1 card. I'll fix that 
first and test with 3 cards. So the next version can include signed-off-by.

I also wonder about the old el3_cleanup_module() function - it called 
el3_common_remove for all cards. With isa_driver and pnp_driver, it oopsed - 
I think that's because the remove() functions were called by driver core on 
isa_unregister_driver (and pnp_unregister_driver) - but what about MCA and 
EISA?

-- 
Ondrej Zary

^ permalink raw reply

* [2.6 patch] net/phy/fixed.c: fix a use-after-free
From: Adrian Bunk @ 2008-02-02 21:15 UTC (permalink / raw)
  To: Anton Vorontsov, Vitaly Bordug, Jeff Garzik; +Cc: netdev

This patch fixes a use-after-free introduced by
commit a79d8e93d300adb84cccc38ac396cfb118c238ad and spotted by the 
Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---
20c51455b2faed63c3026fd4d7139e5a6a917d31 
diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c
index 73b6d39..ca9b040 100644
--- a/drivers/net/phy/fixed.c
+++ b/drivers/net/phy/fixed.c
@@ -236,12 +236,12 @@ module_init(fixed_mdio_bus_init);
 static void __exit fixed_mdio_bus_exit(void)
 {
 	struct fixed_mdio_bus *fmb = &platform_fmb;
-	struct fixed_phy *fp;
+	struct fixed_phy *fp, *tmp;
 
 	mdiobus_unregister(&fmb->mii_bus);
 	platform_device_unregister(pdev);
 
-	list_for_each_entry(fp, &fmb->phys, node) {
+	list_for_each_entry_safe(fp, tmp, &fmb->phys, node) {
 		list_del(&fp->node);
 		kfree(fp);
 	}


^ permalink raw reply related

* inet6_hash_connect() no longer uses secure_ipv6_port_ephemeral()
From: Adrian Bunk @ 2008-02-02 21:14 UTC (permalink / raw)
  To: Pavel Emelyanov, David S. Miller; +Cc: netdev

I do not claim to understand this code, but it doesn't seem to be 
intentional that after commit 5ee31fc1ecdcbc234c8c56dcacef87c8e09909d8 
inet6_hash_connect() now uses secure_ipv4_port_ephemeral() instead of 
secure_ipv6_port_ephemeral() (inet6_sk_port_offset() is no longer 
used and __inet_hash_connect() uses secure_ipv4_port_ephemeral()
through inet_sk_port_offset())?

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply

* [2.6 patch] xfrm4_beet_input(): fix an if()
From: Adrian Bunk @ 2008-02-02 21:16 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller; +Cc: netdev

A bug every C programmer makes at some point in time...

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---
3125760a05c6e97097882a810dc1c5342296aae9 
diff --git a/net/ipv4/xfrm4_mode_beet.c b/net/ipv4/xfrm4_mode_beet.c
index e093a7b..b47030b 100644
--- a/net/ipv4/xfrm4_mode_beet.c
+++ b/net/ipv4/xfrm4_mode_beet.c
@@ -102,7 +102,7 @@ static int xfrm4_beet_input(struct xfrm_state *x, struct sk_buff *skb)
 
 		XFRM_MODE_SKB_CB(skb)->protocol = ph->nexthdr;
 
-		if (!pskb_may_pull(skb, phlen));
+		if (!pskb_may_pull(skb, phlen))
 			goto out;
 		__skb_pull(skb, phlen);
 	}


^ permalink raw reply related

* Re: [PATCH] [RFC] 3c509: convert to isa_driver and pnp_driver v2
From: Ondrej Zary @ 2008-02-02 21:28 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: netdev, Linux Kernel, Jeff Garzik
In-Reply-To: <84144f020802021307ja672fdfl29e54483e9f900d@mail.gmail.com>

On Saturday 02 February 2008 22:07:20 Pekka Enberg wrote:
> Hi,
>
> On Feb 2, 2008 8:25 PM, Ondrej Zary <linux@rainbow-software.org> wrote:
> > +//static __be16 el3_phys_addr[EL3_MAX_CARDS][3];
>
> [snip]
>
> > +//#if defined(CONFIG_MCA) || defined(CONFIG_EISA)
>
> [snip]
>
> > +//     while (el3_probe(el3_cards) == 0) {
> > +//             if (irq[el3_cards] > 1)
> > +//                     el3_root_dev->irq = irq[el3_cards];
> > +//             if (xcvr[el3_cards] >= 0)
> > +//                     el3_root_dev->if_port = xcvr[el3_cards];
> > +//             el3_cards++;
> > +//     }
>
> You might want to consider dropping these hunks...

Yes, they're going away. The last one is there just as a reminder that the irq 
and xcvr parameters should be used in the ISA code.

-- 
Ondrej Zary

^ permalink raw reply


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