Re: [PATCH] [NET] cpmac: convert to new Fixed PHY infrastructure (was: Re: fixed phy support (warning related to FIXED_MII_100_FDX))

2008-01-30 Thread Kumar Gala

From: Anton Vorontsov <[EMAIL PROTECTED]>
Subject: [PATCH] [NET] cpmac: convert to new Fixed PHY infrastructure

This patch converts cpmac to the new Fixed PHY infrastructure,  
though it

doesn't fix all the problems with that driver. I didn't even bother to
test this patch to compile, because cpmac driver is broken in  
several ways:


1. This driver won't compile by itself because lack of its header  
describing

  platform data;
2. It assumes that fixed PHYs should be created by the ethernet  
driver.
  It is wrong assumption: fixed PHYs creation is platform code  
authority,

  driver must blindly accept bus_id and phy_id platform data variables
  instead.

Also, it seem that that driver doesn't have actual in-tree users, so
nothing to fix further.

The main purpose of that patch is to get rid of the following Kconfig
warning:

scripts/kconfig/conf -s arch/powerpc/Kconfig
drivers/net/Kconfig:1713:warning: 'select' used by config symbol
'CPMAC' refers to undefined symbol 'FIXED_MII_100_FDX'

Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
---
drivers/net/Kconfig |4 +--
drivers/net/cpmac.c |   55 +++ 
+--

2 files changed, 19 insertions(+), 40 deletions(-)


applied.

- 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] [NET] cpmac: convert to new Fixed PHY infrastructure

2008-01-30 Thread Kumar Gala
Is this going through netdev or do you want me to pick it via the  
powerpc route?


Based on your comments I sorta assumed it was most convenient to  
lump in with the rest of the powerpc changes...


That's fine.  I'll push it via the powerpc trees.

- 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] [NET] cpmac: convert to new Fixed PHY infrastructure

2008-01-30 Thread Kumar Gala


On Jan 30, 2008, at 11:09 AM, Jeff Garzik wrote:


Anton Vorontsov wrote:

On Mon, Jan 21, 2008 at 01:19:41PM -0600, Kumar Gala wrote:

Anton,

it looks like the "TI AR7 CPMAC Ethernet support" uses FIXED_PHY  
and  was selecting FIXED_MII_100_FDX which is gone.


Can you look into this.  I get the following warning now:

scripts/kconfig/conf -s arch/powerpc/Kconfig
drivers/net/Kconfig:1713:warning: 'select' used by config symbol   
'CPMAC' refers to undefined symbol 'FIXED_MII_100_FDX'

Wow. I thought there were no Fixed PHY users. :-)
Jeff, as you've already Acked Fixed PHY rework to go through powerpc
tree, would you please Ack this patch in addition? I hope cpmac
maintainer will fix remaining issues as time goes by.
Thanks!
- - - -
From: Anton Vorontsov <[EMAIL PROTECTED]>
Subject: [PATCH] [NET] cpmac: convert to new Fixed PHY infrastructure
This patch converts cpmac to the new Fixed PHY infrastructure,  
though it
doesn't fix all the problems with that driver. I didn't even bother  
to
test this patch to compile, because cpmac driver is broken in  
several ways:
1. This driver won't compile by itself because lack of its header  
describing

  platform data;
2. It assumes that fixed PHYs should be created by the ethernet  
driver.
  It is wrong assumption: fixed PHYs creation is platform code  
authority,
  driver must blindly accept bus_id and phy_id platform data  
variables

  instead.
Also, it seem that that driver doesn't have actual in-tree users, so
nothing to fix further.
The main purpose of that patch is to get rid of the following Kconfig
warning:
scripts/kconfig/conf -s arch/powerpc/Kconfig
drivers/net/Kconfig:1713:warning: 'select' used by config symbol
'CPMAC' refers to undefined symbol 'FIXED_MII_100_FDX'
Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>


ACK


Is this going through netdev or do you want me to pick it via the  
powerpc route?


- 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] [NET] cpmac: convert to new Fixed PHY infrastructure (was: Re: fixed phy support (warning related to FIXED_MII_100_FDX))

2008-01-30 Thread Kumar Gala


On Jan 21, 2008, at 2:49 PM, Anton Vorontsov wrote:


On Mon, Jan 21, 2008 at 01:19:41PM -0600, Kumar Gala wrote:

Anton,

it looks like the "TI AR7 CPMAC Ethernet support" uses FIXED_PHY and
was selecting FIXED_MII_100_FDX which is gone.

Can you look into this.  I get the following warning now:

scripts/kconfig/conf -s arch/powerpc/Kconfig
drivers/net/Kconfig:1713:warning: 'select' used by config symbol
'CPMAC' refers to undefined symbol 'FIXED_MII_100_FDX'


Wow. I thought there were no Fixed PHY users. :-)

Jeff, as you've already Acked Fixed PHY rework to go through powerpc
tree, would you please Ack this patch in addition? I hope cpmac
maintainer will fix remaining issues as time goes by.

Thanks!


Jeff, just a reminder to look at this.

- k


- - - -
From: Anton Vorontsov <[EMAIL PROTECTED]>
Subject: [PATCH] [NET] cpmac: convert to new Fixed PHY infrastructure

This patch converts cpmac to the new Fixed PHY infrastructure,  
though it

doesn't fix all the problems with that driver. I didn't even bother to
test this patch to compile, because cpmac driver is broken in  
several ways:


1. This driver won't compile by itself because lack of its header  
describing

  platform data;
2. It assumes that fixed PHYs should be created by the ethernet  
driver.
  It is wrong assumption: fixed PHYs creation is platform code  
authority,

  driver must blindly accept bus_id and phy_id platform data variables
  instead.

Also, it seem that that driver doesn't have actual in-tree users, so
nothing to fix further.

The main purpose of that patch is to get rid of the following Kconfig
warning:

scripts/kconfig/conf -s arch/powerpc/Kconfig
drivers/net/Kconfig:1713:warning: 'select' used by config symbol
'CPMAC' refers to undefined symbol 'FIXED_MII_100_FDX'

Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
---
drivers/net/Kconfig |4 +--
drivers/net/cpmac.c |   55 +++ 
+--

2 files changed, 19 insertions(+), 40 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 114771a..5380ff9 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1707,10 +1707,8 @@ config SC92031

config CPMAC
tristate "TI AR7 CPMAC Ethernet support (EXPERIMENTAL)"
-   depends on NET_ETHERNET && EXPERIMENTAL && AR7
+   depends on NET_ETHERNET && EXPERIMENTAL && AR7 && BROKEN
select PHYLIB
-   select FIXED_PHY
-   select FIXED_MII_100_FDX
help
  TI AR7 CPMAC Ethernet support

diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c
index 6fd95a2..88eeb1d 100644
--- a/drivers/net/cpmac.c
+++ b/drivers/net/cpmac.c
@@ -848,15 +848,6 @@ static void cpmac_adjust_link(struct net_device  
*dev)

spin_unlock(&priv->lock);
}

-static int cpmac_link_update(struct net_device *dev,
-struct fixed_phy_status *status)
-{
-   status->link = 1;
-   status->speed = 100;
-   status->duplex = 1;
-   return 0;
-}
-
static int cpmac_open(struct net_device *dev)
{
int i, size, res;
@@ -999,11 +990,11 @@ static int external_switch;
static int __devinit cpmac_probe(struct platform_device *pdev)
{
int rc, phy_id, i;
+   int mdio_bus_id = cpmac_mii.id;
struct resource *mem;
struct cpmac_priv *priv;
struct net_device *dev;
struct plat_cpmac_data *pdata;
-   struct fixed_info *fixed_phy;
DECLARE_MAC_BUF(mac);

pdata = pdev->dev.platform_data;
@@ -1017,9 +1008,23 @@ static int __devinit cpmac_probe(struct  
platform_device *pdev)

}

if (phy_id == PHY_MAX_ADDR) {
-   if (external_switch || dumb_switch)
+   if (external_switch || dumb_switch) {
+   struct fixed_phy_status status = {};
+
+   mdio_bus_id = 0;
+
+   /*
+* FIXME: this should be in the platform code!
+* Since there is not platform code at all (that is,
+* no mainline users of that driver), place it here
+* for now.
+*/
phy_id = 0;
-   else {
+   status.link = 1;
+   status.duplex = 1;
+   status.speed = 100;
+   fixed_phy_add(PHY_POLL, phy_id, &status);
+   } else {
printk(KERN_ERR "cpmac: no PHY present\n");
return -ENODEV;
}
@@ -1063,32 +1068,8 @@ static int __devinit cpmac_probe(struct  
platform_device *pdev)

priv->msg_enable = netif_msg_init(debug_level, 0xff);
memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr));

-   i

Re: [PATCH] FIXED_MII_100_FDX

2008-01-26 Thread Kumar Gala


On Jan 26, 2008, at 12:54 AM, Sean MacLennan wrote:


On the last git pull,  FIXED_MII_100_FDX was removed from the phy
Kconfig, but the Kconfig for CPMAC still tried to select it.

Cheers,
  Sean

Signed-off-by: Sean MacLennan <[EMAIL PROTECTED]>
---
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 9af05a2..297a4b5 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1710,7 +1710,6 @@ config CPMAC
depends on NET_ETHERNET && EXPERIMENTAL && AR7
select PHYLIB
select FIXED_PHY
-   select FIXED_MII_100_FDX
help
  TI AR7 CPMAC Ethernet support


This patch isn't sufficient.  AntonV has posted a proper fix that we  
need Jeff to pick up.


http://ozlabs.org/pipermail/linuxppc-dev/2008-January/050330.html

- 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 2/5] [POWERPC][NET] ucc_geth_mii and users: get rid of device_type

2008-01-25 Thread Kumar Gala
On Thu, 24 Jan 2008, Anton Vorontsov wrote:

> device_type property is bogus, thus use proper compatible.
>
> Also change compatible property to "fsl,ucc-mdio".
>
> Per http://ozlabs.org/pipermail/linuxppc-dev/2007-December/048388.html
>
> Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
> ---
>  arch/powerpc/boot/dts/mpc832x_mds.dts |3 +--
>  arch/powerpc/boot/dts/mpc832x_rdb.dts |3 +--
>  arch/powerpc/boot/dts/mpc836x_mds.dts |3 +--
>  arch/powerpc/boot/dts/mpc836x_rdk.dts |3 +--
>  arch/powerpc/boot/dts/mpc8568mds.dts  |2 +-
>  drivers/net/ucc_geth_mii.c|3 +++
>  6 files changed, 8 insertions(+), 9 deletions(-)
>

applied. (same comment about rdk)

- 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 for-2.6.25] [POWERPC] Rename commproc to cpm1 and cpm2_common.c to cpm2.c

2008-01-25 Thread Kumar Gala
On Fri, 25 Jan 2008, Jochen Friedrich wrote:

> Rename commproc.[ch] to cpm1.[ch] to be more consistent with cpm2. Also
> rename cpm2_common.c to cpm2.c as suggested by Scott Wood. Adjust the
> includes accordingly.
>
> Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]>
> ---
>  arch/powerpc/platforms/8xx/ep88xc.c   |1 +
>  arch/powerpc/platforms/8xx/mpc86xads_setup.c  |2 +-
>  arch/powerpc/platforms/8xx/mpc885ads_setup.c  |2 +-
>  arch/powerpc/sysdev/Makefile  |4 ++--
>  arch/powerpc/sysdev/{commproc.c => cpm1.c}|4 ++--
>  arch/powerpc/sysdev/{cpm2_common.c => cpm2.c} |3 +--
>  arch/powerpc/sysdev/micropatch.c  |2 +-
>  arch/ppc/8260_io/enet.c   |2 +-
>  arch/ppc/8xx_io/commproc.c|2 +-
>  arch/ppc/8xx_io/enet.c|6 +++---
>  arch/ppc/8xx_io/fec.c |2 +-
>  arch/ppc/8xx_io/micropatch.c  |2 +-
>  arch/ppc/boot/simple/iic.c|2 +-
>  arch/ppc/boot/simple/m8xx_tty.c   |2 +-
>  arch/ppc/kernel/ppc_ksyms.c   |2 +-
>  arch/ppc/platforms/mpc866ads_setup.c  |2 +-
>  arch/ppc/platforms/mpc885ads_setup.c  |2 +-
>  arch/ppc/syslib/mpc8xx_devices.c  |2 +-
>  arch/ppc/xmon/start_8xx.c |2 +-
>  drivers/net/fec_8xx/fec_8xx-netta.c   |2 +-
>  drivers/net/fec_8xx/fec_main.c|2 +-
>  drivers/net/fec_8xx/fec_mii.c |2 +-
>  drivers/net/fs_enet/fs_enet.h |2 +-
>  drivers/net/fs_enet/mac-fec.c |2 +-
>  drivers/net/fs_enet/mac-scc.c |2 +-
>  drivers/serial/cpm_uart/cpm_uart_cpm1.h   |2 +-
>  include/asm-powerpc/{commproc.h => cpm1.h}|8 
>  include/asm-ppc/{commproc.h => cpm1.h}|8 
>  28 files changed, 38 insertions(+), 38 deletions(-)
>  rename arch/powerpc/sysdev/{commproc.c => cpm1.c} (99%)
>  rename arch/powerpc/sysdev/{cpm2_common.c => cpm2.c} (99%)
>  rename include/asm-powerpc/{commproc.h => cpm1.h} (99%)
>  rename include/asm-ppc/{commproc.h => cpm1.h} (99%)
>

applied.

- 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] [POWERPC] Add fixed-phy support for fs_enet

2008-01-23 Thread Kumar Gala
On Tue, 18 Dec 2007, Jochen Friedrich wrote:

> This patch adds support to use the fixed-link property
> of an ethernet node to fs_enet for the
> CONFIG_PPC_CPM_NEW_BINDING case.
>
> Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]>
> Acked-by: Jeff Garzik <[EMAIL PROTECTED]>
> Acked-by: Vitali Bordug <[EMAIL PROTECTED]>
> ---
>  drivers/net/fs_enet/fs_enet-main.c |9 -
>  1 files changed, 8 insertions(+), 1 deletions(-)
>

applied.

- 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 2/3] [POWERPC] fsl_soc: add support for gianfar for fixed-link property

2008-01-17 Thread Kumar Gala
On Fri, 7 Dec 2007, Vitaly Bordug wrote:

>
> fixed-link says: register new "Fixed/emulated PHY", i.e. PHY that
> not connected to the real MDIO bus.
>
> Signed-off-by: Vitaly Bordug <[EMAIL PROTECTED]>
> Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
>
> ---
>
>  Documentation/powerpc/booting-without-of.txt |4 +
>  arch/powerpc/sysdev/fsl_soc.c|   79 
> --
>  2 files changed, 66 insertions(+), 17 deletions(-)
>

applied.

- 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 3/3] [POWERPC] MPC8349E-mITX: Vitesse 7385 PHY is not connected to the MDIO bus

2008-01-17 Thread Kumar Gala
On Fri, 7 Dec 2007, Vitaly Bordug wrote:

>
> ...thus use fixed-link to register proper "Fixed PHY"
>
> Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
> Signed-off-by: Vitaly Bordug <[EMAIL PROTECTED]>
>

applied.

- 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/3] [NET] phy/fixed.c: rework to not duplicate PHY layer functionality

2008-01-17 Thread Kumar Gala
On Fri, 7 Dec 2007, Vitaly Bordug wrote:

>
> With that patch fixed.c now fully emulates MDIO bus, thus no need
> to duplicate PHY layer functionality. That, in turn, drastically
> simplifies the code, and drops down line count.
>
> As an additional bonus, now there is no need to register MDIO bus
> for each PHY, all emulated PHYs placed on the platform fixed MDIO bus.
> There is also no more need to pre-allocate PHYs via .config option,
> this is all now handled dynamically.
>
>
> Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
> Signed-off-by: Vitaly Bordug <[EMAIL PROTECTED]>
> Acked-by: Jeff Garzik <[EMAIL PROTECTED]>
>
> ---
>
>  drivers/net/phy/Kconfig   |   32 +--
>  drivers/net/phy/fixed.c   |  445 
> +
>  include/linux/phy_fixed.h |   51 ++---
>  3 files changed, 195 insertions(+), 333 deletions(-)
>

applied.

- 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 0/3] UCC TDM driver for MPC83xx platforms

2008-01-14 Thread Kumar Gala


On Jan 14, 2008, at 3:15 PM, Andrew Morton wrote:


On Mon, 14 Jan 2008 12:00:51 -0600
Kim Phillips <[EMAIL PROTECTED]> wrote:


On Thu, 10 Jan 2008 21:41:20 -0700
"Aggrwal Poonam" <[EMAIL PROTECTED]> wrote:


Hello  All

I am waiting for more feedback on the patches.

If there are no objections please consider them for 2.6.25.


if this isn't going to go through Alessandro Rubini/misc drivers, can
it go through the akpm/mm tree?



That would work.  But it might be more appropriate to go Kumar- 
>paulus->Linus.


I'm ok w/taking the arch/powerpc bits, but I"m a bit concerned about  
the driver itself.  I'm wondering if we need a TDM framework in the  
kernel.


I guess if Poonam could possibly describe how this driver is actually  
used that would be helpful.  I see we have 8315 with a discrete TDM  
block and I'm guessing 82xx/85xx based CPM parts of some form of TDM  
as well.


- 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 2/2] ucc_geth: use rx-clock-name and tx-clock-name device tree properties

2007-12-13 Thread Kumar Gala


On Dec 3, 2007, at 3:17 PM, Timur Tabi wrote:


Updates the ucc_geth device driver to check the new rx-clock-name and
tx-clock-name properties first.  If present, it uses the new function
qe_clock_source() to obtain the clock source.  Otherwise, it checks  
the

deprecated rx-clock and tx-clock properties.

Update the device trees for 832x, 836x, and 8568 to contain the new  
property

names only.

Signed-off-by: Timur Tabi <[EMAIL PROTECTED]>
---

This patch applies to Kumar's for-2.6.25 branch.  ucc_geth will  
compile but not
run if my other patch, "qe: add function qe_clock_source" has not  
also been

applied.

arch/powerpc/boot/dts/mpc832x_mds.dts |8 ++--
arch/powerpc/boot/dts/mpc832x_rdb.dts |8 ++--
arch/powerpc/boot/dts/mpc836x_mds.dts |8 ++--
arch/powerpc/boot/dts/mpc8568mds.dts  |8 ++--
drivers/net/ucc_geth.c|   55  
++--

5 files changed, 67 insertions(+), 20 deletions(-)


applied.

- 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 2/2] ucc_geth: use rx-clock-name and tx-clock-name device tree properties

2007-12-13 Thread Kumar Gala


On Dec 3, 2007, at 3:17 PM, Timur Tabi wrote:


Updates the ucc_geth device driver to check the new rx-clock-name and
tx-clock-name properties first.  If present, it uses the new function
qe_clock_source() to obtain the clock source.  Otherwise, it checks  
the

deprecated rx-clock and tx-clock properties.

Update the device trees for 832x, 836x, and 8568 to contain the new  
property

names only.

Signed-off-by: Timur Tabi <[EMAIL PROTECTED]>
---

This patch applies to Kumar's for-2.6.25 branch.  ucc_geth will  
compile but not
run if my other patch, "qe: add function qe_clock_source" has not  
also been

applied.


Jeff, I'll take this patch via powerpc.git if you don't have any issue  
since its just touching probe/setup bits.


- k


arch/powerpc/boot/dts/mpc832x_mds.dts |8 ++--
arch/powerpc/boot/dts/mpc832x_rdb.dts |8 ++--
arch/powerpc/boot/dts/mpc836x_mds.dts |8 ++--
arch/powerpc/boot/dts/mpc8568mds.dts  |8 ++--
drivers/net/ucc_geth.c|   55  
++--

5 files changed, 67 insertions(+), 20 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts b/arch/powerpc/ 
boot/dts/mpc832x_mds.dts

index c64f303..fe54489 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -223,8 +223,8 @@
 */
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
-   rx-clock = <19>;
-   tx-clock = <1a>;
+   rx-clock-name = "clk9";
+   tx-clock-name = "clk10";
phy-handle = < &phy3 >;
pio-handle = < &pio3 >;
};
@@ -244,8 +244,8 @@
 */
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
-   rx-clock = <17>;
-   tx-clock = <18>;
+   rx-clock-name = "clk7";
+   tx-clock-name = "clk8";
phy-handle = < &phy4 >;
pio-handle = < &pio4 >;
};
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/ 
boot/dts/mpc832x_rdb.dts

