Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Kumar Gala


On Feb 8, 2007, at 1:36 AM, Li Yang-r58472 wrote:


-Original Message-
From: Kumar Gala [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 08, 2007 3:16 PM
To: Li Yang-r58472
Cc: Tabi Timur-B04825; netdev@vger.kernel.org; linuxppc- 
[EMAIL PROTECTED]
Subject: Re: [PATCH 1/4] ucc_geth: Change private  
immrbar_virt_to_phys

to generic

iopa


On Feb 8, 2007, at 1:06 AM, Li Yang-r58472 wrote:


MURAM is a mmio region so it don't share the characteristic of

main

memory that phy_addr = virt_addr - PAGE_OFFSET.  While they can
both be
mapped through page table using iopa().


Right, so when do you know if you'll be using MURAM or normal
memory?  Why not just keep around a token that is the physical
address at the point you make the decision of MURAM vs normal

memory.


Yes, that can be a way.  But as the virt to phy mapping is only used
once, it's nothing bad to do it this way.


The problem as I stated before with using iopa() is that its not
supported across platforms.


Yes, it is only for PPC32.  But we don't have another API to do  
it.  How

about make it more generic to add PPC64 version?


Why do you need another API to do this, you already have the  
information you want, its just a matter of you keeping track of it.


- k
-
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/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Li Yang-r58472
> -Original Message-
> From: Kumar Gala [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 08, 2007 3:16 PM
> To: Li Yang-r58472
> Cc: Tabi Timur-B04825; netdev@vger.kernel.org; [EMAIL PROTECTED]
> Subject: Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys
to generic
> iopa
> 
> 
> On Feb 8, 2007, at 1:06 AM, Li Yang-r58472 wrote:
> 
> >>> MURAM is a mmio region so it don't share the characteristic of
main
> >>> memory that phy_addr = virt_addr - PAGE_OFFSET.  While they can
> >>> both be
> >>> mapped through page table using iopa().
> >>
> >> Right, so when do you know if you'll be using MURAM or normal
> >> memory?  Why not just keep around a token that is the physical
> >> address at the point you make the decision of MURAM vs normal
memory.
> >
> > Yes, that can be a way.  But as the virt to phy mapping is only used
> > once, it's nothing bad to do it this way.
> 
> The problem as I stated before with using iopa() is that its not
> supported across platforms.

Yes, it is only for PPC32.  But we don't have another API to do it.  How
about make it more generic to add PPC64 version?

- Leo
-
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] HTB O(1) class lookup

2007-02-07 Thread Jarek Poplawski
On Mon, Feb 05, 2007 at 06:14:13PM +0100, Simon Lodal wrote:
...
> Regards
...

It seems decisions makers need more time, so I'd add 
2 cents more:

1c: an indentation could be improved (spaces around
operators), like in these places:

>+#define HTB_MAX_CLS   (TC_H_MIN(-1)+1)
...
>+  htb_cls_array* a;
...
>+  int cnt,done;

etc.

2c: it is a question of taste, but here:

>   err = -ENOBUFS;
>+  if (q->classes[HTB_CLS_ARRAY(minorid)] == NULL) {
>+  if ((q->classes[HTB_CLS_ARRAY(minorid)] = 
>+   kzalloc(sizeof(htb_cls_array), GFP_KERNEL))
>+  == NULL)
>+  goto failure;
>+  }
>   if ((cl = kzalloc(sizeof(*cl), GFP_KERNEL)) == NULL)
>   goto failure;

it would be probably more readable and a bit merciful
to the stressed system to free this htb_cls_array after
the last error (I know it's not a leak).

Regards,
Jarek P.

PS: 1c extra - it's easier to read a diff if you use -p option. 
-
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/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Kumar Gala


On Feb 8, 2007, at 1:06 AM, Li Yang-r58472 wrote:


MURAM is a mmio region so it don't share the characteristic of main
memory that phy_addr = virt_addr - PAGE_OFFSET.  While they can
both be
mapped through page table using iopa().


Right, so when do you know if you'll be using MURAM or normal
memory?  Why not just keep around a token that is the physical
address at the point you make the decision of MURAM vs normal memory.


Yes, that can be a way.  But as the virt to phy mapping is only used
once, it's nothing bad to do it this way.


The problem as I stated before with using iopa() is that its not  
supported across platforms.


- k
-
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/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Li Yang-r58472
> > If its been mapped with ioremap() you know the physical address
> >>> already
> > so why do you need iopa().
> 
>  That's what the original function immrbar_virt_to_phys() does.
> > We're
> >>> trying to
>  get rid of it, because we thought is redundant with iopa().
> 
>  static inline unsigned long immrbar_virt_to_phys(volatile void *
> >>> address)
>  {
>   if ( ((u32)address >= (u32)qe_immr) &&
>   ((u32)address < ((u32)qe_immr + QE_IMMAP_SIZE))
> >>> )
>   return (unsigned long)(address - (u32)qe_immr +
>   (u32)get_qe_base());
>   return (unsigned long)virt_to_phys(address);
>  }
> 
>  get_qe_base() does a search of the OF tree the first time it's
>  called.
> 
>  Here's the code that calls immrbar_virt_to_phys():
> 
>   out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
>    (u32) immrbar_virt_to_phys(ugeth->
>   p_tx_bd_ring[i]));
> 
> 
>  Would it be better to replace this code with something like this:
> 
>  out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
>   get_qe_base() + ((void *) ugeth->p_tx_bd_ring[i] - (void *)
> >>> qe_immr));
> >>>
> >>> No, we don't know if the BD ring is in MURAM or main memory as it
is
> >>> configurable.  iopa() is best choice to handle both case, IMHO.
> >>
> >> Does MURAM behave differently than normal memory?
> >
> > MURAM is a mmio region so it don't share the characteristic of main
> > memory that phy_addr = virt_addr - PAGE_OFFSET.  While they can
> > both be
> > mapped through page table using iopa().
> 
> Right, so when do you know if you'll be using MURAM or normal
> memory?  Why not just keep around a token that is the physical
> address at the point you make the decision of MURAM vs normal memory.

Yes, that can be a way.  But as the virt to phy mapping is only used
once, it's nothing bad to do it this way.

- Leo
-
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/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Kumar Gala


On Feb 8, 2007, at 12:48 AM, Li Yang-r58472 wrote:


-Original Message-
From: Kumar Gala [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 08, 2007 1:58 PM
To: Li Yang-r58472
Cc: Tabi Timur-B04825; netdev@vger.kernel.org; linuxppc- 
[EMAIL PROTECTED]
Subject: Re: [PATCH 1/4] ucc_geth: Change private  
immrbar_virt_to_phys

to generic

iopa


On Feb 7, 2007, at 11:52 PM, Li Yang-r58472 wrote:


-Original Message-
From: Timur Tabi [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 08, 2007 1:03 AM
To: Kumar Gala
Cc: Li Yang-r58472; netdev@vger.kernel.org; [EMAIL PROTECTED]
Subject: Re: [PATCH 1/4] ucc_geth: Change private
immrbar_virt_to_phys

to generic

iopa

Kumar Gala wrote:


If its been mapped with ioremap() you know the physical address

already

so why do you need iopa().


That's what the original function immrbar_virt_to_phys() does.

We're

trying to

get rid of it, because we thought is redundant with iopa().

static inline unsigned long immrbar_virt_to_phys(volatile void *

address)

{
if ( ((u32)address >= (u32)qe_immr) &&
((u32)address < ((u32)qe_immr + QE_IMMAP_SIZE))

)

return (unsigned long)(address - (u32)qe_immr +
(u32)get_qe_base());
return (unsigned long)virt_to_phys(address);
}

get_qe_base() does a search of the OF tree the first time it's
called.

Here's the code that calls immrbar_virt_to_phys():

out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
 (u32) immrbar_virt_to_phys(ugeth->
p_tx_bd_ring[i]));


Would it be better to replace this code with something like this:

out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
get_qe_base() + ((void *) ugeth->p_tx_bd_ring[i] - (void *)

qe_immr));

No, we don't know if the BD ring is in MURAM or main memory as it is
configurable.  iopa() is best choice to handle both case, IMHO.


Does MURAM behave differently than normal memory?


MURAM is a mmio region so it don't share the characteristic of main
memory that phy_addr = virt_addr - PAGE_OFFSET.  While they can  
both be

mapped through page table using iopa().


Right, so when do you know if you'll be using MURAM or normal  
memory?  Why not just keep around a token that is the physical  
address at the point you make the decision of MURAM vs normal memory.


- k
-
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/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Li Yang-r58472
> -Original Message-
> From: Kumar Gala [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 08, 2007 1:58 PM
> To: Li Yang-r58472
> Cc: Tabi Timur-B04825; netdev@vger.kernel.org; [EMAIL PROTECTED]
> Subject: Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys
to generic
> iopa
> 
> 
> On Feb 7, 2007, at 11:52 PM, Li Yang-r58472 wrote:
> 
> >> -Original Message-
> >> From: Timur Tabi [mailto:[EMAIL PROTECTED]
> >> Sent: Thursday, February 08, 2007 1:03 AM
> >> To: Kumar Gala
> >> Cc: Li Yang-r58472; netdev@vger.kernel.org; [EMAIL PROTECTED]
> >> Subject: Re: [PATCH 1/4] ucc_geth: Change private
> >> immrbar_virt_to_phys
> > to generic
> >> iopa
> >>
> >> Kumar Gala wrote:
> >>
> >>> If its been mapped with ioremap() you know the physical address
> > already
> >>> so why do you need iopa().
> >>
> >> That's what the original function immrbar_virt_to_phys() does.
We're
> > trying to
> >> get rid of it, because we thought is redundant with iopa().
> >>
> >> static inline unsigned long immrbar_virt_to_phys(volatile void *
> > address)
> >> {
> >>if ( ((u32)address >= (u32)qe_immr) &&
> >>((u32)address < ((u32)qe_immr + QE_IMMAP_SIZE))
> > )
> >>return (unsigned long)(address - (u32)qe_immr +
> >>(u32)get_qe_base());
> >>return (unsigned long)virt_to_phys(address);
> >> }
> >>
> >> get_qe_base() does a search of the OF tree the first time it's
> >> called.
> >>
> >> Here's the code that calls immrbar_virt_to_phys():
> >>
> >>out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
> >> (u32) immrbar_virt_to_phys(ugeth->
> >>p_tx_bd_ring[i]));
> >>
> >>
> >> Would it be better to replace this code with something like this:
> >>
> >> out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
> >>get_qe_base() + ((void *) ugeth->p_tx_bd_ring[i] - (void *)
> > qe_immr));
> >
> > No, we don't know if the BD ring is in MURAM or main memory as it is
> > configurable.  iopa() is best choice to handle both case, IMHO.
> 
> Does MURAM behave differently than normal memory?

MURAM is a mmio region so it don't share the characteristic of main
memory that phy_addr = virt_addr - PAGE_OFFSET.  While they can both be
mapped through page table using iopa().

- Leo
-
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/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Kumar Gala


On Feb 7, 2007, at 11:52 PM, Li Yang-r58472 wrote:


-Original Message-
From: Timur Tabi [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 08, 2007 1:03 AM
To: Kumar Gala
Cc: Li Yang-r58472; netdev@vger.kernel.org; [EMAIL PROTECTED]
Subject: Re: [PATCH 1/4] ucc_geth: Change private  
immrbar_virt_to_phys

to generic

iopa

Kumar Gala wrote:


If its been mapped with ioremap() you know the physical address

already

so why do you need iopa().


That's what the original function immrbar_virt_to_phys() does.  We're

trying to

get rid of it, because we thought is redundant with iopa().

static inline unsigned long immrbar_virt_to_phys(volatile void *

address)

{
if ( ((u32)address >= (u32)qe_immr) &&
((u32)address < ((u32)qe_immr + QE_IMMAP_SIZE))

)

return (unsigned long)(address - (u32)qe_immr +
(u32)get_qe_base());
return (unsigned long)virt_to_phys(address);
}

get_qe_base() does a search of the OF tree the first time it's  
called.


Here's the code that calls immrbar_virt_to_phys():

out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
 (u32) immrbar_virt_to_phys(ugeth->
p_tx_bd_ring[i]));


Would it be better to replace this code with something like this:

out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
get_qe_base() + ((void *) ugeth->p_tx_bd_ring[i] - (void *)

qe_immr));

No, we don't know if the BD ring is in MURAM or main memory as it is
configurable.  iopa() is best choice to handle both case, IMHO.


Does MURAM behave differently than normal memory?

- k
-
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/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Li Yang-r58472
> -Original Message-
> From: Timur Tabi [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 08, 2007 1:03 AM
> To: Kumar Gala
> Cc: Li Yang-r58472; netdev@vger.kernel.org; [EMAIL PROTECTED]
> Subject: Re: [PATCH 1/4] ucc_geth: Change private immrbar_virt_to_phys
to generic
> iopa
> 
> Kumar Gala wrote:
> 
> > If its been mapped with ioremap() you know the physical address
already
> > so why do you need iopa().
> 
> That's what the original function immrbar_virt_to_phys() does.  We're
trying to
> get rid of it, because we thought is redundant with iopa().
> 
> static inline unsigned long immrbar_virt_to_phys(volatile void *
address)
> {
>   if ( ((u32)address >= (u32)qe_immr) &&
>   ((u32)address < ((u32)qe_immr + QE_IMMAP_SIZE))
)
>   return (unsigned long)(address - (u32)qe_immr +
>   (u32)get_qe_base());
>   return (unsigned long)virt_to_phys(address);
> }
> 
> get_qe_base() does a search of the OF tree the first time it's called.
> 
> Here's the code that calls immrbar_virt_to_phys():
> 
>   out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
>(u32) immrbar_virt_to_phys(ugeth->
>   p_tx_bd_ring[i]));
> 
> 
> Would it be better to replace this code with something like this:
> 
> out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
>   get_qe_base() + ((void *) ugeth->p_tx_bd_ring[i] - (void *)
qe_immr));

No, we don't know if the BD ring is in MURAM or main memory as it is
configurable.  iopa() is best choice to handle both case, IMHO.

- Leo
-
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] phy layer: add kernel-doc + DocBook

2007-02-07 Thread Randy Dunlap
From: Randy Dunlap <[EMAIL PROTECTED]>

Convert function documentation in drivers/net/phy/ to kernel-doc
and add it to DocBook.

Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]>
---
 Documentation/DocBook/kernel-api.tmpl |6 +
 drivers/net/phy/mdio_bus.c|   19 ++-
 drivers/net/phy/phy.c |  192 --
 drivers/net/phy/phy_device.c  |  114 +---
 4 files changed, 234 insertions(+), 97 deletions(-)

--- linux-2620-work.orig/drivers/net/phy/mdio_bus.c
+++ linux-2620-work/drivers/net/phy/mdio_bus.c
@@ -36,10 +36,14 @@
 #include 
 #include 
 
-/* mdiobus_register 
+/**
+ * mdiobus_register - bring up all the PHYs on a given bus and attach them to 
bus
+ * @bus: target mii_bus
  *
- * description: Called by a bus driver to bring up all the PHYs
- *   on a given bus, and attach them to the bus
+ * Description: Called by a bus driver to bring up all the PHYs
+ *   on a given bus, and attach them to the bus.
+ *
+ * Returns 0 on success or < 0 on error.
  */
 int mdiobus_register(struct mii_bus *bus)
 {
@@ -115,10 +119,13 @@ void mdiobus_unregister(struct mii_bus *
 }
 EXPORT_SYMBOL(mdiobus_unregister);
 
-/* mdio_bus_match
+/**
+ * mdio_bus_match - determine if given PHY driver supports the given PHY device
+ * @dev: target PHY device
+ * @drv: given PHY driver
  *
- * description: Given a PHY device, and a PHY driver, return 1 if
- *   the driver supports the device.  Otherwise, return 0
+ * Description: Given a PHY device, and a PHY driver, return 1 if
+ *   the driver supports the device.  Otherwise, return 0.
  */
 static int mdio_bus_match(struct device *dev, struct device_driver *drv)
 {
--- linux-2620-work.orig/drivers/net/phy/phy.c
+++ linux-2620-work/drivers/net/phy/phy.c
@@ -40,7 +40,9 @@
 #include 
 #include 
 
-/* Convenience function to print out the current phy status
+/**
+ * phy_print_status - Convenience function to print out the current phy status
+ * @phydev: the phy_device struct
  */
 void phy_print_status(struct phy_device *phydev)
 {
@@ -56,10 +58,15 @@ void phy_print_status(struct phy_device 
 EXPORT_SYMBOL(phy_print_status);
 
 
-/* Convenience functions for reading/writing a given PHY
- * register. They MUST NOT be called from interrupt context,
+/**
+ * phy_read - Convenience function for reading a given PHY register
+ * @phydev: the phy_device struct
+ * @regnum: register number to read
+ *
+ * NOTE: MUST NOT be called from interrupt context,
  * because the bus read/write functions may wait for an interrupt
- * to conclude the operation. */
+ * to conclude the operation.
+ */
 int phy_read(struct phy_device *phydev, u16 regnum)
 {
int retval;
@@ -73,6 +80,16 @@ int phy_read(struct phy_device *phydev, 
 }
 EXPORT_SYMBOL(phy_read);
 
+/**
+ * phy_write - Convenience function for writing a given PHY register
+ * @phydev: the phy_device struct
+ * @regnum: register number to write
+ * @val: value to write to @regnum
+ *
+ * NOTE: MUST NOT be called from interrupt context,
+ * because the bus read/write functions may wait for an interrupt
+ * to conclude the operation.
+ */
 int phy_write(struct phy_device *phydev, u16 regnum, u16 val)
 {
int err;
@@ -86,7 +103,15 @@ int phy_write(struct phy_device *phydev,
 }
 EXPORT_SYMBOL(phy_write);
 
-
+/**
+ * phy_clear_interrupt - Ack the phy device's interrupt
+ * @phydev: the phy_device struct
+ *
+ * If the @phydev driver has an ack_interrupt function, call it to
+ * ack and clear the phy device's interrupt.
+ *
+ * Returns 0 on success on < 0 on error.
+ */
 int phy_clear_interrupt(struct phy_device *phydev)
 {
int err = 0;
@@ -97,7 +122,13 @@ int phy_clear_interrupt(struct phy_devic
return err;
 }
 
-
+/**
+ * phy_config_interrupt - configure the PHY device for the requested interrupts
+ * @phydev: the phy_device struct
+ * @interrupts: interrupt flags to configure for this @phydev
+ *
+ * Returns 0 on success on < 0 on error.
+ */
 int phy_config_interrupt(struct phy_device *phydev, u32 interrupts)
 {
int err = 0;
@@ -110,9 +141,11 @@ int phy_config_interrupt(struct phy_devi
 }
 
 
-/* phy_aneg_done
+/**
+ * phy_aneg_done - return auto-negotiation status
+ * @phydev: target phy_device struct
  *
- * description: Reads the status register and returns 0 either if
+ * Description: Reads the status register and returns 0 either if
  *   auto-negotiation is incomplete, or if there was an error.
  *   Returns BMSR_ANEGCOMPLETE if auto-negotiation is done.
  */
@@ -174,9 +207,12 @@ static const struct phy_setting settings
 
 #define MAX_NUM_SETTINGS (sizeof(settings)/sizeof(struct phy_setting))
 
-/* phy_find_setting
+/**
+ * phy_find_setting - find a PHY settings array entry that matches speed & 
duplex
+ * @speed: speed to match
+ * @duplex: duplex to match
  *
- * description: Searches the settings array for the setting which
+ * Description: Searches the settings array for the setting which
  *   matches the desired speed and dup

Re: forcedeth problems on 2.6.20-rc6-mm3

2007-02-07 Thread Andrew Morton
On Mon, 5 Feb 2007 16:52:24 -0800 Andrew Morton <[EMAIL PROTECTED]> wrote:

> On Mon, 05 Feb 2007 18:35:06 -0600
> Robert Hancock <[EMAIL PROTECTED]> wrote:
> 
> > Daniel Barkalow wrote:
> > > On Sun, 4 Feb 2007, Robert Hancock wrote:
> > > 
> > >> Something's busted with forcedeth in 2.6.20-rc6-mm3 for me relative to
> > >> 2.6.20-rc6. There's no errors in dmesg, but it seems no packets ever get
> > >> received and so the machine can't get an IP address. I tried reverting 
> > >> all the
> > >> -mm changes to drivers/net/forcedeth.c, which didn't help. The network
> > >> controller shares an IRQ with the USB OHCI controller which is receiving
> > >> interrupts, so it doesn't seem like an interrupt routing problem, though 
> > >> I
> > >> suppose something wierd could be happening there.
> > > 
> > > IIRC, forcedeth tries to use MSI by default. Perhaps the hardware is 
> > > using 
> > > it, but the kernel thinks enabling it didn't work? I think there's a 
> > > module option for forcedeth to disable MSI, which might be worth a try to 
> > > see if it has any effect.
> > 
> > I must have messed something up when testing before - reverting to 
> > forcedeth.c from 2.6.20-rc6 does indeed fix the problem. And it doesn't 
> > seem like no packets at all are received with the -mm3 version (driver 
> > version 0.60), either - if I do a tcpdump I can get Ethernet packets 
> > showing up, but I can't ping my router so it seems like something isn't 
> > getting through properly. With the 2.6.20-rc6 version (driver version 
> > 0.59) it works fine. I switched back and forth between versions and this 
> > seems repeatable.
> > 
> > I don't think it's MSI related, the CK804 version of these controllers 
> > doesn't support MSI and the driver shouldn't be trying to use it. I 
> > tried the MSI and MSI-X disable options on the 0.60 driver, but that 
> > didn't help.
> > 
> 
> OK, thanks.  Jeff, please note that the forcedeth changes in git-netdev-all
> have a problem.

Well all the forcedeth patches seems to have wandered into mainline anyway.

Please test current git (or tomorrow's git snapshot), see if it works?
-
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] sk98lin: planned removal

2007-02-07 Thread Andrew Morton
On Wed, 7 Feb 2007 09:18:30 -0800 Stephen Hemminger <[EMAIL PROTECTED]> wrote:

> Document planned removal of sk98lin driver.
> 
> Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
> ---
>  Documentation/feature-removal-schedule.txt |7 +++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/Documentation/feature-removal-schedule.txt 
> b/Documentation/feature-removal-schedule.txt
> index 0ba6af0..d08a4af 100644
> --- a/Documentation/feature-removal-schedule.txt
> +++ b/Documentation/feature-removal-schedule.txt
> @@ -325,3 +325,10 @@ Why: Unmaintained for years, superceded 
>  Who: Jeff Garzik <[EMAIL PROTECTED]>
>  
>  ---
> +
> +What:   sk98lin network driver
> +When:   July 2007
> +Why:In kernel tree version of driver is unmaintained. Sk98lin driver
> + replaced by the skge driver. 
> +Who:Stephen Hemminger <[EMAIL PROTECTED]>
> +

People don't read that file.  I'd suggest the addition of a warning printk
to the driver's open() method.
-
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] spidernet : fix memory leak in spider_net_stop

2007-02-07 Thread Ishizaki Kou
Jeff-san,

> Jens Osterkamp wrote:
> > We forget to call spider_net_free_rx_chain_contents which does the
> > actual dev_kfree_skb. New skbs are allocated from skbuff_head_cache
> > on each "ifconfig up" letting the cache grow infinitely.
> > 
> > This patch fixes it.
> > 
> > Signed-off-by: Jens Osterkamp <[EMAIL PROTECTED]>
> 
> applied

This fix was applied twice to netdev-2.6.git#upstream.
Because Linas-san's patch has been applied to netdev-2.6.git#upstream.

Best regards,
Kou Ishizaki
-
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 (4/5)] [PFKEYV2]: Extension for dynamic update of endpoint address(es)

2007-02-07 Thread Shinta Sugimoto
Extend PF_KEYv2 framework so that user application can take advantage
of MIGRATE feature via PF_KEYv2 interface. User application can either
send or receive an MIGRATE message to/from PF_KEY socket.

Detail information can be found in the internet-draft
.

Signed-off-by: Shinta Sugimoto <[EMAIL PROTECTED]>
Signed-off-by: Masahide NAKAMURA <[EMAIL PROTECTED]>
Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
---
 include/linux/pfkeyv2.h |3 
 net/key/af_key.c|  422 +++
 2 files changed, 424 insertions(+), 1 deletions(-)

diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h
index 265bafa..26a518b 100644
--- a/include/linux/pfkeyv2.h
+++ b/include/linux/pfkeyv2.h
@@ -251,7 +251,8 @@ #define SADB_X_SPDSETIDX20
 #define SADB_X_SPDEXPIRE   21
 #define SADB_X_SPDDELETE2  22
 #define SADB_X_NAT_T_NEW_MAPPING   23
-#define SADB_MAX   23
+#define SADB_X_MIGRATE 24
+#define SADB_MAX   24
 
 /* Security Association flags */
 #define SADB_SAFLAGS_PFS   1
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 5dd5094..88d08f2 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -2345,6 +2345,196 @@ out:
return err;
 }
 
+#ifdef CONFIG_NET_KEY_MIGRATE
+static int pfkey_sockaddr_pair_size(sa_family_t family)
+{
+   switch (family) {
+   case AF_INET:
+   return PFKEY_ALIGN8(sizeof(struct sockaddr_in) * 2);
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+   case AF_INET6:
+   return PFKEY_ALIGN8(sizeof(struct sockaddr_in6) * 2);
+#endif
+   default:
+   return 0;
+   }
+   /* NOTREACHED */
+}
+
+static int parse_sockaddr_pair(struct sadb_x_ipsecrequest *rq,
+  xfrm_address_t *saddr, xfrm_address_t *daddr,
+  u16 *family)
+{
+   struct sockaddr *sa = (struct sockaddr *)(rq + 1);
+   if (rq->sadb_x_ipsecrequest_len <
+   pfkey_sockaddr_pair_size(sa->sa_family))
+   return -EINVAL;
+
+   switch (sa->sa_family) {
+   case AF_INET:
+   {
+   struct sockaddr_in *sin;
+   sin = (struct sockaddr_in *)sa;
+   if ((sin+1)->sin_family != AF_INET)
+   return -EINVAL;
+   memcpy(&saddr->a4, &sin->sin_addr, sizeof(saddr->a4));
+   sin++;
+   memcpy(&daddr->a4, &sin->sin_addr, sizeof(daddr->a4));
+   *family = AF_INET;
+   break;
+   }
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+   case AF_INET6:
+   {
+   struct sockaddr_in6 *sin6;
+   sin6 = (struct sockaddr_in6 *)sa;
+   if ((sin6+1)->sin6_family != AF_INET6)
+   return -EINVAL;
+   memcpy(&saddr->a6, &sin6->sin6_addr,
+  sizeof(saddr->a6));
+   sin6++;
+   memcpy(&daddr->a6, &sin6->sin6_addr,
+  sizeof(daddr->a6));
+   *family = AF_INET6;
+   break;
+   }
+#endif
+   default:
+   return -EINVAL;
+   }
+
+   return 0;
+}
+
+static int ipsecrequests_to_migrate(struct sadb_x_ipsecrequest *rq1, int len,
+   struct xfrm_migrate *m)
+{
+   int err;
+   struct sadb_x_ipsecrequest *rq2;
+
+   if (len <= sizeof(struct sadb_x_ipsecrequest) ||
+   len < rq1->sadb_x_ipsecrequest_len)
+   return -EINVAL;
+
+   /* old endoints */
+   err = parse_sockaddr_pair(rq1, &m->old_saddr, &m->old_daddr,
+ &m->old_family);
+   if (err)
+   return err;
+
+   rq2 = (struct sadb_x_ipsecrequest *)((u8 *)rq1 + 
rq1->sadb_x_ipsecrequest_len);
+   len -= rq1->sadb_x_ipsecrequest_len;
+
+   if (len <= sizeof(struct sadb_x_ipsecrequest) ||
+   len < rq2->sadb_x_ipsecrequest_len)
+   return -EINVAL;
+
+   /* new endpoints */
+   err = parse_sockaddr_pair(rq2, &m->new_saddr, &m->new_daddr,
+ &m->new_family);
+   if (err)
+   return err;
+
+   if (rq1->sadb_x_ipsecrequest_proto != rq2->sadb_x_ipsecrequest_proto ||
+   rq1->sadb_x_ipsecrequest_mode != rq2->sadb_x_ipsecrequest_mode ||
+   rq1->sadb_x_ipsecrequest_reqid != rq2->sadb_x_ipsecrequest_reqid)
+   return -EINVAL;
+
+   m->proto = rq1->sadb_x_ipsecrequest_proto;
+   m->mode = rq1->sadb_x_ipsecrequest_mode - 1;
+   m->reqid = rq1->sadb_x_ipsecrequest_reqid;
+
+   return ((int)(rq1->sadb_x_ipsecrequest_len +
+ rq2->sadb_x_ipsecrequest_len));
+}
+
+static int pfkey_migrate(struct sock *sk, struct

[PATCH (5/5)] [PFKEYV2]: CONFIG_NET_KEY_MIGRATE option

2007-02-07 Thread Shinta Sugimoto
Add CONFIG_NET_KEY_MIGRATE option which makes it possible for user
application to send or receive MIGRATE message to/from PF_KEY socket.

Signed-off-by: Shinta Sugimoto <[EMAIL PROTECTED]>
Signed-off-by: Masahide NAKAMURA <[EMAIL PROTECTED]>
Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
---
 net/xfrm/Kconfig |   15 +++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/net/xfrm/Kconfig b/net/xfrm/Kconfig
index d385a78..577a4f8 100644
--- a/net/xfrm/Kconfig
+++ b/net/xfrm/Kconfig
@@ -45,4 +45,19 @@ config NET_KEY
 
  Say Y unless you know what you are doing.
 
+config NET_KEY_MIGRATE
+   bool "PF_KEY MIGRATE (EXPERIMENTAL)"
+   depends on NET_KEY && EXPERIMENTAL
+   select XFRM_MIGRATE
+   ---help---
+ Add a PF_KEY MIGRATE message to PF_KEYv2 socket family.
+ The PF_KEY MIGRATE message is used to dynamically update
+ locator(s) of a given IPsec security association.
+ This feature is required, for instance, in a Mobile IPv6
+ environment with IPsec configuration where mobile nodes
+ change their attachment point to the Internet.  Detail
+ information can be found in the internet-draft
+ .
+
+ If unsure, say N.
 
-- 
1.4.2


-
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)] [XFRM]: CONFIG_XFRM_MIGRATE option

2007-02-07 Thread Shinta Sugimoto
Add CONFIG_XFRM_MIGRATE option which makes it possible for for user
application to send or receive MIGRATE message to/from netlink socket.

Signed-off-by: Shinta Sugimoto <[EMAIL PROTECTED]>
Signed-off-by: Masahide NAKAMURA <[EMAIL PROTECTED]>
Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
---
 net/xfrm/Kconfig |   11 +++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/net/xfrm/Kconfig b/net/xfrm/Kconfig
index 0faab63..d385a78 100644
--- a/net/xfrm/Kconfig
+++ b/net/xfrm/Kconfig
@@ -24,6 +24,17 @@ config XFRM_SUB_POLICY
 
  If unsure, say N.
 
+config XFRM_MIGRATE
+   bool "Transformation migrate database (EXPERIMENTAL)"
+   depends on XFRM && EXPERIMENTAL
+   ---help---
+ A feature to update locator(s) of a given IPsec security
+ association dynamically.  This feature is required, for
+ instance, in a Mobile IPv6 environment with IPsec configuration
+ where mobile nodes change their attachment point to the Internet.
+
+ If unsure, say N.
+
 config NET_KEY
tristate "PF_KEY sockets"
select XFRM
-- 
1.4.2


-
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)] [XFRM]: User interface for handling XFRM_MSG_MIGRATE

2007-02-07 Thread Shinta Sugimoto
Add user interface for handling XFRM_MSG_MIGRATE. The message is issued
by user application. When kernel receives the message, procedure of
updating XFRM databases will take place.

Signed-off-by: Shinta Sugimoto <[EMAIL PROTECTED]>
Signed-off-by: Masahide NAKAMURA <[EMAIL PROTECTED]>
Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
---
 net/xfrm/xfrm_user.c |  173 ++
 1 files changed, 173 insertions(+), 0 deletions(-)

diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 82f36d3..2484a3d 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -1632,6 +1632,176 @@ static int xfrm_add_acquire(struct sk_bu
return 0;
 }
 
+#ifdef CONFIG_XFRM_MIGRATE
+static int verify_user_migrate(struct rtattr **xfrma)
+{
+   struct rtattr *rt = xfrma[XFRMA_MIGRATE-1];
+   struct xfrm_user_migrate *um;
+
+   if (!rt)
+   return -EINVAL;
+
+   if ((rt->rta_len - sizeof(*rt)) < sizeof(*um))
+   return -EINVAL;
+
+   return 0;
+}
+
+static int copy_from_user_migrate(struct xfrm_migrate *ma,
+ struct rtattr **xfrma, int *num)
+{
+   struct rtattr *rt = xfrma[XFRMA_MIGRATE-1];
+   struct xfrm_user_migrate *um;
+   int i, num_migrate;
+
+   um = RTA_DATA(rt);
+   num_migrate = (rt->rta_len - sizeof(*rt)) / sizeof(*um);
+
+   if (num_migrate <= 0 || num_migrate > XFRM_MAX_DEPTH)
+   return -EINVAL;
+
+   for (i = 0; i < num_migrate; i++, um++, ma++) {
+   memcpy(&ma->old_daddr, &um->old_daddr, sizeof(ma->old_daddr));
+   memcpy(&ma->old_saddr, &um->old_saddr, sizeof(ma->old_saddr));
+   memcpy(&ma->new_daddr, &um->new_daddr, sizeof(ma->new_daddr));
+   memcpy(&ma->new_saddr, &um->new_saddr, sizeof(ma->new_saddr));
+
+   ma->proto = um->proto;
+   ma->mode = um->mode;
+   ma->reqid = um->reqid;
+   
+   ma->old_family = um->old_family;
+   ma->new_family = um->new_family;
+   }
+
+   *num = i;
+   return 0;
+}
+
+static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh,
+  struct rtattr **xfrma)
+{
+   struct xfrm_userpolicy_id *pi = NLMSG_DATA(nlh);
+   struct xfrm_migrate m[XFRM_MAX_DEPTH];
+   u8 type;
+   int err;
+   int n = 0;
+
+   err = verify_user_migrate((struct rtattr **)xfrma);
+   if (err)
+   return err;
+
+   err = copy_from_user_policy_type(&type, (struct rtattr **)xfrma);
+   if (err)
+   return err;
+
+   err = copy_from_user_migrate((struct xfrm_migrate *)m,
+(struct rtattr **)xfrma, &n);
+   if (err)
+   return err;
+
+   if (!n)
+   return 0;
+
+   xfrm_migrate(&pi->sel, pi->dir, type, m, n);
+
+   return 0;
+}
+#else
+static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh,
+  struct rtattr **xfrma)
+{
+   return -ENOPROTOOPT;
+}
+#endif
+
+#ifdef CONFIG_XFRM_MIGRATE
+static int copy_to_user_migrate(struct xfrm_migrate *m, struct sk_buff *skb)
+{
+   struct xfrm_user_migrate um;
+
+   memset(&um, 0, sizeof(um));
+   um.proto = m->proto;
+   um.mode = m->mode;
+   um.reqid = m->reqid;
+   um.old_family = m->old_family;
+   memcpy(&um.old_daddr, &m->old_daddr, sizeof(um.old_daddr));
+   memcpy(&um.old_saddr, &m->old_saddr, sizeof(um.old_saddr));
+   um.new_family = m->new_family;
+   memcpy(&um.new_daddr, &m->new_daddr, sizeof(um.new_daddr));
+   memcpy(&um.new_saddr, &m->new_saddr, sizeof(um.new_saddr));
+
+   RTA_PUT(skb, XFRMA_MIGRATE, sizeof(um), &um);
+   return 0;
+
+rtattr_failure:
+   return -1;
+}
+
+static int build_migrate(struct sk_buff *skb, struct xfrm_migrate *m,
+int num_migrate, struct xfrm_selector *sel,
+u8 dir, u8 type)
+{
+   struct xfrm_migrate *mp;
+   struct xfrm_userpolicy_id *pol_id;
+   struct nlmsghdr *nlh;
+   unsigned char *b = skb->tail;
+   int i;
+
+   nlh = NLMSG_PUT(skb, 0, 0, XFRM_MSG_MIGRATE, sizeof(*pol_id));
+   pol_id = NLMSG_DATA(nlh);
+   nlh->nlmsg_flags = 0;
+
+   /* copy data from selector, dir, and type to the pol_id */
+   memset(pol_id, 0, sizeof(*pol_id));
+   memcpy(&pol_id->sel, sel, sizeof(pol_id->sel));
+   pol_id->dir = dir;
+
+   if (copy_to_user_policy_type(type, skb) < 0)
+   goto nlmsg_failure;
+
+   for (i = 0, mp = m ; i < num_migrate; i++, mp++) {
+   if (copy_to_user_migrate(mp, skb) < 0)
+   goto nlmsg_failure;
+   }
+
+   nlh->nlmsg_len = skb->tail - b;
+   return skb->len;
+nlmsg_failure:
+   skb_trim(skb, b - skb->data);
+   return -1;
+}
+
+static int xfrm_send_migrate(struct xfrm_selector *sel,

[PATCH 0/5] [XFRM,PFKEYV2]: MIGRATE support (take 3)

2007-02-07 Thread Shinta Sugimoto
Hello,

Let me re-post a patch set for MIGRATE support for XFRM/PFKEYv2.

The patch set consists of following 5 patches:

[PATCH (1/5)] [XFRM]: Extension for dynamic update of endpoint address(es)
[PATCH (2/5)] [XFRM]: User interface for handling XFRM_MSG_MIGRATE
[PATCH (3/5)] [XFRM]: CONFIG_XFRM_MIGRATE option
[PATCH (4/5)] [PFKEYV2]: Extension for dynamic update of endpoint address(es)
[PATCH (5/5)] [PFKEYV2]: CONFIG_NET_KEY_MIGRATE option

And it can also be fetched by git from following repository with
branch name "migrate-take3".

git://git.linux-ipv6.org/gitroot/shinta/net-2.6.21-migrate.git

Regards,
Shinta


-
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)] [XFRM]: Extension for dynamic update of endpoint address(es)

2007-02-07 Thread Shinta Sugimoto
Extend the XFRM framework so that endpoint address(es) in the XFRM
databases could be dynamically updated according to a request (MIGRATE
message) from user application. Target XFRM policy is first identified
by the selector in the MIGRATE message. Next, the endpoint addresses
of the matching templates and XFRM states are updated according to
the MIGRATE message.

Signed-off-by: Shinta Sugimoto <[EMAIL PROTECTED]>
Signed-off-by: Masahide NAKAMURA <[EMAIL PROTECTED]>
Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
---
 include/linux/xfrm.h   |   19 
 include/net/xfrm.h |   44 +
 net/xfrm/xfrm_policy.c |  230 
 net/xfrm/xfrm_state.c  |  174 
 4 files changed, 467 insertions(+), 0 deletions(-)

diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 9529ea1..15ca89e 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -178,6 +178,9 @@ #define XFRM_MSG_GETAE XFRM_MSG_GETAE
XFRM_MSG_REPORT,
 #define XFRM_MSG_REPORT XFRM_MSG_REPORT
 
+   XFRM_MSG_MIGRATE,
+#define XFRM_MSG_MIGRATE XFRM_MSG_MIGRATE
+
__XFRM_MSG_MAX
 };
 #define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)
