All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Bordug <vitb@gate.crashing.org>
To: Mark Zhan <rongkai.zhan@windriver.com>
Cc: netdev@vger.kernel.org, Vitaly Bordug <vbordug@ru.mvista.com>,
	"linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH] MII bitbang driver should generate MII bus phy_mask dynamically
Date: Mon, 11 Jun 2007 13:58:31 -0500	[thread overview]
Message-ID: <20070611185831.GA31896@gate.crashing.org> (raw)
In-Reply-To: <1181548417.5217.13.camel@mark>

On Mon, Jun 11, 2007 at 03:53:37PM +0800, Mark Zhan wrote:
> Current MII bitbang bus driver hard-codes the phy mask of mii_bus to
> ~0x09, which is actually specific to the FSL boards. This patch will
> make the bitbang driver to generate MII bus phy_mask dynamically, by the
> PHY irq info provided by the platform.
> 
> Signed-off-by: Mark Zhan <rongkai.zhan@windriver.com>
Acked-by: Vitaly Bordug <vitb@kernel.crashing.org>
> ---

>  b/drivers/net/fs_enet/mii-bitbang.c |    9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/fs_enet/mii-bitbang.c
> b/drivers/net/fs_enet/mii-bitbang.c
> index d384010..3732d69 100644
> --- a/drivers/net/fs_enet/mii-bitbang.c
> +++ b/drivers/net/fs_enet/mii-bitbang.c
> @@ -315,7 +315,7 @@ static int __devinit fs_enet_mdio_probe(
>  	struct fs_mii_bb_platform_info *pdata;
>  	struct mii_bus *new_bus;
>  	struct bb_info *bitbang;
> -	int err = 0;
> +	int i, err = 0;
>  
>  	if (NULL == dev)
>  		return -EINVAL;
> @@ -336,14 +336,17 @@ static int __devinit fs_enet_mdio_probe(
>  	new_bus->reset = &fs_enet_mii_bb_reset,
>  	new_bus->id = pdev->id;
>  
> -	new_bus->phy_mask = ~0x9;
>  	pdata = (struct fs_mii_bb_platform_info *)pdev->dev.platform_data;
> -
>  	if (NULL == pdata) {
>  		printk(KERN_ERR "gfar mdio %d: Missing platform data!\n", pdev->id);
>  		return -ENODEV;
>  	}
>  
> +	new_bus->phy_mask = 0xFFFFFFFF;
> +	for (i = 0; i < PHY_MAX_ADDR; i++)
> +		if (pdata->irq[i] != -1)
> +			new_bus->phy_mask &= ~(1 << i);
> +
>  	/*set up workspace*/
>  	fs_mii_bitbang_init(bitbang, pdata);
>  
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

WARNING: multiple messages have this Message-ID (diff)
From: Vitaly Bordug <vitb@gate.crashing.org>
To: Mark Zhan <rongkai.zhan@windriver.com>
Cc: netdev@vger.kernel.org,
	"linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>,
	Vitaly Bordug <vbordug@ru.mvista.com>
Subject: Re: [PATCH] MII bitbang driver should generate MII bus phy_mask dynamically
Date: Mon, 11 Jun 2007 13:58:31 -0500	[thread overview]
Message-ID: <20070611185831.GA31896@gate.crashing.org> (raw)
In-Reply-To: <1181548417.5217.13.camel@mark>

On Mon, Jun 11, 2007 at 03:53:37PM +0800, Mark Zhan wrote:
> Current MII bitbang bus driver hard-codes the phy mask of mii_bus to
> ~0x09, which is actually specific to the FSL boards. This patch will
> make the bitbang driver to generate MII bus phy_mask dynamically, by the
> PHY irq info provided by the platform.
> 
> Signed-off-by: Mark Zhan <rongkai.zhan@windriver.com>
Acked-by: Vitaly Bordug <vitb@kernel.crashing.org>
> ---

>  b/drivers/net/fs_enet/mii-bitbang.c |    9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/fs_enet/mii-bitbang.c
> b/drivers/net/fs_enet/mii-bitbang.c
> index d384010..3732d69 100644
> --- a/drivers/net/fs_enet/mii-bitbang.c
> +++ b/drivers/net/fs_enet/mii-bitbang.c
> @@ -315,7 +315,7 @@ static int __devinit fs_enet_mdio_probe(
>  	struct fs_mii_bb_platform_info *pdata;
>  	struct mii_bus *new_bus;
>  	struct bb_info *bitbang;
> -	int err = 0;
> +	int i, err = 0;
>  
>  	if (NULL == dev)
>  		return -EINVAL;
> @@ -336,14 +336,17 @@ static int __devinit fs_enet_mdio_probe(
>  	new_bus->reset = &fs_enet_mii_bb_reset,
>  	new_bus->id = pdev->id;
>  
> -	new_bus->phy_mask = ~0x9;
>  	pdata = (struct fs_mii_bb_platform_info *)pdev->dev.platform_data;
> -
>  	if (NULL == pdata) {
>  		printk(KERN_ERR "gfar mdio %d: Missing platform data!\n", pdev->id);
>  		return -ENODEV;
>  	}
>  
> +	new_bus->phy_mask = 0xFFFFFFFF;
> +	for (i = 0; i < PHY_MAX_ADDR; i++)
> +		if (pdata->irq[i] != -1)
> +			new_bus->phy_mask &= ~(1 << i);
> +
>  	/*set up workspace*/
>  	fs_mii_bitbang_init(bitbang, pdata);
>  
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

  parent reply	other threads:[~2007-06-11 18:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-11  7:53 [PATCH] MII bitbang driver should generate MII bus phy_mask dynamically Mark Zhan
2007-06-11 18:57 ` Andy Fleming
2007-06-11 18:57   ` Andy Fleming
2007-06-11 18:58 ` Vitaly Bordug [this message]
2007-06-11 18:58   ` Vitaly Bordug
2007-06-11 19:03 ` Vitaly Bordug
2007-06-11 19:03   ` Vitaly Bordug

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070611185831.GA31896@gate.crashing.org \
    --to=vitb@gate.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=rongkai.zhan@windriver.com \
    --cc=vbordug@ru.mvista.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.