index 388c8a7..e68a08b 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -202,8 +202,8 @@
 */
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
-   rx-clock = <20>;
-   tx-clock = <13>;
+   rx-clock-name = "clk16";
+   tx-clock-name = "clk3";
phy-handle = <&phy00>;
pio-handle = <&ucc2pio>;
};
@@ -223,8 +223,8 @@
 */
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
-   rx-clock = <19>;
-   tx-clock = <1a>;
+   rx-clock-name = "clk9";
+   tx-clock-name = "clk10";
phy-handle = <&phy04>;
pio-handle = <&ucc3pio>;
};
diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts b/arch/powerpc/ 
boot/dts/mpc836x_mds.dts

index 0b2d2b5..bfd48d0 100644
--- a/arch/powerpc/boot/dts/mpc836x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc836x_mds.dts
@@ -254,8 +254,8 @@
 */
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
-   rx-clock = <0>;
-   tx-clock = <19>;
+   rx-clock-name = "none";
+   tx-clock-name = "clk9";
phy-handle = < &phy0 >;
phy-connection-type = "rgmii-id";
pio-handle = < &pio1 >;
@@ -276,8 +276,8 @@
 */
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
-   rx-clock = <0>;
-   tx-clock = <14>;
+   rx-clock-name = "none";
+   tx-clock-name = "clk4";
phy-handle = < &phy1 >;
phy-connection-type = "rgmii-id";
pio-handle = < &pio2 >;
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/ 
boot/dts/mpc8568mds.dts

index 5439437..cf45aab 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -333,8 +333,8 @@
 */
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
-  

Re: [PATCH 2/11] ibm_newemac: Add ET1011c PHY support

2007-11-30 Thread Kumar Gala


On Nov 30, 2007, at 2:59 PM, Benjamin Herrenschmidt wrote:



On Fri, 2007-11-30 at 08:29 -0600, Olof Johansson wrote:

Hi,

On Fri, Nov 30, 2007 at 04:40:24PM +1100, Benjamin Herrenschmidt  
wrote:


This adds support for the Agere ET1011c PHY as found on the AMCC  
Taishan

board.


The whole patch has whitespace messed up (tabs vs spaces).


Thanks for noticing it on the ...3rd time those are sent to the  
list...


Clearly if you used checkpatch.pl you'd have noticed this by now. :)

- 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 0/5] fixups for mpc8360 rev. 2.1 erratum #2 (RGMII Timing)

2007-11-20 Thread Kumar Gala


On Nov 19, 2007, at 7:30 PM, Jeff Garzik wrote:


Kim Phillips wrote:

On Mon, 5 Nov 2007 12:15:30 -0600
Kim Phillips <[EMAIL PROTECTED]> wrote:

Hello all,

the following patches fix RGMII timing for rev. 2.1 of the mpc8360,
according to erratum #2 (erratum text included below).  Basically  
the

most intrusive part is the addition of two new RGMII Internal Delay
modes; one for TX delay only, and the other for RX delay only  
(i.e, not

both at the same time).

Please review, and since this affects both netdev and powerpc trees,
one maintainer should ack them for the other to push upstream (i.e,
Kumar acks them, and Leo picks them up to go through netdev or the
other way around; either way is fine with me).  I'm hoping they're
trivial enough to go in 2.6.24.

Kumar, Leo, re-ping due to (a) it's been 2 weeks and (b) Anton  
Vorontsov has since

issued his Tested-by.
Might I suggest Kumar ack the powerpc patches, and Leo/Jeff apply 5/5
to go through netdev?


FWIW I just got back from vacation...  I'm grabbing what DaveM has  
collected into davem/netdev-2.6.git, and then going from there...


Jeff,

I've pulled and pushed the arch/powepc bits of these fixes.  I leave  
the PHYY and driver bits to you.


- 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/5] powerpc: document rgmii-rxid and rgmii-txid phy-connection-types

2007-11-19 Thread Kumar Gala
On Mon, 5 Nov 2007, Kim Phillips wrote:

> A h/w bug requires we program the PHY in RGMII mode for internal delay
> on the receive or transmit side only; document the new property values.
>
> Signed-off-by: Kim Phillips <[EMAIL PROTECTED]>
> ---
>  Documentation/powerpc/booting-without-of.txt |5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>

applied.

- 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 5/5] powerpc: handle mpc8360 rev. 2.1 RGMII timing erratum

2007-11-19 Thread Kumar Gala
On Mon, 5 Nov 2007, Kim Phillips wrote:

> if on a rev. 2.1, adjust UCC clock and data timing characteristics
> as specified in the rev.2.1 erratum #2.
>
> Signed-off-by: Kim Phillips <[EMAIL PROTECTED]>
> ---
>  arch/powerpc/platforms/83xx/mpc836x_mds.c |   31 ++--
>  1 files changed, 28 insertions(+), 3 deletions(-)
>

applied.

- 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] PowerPC: Add BCM5248 and Marvell 88E1111 PHY support to NEW EMAC.

2007-10-23 Thread Kumar Gala


On Oct 23, 2007, at 10:20 AM, Josh Boyer wrote:


On Mon, 15 Oct 2007 14:27:23 -0400
Jeff Garzik <[EMAIL PROTECTED]> wrote:


Valentine Barshak wrote:
This patch adds BCM5248 and Marvell 88E PHY support to NEW  
EMAC driver.

These PHY chips are used on PowerPC 440EPx boards.
The PHY code is based on the previous work by Stefan Roese  
<[EMAIL PROTECTED]>


Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]>
---


You guys should really look at moving emac over to the phylib so we  
don't have to duplicate drivers for the same phys all over the place :)


- 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] gianfar: Fix compile regression caused by 09f75cd7

2007-10-15 Thread Kumar Gala


On Fri, 12 Oct 2007, Li Yang wrote:

> Signed-off-by: Li Yang <[EMAIL PROTECTED]>
> ---
>  drivers/net/gianfar.c |7 +++
>  1 files changed, 3 insertions(+), 4 deletions(-)

this patch got lost.

- k

>
> diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
> index 2b758fa..6d1456a 100644
> --- a/drivers/net/gianfar.c
> +++ b/drivers/net/gianfar.c
> @@ -1228,8 +1228,6 @@ static int gfar_change_mtu(struct net_device *dev, int 
> new_mtu)
>   * starting over will fix the problem. */
>  static void gfar_timeout(struct net_device *dev)
>  {
> - struct gfar_private *priv = netdev_priv(dev);
> -
>   dev->stats.tx_errors++;
>
>   if (dev->flags & IFF_UP) {
> @@ -1335,8 +1333,9 @@ struct sk_buff * gfar_new_skb(struct net_device *dev, 
> struct rxbd8 *bdp)
>   return skb;
>  }
>
> -static inline void count_errors(unsigned short status, struct gfar_private 
> *priv)
> +static inline void count_errors(unsigned short status, struct net_device 
> *dev)
>  {
> + struct gfar_private *priv = netdev_priv(dev);
>   struct net_device_stats *stats = &dev->stats;
>   struct gfar_extra_stats *estats = &priv->extra_stats;
>
> @@ -1530,7 +1529,7 @@ int gfar_clean_rx_ring(struct net_device *dev, int 
> rx_work_limit)
>
>   dev->stats.rx_bytes += pkt_len;
>   } else {
> - count_errors(bdp->status, priv);
> + count_errors(bdp->status, dev);
>
>   if (skb)
>   dev_kfree_skb_any(skb);
> --
> 1.5.3.2.104.g41ef
>
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] gianfar: Cleanup compile warning caused by 0795af57

2007-10-15 Thread Kumar Gala
On Mon, 15 Oct 2007, Jeff Garzik wrote:

> Li Yang wrote:
> > Signed-off-by: Li Yang <[EMAIL PROTECTED]>
> > ---
> >  drivers/net/gianfar.c |1 -
> >  1 files changed, 0 insertions(+), 1 deletions(-)
>
> applied all three gianfar patches
>

Jeff,

You seem to have lost one of the patches:

[PATCH] gianfar: Fix compile regression caused by 09f75cd7

http://marc.info/?l=linux-netdev&m=119219683128258&w=2

- 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] gianfar: Cleanup compile warning caused by 0795af57

2007-10-12 Thread Kumar Gala


On Oct 12, 2007, at 8:53 AM, Li Yang wrote:


Signed-off-by: Li Yang <[EMAIL PROTECTED]>


Acked-by: Kumar Gala <[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] gianfar: Fix compile regression caused by 09f75cd7

2007-10-12 Thread Kumar Gala


On Oct 12, 2007, at 8:53 AM, Li Yang wrote:


Signed-off-by: Li Yang <[EMAIL PROTECTED]>


Acked-by: Kumar Gala <[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] gianfar: Fix compile regression caused by bea3348e

2007-10-12 Thread Kumar Gala


On Oct 12, 2007, at 8:53 AM, Li Yang wrote:


Signed-off-by: Li Yang <[EMAIL PROTECTED]>


Acked-by: Kumar Gala <[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 v4] qe: miscellaneous code improvements and fixes to the QE library

2007-10-03 Thread Kumar Gala


On Oct 3, 2007, at 1:00 PM, Timur Tabi wrote:


Stephen Hemminger wrote:

Separate the changes into individual patches to allow for better  
comment/review

and bisection in case of regression.


That would be too difficult.  Some of the changes are single lines,  
and this patch has already been approved -- I just cross-posted to  
netdev because I made a few ucc_geth changes that can't be  
docoupled from the powerpc changes.  A series of 18 patches would  
just be convoluted.


Normally I would agree, but at this point I'm not going to gripe too  
much about 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


Fwd: [PATCH#2 3/4] [PPC] Compile fix for 8xx CPM Ehernet driver

2007-09-28 Thread Kumar Gala

Begin forwarded message:


From: Jochen Friedrich <[EMAIL PROTECTED]>
Date: September 24, 2007 12:15:35 PM CDT
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED], Marcelo Tosatti <[EMAIL PROTECTED]>
Subject: [PATCH#2 3/4] [PPC] Compile fix for 8xx CPM Ehernet driver


Jeff,

Please pick up for 2.6.23 if you don't mind.

- k




Add #include  for flush_dcache_range
to make the driver compile again.

 CC  arch/ppc/8xx_io/enet.o
arch/ppc/8xx_io/enet.c: In function 'scc_enet_start_xmit':
arch/ppc/8xx_io/enet.c:240: error: implicit declaration of function
'flush_dcache_range'
make[1]: *** [arch/ppc/8xx_io/enet.o] Error 1
make: *** [arch/ppc/8xx_io] Error 2

Signed-off-by: Jochen Friedrich <[EMAIL PROTECTED]>
---
arch/ppc/8xx_io/enet.c |1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/ppc/8xx_io/enet.c b/arch/ppc/8xx_io/enet.c
index 703d47e..eace3bc 100644
--- a/arch/ppc/8xx_io/enet.c
+++ b/arch/ppc/8xx_io/enet.c
@@ -44,6 +44,7 @@
 #include 
 #include 
 #include 
+#include 

 /*
  * Theory of Operation



-
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] ucc_geth: fix compilation

2007-09-18 Thread Kumar Gala


On Sep 18, 2007, at 3:56 AM, Li Yang-r58472 wrote:


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
On Behalf Of Kumar Gala
Sent: Friday, September 14, 2007 10:08 PM
To: Jeff Garzik
Cc: [EMAIL PROTECTED] list; netdev
Subject: Re: [PATCH] ucc_geth: fix compilation


On Sep 13, 2007, at 10:23 AM, Anton Vorontsov wrote:


Currently qe_bd_t is used in the macro call --

dma_unmap_single, which

is a no-op on PPC32, thus error is hidden today. Starting

with 2.6.24,

macro will be replaced by the empty static function, and

erroneous use

of qe_bd_t will trigger compilation error.

Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
---


Jeff, I'm going to pick this up via the powerpc.git tree
since its currently only broken in our for-2.6.24 branch
(because of other changes in there).  Any issues?


Kumar,

Kim Phillips has posted the same patch to netdev list before Anton.
Therefore, I do prefer to use his.  Thanks


No problem.  Jeff seems to have picked up some version of the fix.

- 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] ucc_geth: fix compilation

2007-09-14 Thread Kumar Gala


On Sep 13, 2007, at 10:23 AM, Anton Vorontsov wrote:


Currently qe_bd_t is used in the macro call -- dma_unmap_single,
which is a no-op on PPC32, thus error is hidden today. Starting
with 2.6.24, macro will be replaced by the empty static function,
and erroneous use of qe_bd_t will trigger compilation error.

Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
---


Jeff, I'm going to pick this up via the powerpc.git tree since its  
currently only broken in our for-2.6.24 branch (because of other  
changes in there).  Any issues?


- k



Reposting this to include netdev in Cc.

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

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 12e01b2..9a38dfe 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -2148,7 +2148,7 @@ static void ucc_geth_memclean(struct  
ucc_geth_private *ugeth)

for (j = 0; j < ugeth->ug_info->bdRingLenTx[i]; j++) {
if (ugeth->tx_skbuff[i][j]) {
dma_unmap_single(NULL,
-((qe_bd_t *)bd)->buf,
+((struct qe_bd *)bd)->buf,
 (in_be32((u32 *)bd) &
  BD_LENGTH_MASK),
 DMA_TO_DEVICE);
--
1.5.0.6
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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


Re: [PATCH] ucc_geth: kill unused include

2007-08-25 Thread Kumar Gala


On Aug 24, 2007, at 11:37 PM, Jeff Garzik wrote:


Kumar Gala wrote:
The ucc_geth_mii code is based on the gianfar_mii code that use to  
include

ocp.h.  ucc never need this and it causes issues when we want to kill
arch/ppc includes from arch/powerpc.
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
Jeff, if you issue with this for 2.6.23, I'd prefer to push this via
the powerpc.git trees in 2.6.24 as part of a larger cleanup.  Let  
me know

one way or the other.
- k
 drivers/net/ucc_geth_mii.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c
index 6c257b8..df884f0 100644
--- a/drivers/net/ucc_geth_mii.c
+++ b/drivers/net/ucc_geth_mii.c
@@ -32,7 +32,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 


Feel free to push via PPC git


will do.

thanks

- 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 12/30] net: No point in casting kmalloc return values in Gianfar Ethernet Driver

2007-08-24 Thread Kumar Gala


On Aug 23, 2007, at 6:59 PM, Jesper Juhl wrote:


kmalloc() returns a void ptr, so there's no need to cast its return
value in drivers/net/gianfar.c .

Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]>


Acked-by: Kumar Gala <[EMAIL PROTECTED]>

- 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


[PATCH] ucc_geth: kill unused include

2007-08-22 Thread Kumar Gala
The ucc_geth_mii code is based on the gianfar_mii code that use to include
ocp.h.  ucc never need this and it causes issues when we want to kill
arch/ppc includes from arch/powerpc.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---

Jeff, if you issue with this for 2.6.23, I'd prefer to push this via
the powerpc.git trees in 2.6.24 as part of a larger cleanup.  Let me know
one way or the other.

- k

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

diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c
index 6c257b8..df884f0 100644
--- a/drivers/net/ucc_geth_mii.c
+++ b/drivers/net/ucc_geth_mii.c
@@ -32,7 +32,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-- 
1.5.2.4

-
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 6/7 v2] fs_enet: Be an of_platform device when CONFIG_PPC_CPM_NEW_BINDING is set.

2007-08-18 Thread Kumar Gala


On Aug 17, 2007, at 1:17 PM, Scott Wood wrote:

The existing OF glue code was crufty and broken.  Rather than fix  
it, it

will be removed, and the ethernet driver now talks to the device tree
directly.

The old, non-CONFIG_PPC_CPM_NEW_BINDING code can go away once CPM
platforms are dropped from arch/ppc (which will hopefully be soon),  
and

existing arch/powerpc boards that I wasn't able to test on for this
patchset get converted (which should be even sooner).

mii-bitbang.c now also uses the generic bitbang code.

Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
---
Sorry, the previous version of this patch had bb_ops in the wrong
place, and wouldn't build when not using the new binding.


This patch seems to mix moving to using the device tree directly w/o  
some other modifications.  Can it be broken into those two changes as  
they'd be easier to review.


- 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/2] [POWERPC] Add support of platforms without PHY to gianfar driver

2007-07-26 Thread Kumar Gala


On Jul 25, 2007, at 4:21 PM, Jeff Garzik wrote:


I'll let paulus and linuxppc merge this one (or not)...


That would most likely be me, than paulus.  Since this is for a  
Freescale PPC SoC.


- 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


[PATCH] gfar: Fix modpost warning

2007-07-25 Thread Kumar Gala
Fix the following modpost warning:

WARNING: vmlinux.o(.init.text+0x1aa6c): Section mismatch: reference to 
.exit.text:gfar_mdio_exit (between 'gfar_init' and 'gfar_mdio_init')

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 drivers/net/gianfar_mii.c |2 +-
 drivers/net/gianfar_mii.h |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/gianfar_mii.c b/drivers/net/gianfar_mii.c
index ac3596f..100bf41 100644
--- a/drivers/net/gianfar_mii.c
+++ b/drivers/net/gianfar_mii.c
@@ -245,7 +245,7 @@ int __init gfar_mdio_init(void)
return driver_register(&gianfar_mdio_driver);
 }

-void __exit gfar_mdio_exit(void)
+void gfar_mdio_exit(void)
 {
driver_unregister(&gianfar_mdio_driver);
 }
diff --git a/drivers/net/gianfar_mii.h b/drivers/net/gianfar_mii.h
index 5d34004..b373091 100644
--- a/drivers/net/gianfar_mii.h
+++ b/drivers/net/gianfar_mii.h
@@ -42,5 +42,5 @@ struct gfar_mii {
 int gfar_mdio_read(struct mii_bus *bus, int mii_id, int regnum);
 int gfar_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value);
 int __init gfar_mdio_init(void);
-void __exit gfar_mdio_exit(void);
+void gfar_mdio_exit(void);
 #endif /* GIANFAR_PHY_H */
-- 
1.5.2.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


Re: modpost warning question

2007-07-25 Thread Kumar Gala


On Jul 25, 2007, at 2:27 AM, Sam Ravnborg wrote:


On Wed, Jul 25, 2007 at 02:14:12AM -0500, Kumar Gala wrote:

I'm seeing the following warning:

WARNING: vmlinux.o(.init.text+0x1acdc): Section mismatch:  
reference to

.exit.text:gfar_mdio_exit (between 'gfar_init' and 'gfar_mdio_init')

I don't understand why its not ok to access .exit.text  
from .init.text


Several architectures discards .exit.text in the final linker
script (arch/$(ARCH)/kernel/vmlinux.lds.S

So any references to .exit.text will when a module is build-in result
in a linker error because ld will flag it as an error when we  
reference

a symbol in a discarded section.

For the popular architectures (i386,x86_64) we discard .exit.text at
runtime so here we do not see the error from ld (sadly).


Fair point, wondering what we do with .exit on PPC, another thing for  
the list :)


- 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


modpost warning question

2007-07-25 Thread Kumar Gala
I'm seeing the following warning:

WARNING: vmlinux.o(.init.text+0x1acdc): Section mismatch: reference to
.exit.text:gfar_mdio_exit (between 'gfar_init' and 'gfar_mdio_init')

I don't understand why its not ok to access .exit.text from .init.text

The following addresses the issue, however I don't particularly like it:

diff --git a/drivers/net/gianfar_mii.c b/drivers/net/gianfar_mii.c
index ac3596f..100bf41 100644
--- a/drivers/net/gianfar_mii.c
+++ b/drivers/net/gianfar_mii.c
@@ -245,7 +245,7 @@ int __init gfar_mdio_init(void)
return driver_register(&gianfar_mdio_driver);
 }

-void __exit gfar_mdio_exit(void)
+void gfar_mdio_exit(void)
 {
driver_unregister(&gianfar_mdio_driver);
 }
diff --git a/drivers/net/gianfar_mii.h b/drivers/net/gianfar_mii.h
index 5d34004..b373091 100644
--- a/drivers/net/gianfar_mii.h
+++ b/drivers/net/gianfar_mii.h
@@ -42,5 +42,5 @@ struct gfar_mii {
 int gfar_mdio_read(struct mii_bus *bus, int mii_id, int regnum);
 int gfar_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value);
 int __init gfar_mdio_init(void);
-void __exit gfar_mdio_exit(void);
+void gfar_mdio_exit(void);
 #endif /* GIANFAR_PHY_H */
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] Fix error checking in Vitesse IRQ config

2007-07-19 Thread Kumar Gala


On Jul 18, 2007, at 1:35 AM, Andy Fleming wrote:


phy_read() returns a negative number if there's an error, but the
error-checking code in the Vitesse driver's config_intr function
triggers if phy_read() returns non-zero.  Correct that.

Signed-off-by: Andy Fleming <[EMAIL PROTECTED]>


Jeff,

Can you make sure to send this to linus since its need to properly  
fix the Vitesse phy's used on the 8641HPCN and 8544 DS boards.


thanks

- k


---
I made a really stupid mistake in the 4 patches I sent out,  
earlier.  I

