Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 02/14] Big kfree NULL check cleanup - drivers/net
From: Jeff Garzik @ 2005-10-28 20:53 UTC (permalink / raw)
  To: Jesper Juhl
  Cc: linux-kernel, Andrew Morton, David S. Miller, Jes Sorensen,
	Matt Porter, Michael Chan, linux.nics, hans, Santiago Leon,
	Jean Tourrilhes, Paul Mackerras, Michael Hipp, Jes Sorensen,
	Carsten Langgaard, Benjamin Reed, Jouni Malinen, prism54-private,
	netdev, Stuart Cheshire, g4klx, Alan Cox
In-Reply-To: <200510132122.48035.jesper.juhl@gmail.com>

Jesper Juhl wrote:
> This is the drivers/net/ part of the big kfree cleanup patch.
> 
> Remove pointless checks for NULL prior to calling kfree() in drivers/net/.
> 
> 
> Sorry about the long Cc: list, but I wanted to make sure I included everyone
> who's code I've changed with this patch.
> 
> 
> Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>

applied 98% of this

^ permalink raw reply

* Re: [PATCH] AX.25: Use constant instead of magic number.
From: Arnaldo Carvalho de Melo @ 2005-10-28 22:47 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: David S. Miller, Arnaldo Carvalho de Melo, dann frazier, chrisw,
	netdev, linux-hams
In-Reply-To: <20051018203932.GA11053@linux-mips.org>

On 10/18/05, Ralf Baechle <ralf@linux-mips.org> wrote:
> Signed-off-by: Ralf Baechle DL5RB <ralf@linux-mips.org>
>
>  net/rose/rose_route.c |    2 +-
>  1 files changed, 1 insertion(+), 1 deletion(-)

Thanks, applied and already merged by Linus.

^ permalink raw reply

* ICMP attacks & PMTUD mechanism
From: Fernando Gont @ 2005-10-29  8:48 UTC (permalink / raw)
  To: netdev

Folks,

A new revision of my internet-draft on "ICMP attacks against TCP" has been 
published. The draft is available at 
http://www.gont.com.ar/drafts/icmp-attacks-against-tcp.html , and at the 
IETF internet-draft public repository: 
http://www.ietf.org/internet-drafts/draft-gont-tcpm-icmp-attacks-05.txt

Linux does not yet implement the PMTUD attack-specific counter-measure, 
which is a very important one.

There are already two implementations of the PMTUD attack-specific 
counter-measure (which mitigates the possible attack even if large TCP 
windows are in use). OpenBSD implemented the first one, and NetBSD ported 
it to their OS. Both OSes now ship with the counter-measure enabled by default.

I personally built and tested OpenBSD's implementation, together with other 
developers. Even if you can guess a valid TCP sequence number (as you can 
expect if large windows are in use), you're still immune to the PMTUD attack.

The current version of the draft (-05) includes a pseudo-code version of 
the counter-measure, which makes its implementation very straight-forward.

You can find audit tools at my web site 
(http://www.gont.com.ar/tools/icmp-attacks/index.html), so that, if you 
decide to implement the counter-measure for Linux, you can test it.

P.S.: The latest version of my draft also discusses some corner cases of 
the PMTUD attack you may find it worthwhile reading, to check Linux 
behavior on this issue (see Section 7.1). (Talk about freezing 
IPSec-secured connections, for example)

Kindest regards,

--
Fernando Gont
e-mail: fernando@gont.com.ar || fgont@acm.org

^ permalink raw reply

* Re: [PATCH 02/14] Big kfree NULL check cleanup - drivers/net
From: Jesper Juhl @ 2005-10-29 13:56 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: linux-kernel, Andrew Morton, David S. Miller, Jes Sorensen,
	Matt Porter, Michael Chan, linux.nics, hans, Santiago Leon,
	Jean Tourrilhes, Paul Mackerras, Michael Hipp, Jes Sorensen,
	Carsten Langgaard, Benjamin Reed, Jouni Malinen, prism54-private,
	netdev, Stuart Cheshire, g4klx, Alan Cox
In-Reply-To: <43628FCB.9060202@pobox.com>

On 10/28/05, Jeff Garzik <jgarzik@pobox.com> wrote:
> Jesper Juhl wrote:
> > This is the drivers/net/ part of the big kfree cleanup patch.
> >
> > Remove pointless checks for NULL prior to calling kfree() in drivers/net/.
> >
> >
> > Sorry about the long Cc: list, but I wanted to make sure I included everyone
> > who's code I've changed with this patch.
> >
> >
> > Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
>
> applied 98% of this
>

Just currious, what bits are the 2% you did not apply?

--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

^ permalink raw reply

* Abolish all that you are indebted for without sending an other dollar
From: paris butler @ 2005-10-29 15:01 UTC (permalink / raw)
  To: Merlin Shaw

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 720 bytes --]

End the bothersome worry of those calls and letters.
We have pioneered an advanced system of proven strategies 
that will get the creditors and debt collectors off your back for good

Our debt termination program has legally stopped millions of dollars worth
of debt from being collected.


check out our Elimination Program here
http://in.geocities.com/leo_kemble/?1=45LT



no, then link above




"master malfoy moves with nobility that befits his pure blood," croaked
kreacher at once. "his features recall the fine bones of my mistress and his
manners are those of-"  . "and you wouldn't tell me if you knew," said
scrimgeour, "would you?" 
"-be good and.¡± , she was jogging to keep up now.

^ permalink raw reply

* [git patches] 2.6.x net driver updates
From: Jeff Garzik @ 2005-10-29 18:21 UTC (permalink / raw)
  To: Andrew Morton, Linus Torvalds; +Cc: netdev, linux-kernel


Please pull from 'upstream-linus' branch of
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git

to receive the following random collection of updates and new drivers:

 MAINTAINERS                                |    8 
 drivers/net/Kconfig                        |   77 
 drivers/net/Makefile                       |    3 
 drivers/net/acenic.c                       |    6 
 drivers/net/amd8111e.c                     |    0 
 drivers/net/amd8111e.h                     |    0 
 drivers/net/au1000_eth.c                   |    6 
 drivers/net/b44.c                          |   28 
 drivers/net/bmac.c                         |    6 
 drivers/net/bnx2.c                         |   12 
 drivers/net/e1000/e1000_ethtool.c          |    7 
 drivers/net/e1000/e1000_main.c             |    9 
 drivers/net/eepro.c                        |    7 
 drivers/net/fs_enet/Kconfig                |   20 
 drivers/net/fs_enet/Makefile               |   10 
 drivers/net/fs_enet/fs_enet-main.c         | 1226 ++++++++++
 drivers/net/fs_enet/fs_enet-mii.c          |  507 ++++
 drivers/net/fs_enet/fs_enet.h              |  245 ++
 drivers/net/fs_enet/mac-fcc.c              |  578 ++++
 drivers/net/fs_enet/mac-fec.c              |  653 +++++
 drivers/net/fs_enet/mac-scc.c              |  524 ++++
 drivers/net/fs_enet/mii-bitbang.c          |  405 +++
 drivers/net/fs_enet/mii-fixed.c            |   92 
 drivers/net/hamradio/mkiss.c               |    6 
 drivers/net/ibm_emac/Makefile              |   13 
 drivers/net/ibm_emac/ibm_emac.h            |  418 +--
 drivers/net/ibm_emac/ibm_emac_core.c       | 3414 +++++++++++++++--------------
 drivers/net/ibm_emac/ibm_emac_core.h       |  313 +-
 drivers/net/ibm_emac/ibm_emac_debug.c      |  377 +--
 drivers/net/ibm_emac/ibm_emac_debug.h      |   63 
 drivers/net/ibm_emac/ibm_emac_mal.c        |  674 +++--
 drivers/net/ibm_emac/ibm_emac_mal.h        |  336 ++
 drivers/net/ibm_emac/ibm_emac_phy.c        |  335 +-
 drivers/net/ibm_emac/ibm_emac_phy.h        |  105 
 drivers/net/ibm_emac/ibm_emac_rgmii.c      |  201 +
 drivers/net/ibm_emac/ibm_emac_rgmii.h      |   68 
 drivers/net/ibm_emac/ibm_emac_tah.c        |  111 
 drivers/net/ibm_emac/ibm_emac_tah.h        |   96 
 drivers/net/ibm_emac/ibm_emac_zmii.c       |  255 ++
 drivers/net/ibm_emac/ibm_emac_zmii.h       |  114 
 drivers/net/ibmveth.c                      |  186 -
 drivers/net/ibmveth.h                      |   23 
 drivers/net/irda/donauboe.c                |    6 
 drivers/net/irda/irda-usb.c                |    6 
 drivers/net/irda/irport.c                  |    3 
 drivers/net/irda/sir_dev.c                 |    3 
 drivers/net/irda/vlsi_ir.c                 |    3 
 drivers/net/mace.c                         |    6 
 drivers/net/ne2k-pci.c                     |    1 
 drivers/net/ni65.c                         |    9 
 drivers/net/pcmcia/pcnet_cs.c              |    6 
 drivers/net/rrunner.c                      |    6 
 drivers/net/s2io.c                         |   13 
 drivers/net/saa9730.c                      |    8 
 drivers/net/sis190.c                       |    2 
 drivers/net/sis900.c                       |   16 
 drivers/net/smc91x.c                       |    4 
 drivers/net/starfire.c                     |    4 
 drivers/net/sundance.c                     |   62 
 drivers/net/tg3.c                          |   91 
 drivers/net/tg3.h                          |   12 
 drivers/net/tulip/de2104x.c                |    6 
 drivers/net/tulip/tulip_core.c             |    6 
 drivers/net/via-velocity.c                 |    6 
 drivers/net/wireless/airo.c                |   48 
 drivers/net/wireless/airo_cs.c             |    4 
 drivers/net/wireless/atmel.c               |    6 
 drivers/net/wireless/atmel_cs.c            |    3 
 drivers/net/wireless/hermes.c              |   38 
 drivers/net/wireless/hermes.h              |    2 
 drivers/net/wireless/hostap/hostap_ioctl.c |    9 
 drivers/net/wireless/ipw2200.c             |    4 
 drivers/net/wireless/orinoco.c             |   13 
 drivers/net/wireless/prism54/islpci_dev.c  |    3 
 drivers/net/wireless/prism54/islpci_eth.c  |   13 
 drivers/net/wireless/prism54/oid_mgt.c     |    9 
 drivers/net/wireless/strip.c               |   38 
 include/linux/fs_enet_pd.h                 |  136 +
 include/linux/pci_ids.h                    |    2 
 include/net/ax25.h                         |    3 
 include/net/netrom.h                       |    3 
 81 files changed, 8958 insertions(+), 3192 deletions(-)


Akinobu Mita:
      s2io: kconfig help fix

Al Viro:
      s2io iomem annotations

Alan Cox:
      Better fixup for the orinoco driver

Alexey Dobriyan:
      starfire: free_irq() on error path of netdev_open()

Andrew Morton:
      [netdrvr b44] include linux/dma-mapping.h to eliminate warning
      revert "orinoco: Information leakage due to incorrect padding"

Ashutosh Naik:
      e1000: Fixes e1000_suspend warning when CONFIG_PM is not enabled

Aurelien Jarno:
      sis190.c: fix multicast MAC filter

Deepak Saxena:
      Fix CS89x0 KConfig for IXDP2X01

Eugene Surovegin:
      New PowerPC 4xx on-chip ethernet controller driver
      Add MAINTAINER entry for the new PowerPC 4xx on-chip ethernet controller driver

Florin Malita:
      eepro.c: module_param_array cleanup

Jeff Garzik:
      [git] change permissions on drivers/net/amd8111e.[ch] to 0644,

Jesper Juhl:
      drivers/net: Remove pointless checks for NULL prior to calling kfree()

Komuro:
      pcnet_cs: fix mii init code for older DL10019 based cards
      [netdrvr] ne2k-pci based card does not support bus-mastering.

Martin J. Bligh:
      e1000: remove warning about e1000_suspend

Matthew Wilcox:
      b44 reports wrong advertised flags

Michael Chan:
      tg3: add 5714/5715 support
      tg3: fix ASF heartbeat
      tg3: update version and minor fixes

Nicolas Pitre:
      smc91x: shut down power after probing