@@ -256,6 +259,7 @@ enum xfrm_attr_type_t {
XFRMA_COADDR,   /* xfrm_address_t */
XFRMA_LASTUSED,
XFRMA_POLICY_TYPE,  /* struct xfrm_userpolicy_type */
+   XFRMA_MIGRATE,
__XFRMA_MAX
 
 #define XFRMA_MAX (__XFRMA_MAX - 1)
@@ -351,6 +355,19 @@ struct xfrm_user_report {
struct xfrm_selectorsel;
 };
 
+struct xfrm_user_migrate {
+   xfrm_address_t  old_daddr;
+   xfrm_address_t  old_saddr;
+   xfrm_address_t  new_daddr;
+   xfrm_address_t  new_saddr;
+   __u8proto;
+   __u8mode;
+   __u16   reserved;
+   __u32   reqid;
+   __u16   old_family;
+   __u16   new_family;
+};
+
 #ifndef __KERNEL__
 /* backwards compatibility for userspace */
 #define XFRMGRP_ACQUIRE1
@@ -375,6 +392,8 @@ #define XFRMNLGRP_POLICYXFRMNLGRP_POLIC
 #define XFRMNLGRP_AEVENTS  XFRMNLGRP_AEVENTS
XFRMNLGRP_REPORT,
 #define XFRMNLGRP_REPORT   XFRMNLGRP_REPORT
+   XFRMNLGRP_MIGRATE,
+#define XFRMNLGRP_MIGRATE  XFRMNLGRP_MIGRATE
__XFRMNLGRP_MAX
 };
 #define XFRMNLGRP_MAX  (__XFRMNLGRP_MAX - 1)
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index e476541..e125efe 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -359,6 +359,19 @@ struct xfrm_policy
struct xfrm_tmplxfrm_vec[XFRM_MAX_DEPTH];
 };
 
+struct xfrm_migrate {
+   xfrm_address_t  old_daddr;
+   xfrm_address_t  old_saddr;
+   xfrm_address_t  new_daddr;
+   xfrm_address_t  new_saddr;
+   u8  proto;
+   u8  mode;
+   u16 reserved;
+   u32 reqid;
+   u16 old_family;
+   u16 new_family;
+};
+
 #define XFRM_KM_TIMEOUT30
 /* which seqno */
 #define XFRM_REPLAY_SEQ1
@@ -385,6 +398,7 @@ struct xfrm_mgr
int (*new_mapping)(struct xfrm_state *x, 
xfrm_address_t *ipaddr, __be16 sport);
int (*notify_policy)(struct xfrm_policy *x, int 
dir, struct km_event *c);
int (*report)(u8 proto, struct xfrm_selector *sel, 
xfrm_address_t *addr);
+   int (*migrate)(struct xfrm_selector *sel, u8 dir, 
u8 type, struct xfrm_migrate *m, int num_bundles);
 };
 
 extern int xfrm_register_km(struct xfrm_mgr *km);
@@ -985,6 +999,16 @@ extern int xfrm_bundle_ok(struct xfrm_po
  struct flowi *fl, int family, int strict);
 extern void xfrm_init_pmtu(struct dst_entry *dst);
 
+#ifdef CONFIG_XFRM_MIGRATE
+extern int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
+ struct xfrm_migrate *m, int num_bundles);
+extern struct xfrm_state * xfrm_migrate_state_find(struct xfrm_migrate *m);
+extern struct xfrm_state * xfrm_state_migrate(struct xfrm_state *x,
+ struct xfrm_migrate *m);
+extern int xfrm_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
+   struct xfrm_migrate *m, int num_bundles);
+#endif
+
 extern wait_queue_head_t km_waitq;
 extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 
sport);
 extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 
pid);
@@ -1050,5 +1074,25 @@ static inline void xfrm_aevent_doreplay(
xfrm_replay_notify(x, XFRM_REPLAY_UPDATE);
 }
 
+#ifdef CONFIG_XFRM_MIGRATE
+static inline struct xfrm_algo *xfrm_al

Re: [PATCH 0/5] [XFRM,PFKEYV2]: MIGRATE support (take 2)

2007-02-07 Thread David Miller
From: Shinta Sugimoto <[EMAIL PROTECTED]>
Date: Thu, 08 Feb 2007 09:42:00 +0900

> I noticed that I sent wrong version (not the newest one) of the
> patch set by mistake.  I will re-post the patch set soon, so could
> you please wait for that?  I am sorry for the confusion.

Ok, no problem.
-
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


Fw: [PATCH 0/5] [XFRM,PFKEYV2]: MIGRATE support (take 2)

2007-02-07 Thread Shinta Sugimoto
Dear David,

I noticed that I sent wrong version (not the newest one) of the
patch set by mistake.  I will re-post the patch set soon, so could
you please wait for that?  I am sorry for the confusion.

Regards,
Shinta

Forwarded by Shinta Sugimoto <[EMAIL PROTECTED]>
--- Original Message ---
 From:Shinta Sugimoto <[EMAIL PROTECTED]>
 To:  netdev@vger.kernel.org
 Cc:  Francis Dupont <[EMAIL PROTECTED]>,
  Masahide Nakamura <[EMAIL PROTECTED]>,
  [EMAIL PROTECTED],
  [EMAIL PROTECTED]
 Date:Wed, 07 Feb 2007 22:17:41 +0900
 Subject: [PATCH 0/5] [XFRM,PFKEYV2]: MIGRATE support (take 2)


Hello,

Let me send an updated version of patch set of MIGRATE support
for XFRM/PFKEYv2.  About a week ago, I sent a request for comments
for this patch set.  All the comments received were taken into
account.  In summary, the changes are as follow:

- replace alloc & memcpy with kmemdup
- remove unnecessary null-check
- fix bugs in handling protocol value for selector 
- add sanity check for handling MIGRATE message from PF_KEY socket
- some other minor changes

Please note that the patch set is against current net-2.6.21
tree and these changes are available in the branch named
"migrate-20070207-2131" at:

git://git.linux-ipv6.org/gitroot/shinta/net-2.6.21-migrate.git


Regards,
Shinta
-
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
- Original Message Ends 



-
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


[git patches] net driver updates

2007-02-07 Thread Jeff Garzik

Just sent this upstream...

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

to receive the following updates:

 Documentation/feature-removal-schedule.txt|7 +
 MAINTAINERS   |   18 +-
 drivers/net/3c59x.c   |3 +-
 drivers/net/Kconfig   |   65 +-
 drivers/net/Makefile  |6 +-
 drivers/net/Space.c   |4 -
 drivers/net/amd8111e.c|3 +-
 drivers/net/b44.c |8 +-
 drivers/net/b44.h |   10 +-
 drivers/net/bmac.c|   20 +-
 drivers/net/bnx2.c|   13 +-
 drivers/net/bonding/bond_main.c   |   23 +-
 drivers/net/bonding/bond_sysfs.c  |   15 +
 drivers/net/bonding/bonding.h |9 +-
 drivers/net/chelsio/common.h  |2 +-
 drivers/net/chelsio/cpl5_cmd.h|   18 +-
 drivers/net/chelsio/cxgb2.c   |  149 +-
 drivers/net/chelsio/elmer0.h  |   40 +-
 drivers/net/chelsio/espi.c|   44 +-
 drivers/net/chelsio/fpga_defs.h   |6 +-
 drivers/net/chelsio/gmac.h|   11 +-
 drivers/net/chelsio/ixf1010.c |  100 +-
 drivers/net/chelsio/mv88e1xxx.c   |   27 +-
 drivers/net/chelsio/my3126.c  |   16 +-
 drivers/net/chelsio/pm3393.c  |   91 +-
 drivers/net/chelsio/sge.c |  328 ++--
 drivers/net/chelsio/subr.c|   89 +-
 drivers/net/chelsio/tp.c  |   62 +-
 drivers/net/chelsio/vsc7326.c |  139 +-
 drivers/net/chelsio/vsc7326_reg.h |  139 +-
 drivers/net/chelsio/vsc8244.c |   41 +-
 drivers/net/cxgb3/Makefile|8 +
 drivers/net/cxgb3/adapter.h   |  279 ++
 drivers/net/cxgb3/ael1002.c   |  251 ++
 drivers/net/cxgb3/common.h|  729 ++
 drivers/net/cxgb3/cxgb3_ctl_defs.h|  164 ++
 drivers/net/cxgb3/cxgb3_defs.h|   99 +
 drivers/net/cxgb3/cxgb3_ioctl.h   |  185 ++
 drivers/net/cxgb3/cxgb3_main.c| 2515 ++
 drivers/net/cxgb3/cxgb3_offload.c | 1222 +
 drivers/net/cxgb3/cxgb3_offload.h |  193 ++
 drivers/net/cxgb3/firmware_exports.h  |  177 ++
 drivers/net/cxgb3/l2t.c   |  450 
 drivers/net/cxgb3/l2t.h   |  143 ++
 drivers/net/cxgb3/mc5.c   |  473 
 drivers/net/cxgb3/regs.h  | 2195 
 drivers/net/cxgb3/sge.c   | 2681 
 drivers/net/cxgb3/sge_defs.h  |  251 ++
 drivers/net/cxgb3/t3_cpl.h| 1444 +++
 drivers/net/cxgb3/t3_hw.c | 3375 +
 drivers/net/cxgb3/t3cdev.h|   73 +
 drivers/net/cxgb3/version.h   |   39 +
 drivers/net/cxgb3/vsc8211.c   |  228 ++
 drivers/net/cxgb3/xgmac.c |  409 +++
 drivers/net/declance.c|  164 +-
 drivers/net/e1000/e1000.h |7 -
 drivers/net/e1000/e1000_ethtool.c |6 -
 drivers/net/e1000/e1000_main.c|  128 +-
 drivers/net/e1000/e1000_osdep.h   |4 +-
 drivers/net/e1000/e1000_param.c   |   15 +-
 drivers/net/forcedeth.c   | 1342 +++
 drivers/net/hp100.c   |2 +-
 drivers/net/ixgb/ixgb.h   |2 -
 drivers/net/ixgb/ixgb_ethtool.c   |6 -
 drivers/net/ixgb/ixgb_main.c  |4 -
 drivers/net/macb.c|   25 +-
 drivers/net/macb.h|8 +-
 drivers/net/mace.c|   16 +-
 drivers/net/macmace.c |   18 +-
 drivers/net/macsonic.c|6 +-
 drivers/net/myri10ge/myri10ge.c   |   10 -
 drivers/net/netxen/netxen_nic.h   |   17 +-
 drivers/net/netxen/netxen_nic_ethtool.c   |   96 +-
 drivers/net/netxen/netxen_nic_init.c  |  279 ++-
 drivers/net/oaknet.c  |  666 -
 drivers/net/pasemi_mac.c  | 1019 
 drivers/net/pasemi_mac.h  |  460 
 drivers/net/qla3xxx.c |  363 +++-
 drivers/net/qla3xxx.h |   88 +-
 drivers/net/s2io-regs.h   |7 +-
 drivers/net/s2io.c| 1178 +-
 drivers/net/s2io.h|  223 +-
 drivers/net/sc92

Re: [PATCH 0/4] spidernet: support for Celleb

2007-02-07 Thread Benjamin Herrenschmidt
On Wed, 2007-02-07 at 17:15 -0500, Jeff Garzik wrote:
> Ishizaki Kou wrote:
> > This is a revised spidernet patch set based on
> > netdev-2.6.git#upstream.
> > 
> > This patch set is merged Jens-san's spidernet patch and works on
> > Toshiba Cell reference set (aka Celleb). 
> > It requires Jens-san's phy patch
> > (http://ozlabs.org/pipermail/linuxppc-dev/2007-February/030987.html).
> 
> I'm unsure of the status of the phy patch, so will put this patchset on 
> hold until that is resolved

PHY patch is mostly Ok except I don't like that "medium" variable Jens
added which isn't used anywhere in sungem_phy. Jens, can you resend a
version without that ? If you need that variable in spidernet itself,
then put it there :-)

Also, the GMII_* constants, are they standard or 54xx specific ? If the
later, then change the name to reflect that.

Once I have the new patch, I'll give it a test on G5 and if it's ok, it
will be good to go for 2.6.21

Cheers,
Ben.


-
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] MAINTAINERS: update DMFE and wireless drivers mailing list

2007-02-07 Thread Randy Dunlap
From: Randy Dunlap <[EMAIL PROTECTED]>

List netdev as the mailing list for DMFE (network driver)
instead of lkml.

List linux-wireless as the mailing list for wireless network drivers.

Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]>
---
 MAINTAINERS |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-2620-work.orig/MAINTAINERS
+++ linux-2620-work/MAINTAINERS
@@ -1096,7 +1096,7 @@ S:Supported
 DAVICOM FAST ETHERNET (DMFE) NETWORK DRIVER
 P: Tobias Ringstrom
 M: [EMAIL PROTECTED]
-L: linux-kernel@vger.kernel.org
+L: netdev@vger.kernel.org
 S: Maintained
 
 DOCBOOK FOR DOCUMENTATION
@@ -2343,7 +2343,7 @@ S:Maintained
 NETWORKING [WIRELESS]
 P: John W. Linville
 M: [EMAIL PROTECTED]
-L: netdev@vger.kernel.org
+L: [EMAIL PROTECTED]
 T: git kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6.git
 S: Maintained
 
-
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] X.25: Adds /proc/net/x25/forward to view active forwarded calls.

2007-02-07 Thread ahendry
View the active forwarded calls
cat /proc/net/x25/forward

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


--- linux-2.6.20-vanilla/net/x25/x25_proc.c 2007-02-07 14:29:43.0 
+1100
+++ linux-2.6.20/net/x25/x25_proc.c 2007-02-07 15:17:51.0 +1100
@@ -165,6 +165,75 @@ out:
return 0;
 } 
 
+static __inline__ struct x25_forward *x25_get_forward_idx(loff_t pos)
+{
+   struct x25_forward *f;
+   struct list_head *entry;
+
+   list_for_each(entry, &x25_forward_list) {
+   f = list_entry(entry, struct x25_forward, node);
+   if (!pos--)
+   goto found;
+   }
+
+   f = NULL;
+found:
+   return f;
+}
+
+static void *x25_seq_forward_start(struct seq_file *seq, loff_t *pos)
+{
+   loff_t l = *pos;
+
+   read_lock_bh(&x25_forward_list_lock);
+   return l ? x25_get_forward_idx(--l) : SEQ_START_TOKEN;
+}
+
+static void *x25_seq_forward_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+   struct x25_forward *f;
+
+   ++*pos;
+   if (v == SEQ_START_TOKEN) {
+   f = NULL;
+   if (!list_empty(&x25_forward_list))
+   f = list_entry(x25_forward_list.next,
+   struct x25_forward, node);
+   goto out;
+   }
+   f = v;
+   if (f->node.next != &x25_forward_list)
+   f = list_entry(f->node.next, struct x25_forward, node);
+   else 
+   f = NULL;
+out:
+   return f;
+
+}
+
+static void x25_seq_forward_stop(struct seq_file *seq, void *v)
+{
+   read_unlock_bh(&x25_forward_list_lock);
+}
+
+static int x25_seq_forward_show(struct seq_file *seq, void *v)
+{
+   struct x25_forward *f;
+
+   if (v == SEQ_START_TOKEN) {
+   seq_printf(seq, "lci dev1   dev2\n");
+   goto out;
+   }
+
+   f = v;
+
+   seq_printf(seq, "%d %-10s %-10s\n",
+   f->lci, f->dev1->name, f->dev2->name);
+
+out:
+   return 0;
+} 
+
 static struct seq_operations x25_seq_route_ops = {
.start  = x25_seq_route_start,
.next   = x25_seq_route_next,
@@ -179,6 +248,13 @@ static struct seq_operations x25_seq_soc
.show   = x25_seq_socket_show,
 };
 