thought those patches had been tested, but they hadn't been.  This one
corrects a tiny error in the patch, and they have now been tested.   
As before

this change can be pulled from:

http://opensource.freescale.com/pub/scm/linux-2.6-85xx.git netdev

Really, REALLY sorry about that.  I have been given a paper bag of  
appropriate

size and shape to fit over my head.

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

diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c
index 6a53856..8874497 100644
--- a/drivers/net/phy/vitesse.c
+++ b/drivers/net/phy/vitesse.c
@@ -109,7 +109,7 @@ static int vsc824x_config_intr(struct  
phy_device *phydev)

 */
err = phy_read(phydev, MII_VSC8244_ISTAT);

-   if (err)
+   if (err < 0)
return err;

err = phy_write(phydev, MII_VSC8244_IMASK, 0);
--
1.5.0.2.230.gfbe3d-dirty

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


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


Re: [PATCH 2.6.22-rc7 0/4] phy/gianfar: Fixes for gianfar and vitesse RGMII-ID support

2007-07-16 Thread Kumar Gala

Greg,

Can you look at pulling these fixes for the next 2.6.22.x stable  
release.


- k

On Jul 17, 2007, at 12:07 AM, Jeff Garzik wrote:


Andy Fleming wrote:
A few bugs in the Vitesse PHY driver were found on the 8641D HPCN  
board.
Originally, they were masked by a bug in the PHY Lib which was  
fixed by patch 5f708dd91d15876e26d7a57f97a255cedffca463 (Fix  
phy_id for Vitesse 824x PHY).
That patch allowed the Vitesse PHY to bind on the 8641D HPCN  
board, thereby
exposing a bug in the interrupt handling and a bug in the  
configuration of
the PHY.  This sequence of patches fixes the irq handling bug,  
then fixes the configuration bug in 3 places:

1) The Vitesse PHY driver
2) The gianfar driver (needs to pass in the mode correctly for  
internal delay)

3) The OF device tree for arch/powerpc boards
You can apply the following patches, or pull them directly:
The following changes since commit  
c5e3ae8823693b260ce1f217adca8add1bc0b3de:

  Ayaz Abdulla (1):
forcedeth bug fix: realtek phy
are found in the git repository at:
  http://opensource.freescale.com/pub/scm/linux-2.6-85xx.git netdev
Andy Fleming (4):
  Fix Vitesse 824x PHY interrupt acking
  Add phy-connection-type to gianfar nodes
  Fix Vitesse RGMII-ID support
  Fix RGMII-ID handling in gianfar
 Documentation/powerpc/booting-without-of.txt |6 +++
 arch/powerpc/boot/dts/mpc8641_hpcn.dts   |4 ++
 arch/powerpc/sysdev/fsl_soc.c|9 +
 drivers/net/gianfar.c|   12 ++-
 drivers/net/phy/vitesse.c|   46 ++ 
+---

 include/linux/fsl_devices.h  |1 +
 6 files changed, 72 insertions(+), 6 deletions(-)


pulled



-
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] gianfar: kill unused header

2007-07-12 Thread Kumar Gala
A long time ago we used OCP with the gianfar driver.  Eventually when
we kill arch/ppc including this will cause issues so lets just kill it now.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>

---
commit 4e2440a284a0bfaaf3baa0ba4de2c2300912c983
tree cd40eeafcd71577c95dc775b2e682ed852db5f71
parent 773208946a132fb733ba273ee8562814f828cc28
author Kumar Gala <[EMAIL PROTECTED]> Fri, 13 Jul 2007 00:37:49 -0500
committer Kumar Gala <[EMAIL PROTECTED]> Fri, 13 Jul 2007 00:37:49 -0500

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

diff --git a/drivers/net/gianfar_mii.c b/drivers/net/gianfar_mii.c
index 5dd34a1..ac3596f 100644
--- a/drivers/net/gianfar_mii.c
+++ b/drivers/net/gianfar_mii.c
@@ -31,7 +31,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Please pull from 'from_linus' branch

2007-07-01 Thread Kumar Gala


On Jun 29, 2007, at 6:06 AM, Jeff Garzik wrote:


Kumar Gala wrote:

Please pull from 'for_linus' branch of
	master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git  
for_linus

to receive the following updates:
 drivers/net/gianfar.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Kumar Gala (1):
  gianfar: Fix typo bug introduced by move to udp_hdr()


Why is net driver stuff no longer going through me?

Fixes are regularly going upstream.


Jeff,

Can you either pull this in your upstream-fixes branch for Linus  
before 2.6.22 comes out.


- 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: Please pull from 'from_linus' branch

2007-06-30 Thread Kumar Gala


On Jun 29, 2007, at 6:06 AM, Jeff Garzik wrote:


Kumar Gala wrote:

Please pull from 'for_linus' branch of
	master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git  
for_linus

to receive the following updates:
 drivers/net/gianfar.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Kumar Gala (1):
  gianfar: Fix typo bug introduced by move to udp_hdr()


Why is net driver stuff no longer going through me?

Fixes are regularly going upstream.


Sorry about that, will push stuff through you in the future.  I've  
sent Linus one off fixes in the past for post -rc issues.


- 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


Please pull from 'from_linus' branch

2007-06-28 Thread Kumar Gala
Please pull from 'for_linus' branch of

master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git for_linus

to receive the following updates:

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

Kumar Gala (1):
  gianfar: Fix typo bug introduced by move to udp_hdr()

commit 8da32de5c845b711a500f89342baf10c662e2ecb
Author: Kumar Gala <[EMAIL PROTECTED]>
Date:   Fri Jun 29 00:12:04 2007 -0500

gianfar: Fix typo bug introduced by move to udp_hdr()

In commit 4bedb45203eab92a87b4c863fe2d0cded633427f both the udp and tcp
cases where changed to use udp_hdr() instead of leaving the tcp case
alone and fixing with tcp_hdr().

This ended up causing random behavior with TCP connections because
of looking for tcp_hdr()->check in the wrong place.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>

diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 6822bf1..1b854bf 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -944,7 +944,7 @@ static inline void gfar_tx_checksum(struct sk_buff *skb, 
struct txfcb *fcb)
flags |= TXFCB_UDP;
fcb->phcs = udp_hdr(skb)->check;
} else
-   fcb->phcs = udp_hdr(skb)->check;
+   fcb->phcs = tcp_hdr(skb)->check;

/* l3os is the distance between the start of the
 * frame (skb->data) and the start of the IP hdr.
-
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 from 'from_linus' branch

2007-06-28 Thread Kumar Gala
Please pull from 'for_linus' branch of

master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git for_linus

to receive the following updates:

 drivers/net/phy/mdio_bus.c |3 ++-
 drivers/net/phy/vitesse.c  |2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

Kumar Gala (1):
  phy: Fix phy_id for Vitesse 824x PHY

commit 5f708dd91d15876e26d7a57f97a255cedffca463
Author: Kumar Gala <[EMAIL PROTECTED]>
Date:   Thu Jun 28 13:26:06 2007 -0500

phy: Fix phy_id for Vitesse 824x PHY

The phy_id specified for the Vitesse 824x PHY would never match because
it was expecting bits to be set that would be masked by the phy_id_mask.
Fix the phy_id so it will match properly, and changed the mdio_bus_match
to mask both the driver and devices phy_id with the mask so we dont have
this issue in the future.

    Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>

diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index fc4aee9..fc2f0e6 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -131,7 +131,8 @@ static int mdio_bus_match(struct device *dev, struct 
device_driver *drv)
struct phy_device *phydev = to_phy_device(dev);
struct phy_driver *phydrv = to_phy_driver(drv);

-   return (phydrv->phy_id == (phydev->phy_id & phydrv->phy_id_mask));
+   return ((phydrv->phy_id & phydrv->phy_id_mask) ==
+   (phydev->phy_id & phydrv->phy_id_mask));
 }

 /* Suspend and resume.  Copied from platform_suspend and
diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c
index 792716b..596222b 100644
--- a/drivers/net/phy/vitesse.c
+++ b/drivers/net/phy/vitesse.c
@@ -84,7 +84,7 @@ static int vsc824x_config_intr(struct phy_device *phydev)

 /* Vitesse 824x */
 static struct phy_driver vsc8244_driver = {
-   .phy_id = 0x000fc6c2,
+   .phy_id = 0x000fc6c0,
.name   = "Vitesse VSC8244",
.phy_id_mask= 0x000fffc0,
.features   = PHY_GBIT_FEATURES,
-
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 3/5] ucc_geth: eliminate max-speed, change interface-type to phy-connection-type

2007-05-23 Thread Kumar Gala


On May 18, 2007, at 10:33 AM, Kim Phillips wrote:


On Fri, 18 May 2007 09:07:42 -0500
Kumar Gala <[EMAIL PROTECTED]> wrote:



On May 17, 2007, at 8:53 PM, Jeff Garzik wrote:


Kim Phillips wrote:

On Tue, 15 May 2007 17:45:19 -0400
Jeff Garzik <[EMAIL PROTECTED]> wrote:

Kim Phillips wrote:

It was agreed that phy-connection-type was a better name for
the interface-type property, so this patch renames it.

Also, the max-speed property name was determined too generic,
and is therefore eliminated in favour of phy-connection-type
derivation logic.

includes corrections to copyright text.

Signed-off-by: Kim Phillips <[EMAIL PROTECTED]>
---
 drivers/net/ucc_geth.c |   40 +++
+
 drivers/net/ucc_geth_mii.c |9 +
 drivers/net/ucc_geth_mii.h |   10 +-
 3 files changed, 26 insertions(+), 33 deletions(-)

applied to #upstream


just to be clear; only the mpc8323e-mds board works on your
current #upstream-{fixes,linus}.
The mpc8323e-rdb and mpc8360e-mds require
phylib: add the ICPlus IP175C PHY driver
and phylib: enable RGMII-ID on the Marvell m88e PHY
respectively in order to work.
I'm ok with the SGMII patches:
phylib: m88e: enable SGMII mode
gianfar: add support for SGMII
staying on #upstream, but 2 out of 3 boards are currently broken
for #upstream-{fixes,linus}.


New hardware support is always "broken" until merged.  Nonetheless
it is still new and outside the merge window.


I think new is a little relative here.  The MPC8232-RDB & MPC8360E-
MDS boards worked with 2.6.21 and the UCC. They had support for the
PHYs that Kim's listed built directly into the ucc driver and not as
part of the phy lib.  Since we've moved to using the phy lib in
2.6.22 we've broken these boards since their PHY drivers aren't
currently in linus's tree.

Kim, correct me if I'm wrong.



thanks for clarifying that - it is indeed the case.


Jeff, any comments?

While I can see the view that the ICPlus & m88e in RGMII may be  
"new" Kim did post these patches before the release of 2.6.21.


http://marc.info/?l=linux-netdev&m=117624199831578&w=2
http://marc.info/?l=linux-netdev&m=117624199831578&w=2

And I believe its our normal stance to not introduce regressions  
between kernel versions when possible.  It would be appreciated if  
you could push the two patches Kim has referenced to linus for 2.6.22  
otherwise we've created a regression in supporting the MPC8323 RDB &  
MPC8360 MDS boards.


thanks

- 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 3/5] ucc_geth: eliminate max-speed, change interface-type to phy-connection-type

2007-05-18 Thread Kumar Gala


On May 17, 2007, at 8:53 PM, Jeff Garzik wrote:


Kim Phillips wrote:

On Tue, 15 May 2007 17:45:19 -0400
Jeff Garzik <[EMAIL PROTECTED]> wrote:

Kim Phillips wrote:

It was agreed that phy-connection-type was a better name for
the interface-type property, so this patch renames it.

Also, the max-speed property name was determined too generic,
and is therefore eliminated in favour of phy-connection-type
derivation logic.

includes corrections to copyright text.

Signed-off-by: Kim Phillips <[EMAIL PROTECTED]>
---
 drivers/net/ucc_geth.c |   40 +++ 
+

 drivers/net/ucc_geth_mii.c |9 +
 drivers/net/ucc_geth_mii.h |   10 +-
 3 files changed, 26 insertions(+), 33 deletions(-)

applied to #upstream

just to be clear; only the mpc8323e-mds board works on your  
current #upstream-{fixes,linus}.

The mpc8323e-rdb and mpc8360e-mds require
phylib: add the ICPlus IP175C PHY driver
and phylib: enable RGMII-ID on the Marvell m88e PHY
respectively in order to work.
I'm ok with the SGMII patches:
phylib: m88e: enable SGMII mode
gianfar: add support for SGMII
staying on #upstream, but 2 out of 3 boards are currently broken  
for #upstream-{fixes,linus}.


New hardware support is always "broken" until merged.  Nonetheless  
it is still new and outside the merge window.


I think new is a little relative here.  The MPC8232-RDB & MPC8360E- 
MDS boards worked with 2.6.21 and the UCC. They had support for the  
PHYs that Kim's listed built directly into the ucc driver and not as  
part of the phy lib.  Since we've moved to using the phy lib in  
2.6.22 we've broken these boards since their PHY drivers aren't  
currently in linus's tree.


Kim, correct me if I'm wrong.

- 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] e1000: Work around 82571 completion timout on Pseries HW

2007-05-17 Thread Kumar Gala


On May 17, 2007, at 4:01 AM, Christoph Hellwig wrote:


On Wed, May 16, 2007 at 07:43:27PM -0500, Kumar Gala wrote:

index 49be393..830d851 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -819,6 +819,16 @@ e1000_reset(struct e1000_adapter *adapter)
E1000_WRITE_REG(&adapter->hw, CTRL, ctrl);
}

+#if defined(CONFIG_PPC64) || defined(CONFIG_PPC)


If this is really on need on pseries HW this should be #ifdef
CONFIG_PPC_PSERIES.  No reason to force this on all PPC.


No, it shouldn't.  powerpc kernels are multi-platform.


Right, but if you build a multi-platform kernel with pseries support  
you'll get CONFIG_PPC_PSERIES set.


It really shouldn't be there at all because something in either the  
intel

or pseries hardware is totally buggy and we should disable features in
the buggy one completely.


Agreed.

- 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] e1000: Work around 82571 completion timout on Pseries HW

2007-05-16 Thread Kumar Gala


On May 16, 2007, at 3:53 AM, Auke Kok wrote:


Our 82571 (first PCI-E hardware) causes P-Series hardware to throw
issues. Disabling PCI-E completion timeouts in our NIC resolves
the issue.

Signed-off-by: Auke Kok <[EMAIL PROTECTED]>
Cc: Wen Xiong <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_main.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/ 
e1000_main.c

index 49be393..830d851 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -819,6 +819,16 @@ e1000_reset(struct e1000_adapter *adapter)
E1000_WRITE_REG(&adapter->hw, CTRL, ctrl);
}

+#if defined(CONFIG_PPC64) || defined(CONFIG_PPC)


If this is really on need on pseries HW this should be #ifdef  
CONFIG_PPC_PSERIES.  No reason to force this on all PPC.



+#define E1000_GCR_DISABLE_TIMEOUT_MECHANISM 0x8000
+   if (adapter->hw.mac.type == e1000_82571) {
+   /* work around pSeries hardware by disabling timeouts */
+   u32 gcr = E1000_READ_REG(&adapter->hw, E1000_GCR);
+   gcr |= E1000_GCR_DISABLE_TIMEOUT_MECHANISM;
+   E1000_WRITE_REG(&adapter->hw, E1000_GCR, gcr);
+   }
+#endif
+
/* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */
E1000_WRITE_REG(&adapter->hw, VET, ETHERNET_IEEE_VLAN_TYPE);

-
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: Kconfig warnings on latest GIT

2007-05-14 Thread Kumar Gala
On Mon, 14 May 2007, Johannes Berg wrote:

> Simon,
>
> > I don't think that this is quite right, or at least it isn't quite the
> > same as before.
>
> Yeah, I think you're right.
>
> >  I think that was is below will toggle
> > SYS_SUPPORTS_APM_EMULATION when PMAC_APM_EMU is selected,
> > which I think is what you want. Is it also neccessary to
> > add a dependancy on PPC_PMAC to PMAC_APM_EMU ?
>
> No, it depends on ADB_PMU which depends on PPC_PMAC.
>
> > config PMAC_APM_EMU
> > tristate "APM emulation"
> > select APM_EMULATION
> > depends on ADB_PMU && PM
> >
> > config SYS_SUPPORTS_APM_EMULATION
> > bool
> > default y if PMAC_APM_EMU
>
> I still have to try it, I haven't been yet seen Kumar's fix that he said
> he'd done.
>
> johannes

this was my fix which looks pretty much the same.

- k

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index ccc5410..af70799 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -118,6 +118,7 @@ config GENERIC_BUG
depends on BUG

 config SYS_SUPPORTS_APM_EMULATION
+   default y if PMAC_APM_EMU
bool

 config DEFAULT_UIMAGE
diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig
index 58926da..f44c94a 100644
--- a/drivers/macintosh/Kconfig
+++ b/drivers/macintosh/Kconfig
@@ -113,7 +113,6 @@ config PMAC_SMU

 config PMAC_APM_EMU
tristate "APM emulation"
-   select SYS_SUPPORTS_APM_EMULATION
select APM_EMULATION
depends on ADB_PMU && PM

-
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] phylib: phy_ethtool_{sset,gset} -- check phydev for NULL

2007-05-11 Thread Kumar Gala


On May 11, 2007, at 8:49 AM, Matvejchikov Ilya wrote:


2007/5/11, Kumar Gala <[EMAIL PROTECTED]>:


On May 11, 2007, at 5:58 AM, Matvejchikov Ilya wrote:

> Signed-off-by: Matvejchikov Ilya <[EMAIL PROTECTED]>
> ---
>
> diff -purN linux-2.6.21-clean/drivers/net/phy/phy.c
> linux-2.6.21/drivers/net/phy/phy.c
> --- linux-2.6.21-clean/drivers/net/phy/phy.c  2007-04-26
> 07:08:32.0 +0400
> +++ linux-2.6.21/drivers/net/phy/phy.c2007-05-04
> 08:22:01.0 +0400
> @@ -245,6 +245,9 @@ EXPORT_SYMBOL(phy_sanitize_settings);
>  */
> int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd
> *cmd)
> {
> + if (unlikely(!phydev))
> + return -EINVAL;

Should this be -ENODEV?


If we get the ENODEV error, we are suppose that there is no device at
all. PHY device may not be connected to the NET device. But if it
exists we can't say that there is NODEV...

I think it should be -EINVAL.


Hmm, if the phy isn't connected to the NET device doesn't that mean  
we don't have a PHY device (from the point of view of the netdevice),  
thus NODEV?


Whatever we should cleanup the current users of phy_ethtool_sset/ 
phy_ethtool_gset.



> +
>   if (cmd->phy_address != phydev->addr)
>   return -EINVAL;
>
> @@ -289,6 +292,9 @@ EXPORT_SYMBOL(phy_ethtool_sset);
>
> int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd
> *cmd)
> {
> + if (unlikely(!phydev))
> + return -EINVAL;

same question.


The same answer :)


> +
>   cmd->supported = phydev->supported;
>
>   cmd->advertising = phydev->advertising;
> -
> To unsubscribe from this list: send the line "unsubscribe  
netdev" in

> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html




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


Re: [PATCH] phylib: phy_ethtool_{sset,gset} -- check phydev for NULL

2007-05-11 Thread Kumar Gala


On May 11, 2007, at 5:58 AM, Matvejchikov Ilya wrote:


Signed-off-by: Matvejchikov Ilya <[EMAIL PROTECTED]>
---

diff -purN linux-2.6.21-clean/drivers/net/phy/phy.c
linux-2.6.21/drivers/net/phy/phy.c
--- linux-2.6.21-clean/drivers/net/phy/phy.c	2007-04-26  
07:08:32.0 +0400
+++ linux-2.6.21/drivers/net/phy/phy.c	2007-05-04  
08:22:01.0 +0400

@@ -245,6 +245,9 @@ EXPORT_SYMBOL(phy_sanitize_settings);
 */
int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd  
*cmd)

{
+   if (unlikely(!phydev))
+   return -EINVAL;


Should this be -ENODEV?


+
if (cmd->phy_address != phydev->addr)
return -EINVAL;

@@ -289,6 +292,9 @@ EXPORT_SYMBOL(phy_ethtool_sset);

int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd  
*cmd)

