Re: [PATCH] net: Marking struct pernet_operations __net_initdata was inappropriate

2007-10-27 Thread Eric W. Biederman
David Miller [EMAIL PROTECTED] writes:

 Applied, thanks Eric.

 Although juding by his comments I though that Denis had different
 plans in mind to fix this.

He might.  Somehow I wasn't on that thread so I missed it until after
I sent this patch.  Reading through that thread  again it looks like
he had a thought for another attribute.  It all sounded very clever.

This patch is minimal stupid and should just work.  Doubtless the
clever patch can be applied on top, once the details are figured
out.

Eric
-
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] net: Marking struct pernet_operations __net_initdata was inappropriate

2007-10-27 Thread David Miller
From: [EMAIL PROTECTED] (Eric W. Biederman)
Date: Sat, 27 Oct 2007 00:07:12 -0600

 This patch is minimal stupid and should just work.  Doubtless the
 clever patch can be applied on top, once the details are figured
 out.

That is true and that's why I applied your patch.

Thanks!
-
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 1/2] [CRYPTO] tcrypt: Move sg_init_table out of timing loops

2007-10-27 Thread David Miller
From: Herbert Xu [EMAIL PROTECTED]
Date: Fri, 26 Oct 2007 23:00:04 +0800

 [CRYPTO] tcrypt: Move sg_init_table out of timing loops
 
 This patch moves the sg_init_table out of the timing loops for hash
 algorithms so that it doesn't impact on the speed test results.
 
 Signed-off-by: Herbert Xu [EMAIL PROTECTED]

Applied, thanks!
-
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/2] [CRYPTO] users: Fix up scatterlist conversion errors

2007-10-27 Thread David Miller
From: Herbert Xu [EMAIL PROTECTED]
Date: Fri, 26 Oct 2007 23:00:05 +0800

 [CRYPTO] users: Fix up scatterlist conversion errors
 
 This patch fixes the errors made in the users of the crypto layer during
 the sg_init_table conversion.  It also adds a few conversions that were
 missing altogether.
 
 Signed-off-by: Herbert Xu [EMAIL PROTECTED]

Also applied, thanks Herbert!
-
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: [0/3] Distributed storage. Mirror algo extension for automatic recovery.

2007-10-27 Thread Evgeniy Polyakov
Hi Andrew.

On Fri, Oct 26, 2007 at 01:55:38PM -0700, Andrew Morton ([EMAIL PROTECTED]) 
wrote:
  I'm pleased to announce sixth release of the distributed storage
  subsystem, which allows to form a storage on top of remote and local
  nodes, which in turn can be exported to another storage as a node to
  form tree-like storages.
 
 I went back and re-read last month's discussion and I'm not seeing any
 reason why we shouldn't start thinking about merging this.
 
 How close is it to that stage?  A peek at your development blog indicates
 that things are still changing at a moderate rate?

I completed storage layer development itself, the only remaining todo item
is to implement new redundancy algorithm, but I did not see major demand
on that, so it will stay for now with low priority.

I will use DST as a transport layer for distributed filesystem, and
probably that will require additional features, I have no clean design so
far, but right now I have nothing in the pipe to commit to DST.


-- 
Evgeniy Polyakov
-
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 5/5][ATM]: [br2864] whitespace cleanup

2007-10-27 Thread chas williams - CONTRACTOR
commit 6b11f93a718dc916198feb1099ae0cef39ce3936
Author: Chas Williams [EMAIL PROTECTED]
Date:   Sat Oct 27 08:33:40 2007 -0400

[ATM]: [br2864] whitespace cleanup

Signed-off-by: Chas Williams [EMAIL PROTECTED]

diff --git a/include/linux/atmbr2684.h b/include/linux/atmbr2684.h
index ccdab6c..52bf72a 100644
--- a/include/linux/atmbr2684.h
+++ b/include/linux/atmbr2684.h
@@ -15,7 +15,7 @@
 #define BR2684_MEDIA_802_6 (4) /* 802.6 */
 
