[patch 1/2] e100 disable device on PCI error

2006-08-14 Thread akpm
From: Linas Vepstas <[EMAIL PROTECTED]>

A recent patch in -mm3 titled
"gregkh-pci-pci-don-t-enable-device-if-already-enabled.patch" causes
pci_enable_device() to be a no-op if the kernel thinks that the device is
already enabled.  This change breaks the PCI error recovery mechanism in
the e100 device driver, since, after PCI slot reset, the card is no longer
enabled.  This is a trivial fix for this problem.  Tested.

Signed-off-by: Linas Vepstas <[EMAIL PROTECTED]>
Cc: John Ronciak <[EMAIL PROTECTED]>
Cc: Jesse Brandeburg <[EMAIL PROTECTED]>
Cc: Jeff Kirsher <[EMAIL PROTECTED]>
Cc: Auke Kok <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/e100.c |1 +
 1 file changed, 1 insertion(+)

diff -puN drivers/net/e100.c~e100-disable-device-on-pci-error drivers/net/e100.c
--- a/drivers/net/e100.c~e100-disable-device-on-pci-error
+++ a/drivers/net/e100.c
@@ -2741,6 +2741,7 @@ static pci_ers_result_t e100_io_error_de
/* Detach; put netif into state similar to hotplug unplug. */
netif_poll_enable(netdev);
netif_device_detach(netdev);
+   pci_disable_device(pdev);
 
/* Request a slot reset. */
return PCI_ERS_RESULT_NEED_RESET;
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 2/2] e1000 disable device on PCI error

2006-08-14 Thread akpm
From: Linas Vepstas <[EMAIL PROTECTED]>

A recent patch in -mm3 titled
"gregkh-pci-pci-don-t-enable-device-if-already-enabled.patch" causes
pci_enable_device() to be a no-op if the kernel thinks that the device is
already enabled.  This change breaks the PCI error recovery mechanism in
the e1000 device driver, since, after PCI slot reset, the card is no longer
enabled.  This is a trivial fix for this problem.  Tested.

Signed-off-by: Linas Vepstas <[EMAIL PROTECTED]>
Cc: John Ronciak <[EMAIL PROTECTED]>
Cc: Jesse Brandeburg <[EMAIL PROTECTED]>
Cc: Jeff Kirsher <[EMAIL PROTECTED]>
Cc: Auke Kok <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_main.c |1 +
 1 file changed, 1 insertion(+)

diff -puN drivers/net/e1000/e1000_main.c~e1000-disable-device-on-pci-error 
drivers/net/e1000/e1000_main.c
--- a/drivers/net/e1000/e1000_main.c~e1000-disable-device-on-pci-error
+++ a/drivers/net/e1000/e1000_main.c
@@ -4782,6 +4782,7 @@ static pci_ers_result_t e1000_io_error_d
 
if (netif_running(netdev))
e1000_down(adapter);
+   pci_disable_device(pdev);
 
/* Request a slot slot reset. */
return PCI_ERS_RESULT_NEED_RESET;
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 40/41] FS_ENET: use PAL for mii management

2006-08-14 Thread akpm
From: Vitaly Bordug <[EMAIL PROTECTED]>

This patch should update the fs_enet infrastructure to utilize Phy Abstraction
Layer subsystem.  Along with the above, there are apparent bugfixes, overhaul
and improvements.

Signed-off-by: Vitaly Bordug <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/fs_enet/Makefile   |6 
 drivers/net/fs_enet/fec.h  |   42 ++
 drivers/net/fs_enet/fs_enet-main.c |  207 ++-
 drivers/net/fs_enet/fs_enet-mii.c  |  505 ---
 drivers/net/fs_enet/fs_enet.h  |   40 +-
 drivers/net/fs_enet/mac-fcc.c  |   32 +
 drivers/net/fs_enet/mac-fec.c  |  142 ---
 drivers/net/fs_enet/mac-scc.c  |4 
 drivers/net/fs_enet/mii-bitbang.c  |  448 ---
 drivers/net/fs_enet/mii-fec.c  |  243 
 drivers/net/fs_enet/mii-fixed.c|   91 
 11 files changed, 711 insertions(+), 1049 deletions(-)

diff -puN drivers/net/fs_enet/Makefile~fs_enet-use-pal-for-mii-management 
drivers/net/fs_enet/Makefile
--- a/drivers/net/fs_enet/Makefile~fs_enet-use-pal-for-mii-management
+++ a/drivers/net/fs_enet/Makefile
@@ -4,7 +4,7 @@
 
 obj-$(CONFIG_FS_ENET) += fs_enet.o
 
-obj-$(CONFIG_8xx) += mac-fec.o mac-scc.o
-obj-$(CONFIG_8260) += mac-fcc.o
+obj-$(CONFIG_8xx) += mac-fec.o mac-scc.o mii-fec.o
+obj-$(CONFIG_CPM2) += mac-fcc.o mii-bitbang.o
 
-fs_enet-objs := fs_enet-main.o fs_enet-mii.o mii-bitbang.o mii-fixed.o
+fs_enet-objs := fs_enet-main.o
diff -puN /dev/null drivers/net/fs_enet/fec.h
--- /dev/null
+++ a/drivers/net/fs_enet/fec.h
@@ -0,0 +1,42 @@
+#ifndef FS_ENET_FEC_H
+#define FS_ENET_FEC_H
+
+/* CRC polynomium used by the FEC for the multicast group filtering */
+#define FEC_CRC_POLY   0x04C11DB7
+
+#define FEC_MAX_MULTICAST_ADDRS64
+
+/* Interrupt events/masks.
+*/
+#define FEC_ENET_HBERR 0x8000U /* Heartbeat error  */
+#define FEC_ENET_BABR  0x4000U /* Babbling receiver*/
+#define FEC_ENET_BABT  0x2000U /* Babbling transmitter */
+#define FEC_ENET_GRA   0x1000U /* Graceful stop complete   */
+#define FEC_ENET_TXF   0x0800U /* Full frame transmitted   */
+#define FEC_ENET_TXB   0x0400U /* A buffer was transmitted */
+#define FEC_ENET_RXF   0x0200U /* Full frame received  */
+#define FEC_ENET_RXB   0x0100U /* A buffer was received*/
+#define FEC_ENET_MII   0x0080U /* MII interrupt*/
+#define FEC_ENET_EBERR 0x0040U /* SDMA bus error   */
+
+#define FEC_ECNTRL_PINMUX  0x0004
+#define FEC_ECNTRL_ETHER_EN0x0002
+#define FEC_ECNTRL_RESET   0x0001
+
+#define FEC_RCNTRL_BC_REJ  0x0010
+#define FEC_RCNTRL_PROM0x0008
+#define FEC_RCNTRL_MII_MODE0x0004
+#define FEC_RCNTRL_DRT 0x0002
+#define FEC_RCNTRL_LOOP0x0001
+
+#define FEC_TCNTRL_FDEN0x0004
+#define FEC_TCNTRL_HBC 0x0002
+#define FEC_TCNTRL_GTS 0x0001
+
+
+
+/*
+ * Delay to wait for FEC reset command to complete (in us)
+ */
+#define FEC_RESET_DELAY50
+#endif
diff -puN drivers/net/fs_enet/fs_enet-main.c~fs_enet-use-pal-for-mii-management 
drivers/net/fs_enet/fs_enet-main.c
--- a/drivers/net/fs_enet/fs_enet-main.c~fs_enet-use-pal-for-mii-management
+++ a/drivers/net/fs_enet/fs_enet-main.c
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -682,35 +683,6 @@ static void fs_free_irq(struct net_devic
(*fep->ops->post_free_irq)(dev, irq);
 }
 