{
+   if (unlikely(!phydev))
+   return -EINVAL;


same question.


+
cmd->supported = phydev->supported;

cmd->advertising = phydev->advertising;
-
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: Kconfig warnings on latest GIT

2007-05-10 Thread Kumar Gala
On Fri, 11 May 2007, Simon Horman wrote:

> On Thu, May 10, 2007 at 08:47:05PM -0500, Kumar Gala wrote:
> > Try this patch:
>
> That certainly resolves the problem for me.
> I'll see about doing something like that for the similar
> Kconfig problems that I see.
>
> --
> Horms
>   H: http://www.vergenet.net/~horms/
>   W: http://www.valinux.co.jp/en/
>

I've got a similar fix for SYS_SUPPORTS_APM_EMULATION already.  I'll push
both of these to Paul.  If you can put something in place for the
Atari/68k and send it to Geert that would be good (feeling a little lazy
right now :)

I'm still not happy about this fix.  I'd like to get Sam's feeling on if
we can fixup kconfig not to warn if the dependency isn't meet.  I think
the select is valid, and would prefer to fix this properly before we paper
tape over 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: Kconfig warnings on latest GIT

2007-05-10 Thread Kumar Gala


On May 10, 2007, at 8:25 PM, Simon Horman wrote:


On Thu, May 10, 2007 at 11:56:48AM -0500, Timur Tabi wrote:

Simon Horman wrote:


So my question is: in which Kconfig do I define "UCC_FAST_TEMP" and
"UCC_SLOW_TEMP"?  At first I thought, just put it in drivers/ 
Kconfig, but
that Kconfig does nothing but including other Kconfigs.  I  
believe that if I

submit a patch that adds "UCC_FAST_TEMP" and "UCC_SLOW_TEMP" to
drivers/Kconfig, it will be rejected.  Either that, or I'll  
spend six weeks

trying to persuade everyone that it's a good idea.

Does anyone have any suggestions on how I can fix this?

That does seem like a reasonable suggestion, and one that
would probably work well with the other similar problems
that have been introduced sice 2.6.21.


Looks like the fix is simpler than I thought.  Instead of having

UCC_GETH
select UCC_FAST

I need to do

UCC_FAST
default y if UCC_GETH


I pondered something like that, but I couldn't get it quite right :(


I'll have a patch that fixes this out later today.

I chose the first method because I wanted each individual UCC device
driver to select UCC_FAST or UCC_SLOW as appropriate, so that I
wouldn't have to update arch/powerpc/sysdev/qe_lib/Kconfig every time
we add a new UCC driver.  Oh well.


It really seems like the kconfig shouldn't complain if the depends  
isnt satisfied.


- 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: Kconfig warnings on latest GIT

2007-05-10 Thread Kumar Gala
On Fri, 11 May 2007, Simon Horman wrote:

> On Thu, May 10, 2007 at 11:56:48AM -0500, Timur Tabi wrote:
> > Simon Horman wrote:
> >
> > >>So my question is: in which Kconfig do I define "UCC_FAST_TEMP" and
> > >>"UCC_SLOW_TEMP"?  At first I thought, just put it in drivers/Kconfig, but
> > >>that Kconfig does nothing but including other Kconfigs.  I believe that 
> > >>if I
> > >>submit a patch that adds "UCC_FAST_TEMP" and "UCC_SLOW_TEMP" to
> > >>drivers/Kconfig, it will be rejected.  Either that, or I'll spend six 
> > >>weeks
> > >>trying to persuade everyone that it's a good idea.
> > >>
> > >>Does anyone have any suggestions on how I can fix this?
> > >That does seem like a reasonable suggestion, and one that
> > >would probably work well with the other similar problems
> > >that have been introduced sice 2.6.21.
> >
> > Looks like the fix is simpler than I thought.  Instead of having
> >
> > UCC_GETH
> > select UCC_FAST
> >
> > I need to do
> >
> > UCC_FAST
> > default y if UCC_GETH
>
> I pondered something like that, but I couldn't get it quite right :(
>
> > I'll have a patch that fixes this out later today.
> >
> > I chose the first method because I wanted each individual UCC device
> > driver to select UCC_FAST or UCC_SLOW as appropriate, so that I
> > wouldn't have to update arch/powerpc/sysdev/qe_lib/Kconfig every time
> > we add a new UCC driver.  Oh well.
>
> --
> Horms
>   H: http://www.vergenet.net/~horms/
>   W: http://www.valinux.co.jp/en/
>

Try this patch:

diff --git a/arch/powerpc/sysdev/qe_lib/Kconfig 
b/arch/powerpc/sysdev/qe_lib/Kconfig
index 887739f..5de7aba 100644
--- a/arch/powerpc/sysdev/qe_lib/Kconfig
+++ b/arch/powerpc/sysdev/qe_lib/Kconfig
@@ -12,6 +12,7 @@ config UCC_SLOW

 config UCC_FAST
bool
+   default y if UCC_GETH
default n
select UCC
help
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index fa489b1..b159c6c 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2276,7 +2276,6 @@ config GFAR_NAPI
 config UCC_GETH
tristate "Freescale QE Gigabit Ethernet"
depends on QUICC_ENGINE
-   select UCC_FAST
help
  This driver supports the Gigabit Ethernet mode of the QUICC Engine,
  which is available on some Freescale SOCs.
-
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: support for bridging ethernet and 802.11

2007-05-10 Thread Kumar Gala


On May 10, 2007, at 12:25 PM, Jouni Malinen wrote:


On Thu, May 10, 2007 at 07:19:35PM +0200, Johannes Berg wrote:


Ah forgot about that, I had only thought about AP/wired bridging. How
would the prism driver actually do bridging in STA mode though?


If that is referring to Host AP driver, there is support for using WDS
in client mode. If the AP understands this, the client could use
standard frames for its own packets (i.e., SA=own MAC addr) and WDS
frames for frames from all other addresses. There are some  
experimental
modes in Host AP driver that (if I remember correctly ;-) may allow  
this
to be used on a single netdev (i.e., no additional netdev needed  
for the

WDS link) and as such, this would look like working layer 2 bridging
between wlan0 and eth0 even in managed mode.


I'm a little confused.  It seems from the thread that there are  
several forums of bridging.


What I'm trying to accomplish is to take all traffic from eth0 to  
wlan0 (and the other way around).  I'm happy to configure and  
associate wlan0 with an AP.


I believe the current USB adapter I've got is using the SOFTMAC code  
right now.


- 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


support for bridging ethernet and 802.11

2007-05-10 Thread Kumar Gala
I'm wondering how to tell if a given driver/device in the kernel  
supports the ability to bridge between ethernet and 802.11.  From  
searching the web it looks like only the prism driver/device supports  
this.


- 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 v4] powerpc: change rheap functions to use ulongs instead of pointers

2007-05-09 Thread Kumar Gala
On Tue, 8 May 2007, Timur Tabi wrote:

> The rheap allocation functions return a pointer, but the actual value is based
> on how the heap was initialized, and so it can be anything, e.g. an offset
> into a buffer.  A ulong is a better representation of the value returned by
> the allocation functions.
>
> This patch changes all of the relevant rheap functions to use a unsigned long
> integers instead of a pointer.  In case of an error, the value returned is
> a negative error code that has been cast to an unsigned long.  The caller can
> use the IS_ERR_VALUE() macro to check for this.
>
> All code which calls the rheap functions is updated accordingly.  Macros
> IS_MURAM_ERR() and IS_DPERR(), have been deleted in favor of IS_ERR_VALUE().
>
> Also added error checking to rh_attach_region().
>
> Signed-off-by: Timur Tabi <[EMAIL PROTECTED]>

applied.

- 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 2/2] Rename get_property to of_get_property: drivers/net

2007-05-04 Thread Kumar Gala


On May 2, 2007, at 11:14 AM, Kumar Gala wrote:


On Wed, 2 May 2007, Jeff Garzik wrote:


Kumar Gala wrote:


On May 2, 2007, at 9:17 AM, Jeff Garzik wrote:


Kumar Gala wrote:

On Apr 28, 2007, at 10:47 PM, David Miller wrote:

From: Stephen Rothwell <[EMAIL PROTECTED]>
Date: Sun, 29 Apr 2007 11:44:46 +1000

So can I take this as a future OK for architecture specific  
network
drivers changes to go through the architecture trees (cc'd to  
you)?


It's been my experience that if I'm just working through some
platform or bus specific API changes, people like Jeff tend to
not mind if it goes via ARCH trees and the like.
Is this acceptable?   Just want to make sure before I ask Paul  
to pull

some changes that touches the following drivers:
drivers/net/fs_enet/mac-scc.c   |2 +-
drivers/net/ucc_geth.c  |   30 
drivers/serial/cpm_uart/cpm_uart_cpm1.c |4 +-
drivers/serial/cpm_uart/cpm_uart_cpm2.c |4 +-


I don't see a patch, just a diffstat.


I haven't sent a patch, just asking the question if I need to  
break it up or

not.


Without seeing the patch, I have no idea...


Here's an older version of the patch (may need to respin for it to  
apply

cleanly)


Didn't hear one way or the other if this is ok to go via the  
powerpc.git tree?


- k



From 2dd748e71cd24641c4c5d2aa6fbf86c72080ed0d Mon Sep 17 00:00:00  
2001

From: Timur Tabi <[EMAIL PROTECTED]>
Date: Thu, 12 Apr 2007 17:44:06 -0500
Subject: [PATCH] [POWERPC] Change rheap functions to use ulongs  
instead of pointers


The rheap allocation functions return a pointer, but the actual  
value is based
on how the heap was initialized, and so it can be anything, e.g. an  
offset
into a buffer.  A ulong is a better representation of the value  
returned by

the allocation functions.

This patch changes all of the relevant rheap functions to use a  
unsigned long
integers instead of a pointer.  In case of an error, the value  
returned is
a negative error code that has been cast to an unsigned long.  The  
caller can

use the IS_ERR_VALUE() macro to check for this.

All code which calls the rheap functions is updated accordingly.   
Macros
IS_MURAM_ERR() and IS_DPERR(), have been deleted in favor of  
IS_ERR_VALUE().


Also added error checking to rh_attach_region().

Signed-off-by: Timur Tabi <[EMAIL PROTECTED]>
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 arch/powerpc/lib/rheap.c|  117 + 
+-

 arch/powerpc/sysdev/commproc.c  |   20 +++---
 arch/powerpc/sysdev/cpm2_common.c   |   21 +++---
 arch/powerpc/sysdev/qe_lib/qe.c |   29 
 arch/powerpc/sysdev/qe_lib/ucc_fast.c   |5 +-
 arch/powerpc/sysdev/qe_lib/ucc_slow.c   |7 +-
 arch/ppc/8xx_io/commproc.c  |   22 +++---
 arch/ppc/lib/rheap.c|   95  
+

 arch/ppc/syslib/cpm2_common.c   |   23 +++---
 drivers/net/fs_enet/mac-scc.c   |2 +-
 drivers/net/ucc_geth.c  |   30 
 drivers/serial/cpm_uart/cpm_uart_cpm1.c |4 +-
 drivers/serial/cpm_uart/cpm_uart_cpm2.c |4 +-
 include/asm-powerpc/qe.h|   13 +---
 include/asm-ppc/commproc.h  |   13 +---
 include/asm-ppc/cpm2.h  |   13 +---
 include/asm-ppc/rheap.h |   20 +++---
 17 files changed, 221 insertions(+), 217 deletions(-)

diff --git a/arch/powerpc/lib/rheap.c b/arch/powerpc/lib/rheap.c
index 6c5c5dd..b2f6dcc 100644
--- a/arch/powerpc/lib/rheap.c
+++ b/arch/powerpc/lib/rheap.c
@@ -133,7 +133,7 @@ static rh_block_t *get_slot(rh_info_t * info)
info->empty_slots--;

/* Initialize */
-   blk->start = NULL;
+   blk->start = 0;
blk->size = 0;
blk->owner = NULL;

@@ -158,7 +158,7 @@ static void attach_free_block(rh_info_t * info,  
rh_block_t * blkn)


/* We assume that they are aligned properly */
size = blkn->size;
-   s = (unsigned long)blkn->start;
+   s = blkn->start;
e = s + size;

/* Find the blocks immediately before and after the given one
@@ -170,7 +170,7 @@ static void attach_free_block(rh_info_t * info,  
rh_block_t * blkn)

list_for_each(l, &info->free_list) {
blk = list_entry(l, rh_block_t, list);

-   bs = (unsigned long)blk->start;
+   bs = blk->start;
be = bs + blk->size;

if (next == NULL && s >= bs)
@@ -188,10 +188,10 @@ static void attach_free_block(rh_info_t *  
info, rh_block_t * blkn)

}

/* Now check if they are really adjacent */
-	if (before != NULL && s != (unsigned long)before->start + before- 
>size)

+   if (before && s != (before->start + before->size))
before = NULL;