/* used only at device creation:  */
-#define BR2684_FLAG_ROUTED (116) /* payload is routed, not bridged */
+#define BR2684_FLAG_ROUTED (116) /* payload is routed, not bridged */
 
 /*
  * Is there FCS inbound on this VC?  This currently isn't supported.
@@ -45,17 +45,16 @@
 #define BR2684_PAYLOAD_ROUTED   (0)
 #define BR2684_PAYLOAD_BRIDGED  (1)
 
-
 /*
  * This is for the ATM_NEWBACKENDIF call - these are like socket families:
  * the first element of the structure is the backend number and the rest
  * is per-backend specific
  */
 struct atm_newif_br2684 {
-   atm_backend_t   backend_num;/* ATM_BACKEND_BR2684 */
-   int media;  /* BR2684_MEDIA_*, flags in upper bits 
*/
-   charifname[IFNAMSIZ];
-   int mtu;
+   atm_backend_t backend_num;  /* ATM_BACKEND_BR2684 */
+   int media;  /* BR2684_MEDIA_*, flags in upper bits */
+   char ifname[IFNAMSIZ];
+   int mtu;
 };
 
 /*
@@ -66,10 +65,10 @@ struct atm_newif_br2684 {
 #define BR2684_FIND_BYNUM  (1)
 #define BR2684_FIND_BYIFNAME   (2)
 struct br2684_if_spec {
-   int method; /* BR2684_FIND_* */
+   int method; /* BR2684_FIND_* */
union {
-   charifname[IFNAMSIZ];
-   int devnum;
+   char ifname[IFNAMSIZ];
+   int devnum;
} spec;
 };
 