+static struct seq_operations x25_seq_forward_ops = {
+   .start  = x25_seq_forward_start,
+   .next   = x25_seq_forward_next,
+   .stop   = x25_seq_forward_stop,
+   .show   = x25_seq_forward_show,
+};
+
 static int x25_seq_socket_open(struct inode *inode, struct file *file)
 {
return seq_open(file, &x25_seq_socket_ops);
@@ -189,6 +265,11 @@ static int x25_seq_route_open(struct ino
return seq_open(file, &x25_seq_route_ops);
 }
 
+static int x25_seq_forward_open(struct inode *inode, struct file *file)
+{
+   return seq_open(file, &x25_seq_forward_ops);
+}
+
 static struct file_operations x25_seq_socket_fops = {
.owner  = THIS_MODULE,
.open   = x25_seq_socket_open,
@@ -205,6 +286,14 @@ static struct file_operations x25_seq_ro
.release= seq_release,
 };
 
+static struct file_operations x25_seq_forward_fops = {
+   .owner  = THIS_MODULE,
+   .open   = x25_seq_forward_open,
+   .read   = seq_read,
+   .llseek = seq_lseek,
+   .release= seq_release,
+};
+
 static struct proc_dir_entry *x25_proc_dir;
 
 int __init x25_proc_init(void)
@@ -225,9 +314,17 @@ int __init x25_proc_init(void)
if (!p)
goto out_socket;
p->proc_fops = &x25_seq_socket_fops;
+
+   p = create_proc_entry("forward", S_IRUGO, x25_proc_dir);
+   if (!p)
+   goto out_forward;
+   p->proc_fops = &x25_seq_forward_fops;
rc = 0;
+
 out:
return rc;
+out_forward:
+   remove_proc_entry("socket", x25_proc_dir);
 out_socket:
remove_proc_entry("route", x25_proc_dir);
 out_route:
@@ -237,6 +334,7 @@ out_route:
 
 void __exit x25_proc_exit(void)
 {
+   remove_proc_entry("forward", x25_proc_dir);
remove_proc_entry("route", x25_proc_dir);
remove_proc_entry("socket", x25_proc_dir);
remove_proc_entry("x25", proc_net);


-
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] [RESEND] X.25: Add call forwarding

2007-02-07 Thread ahendry
Adds call forwarding to X.25, allowing it to operate like an X.25 router.
Useful if one needs to manipulate X.25 traffic with tools like tc.
This is an update/cleanup based off a patch submitted by Daniel Ferenci a few 
years ago.

Thanks Alan for the feedback.
Added the null check to the clones.
Moved the skb_clone's into the forwarding functions.

Worked ok with Cisco XoT, linux X.25 back to back, and some old NTUs/PADs.

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


diff -uprN -X linux-2.6.20/Documentation/dontdiff 
linux-2.6.20-vanilla.clean/include/net/x25.h linux-2.6.20/include/net/x25.h
--- linux-2.6.20-vanilla.clean/include/net/x25.h2007-02-05 
05:44:54.0 +1100
+++ linux-2.6.20/include/net/x25.h  2007-02-08 10:00:06.0 +1100
@@ -161,6 +161,14 @@ struct x25_sock {
unsigned long   vc_facil_mask;  /* inc_call facilities mask */
 };
 
+struct x25_forward {
+   struct list_headnode;
+   unsigned intlci;
+   struct net_device   *dev1;
+   struct net_device   *dev2;
+   atomic_trefcnt;
+};
+
 static inline struct x25_sock *x25_sk(const struct sock *sk)
 {
return (struct x25_sock *)sk;
@@ -198,6 +206,13 @@ extern int x25_negotiate_facilities(stru
struct x25_dte_facilities *);
 extern void x25_limit_facilities(struct x25_facilities *, struct x25_neigh *);
 
+/* x25_forward.c */
+extern void x25_clear_forward_by_lci(unsigned int lci);
+extern void x25_clear_forward_by_dev(struct net_device *);
+extern int x25_forward_data(int, struct x25_neigh *, struct sk_buff *);
+extern int x25_forward_call(struct x25_address *, struct x25_neigh *,
+   struct sk_buff *, int);
+
 /* x25_in.c */
 extern int  x25_process_rx_frame(struct sock *, struct sk_buff *);
 extern int  x25_backlog_rcv(struct sock *, struct sk_buff *);
@@ -282,6 +297,8 @@ extern struct hlist_head x25_list;
 extern rwlock_t x25_list_lock;
 extern struct list_head x25_route_list;
 extern rwlock_t x25_route_list_lock;
+extern struct list_head x25_forward_list;
+extern rwlock_t x25_forward_list_lock;
 
 extern int x25_proc_init(void);
 extern void x25_proc_exit(void);
diff -uprN -X linux-2.6.20/Documentation/dontdiff 
linux-2.6.20-vanilla.clean/net/x25/af_x25.c linux-2.6.20/net/x25/af_x25.c
--- linux-2.6.20-vanilla.clean/net/x25/af_x25.c 2007-02-05 05:44:54.0 
+1100
+++ linux-2.6.20/net/x25/af_x25.c   2007-02-08 10:00:06.0 +1100
@@ -846,7 +846,7 @@ int x25_rx_call_request(struct sk_buff *
struct x25_address source_addr, dest_addr;
struct x25_facilities facilities;
struct x25_dte_facilities dte_facilities;
-   int len, rc;
+   int len, addr_len, rc;
 
/*
 *  Remove the LCI and frame type.
@@ -857,7 +857,8 @@ int x25_rx_call_request(struct sk_buff *
 *  Extract the X.25 addresses and convert them to ASCII strings,
 *  and remove them.
 */
-   skb_pull(skb, x25_addr_ntoa(skb->data, &source_addr, &dest_addr));
+   addr_len = x25_addr_ntoa(skb->data, &source_addr, &dest_addr);
+   skb_pull(skb, addr_len);
 
/*
 *  Get the length of the facilities, skip past them for the moment
@@ -873,11 +874,27 @@ int x25_rx_call_request(struct sk_buff *
sk = x25_find_listener(&source_addr,skb);
skb_push(skb,len);
 
+   if (sk != NULL && sk_acceptq_is_full(sk)) {
+   goto out_sock_put;
+   }
+
/*
-*  We can't accept the Call Request.
+*  We dont have any listeners for this incoming call.
+*  Try forwarding it.
 */
-   if (sk == NULL || sk_acceptq_is_full(sk))
-   goto out_clear_request;
+   if (sk == NULL) {
+   skb_push(skb, addr_len + X25_STD_MIN_LEN);
+   if (x25_forward_call(&dest_addr, nb, skb, lci) > 0)
+   {
+   /* Call was forwarded, dont process it any more */
+   kfree_skb(skb);
+   rc = 1;
+   goto out;
+   } else {
+   /* No listeners, can't forward, clear the call */
+   goto out_clear_request;
+   }
+   }
 
/*
 *  Try to reach a compromise on the requested facilities.
@@ -1598,6 +1615,9 @@ void x25_kill_by_neigh(struct x25_neigh 
x25_disconnect(s, ENETUNREACH, 0, 0);
 
write_unlock_bh(&x25_list_lock);
+
+   /* Remove any related forwards */
+   x25_clear_forward_by_dev(nb->dev);
 }
 
 static int __init x25_init(void)
diff -uprN -X linux-2.6.20/Documentation/dontdiff 
linux-2.6.20-vanilla.clean/net/x25/Makefile linux-2.6.20/net/x25/Makefile
--- linux-2.6.20-vanilla.clean/net/x25/Makefile 2007-02-05 05:44:54.0 
+1100
+++ linux-2.6.20/net/x25/Makefile   2007-02-08 10:00:06.0 +1100
@@ -6,5 +6

[PATCH 2/3] X.25: Adds /proc/sys/net/x25/x25_forward to control forwarding.

2007-02-07 Thread ahendry
echo "1" > /proc/sys/net/x25/x25_forward 
To turn on x25_forwarding, defaults to off
Requires the previous patch.

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


diff -uprN -X linux-2.6.20/Documentation/dontdiff 
linux-2.6.20-vanilla/include/linux/sysctl.h linux-2.6.20/include/linux/sysctl.h
--- linux-2.6.20-vanilla/include/linux/sysctl.h 2007-02-07 14:28:13.0 
+1100
+++ linux-2.6.20/include/linux/sysctl.h 2007-02-07 15:01:20.0 +1100
@@ -699,7 +699,8 @@ enum {
NET_X25_CALL_REQUEST_TIMEOUT=2,
NET_X25_RESET_REQUEST_TIMEOUT=3,
NET_X25_CLEAR_REQUEST_TIMEOUT=4,
-   NET_X25_ACK_HOLD_BACK_TIMEOUT=5
+   NET_X25_ACK_HOLD_BACK_TIMEOUT=5,
+   NET_X25_FORWARD=6
 };
 
 /* /proc/sys/net/token-ring */
diff -uprN -X linux-2.6.20/Documentation/dontdiff 
linux-2.6.20-vanilla/include/net/x25.h linux-2.6.20/include/net/x25.h
--- linux-2.6.20-vanilla/include/net/x25.h  2007-02-07 14:28:14.0 
+1100
+++ linux-2.6.20/include/net/x25.h  2007-02-07 15:02:06.0 +1100
@@ -180,6 +180,7 @@ extern int  sysctl_x25_call_request_time
 extern int  sysctl_x25_reset_request_timeout;
 extern int  sysctl_x25_clear_request_timeout;
 extern int  sysctl_x25_ack_holdback_timeout;
+extern int  sysctl_x25_forward;
 
 extern int  x25_addr_ntoa(unsigned char *, struct x25_address *,
  struct x25_address *);
diff -uprN -X linux-2.6.20/Documentation/dontdiff 
linux-2.6.20-vanilla/net/x25/af_x25.c linux-2.6.20/net/x25/af_x25.c
--- linux-2.6.20-vanilla/net/x25/af_x25.c   2007-02-07 14:29:43.0 
+1100
+++ linux-2.6.20/net/x25/af_x25.c   2007-02-07 15:03:27.0 +1100
@@ -63,6 +63,7 @@ int sysctl_x25_call_request_timeout=
 int sysctl_x25_reset_request_timeout   = X25_DEFAULT_T22;
 int sysctl_x25_clear_request_timeout   = X25_DEFAULT_T23;
 int sysctl_x25_ack_holdback_timeout= X25_DEFAULT_T2;
+int sysctl_x25_forward = 0;
 
 HLIST_HEAD(x25_list);
 DEFINE_RWLOCK(x25_list_lock);
@@ -884,7 +885,8 @@ int x25_rx_call_request(struct sk_buff *
 */
if (sk == NULL) {
skb_push(skb, addr_len + X25_STD_MIN_LEN);
-   if (x25_forward_call(&dest_addr, nb, skb, lci) > 0)
+   if (sysctl_x25_forward &&
+   x25_forward_call(&dest_addr, nb, skb, lci) > 0)
{
/* Call was forwarded, dont process it any more */
kfree_skb(skb);
diff -uprN -X linux-2.6.20/Documentation/dontdiff 
linux-2.6.20-vanilla/net/x25/sysctl_net_x25.c 
linux-2.6.20/net/x25/sysctl_net_x25.c
--- linux-2.6.20-vanilla/net/x25/sysctl_net_x25.c   2007-02-07 
14:29:43.0 +1100
+++ linux-2.6.20/net/x25/sysctl_net_x25.c   2007-02-07 15:03:58.0 
+1100
@@ -73,6 +73,14 @@ static struct ctl_table x25_table[] = {
.extra1 =   &min_timer,
.extra2 =   &max_timer,
},
+   {
+   .ctl_name = NET_X25_FORWARD,
+   .procname = "x25_forward",
+   .data = &sysctl_x25_forward,
+   .maxlen =   sizeof(int),
+   .mode = 0644,
+   .proc_handler = &proc_dointvec,
+   },
{ 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


Re: [PATCH] Broken ArcNet com20020 pcmcia driver in 2.6.20

2007-02-07 Thread Randy Dunlap
On Wed, 7 Feb 2007 23:24:21 +0100 (CET) Esben Nielsen wrote:

> On Wed, 7 Feb 2007, Randy Dunlap wrote:
> 
> > Esben Nielsen wrote:
> >>  Hi,
> >>  I can not get my com20020 pcmcia driver to work as a module under 2.6.20.
> >>  There is the build problem:
> >
> The relevant parts:
> ...
> CONFIG_ARCNET_COM20020=m
> # CONFIG_ARCNET_COM20020_ISA is not set
> # CONFIG_ARCNET_COM20020_PCI is not set
> ...
> CONFIG_ARCNET_COM20020_CS=m

Sorry about that.

> In this hiracy it is not nice for the com20020 module to check wether 
> there are users for it. It breaks the direction of dependency. What if I 
> first compile com20020 install it, and then decide I want one of the other
> modules? Then would I have to recompile com20020 and reload it.
> Therefore: Remove the check, do always export the symbols.

That's not the usual kernel way, but I'll leave it up to the netdev
people.  (and net mailing list changed from linux-net to netdev)

An alternative patch is below.
Thanks for your report and patch.


> As for actually testing: I have access to ArcNet hardware for 3 more 
> weeks. Then I will start at a new job, where there is no ArcNet.

> >> WARNING:  "com20020_found" [drivers/net/pcmcia/com20020_cs.ko] undefined!
> >> WARNING:  "com20020_check" [drivers/net/pcmcia/com20020_cs.ko] undefined!
> >>
> >>  The solution:
> >>  Always export com20020_found and com20020_check.
> >>
> >>  Esben
> >>
> >>   drivers/net/arcnet/com20020.c |3 ---
> >>   1 file changed, 3 deletions(-)
> >>
> >>  Index: linux-2.6.20/drivers/net/arcnet/com20020.c
> >>  ===
> >>  --- linux-2.6.20.orig/drivers/net/arcnet/com20020.c
> >>  +++ linux-2.6.20/drivers/net/arcnet/com20020.c
> >>  @@ -337,11 +337,8 @@ static void com20020_set_mc_list(struct
> >>   }
> >>   }
> >>
> >>  -#if defined(CONFIG_ARCNET_COM20020_PCI_MODULE) || \
> >>  -defined(CONFIG_ARCNET_COM20020_ISA_MODULE)
> >>   EXPORT_SYMBOL(com20020_check);
> >>   EXPORT_SYMBOL(com20020_found);
> >>  -#endif
> >>
> >>   MODULE_LICENSE("GPL");
---


From: Randy Dunlap <[EMAIL PROTECTED]>

Need to export com20020 symbols for com20020_cs also.

WARNING:  "com20020_found" [drivers/net/pcmcia/com20020_cs.ko] undefined!
WARNING:  "com20020_check" [drivers/net/pcmcia/com20020_cs.ko] undefined!

Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]>
---
 drivers/net/arcnet/com20020.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- linux-2620-work.orig/drivers/net/arcnet/com20020.c
+++ linux-2620-work/drivers/net/arcnet/com20020.c
@@ -338,7 +338,8 @@ static void com20020_set_mc_list(struct 
 }
 
 #if defined(CONFIG_ARCNET_COM20020_PCI_MODULE) || \
-defined(CONFIG_ARCNET_COM20020_ISA_MODULE)
+defined(CONFIG_ARCNET_COM20020_ISA_MODULE) || \
+defined(CONFIG_ARCNET_COM20020_CS_MODULE)
 EXPORT_SYMBOL(com20020_check);
 EXPORT_SYMBOL(com20020_found);
 #endif

-
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 review] b44: Port to ssb subsystem

2007-02-07 Thread Gary Zambrano
On Tue, 2007-01-23 at 17:20 +0100, Michael Buesch wrote:
> This patch ports b44 to the new SSB subsystem and makes
> it possible to turn off PCI related stuff.
> 
> This patch is against my tree, where I have implemented the
> ssb subsystem.
> 
> If you're all OK with this patch, I'd like apply it to my tree.
> I think that's best. Although it's not wireless-related, it's
> much easier to maintain this way.

>  
> +static int b44_ethtool_ioctl (struct net_device *dev, void __user *useraddr)

Michael, Do you really want to create ethtool_ioctl() to do what the
ethtool_ops does?

-Gary


-
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] AT91: MACB support

2007-02-07 Thread Jeff Garzik

Haavard Skinnemoen wrote:

From: Andrew Victor <[EMAIL PROTECTED]>

The Atmel MACB Ethernet peripheral is also integrated in the AT91SAM9260
and AT91SAM9263 processors.  The differences from the AVR32 version are:
  * Single peripheral clock.
  * MII/RMII selection bit is inverted.
  * Clock enable bit.

Original patch from Patrice Vilchez.

Signed-off-by: Andrew Victor <[EMAIL PROTECTED]>
Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 drivers/net/Kconfig |2 +-
 drivers/net/macb.c  |   25 +++--
 drivers/net/macb.h  |8 +++-
 3 files changed, 31 insertions(+), 4 deletions(-)


applied


-
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] sk98lin: planned removal

2007-02-07 Thread Jeff Garzik

Stephen Hemminger wrote:

Document planned removal of sk98lin driver.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
---
 Documentation/feature-removal-schedule.txt |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)


applied


-
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] IPv6: Implement RFC 4429 Optimistic Duplicate Address Detection

2007-02-07 Thread YOSHIFUJI Hideaki / 吉藤英明
In article <[EMAIL PROTECTED]> (at Wed, 7 Feb 2007 15:55:03 -0500), Neil Horman 
<[EMAIL PROTECTED]> says:

