aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-05-15 02:06:16 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-18 00:03:43 -0400
commit6bc5046e6df7d7122631c82ccaa6edf7085331ac (patch)
tree2635317661bd011746859e4a52a907e53ee2c4f1
parente0b221bf4e07edf2fda645e457dc3c35c2f2f3a9 (diff)
sfc: Use generic XENPAK register definitions
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/sfc/tenxpress.c16
-rw-r--r--drivers/net/sfc/xenpack.h57
-rw-r--r--drivers/net/sfc/xfp_phy.c4
3 files changed, 4 insertions, 73 deletions
diff --git a/drivers/net/sfc/tenxpress.c b/drivers/net/sfc/tenxpress.c
index 0421190db7de..db723c58f6f1 100644
--- a/drivers/net/sfc/tenxpress.c
+++ b/drivers/net/sfc/tenxpress.c
@@ -44,18 +44,6 @@
44 */ 44 */
45#define MAX_BAD_LP_TRIES (5) 45#define MAX_BAD_LP_TRIES (5)
46 46
47/* LASI Control */
48#define PMA_PMD_LASI_CTRL 36866
49#define PMA_PMD_LASI_STATUS 36869
50#define PMA_PMD_LS_ALARM_LBN 0
51#define PMA_PMD_LS_ALARM_WIDTH 1
52#define PMA_PMD_TX_ALARM_LBN 1
53#define PMA_PMD_TX_ALARM_WIDTH 1
54#define PMA_PMD_RX_ALARM_LBN 2
55#define PMA_PMD_RX_ALARM_WIDTH 1
56#define PMA_PMD_AN_ALARM_LBN 3
57#define PMA_PMD_AN_ALARM_WIDTH 1
58
59/* Extended control register */ 47/* Extended control register */
60#define PMA_PMD_XCONTROL_REG 49152 48#define PMA_PMD_XCONTROL_REG 49152
61#define PMA_PMD_EXT_GMII_EN_LBN 1 49#define PMA_PMD_EXT_GMII_EN_LBN 1
@@ -579,8 +567,8 @@ static void tenxpress_phy_poll(struct efx_nic *efx)
579 change = true; 567 change = true;
580 } else { 568 } else {
581 int status = efx_mdio_read(efx, MDIO_MMD_PMAPMD, 569 int status = efx_mdio_read(efx, MDIO_MMD_PMAPMD,
582 PMA_PMD_LASI_STATUS); 570 MDIO_PMA_LASI_STAT);
583 if (status & (1 << PMA_PMD_LS_ALARM_LBN)) 571 if (status & MDIO_PMA_LASI_LSALARM)
584 change = true; 572 change = true;
585 } 573 }
586 574
diff --git a/drivers/net/sfc/xenpack.h b/drivers/net/sfc/xenpack.h
deleted file mode 100644
index 4e52286e542d..000000000000
--- a/drivers/net/sfc/xenpack.h
+++ /dev/null
@@ -1,57 +0,0 @@
1/****************************************************************************
2 * Driver for Solarflare Solarstorm network controllers and boards
3 * Copyright 2006 Solarflare Communications Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published
7 * by the Free Software Foundation, incorporated herein by reference.
8 */
9
10#ifndef EFX_XENPACK_H
11#define EFX_XENPACK_H
12
13/* Exported functions from Xenpack standard PHY control */
14
15#include "mdio_10g.h"
16
17/****************************************************************************/
18/* XENPACK MDIO register extensions */
19#define MDIO_XP_LASI_RX_CTRL (0x9000)
20#define MDIO_XP_LASI_TX_CTRL (0x9001)
21#define MDIO_XP_LASI_CTRL (0x9002)
22#define MDIO_XP_LASI_RX_STAT (0x9003)
23#define MDIO_XP_LASI_TX_STAT (0x9004)
24#define MDIO_XP_LASI_STAT (0x9005)
25
26/* Control/Status bits */
27#define XP_LASI_LS_ALARM (1 << 0)
28#define XP_LASI_TX_ALARM (1 << 1)
29#define XP_LASI_RX_ALARM (1 << 2)
30/* These two are Quake vendor extensions to the standard XENPACK defines */
31#define XP_LASI_LS_INTB (1 << 3)
32#define XP_LASI_TEST (1 << 7)
33
34/* Enable LASI interrupts for PHY */
35static inline void xenpack_enable_lasi_irqs(struct efx_nic *efx)
36{
37 /* Read to clear LASI status register */
38 efx_mdio_read(efx, MDIO_MMD_PMAPMD, MDIO_XP_LASI_STAT);
39
40 efx_mdio_write(efx, MDIO_MMD_PMAPMD, MDIO_XP_LASI_CTRL,
41 XP_LASI_LS_ALARM);
42}
43
44/* Read the LASI interrupt status to clear the interrupt. */
45static inline int xenpack_clear_lasi_irqs(struct efx_nic *efx)
46{
47 /* Read to clear link status alarm */
48 return efx_mdio_read(efx, MDIO_MMD_PMAPMD, MDIO_XP_LASI_STAT);
49}
50
51/* Turn off LASI interrupts */
52static inline void xenpack_disable_lasi_irqs(struct efx_nic *efx)
53{
54 efx_mdio_write(efx, MDIO_MMD_PMAPMD, MDIO_XP_LASI_CTRL, 0);
55}
56
57#endif /* EFX_XENPACK_H */
diff --git a/drivers/net/sfc/xfp_phy.c b/drivers/net/sfc/xfp_phy.c
index aad2dca19772..bb2e6afd0829 100644
--- a/drivers/net/sfc/xfp_phy.c
+++ b/drivers/net/sfc/xfp_phy.c
@@ -15,7 +15,6 @@
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include "efx.h" 16#include "efx.h"
17#include "mdio_10g.h" 17#include "mdio_10g.h"
18#include "xenpack.h"
19#include "phy.h" 18#include "phy.h"
20#include "falcon.h" 19#include "falcon.h"
21 20
@@ -169,7 +168,8 @@ static int xfp_phy_init(struct efx_nic *efx)
169 168
170static void xfp_phy_clear_interrupt(struct efx_nic *efx) 169static void xfp_phy_clear_interrupt(struct efx_nic *efx)
171{ 170{
172 xenpack_clear_lasi_irqs(efx); 171 /* Read to clear link status alarm */
172 efx_mdio_read(efx, MDIO_MMD_PMAPMD, MDIO_PMA_LASI_STAT);
173} 173}
174 174
175static int xfp_link_ok(struct efx_nic *efx) 175static int xfp_link_ok(struct efx_nic *efx)