@@ -79,16 +78,16 @@ struct br2684_if_spec {
  * is per-backend specific
  */
 struct atm_backend_br2684 {
-   atm_backend_t   backend_num;/* ATM_BACKEND_BR2684 */
+   atm_backend_t backend_num;  /* ATM_BACKEND_BR2684 */
struct br2684_if_spec ifspec;
-   int fcs_in; /* BR2684_FCSIN_* */
-   int fcs_out;/* BR2684_FCSOUT_* */
-   int fcs_auto;   /* 1: fcs_{in,out} disabled if no FCS rx'ed */
-   int encaps; /* BR2684_ENCAPS_* */
-   int has_vpiid;  /* 1: use vpn_id - Unsupported */
-   __u8vpn_id[7];
-   int send_padding;   /* unsupported */
-   int min_size;   /* we will pad smaller packets than this */
+   int fcs_in; /* BR2684_FCSIN_* */
+   int fcs_out;/* BR2684_FCSOUT_* */
+   int fcs_auto;   /* 1: fcs_{in,out} disabled if no FCS rx'ed */
+   int encaps; /* BR2684_ENCAPS_* */
+   int has_vpiid;  /* 1: use vpn_id - Unsupported */
+   __u8 vpn_id[7];
+   int send_padding;   /* unsupported */
+   int min_size;   /* we will pad smaller packets than this */
 };
 
 /*
@@ -97,8 +96,8 @@ struct atm_backend_br2684 {
  * efficient per-if in/out filters, this support will be removed
  */
 struct br2684_filter {
-   __be32  prefix; /* network byte order */
-   __be32  netmask;/* 0 = disable filter */
+   __be32 prefix;  /* network byte order */
+   __be32 netmask; /* 0 = disable filter */
 };
 
 struct br2684_filter_set {
@@ -107,8 +106,8 @@ struct br2684_filter_set {
 };
 
 enum br2684_payload {
-p_routed = BR2684_PAYLOAD_ROUTED,
-p_bridged = BR2684_PAYLOAD_BRIDGED,
+   p_routed = BR2684_PAYLOAD_ROUTED,
+   p_bridged = BR2684_PAYLOAD_BRIDGED,
 };
 
 #define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \
diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index d9bb2a1..f5a3794 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -1,9 +1,10 @@
 /*
-Ethernet netdevice using ATM AAL5 as underlying carrier
-(RFC1483 obsoleted by RFC2684) for Linux
-Authors: Marcell GAL, 2000, XDSL Ltd, Hungary
- Eric Kinzie, 2006-2007, US Naval Research Laboratory
-*/
+ * Ethernet netdevice using ATM AAL5 as underlying carrier
+ * (RFC1483 obsoleted by RFC2684) for Linux
+ *
+ * Authors: Marcell GAL, 2000, XDSL Ltd, Hungary
+ *  Eric Kinzie, 2006-2007, US Naval Research Laboratory
+ */
 
 #include linux/module.h
 #include linux/init.h
@@ -51,28 +52,24 @@ static void skb_debug(const struct sk_buff *skb)
 #define ETHERTYPE_IPV6 0x86, 0xdd
 #define PAD_BRIDGED0x00, 0x00
 
-static unsigned char ethertype_ipv4[] =
-   { ETHERTYPE_IPV4 };
-static unsigned char ethertype_ipv6[] =
-   { ETHERTYPE_IPV6 };
+static unsigned char ethertype_ipv4[] = { ETHERTYPE_IPV4 };
+static unsigned char ethertype_ipv6[] = { ETHERTYPE_IPV6 };
 static unsigned char llc_oui_pid_pad[] =
-   { LLC, SNAP_BRIDGED, PID_ETHERNET, PAD_BRIDGED };

Re: [PATCH] ucc_geth: add support for netpoll

2007-10-27 Thread Sergei Shtylyov

Hello.

Anton Vorontsov wrote:


This patch adds netpoll support for the QE UCC Gigabit Ethernet
driver. The approach is very similar to the gianfar driver.


   It's rather contrarywise -- this is standard approach and gianfar with its 
3 TSEC IRQs has a quite non-standard poll_controller() implementation.



Tested using netconsole.


   KGDBoE is considered a better test (I hope you've also tested with it).


Signed-off-by: Anton Vorontsov [EMAIL PROTECTED]
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 18a6f48..06807ce 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3691,6 +3691,22 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void 
*info)
return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER

+/*
+ * Polling 'interrupt' - used by things like netconsole to send skbs
+ * without having to re-enable interrupts. It's not called while
+ * the interrupt routine is executing.
+ */
+static void ucc_netpoll(struct net_device *dev)
+{
+   struct ucc_geth_private *ugeth = netdev_priv(dev);
+
+   disable_irq(ugeth-ug_info-uf_info.irq);
+   ucc_geth_irq_handler(ugeth-ug_info-uf_info.irq, dev);
+   enable_irq(ugeth-ug_info-uf_info.irq);


   Why not make it less complex (for a reader and gcc too :-) ?

struct ucc_geth_private *ugeth = netdev_priv(dev);
int irq = ugeth-ug_info-uf_info.irq;

disable_irq(irq);
ucc_geth_irq_handler(irq, dev);
enable_irq(irq);


+}
+#endif /* CONFIG_NET_POLL_CONTROLLER */
+
 /* Called when something needs to use the ethernet device */
 /* Returns 0 for success. */
 static int ucc_geth_open(struct net_device *dev)


WBR, Sergei
-
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


ASUS NX1001 (IP100A, sundance) PHY not powered up

2007-10-27 Thread Yanko Kaneti
Hi,

Trying a new ASUS NX1001 adapter (1043:8213) with a IP100A chip
(13f0:0200) (rev 31) on a machine running Fedora development (2.6.23.1 +
some unrelated to sundance patches). 

On power up the link appears down (judging by the switch port its
connected to).  The normal fedora startup has udev which loads the
sundance driver, dmesg says it has done so, the link still down.
rmmod sundance - still down.
modprobe sundance - still down.
rmmod sundance - link up
modprobe sundance - link down
rmmod sundance - link up
..
?
All these with no indication of error in the logs.

Same make adapter from the same batch appears to function under win2k
after loading the driver from the cd.  Again the link appears to be
powered up when the driver is loaded.

The LED on the card is only active on data activity not link status. 

Puzzled
Yanko

-
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/5][ATM]: [he] This patch removes the ancient version string.

2007-10-27 Thread chas williams - CONTRACTOR
commit 41d6b7e20dd6d57bec4f14697f654c8211ff5d57
Author: Adrian Bunk [EMAIL PROTECTED]
Date:   Fri Oct 26 07:29:47 2007 -0400

[ATM]: [he] This patch removes the ancient version string.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Chas Williams [EMAIL PROTECTED]

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

2007-10-27 Thread chas williams - CONTRACTOR
commit f57512af6142cf14bd15012c4c627f9ebef0582a
Author: Robert P. J. Day [EMAIL PROTECTED]
Date:   Fri Oct 26 07:27:07 2007 -0400

[ATM]: atm is no longer experimental

From: Robert P. J. Day [EMAIL PROTECTED]
Signed-off-by: Chas Williams [EMAIL PROTECTED]

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

2007-10-27 Thread chas williams - CONTRACTOR
commit 03c544e08cfe22f0c8a952c0aed1265917dca469
Author: Kay Sievers [EMAIL PROTECTED]
Date:   Fri Oct 26 07:28:29 2007 -0400

[ATM]: Convert struct class_device to struct device

Signed-off-by: Kay Sievers [EMAIL PROTECTED]
Cc: Tony Jones [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]
Signed-off-by: Chas Williams [EMAIL PROTECTED]

diff --git a/net/atm/atm_sysfs.c b/net/atm/atm_sysfs.c
index 9ef07ed..1b88311 100644
--- a/net/atm/atm_sysfs.c
+++ b/net/atm/atm_sysfs.c
@@ -9,13 +9,15 @@
 
 #define to_atm_dev(cldev) container_of(cldev, struct atm_dev, class_dev)
 
-static ssize_t show_type(struct class_device *cdev, char *buf)
+static ssize_t show_type(struct device *cdev,
+struct device_attribute *attr, char *buf)
 {
struct atm_dev *adev = to_atm_dev(cdev);
return sprintf(buf, %s\n, adev-type);
 }
 
-static ssize_t show_address(struct class_device *cdev, char *buf)
+static ssize_t show_address(struct device *cdev,
+   struct device_attribute *attr, char *buf)
 {
char *pos = buf;
struct atm_dev *adev = to_atm_dev(cdev);
@@ -28,7 +30,8 @@ static ssize_t show_address(struct class_device *cdev, char 
*buf)
return pos - buf;
 }
 
-static ssize_t show_atmaddress(struct class_device *cdev, char *buf)
+static ssize_t show_atmaddress(struct device *cdev,
+  struct device_attribute *attr, char *buf)
 {
unsigned long flags;
char *pos = buf;
@@ -54,7 +57,8 @@ static ssize_t show_atmaddress(struct class_device *cdev, 
char *buf)
return pos - buf;
 }
 
-static ssize_t show_carrier(struct class_device *cdev, char *buf)
+static ssize_t show_carrier(struct device *cdev,
+   struct device_attribute *attr, char *buf)
 {
char *pos = buf;
struct atm_dev *adev = to_atm_dev(cdev);
@@ -65,7 +69,8 @@ static ssize_t show_carrier(struct class_device *cdev, char 
*buf)
return pos - buf;
 }
 
-static ssize_t show_link_rate(struct class_device *cdev, char *buf)
+static ssize_t show_link_rate(struct device *cdev,
+ struct device_attribute *attr, char *buf)
 {
char *pos = buf;
struct atm_dev *adev = to_atm_dev(cdev);
@@ -90,22 +95,23 @@ static ssize_t show_link_rate(struct class_device *cdev, 
char *buf)
return pos - buf;
 }
 
-static CLASS_DEVICE_ATTR(address, S_IRUGO, show_address, NULL);
-static CLASS_DEVICE_ATTR(atmaddress, S_IRUGO, show_atmaddress, NULL);
-static CLASS_DEVICE_ATTR(carrier, S_IRUGO, show_carrier, NULL);
-static CLASS_DEVICE_ATTR(type, S_IRUGO, show_type, NULL);
-static CLASS_DEVICE_ATTR(link_rate, S_IRUGO, show_link_rate, NULL);
-
-static struct class_device_attribute *atm_attrs[] = {
-   class_device_attr_atmaddress,
-   class_device_attr_address,
-   class_device_attr_carrier,
-   class_device_attr_type,
-   class_device_attr_link_rate,
+static DEVICE_ATTR(address, S_IRUGO, show_address, NULL);
+static DEVICE_ATTR(atmaddress, S_IRUGO, show_atmaddress, NULL);
+static DEVICE_ATTR(carrier, S_IRUGO, show_carrier, NULL);
+static DEVICE_ATTR(type, S_IRUGO, show_type, NULL);
+static DEVICE_ATTR(link_rate, S_IRUGO, show_link_rate, NULL);
+
+static struct device_attribute *atm_attrs[] = {
+   dev_attr_atmaddress,
+   dev_attr_address,
+   dev_attr_carrier,
+   dev_attr_type,
+   dev_attr_link_rate,
NULL
 };
 
-static int atm_uevent(struct class_device *cdev, struct kobj_uevent_env *env)
+
+static int atm_uevent(struct device *cdev, struct kobj_uevent_env *env)
 {
struct atm_dev *adev;
 
@@ -122,7 +128,7 @@ static int atm_uevent(struct class_device *cdev, struct 
kobj_uevent_env *env)
return 0;
 }
 
-static void atm_release(struct class_device *cdev)
+static void atm_release(struct device *cdev)
 {
struct atm_dev *adev = to_atm_dev(cdev);
 
@@ -131,25 +137,25 @@ static void atm_release(struct class_device *cdev)
 
 static struct class atm_class = {
.name   = atm,
-   .release= atm_release,
-   .uevent = atm_uevent,
+   .dev_release= atm_release,
+   .dev_uevent = atm_uevent,
 };
 
 int atm_register_sysfs(struct atm_dev *adev)
 {
-   struct class_device *cdev = adev-class_dev;
+   struct device *cdev = adev-class_dev;
int i, j, err;
 
cdev-class = atm_class;
-   class_set_devdata(cdev, adev);
+   dev_set_drvdata(cdev, adev);
 
-   snprintf(cdev-class_id, BUS_ID_SIZE, %s%d, adev-type, adev-number);
-   err = class_device_register(cdev);
+   snprintf(cdev-bus_id, BUS_ID_SIZE, %s%d, adev-type, adev-number);
+   err = device_register(cdev);
if (err  0)
return err;
 
for (i = 0; atm_attrs[i]; i++) {
-   err = class_device_create_file(cdev, atm_attrs[i]);
+   err = device_create_file(cdev, atm_attrs[i]);
 

[PATCH 4/5][ATM]: [br2864] routed support

2007-10-27 Thread chas williams - CONTRACTOR
commit fea6b121bcc150fc91186e5012466c91944ce64d
Author: Eric Kinzie [EMAIL PROTECTED]
Date:   Fri Oct 26 08:05:08 2007 -0400

[ATM]: [br2864] routed support

From: Eric Kinzie [EMAIL PROTECTED]
Signed-off-by: Chas Williams [EMAIL PROTECTED]

diff --git a/include/linux/atmbr2684.h b/include/linux/atmbr2684.h
index 969fb6c..ccdab6c 100644
--- a/include/linux/atmbr2684.h
+++ b/include/linux/atmbr2684.h
@@ -14,6 +14,9 @@
 #define BR2684_MEDIA_FDDI  (3)
 #define BR2684_MEDIA_802_6 (4) /* 802.6 */
 
+   /* used only at device creation:  */
+#define BR2684_FLAG_ROUTED (116) /* payload is routed, not bridged */
+
 /*
  * Is there FCS inbound on this VC?  This currently isn't supported.
  */
@@ -36,13 +39,21 @@
 #define BR2684_ENCAPS_AUTODETECT (2)   /* Unsuported */
 
 /*
+ * Is this VC bridged or routed?
+ */
+
+#define BR2684_PAYLOAD_ROUTED   (0)
+#define BR2684_PAYLOAD_BRIDGED  (1)
+
+
+/*
  * This is for the ATM_NEWBACKENDIF call - these are like socket families:
  * the first element of the structure is the backend number and the rest
  * is per-backend specific
  */
 struct atm_newif_br2684 {
atm_backend_t   backend_num;/* ATM_BACKEND_BR2684 */
-   int media;  /* BR2684_MEDIA_* */
+   int media;  /* BR2684_MEDIA_*, flags in upper bits 
*/
charifname[IFNAMSIZ];
int mtu;
 };
@@ -95,6 +106,11 @@ struct br2684_filter_set {
struct br2684_filter filter;
 };
 
+enum br2684_payload {
+p_routed = BR2684_PAYLOAD_ROUTED,
+p_bridged = BR2684_PAYLOAD_BRIDGED,
+};
+
 #define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \
struct br2684_filter_set)
 
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 2096e5c..a3d07c2 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -359,7 +359,7 @@ struct atm_dev {
struct proc_dir_entry *proc_entry; /* proc entry */
char *proc_name;/* proc entry name */
 #endif
-   struct class_device class_dev;  /* sysfs class device */
+   struct device class_dev;/* sysfs device */
struct list_head dev_list;  /* linkage */
 };
 
@@ -461,7 +461,7 @@ static inline void atm_dev_put(struct atm_dev *dev)
BUG_ON(!test_bit(ATM_DF_REMOVED, dev-flags));
if (dev-ops-dev_close)
dev-ops-dev_close(dev);
-   class_device_put(dev-class_dev);
+   put_device(dev-class_dev);
}
 }
 
diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index ba6428f..d9bb2a1 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -1,7 +1,8 @@
 /*
-Experimental ethernet netdevice using ATM AAL5 as underlying carrier
-(RFC1483 obsoleted by RFC2684) for Linux 2.4
-Author: Marcell GAL, 2000, XDSL Ltd, Hungary
+Ethernet netdevice using ATM AAL5 as underlying carrier
+(RFC1483 obsoleted by RFC2684) for Linux
+Authors: Marcell GAL, 2000, XDSL Ltd, Hungary
+ Eric Kinzie, 2006-2007, US Naval Research Laboratory
 */
 
 #include linux/module.h
@@ -39,9 +40,27 @@ static void skb_debug(const struct sk_buff *skb)
 #define skb_debug(skb) do {} while (0)
 #endif
 
+#define BR2684_ETHERTYPE_LEN   2
+#define BR2684_PAD_LEN 2
+
+#define LLC0xaa, 0xaa, 0x03
+#define SNAP_BRIDGED   0x00, 0x80, 0xc2
+#define SNAP_ROUTED0x00, 0x00, 0x00
+#define PID_ETHERNET   0x00, 0x07
+#define ETHERTYPE_IPV4 0x08, 0x00
+#define ETHERTYPE_IPV6 0x86, 0xdd
+#define PAD_BRIDGED0x00, 0x00
+
+static unsigned char ethertype_ipv4[] =
+   { ETHERTYPE_IPV4 };
+static unsigned char ethertype_ipv6[] =
+   { ETHERTYPE_IPV6 };
 static unsigned char llc_oui_pid_pad[] =
-{ 0xAA, 0xAA, 0x03, 0x00, 0x80, 0xC2, 0x00, 0x07, 0x00, 0x00 };
-#define PADLEN (2)
+   { LLC, SNAP_BRIDGED, PID_ETHERNET, PAD_BRIDGED };
+static unsigned char llc_oui_ipv4[] =
+   { LLC, SNAP_ROUTED, ETHERTYPE_IPV4 };
+static unsigned char llc_oui_ipv6[] =
+   { LLC, SNAP_ROUTED, ETHERTYPE_IPV6 };
 
 enum br2684_encaps {
e_vc  = BR2684_ENCAPS_VC,
@@ -69,6 +88,7 @@ struct br2684_dev {
struct list_head brvccs; /* one device = one vcc (before xmas) */
struct net_device_stats stats;
int mac_was_set;
+   enum br2684_payload payload;
 };
 
 /*
@@ -136,6 +156,7 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct 
br2684_dev *brdev,
 {
struct atm_vcc *atmvcc;
int minheadroom = (brvcc-encaps == e_llc) ? 10 : 2;
+
if (skb_headroom(skb)  minheadroom) {
struct sk_buff *skb2 = skb_realloc_headroom(skb, minheadroom);
brvcc-copies_needed++;
@@ -146,11 +167,32 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct 
br2684_dev *brdev,
}
skb = skb2;
}
-   skb_push(skb, minheadroom);
-   if (brvcc-encaps == e_llc)
-   

Re: [PATCH] ucc_geth: add support for netpoll

2007-10-27 Thread Anton Vorontsov
On Sat, Oct 27, 2007 at 05:09:51PM +0400, Sergei Shtylyov wrote:
 Hello.
 
 Anton Vorontsov wrote:
 
  This patch adds netpoll support for the QE UCC Gigabit Ethernet
  driver. The approach is very similar to the gianfar driver.
 
 It's rather contrarywise -- this is standard approach and gianfar with 
 its 
 3 TSEC IRQs has a quite non-standard poll_controller() implementation.

Oh.. well, right -- gianfar a bit more comlex in that regard.

 
  Tested using netconsole.
 
 KGDBoE is considered a better test (I hope you've also tested with it).

At the time of posting it was tested using netconsole only, a few
days later it's was tested using KGDBoE also. So, it works indeed.

  Signed-off-by: Anton Vorontsov [EMAIL PROTECTED]
  diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
  index 18a6f48..06807ce 100644
  --- a/drivers/net/ucc_geth.c
  +++ b/drivers/net/ucc_geth.c
  @@ -3691,6 +3691,22 @@ static irqreturn_t ucc_geth_irq_handler(int irq, 
  void *info)
  return IRQ_HANDLED;
   }
   
  +#ifdef CONFIG_NET_POLL_CONTROLLER
  +/*
  + * Polling 'interrupt' - used by things like netconsole to send skbs
  + * without having to re-enable interrupts. It's not called while
  + * the interrupt routine is executing.
  + */
  +static void ucc_netpoll(struct net_device *dev)
  +{
  +   struct ucc_geth_private *ugeth = netdev_priv(dev);
  +
  +   disable_irq(ugeth-ug_info-uf_info.irq);
  +   ucc_geth_irq_handler(ugeth-ug_info-uf_info.irq, dev);
  +   enable_irq(ugeth-ug_info-uf_info.irq);
 
 Why not make it less complex (for a reader and gcc too :-) ?

Yup, I'm agree here but it's too late. Again. ;-)

This patch already accepted into the -mm (a week or so after the
silence), so.. now I'd rather not bother Andrew with such really
cosmetic changes. But if Jeff would directly apply modfied patch,
I'll send it. ;-)


Anyhow, I'm sincerely appreciate your comments.

Thanks,

-- 
Anton Vorontsov
email: [EMAIL PROTECTED]
backup email: [EMAIL PROTECTED]
irc://irc.freenode.net/bd2
-
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: Files, sockets, and closing

2007-10-27 Thread Andi Kleen

This particular problem has come up many times over the years. So far
the standard strategy has been to ignore it. It's doubtful that the
complexity needed for a fix is worth it.

Workaround at user space level: call shutdown() first instead of close()

-Andi
-
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: [linux-pm] QUESTION: How to fix race between .suspend routine and watchdog timer

2007-10-27 Thread Alan Stern
On Fri, 26 Oct 2007, Maxim Levitsky wrote:

   Looking through the dmfe code, I noticed yet another possible race.
   A race between the .suspend, and a timer that serves both as a watchdog, 
   and link state detector.
   Again I need to prevent it from running during the suspend/resume, but 
   how?
   
   I can use del_timer in .suspend, and mod_timer in .resume, but that 
   doesn't protect against
   race with already running timer.
   I can use del_timer_sync, but it states that it is useless if timer 
   re-enables itself, and I agree with that.
   In dmfe case the timer does re-enable itself.
  
  That comment isn't right.  del_timer_sync works perfectly well even if
  the timer routine re-enables itself, provided it stops doing so after a
  small number of iterations.
 Thanks for the info. but
 Due to the don't access the hardware, while powered-off rule, I must know 
 that the timer isn't running.
 and won't be.
 So what function to use (if possible) to be sure that the timer won't run 
 anymore?
 (Taking in the account the fact that it re-enables itself)

Use del_timer_sync().  It guarantees that when it returns, the timer 
will be stopped and the timer routine will no longer be running on any 
CPU.

Alan Stern

-
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: [linux-pm] QUESTION: How to fix race between .suspend routine and watchdog timer

2007-10-27 Thread Maxim Levitsky
On Saturday 27 October 2007 21:17:55 Alan Stern wrote:
 On Fri, 26 Oct 2007, Maxim Levitsky wrote:
 
Looking through the dmfe code, I noticed yet another possible race.
A race between the .suspend, and a timer that serves both as a 
watchdog, and link state detector.
Again I need to prevent it from running during the suspend/resume, but 
how?

I can use del_timer in .suspend, and mod_timer in .resume, but that 
doesn't protect against
race with already running timer.
I can use del_timer_sync, but it states that it is useless if timer 
re-enables itself, and I agree with that.
In dmfe case the timer does re-enable itself.
   
   That comment isn't right.  del_timer_sync works perfectly well even if
   the timer routine re-enables itself, provided it stops doing so after a
   small number of iterations.
  Thanks for the info. but
  Due to the don't access the hardware, while powered-off rule, I must know 
  that the timer isn't running.
  and won't be.
  So what function to use (if possible) to be sure that the timer won't run 
  anymore?
  (Taking in the account the fact that it re-enables itself)
 
 Use del_timer_sync().  It guarantees that when it returns, the timer 
 will be stopped and the timer routine will no longer be running on any 
 CPU.
 
Even if the timer re-enables itself, are you sure?

 Alan Stern
 
 

Best regards,
Maxim Levitsky
-
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: [linux-pm] QUESTION: How to fix race between .suspend routine and watchdog timer

2007-10-27 Thread Alan Stern
On Sat, 27 Oct 2007, Maxim Levitsky wrote:

  Use del_timer_sync().  It guarantees that when it returns, the timer 
  will be stopped and the timer routine will no longer be running on any 
  CPU.
  
 Even if the timer re-enables itself, are you sure?

Last time I looked at the source code, that's what it did.  I'll look
again...  Yep, it still does.  It checks to see if the timer routine is
currently running; if so then it waits a little while and tries again.

Alan Stern

-
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] proc_fs.h redux

2007-10-27 Thread Joe Perches
On Sat, 2007-10-27 at 23:47 +0400, Alexey Dobriyan wrote:
 Remove proc_fs.h from headers that doesn't really need it.

 --- a/arch/powerpc/kernel/process.c
 +++ b/arch/powerpc/kernel/process.c
 @@ -17,6 +17,7 @@
  #include linux/errno.h
  #include linux/sched.h
  #include linux/kernel.h
 +#include linux/fs.h

Your code doesn't match your patch description.

You've got new includes of:

linux/fs.h
linux/proc_fs.h
linux/err.h
linux/kref.h

and forward declarations of

struct proc_dir_entry;
struct file_operations;

As a general rule, I think it better to use includes
than use naked forward declarations.


-
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 1/5][ATM]: atm is no longer experimental

2007-10-27 Thread David Miller

Sorry Chas, you'll need to submit ATM changes like this within the
merge window just like everyone else.  The merge window for 2.6.24
was open for more than a week, and is now closed.

Please resubmit these during the 2.6.25 merge window.

Thank you.
-
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] Fix/Rewrite of the mipsnet driver

