aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ks8851.c
diff options
context:
space:
mode:
authorSebastien Jan <s-jan@ti.com>2010-05-05 04:45:52 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-06 00:27:44 -0400
commit7d9974666e0dc2cbbeac80fa4d550df0bbea6fad (patch)
tree0898cfd2ae49e3eece28c0632ded527e2b269032 /drivers/net/ks8851.c
parentd951f7250305adaea5f25398b70023681183d0cb (diff)
ks8851: Add caching of CCR register
CCR register contains information on companion eeprom availability. Signed-off-by: Sebastien Jan <s-jan@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ks8851.c')
-rw-r--r--drivers/net/ks8851.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/ks8851.c b/drivers/net/ks8851.c
index b8ed1ee37ac1..623171f37d99 100644
--- a/drivers/net/ks8851.c
+++ b/drivers/net/ks8851.c
@@ -78,7 +78,9 @@ union ks8851_tx_hdr {
78 * @msg_enable: The message flags controlling driver output (see ethtool). 78 * @msg_enable: The message flags controlling driver output (see ethtool).
79 * @fid: Incrementing frame id tag. 79 * @fid: Incrementing frame id tag.
80 * @rc_ier: Cached copy of KS_IER. 80 * @rc_ier: Cached copy of KS_IER.
81 * @rc_ccr: Cached copy of KS_CCR.
81 * @rc_rxqcr: Cached copy of KS_RXQCR. 82 * @rc_rxqcr: Cached copy of KS_RXQCR.
83 * @eeprom_size: Companion eeprom size in Bytes, 0 if no eeprom
82 * 84 *
83 * The @lock ensures that the chip is protected when certain operations are 85 * The @lock ensures that the chip is protected when certain operations are
84 * in progress. When the read or write packet transfer is in progress, most 86 * in progress. When the read or write packet transfer is in progress, most
@@ -109,6 +111,8 @@ struct ks8851_net {
109 111
110 u16 rc_ier; 112 u16 rc_ier;
111 u16 rc_rxqcr; 113 u16 rc_rxqcr;
114 u16 rc_ccr;
115 u16 eeprom_size;
112 116
113 struct mii_if_info mii; 117 struct mii_if_info mii;
114 struct ks8851_rxctrl rxctrl; 118 struct ks8851_rxctrl rxctrl;
@@ -1269,6 +1273,14 @@ static int __devinit ks8851_probe(struct spi_device *spi)
1269 goto err_id; 1273 goto err_id;
1270 } 1274 }
1271 1275
1276 /* cache the contents of the CCR register for EEPROM, etc. */
1277 ks->rc_ccr = ks8851_rdreg16(ks, KS_CCR);
1278
1279 if (ks->rc_ccr & CCR_EEPROM)
1280 ks->eeprom_size = 128;
1281 else
1282 ks->eeprom_size = 0;
1283
1272 ks8851_read_selftest(ks); 1284 ks8851_read_selftest(ks);
1273 ks8851_init_mac(ks); 1285 ks8851_init_mac(ks);
1274 1286