-   if (after != NULL && e != (u

Re: [PATCH v2] gianfar: Add I/O barriers when touching buffer descriptor ownership.

2007-05-02 Thread Kumar Gala
On Wed, 2 May 2007, Scott Wood wrote:

> Kumar Gala wrote:
> > Why doesn't marking the bdp pointer volatile resolve the issue in
> > gfar_clean_rx_ring() to ensure load ordering?
>
> Because that only addresses compiler reordering (and does so in a rather
> clumsy way -- not all accesses need to be strongly ordered), not hardware
> reordering.
>
> -Scott
>

So what about some thing like this where we do the read only once?

- k

diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index a06d8d1..9cd7d1e 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -1438,31 +1438,35 @@ int gfar_clean_rx_ring(struct net_device *dev, int 
rx_work_limit)
 {
struct rxbd8 *bdp;
struct sk_buff *skb;
-   u16 pkt_len;
+   u16 pkt_len, status;
+   u32 bd_info;
int howmany = 0;
struct gfar_private *priv = netdev_priv(dev);

/* Get the first full descriptor */
bdp = priv->cur_rx;

-   while (!((bdp->status & RXBD_EMPTY) || (--rx_work_limit < 0))) {
+   bd_info = *bdp;
+
+   status = bd_info >> 16;
+   /* Remove the FCS from the packet length */
+   pkt_len = (bd_info & 0x) - 4;
+
+   while (!((status & RXBD_EMPTY) || (--rx_work_limit < 0))) {
skb = priv->rx_skbuff[priv->skb_currx];

-   if (!(bdp->status &
+   if (!(status &
  (RXBD_LARGE | RXBD_SHORT | RXBD_NONOCTET
   | RXBD_CRCERR | RXBD_OVERRUN | RXBD_TRUNCATED))) {
/* Increment the number of packets */
priv->stats.rx_packets++;
howmany++;

-   /* Remove the FCS from the packet length */
-   pkt_len = bdp->length - 4;
-
gfar_process_frame(dev, skb, pkt_len);

priv->stats.rx_bytes += pkt_len;
} else {
-   count_errors(bdp->status, priv);
+   count_errors(status, priv);

if (skb)
dev_kfree_skb_any(skb);
@@ -1480,7 +1484,7 @@ int gfar_clean_rx_ring(struct net_device *dev, int 
rx_work_limit)
priv->rx_skbuff[priv->skb_currx] = skb;

/* Update to the next pointer */
-   if (bdp->status & RXBD_WRAP)
+   if (status & RXBD_WRAP)
bdp = priv->rx_bd_base;
else
bdp++;
@@ -1490,6 +1494,11 @@ int gfar_clean_rx_ring(struct net_device *dev, int 
rx_work_limit)
(priv->skb_currx +
 1) & RX_RING_MOD_MASK(priv->rx_ring_size);

+   bd_info = *bdp;
+
+   status = bd_info >> 16;
+   /* Remove the FCS from the packet length */
+   pkt_len = (bd_info & 0x) - 4;
}

/* Update the current rxbd pointer to be the next one */
-
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 v2] gianfar: Add I/O barriers when touching buffer descriptor ownership.

2007-05-02 Thread Kumar Gala


On May 2, 2007, at 3:40 PM, Scott Wood wrote:


Kumar Gala wrote:

On May 2, 2007, at 3:12 PM, Scott Wood wrote:
wmb() is a sync, smp_wmb() is an eieio.  Andy told me he would  
not  accept a sync in those spots.

Sorry, was looking at the iobarrier code.

And the driver is already ppc-specific; it uses in/out_be32.

True, but its hidden behind the gfar_read/write accessors.
Your change is a bit more blatant.


Well, Segher doesn't want me to use iobarrier (because it's not I/ 
O). Andy doesn't want me to use wmb() (because it's sync).  I don't  
think something like gfar_wmb() would be appropriate.  So the  
remaining options are either eieio(), or a new non-arch-specific,  
non-driver-specific mem_wmb() (or whatever).


While I like the latter option, I don't think this bugfix should  
have to wait for it.


Ok, I've resigned to the eieio's.  If we end up respinning the patch  
again for any reason I'd like to see something in the commit comment  
to the fact that we are adding ppc specific sync operations.


Why doesn't marking the bdp pointer volatile resolve the issue in  
gfar_clean_rx_ring() to ensure load ordering?


- 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 v2] gianfar: Add I/O barriers when touching buffer descriptor ownership.

2007-05-02 Thread Kumar Gala


On May 2, 2007, at 3:12 PM, Scott Wood wrote:


Kumar Gala wrote:
I'd rather see a wmb() instead of eieio() to keep this code non- 
ppc  specific.  (also, we implement wmb as eieio, so I don't keep  
the  comment about it being too heavy, unless you mean generically).


wmb() is a sync, smp_wmb() is an eieio.  Andy told me he would not  
accept a sync in those spots.


Sorry, was looking at the iobarrier code.


And the driver is already ppc-specific; it uses in/out_be32.


True, but its hidden behind the gfar_read/write accessors.

Your change is a bit more blatant.

- 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 v2] gianfar: Add I/O barriers when touching buffer descriptor ownership.

2007-05-02 Thread Kumar Gala


On May 2, 2007, at 2:57 PM, Scott Wood wrote:

The hardware must not see that is given ownership of a buffer until  
it is
completely written, and when the driver receives ownership of a  
buffer,

it must ensure that any other reads to the buffer reflect its final
state.  Thus, I/O barriers are added where required.

Without this patch, I have observed GCC reordering the setting of
bdp->length and bdp->status in gfar_new_skb.

Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
---
This is version 2 of this patch.  I was told that eieio doesn't order
loads from main memory, so a sync is used instead.  Also, due to
objectons that iobarrier_* shouldn't be used for main memory, I used
eieio() instead (a wmb() would be unnecessarily heavy).


I'd rather see a wmb() instead of eieio() to keep this code non-ppc  
specific.  (also, we implement wmb as eieio, so I don't keep the  
comment about it being too heavy, unless you mean generically).


- k



 drivers/net/gianfar.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index b666a0c..b014d27 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -1025,6 +1025,7 @@ static int gfar_start_xmit(struct sk_buff  
*skb, struct net_device *dev)


dev->trans_start = jiffies;

+   eieio();
txbdp->status = status;

/* If this was the last BD in the ring, the next one */
@@ -1301,6 +1302,7 @@ struct sk_buff * gfar_new_skb(struct  
net_device *dev, struct rxbd8 *bdp)

bdp->length = 0;

/* Mark the buffer empty */
+   eieio();
bdp->status |= (RXBD_EMPTY | RXBD_INTERRUPT);

return skb;
@@ -1484,6 +1486,7 @@ int gfar_clean_rx_ring(struct net_device  
*dev, int rx_work_limit)

bdp = priv->cur_rx;

while (!((bdp->status & RXBD_EMPTY) || (--rx_work_limit < 0))) {
+   rmb();
skb = priv->rx_skbuff[priv->skb_currx];

if (!(bdp->status &
--
1.5.0.3
___
Linuxppc-dev mailing list
[EMAIL PROTECTED]
https://ozlabs.org/mailman/listinfo/linuxppc-dev


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


Re: [PATCH 2/2] Rename get_property to of_get_property: drivers/net

2007-05-02 Thread Kumar Gala
On Wed, 2 May 2007, Jeff Garzik wrote:

> Kumar Gala wrote:
> >
> > On May 2, 2007, at 9:17 AM, Jeff Garzik wrote:
> >
> > > Kumar Gala wrote:
> > > > On Apr 28, 2007, at 10:47 PM, David Miller wrote:
> > > > > From: Stephen Rothwell <[EMAIL PROTECTED]>
> > > > > Date: Sun, 29 Apr 2007 11:44:46 +1000
> > > > >
> > > > > > So can I take this as a future OK for architecture specific network
> > > > > > drivers changes to go through the architecture trees (cc'd to you)?
> > > > >
> > > > > It's been my experience that if I'm just working through some
> > > > > platform or bus specific API changes, people like Jeff tend to
> > > > > not mind if it goes via ARCH trees and the like.
> > > > Is this acceptable?   Just want to make sure before I ask Paul to pull
> > > > some changes that touches the following drivers:
> > > > drivers/net/fs_enet/mac-scc.c   |2 +-
> > > > drivers/net/ucc_geth.c  |   30 
> > > > drivers/serial/cpm_uart/cpm_uart_cpm1.c |4 +-
> > > > drivers/serial/cpm_uart/cpm_uart_cpm2.c |4 +-
> > >
> > > I don't see a patch, just a diffstat.
> >
> > I haven't sent a patch, just asking the question if I need to break it up or
> > not.
>
> Without seeing the patch, I have no idea...

Here's an older version of the patch (may need to respin for it to apply
cleanly)

>From 2dd748e71cd24641c4c5d2aa6fbf86c72080ed0d Mon Sep 17 00:00:00 2001
From: Timur Tabi <[EMAIL PROTECTED]>
Date: Thu, 12 Apr 2007 17:44:06 -0500
Subject: [PATCH] [POWERPC] Change rheap functions to use ulongs instead of 
pointers

The rheap allocation functions return a pointer, but the actual value is based
on how the heap was initialized, and so it can be anything, e.g. an offset
into a buffer.  A ulong is a better representation of the value returned by
the allocation functions.

This patch changes all of the relevant rheap functions to use a unsigned long
integers instead of a pointer.  In case of an error, the value returned is
a negative error code that has been cast to an unsigned long.  The caller can
use the IS_ERR_VALUE() macro to check for this.

All code which calls the rheap functions is updated accordingly.  Macros
IS_MURAM_ERR() and IS_DPERR(), have been deleted in favor of IS_ERR_VALUE().

Also added error checking to rh_attach_region().

Signed-off-by: Timur Tabi <[EMAIL PROTECTED]>
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 arch/powerpc/lib/rheap.c|  117 ++-
 arch/powerpc/sysdev/commproc.c  |   20 +++---
 arch/powerpc/sysdev/cpm2_common.c   |   21 +++---
 arch/powerpc/sysdev/qe_lib/qe.c |   29 
 arch/powerpc/sysdev/qe_lib/ucc_fast.c   |5 +-
 arch/powerpc/sysdev/qe_lib/ucc_slow.c   |7 +-
 arch/ppc/8xx_io/commproc.c  |   22 +++---
 arch/ppc/lib/rheap.c|   95 +
 arch/ppc/syslib/cpm2_common.c   |   23 +++---
 drivers/net/fs_enet/mac-scc.c   |2 +-
 drivers/net/ucc_geth.c  |   30 
 drivers/serial/cpm_uart/cpm_uart_cpm1.c |4 +-
 drivers/serial/cpm_uart/cpm_uart_cpm2.c |4 +-
 include/asm-powerpc/qe.h|   13 +---
 include/asm-ppc/commproc.h  |   13 +---
 include/asm-ppc/cpm2.h  |   13 +---
 include/asm-ppc/rheap.h |   20 +++---
 17 files changed, 221 insertions(+), 217 deletions(-)

diff --git a/arch/powerpc/lib/rheap.c b/arch/powerpc/lib/rheap.c
index 6c5c5dd..b2f6dcc 100644
--- a/arch/powerpc/lib/rheap.c
+++ b/arch/powerpc/lib/rheap.c
@@ -133,7 +133,7 @@ static rh_block_t *get_slot(rh_info_t * info)
info->empty_slots--;

/* Initialize */
-   blk->start = NULL;
+   blk->start = 0;
blk->size = 0;
blk->owner = NULL;

@@ -158,7 +158,7 @@ static void attach_free_block(rh_info_t * info, rh_block_t 
* blkn)

/* We assume that they are aligned properly */
size = blkn->size;
-   s = (unsigned long)blkn->start;
+   s = blkn->start;
e = s + size;

/* Find the blocks immediately before and after the given one
@@ -170,7 +170,7 @@ static void attach_free_block(rh_info_t * info, rh_block_t 
* blkn)
list_for_each(l, &info->free_list) {
blk = list_entry(l, rh_block_t, list);

-   bs = (unsigned long)blk->start;
+   bs = blk->start;
be = bs + blk->size;

if (next == NULL && s >= bs)
@@ -188,10 +188,10 @@ static void attach_free_block(rh_info_t * info, 
rh_block_t * blkn)
}

/* No

Re: [PATCH 2/2] Rename get_property to of_get_property: drivers/net

2007-05-02 Thread Kumar Gala


On May 2, 2007, at 9:17 AM, Jeff Garzik wrote:


Kumar Gala wrote:

On Apr 28, 2007, at 10:47 PM, David Miller wrote:

From: Stephen Rothwell <[EMAIL PROTECTED]>
Date: Sun, 29 Apr 2007 11:44:46 +1000


So can I take this as a future OK for architecture specific network
drivers changes to go through the architecture trees (cc'd to you)?


It's been my experience that if I'm just working through some
platform or bus specific API changes, people like Jeff tend to
not mind if it goes via ARCH trees and the like.
Is this acceptable?   Just want to make sure before I ask Paul to  
pull some changes that touches the following drivers:

drivers/net/fs_enet/mac-scc.c   |2 +-
drivers/net/ucc_geth.c  |   30 
drivers/serial/cpm_uart/cpm_uart_cpm1.c |4 +-
drivers/serial/cpm_uart/cpm_uart_cpm2.c |4 +-


I don't see a patch, just a diffstat.


I haven't sent a patch, just asking the question if I need to break  
it up or not.


- 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: patches for 2.6.22

2007-05-02 Thread Kumar Gala


On Apr 30, 2007, at 2:51 PM, Kim Phillips wrote:


On Fri, 27 Apr 2007 21:25:19 +1000
Paul Mackerras <[EMAIL PROTECTED]> wrote:


If anyone has patches that I haven't picked up yet which they think
should go into 2.6.22, please send me either a pointer to the


these were missed:

[PATCH 1/4 v5] powerpc: document phy-connection-type property
Tue Apr 24 07:26:10 EST 2007
http://ozlabs.org/pipermail/linuxppc-dev/2007-April/034669.html


ok.

[PATCH 2/4 v4] powerpc: replace undocumented interface properties  
in dts files

Tue Apr 24 07:26:14 EST 2007
http://ozlabs.org/pipermail/linuxppc-dev/2007-April/034670.html


I have issues with this since it looks like the current ucc driver in  
linus's tree is using a previous rev of your patch and thus using  
interface-type and max-speed still.


[PATCH 3/4] powerpc: Add 'mdio' to bus scan id list for platforms  
with QE UEC

Wed Apr 11 07:56:49 EST 2007
http://ozlabs.org/pipermail/linuxppc-dev/2007-April/034163.html


ok



[PATCH 4/4] powerpc: turn on corresponding PHY drivers in QE UEC  
platforms defconfigs

Wed Apr 11 07:56:53 EST 2007
http://ozlabs.org/pipermail/linuxppc-dev/2007-April/034164.html


ok

I'll pull patches 1, 3, 4 and wait on the dts changes until you sort  
of the ucc driver issues with Jeff.


- 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 2/2] Rename get_property to of_get_property: drivers/net

2007-05-02 Thread Kumar Gala


On Apr 28, 2007, at 10:47 PM, David Miller wrote:


From: Stephen Rothwell <[EMAIL PROTECTED]>
Date: Sun, 29 Apr 2007 11:44:46 +1000


So can I take this as a future OK for architecture specific network
drivers changes to go through the architecture trees (cc'd to you)?


It's been my experience that if I'm just working through some
platform or bus specific API changes, people like Jeff tend to
not mind if it goes via ARCH trees and the like.


Is this acceptable?   Just want to make sure before I ask Paul to  
pull some changes that touches the following drivers:


drivers/net/fs_enet/mac-scc.c   |2 +-
drivers/net/ucc_geth.c  |   30 
drivers/serial/cpm_uart/cpm_uart_cpm1.c |4 +-
drivers/serial/cpm_uart/cpm_uart_cpm2.c |4 +-

But is related to an arch API cleanup.

- 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


[PATCH] Convert network devices to use struct device instead of class_device

2007-02-13 Thread Kumar Gala
Convert network devices to use struct device instead of class_device.  Greg
missed this one in his cleanup path.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>

---

Jeff,

Sorry my mailer was completely screwed.  I thought I had fixed the
settings to turn of flowed text.  I think this was why the patches I've
been sending haven't been applying.  You can also get this fix from the
following git tree:

master.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git gfar

Please apply since this is causing compile errors

- k

commit 4409d28140d9a6e6e3f4f1fdaf7234c4b965d954
tree b12acbebc292de5146c89ba274eea38237ec7f91
parent ec2f9d1331f658433411c58077871e1eef4ee1b4
author Kumar Gala <[EMAIL PROTECTED]> Mon, 12 Feb 2007 23:40:06 -0600
committer Kumar Gala <[EMAIL PROTECTED]> Mon, 12 Feb 2007 23:40:06 -0600

 drivers/net/gianfar_sysfs.c |  108 ++-
 1 files changed, 55 insertions(+), 53 deletions(-)

diff --git a/drivers/net/gianfar_sysfs.c b/drivers/net/gianfar_sysfs.c
index 9dd387f..6e2166a 100644
--- a/drivers/net/gianfar_sysfs.c
+++ b/drivers/net/gianfar_sysfs.c
@@ -39,13 +39,15 @@
 #include "gianfar.h"

 #define GFAR_ATTR(_name) \
-static ssize_t gfar_show_##_name(struct class_device *cdev, char *buf); \
-static ssize_t gfar_set_##_name(struct class_device *cdev, \
+static ssize_t gfar_show_##_name(struct device *dev, \
+struct device_attribute *attr, char *buf); \
+static ssize_t gfar_set_##_name(struct device *dev, \
+   struct device_attribute *attr, \
const char *buf, size_t count); \
-static CLASS_DEVICE_ATTR(_name, 0644, gfar_show_##_name, gfar_set_##_name)
+static DEVICE_ATTR(_name, 0644, gfar_show_##_name, gfar_set_##_name)

 #define GFAR_CREATE_FILE(_dev, _name) \
-   class_device_create_file(&_dev->class_dev, &class_device_attr_##_name)
+   device_create_file(&_dev->dev, &dev_attr_##_name)

 GFAR_ATTR(bd_stash);
 GFAR_ATTR(rx_stash_size);
@@ -54,29 +56,28 @@ GFAR_ATTR(fifo_threshold);
 GFAR_ATTR(fifo_starve);
 GFAR_ATTR(fifo_starve_off);

-#define to_net_dev(cd) container_of(cd, struct net_device, class_dev)
-
-static ssize_t gfar_show_bd_stash(struct class_device *cdev, char *buf)
+static ssize_t gfar_show_bd_stash(struct device *dev,
+ struct device_attribute *attr, char *buf)
 {
-   struct net_device *dev = to_net_dev(cdev);
-   struct gfar_private *priv = netdev_priv(dev);
+   struct gfar_private *priv = netdev_priv(to_net_dev(dev));

-   return sprintf(buf, "%s\n", priv->bd_stash_en? "on" : "off");
+   return sprintf(buf, "%s\n", priv->bd_stash_en ? "on" : "off");
 }

-static ssize_t gfar_set_bd_stash(struct class_device *cdev,
-   const char *buf, size_t count)
+static ssize_t gfar_set_bd_stash(struct device *dev,
+struct device_attribute *attr,
+const char *buf, size_t count)
 {
-   struct net_device *dev = to_net_dev(cdev);
-   struct gfar_private *priv = netdev_priv(dev);
+   struct gfar_private *priv = netdev_priv(to_net_dev(dev));
int new_setting = 0;
u32 temp;
unsigned long flags;

/* Find out the new setting */
-   if (!strncmp("on", buf, count-1) || !strncmp("1", buf, count-1))
+   if (!strncmp("on", buf, count - 1) || !strncmp("1", buf, count - 1))
new_setting = 1;
-   else if (!strncmp("off", buf, count-1) || !strncmp("0", buf, count-1))
+   else if (!strncmp("off", buf, count - 1)
+|| !strncmp("0", buf, count - 1))
new_setting = 0;
else
return count;
@@ -100,19 +101,19 @@ static ssize_t gfar_set_bd_stash(struct class_device 
*cdev,
return count;
 }

-static ssize_t gfar_show_rx_stash_size(struct class_device *cdev, char *buf)
+static ssize_t gfar_show_rx_stash_size(struct device *dev,
+  struct device_attribute *attr, char *buf)
 {
-   struct net_device *dev = to_net_dev(cdev);
-   struct gfar_private *priv = netdev_priv(dev);
+   struct gfar_private *priv = netdev_priv(to_net_dev(dev));

return sprintf(buf, "%d\n", priv->rx_stash_size);
 }

-static ssize_t gfar_set_rx_stash_size(struct class_device *cdev,
-   const char *buf, size_t count)
+static ssize_t gfar_set_rx_stash_size(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
 {
-   struct net_device *dev = to_net_dev(cdev);
-   struct gfar_private *priv = netdev_priv(dev);
+   struct gfar_private *priv = netdev_priv(to_net_dev(dev));
unsigned int length = simple_strto

[git patches] gianfar sysfs driver fix

2007-02-12 Thread Kumar Gala

Please pull from 'gfar' branch of
master.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git gfar

(will try this as a git pull request, see if that works better :)

to receive the following updates:

 drivers/net/gianfar_sysfs.c |  108 ++--
 1 file changed, 55 insertions(+), 53 deletions(-)

Kumar Gala (1):
  Convert network devices to use struct device instead of class_device

diff --git a/drivers/net/gianfar_sysfs.c b/drivers/net/gianfar_sysfs.c
index 9dd387f..6e2166a 100644
--- a/drivers/net/gianfar_sysfs.c
+++ b/drivers/net/gianfar_sysfs.c
@@ -39,13 +39,15 @@
 #include "gianfar.h"

 #define GFAR_ATTR(_name) \
-static ssize_t gfar_show_##_name(struct class_device *cdev, char *buf); \
-static ssize_t gfar_set_##_name(struct class_device *cdev, \
+static ssize_t gfar_show_##_name(struct device *dev, \
+struct device_attribute *attr, char *buf); \
+static ssize_t gfar_set_##_name(struct device *dev, \
+   struct device_attribute *attr, \
const char *buf, size_t count); \
-static CLASS_DEVICE_ATTR(_name, 0644, gfar_show_##_name, gfar_set_##_name)
+static DEVICE_ATTR(_name, 0644, gfar_show_##_name, gfar_set_##_name)

 #define GFAR_CREATE_FILE(_dev, _name) \
-   class_device_create_file(&_dev->class_dev, &class_device_attr_##_name)
+   device_create_file(&_dev->dev, &dev_attr_##_name)

 GFAR_ATTR(bd_stash);
 GFAR_ATTR(rx_stash_size);
@@ -54,29 +56,28 @@ GFAR_ATTR(fifo_threshold);
 GFAR_ATTR(fifo_starve);
 GFAR_ATTR(fifo_starve_off);

-#define to_net_dev(cd) container_of(cd, struct net_device, class_dev)
-
-static ssize_t gfar_show_bd_stash(struct class_device *cdev, char *buf)
+static ssize_t gfar_show_bd_stash(struct device *dev,
+ struct device_attribute *attr, char *buf)
 {
-   struct net_device *dev = to_net_dev(cdev);
-   struct gfar_private *priv = netdev_priv(dev);
+   struct gfar_private *priv = netdev_priv(to_net_dev(dev));

-   return sprintf(buf, "%s\n", priv->bd_stash_en? "on" : "off");
+   return sprintf(buf, "%s\n", priv->bd_stash_en ? "on" : "off");
 }

-static ssize_t gfar_set_bd_stash(struct class_device *cdev,
-   const char *buf, size_t count)
+static ssize_t gfar_set_bd_stash(struct device *dev,
+struct device_attribute *attr,
+const char *buf, size_t count)
 {
-   struct net_device *dev = to_net_dev(cdev);
-   struct gfar_private *priv = netdev_priv(dev);
+   struct gfar_private *priv = netdev_priv(to_net_dev(dev));
int new_setting = 0;
u32 temp;
unsigned long flags;

/* Find out the new setting */
-   if (!strncmp("on", buf, count-1) || !strncmp("1", buf, count-1))
+   if (!strncmp("on", buf, count - 1) || !strncmp("1", buf, count - 1))
new_setting = 1;
-   else if (!strncmp("off", buf, count-1) || !strncmp("0", buf, count-1))
+   else if (!strncmp("off", buf, count - 1)
+|| !strncmp("0", buf, count - 1))
new_setting = 0;
else
return count;
@@ -100,19 +101,19 @@ static ssize_t gfar_set_bd_stash(struct class_device 
*cdev,
return count;
 }

-static ssize_t gfar_show_rx_stash_size(struct class_device *cdev, char *buf)
+static ssize_t gfar_show_rx_stash_size(struct device *dev,
+  struct device_attribute *attr, char *buf)
 {
-   struct net_device *dev = to_net_dev(cdev);
-   struct gfar_private *priv = netdev_priv(dev);
+   struct gfar_private *priv = netdev_priv(to_net_dev(dev));

return sprintf(buf, "%d\n", priv->rx_stash_size);
 }

-static ssize_t gfar_set_rx_stash_size(struct class_device *cdev,
-   const char *buf, size_t count)
+static ssize_t gfar_set_rx_stash_size(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
 {
-   struct net_device *dev = to_net_dev(cdev);
-   struct gfar_private *priv = netdev_priv(dev);
+   struct gfar_private *priv = netdev_priv(to_net_dev(dev));
unsigned int length = simple_strtoul(buf, NULL, 0);
u32 temp;
unsigned long flags;
@@ -146,21 +147,21 @@ static ssize_t gfar_set_rx_stash_size(struct class_device 
*cdev,
return count;
 }

-
 /* Stashing will only be enabled when rx_stash_size != 0 */
-static ssize_t gfar_show_rx_stash_index(struct class_device *cdev, char *buf)
+static ssize_t gfar_show_rx_stash_index(struct device *dev,
+   struct device_attribute *attr,
+   char *buf)
 {
-   struct net_device *

[PATCH][RESPIN] gianfar: Convert network devices to use struct device instead of class_device

2007-02-09 Thread Kumar Gala

Convert network devices to use struct device instead of class_device.  Greg
missed this one in his cleanup path.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>

---

Here's a respin of the patch against a recent linus.git tree.  If this 
doesnt apply I'm at a loss.


- k

commit b8fa75ada71d54a75c85fb7d3200419f790328b2
tree f67387b120c45e2c4ae17e5aeabd529c58b58113
parent eaefd5fb7d793c9c1bcef1b0c0d5ec3824a85b91
author Kumar Gala <[EMAIL PROTECTED]> Fri, 09 Feb 2007 15:30:00 -0600
committer Kumar Gala <[EMAIL PROTECTED]> Fri, 09 Feb 2007 15:30:00 -0600

 drivers/net/gianfar_sysfs.c |  108 ++-
 1 files changed, 55 insertions(+), 53 deletions(-)

diff --git a/drivers/net/gianfar_sysfs.c b/drivers/net/gianfar_sysfs.c
index 9dd387f..6e2166a 100644
--- a/drivers/net/gianfar_sysfs.c
+++ b/drivers/net/gianfar_sysfs.c
@@ -39,13 +39,15 @@
 #include "gianfar.h"

 #define GFAR_ATTR(_name) \
-static ssize_t gfar_show_##_name(struct class_device *cdev, char *buf); \
-static ssize_t gfar_set_##_name(struct class_device *cdev, \
+static ssize_t gfar_show_##_name(struct device *dev, \
+struct device_attribute *attr, char *buf); \
+static ssize_t gfar_set_##_name(struct device *dev, \
+   struct device_attribute *attr, \
const char *buf, size_t count); \
-static CLASS_DEVICE_ATTR(_name, 0644, gfar_show_##_name, gfar_set_##_name)
+static DEVICE_ATTR(_name, 0644, gfar_show_##_name, gfar_set_##_name)

 #define GFAR_CREATE_FILE(_dev, _name) \
-   class_device_create_file(&_dev->class_dev, &class_device_attr_##_name)
+   device_create_file(&_dev->dev, &dev_attr_##_name)

 GFAR_ATTR(bd_stash);
 GFAR_ATTR(rx_stash_size);
@@ -54,29 +56,28 @@ GFAR_ATTR(fifo_threshold);
 GFAR_ATTR(fifo_starve);
 GFAR_ATTR(fifo_starve_off);

-#define to_net_dev(cd) container_of(cd, struct net_device, class_dev)
-
-static ssize_t gfar_show_bd_stash(struct class_device *cdev, char *buf)
+static ssize_t gfar_show_bd_stash(struct device *dev,
+ struct device_attribute *attr, char *buf)
 {
-   struct net_device *dev = to_net_dev(cdev);
-   struct gfar_private *priv = netdev_priv(dev);
+   struct gfar_private *priv = netdev_priv(to_net_dev(dev));

-   return sprintf(buf, "%s\n", priv->bd_stash_en? "on" : "off");
+   return sprintf(buf, "%s\n", priv->bd_stash_en ? "on" : "off");
 }

-static ssize_t gfar_set_bd_stash(struct class_device *cdev,
-   const char *buf, size_t count)
+static ssize_t gfar_set_bd_stash(struct device *dev,
+struct device_attribute *attr,
+const char *buf, size_t count)
 {
-   struct net_device *dev = to_net_dev(cdev);
-   struct gfar_private *priv = netdev_priv(dev);
+   struct gfar_private *priv = netdev_priv(to_net_dev(dev));
int new_setting = 0;
u32 temp;
unsigned long flags;

/* Find out the new setting */
-   if (!strncmp("on", buf, count-1) || !strncmp("1", buf, count-1))
+   if (!strncmp("on", buf, count - 1) || !strncmp("1", buf, count - 1))
new_setting = 1;
-   else if (!strncmp("off", buf, count-1) || !strncmp("0", buf, count-1))
+   else if (!strncmp("off", buf, count - 1)
+|| !strncmp("0", buf, count - 1))
new_setting = 0;
else
return count;
@@ -100,19 +101,19 @@ static ssize_t gfar_set_bd_stash(struct class_device 
*cdev,
return count;
 }

-static ssize_t gfar_show_rx_stash_size(struct class_device *cdev, char *buf)
+static ssize_t gfar_show_rx_stash_size(struct device *dev,
+  struct device_attribute *attr, char *buf)
 {
-   struct net_device *dev = to_net_dev(cdev);
-   struct gfar_private *priv = netdev_priv(dev);
+   struct gfar_private *priv = netdev_priv(to_net_dev(dev));

return sprintf(buf, "%d\n", priv->rx_stash_size);
 }

-static ssize_t gfar_set_rx_stash_size(struct class_device *cdev,
-   const char *buf, size_t count)
+static ssize_t gfar_set_rx_stash_size(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
 {
-   struct net_device *dev = to_net_dev(cdev);
-   struct gfar_private *priv = netdev_priv(dev);
+   struct gfar_private *priv = netdev_priv(to_net_dev(dev));
unsigned int length = simple_strtoul(buf, NULL, 0);
u32 temp;
unsigned long flags;
@@ -146,21 +147,21 @@ static ssize_t gfar_set_rx_stash_size(struct class_device 
*cdev,
return count;
 }

-
 /* Stashing will only be enabled when rx_stash_siz

Re: [NET]: Fix whitespace errors

2007-02-09 Thread Kumar Gala


On Feb 9, 2007, at 8:41 AM, YOSHIFUJI Hideaki / 吉藤英明 wrote:


Hello.

Please pull "2.6.20-net-2.6-20070209-whitespace" branch
at 
to fix trivial whitespace errors:
 - convert leading sequences of whitespace with tab(s).
 - remove whitespace at the end of line.
under net.

Tree is on top of current net-2.6 tree.


Do you have a script that did this?

And is this type of cleanup something that is desired?  I noticed a  
asm/powerpc header that had whitespace issues and was going to commit  
a patch, but figured I should than cleanup all the headers.  I wasn't  
sure if cleaning up whitespace issues wholesale like this was  
desirable or not.


- 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] cxgb3 - convert to user struct device instead of class_device

2007-02-08 Thread Kumar Gala


On Feb 8, 2007, at 4:02 PM, Roland Dreier wrote:


Andrew told me to drop it, so I dropped it :)


That's odd -- do you know why?  drivers/net/cxgb3 won't build at all
in Linus's tree.  I would have thought we want to fix it ASAP.


I've posted a similar patch for drivers/net/gianfar_sysfs.c that is  
needed for it to build in linus's tree.


- 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


[PATCH][RESEND] gianfar: Convert network devices to use struct device instead of class_device

2007-02-08 Thread Kumar Gala

Convert network devices to use struct device instead of class_device.  Greg
missed this one in his cleanup path.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>

---

Got Jeff's email wrong the first time.

commit 24c316396f71c6164f11ca1398151d8b15fd06e0
tree d02ee36eaf848d200dacf3bf795abaec1e55cbc2
parent b892afd1e60132a981b963929e352eabf3306ba2
author Kumar Gala <[EMAIL PROTECTED]> Thu, 08 Feb 2007 11:07:11 -0600
committer Kumar Gala <[EMAIL PROTECTED]> Thu, 08 Feb 2007 11:07:11 -0600

 drivers/net/gianfar_sysfs.c |  108 ++-
 1 files changed, 55 insertions(+), 53 deletions(-)

diff --git a/drivers/net/gianfar_sysfs.c b/drivers/net/gianfar_sysfs.c
index 9dd387f..6e2166a 100644
--- a/drivers/net/gianfar_sysfs.c
+++ b/drivers/net/gianfar_sysfs.c
@@ -39,13 +39,15 @@
 #include "gianfar.h"

 #define GFAR_ATTR(_name) \
-static ssize_t gfar_show_##_name(struct class_device *cdev, char *buf); \
-static ssize_t gfar_set_##_name(struct class_device *cdev, \
+static ssize_t gfar_show_##_name(struct device *dev, \
+struct device_attribute *attr, char *buf); \
+static ssize_t gfar_set_##_name(struct device *dev, \
+   struct device_attribute *attr, \
const char *buf, size_t count); \
-static CLASS_DEVICE_ATTR(_name, 0644, gfar_show_##_name, gfar_set_##_name)
+static DEVICE_ATTR(_name, 0644, gfar_show_##_name, gfar_set_##_name)

 #define GFAR_CREATE_FILE(_dev, _name) \
-   class_device_create_file(&_dev->class_dev, &class_device_attr_##_name)
+   device_create_file(&_dev->dev, &dev_attr_##_name)

 GFAR_ATTR(bd_stash);
 GFAR_ATTR(rx_stash_size);
@@ -54,29 +56,28 @@ GFAR_ATTR(fifo_threshold);
 GFAR_ATTR(fifo_starve);
 GFAR_ATTR(fifo_starve_off);

-#define to_net_dev(cd) container_of(cd, struct net_device, class_dev)
-
-static ssize_t gfar_show_bd_stash(struct class_device *cdev, char *buf)
+static ssize_t gfar_show_bd_stash(struct device *dev,
+ struct device_attribute *attr, char *buf)
 {
-   struct net_device *dev = to_net_dev(cdev);
-   struct gfar_private *priv = netdev_priv(dev);
+   struct gfar_private *priv = netdev_priv(to_net_dev(dev));

-   return sprintf(buf, "%s\n", priv->bd_stash_en? "on" : "off");
+   return sprintf(buf, "%s\n", priv->bd_stash_en ? "on" : "off");
 }

-static ssize_t gfar_set_bd_stash(struct class_device *cdev,
-   const char *buf, size_t count)
+static ssize_t gfar_set_bd_stash(struct device *dev,
+struct device_attribute *attr,
+const char *buf, size_t count)
 {
-   struct net_device *dev = to_net_dev(cdev);
-   struct gfar_private *priv = netdev_priv(dev);
+   struct gfar_private *priv = netdev_priv(to_net_dev(dev));
int new_setting = 0;
u32 temp;
unsigned long flags;

/* Find out the new setting */
-   if (!strncmp("on", buf, count-1) || !strncmp("1", buf, count-1))
+   if (!strncmp("on", buf, count - 1) || !strncmp("1", buf, count - 1))
new_setting = 1;
-   else if (!strncmp("off", buf, count-1) || !strncmp("0", buf, count-1))
+   else if (!strncmp("off", buf, count - 1)
+|| !strncmp("0", buf, count - 1))
new_setting = 0;
else
return count;
@@ -100,19 +101,19 @@ static ssize_t gfar_set_bd_stash(struct class_device 
*cdev,
return count;
 }

-static ssize_t gfar_show_rx_stash_size(struct class_device *cdev, char *buf)
+static ssize_t gfar_show_rx_stash_size(struct device *dev,
+  struct device_attribute *attr, char *buf)
 {
-   struct net_device *dev = to_net_dev(cdev);
-   struct gfar_private *priv = netdev_priv(dev);
+   struct gfar_private *priv = netdev_priv(to_net_dev(dev));

return sprintf(buf, "%d\n", priv->rx_stash_size);
 }

-static ssize_t gfar_set_rx_stash_size(struct class_device *cdev,
-   const char *buf, size_t count)
+static ssize_t gfar_set_rx_stash_size(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
 {
-   struct net_device *dev = to_net_dev(cdev);
-   struct gfar_private *priv = netdev_priv(dev);
+   struct gfar_private *priv = netdev_priv(to_net_dev(dev));
unsigned int length = simple_strtoul(buf, NULL, 0);
u32 temp;
unsigned long flags;
@@ -146,21 +147,21 @@ static ssize_t gfar_set_rx_stash_size(struct class_device 
*cdev,
return count;
 }

-
 /* Stashing will only be enabled when rx_stash_size != 0 */
-static ssize_t gfar_show_rx_stash_index(struct class_device *cdev, char *buf)
+s

[PATCH] Convert network devices to use struct device instead of class_device

2007-02-08 Thread Kumar Gala

Convert network devices to use struct device instead of class_device.  Greg
missed this one in his cleanup path.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>

---
commit 24c316396f71c6164f11ca1398151d8b15fd06e0
tree d02ee36eaf848d200dacf3bf795abaec1e55cbc2
parent b892afd1e60132a981b963929e352eabf3306ba2
author Kumar Gala <[EMAIL PROTECTED]> Thu, 08 Feb 2007 11:07:11 -0600
committer Kumar Gala <[EMAIL PROTECTED]> Thu, 08 Feb 2007 11:07:11 -0600

 drivers/net/gianfar_sysfs.c |  108 ++-
 1 files changed, 55 insertions(+), 53 deletions(-)

diff --git a/drivers/net/gianfar_sysfs.c b/drivers/net/gianfar_sysfs.c
index 9dd387f..6e2166a 100644
--- a/drivers/net/gianfar_sysfs.c
+++ b/drivers/net/gianfar_sysfs.c
@@ -39,13 +39,15 @@
 #include "gianfar.h"

 #define GFAR_ATTR(_name) \
-static ssize_t gfar_show_##_name(struct class_device *cdev, char *buf); \
-static ssize_t gfar_set_##_name(struct class_device *cdev, \
+static ssize_t gfar_show_##_name(struct device *dev, \
+struct device_attribute *attr, char *buf); \
+static ssize_t gfar_set_##_name(struct device *dev, \
+   struct device_attribute *attr, \
const char *buf, size_t count); \
-static CLASS_DEVICE_ATTR(_name, 0644, gfar_show_##_name, gfar_set_##_name)
+static DEVICE_ATTR(_name, 0644, gfar_show_##_name, gfar_set_##_name)

 #define GFAR_CREATE_FILE(_dev, _name) \
-   class_device_create_file(&_dev->class_dev, &class_device_attr_##_name)
+   device_create_file(&_dev->dev, &dev_attr_##_name)

 GFAR_ATTR(bd_stash);
 GFAR_ATTR(rx_stash_size);
@@ -54,29 +56,28 @@ GFAR_ATTR(fifo_threshold);
 GFAR_ATTR(fifo_starve);
 GFAR_ATTR(fifo_starve_off);

-#define to_net_dev(cd) container_of(cd, struct net_device, class_dev)
-
-static ssize_t gfar_show_bd_stash(struct class_device *cdev, char *buf)
+static ssize_t gfar_show_bd_stash(struct device *dev,
+ struct device_attribute *attr, char *buf)
 {
-   struct net_device *dev = to_net_dev(cdev);
-   struct gfar_private *priv = netdev_priv(dev);
+   struct gfar_private *priv = netdev_priv(to_net_dev(dev));

-   return sprintf(buf, "%s\n", priv->bd_stash_en? "on" : "off");
+   return sprintf(buf, "%s\n", priv->bd_stash_en ? "on" : "off");
 }

-static ssize_t gfar_set_bd_stash(struct class_device *cdev,
-   const char *buf, size_t count)
+static ssize_t gfar_set_bd_stash(struct device *dev,
+struct device_attribute *attr,
+const char *buf, size_t count)
 {
-   struct net_device *dev = to_net_dev(cdev);
-   struct gfar_private *priv = netdev_priv(dev);
+   struct gfar_private *priv = netdev_priv(to_net_dev(dev));
int new_setting = 0;
u32 temp;
unsigned long flags;

/* Find out the new setting */
-   if (!strncmp("on", buf, count-1) || !strncmp("1", buf, count-1))
+   if (!strncmp("on", buf, count - 1) || !strncmp("1", buf, count - 1))
new_setting = 1;
-   else if (!strncmp("off", buf, count-1) || !strncmp("0", buf, count-1))
+   else if (!strncmp("off", buf, count - 1)
+|| !strncmp("0", buf, count - 1))
new_setting = 0;
else
return count;
@@ -100,19 +101,19 @@ static ssize_t gfar_set_bd_stash(struct class_device 
*cdev,
return count;
 }

-static ssize_t gfar_show_rx_stash_size(struct class_device *cdev, char *buf)
+static ssize_t gfar_show_rx_stash_size(struct device *dev,
+  struct device_attribute *attr, char *buf)
 {
-   struct net_device *dev = to_net_dev(cdev);
-   struct gfar_private *priv = netdev_priv(dev);
+   struct gfar_private *priv = netdev_priv(to_net_dev(dev));

return sprintf(buf, "%d\n", priv->rx_stash_size);
 }

-static ssize_t gfar_set_rx_stash_size(struct class_device *cdev,
-   const char *buf, size_t count)
+static ssize_t gfar_set_rx_stash_size(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
 {
-   struct net_device *dev = to_net_dev(cdev);
-   struct gfar_private *priv = netdev_priv(dev);
+   struct gfar_private *priv = netdev_priv(to_net_dev(dev));
unsigned int length = simple_strtoul(buf, NULL, 0);
u32 temp;
unsigned long flags;
@@ -146,21 +147,21 @@ static ssize_t gfar_set_rx_stash_size(struct class_device 
*cdev,
return count;
 }

-
 /* Stashing will only be enabled when rx_stash_size != 0 */
-static ssize_t gfar_show_rx_stash_index(struct class_device *cdev, char *buf)
+static ssize_t gfar_show_rx_stash_index(struct device 

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

2007-02-06 Thread Kumar Gala


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?


- k



Signed-off-by: Li Yang <[EMAIL PROTECTED]>
---
drivers/net/ucc_geth.c |   29 ++---
1 files changed, 6 insertions(+), 23 deletions(-)

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 7e4b23c..722a89f 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3065,21 +3065,11 @@ static int ucc_geth_startup(struct  
ucc_geth_private *ugeth)

endOfRing =
ugeth->p_tx_bd_ring[i] + (ug_info->bdRingLenTx[i] -
  1) * sizeof(struct qe_bd);
-   if (ugeth->ug_info->uf_info.bd_mem_part == MEM_PART_SYSTEM) {
-   out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
-(u32) virt_to_phys(ugeth->p_tx_bd_ring[i]));
-   out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].
+   out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
+   iopa((unsigned long)ugeth->p_tx_bd_ring[i]));
+   out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].
 last_bd_completed_address,
-(u32) virt_to_phys(endOfRing));
-   } else if (ugeth->ug_info->uf_info.bd_mem_part ==
-  MEM_PART_MURAM) {
-   out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].bd_ring_base,
-(u32) immrbar_virt_to_phys(ugeth->
-   p_tx_bd_ring[i]));
-   out_be32(&ugeth->p_send_q_mem_reg->sqqd[i].
-last_bd_completed_address,
-(u32) immrbar_virt_to_phys(endOfRing));
-   }
+   iopa((unsigned long)endOfRing));
}
/* schedulerbasepointer */
@@ -3331,15 +3321,8 @@ static int ucc_geth_startup(struct  
ucc_geth_private *ugeth)

/* Setup the table */
/* Assume BD rings are already established */
for (i = 0; i < ug_info->numQueuesRx; i++) {
-   if (ugeth->ug_info->uf_info.bd_mem_part == MEM_PART_SYSTEM) {
-   out_be32(&ugeth->p_rx_bd_qs_tbl[i].externalbdbaseptr,
-(u32) virt_to_phys(ugeth->p_rx_bd_ring[i]));
-   } else if (ugeth->ug_info->uf_info.bd_mem_part ==
-  MEM_PART_MURAM) {
-   out_be32(&ugeth->p_rx_bd_qs_tbl[i].externalbdbaseptr,
-(u32) immrbar_virt_to_phys(ugeth->
-   p_rx_bd_ring[i]));
-   }
+   out_be32(&ugeth->p_rx_bd_qs_tbl[i].externalbdbaseptr,
+iopa((unsigned long)ugeth->p_rx_bd_ring[i]));
/* rest of fields handled by QE */
}

-
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: RFC: Provide setting of Link Partner Autonegotiation

2007-01-29 Thread Kumar Gala

On Jan 20, 2007, at 4:49 PM, Kumar Gala wrote:

Here's the start of a patch to provide the state of the link  
partner's autoneg.  This is useful to know if the link partner is  
trying to force a speed and we aren't matching.


I wasn't sure how to handle this for all the drivers that handle  
phy's themselves.  Is there some way to have this set to a 'not  
supported value' in ethtool_get_settings and leave it to the driver  
specific function to modify it?


I'll followup with an ethtool patch once we figure out the kernel  
side.


- kumar


Jeff,

What are your thoughts on adding some defines like:

LPA_NOT_IMPLEMENTED	/* device/driver has determined if it can  
implement this feature */

LPA_NOT_SUPPORTED   /* device/driver doesn't support this information */

By default we'd set the field to LPA_NOT_IMPLEMENTED and than let the  
driver's get_settings callback modify it as appropriate?


- k


diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index e175f39..77694d5 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -299,6 +299,7 @@ int phy_ethtool_gset(struct phy_device *phydev,  
struct ethtool_cmd *cmd)

cmd->phy_address = phydev->addr;
cmd->transceiver = XCVR_EXTERNAL;
cmd->autoneg = phydev->autoneg;
+   cmd->lp_autoneg = phydev->link_partner_autoneg;

return 0;
 }
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/ 
phy_device.c

index a4d7529..a7137c8 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -62,6 +62,7 @@ struct phy_device* phy_device_create(struct  
mii_bus *bus, int addr, int phy_id)

dev->interface = PHY_INTERFACE_MODE_GMII;

dev->autoneg = AUTONEG_ENABLE;
+   dev->link_partner_autoneg = AUTONEG_ENABLE;

dev->addr = addr;
dev->phy_id = phy_id;
@@ -441,6 +442,16 @@ int genphy_update_link(struct phy_device *phydev)
else
phydev->link = 1;

+   /* Read Auto-Negotiation Expansion */
+   status = phy_read(phydev, MII_EXPANSION);
+   if (status < 0)
+   return status;
+
+   if (status & EXPANSION_NWAY)
+   phydev->link_partner_autoneg = AUTONEG_ENABLE;
+   else
+   phydev->link_partner_autoneg = AUTONEG_DISABLE;
+
return 0;
 }
 EXPORT_SYMBOL(genphy_update_link);
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index c6310ae..18b0b17 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -26,7 +26,8 @@ struct ethtool_cmd {
__u8autoneg;/* Enable or disable autonegotiation */
__u32   maxtxpkt;   /* Tx pkts before generating tx int */
__u32   maxrxpkt;   /* Rx pkts before generating rx int */
-   __u32   reserved[4];
+   __u32   lp_autoneg; /* Link partner's ability for autonegotiation */
+   __u32   reserved[3];
 };

 #define ETHTOOL_BUSINFO_LEN32
diff --git a/include/linux/phy.h b/include/linux/phy.h
index edd4c88..f91a9c0 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -269,6 +269,8 @@ struct phy_device {

int link_timeout;

+   int link_partner_autoneg;
+
/* Interrupt number for this PHY
 * -1 means no interrupt */
int irq;
-
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


[PATCH] RFC: Broadcom PHY forcing fix

2007-01-25 Thread Kumar Gala
Maciej,

I've got a BCM5461 that requires this fix to be able to force the speeds 
on the PHY.  Not sure if its needed on the other variants or not.  The 
problem is the genphy_config_aneg resets the PHY when forcing the speed 
and once we reset the BCM5461 it doesn't remember any of its settings.

Let me know if this works for you or not.

- k

diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
index 29666c8..bf752f4 100644
--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c
@@ -99,6 +99,61 @@ static int bcm54xx_config_intr(struct ph
return err;
 }
 
+/* bcm_setup_forced
+ *
+ * description: Configures MII_BMCR to force speed/duplex
+ *   to the values in phydev. Assumes that the values are valid.
+ *   Please see phy_sanitize_settings() */
+static int bcm54xx_setup_forced(struct phy_device *phydev)
+{
+   int ctl = 0;
+   phydev->pause = phydev->asym_pause = 0;
+
+   if (SPEED_100 == phydev->speed)
+   ctl |= BMCR_SPEED100;
+
+   if (DUPLEX_FULL == phydev->duplex)
+   ctl |= BMCR_FULLDPLX;
+   
+   ctl = phy_write(phydev, MII_BMCR, ctl);
+
+   if (ctl < 0)
+   return ctl;
+
+   return ctl;
+}
+
+int bcm54xx_config_aneg(struct phy_device *phydev)
+{
+   int err = 0;
+
+   if (AUTONEG_ENABLE == phydev->autoneg) {
+   err = genphy_config_advert(phydev);
+
+   if (err < 0)
+   return err;
+
+   err = genphy_restart_aneg(phydev);
+   } else {
+   if (SPEED_1000 == phydev->speed) {
+   int adv;
+   adv = phy_read(phydev, MII_ADVERTISE);
+   adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4);
+
+   err = phy_write(phydev, MII_ADVERTISE, adv);
+
+   if (err < 0)
+   return err;
+
+   err = genphy_restart_aneg(phydev);
+   } else {
+   err = bcm54xx_setup_forced(phydev);
+   }
+   }
+
+   return err;
+}
+
 static struct phy_driver bcm5411_driver = {
.phy_id = 0x00206070,
.phy_id_mask= 0xfff0,
@@ -106,7 +161,7 @@ static struct phy_driver bcm5411_driver 
.features   = PHY_GBIT_FEATURES,
.flags  = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init= bcm54xx_config_init,
-   .config_aneg= genphy_config_aneg,
+   .config_aneg= bcm54xx_config_aneg,
.read_status= genphy_read_status,
.ack_interrupt  = bcm54xx_ack_interrupt,
.config_intr= bcm54xx_config_intr,
@@ -120,7 +175,7 @@ static struct phy_driver bcm5421_driver 
.features   = PHY_GBIT_FEATURES,
.flags  = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init= bcm54xx_config_init,
-   .config_aneg= genphy_config_aneg,
+   .config_aneg= bcm54xx_config_aneg,
.read_status= genphy_read_status,
.ack_interrupt  = bcm54xx_ack_interrupt,
.config_intr= bcm54xx_config_intr,
@@ -134,7 +189,7 @@ static struct phy_driver bcm5461_driver 
.features   = PHY_GBIT_FEATURES,
.flags  = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.config_init= bcm54xx_config_init,
-   .config_aneg= genphy_config_aneg,
+   .config_aneg= bcm54xx_config_aneg,
.read_status= genphy_read_status,
.ack_interrupt  = bcm54xx_ack_interrupt,
.config_intr= bcm54xx_config_intr,
-
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


RFC: Provide setting of Link Partner Autonegotiation

2007-01-20 Thread Kumar Gala
Here's the start of a patch to provide the state of the link partner's 
autoneg.  This is useful to know if the link partner is trying to force a 
speed and we aren't matching.


I wasn't sure how to handle this for all the drivers that handle phy's 
themselves.  Is there some way to have this set to a 'not supported value' 
in ethtool_get_settings and leave it to the driver specific function to 
modify it?


I'll followup with an ethtool patch once we figure out the kernel side.

- kumar

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index e175f39..77694d5 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -299,6 +299,7 @@ int phy_ethtool_gset(struct phy_device *phydev, struct 
ethtool_cmd *cmd)
cmd->phy_address = phydev->addr;
cmd->transceiver = XCVR_EXTERNAL;
cmd->autoneg = phydev->autoneg;
+   cmd->lp_autoneg = phydev->link_partner_autoneg;

return 0;
 }
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index a4d7529..a7137c8 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -62,6 +62,7 @@ struct phy_device* phy_device_create(struct mii_bus *bus, int 
addr, int phy_id)
dev->interface = PHY_INTERFACE_MODE_GMII;

dev->autoneg = AUTONEG_ENABLE;
+   dev->link_partner_autoneg = AUTONEG_ENABLE;

dev->addr = addr;
dev->phy_id = phy_id;
@@ -441,6 +442,16 @@ int genphy_update_link(struct phy_device *phydev)
else
phydev->link = 1;

+   /* Read Auto-Negotiation Expansion */
+   status = phy_read(phydev, MII_EXPANSION);
+   if (status < 0)
+   return status;
+
+   if (status & EXPANSION_NWAY)
+   phydev->link_partner_autoneg = AUTONEG_ENABLE;
+   else
+   phydev->link_partner_autoneg = AUTONEG_DISABLE;
+
return 0;
 }
 EXPORT_SYMBOL(genphy_update_link);
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index c6310ae..18b0b17 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -26,7 +26,8 @@ struct ethtool_cmd {
__u8autoneg;/* Enable or disable autonegotiation */
__u32   maxtxpkt;   /* Tx pkts before generating tx int */
__u32   maxrxpkt;   /* Rx pkts before generating rx int */
-   __u32   reserved[4];
+   __u32   lp_autoneg; /* Link partner's ability for autonegotiation */
+   __u32   reserved[3];
 };

 #define ETHTOOL_BUSINFO_LEN32
diff --git a/include/linux/phy.h b/include/linux/phy.h
index edd4c88..f91a9c0 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -269,6 +269,8 @@ struct phy_device {

int link_timeout;

+   int link_partner_autoneg;
+
/* Interrupt number for this PHY
 * -1 means no interrupt */
int irq;
-
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: Export phy ethtool helpers

2007-01-20 Thread Kumar Gala

We need to export phy_ethtool_gset and phy_ethtool_sset to allow drivers that
use these functions to be built as modules.

Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>

---
commit 7fff6ffb83f2543299df3ed8815976440abdd576
tree 0eea7a64a684a3d3970cec9a8c9c65ee2839ebfc
parent a8b3485287731978899ced11f24628c927890e78
author Kumar Gala <[EMAIL PROTECTED]> Sat, 20 Jan 2007 16:28:13 -0600
committer Kumar Gala <[EMAIL PROTECTED]> Sat, 20 Jan 2007 16:28:13 -0600

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

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index e175f39..868400d 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -286,6 +286,7 @@ int phy_ethtool_sset(struct phy_device *phydev, struct 
ethtool_cmd *cmd)

return 0;
 }
+EXPORT_SYMBOL(phy_ethtool_sset);

 int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd)
 {
@@ -302,6 +303,7 @@ int phy_ethtool_gset(struct phy_device *phydev, struct 
ethtool_cmd *cmd)

return 0;
 }
+EXPORT_SYMBOL(phy_ethtool_gset);


 /* Note that this function is currently incompatible with the
-
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: [git patches] net driver fixes

2007-01-08 Thread Kumar Gala


On Jan 8, 2007, at 5:40 AM, Jeff Garzik wrote:


Li Yang-r58472 wrote:

Hi Jeff,
Could you apply the updates for ucc_geth driver?
The patches from Timur that make the driver compile correctly on  
2.6.20.

[PATCH] Fix phy_read/write redefinition errors in ucc_geth_phy.c
[PATCH] Update ucc_geth.c for new workqueue structure
The patch from Ahmed that cleans up some unnecessary casts.
[PATCH 2.6.20-rc3] UCC Ether driver: kmalloc casting cleanups


I don't have any of these in my queue.


Here's links to the orig patches:

http://marc.theaimsgroup.com/?l=linux-netdev&m=116605401912152&w=2
http://marc.theaimsgroup.com/?l=linux-netdev&m=116605366909148&w=2

- 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] Update ucc_geth.c for new workqueue structure

2007-01-05 Thread Kumar Gala

Jeff,

Friendly reminder that this should go in for 2.6.20

- k

On Dec 18, 2006, at 10:23 AM, Kumar Gala wrote:


Jeff,

Can you pickup this patch for 2.6.20 as it fixes a compile issue  
due to the workqueue changes.


- kumar

On Dec 13, 2006, at 5:08 PM, [EMAIL PROTECTED] wrote:


From: Timur Tabi <[EMAIL PROTECTED]>

The workqueue interface changed with David Howell's patch on  
11/22/2006

(SHA 65f27f38446e1976cc98fd3004b110fedcddd189).  Several drivers were
updated with that patch to handle the new interface, but ucc_geth.c
was not one of them.  This patch updates ucc_geth.c to support the  
new

model.

A compiler warning in set_mac_addr() was also fixed.

Signed-off-by: Timur Tabi <[EMAIL PROTECTED]>
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>

---
 drivers/net/ucc_geth.c |   12 +++-
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 1f05511..d33bb0c 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 

 #include 
 #include 
@@ -472,7 +473,7 @@ static void put_enet_addr_container(stru
kfree(enet_addr_cont);
 }

-static int set_mac_addr(__be16 __iomem *reg, u8 *mac)
+static void set_mac_addr(__be16 __iomem *reg, u8 *mac)
 {
out_be16(®[0], ((u16)mac[5] << 8) | mac[4]);
out_be16(®[1], ((u16)mac[3] << 8) | mac[2]);
@@ -3918,10 +3919,11 @@ static irqreturn_t phy_interrupt(int irq
 }

 /* Scheduled by the phy_interrupt/timer to handle PHY changes */
-static void ugeth_phy_change(void *data)
+static void ugeth_phy_change(struct work_struct *work)
 {
-   struct net_device *dev = (struct net_device *)data;
-   struct ucc_geth_private *ugeth = netdev_priv(dev);
+   struct ucc_geth_private *ugeth =
+   container_of(work, struct ucc_geth_private, tq);
+   struct net_device *dev = ugeth->dev;
struct ucc_geth *ug_regs;
int result = 0;

@@ -4078,7 +4080,7 @@ static int ucc_geth_open(struct net_devi
 #endif /* CONFIG_UGETH_NAPI */

/* Set up the PHY change work queue */
-   INIT_WORK(&ugeth->tq, ugeth_phy_change, dev);
+   INIT_WORK(&ugeth->tq, ugeth_phy_change);

init_timer(&ugeth->phy_info_timer);
ugeth->phy_info_timer.function = &ugeth_phy_startup_timer;
--
1.4.4

-
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


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


Re: [PATCH] Fix phy_read/write redefinition errors in ucc_geth_phy.c

2007-01-05 Thread Kumar Gala

Jeff,

Friendly reminder that this should go in for 2.6.20

- k

On Dec 18, 2006, at 10:24 AM, Kumar Gala wrote:


Jeff,

Can you pickup this patch for 2.6.20.  It addresses a name conflict  
issue with the phylib and the phy handling in the ucc driver.


thanks

- k

On Dec 13, 2006, at 5:08 PM, [EMAIL PROTECTED] wrote:


From: Timur Tabi <[EMAIL PROTECTED]>

The local versions of phy_read() and phy_write() in ucc_geth_phy.c  
conflict
with the prototypes in include/linux/phy.h, so this patch renames  
them,
moves them to the top of the file (while eliminating the redundant  
prototype),

and makes them static.

Signed-off-by: Timur Tabi <[EMAIL PROTECTED]>
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>

---
 drivers/net/ucc_geth_phy.c |  134 + 
+--

 1 files changed, 66 insertions(+), 68 deletions(-)

diff --git a/drivers/net/ucc_geth_phy.c b/drivers/net/ucc_geth_phy.c
index 5360ec0..3c86592 100644
--- a/drivers/net/ucc_geth_phy.c
+++ b/drivers/net/ucc_geth_phy.c
@@ -68,8 +68,31 @@ static int gbit_config_aneg(struct ugeth
 static int genmii_config_aneg(struct ugeth_mii_info *mii_info);
 static int genmii_update_link(struct ugeth_mii_info *mii_info);
 static int genmii_read_status(struct ugeth_mii_info *mii_info);
-u16 phy_read(struct ugeth_mii_info *mii_info, u16 regnum);
-void phy_write(struct ugeth_mii_info *mii_info, u16 regnum, u16  
val);

+
+static u16 ucc_geth_phy_read(struct ugeth_mii_info *mii_info, u16  
regnum)

+{
+   u16 retval;
+   unsigned long flags;
+
+   ugphy_vdbg("%s: IN", __FUNCTION__);
+
+   spin_lock_irqsave(&mii_info->mdio_lock, flags);
+	retval = mii_info->mdio_read(mii_info->dev, mii_info->mii_id,  
regnum);

+   spin_unlock_irqrestore(&mii_info->mdio_lock, flags);
+
+   return retval;
+}
+
+static void ucc_geth_phy_write(struct ugeth_mii_info *mii_info,  
u16 regnum, u16 val)

+{
+   unsigned long flags;
+
+   ugphy_vdbg("%s: IN", __FUNCTION__);
+
+   spin_lock_irqsave(&mii_info->mdio_lock, flags);
+   mii_info->mdio_write(mii_info->dev, mii_info->mii_id, regnum, val);
+   spin_unlock_irqrestore(&mii_info->mdio_lock, flags);
+}

 /* Write value to the PHY for this device to the register at  
regnum, */

 /* waiting until the write is done before it returns.  All PHY */
@@ -184,7 +207,7 @@ static void config_genmii_advert(struct
advertise = mii_info->advertising;

/* Setup standard advertisement */
-   adv = phy_read(mii_info, MII_ADVERTISE);
+   adv = ucc_geth_phy_read(mii_info, MII_ADVERTISE);
adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4);
if (advertise & ADVERTISED_10baseT_Half)
adv |= ADVERTISE_10HALF;
@@ -194,7 +217,7 @@ static void config_genmii_advert(struct
adv |= ADVERTISE_100HALF;
if (advertise & ADVERTISED_100baseT_Full)
adv |= ADVERTISE_100FULL;
-   phy_write(mii_info, MII_ADVERTISE, adv);
+   ucc_geth_phy_write(mii_info, MII_ADVERTISE, adv);
 }

 static void genmii_setup_forced(struct ugeth_mii_info *mii_info)
@@ -204,7 +227,7 @@ static void genmii_setup_forced(struct u

ugphy_vdbg("%s: IN", __FUNCTION__);

-   ctrl = phy_read(mii_info, MII_BMCR);
+   ctrl = ucc_geth_phy_read(mii_info, MII_BMCR);

ctrl &=
 	~(BMCR_FULLDPLX | BMCR_SPEED100 | BMCR_SPEED1000 |  
BMCR_ANENABLE);

@@ -234,7 +257,7 @@ static void genmii_setup_forced(struct u
break;
}

-   phy_write(mii_info, MII_BMCR, ctrl);
+   ucc_geth_phy_write(mii_info, MII_BMCR, ctrl);
 }

 /* Enable and Restart Autonegotiation */
@@ -244,9 +267,9 @@ static void genmii_restart_aneg(struct u

ugphy_vdbg("%s: IN", __FUNCTION__);

-   ctl = phy_read(mii_info, MII_BMCR);
+   ctl = ucc_geth_phy_read(mii_info, MII_BMCR);
ctl |= (BMCR_ANENABLE | BMCR_ANRESTART);
-   phy_write(mii_info, MII_BMCR, ctl);
+   ucc_geth_phy_write(mii_info, MII_BMCR, ctl);
 }

 static int gbit_config_aneg(struct ugeth_mii_info *mii_info)
@@ -261,14 +284,14 @@ static int gbit_config_aneg(struct ugeth
config_genmii_advert(mii_info);
advertise = mii_info->advertising;

-   adv = phy_read(mii_info, MII_1000BASETCONTROL);
+   adv = ucc_geth_phy_read(mii_info, MII_1000BASETCONTROL);
adv &= ~(MII_1000BASETCONTROL_FULLDUPLEXCAP |
 MII_1000BASETCONTROL_HALFDUPLEXCAP);
if (advertise & SUPPORTED_1000baseT_Half)
adv |= MII_1000BASETCONTROL_HALFDUPLEXCAP;
if (advertise & SUPPORTED_1000baseT_Full)
adv |= MII_1000BASETCONTROL_FULLDUPLEXCAP;
-   phy_write(mii_info, MII_1000BASETCONTROL, adv);
+   ucc_geth_phy_write(mii_info, MII_1000BASETCONTROL, adv);

 

Re: [PATCH] Fix phy_read/write redefinition errors in ucc_geth_phy.c

2006-12-18 Thread Kumar Gala

Jeff,

Can you pickup this patch for 2.6.20.  It addresses a name conflict  
issue with the phylib and the phy handling in the ucc driver.


thanks

- k

On Dec 13, 2006, at 5:08 PM, [EMAIL PROTECTED] wrote:


From: Timur Tabi <[EMAIL PROTECTED]>

The local versions of phy_read() and phy_write() in ucc_geth_phy.c  
conflict
with the prototypes in include/linux/phy.h, so this patch renames  
them,
moves them to the top of the file (while eliminating the redundant  
prototype),

and makes them static.

Signed-off-by: Timur Tabi <[EMAIL PROTECTED]>
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>

---
 drivers/net/ucc_geth_phy.c |  134 + 
+--

 1 files changed, 66 insertions(+), 68 deletions(-)

diff --git a/drivers/net/ucc_geth_phy.c b/drivers/net/ucc_geth_phy.c
index 5360ec0..3c86592 100644
--- a/drivers/net/ucc_geth_phy.c
+++ b/drivers/net/ucc_geth_phy.c
@@ -68,8 +68,31 @@ static int gbit_config_aneg(struct ugeth
 static int genmii_config_aneg(struct ugeth_mii_info *mii_info);
 static int genmii_update_link(struct ugeth_mii_info *mii_info);
 static int genmii_read_status(struct ugeth_mii_info *mii_info);
-u16 phy_read(struct ugeth_mii_info *mii_info, u16 regnum);
-void phy_write(struct ugeth_mii_info *mii_info, u16 regnum, u16 val);
+
+static u16 ucc_geth_phy_read(struct ugeth_mii_info *mii_info, u16  
regnum)

+{
+   u16 retval;
+   unsigned long flags;
+
+   ugphy_vdbg("%s: IN", __FUNCTION__);
+
+   spin_lock_irqsave(&mii_info->mdio_lock, flags);
+	retval = mii_info->mdio_read(mii_info->dev, mii_info->mii_id,  
regnum);

+   spin_unlock_irqrestore(&mii_info->mdio_lock, flags);
+
+   return retval;
+}
+
+static void ucc_geth_phy_write(struct ugeth_mii_info *mii_info,  
u16 regnum, u16 val)

+{
+   unsigned long flags;
+
+   ugphy_vdbg("%s: IN", __FUNCTION__);
+
+   spin_lock_irqsave(&mii_info->mdio_lock, flags);
+   mii_info->mdio_write(mii_info->dev, mii_info->mii_id, regnum, val);
+   spin_unlock_irqrestore(&mii_info->mdio_lock, flags);
+}

 /* Write value to the PHY for this device to the register at  
regnum, */

 /* waiting until the write is done before it returns.  All PHY */
@@ -184,7 +207,7 @@ static void config_genmii_advert(struct
advertise = mii_info->advertising;

/* Setup standard advertisement */
-   adv = phy_read(mii_info, MII_ADVERTISE);
+   adv = ucc_geth_phy_read(mii_info, MII_ADVERTISE);
adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4);
if (advertise & ADVERTISED_10baseT_Half)
adv |= ADVERTISE_10HALF;
@@ -194,7 +217,7 @@ static void config_genmii_advert(struct
adv |= ADVERTISE_100HALF;
if (advertise & ADVERTISED_100baseT_Full)
adv |= ADVERTISE_100FULL;
-   phy_write(mii_info, MII_ADVERTISE, adv);
+   ucc_geth_phy_write(mii_info, MII_ADVERTISE, adv);
 }

 static void genmii_setup_forced(struct ugeth_mii_info *mii_info)
@@ -204,7 +227,7 @@ static void genmii_setup_forced(struct u

ugphy_vdbg("%s: IN", __FUNCTION__);

-   ctrl = phy_read(mii_info, MII_BMCR);
+   ctrl = ucc_geth_phy_read(mii_info, MII_BMCR);

ctrl &=
 	~(BMCR_FULLDPLX | BMCR_SPEED100 | BMCR_SPEED1000 |  
BMCR_ANENABLE);

@@ -234,7 +257,7 @@ static void genmii_setup_forced(struct u
break;
}

-   phy_write(mii_info, MII_BMCR, ctrl);
+   ucc_geth_phy_write(mii_info, MII_BMCR, ctrl);
 }

 /* Enable and Restart Autonegotiation */
@@ -244,9 +267,9 @@ static void genmii_restart_aneg(struct u

ugphy_vdbg("%s: IN", __FUNCTION__);

-   ctl = phy_read(mii_info, MII_BMCR);
+   ctl = ucc_geth_phy_read(mii_info, MII_BMCR);
ctl |= (BMCR_ANENABLE | BMCR_ANRESTART);
-   phy_write(mii_info, MII_BMCR, ctl);
+   ucc_geth_phy_write(mii_info, MII_BMCR, ctl);
 }

 static int gbit_config_aneg(struct ugeth_mii_info *mii_info)
@@ -261,14 +284,14 @@ static int gbit_config_aneg(struct ugeth
config_genmii_advert(mii_info);
advertise = mii_info->advertising;

-   adv = phy_read(mii_info, MII_1000BASETCONTROL);
+   adv = ucc_geth_phy_read(mii_info, MII_1000BASETCONTROL);
adv &= ~(MII_1000BASETCONTROL_FULLDUPLEXCAP |
 MII_1000BASETCONTROL_HALFDUPLEXCAP);
if (advertise & SUPPORTED_1000baseT_Half)
adv |= MII_1000BASETCONTROL_HALFDUPLEXCAP;
if (advertise & SUPPORTED_1000baseT_Full)
adv |= MII_1000BASETCONTROL_FULLDUPLEXCAP;
-   phy_write(mii_info, MII_1000BASETCONTROL, adv);
+   ucc_geth_phy_write(mii_info, MII_1000BASETCONTROL, adv);

/* Start/Restart aneg */
genmii_restart_aneg(mii_info);
@@ -298,10 +321,10 @@ st

Re: [PATCH] Update ucc_geth.c for new workqueue structure

2006-12-18 Thread Kumar Gala

Jeff,

Can you pickup this patch for 2.6.20 as it fixes a compile issue due  
to the workqueue changes.


- kumar

On Dec 13, 2006, at 5:08 PM, [EMAIL PROTECTED] wrote:


From: Timur Tabi <[EMAIL PROTECTED]>

The workqueue interface changed with David Howell's patch on  
11/22/2006

(SHA 65f27f38446e1976cc98fd3004b110fedcddd189).  Several drivers were
updated with that patch to handle the new interface, but ucc_geth.c
was not one of them.  This patch updates ucc_geth.c to support the new
model.

A compiler warning in set_mac_addr() was also fixed.

Signed-off-by: Timur Tabi <[EMAIL PROTECTED]>
Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>

---
 drivers/net/ucc_geth.c |   12 +++-
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 1f05511..d33bb0c 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 

 #include 
 #include 
@@ -472,7 +473,7 @@ static void put_enet_addr_container(stru
kfree(enet_addr_cont);
 }

-static int set_mac_addr(__be16 __iomem *reg, u8 *mac)
+static void set_mac_addr(__be16 __iomem *reg, u8 *mac)
 {
out_be16(®[0], ((u16)mac[5] << 8) | mac[4]);
out_be16(®[1], ((u16)mac[3] << 8) | mac[2]);
@@ -3918,10 +3919,11 @@ static irqreturn_t phy_interrupt(int irq
 }

 /* Scheduled by the phy_interrupt/timer to handle PHY changes */
-static void ugeth_phy_change(void *data)
+static void ugeth_phy_change(struct work_struct *work)
 {
-   struct net_device *dev = (struct net_device *)data;
-   struct ucc_geth_private *ugeth = netdev_priv(dev);
+   struct ucc_geth_private *ugeth =
+   container_of(work, struct ucc_geth_private, tq);
+   struct net_device *dev = ugeth->dev;
struct ucc_geth *ug_regs;
int result = 0;

@@ -4078,7 +4080,7 @@ static int ucc_geth_open(struct net_devi
 #endif /* CONFIG_UGETH_NAPI */

/* Set up the PHY change work queue */
-   INIT_WORK(&ugeth->tq, ugeth_phy_change, dev);
+   INIT_WORK(&ugeth->tq, ugeth_phy_change);

init_timer(&ugeth->phy_info_timer);
ugeth->phy_info_timer.function = &ugeth_phy_startup_timer;
--
1.4.4

-
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: latest linux git doesn't compile ucc_geth_phy.c and ucc_geth.c

2006-12-13 Thread Kumar Gala
I just posted two patches to linuxppc-dev that fix these problems.   
The message

are titled:

[PATCH] Update ucc_geth.c for new workqueue structure
[PATCH] Fix phy_read/write redefinition errors in ucc_geth_phy.c

I've tested these on an 8360EMDS, and Kumar has reviewed and signed  
off on the

code, so I think they're good.  Please let me know if they're not.


You should really copy Jeff Garzik and the netdev list on these patches.

- 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: latest linux git doesn't compile ucc_geth_phy.c and ucc_geth.c

2006-12-13 Thread Kumar Gala



On Wed, 13 Dec 2006, Joakim Tjernlund wrote:


drivers/net/ucc_geth.c:4083:45: macro "INIT_WORK" passed 3 arguments,
but takes just 2
drivers/net/ucc_geth.c: In function `ucc_geth_open':
drivers/net/ucc_geth.c:4083: error: `INIT_WORK' undeclared (first use in
this function)
drivers/net/ucc_geth.c:4083: error: (Each undeclared identifier is
reported only once
drivers/net/ucc_geth.c:4083: error: for each function it appears in.)
drivers/net/ucc_geth.c: At top level:
drivers/net/ucc_geth.c:3924: warning: 'ugeth_phy_change' defined but not
used
make[2]: *** [drivers/net/ucc_geth.o] Error 1



This is because of the new INIT_WORK changes.


drivers/net/ucc_geth_phy.c:71: error: conflicting types for 'phy_read'
include/linux/phy.h:355: error: previous declaration of 'phy_read' was
here
drivers/net/ucc_geth_phy.c:71: error: conflicting types for 'phy_read'
include/linux/phy.h:355: error: previous declaration of 'phy_read' was
here
drivers/net/ucc_geth_phy.c:72: error: conflicting types for 'phy_write'
include/linux/phy.h:356: error: previous declaration of 'phy_write' was
here
drivers/net/ucc_geth_phy.c:72: error: conflicting types for 'phy_write'
include/linux/phy.h:356: error: previous declaration of 'phy_write' was
here


This is because of me wanting to get PHY_POLL defined for board code with 
having to include it everywhere it was being used.


Try the following patch and let me know if it works. (Make sure to try 
something that effects the PHY, like link status change or speed).


If it works for you I'll clean it up and send it upstream.

- k

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 8243150..252088f 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3920,10 +3920,11 @@ static irqreturn_t phy_interrupt(int irq, void *dev_id)
 }

 /* Scheduled by the phy_interrupt/timer to handle PHY changes */
-static void ugeth_phy_change(void *data)
+static void ugeth_phy_change(struct work_struct *work)
 {
-   struct net_device *dev = (struct net_device *)data;
-   struct ucc_geth_private *ugeth = netdev_priv(dev);
+   struct ucc_geth_private *ugeth =
+   container_of(work, struct ucc_geth_private, tq);
+   struct net_device *dev = ugeth->dev;
struct ucc_geth *ug_regs;
int result = 0;

@@ -4080,7 +4081,7 @@ static int ucc_geth_open(struct net_device *dev)
 #endif /* CONFIG_UGETH_NAPI */

/* Set up the PHY change work queue */
-   INIT_WORK(&ugeth->tq, ugeth_phy_change, dev);
+   INIT_WORK(&ugeth->tq, ugeth_phy_change);

init_timer(&ugeth->phy_info_timer);
ugeth->phy_info_timer.function = &ugeth_phy_startup_timer;
diff --git a/drivers/net/ucc_geth.h b/drivers/net/ucc_geth.h
diff --git a/drivers/net/ucc_geth_phy.c b/drivers/net/ucc_geth_phy.c
index 5360ec0..95a7674 100644
--- a/drivers/net/ucc_geth_phy.c
+++ b/drivers/net/ucc_geth_phy.c
@@ -68,8 +68,8 @@ static int gbit_config_aneg(struct ugeth_mii_info *mii_info);
 static int genmii_config_aneg(struct ugeth_mii_info *mii_info);
 static int genmii_update_link(struct ugeth_mii_info *mii_info);
 static int genmii_read_status(struct ugeth_mii_info *mii_info);
-u16 phy_read(struct ugeth_mii_info *mii_info, u16 regnum);
-void phy_write(struct ugeth_mii_info *mii_info, u16 regnum, u16 val);
+static u16 ugphy_read(struct ugeth_mii_info *mii_info, u16 regnum);
+static void ugphy_write(struct ugeth_mii_info *mii_info, u16 regnum, u16 val);

 /* Write value to the PHY for this device to the register at regnum, */
 /* waiting until the write is done before it returns.  All PHY */
@@ -184,7 +184,7 @@ static void config_genmii_advert(struct ugeth_mii_info 
*mii_info)
advertise = mii_info->advertising;

/* Setup standard advertisement */
-   adv = phy_read(mii_info, MII_ADVERTISE);
+   adv = ugphy_read(mii_info, MII_ADVERTISE);
adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4);
if (advertise & ADVERTISED_10baseT_Half)
adv |= ADVERTISE_10HALF;
@@ -194,7 +194,7 @@ static void config_genmii_advert(struct ugeth_mii_info 
*mii_info)
adv |= ADVERTISE_100HALF;
if (advertise & ADVERTISED_100baseT_Full)
adv |= ADVERTISE_100FULL;
-   phy_write(mii_info, MII_ADVERTISE, adv);
+   ugphy_write(mii_info, MII_ADVERTISE, adv);
 }

 static void genmii_setup_forced(struct ugeth_mii_info *mii_info)
@@ -204,7 +204,7 @@ static void genmii_setup_forced(struct ugeth_mii_info 
*mii_info)

ugphy_vdbg("%s: IN", __FUNCTION__);

-   ctrl = phy_read(mii_info, MII_BMCR);
+   ctrl = ugphy_read(mii_info, MII_BMCR);

ctrl &=
~(BMCR_FULLDPLX | BMCR_SPEED100 | BMCR_SPEED1000 | BMCR_ANENABLE);
@@ -234,7 +234,7 @@ static void genmii_setup_forced(struct ugeth_mii_info 
*mii_info)
break;
}

-   phy_write(mii_info, MII_BMCR, ctrl);
+   ugphy_write(mii_info, MII_BMCR, ctrl);
 }

 /* Enable and Restart Autonegotiation

examples of setting ip address/netmask/etc.. on a device

2006-12-12 Thread Kumar Gala
I was wondering if there were any examples of net devices that expect  
to be told the ip information for their connection (things doing  
forms of offload).  If so can someone point me at a driver that does  
this.


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


status of route matching work?

2006-11-14 Thread Kumar Gala

Thomas,

I came across this comment in DaveM's blog:

"Next he described a way to do route matching based upon branching  
rules with a "GOTO" operation. Only forward GOTOs would be allowed in  
the tree in order to prevent loops, but this would allow to match on  
many key components and allow a high level of rule sharing.


One nice consequence of Thomas's work is that we can force packets  
for a local address to still go over a real ethernet device. Some  
people do this for testing and the current kernel cannot do this.  
Continually a very ugly patch keeps getting submitted which allowed  
this but broke a lot of other things. Thomas's ideas allow this to be  
supported cleanly."


And was wondering what the status of this work was.  I'm interested  
in being able to force packets for a local address out a real  
ethernet device.


thanks

- kumar
-
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] Add support for configuring the PHY connection interface

2006-11-07 Thread Kumar Gala
 set interface\n", num);
+   continue;
+   }
+
ret = gfar_set_phy_info(np, &gfar_data.phy_id,
&gfar_data.bus_id, &gfar_data.phy_flags);
if (ret) {
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 4873dc6..ad540ce 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -360,7 +360,8 @@ #endif /* defined(AU1XXX_PHY_STATIC_CONF
BUG_ON(!phydev);
BUG_ON(phydev->attached_dev);

-	phydev = phy_connect(dev, phydev->dev.bus_id,  
&au1000_adjust_link, 0);
+	phydev = phy_connect(dev, phydev->dev.bus_id,  
&au1000_adjust_link, 0,

+   PHY_INTERFACE_MODE_MII);

if (IS_ERR(phydev)) {
printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name);
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/ 
fs_enet/fs_enet-main.c

index cb39587..889d3a1 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -779,7 +779,8 @@ static int fs_init_phy(struct net_device
fep->oldspeed = 0;
fep->oldduplex = -1;
if(fep->fpi->bus_id)
-   phydev = phy_connect(dev, fep->fpi->bus_id, &fs_adjust_link, 0);
+   phydev = phy_connect(dev, fep->fpi->bus_id, &fs_adjust_link, 0,
+   PHY_INTERFACE_MODE_MII);
else {
printk("No phy bus ID specified in BSP code\n");
    return -EINVAL;
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index a06d8d1..80e4aec 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -9,7 +9,7 @@
  * Author: Andy Fleming
  * Maintainer: Kumar Gala
  *
- * Copyright (c) 2002-2004 Freescale Semiconductor, Inc.
+ * Copyright (c) 2002-2006 Freescale Semiconductor, Inc.
  *
  * This program is free software; you can redistribute  it and/or  
modify it
  * under  the terms of  the GNU General  Public License as  
published by the

@@ -410,7 +410,8 @@ static int init_phy(struct net_device *d

 	snprintf(phy_id, BUS_ID_SIZE, PHY_ID_FMT, priv->einfo->bus_id,  
priv->einfo->phy_id);


-   phydev = phy_connect(dev, phy_id, &adjust_link, 0);
+   phydev = phy_connect(dev, phy_id, &adjust_link, 0,
+   priv->einfo->interface);

if (IS_ERR(phydev)) {
printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name);
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/ 
phy_device.c

index 2a08b2b..b01fc70 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -59,6 +59,7 @@ struct phy_device* phy_device_create(str
dev->duplex = -1;
dev->pause = dev->asym_pause = 0;
dev->link = 1;
+   dev->interface = PHY_INTERFACE_MODE_GMII;

dev->autoneg = AUTONEG_ENABLE;

@@ -137,11 +138,12 @@ void phy_prepare_link(struct phy_device
  *   the desired functionality.
  */
 struct phy_device * phy_connect(struct net_device *dev, const char  
*phy_id,

-   void (*handler)(struct net_device *), u32 flags)
+   void (*handler)(struct net_device *), u32 flags,
+   u32 interface)
 {
struct phy_device *phydev;

-   phydev = phy_attach(dev, phy_id, flags);
+   phydev = phy_attach(dev, phy_id, flags, interface);

if (IS_ERR(phydev))
return phydev;
@@ -186,7 +188,7 @@ static int phy_compare_id(struct device
 }

 struct phy_device *phy_attach(struct net_device *dev,
-   const char *phy_id, u32 flags)
+   const char *phy_id, u32 flags, u32 interface)
 {
struct bus_type *bus = &mdio_bus_type;
struct phy_device *phydev;
@@ -231,6 +233,20 @@ struct phy_device *phy_attach(struct net

phydev->dev_flags = flags;

+   phydev->interface = interface;
+
+   /* Do initial configuration here, now that
+* we have certain key parameters
+* (dev_flags and interface) */
+   if (phydev->drv->config_init) {
+   int err;
+
+   err = phydev->drv->config_init(phydev);
+
+   if (err < 0)
+   return ERR_PTR(err);
+   }
+
return phydev;
 }
 EXPORT_SYMBOL(phy_attach);
@@ -612,13 +628,8 @@ static int phy_probe(struct device *dev)

spin_unlock(&phydev->lock);

-   if (err < 0)
-   return err;
-
-   if (phydev->drv->config_init)
-   err = phydev->drv->config_init(phydev);
-
return err;
+
 }

 static int phy_remove(struct device *dev)
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 892d6ab..7d9ead0 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -46,15 +46,32 @@ #define PHY_IGNORE_INTERRUPT-2
 #define PHY_HAS_INTERRUPT  0x0001
 #

BCM5461 phy issue in 10M/Full duplex

2006-10-18 Thread Kumar Gala
I was wondering if anyone has had any issues when trying to force a  
BCM5461 phy into 10M/full duplex.  I seem to be having an issue in  
the two managed switches I've tried this on but autoneg to 10/half.   
This causes a problem in that I start seeing a large number of frame  
errors.


I believe, but need to double check, that if I leave the BCM5461 in  
autoneg, and foce the switch to 10M/full that the BCM5461 will  
autoneg at 10M/half duplex.


Just wondering if anyone else has seen similar behavior with this PHY.

thanks

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


use of tx_timeout in enet driver?

2006-10-13 Thread Kumar Gala
I'm working on a enet driver and trying to figure out what I should  
do in the tx_timeout function.  The device I have doesn't interrupt  
on tx completions so I already have a timer loop to check to see if  
there have been any completions by looking at the ring pointers.


So should I do something like e100 does in using a work_queue to  
effectively reset the card if we get a tx_timeout?


- kumar
-
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: examples to model ethernet driver off of?

2006-09-13 Thread Kumar Gala


On Sep 13, 2006, at 3:11 PM, Auke Kok wrote:


Francois Romieu wrote:

Kumar Gala <[EMAIL PROTECTED]> :
What are good examples of simple/basic ethernet drivers one  
should  use to model a new driver off of?

tg3/bnx2/sky2/b44/8139cp


Can I add e1000/ixgb to that? ;)


What is the feeling about e100.c?

I'm looking for something that is just basic tx/rx with no real fancy  
features.


- 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


examples to model ethernet driver off of?

2006-09-13 Thread Kumar Gala
What are good examples of simple/basic ethernet drivers one should  
use to model a new driver off of?


thanks

- kumar
-
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/2] PHYLIB: Fix forcing mode reduction

2006-07-24 Thread Kumar Gala

Jeff,

Any status on accepting this patch, I've got some additional fixes  
that are based on having access to genphy_update_link()


- kumar

On Jun 5, 2006, at 6:45 PM, Nathaniel Case wrote:


On Mon, 2006-06-05 at 17:08 -0500, Andy Fleming wrote:

Looks good.  Feel free to send these patches to
netdev@vger.kernel.org (you may need to subscribe), and copy Jeff
Garzik <[EMAIL PROTECTED]>.


This fixes a problem seen when a port without a cable connected would
repeatedly print out "Trying 1000/HALF".  While in the PHY_FORCING
state, the call to phy_read_status() was resetting the value of
phydev->speed and phydev->duplex, preventing it from incrementally
trying the speed/duplex variations.

Since we really just want the link status updated for the PHY_FORCING
state, calling genphy_update_link() instead of phy_read_status() fixes
this issue.

Patch tested on a MPC8540 platform with a BCM5421 PHY.

Signed-off-by: Nate Case <[EMAIL PROTECTED]>
Signed-off-by: Andy Fleming <[EMAIL PROTECTED]>

---

--- a/drivers/net/phy/phy.c 2006-06-04 16:01:59.0 -0500
+++ b/drivers/net/phy/phy.c 2006-06-05 10:55:31.0 -0500
@@ -767,7 +783,7 @@
}
break;
case PHY_FORCING:
-   err = phy_read_status(phydev);
+   err = genphy_update_link(phydev);

if (err)
break;
--- a/drivers/net/phy/phy_device.c  2006-06-04 16:02:08.0 -0500
+++ b/drivers/net/phy/phy_device.c  2006-06-04 19:12:26.0 -0500
@@ -417,6 +417,7 @@

return 0;
 }
+EXPORT_SYMBOL(genphy_update_link);

 /* genphy_read_status
  *


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


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


Re: [PATCH 1/3] Freescale QE UCC gigabit ethernet driver

2006-07-07 Thread Kumar Gala


On Jul 7, 2006, at 3:59 AM, Li Yang-r58472 wrote:


-Original Message-
From: Kumar Gala [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 06, 2006 9:45 PM
To: Li Yang-r58472
Cc: Andrew Morton; [EMAIL PROTECTED]; netdev@vger.kernel.org;
[EMAIL PROTECTED]
Subject: Re: [PATCH 1/3] Freescale QE UCC gigabit ethernet driver

Nack.  Here are some high level things that should be addressed:
* There is a ton of debug code that should probably be stripped out,
such as dump_regs, etc..


The reason I left these debug code in is that, QE is very flexible.
User probably needs to fine tune parameters for their own application.
It will be good to give them some clue doing that.  It's fine to  
remove

them, if you do think they are too verbose.


Then I suggest you look at debugfs.


* The phy support should use the phylib instead


I'll do this when I do get some time. ;)

* convert from being a platform_device to of_device


I'm not up against moving to use of_device.  But why are we putting
extra effort in closing the door to backward compatibility with ppc
arch, and doesn't provide any new feature. ;)


Because the intent is for arch/ppc to go away in the future.  You are  
introducing a new driver and a new platform, this is the ideal time  
for us to use of_device.  The benefits are that the driver is the  
ideal place to parse the details of the device node rather than  
platform code in arch/powerpc.


- kumar
-
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: [git patches] net driver fixes

2006-04-12 Thread Kumar Gala


On Apr 12, 2006, at 5:45 PM, Jeff Garzik wrote:


Kumar Gala wrote:

Jeff,
Noticed Andy's gianfar fixes aren't in here.  I'd be good to see  
if we can get them in for 2.6.17


Never saw them...


Odd, posted to netdev, Andy may not have copied you on them.

http://marc.theaimsgroup.com/?l=linux-netdev&m=114437381506340&w=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


  1   2   >