2007-10-27 Thread Thiemo Seufer
Hello All,

currently the mipsnet driver fails after transmitting a number of
packages because SKBs are allocated but never freed. I fixed that
and coudn't refrain from removing the most egregious warts.

- mipsnet.h folded into mipsnet.c, as it doesn't provide any
  useful external interface.
- Free SKB after transmission.
- Call free_irq in mipsnet_close, to balance the request_irq in
  mipsnet_open.
- Removed duplicate read of rxDataCount.
- Some identifiers are now less verbose.
- Removed dead and/or unnecessarily complex code.
- Code formatting fixes.

Tested on Qemu's mipssim emulation, with this patch it can boot a
Debian NFSroot.


Thiemo


Signed-off-by: Thiemo Seufer [EMAIL PROTECTED]
---
diff --git a/drivers/net/mipsnet.c b/drivers/net/mipsnet.c
index 9853c74..28c66c1 100644
--- a/drivers/net/mipsnet.c
+++ b/drivers/net/mipsnet.c
@@ -4,8 +4,6 @@
  * for more details.
  */
 
-#define DEBUG
-
 #include linux/init.h
 #include linux/kernel.h
 #include linux/module.h
@@ -16,11 +14,93 @@
 #include asm/io.h
 #include asm/mips-boards/simint.h
 
