diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-04-29 04:13:29 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-29 20:32:34 -0400 |
commit | 4023939667a906f0c02022ce7ec06d6512470211 (patch) | |
tree | 6a0342eb2a48f01908154f8d85181cbf1dc06eb7 /drivers/net/s2io.c | |
parent | cdbf0eb478dd4c76aa665c80976837dc58367f52 (diff) |
s2io: Use generic MDIO definitions
Compile-tested only.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/s2io.c')
-rw-r--r-- | drivers/net/s2io.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 1a4979f27fb5..80562ea77de3 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -63,6 +63,7 @@ | |||
63 | #include <linux/kernel.h> | 63 | #include <linux/kernel.h> |
64 | #include <linux/netdevice.h> | 64 | #include <linux/netdevice.h> |
65 | #include <linux/etherdevice.h> | 65 | #include <linux/etherdevice.h> |
66 | #include <linux/mdio.h> | ||
66 | #include <linux/skbuff.h> | 67 | #include <linux/skbuff.h> |
67 | #include <linux/init.h> | 68 | #include <linux/init.h> |
68 | #include <linux/delay.h> | 69 | #include <linux/delay.h> |
@@ -3328,9 +3329,9 @@ static void s2io_updt_xpak_counter(struct net_device *dev) | |||
3328 | struct stat_block *stat_info = sp->mac_control.stats_info; | 3329 | struct stat_block *stat_info = sp->mac_control.stats_info; |
3329 | 3330 | ||
3330 | /* Check the communication with the MDIO slave */ | 3331 | /* Check the communication with the MDIO slave */ |
3331 | addr = 0x0000; | 3332 | addr = MDIO_CTRL1; |
3332 | val64 = 0x0; | 3333 | val64 = 0x0; |
3333 | val64 = s2io_mdio_read(MDIO_MMD_PMA_DEV_ADDR, addr, dev); | 3334 | val64 = s2io_mdio_read(MDIO_MMD_PMAPMD, addr, dev); |
3334 | if((val64 == 0xFFFF) || (val64 == 0x0000)) | 3335 | if((val64 == 0xFFFF) || (val64 == 0x0000)) |
3335 | { | 3336 | { |
3336 | DBG_PRINT(ERR_DBG, "ERR: MDIO slave access failed - " | 3337 | DBG_PRINT(ERR_DBG, "ERR: MDIO slave access failed - " |
@@ -3338,24 +3339,24 @@ static void s2io_updt_xpak_counter(struct net_device *dev) | |||
3338 | return; | 3339 | return; |
3339 | } | 3340 | } |
3340 | 3341 | ||
3341 | /* Check for the expecte value of 2040 at PMA address 0x0000 */ | 3342 | /* Check for the expected value of control reg 1 */ |
3342 | if(val64 != 0x2040) | 3343 | if(val64 != MDIO_CTRL1_SPEED10G) |
3343 | { | 3344 | { |
3344 | DBG_PRINT(ERR_DBG, "Incorrect value at PMA address 0x0000 - "); | 3345 | DBG_PRINT(ERR_DBG, "Incorrect value at PMA address 0x0000 - "); |
3345 | DBG_PRINT(ERR_DBG, "Returned: %llx- Expected: 0x2040\n", | 3346 | DBG_PRINT(ERR_DBG, "Returned: %llx- Expected: 0x%x\n", |
3346 | (unsigned long long)val64); | 3347 | (unsigned long long)val64, MDIO_CTRL1_SPEED10G); |
3347 | return; | 3348 | return; |
3348 | } | 3349 | } |
3349 | 3350 | ||
3350 | /* Loading the DOM register to MDIO register */ | 3351 | /* Loading the DOM register to MDIO register */ |
3351 | addr = 0xA100; | 3352 | addr = 0xA100; |
3352 | s2io_mdio_write(MDIO_MMD_PMA_DEV_ADDR, addr, val16, dev); | 3353 | s2io_mdio_write(MDIO_MMD_PMAPMD, addr, val16, dev); |
3353 | val64 = s2io_mdio_read(MDIO_MMD_PMA_DEV_ADDR, addr, dev); | 3354 | val64 = s2io_mdio_read(MDIO_MMD_PMAPMD, addr, dev); |
3354 | 3355 | ||
3355 | /* Reading the Alarm flags */ | 3356 | /* Reading the Alarm flags */ |
3356 | addr = 0xA070; | 3357 | addr = 0xA070; |
3357 | val64 = 0x0; | 3358 | val64 = 0x0; |
3358 | val64 = s2io_mdio_read(MDIO_MMD_PMA_DEV_ADDR, addr, dev); | 3359 | val64 = s2io_mdio_read(MDIO_MMD_PMAPMD, addr, dev); |
3359 | 3360 | ||
3360 | flag = CHECKBIT(val64, 0x7); | 3361 | flag = CHECKBIT(val64, 0x7); |
3361 | type = 1; | 3362 | type = 1; |
@@ -3387,7 +3388,7 @@ static void s2io_updt_xpak_counter(struct net_device *dev) | |||
3387 | /* Reading the Warning flags */ | 3388 | /* Reading the Warning flags */ |
3388 | addr = 0xA074; | 3389 | addr = 0xA074; |
3389 | val64 = 0x0; | 3390 | val64 = 0x0; |
3390 | val64 = s2io_mdio_read(MDIO_MMD_PMA_DEV_ADDR, addr, dev); | 3391 | val64 = s2io_mdio_read(MDIO_MMD_PMAPMD, addr, dev); |
3391 | 3392 | ||
3392 | if(CHECKBIT(val64, 0x7)) | 3393 | if(CHECKBIT(val64, 0x7)) |
3393 | stat_info->xpak_stat.warn_transceiver_temp_high++; | 3394 | stat_info->xpak_stat.warn_transceiver_temp_high++; |