All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastien Jan <s-jan@ti.com>
To: netdev@vger.kernel.org
Cc: linux-omap@vger.kernel.org, Abraham Arce <x0066660@ti.com>,
	Ben Dooks <ben-linux@fluff.org>,
	Tristram.Ha@micrel.com, Sebastien Jan <s-jan@ti.com>
Subject: [PATCH 1/4 v2] ks8851: Add caching of CCR register
Date: Wed,  5 May 2010 20:45:52 +0200	[thread overview]
Message-ID: <1273085155-1260-2-git-send-email-s-jan@ti.com> (raw)
In-Reply-To: <1273085155-1260-1-git-send-email-s-jan@ti.com>

CCR register contains information on companion eeprom availability.

Signed-off-by: Sebastien Jan <s-jan@ti.com>
---
 drivers/net/ks8851.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ks8851.c b/drivers/net/ks8851.c
index 9e9f9b3..a84e500 100644
--- a/drivers/net/ks8851.c
+++ b/drivers/net/ks8851.c
@@ -76,7 +76,9 @@ union ks8851_tx_hdr {
  * @msg_enable: The message flags controlling driver output (see ethtool).
  * @fid: Incrementing frame id tag.
  * @rc_ier: Cached copy of KS_IER.
+ * @rc_ccr: Cached copy of KS_CCR.
  * @rc_rxqcr: Cached copy of KS_RXQCR.
+ * @eeprom_size: Companion eeprom size in Bytes, 0 if no eeprom
  *
  * The @lock ensures that the chip is protected when certain operations are
  * in progress. When the read or write packet transfer is in progress, most
@@ -107,6 +109,8 @@ struct ks8851_net {
 
 	u16			rc_ier;
 	u16			rc_rxqcr;
+	u16			rc_ccr;
+	u16			eeprom_size;
 
 	struct mii_if_info	mii;
 	struct ks8851_rxctrl	rxctrl;
@@ -1279,6 +1283,14 @@ static int __devinit ks8851_probe(struct spi_device *spi)
 		goto err_id;
 	}
 
+	/* cache the contents of the CCR register for EEPROM, etc. */
+	ks->rc_ccr = ks8851_rdreg16(ks, KS_CCR);
+
+	if (ks->rc_ccr & CCR_EEPROM)
+		ks->eeprom_size = 128;
+	else
+		ks->eeprom_size = 0;
+
 	ks8851_read_selftest(ks);
 	ks8851_init_mac(ks);
 
-- 
1.6.3.3


  reply	other threads:[~2010-05-05 18:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-05 18:45 [PATCH 0/4 v2] ks8851: support for read/write MAC address from eeprom Sebastien Jan
2010-05-05 18:45 ` Sebastien Jan [this message]
2010-05-06  7:20   ` [PATCH 1/4 v2] ks8851: Add caching of CCR register David Miller
2010-05-05 18:45 ` [PATCH 2/4 v2] ks8851: Low level functions for read/write to companion eeprom Sebastien Jan
2010-05-06  7:20   ` David Miller
2010-05-11  1:23     ` Ben Dooks
2010-05-11  5:59       ` David Miller
2010-05-11  1:16   ` Ben Dooks
2010-05-05 18:45 ` [PATCH 3/4 v2] ks8851: companion eeprom access through ethtool Sebastien Jan
2010-05-06  7:20   ` David Miller
2010-05-05 18:45 ` [PATCH 4/4 v2] ks8851: read/write MAC address on companion eeprom through debugfs Sebastien Jan
2010-05-06  7:25   ` David Miller
2010-05-06  8:01     ` Sebastien Jan

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=1273085155-1260-2-git-send-email-s-jan@ti.com \
    --to=s-jan@ti.com \
    --cc=Tristram.Ha@micrel.com \
    --cc=ben-linux@fluff.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=x0066660@ti.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.