aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/s2io-regs.h5
-rw-r--r--drivers/net/s2io.c21
2 files changed, 11 insertions, 15 deletions
diff --git a/drivers/net/s2io-regs.h b/drivers/net/s2io-regs.h
index f8274f8941ea..416669fd68c6 100644
--- a/drivers/net/s2io-regs.h
+++ b/drivers/net/s2io-regs.h
@@ -271,11 +271,6 @@ struct XENA_dev_config {
271 u64 mdio_control; 271 u64 mdio_control;
272#define MDIO_MMD_INDX_ADDR(val) vBIT(val, 0, 16) 272#define MDIO_MMD_INDX_ADDR(val) vBIT(val, 0, 16)
273#define MDIO_MMD_DEV_ADDR(val) vBIT(val, 19, 5) 273#define MDIO_MMD_DEV_ADDR(val) vBIT(val, 19, 5)
274#define MDIO_MMD_PMA_DEV_ADDR 0x1
275#define MDIO_MMD_PMD_DEV_ADDR 0x1
276#define MDIO_MMD_WIS_DEV_ADDR 0x2
277#define MDIO_MMD_PCS_DEV_ADDR 0x3
278#define MDIO_MMD_PHYXS_DEV_ADDR 0x4
279#define MDIO_MMS_PRT_ADDR(val) vBIT(val, 27, 5) 274#define MDIO_MMS_PRT_ADDR(val) vBIT(val, 27, 5)
280#define MDIO_CTRL_START_TRANS(val) vBIT(val, 56, 4) 275#define MDIO_CTRL_START_TRANS(val) vBIT(val, 56, 4)
281#define MDIO_OP(val) vBIT(val, 60, 2) 276#define MDIO_OP(val) vBIT(val, 60, 2)
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++;