-#include mipsnet.h   /* actual device IO mapping */
+#define MIPSNET_VERSION 2007-10-28
+
+/*
+ * Net status/control block as seen by sw in the core.
+ */
+struct MIPS_T_NetControl {
+   /*
+* Device info for probing, reads as MIPSNET%d where %d is some
+* form of version.
+*/
+   uint64_t devId; /*0x00 */
+
+   /*
+* read only busy flag.
+* Set and cleared by the Net Device to indicate that an rx or a tx
+* is in progress.
+*/
+   uint32_t busy;  /*0x08 */
+
+   /*
+* Set by the Net Device.
+* The device will set it once data has been received.
+* The value is the number of bytes that should be read from
+* rxDataBuffer.  The value will decrease till 0 until all the data
+* from rxDataBuffer has been read.
+*/
+   uint32_t rxDataCount;   /*0x0c */
+#define MIPSNET_MAX_RXTX_DATACOUNT (116)
+
+   /*
+* Settable from the MIPS core, cleared by the Net Device.
+* The core should set the number of bytes it wants to send,
+* then it should write those bytes of data to txDataBuffer.
+* The device will clear txDataCount has been processed (not
+* necessarily sent).
+*/
+   uint32_t txDataCount;   /*0x10 */
 
-#define MIPSNET_VERSION 2005-06-20
+   /*
+* Interrupt control
+*
+* Used to clear the interrupted generated by this dev.
+* Write a 1 to clear the interrupt. (except bit31).
+*
+* Bit0 is set if it was a tx-done interrupt.
+* Bit1 is set when new rx-data is available.
+*Until this bit is cleared there will be no other RXs.
+*
+* Bit31 is used for testing, it clears after a read.
+*Writing 1 to this bit will cause an interrupt to be generated.
+*To clear the test interrupt, write 0 to this register.
+*/
+   uint32_t interruptControl;  /*0x14 */
+#define MIPSNET_INTCTL_TXDONE ((uint32_t)(1  0))
+#define MIPSNET_INTCTL_RXDONE ((uint32_t)(1  1))
+#define MIPSNET_INTCTL_TESTBIT((uint32_t)(1  31))
 
-#define mipsnet_reg_address(dev, field) (dev-base_addr + field_offset(field))
+   /*
+* Readonly core-specific interrupt info for the device to signal
+* the core. The meaning of the contents of this field might change.
+*/
+   /* XXX: the whole memIntf interrupt scheme is messy: the device
+* should have no control what so ever of what VPE/register set is
+* being used.
+* The MemIntf should only expose interrupt lines, and something in
+* the config should be responsible for the line-core/vpe bindings.
+*/
+   uint32_t interruptInfo; /*0x18 */
+
+   /*
+* This is where the received data is read out.
+* There is more data to read until rxDataReady is 0.
+* Only 1 byte at this regs offset is used.
+*/
+   uint32_t rxDataBuffer;  /*0x1c */
+
+   /*
+* This is where the data to transmit is written.
+* Data should be written for the amount specified in the
+* txDataCount register.
+* Only 1 byte at this regs offset is used.
+*/
+   uint32_t txDataBuffer;  /*0x20 */
+};
+
+#define regaddr(dev, field) \
+  (dev-base_addr + offsetof(MIPS_T_NetControl, field))
 
 struct mipsnet_priv {
struct net_device_stats stats;
@@ -34,18 +114,13 @@ static char mipsnet_string[] = mipsnet;
 static int ioiocpy_frommipsnet(struct net_device *dev, unsigned char *kdata,
int len)
 {
-   uint32_t available_len = inl(mipsnet_reg_address(dev, rxDataCount));
-   if (available_len  len)
-   return -EFAULT;
+   for (; len  0; len--, kdata++)
+   *kdata = inb(regaddr(dev, rxDataBuffer));
 
-   for (; len  0; len--, kdata++) {
-