-/**/
-
-/* This interrupt occurs when the PHY detects a link change. */
-static irqreturn_t
-fs_mii_link_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-{
-   struct net_device *dev = dev_id;
-   struct fs_enet_private *fep;
-   const struct fs_platform_info *fpi;
-
-   fep = netdev_priv(dev);
-   fpi = fep->fpi;
-
-   /*
-* Acknowledge the interrupt if possible. If we have not
-* found the PHY yet we can't process or acknowledge the
-* interrupt now. Instead we ignore this interrupt for now,
-* which we can do since it is edge triggered. It will be
-* acknowledged later by fs_enet_open().
-*/
-   if (!fep->phy)
-   return IRQ_NONE;
-
-   fs_mii_ack_int(dev);
-   fs_mii_link_status_change_check(dev, 0);
-
-   return IRQ_HANDLED;
-}
-
 static void fs_timeout(struct net_device *dev)
 {
struct fs_enet_private *fep = netdev_priv(dev);
@@ -722,10 +694,13 @@ static void fs_timeout(struct net_device
spin_lock_irqsave(&fep->lock, flags);
 
if (dev->flags & IFF_UP) {
+   phy_stop(fep->phydev);
(*fep->ops->stop)(dev);
(*fep->ops->restart)(dev);
+   phy_start(fep->phydev);
}
 
+   phy_start(fep->phydev)

[patch 30/41] via-rhine: NAPI support

2006-08-14 Thread akpm
From: Roger Luethi <[EMAIL PROTECTED]>

Add NAPI support to the via-rhine driver so that it can handle higher
speeds and doesn't get overloaded by interrupts as easily.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
Signed-off-by: Roger Luethi <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/Kconfig |   14 ++
 drivers/net/via-rhine.c |   77 --
 2 files changed, 79 insertions(+), 12 deletions(-)

diff -puN drivers/net/Kconfig~via-rhine-napi-support drivers/net/Kconfig
--- a/drivers/net/Kconfig~via-rhine-napi-support
+++ a/drivers/net/Kconfig
@@ -1740,6 +1740,20 @@ config VIA_RHINE_MMIO
 
  If unsure, say Y.
 
+config VIA_RHINE_NAPI
+   bool "Use Rx Polling (NAPI)"
+   depends on VIA_RHINE
+   help
+ NAPI is a new driver API designed to reduce CPU and interrupt load
+ when the driver is receiving lots of packets from the card.
+
+ If your estimated Rx load is 10kpps or more, or if the card will be
+ deployed on potentially unfriendly networks (e.g. in a firewall),
+ then say Y here.
+
+ See  for more
+ information.
+
 config LAN_SAA9730
bool "Philips SAA9730 Ethernet support (EXPERIMENTAL)"
depends on NET_PCI && EXPERIMENTAL && MIPS
diff -puN drivers/net/via-rhine.c~via-rhine-napi-support drivers/net/via-rhine.c
--- a/drivers/net/via-rhine.c~via-rhine-napi-support
+++ a/drivers/net/via-rhine.c
@@ -30,8 +30,8 @@
 */
 
 #define DRV_NAME   "via-rhine"
-#define DRV_VERSION"1.4.0"
-#define DRV_RELDATE"June-27-2006"
+#define DRV_VERSION"1.4.1"
+#define DRV_RELDATE"July-24-2006"
 
 
 /* A few user-configurable values.
@@ -63,7 +63,11 @@ static const int multicast_filter_limit 
There are no ill effects from too-large receive rings. */
 #define TX_RING_SIZE   16
 #define TX_QUEUE_LEN   10  /* Limit ring entries actually used. */
+#ifdef CONFIG_VIA_RHINE_NAPI
+#define RX_RING_SIZE   64
+#else
 #define RX_RING_SIZE   16
+#endif
 
 
 /* Operational parameters that usually are not changed. */
@@ -396,7 +400,7 @@ static void rhine_tx_timeout(struct net_
 static int  rhine_start_tx(struct sk_buff *skb, struct net_device *dev);
 static irqreturn_t rhine_interrupt(int irq, void *dev_instance, struct pt_regs 
*regs);
 static void rhine_tx(struct net_device *dev);
-static void rhine_rx(struct net_device *dev);
+static int rhine_rx(struct net_device *dev, int limit);
 static void rhine_error(struct net_device *dev, int intr_status);
 static void rhine_set_rx_mode(struct net_device *dev);
 static struct net_device_stats *rhine_get_stats(struct net_device *dev);
@@ -564,6 +568,32 @@ static void rhine_poll(struct net_device
 }
 #endif
 
+#ifdef CONFIG_VIA_RHINE_NAPI
+static int rhine_napipoll(struct net_device *dev, int *budget)
+{
+   struct rhine_private *rp = netdev_priv(dev);
+   void __iomem *ioaddr = rp->base;
+   int done, limit = min(dev->quota, *budget);
+
+   done = rhine_rx(dev, limit);
+   *budget -= done;
+   dev->quota -= done;
+
+   if (done < limit) {
+   netif_rx_complete(dev);
+
+   iowrite16(IntrRxDone | IntrRxErr | IntrRxEmpty| IntrRxOverflow |
+ IntrRxDropped | IntrRxNoBuf | IntrTxAborted |
+ IntrTxDone | IntrTxError | IntrTxUnderrun |
+ IntrPCIErr | IntrStatsMax | IntrLinkChange,
+ ioaddr + IntrEnable);
+   return 0;
+   }
+   else
+   return 1;
+}
+#endif
+
 static void rhine_hw_init(struct net_device *dev, long pioaddr)
 {
struct rhine_private *rp = netdev_priv(dev);
@@ -744,6 +774,10 @@ static int __devinit rhine_init_one(stru
 #ifdef CONFIG_NET_POLL_CONTROLLER
dev->poll_controller = rhine_poll;
 #endif
+#ifdef CONFIG_VIA_RHINE_NAPI
+   dev->poll = rhine_napipoll;
+   dev->weight = 64;
+#endif
if (rp->quirks & rqRhineI)
dev->features |= NETIF_F_SG|NETIF_F_HW_CSUM;
 
@@ -1165,6 +1199,7 @@ static void rhine_tx_timeout(struct net_
dev->trans_start = jiffies;
rp->stats.tx_errors++;
netif_wake_queue(dev);
+   netif_poll_enable(dev);
 }
 
 static int rhine_start_tx(struct sk_buff *skb, struct net_device *dev)
@@ -1268,8 +1303,18 @@ static irqreturn_t rhine_interrupt(int i
   dev->name, intr_status);
 
if (intr_status & (IntrRxDone | IntrRxErr | IntrRxDropped |
-   IntrRxWakeUp | IntrRxEmpty | IntrRxNoBuf))
-   rhine_rx(dev);
+  IntrRxWakeUp | IntrRxEmpty | IntrRxNoBuf)) {
+#ifdef CONFIG_VIA_RHINE_NAPI
+   iowrite16(IntrTxAborted |
+ IntrTxDone | IntrTxError | IntrTxUnderrun |
+ IntrPCIErr | IntrStatsMax | IntrLinkChange,
+ ioaddr + 

[patch 38/41] xircom_cb: wire up errors from pci_register_driver()

2006-08-14 Thread akpm
From: Alexey Dobriyan <[EMAIL PROTECTED]>

Signed-off-by: Alexey Dobriyan <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Dominik Brodowski <[EMAIL PROTECTED]>
Cc: Valerie Henson <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/tulip/xircom_cb.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff -puN 
drivers/net/tulip/xircom_cb.c~xircom_cb-wire-up-errors-from-pci_register_driver 
drivers/net/tulip/xircom_cb.c
--- 
a/drivers/net/tulip/xircom_cb.c~xircom_cb-wire-up-errors-from-pci_register_driver
+++ a/drivers/net/tulip/xircom_cb.c
@@ -1264,8 +1264,7 @@ static void investigate_write_descriptor
 
 static int __init xircom_init(void)
 {
-   pci_register_driver(&xircom_ops);
-   return 0;
+   return pci_register_driver(&xircom_ops);
 }
 
 static void __exit xircom_exit(void)
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 35/41] Add ethtool -g support to Spidernet network driver

2006-08-14 Thread akpm
From: Jim Lewis <[EMAIL PROTECTED]>

Add ethtool -g (show ring sizes) support to the Spidernet network driver.

Signed-off-by: James K Lewis <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/spider_net.c |   12 +++-
 drivers/net/spider_net.h |3 +++
 drivers/net/spider_net_ethtool.c |   13 +
 3 files changed, 23 insertions(+), 5 deletions(-)

diff -puN 
drivers/net/spider_net.c~add-ethtool-g-support-to-spidernet-network-driver 
drivers/net/spider_net.c
--- a/drivers/net/spider_net.c~add-ethtool-g-support-to-spidernet-network-driver
+++ a/drivers/net/spider_net.c
@@ -1611,13 +1611,12 @@ spider_net_open(struct net_device *netde
int result;
 
result = -ENOMEM;
-   if (spider_net_init_chain(card, &card->tx_chain,
-   card->descr,
-   PCI_DMA_TODEVICE, tx_descriptors))
+   if (spider_net_init_chain(card, &card->tx_chain, card->descr,
+   PCI_DMA_TODEVICE, card->tx_desc))
goto alloc_tx_failed;
if (spider_net_init_chain(card, &card->rx_chain,
-   card->descr + tx_descriptors,
-   PCI_DMA_FROMDEVICE, rx_descriptors))
+   card->descr + card->rx_desc,
+   PCI_DMA_FROMDEVICE, card->rx_desc))
goto alloc_rx_failed;
 
/* allocate rx skbs */
@@ -2005,6 +2004,9 @@ spider_net_setup_netdev(struct spider_ne
 
card->options.rx_csum = SPIDER_NET_RX_CSUM_DEFAULT;
 
+   card->tx_desc = tx_descriptors;
+   card->rx_desc = rx_descriptors;
+
spider_net_setup_netdev_ops(netdev);
 
netdev->features = NETIF_F_HW_CSUM | NETIF_F_LLTX;
diff -puN 
drivers/net/spider_net.h~add-ethtool-g-support-to-spidernet-network-driver 
drivers/net/spider_net.h
--- a/drivers/net/spider_net.h~add-ethtool-g-support-to-spidernet-network-driver
+++ a/drivers/net/spider_net.h
@@ -440,6 +440,9 @@ struct spider_net_card {
/* for ethtool */
int msg_enable;
 
+   int rx_desc;
+   int tx_desc;
+
struct spider_net_descr descr[0];
 };
 
diff -puN 
drivers/net/spider_net_ethtool.c~add-ethtool-g-support-to-spidernet-network-driver
 drivers/net/spider_net_ethtool.c
--- 
a/drivers/net/spider_net_ethtool.c~add-ethtool-g-support-to-spidernet-network-driver
+++ a/drivers/net/spider_net_ethtool.c
@@ -130,6 +130,18 @@ spider_net_ethtool_set_tx_csum(struct ne
 return 0;
 }
 
+static void
+spider_net_ethtool_get_ringparam(struct net_device *netdev,
+struct ethtool_ringparam *ering)
+{
+   struct spider_net_card *card = netdev->priv;
+
+   ering->tx_max_pending = SPIDER_NET_TX_DESCRIPTORS_MAX;
+   ering->tx_pending = card->tx_desc;
+   ering->rx_max_pending = SPIDER_NET_RX_DESCRIPTORS_MAX;
+   ering->rx_pending = card->rx_desc;
+}
+
 struct ethtool_ops spider_net_ethtool_ops = {
.get_settings   = spider_net_ethtool_get_settings,
.get_drvinfo= spider_net_ethtool_get_drvinfo,
@@ -141,5 +153,6 @@ struct ethtool_ops spider_net_ethtool_op
.set_rx_csum= spider_net_ethtool_set_rx_csum,
.get_tx_csum= spider_net_ethtool_get_tx_csum,
.set_tx_csum= spider_net_ethtool_set_tx_csum,
+   .get_ringparam  = spider_net_ethtool_get_ringparam,
 };
 
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 32/41] lockdep: fix smc91x

2006-08-14 Thread akpm
From: Russell King <[EMAIL PROTECTED]>

When booting using root-nfs, I'm seeing (independently) two lockdep dumps
in the smc91x driver.  The patch below fixes both.  Both dumps look like
real locking issues.

Nico - please review and ack if you think the patch is correct.

Dump 1:

Sending DHCP requests .
=
[ INFO: inconsistent lock state ]
-
inconsistent {hardirq-on-W} -> {in-hardirq-W} usage.
swapper/0 [HC1[1]:SC0[0]:HE0:SE1] takes:
 (&lp->lock){+-..}, at: [] smc_interrupt+0x24/0x740
{hardirq-on-W} state was registered at:
  [] lock_acquire+0x80/0x94
  [] _spin_lock+0x30/0x40
  [] smc_reset+0x2c/0x140
  [] smc_drv_probe+0x288/0x720
  [] platform_drv_probe+0x20/0x24
  [] driver_probe_device+0x8c/0xd4
  [] __driver_attach+0x88/0xe8
  [] bus_for_each_dev+0x50/0x84
  [] driver_attach+0x20/0x28
  [] bus_add_driver+0x6c/0x138
  [] driver_register+0x90/0xa0
  [] platform_driver_register+0x6c/0x88
  [] smc_init+0x14/0x1c
  [] init+0x140/0x318
  [] do_exit+0x0/0x83c
irq event stamp: 19510
hardirqs last  enabled at (19509): [] default_idle+0x40/0x4c
hardirqs last disabled at (19510): [] __irq_svc+0x28/0xc0
softirqs last  enabled at (19504): [] __do_softirq+0xf4/0x10c
softirqs last disabled at (19495): [] irq_exit+0x54/0x5c

other info that might help us debug this:
no locks held by swapper/0.

stack backtrace:
[] (dump_stack+0x0/0x14) from [] 
(print_usage_bug+0x19c/0x1f0)
[] (print_usage_bug+0x0/0x1f0) from [] 
(mark_lock+0xf4/0x5b8)
[] (mark_lock+0x0/0x5b8) from [] 
(__lock_acquire+0x50c/0xdd4)
 r8 = C021F520  r7 = C021F7DC  r6 =   r5 = C02B11F4
 r4 = 
[] (__lock_acquire+0x0/0xdd4) from [] 
(lock_acquire+0x80/0x94)
[] (lock_acquire+0x0/0x94) from [] (_spin_lock+0x30/0x40)
[] (_spin_lock+0x0/0x40) from [] (smc_interrupt+0x24/0x740)
 r4 = C06EFB20
[] (smc_interrupt+0x0/0x740) from [] 
(handle_IRQ_event+0x34/0x6c)
[] (handle_IRQ_event+0x0/0x6c) from [] 
(handle_level_irq+0xe8/0x158)
 r8 = C021BF48  r7 = C021D124  r6 = C06EFB20  r5 = 0029
 r4 = C021D100
[] (handle_level_irq+0x0/0x158) from [] 
(asm_do_IRQ+0x54/0x64)
 r8 = C001A680  r7 = 8000  r6 = 0029  r5 = F1100100
 r4 = C021D100
[] (asm_do_IRQ+0x0/0x64) from [] (__irq_svc+0x28/0xc0)
 r4 = 
[] (default_idle+0x0/0x4c) from [] (cpu_idle+0x68/0x88)
 r4 = C0021A64
[] (cpu_idle+0x0/0x88) from [] (__init_end+0x28/0x30)
 r5 = C0274DB4  r4 = C03AC520
[] (__init_end+0x0/0x30) from [] (start_kernel+0x270/0x2dc)
[] (start_kernel+0x0/0x2dc) from [<8078>] (0x8078)
 r8 = 0001A078  r7 = C03C0328  r6 = C0220984  r5 = C0275240
 r4 = 00C5387D
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1

Dump 2:

Sending DHCP requests .
=
[ INFO: inconsistent lock state ]
-
inconsistent {hardirq-on-W} -> {in-hardirq-W} usage.
swapper/0 [HC1[1]:SC0[0]:HE0:SE1] takes:
 (&lp->lock){+-..}, at: [] smc_interrupt+0x24/0x740
{hardirq-on-W} state was registered at:
  [] lock_acquire+0x80/0x94
  [] _spin_lock+0x30/0x40
  [] smc_shutdown+0x20/0x74
  [] smc_drv_probe+0x488/0x720
  [] platform_drv_probe+0x20/0x24
  [] driver_probe_device+0x8c/0xd4
  [] __driver_attach+0x88/0xe8
  [] bus_for_each_dev+0x50/0x84
  [] driver_attach+0x20/0x28
  [] bus_add_driver+0x6c/0x138
  [] driver_register+0x90/0xa0
  [] platform_driver_register+0x6c/0x88
  [] smc_init+0x14/0x1c
  [] init+0x140/0x318
  [] do_exit+0x0/0x83c
irq event stamp: 19304
hardirqs last  enabled at (19303): [] default_idle+0x40/0x4c
hardirqs last disabled at (19304): [] __irq_svc+0x28/0xc0
softirqs last  enabled at (19298): [] __do_softirq+0xf4/0x10c
softirqs last disabled at (19289): [] irq_exit+0x54/0x5c

other info that might help us debug this:
no locks held by swapper/0.

stack backtrace:
[] (dump_stack+0x0/0x14) from [] 
(print_usage_bug+0x19c/0x1f0)
[] (print_usage_bug+0x0/0x1f0) from [] 
(mark_lock+0xf4/0x5b8)
[] (mark_lock+0x0/0x5b8) from [] 
(__lock_acquire+0x50c/0xdd4)
 r8 = C021F520  r7 = C021F7DC  r6 =   r5 = C02B11F4
 r4 = 
[] (__lock_acquire+0x0/0xdd4) from [] 
(lock_acquire+0x80/0x94)
[] (lock_acquire+0x0/0x94) from [] (_spin_lock+0x30/0x40)
[] (_spin_lock+0x0/0x40) from [] (smc_interrupt+0x24/0x740)
 r4 = C06EFB20
[] (smc_interrupt+0x0/0x740) from [] 
(handle_IRQ_event+0x34/0x6c)
[] (handle_IRQ_event+0x0/0x6c) from [] 
(handle_level_irq+0xe8/0x158)
 r8 = C021BF48  r7 = C021D124  r6 = C06EFB20  r5 = 0029
 r4 = C021D100
[] (handle_level_irq+0x0/0x158) from [] 
(asm_do_IRQ+0x54/0x64)
 r8 = C001A680  r7 = 8000  r6 = 0029  r5 = F1100100
 r4 = C021D100
[] (asm_do_IRQ+0x0/0x64) from [] (__irq_svc+0x28/0xc0)
 r4 = 
[] (default_idle+0x0/0x4c) from [] (cpu_idle+0x68/0x88)
 r4 = C0021A64
[] (cpu_idle+0x0/0x88) from [] (__init_end+0x28/0x30)
 r5 = C0274DB4  r4 = C03AC520
[] (__init_end+0x0/0x30) from [] (start_kernel+0x270/0x2dc)
[] (start_kernel+0x0/0x2dc) from [<8078>] (0x8078)
 r8 = 0001A078  r7 = C03C0328  r6 = C0220984  r5 = C0275240
 r4 =

[patch 13/13] net/ipv6/ip6_fib.c: make code static

2006-08-14 Thread akpm
From: Adrian Bunk <[EMAIL PROTECTED]>

Make the following needlessly global code static:
- fib6_walker_lock
- struct fib6_walker_list
- fib6_walk_continue()
- fib6_walk()

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 include/net/ip6_fib.h |   25 -
 net/ipv6/ip6_fib.c|   29 -
 2 files changed, 24 insertions(+), 30 deletions(-)

diff -puN include/net/ip6_fib.h~net-ipv6-ip6_fibc-make-code-static 
include/net/ip6_fib.h
--- a/include/net/ip6_fib.h~net-ipv6-ip6_fibc-make-code-static
+++ a/include/net/ip6_fib.h
@@ -92,28 +92,6 @@ struct fib6_walker_t
void *args;
 };
 
-extern struct fib6_walker_t fib6_walker_list;
-extern rwlock_t fib6_walker_lock;
-
-static inline void fib6_walker_link(struct fib6_walker_t *w)
-{
-   write_lock_bh(&fib6_walker_lock);
-   w->next = fib6_walker_list.next;
-   w->prev = &fib6_walker_list;
-   w->next->prev = w;
-   w->prev->next = w;
-   write_unlock_bh(&fib6_walker_lock);
-}
-
-static inline void fib6_walker_unlink(struct fib6_walker_t *w)
-{
-   write_lock_bh(&fib6_walker_lock);
-   w->next->prev = w->prev;
-   w->prev->next = w->next;
-   w->prev = w->next = w;
-   write_unlock_bh(&fib6_walker_lock);
-}
-
 struct rt6_statistics {
__u32   fib_nodes;
__u32   fib_route_nodes;
@@ -195,9 +173,6 @@ struct fib6_node*fib6_locate(struct fi
 extern voidfib6_clean_all(int (*func)(struct rt6_info *, 
void *arg),
   int prune, void *arg);
 
-extern int fib6_walk(struct fib6_walker_t *w);
-extern int fib6_walk_continue(struct fib6_walker_t *w);
-
 extern int fib6_add(struct fib6_node *root,
 struct rt6_info *rt,
 struct nlmsghdr *nlh,
diff -puN net/ipv6/ip6_fib.c~net-ipv6-ip6_fibc-make-code-static 
net/ipv6/ip6_fib.c
--- a/net/ipv6/ip6_fib.c~net-ipv6-ip6_fibc-make-code-static
+++ a/net/ipv6/ip6_fib.c
@@ -69,8 +69,7 @@ struct fib6_cleaner_t
void *arg;
 };
 
-DEFINE_RWLOCK(fib6_walker_lock);
-
+static DEFINE_RWLOCK(fib6_walker_lock);
 
 #ifdef CONFIG_IPV6_SUBTREES
 #define FWS_INIT FWS_S
@@ -82,6 +81,8 @@ DEFINE_RWLOCK(fib6_walker_lock);
 
 static void fib6_prune_clones(struct fib6_node *fn, struct rt6_info *rt);
 static struct fib6_node * fib6_repair_tree(struct fib6_node *fn);
+static int fib6_walk(struct fib6_walker_t *w);
+static int fib6_walk_continue(struct fib6_walker_t *w);
 
 /*
  * A routing update causes an increase of the serial number on the
@@ -94,13 +95,31 @@ static __u32 rt_sernum;
 
 static DEFINE_TIMER(ip6_fib_timer, fib6_run_gc, 0, 0);
 
-struct fib6_walker_t fib6_walker_list = {
+static struct fib6_walker_t fib6_walker_list = {
.prev   = &fib6_walker_list,
.next   = &fib6_walker_list, 
 };
 
 #define FOR_WALKERS(w) for ((w)=fib6_walker_list.next; (w) != 
&fib6_walker_list; (w)=(w)->next)
 
+static inline void fib6_walker_link(struct fib6_walker_t *w)
+{
+   write_lock_bh(&fib6_walker_lock);
+   w->next = fib6_walker_list.next;
+   w->prev = &fib6_walker_list;
+   w->next->prev = w;
+   w->prev->next = w;
+   write_unlock_bh(&fib6_walker_lock);
+}
+
+static inline void fib6_walker_unlink(struct fib6_walker_t *w)
+{
+   write_lock_bh(&fib6_walker_lock);
+   w->next->prev = w->prev;
+   w->prev->next = w->next;
+   w->prev = w->next = w;
+   write_unlock_bh(&fib6_walker_lock);
+}
 static __inline__ u32 fib6_new_sernum(void)
 {
u32 n = ++rt_sernum;
@@ -1173,7 +1192,7 @@ int fib6_del(struct rt6_info *rt, struct
  * <0  -> walk is terminated by an error.
  */
 
-int fib6_walk_continue(struct fib6_walker_t *w)
+static int fib6_walk_continue(struct fib6_walker_t *w)
 {
struct fib6_node *fn, *pn;
 
@@ -1247,7 +1266,7 @@ int fib6_walk_continue(struct fib6_walke
}
 }
 
-int fib6_walk(struct fib6_walker_t *w)
+static int fib6_walk(struct fib6_walker_t *w)
 {
int res;
 
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 12/13] net/decnet/: cleanups

2006-08-14 Thread akpm
From: Adrian Bunk <[EMAIL PROTECTED]>

- make the following needlessly global functions static:
  - dn_fib.c: dn_fib_sync_down()
  - dn_fib.c: dn_fib_sync_up()
  - dn_rules.c: dn_fib_rule_action()
- remove the following unneeded prototype:
  - dn_fib.c: dn_cache_dump()

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 include/net/dn_fib.h  |3 ---
 net/decnet/dn_fib.c   |9 +
 net/decnet/dn_rules.c |4 ++--
 3 files changed, 7 insertions(+), 9 deletions(-)

diff -puN include/net/dn_fib.h~net-decnet-cleanups include/net/dn_fib.h
--- a/include/net/dn_fib.h~net-decnet-cleanups
+++ a/include/net/dn_fib.h
@@ -131,9 +131,6 @@ extern __le16 dn_fib_get_attr16(struct r
 extern void dn_fib_flush(void);
 extern void dn_fib_select_multipath(const struct flowi *fl,
struct dn_fib_res *res);
-extern int dn_fib_sync_down(__le16 local, struct net_device *dev,
-   int force);
-extern int dn_fib_sync_up(struct net_device *dev);
 
 /*
  * dn_tables.c
diff -puN net/decnet/dn_fib.c~net-decnet-cleanups net/decnet/dn_fib.c
--- a/net/decnet/dn_fib.c~net-decnet-cleanups
+++ a/net/decnet/dn_fib.c
@@ -55,8 +55,6 @@
 
 #define endfor_nexthops(fi) }
 
-extern int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb);
-
 static DEFINE_SPINLOCK(dn_fib_multipath_lock);
 static struct dn_fib_info *dn_fib_info_list;
 static DEFINE_SPINLOCK(dn_fib_info_lock);
@@ -80,6 +78,9 @@ static struct
[RTN_XRESOLVE] ={ .error = -EINVAL, .scope = RT_SCOPE_NOWHERE },
 };
 
+static int dn_fib_sync_down(__le16 local, struct net_device *dev, int force);
+static int dn_fib_sync_up(struct net_device *dev);
+
 void dn_fib_free_info(struct dn_fib_info *fi)
 {
if (fi->fib_dead == 0) {
@@ -651,7 +652,7 @@ static int dn_fib_dnaddr_event(struct no
return NOTIFY_DONE;
 }
 
-int dn_fib_sync_down(__le16 local, struct net_device *dev, int force)
+static int dn_fib_sync_down(__le16 local, struct net_device *dev, int force)
 {
 int ret = 0;
 int scope = RT_SCOPE_NOWHERE;
@@ -695,7 +696,7 @@ int dn_fib_sync_down(__le16 local, struc
 }
 
 
-int dn_fib_sync_up(struct net_device *dev)
+static int dn_fib_sync_up(struct net_device *dev)
 {
 int ret = 0;
 
diff -puN net/decnet/dn_rules.c~net-decnet-cleanups net/decnet/dn_rules.c
--- a/net/decnet/dn_rules.c~net-decnet-cleanups
+++ a/net/decnet/dn_rules.c
@@ -75,8 +75,8 @@ int dn_fib_lookup(struct flowi *flp, str
return err;
 }
 
-int dn_fib_rule_action(struct fib_rule *rule, struct flowi *flp, int flags,
-  struct fib_lookup_arg *arg)
+static int dn_fib_rule_action(struct fib_rule *rule, struct flowi *flp,
+ int flags, struct fib_lookup_arg *arg)
 {
int err = -EAGAIN;
struct dn_fib_table *tbl;
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 07/13] security/selinux/hooks.c: make 4 functions static

2006-08-14 Thread akpm
From: Adrian Bunk <[EMAIL PROTECTED]>

This patch makes four needlessly global functions static.

(akpm: applicable to the selinux updates in net-2.6.19.git)

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
Acked-by: James Morris <[EMAIL PROTECTED]>
Cc: "David S. Miller" <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 security/selinux/hooks.c |   12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff -puN 
security/selinux/hooks.c~security-selinux-hooksc-make-4-functions-static 
security/selinux/hooks.c
--- a/security/selinux/hooks.c~security-selinux-hooksc-make-4-functions-static
+++ a/security/selinux/hooks.c
@@ -3598,7 +3598,7 @@ static void selinux_sk_getsecid(struct s
}
 }
 
-void selinux_sock_graft(struct sock* sk, struct socket *parent)
+static void selinux_sock_graft(struct sock* sk, struct socket *parent)
 {
struct inode_security_struct *isec = SOCK_INODE(parent)->i_security;
struct sk_security_struct *sksec = sk->sk_security;
@@ -3608,8 +3608,8 @@ void selinux_sock_graft(struct sock* sk,
selinux_netlbl_sock_graft(sk, parent);
 }
 
-int selinux_inet_conn_request(struct sock *sk, struct sk_buff *skb,
-  struct request_sock *req)
+static int selinux_inet_conn_request(struct sock *sk, struct sk_buff *skb,
+struct request_sock *req)
 {
struct sk_security_struct *sksec = sk->sk_security;
int err;
@@ -3638,7 +3638,8 @@ int selinux_inet_conn_request(struct soc
return 0;
 }
 
-void selinux_inet_csk_clone(struct sock *newsk, const struct request_sock *req)
+static void selinux_inet_csk_clone(struct sock *newsk,
+  const struct request_sock *req)
 {
struct sk_security_struct *newsksec = newsk->sk_security;
 
@@ -3649,7 +3650,8 @@ void selinux_inet_csk_clone(struct sock 
   time it will have been created and available. */
 }
 
-void selinux_req_classify_flow(const struct request_sock *req, struct flowi 
*fl)
+static void selinux_req_classify_flow(const struct request_sock *req,
+ struct flowi *fl)
 {
fl->secid = req->secid;
 }
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 11/13] constify Tigon3 ether firmware structs

2006-08-14 Thread akpm
From: Andreas Mohr <[EMAIL PROTECTED]>

Constify largish areas of firmware data in Tigon3 ethernet driver.

non-const:

lsmod:
tg3   101404  0

objdump -x:
.rodata 03e8
.data 4a0c

ls -l:
-rw-r--r-- 1 root root 114404 2006-08-19 21:36 drivers/net/tg3.ko

const:

lsmod:
tg3   101404  0

objdump -x:
.rodata 42c8
.data 0b4c

ls -l:
-rw-r--r-- 1 root root 114532 2006-08-19 21:06 drivers/net/tg3.ko

Signed-off-by: Andreas Mohr <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/tg3.c |   26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff -puN drivers/net/tg3.c~constify-tigon3-ether-firmware-structs 
drivers/net/tg3.c
--- a/drivers/net/tg3.c~constify-tigon3-ether-firmware-structs
+++ a/drivers/net/tg3.c
@@ -264,7 +264,7 @@ static struct pci_device_id tg3_pci_tbl[
 
 MODULE_DEVICE_TABLE(pci, tg3_pci_tbl);
 
-static struct {
+static const struct {
const char string[ETH_GSTRING_LEN];
 } ethtool_stats_keys[TG3_NUM_STATS] = {
{ "rx_octets" },
@@ -345,7 +345,7 @@ static struct {
{ "nic_tx_threshold_hit" }
 };
 
-static struct {
+static const struct {
const char string[ETH_GSTRING_LEN];
 } ethtool_test_keys[TG3_NUM_TEST] = {
{ "nvram test (online) " },
@@ -4969,7 +4969,7 @@ static int tg3_halt(struct tg3 *tp, int 
 #define TG3_FW_BSS_ADDR0x08000a70
 #define TG3_FW_BSS_LEN 0x10
 
-static u32 tg3FwText[(TG3_FW_TEXT_LEN / sizeof(u32)) + 1] = {
+static const u32 tg3FwText[(TG3_FW_TEXT_LEN / sizeof(u32)) + 1] = {
0x, 0x1003, 0x, 0x000d, 0x000d, 0x3c1d0800,
0x37bd3ffc, 0x03a0f021, 0x3c100800, 0x2610, 0x0e18, 0x,
0x000d, 0x3c1d0800, 0x37bd3ffc, 0x03a0f021, 0x3c100800, 0x26100034,
@@ -5063,7 +5063,7 @@ static u32 tg3FwText[(TG3_FW_TEXT_LEN / 
0x27bd0008, 0x03e8, 0x, 0x, 0x
 };
 
-static u32 tg3FwRodata[(TG3_FW_RODATA_LEN / sizeof(u32)) + 1] = {
+static const u32 tg3FwRodata[(TG3_FW_RODATA_LEN / sizeof(u32)) + 1] = {
0x35373031, 0x726c7341, 0x, 0x, 0x53774576, 0x656e7430,
0x, 0x726c7045, 0x76656e74, 0x3100, 0x556e6b6e, 0x45766e74,
0x, 0x, 0x, 0x, 0x66617461, 0x6c457272,
@@ -5128,13 +5128,13 @@ static int tg3_halt_cpu(struct tg3 *tp, 
 struct fw_info {
unsigned int text_base;
unsigned int text_len;
-   u32 *text_data;
+   const u32 *text_data;
unsigned int rodata_base;
unsigned int rodata_len;
-   u32 *rodata_data;
+   const u32 *rodata_data;
unsigned int data_base;
unsigned int data_len;
-   u32 *data_data;
+   const u32 *data_data;
 };
 
 /* tp->lock is held. */
@@ -5266,7 +5266,7 @@ static int tg3_load_5701_a0_firmware_fix
 #define TG3_TSO_FW_BSS_ADDR0x08001b80
 #define TG3_TSO_FW_BSS_LEN 0x894
 
-static u32 tg3TsoFwText[(TG3_TSO_FW_TEXT_LEN / 4) + 1] = {
+static const u32 tg3TsoFwText[(TG3_TSO_FW_TEXT_LEN / 4) + 1] = {
0x0e03, 0x, 0x08001b24, 0x, 0x1003, 0x,
0x000d, 0x000d, 0x3c1d0800, 0x37bd4000, 0x03a0f021, 0x3c100800,
0x2610, 0x0e10, 0x, 0x000d, 0x27bdffe0, 0x3c04fefe,
@@ -5553,7 +5553,7 @@ static u32 tg3TsoFwText[(TG3_TSO_FW_TEXT
0xac470014, 0xac4a0018, 0x03e8, 0xac4b001c, 0x, 0x,
 };
 
-static u32 tg3TsoFwRodata[] = {
+static const u32 tg3TsoFwRodata[] = {
0x4d61696e, 0x43707542, 0x, 0x4d61696e, 0x43707541, 0x,
0x, 0x, 0x73746b6f, 0x6c64, 0x496e, 0x73746b6f,
0x2a2a, 0x, 0x53774576, 0x656e7430, 0x, 0x,
@@ -5561,7 +5561,7 @@ static u32 tg3TsoFwRodata[] = {
0x,
 };
 
-static u32 tg3TsoFwData[] = {
+static const u32 tg3TsoFwData[] = {
0x, 0x73746b6f, 0x6c64, 0x5f76312e, 0x362e3000, 0x,
0x, 0x, 0x, 0x, 0x, 0x,
0x,
@@ -5583,7 +5583,7 @@ static u32 tg3TsoFwData[] = {
 #define TG3_TSO5_FW_BSS_ADDR   0x00010f50
 #define TG3_TSO5_FW_BSS_LEN0x88
 
-static u32 tg3Tso5FwText[(TG3_TSO5_FW_TEXT_LEN / 4) + 1] = {
+static const u32 tg3Tso5FwText[(TG3_TSO5_FW_TEXT_LEN / 4) + 1] = {
0x0c004003, 0x, 0x00010f04, 0x, 0x1003, 0x,
0x000d, 0x000d, 0x3c1d0001, 0x37bde000, 0x03a0f021, 0x3c11,
0x2610, 0x0c004010, 0x, 0x000d, 0x27bdffe0, 0x3c04fefe,
@@ -5742,14 +5742,14 @@ static u32 tg3Tso5FwText[(TG3_TSO5_FW_TE
0x, 0x, 0x,
 };
 
-static u32 tg3Tso5FwRodata[(TG3_TSO5_FW_RODATA_LEN / 4) + 1] = {
+static const u32 tg3Tso5FwRodata[(TG3_TSO5_FW_RODATA_LEN / 4) + 1] = {
0x4d61696e, 0x43707542, 0x, 0x4d61696e, 0x43707541, 0x

[patch 04/13] IRDA: Replace hard-coded dev_self[] array sizes with ARRAY_SIZE()

2006-08-14 Thread akpm
From: Bjorn Helgaas <[EMAIL PROTECTED]>

Several IR drivers used "for (i = 0; i < 4; i++)" to walk their dev_self[]
table.  Better to use ARRAY_SIZE().  And fix ali-ircc so it won't run off
the end if we find too many adapters.

Signed-off-by: Bjorn Helgaas <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/irda/ali-ircc.c|8 +++-
 drivers/net/irda/irport.c  |4 ++--
 drivers/net/irda/via-ircc.c|5 -
 drivers/net/irda/w83977af_ir.c |4 ++--
 4 files changed, 15 insertions(+), 6 deletions(-)

diff -puN 
drivers/net/irda/ali-ircc.c~irda-replace-hard-coded-dev_self-array-sizes-with-array_size
 drivers/net/irda/ali-ircc.c
--- 
a/drivers/net/irda/ali-ircc.c~irda-replace-hard-coded-dev_self-array-sizes-with-array_size
+++ a/drivers/net/irda/ali-ircc.c
@@ -249,7 +249,7 @@ static void __exit ali_ircc_cleanup(void
 
IRDA_DEBUG(2, "%s(),  Start \n", 
__FUNCTION__); 
 
-   for (i=0; i < 4; i++) {
+   for (i=0; i < ARRAY_SIZE(dev_self); i++) {
if (dev_self[i])
ali_ircc_close(dev_self[i]);
}
@@ -273,6 +273,12 @@ static int ali_ircc_open(int i, chipio_t
int err;

IRDA_DEBUG(2, "%s(),  Start \n", 
__FUNCTION__); 
+
+   if (i >= ARRAY_SIZE(dev_self)) {
+   IRDA_ERROR("%s(), maximum number of supported chips reached!\n",
+  __FUNCTION__);
+   return -ENOMEM;
+   }

/* Set FIR FIFO and DMA Threshold */
if ((ali_ircc_setup(info)) == -1)
diff -puN 
drivers/net/irda/irport.c~irda-replace-hard-coded-dev_self-array-sizes-with-array_size
 drivers/net/irda/irport.c
--- 
a/drivers/net/irda/irport.c~irda-replace-hard-coded-dev_self-array-sizes-with-array_size
+++ a/drivers/net/irda/irport.c
@@ -1090,7 +1090,7 @@ static int __init irport_init(void)
 {
int i;
 
-   for (i=0; (io[i] < 2000) && (i < 4); i++) {
+   for (i=0; (io[i] < 2000) && (i < ARRAY_SIZE(dev_self)); i++) {
if (irport_open(i, io[i], irq[i]) != NULL)
return 0;
}
@@ -1112,7 +1112,7 @@ static void __exit irport_cleanup(void)
 
 IRDA_DEBUG( 4, "%s()\n", __FUNCTION__);
 
-   for (i=0; i < 4; i++) {
+   for (i=0; i < ARRAY_SIZE(dev_self); i++) {
if (dev_self[i])
irport_close(dev_self[i]);
}
diff -puN 
drivers/net/irda/via-ircc.c~irda-replace-hard-coded-dev_self-array-sizes-with-array_size
 drivers/net/irda/via-ircc.c
--- 
a/drivers/net/irda/via-ircc.c~irda-replace-hard-coded-dev_self-array-sizes-with-array_size
+++ a/drivers/net/irda/via-ircc.c
@@ -279,7 +279,7 @@ static void via_ircc_clean(void)
 
IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
 
-   for (i=0; i < 4; i++) {
+   for (i=0; i < ARRAY_SIZE(dev_self); i++) {
if (dev_self[i])
via_ircc_close(dev_self[i]);
}
@@ -327,6 +327,9 @@ static __devinit int via_ircc_open(int i
 
IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
 
+   if (i >= ARRAY_SIZE(dev_self))
+   return -ENOMEM;
+
/* Allocate new instance of the driver */
dev = alloc_irdadev(sizeof(struct via_ircc_cb));
if (dev == NULL) 
diff -puN 
drivers/net/irda/w83977af_ir.c~irda-replace-hard-coded-dev_self-array-sizes-with-array_size
 drivers/net/irda/w83977af_ir.c
--- 
a/drivers/net/irda/w83977af_ir.c~irda-replace-hard-coded-dev_self-array-sizes-with-array_size
+++ a/drivers/net/irda/w83977af_ir.c
@@ -116,7 +116,7 @@ static int __init w83977af_init(void)
 
IRDA_DEBUG(0, "%s()\n", __FUNCTION__ );
 
-   for (i=0; (io[i] < 2000) && (i < 4); i++) { 
+   for (i=0; (io[i] < 2000) && (i < ARRAY_SIZE(dev_self)); i++) {
if (w83977af_open(i, io[i], irq[i], dma[i]) == 0)
return 0;
}
@@ -135,7 +135,7 @@ static void __exit w83977af_cleanup(void
 
 IRDA_DEBUG(4, "%s()\n", __FUNCTION__ );
 
-   for (i=0; i < 4; i++) {
+   for (i=0; i < ARRAY_SIZE(dev_self); i++) {
if (dev_self[i])
w83977af_close(dev_self[i]);
}
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 24/41] drivers/net/e1000/: possible cleanups

2006-08-14 Thread akpm
From: Adrian Bunk <[EMAIL PROTECTED]>

- make needlessly global functions 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()
  - e1000_hw.c: e1000_ife_disable_dynamic_power_down()
  - e1000_hw.c: e1000_ife_enable_dynamic_power_down()
  - e1000_hw.c: e1000_write_ich8_word()
  - e1000_hw.c: e1000_duplex_reversal()
  - e1000_main.c: e1000_io_read()

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
Cc: John Ronciak <[EMAIL PROTECTED]>
Cc: Jesse Brandeburg <[EMAIL PROTECTED]>
Cc: Jeff Kirsher <[EMAIL PROTECTED]>
Cc: Auke Kok <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_hw.c   |   89 ++-
 drivers/net/e1000/e1000_hw.h   |   32 ---
 drivers/net/e1000/e1000_main.c |2 
 3 files changed, 67 insertions(+), 56 deletions(-)

diff -puN drivers/net/e1000/e1000_hw.c~drivers-net-e1000-possible-cleanups 
drivers/net/e1000/e1000_hw.c
--- a/drivers/net/e1000/e1000_hw.c~drivers-net-e1000-possible-cleanups
+++ a/drivers/net/e1000/e1000_hw.c
@@ -105,6 +105,33 @@ static int32_t e1000_configure_kmrn_for_
uint16_t duplex);
 static int32_t e1000_configure_kmrn_for_1000(struct e1000_hw *hw);
 
+static int32_t e1000_erase_ich8_4k_segment(struct e1000_hw *hw,
+  uint32_t segment);
+static int32_t e1000_get_software_flag(struct e1000_hw *hw);
+static int32_t e1000_get_software_semaphore(struct e1000_hw *hw);
+static int32_t e1000_init_lcd_from_nvm(struct e1000_hw *hw);
+static int32_t e1000_kumeran_lock_loss_workaround(struct e1000_hw *hw);
+static int32_t e1000_read_eeprom_ich8(struct e1000_hw *hw, uint16_t offset,
+ uint16_t words, uint16_t *data);
+static int32_t e1000_read_ich8_byte(struct e1000_hw *hw, uint32_t index,
+   uint8_t* data);
+static int32_t e1000_read_ich8_word(struct e1000_hw *hw, uint32_t index,
+   uint16_t *data);
+static int32_t e1000_read_kmrn_reg(struct e1000_hw *hw, uint32_t reg_addr,
+  uint16_t *data);
+static void e1000_release_software_flag(struct e1000_hw *hw);
+static void e1000_release_software_semaphore(struct e1000_hw *hw);
+static int32_t e1000_set_pci_ex_no_snoop(struct e1000_hw *hw,
+uint32_t no_snoop);
+static int32_t e1000_verify_write_ich8_byte(struct e1000_hw *hw,
+   uint32_t index, uint8_t byte);
+static int32_t e1000_write_eeprom_ich8(struct e1000_hw *hw, uint16_t offset,
+  uint16_t words, uint16_t *data);
+static int32_t e1000_write_ich8_byte(struct e1000_hw *hw, uint32_t index,
+uint8_t data);
+static int32_t e1000_write_kmrn_reg(struct e1000_hw *hw, uint32_t reg_addr,
+   uint16_t data);
+
 /* IGP cable length table */
 static const
 uint16_t e1000_igp_cable_length_table[IGP01E1000_AGC_LENGTH_TABLE_SIZE] =
@@ -3233,7 +3260,7 @@ e1000_shift_in_mdi_bits(struct e1000_hw 
 return data;
 }
 
-int32_t
+static int32_t
 e1000_swfw_sync_acquire(struct e1000_hw *hw, uint16_t mask)
 {
 uint32_t swfw_sync = 0;
@@ -3277,7 +3304,7 @@ e1000_swfw_sync_acquire(struct e1000_hw 
 return E1000_SUCCESS;
 }
 
-void
+static void
 e1000_swfw_sync_release(struct e1000_hw *hw, uint16_t mask)
 {
 uint32_t swfw_sync;
@@ -3575,7 +3602,7 @@ e1000_write_phy_reg_ex(struct e1000_hw *
 return E1000_SUCCESS;
 }
 
-int32_t
+static int32_t
 e1000_read_kmrn_reg(struct e1000_hw *hw,
 uint32_t reg_addr,
 uint16_t *data)
@@ -3608,7 +3635,7 @@ e1000_read_kmrn_reg(struct e1000_hw *hw,
 return E1000_SUCCESS;
 }
 
-int32_t
+static int32_t
 e1000_write_kmrn_reg(struct e1000_hw *hw,
  uint32_t reg_addr,
  uint16_t data)
@@ -3839,7 +3866,7 @@ e1000_phy_powerdown_workaround(struct e1
 *
 * hw - struct containing variables accessed by shared code
 **/
-int32_t
+static int32_t
 e1000_kumeran_lock_loss_workaround(struct e1000_hw *hw)
 {
 int32_t ret_val;
@@ -4086,7 +4113,7 @@ e1000_phy_igp_get_info(struct e1000_hw *
 * hw - Struct containing variables accessed by shared code
 * phy_info - PHY information structure
 **/
-int32_t
+static int32_t
 e1000_phy_ife_get_info(struct e1000_hw *hw,
struct e1000_phy_info *phy_info)
 {
@@ -5643,6 +5670,7 @@ e1000_init_rx_addrs(struct e1000_hw *hw)
  * for the first 15 multicast addresses, and hashes the rest into the
  * multicast table.
  ***

[patch 02/13] lockdep: annotate __icmpv6_socket

2006-08-14 Thread akpm
From: Ingo Molnar <[EMAIL PROTECTED]>

Split off __icmpv6_socket's sk->sk_dst_lock class, because it gets used
from softirqs, which is safe for __icmpv6_sockets (because they never get
directly used via userspace syscalls), but unsafe for normal sockets.

Has no effect on non-lockdep kernels.

Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
Cc: "David S. Miller" <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Arjan van de Ven <[EMAIL PROTECTED]>
Acked-by: Herbert Xu <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 net/ipv6/icmp.c |   13 +
 1 file changed, 13 insertions(+)

diff -puN net/ipv6/icmp.c~lockdep-fix-sk_dst_check-deadlock net/ipv6/icmp.c
--- a/net/ipv6/icmp.c~lockdep-fix-sk_dst_check-deadlock
+++ a/net/ipv6/icmp.c
@@ -714,6 +714,11 @@ discard_it:
return 0;
 }
 
+/*
+ * Special lock-class for __icmpv6_socket:
+ */
+static struct lock_class_key icmpv6_socket_sk_dst_lock_key;
+
 int __init icmpv6_init(struct net_proto_family *ops)
 {
struct sock *sk;
@@ -732,6 +737,14 @@ int __init icmpv6_init(struct net_proto_
 
sk = per_cpu(__icmpv6_socket, i)->sk;
sk->sk_allocation = GFP_ATOMIC;
+   /*
+* Split off their lock-class, because sk->sk_dst_lock
+* gets used from softirqs, which is safe for
+* __icmpv6_socket (because those never get directly used
+* via userspace syscalls), but unsafe for normal sockets.
+*/
+   lockdep_set_class(&sk->sk_dst_lock,
+ &icmpv6_socket_sk_dst_lock_key);
 
/* Enough space for 2 64K ICMP packets, including
 * sk_buff struct overhead.
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 05/13] arcnet: SoHard PCI support

2006-08-14 Thread akpm
From: Stphane Witzmann <[EMAIL PROTECTED]>

Add support for a SoHard PCI ARCnet card.


Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/arcnet/com20020-pci.c |1 +
 1 file changed, 1 insertion(+)

diff -puN drivers/net/arcnet/com20020-pci.c~acrnet-sohard-pci-support 
drivers/net/arcnet/com20020-pci.c
--- a/drivers/net/arcnet/com20020-pci.c~acrnet-sohard-pci-support
+++ a/drivers/net/arcnet/com20020-pci.c
@@ -161,6 +161,7 @@ static struct pci_device_id com20020pci_
{ 0x1571, 0xa204, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
{ 0x1571, 0xa205, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
{ 0x1571, 0xa206, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
+   { 0x10B5, 0x9030, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
{ 0x10B5, 0x9050, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
{0,}
 };
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 10/13] fix potential stack overflow in net/core/utils.c

2006-08-14 Thread akpm
From: "Siddha, Suresh B" <[EMAIL PROTECTED]>

On High end systems (1024 or so cpus) this can potentially cause stack
overflow.  Fix the stack usage.

Signed-off-by: Suresh Siddha <[EMAIL PROTECTED]>
Cc: "David S. Miller" <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 net/core/utils.c |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff -puN net/core/utils.c~fix-potential-stack-overflow-in-net-core-utilsc 
net/core/utils.c
--- a/net/core/utils.c~fix-potential-stack-overflow-in-net-core-utilsc
+++ a/net/core/utils.c
@@ -130,12 +130,13 @@ void __init net_random_init(void)
 static int net_random_reseed(void)
 {
int i;
-   unsigned long seed[NR_CPUS];
+   unsigned long seed;
 
-   get_random_bytes(seed, sizeof(seed));
for_each_possible_cpu(i) {
struct nrnd_state *state = &per_cpu(net_rand_state,i);
-   __net_srandom(state, seed[i]);
+
+   get_random_bytes(&seed, sizeof(seed));
+   __net_srandom(state, seed);
}
return 0;
 }
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 06/13] xt_physdev build fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

It needs netfilter_bridge.h for brnf_deferred_hooks

Cc: Bart De Schuymer <[EMAIL PROTECTED]>
Cc: "David S. Miller" <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 net/netfilter/xt_physdev.c |1 +
 1 file changed, 1 insertion(+)

diff -puN net/netfilter/xt_physdev.c~xt_physdev-build-fix 
net/netfilter/xt_physdev.c
--- a/net/netfilter/xt_physdev.c~xt_physdev-build-fix
+++ a/net/netfilter/xt_physdev.c
@@ -10,6 +10,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 01/13] via-ircc: fix memory leak

2006-08-14 Thread akpm
From: Chuck Short <[EMAIL PROTECTED]>

Fix memory leak.

Coverity id# 653

patch location:
http://www.kernel.org/git/?p=linux/kernel/git/bcollins/ubuntu-dapper.git;a=commitdiff;h=a1f34cb68b16807ed9d5ebb0f6a6ec5ff8a5fc78

Signed-off-by: Chuck Short <[EMAIL PROTECTED]>
Signed-off-by: Ben Collins <[EMAIL PROTECTED]>
Cc: Samuel Ortiz <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/irda/via-ircc.c |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff -puN drivers/net/irda/via-ircc.c~via-ircc-fix-memory-leak 
drivers/net/irda/via-ircc.c
--- a/drivers/net/irda/via-ircc.c~via-ircc-fix-memory-leak
+++ a/drivers/net/irda/via-ircc.c
@@ -1220,8 +1220,13 @@ static int upload_rxdata(struct via_ircc
 
IRDA_DEBUG(2, "%s(): len=%x\n", __FUNCTION__, len);
 
+   if ((len - 4) < 2) {
+   self->stats.rx_dropped++;
+   return FALSE;
+   }
+
skb = dev_alloc_skb(len + 1);
-   if ((skb == NULL) || ((len - 4) < 2)) {
+   if (skb == NULL) {
self->stats.rx_dropped++;
return FALSE;
}
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 03/13] ppp: handle kmalloc() failures

2006-08-14 Thread akpm
From: Panagiotis Issaris <[EMAIL PROTECTED]>

The PPP code contains two kmalloc()s followed by memset()s without handling a
possible memory allocation failure.  (Suggested by Joe Perches).

And furthermore, conversions from kmalloc+memset to kzalloc.

[EMAIL PROTECTED]: fix error-path leak]
[EMAIL PROTECTED]: cleanups]
Signed-off-by: Panagiotis Issaris <[EMAIL PROTECTED]>
Cc: Paul Mackerras <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/ppp_generic.c |   33 ++---
 1 file changed, 22 insertions(+), 11 deletions(-)

diff -puN drivers/net/ppp_generic.c~ppp-handle-kmalloc-failures 
drivers/net/ppp_generic.c
--- a/drivers/net/ppp_generic.c~ppp-handle-kmalloc-failures
+++ a/drivers/net/ppp_generic.c
@@ -192,7 +192,7 @@ struct cardmap {
void *ptr[CARDMAP_WIDTH];
 };
 static void *cardmap_get(struct cardmap *map, unsigned int nr);
-static void cardmap_set(struct cardmap **map, unsigned int nr, void *ptr);
+static int cardmap_set(struct cardmap **map, unsigned int nr, void *ptr);
 static unsigned int cardmap_find_first_free(struct cardmap *map);
 static void cardmap_destroy(struct cardmap **map);
 
@@ -1995,10 +1995,9 @@ ppp_register_channel(struct ppp_channel 
 {
struct channel *pch;
 
-   pch = kmalloc(sizeof(struct channel), GFP_KERNEL);
+   pch = kzalloc(sizeof(struct channel), GFP_KERNEL);
if (pch == 0)
return -ENOMEM;
-   memset(pch, 0, sizeof(struct channel));
pch->ppp = NULL;
pch->chan = chan;
chan->ppp = pch;
@@ -2408,13 +2407,12 @@ ppp_create_interface(int unit, int *retp
int ret = -ENOMEM;
int i;
 
-   ppp = kmalloc(sizeof(struct ppp), GFP_KERNEL);
+   ppp = kzalloc(sizeof(struct ppp), GFP_KERNEL);
if (!ppp)
goto out;
dev = alloc_netdev(0, "", ppp_setup);
if (!dev)
goto out1;
-   memset(ppp, 0, sizeof(struct ppp));
 
ppp->mru = PPP_MRU;
init_ppp_file(&ppp->file, INTERFACE);
@@ -2454,11 +2452,18 @@ ppp_create_interface(int unit, int *retp
}
 
atomic_inc(&ppp_unit_count);
-   cardmap_set(&all_ppp_units, unit, ppp);
+   ret = cardmap_set(&all_ppp_units, unit, ppp);
+   if (ret != 0) {
+   printk(KERN_ERR "PPP: couldn't set cardmap\n");
+   goto out3;
+   }
+
mutex_unlock(&all_ppp_mutex);
*retp = 0;
return ppp;
 
+out3:
+   atomic_dec(&ppp_unit_count);
 out2:
mutex_unlock(&all_ppp_mutex);
free_netdev(dev);
@@ -2695,7 +2700,7 @@ static void *cardmap_get(struct cardmap 
return NULL;
 }
 
-static void cardmap_set(struct cardmap **pmap, unsigned int nr, void *ptr)
+static int cardmap_set(struct cardmap **pmap, unsigned int nr, void *ptr)
 {
struct cardmap *p;
int i;
@@ -2704,8 +2709,9 @@ static void cardmap_set(struct cardmap *
if (p == NULL || (nr >> p->shift) >= CARDMAP_WIDTH) {
do {
/* need a new top level */
-   struct cardmap *np = kmalloc(sizeof(*np), GFP_KERNEL);
-   memset(np, 0, sizeof(*np));
+   struct cardmap *np = kzalloc(sizeof(*np), GFP_KERNEL);
+   if (!np)
+   goto enomem;
np->ptr[0] = p;
if (p != NULL) {
np->shift = p->shift + CARDMAP_ORDER;
@@ -2719,8 +2725,9 @@ static void cardmap_set(struct cardmap *
while (p->shift > 0) {
i = (nr >> p->shift) & CARDMAP_MASK;
if (p->ptr[i] == NULL) {
-   struct cardmap *np = kmalloc(sizeof(*np), GFP_KERNEL);
-   memset(np, 0, sizeof(*np));
+   struct cardmap *np = kzalloc(sizeof(*np), GFP_KERNEL);
+   if (!np)
+   goto enomem;
np->shift = p->shift - CARDMAP_ORDER;
np->parent = p;
p->ptr[i] = np;
@@ -2735,6 +2742,10 @@ static void cardmap_set(struct cardmap *
set_bit(i, &p->inuse);
else
clear_bit(i, &p->inuse);
+   return 0;
+enomem:
+   cardmap_destroy(pmap);
+   return -ENOMEM;
 }
 
 static unsigned int cardmap_find_first_free(struct cardmap *map)
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 09/13] net: add the UdpSndbufErrors and UdpRcvbufErrors MIBs

2006-08-14 Thread akpm
From: Martin Bligh <[EMAIL PROTECTED]>

Signed-off-by: Martin Bligh <[EMAIL PROTECTED]>
Cc: "David S. Miller" <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 include/linux/snmp.h |2 ++
 net/ipv4/proc.c  |2 ++
 net/ipv4/udp.c   |   16 +++-
 3 files changed, 19 insertions(+), 1 deletion(-)

diff -puN 
include/linux/snmp.h~net-add-the-udpsndbuferrors-and-udprcvbuferrors-mibs 
include/linux/snmp.h
--- a/include/linux/snmp.h~net-add-the-udpsndbuferrors-and-udprcvbuferrors-mibs
+++ a/include/linux/snmp.h
@@ -155,6 +155,8 @@ enum
UDP_MIB_NOPORTS,/* NoPorts */
UDP_MIB_INERRORS,   /* InErrors */
UDP_MIB_OUTDATAGRAMS,   /* OutDatagrams */
+   UDP_MIB_RCVBUFERRORS,   /* RcvbufErrors */
+   UDP_MIB_SNDBUFERRORS,   /* SndbufErrors */
__UDP_MIB_MAX
 };
 
diff -puN net/ipv4/proc.c~net-add-the-udpsndbuferrors-and-udprcvbuferrors-mibs 
net/ipv4/proc.c
--- a/net/ipv4/proc.c~net-add-the-udpsndbuferrors-and-udprcvbuferrors-mibs
+++ a/net/ipv4/proc.c
@@ -173,6 +173,8 @@ static const struct snmp_mib snmp4_udp_l
SNMP_MIB_ITEM("NoPorts", UDP_MIB_NOPORTS),
SNMP_MIB_ITEM("InErrors", UDP_MIB_INERRORS),
SNMP_MIB_ITEM("OutDatagrams", UDP_MIB_OUTDATAGRAMS),
+   SNMP_MIB_ITEM("RcvbufErrors", UDP_MIB_RCVBUFERRORS),
+   SNMP_MIB_ITEM("SndbufErrors", UDP_MIB_SNDBUFERRORS),
SNMP_MIB_SENTINEL
 };
 
diff -puN net/ipv4/udp.c~net-add-the-udpsndbuferrors-and-udprcvbuferrors-mibs 
net/ipv4/udp.c
--- a/net/ipv4/udp.c~net-add-the-udpsndbuferrors-and-udprcvbuferrors-mibs
+++ a/net/ipv4/udp.c
@@ -662,6 +662,16 @@ out:
UDP_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS);
return len;
}
+   /*
+* ENOBUFS = no kernel mem, SOCK_NOSPACE = no sndbuf space.  Reporting
+* ENOBUFS might not be good (it's not tunable per se), but otherwise
+* we don't have a good statistic (IpOutDiscards but it can be too many
+* things).  We could add another new stat but at least for now that
+* seems like overkill.
+*/
+   if (err == -ENOBUFS || test_bit(SOCK_NOSPACE, &sk->sk_socket->flags)) {
+   UDP_INC_STATS_USER(UDP_MIB_SNDBUFERRORS);
+   }
return err;
 
 do_confirm:
@@ -981,6 +991,7 @@ static int udp_encap_rcv(struct sock * s
 static int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
 {
struct udp_sock *up = udp_sk(sk);
+   int rc;
 
/*
 *  Charge it to the socket, dropping if the queue is full.
@@ -1027,7 +1038,10 @@ static int udp_queue_rcv_skb(struct sock
skb->ip_summed = CHECKSUM_UNNECESSARY;
}
 
-   if (sock_queue_rcv_skb(sk,skb)<0) {
+   if ((rc = sock_queue_rcv_skb(sk,skb)) < 0) {
+   /* Note that an ENOMEM error is charged twice */
+   if (rc == -ENOMEM)
+   UDP_INC_STATS_BH(UDP_MIB_RCVBUFERRORS);
UDP_INC_STATS_BH(UDP_MIB_INERRORS);
kfree_skb(skb);
return -1;
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 08/13] netfilter: make unused signal code go away so nobody copies its brokenness

2006-08-14 Thread akpm
From: Alan Cox <[EMAIL PROTECTED]>

This code is wrong on so many levels, please lose it so it isn't replicated
anywhere else.

Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
Cc: Patrick McHardy <[EMAIL PROTECTED]>
Cc: "David S. Miller" <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 net/bridge/netfilter/ebtables.c |   21 -
 1 file changed, 21 deletions(-)

diff -puN 
net/bridge/netfilter/ebtables.c~netfilter-make-unused-signal-code-go-away-so-nobody-copies-its-broken-ness
 net/bridge/netfilter/ebtables.c
--- 
a/net/bridge/netfilter/ebtables.c~netfilter-make-unused-signal-code-go-away-so-nobody-copies-its-broken-ness
+++ a/net/bridge/netfilter/ebtables.c
@@ -37,30 +37,9 @@
 #include 
 #include 
 
-#if 0
-/* use this for remote debugging
- * Copyright (C) 1998 by Ori Pomerantz
- * Print the string to the appropriate tty, the one
- * the current task uses
- */
-static void print_string(char *str)
-{
-   struct tty_struct *my_tty;
-
-   /* The tty for the current task */
-   my_tty = current->signal->tty;
-   if (my_tty != NULL) {
-   my_tty->driver->write(my_tty, 0, str, strlen(str));
-   my_tty->driver->write(my_tty, 0, "\015\012", 2);
-   }
-}
-
-#define BUGPRINT(args) print_string(args);
-#else
 #define BUGPRINT(format, args...) printk("kernel msg: ebtables bug: please "\
  "report to author: "format, ## args)
 /* #define BUGPRINT(format, args...) */
-#endif
 #define MEMPRINT(format, args...) printk("kernel msg: ebtables "\
  ": out of memory: "format, ## args)
 /* #define MEMPRINT(format, args...) */
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 16/41] ibmtr section fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

WARNING: drivers/net/tokenring/ibmtr.o - Section mismatch: reference to 
.init.data:ibmtr_mem_base from .text between 'ibmtr_probe1' (at offset 0x6e6) 
and 'ibmtr_probe_card'
WARNING: drivers/net/tokenring/ibmtr.o - Section mismatch: reference to 
.init.data:ibmtr_mem_base from .text between 'ibmtr_probe1' (at offset 0x74a) 
and 'ibmtr_probe_card'
WARNING: drivers/net/tokenring/ibmtr.o - Section mismatch: reference to 
.init.data:ibmtr_mem_base from .text between 'ibmtr_probe1' (at offset 0x7fd) 
and 'ibmtr_probe_card'

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/tokenring/ibmtr.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/net/tokenring/ibmtr.c~ibmtr-section-fix 
drivers/net/tokenring/ibmtr.c
--- a/drivers/net/tokenring/ibmtr.c~ibmtr-section-fix
+++ a/drivers/net/tokenring/ibmtr.c
@@ -140,7 +140,7 @@ in the event that chatty debug messages 
 
 /* version and credits */
 #ifndef PCMCIA
-static char version[] __initdata =
+static char version[] __devinitdata =
 "\nibmtr.c: v1.3.57   8/ 7/94 Peter De Schrijver and Mark Swanson\n"
 " v2.1.125 10/20/98 Paul Norton<[EMAIL PROTECTED]>\n"
 " v2.2.0   12/30/98 Joel Sloan <[EMAIL PROTECTED]>\n"
@@ -216,7 +216,7 @@ static int __devinitdata turbo_irq[IBMTR
 static int __devinitdata turbo_searched = 0;
 
 #ifndef PCMCIA
-static __u32 ibmtr_mem_base __initdata = 0xd;
+static __u32 ibmtr_mem_base __devinitdata = 0xd;
 #endif
 
 static void __devinit PrtChanID(char *pcid, short stride)
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 05/41] cops section fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

WARNING: drivers/net/appletalk/cops.o - Section mismatch: reference to 
.init.text:cops_probe from .text between 'init_module' (at offset 0xae) and 
'cops_rx'

Cc: "David S. Miller" <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/appletalk/cops.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/net/appletalk/cops.c~cops-section-fix 
drivers/net/appletalk/cops.c
--- a/drivers/net/appletalk/cops.c~cops-section-fix
+++ a/drivers/net/appletalk/cops.c
@@ -1030,7 +1030,7 @@ module_param(io, int, 0);
 module_param(irq, int, 0);
 module_param(board_type, int, 0);
 
-int init_module(void)
+int __init init_module(void)
 {
if (io == 0)
printk(KERN_WARNING "%s: You shouldn't autoprobe with insmod\n",
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 41/41] ppc32: board-specific part of fs_enet update

2006-08-14 Thread akpm
From: Vitaly Bordug <[EMAIL PROTECTED]>

This contains board-specific portion to respect driver changes (for 8272ads ,
885ads and 866ads).  Altered platform_data structures as well as initial setup
routines relevant to fs_enet.

Changes to the mpc8560ads ppc/ code are also introduced, but mainly as
reference, since the entire board support is going to appear in arch/powerpc.

Signed-off-by: Vitaly Bordug <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 arch/ppc/platforms/85xx/mpc8560_ads.c|   89 +++
 arch/ppc/platforms/85xx/mpc85xx_ads_common.h |   19 +
 arch/ppc/platforms/mpc8272ads_setup.c|  154 +++--
 arch/ppc/platforms/mpc866ads_setup.c |  192 -
 arch/ppc/platforms/mpc885ads_setup.c |  179 ++-
 arch/ppc/platforms/pq2ads_pd.h   |   82 ---
 arch/ppc/syslib/mpc85xx_devices.c|   89 +++
 arch/ppc/syslib/mpc8xx_devices.c |8 
 arch/ppc/syslib/mpc8xx_sys.c |6 
 arch/ppc/syslib/pq2_devices.c|5 
 arch/ppc/syslib/pq2_sys.c|3 
 include/asm-ppc/cpm2.h   |   95 
 include/asm-ppc/mpc8260.h|1 
 include/asm-ppc/mpc8xx.h |1 
 include/linux/fs_enet_pd.h   |   50 +---
 15 files changed, 580 insertions(+), 393 deletions(-)

diff -puN 
arch/ppc/platforms/85xx/mpc8560_ads.c~ppc32-board-specific-part-of-fs_enet-update
 arch/ppc/platforms/85xx/mpc8560_ads.c
--- 
a/arch/ppc/platforms/85xx/mpc8560_ads.c~ppc32-board-specific-part-of-fs_enet-update
+++ a/arch/ppc/platforms/85xx/mpc8560_ads.c
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -58,6 +59,71 @@
  * Setup the architecture
  *
  */
+static void init_fcc_ioports(void)
+{
+   struct immap *immap;
+   struct io_port *io;
+   u32 tempval;
+
+   immap = cpm2_immr;
+
+   io = &immap->im_ioport;
+   /* FCC2/3 are on the ports B/C. */
+   tempval = in_be32(&io->iop_pdirb);
+   tempval &= ~PB2_DIRB0;
+   tempval |= PB2_DIRB1;
+   out_be32(&io->iop_pdirb, tempval);
+
+   tempval = in_be32(&io->iop_psorb);
+   tempval &= ~PB2_PSORB0;
+   tempval |= PB2_PSORB1;
+   out_be32(&io->iop_psorb, tempval);
+
+   tempval = in_be32(&io->iop_pparb);
+   tempval |= (PB2_DIRB0 | PB2_DIRB1);
+   out_be32(&io->iop_pparb, tempval);
+
+   tempval = in_be32(&io->iop_pdirb);
+   tempval &= ~PB3_DIRB0;
+   tempval |= PB3_DIRB1;
+   out_be32(&io->iop_pdirb, tempval);
+
+   tempval = in_be32(&io->iop_psorb);
+   tempval &= ~PB3_PSORB0;
+   tempval |= PB3_PSORB1;
+   out_be32(&io->iop_psorb, tempval);
+
+   tempval = in_be32(&io->iop_pparb);
+   tempval |= (PB3_DIRB0 | PB3_DIRB1);
+   out_be32(&io->iop_pparb, tempval);
+
+tempval = in_be32(&io->iop_pdirc);
+tempval |= PC3_DIRC1;
+out_be32(&io->iop_pdirc, tempval);
+
+tempval = in_be32(&io->iop_pparc);
+tempval |= PC3_DIRC1;
+out_be32(&io->iop_pparc, tempval);
+
+   /* Port C has clocks..  */
+   tempval = in_be32(&io->iop_psorc);
+   tempval &= ~(CLK_TRX);
+   out_be32(&io->iop_psorc, tempval);
+
+   tempval = in_be32(&io->iop_pdirc);
+   tempval &= ~(CLK_TRX);
+   out_be32(&io->iop_pdirc, tempval);
+   tempval = in_be32(&io->iop_pparc);
+   tempval |= (CLK_TRX);
+   out_be32(&io->iop_pparc, tempval);
+
+   /* Configure Serial Interface clock routing.
+* First,  clear all FCC bits to zero,
+* then set the ones we want.
+*/
+   immap->im_cpmux.cmx_fcr &= ~(CPMUX_CLK_MASK);
+   immap->im_cpmux.cmx_fcr |= CPMUX_CLK_ROUTE;
+}
 
 static void __init
 mpc8560ads_setup_arch(void)
@@ -66,6 +132,7 @@ mpc8560ads_setup_arch(void)
unsigned int freq;
struct gianfar_platform_data *pdata;
struct gianfar_mdio_data *mdata;
+   struct fs_platform_info *fpi;
 
cpm2_reset();
 
@@ -110,6 +177,28 @@ mpc8560ads_setup_arch(void)
memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
}
 
+   init_fcc_ioports();
+   ppc_sys_device_remove(MPC85xx_CPM_FCC1);
+
+   fpi = (struct fs_platform_info *) ppc_sys_get_pdata(MPC85xx_CPM_FCC2);
+   if (fpi) {
+   memcpy(fpi->macaddr, binfo->bi_enet2addr, 6);
+   fpi->bus_id = "0:02";
+   fpi->phy_addr = 2;
+   fpi->dpram_offset = (u32)cpm2_immr->im_dprambase;
+   fpi->fcc_regs_c = (u32)&cpm2_immr->im_fcc_c[1];
+   }
+
+   fpi = (struct fs_platform_info *) ppc_sys_get_pdata(MPC85xx_CPM_FCC3);
+   if (fpi) {
+   memcpy(fpi->macaddr, binfo->bi_enet2addr, 6);
+   fpi->macaddr[5] += 1;
+   fpi->bus_id = "0:03";
+   fpi->phy_addr = 3;
+   fpi->dpram_offset = (u32)cpm2_immr->im_dpra

[patch 26/41] Update smc91x driver with ARM Versatile board info

2006-08-14 Thread akpm
From: Deepak Saxena <[EMAIL PROTECTED]>

We need to specify a Versatile-specific SMC_IRQ_FLAGS value or the new
generic IRQ layer will complain thusly:

No IRQF_TRIGGER set_type function for IRQ 25 ()

Signed-off-by: Deepak Saxena <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Russell King <[EMAIL PROTECTED]>
Cc: Nicolas Pitre <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/smc91x.h |   18 ++
 1 file changed, 18 insertions(+)

diff -puN 
drivers/net/smc91x.h~update-smc91x-driver-with-arm-versatile-board-info 
drivers/net/smc91x.h
--- a/drivers/net/smc91x.h~update-smc91x-driver-with-arm-versatile-board-info
+++ a/drivers/net/smc91x.h
@@ -367,6 +367,24 @@ static inline void LPD7_SMC_outsw (unsig
 
 #define SMC_IRQ_FLAGS  (0)
 
+#elif  defined(CONFIG_ARCH_VERSATILE)
+
+#define SMC_CAN_USE_8BIT   1
+#define SMC_CAN_USE_16BIT  1
+#define SMC_CAN_USE_32BIT  1
+#define SMC_NOWAIT 1
+
+#define SMC_inb(a, r)  readb((a) + (r))
+#define SMC_inw(a, r)  readw((a) + (r))
+#define SMC_inl(a, r)  readl((a) + (r))
+#define SMC_outb(v, a, r)  writeb(v, (a) + (r))
+#define SMC_outw(v, a, r)  writew(v, (a) + (r))
+#define SMC_outl(v, a, r)  writel(v, (a) + (r))
+#define SMC_insl(a, r, p, l)   readsl((a) + (r), p, l)
+#define SMC_outsl(a, r, p, l)  writesl((a) + (r), p, l)
+
+#define SMC_IRQ_FLAGS  (0)
+
 #else
 
 #define SMC_CAN_USE_8BIT   1
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 17/41] smctr section fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

WARNING: drivers/net/tokenring/smctr.o - Section mismatch: reference to 
.init.text: from .text between 'init_module' (at offset 0x2ba0) and 
'smctr_reset_adapter'
WARNING: drivers/net/tokenring/smctr.o - Section mismatch: reference to 
.init.text:smctr_probe from .text between 'init_module' (at offset 0x2bf4) and 
'smctr_reset_adapter'

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/tokenring/smctr.c |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff -puN drivers/net/tokenring/smctr.c~smctr-section-fix 
drivers/net/tokenring/smctr.c
--- a/drivers/net/tokenring/smctr.c~smctr-section-fix
+++ a/drivers/net/tokenring/smctr.c
@@ -5666,7 +5666,7 @@ module_param_array(io, int, NULL, 0);
 module_param_array(irq, int, NULL, 0);
 module_param(ringspeed, int, 0);
 
-static struct net_device *setup_card(int n)
+static struct net_device * __init setup_card(int n)
 {
struct net_device *dev = alloc_trdev(sizeof(struct net_local));
int err;
@@ -5696,9 +5696,8 @@ out:
free_netdev(dev);
return ERR_PTR(err);
 }
-   
 
-int init_module(void)
+int __init init_module(void)
 {
 int i, found = 0;
struct net_device *dev;
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 02/41] ixgb: add PCI Error recovery callbacks

2006-08-14 Thread akpm
From: [EMAIL PROTECTED] (Linas Vepstas)

Adds PCI Error recovery callbacks to the Intel 10-gigabit ethernet ixgb
device driver.  Lightly tested, works.

Signed-off-by: Linas Vepstas <[EMAIL PROTECTED]>
Cc: Jesse Brandeburg <[EMAIL PROTECTED]>
Cc: Auke Kok <[EMAIL PROTECTED]>
Cc: John Ronciak <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>

"Zhang, Yanmin" <[EMAIL PROTECTED]> wrote:

Both pci_disable_device and ixgb_down would access the device.  It doesn't
follow Documentation/pci-error-recovery.txt that error_detected shouldn't do
any access to the device.
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/ixgb/ixgb_main.c |  112 -
 1 file changed, 111 insertions(+), 1 deletion(-)

diff -puN drivers/net/ixgb/ixgb_main.c~ixgb-add-pci-error-recovery-callbacks 
drivers/net/ixgb/ixgb_main.c
--- a/drivers/net/ixgb/ixgb_main.c~ixgb-add-pci-error-recovery-callbacks
+++ a/drivers/net/ixgb/ixgb_main.c
@@ -118,15 +118,26 @@ static void ixgb_restore_vlan(struct ixg
 static void ixgb_netpoll(struct net_device *dev);
 #endif
 
-/* Exported from other modules */
+static pci_ers_result_t ixgb_io_error_detected (struct pci_dev *pdev,
+enum pci_channel_state state);
+static pci_ers_result_t ixgb_io_slot_reset (struct pci_dev *pdev);
+static void ixgb_io_resume (struct pci_dev *pdev);
 
+/* Exported from other modules */
 extern void ixgb_check_options(struct ixgb_adapter *adapter);
 
+static struct pci_error_handlers ixgb_err_handler = {
+   .error_detected = ixgb_io_error_detected,
+   .slot_reset = ixgb_io_slot_reset,
+   .resume = ixgb_io_resume,
+};
+
 static struct pci_driver ixgb_driver = {
.name = ixgb_driver_name,
.id_table = ixgb_pci_tbl,
.probe= ixgb_probe,
.remove   = __devexit_p(ixgb_remove),
+   .err_handler = &ixgb_err_handler
 };
 
 MODULE_AUTHOR("Intel Corporation, <[EMAIL PROTECTED]>");
@@ -1543,6 +1554,11 @@ void
 ixgb_update_stats(struct ixgb_adapter *adapter)
 {
struct net_device *netdev = adapter->netdev;
+   struct pci_dev *pdev = adapter->pdev;
+
+   /* Prevent stats update while adapter is being reset */
+   if (pdev->error_state && pdev->error_state != pci_channel_io_normal)
+   return;
 
if((netdev->flags & IFF_PROMISC) || (netdev->flags & IFF_ALLMULTI) ||
   (netdev->mc_count > IXGB_MAX_NUM_MULTICAST_ADDRESSES)) {
@@ -2198,4 +2214,98 @@ static void ixgb_netpoll(struct net_devi
 }
 #endif
 
+/**
+ * ixgb_io_error_detected() - called when PCI error is detected
+ * @pdevpointer to pci device with error
+ * @state   pci channel state after error
+ *
+ * This callback is called by the PCI subsystem whenever
+ * a PCI bus error is detected.
+ */
+static pci_ers_result_t ixgb_io_error_detected (struct pci_dev *pdev,
+enum pci_channel_state state)
+{
+   struct net_device *netdev = pci_get_drvdata(pdev);
+   struct ixgb_adapter *adapter = netdev->priv;
+
+   if(netif_running(netdev))
+   ixgb_down(adapter, TRUE);
+
+   pci_disable_device(pdev);
+
+   /* Request a slot reset. */
+   return PCI_ERS_RESULT_NEED_RESET;
+}
+
+/**
+ * ixgb_io_slot_reset - called after the pci bus has been reset.
+ * @pdevpointer to pci device with error
+ *
+ * This callback is called after the PCI buss has been reset.
+ * Basically, this tries to restart the card from scratch.
+ * This is a shortened version of the device probe/discovery code,
+ * it resembles the first-half of the ixgb_probe() routine.
+ */
+static pci_ers_result_t ixgb_io_slot_reset (struct pci_dev *pdev)
+{
+   struct net_device *netdev = pci_get_drvdata(pdev);
+   struct ixgb_adapter *adapter = netdev->priv;
+
+   if(pci_enable_device(pdev)) {
+   DPRINTK(PROBE, ERR, "Cannot re-enable PCI device after 
reset.\n");
+   return PCI_ERS_RESULT_DISCONNECT;
+   }
+
+   /* Perform card reset only on one instance of the card */
+   if (0 != PCI_FUNC (pdev->devfn))
+   return PCI_ERS_RESULT_RECOVERED;
+
+   pci_set_master(pdev);
+
+   netif_carrier_off(netdev);
+   netif_stop_queue(netdev);
+   ixgb_reset(adapter);
+
+   /* Make sure the EEPROM is good */
+   if(!ixgb_validate_eeprom_checksum(&adapter->hw)) {
+   DPRINTK(PROBE, ERR, "After reset, the EEPROM checksum is not 
valid.\n");
+   return PCI_ERS_RESULT_DISCONNECT;
+   }
+   ixgb_get_ee_mac_addr(&adapter->hw, netdev->dev_addr);
+   memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len);
+
+   if(!is_valid_ether_addr(netdev->perm_addr)) {
+   DPRINTK(PROBE, ERR, "After reset, invalid MAC address.\n");
+   return PCI_ERS_RESULT_DISCONNECT;
+   }
+
+   return PCI_ERS_RESULT_RECOVERED;
+}
+
+/**
+ * ixgb_io_resume - called when its OK to resume normal operations
+ * @pdevpointer to 

[patch 33/41] via-rhine: add option avoid_D3 (work around broken BIOSes)

2006-08-14 Thread akpm
From: Roger Luethi <[EMAIL PROTECTED]>

It looks like broken BIOSes controlling Rhine chips will remain in use in
significant numbers; such systems fail to come up via PXE after they have
been put into D3 (power-saving) mode.

This patch adds a module option for disabling the call that puts the chip
to sleep.

Signed-off-by: Roger Luethi <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Joerg Bashir <[EMAIL PROTECTED]>
Cc: Tim Phipps <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/via-rhine.c |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff -puN 
drivers/net/via-rhine.c~via-rhine-add-option-avoid_d3-work-around-broken-bioses 
drivers/net/via-rhine.c
--- 
a/drivers/net/via-rhine.c~via-rhine-add-option-avoid_d3-work-around-broken-bioses
+++ a/drivers/net/via-rhine.c
@@ -44,6 +44,10 @@ static int max_interrupt_work = 20;
Setting to > 1518 effectively disables this feature. */
 static int rx_copybreak;
 
+/* Work-around for broken BIOSes: they are unable to get the chip back out of
+   power state D3 so PXE booting fails. bootparam(7): via-rhine.avoid_D3=1 */
+static int avoid_D3;
+
 /*
  * In case you are looking for 'options[]' or 'full_duplex[]', they
  * are gone. Use ethtool(8) instead.
@@ -120,9 +124,11 @@ MODULE_LICENSE("GPL");
 module_param(max_interrupt_work, int, 0);
 module_param(debug, int, 0);
 module_param(rx_copybreak, int, 0);
+module_param(avoid_D3, bool, 0);
 MODULE_PARM_DESC(max_interrupt_work, "VIA Rhine maximum events handled per 
interrupt");
 MODULE_PARM_DESC(debug, "VIA Rhine debug level (0-7)");
 MODULE_PARM_DESC(rx_copybreak, "VIA Rhine copy breakpoint for 
copy-only-tiny-frames");
+MODULE_PARM_DESC(avoid_D3, "Avoid power state D3 (work-around for broken 
BIOSes)");
 
 /*
Theory of Operation
@@ -823,6 +829,9 @@ static int __devinit rhine_init_one(stru
}
}
rp->mii_if.phy_id = phy_id;
+   if (debug > 1 && avoid_D3)
+   printk(KERN_INFO "%s: No D3 power state at shutdown.\n",
+  dev->name);
 
return 0;
 
@@ -1911,7 +1920,8 @@ static void rhine_shutdown (struct pci_d
}
 
/* Hit power state D3 (sleep) */
-   iowrite8(ioread8(ioaddr + StickyHW) | 0x03, ioaddr + StickyHW);
+   if (!avoid_D3)
+   iowrite8(ioread8(ioaddr + StickyHW) | 0x03, ioaddr + StickyHW);
 
/* TODO: Check use of pci_enable_wake() */
 
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 23/41] sundance section fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

drivers/net/sundance.c:110: error: version causes a section type conflict

I don't understand this error.  It's referred to from both __init and
__devinit code.  With CONFIG_HOTPLUG=n, version[] is placed in .init.data and
is referred to from .init.text.

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/sundance.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/net/sundance.c~sundance-section-fix drivers/net/sundance.c
--- a/drivers/net/sundance.c~sundance-section-fix
+++ a/drivers/net/sundance.c
@@ -109,7 +109,7 @@ static char *media[MAX_UNITS];
 #endif
 
 /* These identify the driver base version and may not be removed. */
-static char version[] __devinitdata =
+static char version[] =
 KERN_INFO DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE "  Written by Donald 
Becker\n"
 KERN_INFO "  http://www.scyld.com/network/sundance.html\n";;
 
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 27/41] s2io build fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

sparc32:

drivers/net/s2io.c:2636: warning: implicit declaration of function 'disable_irq'
drivers/net/s2io.c:2656: warning: implicit declaration of function 'enable_irq'

Cc: Ananda Raju <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/s2io.c |1 +
 1 file changed, 1 insertion(+)

diff -puN drivers/net/s2io.c~s2io-build-fix drivers/net/s2io.c
--- a/drivers/net/s2io.c~s2io-build-fix
+++ a/drivers/net/s2io.c
@@ -71,6 +71,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /* local include */
 #include "s2io.h"
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 10/41] eexpress section fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

WARNING: drivers/net/eexpress.o - Section mismatch: reference to .init.text: 
from .text between 'init_module' (at offset 0x6c3) and 'eexp_hw_lasttxstat'
WARNING: drivers/net/eexpress.o - Section mismatch: reference to .init.text: 
from .text between 'init_module' (at offset 0x74f) and 'eexp_hw_lasttxstat'

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/eexpress.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/net/eexpress.c~eexpress-section-fix drivers/net/eexpress.c
--- a/drivers/net/eexpress.c~eexpress-section-fix
+++ a/drivers/net/eexpress.c
@@ -1698,7 +1698,7 @@ MODULE_LICENSE("GPL");
  * are specified, we verify and then use them.  If no parameters are given, we
  * autoprobe for one card only.
  */
-int init_module(void)
+int __init init_module(void)
 {
struct net_device *dev;
int this_dev, found = 0;
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 21/41] winbond-840 section fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

With CONFIG_HOTPLUG=n it won't compile:

drivers/net/tulip/winbond-840.c:141: error: version causes a section type 
conflict

(For some reason it gets the same error if marked __initdata.  Give up.)

Cc: Valerie Henson <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/tulip/winbond-840.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/net/tulip/winbond-840.c~winbond-840-section-fix 
drivers/net/tulip/winbond-840.c
--- a/drivers/net/tulip/winbond-840.c~winbond-840-section-fix
+++ a/drivers/net/tulip/winbond-840.c
@@ -138,7 +138,7 @@ static int full_duplex[MAX_UNITS] = {-1,
 #include 
 
 /* These identify the driver base version and may not be removed. */
-static char version[] __devinitdata =
+static char version[] =
 KERN_INFO DRV_NAME ".c:v" DRV_VERSION " (2.4 port) " DRV_RELDATE "  Donald 
Becker <[EMAIL PROTECTED]>\n"
 KERN_INFO "  http://www.scyld.com/network/drivers.html\n";;
 
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 28/41] net: Add netconsole support to dm9000 driver

2006-08-14 Thread akpm
From: "Kevin Hao" <[EMAIL PROTECTED]>

Add netconsole support to dm9000 driver.

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Sascha Hauer <[EMAIL PROTECTED]>
Cc: Ben Dooks <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/dm9000.c |   14 ++
 1 file changed, 14 insertions(+)

diff -puN drivers/net/dm9000.c~net-add-netconsole-support-to-dm9000-driver 
drivers/net/dm9000.c
--- a/drivers/net/dm9000.c~net-add-netconsole-support-to-dm9000-driver
+++ a/drivers/net/dm9000.c
@@ -339,6 +339,17 @@ static void dm9000_timeout(struct net_de
spin_unlock_irqrestore(&db->lock,flags);
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ *Used by netconsole
+ */
+static void dm9000_poll_controller(struct net_device *dev)
+{
+   disable_irq(dev->irq);
+   dm9000_interrupt(dev->irq,dev,NULL);
+   enable_irq(dev->irq);
+}
+#endif
 
 /* dm9000_release_board
  *
@@ -538,6 +549,9 @@ dm9000_probe(struct platform_device *pde
ndev->stop   = &dm9000_stop;
ndev->get_stats  = &dm9000_get_stats;
ndev->set_multicast_list = &dm9000_hash_table;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+   ndev->poll_controller= &dm9000_poll_controller;
+#endif
 
 #ifdef DM9000_PROGRAM_EEPROM
program_eeprom(db);
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 18/41] wd section fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

WARNING: drivers/net/wd.o - Section mismatch: reference to .init.text: from 
.text between 'init_module' (at offset 0xfd) and 'wd_open'
WARNING: drivers/net/wd.o - Section mismatch: reference to .init.text: from 
.text between 'init_module' (at offset 0x14b) and 'wd_open'
WARNING: drivers/net/wd.o - Section mismatch: reference to 
.init.data:wd_portlist from .text between 'init_module' (at offset 0x17f) and 
'wd_open'

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/wd.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/net/wd.c~wd-section-fix drivers/net/wd.c
--- a/drivers/net/wd.c~wd-section-fix
+++ a/drivers/net/wd.c
@@ -500,8 +500,8 @@ MODULE_LICENSE("GPL");
 
 /* This is set up so that only a single autoprobe takes place per call.
 ISA device autoprobes on a running machine are not recommended. */
-int
-init_module(void)
+
+int __init init_module(void)
 {
struct net_device *dev;
int this_dev, found = 0;
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 20/41] seeq8005 section fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

WARNING: drivers/net/seeq8005.o - Section mismatch: reference to 
.init.text:seeq8005_probe from .text between 'init_module' (at offset 0x106) 
and 'seeq8005_open'

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/seeq8005.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/net/seeq8005.c~seeq8005-section-fix drivers/net/seeq8005.c
--- a/drivers/net/seeq8005.c~seeq8005-section-fix
+++ a/drivers/net/seeq8005.c
@@ -742,7 +742,7 @@ module_param(irq, int, 0);
 MODULE_PARM_DESC(io, "SEEQ 8005 I/O base address");
 MODULE_PARM_DESC(irq, "SEEQ 8005 IRQ number");
 
-int init_module(void)
+int __init init_module(void)
 {
dev_seeq = seeq8005_probe(-1);
if (IS_ERR(dev_seeq))
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 37/41] s390: fix arp_tbl lock usage in qeth

2006-08-14 Thread akpm
From: Heiko Carstens <[EMAIL PROTECTED]>

qeth: bhs must be disabled when accessing neighbour tables.

=
[ INFO: inconsistent lock state ]
-
inconsistent {in-softirq-W} -> {softirq-on-W} usage.
modprobe/529 [HC0[0]:SC0[0]:HE1:SE1] takes:
 (&tbl->lock){-+..}, at: [<40809384>] qeth_init+0x384/0x4c4 [qeth]
{in-softirq-W} state was registered at:
  [<0005f356>] lock_acquire+0x8a/0xb0
  [<0030ff06>] _write_lock+0x52/0x6c
  [<0024e3ec>] neigh_periodic_timer+0xa8/0x254
  [<00046888>] run_timer_softirq+0x1e4/0x278
  [<0004072c>] __do_softirq+0xb4/0x144
  [<0001f1b0>] do_softirq+0xec/0xf0
  [<00040938>] irq_exit+0x90/0xa8
  [<0001c1c0>] do_extint+0x100/0x11c
  [<0001fbf0>] ext_no_vtime+0x1c/0x26
  [<004df5ba>] tcp_init+0x10e/0x3c4
irq event stamp: 15707
hardirqs last  enabled at (15707): [<0030e080>] 
__mutex_unlock_slowpath+0x104/0x1b4
hardirqs last disabled at (15706): [<0030dfd8>] 
__mutex_unlock_slowpath+0x5c/0x1b4
softirqs last  enabled at (13036): [<000407a2>] __do_softirq+0x12a/0x144
softirqs last disabled at (13029): [<0001f1b0>] do_softirq+0xec/0xf0

other info that might help us debug this:
no locks held by modprobe/529.

stack backtrace:
3e38b200 3e38fb30 0002 
   3e38fbd0 3e38fb48 3e38fb48 00016744
      
   3e38fb30 000c 3e38fb30 3e38fba0
   0031e9f8 00016744 3e38fb30 3e38fb80
Call Trace:
([<000166d2>] show_trace+0x166/0x16c)
 [<0001679e>] show_stack+0xc6/0xf8
 [<000167fe>] dump_stack+0x2e/0x3c
 [<0005cef2>] print_usage_bug+0x26e/0x280
 [<0005dc50>] mark_lock+0x620/0x6c4
 [<0005eb8c>] __lock_acquire+0x750/0xe90
 [<0005f356>] lock_acquire+0x8a/0xb0
 [<0030ff06>] _write_lock+0x52/0x6c
 [<40809384>] qeth_init+0x384/0x4c4 [qeth]
 [<00069fe2>] sys_init_module+0xd6/0x2c8
 [<0001f4a4>] sysc_noemu+0x10/0x16
 [<0210dc9e>] 0x210dc9e

Cc: Arjan van de Ven <[EMAIL PROTECTED]>
Cc: Ingo Molnar <[EMAIL PROTECTED]>
Cc: Frank Pavlic <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/s390/net/qeth_main.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff -puN drivers/s390/net/qeth_main.c~s390-fix-arp_tbl-lock-usage-in-qeth 
drivers/s390/net/qeth_main.c
--- a/drivers/s390/net/qeth_main.c~s390-fix-arp_tbl-lock-usage-in-qeth
+++ a/drivers/s390/net/qeth_main.c
@@ -8510,9 +8510,9 @@ static int
 qeth_ipv6_init(void)
 {
qeth_old_arp_constructor = arp_tbl.constructor;
-   write_lock(&arp_tbl.lock);
+   write_lock_bh(&arp_tbl.lock);
arp_tbl.constructor = qeth_arp_constructor;
-   write_unlock(&arp_tbl.lock);
+   write_unlock_bh(&arp_tbl.lock);
 
arp_direct_ops = (struct neigh_ops*)
kmalloc(sizeof(struct neigh_ops), GFP_KERNEL);
@@ -8528,9 +8528,9 @@ qeth_ipv6_init(void)
 static void
 qeth_ipv6_uninit(void)
 {
-   write_lock(&arp_tbl.lock);
+   write_lock_bh(&arp_tbl.lock);
arp_tbl.constructor = qeth_old_arp_constructor;
-   write_unlock(&arp_tbl.lock);
+   write_unlock_bh(&arp_tbl.lock);
kfree(arp_direct_ops);
 }
 #endif /* CONFIG_QETH_IPV6 */
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 36/41] skge: remember to run netif_poll_disable()

2006-08-14 Thread akpm
From: "Edgar E. Iglesias" <[EMAIL PROTECTED]>

Signed-off-by: Edgar E. Iglesias <[EMAIL PROTECTED]>
Cc: Stephen Hemminger <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/skge.c |2 ++
 1 file changed, 2 insertions(+)

diff -puN drivers/net/skge.c~skge-remember-to-run-netif_poll_disable 
drivers/net/skge.c
--- a/drivers/net/skge.c~skge-remember-to-run-netif_poll_disable
+++ a/drivers/net/skge.c
@@ -2211,6 +2211,7 @@ static int skge_up(struct net_device *de
skge_write8(hw, Q_ADDR(rxqaddr[port], Q_CSR), CSR_START | CSR_IRQ_CL_F);
skge_led(skge, LED_MODE_ON);
 
+   netif_poll_enable(dev);
return 0;
 
  free_rx_ring:
@@ -2279,6 +2280,7 @@ static int skge_down(struct net_device *
 
skge_led(skge, LED_MODE_OFF);
 
+   netif_poll_disable(dev);
skge_tx_clean(skge);
skge_rx_clean(skge);
 
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 08/41] e2100 section fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

WARNING: drivers/net/e2100.o - Section mismatch: reference to .init.text: from 
.text between 'init_module' (at offset 0xd9) and 'e21_reset_8390'

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/e2100.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/net/e2100.c~e2100-section-fix drivers/net/e2100.c
--- a/drivers/net/e2100.c~e2100-section-fix
+++ a/drivers/net/e2100.c
@@ -425,8 +425,8 @@ MODULE_LICENSE("GPL");
 
 /* This is set up so that only a single autoprobe takes place per call.
 ISA device autoprobes on a running machine are not recommended. */
-int
-init_module(void)
+
+int __init init_module(void)
 {
struct net_device *dev;
int this_dev, found = 0;
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 07/41] at1700 section fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

WARNING: drivers/net/at1700.o - Section mismatch: reference to 
.init.text:at1700_probe from .text between 'init_module' (at offset 0x75) and 
'net_get_stats'

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/at1700.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/net/at1700.c~at1700-section-fix drivers/net/at1700.c
--- a/drivers/net/at1700.c~at1700-section-fix
+++ a/drivers/net/at1700.c
@@ -901,7 +901,7 @@ MODULE_PARM_DESC(io, "AT1700/FMV18X I/O 
 MODULE_PARM_DESC(irq, "AT1700/FMV18X IRQ number");
 MODULE_PARM_DESC(net_debug, "AT1700/FMV18X debug level (0-6)");
 
-int init_module(void)
+int __init init_module(void)
 {
if (io == 0)
printk("at1700: You should not use auto-probing with 
insmod!\n");
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 39/41] PAL: Support of the fixed PHY

2006-08-14 Thread akpm
From: Vitaly Bordug <[EMAIL PROTECTED]>

This makes it possible for HW PHY-less boards to utilize PAL goodies.  Generic
routines to connect to fixed PHY are provided, as well as ability to specify
software callback that fills up link, speed, etc.  information into PHY
descriptor (the latter feature not tested so far).

Signed-off-by: Vitaly Bordug <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/phy/Kconfig  |   17 +
 drivers/net/phy/Makefile |1 
 drivers/net/phy/fixed.c  |  358 +
 drivers/net/phy/mdio_bus.c   |1 
 drivers/net/phy/phy_device.c |   51 ++--
 include/linux/phy.h  |1 
 6 files changed, 408 insertions(+), 21 deletions(-)

diff -puN drivers/net/phy/Kconfig~pal-support-of-the-fixed-phy 
drivers/net/phy/Kconfig
--- a/drivers/net/phy/Kconfig~pal-support-of-the-fixed-phy
+++ a/drivers/net/phy/Kconfig
@@ -56,5 +56,22 @@ config SMSC_PHY
---help---
  Currently supports the LAN83C185 PHY
 
+config FIXED_PHY
+   tristate "Drivers for PHY emulation on fixed speed/link"
+   depends on PHYLIB
+   ---help---
+ Adds the driver to PHY layer to cover the boards that do not have any 
PHY bound,
+ but with the ability to manipulate with speed/link in software. The 
relavant MII
+ speed/duplex parameters could be effectively handled in 
user-specified  fuction.
+ Currently tested with mpc866ads.
+
+config FIXED_MII_10_FDX
+   bool "Emulation for 10M Fdx fixed PHY behavior"
+   depends on FIXED_PHY
+
+config FIXED_MII_100_FDX
+   bool "Emulation for 100M Fdx fixed PHY behavior"
+   depends on FIXED_PHY
+
 endmenu
 
diff -puN drivers/net/phy/Makefile~pal-support-of-the-fixed-phy 
drivers/net/phy/Makefile
--- a/drivers/net/phy/Makefile~pal-support-of-the-fixed-phy
+++ a/drivers/net/phy/Makefile
@@ -10,3 +10,4 @@ obj-$(CONFIG_LXT_PHY) += lxt.o
 obj-$(CONFIG_QSEMI_PHY)+= qsemi.o
 obj-$(CONFIG_SMSC_PHY) += smsc.o
 obj-$(CONFIG_VITESSE_PHY)  += vitesse.o
+obj-$(CONFIG_FIXED_PHY)+= fixed.o
diff -puN /dev/null drivers/net/phy/fixed.c
--- /dev/null
+++ a/drivers/net/phy/fixed.c
@@ -0,0 +1,358 @@
+/*
+ * drivers/net/phy/fixed.c
+ *
+ * Driver for fixed PHYs, when transceiver is able to operate in one fixed 
mode.
+ *
+ * Author: Vitaly Bordug
+ *
+ * Copyright (c) 2006 MontaVista Software, Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#define MII_REGS_NUM   7
+
+/*
+The idea is to emulate normal phy behavior by responding with
+pre-defined values to mii BMCR read, so that read_status hook could
+take all the needed info.
+*/
+
+struct fixed_phy_status {
+   u8  link;
+   u16 speed;
+   u8  duplex;
+};
+
+/*-
+ *  Private information hoder for mii_bus
+ 
*-*/
+struct fixed_info {
+   u16 *regs;
+   u8 regs_num;
+   struct fixed_phy_status phy_status;
+   struct phy_device *phydev; /* pointer to the container */
+   /* link & speed cb */
+   int(*link_update)(struct net_device*, struct fixed_phy_status*);
+
+};
+
+/*-
+ *  If something weird is required to be done with link/speed,
+ * network driver is able to assign a function to implement this.
+ * May be useful for PHY's that need to be software-driven.
+ 
*-*/
+int fixed_mdio_set_link_update(struct phy_device* phydev,
+   int(*link_update)(struct net_device*, struct fixed_phy_status*))
+{
+   struct fixed_info *fixed;
+
+   if(link_update == NULL)
+   return -EINVAL;
+
+   if(phydev) {
+   if(phydev->bus) {
+   fixed = phydev->bus->priv;
+   fixed->link_update = link_update;
+   return 0;
+   }
+   }
+   return -EINVAL;
+}
+EXPORT_SYMBOL(fixed_mdio_set_link_update);
+
+/*-
+ *  This is used for updating internal mii regs from the status
+ 
*-*/
+static int fixed_mdio_update_regs(struct fixed_info *fixed)
+{
+   u16 *regs = fixed->regs;
+   

[patch 29/41] smc911x: Re-release spinlock on spurious interrupt

2006-08-14 Thread akpm
From: Peter Korsgaard <[EMAIL PROTECTED]>

The smc911x driver forgets to release the spinlock on spurious interrupts. 
This little patch fixes it.

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Peter Korsgaard <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/smc911x.c |1 +
 1 file changed, 1 insertion(+)

diff -puN 
drivers/net/smc911x.c~smc911x-re-release-spinlock-on-spurious-interrupt 
drivers/net/smc911x.c
--- a/drivers/net/smc911x.c~smc911x-re-release-spinlock-on-spurious-interrupt
+++ a/drivers/net/smc911x.c
@@ -1090,6 +1090,7 @@ static irqreturn_t smc911x_interrupt(int
/* Spurious interrupt check */
if ((SMC_GET_IRQ_CFG() & (INT_CFG_IRQ_INT_ | INT_CFG_IRQ_EN_)) !=
(INT_CFG_IRQ_INT_ | INT_CFG_IRQ_EN_)) {
+   spin_unlock_irqrestore(&lp->lock, flags);
return IRQ_NONE;
}
 
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 34/41] build fixes: smc91x

2006-08-14 Thread akpm
From: David Brownell <[EMAIL PROTECTED]>

Unclear how these bugs arrived, presumably from incorrect cleanup of
the 16-bit-only paths, but smc91x wouldn't build for OMAP.

Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Cc: Nicolas Pitre <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/smc91x.h |6 --
 1 file changed, 6 deletions(-)

diff -puN drivers/net/smc91x.h~build-fixes-smc91x drivers/net/smc91x.h
--- a/drivers/net/smc91x.h~build-fixes-smc91x
+++ a/drivers/net/smc91x.h
@@ -184,16 +184,10 @@ SMC_outw(u16 val, void __iomem *ioaddr, 
 #define SMC_IO_SHIFT   0
 #define SMC_NOWAIT 1
 
-#define SMC_inb(a, r)  readb((a) + (r))
-#define SMC_outb(v, a, r)  writeb(v, (a) + (r))
 #define SMC_inw(a, r)  readw((a) + (r))
 #define SMC_outw(v, a, r)  writew(v, (a) + (r))
 #define SMC_insw(a, r, p, l)   readsw((a) + (r), p, l)
 #define SMC_outsw(a, r, p, l)  writesw((a) + (r), p, l)
-#define SMC_inl(a, r)  readl((a) + (r))
-#define SMC_outl(v, a, r)  writel(v, (a) + (r))
-#define SMC_insl(a, r, p, l)   readsl((a) + (r), p, l)
-#define SMC_outsl(a, r, p, l)  writesl((a) + (r), p, l)
 
 #include 
 #include 
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 14/41] lne390 section fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

WARNING: drivers/net/lne390.o - Section mismatch: reference to .init.text: from 
.text between 'init_module' (at offset 0x100) and 'lne390_close'

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/lne390.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/net/lne390.c~lne390-section-fix drivers/net/lne390.c
--- a/drivers/net/lne390.c~lne390-section-fix
+++ a/drivers/net/lne390.c
@@ -406,7 +406,7 @@ MODULE_PARM_DESC(mem, "memory base addre
 MODULE_DESCRIPTION("Mylex LNE390A/B EISA Ethernet driver");
 MODULE_LICENSE("GPL");
 
-int init_module(void)
+int __init init_module(void)
 {
struct net_device *dev;
int this_dev, found = 0;
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 19/41] ni65 section fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

WARNING: drivers/net/ni65.o - Section mismatch: reference to 
.init.text:ni65_probe from .text between 'init_module' (at offset 0x54a) and 
'ni65_stop_start'

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/ni65.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/net/ni65.c~ni65-section-fix drivers/net/ni65.c
--- a/drivers/net/ni65.c~ni65-section-fix
+++ a/drivers/net/ni65.c
@@ -1253,7 +1253,7 @@ MODULE_PARM_DESC(irq, "ni6510 IRQ number
 MODULE_PARM_DESC(io, "ni6510 I/O base address");
 MODULE_PARM_DESC(dma, "ni6510 ISA DMA channel (ignored for some cards)");
 
-int init_module(void)
+int __init init_module(void)
 {
dev_ni65 = ni65_probe(-1);
return IS_ERR(dev_ni65) ? PTR_ERR(dev_ni65) : 0;
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 04/41] ac3200 section fixes

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

WARNING: drivers/net/ac3200.o - Section mismatch: reference to .init.text: from 
.text between 'init_module' (at offset 0xf9) and 'ac_close_card'

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/ac3200.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff -puN drivers/net/ac3200.c~ac3200-section-fixes drivers/net/ac3200.c
--- a/drivers/net/ac3200.c~ac3200-section-fixes
+++ a/drivers/net/ac3200.c
@@ -370,8 +370,7 @@ MODULE_PARM_DESC(mem, "Memory base addre
 MODULE_DESCRIPTION("Ansel AC3200 EISA ethernet driver");
 MODULE_LICENSE("GPL");
 
-int
-init_module(void)
+int __init init_module(void)
 {
struct net_device *dev;
int this_dev, found = 0;
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 15/41] ni52 section fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

WARNING: drivers/net/ni52.o - Section mismatch: reference to 
.init.text:ni52_probe from .text between 'init_module' (at offset 0x997) and 
'ni52_close'
WARNING: drivers/net/ni65.o - Section mismatch: reference to 
.init.text:ni65_probe from .text between 'init_module' (at offset 0x54a) and 
'ni65_stop_start'

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/ni52.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/net/ni52.c~ni52-section-fix drivers/net/ni52.c
--- a/drivers/net/ni52.c~ni52-section-fix
+++ a/drivers/net/ni52.c
@@ -1323,7 +1323,7 @@ MODULE_PARM_DESC(irq, "NI5210 IRQ number
 MODULE_PARM_DESC(memstart, "NI5210 memory base address,required");
 MODULE_PARM_DESC(memend, "NI5210 memory end address,required");
 
-int init_module(void)
+int __init init_module(void)
 {
if(io <= 0x0 || !memend || !memstart || irq < 2) {
printk("ni52: Autoprobing not allowed for modules.\nni52: Set 
symbols 'io' 'irq' 'memstart' and 'memend'\n");
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 31/41] via-rhine: NAPI poll enable

2006-08-14 Thread akpm
From: Stephen Hemminger <[EMAIL PROTECTED]>

The poll_enable should be in init_registers before enabling interrupts, not
in tx_timeout.  Thanks for spotting it Roger.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
Cc: Roger Luethi <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/via-rhine.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -puN drivers/net/via-rhine.c~via-rhine-napi-poll-enable 
drivers/net/via-rhine.c
--- a/drivers/net/via-rhine.c~via-rhine-napi-poll-enable
+++ a/drivers/net/via-rhine.c
@@ -1048,6 +1048,8 @@ static void init_registers(struct net_de
 
rhine_set_rx_mode(dev);
 
+   netif_poll_enable(dev);
+
/* Enable interrupts by setting the interrupt mask. */
iowrite16(IntrRxDone | IntrRxErr | IntrRxEmpty| IntrRxOverflow |
   IntrRxDropped | IntrRxNoBuf | IntrTxAborted |
@@ -1199,7 +1201,6 @@ static void rhine_tx_timeout(struct net_
dev->trans_start = jiffies;
rp->stats.tx_errors++;
netif_wake_queue(dev);
-   netif_poll_enable(dev);
 }
 
 static int rhine_start_tx(struct sk_buff *skb, struct net_device *dev)
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 01/41] e100: disable interrupts at boot

2006-08-14 Thread akpm
From: Bjorn Helgaas <[EMAIL PROTECTED]>

Apparently the Intel PRO/100 device enables interrupts on reset.  Unless
firmware explicitly disables PRO/100 interrupts, we can get a flood of
interrupts when a driver attaches to an unrelated device that happens to
share the PRO/100 IRQ.

This should resolve this "irq 11: nobody cared" bug report:
http://bugzilla.kernel.org/show_bug.cgi?id=5918

Signed-off-by: Bjorn Helgaas <[EMAIL PROTECTED]>
Cc: Jesse Brandeburg <[EMAIL PROTECTED]>
Cc: Jeff Kirsher <[EMAIL PROTECTED]>
Cc: John Ronciak <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/pci/quirks.c |   57 +
 1 file changed, 57 insertions(+)

diff -puN drivers/pci/quirks.c~e100-disable-interrupts-at-boot 
drivers/pci/quirks.c
--- a/drivers/pci/quirks.c~e100-disable-interrupts-at-boot
+++ a/drivers/pci/quirks.c
@@ -1518,6 +1518,63 @@ static void __devinit quirk_netmos(struc
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETMOS, PCI_ANY_ID, quirk_netmos);
 
+static void __devinit quirk_e100_interrupt(struct pci_dev *dev)
+{
+   u16 command;
+   u32 bar;
+   u8 __iomem *csr;
+   u8 cmd_hi;
+
+   switch (dev->device) {
+   /* PCI IDs taken from drivers/net/e100.c */
+   case 0x1029:
+   case 0x1030 ... 0x1034:
+   case 0x1038 ... 0x103E:
+   case 0x1050 ... 0x1057:
+   case 0x1059:
+   case 0x1064 ... 0x106B:
+   case 0x1091 ... 0x1095:
+   case 0x1209:
+   case 0x1229:
+   case 0x2449:
+   case 0x2459:
+   case 0x245D:
+   case 0x27DC:
+   break;
+   default:
+   return;
+   }
+
+   /*
+* Some firmware hands off the e100 with interrupts enabled,
+* which can cause a flood of interrupts if packets are
+* received before the driver attaches to the device.  So
+* disable all e100 interrupts here.  The driver will
+* re-enable them when it's ready.
+*/
+   pci_read_config_word(dev, PCI_COMMAND, &command);
+   pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &bar);
+
+   if (!(command & PCI_COMMAND_MEMORY) || !bar)
+   return;
+
+   csr = ioremap(bar, 8);
+   if (!csr) {
+   printk(KERN_WARNING "PCI: Can't map %s e100 registers\n",
+   pci_name(dev));
+   return;
+   }
+
+   cmd_hi = readb(csr + 3);
+   if (cmd_hi == 0) {
+   printk(KERN_WARNING "PCI: Firmware left %s e100 interrupts "
+   "enabled, disabling\n", pci_name(dev));
+   writeb(1, csr + 3);
+   }
+
+   iounmap(csr);
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, quirk_e100_interrupt);
 
 static void __devinit fixup_rev1_53c810(struct pci_dev* dev)
 {
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 11/41] es3210 section fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

WARNING: drivers/net/es3210.o - Section mismatch: reference to .init.text: from 
.text between 'init_module' (at offset 0xdf) and 'es_close'
WARNING: drivers/net/es3210.o - Section mismatch: reference to .init.text: from 
.text between 'init_module' (at offset 0x100) and 'es_close'

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/es3210.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff -puN drivers/net/es3210.c~es3210-section-fix drivers/net/es3210.c
--- a/drivers/net/es3210.c~es3210-section-fix
+++ a/drivers/net/es3210.c
@@ -421,8 +421,7 @@ MODULE_PARM_DESC(mem, "memory base addre
 MODULE_DESCRIPTION("Racal-Interlan ES3210 EISA ethernet driver");
 MODULE_LICENSE("GPL");
 
-int
-init_module(void)
+int __init init_module(void)
 {
struct net_device *dev;
int this_dev, found = 0;
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 09/41] eepro section fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

WARNING: drivers/net/eepro.o - Section mismatch: reference to .init.text: from 
.text between 'init_module' (at offset 0x284) and 'eepro_ethtool_get_drvinfo'
WARNING: drivers/net/eepro.o - Section mismatch: reference to .init.text: from 
.text between 'init_module' (at offset 0x2a7) and 'eepro_ethtool_get_drvinfo'
WARNING: drivers/net/eepro.o - Section mismatch: reference to 
.init.data:eepro_portlist from .text between 'init_module' (at offset 0x2b3) 
and 'eepro_ethtool_get_drvinfo'

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/eepro.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff -puN drivers/net/eepro.c~eepro-section-fix drivers/net/eepro.c
--- a/drivers/net/eepro.c~eepro-section-fix
+++ a/drivers/net/eepro.c
@@ -1807,8 +1807,7 @@ MODULE_PARM_DESC(irq, "EtherExpress Pro/
 MODULE_PARM_DESC(mem, "EtherExpress Pro/10 Rx buffer size(es) in kB (3-29)");
 MODULE_PARM_DESC(autodetect, "EtherExpress Pro/10 force board(s) detection 
(0-1)");
 
-int
-init_module(void)
+int __init init_module(void)
 {
struct net_device *dev;
int i;
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 13/41] lance section fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

WARNING: drivers/net/lance.o - Section mismatch: reference to 
.init.data:lance_portlist from .text between 'init_module' (at offset 0x8d3) 
and 'lance_purge_ring'
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/lance.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/net/lance.c~lance-section-fix drivers/net/lance.c
--- a/drivers/net/lance.c~lance-section-fix
+++ a/drivers/net/lance.c
@@ -326,7 +326,7 @@ MODULE_PARM_DESC(dma, "LANCE/PCnet ISA D
 MODULE_PARM_DESC(irq, "LANCE/PCnet IRQ number (ignored for some devices)");
 MODULE_PARM_DESC(lance_debug, "LANCE/PCnet debug level (0-7)");
 
-int init_module(void)
+int __init init_module(void)
 {
struct net_device *dev;
int this_dev, found = 0;
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 22/41] fealnx section fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

With CONFIG_HOTPLUG=n it won't compile:

distcc[25607] ERROR: compile drivers/net/fealnx.c on g5/64 failed

version[] is referred to from both __init code and from __devinit code, so
move it out of __init altogether.

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/fealnx.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/net/fealnx.c~fealnx-section-fix drivers/net/fealnx.c
--- a/drivers/net/fealnx.c~fealnx-section-fix
+++ a/drivers/net/fealnx.c
@@ -92,7 +92,7 @@ static int full_duplex[MAX_UNITS] = { -1
 #include 
 
 /* These identify the driver base version and may not be removed. */
-static char version[] __devinitdata =
+static char version[] =
 KERN_INFO DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE "\n";
 
 
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 06/41] cs89x0 section fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

WARNING: drivers/net/cs89x0.o - Section mismatch: reference to 
.init.data:version from .text between 'init_module' (at offset 0x13d8) and 
'net_get_stats'
WARNING: drivers/net/cs89x0.o - Section mismatch: reference to .init.text: from 
.text between 'init_module' (at offset 0x1634) and 'net_get_stats'
WARNING: drivers/net/cs89x0.o - Section mismatch: reference to .init.text: from 
.text between 'init_module' (at offset 0x1a1f) and 'net_get_stats'

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/cs89x0.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff -puN drivers/net/cs89x0.c~cs89x0-section-fix drivers/net/cs89x0.c
--- a/drivers/net/cs89x0.c~cs89x0-section-fix
+++ a/drivers/net/cs89x0.c
@@ -1905,8 +1905,7 @@ MODULE_LICENSE("GPL");
 
 */
 
-int
-init_module(void)
+int __init init_module(void)
 {
struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
struct net_local *lp;
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 03/41] 82596 section fixes

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

WARNING: drivers/net/82596.o - Section mismatch: reference to 
.init.text:i82596_probe from .text between 'init_module' (at offset 0x141) and 
'i596_add_cmd'

Also nail a couple of crazy inlines.

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/82596.c |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff -puN drivers/net/82596.c~82596-section-fixes drivers/net/82596.c
--- a/drivers/net/82596.c~82596-section-fixes
+++ a/drivers/net/82596.c
@@ -899,7 +899,7 @@ memory_squeeze:
 }
 
 
-static inline void i596_cleanup_cmd(struct net_device *dev, struct 
i596_private *lp)
+static void i596_cleanup_cmd(struct net_device *dev, struct i596_private *lp)
 {
struct i596_cmd *ptr;
 
@@ -932,7 +932,8 @@ static inline void i596_cleanup_cmd(stru
lp->scb.cmd = I596_NULL;
 }
 
-static inline void i596_reset(struct net_device *dev, struct i596_private *lp, 
int ioaddr)
+static void i596_reset(struct net_device *dev, struct i596_private *lp,
+   int ioaddr)
 {
unsigned long flags;
 
@@ -1578,7 +1579,7 @@ static int debug = -1;
 module_param(debug, int, 0);
 MODULE_PARM_DESC(debug, "i82596 debug mask");
 
-int init_module(void)
+int __init init_module(void)
 {
if (debug >= 0)
i596_debug = debug;
@@ -1588,7 +1589,7 @@ int init_module(void)
return 0;
 }
 
-void cleanup_module(void)
+void __exit cleanup_module(void)
 {
unregister_netdev(dev_82596);
 #ifdef __mc68000__
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 12/41] eth16i section fix

2006-08-14 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

WARNING: drivers/net/eth16i.o - Section mismatch: reference to 
.init.data:cardname from .text between 'init_module' (at offset 0x6d2) and 
'eth16i_multicast'
WARNING: drivers/net/eth16i.o - Section mismatch: reference to .init.text: from 
.text between 'init_module' (at offset 0x6ef) and 'eth16i_multicast'
WARNING: drivers/net/eth16i.o - Section mismatch: reference to .init.text: from 
.text between 'init_module' (at offset 0x702) and 'eth16i_multicast'
WARNING: drivers/net/eth16i.o - Section mismatch: reference to 
.init.data:cardname from .text between 'init_module' (at offset 0x70e) and 
'eth16i_multicast'
WARNING: drivers/net/eth16i.o - Section mismatch: reference to .init.text: from 
.text between 'init_module' (at offset 0x71d) and 'eth16i_multicast'
WARNING: drivers/net/eth16i.o - Section mismatch: reference to 
.init.data:cardname from .text between 'init_module' (at offset 0x729) and 
'eth16i_multicast'

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/eth16i.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/net/eth16i.c~eth16i-section-fix drivers/net/eth16i.c
--- a/drivers/net/eth16i.c~eth16i-section-fix
+++ a/drivers/net/eth16i.c
@@ -1434,7 +1434,7 @@ MODULE_PARM_DESC(mediatype, "eth16i medi
 module_param(debug, int, 0);
 MODULE_PARM_DESC(debug, "eth16i debug level (0-6)");
 
-int init_module(void)
+int __init init_module(void)
 {
int this_dev, found = 0;
struct net_device *dev;
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: ehea debug output discussion

2006-08-14 Thread Paul Mackerras
Jan-Bernd Themann writes:

> The outcome of some internal discussions was that it is not acceptable for
> our enterprise users of this type of driver on this target system to need a
> recompile / reload of the driver for error analysis, so we need a mechanism
> that allows us to switch on / off debug output at runtime. Therefore, we'd
> introduce a stripped down version of EDEB.

This is precisely what kprobes is for.  There is no need for
EDEB-style debug code in the source given that kprobes gives you the
ability to add logging in at (almost) arbitrary points at runtime.  In
fact kprobes is more powerful because you don't have to specify the
set of points of interest when the kernel is built--you can do it
later, at the time of debugging.

Please look into providing a kprobes module and/or a systemtap script
for the debugging points you want rather than cluttering up the source
code with EDEB statements.

Paul.

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 09/16] [IPv6] address: Convert address notification to use rtnl_notify()

2006-08-14 Thread jamal
On Mon, 2006-14-08 at 22:46 -0400, jamal wrote:
> On Tue, 2006-15-08 at 10:56 +1000, Herbert Xu wrote:
> Thats all the quagga
> and other folks were looking for in cases where it was ambigous. 
> 

Just to be clear, when Alexey says "that past discussion essentially
closed the question." he is correct and i did not, hopefully, insuniate
otherwise. The question i posed above is still valid though ;->

cheers,
jamal



-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 09/16] [IPv6] address: Convert address notification to use rtnl_notify()

2006-08-14 Thread jamal
On Tue, 2006-15-08 at 10:56 +1000, Herbert Xu wrote:

> Agreed.  The pid field in the netlink header should be treated as an
> opaque value.  Any attempt to interpret it as the process ID is doomed
> to failure.


Not necessarily as a processid ("PID" is a really bad noun in that
sense); but rather as something meaningful of interpretation in regards
to the real origin of the executed change. 
The concept of "whodunnit" is invaluable. 
And a processid tends to be useful when nothing else is there to
identify the originator. Just saying "it is the kernel" (PID=0) when the
kernel just acted as a proxy of some user space app, is not useful all
the times, IMO.
[Routes, but not other functional blocks in rtnetlink, actually have a
field (called protocol) that says who added them]. Thats all the quagga
and other folks were looking for in cases where it was ambigous. 

cheers,
jamal

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Kernel patches enabling better POSIX AIO (Was Re: [3/4] kevent: AIO, aio_sendfile)

2006-08-14 Thread Nicholas Miell
On Mon, 2006-08-14 at 09:38 -0700, Ulrich Drepper wrote:
> Suparna Bhattacharya wrote:
> > Is there a (remote) possibility that the thread could have died and its
> > pid got reused by a new thread in another process ? Or is there a mechanism
> > that prevents such a possibility from arising (not just in NPTL library,
> > but at the kernel level) ?
> 
> The UID/GID won't help you with dying processes.  What if the same user
> creates a process with the same PID?  That process will not expect the
> notification and mustn't receive it.  If you cannot detect whether the
> issuing process died you have problems which cannot be solved with a
> uid/gid pair.
> 
> 

Eric W. Biederman sent a series of patches that introduced a struct
task_ref specifically to solve this sort of problem on January 28 of
this year, but I don't think it went anywhere.


-- 
Nicholas Miell <[EMAIL PROTECTED]>

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] move skb->dev assignment into netdev_alloc_skb

2006-08-14 Thread Brandeburg, Jesse
On Sat, 12 Aug 2006, Christoph Hellwig wrote:
> > >> Signed-off-by: Christoph Hellwig <[EMAIL PROTECTED]>
> > >
> > >Since the e1000 change is non-trivial I'm not going to bypass
> > >the driver author on it, sorry.
> > >
> > >What I did do was put the netdev_alloc_skb() change into my
> > >tree, and since I'm co-author of the tg3 driver I'll apply
> > >that bit too.
> > >
> > >The e1000 bit will need to go through the e1000 maintainers.
> > 
> > Thank you, I'll take a look at this tomorrow, as I need to digest the
> > patch in context.
> 
> Did you get a chance to look at it?  For your conveniance here's just
> the e1000 bits, without the hunks Dave has commited already:
> 

I'm okay with this change.  Auke will shortly be submitting a patch set 
for 2.6.19 and it should include this.

Thanks for the feedback Christoph!

Jesse

for reference this is the patch, but like i said auke will enqueue it in 
GIT and send it to Jeff for inclusion.

e1000: clean up skb allocation code, patch submitted by Christoph

Signed-off-by: Christoph Hellwig <[EMAIL PROTECTED]>
Acked-by: Jesse Brandeburg <[EMAIL PROTECTED]>

---

 drivers/net/e1000/e1000_main.c |   19 +++
 1 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 627f224..66c0325 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -36,7 +36,7 @@ static char e1000_driver_string[] = "Int
 #else
 #define DRIVERNAPI "-NAPI"
 #endif
-#define DRV_VERSION "7.1.9-k4"DRIVERNAPI
+#define DRV_VERSION "7.1.9-k6"DRIVERNAPI
 char e1000_driver_version[] = DRV_VERSION;
 static char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
 
@@ -3711,7 +3711,6 @@ e1000_clean_rx_irq(struct e1000_adapter 
netdev_alloc_skb(netdev, length + NET_IP_ALIGN);
if (new_skb) {
skb_reserve(new_skb, NET_IP_ALIGN);
-   new_skb->dev = netdev;
memcpy(new_skb->data - NET_IP_ALIGN,
   skb->data - NET_IP_ALIGN,
   length + NET_IP_ALIGN);
@@ -3978,13 +3977,13 @@ e1000_alloc_rx_buffers(struct e1000_adap
buffer_info = &rx_ring->buffer_info[i];
 
while (cleaned_count--) {
-   if (!(skb = buffer_info->skb))
-   skb = netdev_alloc_skb(netdev, bufsz);
-   else {
+   skb = buffer_info->skb;
+   if (skb) {
skb_trim(skb, 0);
goto map_skb;
}
 
+   skb = netdev_alloc_skb(netdev, bufsz);
if (unlikely(!skb)) {
/* Better luck next round */
adapter->alloc_rx_buff_failed++;
@@ -4009,10 +4008,10 @@ e1000_alloc_rx_buffers(struct e1000_adap
dev_kfree_skb(skb);
dev_kfree_skb(oldskb);
break; /* while !buffer_info->skb */
-   } else {
-   /* Use new allocation */
-   dev_kfree_skb(oldskb);
}
+
+   /* Use new allocation */
+   dev_kfree_skb(oldskb);
}
/* Make buffer alignment 2 beyond a 16 byte boundary
 * this will result in a 16 byte aligned IP header after
@@ -4020,8 +4019,6 @@ e1000_alloc_rx_buffers(struct e1000_adap
 */
skb_reserve(skb, NET_IP_ALIGN);
 
-   skb->dev = netdev;
-
buffer_info->skb = skb;
buffer_info->length = adapter->rx_buffer_len;
 map_skb:
@@ -4135,8 +4132,6 @@ e1000_alloc_rx_buffers_ps(struct e1000_a
 */
skb_reserve(skb, NET_IP_ALIGN);
 
-   skb->dev = netdev;
-
buffer_info->skb = skb;
buffer_info->length = adapter->rx_ps_bsize0;
buffer_info->dma = pci_map_single(pdev, skb->data,
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 09/16] [IPv6] address: Convert address notification to use rtnl_notify()

2006-08-14 Thread Herbert Xu
Alexey Kuznetsov <[EMAIL PROTECTED]> wrote:
> 
>> IMO, I believe there is a strong case that can be made for events that
>> were caused by non-netlink users such as ioctls that could at least be
>> multicast with current->pid.
> 
> Highly not desired.

Agreed.  The pid field in the netlink header should be treated as an
opaque value.  Any attempt to interpret it as the process ID is doomed
to failure.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


BUG at kernel/workqueue.c:149 using linux-2.6.18-rc4 with zd1211rw

2006-08-14 Thread Max

Hit this when connecting a computer to an access point with a zydas usb
dongle using the zd1211rw driver. This seems entirely reproducible
(2/2).  The system hit the BUG over night. I already sent this to
zd1211-devs and Ulrich Kunitz suggested that it might be a bug in
softmac, so resending to a wider audience.

Max
--
kernel BUG at kernel/workqueue.c:149!
invalid opcode:  [#1]
Modules linked in: michael_mic arc4 zd1211rw ieee80211_crypt_wep 
ieee80211_crypt_tkip ieee80211_crypt_ccmp firmware_class ieee80211softmac 
ieee80211 ieee80211_crypt snd_mixer_oss rfcomm l2cap bluetooth 8250 serial_core 
snd_cmipci snd_pcm snd_page_alloc snd_opl3_lib snd_timer snd_hwdep 
snd_mpu401_uart snd_rawmidi snd ehci_hcd uhci_hcd ohci_hcd ohci1394 ieee1394
CPU:0
EIP:0060:[]Not tainted VLI
EFLAGS: 00010082   (2.6.18-rc4 #1)
EIP is at queue_delayed_work+0x71/0x90
eax:    ebx: e0f024ec   ecx: f7146780   edx: e0f024d4
esi: c1ab63c0   edi: 0bb8   ebp: f6084a38   esp: c1ac7efc
ds: 007b   es: 007b   ss: 0068
Process events/0 (pid: 4, ti=c1ac6000 task=c1ab8ab0 task.ti=c1ac6000)
Stack: 02000112 e0f024d4 0292 e0f024c0 f68cd600 fa9c9a47 f6084d5c 0006
    0086 0296 c1ac7f40 0086  e0f024d4 c1a94420
   0296 e0f024c0 c01285b1 e0f024c0 c1ab8bc0 021c c1a94428 c1a94438
Call Trace:
 [] ieee80211softmac_auth_queue+0x57/0x170 [ieee80211softmac]
 [] run_workqueue+0x61/0xd0
 [] ieee80211softmac_auth_queue+0x0/0x170 [ieee80211softmac]
 [] worker_thread+0x147/0x170
 [] default_wake_function+0x0/0x20
 [] worker_thread+0x0/0x170
 [] kthread+0xfd/0x110
 [] kthread+0x0/0x110
 [] kernel_thread_helper+0x5/0x10
Code: a1 80 b3 45 c0 89 53 10 c7 43 0c a0 83 12 c0 01 f8 85 c9 89 43 08 75 27 
89 44 24 04 89 1c 24 e8 d6 8c ff ff b9 01 00 00 00 eb b1 <0f> 0b 95 00 34 b7 3f 
c0 eb c0 0f 0b 96 00 34 b7 3f c0 eb be 0f
EIP: [] queue_delayed_work+0x71/0x90 SS:ESP 0068:c1ac7efc
 <7>SoftMAC: Authentication response received from 00:13:10:36:43:0b but no 
queue item exists.
SoftMAC: Authentication response received from 00:13:10:36:43:0b but no queue 
item exists.
--
int fastcall queue_delayed_work(struct workqueue_struct *wq,
struct work_struct *work, unsigned long delay)
{
int ret = 0;
struct timer_list *timer = &work->timer;

if (!test_and_set_bit(0, &work->pending)) {
BUG_ON(timer_pending(timer));  <--- XXX
BUG_ON(!list_empty(&work->entry));

/* This stores wq for the moment, for the timer_fn */
work->wq_data = wq;
timer->expires = jiffies + delay;
timer->data = (unsigned long)work;
timer->function = delayed_work_timer_fn;
add_timer(timer);
ret = 1;
}
return ret;
}
--
[...]
SoftMAC: Received deauthentication packet from 00:13:10:36:43:0b, but that 
network is unknown.
SoftMAC: Received deauthentication packet from 00:13:10:36:43:0b, but that 
network is unknown.
SoftMAC: Received deauthentication packet from 00:13:10:36:43:0b, but that 
network is unknown.
SoftMAC: Received deauthentication packet from 00:13:10:36:43:0b, but that 
network is unknown.
SoftMAC: Open Authentication completed with 00:13:10:36:43:0b
SoftMAC: Authentication response received from 00:13:10:36:43:0b but no queue 
item exists.
TKIP: replay detected: STA=00:13:10:36:43:0b previous TSC 0001 received 
TSC 0001
TKIP: replay detected: STA=00:13:10:36:43:0b previous TSC 0001 received 
TSC 0001
SoftMAC: Received deauthentication packet from 00:13:10:36:43:0b, but that 
network is unknown.
SoftMAC: Received deauthentication packet from 00:13:10:36:43:0b, but that 
network is unknown.
SoftMAC: Received deauthentication packet from 00:13:10:36:43:0b, but that 
network is unknown.
SoftMAC: Received deauthentication packet from 00:13:10:36:43:0b, but that 
network is unknown.
SoftMAC: Open Authentication completed with 00:13:10:36:43:0b
SoftMAC: Authentication response received from 00:13:10:36:43:0b but no queue 
item exists.
TKIP: replay detected: STA=00:13:10:36:43:0b previous TSC 0001 received 
TSC 0001
TKIP: replay detected: STA=00:13:10:36:43:0b previous TSC 0001 received 
TSC 0001
TKIP: replay detected: STA=00:13:10:36:43:0b previous TSC 0001 received 
TSC 0001
SoftMAC: Received deauthentication packet from 00:13:10:36:43:0b, but that 
network is unknown.
SoftMAC: Authentication timed out with 00:13:10:36:43:0b
SoftMAC: Authentication timed out with 00:13:10:36:43:0b
SoftMAC: Authentication timed out with 00:13:10:36:43:0b
SoftMAC: Authentication timed out with 00:13:10:36:43:0b
SoftMAC: Authentication timed out with 00:13:10:36:43:0b
SoftMAC: Open Authentication completed with 00:13:10:36:43:0b
SoftMAC: Open Authentication completed with 00:13:10:36:43:0b
SoftMAC: Authentication response received from 00:13:10:36:43:0b but no qu

Re: [RFC 5/7] neighbour: convert lookup to sequence lock

2006-08-14 Thread Alexey Kuznetsov
Hello!

> That wouldn't work if hard_header() ever expands the head. Fortunately
> hard_header() returns the length added even in case of an error so we
> can undo the absolute value returned.

Yes.

Or probably it is safer to undo to skb->nh. Even if hard_header
expands skb, skb->nh still remains valid.

Alexey
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[2.6 patch] orinoco.h: "extern inline" -> "static __always_inline"

2006-08-14 Thread Adrian Bunk
"extern inline" generates a warning with -Wmissing-prototypes and I'm 
currently working on getting the kernel cleaned up for adding this to 
the CFLAGS since it will help us to avoid a nasty class of runtime 
errors.

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>

---

 drivers/net/wireless/orinoco.h |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

--- linux-2.6.18-rc4-mm1/drivers/net/wireless/orinoco.h.old 2006-08-13 
23:14:05.0 +0200
+++ linux-2.6.18-rc4-mm1/drivers/net/wireless/orinoco.h 2006-08-13 
23:14:39.0 +0200
@@ -138,8 +138,8 @@
  * SPARC, due to its weird semantics for save/restore flags. extern
  * inline should prevent the kernel from linking or module from
  * loading if they are not inlined. */
-extern inline int orinoco_lock(struct orinoco_private *priv,
-  unsigned long *flags)
+static __always_inline int orinoco_lock(struct orinoco_private *priv,
+   unsigned long *flags)
 {
spin_lock_irqsave(&priv->lock, *flags);
if (priv->hw_unavailable) {
@@ -151,8 +151,8 @@
return 0;
 }
 
-extern inline void orinoco_unlock(struct orinoco_private *priv,
- unsigned long *flags)
+static __always_inline void orinoco_unlock(struct orinoco_private *priv,
+  unsigned long *flags)
 {
spin_unlock_irqrestore(&priv->lock, *flags);
 }

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 09/16] [IPv6] address: Convert address notification to use rtnl_notify()

2006-08-14 Thread Alexey Kuznetsov
Hello!

> Some of these removals of current->pid will affect users such as quagga,
> zebra, vrrpd etc.

If they survived cleanup in IPv4, they definitely will not feel cleanup
in IPv6.

Thomas does great work, Jamal, do not worry. :-)


> IMO, I believe there is a strong case that can be made for events that
> were caused by non-netlink users such as ioctls that could at least be
> multicast with current->pid.

Highly not desired.


> It would also be acceptable if the quagga etc folks could meet their
> goals some other way.

To all that I remember, that past discussion essentially closed the question.

Alexey
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 09/16] [IPv6] address: Convert address notification to use rtnl_notify()

2006-08-14 Thread jamal
On Tue, 2006-15-08 at 02:07 +0200, Thomas Graf wrote:
> * jamal <[EMAIL PROTECTED]> 2006-08-14 19:43

> > If i am not mistaken:
> > Some of these removals of current->pid will affect users such as quagga,
> > zebra, vrrpd etc. If those specific users are not affected, please
> > ignore the rest of my comments.
> 
> I'm aware of that. The next patchset cleaning up fib6 and ifa6 will
> provide means to pass on the required netlink information to these
> notification functions.

Good nuf. Thanks Thomas.

cheers,
jamal

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/3] myri10ge update

2006-08-14 Thread Brice Goglin
Jeff Garzik wrote:
> Brice Goglin wrote:
>> Hi,
>>
>> Here's 3 new minor updates for the myri10ge driver:
>>
>> 1) define some previously hardwired firmware constants
>> 2) allow to disable link status change reporting
>> 3) convert to netdev_alloc_skb
>
> Patches 1 and 3 look OK.  They are cleanups, and will need to go into
> #upstream (2.6.19) rather than #upstream-fixes (2.6.18-rc).
>
> Should I go ahead and attempt to apply 1 and 3, or wait?

Feel free to apply 1 and 3 on #upstream for 2.6.19 now. I will rework 2
and send it back later.

Thanks,
Brice

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: PATCH Fix bonding active-backup behavior for VLAN interfaces

2006-08-14 Thread David Miller
From: Jay Vosburgh <[EMAIL PROTECTED]>
Date: Thu, 03 Aug 2006 18:01:35 -0700

>   In this case (bond0.555 above bond0 above eth0,eth1,etc),
> skb_bond doesn't suppress duplicates because skb_bond is called with the
> skb->dev set to the bond0.555 dev, not the ethX dev.  Non-accelerated
> VLAN devices don't do this; they'll come in with skb->dev set to ethX
> and will go through skb_bond as expected.

Ok, since __vlan_hwaccel_rx() bypasses the netif_receive_skb()
that would normally occur, we have to duplicate the bonding
drop checks.

The submitted patch put skb_bond() into if_vlan.h which is
definitely the wrong thing to do.  This is a generic operation
and therefore belongs in linux/netdevice.h at best.

Furthermore, we're only interested in the packet drop check,
so that's the only part of the logic we need to export,
the rest can stay private to skb_bond() in net/core/dev.c

Can the folks who can reproduce this try this patch?

Thanks.

commit 8a9583e08d0524e3bfe43a51af7c66ca21adf9f3
Author: David S. Miller <[EMAIL PROTECTED]>
Date:   Mon Aug 14 17:08:36 2006 -0700

[VLAN]: Make sure bonding packet drop checks get done in hwaccel RX path.

Since __vlan_hwaccel_rx() is essentially bypassing the
netif_receive_skb() call that would have occurred if we did the VLAN
decapsulation in software, we are missing the skb_bond() call and the
assosciated checks it does.

Export those checks via an inline function, skb_bond_should_drop(),
and use this in __vlan_hwaccel_rx().

Signed-off-by: David S. Miller <[EMAIL PROTECTED]>

diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 383627a..ab27408 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -155,6 +155,11 @@ static inline int __vlan_hwaccel_rx(stru
 {
struct net_device_stats *stats;
 
+   if (skb_bond_should_drop(skb)) {
+   dev_kfree_skb_any(skb);
+   return NET_RX_DROP;
+   }
+
skb->dev = grp->vlan_devices[vlan_tag & VLAN_VID_MASK];
if (skb->dev == NULL) {
dev_kfree_skb_any(skb);
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 75f02d8..c0c2b46 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1012,6 +1012,30 @@ static inline int netif_needs_gso(struct
unlikely(skb->ip_summed != CHECKSUM_HW));
 }
 
+/* On bonding slaves other than the currently active slave, suppress
+ * duplicates except for 802.3ad ETH_P_SLOW and alb non-mcast/bcast.
+ */
+static inline int skb_bond_should_drop(struct sk_buff *skb)
+{
+   struct net_device *dev = skb->dev;
+   struct net_device *master = dev->master;
+
+   if (master &&
+   (dev->priv_flags & IFF_SLAVE_INACTIVE)) {
+   if (master->priv_flags & IFF_MASTER_ALB) {
+   if (skb->pkt_type != PACKET_BROADCAST &&
+   skb->pkt_type != PACKET_MULTICAST)
+   return 0;
+   }
+   if (master->priv_flags & IFF_MASTER_8023AD &&
+   skb->protocol == __constant_htons(ETH_P_SLOW))
+   return 0;
+
+   return 1;
+   }
+   return 0;
+}
+
 #endif /* __KERNEL__ */
 
 #endif /* _LINUX_DEV_H */
diff --git a/net/core/dev.c b/net/core/dev.c
index d95e262..9fe96cd 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1619,26 +1619,10 @@ static inline struct net_device *skb_bon
struct net_device *dev = skb->dev;
 
if (dev->master) {
-   /*
-* On bonding slaves other than the currently active
-* slave, suppress duplicates except for 802.3ad
-* ETH_P_SLOW and alb non-mcast/bcast.
-*/
-   if (dev->priv_flags & IFF_SLAVE_INACTIVE) {
-   if (dev->master->priv_flags & IFF_MASTER_ALB) {
-   if (skb->pkt_type != PACKET_BROADCAST &&
-   skb->pkt_type != PACKET_MULTICAST)
-   goto keep;
-   }
-
-   if (dev->master->priv_flags & IFF_MASTER_8023AD &&
-   skb->protocol == __constant_htons(ETH_P_SLOW))
-   goto keep;
-   
+   if (skb_bond_should_drop(skb)) {
kfree_skb(skb);
return NULL;
}
-keep:
skb->dev = dev->master;
}
 
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/6] ehea: header files

2006-08-14 Thread Michael Ellerman
On Mon, 2006-08-14 at 14:53 +0200, Jan-Bernd Themann wrote:
> Michael Ellerman wrote:
> >> --- linux-2.6.18-rc4-orig/drivers/net/ehea/ehea.h  1969-12-31 
> >> 16:00:00.0 -0800
> >> +++ kernel/drivers/net/ehea/ehea.h 2006-08-08 23:59:39.927452928 -0700
> >> +
> >> +#define EHEA_PAGESHIFT  12
> >> +#define EHEA_PAGESIZE   4096UL
> >> +#define EHEA_CACHE_LINE 128
> > 
> > This looks like a very bad idea, what happens if you're running on a
> > machine with 64K pages?
> > 
> 
> The EHEA_PAGESIZE define is needed for queue management to hardware side.

You mean the eHEA has its own concept of page size? Separate from the
page size used by the MMU?

> >> +/*
> >> + *  h_galpa:
> >> + *  for pSeries this is a 64bit memory address where
> >> + *  I/O memory is mapped into CPU address space
> >> + */
> >> +
> >> +struct h_galpa {
> >> +  u64 fw_handle;
> >> +};
> > 
> > What is a h_galpa? And why does it need a struct if it's just a u64?
> > 
> 
> The eHEA chip is not PCI attached but directly connected to a proprietary
> bus. Currently, we can access it by a simple 64 bit address, but this is not
> true in all cases. Having a struct here allows us to encapsulate the chip
> register access and to respond to changes to system hardware.
> 
> We'll change the name to h_epa meaning "ehea physical address"

Hmm, I'm not convinced. Having the struct doesn't really encapsulate
much, because most of the places where you use the h_galpa struct just
pull out the fw_handle anyway. So if you change the layout of the struct
you're going to have to change most of the code anyway. And in the
meantime it makes the code a lot less readable, most people understand
what "u64 addr" is about, whereas "struct h_galpa" is much less
meaningful. 

cheers

-- 
Michael Ellerman
IBM OzLabs

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person


signature.asc
Description: This is a digitally signed message part


Re: sysfs vs. d80211 configuration

2006-08-14 Thread Mike Kershaw
On Mon, Aug 14, 2006 at 11:05:15PM +, Alexey Toptygin wrote:
> On Mon, 14 Aug 2006, Johannes Berg wrote:
> 
> >In my seemingly never-ending quest to actually use the d80211 stack for 
> >something useful I just wanted to write a small setuid tool that:
> >* creates and opens a new monitor interface
> >* drops priviledges
> >* ... does things with received frames ... (not interesting for this 
> >discussion)
> >* removes new monitor interface
> >
> >So I figured I'd just keep an fd open to 
> >/sys/class/net/mymonitorinterface/remove_iface to which I could write the 
> >interfaces name after I was done with it. However, when writing to that fd 
> >I got -EACCESS because it checks for CAP_NET_ADMIN.
> 
> Why not have the tool create a monitor interface, open it, and fork; the 
> child drops privileges and does the reading, and the parent wait(2)s for 
> the child and removes the interface once it has collected the child?

Kismet achieves this nearly the same way -- It keeps a root process for
channel control, and talks over IPC to a nonpriv process.  When it's
done, it sends the shutdown command to the root process and restores the
interface settings (or removes monitor interfaces, etc).  

If you set up all your interfaces before the fork you can keep the IPC
very simple.

-m

-- 
Mike Kershaw/Dragorn <[EMAIL PROTECTED]>
GPG Fingerprint: 3546 89DF 3C9D ED80 3381  A661 D7B2 8822 738B BDB1


pgpZ01U7AVtk5.pgp
Description: PGP signature


Re: [PATCH 09/16] [IPv6] address: Convert address notification to use rtnl_notify()

2006-08-14 Thread Thomas Graf
* jamal <[EMAIL PROTECTED]> 2006-08-14 19:43
> On Mon, 2006-14-08 at 00:00 +0200, Thomas Graf wrote:
> > plain text document attachment (rtnl_convert_ip6_addr)
> > Fixes a wrong use of current->pid as netlink pid.
> 
> If i am not mistaken:
> Some of these removals of current->pid will affect users such as quagga,
> zebra, vrrpd etc. If those specific users are not affected, please
> ignore the rest of my comments.

I'm aware of that. The next patchset cleaning up fib6 and ifa6 will
provide means to pass on the required netlink information to these
notification functions.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: ehea debug output discussion

2006-08-14 Thread Michael Ellerman
On Mon, 2006-08-14 at 14:38 +0200, Jan-Bernd Themann wrote:
> Hi
> 
> Anton Blanchard wrote:
> > What is going to be done about the debug infrastructure in the ehea
> > driver? The entry and exit traces really need to go, and any other debug
> > you think is important to users needs to go into debugfs or something
> > similar.
> > 
> > I see a similar issue in the ehca driver that I am in the middle of
> > reviewing.
> > 
> > Anton
> 
> This is a statement for the eHEA driver:
> 
> Most of the debug outputs are redundant and we'll remove them
> (EDEB_EN / EDEB_EX). We can use the standard mechanism for ethernet devices
> (netif_msg_x) in most functions of ehea_main.c as we have the device struct
> as a parameter available. However, some debug output mechanism is needed
> where the standard mechanism does not work (functions that have no relation
> to the dev struct do not have a dev parameter, for example
> ehea_hcall_9arg_9ret in ehea_phyp.h)
> 
> The outcome of some internal discussions was that it is not acceptable for
> our enterprise users of this type of driver on this target system to need a
> recompile / reload of the driver for error analysis, so we need a mechanism
> that allows us to switch on / off debug output at runtime. Therefore, we'd
> introduce a stripped down version of EDEB.

Well, it might be better if the driver just worked, then your enterprise
users wouldn't need debugging output ;) ...

But if you think you need that facility then you should look at debugfs,
or relayfs, or just plain old printk, rather than implementing something
new.

cheers

-- 
Michael Ellerman
IBM OzLabs

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person


signature.asc
Description: This is a digitally signed message part


Re: [PATCH 09/16] [IPv6] address: Convert address notification to use rtnl_notify()

2006-08-14 Thread jamal

CCing Hasso Tepper <[EMAIL PROTECTED]>

Hasso, please comment on this thread (apologies, I forgot the other
guy's name; so if you can CC all the necessary suspects to comment, it
would help).

cheers,
jamal

On Mon, 2006-14-08 at 19:43 -0400, jamal wrote:
> On Mon, 2006-14-08 at 00:00 +0200, Thomas Graf wrote:
> > plain text document attachment (rtnl_convert_ip6_addr)
> > Fixes a wrong use of current->pid as netlink pid.
> 
> If i am not mistaken:
> Some of these removals of current->pid will affect users such as quagga,
> zebra, vrrpd etc. If those specific users are not affected, please
> ignore the rest of my comments.
> 
> I realize mr. Kuznetsov submitted at least one patch in the past to do
> something similar to this. 
> IMO, I believe there is a strong case that can be made for events that
> were caused by non-netlink users such as ioctls that could at least be
> multicast with current->pid. In other words an exception case for only
> this scenario. In such a case there is no unicast netlink message. 
> It would also be acceptable if the quagga etc folks could meet their
> goals some other way.
> 
> cheers,
> jamal
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 09/16] [IPv6] address: Convert address notification to use rtnl_notify()

2006-08-14 Thread jamal
On Mon, 2006-14-08 at 00:00 +0200, Thomas Graf wrote:
> plain text document attachment (rtnl_convert_ip6_addr)
> Fixes a wrong use of current->pid as netlink pid.

If i am not mistaken:
Some of these removals of current->pid will affect users such as quagga,
zebra, vrrpd etc. If those specific users are not affected, please
ignore the rest of my comments.

I realize mr. Kuznetsov submitted at least one patch in the past to do
something similar to this. 
IMO, I believe there is a strong case that can be made for events that
were caused by non-netlink users such as ioctls that could at least be
multicast with current->pid. In other words an exception case for only
this scenario. In such a case there is no unicast netlink message. 
It would also be acceptable if the quagga etc folks could meet their
goals some other way.

cheers,
jamal


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC 5/7] neighbour: convert lookup to sequence lock

2006-08-14 Thread Thomas Graf
* Stephen Hemminger <[EMAIL PROTECTED]> 2006-08-14 15:37
> On Tue, 15 Aug 2006 00:22:20 +0200
> Thomas Graf <[EMAIL PROTECTED]> wrote:
> > Don't you need to pull in order to undo the push that probably
> > happened in dev->hard_header()?
> 
> Probably just record the headroom() and undo that?

That wouldn't work if hard_header() ever expands the head. Fortunately
hard_header() returns the length added even in case of an error so we
can undo the absolute value returned.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: sysfs vs. d80211 configuration

2006-08-14 Thread Alexey Toptygin

On Mon, 14 Aug 2006, Johannes Berg wrote:

In my seemingly never-ending quest to actually use the d80211 stack for 
something useful I just wanted to write a small setuid tool that:

* creates and opens a new monitor interface
* drops priviledges
* ... does things with received frames ... (not interesting for this 
discussion)

* removes new monitor interface

So I figured I'd just keep an fd open to 
/sys/class/net/mymonitorinterface/remove_iface to which I could write the 
interfaces name after I was done with it. However, when writing to that fd I 
got -EACCESS because it checks for CAP_NET_ADMIN.


Why not have the tool create a monitor interface, open it, and fork; the 
child drops privileges and does the reading, and the parent wait(2)s for 
the child and removes the interface once it has collected the child?


Alexey
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC][NET::SCHED]: cleanup qdisc_restart

2006-08-14 Thread David Miller
From: jamal <[EMAIL PROTECTED]>
Date: Mon, 14 Aug 2006 18:57:27 -0400

> The question to ask though is: shouldnt we be having drivers use the
> mnemonics instead of values like 1? 

Absolutely, but while such conversions still remain undone
we shouldn't knowingly break stuff :)
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: 2.6.18-rc4-mm1: eth0: trigger_send() called with the transmitter busy

2006-08-14 Thread Laurent Riffard
Le 14.08.2006 23:25, Rafael J. Wysocki a écrit :
> On Monday 14 August 2006 22:06, Laurent Riffard wrote:
>> Le 14.08.2006 19:47, Laurent Riffard a écrit :
>>> Le 14.08.2006 18:50, Andrew Morton a écrit :
 On Mon, 14 Aug 2006 16:38:47 +0200
 Laurent Riffard <[EMAIL PROTECTED]> wrote:

> Le 13.08.2006 10:24, Andrew Morton a __crit :
>> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.18-rc4/2.6.18-rc4-mm1/
> Hello,
>
> This morning, while trying to suspend to disk, my box started to loop 
> displaying the following message:
> eth0: trigger_send() called with the transmitter busy.
>
> Here is the scenario. I booted 2.6.18-rc4-mm1 with this command line:
> root=/dev/vglinux1/lvroot video=vesafb:ywrap,mtrr splash=silent 
> resume=/dev/hdb7 [EMAIL PROTECTED]/,@192.168.0.1/00:0E:9B:91:ED:72 init 1
>
> Then I issued:
> # echo 6 > /proc/sys/kernel/printk
> # echo disk > /sys/power/state
 ne2k isn't  the most actively-maintained driver.

 But most (I think all) net drivers have problems during suspend when
 netconsole is active.  Does disabling netconsole help?
>>> Yes it does. 
>>>  
 Did this operation work OK in earlier kernels, with netconsole enabled?
>>> It's the first time I see such a message. I can't speak for 2.6.18-rc3-mm2 
>>> because it could not suspend at all (did hang right after 
>>> "echo disk > /sys/power/state"), but it worked in earlier kernels.
>>>
>>> I'll try with plain 2.6.18-rc4.
>> Same problem with 2.6.18-rc4.
> 
> I think something like this will help (untested):

Well, sort of: it sometimes works, which is better than not. I tried
about 10 times and it sometimes hangs after 'shrinking memory' or whilst 
writing to the swap device. The message "eth0: trigger_send() called 
with the transmitter busy" didn't appear anymore.

Note that I always have had a warning sowhere in acpi_pci_link_set during 
suspend:
 BUG: sleeping function called from invalid context at 
include/asm/semaphore.h:99

I'm under the impression your patch is a workaround for my network problem. 
Or must really netconsole be stopped during device_suspend ?

>  kernel/power/disk.c |7 +++
>  1 files changed, 7 insertions(+)
> 
> Index: linux-2.6.18-rc4-mm1/kernel/power/disk.c
> ===
> --- linux-2.6.18-rc4-mm1.orig/kernel/power/disk.c
> +++ linux-2.6.18-rc4-mm1/kernel/power/disk.c
> @@ -119,8 +119,10 @@ int pm_suspend_disk(void)
>   if (error)
>   return error;
>  
> + suspend_console();
>   error = device_suspend(PMSG_FREEZE);
>   if (error) {
> + resume_console();
>   printk("Some devices failed to suspend\n");
>   unprepare_processes();
>   return error;
> @@ -133,6 +135,7 @@ int pm_suspend_disk(void)
>  
>   if (in_suspend) {
>   device_resume();
> + resume_console();
>   pr_debug("PM: writing image.\n");
>   error = swsusp_write();
>   if (!error)
> @@ -148,6 +151,7 @@ int pm_suspend_disk(void)
>   swsusp_free();
>   Done:
>   device_resume();
> + resume_console();
>   unprepare_processes();
>   return error;
>  }
> @@ -212,7 +216,9 @@ static int software_resume(void)
>  
>   pr_debug("PM: Preparing devices for restore.\n");
>  
> + suspend_console();
>   if ((error = device_suspend(PMSG_PRETHAW))) {
> + resume_console();
>   printk("Some devices failed to suspend\n");
>   swsusp_free();
>   goto Thaw;
> @@ -224,6 +230,7 @@ static int software_resume(void)
>   swsusp_resume();
>   pr_debug("PM: Restore failed, recovering.n");
>   device_resume();
> + resume_console();
>   Thaw:
>   unprepare_processes();
>   Done:

BTW, it doesn't apply cleanly:

  CC  kernel/power/disk.o
kernel/power/disk.c: In function 'pm_suspend_disk':
kernel/power/disk.c:122: warning: implicit declaration of function 
'suspend_console'
kernel/power/disk.c:125: warning: implicit declaration of function 
'resume_console'
-- 
laurent

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC][NET::SCHED]: cleanup qdisc_restart

2006-08-14 Thread jamal
On Mon, 2006-14-08 at 14:01 -0700, David Miller wrote:
> From: Stephen Hemminger <[EMAIL PROTECTED]>
> Date: Tue, 15 Aug 2006 07:42:39 -0700
> 
> > Please don't change the values because some older drvers still return 1 
> > rather
> > than NETDEV_TX_BUSY
> 
> Unfortunately, this is probably very true.  So we indeed cannot
> change the NETDEV_TX_BUSY value.

That slipped from the experiments i was trying out. I can use valid
return codes.
The question to ask though is: shouldnt we be having drivers use the
mnemonics instead of values like 1? 

cheers,
jamal

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC 5/7] neighbour: convert lookup to sequence lock

2006-08-14 Thread Stephen Hemminger
On Tue, 15 Aug 2006 00:22:20 +0200
Thomas Graf <[EMAIL PROTECTED]> wrote:

> * Stephen Hemminger <[EMAIL PROTECTED]> 2006-08-14 14:20
> > --- net-2.6.19.orig/net/core/neighbour.c
> > +++ net-2.6.19/net/core/neighbour.c
> > @@ -1160,19 +1164,24 @@ int neigh_resolve_output(struct sk_buff 
> > if (!neigh_event_send(neigh, skb)) {
> > int err;
> > struct net_device *dev = neigh->dev;
> > +   unsigned short type = ntohs(skb->protocol);
> > +
> > if (dev->hard_header_cache && !dst->hh) {
> > -   write_lock_bh(&neigh->lock);
> > +   write_seqlock_bh(&neigh->lock);
> > if (!dst->hh)
> > neigh_hh_init(neigh, dst, dst->ops->protocol);
> > -   err = dev->hard_header(skb, dev, ntohs(skb->protocol),
> > +   err = dev->hard_header(skb, dev, type,
> >neigh->ha, NULL, skb->len);
> > -   write_unlock_bh(&neigh->lock);
> > +   write_sequnlock_bh(&neigh->lock);
> > } else {
> > -   read_lock_bh(&neigh->lock);
> > -   err = dev->hard_header(skb, dev, ntohs(skb->protocol),
> > -  neigh->ha, NULL, skb->len);
> > -   read_unlock_bh(&neigh->lock);
> > +   unsigned seq;
> > +   do {
> > +   seq = read_seqbegin(&neigh->lock);
> > +   err = dev->hard_header(skb, dev, type,
> > +  neigh->ha, NULL, 
> > skb->len);
> > +   } while (read_seqretry(&neigh->lock, seq));
> 
> Don't you need to pull in order to undo the push that probably
> happened in dev->hard_header()?

Probably just record the headroom() and undo that?
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch RFC 3/3] b44: convert to ssb module

2006-08-14 Thread Michael Buesch
This is not runtime tested.

Signed-off-by: Michael Buesch <[EMAIL PROTECTED]>

Index: wireless-dev/drivers/net/Kconfig
===
--- wireless-dev.orig/drivers/net/Kconfig   2006-08-09 16:52:40.0 
+0200
+++ wireless-dev/drivers/net/Kconfig2006-08-14 23:29:25.0 +0200
@@ -1388,7 +1388,7 @@
 
 config B44
tristate "Broadcom 4400 ethernet support"
-   depends on NET_PCI && PCI
+   depends on NET_PCI && PCI && SONICS_SILICON_BACKPLANE
select MII
help
  If you have a network (Ethernet) controller of this type, say Y and
Index: wireless-dev/drivers/net/b44.c
===
--- wireless-dev.orig/drivers/net/b44.c 2006-08-09 16:52:40.0 +0200
+++ wireless-dev/drivers/net/b44.c  2006-08-15 00:06:58.0 +0200
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -177,85 +178,6 @@
return 0;
 }
 
-/* Sonics SiliconBackplane support routines.  ROFL, you should see all the
- * buzz words used on this company's website :-)
- *
- * All of these routines must be invoked with bp->lock held and
- * interrupts disabled.
- */
-
-#define SB_PCI_DMA 0x4000  /* Client Mode PCI memory 
access space (1 GB) */
-#define BCM4400_PCI_CORE_ADDR  0x18002000  /* Address of PCI core on 
BCM4400 cards */
-
-static u32 ssb_get_core_rev(struct b44 *bp)
-{
-   return (br32(bp, B44_SBIDHIGH) & SBIDHIGH_RC_MASK);
-}
-
-static u32 ssb_pci_setup(struct b44 *bp, u32 cores)
-{
-   u32 bar_orig, pci_rev, val;
-
-   pci_read_config_dword(bp->pdev, SSB_BAR0_WIN, &bar_orig);
-   pci_write_config_dword(bp->pdev, SSB_BAR0_WIN, BCM4400_PCI_CORE_ADDR);
-   pci_rev = ssb_get_core_rev(bp);
-
-   val = br32(bp, B44_SBINTVEC);
-   val |= cores;
-   bw32(bp, B44_SBINTVEC, val);
-
-   val = br32(bp, SSB_PCI_TRANS_2);
-   val |= SSB_PCI_PREF | SSB_PCI_BURST;
-   bw32(bp, SSB_PCI_TRANS_2, val);
-
-   pci_write_config_dword(bp->pdev, SSB_BAR0_WIN, bar_orig);
-
-   return pci_rev;
-}
-
-static void ssb_core_disable(struct b44 *bp)
-{
-   if (br32(bp, B44_SBTMSLOW) & SBTMSLOW_RESET)
-   return;
-
-   bw32(bp, B44_SBTMSLOW, (SBTMSLOW_REJECT | SBTMSLOW_CLOCK));
-   b44_wait_bit(bp, B44_SBTMSLOW, SBTMSLOW_REJECT, 10, 0);
-   b44_wait_bit(bp, B44_SBTMSHIGH, SBTMSHIGH_BUSY, 10, 1);
-   bw32(bp, B44_SBTMSLOW, (SBTMSLOW_FGC | SBTMSLOW_CLOCK |
-   SBTMSLOW_REJECT | SBTMSLOW_RESET));
-   br32(bp, B44_SBTMSLOW);
-   udelay(1);
-   bw32(bp, B44_SBTMSLOW, (SBTMSLOW_REJECT | SBTMSLOW_RESET));
-   br32(bp, B44_SBTMSLOW);
-   udelay(1);
-}
-
-static void ssb_core_reset(struct b44 *bp)
-{
-   u32 val;
-
-   ssb_core_disable(bp);
-   bw32(bp, B44_SBTMSLOW, (SBTMSLOW_RESET | SBTMSLOW_CLOCK | 
SBTMSLOW_FGC));
-   br32(bp, B44_SBTMSLOW);
-   udelay(1);
-
-   /* Clear SERR if set, this is a hw bug workaround.  */
-   if (br32(bp, B44_SBTMSHIGH) & SBTMSHIGH_SERR)
-   bw32(bp, B44_SBTMSHIGH, 0);
-
-   val = br32(bp, B44_SBIMSTATE);
-   if (val & (SBIMSTATE_IBE | SBIMSTATE_TO))
-   bw32(bp, B44_SBIMSTATE, val & ~(SBIMSTATE_IBE | SBIMSTATE_TO));
-
-   bw32(bp, B44_SBTMSLOW, (SBTMSLOW_CLOCK | SBTMSLOW_FGC));
-   br32(bp, B44_SBTMSLOW);
-   udelay(1);
-
-   bw32(bp, B44_SBTMSLOW, (SBTMSLOW_CLOCK));
-   br32(bp, B44_SBTMSLOW);
-   udelay(1);
-}
-
 static int ssb_core_unit(struct b44 *bp)
 {
 #if 0
@@ -281,12 +203,6 @@
return 0;
 }
 
-static int ssb_is_core_up(struct b44 *bp)
-{
-   return ((br32(bp, B44_SBTMSLOW) & (SBTMSLOW_RESET | SBTMSLOW_REJECT | 
SBTMSLOW_CLOCK))
-   == SBTMSLOW_CLOCK);
-}
-
 static void __b44_cam_write(struct b44 *bp, unsigned char *data, int index)
 {
u32 val;
@@ -1276,9 +1192,12 @@
 }
 
 /* bp->lock is held. */
-static void b44_chip_reset(struct b44 *bp)
+static int b44_chip_reset(struct b44 *bp)
 {
-   if (ssb_is_core_up(bp)) {
+   struct ssb *ssb = bp->ssb;
+   int err = 0;
+
+   if (ssb_core_is_enabled(ssb)) {
bw32(bp, B44_RCV_LAZY, 0);
bw32(bp, B44_ENET_CTRL, ENET_CTRL_DISABLE);
b44_wait_bit(bp, B44_ENET_CTRL, ENET_CTRL_DISABLE, 100, 1);
@@ -1291,12 +1210,13 @@
bw32(bp, B44_DMARX_CTRL, 0);
bp->rx_prod = bp->rx_cons = 0;
} else {
-   ssb_pci_setup(bp, (bp->core_unit == 0 ?
-  SBINTVEC_ENET0 :
-  SBINTVEC_ENET1));
+   err = ssb_cores_connect(ssb, 0x1);
+   if (err)
+   goto out;
+   err = ssb_switch_core(ssb, &(ssb->cores[0]));
}
 
-   ssb_core_reset(bp);
+   ssb_core_enable(ssb, 0);
 
b44_clear_stats(bp);
 
@@ -13

[patch RFC 2/3] bcm43xx-d80211: convert to ssb module

2006-08-14 Thread Michael Buesch
More #defines in bcm43xx.h can be deleted and the corresponding
#defines in ssh.h can be used instead. But I leave this alone for now...

Signed-off-by: Michael Buesch <[EMAIL PROTECTED]>

Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx.h
===
--- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx.h 
2006-08-14 22:05:06.0 +0200
+++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx.h  2006-08-14 
23:19:39.0 +0200
@@ -11,6 +11,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -186,25 +187,7 @@
 #define BCM43xx_PCTL_FORCE_PLL 0x1000
 #define BCM43xx_PCTL_DYN_XTAL  0x2000
 
-/* COREIDs */
-#define BCM43xx_COREID_CHIPCOMMON  0x800
-#define BCM43xx_COREID_ILINE20  0x801
-#define BCM43xx_COREID_SDRAM0x803
-#define BCM43xx_COREID_PCI 0x804
-#define BCM43xx_COREID_MIPS 0x805
-#define BCM43xx_COREID_ETHERNET 0x806
-#define BCM43xx_COREID_V90 0x807
-#define BCM43xx_COREID_USB11_HOSTDEV0x80a
-#define BCM43xx_COREID_IPSEC0x80b
-#define BCM43xx_COREID_PCMCIA  0x80d
-#define BCM43xx_COREID_EXT_IF   0x80f
-#define BCM43xx_COREID_80211   0x812
-#define BCM43xx_COREID_MIPS_33020x816
-#define BCM43xx_COREID_USB11_HOST   0x817
-#define BCM43xx_COREID_USB11_DEV0x818
-#define BCM43xx_COREID_USB20_HOST   0x819
-#define BCM43xx_COREID_USB20_DEV0x81a
-#define BCM43xx_COREID_SDIO_HOST0x81b
+// FIXME: deletes SSB duplicates.
 
 /* Core Information Registers */
 #define BCM43xx_CIR_BASE   0xf00
@@ -578,29 +561,9 @@
 
 #define BCM43xx_MAX_80211_CORES2
 
-#ifdef CONFIG_BCM947XX
-#define core_offset(bcm) (bcm)->current_core_offset
-#else
-#define core_offset(bcm) 0
-#endif
-
-/* Generic information about a core. */
-struct bcm43xx_coreinfo {
-   u8 available:1,
-  enabled:1,
-  initialized:1;
-   /** core_rev revision number */
-   u8 rev;
-   /** Index number for _switch_core() */
-   u8 index;
-   /** core_id ID number */
-   u16 id;
-   /** Core-specific data. */
-   void *priv;
-};
-
 /* Additional information for each 80211 core. */
-struct bcm43xx_coreinfo_80211 {
+struct bcm43xx_corepriv_80211 {
+   u8 initialized:1;
/* PHY device. */
struct bcm43xx_phyinfo phy;
/* Radio device. */
@@ -615,7 +578,7 @@
 
 /* Context information for a noise calculation (Link Quality). */
 struct bcm43xx_noise_calculation {
-   struct bcm43xx_coreinfo *core_at_start;
+   struct ssb_core *core_at_start;
u8 channel_at_start;
u8 calculation_running:1;
u8 nr_samples;
@@ -685,6 +648,8 @@
  */
 
 struct bcm43xx_private {
+   /* Pointer to the Sonics Silicon Backplane. */
+   struct ssb *ssb;
struct ieee80211_hw *ieee;
struct ieee80211_low_level_stats ieee_stats;
 
@@ -735,27 +700,19 @@
struct bcm43xx_led leds[BCM43xx_NR_LEDS];
spinlock_t leds_lock;
 
-   /* The currently active core. */
-   struct bcm43xx_coreinfo *current_core;
-#ifdef CONFIG_BCM947XX
-   /** current core memory offset */
-   u32 current_core_offset;
-#endif
-   struct bcm43xx_coreinfo *active_80211_core;
-   /* coreinfo structs for all possible cores follow.
-* Note that a core might not exist.
-* So check the coreinfo flags before using it.
+   /* Pointers to the available cores.
+* If a core is not available, this is NULL.
 */
-   struct bcm43xx_coreinfo core_chipcommon;
-   struct bcm43xx_coreinfo core_pci;
-   struct bcm43xx_coreinfo core_80211[ BCM43xx_MAX_80211_CORES ];
+   struct ssb_core *core_80211[ BCM43xx_MAX_80211_CORES ];
+   struct ssb_core *active_80211_core;//FIXME remove?
+   struct ssb_core *core_chipcommon;
+   struct ssb_core *core_pci;
+
/* Additional information, specific to the 80211 cores. */
-   struct bcm43xx_coreinfo_80211 core_80211_ext[ BCM43xx_MAX_80211_CORES ];
+   struct bcm43xx_corepriv_80211 corepriv_80211[ BCM43xx_MAX_80211_CORES ];
/* Number of available 80211 cores. */
int nr_80211_available;
 
-   u32 chipcommon_capabilities;
-
/* Reason code of the last interrupt. */
u32 irq_reason;
u32 dma_reason[4];
@@ -829,11 +786,11 @@
  * any of these functions.
  */
 static inline
-struct bcm43xx_coreinfo_80211 *
+struct bcm43xx_corepriv_80211 *
 bcm43xx_current_80211_priv(struct bcm43xx_private *bcm)
 {
-   assert(bcm->current_core->id == BCM43xx_COREID_80211);
-   return bcm->current_core->priv;
+   assert(bcm->ssb->current_core->cc == SSB_CC_80211);
+   return bcm->ssb->current_core->priv;
 }
 static inline
 struct bcm43xx_pio * bcm43xx_current_pio(struct bcm43xx_private *bcm)
@@ -894,25 +851,25 @@
 static inline
 u16

[patch RFC 0/3] Sonics Silicon Backplane module

2006-08-14 Thread Michael Buesch
Hi.

This patch series creates a new Sonics Silicon Backplane
driver and converts the bcm43xx and b44 drivers to use it.
The bcm43xx patch is tested and it works. But the b44
patch is only compile tested, as I don't have the
hardware (yet?).

These patches apply against wireless-dev.

-- 
Greetings Michael.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch RFC 1/3] add Sonics Silicon Backplane module

2006-08-14 Thread Michael Buesch
Signed-off-by: Michael Buesch <[EMAIL PROTECTED]>

Index: wireless-dev/drivers/misc/Kconfig
===
--- wireless-dev.orig/drivers/misc/Kconfig  2006-08-14 15:31:50.0 
+0200
+++ wireless-dev/drivers/misc/Kconfig   2006-08-14 22:02:07.0 +0200
@@ -28,5 +28,16 @@
 
  If unsure, say N.
 
+config SONICS_SILICON_BACKPLANE
+   tristate "Sonics Silicon Backplane support"
+   depends on PCI && EXPERIMENTAL
+   default m
+   ---help---
+ The Sonics Silicon Backplane is used in some chips such
+ as the Broadcom 43xx and 44xx series.
+ The Backplane ties several chip-cores together.
+
+ If unsure, say M.
+
 endmenu
 
Index: wireless-dev/drivers/misc/Makefile
===
--- wireless-dev.orig/drivers/misc/Makefile 2006-08-14 15:31:50.0 
+0200
+++ wireless-dev/drivers/misc/Makefile  2006-08-14 22:02:07.0 +0200
@@ -3,5 +3,6 @@
 #
 obj- := misc.o # Dummy rule to force built-in.o to be made
 
-obj-$(CONFIG_IBM_ASM)  += ibmasm/
-obj-$(CONFIG_HDPU_FEATURES)+= hdpuftrs/
+obj-$(CONFIG_IBM_ASM)  += ibmasm/
+obj-$(CONFIG_HDPU_FEATURES)+= hdpuftrs/
+obj-$(CONFIG_SONICS_SILICON_BACKPLANE) += ssb.o
Index: wireless-dev/drivers/misc/ssb.c
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ wireless-dev/drivers/misc/ssb.c 2006-08-14 23:19:34.0 +0200
@@ -0,0 +1,502 @@
+/*
+ * Sonics Silicon Backplane backend.
+ *
+ * Copyright (C) 2005-2006 Michael Buesch <[EMAIL PROTECTED]>
+ * Copyright (C) 2005 Martin Langer <[EMAIL PROTECTED]>
+ * Copyright (C) 2005 Stefano Brivio <[EMAIL PROTECTED]>
+ * Copyright (C) 2005 Danny van Dyk <[EMAIL PROTECTED]>
+ * Copyright (C) 2005 Andreas Jaggi <[EMAIL PROTECTED]>
+ *
+ * Derived from the Broadcom 4400 device driver.
+ * Copyright (C) 2002 David S. Miller (davem@redhat.com)
+ * Fixed by Pekka Pietikainen ([EMAIL PROTECTED])
+ * Copyright (C) 2006 Broadcom Corporation.
+ *
+ * Licensed under the GNU/GPL. See COPYING for details.
+ */
+
+#include 
+#include 
+#include 
+
+#define SSB_DEBUG  1
+#define PFX"ssb: "
+
+#if SSB_DEBUG
+# define dprintk(f, x...)  do { printk(f ,##x); } while (0)
+#else
+# define dprintk(f, x...)  do { /* nothing */ } while (0)
+#endif
+
+static inline int ssb_pci_read_config32(struct ssb *ssb, int offset,
+   u32 *value)
+{
+   return pci_read_config_dword(ssb->pci_dev, offset, value);
+}
+
+static inline int ssb_pci_read_config16(struct ssb *ssb, int offset,
+   u16 *value)
+{
+   return pci_read_config_word(ssb->pci_dev, offset, value);
+}
+
+static inline int ssb_pci_write_config32(struct ssb *ssb, int offset,
+u32 value)
+{
+   return pci_write_config_dword(ssb->pci_dev, offset, value);
+}
+
+static inline u32 ssb_read32(struct ssb *ssb, u16 offset)
+{
+   return ioread32(ssb->mmio + offset + ssb_core_offset(ssb));
+}
+
+static inline void ssb_write32(struct ssb *ssb, u16 offset,
+  u32 value)
+{
+   iowrite32(value, ssb->mmio + offset + ssb_core_offset(ssb));
+}
+
+
+struct ssb * ssb_alloc(struct pci_dev *pci_dev,
+  void __iomem *mmio)
+{
+   struct ssb *ssb;
+
+   ssb = kzalloc(sizeof(*ssb), GFP_KERNEL);
+   if (!ssb)
+   return NULL;
+
+   ssb->pci_dev = pci_dev;
+   ssb->mmio = mmio;
+
+   return ssb;
+}
+EXPORT_SYMBOL(ssb_alloc);
+
+void ssb_free(struct ssb *ssb)
+{
+   kfree(ssb->cores);
+   kfree(ssb);
+}
+EXPORT_SYMBOL(ssb_free);
+
+static int do_switch_core(struct ssb *ssb, u8 coreidx)
+{
+   int err;
+   int attempts = 0;
+   u32 cur_core;
+
+   while (1) {
+   err = ssb_pci_write_config32(ssb, SSB_BAR0_WIN,
+(coreidx * 0x1000) + 0x1800);
+   if (unlikely(err))
+   goto error;
+   err = ssb_pci_read_config32(ssb, SSB_BAR0_WIN,
+   &cur_core);
+   if (unlikely(err))
+   goto error;
+   cur_core = (cur_core - 0x1800) / 0x1000;
+   if (cur_core == coreidx)
+   break;
+
+   if (unlikely(attempts++ > SSB_BAR0_MAX_RETRIES))
+   goto error;
+   udelay(10);
+   }
+#ifdef CONFIG_BCM947XX
+   ssb->current_core_offset = 0;
+   if (ssb->pci_dev->bus->number == 0)
+   ssb->current_core_offset = 0x1000 * coreidx;
+#endif /* CONFIG_BCM947XX */
+
+   return 0;
+error:
+   printk(KERN_ERR PFX "Failed to switch to core %u\n", coreidx);
+   return -ENODEV;
+}
+
+int ssb_switch_core(struct ssb *ssb,
+  

Re: [RFC 5/7] neighbour: convert lookup to sequence lock

2006-08-14 Thread Thomas Graf
* Stephen Hemminger <[EMAIL PROTECTED]> 2006-08-14 14:20
> --- net-2.6.19.orig/net/core/neighbour.c
> +++ net-2.6.19/net/core/neighbour.c
> @@ -1160,19 +1164,24 @@ int neigh_resolve_output(struct sk_buff 
>   if (!neigh_event_send(neigh, skb)) {
>   int err;
>   struct net_device *dev = neigh->dev;
> + unsigned short type = ntohs(skb->protocol);
> +
>   if (dev->hard_header_cache && !dst->hh) {
> - write_lock_bh(&neigh->lock);
> + write_seqlock_bh(&neigh->lock);
>   if (!dst->hh)
>   neigh_hh_init(neigh, dst, dst->ops->protocol);
> - err = dev->hard_header(skb, dev, ntohs(skb->protocol),
> + err = dev->hard_header(skb, dev, type,
>  neigh->ha, NULL, skb->len);
> - write_unlock_bh(&neigh->lock);
> + write_sequnlock_bh(&neigh->lock);
>   } else {
> - read_lock_bh(&neigh->lock);
> - err = dev->hard_header(skb, dev, ntohs(skb->protocol),
> -neigh->ha, NULL, skb->len);
> - read_unlock_bh(&neigh->lock);
> + unsigned seq;
> + do {
> + seq = read_seqbegin(&neigh->lock);
> + err = dev->hard_header(skb, dev, type,
> +neigh->ha, NULL, 
> skb->len);
> + } while (read_seqretry(&neigh->lock, seq));

Don't you need to pull in order to undo the push that probably
happened in dev->hard_header()?
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Possible leak of multicast source filter sctructure

2006-08-14 Thread David Stevens
[EMAIL PROTECTED] wrote on 08/13/2006 08:44:05 PM:

> From: "Michal Ruzicka" <[EMAIL PROTECTED]>
> Date: Fri, 11 Aug 2006 12:04:53 +0100
> 
> > You are absolutely right, I just failed to notice that -ENODEV return 
value
> > from ip_mc_del_src()/ip_mc_leave_src() is ignored.
> > Here comes the patch:
>  ...
> > > Also, ip_mc_leave_group() has the same issue; looks
> > > like it just needs the "if (in_dev)" removed before the call to
> > > ip_mc_leave_src().
> > 
> > In fact it is a slightly different issue, there is no leak in this
> > function. Rather the function completely fails to leave a multicast
> > group joined on an interface that does not exist any more.
>  ...
> > Here comes a patch for that:
> 
> Both of these fixes look fine to me.  David?

The first patch in that, yes.

Acked-by: David L Stevens <[EMAIL PROTECTED]>

I'm not sure the second one is quite right. The case of concern
is where an interface is deleted. If you joined (or left) the group by
address and then deleted the interface, then you wouldn't match the
index (which wouldn't be set) so the leave wouldn't work, still.
Also, if you passed a completely bogus ifindex, it should return
ENODEV, but with the patch it would return EADDRNOTAVAIL it appears.
So, I think the second patch needs some more work. I'll look at
it some more and see if I can suggest something better.


+-DLS

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/3] myri10ge update

2006-08-14 Thread Jeff Garzik

Brice Goglin wrote:

Hi,

Here's 3 new minor updates for the myri10ge driver:

1) define some previously hardwired firmware constants
2) allow to disable link status change reporting
3) convert to netdev_alloc_skb


Patches 1 and 3 look OK.  They are cleanups, and will need to go into 
#upstream (2.6.19) rather than #upstream-fixes (2.6.18-rc).


Should I go ahead and attempt to apply 1 and 3, or wait?

Jeff



-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] myri10ge: allow to disable link status change reporting

2006-08-14 Thread Jeff Garzik

Brice Goglin wrote:

Add myri10ge_verbose module parameter to disable reporting of
link status change since some Ethernet switches seem to generate
a lot of status changes under some circumstances and some people
want to avoid useless flooding in the logs.

Also add a counter for link status changes to statistics.

Signed-off-by: Brice Goglin <[EMAIL PROTECTED]>


NAK - use the standard netif_msg_xxx and the msg_enable style variable 
found in many drivers.  No need for a module parameter, ethtool already 
covers this type of need.


Jeff



-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] myri10ge: define some previously hardwired firmware constants

2006-08-14 Thread Brice Goglin
Define some previously hardwired firmware constants.

Signed-off-by: Brice Goglin <[EMAIL PROTECTED]>
---
 drivers/net/myri10ge/myri10ge.c |   17 ++---
 drivers/net/myri10ge/myri10ge_mcp.h |   14 +-
 2 files changed, 23 insertions(+), 8 deletions(-)

Index: linux-mm/drivers/net/myri10ge/myri10ge.c
===
--- linux-mm.orig/drivers/net/myri10ge/myri10ge.c   2006-08-14 
14:21:47.0 -0400
+++ linux-mm/drivers/net/myri10ge/myri10ge.c2006-08-14 14:21:57.0 
-0400
@@ -271,7 +271,7 @@
struct mcp_cmd *buf;
char buf_bytes[sizeof(*buf) + 8];
struct mcp_cmd_response *response = mgp->cmd;
-   char __iomem *cmd_addr = mgp->sram + MXGEFW_CMD_OFFSET;
+   char __iomem *cmd_addr = mgp->sram + MXGEFW_ETH_CMD;
u32 dma_low, dma_high, result, value;
int sleep_total = 0;
 
@@ -404,7 +404,7 @@
buf[4] = htonl(dma_low);/* dummy addr LSW */
buf[5] = htonl(enable); /* enable? */
 
-   submit = mgp->sram + 0xfc01c0;
+   submit = mgp->sram + MXGEFW_BOOT_DUMMY_RDMA;
 
myri10ge_pio_copy(submit, &buf, sizeof(buf));
for (i = 0; mgp->cmd->data != MYRI10GE_NO_CONFIRM_DATA && i < 20; i++)
@@ -600,7 +600,7 @@
buf[5] = htonl(8);  /* where to copy to */
buf[6] = htonl(0);  /* where to jump to */
 
-   submit = mgp->sram + 0xfc;
+   submit = mgp->sram + MXGEFW_BOOT_HANDOFF;
 
myri10ge_pio_copy(submit, &buf, sizeof(buf));
mb();
@@ -1648,9 +1648,11 @@
}
 
if (mgp->mtrr >= 0) {
-   mgp->tx.wc_fifo = (u8 __iomem *) mgp->sram + 0x20;
-   mgp->rx_small.wc_fifo = (u8 __iomem *) mgp->sram + 0x30;
-   mgp->rx_big.wc_fifo = (u8 __iomem *) mgp->sram + 0x34;
+   mgp->tx.wc_fifo = (u8 __iomem *) mgp->sram + MXGEFW_ETH_SEND_4;
+   mgp->rx_small.wc_fifo =
+   (u8 __iomem *) mgp->sram + MXGEFW_ETH_RECV_SMALL;
+   mgp->rx_big.wc_fifo =
+   (u8 __iomem *) mgp->sram + MXGEFW_ETH_RECV_BIG;
} else {
mgp->tx.wc_fifo = NULL;
mgp->rx_small.wc_fifo = NULL;
@@ -1841,7 +1843,8 @@
if (cnt > 0) {
/* pad it to 64 bytes.  The src is 64 bytes bigger than it
 * needs to be so that we don't overrun it */
-   myri10ge_pio_copy(tx->wc_fifo + (cnt << 18), src, 64);
+   myri10ge_pio_copy(tx->wc_fifo + MXGEFW_ETH_SEND_OFFSET(cnt),
+ src, 64);
mb();
}
 }
Index: linux-mm/drivers/net/myri10ge/myri10ge_mcp.h
===
--- linux-mm.orig/drivers/net/myri10ge/myri10ge_mcp.h   2006-08-14 
14:21:47.0 -0400
+++ linux-mm/drivers/net/myri10ge/myri10ge_mcp.h2006-08-14 
14:21:57.0 -0400
@@ -91,7 +91,19 @@
 
 /* Commands */
 
-#define MXGEFW_CMD_OFFSET 0xf8
+#defineMXGEFW_BOOT_HANDOFF 0xfc
+#defineMXGEFW_BOOT_DUMMY_RDMA  0xfc01c0
+
+#defineMXGEFW_ETH_CMD  0xf8
+#defineMXGEFW_ETH_SEND_4   0x20
+#defineMXGEFW_ETH_SEND_1   0x24
+#defineMXGEFW_ETH_SEND_2   0x28
+#defineMXGEFW_ETH_SEND_3   0x2c
+#defineMXGEFW_ETH_RECV_SMALL   0x30
+#defineMXGEFW_ETH_RECV_BIG 0x34
+
+#defineMXGEFW_ETH_SEND(n)  (0x20 + (((n) & 0x03) * 
0x4))
+#defineMXGEFW_ETH_SEND_OFFSET(n)   (MXGEFW_ETH_SEND(n) - 
MXGEFW_ETH_SEND_4)
 
 enum myri10ge_mcp_cmd_type {
MXGEFW_CMD_NONE = 0,


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] myri10ge: convert to netdev_alloc_skb

2006-08-14 Thread Brice Goglin
Convert the myri10ge driver to use netdev_alloc_skb instead of dev_alloc_skb,
which requires to propagate the net_device across several functions.

Signed-off-by: Brice Goglin <[EMAIL PROTECTED]>
---
 drivers/net/myri10ge/myri10ge.c |   37 -
 1 file changed, 20 insertions(+), 17 deletions(-)

Index: linux-mm/drivers/net/myri10ge/myri10ge.c
===
--- linux-mm.orig/drivers/net/myri10ge/myri10ge.c   2006-08-14 
14:21:57.0 -0400
+++ linux-mm/drivers/net/myri10ge/myri10ge.c2006-08-14 14:22:07.0 
-0400
@@ -798,12 +798,13 @@
  * pages directly and building a fraglist in the near future.
  */
 
-static inline struct sk_buff *myri10ge_alloc_big(int bytes)
+static inline struct sk_buff *myri10ge_alloc_big(struct net_device *dev,
+int bytes)
 {
struct sk_buff *skb;
unsigned long data, roundup;
 
-   skb = dev_alloc_skb(bytes + 4096 + MXGEFW_PAD);
+   skb = netdev_alloc_skb(dev, bytes + 4096 + MXGEFW_PAD);
if (skb == NULL)
return NULL;
 
@@ -821,12 +822,13 @@
 
 /* Allocate 2x as much space as required and use whichever portion
  * does not cross a 4KB boundary */
-static inline struct sk_buff *myri10ge_alloc_small_safe(unsigned int bytes)
+static inline struct sk_buff *myri10ge_alloc_small_safe(struct net_device *dev,
+   unsigned int bytes)
 {
struct sk_buff *skb;
unsigned long data, boundary;
 
-   skb = dev_alloc_skb(2 * (bytes + MXGEFW_PAD) - 1);
+   skb = netdev_alloc_skb(dev, 2 * (bytes + MXGEFW_PAD) - 1);
if (unlikely(skb == NULL))
return NULL;
 
@@ -847,12 +849,13 @@
 
 /* Allocate just enough space, and verify that the allocated
  * space does not cross a 4KB boundary */
-static inline struct sk_buff *myri10ge_alloc_small(int bytes)
+static inline struct sk_buff *myri10ge_alloc_small(struct net_device *dev,
+  int bytes)
 {
struct sk_buff *skb;
unsigned long roundup, data, end;
 
-   skb = dev_alloc_skb(bytes + 16 + MXGEFW_PAD);
+   skb = netdev_alloc_skb(dev, bytes + 16 + MXGEFW_PAD);
if (unlikely(skb == NULL))
return NULL;
 
@@ -868,15 +871,17 @@
   "myri10ge_alloc_small: small skb crossed 4KB 
boundary\n");
myri10ge_skb_cross_4k = 1;
dev_kfree_skb_any(skb);
-   skb = myri10ge_alloc_small_safe(bytes);
+   skb = myri10ge_alloc_small_safe(dev, bytes);
}
return skb;
 }
 
 static inline int
-myri10ge_getbuf(struct myri10ge_rx_buf *rx, struct pci_dev *pdev, int bytes,
-   int idx)
+myri10ge_getbuf(struct myri10ge_rx_buf *rx, struct myri10ge_priv *mgp,
+   int bytes, int idx)
 {
+   struct net_device *dev = mgp->dev;
+   struct pci_dev *pdev = mgp->pdev;
struct sk_buff *skb;
dma_addr_t bus;
int len, retval = 0;
@@ -884,11 +889,11 @@
bytes += VLAN_HLEN; /* account for 802.1q vlan tag */
 
if ((bytes + MXGEFW_PAD) > (4096 - 16) /* linux overhead */ )
-   skb = myri10ge_alloc_big(bytes);
+   skb = myri10ge_alloc_big(dev, bytes);
else if (myri10ge_skb_cross_4k)
-   skb = myri10ge_alloc_small_safe(bytes);
+   skb = myri10ge_alloc_small_safe(dev, bytes);
else
-   skb = myri10ge_alloc_small(bytes);
+   skb = myri10ge_alloc_small(dev, bytes);
 
if (unlikely(skb == NULL)) {
rx->alloc_fail++;
@@ -951,7 +956,7 @@
unmap_len = pci_unmap_len(&rx->info[idx], len);
 
/* try to replace the received skb */
-   if (myri10ge_getbuf(rx, mgp->pdev, bytes, idx)) {
+   if (myri10ge_getbuf(rx, mgp, bytes, idx)) {
/* drop the frame -- the old skbuf is re-cycled */
mgp->stats.rx_dropped += 1;
return 0;
@@ -968,7 +973,6 @@
skb_put(skb, len);
 
skb->protocol = eth_type_trans(skb, mgp->dev);
-   skb->dev = mgp->dev;
if (mgp->csum_flag) {
if ((skb->protocol == ntohs(ETH_P_IP)) ||
(skb->protocol == ntohs(ETH_P_IPV6))) {
@@ -1439,7 +1443,7 @@
/* Fill the receive rings */
 
for (i = 0; i <= mgp->rx_small.mask; i++) {
-   status = myri10ge_getbuf(&mgp->rx_small, mgp->pdev,
+   status = myri10ge_getbuf(&mgp->rx_small, mgp,
 mgp->small_bytes, i);
if (status) {
printk(KERN_ERR
@@ -1451,8 +1455,7 @@
 
for (i = 0; i <= mgp->rx_big.mask; i++) {
status =
-   myri10ge_getbuf(&mgp->rx_big, mgp->pdev,
-   dev->mtu + ETH_HLEN, i);
+   myri

[PATCH 0/3] myri10ge update

2006-08-14 Thread Brice Goglin
Hi,

Here's 3 new minor updates for the myri10ge driver:

1) define some previously hardwired firmware constants
2) allow to disable link status change reporting
3) convert to netdev_alloc_skb

Please apply.

Thank you
Brice Goglin

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] myri10ge: allow to disable link status change reporting

2006-08-14 Thread Brice Goglin
Add myri10ge_verbose module parameter to disable reporting of
link status change since some Ethernet switches seem to generate
a lot of status changes under some circumstances and some people
want to avoid useless flooding in the logs.

Also add a counter for link status changes to statistics.

Signed-off-by: Brice Goglin <[EMAIL PROTECTED]>
---
 drivers/net/myri10ge/myri10ge.c |   26 --
 1 file changed, 20 insertions(+), 6 deletions(-)

Index: linux-mm/drivers/net/myri10ge/myri10ge.c
===
--- linux-mm.orig/drivers/net/myri10ge/myri10ge.c   2006-08-14 
14:22:07.0 -0400
+++ linux-mm/drivers/net/myri10ge/myri10ge.c2006-08-14 14:30:50.0 
-0400
@@ -192,6 +192,7 @@
u32 read_dma;
u32 write_dma;
u32 read_write_dma;
+   u32 link_changes;
 };
 
 static char *myri10ge_fw_unaligned = "myri10ge_ethp_z8e.dat";
@@ -257,6 +258,10 @@
 MODULE_PARM_DESC(myri10ge_max_irq_loops,
 "Set stuck legacy IRQ detection threshold\n");
 
+static int myri10ge_verbose = 1;
+module_param(myri10ge_verbose, int, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(myri10ge_verbose, "Enable verbose printing\n");
+
 #define MYRI10GE_FW_OFFSET 1024*1024
 #define MYRI10GE_HIGHPART_TO_U32(X) \
 (sizeof (X) == 8) ? ((u32)((u64)(X) >> 32)) : (0)
@@ -764,6 +769,7 @@
mgp->rx_small.cnt = 0;
mgp->rx_done.idx = 0;
mgp->rx_done.cnt = 0;
+   mgp->link_changes = 0;
status = myri10ge_update_mac_address(mgp, mgp->dev->dev_addr);
myri10ge_change_promisc(mgp, 0, 0);
myri10ge_change_pause(mgp, mgp->pause);
@@ -1085,13 +1091,19 @@
if (mgp->link_state != stats->link_up) {
mgp->link_state = stats->link_up;
if (mgp->link_state) {
-   printk(KERN_INFO "myri10ge: %s: link up\n",
-  mgp->dev->name);
+   if (myri10ge_verbose)
+   printk(KERN_INFO
+  "myri10ge: %s: link up\n",
+  mgp->dev->name);
netif_carrier_on(mgp->dev);
+   mgp->link_changes++;
} else {
-   printk(KERN_INFO "myri10ge: %s: link down\n",
-  mgp->dev->name);
+   if (myri10ge_verbose)
+   printk(KERN_INFO
+  "myri10ge: %s: link down\n",
+  mgp->dev->name);
netif_carrier_off(mgp->dev);
+   mgp->link_changes++;
}
}
if (mgp->rdma_tags_available !=
@@ -1293,8 +1305,9 @@
"serial_number", "tx_pkt_start", "tx_pkt_done",
"tx_req", "tx_done", "rx_small_cnt", "rx_big_cnt",
"wake_queue", "stop_queue", "watchdog_resets", "tx_linearized",
-   "link_up", "dropped_link_overflow", "dropped_link_error_or_filtered",
-   "dropped_runt", "dropped_overrun", "dropped_no_small_buffer",
+   "link_changes", "link_up", "dropped_link_overflow",
+   "dropped_link_error_or_filtered", "dropped_runt",
+   "dropped_overrun", "dropped_no_small_buffer",
"dropped_no_big_buffer"
 };
 
@@ -1345,6 +1358,7 @@
data[i++] = (unsigned int)mgp->stop_queue;
data[i++] = (unsigned int)mgp->watchdog_resets;
data[i++] = (unsigned int)mgp->tx_linearized;
+   data[i++] = (unsigned int)mgp->link_changes;
data[i++] = (unsigned int)ntohl(mgp->fw_stats->link_up);
data[i++] = (unsigned int)ntohl(mgp->fw_stats->dropped_link_overflow);
data[i++] =


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Patches queued in wireless-2.6 for 2.6.19

2006-08-14 Thread Daniel Drake

John W. Linville wrote:

Daniel Drake:
  zd1211rw: ZD1211B ASIC/FWT, not jointly decoder


Any chance this one can go into 2.6.18? Otherwise, one of my devices 
(which is otherwise supported by the driver in the 2.6.18 tree) cannot 
transmit any frames.


Thanks,
Daniel

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 11/16] [IPv6] link: Convert link notifications to use rtnl_notify()

2006-08-14 Thread Thomas Graf
Fixes a wrong use of current->pid as netlink pid.

Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>

Index: net-2.6.19.git/net/ipv6/addrconf.c
===
--- net-2.6.19.git.orig/net/ipv6/addrconf.c
+++ net-2.6.19.git/net/ipv6/addrconf.c
@@ -3438,20 +3438,23 @@ static int inet6_dump_ifinfo(struct sk_b
 void inet6_ifinfo_notify(int event, struct inet6_dev *idev)
 {
struct sk_buff *skb;
-   int size = NLMSG_SPACE(sizeof(struct ifinfomsg) + 
INET6_IFINFO_RTA_SPACE);
+   int payload = sizeof(struct ifinfomsg) + INET6_IFINFO_RTA_SPACE;
+   int err = -ENOBUFS;

-   skb = alloc_skb(size, GFP_ATOMIC);
-   if (!skb) {
-   netlink_set_err(rtnl, 0, RTNLGRP_IPV6_IFINFO, ENOBUFS);
-   return;
-   }
-   if (inet6_fill_ifinfo(skb, idev, current->pid, 0, event, 0) < 0) {
+   skb = nlmsg_new(nlmsg_total_size(payload), GFP_ATOMIC);
+   if (skb == NULL)
+   goto errout;
+
+   err = inet6_fill_ifinfo(skb, idev, 0, 0, event, 0);
+   if (err < 0) {
kfree_skb(skb);
-   netlink_set_err(rtnl, 0, RTNLGRP_IPV6_IFINFO, EINVAL);
-   return;
+   goto errout;
}
-   NETLINK_CB(skb).dst_group = RTNLGRP_IPV6_IFINFO;
-   netlink_broadcast(rtnl, skb, 0, RTNLGRP_IPV6_IFINFO, GFP_ATOMIC);
+
+   err = rtnl_notify(skb, 0, RTNLGRP_IPV6_IFADDR, NULL, GFP_ATOMIC);
+errout:
+   if (err < 0)
+   rtnl_set_sk_err(RTNLGRP_IPV6_IFADDR, err);
 }
 
 /* Maximum length of prefix_cacheinfo attributes */

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 07/16] [IPv4] address: Convert address notification to use rtnl_notify()

2006-08-14 Thread Thomas Graf
Adds support for NLM_F_ECHO allowing applications to easly
see which address have been deleted, added, or promoted.

Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>

Index: net-2.6.19.git/net/ipv4/devinet.c
===
--- net-2.6.19.git.orig/net/ipv4/devinet.c
+++ net-2.6.19.git/net/ipv4/devinet.c
@@ -88,7 +88,7 @@ static struct nla_policy ifa_ipv4_policy
[IFA_LABEL] = { .type = NLA_STRING },
 };
 
-static void rtmsg_ifa(int event, struct in_ifaddr *);
+static void rtmsg_ifa(int event, struct in_ifaddr *, struct nlmsghdr *, u32);
 
 static BLOCKING_NOTIFIER_HEAD(inetaddr_chain);
 static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
@@ -239,8 +239,8 @@ int inet_addr_onlink(struct in_device *i
return 0;
 }
 
-static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
-int destroy)
+static void __inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
+int destroy, struct nlmsghdr *nlh, u32 pid)
 {
struct in_ifaddr *promote = NULL;
struct in_ifaddr *ifa, *ifa1 = *ifap;
@@ -273,7 +273,7 @@ static void inet_del_ifa(struct in_devic
if (!do_promote) {
*ifap1 = ifa->ifa_next;
 
-   rtmsg_ifa(RTM_DELADDR, ifa);
+   rtmsg_ifa(RTM_DELADDR, ifa, nlh, pid);
blocking_notifier_call_chain(&inetaddr_chain,
NETDEV_DOWN, ifa);
inet_free_ifa(ifa);
@@ -298,7 +298,7 @@ static void inet_del_ifa(struct in_devic
   is valid, it will try to restore deleted routes... Grr.
   So that, this order is correct.
 */
-   rtmsg_ifa(RTM_DELADDR, ifa1);
+   rtmsg_ifa(RTM_DELADDR, ifa1, nlh, pid);
blocking_notifier_call_chain(&inetaddr_chain, NETDEV_DOWN, ifa1);
 
if (promote) {
@@ -310,7 +310,7 @@ static void inet_del_ifa(struct in_devic
}
 
promote->ifa_flags &= ~IFA_F_SECONDARY;
-   rtmsg_ifa(RTM_NEWADDR, promote);
+   rtmsg_ifa(RTM_NEWADDR, promote, nlh, pid);
blocking_notifier_call_chain(&inetaddr_chain,
NETDEV_UP, promote);
for (ifa = promote->ifa_next; ifa; ifa = ifa->ifa_next) {
@@ -329,7 +329,14 @@ static void inet_del_ifa(struct in_devic
}
 }
 
-static int inet_insert_ifa(struct in_ifaddr *ifa)
+static void inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
+int destroy)
+{
+   __inet_del_ifa(in_dev, ifap, destroy, NULL, 0);
+}
+
+static int __inet_insert_ifa(struct in_ifaddr *ifa, struct nlmsghdr *nlh,
+u32 pid)
 {
struct in_device *in_dev = ifa->ifa_dev;
struct in_ifaddr *ifa1, **ifap, **last_primary;
@@ -374,12 +381,17 @@ static int inet_insert_ifa(struct in_ifa
/* Send message first, then call notifier.
   Notifier will trigger FIB update, so that
   listeners of netlink will know about new ifaddr */
-   rtmsg_ifa(RTM_NEWADDR, ifa);
+   rtmsg_ifa(RTM_NEWADDR, ifa, nlh, pid);
blocking_notifier_call_chain(&inetaddr_chain, NETDEV_UP, ifa);
 
return 0;
 }
 
+static int inet_insert_ifa(struct in_ifaddr *ifa)
+{
+   return __inet_insert_ifa(ifa, NULL, 0);
+}
+
 static int inet_set_ifa(struct net_device *dev, struct in_ifaddr *ifa)
 {
struct in_device *in_dev = __in_dev_get_rtnl(dev);
@@ -466,7 +478,7 @@ static int inet_rtm_deladdr(struct sk_bu
!inet_ifa_match(nla_get_u32(tb[IFA_ADDRESS]), ifa)))
continue;
 
-   inet_del_ifa(in_dev, ifap, 1);
+   __inet_del_ifa(in_dev, ifap, 1, nlh, NETLINK_CB(skb).pid);
return 0;
}
 
@@ -558,7 +570,7 @@ static int inet_rtm_newaddr(struct sk_bu
if (IS_ERR(ifa))
return PTR_ERR(ifa);
 
-   return inet_insert_ifa(ifa);
+   return __inet_insert_ifa(ifa, nlh, NETLINK_CB(skb).pid);
 }
 
 /*
@@ -1189,18 +1201,27 @@ done:
return skb->len;
 }
 
-static void rtmsg_ifa(int event, struct in_ifaddr* ifa)
+static void rtmsg_ifa(int event, struct in_ifaddr* ifa, struct nlmsghdr *nlh,
+ u32 pid)
 {
struct sk_buff *skb;
+   u32 seq = nlh ? nlh->nlmsg_seq : 0;
+   int err = -ENOBUFS;
 
skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
if (skb == NULL)
-   netlink_set_err(rtnl, 0, RTNLGRP_IPV4_IFADDR, ENOBUFS);
-   else if (inet_fill_ifaddr(skb, ifa, 0, 0, event, 0) < 0) {
+   goto errout;
+
+   err = inet_fill_ifaddr(skb, ifa, pid, seq, event, 0);
+   if (err < 0) {
kfree_skb(skb);
-   netlink_set_err(rtnl, 0, RTNLGRP_IPV4_IFADDR, EINVAL);
-   } else
-

[PATCH 04/16] [NET] fib_rules: Convert fib rule notification to use rtnl_notify()

2006-08-14 Thread Thomas Graf
Adds support for NLM_F_ECHO to simplify the process of identifying
inserted rules with an auto generated priority.

Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>

Index: net-2.6.19.git/net/core/fib_rules.c
===
--- net-2.6.19.git.orig/net/core/fib_rules.c
+++ net-2.6.19.git/net/core/fib_rules.c
@@ -18,7 +18,8 @@ static LIST_HEAD(rules_ops);
 static DEFINE_SPINLOCK(rules_mod_lock);
 
 static void notify_rule_change(int event, struct fib_rule *rule,
-  struct fib_rules_ops *ops);
+  struct fib_rules_ops *ops, struct nlmsghdr *nlh,
+  u32 pid);
 
 static struct fib_rules_ops *lookup_rules_ops(int family)
 {
@@ -209,7 +210,7 @@ int fib_nl_newrule(struct sk_buff *skb, 
else
list_add_rcu(&rule->list, ops->rules_list);
 
-   notify_rule_change(RTM_NEWRULE, rule, ops);
+   notify_rule_change(RTM_NEWRULE, rule, ops, nlh, NETLINK_CB(skb).pid);
rules_ops_put(ops);
return 0;
 
@@ -266,7 +267,8 @@ int fib_nl_delrule(struct sk_buff *skb, 
 
list_del_rcu(&rule->list);
synchronize_rcu();
-   notify_rule_change(RTM_DELRULE, rule, ops);
+   notify_rule_change(RTM_DELRULE, rule, ops, nlh,
+  NETLINK_CB(skb).pid);
fib_rule_put(rule);
rules_ops_put(ops);
return 0;
@@ -344,18 +346,26 @@ skip:
 EXPORT_SYMBOL_GPL(fib_rules_dump);
 
 static void notify_rule_change(int event, struct fib_rule *rule,
-  struct fib_rules_ops *ops)
+  struct fib_rules_ops *ops, struct nlmsghdr *nlh,
+  u32 pid)
 {
-   int size = nlmsg_total_size(sizeof(struct fib_rule_hdr) + 128);
-   struct sk_buff *skb = alloc_skb(size, GFP_KERNEL);
+   struct sk_buff *skb;
+   int err = -ENOBUFS;
 
+   skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
if (skb == NULL)
-   netlink_set_err(rtnl, 0, ops->nlgroup, ENOBUFS);
-   else if (fib_nl_fill_rule(skb, rule, 0, 0, event, 0, ops) < 0) {
+   goto errout;
+
+   err = fib_nl_fill_rule(skb, rule, pid, nlh->nlmsg_seq, event, 0, ops);
+   if (err < 0) {
kfree_skb(skb);
-   netlink_set_err(rtnl, 0, ops->nlgroup, EINVAL);
-   } else
-   netlink_broadcast(rtnl, skb, 0, ops->nlgroup, GFP_KERNEL);
+   goto errout;
+   }
+
+   err = rtnl_notify(skb, pid, ops->nlgroup, nlh, GFP_KERNEL);
+errout:
+   if (err < 0)
+   rtnl_set_sk_err(ops->nlgroup, err);
 }
 
 static void attach_rules(struct list_head *rules, struct net_device *dev)

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 06/16] [DECNET]: Convert DECnet notifications to use rtnl_notify()

2006-08-14 Thread Thomas Graf
Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>

Index: net-2.6.19.git/net/decnet/dn_dev.c
===
--- net-2.6.19.git.orig/net/decnet/dn_dev.c
+++ net-2.6.19.git/net/decnet/dn_dev.c
@@ -746,20 +746,23 @@ rtattr_failure:
 static void rtmsg_ifa(int event, struct dn_ifaddr *ifa)
 {
struct sk_buff *skb;
-   int size = NLMSG_SPACE(sizeof(struct ifaddrmsg)+128);
+   int payload = sizeof(struct ifaddrmsg) + 128;
+   int err = -ENOBUFS;
 
-   skb = alloc_skb(size, GFP_KERNEL);
-   if (!skb) {
-   netlink_set_err(rtnl, 0, RTNLGRP_DECnet_IFADDR, ENOBUFS);
-   return;
-   }
-   if (dn_dev_fill_ifaddr(skb, ifa, 0, 0, event, 0) < 0) {
+   skb = alloc_skb(nlmsg_total_size(payload), GFP_KERNEL);
+   if (skb == NULL)
+   goto errout;
+
+   err = dn_dev_fill_ifaddr(skb, ifa, 0, 0, event, 0);
+   if (err < 0) {
kfree_skb(skb);
-   netlink_set_err(rtnl, 0, RTNLGRP_DECnet_IFADDR, EINVAL);
-   return;
+   goto errout;
}
-   NETLINK_CB(skb).dst_group = RTNLGRP_DECnet_IFADDR;
-   netlink_broadcast(rtnl, skb, 0, RTNLGRP_DECnet_IFADDR, GFP_KERNEL);
+
+   err = rtnl_notify(skb, 0, RTNLGRP_DECnet_IFADDR, NULL, GFP_KERNEL);
+errout:
+   if (err < 0)
+   rtnl_set_sk_err(RTNLGRP_DECnet_IFADDR, err);
 }
 
 static int dn_dev_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb)
Index: net-2.6.19.git/net/decnet/dn_table.c
===
--- net-2.6.19.git.orig/net/decnet/dn_table.c
+++ net-2.6.19.git/net/decnet/dn_table.c
@@ -333,24 +333,24 @@ static void dn_rtmsg_fib(int event, stru
 {
 struct sk_buff *skb;
 u32 pid = req ? req->pid : 0;
-int size = NLMSG_SPACE(sizeof(struct rtmsg) + 256);
+   int err = -ENOBUFS;
 
-skb = alloc_skb(size, GFP_KERNEL);
-if (!skb)
-return;
-
-if (dn_fib_dump_info(skb, pid, nlh->nlmsg_seq, event, tb_id, 
-f->fn_type, f->fn_scope, &f->fn_key, z, 
-DN_FIB_INFO(f), 0) < 0) {
+skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
+if (skb == NULL)
+   goto errout;
+
+err = dn_fib_dump_info(skb, pid, nlh->nlmsg_seq, event, tb_id,
+  f->fn_type, f->fn_scope, &f->fn_key, z,
+  DN_FIB_INFO(f), 0);
+   if (err < 0) {
 kfree_skb(skb);
-return;
+   goto errout;
 }
-NETLINK_CB(skb).dst_group = RTNLGRP_DECnet_ROUTE;
-if (nlh->nlmsg_flags & NLM_F_ECHO)
-atomic_inc(&skb->users);
-netlink_broadcast(rtnl, skb, pid, RTNLGRP_DECnet_ROUTE, GFP_KERNEL);
-if (nlh->nlmsg_flags & NLM_F_ECHO)
-netlink_unicast(rtnl, skb, pid, MSG_DONTWAIT);
+
+   err = rtnl_notify(skb, pid, RTNLGRP_DECnet_ROUTE, nlh, GFP_KERNEL);
+errout:
+   if (err < 0)
+   rtnl_set_sk_err(RTNLGRP_DECnet_ROUTE, err);
 }
 
 static __inline__ int dn_hash_dump_bucket(struct sk_buff *skb, 

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 10/16] [IPv6] route: Convert route notifications to use rtnl_notify()

2006-08-14 Thread Thomas Graf
Fixes a wrong use of current->pid as netlink pid.

Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>

Index: net-2.6.19.git/net/ipv6/route.c
===
--- net-2.6.19.git.orig/net/ipv6/route.c
+++ net-2.6.19.git/net/ipv6/route.c
@@ -35,7 +35,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #ifdef CONFIG_PROC_FS
@@ -54,6 +53,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -2052,27 +2052,25 @@ void inet6_rt_notify(int event, struct r
struct netlink_skb_parms *req)
 {
struct sk_buff *skb;
-   int size = NLMSG_SPACE(sizeof(struct rtmsg)+256);
-   u32 pid = current->pid;
-   u32 seq = 0;
-
-   if (req)
-   pid = req->pid;
-   if (nlh)
-   seq = nlh->nlmsg_seq;
-   
-   skb = alloc_skb(size, gfp_any());
-   if (!skb) {
-   netlink_set_err(rtnl, 0, RTNLGRP_IPV6_ROUTE, ENOBUFS);
-   return;
-   }
-   if (rt6_fill_node(skb, rt, NULL, NULL, 0, event, pid, seq, 0, 0) < 0) {
+   u32 pid = req ? req->pid : 0;
+   u32 seq = nlh ? nlh->nlmsg_seq : 0;
+   int payload = sizeof(struct rtmsg) + 256;
+   int err = -ENOBUFS;
+
+   skb = nlmsg_new(nlmsg_total_size(payload), gfp_any());
+   if (skb == NULL)
+   goto errout;
+
+   err = rt6_fill_node(skb, rt, NULL, NULL, 0, event, pid, seq, 0, 0);
+   if (err < 0) {
kfree_skb(skb);
-   netlink_set_err(rtnl, 0, RTNLGRP_IPV6_ROUTE, EINVAL);
-   return;
+   goto errout;
}
-   NETLINK_CB(skb).dst_group = RTNLGRP_IPV6_ROUTE;
-   netlink_broadcast(rtnl, skb, 0, RTNLGRP_IPV6_ROUTE, gfp_any());
+
+   err = rtnl_notify(skb, pid, RTNLGRP_IPV6_ROUTE, nlh, gfp_any());
+errout:
+   if (err < 0)
+   rtnl_set_sk_err(RTNLGRP_IPV6_ROUTE, err);
 }
 
 /*

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/16] [NETLINK]: Add notification message sending interface

2006-08-14 Thread Thomas Graf
Adds nlmsg_notify() implementing proper notification logic. The
message is multicasted to all listeners in the group. The
applications the requests orignates from can request a unicast
back report in which case said socket will be excluded from the
multicast to avoid duplicated notifications.

nlmsg_multicast() is extended to take allocation flags to
allow notification in atomic contexts.

Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>

Index: net-2.6.19.git/include/net/netlink.h
===
--- net-2.6.19.git.orig/include/net/netlink.h
+++ net-2.6.19.git/include/net/netlink.h
@@ -43,6 +43,7 @@
  * Message Sending:
  *   nlmsg_multicast() multicast message to several groups
  *   nlmsg_unicast()   unicast a message to a single socket
+ *   nlmsg_notify()send notification message
  *
  * Message Length Calculations:
  *   nlmsg_msg_size(payload)   length of message w/o padding
@@ -545,15 +546,16 @@ static inline void nlmsg_free(struct sk_
  * @skb: netlink message as socket buffer
  * @pid: own netlink pid to avoid sending to yourself
  * @group: multicast group id
+ * @flags: allocation flags
  */
 static inline int nlmsg_multicast(struct sock *sk, struct sk_buff *skb,
- u32 pid, unsigned int group)
+ u32 pid, unsigned int group, gfp_t flags)
 {
int err;
 
NETLINK_CB(skb).dst_group = group;
 
-   err = netlink_broadcast(sk, skb, pid, group, GFP_KERNEL);
+   err = netlink_broadcast(sk, skb, pid, group, flags);
if (err > 0)
err = 0;
 
Index: net-2.6.19.git/net/netlink/af_netlink.c
===
--- net-2.6.19.git.orig/net/netlink/af_netlink.c
+++ net-2.6.19.git/net/netlink/af_netlink.c
@@ -1550,6 +1550,38 @@ void netlink_queue_skip(struct nlmsghdr 
skb_pull(skb, msglen);
 }
 
+/**
+ * nlmsg_notify - send a notification netlink message
+ * @sk: netlink socket to use
+ * @skb: notification message
+ * @pid: destination netlink pid for reports or 0
+ * @group: destination multicast group or 0
+ * @report: 1 to report back, 0 to disable
+ * @flags: allocation flags
+ */
+int nlmsg_notify(struct sock *sk, struct sk_buff *skb, u32 pid,
+unsigned int group, int report, gfp_t flags)
+{
+   int err = 0;
+
+   if (group) {
+   int exclude_pid = 0;
+
+   if (report) {
+   atomic_inc(&skb->users);
+   exclude_pid = pid;
+   }
+
+   /* errors reported via destination sk->sk_err */
+   nlmsg_multicast(sk, skb, exclude_pid, group, flags);
+   }
+
+   if (report)
+   err = nlmsg_unicast(sk, skb, pid);
+
+   return err;
+}
+
 #ifdef CONFIG_PROC_FS
 struct nl_seq_iter {
int link;
@@ -1804,4 +1836,4 @@ EXPORT_SYMBOL(netlink_set_err);
 EXPORT_SYMBOL(netlink_set_nonroot);
 EXPORT_SYMBOL(netlink_unicast);
 EXPORT_SYMBOL(netlink_unregister_notifier);
-
+EXPORT_SYMBOL(nlmsg_notify);
Index: net-2.6.19.git/include/net/genetlink.h
===
--- net-2.6.19.git.orig/include/net/genetlink.h
+++ net-2.6.19.git/include/net/genetlink.h
@@ -133,11 +133,12 @@ static inline int genlmsg_cancel(struct 
  * @skb: netlink message as socket buffer
  * @pid: own netlink pid to avoid sending to yourself
  * @group: multicast group id
+ * @flags: allocation flags
  */
 static inline int genlmsg_multicast(struct sk_buff *skb, u32 pid,
-   unsigned int group)
+   unsigned int group, gfp_t flags)
 {
-   return nlmsg_multicast(genl_sock, skb, pid, group);
+   return nlmsg_multicast(genl_sock, skb, pid, group, flags);
 }
 
 /**
Index: net-2.6.19.git/net/netlabel/netlabel_user.c
===
--- net-2.6.19.git.orig/net/netlabel/netlabel_user.c
+++ net-2.6.19.git/net/netlabel/netlabel_user.c
@@ -154,5 +154,5 @@ int netlbl_netlink_snd(struct sk_buff *s
  */
 int netlbl_netlink_snd_multicast(struct sk_buff *skb, u32 pid, u32 group)
 {
-   return genlmsg_multicast(skb, pid, group);
+   return genlmsg_multicast(skb, pid, group, GFP_KERNEL);
 }
Index: net-2.6.19.git/net/netlink/genetlink.c
===
--- net-2.6.19.git.orig/net/netlink/genetlink.c
+++ net-2.6.19.git/net/netlink/genetlink.c
@@ -510,7 +510,7 @@ static int genl_ctrl_event(int event, vo
if (IS_ERR(msg))
return PTR_ERR(msg);
 
-   genlmsg_multicast(msg, 0, GENL_ID_CTRL);
+   genlmsg_multicast(msg, 0, GENL_ID_CTRL, GFP_KERNEL);
break;
}
 

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to

[PATCH 13/16] [BRIDGE]: Convert notifications to use rtnl_notify()

2006-08-14 Thread Thomas Graf
Fixes a wrong use of current->pid as netlink pid.

Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>

Index: net-2.6.19.git/net/bridge/br_netlink.c
===
--- net-2.6.19.git.orig/net/bridge/br_netlink.c
+++ net-2.6.19.git/net/bridge/br_netlink.c
@@ -12,6 +12,7 @@
 
 #include 
 #include 
+#include 
 #include "br_private.h"
 
 /*
@@ -76,26 +77,24 @@ rtattr_failure:
 void br_ifinfo_notify(int event, struct net_bridge_port *port)
 {
struct sk_buff *skb;
-   int err = -ENOMEM;
+   int payload = sizeof(struct ifinfomsg) + 128;
+   int err = -ENOBUFS;
 
pr_debug("bridge notify event=%d\n", event);
-   skb = alloc_skb(NLMSG_SPACE(sizeof(struct ifinfomsg) + 128),
-   GFP_ATOMIC);
-   if (!skb)
-   goto err_out;
+   skb = nlmsg_new(nlmsg_total_size(payload), GFP_ATOMIC);
+   if (skb == NULL)
+   goto errout;
+
+   err = br_fill_ifinfo(skb, port, 0, 0, event, 0);
+   if (err < 0) {
+   kfree_skb(skb);
+   goto errout;
+   }
 
-   err = br_fill_ifinfo(skb, port, current->pid, 0, event, 0);
+   err = rtnl_notify(skb, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC);
+errout:
if (err < 0)
-   goto err_kfree;
-
-   NETLINK_CB(skb).dst_group = RTNLGRP_LINK;
-   netlink_broadcast(rtnl, skb, 0, RTNLGRP_LINK, GFP_ATOMIC);
-   return;
-
-err_kfree:
-   kfree_skb(skb);
-err_out:
-   netlink_set_err(rtnl, 0, RTNLGRP_LINK, err);
+   rtnl_set_sk_err(RTNLGRP_LINK, err);
 }
 
 /*

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


  1   2   3   >