All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Dale Farnsworth <dale@farnsworth.org>
Cc: Netdev <netdev@oss.sgi.com>, James Chapman <jchapman@katalix.com>
Subject: Re: [PATCH: 2.6.12-rc1] mii: Add test for GigE support
Date: Tue, 22 Mar 2005 18:27:47 -0500	[thread overview]
Message-ID: <4240A9F3.5040704@pobox.com> (raw)
In-Reply-To: <20050322231746.GA27770@xyzzy>

Dale Farnsworth wrote:
> This patch adds the ability to test a PHY for GigE support
> 
> Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
> 
> Index: linux-2.5-enet/drivers/net/mii.c
> ===================================================================
> --- linux-2.5-enet.orig/drivers/net/mii.c
> +++ linux-2.5-enet/drivers/net/mii.c
> @@ -207,6 +207,21 @@
>  	return 0;
>  }
>  
> +int mii_check_gmii_support(struct mii_if_info *mii)
> +{
> +	int reg;
> +
> +	reg = mii->mdio_read(mii->dev, mii->phy_id, MII_BMSR);
> +	if (reg & BMSR_HAS_EXTSTAT1000) {
> +		reg = mii->mdio_read(mii->dev, mii->phy_id, MII_EXTSTAT1000);
> +		if (reg & (ESR_1000_BASE_X_FD | ESR_1000_BASE_T_FD |
> +			   ESR_1000_BASE_X_HD | ESR_1000_BASE_T_HD))
> +			return 1;
> +	}
> +
> +	return 0;

Two comments:

1) you need to add EXPORT_SYMBOL() when adding new API functions (see 
the bottom of the file).

2) Reading a non-existent register will return all 1's in most cases, so 
I am not sure if this is the best test.

	Jeff

  reply	other threads:[~2005-03-22 23:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-22 23:17 [PATCH: 2.6.12-rc1] mii: Add test for GigE support Dale Farnsworth
2005-03-22 23:27 ` Jeff Garzik [this message]
2005-03-23  1:21   ` Andy Fleming
2005-03-23  1:47     ` Jeff Garzik
2005-03-23  6:14       ` Dale Farnsworth
2005-03-25  4:42         ` Jeff Garzik
2005-08-22 23:50         ` [PATCH] [NET] " Dale Farnsworth

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=4240A9F3.5040704@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=dale@farnsworth.org \
    --cc=jchapman@katalix.com \
    --cc=netdev@oss.sgi.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.