Panagiotis Issaris:
      ipw2200: Missing kmalloc check

Pantelis Antoniou:
      Add fs_enet ethernet network driver, for several embedded platforms.

Patrick McHardy:
      prism54: Free skb after disabling interrupts

Pavel Machek:
      b44: fix suspend/resume

Philippe De Muyter:
      sundance: fix DFE-580TX Tx Underrun

Ravikiran G Thirumalai:
      e1000: use vmalloc_node()

Roger While:
      [wireless prism54] Fix frame length

Santiago Leon:
      ibmveth fix bonding
      ibmveth fix buffer pool management
      ibmveth fix buffer replenishing
      ibmveth lockless TX
      ibmveth fix failed addbuf

Tobias Klauser:
      drivers/net/tg3: Use the DMA_{32,64}BIT_MASK constants

Vasily Averin:
      sis900: come alive after temporary memory shortage

^ permalink raw reply

* [PATCH] natsemi: Option to use MII port with no PHY
From: Mark Brown @ 2005-10-29 18:24 UTC (permalink / raw)
  To: Tim Hockin; +Cc: netdev, linux-kernel

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

This patch provides a module option which configures the natsemi driver
to use the external MII port on the chip but ignore any PHYs that may be
attached to it.  The link state will be left as it was when the driver
started and can be configured via ethtool.  Any PHYs that are present
can be accessed via the MII ioctl()s.

This is useful for systems where the device is connected without a PHY
or where either information or actions outside the scope of the natsemi
driver are required in order to use the PHYs.

Signed-off-by: Mark Brown <broonie@sirena.org.uk>

diff -uprN linux-2.6.14/drivers/net/natsemi.c linux/drivers/net/natsemi.c
--- linux-2.6.14/drivers/net/natsemi.c	2005-10-28 01:02:08.000000000 +0100
+++ linux/drivers/net/natsemi.c	2005-10-29 15:53:16.000000000 +0100
@@ -264,7 +264,7 @@ MODULE_PARM_DESC(debug, "DP8381x default
 MODULE_PARM_DESC(rx_copybreak, 
 	"DP8381x copy breakpoint for copy-only-tiny-frames");
 MODULE_PARM_DESC(options, 
-	"DP8381x: Bits 0-3: media type, bit 17: full duplex");
+	"DP8381x: Bits 0-3: media type, bit 17: full duplex, bit 18: ignore PHY");
 MODULE_PARM_DESC(full_duplex, "DP8381x full duplex setting(s) (1)");
 
 /*
@@ -693,6 +693,8 @@ struct netdev_private {
 	int oom;
 	/* Do not touch the nic registers */
 	int hands_off;
+	/* Don't pay attention to the reported link state. */
+	int ignore_phy;
 	/* external phy that is used: only valid if dev->if_port != PORT_TP */
 	int mii;
 	int phy_addr_external;