> @@ -559,7 +562,7 @@ void ndisc_send_ns(struct net_device *dev, struct 
> neighbour *neigh,
>   return;
>  
>   len = sizeof(struct icmp6hdr) + sizeof(struct in6_addr);
> - send_llinfo = dev->addr_len && !ipv6_addr_any(saddr);
> + send_llinfo = dev->addr_len && !ipv6_addr_any(saddr); 
>   if (send_llinfo)
>   len += ndisc_opt_addr_space(dev);
>  

trailing space

> @@ -637,7 +660,7 @@ void ndisc_send_rs(struct net_device *dev, struct 
> in6_addr *saddr,
>   return;
>  
>   len = sizeof(struct icmp6hdr);
> - if (dev->addr_len)
> + if (dev->addr_len && send_sllao)
>   len += ndisc_opt_addr_space(dev);
>  
>  skb = sock_alloc_send_skb(sk,

if (send_sllao)

> @@ -664,7 +687,7 @@ void ndisc_send_rs(struct net_device *dev, struct 
> in6_addr *saddr,
>  
>   opt = (u8*) (hdr + 1);
>  
> - if (dev->addr_len)
> + if (dev->addr_len && send_sllao)
>   ndisc_fill_addr_option(opt, ND_OPT_SOURCE_LL_ADDR, 
> dev->dev_addr,
>  dev->addr_len, dev->type);
>  

ditto.

--yoshfuji
-
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/4] spidernet: support for Celleb

2007-02-07 Thread Jeff Garzik

Ishizaki Kou wrote:

This is a revised spidernet patch set based on
netdev-2.6.git#upstream.

This patch set is merged Jens-san's spidernet patch and works on
Toshiba Cell reference set (aka Celleb). 
It requires Jens-san's phy patch

(http://ozlabs.org/pipermail/linuxppc-dev/2007-February/030987.html).


I'm unsure of the status of the phy patch, so will put this patchset on 
hold until that is resolved



-
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 netdev#atl1 1/1] atl1: clean up extern, global scope declarations

2007-02-07 Thread Jeff Garzik

Jay Cliburn wrote:

From: Jay Cliburn <[EMAIL PROTECTED]>

atl1: move extern to header file; make some global code static

Move an extern declaration to a header file.  Make needlessly global
functions static.  Noticed by Adrian Bunk.

Signed-off-by: Jay Cliburn <[EMAIL PROTECTED]>


applied


-
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: [Bugme-new] [Bug 7962] New: oops in port_carrier_check

2007-02-07 Thread Stephen Hemminger
On Wed, 7 Feb 2007 12:52:16 -0800
Andrew Morton <[EMAIL PROTECTED]> wrote:

> 
> 
> Begin forwarded message:
> 
> Date: Wed, 7 Feb 2007 12:41:07 -0800
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: [Bugme-new] [Bug 7962] New: oops in port_carrier_check
> 
> 
> http://bugzilla.kernel.org/show_bug.cgi?id=7962
> 
>Summary: oops in port_carrier_check
> Kernel Version: 2.6.20-rc7
> Status: NEW
>   Severity: normal
>  Owner: [EMAIL PROTECTED]
>  Submitter: [EMAIL PROTECTED]
> 
> 
> While playing with qemu, I got a oops in bridge (and lost keyboard) :
> 
> Feb  7 21:20:18 plop kernel: BUG: unable to handle kernel paging request at
> virtual address 6b6b6b6b
> Feb  7 21:20:18 plop kernel:  printing eip:
> Feb  7 21:20:18 plop kernel: *pde = 
> Feb  7 21:20:18 plop kernel: Oops:  [#1]
> Feb  7 21:20:18 plop kernel: CPU:0
> Feb  7 21:20:19 plop kernel: EIP:0060:[pg0+814360305/1067136000]Not
> tainted VLI
> Feb  7 21:20:19 plop kernel: EIP:0060:[]Not tainted VLI
> Feb  7 21:20:19 plop kernel: EFLAGS: 00010202   (2.6.20.0.rc7-1mdv #1)
> Feb  7 21:20:19 plop kernel: EIP is at port_carrier_check+0x22/0x75 [bridge]
> Feb  7 21:20:19 plop kernel: eax: 6b6b6b6b   ebx: 6b6b6b6b   ecx:   
> edx: 0001
> Feb  7 21:20:19 plop kernel: esi: eb99b120   edi: 0296   ebp: eff0bf58  
> esp: eff0bf4c
> Feb  7 21:20:19 plop kernel: ds: 007b   es: 007b   ss: 0068
> Feb  7 21:20:19 plop kernel: Process events/0 (pid: 4, ti=eff0a000 
> task=eff09530
> task.ti=eff0a000)
> Feb  7 21:20:19 plop kernel: Stack: cd566744 eff4e86c 0296 eff0bf84 
> c012534a
> eff0bf70 0296 eff0bfa0
> Feb  7 21:20:19 plop kernel:eff0bfac cd566740 f0eed6cf eff4e86c 
> eff03ec8
> eff0bfb4 eff0bfc4 c012590d
> Feb  7 21:20:19 plop kernel:0001  0001 0001 
> 
>  eff09530 c0114770
> Feb  7 21:20:19 plop kernel: Call Trace:
> Feb  7 21:20:19 plop kernel:  [show_trace_log_lvl+26/47]
> show_trace_log_lvl+0x1a/0x2f
> Feb  7 21:20:19 plop kernel:  [] show_trace_log_lvl+0x1a/0x2f
> Feb  7 21:20:19 plop kernel:  [show_stack_log_lvl+155/163]
> show_stack_log_lvl+0x9b/0xa3
> Feb  7 21:20:19 plop kernel:  [] show_stack_log_lvl+0x9b/0xa3
> Feb  7 21:20:19 plop kernel:  [show_registers+402/616] 
> show_registers+0x192/0x268
> Feb  7 21:20:19 plop kernel:  [] show_registers+0x192/0x268
> Feb  7 21:20:19 plop kernel:  [die+234/511] die+0xea/0x1ff
> Feb  7 21:20:19 plop kernel:  [] die+0xea/0x1ff
> Feb  7 21:20:19 plop kernel:  [do_page_fault+/1334] 
> do_page_fault+0x457/0x536
> Feb  7 21:20:19 plop kernel:  [] do_page_fault+0x457/0x536
> Feb  7 21:20:19 plop kernel:  [error_code+116/128] error_code+0x74/0x80
> Feb  7 21:20:19 plop kernel:  [] error_code+0x74/0x80
> Feb  7 21:20:19 plop kernel:  [run_workqueue+142/333] run_workqueue+0x8e/0x14d
> Feb  7 21:20:19 plop kernel:  [] run_workqueue+0x8e/0x14d
> Feb  7 21:20:19 plop kernel:  [worker_thread+260/302] 
> worker_thread+0x104/0x12e 
> Feb  7 21:20:19 plop kernel:  [] worker_thread+0x104/0x12e
> Feb  7 21:20:19 plop kernel:  [kthread+163/206] kthread+0xa3/0xce
> Feb  7 21:20:19 plop kernel:  [] kthread+0xa3/0xce
> Feb  7 21:20:19 plop kernel:  [kernel_thread_helper+7/16]
> kernel_thread_helper+0x7/0x10
> Feb  7 21:20:19 plop kernel:  [] kernel_thread_helper+0x7/0x10
> Feb  7 21:20:19 plop kernel:  === 
> Feb  7 21:20:19 plop kernel: Code: 38 cf 89 d8 5b 5e 5f 5d c3 55 89 e5 57 56 
> 53
> 8b b0 24 ff ff ff 0f ba 30 00 e8 d3 20 38 cf 8b 9e 40 02 00 00 85 db 74 4c 8b 
> 46
> 2c <8b> 3b a8 10 75 0a 89 f0 e8 e2 f9 ff ff 89 43 2c 8b 47 30 f6 40 
> Feb  7 21:20:19 plop kernel: EIP: [pg0+814360305/1067136000]
> port_carrier_check+0x22/0x75 [bridge] SS:ESP 0068:eff0bf4c
> Feb  7 21:20:19 plop kernel: EIP: [] port_carrier_check+0x22/0x75
> [bridge] SS:ESP 0068:eff0bf4c
> 
> --- You are receiving this mail because: ---
> You are on the CC list for the bug, or are watching someone who is.


I wonder if this is work_queue API change fallout.
-
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.20] net/ieee80211/ieee80211_crypt_tkip.c spams kernel message buffer

2007-02-07 Thread Andreas Steinmetz
net/ieee80211/ieee80211_crypt_tkip.c outputs tons of these which didn't
happen with 2.6.18.2 (only one or two of these after enabling the
ipw2200 with the kill switch):

TKIP: replay detected: STA=00:0e:2e:94:84:c3 previous TSC 0200
received TSC 0002e560
printk: 19 messages suppressed.
TKIP: replay detected: STA=00:0e:2e:94:84:c3 previous TSC 0200
received TSC 0002e574
printk: 19 messages suppressed.
TKIP: replay detected: STA=00:0e:2e:94:84:c3 previous TSC 0200
received TSC 0002e588
printk: 18 messages suppressed.
TKIP: replay detected: STA=00:0e:2e:94:84:c3 previous TSC 0200
received TSC 0002e59b
printk: 19 messages suppressed.
TKIP: replay detected: STA=00:0e:2e:94:84:c3 previous TSC 0200
received TSC 0002e5af
printk: 19 messages suppressed.
TKIP: replay detected: STA=00:0e:2e:94:84:c3 previous TSC 0200
received TSC 0002e5c3
printk: 19 messages suppressed.
TKIP: replay detected: STA=00:0e:2e:94:84:c3 previous TSC 0200
received TSC 0002e5d7
printk: 19 messages suppressed.
TKIP: replay detected: STA=00:0e:2e:94:84:c3 previous TSC 0200
received TSC 0002e5eb
printk: 19 messages suppressed.
TKIP: replay detected: STA=00:0e:2e:94:84:c3 previous TSC 0200
received TSC 0002e5ff
printk: 16 messages suppressed.
TKIP: replay detected: STA=00:0e:2e:94:84:c3 previous TSC 0200
received TSC 0002e612
printk: 17 messages suppressed.
TKIP: replay detected: STA=00:0e:2e:94:84:c3 previous TSC 0200
received TSC 0002e626

-- 
Andreas Steinmetz   SPAMmers use [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] IPv6: Implement RFC 4429 Optimistic Duplicate Address Detection

2007-02-07 Thread YOSHIFUJI Hideaki / 吉藤英明
In article <[EMAIL PROTECTED]> (at Wed, 7 Feb 2007 15:55:03 -0500), Neil Horman 
<[EMAIL PROTECTED]> says:

> diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
> index 7b7bd44..8a1ea96 100644
> --- a/net/ipv6/ip6_output.c
> +++ b/net/ipv6/ip6_output.c
> @@ -859,6 +859,34 @@ static int ip6_dst_lookup_tail(struct sock *sk,
>   err = ipv6_get_saddr(*dst, &fl->fl6_dst, &fl->fl6_src);
>   if (err)
>   goto out_err_release;
> +#ifdef CONFIG_IPV6_OPTIMISTIC_DAD
> + /*
> +  * Here if the dst entry we've looked up 
> +  * has a neighbour entry that is in the INCOMPLETE
> +  * state and the src address from the flow is 
> +  * marked as OPTIMISTIC, we release the found 
> +  * dst entry and replace it instead with the 
> +  * dst entry of the nexthop router
> +  */
> + if (!((*dst)->neighbour->nud_state & NUD_VALID)) {
> + struct inet6_ifaddr *ifp;
> + struct flowi fl_gw;
> + ifp = ipv6_get_ifaddr(&fl->fl6_src, (*dst)->dev, 1);
> +
> + if (ifp && ifp->flags & IFA_F_OPTIMISTIC) {
> + /*
> +  * We need to get the dst entry for the 
> +  * default router instead
> +  */
> + dst_release(*dst);
> + memcpy(&fl_gw, fl, sizeof(struct flowi));
> + memset(&fl_gw.fl6_dst, 0, sizeof(struct 
> in6_addr));
> + *dst = ip6_route_output(sk, &fl_gw);
> + if ((err = (*dst)->error))
> + goto out_err_release;   
> 
> + }
> + }
> +#endif
>   }
>  
>   return 0;

Sorry, this is still not correct if the source address is already
specified.  I think they should be placed just betwee laste "}" and
"return 0;", no?


I still have a question.  Now, who will install the kernel route for
the incoming packet?  Can we get packet for our unicast address during
optimistic DAD period?

--yoshfuji
-
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


Please pull "upstream" branch of wireless-2.6

2007-02-07 Thread John W. Linville
On Tue, Feb 06, 2007 at 07:06:07PM -0500, Jeff Garzik wrote:
> Would you mind rebasing & resending, kind sir?

By your command! :-)

---

The following changes since commit 62d0cfcb27cf755cebdc93ca95dabc83608007cd:
  Linus Torvalds (1):
Linux 2.6.20

are found in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git 
upstream

Daniel Drake (1):
  zd1211rw: Remove noisy debug message

Larry Finger (3):
  bcm43xx: Fix problem with >1 GB RAM
  bcm43xx: Fix scaling error for 'iwlist rate' information
  bcm43xx: Fix scaling error for 'iwlist freq' information

Maxime Austruy (1):
  zd1211rw: fix potential leak in usb_init

Michael Buesch (1):
  bcm43xx: Enable fwpostfix in nondebug bcm43xx

Robert P. J. Day (1):
  Rename IPW2100 debugging macros to not look like config options.

Ulrich Kunitz (3):
  zd1211rw: Reset device in the probe call
  zd1211rw: Fixed array size issue in reset_mode
  zd1211rw: Added error stats update

 drivers/net/wireless/bcm43xx/bcm43xx.h  |1 +
 drivers/net/wireless/bcm43xx/bcm43xx_dma.c  |  171 +++
 drivers/net/wireless/bcm43xx/bcm43xx_main.c |6 +-
 drivers/net/wireless/bcm43xx/bcm43xx_wx.c   |   28 ++--
 drivers/net/wireless/ipw2100.c  |   16 ++--
 drivers/net/wireless/zd1211rw/zd_mac.c  |   44 ++--
 drivers/net/wireless/zd1211rw/zd_usb.c  |   12 ++
 7 files changed, 194 insertions(+), 84 deletions(-)

diff --git a/drivers/net/wireless/bcm43xx/bcm43xx.h 
b/drivers/net/wireless/bcm43xx/bcm43xx.h
index 8286678..4168b1a 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx.h
+++ b/drivers/net/wireless/bcm43xx/bcm43xx.h
@@ -766,6 +766,7 @@ struct bcm43xx_private {
 * This is currently always BCM43xx_BUSTYPE_PCI
 */
u8 bustype;
+   u64 dma_mask;
 
u16 board_vendor;
u16 board_type;
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_dma.c 
b/drivers/net/wireless/bcm43xx/bcm43xx_dma.c
index 978ed09..6e0dc76 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_dma.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_dma.c
@@ -145,16 +145,14 @@ dma_addr_t map_descbuffer(struct bcm43xx_dmaring *ring,
  int tx)
 {
dma_addr_t dmaaddr;
+   int direction = PCI_DMA_FROMDEVICE;
 
-   if (tx) {
-   dmaaddr = dma_map_single(&ring->bcm->pci_dev->dev,
-buf, len,
-DMA_TO_DEVICE);
-   } else {
-   dmaaddr = dma_map_single(&ring->bcm->pci_dev->dev,
+   if (tx)
+   direction = PCI_DMA_TODEVICE;
+
+   dmaaddr = pci_map_single(ring->bcm->pci_dev,
 buf, len,
-DMA_FROM_DEVICE);
-   }
+direction);
 
return dmaaddr;
 }
@@ -166,13 +164,13 @@ void unmap_descbuffer(struct bcm43xx_dmaring *ring,
  int tx)
 {
if (tx) {
-   dma_unmap_single(&ring->bcm->pci_dev->dev,
+   pci_unmap_single(ring->bcm->pci_dev,
 addr, len,
-DMA_TO_DEVICE);
+PCI_DMA_TODEVICE);
} else {
-   dma_unmap_single(&ring->bcm->pci_dev->dev,
+   pci_unmap_single(ring->bcm->pci_dev,
 addr, len,
-DMA_FROM_DEVICE);
+PCI_DMA_FROMDEVICE);
}
 }
 
@@ -183,8 +181,8 @@ void sync_descbuffer_for_cpu(struct bcm43xx_dmaring *ring,
 {
assert(!ring->tx);
 
-   dma_sync_single_for_cpu(&ring->bcm->pci_dev->dev,
-   addr, len, DMA_FROM_DEVICE);
+   pci_dma_sync_single_for_cpu(ring->bcm->pci_dev,
+   addr, len, PCI_DMA_FROMDEVICE);
 }
 
 static inline
@@ -194,8 +192,8 @@ void sync_descbuffer_for_device(struct bcm43xx_dmaring 
*ring,
 {
assert(!ring->tx);
 
-   dma_sync_single_for_device(&ring->bcm->pci_dev->dev,
-  addr, len, DMA_FROM_DEVICE);
+   pci_dma_sync_single_for_cpu(ring->bcm->pci_dev,
+   addr, len, PCI_DMA_TODEVICE);
 }
 
 /* Unmap and free a descriptor buffer. */
@@ -214,17 +212,53 @@ void free_descriptor_buffer(struct bcm43xx_dmaring *ring,
 
 static int alloc_ringmemory(struct bcm43xx_dmaring *ring)
 {
-   struct device *dev = &(ring->bcm->pci_dev->dev);
-
-   ring->descbase = dma_alloc_coherent(dev, BCM43xx_DMA_RINGMEMSIZE,
-   &(ring->dmabase), GFP_KERNEL);
+   ring->descbase = pci_alloc_consistent(ring->bcm->pci_dev, 
BCM43xx_DMA_RINGMEMSIZE,
+   &(ring->dmabase));
if (!ring->descbase) {
-   printk(KERN_ERR PFX "DMA ringmemory allocation fail

Re: [PATCH] IPv6: Implement RFC 4429 Optimistic Duplicate Address Detection

2007-02-07 Thread Vlad Yasevich
Darn... and it was looking so good...


> diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
> index 7b7bd44..8a1ea96 100644
> --- a/net/ipv6/ip6_output.c
> +++ b/net/ipv6/ip6_output.c
> @@ -859,6 +859,34 @@ static int ip6_dst_lookup_tail(struct sock *sk,
>   err = ipv6_get_saddr(*dst, &fl->fl6_dst, &fl->fl6_src);
>   if (err)
>   goto out_err_release;
> +#ifdef CONFIG_IPV6_OPTIMISTIC_DAD
> + /*
> +  * Here if the dst entry we've looked up 
> +  * has a neighbour entry that is in the INCOMPLETE
> +  * state and the src address from the flow is 
> +  * marked as OPTIMISTIC, we release the found 
> +  * dst entry and replace it instead with the 
> +  * dst entry of the nexthop router
> +  */
> + if (!((*dst)->neighbour->nud_state & NUD_VALID)) {
> + struct inet6_ifaddr *ifp;
> + struct flowi fl_gw;
> + ifp = ipv6_get_ifaddr(&fl->fl6_src, (*dst)->dev, 1);
> +
> + if (ifp && ifp->flags & IFA_F_OPTIMISTIC) {
> + /*
> +  * We need to get the dst entry for the 
> +  * default router instead
> +  */
> + dst_release(*dst);
> + memcpy(&fl_gw, fl, sizeof(struct flowi));
> + memset(&fl_gw.fl6_dst, 0, sizeof(struct 
> in6_addr));
> + *dst = ip6_route_output(sk, &fl_gw);
> + if ((err = (*dst)->error))
> + goto out_err_release;   
> 
> + }
> + }
> +#endif

You are leaking an 'ifp' ref.  ipv6_get_ifaddr() does in6_ifa_hold(ifp).  You
need do in6_ifa_put(ifp), when you are done with the ifp.



> @@ -622,9 +625,29 @@ void ndisc_send_rs(struct net_device *dev, struct 
> in6_addr *saddr,
>  struct sk_buff *skb;
>  struct icmp6hdr *hdr;
>   __u8 * opt;
> + struct inet6_ifaddr *ifp;
> + int send_sllao = 1;
>  int len;
>   int err;
>  
> + /*
> +  * Check the source address.  If its OPTIMISTIC
> +  * and addr_len is non-zero (implying the sllao option)
> +  * then don't send the RS (RFC 4429, section 2.2)
> +  */
> + ifp = ipv6_get_ifaddr(saddr, dev, 1);
> +
> + /*
> +  * According to section 2.2 of RFC 4429, we must not 
> +  * send router solicitations with a sllao from 
> +  * optimistic addresses, but we may send the solicitation
> +  * if we don't include the sllao.  So here we check
> +  * if our address is optimistic, and if so, we
> +  * supress the inclusion of the sllao.
> +  */ 
> + if (!dev->addr_len || !ifp || (ifp->flags & IFA_F_OPTIMISTIC))
> + send_sllao=0;
> +

Ditto.


-vlad
-
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/1] Fabric7 VIOC driver source code

2007-02-07 Thread Sriram Chidambaram
This patch provides the Fabric7 VIOC driver source code.
This git mbox patch is built against 
git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git

The patch can be pulled from
ftp://ftp.fabric7.com/VIOC/Fabric7-VIOC-driver-patch.FEB-07-2007

Signed-off-by: Fabric7 Driver-Support <[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] IPv6: Implement RFC 4429 Optimistic Duplicate Address Detection

2007-02-07 Thread Neil Horman
On Tue, Feb 06, 2007 at 04:13:25PM -0500, Vlad Yasevich wrote:
> Hi Neil
> 
> a few comments.  sorry, just can't resist... :)
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Its really ok :).  Brian found some other minor typos as well.  I've attached
the latest patch which takes your comments, and Brians observations into
account.  The only change I left out was the space/tab conversion in
ndisc_send_ns, since it appeared to be more inline with the style in the rest of
the file.  Everything else is incorporated into this patch, however. Thanks for
all the keen eyes!

Thanks & Regards
Neil

Signed-off-by: Neil Horman <[EMAIL PROTECTED]>


 include/linux/if_addr.h |1 
 include/linux/ipv6.h|4 ++
 include/linux/sysctl.h  |1 
 include/net/addrconf.h  |4 +-
 net/ipv6/Kconfig|   10 +
 net/ipv6/addrconf.c |   90 
 net/ipv6/ip6_output.c   |   28 ++
 net/ipv6/mcast.c|4 +-
 net/ipv6/ndisc.c|   82 ++-
 9 files changed, 182 insertions(+), 42 deletions(-)



diff --git a/include/linux/if_addr.h b/include/linux/if_addr.h
index d557e4c..43f3bed 100644
--- a/include/linux/if_addr.h
+++ b/include/linux/if_addr.h
@@ -39,6 +39,7 @@ enum
 #define IFA_F_TEMPORARYIFA_F_SECONDARY
 
 #defineIFA_F_NODAD 0x02
+#define IFA_F_OPTIMISTIC   0x04
 #defineIFA_F_HOMEADDRESS   0x10
 #define IFA_F_DEPRECATED   0x20
 #define IFA_F_TENTATIVE0x40
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index f824113..bf93c1b 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -177,6 +177,9 @@ struct ipv6_devconf {
 #endif
 #endif
__s32   proxy_ndp;
+#ifdef CONFIG_IPV6_OPTIMISTIC_DAD
+   __s32   optimistic_dad;
+#endif
void*sysctl;
 };
 
@@ -205,6 +208,7 @@ enum {
DEVCONF_RTR_PROBE_INTERVAL,
DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN,
DEVCONF_PROXY_NDP,
+   DEVCONF_OPTIMISTIC_DAD,
DEVCONF_MAX
 };
 
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 81480e6..972a33a 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -570,6 +570,7 @@ enum {
NET_IPV6_RTR_PROBE_INTERVAL=21,
NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22,
NET_IPV6_PROXY_NDP=23,
+   NET_IPV6_OPTIMISTIC_DAD=24,
__NET_IPV6_MAX
 };
 
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 88df8fc..d248a19 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -73,7 +73,9 @@ extern intipv6_get_saddr(struct dst_entry 
*dst,
 extern int ipv6_dev_get_saddr(struct net_device *dev, 
   struct in6_addr *daddr,
   struct in6_addr *saddr);
-extern int ipv6_get_lladdr(struct net_device *dev, struct 
in6_addr *);
+extern int ipv6_get_lladdr(struct net_device *dev, 
+   struct in6_addr *,
+   unsigned char banned_flags);
 extern int ipv6_rcv_saddr_equal(const struct sock *sk, 
  const struct sock *sk2);
 extern voidaddrconf_join_solict(struct net_device *dev,
diff --git a/net/ipv6/Kconfig b/net/ipv6/Kconfig
index deb4101..822d3eb 100644
--- a/net/ipv6/Kconfig
+++ b/net/ipv6/Kconfig
@@ -57,6 +57,16 @@ config IPV6_ROUTE_INFO
 
  If unsure, say N.
 
+config IPV6_OPTIMISTIC_DAD
+   bool "IPv6: Enable RFC 4429 Optimistic DAD (EXPERIMENTAL)"
+   depends on IPV6 && EXPERIMENTAL
+   ---help---
+ This is experimental support for optimistic Duplicate
+ Address Detection.  It allows for autoconfigured addresses
+ to be used more quickly.
+
+ If unsure, say N.
+
 config INET6_AH
tristate "IPv6: AH transformation"
depends on IPV6
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index e385469..c884eeb 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -594,6 +594,16 @@ ipv6_add_addr(struct inet6_dev *idev, const struct 
in6_addr *addr, int pfxlen,
 
ifa->rt = rt;
 
+   /*
+* part one of RFC 4429, section 3.3
+* We should not configure an address as 
+* optimistic if we do not yet know the link
+* layer address of our nexhop router
+*/
+
+   if (rt->rt6i_nexthop == NULL)
+   ifa->flags &= ~IFA_F_OPTIMISTIC;
+
ifa->idev = idev;
in6_dev_hold(idev);
/* For caller */
@@ -770,6 +780,7 @@ static int ipv6_create_tempaddr(struct inet6_ifaddr *ifp, 
struct inet6_ifaddr *i
int tmp_plen;
int ret = 0;
int max_addresses;
+   u32 addr_flags;
 
write_lock(&idev->

Fw: [Bugme-new] [Bug 7962] New: oops in port_carrier_check

2007-02-07 Thread Andrew Morton


Begin forwarded message:

Date: Wed, 7 Feb 2007 12:41:07 -0800
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [Bugme-new] [Bug 7962] New: oops in port_carrier_check


http://bugzilla.kernel.org/show_bug.cgi?id=7962

   Summary: oops in port_carrier_check
Kernel Version: 2.6.20-rc7
Status: NEW
  Severity: normal
 Owner: [EMAIL PROTECTED]
 Submitter: [EMAIL PROTECTED]


While playing with qemu, I got a oops in bridge (and lost keyboard) :

Feb  7 21:20:18 plop kernel: BUG: unable to handle kernel paging request at
virtual address 6b6b6b6b
Feb  7 21:20:18 plop kernel:  printing eip:
Feb  7 21:20:18 plop kernel: *pde = 
Feb  7 21:20:18 plop kernel: Oops:  [#1]
Feb  7 21:20:18 plop kernel: CPU:0
Feb  7 21:20:19 plop kernel: EIP:0060:[pg0+814360305/1067136000]Not
tainted VLI
Feb  7 21:20:19 plop kernel: EIP:0060:[]Not tainted VLI
Feb  7 21:20:19 plop kernel: EFLAGS: 00010202   (2.6.20.0.rc7-1mdv #1)
Feb  7 21:20:19 plop kernel: EIP is at port_carrier_check+0x22/0x75 [bridge]
Feb  7 21:20:19 plop kernel: eax: 6b6b6b6b   ebx: 6b6b6b6b   ecx:   
edx: 0001
Feb  7 21:20:19 plop kernel: esi: eb99b120   edi: 0296   ebp: eff0bf58  
esp: eff0bf4c
Feb  7 21:20:19 plop kernel: ds: 007b   es: 007b   ss: 0068
Feb  7 21:20:19 plop kernel: Process events/0 (pid: 4, ti=eff0a000 task=eff09530
task.ti=eff0a000)
Feb  7 21:20:19 plop kernel: Stack: cd566744 eff4e86c 0296 eff0bf84 c012534a
eff0bf70 0296 eff0bfa0
Feb  7 21:20:19 plop kernel:eff0bfac cd566740 f0eed6cf eff4e86c eff03ec8
eff0bfb4 eff0bfc4 c012590d
Feb  7 21:20:19 plop kernel:0001  0001 0001 
 eff09530 c0114770
Feb  7 21:20:19 plop kernel: Call Trace:
Feb  7 21:20:19 plop kernel:  [show_trace_log_lvl+26/47]
show_trace_log_lvl+0x1a/0x2f
Feb  7 21:20:19 plop kernel:  [] show_trace_log_lvl+0x1a/0x2f
Feb  7 21:20:19 plop kernel:  [show_stack_log_lvl+155/163]
show_stack_log_lvl+0x9b/0xa3
Feb  7 21:20:19 plop kernel:  [] show_stack_log_lvl+0x9b/0xa3
Feb  7 21:20:19 plop kernel:  [show_registers+402/616] 
show_registers+0x192/0x268
Feb  7 21:20:19 plop kernel:  [] show_registers+0x192/0x268
Feb  7 21:20:19 plop kernel:  [die+234/511] die+0xea/0x1ff
Feb  7 21:20:19 plop kernel:  [] die+0xea/0x1ff
Feb  7 21:20:19 plop kernel:  [do_page_fault+/1334] 
do_page_fault+0x457/0x536
Feb  7 21:20:19 plop kernel:  [] do_page_fault+0x457/0x536
Feb  7 21:20:19 plop kernel:  [error_code+116/128] error_code+0x74/0x80
Feb  7 21:20:19 plop kernel:  [] error_code+0x74/0x80
Feb  7 21:20:19 plop kernel:  [run_workqueue+142/333] run_workqueue+0x8e/0x14d
Feb  7 21:20:19 plop kernel:  [] run_workqueue+0x8e/0x14d
Feb  7 21:20:19 plop kernel:  [worker_thread+260/302] worker_thread+0x104/0x12e 
Feb  7 21:20:19 plop kernel:  [] worker_thread+0x104/0x12e
Feb  7 21:20:19 plop kernel:  [kthread+163/206] kthread+0xa3/0xce
Feb  7 21:20:19 plop kernel:  [] kthread+0xa3/0xce
Feb  7 21:20:19 plop kernel:  [kernel_thread_helper+7/16]
kernel_thread_helper+0x7/0x10
Feb  7 21:20:19 plop kernel:  [] kernel_thread_helper+0x7/0x10
Feb  7 21:20:19 plop kernel:  === 
Feb  7 21:20:19 plop kernel: Code: 38 cf 89 d8 5b 5e 5f 5d c3 55 89 e5 57 56 53
8b b0 24 ff ff ff 0f ba 30 00 e8 d3 20 38 cf 8b 9e 40 02 00 00 85 db 74 4c 8b 46
2c <8b> 3b a8 10 75 0a 89 f0 e8 e2 f9 ff ff 89 43 2c 8b 47 30 f6 40 
Feb  7 21:20:19 plop kernel: EIP: [pg0+814360305/1067136000]
port_carrier_check+0x22/0x75 [bridge] SS:ESP 0068:eff0bf4c
Feb  7 21:20:19 plop kernel: EIP: [] port_carrier_check+0x22/0x75
[bridge] SS:ESP 0068:eff0bf4c

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.
-
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: [Lksctp-developers] Fw: Intermittent SCTP multihoming breakage

2007-02-07 Thread Vlad Yasevich
Hi Steve

I think I've tracked this down.  Can you apply the attached patch on top
of the one I posted before and re-run your test.

With both patches, I was able flip-flop the downed interface multiple times
and in all cases path failover completed and data flow resumed.

Here is the modified script I was running:

#!/bin/sh

net1="$1"
net2="$2"

flush() {
iptables -F
echo "Flush"
exit
}

trap flush EXIT

while true; do
# clear table
iptables -F
echo "flushed"
sleep 5

# block net1
iptables -A INPUT -i "$net1" -p sctp -j DROP
echo "set net1"
sleep 5

# clear table
iptables -F
echo "flushed"
sleep 5

# block net2
iptables -A INPUT -i "$net2" -p sctp -j DROP
echo "set net2"
sleep 5
done

I was able to run this script for 10 minutes sustaining the message flow.

-vlad
>From 72d6856f7e45a17e0910e0eacd1a01d44fafd1c0 Mon Sep 17 00:00:00 2001
From: Vlad Yasevich <[EMAIL PROTECTED]>
Date: Wed, 7 Feb 2007 14:58:25 -0500
Subject: [PATCH] [SCTP] Strike the transport before updating rto

Once we reach a poing where we exceed the max.path.retrans
strike the trasport before updating the rto.  This will force
transport switch at the right time, instead of 1 retransmit too
late.

Signed-off-by: Vlad Yasevich <[EMAIL PROTECTED]>
---
 net/sctp/sm_statefuns.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index fbbc9e6..801f9d6 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -4605,12 +4605,12 @@ sctp_disposition_t sctp_sf_do_6_3_3_rtx(const struct sctp_endpoint *ep,
 	 * sent as soon as cwnd allows (normally when a SACK arrives).
 	 */
 
-	/* NB: Rules E4 and F1 are implicit in R1.  */
-	sctp_add_cmd_sf(commands, SCTP_CMD_RETRAN, SCTP_TRANSPORT(transport));
-
 	/* Do some failure management (Section 8.2). */
 	sctp_add_cmd_sf(commands, SCTP_CMD_STRIKE, SCTP_TRANSPORT(transport));
 
+	/* NB: Rules E4 and F1 are implicit in R1.  */
+	sctp_add_cmd_sf(commands, SCTP_CMD_RETRAN, SCTP_TRANSPORT(transport));
+
 	return SCTP_DISPOSITION_CONSUME;
 }
 
-- 
1.5.0.rc3.g6506



[PATCH] [NETDEV] [005] dmfe : Add support for wake-on-lan [FIXED]

2007-02-07 Thread Levitsky Maxim
Hello , I just noticed a error in my patch , just a mistake , sorry please

in dmfe_resume I mixed DMFE_WOL_LINKCHANGE | DMFE_WOL_MAGICPACKET , and 
WAKE_PHY | WAKE_MAGIC

here goes updated patch:

From: Maxim Levitsky <[EMAIL PROTECTED]>
Subject: [PATCH] [NET] [005] dmfe : Add support for wake-on-lan

Adds support for wake on lan feature

Signed-off-by: Maxim Levitsky <[EMAIL PROTECTED]>

---

This board supports WOL on magic packet / link change / specific packet
This adds support for WOL on magic packet / link change

Note : WOL is enabled when you suspend system ether to disk or ram, and is not 
enabled when you
turn system off


--- linux-2.6.20-mod/drivers/net/tulip/dmfe.c   2007-02-07 18:53:19.0 
+0200
+++ linux-2.6.20-test/drivers/net/tulip/dmfe.c  2007-02-07 18:55:44.0 
+0200
@@ -122,6 +122,11 @@
 #define DM9801_NOISE_FLOOR 8
 #define DM9802_NOISE_FLOOR 5
 
+#define DMFE_WOL_LINKCHANGE0x2000
+#define DMFE_WOL_SAMPLEPACKET  0x1000
+#define DMFE_WOL_MAGICPACKET   0x0800
+
+
 #define DMFE_10MHF  0
 #define DMFE_100MHF 1
 #define DMFE_10MFD  4
@@ -242,6 +247,7 @@ struct dmfe_board_info {
u8 wait_reset;  /* Hardware failed, need to reset */
u8 dm910x_chk_mode; /* Operating mode check */
u8 first_in_callback;   /* Flag to record state */
+   u8 wol_mode;/* user WOL settings */
struct timer_list timer;
 
/* System defined statistic counter */
@@ -423,6 +429,7 @@ static int __devinit dmfe_init_one (stru
db->chip_id = ent->driver_data;
db->ioaddr = pci_resource_start(pdev, 0);
db->chip_revision = dev_rev;
+   db->wol_mode = 0;
 
db->pdev = pdev;
 
@@ -1054,7 +1061,11 @@ static void dmfe_set_filter_mode(struct 
spin_unlock_irqrestore(&db->lock, flags);
 }
 
-static void netdev_get_drvinfo(struct net_device *dev,
+/*
+ * Ethtool interace 
+ */
+
+static void dmfe_ethtool_get_drvinfo(struct net_device *dev,
   struct ethtool_drvinfo *info)
 {
struct dmfe_board_info *np = netdev_priv(dev);
@@ -1068,9 +1079,35 @@ static void netdev_get_drvinfo(struct ne
dev->base_addr, dev->irq);
 }
 
+static int dmfe_ethtool_set_wol(struct net_device *dev, 
+   struct ethtool_wolinfo *wolinfo)
+{
+   struct dmfe_board_info *db = netdev_priv(dev);
+   
+   if (wolinfo->wolopts & (WAKE_UCAST | WAKE_MCAST | WAKE_BCAST | 
+   WAKE_ARP | WAKE_MAGICSECURE))
+  return -EOPNOTSUPP;
+   
+   db->wol_mode = wolinfo->wolopts;
+   return 0;
+}
+
+static void dmfe_ethtool_get_wol(struct net_device *dev, 
+struct ethtool_wolinfo *wolinfo)
+{
+   struct dmfe_board_info *db = netdev_priv(dev);
+   
+   wolinfo->supported = WAKE_PHY | WAKE_MAGIC;
+   wolinfo->wolopts = db->wol_mode;
+   return;
+}
+
+
 static const struct ethtool_ops netdev_ethtool_ops = {
-   .get_drvinfo= netdev_get_drvinfo,
+   .get_drvinfo= dmfe_ethtool_get_drvinfo,
.get_link   = ethtool_op_get_link,
+   .set_wol= dmfe_ethtool_set_wol,
+   .get_wol= dmfe_ethtool_get_wol,
 };
 
 /*
@@ -2046,6 +2083,20 @@ static int dmfe_suspend(struct pci_dev *
 /* Fre RX buffers */
 dmfe_free_rxbuffer(db);
 
+/* Enable WOL */
+pci_read_config_dword(pci_dev, 0x40, &tmp);
+tmp &= ~(DMFE_WOL_LINKCHANGE|DMFE_WOL_MAGICPACKET);
+
+if (db->wol_mode & WAKE_PHY)
+   tmp |= DMFE_WOL_LINKCHANGE;
+if (db->wol_mode & WAKE_MAGIC)
+   tmp |= DMFE_WOL_MAGICPACKET;
+
+pci_write_config_dword(pci_dev, 0x40, tmp);
+
+pci_enable_wake(pci_dev, PCI_D3hot, 1);
+pci_enable_wake(pci_dev, PCI_D3cold, 1);
+
 /* Power down device*/
 pci_set_power_state(pci_dev ,  pci_choose_state(pci_dev,state));
 pci_save_state(pci_dev);
@@ -2064,6 +2115,15 @@ static int dmfe_resume(struct pci_dev *p
 /* Re-initilize DM910X board */
 dmfe_init_dm910x(dev);
 
+/* Disable WOL */
+pci_read_config_dword(pci_dev, 0x40, &tmp);
+
+tmp &= (DMFE_WOL_LINKCHANGE | DMFE_WOL_MAGICPACKET);
+pci_write_config_dword(pci_dev, 0x40, tmp);
+
+pci_enable_wake(pci_dev, PCI_D3hot, 0);
+pci_enable_wake(pci_dev, PCI_D3cold, 0);
+
 /* Restart upper layer interface */
 netif_device_attach(dev);
 



 

No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail 
-
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: dynticks + iptables almost stops the boot process [was: Re: 2.6.20-rc6-mm3]

2007-02-07 Thread Ingo Molnar

* Andrew Morton <[EMAIL PROTECTED]> wrote:

> On Wed, 07 Feb 2007 00:17:33 +0100
> Thomas Gleixner <[EMAIL PROTECTED]> wrote:
> 
> > On Wed, 2007-02-07 at 00:12 +0100, Tilman Schmidt wrote:
> > > > No, not this. Anyway the last patch Thomas forwarded does fix the
> > > > problem.
> > > 
> > > Which one would that be? I might try it for comparison.
> > 
> > Find the combined patch of all fixlets on top of -mm3 below.
> 
> err, I don't have most of this.
> 
> I just uploaded the crappile-of-the-moment to
>
> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/mm/broken-out-2007-02-06-16-59.tar.gz

hm:

 ERROR 404: Not Found.

pls. do:

ssh master.kernel.org chmod a+r 
/pub/linux/kernel/people/akpm/mm/broken-out-2007-02-06-16-59.tar.gz

Ingo
-
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] [NETDEV] [002] dmfe : Fix possible oops

2007-02-07 Thread Levitsky Maxim
From: Maxim Levitsky <[EMAIL PROTECTED]>
Subject: [PATCH] [NET] [002] dmfe : Fix possible oops

Deallocate memory after driver is unregistred to prevent oops
Don't dereference NULL pointer that can be returned by dev_alloc_skb in case of 
oom

Signed-off-by: Maxim Levitsky <[EMAIL PROTECTED]>

---

--- linux-2.6.20-mod/drivers/net/tulip/dmfe.c   2007-02-07 18:27:07.0 
+0200
+++ linux-2.6.20-test/drivers/net/tulip/dmfe.c  2007-02-07 18:27:59.0 
+0200
@@ -497,13 +497,16 @@ static void __devexit dmfe_remove_one (s
DMFE_DBUG(0, "dmfe_remove_one()", 0);
 
    if (dev) {
+   
+   unregister_netdev(dev);
+   pci_release_regions(pdev);
+   
+   
pci_free_consistent(db->pdev, sizeof(struct tx_desc) *
DESC_ALL_CNT + 0x20, db->desc_pool_ptr,
    db->desc_pool_dma_ptr);
pci_free_consistent(db->pdev, TX_BUF_ALLOC * TX_DESC_CNT + 4,
db->buf_pool_ptr, db->buf_pool_dma_ptr);
-   unregister_netdev(dev);
-   pci_release_regions(pdev);
free_netdev(dev);   /* free board information */
pci_set_drvdata(pdev, NULL);
}
@@ -921,7 +924,7 @@ static inline u32 cal_CRC(unsigned char 
 static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db)
 {
struct rx_desc *rxptr;
-   struct sk_buff *skb;
+   struct sk_buff *skb, *newskb;
int rxlen;
u32 rdes0;
 
@@ -974,8 +977,10 @@ static void dmfe_rx_packet(struct DEVICE
/* Good packet, send to upper layer */
/* Shorst packet used new SKB */
if ( (rxlen < RX_COPY_SIZE) &&
-   ( (skb = dev_alloc_skb(rxlen + 
2) )
+   ( (newskb = dev_alloc_skb(rxlen 
+ 2) )
!= NULL) ) {
+   
+   skb = newskb;
/* size less than COPY_SIZE, 
allocate a rxlen SKB
*/
skb->dev = dev;
skb_reserve(skb, 2); /* 16byte 
align */



 

8:00? 8:25? 8:40? Find a flick in no time 
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news
-
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


[Fwd: [Netem] [PATCH 2.6.18 0/2] LARTC: trace control for netem]

2007-02-07 Thread Rainer Baumann
Hi Stephen

I just wanted to ask you, if you already had time to test our trace
extension for netem as discussed on the 13th of December.

Cheers
Rainer

Rainer Baumann wrote:
> Hi Stephen
>
> As discussed yesterday, here our patches to integrate trace control into netem
>
>
>
> Trace Control for Netem: Emulate network properties such as long range 
> dependency and self-similarity of cross-traffic.
>
> A new option (trace) has been added to the netem command. If the trace option 
> is used, the values for packet delay etc. are read from a pregenerated trace 
> file, afterwards the packets are processed by the normal netem functions. The 
> packet action values are readout from the trace file in user space and sent 
> to kernel space via configfs.
>
>
>
>
>
>
>
> ___
> Netem mailing list
> [EMAIL PROTECTED]
> https://lists.osdl.org/mailman/listinfo/netem
>   






-
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] [NETDEV] [001] dmfe : trivial/spelling fixes

2007-02-07 Thread Levitsky Maxim
From: Maxim Levitsky <[EMAIL PROTECTED]>
Subject: [PATCH] [NET] [001] dmfe : trivial/spelling fixes

Fix a typo, and wrap lines on 80-th column

Signed-off-by: Maxim Levitsky <[EMAIL PROTECTED]>

---

--- linux-2.6.20-org/drivers/net/tulip/dmfe.c   2007-02-03 11:47:52.0 
+0200
+++ linux-2.6.20-mod/drivers/net/tulip/dmfe.c   2007-02-07 14:41:29.0 
+0200
@@ -143,9 +145,13 @@
 #define DMFE_TX_TIMEOUT ((3*HZ)/2) /* tx packet time-out time 1.5 s" */
 #define DMFE_TX_KICK   (HZ/2)  /* tx packet Kick-out time 0.5 s" */
 
-#define DMFE_DBUG(dbug_now, msg, value) if (dmfe_debug || (dbug_now)) 
printk(KERN_ERR DRV_NAME ":
%s %lx\n", (msg), (long) (value))
+#define DMFE_DBUG(dbug_now, msg, value) if (dmfe_debug || (dbug_now)) \
+   printk(KERN_ERR DRV_NAME ": %s %lx\n", (msg), (long) (value))
 
-#define SHOW_MEDIA_TYPE(mode) printk(KERN_ERR DRV_NAME ": Change Speed to 
%sMhz %s duplex\n",mode
& 1 ?"100":"10", mode & 4 ? "full":"half");
+#define SHOW_MEDIA_TYPE(mode) \
+   printk(KERN_ERR DRV_NAME ": \
+   Change Speed to %sMhz %s duplex\n",mode & 1 ?"100":"10", \
+   mode & 4 ? "full":"half");
 
 
 /* CR9 definition: SROM/MII */
@@ -163,10 +169,17 @@
 
 #define SROM_V41_CODE   0x14
 
-#define SROM_CLK_WRITE(data, ioaddr)
outl(data|CR9_SROM_READ|CR9_SRCS,ioaddr);udelay(5);outl(data|CR9_SROM_READ|CR9_SRCS|CR9_SRCLK,ioaddr);udelay(5);outl(data|CR9_SROM_READ|CR9_SRCS,ioaddr);udelay(5);
+#define SROM_CLK_WRITE(data, ioaddr) \
+   outl(data|CR9_SROM_READ|CR9_SRCS,ioaddr);udelay(5);\
+   outl(data|CR9_SROM_READ|CR9_SRCS|CR9_SRCLK,ioaddr);udelay(5);\
+   outl(data|CR9_SROM_READ|CR9_SRCS,ioaddr);udelay(5);
+
+#define __CHK_IO_SIZE(pci_id, dev_rev) \
+   ( ((pci_id)==PCI_DM9132_ID) || ((dev_rev) >= 0x0230) ) ? \
+   DM9102A_IO_SIZE: DM9102_IO_SIZE
 
-#define __CHK_IO_SIZE(pci_id, dev_rev) ( ((pci_id)==PCI_DM9132_ID) || 
((dev_rev) >= 0x0230) )
? DM9102A_IO_SIZE: DM9102_IO_SIZE
-#define CHK_IO_SIZE(pci_dev, dev_rev) __CHK_IO_SIZE(((pci_dev)->device << 16) |
(pci_dev)->vendor, dev_rev)
+#define CHK_IO_SIZE(pci_dev, dev_rev) \
+   __CHK_IO_SIZE(((pci_dev)->device << 16) | (pci_dev)->vendor, dev_rev)
 
 /* Sten Check */
 #define DEVICE net_device
@@ -329,7 +342,7 @@ static void dmfe_program_DM9802(struct d
 static void dmfe_HPNA_remote_cmd_chk(struct dmfe_board_info * );
 static void dmfe_set_phyxcer(struct dmfe_board_info *);
 
-/* DM910X network baord routine  */
+/* DM910X network board routine  */
 
 /*
  * Search DM910X board ,allocate space and register it
@@ -402,8 +415,11 @@ static int __devinit dmfe_init_one (stru
db->dev = dev;
 
/* Allocate Tx/Rx descriptor memory */
-   db->desc_pool_ptr = pci_alloc_consistent(pdev, sizeof(struct tx_desc) * 
DESC_ALL_CNT +
0x20,
&db->desc_pool_dma_ptr);
-   db->buf_pool_ptr = pci_alloc_consistent(pdev, TX_BUF_ALLOC * 
TX_DESC_CNT + 4,
&db->buf_pool_dma_ptr);
+   db->desc_pool_ptr = pci_alloc_consistent(pdev, sizeof(struct tx_desc) 
+   * DESC_ALL_CNT + 0x20, &db->desc_pool_dma_ptr);
+   
+   db->buf_pool_ptr = pci_alloc_consistent(pdev, TX_BUF_ALLOC 
+   * TX_DESC_CNT + 4, &db->buf_pool_dma_ptr);
 
db->first_tx_desc = (struct tx_desc *) db->desc_pool_ptr;
db->first_tx_desc_dma = db->desc_pool_dma_ptr;
@@ -440,7 +457,8 @@ static int __devinit dmfe_init_one (stru
 
/* read 64 word srom data */
for (i = 0; i < 64; i++)
-   ((u16 *) db->srom)[i] = cpu_to_le16(read_srom_word(db->ioaddr, 
i));
+   ((u16 *) db->srom)[i] = 
+   cpu_to_le16(read_srom_word(db->ioaddr, i));
 
/* Set Node address */
for (i = 0; i < 6; i++)
@@ -722,7 +742,8 @@ static int dmfe_stop(struct DEVICE *dev)
 
 #if 0
/* show statistic counter */
-   printk(DRV_NAME ": FU:%lx EC:%lx LC:%lx NC:%lx LOC:%lx TXJT:%lx 
RESET:%lx RCR8:%lx FAL:%lx
TT:%lx\n",
+   printk(DRV_NAME ": FU:%lx EC:%lx LC:%lx NC:%lx LOC:%lx TXJT:%lx 
+   RESET:%lx RCR8:%lx FAL:%lx TT:%lx\n",
db->tx_fifo_underrun, db->tx_excessive_collision,
db->tx_late_collision, db->tx_no_carrier, db->tx_loss_carrier,
db->tx_jabber_timeout, db->reset_count, db->reset_cr8,
@@ -919,7 +940,8 @@ static void dmfe_rx_packet(struct DEVICE
db->rx_avail_cnt--;
db->interval_rx_cnt++;
 
-   pci_unmap_single(db->pdev, le32_to_cpu(rxptr->rdes2), 
RX_ALLOC_SIZE,
PCI_DMA_FROMDEVICE);
+   pci_unmap_single(db->pdev, le32_to_cpu(rxptr->rdes2), 
+    RX_ALLOC_SIZE, PCI_DMA_FROMDEVICE);
if ( (rdes0 & 0x300) != 0x300) {
/* A packet without First/Last flag */
/* reuse this SKB */
@@ -1259,7 +1334,8 @@ static void dmfe_reuse_skb(struct dmfe_b
 
if (!(rxptr->rdes0 & cpu_to_le3

[PATCH] [NETDEV] [005] dmfe : Add support for wake-on-lan

2007-02-07 Thread Levitsky Maxim
From: Maxim Levitsky <[EMAIL PROTECTED]>
Subject: [PATCH] [NETDEV] [005] dmfe : Add support for wake-on-lan

Adds support for wake on lan feature

Signed-off-by: Maxim Levitsky <[EMAIL PROTECTED]>

---

This board supports WOL on magic packet / link change / specific packet
This adds support for WOL on magic packet / link change

Note : WOL is enabled when you suspend system ether to disk or ram, and is not 
enabled when you
turn system off


--- linux-2.6.20-mod/drivers/net/tulip/dmfe.c   2007-02-07 18:53:19.0 
+0200
+++ linux-2.6.20-test/drivers/net/tulip/dmfe.c  2007-02-07 18:55:44.0 
+0200
@@ -122,6 +122,11 @@
 #define DM9801_NOISE_FLOOR 8
 #define DM9802_NOISE_FLOOR 5
 
+#define DMFE_WOL_LINKCHANGE0x2000
+#define DMFE_WOL_SAMPLEPACKET  0x1000
+#define DMFE_WOL_MAGICPACKET   0x0800
+
+
 #define DMFE_10MHF      0
 #define DMFE_100MHF     1
 #define DMFE_10MFD      4
@@ -242,6 +247,7 @@ struct dmfe_board_info {
u8 wait_reset;  /* Hardware failed, need to reset */
u8 dm910x_chk_mode; /* Operating mode check */
u8 first_in_callback;   /* Flag to record state */
+   u8 wol_mode;/* user WOL settings */
struct timer_list timer;
 
/* System defined statistic counter */
@@ -423,6 +429,7 @@ static int __devinit dmfe_init_one (stru
db->chip_id = ent->driver_data;
db->ioaddr = pci_resource_start(pdev, 0);
db->chip_revision = dev_rev;
+   db->wol_mode = 0;
 
db->pdev = pdev;
 
@@ -1054,7 +1061,11 @@ static void dmfe_set_filter_mode(struct 
spin_unlock_irqrestore(&db->lock, flags);
 }
 
-static void netdev_get_drvinfo(struct net_device *dev,
+/*
+ * Ethtool interace 
+ */
+
+static void dmfe_ethtool_get_drvinfo(struct net_device *dev,
       struct ethtool_drvinfo *info)
 {
struct dmfe_board_info *np = netdev_priv(dev);
@@ -1068,9 +1079,35 @@ static void netdev_get_drvinfo(struct ne
dev->base_addr, dev->irq);
 }
 
+static int dmfe_ethtool_set_wol(struct net_device *dev, 
+   struct ethtool_wolinfo *wolinfo)
+{
+   struct dmfe_board_info *db = netdev_priv(dev);
+   
+   if (wolinfo->wolopts & (WAKE_UCAST | WAKE_MCAST | WAKE_BCAST | 
+       WAKE_ARP | WAKE_MAGICSECURE))
+      return -EOPNOTSUPP;
+   
+   db->wol_mode = wolinfo->wolopts;
+   return 0;
+}
+
+static void dmfe_ethtool_get_wol(struct net_device *dev, 
+    struct ethtool_wolinfo *wolinfo)
+{
+   struct dmfe_board_info *db = netdev_priv(dev);
+   
+   wolinfo->supported = WAKE_PHY | WAKE_MAGIC;
+   wolinfo->wolopts = db->wol_mode;
+   return;
+}
+
+
 static const struct ethtool_ops netdev_ethtool_ops = {
-   .get_drvinfo= netdev_get_drvinfo,
+   .get_drvinfo= dmfe_ethtool_get_drvinfo,
.get_link               = ethtool_op_get_link,
+   .set_wol= dmfe_ethtool_set_wol,
+   .get_wol= dmfe_ethtool_get_wol,
 };
 
 /*
@@ -2046,6 +2083,20 @@ static int dmfe_suspend(struct pci_dev *
     /* Fre RX buffers */
     dmfe_free_rxbuffer(db);
 
+    /* Enable WOL */
+    pci_read_config_dword(pci_dev, 0x40, &tmp);
+    tmp &= ~(WAKE_PHY|WAKE_MAGIC);
+    
+    if (db->wol_mode & WAKE_PHY)
+       tmp |= DMFE_WOL_LINKCHANGE;
+    if (db->wol_mode & WAKE_MAGIC)
+       tmp |= DMFE_WOL_MAGICPACKET;
+    
+    pci_write_config_dword(pci_dev, 0x40, tmp);
+    
+    pci_enable_wake(pci_dev, PCI_D3hot, 1);
+    pci_enable_wake(pci_dev, PCI_D3cold, 1);
+    
     /* Power down device*/
     pci_set_power_state(pci_dev ,  pci_choose_state(pci_dev,state));
     pci_save_state(pci_dev);
@@ -2064,6 +2115,15 @@ static int dmfe_resume(struct pci_dev *p
     /* Re-initilize DM910X board */
     dmfe_init_dm910x(dev);
         
+    /* Disable WOL */
+    pci_read_config_dword(pci_dev, 0x40, &tmp);
+    
+    tmp &= (DMFE_WOL_LINKCHANGE | DMFE_WOL_MAGICPACKET);
+    pci_write_config_dword(pci_dev, 0x40, tmp);
+    
+    pci_enable_wake(pci_dev, PCI_D3hot, 0);
+    pci_enable_wake(pci_dev, PCI_D3cold, 0);
+    
     /* Restart upper layer interface */
     netif_device_attach(dev);


 

Food fight? Enjoy some healthy debate 
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367
-
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] [NETDEV] [000] dmfe : fix bugs and add features

2007-02-07 Thread Levitsky Maxim
Hello,

Before some time I decided to fix suspend/resume on my Davicom network card.
During development I also fixed couple of bugs and added support for link 
detection and WOL
Note : 2.6.20 already has support for link detection , but it is broken when 
card has external PHY
, like mine.

So here it goes:

[PATCH] [NET] [001] dmfe : trivial/spelling fixes
[PATCH] [NET] [002] dmfe : Fix possible oops
[PATCH] [NET] [003] dmfe : fix link detection
[PATCH] [NET] [004] dmfe : Add suspend/resume support
[PATCH] [NET] [005] dmfe : Add support for wake-on-lan

        Maxim Levitsky


 

Finding fabulous fares is fun.  
Let Yahoo! FareChase search your favorite travel sites to find flight and hotel 
bargains.
http://farechase.yahoo.com/promo-generic-14795097
-
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] [NETDEV] [004] dmfe : Add suspend/resume support

2007-02-07 Thread Levitsky Maxim
From: Maxim Levitsky <[EMAIL PROTECTED]>
Subject: [PATCH] [NETDEV] [004] dmfe : Add suspend/resume support

Adds support for suspend/resume

---


--- linux-2.6.20-mod/drivers/net/tulip/dmfe.c   2007-02-07 18:46:13.0 
+0200
+++ linux-2.6.20-test/drivers/net/tulip/dmfe.c  2007-02-07 18:50:52.0 
+0200
@@ -55,9 +55,6 @@
 
     TODO
 
-    Implement pci_driver::suspend() and pci_driver::resume()
-    power management methods.
-
     Check on 64 bit boxes.
     Check and fix on big endian boxes.
 
@@ -2027,11 +2024,59 @@ static struct pci_device_id dmfe_pci_tbl
 MODULE_DEVICE_TABLE(pci, dmfe_pci_tbl);
 
 
+
+static int dmfe_suspend(struct pci_dev *pci_dev, pm_message_t state)
+{
+    u32 tmp;
+
+    struct net_device *dev = pci_get_drvdata(pci_dev);
+    struct dmfe_board_info *db = netdev_priv(dev);
+    
+    /* Disable upper layer interface */
+    netif_device_detach(dev);
+    
+    /* Disable Tx/Rx */
+    db->cr6_data &= ~(CR6_RXSC | CR6_TXSC);
+    update_cr6(db->cr6_data, dev->base_addr);
+    
+    /* Disable Interrupt */
+    outl(0, dev->base_addr + DCR7);
+    outl(inl(dev->base_addr + DCR5), dev->base_addr + DCR5);
+    
+    /* Fre RX buffers */
+    dmfe_free_rxbuffer(db);
+
+    /* Power down device*/
+    pci_set_power_state(pci_dev ,  pci_choose_state(pci_dev,state));
+    pci_save_state(pci_dev);
+
+    return 0;
+}
+
+static int dmfe_resume(struct pci_dev *pci_dev)
+{
+    struct net_device *dev = pci_get_drvdata(pci_dev);
+    u32 tmp;
+
+    pci_restore_state(pci_dev);
+    pci_set_power_state(pci_dev ,PCI_D0);
+    
+    /* Re-initilize DM910X board */
+    dmfe_init_dm910x(dev);
+        
+    /* Restart upper layer interface */
+    netif_device_attach(dev);
+
+    return 0;
+}
+
 static struct pci_driver dmfe_driver = {
.name   = "dmfe",
.id_table   = dmfe_pci_tbl,
.probe  = dmfe_init_one,
.remove = __devexit_p(dmfe_remove_one),
+        .suspend        = dmfe_suspend,
+        .resume         = dmfe_resume
 };
 
 MODULE_AUTHOR("Sten Wang, [EMAIL PROTECTED]");



 

Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com
-
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] [NETDEV] [003] dmfe : fix link detection

2007-02-07 Thread Levitsky Maxim
From: Maxim Levitsky <[EMAIL PROTECTED]>
Subject: [PATCH] [NET] [003] dmfe : fix link detection

Cleanup link detection
Fix link not detected when using external PHY

Signed-off-by: Maxim Levitsky <[EMAIL PROTECTED]>

---

CR12's bits 0 and 1 show link status/speed only for internal PHY.
In case external one is used, only bit 6 shows link status via special line , 
and can be left
unnconected
Thus we need to check bit 6 and also query PHY for link status
Note: internal phy is standard phy , so will indicate link status too.

--- linux-2.6.20-mod/drivers/net/tulip/dmfe.c   2007-02-07 18:40:33.0 
+0200
+++ linux-2.6.20-test/drivers/net/tulip/dmfe.c  2007-02-07 18:44:01.0 
+0200
@@ -147,7 +147,7 @@
printk(KERN_ERR DRV_NAME ": %s %lx\n", (msg), (long) (value))
 
 #define SHOW_MEDIA_TYPE(mode) \
-   printk(KERN_ERR DRV_NAME ": \
+   printk(KERN_INFO DRV_NAME ": \
Change Speed to %sMhz %s duplex\n",mode & 1 ?"100":"10", \
mode & 4 ? "full":"half");
 
@@ -242,7 +242,6 @@ struct dmfe_board_info {
u8 media_mode;  /* user specify media mode */
u8 op_mode; /* real work media mode */
u8 phy_addr;
-   u8 link_failed; /* Ever link failed */
u8 wait_reset;  /* Hardware failed, need to reset */
u8 dm910x_chk_mode; /* Operating mode check */
u8 first_in_callback;   /* Flag to record state */
@@ -536,7 +535,6 @@ static int dmfe_open(struct DEVICE *dev)
db->tx_packet_cnt = 0;
db->tx_queue_cnt = 0;
db->rx_avail_cnt = 0;
-   db->link_failed = 1;
db->wait_reset = 0;
 
db->first_in_callback = 0;
@@ -1091,6 +1089,8 @@ static void dmfe_timer(unsigned long dat
struct dmfe_board_info *db = netdev_priv(dev);
    unsigned long flags;
 
+   int link_ok, link_ok_phy;
+
DMFE_DBUG(0, "dmfe_timer()", 0);
spin_lock_irqsave(&db->lock, flags);
 
@@ -1155,22 +1155,45 @@ static void dmfe_timer(unsigned long dat
else
tmp_cr12 = inb(db->ioaddr + DCR12); /* DM9102/DM9102A */
 
+   
if ( ((db->chip_id == PCI_DM9102_ID) &&
(db->chip_revision == 0x0230)) ||
((db->chip_id == PCI_DM9132_ID) &&
(db->chip_revision == 0x0210)) ) {
/* DM9102A Chip */
if (tmp_cr12 & 2)
-   tmp_cr12 = 0x0; /* Link failed */
+   link_ok = 0;
else
-   tmp_cr12 = 0x3; /* Link OK */
+   link_ok = 1;
+   }
+   else
+   /*0x43 is used instead of 0x3 because bit 6 should be 
+   connected to external PHY and specify its link status.*/
+   link_ok = (tmp_cr12 & 0x43) ? 1 : 0;
+   
+   
+   /* If chip reports that link is failed it could be because external 
+   PHY is not conected correctly to chip (through pin 89).
+   To be sure ask PHY too.
+   */
+   
+   /* need a dummy read because of PHY's register latch*/
+   phy_read (db->ioaddr, db->phy_addr, 1, db->chip_id); 
+   link_ok_phy = (phy_read (db->ioaddr, 
+          db->phy_addr, 1, db->chip_id) & 0x4) ? 1 : 0;
+   
+
+   
+   if (link_ok_phy != link_ok) {
+   DMFE_DBUG (0, "PHY and chip report different link status", 0);
+   link_ok = link_ok | link_ok_phy;
}
 
-   if ( !(tmp_cr12 & 0x3) && !db->link_failed ) {
+   if ( !link_ok && netif_carrier_ok(dev) ) {
/* Link Failed */
DMFE_DBUG(0, "Link Failed", tmp_cr12);
-   db->link_failed = 1;
-   netif_carrier_off(db->dev);
+   
+   netif_carrier_off(dev);
 
/* For Force 10/100M Half/Full mode: Enable Auto-Nego mode */
/* AUTO or force 1M Homerun/Longrun don't need */
@@ -1184,19 +1207,17 @@ static void dmfe_timer(unsigned long dat
db->cr6_data&=~0x0200;  /* bit9=0, HD mode */
update_cr6(db->cr6_data, db->ioaddr);
}
-   } else
-   if ((tmp_cr12 & 0x3) && db->link_failed) {
-   DMFE_DBUG(0, "Link link OK", tmp_cr12);
-   db->link_failed = 0;
+   
+   } else if (!netif_carrier_ok(dev)) {
+   
+   DMFE_DBUG(0, "Link OK", tmp_cr12);
 
/* Auto Sense Speed */
-   if ( (db->media_mode & DMFE_AUTO) &&
-   dmfe_sense_speed(db) )
-   db->link_failed = 1;
-   else
-   netif_carrier_on(db->dev);
+   if (! (db->media_mode & DMFE_AUTO) || !dmfe_sense_speed(db)) {
+   netif_carrier_on(dev)

[PATCH] sk98lin: planned removal

2007-02-07 Thread Stephen Hemminger
Document planned removal of sk98lin driver.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
---
 Documentation/feature-removal-schedule.txt |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/Documentation/feature-removal-schedule.txt 
b/Documentation/feature-removal-schedule.txt
index 0ba6af0..d08a4af 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -325,3 +325,10 @@ Why:   Unmaintained for years, superceded 
 Who:   Jeff Garzik <[EMAIL PROTECTED]>
 
 ---
+
+What:   sk98lin network driver
+When:   July 2007
+Why:In kernel tree version of driver is unmaintained. Sk98lin driver
+   replaced by the skge driver. 
+Who:Stephen Hemminger <[EMAIL PROTECTED]>
+
-- 
1.4.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


Re: Funny Routing change since 2.6.16.x

2007-02-07 Thread Patrick McHardy
Ingo Oeser wrote:
> Patrick McHardy schrieb:
> 
>>My guess is that you're using MASQUERADE on ppp0, which since 2.6.14
>>doesn't exclude locally generated packets anymore, so it translates
>>them to the primary ppp0 address. For replies it works because NAT
>>is already set up for the incoming packet, without masquerading.
> 
> 
> Your guess is right! Thanks for that hint. Do you have any idea, how to
> restore the old behavior? 
> 
> I have to, because the ISP cannot assign a different local address
> and have problems with the new behavior, because that IP adress is an MX entry
> and the VPN gateway address for several third party vendor tunnels. 
> So changing that is quite an effort.


Since these packets already have the proper source address chosen
by routing, there is no need to NAT them anymore. So the easiest
fix is to exclude them manually from masquerading based on the
address.
-
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: Funny Routing change since 2.6.16.x

2007-02-07 Thread Ingo Oeser
Patrick McHardy schrieb:
> My guess is that you're using MASQUERADE on ppp0, which since 2.6.14
> doesn't exclude locally generated packets anymore, so it translates
> them to the primary ppp0 address. For replies it works because NAT
> is already set up for the incoming packet, without masquerading.

Your guess is right! Thanks for that hint. Do you have any idea, how to
restore the old behavior? 

I have to, because the ISP cannot assign a different local address
and have problems with the new behavior, because that IP adress is an MX entry
and the VPN gateway address for several third party vendor tunnels. 
So changing that is quite an effort.

Many thanks for your quick answer.

Best regards

Ingo Oeser
-
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: Funny Routing change since 2.6.16.x

2007-02-07 Thread Patrick McHardy
Ingo Oeser wrote:
> Dear network gurus,
> 
> I used to change the source address on an PPPoE connection by using
> these commands:
> 
> /sbin/ifconfig ppp0:1 $SRCADDR
> /sbin/ip route add default dev ppp0 src $SRCADDR
> 
> where SRCADDR is an address in a different network
> than the local and peer address for ppp0.
> 
> That works fine until Linux 2.6.13.1.
> 
> When I use Kernel 2.6.16.32, 2.6.19.2 or 2.6.19.3
> this stops working.
> 
> Funnily it WORKS, when the machine just has to answer.
> It DOESN'T work, when the machine initiates an connection.
> 
> I verified that on the receiving side of a ping with tcpdump.
> 
> I also verified that "ip route get $OTHER_HOST" would use the route 
> with src address  set to "SRCADDR" from above.
> 
> I tried using a default route like "ip route add default via $GATEWAY src 
> $SRCADDR",
> but that doesn't work either.
> 
> I attached the config for the old working kernel and the 2.6.19.3 config
> for reference.
> 
> We noticed no problems with ethernet alias interfaces.
> 
> The (production) machine is a PC doing SNAT, DNAT, MASQUERADE 
> and iptables based stateful inspection firewalling. Policy routing is 
> compiled in, but not used at all.
> 
> If you need the iptables rules anyway, just tell me.

My guess is that you're using MASQUERADE on ppp0, which since 2.6.14
doesn't exclude locally generated packets anymore, so it translates
them to the primary ppp0 address. For replies it works because NAT
is already set up for the incoming packet, without masquerading.
-
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/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Timur Tabi

Kumar Gala wrote:

If its been mapped with ioremap() you know the physical address already 
so why do you need iopa().  


That's what the original function immrbar_virt_to_phys() does.  We're trying to 
get rid of it, because we thought is redundant with iopa().


static inline unsigned long immrbar_virt_to_phys(volatile void * address)
{
if ( ((u32)address >= (u32)qe_immr) &&
((u32)address < ((u32)qe_immr + QE_IMMAP_SIZE)) )
return (unsigned long)(address - (u32)qe_immr +
(u32)get_qe_base());
return (unsigned long)virt_to_phys(address);
}

get_qe_base() does a search of the OF tree the first time it's called.

Here's the code that calls immrbar_virt_to_phys():

out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
 (u32) immrbar_virt_to_phys(ugeth->
p_tx_bd_ring[i]));


Would it be better to replace this code with something like this:

out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
get_qe_base() + ((void *) ugeth->p_tx_bd_ring[i] - (void *) qe_immr));


--
Timur Tabi
Linux Kernel Developer @ Freescale
-
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/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Kumar Gala


On Feb 7, 2007, at 10:43 AM, Timur Tabi wrote:


Kumar Gala wrote:

On Feb 6, 2007, at 5:31 AM, Li Yang wrote:

Get rid of private immrbar_virt_to_phys() routine and
use generic iopa().
Nack. iopa() isn't that generic, shouldn't we really be using the  
dma mapping API here?


I'm having a hard time understanding what's wrong with iopa().  Is  
it because it's a 32-bit only function?  The memory has already  
been mapped with ioremap(), so why would we want to map it again?


If its been mapped with ioremap() you know the physical address  
already so why do you need iopa().  The problem I have is iopa() is  
ppc specific and I can envision a day when someone wants to run Linux  
on a StarCore + QE, so having the drivers using ppc specific APIs is  
bad.


- k
-
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/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Kumar Gala


On Feb 7, 2007, at 3:34 AM, Li Yang-r58472 wrote:


On Feb 6, 2007, at 5:31 AM, Li Yang wrote:


Get rid of private immrbar_virt_to_phys() routine and
use generic iopa().


Nack. iopa() isn't that generic, shouldn't we really be using the dma
mapping API here?


Do you mean the dma_map_single()?  dma_map_single can map memory space
correctly, but I don't think it can handle ioremap-ed space.


What are you mapping?  It looks like buffer descriptor rings.  Are  
they being kept in QE sram?  If so that I think you can treat it as  
memory.  (I believe the SRAM behaves like memory, is cache-coherent,  
etc).


- k
-
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: when having to acquire an SA, ipsec drops the packet

2007-02-07 Thread Joy Latten
>From: Joy Latten <[EMAIL PROTECTED]>
>Date: Mon, 05 Feb 2007 14:53:39 -0600
>
>> I can run some tests with this patch and report any results... 
>
>Please check out the two most recent patches I posted:
>
>1) Updated core patch with ipv6 side added.
>2) Fix for thinko noticed by Venkat.

Just a quick update. I have patched an lspp kernel and 
latest kernel.org kernel. I have been using them alternately
while doing some minor testing and have not found any problems.
Over the next few days, I plan to run a few stress tests for 
labeled ipsec and regular ipsec and will do so with the patched
lspp kernel.  I will also try with kernel.org kernel.
It may take a few days. 

Regards,
Joy
-
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/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Timur Tabi

Kumar Gala wrote:


On Feb 6, 2007, at 5:31 AM, Li Yang wrote:


Get rid of private immrbar_virt_to_phys() routine and
use generic iopa().


Nack. iopa() isn't that generic, shouldn't we really be using the dma 
mapping API here?


I'm having a hard time understanding what's wrong with iopa().  Is it because 
it's a 32-bit only function?  The memory has already been mapped with ioremap(), 
so why would we want to map it again?


--
Timur Tabi
Linux Kernel Developer @ Freescale
-
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] AT91: MACB support

2007-02-07 Thread Haavard Skinnemoen
From: Andrew Victor <[EMAIL PROTECTED]>

The Atmel MACB Ethernet peripheral is also integrated in the AT91SAM9260
and AT91SAM9263 processors.  The differences from the AVR32 version are:
  * Single peripheral clock.
  * MII/RMII selection bit is inverted.
  * Clock enable bit.

Original patch from Patrice Vilchez.

Signed-off-by: Andrew Victor <[EMAIL PROTECTED]>
Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 drivers/net/Kconfig |2 +-
 drivers/net/macb.c  |   25 +++--
 drivers/net/macb.h  |8 +++-
 3 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 8aa8dd0..3318f30 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -190,7 +190,7 @@ config MII
 
 config MACB
tristate "Atmel MACB support"
-   depends on NET_ETHERNET && AVR32
+   depends on NET_ETHERNET && (AVR32 || ARCH_AT91SAM9260 || 
ARCH_AT91SAM9263)
select MII
help
  The Atmel MACB ethernet interface is found on many AT32 and AT91
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 25b559b..5eb7a35 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -1046,6 +1046,14 @@ static int __devinit macb_probe(struct platform_device 
*pdev)
 
spin_lock_init(&bp->lock);
 
+#if defined(CONFIG_ARCH_AT91)
+   bp->pclk = clk_get(&pdev->dev, "macb_clk");
+   if (IS_ERR(bp->pclk)) {
+   dev_err(&pdev->dev, "failed to get macb_clk\n");
+   goto err_out_free_dev;
+   }
+   clk_enable(bp->pclk);
+#else
bp->pclk = clk_get(&pdev->dev, "pclk");
if (IS_ERR(bp->pclk)) {
dev_err(&pdev->dev, "failed to get pclk\n");
@@ -1059,6 +1067,7 @@ static int __devinit macb_probe(struct platform_device 
*pdev)
 
clk_enable(bp->pclk);
clk_enable(bp->hclk);
+#endif
 
bp->regs = ioremap(regs->start, regs->end - regs->start + 1);
if (!bp->regs) {
@@ -1119,9 +1128,17 @@ static int __devinit macb_probe(struct platform_device 
*pdev)
 
pdata = pdev->dev.platform_data;
if (pdata && pdata->is_rmii)
+#if defined(CONFIG_ARCH_AT91)
+   macb_writel(bp, USRIO, (MACB_BIT(RMII) | MACB_BIT(CLKEN)) );
+#else
macb_writel(bp, USRIO, 0);
+#endif
else
+#if defined(CONFIG_ARCH_AT91)
+   macb_writel(bp, USRIO, MACB_BIT(CLKEN));
+#else
macb_writel(bp, USRIO, MACB_BIT(MII));
+#endif
 
bp->tx_pending = DEF_TX_RING_PENDING;
 
@@ -1148,9 +1165,11 @@ err_out_free_irq:
 err_out_iounmap:
iounmap(bp->regs);
 err_out_disable_clocks:
+#ifndef CONFIG_ARCH_AT91
clk_disable(bp->hclk);
-   clk_disable(bp->pclk);
clk_put(bp->hclk);
+#endif
+   clk_disable(bp->pclk);
 err_out_put_pclk:
clk_put(bp->pclk);
 err_out_free_dev:
@@ -1173,9 +1192,11 @@ static int __devexit macb_remove(struct platform_device 
*pdev)
unregister_netdev(dev);
free_irq(dev->irq, dev);
iounmap(bp->regs);
+#ifndef CONFIG_ARCH_AT91
clk_disable(bp->hclk);
-   clk_disable(bp->pclk);
clk_put(bp->hclk);
+#endif
+   clk_disable(bp->pclk);
clk_put(bp->pclk);
free_netdev(dev);
platform_set_drvdata(pdev, NULL);
diff --git a/drivers/net/macb.h b/drivers/net/macb.h
index 27bf0ae..b3bb218 100644
--- a/drivers/net/macb.h
+++ b/drivers/net/macb.h
@@ -200,7 +200,7 @@
 #define MACB_SOF_OFFSET30
 #define MACB_SOF_SIZE  2
 
-/* Bitfields in USRIO */
+/* Bitfields in USRIO (AVR32) */
 #define MACB_MII_OFFSET0
 #define MACB_MII_SIZE  1
 #define MACB_EAM_OFFSET1
@@ -210,6 +210,12 @@
 #define MACB_TX_PAUSE_ZERO_OFFSET  3
 #define MACB_TX_PAUSE_ZERO_SIZE1
 
+/* Bitfields in USRIO (AT91) */
+#define MACB_RMII_OFFSET   0
+#define MACB_RMII_SIZE 1
+#define MACB_CLKEN_OFFSET  1
+#define MACB_CLKEN_SIZE1
+
 /* Bitfields in WOL */
 #define MACB_IP_OFFSET 0
 #define MACB_IP_SIZE   16
-- 
1.4.4.3

-
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


Crypto Update for 2.6.21

2007-02-07 Thread Herbert Xu
Hi Dave:

Here is the crypto update for 2.6.21:

Please pull from

git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git

or

master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6.git

Summary:

* Added Camellia, PCBC, DES-like encryption for RxRPC.
* API updates in preparation for async.

Andrew Donofrio (1):
  [CRYPTO] tcrypt: Added test vectors for sha384/sha512

David Howells (2):
  [CRYPTO] pcbc: Add Propagated CBC template
  [CRYPTO] fcrypt: Add FCrypt from RxRPC

Herbert Xu (7):
  [CRYPTO] all: Check for usage in hard IRQ context
  [CRYPTO] tcrypt: Removed vestigial crypto_alloc_tfm call
  [CRYPTO] api: Remove deprecated interface
  [CRYPTO] api: Add type-safe spawns
  [CRYPTO] api: Allow multiple frontends per backend
  [CRYPTO] xcbc: Use new cipher interface
  [CRYPTO] api: Use structs for cipher/compression

Noriaki TAKAMIYA (6):
  [CRYPTO] camellia: Add Kconfig entry.
  [CRYPTO] camellia: added the code of Camellia cipher algorithm.
  [CRYPTO] camellia: added the testing code of Camellia cipher
  [IPSEC]: added the definition of Camellia cipher
  [IPSEC]: added the entry of Camellia cipher algorithm to ealg_list[]
  [CRYPTO] doc: added the developer of Camellia cipher

Richard Knutsson (1):
  [CRYPTO] geode: Convert pci_module_init() to pci_register_driver()

 Documentation/crypto/api-intro.txt |4 
 crypto/Kconfig |   31 
 crypto/Makefile|3 
 crypto/algapi.c|   15 
 crypto/api.c   |   80 -
 crypto/blkcipher.c |9 
 crypto/camellia.c  | 1801 +
 crypto/cbc.c   |9 
 crypto/cipher.c|  447 -
 crypto/compress.c  |5 
 crypto/digest.c|   24 
 crypto/ecb.c   |9 
 crypto/fcrypt.c|  423 
 crypto/hash.c  |5 
 crypto/hmac.c  |9 
 crypto/internal.h  |   27 
 crypto/lrw.c   |   11 
 crypto/pcbc.c  |  349 +++
 crypto/tcrypt.c|   73 +
 crypto/tcrypt.h|  538 +++
 crypto/xcbc.c  |   60 -
 drivers/crypto/geode-aes.c |2 
 fs/ecryptfs/crypto.c   |4 
 fs/ecryptfs/ecryptfs_kernel.h  |1 
 include/crypto/algapi.h|   24 
 include/linux/crypto.h |  148 ---
 include/linux/pfkeyv2.h|1 
 net/xfrm/xfrm_algo.c   |   17 
 28 files changed, 3396 insertions(+), 733 deletions(-)

Thanks,
-- 
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


Re: [PATCH] bcm43xx: Fix incorrect definition of PHY revision

2007-02-07 Thread Michael Buesch
On Wednesday 07 February 2007 04:31, Larry Finger wrote:
> There is a typographical error in the spefications that interchange the PHY 
> version
> and revision. Fixing this error makes all BCM43xx varieties work at full CCCK 
> rates.
> 
> Signed-off-by: Larry Finger<[EMAIL PROTECTED]>
> ---
> 
> John,
> 
> This patch should be put into wireless-2.6 and into 'upstream' as soon as 
> possible.
> I will be sending it to stable for inclusion in 2.6.20.1, and whatever other 
> kernels
> are still being maintained by -stable.
> 
> Larry
> ---
>  
> Index: wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
> ===
> --- wireless-2.6.orig/drivers/net/wireless/bcm43xx/bcm43xx_main.c
> +++ wireless-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
> @@ -3704,9 +3704,9 @@ static int bcm43xx_read_phyinfo(struct b
>  
>   value = bcm43xx_read16(bcm, BCM43xx_MMIO_PHY_VER);
>  
> - phy_version = (value & 0xF000) >> 12;
> + phy_rev = (value & 0xF000) >> 12;
>   phy_type = (value & 0x0F00) >> 8;
> - phy_rev = (value & 0x000F);
> + phy_version = (value & 0x000F);
>  
>   dprintk(KERN_INFO PFX "Detected PHY: Version: %x, Type %x, Revision 
> %x\n",
>   phy_version, phy_type, phy_rev);


I don't think this is correct.
>From which part of the specs did you get this?
http://bcm-v4.sipsolutions.net/802.11/PHY is where the PHY_Version
register is explained. "phy_version"=="AnalogType"

Actually it is possible that phy_revision is mask 0xFF, but that's
not too important at the moment, as we don't have revisions>0xF, yet.

But besides that, it's interresting that this "fixes" things for you.

Especially since wireless-2.6 has no support for hw-power-control, which
is needed by cards 4318 and newer.

-- 
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


Re: [PATCH] bcm43xx: Fix for oops on resume

2007-02-07 Thread Johannes Berg
On Wed, 2007-02-07 at 07:50 -0600, Larry Finger wrote:

> Could you please apply this patch and tell me what gets printed after you 
> resume, and whether you
> did a suspend to RAM or disk?

Oh and if anyone else does this please also let us know what it prints
on a regular freshly booted modprobe.

johannes


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


Re: [PATCH] bcm43xx: Fix for oops on resume

2007-02-07 Thread Johannes Berg
On Wed, 2007-02-07 at 07:50 -0600, Larry Finger wrote:

> Could you please apply this patch and tell me what gets printed after you 
> resume, and whether you
> did a suspend to RAM or disk?

Not a bad idea. I can test suspend to ram as well as to disk, just got
both working again.

The kernel I'm running right now was built on my powermac so I can't do
it right away (otherwise I could've just recompiled the bcm43xx module)
but I'll do it later today or tomorrow.

Usually, to get my connection back after a suspend, I just have to set
the ssid again.

johannes


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


Re: [PATCH] bcm43xx: Fix for oops on resume

2007-02-07 Thread Larry Finger
Johannes Berg wrote:
> On Wed, 2007-02-07 at 07:23 -0600, Larry Finger wrote:
> 
>> As you suggested earlier, a slow clock setting in the bcm43xx device may be 
>> the cause of this
>> difficulty. If my laptop would suspend/resume correctly, then I could test 
>> various fixes based on
>> that hypothesis. 
> 
> Mine does suspend, but I don't see the problem...

Could you please apply this patch and tell me what gets printed after you 
resume, and whether you
did a suspend to RAM or disk?

I welcome the results of this test from anyone whose system will 
suspend/resume. Please also note if
any further action is needed to get wireless communication re-established.

Thanks,

Larry


==

Index: linux-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===
--- linux-2.6.orig/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ linux-2.6/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -2401,6 +2401,7 @@ static int bcm43xx_chip_init(struct bcm4
}
udelay(10);
}
+   dprintk(KERN_INFO PFX "It took %d tries to set IRQ_READY\n", i);
bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON); /* dummy read */

value16 = bcm43xx_shm_read16(bcm, BCM43xx_SHM_SHARED,

-
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] bcm43xx: Fix for oops on resume

2007-02-07 Thread Johannes Berg
On Wed, 2007-02-07 at 07:23 -0600, Larry Finger wrote:

> As you suggested earlier, a slow clock setting in the bcm43xx device may be 
> the cause of this
> difficulty. If my laptop would suspend/resume correctly, then I could test 
> various fixes based on
> that hypothesis. 

Mine does suspend, but I don't see the problem...

> Since it does not, I think the band-aid approach is warranted. 

Oh yes, I agree, having some hardware mess up will almost always crash
the computer anyway.

> A proper fix is
> still on my agenda; however, getting full data rates still has priority.

Sure. Thanks for all you're doing :)

johannes


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


Re: [PATCH] bcm43xx: Fix for oops on resume

2007-02-07 Thread Larry Finger
Johannes Berg wrote:
> On Tue, 2007-02-06 at 11:39 -0600, Larry Finger wrote:
>> There is a kernel oops on bcm43xx when resuming due to an overly tight 
>> timeout loop.
> 
> Come to think of it... Is there any chance of fixing the actual oops
> that happens in this case? I can imagine broken hardware or firmware
> that causes this as well and we don't really want to oops in that case
> either... That's why we have the timeout in the first place, to not hang
> there forever.
> 
> Nothing against this patch though.

As you suggested earlier, a slow clock setting in the bcm43xx device may be the 
cause of this
difficulty. If my laptop would suspend/resume correctly, then I could test 
various fixes based on
that hypothesis. Since it does not, I think the band-aid approach is warranted. 
A proper fix is
still on my agenda; however, getting full data rates still has priority.

Larry
-
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] [PFKEYV2]: CONFIG_NET_KEY_MIGRATE option

2007-02-07 Thread Shinta Sugimoto
Add CONFIG_NET_KEY_MIGRATE option which makes it possible for user
application to send or receive MIGRATE message to/from PF_KEY socket.

Signed-off-by: Shinta Sugimoto <[EMAIL PROTECTED]>
Signed-off-by: Masahide NAKAMURA <[EMAIL PROTECTED]>
Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
---
 net/xfrm/Kconfig |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/net/xfrm/Kconfig b/net/xfrm/Kconfig
index 39d1cc4..fbaab2f 100644
--- a/net/xfrm/Kconfig
+++ b/net/xfrm/Kconfig
@@ -41,4 +41,14 @@ config NET_KEY
 
  Say Y unless you know what you are doing.
 
+config NET_KEY_MIGRATE
+   bool "PF_KEY MIGRATE (EXPERIMENTAL)"
+   depends on NET_KEY && EXPERIMENTAL
+   select XFRM_MIGRATE
+   ---help---
+ Add a PF_KEY MIGRATE message to PF_KEYv2 socket family.
+ The PF_KEY MIGRATE message is used to dynamically update
+ locator(s) of a given IPsec security association.  This feature
+ is required, for instance, in a Mobile IPv6 environment where
+ a mobile node changes its attachment point to the Internet.
 
-- 
1.4.2



-
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 4/5] [PFKEYV2]: Extension for dynamic update of endpoint address(es)

2007-02-07 Thread Shinta Sugimoto
Extend PF_KEYv2 framework so that user application can take advantage
of MIGRATE feature via PF_KEYv2 interface. User application can either
send or receive an MIGRATE message to/from PF_KEY socket.

Detail information can be found in the internet-draft
.

Signed-off-by: Shinta Sugimoto <[EMAIL PROTECTED]>
Signed-off-by: Masahide NAKAMURA <[EMAIL PROTECTED]>
Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
---
 include/linux/pfkeyv2.h |3 
 net/key/af_key.c|  442 +++
 2 files changed, 444 insertions(+), 1 deletions(-)

diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h
index 265bafa..26a518b 100644
--- a/include/linux/pfkeyv2.h
+++ b/include/linux/pfkeyv2.h
@@ -251,7 +251,8 @@ #define SADB_X_SPDSETIDX20
 #define SADB_X_SPDEXPIRE   21
 #define SADB_X_SPDDELETE2  22
 #define SADB_X_NAT_T_NEW_MAPPING   23
-#define SADB_MAX   23
+#define SADB_X_MIGRATE 24
+#define SADB_MAX   24
 
 /* Security Association flags */
 #define SADB_SAFLAGS_PFS   1
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 5dd5094..9c9537c 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -2345,6 +2345,196 @@ out:
return err;
 }
 
+#ifdef CONFIG_NET_KEY_MIGRATE
+static int pfkey_sockaddr_pair_size(sa_family_t family)
+{
+   switch (family) {
+   case AF_INET:
+   return PFKEY_ALIGN8(sizeof(struct sockaddr_in) * 2);
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+   case AF_INET6:
+   return PFKEY_ALIGN8(sizeof(struct sockaddr_in6) * 2);
+#endif
+   default:
+   return 0;
+   }
+   /* NOTREACHED */
+}
+
+static int parse_sockaddr_pair(struct sadb_x_ipsecrequest *rq,
+  xfrm_address_t *saddr,
+  xfrm_address_t *daddr,
+  u16 *family)
+{
+   struct sockaddr *sa = (struct sockaddr *)(rq + 1);
+   if (rq->sadb_x_ipsecrequest_len <
+   pfkey_sockaddr_pair_size(sa->sa_family))
+   return -EINVAL;
+
+   switch (sa->sa_family) {
+   case AF_INET:
+   {
+   struct sockaddr_in *sin;
+   sin = (struct sockaddr_in *)sa;
+   if ((sin+1)->sin_family != AF_INET)
+   return -EINVAL;
+   memcpy(&saddr->a4, &sin->sin_addr, sizeof(saddr->a4));
+   sin++;
+   memcpy(&daddr->a4, &sin->sin_addr, sizeof(daddr->a4));
+   *family = AF_INET;
+   break;
+   }
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+   case AF_INET6:
+   {
+   struct sockaddr_in6 *sin6;
+   sin6 = (struct sockaddr_in6 *)sa;
+   if ((sin6+1)->sin6_family != AF_INET6)
+   return -EINVAL;
+   memcpy(&saddr->a6, &sin6->sin6_addr,
+  sizeof(saddr->a6));
+   sin6++;
+   memcpy(&daddr->a6, &sin6->sin6_addr,
+  sizeof(daddr->a6));
+   *family = AF_INET6;
+   break;
+   }
+#endif
+   default:
+   return -EINVAL;
+   }
+   return 0;
+}
+
+static int ipsecrequests_to_migrate(struct sadb_x_ipsecrequest *rq,
+   struct xfrm_migrate *m,
+   int len,
+   int *bytes_read)
+{
+   int err;
+   struct sadb_x_ipsecrequest *rq1, *rq2;
+
+   if (len <= sizeof(struct sadb_x_ipsecrequest))
+   return -EINVAL;
+
+   /* old endoints */
+   rq1 = rq;
+   err = parse_sockaddr_pair(rq1, &m->old_saddr, &m->old_daddr,
+ &m->old_family);
+   if (err)
+   return err;
+
+   len -= rq1->sadb_x_ipsecrequest_len;
+   if (len <= sizeof(struct sadb_x_ipsecrequest))
+   return -EINVAL;
+   
+   /* new endpoints */
+   rq2 = (struct sadb_x_ipsecrequest *)((u8 *)rq1 + 
rq1->sadb_x_ipsecrequest_len);
+   err = parse_sockaddr_pair(rq2, &m->new_saddr, &m->new_daddr,
+ &m->new_family);
+   if (err)
+   return err;
+
+   if (rq1->sadb_x_ipsecrequest_proto != rq2->sadb_x_ipsecrequest_proto ||
+   rq1->sadb_x_ipsecrequest_mode != rq2->sadb_x_ipsecrequest_mode ||
+   rq1->sadb_x_ipsecrequest_reqid != rq2->sadb_x_ipsecrequest_reqid)
+   return -EINVAL;
+
+   m->proto = rq1->sadb_x_ipsecrequest_proto;
+   m->mode = rq1->sadb_x_ipsecrequest_mode - 1;
+   m->reqid = rq->sadb_x_ipsecrequest_reqid;
+
+   *bytes_read += rq1->sadb_x_ipsecrequest_len +
+  rq2->sadb_x_ipsecrequest_len;
+
+  

[PATCH 2/5] [XFRM]: User inteface for handling XFRM_MSG_MIGRATE

2007-02-07 Thread Shinta Sugimoto
Add user interface for handling XFRM_MSG_MIGRATE. The message is issued
by user application. When kernel receives the message, procedure of
updating XFRM databases will take place.

Signed-off-by: Shinta Sugimoto <[EMAIL PROTECTED]>
Signed-off-by: Masahide NAKAMURA <[EMAIL PROTECTED]>
Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
---
 net/xfrm/xfrm_user.c |  173 ++
 1 files changed, 173 insertions(+), 0 deletions(-)

diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 82f36d3..8d9a56a 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -1632,6 +1632,176 @@ static int xfrm_add_acquire(struct sk_bu
return 0;
 }
 
+#ifdef CONFIG_XFRM_MIGRATE
+static int verify_user_migrate(struct rtattr **xfrma)
+{
+   struct rtattr *rt = xfrma[XFRMA_MIGRATE-1];
+   struct xfrm_user_migrate *um;
+
+   if (!rt)
+   return -EINVAL;
+
+   if ((rt->rta_len - sizeof(*rt)) < sizeof(*um))
+   return -EINVAL;
+
+   return 0;
+}
+
+static int copy_from_user_migrate(struct xfrm_migrate *ma,
+ struct rtattr **xfrma, int *num)
+{
+   struct rtattr *rt = xfrma[XFRMA_MIGRATE-1];
+   struct xfrm_user_migrate *um;
+   int i, num_migrate;
+
+   um = RTA_DATA(rt);
+   num_migrate = (rt->rta_len - sizeof(*rt)) / sizeof(*um);
+
+   if (num_migrate <= 0 || num_migrate > XFRM_MAX_DEPTH)
+   return -EINVAL;
+
+   for (i = 0; i < num_migrate; i++, um++, ma++) {
+   ma->proto = um->proto;
+   ma->mode = um->mode;
+   ma->reqid = um->reqid;
+
+   ma->old_family = um->old_family;
+   memcpy(&ma->old_daddr, &um->old_daddr, sizeof(ma->old_daddr));
+   memcpy(&ma->old_saddr, &um->old_saddr, sizeof(ma->old_saddr));
+
+   ma->new_family = um->new_family;
+   memcpy(&ma->new_daddr, &um->new_daddr, sizeof(ma->new_daddr));
+   memcpy(&ma->new_saddr, &um->new_saddr, sizeof(ma->new_saddr));
+   }
+
+   *num = i;
+   return 0;
+}
+
+static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh,
+  struct rtattr **xfrma)
+{
+   struct xfrm_userpolicy_id *pi = NLMSG_DATA(nlh);
+   struct xfrm_migrate m[XFRM_MAX_DEPTH];
+   u8 type;
+   int err;
+   int n = 0;
+
+   err = verify_user_migrate((struct rtattr **)xfrma);
+   if (err)
+   return err;
+
+   err = copy_from_user_policy_type(&type, (struct rtattr **)xfrma);
+   if (err)
+   return err;
+
+   err = copy_from_user_migrate((struct xfrm_migrate *)m,
+(struct rtattr **)xfrma, &n);
+   if (err)
+   return err;
+
+   if (!n)
+   return 0;
+
+   xfrm_migrate(&pi->sel, pi->dir, type, m, n);
+
+   return 0;
+}
+#else
+static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh,
+  struct rtattr **xfrma)
+{
+   return -ENOPROTOOPT;
+}
+#endif
+
+#ifdef CONFIG_XFRM_MIGRATE
+static int copy_to_user_migrate(struct xfrm_migrate *m, struct sk_buff *skb)
+{
+   struct xfrm_user_migrate um;
+
+   memset(&um, 0, sizeof(um));
+   um.proto = m->proto;
+   um.mode = m->mode;
+   um.reqid = m->reqid;
+   um.old_family = m->old_family;
+   memcpy(&um.old_daddr, &m->old_daddr, sizeof(um.old_daddr));
+   memcpy(&um.old_saddr, &m->old_saddr, sizeof(um.old_saddr));
+   um.new_family = m->new_family;
+   memcpy(&um.new_daddr, &m->new_daddr, sizeof(um.new_daddr));
+   memcpy(&um.new_saddr, &m->new_saddr, sizeof(um.new_saddr));
+
+   RTA_PUT(skb, XFRMA_MIGRATE, sizeof(um), &um);
+   return 0;
+
+rtattr_failure:
+   return -1;
+}
+
+static int build_migrate(struct sk_buff *skb, struct xfrm_migrate *m,
+int num_migrate, struct xfrm_selector *sel,
+u8 dir, u8 type)
+{
+   struct xfrm_migrate *mp;
+   struct xfrm_userpolicy_id *pol_id;
+   struct nlmsghdr *nlh;
+   unsigned char *b = skb->tail;
+   int i;
+
+   nlh = NLMSG_PUT(skb, 0, 0, XFRM_MSG_MIGRATE, sizeof(*pol_id));
+   pol_id = NLMSG_DATA(nlh);
+   nlh->nlmsg_flags = 0;
+
+   /* copy data from selector, dir, and type to the pol_id */
+   memset(pol_id, 0, sizeof(*pol_id));
+   memcpy(&pol_id->sel, sel, sizeof(pol_id->sel));
+   pol_id->dir = dir;
+
+   if (copy_to_user_policy_type(type, skb) < 0)
+   goto nlmsg_failure;
+
+   for (i = 0, mp = m ; i < num_migrate; i++, mp++) {
+   if (copy_to_user_migrate(mp, skb) < 0)
+   goto nlmsg_failure;
+   }
+
+   nlh->nlmsg_len = skb->tail - b;
+   return skb->len;
+nlmsg_failure:
+   skb_trim(skb, b - skb->data);
+   return -1;
+}
+
+static int xfrm_send_migrate(struct xfrm_selector *sel, u8 dir, u8 typ

[PATCH 3/5] [XFRM]: CONFIG_XFRM_MIGRATE option

2007-02-07 Thread Shinta Sugimoto
Add CONFIG_XFRM_MIGRATE option which makes it possible for for user
application to send or receive MIGRATE message to/from netlink socket.

Signed-off-by: Shinta Sugimoto <[EMAIL PROTECTED]>
Signed-off-by: Masahide NAKAMURA <[EMAIL PROTECTED]>
Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
---
 net/xfrm/Kconfig |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/net/xfrm/Kconfig b/net/xfrm/Kconfig
index 0faab63..39d1cc4 100644
--- a/net/xfrm/Kconfig
+++ b/net/xfrm/Kconfig
@@ -24,6 +24,13 @@ config XFRM_SUB_POLICY
 
  If unsure, say N.
 
+config XFRM_MIGRATE
+   bool "Transformation migrate database (EXPERIMENTAL)"
+   depends on XFRM && EXPERIMENTAL
+   ---help---
+ A feature to update locator(s) of a given IPsec security
+ association dynamically.
+
 config NET_KEY
tristate "PF_KEY sockets"
select XFRM
-- 
1.4.2




-
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] [XFRM]: Extension for dynamic update of endpoint address(es)

2007-02-07 Thread Shinta Sugimoto
Extend the XFRM framework so that endpoint address(es) in the XFRM
databases could be dynamically updated according to a request (MIGRATE
message) from user application. Target XFRM policy is first identified
by the selector in the MIGRATE message. Next, the endpoint addresses
of the matching templates and XFRM states are updated according to
the MIGRATE message.

Signed-off-by: Shinta Sugimoto <[EMAIL PROTECTED]>
Signed-off-by: Masahide NAKAMURA <[EMAIL PROTECTED]>
Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
---
 include/linux/xfrm.h   |   19 
 include/net/xfrm.h |   53 
 net/xfrm/xfrm_policy.c |  206 
 net/xfrm/xfrm_state.c  |  184 +++
 4 files changed, 462 insertions(+), 0 deletions(-)

diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 9529ea1..15ca89e 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -178,6 +178,9 @@ #define XFRM_MSG_GETAE XFRM_MSG_GETAE
XFRM_MSG_REPORT,
 #define XFRM_MSG_REPORT XFRM_MSG_REPORT
 
+   XFRM_MSG_MIGRATE,
+#define XFRM_MSG_MIGRATE XFRM_MSG_MIGRATE
+
__XFRM_MSG_MAX
 };
 #define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)
@@ -256,6 +259,7 @@ enum xfrm_attr_type_t {
XFRMA_COADDR,   /* xfrm_address_t */
XFRMA_LASTUSED,
XFRMA_POLICY_TYPE,  /* struct xfrm_userpolicy_type */
+   XFRMA_MIGRATE,
__XFRMA_MAX
 
 #define XFRMA_MAX (__XFRMA_MAX - 1)
@@ -351,6 +355,19 @@ struct xfrm_user_report {
struct xfrm_selectorsel;
 };
 
+struct xfrm_user_migrate {
+   xfrm_address_t  old_daddr;
+   xfrm_address_t  old_saddr;
+   xfrm_address_t  new_daddr;
+   xfrm_address_t  new_saddr;
+   __u8proto;
+   __u8mode;
+   __u16   reserved;
+   __u32   reqid;
+   __u16   old_family;
+   __u16   new_family;
+};
+
 #ifndef __KERNEL__
 /* backwards compatibility for userspace */
 #define XFRMGRP_ACQUIRE1
@@ -375,6 +392,8 @@ #define XFRMNLGRP_POLICYXFRMNLGRP_POLIC
 #define XFRMNLGRP_AEVENTS  XFRMNLGRP_AEVENTS
XFRMNLGRP_REPORT,
 #define XFRMNLGRP_REPORT   XFRMNLGRP_REPORT
+   XFRMNLGRP_MIGRATE,
+#define XFRMNLGRP_MIGRATE  XFRMNLGRP_MIGRATE
__XFRMNLGRP_MAX
 };
 #define XFRMNLGRP_MAX  (__XFRMNLGRP_MAX - 1)
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index e476541..a1e8451 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -359,6 +359,19 @@ struct xfrm_policy
struct xfrm_tmplxfrm_vec[XFRM_MAX_DEPTH];
 };
 
+struct xfrm_migrate {
+   xfrm_address_t  old_daddr;
+   xfrm_address_t  old_saddr;
+   xfrm_address_t  new_daddr;
+   xfrm_address_t  new_saddr;
+   u8  proto;
+   u8  mode;
+   u16 reserved;
+   u32 reqid;
+   u16 old_family;
+   u16 new_family;
+};
+
 #define XFRM_KM_TIMEOUT30
 /* which seqno */
 #define XFRM_REPLAY_SEQ1
@@ -385,6 +398,7 @@ struct xfrm_mgr
int (*new_mapping)(struct xfrm_state *x, 
xfrm_address_t *ipaddr, __be16 sport);
int (*notify_policy)(struct xfrm_policy *x, int 
dir, struct km_event *c);
int (*report)(u8 proto, struct xfrm_selector *sel, 
xfrm_address_t *addr);
+   int (*migrate)(struct xfrm_selector *sel, u8 dir, 
u8 type, struct xfrm_migrate *m, int num_bundles);
 };
 
 extern int xfrm_register_km(struct xfrm_mgr *km);
@@ -985,6 +999,16 @@ extern int xfrm_bundle_ok(struct xfrm_po
  struct flowi *fl, int family, int strict);
 extern void xfrm_init_pmtu(struct dst_entry *dst);
 
+#ifdef CONFIG_XFRM_MIGRATE
+extern int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
+ struct xfrm_migrate *m, int num_bundles);
+extern struct xfrm_state * xfrm_migrate_state_find(struct xfrm_migrate *m);
+extern struct xfrm_state * xfrm_state_migrate(struct xfrm_state *x,
+ struct xfrm_migrate *m);
+extern int xfrm_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
+   struct xfrm_migrate *m, int num_bundles);
+#endif
+
 extern wait_queue_head_t km_waitq;
 extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 
sport);
 extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 
pid);
@@ -1050,5 +1074,34 @@ static inline void xfrm_aevent_doreplay(
xfrm_replay_notify(x, XFRM_REPLAY_UPDATE);
 }
 
+#ifdef CONFIG_XFRM_MIGRATE
+static inline int xfrm_migrat

[PATCH 0/5] [XFRM,PFKEYV2]: MIGRATE support (take 2)

2007-02-07 Thread Shinta Sugimoto
Hello,

Let me send an updated version of patch set of MIGRATE support
for XFRM/PFKEYv2.  About a week ago, I sent a request for comments
for this patch set.  All the comments received were taken into
account.  In summary, the changes are as follow:

- replace alloc & memcpy with kmemdup
- remove unnecessary null-check
- fix bugs in handling protocol value for selector 
- add sanity check for handling MIGRATE message from PF_KEY socket
- some other minor changes

Please note that the patch set is against current net-2.6.21
tree and these changes are available in the branch named
"migrate-20070207-2131" at:

git://git.linux-ipv6.org/gitroot/shinta/net-2.6.21-migrate.git


Regards,
Shinta
-
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] bcm43xx: Fix for oops on resume

2007-02-07 Thread Johannes Berg
On Tue, 2007-02-06 at 11:39 -0600, Larry Finger wrote:
> There is a kernel oops on bcm43xx when resuming due to an overly tight 
> timeout loop.

Come to think of it... Is there any chance of fixing the actual oops
that happens in this case? I can imagine broken hardware or firmware
that causes this as well and we don't really want to oops in that case
either... That's why we have the timeout in the first place, to not hang
there forever.

Nothing against this patch though.

johannes


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


Re: [PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support

2007-02-07 Thread Frank Pavlic
On Tue, Feb 06, 2007 at 02:41:06PM -0800, David Miller wrote:
> From: Frank Pavlic <[EMAIL PROTECTED]>
> Date: Fri, 2 Feb 2007 13:05:28 +0100
> 
> > The patch set consists of following patches:
> > 
> > [1/7] [S390]: Rewrite of the IUCV base code, part 1
> > [2/7] [S390]: Rewrite of the IUCV base code, part 2
> > [3/7] [S390]: Adapt monreader driver to new IUCV API
> > [4/7] [S390]: Adapt vmlogrdr driver to new IUCV API
> > [5/7] [S390]: Adapt netiucv driver to new IUCV API
> > [6/7] [S390]: Adapt special message interface to new IUCV API
> > [7/7] [S390]: Add AF_IUCV socket support
> 
> I have no fundamental objections to this, although I think
> I'll end up needing something similar on Niagara at some
> point :-)
I guess there are and will be more than two guys needing such a vehicle.
With all the virtualization support in Linux we have right now
and the stuff which will come in the future IMO we will need some kind
of a generic inter-communication infrastructure (what a wording :-) )
in Linux . 
> 
> The list ate the first patch due to it's size.  Could you
> email me a copy privately so can integrate all of your work
> into my net-2.6.21 tree?
> 
> 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
-
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: Intel 82559 NIC corrupted EEPROM

2007-02-07 Thread John

Jesse Brandeburg wrote:


John wrote:


Jesse Brandeburg wrote:


can you try adding mdelay(100); in e100_eeprom_load before the for loop,
and then change the multiple udelay(4) to mdelay(1) in e100_eeprom_read


I applied the attached patch.

Loading the driver now takes around one minute :-)


ouch, but yep, thats what happens when you use "super extra delay"


I ran 'source load_unload' 25 times in a loop.

The first 12 times were successful. The last 13 times failed.
(cf. attached archive)

I noticed something very strange.

The number of words obviously in error (0x) returned by the EEPROM
on 00:09.0 is not constant.


That is very strange, I would think that maybe you have something else
on the bus with the e100 that may be hogging bus cycles you have
failing hardware (maybe a bad eeprom, or possibly a bad mac chip)


$ grep -c 0x insmod*
insmod_300.txt:0
insmod_301.txt:0
insmod_302.txt:0
insmod_303.txt:0
insmod_304.txt:0
insmod_305.txt:0
insmod_306.txt:0
insmod_307.txt:0
insmod_308.txt:0
insmod_309.txt:0
insmod_310.txt:0
insmod_311.txt:0
insmod_312.txt:1
insmod_313.txt:5
insmod_314.txt:24
insmod_315.txt:45
insmod_316.txt:243
insmod_317.txt:256
insmod_318.txt:256
insmod_319.txt:256
insmod_320.txt:256
insmod_321.txt:256
insmod_322.txt:256
insmod_323.txt:253
insmod_324.txt:240


this is even stranger, does it cycle back down (sine wave) to zero
again?  The delays did seem to work, at least sometimes.  This
indicates that something needs that extra delay to successfully read
the eeprom.  I might try changing all the udelay(4) to udelay(40) (x10
increase) and see if that gives you a happy medium of "most times
driver loads without error"

John, this problem seems to be very specific to your hardware.  I know
that you have put in a lot of time debugging this, but I'm not sure
what we can do from here.  If this were a generic code problem more
people would be reporting the issue.

What would you like to do?  At this stage I would like e100 to work
better than it is, but I'm not sure what to do next.


Hello everyone,

I'm resurrecting this thread because it appears we'll need to support 
these motherboards for several months to come, yet Adrian Bunk has 
scheduled the removal of eepro100 in January 2007.


To recap, we have to support ~30 EBC-2000T motherboards.
http://www.adlinktech.com/PD/web/PD_detail.php?pid=213
These motherboards come with three on-board Intel 82559 NICs.

Last time I checked, i.e. two months ago, e100 did not correctly 
initialize all three NICs on these motherboards. Therefore, we've been 
using eepro100.


I will be testing the latest 2.6.20 kernel to see if the situation has 
changed, but I wanted to let you all know that there are still some 
eepro100 users out there, out of necessity.


Regards,

John

-
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] NET : change layout of ehash table

2007-02-07 Thread Eric Dumazet

ehash table layout is currently this one :

First half of this table is used by sockets not in TIME_WAIT state
Second half of it is used by sockets in TIME_WAIT state.

This is non optimal because of for a given hash or socket, the two chain heads 
are located in separate cache lines.
Moreover the locks of the second half are never used.

If instead of this halving, we use two list heads in inet_ehash_bucket instead 
of only one, we probably can avoid one cache miss, and reduce ram usage, 
particularly if sizeof(rwlock_t) is big (various CONFIG_DEBUG_SPINLOCK, 
CONFIG_DEBUG_LOCK_ALLOC settings). So we still halves the table but we keep 
together related chains to speedup lookups and socket state change.

In this patch I did not try to align struct inet_ehash_bucket, but a future 
patch could try to make this structure have a convenient size (a power of two 
or a multiple of L1_CACHE_SIZE).
I guess rwlock will just vanish as soon as RCU is plugged into ehash :) , so 
maybe we dont need to scratch our heads to align the bucket...

Note : In case struct inet_ehash_bucket is not a power of two, we could 
probably change alloc_large_system_hash() (in case it use __get_free_pages()) 
to free the unused space. It currently allocates a big zone, but the last 
quarter of it could be freed. Again, this should be a temporary 'problem'.

Patch tested on ipv4 tcp only, but should be OK for IPV6 and DCCP.

Signed-off-by: Eric Dumazet <[EMAIL PROTECTED]>
--- linux-2.6.20/include/net/inet_hashtables.h  2007-02-07 09:19:22.0 
+0100
+++ linux-2.6.20-ed/include/net/inet_hashtables.h   2007-02-07 
12:20:47.0 +0100
@@ -34,12 +34,13 @@
 #include 
 
 /* This is for all connections with a full identity, no wildcards.
- * New scheme, half the table is for TIME_WAIT, the other half is
- * for the rest.  I'll experiment with dynamic table growth later.
+ * One chain is dedicated to TIME_WAIT sockets.
+ * I'll experiment with dynamic table growth later.
  */
 struct inet_ehash_bucket {
rwlock_t  lock;
struct hlist_head chain;
+   struct hlist_head twchain;
 };
 
 /* There are a few simple rules, which allow for local port reuse by
@@ -97,8 +98,7 @@ struct inet_hashinfo {
 *
 *  TCP_ESTABLISHED <= sk->sk_state < TCP_CLOSE
 *
-* First half of the table is for sockets not in TIME_WAIT, second half
-* is for TIME_WAIT sockets only.
+* TIME_WAIT sockets use a separate chain (twchain).
 */
struct inet_ehash_bucket*ehash;
 
@@ -369,7 +369,7 @@ static inline struct sock *
}
 
/* Must check for a TIME_WAIT'er before going to listener hash. */
-   sk_for_each(sk, node, &(head + hashinfo->ehash_size)->chain) {
+   sk_for_each(sk, node, &head->twchain) {
if (INET_TW_MATCH(sk, hash, acookie, saddr, daddr, ports, dif))
goto hit;
}
--- linux-2.6.20/net/ipv4/tcp_ipv4.c2007-02-07 09:09:40.0 +0100
+++ linux-2.6.20-ed/net/ipv4/tcp_ipv4.c 2007-02-07 09:42:26.0 +0100
@@ -2051,7 +2051,7 @@ static void *established_get_first(struc
}
st->state = TCP_SEQ_STATE_TIME_WAIT;
inet_twsk_for_each(tw, node,
-  &tcp_hashinfo.ehash[st->bucket + 
tcp_hashinfo.ehash_size].chain) {
+  &tcp_hashinfo.ehash[st->bucket].twchain) {
if (tw->tw_family != st->family) {
continue;
}
@@ -2107,7 +2107,7 @@ get_tw:
}
 
st->state = TCP_SEQ_STATE_TIME_WAIT;
-   tw = tw_head(&tcp_hashinfo.ehash[st->bucket + 
tcp_hashinfo.ehash_size].chain);
+   tw = tw_head(&tcp_hashinfo.ehash[st->bucket].twchain);
goto get_tw;
 found:
cur = sk;
--- linux-2.6.20/net/ipv4/tcp.c 2007-02-07 09:09:40.0 +0100
+++ linux-2.6.20-ed/net/ipv4/tcp.c  2007-02-07 09:33:33.0 +0100
@@ -2415,10 +2415,11 @@ void __init tcp_init(void)
&tcp_hashinfo.ehash_size,
NULL,
0);
-   tcp_hashinfo.ehash_size = (1 << tcp_hashinfo.ehash_size) >> 1;
-   for (i = 0; i < (tcp_hashinfo.ehash_size << 1); i++) {
+   tcp_hashinfo.ehash_size = 1 << tcp_hashinfo.ehash_size;
+   for (i = 0; i < tcp_hashinfo.ehash_size; i++) {
rwlock_init(&tcp_hashinfo.ehash[i].lock);
INIT_HLIST_HEAD(&tcp_hashinfo.ehash[i].chain);
+   INIT_HLIST_HEAD(&tcp_hashinfo.ehash[i].twchain);
}
 
tcp_hashinfo.bhash =
@@ -2475,7 +2476,7 @@ void __init tcp_init(void)
 
printk(KERN_INFO "TCP: Hash tables configured "
   "(established %d bind %d)\n",
-  tcp_hashinfo.ehash_size << 1, tcp_hashinfo.bhash_size);
+  tcp_hashinfo.ehash_size, tcp_hashinfo.bhash_size);
 
tcp_

Re: [PATCH 0/7] [S390]: Introduction of AF_IUCV sockets support

2007-02-07 Thread Frank Pavlic
On Tue, Feb 06, 2007 at 02:41:06PM -0800, David Miller wrote:
> From: Frank Pavlic <[EMAIL PROTECTED]>
> Date: Fri, 2 Feb 2007 13:05:28 +0100
> 
> > The patch set consists of following patches:
> > 
> > [1/7] [S390]: Rewrite of the IUCV base code, part 1
> > [2/7] [S390]: Rewrite of the IUCV base code, part 2
> > [3/7] [S390]: Adapt monreader driver to new IUCV API
> > [4/7] [S390]: Adapt vmlogrdr driver to new IUCV API
> > [5/7] [S390]: Adapt netiucv driver to new IUCV API
> > [6/7] [S390]: Adapt special message interface to new IUCV API
> > [7/7] [S390]: Add AF_IUCV socket support
> 
> I have no fundamental objections to this, although I think
> I'll end up needing something similar on Niagara at some
> point :-)
> 
> The list ate the first patch due to it's size.  Could you
> email me a copy privately so can integrate all of your work
> into my net-2.6.21 tree?
> 
> Thanks.
> -
Dave,
Really good news for me, I just have started to split the first patch :-)
Thank you 
I send you a copy privately...

Frank
-
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] tg3 : avoid an expensive divide

2007-02-07 Thread Andi Kleen

> Well, this could explain but unfortunatly I dont have this option set :
> 
> # grep OPTIMIZE .config
> # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
> 
> # gcc -v
> Using built-in specs.
> Target: x86_64-unknown-linux-gnu
> Configured with: ../gcc-4.1.1/configure --enable-languages=c,c++

Ah. Looking more closely the problem is different (sorry for the wrong
explanation earlier, it fit too well and it really happened elsewhere)

The code is 

#define TG3_RX_RCB_RING_SIZE(tp)\
((tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ?  512 : 1024)

...
sw_idx %= TG3_RX_RCB_RING_SIZE(tp);


The problem is that gcc doesn't rewrite the x % (cond ? const1 : const2) 
expression
to the more optimizable cond ? (x % const1 : x % const2). For the first it sees
a full variable division, for which div* is the best code to generate.

Your patch is probably correct or alternatively rewrite the expression 
to the optimizable form by hand.

Arguably gcc should do this by itself. Perhaps file a gcc bug about this 
missing optimization. 

-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: [PATCH] tg3 : avoid an expensive divide

2007-02-07 Thread Eric Dumazet
On Wednesday 07 February 2007 10:54, Andi Kleen wrote:
> David Miller <[EMAIL PROTECTED]> writes:
> > Because I've seen gcc optimize this properly before (at least on
> > sparc64), it means that either:
> >
> > 1) There is a GCC bug where the properties of the constants
> >do not propagate.
> >
> > 2) GCC really thinks the divide is cheaper (code density vs.
> >cycle count tradeoffs etc.)
>
> Probably Eric compiled with the now default
> CONFIG_CC_OPTIMIZE_FOR_SIZE/-Os. With that gcc decides to use the shorter
> hardware divide instruction, even though it is significantly slower than an
> expanded optimized sequence for constant dividend.
>
> We've seen this in a few other cases while during performance regression
> testing between kernels that still used -O2 vs the newer -Os.
>
> No good solution found unfortunately.

Well, this could explain but unfortunatly I dont have this option set :

# grep OPTIMIZE .config
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set

# gcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.1.1/configure --enable-languages=c,c++
Thread model: posix
gcc version 4.1.1

Then I did :

# make drivers/net/tg3.s
  CHK include/linux/version.h
  CHK include/linux/utsrelease.h
  CC  drivers/net/tg3.s

# more drivers/net/tg3.s
.file   "tg3.c"
# GNU C version 4.1.1 (x86_64-unknown-linux-gnu)
#   compiled by GNU C version 4.1.0.
# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
# options passed:  -nostdinc -Iinclude -D__KERNEL__ -DCONFIG_AS_CFI=1
# -DKBUILD_STR(s)=#s -DKBUILD_BASENAME=KBUILD_STR(tg3)
# -DKBUILD_MODNAME=KBUILD_STR(tg3) -isystem -include -MD -march=k8 -m64
# -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
# -maccumulate-outgoing-args -auxbase-strip -O2 -Wall -Wundef
# -Wstrict-prototypes -Wno-trigraphs -Wno-sign-compare
# -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-aliasing
# -fno-common -fno-reorder-blocks -fno-asynchronous-unwind-tables
# -funit-at-a-time -fno-omit-frame-pointer -fno-optimize-sibling-calls
# -fno-stack-protector -fverbose-asm
# options enabled:  -falign-loops -fargument-alias -fbranch-count-reg
# -fcaller-saves -fcprop-registers -fcrossjumping -fcse-follow-jumps
# -fcse-skip-blocks -fdefer-pop -fdelete-null-pointer-checks
# -fearly-inlining -feliminate-unused-debug-types -fexpensive-optimizations
# -ffunction-cse -fgcse -fgcse-lm -fguess-branch-probability -fident
# -fif-conversion -fif-conversion2 -finline-functions-called-once
# -fipa-pure-const -fipa-reference -fipa-type-escape -fivopts
# -fkeep-static-consts -fleading-underscore -floop-optimize
# -floop-optimize2 -fmath-errno -fmerge-constants -foptimize-register-move
# -fpeephole -fpeephole2 -freg-struct-return -fregmove -freorder-functions
# -frerun-cse-after-loop -frerun-loop-opt -fsched-interblock -fsched-spec
# -fsched-stalled-insns-dep -fschedule-insns2 -fshow-column
# -fsplit-ivs-in-unroller -fstrength-reduce -fthread-jumps -ftrapping-math
# -ftree-ccp -ftree-ch -ftree-copy-prop -ftree-copyrename -ftree-dce
# -ftree-dominator-opts -ftree-dse -ftree-fre -ftree-loop-im
# -ftree-loop-ivcanon -ftree-loop-optimize -ftree-lrs -ftree-pre
# -ftree-salias -ftree-sink -ftree-sra -ftree-store-ccp
# -ftree-store-copy-prop -ftree-ter -ftree-vect-loop-version -ftree-vrp
# -funit-at-a-time -fverbose-asm -fzero-initialized-in-bss
# -m128bit-long-double -m64 -m80387 -maccumulate-outgoing-args
# -malign-stringops -mfancy-math-387 -mfp-ret-in-387 -mieee-fp
# -mno-red-zone -mpush-args -mtls-direct-seg-refs

# Compiler executable checksum: a068cb1f6a9c2e4d8616444230e91dfc


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] tg3 : avoid an expensive divide

2007-02-07 Thread David Miller
From: Andi Kleen <[EMAIL PROTECTED]>
Date: 07 Feb 2007 10:54:49 +0100

> Probably Eric compiled with the now default CONFIG_CC_OPTIMIZE_FOR_SIZE/-Os.
> With that gcc decides to use the shorter hardware divide instruction, even
> though it is significantly slower than an expanded optimized sequence
> for constant dividend.
> 
> We've seen this in a few other cases while during performance regression
> testing between kernels that still used -O2 vs the newer -Os.
> 
> No good solution found unfortunately.

Thanks for the explanation, that makes a lot of sense.
-
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/4] ucc_geth: Change private immrbar_virt_to_phys to generic iopa

2007-02-07 Thread Li Yang-r58472
> On Feb 6, 2007, at 5:31 AM, Li Yang wrote:
> 
> > Get rid of private immrbar_virt_to_phys() routine and
> > use generic iopa().
> 
> Nack. iopa() isn't that generic, shouldn't we really be using the dma
> mapping API here?

Do you mean the dma_map_single()?  dma_map_single can map memory space
correctly, but I don't think it can handle ioremap-ed space.

- Leo
-
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 4/4] spidernet: remove txram full logging

2007-02-07 Thread Ishizaki Kou
This patches removes logging for SPIDER_NET_GTMFLLINT interrupts.
Since the interrupts are not irregular, and they happen frequently
when using 100Mbps network switches.

Signed-off-by: Kou Ishizaki <[EMAIL PROTECTED]>
---

--- org-linux-powerpc-git/drivers/net/spider_net.c  2007-02-06 
20:44:47.0 +0900
+++ linux-powerpc-git/drivers/net/spider_net.c  2007-02-06 20:48:38.0 
+0900
@@ -1417,8 +1417,8 @@
switch (i)
{
case SPIDER_NET_GTMFLLINT:
-   if (netif_msg_intr(card) && net_ratelimit())
-   pr_err("Spider TX RAM full\n");
+   /* TX RAM full may happen on a usual case.
+* Logging is not needed. */
show_error = 0;
break;
case SPIDER_NET_GRFDFLLINT: /* fallthrough */
-
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] tg3 : avoid an expensive divide

2007-02-07 Thread Andi Kleen
David Miller <[EMAIL PROTECTED]> writes:
> 
> Because I've seen gcc optimize this properly before (at least on
> sparc64), it means that either:
> 
> 1) There is a GCC bug where the properties of the constants
>do not propagate.
> 
> 2) GCC really thinks the divide is cheaper (code density vs.
>cycle count tradeoffs etc.)

Probably Eric compiled with the now default CONFIG_CC_OPTIMIZE_FOR_SIZE/-Os.
With that gcc decides to use the shorter hardware divide instruction, even
though it is significantly slower than an expanded optimized sequence
for constant dividend.

We've seen this in a few other cases while during performance regression
testing between kernels that still used -O2 vs the newer -Os.

No good solution found unfortunately.

-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


[PATCH 2/4] spidernet: load firmware when open

2007-02-07 Thread Ishizaki Kou
This patch moves calling init_firmware() from spider_net_probe() to
spider_net_open() so as to use the driver by built-in.

Signed-off-by: Kou Ishizaki <[EMAIL PROTECTED]>
---

--- org-linux-powerpc-git/drivers/net/spider_net.c  2007-02-06 
20:35:55.0 +0900
+++ linux-powerpc-git/drivers/net/spider_net.c  2007-02-06 20:39:27.0 
+0900
@@ -1700,6 +1700,124 @@
 }
 
 /**
+ * spider_net_download_firmware - loads firmware into the adapter
+ * @card: card structure
+ * @firmware_ptr: pointer to firmware data
+ *
+ * spider_net_download_firmware loads the firmware data into the
+ * adapter. It assumes the length etc. to be allright.
+ */
+static int
+spider_net_download_firmware(struct spider_net_card *card,
+const void *firmware_ptr)
+{
+   int sequencer, i;
+   const u32 *fw_ptr = firmware_ptr;
+
+   /* stop sequencers */
+   spider_net_write_reg(card, SPIDER_NET_GSINIT,
+SPIDER_NET_STOP_SEQ_VALUE);
+
+   for (sequencer = 0; sequencer < SPIDER_NET_FIRMWARE_SEQS;
+sequencer++) {
+   spider_net_write_reg(card,
+SPIDER_NET_GSnPRGADR + sequencer * 8, 0);
+   for (i = 0; i < SPIDER_NET_FIRMWARE_SEQWORDS; i++) {
+   spider_net_write_reg(card, SPIDER_NET_GSnPRGDAT +
+sequencer * 8, *fw_ptr);
+   fw_ptr++;
+   }
+   }
+
+   if (spider_net_read_reg(card, SPIDER_NET_GSINIT))
+   return -EIO;
+
+   spider_net_write_reg(card, SPIDER_NET_GSINIT,
+SPIDER_NET_RUN_SEQ_VALUE);
+
+   return 0;
+}
+
+/**
+ * spider_net_init_firmware - reads in firmware parts
+ * @card: card structure
+ *
+ * Returns 0 on success, <0 on failure
+ *
+ * spider_net_init_firmware opens the sequencer firmware and does some basic
+ * checks. This function opens and releases the firmware structure. A call
+ * to download the firmware is performed before the release.
+ *
+ * Firmware format
+ * ===
+ * spider_fw.bin is expected to be a file containing 6*1024*4 bytes, 4k being
+ * the program for each sequencer. Use the command
+ *tail -q -n +2 Seq_code1_0x088.txt Seq_code2_0x090.txt  \
+ * Seq_code3_0x098.txt Seq_code4_0x0A0.txt Seq_code5_0x0A8.txt   \
+ * Seq_code6_0x0B0.txt | xxd -r -p -c4 > spider_fw.bin
+ *
+ * to generate spider_fw.bin, if you have sequencer programs with something
+ * like the following contents for each sequencer:
+ *
+ *
+ *
+ * ...
+ *<1024th 4-BYTES-WORD FOR SEQUENCER>
+ */
+static int
+spider_net_init_firmware(struct spider_net_card *card)
+{
+   struct firmware *firmware = NULL;
+   struct device_node *dn;
+   const u8 *fw_prop = NULL;
+   int err = -ENOENT;
+   int fw_size;
+
+   if (request_firmware((const struct firmware **)&firmware,
+SPIDER_NET_FIRMWARE_NAME, &card->pdev->dev) == 0) {
+   if ( (firmware->size != SPIDER_NET_FIRMWARE_LEN) &&
+netif_msg_probe(card) ) {
+   pr_err("Incorrect size of spidernet firmware in " \
+  "filesystem. Looking in host firmware...\n");
+   goto try_host_fw;
+   }
+   err = spider_net_download_firmware(card, firmware->data);
+
+   release_firmware(firmware);
+   if (err)
+   goto try_host_fw;
+
+   goto done;
+   }
+
+try_host_fw:
+   dn = pci_device_to_OF_node(card->pdev);
+   if (!dn)
+   goto out_err;
+
+   fw_prop = get_property(dn, "firmware", &fw_size);
+   if (!fw_prop)
+   goto out_err;
+
+   if ( (fw_size != SPIDER_NET_FIRMWARE_LEN) &&
+netif_msg_probe(card) ) {
+   pr_err("Incorrect size of spidernet firmware in " \
+  "host firmware\n");
+   goto done;
+   }
+
+   err = spider_net_download_firmware(card, fw_prop);
+
+done:
+   return err;
+out_err:
+   if (netif_msg_probe(card))
+   pr_err("Couldn't find spidernet firmware in filesystem " \
+  "or host firmware\n");
+   return err;
+}
+
+/**
  * spider_net_open - called upon ifonfig up
  * @netdev: interface device structure
  *
@@ -1715,6 +1833,10 @@
struct spider_net_descr *descr;
int result;
 
+   result = spider_net_init_firmware(card);
+   if (result)
+   goto init_firmware_failed;
+
/* start probing with copper */
spider_net_setup_aneg(card);
if (card->phy.def->phy_id)
@@ -1765,6 +1887,7 @@
spider_net_free_chain(card, &card->tx_chain);
 alloc_tx_failed:
del_timer_sync(&card->aneg_timer);
+init_firmware_failed:
return result;
 }
 
@@ -1876,124 +1999,6 @@
 }
 
 /**
- * spider_net_downlo

[PATCH 3/4] spidernet: spidernet: add support for Celleb

2007-02-07 Thread Ishizaki Kou
This patch adds or changes some HW specific settings for spider_net on
Celleb.

Signed-off-by: Kou Ishizaki <[EMAIL PROTECTED]>
---

--- org-linux-powerpc-git/drivers/net/Kconfig   2007-02-06 20:41:01.0 
+0900
+++ linux-powerpc-git/drivers/net/Kconfig   2007-02-06 20:41:44.0 
+0900
@@ -2256,7 +2256,7 @@
 
 config SPIDER_NET
tristate "Spider Gigabit Ethernet driver"
-   depends on PCI && PPC_IBM_CELL_BLADE
+   depends on PCI && (PPC_IBM_CELL_BLADE || PPC_CELLEB)
select FW_LOADER
help
  This driver supports the Gigabit Ethernet chips present on the
--- org-linux-powerpc-git/drivers/net/spider_net.h  2007-02-06 
20:35:51.0 +0900
+++ linux-powerpc-git/drivers/net/spider_net.h  2007-02-06 20:41:44.0 
+0900
@@ -1,7 +1,8 @@
 /*
- * Network device driver for Cell Processor-Based Blade
+ * Network device driver for Cell Processor-Based Blade and Celleb platform
  *
  * (C) Copyright IBM Corp. 2005
+ * (C) Copyright 2006 TOSHIBA CORPORATION
  *
  * Authors : Utz Bacher <[EMAIL PROTECTED]>
  *   Jens Osterkamp <[EMAIL PROTECTED]>
@@ -184,7 +185,8 @@
 
 /* pause frames: automatic, no upper retransmission count */
 /* outside loopback mode: ETOMOD signal dont matter, not connected */
-#define SPIDER_NET_OPMODE_VALUE0x0063
+/* ETOMOD signal is brought to PHY reset. bit 2 must be 1 in Celleb */
+#define SPIDER_NET_OPMODE_VALUE0x0067
 /*#define SPIDER_NET_OPMODE_VALUE  0x001b0062*/
 #define SPIDER_NET_LENLMT_VALUE0x0908
 
--- org-linux-powerpc-git/drivers/net/spider_net.c  2007-02-06 
20:41:22.0 +0900
+++ linux-powerpc-git/drivers/net/spider_net.c  2007-02-06 20:41:44.0 
+0900
@@ -1,7 +1,8 @@
 /*
- * Network device driver for Cell Processor-Based Blade
+ * Network device driver for Cell Processor-Based Blade and Celleb platform
  *
  * (C) Copyright IBM Corp. 2005
+ * (C) Copyright 2006 TOSHIBA CORPORATION
  *
  * Authors : Utz Bacher <[EMAIL PROTECTED]>
  *   Jens Osterkamp <[EMAIL PROTECTED]>
@@ -1600,6 +1601,11 @@
 
spider_net_write_reg(card, SPIDER_NET_CKRCTRL,
 SPIDER_NET_CKRCTRL_RUN_VALUE);
+
+   /* trigger ETOMOD signal */
+   spider_net_write_reg(card, SPIDER_NET_GMACOPEMD,
+   spider_net_read_reg(card, SPIDER_NET_GMACOPEMD) | 0x4);
+
 }
 
 /**
-
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/4] spidernet: autoneg support for Celleb

2007-02-07 Thread Ishizaki Kou
Add auto negotiation support for Celleb. 

Signed-off-by: Kou Ishizaki <[EMAIL PROTECTED]>
---


--- org-linux-powerpc-git/drivers/net/spider_net.h  2007-02-06 
20:24:35.0 +0900
+++ linux-powerpc-git/drivers/net/spider_net.h  2007-02-06 20:30:35.0 
+0900
@@ -50,6 +50,8 @@
 #define SPIDER_NET_TX_DESCRIPTORS_MAX  512
 
 #define SPIDER_NET_TX_TIMER(HZ/5)
+#define SPIDER_NET_ANEG_TIMER  (HZ)
+#define SPIDER_NET_ANEG_TIMEOUT2
 
 #define SPIDER_NET_RX_CSUM_DEFAULT 1
 
@@ -104,6 +106,7 @@
 
 #define SPIDER_NET_GMACOPEMD   0x0100
 #define SPIDER_NET_GMACLENLMT  0x0108
+#define SPIDER_NET_GMACST  0x0110
 #define SPIDER_NET_GMACINTEN   0x0118
 #define SPIDER_NET_GMACPHYCTRL 0x0120
 
@@ -333,9 +336,12 @@
 /* We rely on flagged descriptor interrupts */
 #define SPIDER_NET_RXINT   ( (1 << SPIDER_NET_GDAFDCINT) )
 
+#define SPIDER_NET_LINKINT ( 1 << SPIDER_NET_GMAC2INT )
+
 #define SPIDER_NET_ERRINT  ( 0x & \
  (~SPIDER_NET_TXINT) & \
- (~SPIDER_NET_RXINT) )
+ (~SPIDER_NET_RXINT) & \
+ (~SPIDER_NET_LINKINT) )
 
 #define SPIDER_NET_GPREXEC 0x8000
 #define SPIDER_NET_GPRDAT_MASK 0x
@@ -442,6 +448,8 @@
struct spider_net_descr_chain rx_chain;
struct spider_net_descr *low_watermark;
 
+   int aneg_count;
+   struct timer_list aneg_timer;
struct timer_list tx_timer;
struct work_struct tx_timeout_task;
atomic_t tx_timeout_task_counter;
--- org-linux-powerpc-git/drivers/net/spider_net.c  2007-02-06 
20:24:35.0 +0900
+++ linux-powerpc-git/drivers/net/spider_net.c  2007-02-06 20:30:57.0 
+0900
@@ -165,6 +165,40 @@
return readvalue;
 }
 
+/** spider_net_setup_aneg - initial auto-negotiation setup
+ * @card: device structure 
+ **/
+static void
+spider_net_setup_aneg(struct spider_net_card *card)
+{
+   struct mii_phy *phy = &card->phy;
+   u32 advertise = 0;
+   u16 bmcr, bmsr, stat1000, estat;
+
+   bmcr = spider_net_read_phy(card->netdev, phy->mii_id, MII_BMCR);
+   bmsr = spider_net_read_phy(card->netdev, phy->mii_id, MII_BMSR);
+   stat1000 = spider_net_read_phy(card->netdev, phy->mii_id, MII_STAT1000);
+   estat= spider_net_read_phy(card->netdev, phy->mii_id, MII_ESTATUS);
+
+   if (bmsr & BMSR_10HALF)
+   advertise |= ADVERTISED_10baseT_Half;
+   if (bmsr & BMSR_10FULL)
+   advertise |= ADVERTISED_10baseT_Full;
+   if (bmsr & BMSR_100HALF)
+   advertise |= ADVERTISED_100baseT_Half;
+   if (bmsr & BMSR_100FULL)
+   advertise |= ADVERTISED_100baseT_Full;
+
+   if ((bmsr & BMSR_ESTATEN) && (estat & ESTATUS_1000_TFULL))
+   advertise |= SUPPORTED_1000baseT_Full;
+   if ((bmsr & BMSR_ESTATEN) && (estat & ESTATUS_1000_THALF))
+   advertise |= SUPPORTED_1000baseT_Half;
+
+   mii_phy_probe(phy, phy->mii_id);
+   phy->def->ops->setup_aneg(phy, advertise);
+
+}
+
 /**
  * spider_net_rx_irq_off - switch off rx irq on this spider card
  * @card: device structure
@@ -1244,6 +1278,33 @@
 }
 
 /**
+ * spider_net_link_reset
+ * @netdev: net device structure
+ *
+ * This is called when the PHY_LINK signal is asserted. For the blade this is
+ * not connected so we should never get here.
+ *
+ */
+static void
+spider_net_link_reset(struct net_device *netdev)
+{
+
+   struct spider_net_card *card = netdev_priv(netdev);
+
+   del_timer_sync(&card->aneg_timer);
+
+   /* clear interrupt, block further interrupts */
+   spider_net_write_reg(card, SPIDER_NET_GMACST,
+spider_net_read_reg(card, SPIDER_NET_GMACST));
+   spider_net_write_reg(card, SPIDER_NET_GMACINTEN, 0);
+
+   /* reset phy and setup aneg */
+   spider_net_setup_aneg(card);
+   mod_timer(&card->aneg_timer, jiffies + SPIDER_NET_ANEG_TIMER);
+
+}
+
+/**
  * spider_net_handle_error_irq - handles errors raised by an interrupt
  * @card: card structure
  * @status_reg: interrupt status register 0 (GHIINT0STS)
@@ -1496,6 +1557,9 @@
if (status_reg & SPIDER_NET_TXINT)
netif_rx_schedule(netdev);
 
+   if (status_reg & SPIDER_NET_LINKINT)
+   spider_net_link_reset(netdev);
+
if (status_reg & SPIDER_NET_ERRINT )
spider_net_handle_error_irq(card, status_reg);
 
@@ -1620,8 +1684,6 @@
 
spider_net_write_reg(card, SPIDER_NET_GMACLENLMT,
 SPIDER_NET_LENLMT_VALUE);
-   spider_net_write_reg(card, SPIDER_NET_GMACMODE,
-SPIDER_NET_MACMODE_VALUE);
spider_net_write_reg(card, SPIDER_NET_GMACOPEMD,
 SPIDER_NET_OPMODE

[PATCH 0/4] spidernet: support for Celleb

2007-02-07 Thread Ishizaki Kou
This is a revised spidernet patch set based on
netdev-2.6.git#upstream.

This patch set is merged Jens-san's spidernet patch and works on
Toshiba Cell reference set (aka Celleb). 
It requires Jens-san's phy patch
(http://ozlabs.org/pipermail/linuxppc-dev/2007-February/030987.html).

Ignore our previos patch set, and try this patch set on Cell Blade,
please (sorry for asking a lot).

Best regards,
Kou Ishizaki
-
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 11/11] netfilter warning fix

2007-02-07 Thread Ingo Molnar

* Patrick McHardy <[EMAIL PROTECTED]> wrote:

> David Miller wrote:
> > From: Ingo Molnar <[EMAIL PROTECTED]>
> > Date: Wed, 7 Feb 2007 09:07:22 +0100
> > 
> > 
> >>Dave, Patrick, can we lift the nack on PREEMPT_RCU, as far as networking 
> >>goes?
> > 
> > 
> > After Patrick's fixups, sure.
> 
> I'm about to send my queued netfilter patches, after which I will look 
> into this. Shouldn't take more than a one or two days.

thanks, that's great!

Ingo
-
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 11/11] netfilter warning fix

2007-02-07 Thread Patrick McHardy
David Miller wrote:
> From: Ingo Molnar <[EMAIL PROTECTED]>
> Date: Wed, 7 Feb 2007 09:07:22 +0100
> 
> 
>>Dave, Patrick, can we lift the nack on PREEMPT_RCU, as far as networking 
>>goes?
> 
> 
> After Patrick's fixups, sure.


I'm about to send my queued netfilter patches, after which I will look
into this. Shouldn't take more than a one or two days.

-
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 11/11] netfilter warning fix

2007-02-07 Thread David Miller
From: Ingo Molnar <[EMAIL PROTECTED]>
Date: Wed, 7 Feb 2007 09:07:22 +0100

> Dave, Patrick, can we lift the nack on PREEMPT_RCU, as far as networking 
> goes?

After Patrick's fixups, sure.
-
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] irlan: handle out of memory errors

2007-02-07 Thread David Miller
From: Samuel Ortiz <[EMAIL PROTECTED]>
Date: Wed, 20 Dec 2006 00:47:26 +0200

> On Tue, Dec 19, 2006 at 05:56:01PM +0900, Akinobu Mita wrote:
> > This patch checks return values:
> > 
> > - irlmp_register_client()
> > - irlmp_register_service()
> > - irlan_open()
> > 
> > Cc: Samuel Ortiz <[EMAIL PROTECTED]>
> > Signed-off-by: Akinobu Mita <[EMAIL PROTECTED]>
> This one seems correct as well, thanks again.
> 
> Signed-off-by: Samuel Ortiz <[EMAIL PROTECTED]>

Also applied, thanks a lot.
-
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] irda: handle out of memory errors

2007-02-07 Thread David Miller
From: Samuel Ortiz <[EMAIL PROTECTED]>
Date: Wed, 20 Dec 2006 00:44:22 +0200

> On Tue, Dec 19, 2006 at 05:55:09PM +0900, Akinobu Mita wrote:
> > This patch checks return value of memory allocation functions
> > for irda subsystem and fixes memory leaks in error cases.
> > 
> > Cc: Samuel Ortiz <[EMAIL PROTECTED]>
> > Signed-off-by: Akinobu Mita <[EMAIL PROTECTED]>
> That looks correct, thanks for the patch.
> 
> Signed-off-by: Samuel Ortiz <[EMAIL PROTECTED]>

Applied, 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


Re: [PATCH] net: unregister_netdevice as void

2007-02-07 Thread David Miller
From: Stephen Hemminger <[EMAIL PROTECTED]>
Date: Mon, 18 Dec 2006 21:05:11 -0800

> There was no real useful information from the unregister_netdevice() return
> code, the only error occurred in a situation that was a driver bug. So
> change it to a void function.
> 
> Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

Applied to net-2.6.21, thanks Stephen.
-
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 11/11] netfilter warning fix

2007-02-07 Thread Ingo Molnar

* Patrick McHardy <[EMAIL PROTECTED]> wrote:

> > this means that this particular use could be fixed by converting the 
> > preempt_disable()/enable() pair in nf_ct_l4proto_find_get() to 
> > rcu_read_lock()/unlock(), correct?
> 
> That is another bug (all uses of preempt_disable in netfilter 
> actually), but calling __nf_ct_l[34]proto_find without rcu_read_lock 
> is broken as well.
> 
> > Furthermore, every user of synchronize_net() [and synchronize_rcu() 
> > in general] needs to be reviewed.
> 
> I'll take care of netfilter.

great! Netfilter is one of the main users of synchronize_net() (about 
90% of the synchronize_net() callsites are in netfilter), and one of the 
main (well, in fact pretty much only) users of preempt_disable().

Dave, Patrick, can we lift the nack on PREEMPT_RCU, as far as networking 
goes? We really need some progress regarding it, and i think Paul is way 
too modest about pushing it. His patchset been in beta testing for like 
2 years meanwhile. PREEMPT_RCU has already found a nice set of 
bugs/uncleanlinesses elsewhere too, so even if you never actually enable 
PREEMPT_RCU (it's off by default), it's a nice generalization of the RCU 
framework that also tightens up its semantics. I think we need that, 
before existing code learns to depend on non-generic details of 
'classic' RCU too much. [my other interest in it, as you might have 
guessed, is that PREEMPT_RT depends on PREEMPT_RCU architecturally, but 
that shouldnt worry you - i think the upstream arguments alone are 
strong enough.]

Ingo
-
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: [IPV6] RAW: Add checksum default defines for MH.

2007-02-07 Thread David Miller
From: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
Date: Wed, 07 Feb 2007 15:43:34 +0900 (JST)

> AFAIK, we have not heard objectsions and I finally agree on this.
> Please apply.
> 
> Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>

Yes, thank you for reminding me, I will apply this to
net-2.6.21 right now.
-
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