@@ -880,7 +882,19 @@ static int __devinit natsemi_probe1 (str
 	np->msg_enable = (debug >= 0) ? (1<<debug)-1 : NATSEMI_DEF_MSG;
 	np->hands_off = 0;
 
+	option = find_cnt < MAX_UNITS ? options[find_cnt] : 0;
+	if (dev->mem_start)
+		option = dev->mem_start;
+
+	/* Ignore the PHY status? */
+	if (option & 0x400) {
+		np->ignore_phy = 1;
+	} else {
+		np->ignore_phy = 0;
+	}
+
 	/* Initial port:
+	 * - If configured to ignore the PHY set up for external.
 	 * - If the nic was configured to use an external phy and if find_mii
 	 *   finds a phy: use external port, first phy that replies.
 	 * - Otherwise: internal port.
@@ -888,7 +902,7 @@ static int __devinit natsemi_probe1 (str
 	 * The address would be used to access a phy over the mii bus, but
 	 * the internal phy is accessed through mapped registers.
 	 */
-	if (readl(ioaddr + ChipConfig) & CfgExtPhy)
+	if (np->ignore_phy || readl(ioaddr + ChipConfig) & CfgExtPhy)
 		dev->if_port = PORT_MII;
 	else
 		dev->if_port = PORT_TP;
@@ -898,7 +912,9 @@ static int __devinit natsemi_probe1 (str
 
 	if (dev->if_port != PORT_TP) {
 		np->phy_addr_external = find_mii(dev);
-		if (np->phy_addr_external == PHY_ADDR_NONE) {
+		/* If we're ignoring the PHY it doesn't matter if we can't
+		 * find one. */
+		if (!np->ignore_phy && np->phy_addr_external == PHY_ADDR_NONE) {
 			dev->if_port = PORT_TP;
 			np->phy_addr_external = PHY_ADDR_INTERNAL;
 		}
@@ -906,10 +922,6 @@ static int __devinit natsemi_probe1 (str
 		np->phy_addr_external = PHY_ADDR_INTERNAL;
 	}
 
-	option = find_cnt < MAX_UNITS ? options[find_cnt] : 0;
-	if (dev->mem_start)
-		option = dev->mem_start;
-
 	/* The lower four bits are the media type. */
 	if (option) {
 		if (option & 0x200)
@@ -940,7 +952,10 @@ static int __devinit natsemi_probe1 (str
 	if (mtu)
 		dev->mtu = mtu;
 
-	netif_carrier_off(dev);
+	if (np->ignore_phy)
+		netif_carrier_on(dev);
+	else
+		netif_carrier_off(dev);
 
 	/* get the initial settings from hardware */
 	tmp            = mdio_read(dev, MII_BMCR);
@@ -988,6 +1003,8 @@ static int __devinit natsemi_probe1 (str
 		printk("%02x, IRQ %d", dev->dev_addr[i], irq);
 		if (dev->if_port == PORT_TP)
 			printk(", port TP.\n");
+		else if (np->ignore_phy)
+			printk(", port MII, ignoring PHY\n");
 		else
 			printk(", port MII, phy ad %d.\n", np->phy_addr_external);
 	}
@@ -1643,42 +1660,44 @@ static void check_link(struct net_device
 {
 	struct netdev_private *np = netdev_priv(dev);
 	void __iomem * ioaddr = ns_ioaddr(dev);
-	int duplex;
+	int duplex = np->full_duplex;
 	u16 bmsr;
-       
-	/* The link status field is latched: it remains low after a temporary
-	 * link failure until it's read. We need the current link status,
-	 * thus read twice.
-	 */
-	mdio_read(dev, MII_BMSR);
-	bmsr = mdio_read(dev, MII_BMSR);
 
-	if (!(bmsr & BMSR_LSTATUS)) {
-		if (netif_carrier_ok(dev)) {
+	/* If we're not paying attention to the PHY status then don't check. */
+	if (!np->ignore_phy) {       
+		/* The link status field is latched: it remains low
+		 * after a temporary link failure until it's read. We
+		 * need the current link status, thus read twice.
+		 */
+		mdio_read(dev, MII_BMSR);
+		bmsr = mdio_read(dev, MII_BMSR);
+
+		if (!(bmsr & BMSR_LSTATUS)) {
+			if (netif_carrier_ok(dev)) {
+				if (netif_msg_link(np))
+					printk(KERN_NOTICE "%s: link down.\n",
+					       dev->name);
+				netif_carrier_off(dev);
+				undo_cable_magic(dev);
+			}
+			return;
+		}
+		if (!netif_carrier_ok(dev)) {
 			if (netif_msg_link(np))
-				printk(KERN_NOTICE "%s: link down.\n",
-					dev->name);
-			netif_carrier_off(dev);
-			undo_cable_magic(dev);
+				printk(KERN_NOTICE "%s: link up.\n", dev->name);
+			netif_carrier_on(dev);
+			do_cable_magic(dev);
 		}
-		return;
-	}
-	if (!netif_carrier_ok(dev)) {
-		if (netif_msg_link(np))
-			printk(KERN_NOTICE "%s: link up.\n", dev->name);
-		netif_carrier_on(dev);
-		do_cable_magic(dev);
-	}
-
-	duplex = np->full_duplex;
-	if (!duplex) {
-		if (bmsr & BMSR_ANEGCOMPLETE) {
-			int tmp = mii_nway_result(
-				np->advertising & mdio_read(dev, MII_LPA));
-			if (tmp == LPA_100FULL || tmp == LPA_10FULL)
+		
+		if (!duplex) {
+			if (bmsr & BMSR_ANEGCOMPLETE) {
+				int tmp = mii_nway_result(
+					np->advertising & mdio_read(dev, MII_LPA));
+				if (tmp == LPA_100FULL || tmp == LPA_10FULL)
+					duplex = 1;
+			} else if (mdio_read(dev, MII_BMCR) & BMCR_FULLDPLX)
 				duplex = 1;
-		} else if (mdio_read(dev, MII_BMCR) & BMCR_FULLDPLX)
-			duplex = 1;
+		}
 	}
 
 	/* if duplex is set then bit 28 must be set, too */

-- 
"You grabbed my hand and we fell into it, like a daydream - or a fever."

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 307 bytes --]

^ permalink raw reply

* [PATCH 1/3] PPC 44x EMAC driver: add 440SPe support
From: Eugene Surovegin @ 2005-10-29 19:43 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, linuxppc-embedded

For some reason, the hardware designers made the polarity of one bit
in the 440SPe's PHY interface register the opposite of all other PPC
440 chips.  To handle this, abstract our access to this bit and do the
right thing based on the configured CPU type.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Eugene Surovegin <ebs@ebshome.net>
---

 drivers/net/ibm_emac/ibm_emac.h      |   21 ++++++++++++++++++++-
 drivers/net/ibm_emac/ibm_emac_core.c |   13 +++++++------
 drivers/net/ibm_emac/ibm_emac_mal.h  |    3 ++-
 3 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ibm_emac/ibm_emac.h b/drivers/net/ibm_emac/ibm_emac.h
index 28c476f..d3166da 100644
--- a/drivers/net/ibm_emac/ibm_emac.h
+++ b/drivers/net/ibm_emac/ibm_emac.h
@@ -26,7 +26,7 @@
 /* This is a simple check to prevent use of this driver on non-tested SoCs */
 #if !defined(CONFIG_405GP) && !defined(CONFIG_405GPR) && !defined(CONFIG_405EP) && \
     !defined(CONFIG_440GP) && !defined(CONFIG_440GX) && !defined(CONFIG_440SP) && \
-    !defined(CONFIG_440EP) && !defined(CONFIG_NP405H)
+    !defined(CONFIG_440EP) && !defined(CONFIG_NP405H) && !defined(CONFIG_440SPE)
 #error	"Unknown SoC. Please, check chip user manual and make sure EMAC defines are OK"
 #endif
 
@@ -246,6 +246,25 @@ struct emac_regs {
 #define EMAC_STACR_PCDA_SHIFT		5
 #define EMAC_STACR_PRA_MASK		0x1f
 
+/*
+ * For the 440SPe, AMCC inexplicably changed the polarity of
+ * the "operation complete" bit in the MII control register.
+ */
+#if defined(CONFIG_440SPE)
+static inline int emac_phy_done(u32 stacr)
+{
+	return !(stacr & EMAC_STACR_OC);
+};
+#define EMAC_STACR_START 		EMAC_STACR_OC
+
+#else /* CONFIG_440SPE */
+static inline int emac_phy_done(u32 stacr)
+{
+	return stacr & EMAC_STACR_OC;
+};
+#define EMAC_STACR_START 		0
+#endif /* !CONFIG_440SPE */
+
 /* EMACx_TRTR */
 #if !defined(CONFIG_IBM_EMAC4)
 #define EMAC_TRTR_SHIFT			27
diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c
index 943fbd1..48239e1 100644
--- a/drivers/net/ibm_emac/ibm_emac_core.c
+++ b/drivers/net/ibm_emac/ibm_emac_core.c
@@ -546,7 +546,7 @@ static int __emac_mdio_read(struct ocp_e
 
 	/* Wait for management interface to become idle */
 	n = 10;
-	while (!(in_be32(&p->stacr) & EMAC_STACR_OC)) {
+	while (!emac_phy_done(in_be32(&p->stacr))) {
 		udelay(1);
 		if (!--n)
 			goto to;
@@ -556,11 +556,12 @@ static int __emac_mdio_read(struct ocp_e
 	out_be32(&p->stacr,
 		 EMAC_STACR_BASE(emac_opb_mhz()) | EMAC_STACR_STAC_READ |
 		 (reg & EMAC_STACR_PRA_MASK)
-		 | ((id & EMAC_STACR_PCDA_MASK) << EMAC_STACR_PCDA_SHIFT));
+		 | ((id & EMAC_STACR_PCDA_MASK) << EMAC_STACR_PCDA_SHIFT)
+		 | EMAC_STACR_START);
 
 	/* Wait for read to complete */
 	n = 100;
-	while (!((r = in_be32(&p->stacr)) & EMAC_STACR_OC)) {
+	while (!emac_phy_done(r = in_be32(&p->stacr))) {
 		udelay(1);
 		if (!--n)
 			goto to;
@@ -594,7 +595,7 @@ static void __emac_mdio_write(struct ocp
 
 	/* Wait for management interface to be idle */
 	n = 10;
-	while (!(in_be32(&p->stacr) & EMAC_STACR_OC)) {
+	while (!emac_phy_done(in_be32(&p->stacr))) {
 		udelay(1);
 		if (!--n)
 			goto to;
@@ -605,11 +606,11 @@ static void __emac_mdio_write(struct ocp
 		 EMAC_STACR_BASE(emac_opb_mhz()) | EMAC_STACR_STAC_WRITE |
 		 (reg & EMAC_STACR_PRA_MASK) |
 		 ((id & EMAC_STACR_PCDA_MASK) << EMAC_STACR_PCDA_SHIFT) |
-		 (val << EMAC_STACR_PHYD_SHIFT));
+		 (val << EMAC_STACR_PHYD_SHIFT) | EMAC_STACR_START);
 
 	/* Wait for write to complete */
 	n = 100;
-	while (!(in_be32(&p->stacr) & EMAC_STACR_OC)) {
+	while (!emac_phy_done(in_be32(&p->stacr))) {
 		udelay(1);
 		if (!--n)
 			goto to;
diff --git a/drivers/net/ibm_emac/ibm_emac_mal.h b/drivers/net/ibm_emac/ibm_emac_mal.h
index 15b0bda..fb6dfe1 100644
--- a/drivers/net/ibm_emac/ibm_emac_mal.h
+++ b/drivers/net/ibm_emac/ibm_emac_mal.h
@@ -34,7 +34,8 @@
 #if defined(CONFIG_405GP) || defined(CONFIG_405GPR) || defined(CONFIG_405EP) || \
     defined(CONFIG_440EP) || defined(CONFIG_NP405H)
 #define MAL_VERSION		1
-#elif defined(CONFIG_440GP) || defined(CONFIG_440GX) || defined(CONFIG_440SP)
+#elif defined(CONFIG_440GP) || defined(CONFIG_440GX) || defined(CONFIG_440SP) || \
+      defined(CONFIG_440SPE)
 #define MAL_VERSION		2
 #else
 #error "Unknown SoC, please check chip manual and choose MAL 'version'"

^ permalink raw reply related

* [PATCH 2/3] PPC 44x EMAC driver: add 440GR support
From: Eugene Surovegin @ 2005-10-29 19:45 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, sr, linuxppc-embedded

Add PowerPC 440GR support

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Eugene Surovegin <ebs@ebshome.net>
---

 drivers/net/Kconfig                  |    2 +-
 drivers/net/ibm_emac/ibm_emac.h      |    3 ++-
 drivers/net/ibm_emac/ibm_emac_core.c |    7 ++++---
 drivers/net/ibm_emac/ibm_emac_mal.h  |    2 +-
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 6d4f9ce..97760c1 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1203,7 +1203,7 @@ config IBM_EMAC_RX_SKB_HEADROOM
 
 config IBM_EMAC_PHY_RX_CLK_FIX
 	bool "PHY Rx clock workaround"
-	depends on IBM_EMAC && (405EP || 440GX || 440EP)
+	depends on IBM_EMAC && (405EP || 440GX || 440EP || 440GR)
 	help
 	  Enable this if EMAC attached to a PHY which doesn't generate
 	  RX clock if there is no link, if this is the case, you will 
diff --git a/drivers/net/ibm_emac/ibm_emac.h b/drivers/net/ibm_emac/ibm_emac.h
index d3166da..644edbf 100644
--- a/drivers/net/ibm_emac/ibm_emac.h
+++ b/drivers/net/ibm_emac/ibm_emac.h
@@ -26,7 +26,8 @@
 /* This is a simple check to prevent use of this driver on non-tested SoCs */
 #if !defined(CONFIG_405GP) && !defined(CONFIG_405GPR) && !defined(CONFIG_405EP) && \
     !defined(CONFIG_440GP) && !defined(CONFIG_440GX) && !defined(CONFIG_440SP) && \
-    !defined(CONFIG_440EP) && !defined(CONFIG_NP405H) && !defined(CONFIG_440SPE)
+    !defined(CONFIG_440EP) && !defined(CONFIG_NP405H) && !defined(CONFIG_440SPE) && \
+    !defined(CONFIG_440GR)
 #error	"Unknown SoC. Please, check chip user manual and make sure EMAC defines are OK"
 #endif
 
diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c
index 48239e1..eb7d694 100644
--- a/drivers/net/ibm_emac/ibm_emac_core.c
+++ b/drivers/net/ibm_emac/ibm_emac_core.c
@@ -87,10 +87,11 @@ MODULE_LICENSE("GPL");
  */
 static u32 busy_phy_map;
 
-#if defined(CONFIG_IBM_EMAC_PHY_RX_CLK_FIX) && (defined(CONFIG_405EP) || defined(CONFIG_440EP))
+#if defined(CONFIG_IBM_EMAC_PHY_RX_CLK_FIX) && \
+    (defined(CONFIG_405EP) || defined(CONFIG_440EP) || defined(CONFIG_440GR))
 /* 405EP has "EMAC to PHY Control Register" (CPC0_EPCTL) which can help us
  * with PHY RX clock problem.
- * 440EP has more sane SDR0_MFR register implementation than 440GX, which
+ * 440EP/440GR has more sane SDR0_MFR register implementation than 440GX, which
  * also allows controlling each EMAC clock
  */
 static inline void EMAC_RX_CLK_TX(int idx)
@@ -100,7 +101,7 @@ static inline void EMAC_RX_CLK_TX(int id
 
 #if defined(CONFIG_405EP)
 	mtdcr(0xf3, mfdcr(0xf3) | (1 << idx));
-#else /* CONFIG_440EP */
+#else /* CONFIG_440EP || CONFIG_440GR */
 	SDR_WRITE(DCRN_SDR_MFR, SDR_READ(DCRN_SDR_MFR) | (0x08000000 >> idx));
 #endif
 
diff --git a/drivers/net/ibm_emac/ibm_emac_mal.h b/drivers/net/ibm_emac/ibm_emac_mal.h
index fb6dfe1..2a2d3b2 100644
--- a/drivers/net/ibm_emac/ibm_emac_mal.h
+++ b/drivers/net/ibm_emac/ibm_emac_mal.h
@@ -32,7 +32,7 @@
  * reflect the fact that 40x and 44x have slightly different MALs. --ebs
  */
 #if defined(CONFIG_405GP) || defined(CONFIG_405GPR) || defined(CONFIG_405EP) || \
-    defined(CONFIG_440EP) || defined(CONFIG_NP405H)
+    defined(CONFIG_440EP) || defined(CONFIG_440GR) || defined(CONFIG_NP405H)
 #define MAL_VERSION		1
 #elif defined(CONFIG_440GP) || defined(CONFIG_440GX) || defined(CONFIG_440SP) || \
       defined(CONFIG_440SPE)

^ permalink raw reply related

* [PATCH 3/3] PPC 4xx EMAC driver: fix VSC8201 PHY initialization
From: Eugene Surovegin @ 2005-10-29 19:47 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, linuxppc-embedded

* MII registers must override strap pins
* disable "echo" mode to make 10/HDX work (Franz Sirl)

Signed-off-by: Eugene Surovegin <ebs@ebshome.net>
---

 drivers/net/ibm_emac/ibm_emac_phy.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ibm_emac/ibm_emac_phy.c b/drivers/net/ibm_emac/ibm_emac_phy.c
index a27e49c..67935dd 100644
--- a/drivers/net/ibm_emac/ibm_emac_phy.c
+++ b/drivers/net/ibm_emac/ibm_emac_phy.c
@@ -236,12 +236,16 @@ static struct mii_phy_def genmii_phy_def
 };
 
 /* CIS8201 */
+#define MII_CIS8201_10BTCSR	0x16
+#define  TENBTCSR_ECHO_DISABLE	0x2000
 #define MII_CIS8201_EPCR	0x17
 #define  EPCR_MODE_MASK		0x3000
 #define  EPCR_GMII_MODE		0x0000
 #define  EPCR_RGMII_MODE	0x1000
 #define  EPCR_TBI_MODE		0x2000
 #define  EPCR_RTBI_MODE		0x3000
+#define MII_CIS8201_ACSR	0x1c
+#define  ACSR_PIN_PRIO_SELECT	0x0004
 
 static int cis8201_init(struct mii_phy *phy)
 {
@@ -269,6 +273,14 @@ static int cis8201_init(struct mii_phy *
 	}
 
 	phy_write(phy, MII_CIS8201_EPCR, epcr);
+	
+	/* MII regs override strap pins */
+	phy_write(phy, MII_CIS8201_ACSR, 
+		  phy_read(phy, MII_CIS8201_ACSR) | ACSR_PIN_PRIO_SELECT);
+
+	/* Disable TX_EN -> CRS echo mode, otherwise 10/HDX doesn't work */
+	phy_write(phy, MII_CIS8201_10BTCSR,
+		  phy_read(phy, MII_CIS8201_10BTCSR) | TENBTCSR_ECHO_DISABLE);
 
 	return 0;
 }

^ permalink raw reply related

* Re: [PATCH 1/3] PPC 44x EMAC driver: add 440SPe support
From: Jeff Garzik @ 2005-10-29 22:07 UTC (permalink / raw)
  To: Eugene Surovegin; +Cc: netdev, linuxppc-embedded
In-Reply-To: <20051029194314.GB1865@gate.ebshome.net>

applied 1-3

^ permalink raw reply

* [2.6 patch] kernel/: small cleanups
From: Adrian Bunk @ 2005-10-30  1:02 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul E. McKenney, dwmw2, linux-audit, faith, george, netdev

This patch contains the following cleanups:
- make needlessly global functions static
- every file should include the headers containing the prototypes for
  it's global functions


Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 kernel/audit.c      |    2 +-
 kernel/irq/proc.c   |    2 ++
 kernel/rcutorture.c |    2 +-
 kernel/timer.c      |    1 +
 4 files changed, 5 insertions(+), 2 deletions(-)

--- linux-2.6.14-rc5-mm1-full/kernel/timer.c.old	2005-10-30 02:27:36.000000000 +0200
+++ linux-2.6.14-rc5-mm1-full/kernel/timer.c	2005-10-30 02:27:56.000000000 +0200
@@ -33,6 +33,7 @@
 #include <linux/posix-timers.h>
 #include <linux/cpu.h>
 #include <linux/syscalls.h>
+#include <linux/delay.h>
 
 #include <asm/uaccess.h>
 #include <asm/unistd.h>
--- linux-2.6.14-rc5-mm1-full/kernel/irq/proc.c.old	2005-10-30 02:31:31.000000000 +0200
+++ linux-2.6.14-rc5-mm1-full/kernel/irq/proc.c	2005-10-30 02:31:48.000000000 +0200
@@ -10,6 +10,8 @@
 #include <linux/proc_fs.h>
 #include <linux/interrupt.h>
 
+#include "internals.h"
+
 static struct proc_dir_entry *root_irq_dir, *irq_dir[NR_IRQS];
 
 #ifdef CONFIG_SMP
--- linux-2.6.14-rc5-mm1-full/kernel/audit.c.old	2005-10-30 02:33:08.000000000 +0200
+++ linux-2.6.14-rc5-mm1-full/kernel/audit.c	2005-10-30 02:33:15.000000000 +0200
@@ -272,7 +272,7 @@
 	return old;
 }
 
-int kauditd_thread(void *dummy)
+static int kauditd_thread(void *dummy)
 {
 	struct sk_buff *skb;
 
--- linux-2.6.14-rc5-mm1-full/kernel/rcutorture.c.old	2005-10-30 02:33:35.000000000 +0200
+++ linux-2.6.14-rc5-mm1-full/kernel/rcutorture.c	2005-10-30 02:33:53.000000000 +0200
@@ -99,7 +99,7 @@
 /*
  * Allocate an element from the rcu_tortures pool.
  */
-struct rcu_torture *
+static struct rcu_torture *
 rcu_torture_alloc(void)
 {
 	struct list_head *p;

^ permalink raw reply

* Eradicate everything you owe with out sending another dime
From: conchita mccoy @ 2005-10-30  4:58 UTC (permalink / raw)
  To: Divina Nguyen


Abolish all you are indebted for without mailing another cent.  
Stop the embarrassing telephone calls. Eliminate the sending of checks!
Believe it or not a good number lending institutions not following the
banking laws here. Mind-boggling but accurate! 
Visit our web site for comprehensive particulars in relation to our
procedure at NO cost or requirement. You have zilch to lose and heaps to
reap.

http://ar.geocities.com/bernard_wooid/?1=37.Do away with all that you owe
with out mailing an other dime
Complete info or to cease getting or to comprehend our mailng address

Develop profit & customer base immediately with skilled , large quantity
e-mail advertising campaign
Rely on most experienced quality_items_ideas@uk2.net

Just before he reached Tokio he came to a military fort, and for nearly an
hour watched the skilful maneuvers of a regiment of soldiers at their
morning drill. They were not very big people, compared with other nations,
but they seemed alert and well trained, and the boy decided it would require
a brave enemy to face them on a field of battle
Having at length satisfied his curiosity as to Japanese life and customs
Rob prepared for his long flight across the Pacific Ocean

^ permalink raw reply

* [2.6 patch] drivers/net/arcnet/: possible cleanups
From: Adrian Bunk @ 2005-10-30 10:50 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: akpm, linux-kernel, netdev
In-Reply-To: <43281950.7000004@pobox.com>

On Wed, Sep 14, 2005 at 08:36:32AM -0400, Jeff Garzik wrote:
> akpm@osdl.org wrote:
> >From: Adrian Bunk <bunk@stusta.de>
> >
> >This patch contains the following possible cleanups:
> >- make needlessly global code static
> >- arcnet.c: remove the outdated VERSION
> 
> continually NAK'd, because it removes a version that may be relevant to 
> somebody as a reference.

OK, what about the patch below that leaves the VERSION #define but 
doesn't print this 5 year old version string?


<--  snip  -->


This patch contains the following possible cleanups:
- make needlessly global code static
- arcnet.c: don't print the outdated VERSION
- arcnet.c: remove the unneeded EXPORT_SYMBOL(arc_proto_null)
- arcnet.c: remove the unneeded EXPORT_SYMBOL(arcnet_dump_packet)

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>

---

 drivers/net/arcnet/arc-rawmode.c |    2 +-
 drivers/net/arcnet/arcnet.c      |   17 ++++++++++-------
 drivers/net/arcnet/rfc1051.c     |    2 +-
 drivers/net/arcnet/rfc1201.c     |    2 +-
 include/linux/arcdevice.h        |    9 ---------
 5 files changed, 13 insertions(+), 19 deletions(-)
      
diff -puN drivers/net/arcnet/arcnet.c~drivers-net-arcnet-possible-cleanups drivers/net/arcnet/arcnet.c
--- devel/drivers/net/arcnet/arcnet.c~drivers-net-arcnet-possible-cleanups	2005-07-09 01:24:43.000000000 -0700
+++ devel-akpm/drivers/net/arcnet/arcnet.c	2005-07-09 01:24:43.000000000 -0700
@@ -61,6 +59,7 @@ static int null_build_header(struct sk_b
 static int null_prepare_tx(struct net_device *dev, struct archdr *pkt,
 			   int length, int bufnum);
 
+static void arcnet_rx(struct net_device *dev, int bufnum);
 
 /*
  * one ArcProto per possible proto ID.  None of the elements of
@@ -71,7 +70,7 @@ static int null_prepare_tx(struct net_de
  struct ArcProto *arc_proto_map[256], *arc_proto_default,
    *arc_bcast_proto, *arc_raw_proto;
 
-struct ArcProto arc_proto_null =
+static struct ArcProto arc_proto_null =
 {
 	.suffix		= '?',
 	.mtu		= XMTU,
@@ -90,7 +89,6 @@ EXPORT_SYMBOL(arc_proto_map);
 EXPORT_SYMBOL(arc_proto_default);
 EXPORT_SYMBOL(arc_bcast_proto);
 EXPORT_SYMBOL(arc_raw_proto);
-EXPORT_SYMBOL(arc_proto_null);
 EXPORT_SYMBOL(arcnet_unregister_proto);
 EXPORT_SYMBOL(arcnet_debug);
 EXPORT_SYMBOL(alloc_arcdev);
@@ -118,7 +116,7 @@ static int __init arcnet_init(void)
 
 	arcnet_debug = debug;
 
-	printk(VERSION);
+	printk("arcnet loaded.\n");
 
 #ifdef ALPHA_WARNING
 	BUGLVL(D_EXTRA) {
@@ -178,8 +176,8 @@ EXPORT_SYMBOL(arcnet_dump_skb);
  * Dump the contents of an ARCnet buffer
  */
 #if (ARCNET_DEBUG_MAX & (D_RX | D_TX))
-void arcnet_dump_packet(struct net_device *dev, int bufnum, char *desc,
-			int take_arcnet_lock)
+static void arcnet_dump_packet(struct net_device *dev, int bufnum,
+			       char *desc, int take_arcnet_lock)
 {
 	struct arcnet_local *lp = dev->priv;
 	int i, length;
@@ -208,7 +206,10 @@ void arcnet_dump_packet(struct net_devic
 
 }
 
-EXPORT_SYMBOL(arcnet_dump_packet);
+#else
+
+#define arcnet_dump_packet(dev, bufnum, desc,take_arcnet_lock) do { } while (0)
+
 #endif
 
 
@@ -987,7 +988,7 @@ irqreturn_t arcnet_interrupt(int irq, vo
  * This is a generic packet receiver that calls arcnet??_rx depending on the
  * protocol ID found.
  */
-void arcnet_rx(struct net_device *dev, int bufnum)
+static void arcnet_rx(struct net_device *dev, int bufnum)
 {
 	struct arcnet_local *lp = dev->priv;
 	struct archdr pkt;
diff -puN drivers/net/arcnet/arc-rawmode.c~drivers-net-arcnet-possible-cleanups drivers/net/arcnet/arc-rawmode.c
--- devel/drivers/net/arcnet/arc-rawmode.c~drivers-net-arcnet-possible-cleanups	2005-07-09 01:24:43.000000000 -0700
+++ devel-akpm/drivers/net/arcnet/arc-rawmode.c	2005-07-09 01:24:43.000000000 -0700
@@ -42,7 +42,7 @@ static int build_header(struct sk_buff *
 static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
 		      int bufnum);
 
-struct ArcProto rawmode_proto =
+static struct ArcProto rawmode_proto =
 {
 	.suffix		= 'r',
 	.mtu		= XMTU,
diff -puN drivers/net/arcnet/rfc1051.c~drivers-net-arcnet-possible-cleanups drivers/net/arcnet/rfc1051.c
--- devel/drivers/net/arcnet/rfc1051.c~drivers-net-arcnet-possible-cleanups	2005-07-09 01:24:43.000000000 -0700
+++ devel-akpm/drivers/net/arcnet/rfc1051.c	2005-07-09 01:24:43.000000000 -0700
@@ -43,7 +43,7 @@ static int prepare_tx(struct net_device 
 		      int bufnum);
 
 
-struct ArcProto rfc1051_proto =
+static struct ArcProto rfc1051_proto =
 {
 	.suffix		= 's',
 	.mtu		= XMTU - RFC1051_HDR_SIZE,
diff -puN drivers/net/arcnet/rfc1201.c~drivers-net-arcnet-possible-cleanups drivers/net/arcnet/rfc1201.c
--- devel/drivers/net/arcnet/rfc1201.c~drivers-net-arcnet-possible-cleanups	2005-07-09 01:24:43.000000000 -0700
+++ devel-akpm/drivers/net/arcnet/rfc1201.c	2005-07-09 01:24:43.000000000 -0700
@@ -43,7 +43,7 @@ static int prepare_tx(struct net_device 
 		      int bufnum);
 static int continue_tx(struct net_device *dev, int bufnum);
 
-struct ArcProto rfc1201_proto =
+static struct ArcProto rfc1201_proto =
 {
 	.suffix		= 'a',
 	.mtu		= 1500,	/* could be more, but some receivers can't handle it... */
diff -puN include/linux/arcdevice.h~drivers-net-arcnet-possible-cleanups include/linux/arcdevice.h
--- devel/include/linux/arcdevice.h~drivers-net-arcnet-possible-cleanups	2005-07-09 01:24:43.000000000 -0700
+++ devel-akpm/include/linux/arcdevice.h	2005-07-09 01:24:43.000000000 -0700
@@ -206,7 +206,6 @@ struct ArcProto {
 
 extern struct ArcProto *arc_proto_map[256], *arc_proto_default,
 	*arc_bcast_proto, *arc_raw_proto;
-extern struct ArcProto arc_proto_null;
 
 
 /*
@@ -334,17 +333,9 @@ void arcnet_dump_skb(struct net_device *
 #define arcnet_dump_skb(dev,skb,desc) ;
 #endif
 
-#if (ARCNET_DEBUG_MAX & D_RX) || (ARCNET_DEBUG_MAX & D_TX)
-void arcnet_dump_packet(struct net_device *dev, int bufnum, char *desc,
-			int take_arcnet_lock);
-#else
-#define arcnet_dump_packet(dev, bufnum, desc,take_arcnet_lock) ;
-#endif
-
 void arcnet_unregister_proto(struct ArcProto *proto);
 irqreturn_t arcnet_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 struct net_device *alloc_arcdev(char *name);
-void arcnet_rx(struct net_device *dev, int bufnum);
 
 #endif				/* __KERNEL__ */
 #endif				/* _LINUX_ARCDEVICE_H */
_

^ permalink raw reply

* [PATCH][MCAST]IPv6: doubt about ipv6_sk_mc_lock usage.
From: Yan Zheng @ 2005-10-30 15:44 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel

Hello.

I think ipv6_sk_mc_lock should protest both ipv6_mc_list and it's sflist. because they can are used by 
inet6_mc_check(...) in softirq and be modified by ip6_mc_source(...) or ip6_mc_msfilter(...) simultaneity.
I also remove read_lock when traverse ipv6_mc_list, because it's protected by lock_sock(sk).

Regards

Signed-off-by: Yan Zheng <yanzheng@21cn.com>

Index: net/ipv6/mcast.c
====================================================================
--- linux-2.6.14/net/ipv6/mcast.c	2005-10-30 23:09:33.000000000 +0800
+++ linux/net/ipv6/mcast.c	2005-10-30 23:00:24.000000000 +0800
@@ -188,15 +188,12 @@ int ipv6_sock_mc_join(struct sock *sk, i
 	if (!ipv6_addr_is_multicast(addr))
 		return -EINVAL;
 
-	read_lock_bh(&ipv6_sk_mc_lock);
 	for (mc_lst=np->ipv6_mc_list; mc_lst; mc_lst=mc_lst->next) {
 		if ((ifindex == 0 || mc_lst->ifindex == ifindex) &&
 		    ipv6_addr_equal(&mc_lst->addr, addr)) {
-			read_unlock_bh(&ipv6_sk_mc_lock);
 			return -EADDRINUSE;
 		}
 	}
-	read_unlock_bh(&ipv6_sk_mc_lock);
 
 	mc_lst = sock_kmalloc(sk, sizeof(struct ipv6_mc_socklist), GFP_KERNEL);
 
@@ -379,7 +376,6 @@ int ip6_mc_source(int add, int omode, st
 
 	err = -EADDRNOTAVAIL;
 
-	read_lock_bh(&ipv6_sk_mc_lock);
 	for (pmc=inet6->ipv6_mc_list; pmc; pmc=pmc->next) {
 		if (pgsr->gsr_interface && pmc->ifindex != pgsr->gsr_interface)
 			continue;
@@ -400,7 +396,7 @@ int ip6_mc_source(int add, int omode, st
 		/* allow mode switches for empty-set filters */
 		ip6_mc_add_src(idev, group, omode, 0, NULL, 0);
 		ip6_mc_del_src(idev, group, pmc->sfmode, 0, NULL, 0);
-		pmc->sfmode = omode;
+		pmc->sfmode = omode; //need a write lock ?
 	}
 
 	psl = pmc->sflist;
@@ -425,10 +421,12 @@ int ip6_mc_source(int add, int omode, st
 
 		/* update the interface filter */
 		ip6_mc_del_src(idev, group, omode, 1, source, 1);
-
+		
+		write_lock_bh(&ipv6_sk_mc_lock);
 		for (j=i+1; j<psl->sl_count; j++)
 			psl->sl_addr[j-1] = psl->sl_addr[j];
 		psl->sl_count--;
+		write_unlock_bh(&ipv6_sk_mc_lock);
 		err = 0;
 		goto done;
 	}
@@ -455,9 +453,12 @@ int ip6_mc_source(int add, int omode, st
 		if (psl) {
 			for (i=0; i<psl->sl_count; i++)
 				newpsl->sl_addr[i] = psl->sl_addr[i];
-			sock_kfree_s(sk, psl, IP6_SFLSIZE(psl->sl_max));
 		}
+		write_lock_bh(&ipv6_sk_mc_lock);
+		if (psl) 
+			sock_kfree_s(sk, psl, IP6_SFLSIZE(psl->sl_max));
 		pmc->sflist = psl = newpsl;
+		write_unlock_bh(&ipv6_sk_mc_lock);
 	}
 	rv = 1;	/* > 0 for insert logic below if sl_count is 0 */
 	for (i=0; i<psl->sl_count; i++) {
@@ -467,15 +468,16 @@ int ip6_mc_source(int add, int omode, st
 	}
 	if (rv == 0)		/* address already there is an error */
 		goto done;
+	write_lock_bh(&ipv6_sk_mc_lock);
 	for (j=psl->sl_count-1; j>=i; j--)
 		psl->sl_addr[j+1] = psl->sl_addr[j];
 	psl->sl_addr[i] = *source;
 	psl->sl_count++;
+	write_unlock_bh(&ipv6_sk_mc_lock);
 	err = 0;
 	/* update the interface list */
 	ip6_mc_add_src(idev, group, omode, 1, source, 1);
 done:
-	read_unlock_bh(&ipv6_sk_mc_lock);
 	read_unlock_bh(&idev->lock);
 	in6_dev_put(idev);
 	dev_put(dev);
@@ -548,14 +550,17 @@ int ip6_mc_msfilter(struct sock *sk, str
 	} else
 		newpsl = NULL;
 	psl = pmc->sflist;
-	if (psl) {
+	if (psl) 
 		(void) ip6_mc_del_src(idev, group, pmc->sfmode,
 			psl->sl_count, psl->sl_addr, 0);
-		sock_kfree_s(sk, psl, IP6_SFLSIZE(psl->sl_max));
-	} else
+	else
 		(void) ip6_mc_del_src(idev, group, pmc->sfmode, 0, NULL, 0);
+	write_lock_bh(&ipv6_sk_mc_lock);
+	if (psl) 
+		sock_kfree_s(sk, psl, IP6_SFLSIZE(psl->sl_max));
 	pmc->sflist = newpsl;
 	pmc->sfmode = gsf->gf_fmode;
+	write_unlock_bh(&ipv6_sk_mc_lock);
 	err = 0;
 done:
 	read_unlock_bh(&idev->lock);

^ permalink raw reply

* [2.6 patch] drivers/net/ixgb/: make some code static
From: Adrian Bunk @ 2005-10-30 15:53 UTC (permalink / raw)
  To: ayyappan.veeraiyan, ganesh.venkatesan, john.ronciak
  Cc: jgarzik, netdev, linux-kernel

This patch makes some needlessly global code static.


Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 drivers/net/ixgb/ixgb_ethtool.c |    2 +-
 drivers/net/ixgb/ixgb_hw.c      |   31 ++++++++++++++++++++++---------
 drivers/net/ixgb/ixgb_hw.h      |   17 -----------------
 drivers/net/ixgb/ixgb_main.c    |    2 +-
 4 files changed, 24 insertions(+), 28 deletions(-)

--- linux-2.6.14-rc5-mm1-full/drivers/net/ixgb/ixgb_ethtool.c.old	2005-10-30 15:37:22.000000000 +0100
+++ linux-2.6.14-rc5-mm1-full/drivers/net/ixgb/ixgb_ethtool.c	2005-10-30 15:37:29.000000000 +0100
@@ -694,7 +694,7 @@
 	}
 }
 
-struct ethtool_ops ixgb_ethtool_ops = {
+static struct ethtool_ops ixgb_ethtool_ops = {
 	.get_settings = ixgb_get_settings,
 	.set_settings = ixgb_set_settings,
 	.get_drvinfo = ixgb_get_drvinfo,
--- linux-2.6.14-rc5-mm1-full/drivers/net/ixgb/ixgb_hw.h.old	2005-10-30 15:37:57.000000000 +0100
+++ linux-2.6.14-rc5-mm1-full/drivers/net/ixgb/ixgb_hw.h	2005-10-30 15:41:28.000000000 +0100
@@ -784,23 +784,8 @@
 extern boolean_t ixgb_adapter_stop(struct ixgb_hw *hw);
 extern boolean_t ixgb_init_hw(struct ixgb_hw *hw);
 extern boolean_t ixgb_adapter_start(struct ixgb_hw *hw);
-extern void ixgb_init_rx_addrs(struct ixgb_hw *hw);
 extern void ixgb_check_for_link(struct ixgb_hw *hw);
 extern boolean_t ixgb_check_for_bad_link(struct ixgb_hw *hw);
-extern boolean_t ixgb_setup_fc(struct ixgb_hw *hw);
-extern void ixgb_clear_hw_cntrs(struct ixgb_hw *hw);
-extern boolean_t mac_addr_valid(uint8_t *mac_addr);
-
-extern uint16_t ixgb_read_phy_reg(struct ixgb_hw *hw,
-				uint32_t reg_addr,
-				uint32_t phy_addr,
-				uint32_t device_type);
-
-extern void ixgb_write_phy_reg(struct ixgb_hw *hw,
-				uint32_t reg_addr,
-				uint32_t phy_addr,
-				uint32_t device_type,
-				uint16_t data);
 
 extern void ixgb_rar_set(struct ixgb_hw *hw,
 				uint8_t *addr,
@@ -818,8 +803,6 @@
 				 uint32_t offset,
 				 uint32_t value);
 
-extern void ixgb_clear_vfta(struct ixgb_hw *hw);
-
 /* Access functions to eeprom data */
 void ixgb_get_ee_mac_addr(struct ixgb_hw *hw, uint8_t *mac_addr);
 uint32_t ixgb_get_ee_pba_number(struct ixgb_hw *hw);
--- linux-2.6.14-rc5-mm1-full/drivers/net/ixgb/ixgb_hw.c.old	2005-10-30 15:38:11.000000000 +0100
+++ linux-2.6.14-rc5-mm1-full/drivers/net/ixgb/ixgb_hw.c	2005-10-30 15:41:44.000000000 +0100
@@ -47,9 +47,22 @@
 
 static ixgb_phy_type ixgb_identify_phy(struct ixgb_hw *hw);
 
-uint32_t ixgb_mac_reset(struct ixgb_hw *hw);
+static void ixgb_clear_hw_cntrs(struct ixgb_hw *hw);
 
-uint32_t ixgb_mac_reset(struct ixgb_hw *hw)
+static void ixgb_clear_vfta(struct ixgb_hw *hw);
+
+static void ixgb_init_rx_addrs(struct ixgb_hw *hw);
+
+static uint16_t ixgb_read_phy_reg(struct ixgb_hw *hw,
+				  uint32_t reg_address,
+				  uint32_t phy_address,
+				  uint32_t device_type);
+
+static boolean_t ixgb_setup_fc(struct ixgb_hw *hw);
+
+static boolean_t mac_addr_valid(uint8_t *mac_addr);
+
+static uint32_t ixgb_mac_reset(struct ixgb_hw *hw)
 {
 	uint32_t ctrl_reg;
 
@@ -335,7 +348,7 @@
  * of the receive addresss registers. Clears the multicast table. Assumes
  * the receiver is in reset when the routine is called.
  *****************************************************************************/
-void
+static void
 ixgb_init_rx_addrs(struct ixgb_hw *hw)
 {
 	uint32_t i;
@@ -604,7 +617,7 @@
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-void
+static void
 ixgb_clear_vfta(struct ixgb_hw *hw)
 {
 	uint32_t offset;
@@ -620,7 +633,7 @@
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
 
-boolean_t
+static boolean_t
 ixgb_setup_fc(struct ixgb_hw *hw)
 {
 	uint32_t ctrl_reg;
@@ -722,7 +735,7 @@
  * This requires that first an address cycle command is sent, followed by a
  * read command.
  *****************************************************************************/
-uint16_t
+static uint16_t
 ixgb_read_phy_reg(struct ixgb_hw *hw,
 		uint32_t reg_address,
 		uint32_t phy_address,
@@ -815,7 +828,7 @@
  * This requires that first an address cycle command is sent, followed by a
  * write command.
  *****************************************************************************/
-void
+static void
 ixgb_write_phy_reg(struct ixgb_hw *hw,
 			uint32_t reg_address,
 			uint32_t phy_address,
@@ -959,7 +972,7 @@
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-void
+static void
 ixgb_clear_hw_cntrs(struct ixgb_hw *hw)
 {
 	volatile uint32_t temp_reg;
@@ -1114,7 +1127,7 @@
  * mac_addr - pointer to MAC address.
  *
  *****************************************************************************/
-boolean_t
+static boolean_t
 mac_addr_valid(uint8_t *mac_addr)
 {
 	boolean_t is_valid = TRUE;
--- linux-2.6.14-rc5-mm1-full/drivers/net/ixgb/ixgb_main.c.old	2005-10-30 15:42:00.000000000 +0100
+++ linux-2.6.14-rc5-mm1-full/drivers/net/ixgb/ixgb_main.c	2005-10-30 15:42:10.000000000 +0100
@@ -45,7 +45,7 @@
  */
 
 char ixgb_driver_name[] = "ixgb";
-char ixgb_driver_string[] = "Intel(R) PRO/10GbE Network Driver";
+static char ixgb_driver_string[] = "Intel(R) PRO/10GbE Network Driver";
 
 #ifndef CONFIG_IXGB_NAPI
 #define DRIVERNAPI

^ permalink raw reply

* [2.6 patch] drivers/net/e1000/: possible cleanups
From: Adrian Bunk @ 2005-10-30 15:53 UTC (permalink / raw)
  To: cramerj, john.ronciak, ganesh.venkatesan; +Cc: jgarzik, netdev, linux-kernel

This patch contains the following possible cleanups:
- make needlessly global code static
- #if 0 the following unused global functions:
  - e1000_hw.c: e1000_mc_addr_list_update
  - e1000_hw.c: e1000_read_reg_io
  - e1000_hw.c: e1000_enable_pciex_master


Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 drivers/net/e1000/e1000_ethtool.c |    2 
 drivers/net/e1000/e1000_hw.c      |  101 ++++++++++++++++++++----------
 drivers/net/e1000/e1000_hw.h      |   42 ------------
 drivers/net/e1000/e1000_main.c    |   31 ++++-----
 4 files changed, 87 insertions(+), 89 deletions(-)

--- linux-2.6.14-rc5-mm1-full/drivers/net/e1000/e1000_ethtool.c.old	2005-10-30 15:48:13.000000000 +0100
+++ linux-2.6.14-rc5-mm1-full/drivers/net/e1000/e1000_ethtool.c	2005-10-30 15:48:20.000000000 +0100
@@ -1739,7 +1739,7 @@
 	}
 }
 
-struct ethtool_ops e1000_ethtool_ops = {
+static struct ethtool_ops e1000_ethtool_ops = {
 	.get_settings           = e1000_get_settings,
 	.set_settings           = e1000_set_settings,
 	.get_drvinfo            = e1000_get_drvinfo,
--- linux-2.6.14-rc5-mm1-full/drivers/net/e1000/e1000_hw.h.old	2005-10-30 15:48:35.000000000 +0100
+++ linux-2.6.14-rc5-mm1-full/drivers/net/e1000/e1000_hw.h	2005-10-30 16:04:05.000000000 +0100
@@ -284,7 +284,6 @@
 /* Initialization */
 int32_t e1000_reset_hw(struct e1000_hw *hw);
 int32_t e1000_init_hw(struct e1000_hw *hw);
-int32_t e1000_id_led_init(struct e1000_hw * hw);
 int32_t e1000_set_mac_type(struct e1000_hw *hw);
 void e1000_set_media_type(struct e1000_hw *hw);
 
@@ -292,10 +291,8 @@
 int32_t e1000_setup_link(struct e1000_hw *hw);
 int32_t e1000_phy_setup_autoneg(struct e1000_hw *hw);
 void e1000_config_collision_dist(struct e1000_hw *hw);
-int32_t e1000_config_fc_after_link_up(struct e1000_hw *hw);
 int32_t e1000_check_for_link(struct e1000_hw *hw);
 int32_t e1000_get_speed_and_duplex(struct e1000_hw *hw, uint16_t * speed, uint16_t * duplex);
-int32_t e1000_wait_autoneg(struct e1000_hw *hw);
 int32_t e1000_force_mac_fc(struct e1000_hw *hw);
 
 /* PHY */
@@ -303,21 +300,11 @@
 int32_t e1000_write_phy_reg(struct e1000_hw *hw, uint32_t reg_addr, uint16_t data);
 int32_t e1000_phy_hw_reset(struct e1000_hw *hw);
 int32_t e1000_phy_reset(struct e1000_hw *hw);
-int32_t e1000_detect_gig_phy(struct e1000_hw *hw);
 int32_t e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info);
-int32_t e1000_phy_m88_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info);
-int32_t e1000_phy_igp_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info);
-int32_t e1000_get_cable_length(struct e1000_hw *hw, uint16_t *min_length, uint16_t *max_length);
-int32_t e1000_check_polarity(struct e1000_hw *hw, uint16_t *polarity);
-int32_t e1000_check_downshift(struct e1000_hw *hw);
 int32_t e1000_validate_mdi_setting(struct e1000_hw *hw);
 
 /* EEPROM Functions */
 int32_t e1000_init_eeprom_params(struct e1000_hw *hw);
-boolean_t e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw);
-int32_t e1000_read_eeprom_eerd(struct e1000_hw *hw, uint16_t offset, uint16_t words, uint16_t *data);
-int32_t e1000_write_eeprom_eewr(struct e1000_hw *hw, uint16_t offset, uint16_t words, uint16_t *data);
-int32_t e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int eerd);
 
 /* MNG HOST IF functions */
 uint32_t e1000_enable_mng_pass_thru(struct e1000_hw *hw);
@@ -377,13 +364,6 @@
 							uint16_t length);
 boolean_t e1000_check_mng_mode(struct e1000_hw *hw);
 boolean_t e1000_enable_tx_pkt_filtering(struct e1000_hw *hw);
-int32_t e1000_mng_enable_host_if(struct e1000_hw *hw);
-int32_t e1000_mng_host_if_write(struct e1000_hw *hw, uint8_t *buffer,
-                            uint16_t length, uint16_t offset, uint8_t *sum);
-int32_t e1000_mng_write_cmd_header(struct e1000_hw* hw, 
-                                   struct e1000_host_mng_command_header* hdr);
-
-int32_t e1000_mng_write_commit(struct e1000_hw *hw);
 
 int32_t e1000_read_eeprom(struct e1000_hw *hw, uint16_t reg, uint16_t words, uint16_t *data);
 int32_t e1000_validate_eeprom_checksum(struct e1000_hw *hw);
@@ -395,13 +375,10 @@
 void e1000_swfw_sync_release(struct e1000_hw *hw, uint16_t mask);
 
 /* Filters (multicast, vlan, receive) */
-void e1000_init_rx_addrs(struct e1000_hw *hw);
-void e1000_mc_addr_list_update(struct e1000_hw *hw, uint8_t * mc_addr_list, uint32_t mc_addr_count, uint32_t pad, uint32_t rar_used_count);
 uint32_t e1000_hash_mc_addr(struct e1000_hw *hw, uint8_t * mc_addr);
 void e1000_mta_set(struct e1000_hw *hw, uint32_t hash_value);
 void e1000_rar_set(struct e1000_hw *hw, uint8_t * mc_addr, uint32_t rar_index);
 void e1000_write_vfta(struct e1000_hw *hw, uint32_t offset, uint32_t value);
-void e1000_clear_vfta(struct e1000_hw *hw);
 
 /* LED functions */
 int32_t e1000_setup_led(struct e1000_hw *hw);
@@ -412,7 +389,6 @@
 /* Adaptive IFS Functions */
 
 /* Everything else */
-void e1000_clear_hw_cntrs(struct e1000_hw *hw);
 void e1000_reset_adaptive(struct e1000_hw *hw);
 void e1000_update_adaptive(struct e1000_hw *hw);
 void e1000_tbi_adjust_stats(struct e1000_hw *hw, struct e1000_hw_stats *stats, uint32_t frame_len, uint8_t * mac_addr);
@@ -423,29 +399,11 @@
 void e1000_write_pci_cfg(struct e1000_hw *hw, uint32_t reg, uint16_t * value);
 /* Port I/O is only supported on 82544 and newer */
 uint32_t e1000_io_read(struct e1000_hw *hw, unsigned long port);
-uint32_t e1000_read_reg_io(struct e1000_hw *hw, uint32_t offset);
 void e1000_io_write(struct e1000_hw *hw, unsigned long port, uint32_t value);
-void e1000_write_reg_io(struct e1000_hw *hw, uint32_t offset, uint32_t value);
-int32_t e1000_config_dsp_after_link_change(struct e1000_hw *hw, boolean_t link_up);
-int32_t e1000_set_d3_lplu_state(struct e1000_hw *hw, boolean_t active);
-int32_t e1000_set_d0_lplu_state(struct e1000_hw *hw, boolean_t active);
-void e1000_set_pci_express_master_disable(struct e1000_hw *hw);
-void e1000_enable_pciex_master(struct e1000_hw *hw);
 int32_t e1000_disable_pciex_master(struct e1000_hw *hw);
-int32_t e1000_get_auto_rd_done(struct e1000_hw *hw);
-int32_t e1000_get_phy_cfg_done(struct e1000_hw *hw);
 int32_t e1000_get_software_semaphore(struct e1000_hw *hw);
 void e1000_release_software_semaphore(struct e1000_hw *hw);
 int32_t e1000_check_phy_reset_block(struct e1000_hw *hw);
-int32_t e1000_get_hw_eeprom_semaphore(struct e1000_hw *hw);
-void e1000_put_hw_eeprom_semaphore(struct e1000_hw *hw);
-int32_t e1000_commit_shadow_ram(struct e1000_hw *hw);
-uint8_t e1000_arc_subsystem_valid(struct e1000_hw *hw);
-
-#define E1000_READ_REG_IO(a, reg) \
-    e1000_read_reg_io((a), E1000_##reg)
-#define E1000_WRITE_REG_IO(a, reg, val) \
-    e1000_write_reg_io((a), E1000_##reg, val)
 
 /* PCI Device IDs */
 #define E1000_DEV_ID_82542               0x1000
--- linux-2.6.14-rc5-mm1-full/drivers/net/e1000/e1000_hw.c.old	2005-10-30 15:49:27.000000000 +0100
+++ linux-2.6.14-rc5-mm1-full/drivers/net/e1000/e1000_hw.c	2005-10-30 16:05:02.000000000 +0100
@@ -68,6 +68,38 @@
 static int32_t e1000_set_phy_mode(struct e1000_hw *hw);
 static int32_t e1000_host_if_read_cookie(struct e1000_hw *hw, uint8_t *buffer);
 static uint8_t e1000_calculate_mng_checksum(char *buffer, uint32_t length);
+static uint8_t e1000_arc_subsystem_valid(struct e1000_hw *hw);
+static int32_t e1000_check_downshift(struct e1000_hw *hw);
+static int32_t e1000_check_polarity(struct e1000_hw *hw, uint16_t *polarity);
+static void e1000_clear_hw_cntrs(struct e1000_hw *hw);
+static void e1000_clear_vfta(struct e1000_hw *hw);
+static int32_t e1000_commit_shadow_ram(struct e1000_hw *hw);
+static int32_t e1000_config_dsp_after_link_change(struct e1000_hw *hw,
+						  boolean_t link_up);
+static int32_t e1000_config_fc_after_link_up(struct e1000_hw *hw);
+static int32_t e1000_detect_gig_phy(struct e1000_hw *hw);
+static int32_t e1000_get_auto_rd_done(struct e1000_hw *hw);
+static int32_t e1000_get_cable_length(struct e1000_hw *hw,
+				      uint16_t *min_length,
+				      uint16_t *max_length);
+static int32_t e1000_get_hw_eeprom_semaphore(struct e1000_hw *hw);
+static int32_t e1000_get_phy_cfg_done(struct e1000_hw *hw);
+static int32_t e1000_id_led_init(struct e1000_hw * hw);
+static void e1000_init_rx_addrs(struct e1000_hw *hw);
+static boolean_t e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw);
+static int32_t e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int eerd);
+static void e1000_put_hw_eeprom_semaphore(struct e1000_hw *hw);
+static int32_t e1000_read_eeprom_eerd(struct e1000_hw *hw, uint16_t offset,
+				      uint16_t words, uint16_t *data);
+static int32_t e1000_set_d0_lplu_state(struct e1000_hw *hw, boolean_t active);
+static int32_t e1000_set_d3_lplu_state(struct e1000_hw *hw, boolean_t active);
+static int32_t e1000_wait_autoneg(struct e1000_hw *hw);
+
+static void e1000_write_reg_io(struct e1000_hw *hw, uint32_t offset,
+			       uint32_t value);
+
+#define E1000_WRITE_REG_IO(a, reg, val) \
+	    e1000_write_reg_io((a), E1000_##reg, val)
 
 /* IGP cable length table */
 static const
@@ -2035,7 +2067,7 @@
  * based on the flow control negotiated by the PHY. In TBI mode, the TFCE
  * and RFCE bits will be automaticaly set to the negotiated flow control mode.
  *****************************************************************************/
-int32_t
+static int32_t
 e1000_config_fc_after_link_up(struct e1000_hw *hw)
 {
     int32_t ret_val;
@@ -2537,7 +2569,7 @@
 *
 * hw - Struct containing variables accessed by shared code
 ******************************************************************************/
-int32_t
+static int32_t
 e1000_wait_autoneg(struct e1000_hw *hw)
 {
     int32_t ret_val;
@@ -3021,7 +3053,7 @@
 *
 * hw - Struct containing variables accessed by shared code
 ******************************************************************************/
-int32_t
+static int32_t
 e1000_detect_gig_phy(struct e1000_hw *hw)
 {
     int32_t phy_init_status, ret_val;
@@ -3121,7 +3153,7 @@
 * hw - Struct containing variables accessed by shared code
 * phy_info - PHY information structure
 ******************************************************************************/
-int32_t
+static int32_t
 e1000_phy_igp_get_info(struct e1000_hw *hw,
                        struct e1000_phy_info *phy_info)
 {
@@ -3195,7 +3227,7 @@
 * hw - Struct containing variables accessed by shared code
 * phy_info - PHY information structure
 ******************************************************************************/
-int32_t
+static int32_t
 e1000_phy_m88_get_info(struct e1000_hw *hw,
                        struct e1000_phy_info *phy_info)
 {
@@ -3905,7 +3937,7 @@
  * data - word read from the EEPROM
  * words - number of words to read
  *****************************************************************************/
-int32_t
+static int32_t
 e1000_read_eeprom_eerd(struct e1000_hw *hw,
                   uint16_t offset,
                   uint16_t words,
@@ -3939,7 +3971,7 @@
  * data - word read from the EEPROM
  * words - number of words to read
  *****************************************************************************/
-int32_t
+static int32_t
 e1000_write_eeprom_eewr(struct e1000_hw *hw,
                    uint16_t offset,
                    uint16_t words,
@@ -3976,7 +4008,7 @@
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-int32_t
+static int32_t
 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int eerd)
 {
     uint32_t attempts = 100000;
@@ -4004,7 +4036,7 @@
 *
 * hw - Struct containing variables accessed by shared code
 ****************************************************************************/
-boolean_t
+static boolean_t
 e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw)
 {
     uint32_t eecd = 0;
@@ -4322,7 +4354,7 @@
  * data - word read from the EEPROM
  * words - number of words to read
  *****************************************************************************/
-int32_t
+static int32_t
 e1000_commit_shadow_ram(struct e1000_hw *hw)
 {
     uint32_t attempts = 100000;
@@ -4453,7 +4485,7 @@
  * of the receive addresss registers. Clears the multicast table. Assumes
  * the receiver is in reset when the routine is called.
  *****************************************************************************/
-void
+static void
 e1000_init_rx_addrs(struct e1000_hw *hw)
 {
     uint32_t i;
@@ -4481,6 +4513,7 @@
     }
 }
 
+#if 0
 /******************************************************************************
  * Updates the MAC's list of multicast addresses.
  *
@@ -4564,6 +4597,7 @@
     }
     DEBUGOUT("MC Update Complete\n");
 }
+#endif  /*  0  */
 
 /******************************************************************************
  * Hashes an address to determine its location in the multicast table
@@ -4705,7 +4739,7 @@
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-void
+static void
 e1000_clear_vfta(struct e1000_hw *hw)
 {
     uint32_t offset;
@@ -4735,7 +4769,7 @@
     }
 }
 
-int32_t
+static int32_t
 e1000_id_led_init(struct e1000_hw * hw)
 {
     uint32_t ledctl;
@@ -4997,7 +5031,7 @@
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-void
+static void
 e1000_clear_hw_cntrs(struct e1000_hw *hw)
 {
     volatile uint32_t temp;
@@ -5283,6 +5317,8 @@
         break;
     }
 }
+
+#if 0
 /******************************************************************************
  * Reads a value from one of the devices registers using port I/O (as opposed
  * memory mapped I/O). Only 82544 and newer devices support port I/O.
@@ -5300,6 +5336,7 @@
     e1000_io_write(hw, io_addr, offset);
     return e1000_io_read(hw, io_data);
 }
+#endif  /*  0  */
 
 /******************************************************************************
  * Writes a value to one of the devices registers using port I/O (as opposed to
@@ -5309,7 +5346,7 @@
  * offset - offset to write to
  * value - value to write
  *****************************************************************************/
-void
+static void
 e1000_write_reg_io(struct e1000_hw *hw,
                    uint32_t offset,
                    uint32_t value)
@@ -5337,7 +5374,7 @@
  * register to the minimum and maximum range.
  * For IGP phy's, the function calculates the range by the AGC registers.
  *****************************************************************************/
-int32_t
+static int32_t
 e1000_get_cable_length(struct e1000_hw *hw,
                        uint16_t *min_length,
                        uint16_t *max_length)
@@ -5489,7 +5526,7 @@
  * return 0.  If the link speed is 1000 Mbps the polarity status is in the
  * IGP01E1000_PHY_PCS_INIT_REG.
  *****************************************************************************/
-int32_t
+static int32_t
 e1000_check_polarity(struct e1000_hw *hw,
                      uint16_t *polarity)
 {
@@ -5551,7 +5588,7 @@
  * Link Health register.  In IGP this bit is latched high, so the driver must
  * read it immediately after link is established.
  *****************************************************************************/
-int32_t
+static int32_t
 e1000_check_downshift(struct e1000_hw *hw)
 {
     int32_t ret_val;
@@ -5592,7 +5629,7 @@
  *
  ****************************************************************************/
 
-int32_t
+static int32_t
 e1000_config_dsp_after_link_change(struct e1000_hw *hw,
                                    boolean_t link_up)
 {
@@ -5823,7 +5860,7 @@
  *
  ****************************************************************************/
 
-int32_t
+static int32_t
 e1000_set_d3_lplu_state(struct e1000_hw *hw,
                         boolean_t active)
 {
@@ -5936,7 +5973,7 @@
  *
  ****************************************************************************/
 
-int32_t
+static int32_t
 e1000_set_d0_lplu_state(struct e1000_hw *hw,
                         boolean_t active)
 {
@@ -6103,7 +6140,7 @@
  *            timeout
  *          - E1000_SUCCESS for success.
  ****************************************************************************/
-int32_t
+static int32_t
 e1000_mng_enable_host_if(struct e1000_hw * hw)
 {
     uint32_t hicr;
@@ -6137,7 +6174,7 @@
  *
  * returns  - E1000_SUCCESS for success.
  ****************************************************************************/
-int32_t
+static int32_t
 e1000_mng_host_if_write(struct e1000_hw * hw, uint8_t *buffer,
                         uint16_t length, uint16_t offset, uint8_t *sum)
 {
@@ -6205,7 +6242,7 @@
  *
  * returns  - E1000_SUCCESS for success.
  ****************************************************************************/
-int32_t
+static int32_t
 e1000_mng_write_cmd_header(struct e1000_hw * hw,
                            struct e1000_host_mng_command_header * hdr)
 {
@@ -6243,7 +6280,7 @@
  *
  * returns  - E1000_SUCCESS for success.
  ****************************************************************************/
-int32_t
+static int32_t
 e1000_mng_write_commit(
     struct e1000_hw * hw)
 {
@@ -6496,7 +6533,7 @@
  * returns: - none.
  *
  ***************************************************************************/
-void
+static void
 e1000_set_pci_express_master_disable(struct e1000_hw *hw)
 {
     uint32_t ctrl;
@@ -6511,6 +6548,7 @@
     E1000_WRITE_REG(hw, CTRL, ctrl);
 }
 
+#if 0
 /***************************************************************************
  *
  * Enables PCI-Express master access.
@@ -6534,6 +6572,7 @@
     ctrl &= ~E1000_CTRL_GIO_MASTER_DISABLE;
     E1000_WRITE_REG(hw, CTRL, ctrl);
 }
+#endif  /*  0  */
 
 /*******************************************************************************
  *
@@ -6584,7 +6623,7 @@
  *            E1000_SUCCESS at any other case.
  *
  ******************************************************************************/
-int32_t
+static int32_t
 e1000_get_auto_rd_done(struct e1000_hw *hw)
 {
     int32_t timeout = AUTO_READ_DONE_TIMEOUT;
@@ -6623,7 +6662,7 @@
  *            E1000_SUCCESS at any other case.
  *
  ***************************************************************************/
-int32_t
+static int32_t
 e1000_get_phy_cfg_done(struct e1000_hw *hw)
 {
     int32_t timeout = PHY_CFG_TIMEOUT;
@@ -6666,7 +6705,7 @@
  *            E1000_SUCCESS at any other case.
  *
  ***************************************************************************/
-int32_t
+static int32_t
 e1000_get_hw_eeprom_semaphore(struct e1000_hw *hw)
 {
     int32_t timeout;
@@ -6711,7 +6750,7 @@
  * returns: - None.
  *
  ***************************************************************************/
-void
+static void
 e1000_put_hw_eeprom_semaphore(struct e1000_hw *hw)
 {
     uint32_t swsm;
@@ -6747,7 +6786,7 @@
 	    E1000_BLK_PHY_RESET : E1000_SUCCESS;
 }
 
-uint8_t
+static uint8_t
 e1000_arc_subsystem_valid(struct e1000_hw *hw)
 {
     uint32_t fwsm;
--- linux-2.6.14-rc5-mm1-full/drivers/net/e1000/e1000_main.c.old	2005-10-30 16:05:15.000000000 +0100
+++ linux-2.6.14-rc5-mm1-full/drivers/net/e1000/e1000_main.c	2005-10-30 16:07:44.000000000 +0100
@@ -37,7 +37,7 @@
  */
 
 char e1000_driver_name[] = "e1000";
-char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
+static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
 #ifndef CONFIG_E1000_NAPI
 #define DRIVERNAPI
 #else
@@ -45,7 +45,7 @@
 #endif
 #define DRV_VERSION "6.1.16-k2"DRIVERNAPI
 char e1000_driver_version[] = DRV_VERSION;
-char e1000_copyright[] = "Copyright (c) 1999-2005 Intel Corporation.";
+static char e1000_copyright[] = "Copyright (c) 1999-2005 Intel Corporation.";
 
 /* e1000_pci_tbl - PCI Device ID Table
  *
@@ -112,14 +112,14 @@
 int e1000_setup_all_rx_resources(struct e1000_adapter *adapter);
 void e1000_free_all_tx_resources(struct e1000_adapter *adapter);
 void e1000_free_all_rx_resources(struct e1000_adapter *adapter);
-int e1000_setup_tx_resources(struct e1000_adapter *adapter,
-                             struct e1000_tx_ring *txdr);
-int e1000_setup_rx_resources(struct e1000_adapter *adapter,
-                             struct e1000_rx_ring *rxdr);
-void e1000_free_tx_resources(struct e1000_adapter *adapter,
-                             struct e1000_tx_ring *tx_ring);
-void e1000_free_rx_resources(struct e1000_adapter *adapter,
-                             struct e1000_rx_ring *rx_ring);
+static int e1000_setup_tx_resources(struct e1000_adapter *adapter,
+				    struct e1000_tx_ring *txdr);
+static int e1000_setup_rx_resources(struct e1000_adapter *adapter,
+				    struct e1000_rx_ring *rxdr);
+static void e1000_free_tx_resources(struct e1000_adapter *adapter,
+				    struct e1000_tx_ring *tx_ring);
+static void e1000_free_rx_resources(struct e1000_adapter *adapter,
+				    struct e1000_rx_ring *rx_ring);
 void e1000_update_stats(struct e1000_adapter *adapter);
 
 /* Local Function Prototypes */
@@ -296,7 +296,8 @@
 		E1000_WRITE_FLUSH(&adapter->hw);
 	}
 }
-void
+
+static void
 e1000_update_mng_vlan(struct e1000_adapter *adapter)
 {
 	struct net_device *netdev = adapter->netdev;
@@ -1141,7 +1142,7 @@
  * Return 0 on success, negative on failure
  **/
 
-int
+static int
 e1000_setup_tx_resources(struct e1000_adapter *adapter,
                          struct e1000_tx_ring *txdr)
 {
@@ -1359,7 +1360,7 @@
  * Returns 0 on success, negative on failure
  **/
 
-int
+static int
 e1000_setup_rx_resources(struct e1000_adapter *adapter,
                          struct e1000_rx_ring *rxdr)
 {
@@ -1747,7 +1748,7 @@
  * Free all transmit software resources
  **/
 
-void
+static void
 e1000_free_tx_resources(struct e1000_adapter *adapter,
                         struct e1000_tx_ring *tx_ring)
 {
@@ -1858,7 +1859,7 @@
  * Free all receive software resources
  **/
 
-void
+static void
 e1000_free_rx_resources(struct e1000_adapter *adapter,
                         struct e1000_rx_ring *rx_ring)
 {

^ permalink raw reply

* Re: [PATCH][MCAST]IPv6: doubt about ipv6_sk_mc_lock usage.
From: David Stevens @ 2005-10-30 17:32 UTC (permalink / raw)
  To: Yan Zheng; +Cc: linux-kernel, netdev, netdev-owner
In-Reply-To: <4364EA58.7040707@21cn.com>

No, ipv6_sk_mc_lock is required for join and leave to protect 
inet6_mc_check()
calls, and modifications to the filter list only happen via ioctls that 
are protected
by the socket lock.

I don't think any of these changes are correct.

                                                +-DLS


netdev-owner@vger.kernel.org wrote on 10/30/2005 07:44:24 AM:

> Hello.
> 
> I think ipv6_sk_mc_lock should protest both ipv6_mc_list and it's 
sflist. 
> because they can are used by 
> inet6_mc_check(...) in softirq and be modified by ip6_mc_source(...) or 
> ip6_mc_msfilter(...) simultaneity.
> I also remove read_lock when traverse ipv6_mc_list, because it's 
protected by 
> lock_sock(sk).
> 

^ permalink raw reply

* Re: [2.6 patch] kernel/: small cleanups
From: Paul E. McKenney @ 2005-10-30 20:53 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel, dwmw2, linux-audit, faith, george, netdev
In-Reply-To: <20051030010200.GT4180@stusta.de>

On Sun, Oct 30, 2005 at 02:02:00AM +0100, Adrian Bunk wrote:
> This patch contains the following cleanups:
> - make needlessly global functions static

Good catch on rcu_torture_alloc()!

							Thanx, Paul

> - every file should include the headers containing the prototypes for
>   it's global functions

Acked-by: <paulmck@us.ibm.com>
> Signed-off-by: Adrian Bunk <bunk@stusta.de>
> 
> ---
> 
>  kernel/audit.c      |    2 +-
>  kernel/irq/proc.c   |    2 ++
>  kernel/rcutorture.c |    2 +-
>  kernel/timer.c      |    1 +
>  4 files changed, 5 insertions(+), 2 deletions(-)
> 
> --- linux-2.6.14-rc5-mm1-full/kernel/timer.c.old	2005-10-30 02:27:36.000000000 +0200
> +++ linux-2.6.14-rc5-mm1-full/kernel/timer.c	2005-10-30 02:27:56.000000000 +0200
> @@ -33,6 +33,7 @@
>  #include <linux/posix-timers.h>
>  #include <linux/cpu.h>
>  #include <linux/syscalls.h>
> +#include <linux/delay.h>
>  
>  #include <asm/uaccess.h>
>  #include <asm/unistd.h>
> --- linux-2.6.14-rc5-mm1-full/kernel/irq/proc.c.old	2005-10-30 02:31:31.000000000 +0200
> +++ linux-2.6.14-rc5-mm1-full/kernel/irq/proc.c	2005-10-30 02:31:48.000000000 +0200
> @@ -10,6 +10,8 @@
>  #include <linux/proc_fs.h>
>  #include <linux/interrupt.h>
>  
> +#include "internals.h"
> +
>  static struct proc_dir_entry *root_irq_dir, *irq_dir[NR_IRQS];
>  
>  #ifdef CONFIG_SMP
> --- linux-2.6.14-rc5-mm1-full/kernel/audit.c.old	2005-10-30 02:33:08.000000000 +0200
> +++ linux-2.6.14-rc5-mm1-full/kernel/audit.c	2005-10-30 02:33:15.000000000 +0200
> @@ -272,7 +272,7 @@
>  	return old;
>  }
>  
> -int kauditd_thread(void *dummy)
> +static int kauditd_thread(void *dummy)
>  {
>  	struct sk_buff *skb;
>  
> --- linux-2.6.14-rc5-mm1-full/kernel/rcutorture.c.old	2005-10-30 02:33:35.000000000 +0200
> +++ linux-2.6.14-rc5-mm1-full/kernel/rcutorture.c	2005-10-30 02:33:53.000000000 +0200
> @@ -99,7 +99,7 @@
>  /*
>   * Allocate an element from the rcu_tortures pool.
>   */
> -struct rcu_torture *
> +static struct rcu_torture *
>  rcu_torture_alloc(void)
>  {
>  	struct list_head *p;
> 
> 

^ permalink raw reply

* Re: [NF+IPsec 4/6]: Make IPsec input processing symetrical to output
From: Patrick McHardy @ 2005-10-30 23:15 UTC (permalink / raw)
  To: Herbert Xu; +Cc: netdev, netfilter-devel
In-Reply-To: <4360E75A.10405@trash.net>

Patrick McHardy wrote:
> Herbert Xu wrote:
> 
>>I presume that you will be changing the output path so that LOCAL_OUT
>>does not see the plain-text packet.  Otherwise it'll be asymmetric with
>>repsect to the inbound side which does not see plain-text packets for
>>transport mode SAs.
> 
> Yes, that was the idea. But since people seem to consider this an
> important case to handle I'm going to try the per-SA flag you
> proposed. I'll send new patches in the next days.

Unfortunately hiding the plain-text packets on output when transport
mode SAs are used and the flag is not set adds a new inconsistency
with NAT. In my last patchsets NAT was handled by redoing the policy
lookup when a packet was NATed at LOCAL_OUT or POST_ROUTING and wasn't
already transformed. If the new lookup yielded a policy
ip_dst_output/__ip_dst_output was called again. The hooks were always
called in the normal order. With a per-SA flag however we don't know
if the packet should be hidden before the second lookup is done, so
with NAT a packet that would usually be hidden might be visible
on LOCAL_OUT and POST_ROUTING, or just LOCAL_OUT. This also affects
ip_queue.

So far the by far cleanest solution from a netfilter point of view
was to ignore transport mode unless its the innermost transform on
output and to always send the decapsulated packets through the stack
again on input. Since Yoshifuji disagrees with this approach we seem
to be deadlocked ..

^ permalink raw reply

* [2.6 patch] drivers/net/hamradio/dmascc.c: remove dmascc_setup()
From: Adrian Bunk @ 2005-10-31  0:33 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linux-kernel

It seems dmascc_setup() is a leftover time before dmascc_init() was 
there.


Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 drivers/net/hamradio/dmascc.c |   10 ----------
 1 file changed, 10 deletions(-)

--- linux-2.6.14-rc5-mm1-full/drivers/net/hamradio/dmascc.c.old	2005-10-31 01:21:39.000000000 +0100
+++ linux-2.6.14-rc5-mm1-full/drivers/net/hamradio/dmascc.c	2005-10-31 01:21:49.000000000 +0100
@@ -311,16 +311,6 @@
 	}
 }
 
-#ifndef MODULE
-void __init dmascc_setup(char *str, int *ints)
-{
-	int i;
-
-	for (i = 0; i < MAX_NUM_DEVS && i < ints[0]; i++)
-		io[i] = ints[i + 1];
-}
-#endif
-
 static int __init dmascc_init(void)
 {
 	int h, i, j, n;

^ permalink raw reply

* Re: [PATCH][MCAST]IPv6: doubt about ipv6_sk_mc_lock usage.
From: Yan Zheng @ 2005-10-31  1:46 UTC (permalink / raw)
  To: David Stevens; +Cc: netdev, linux-kernel
In-Reply-To: <OFE9824801.1D574FF8-ON882570AA.005FC39C-882570AA.006050CD@us.ibm.com>

David Stevens wrote:
> No, ipv6_sk_mc_lock is required for join and leave to protect 
> inet6_mc_check()
> calls, and modifications to the filter list only happen via ioctls that 
> are protected
> by the socket lock.
> 
> I don't think any of these changes are correct.
> 
>                                                 +-DLS

Thanks.

I have one more question. 
Why ip6_mc_source() uses read_lock_bh(&ipv6_sk_mc_lock) and ip6_mc_msfilter() doesn't use ipv6_sk_mc_lock at all. 
when ipv6_mc_list's sflist are accessed by inet6_mc_check(), Can it be modified by ip6_mc_source() or ip6_mc_msfilter() ?
(For example ipv6_mc_list's sflist is freed up by sock_kfree_s(), when inet6_mc_check() uses it)


                                                                   Regards

^ permalink raw reply

* [PATCH][MCAST]IPv6: small fix for ip6_mc_msfilter(...)
From: Yan Zheng @ 2005-10-31  2:52 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, David Stevens

Hi.
I think ip6_mc_add_src(...) should be called when number of sources is zero and filter mode is exclude.

Regards



Signed-off-by: Yan Zheng <yanzheng@21cn.com> 

Index: net/ipv6/mcast.c
================================================================================
--- linux-2.6.14/net/ipv6/mcast.c	2005-10-30 23:09:33.000000000 +0800
+++ linux/net/ipv6/mcast.c	2005-10-31 10:37:36.000000000 +0800
@@ -545,8 +545,10 @@ int ip6_mc_msfilter(struct sock *sk, str
 			sock_kfree_s(sk, newpsl, IP6_SFLSIZE(newpsl->sl_max));
 			goto done;
 		}
-	} else
+	} else {
 		newpsl = NULL;
+		ip6_mc_add_src(idev, group, gsf->gf_fmode, 0, NULL, 0);
+	}
 	psl = pmc->sflist;
 	if (psl) {
 		(void) ip6_mc_del_src(idev, group, pmc->sfmode,

^ permalink raw reply

* Re: [NF+IPsec 4/6]: Make IPsec input processing symetrical to output
From: Yasuyuki KOZAKAI @ 2005-10-31  3:19 UTC (permalink / raw)
  To: kaber; +Cc: netdev, netfilter-devel, herbert
In-Reply-To: <43655428.3040904@trash.net>


Hi, Patrick,

From: Patrick McHardy <kaber@trash.net>
Date: Mon, 31 Oct 2005 00:15:52 +0100

> Patrick McHardy wrote:
> > Herbert Xu wrote:
> > 
> >>I presume that you will be changing the output path so that LOCAL_OUT
> >>does not see the plain-text packet.  Otherwise it'll be asymmetric with
> >>repsect to the inbound side which does not see plain-text packets for
> >>transport mode SAs.

I support this way.

> > Yes, that was the idea. But since people seem to consider this an
> > important case to handle I'm going to try the per-SA flag you
> > proposed. I'll send new patches in the next days.

I think pure transport mode is important, too. For example, for users of
L2TP over IPsec.

But I'm not sure that how many people wants to use netfilter hook together.
At least, I don't need that. Because I can use IPsec policy instead of
iptables rule and that's enough for me.

I also think that it's the work for IPsec policy check to decide to
accept or drop decrypted packets on input path of transport mode, that is
not netfilter work.

On the other hand, for the users who want to use local NAT and IPsec
transport mode together, we might have to add netfilter hook to input
path. But I'm not sure how many such users are. If nobody want, hooks
we need are only LOCAL_OUT and POST_ROUTING on output path per tunnel.

> Unfortunately hiding the plain-text packets on output when transport
> mode SAs are used and the flag is not set adds a new inconsistency
> with NAT. In my last patchsets NAT was handled by redoing the policy
> lookup when a packet was NATed at LOCAL_OUT or POST_ROUTING and wasn't
> already transformed. If the new lookup yielded a policy
> ip_dst_output/__ip_dst_output was called again. The hooks were always
> called in the normal order. With a per-SA flag however we don't know
> if the packet should be hidden before the second lookup is done, so
> with NAT a packet that would usually be hidden might be visible
> on LOCAL_OUT and POST_ROUTING, or just LOCAL_OUT. This also affects
> ip_queue.

Sorry, maybe I don't understand. per-SA flag means that packets go through
netfilter hook before handling of its SA on output path ? Why it isn't
'after' ?

> So far the by far cleanest solution from a netfilter point of view
> was to ignore transport mode unless its the innermost transform on
> output and to always send the decapsulated packets through the stack
> again on input. Since Yoshifuji disagrees with this approach we seem
> to be deadlocked ..
> 
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--- Yasuyuki Kozakai

^ permalink raw reply

* [PATCH][MCAST]IPv6: Check packet size when process Multicast Address and Source Specific Query
From: Yan Zheng @ 2005-10-31  5:20 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, David Stevens


Signed-off-by: Yan Zheng <yanzheng@21cn.com>

Index: net/ipv6/mcast.c
================================================================================
--- linux-2.6.14/net/ipv6/mcast.c	2005-10-30 23:09:33.000000000 +0800
+++ linux/net/ipv6/mcast.c	2005-10-31 13:13:10.000000000 +0800
@@ -1156,7 +1156,12 @@ int igmp6_event_query(struct sk_buff *sk
 			return 0;
 		}
 		/* mark sources to include, if group & source-specific */
-		mark = mlh2->nsrcs != 0;
+		if (mlh2->nsrcs != 0) {
+			if (!pskb_may_pull(skb, mlh2->nsrcs * sizeof(struct in6_addr) +
+				(sizeof(struct mld2_query) - sizeof(struct icmp6hdr))))
+				return -EINVAL;
+			mark = 1;
+		}
 	} else {
 		in6_dev_put(idev);
 		return -EINVAL;

^ 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