cxgb_mv88e1xxx.c (256281) | cxgb_mv88e1xxx.c (277343) |
---|---|
1/************************************************************************** 2 3Copyright (c) 2007, Chelsio Inc. 4All rights reserved. 5 6Redistribution and use in source and binary forms, with or without 7modification, are permitted provided that the following conditions are met: 8 --- 14 unchanged lines hidden (view full) --- 23INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26POSSIBILITY OF SUCH DAMAGE. 27 28***************************************************************************/ 29 30#include <sys/cdefs.h> | 1/************************************************************************** 2 3Copyright (c) 2007, Chelsio Inc. 4All rights reserved. 5 6Redistribution and use in source and binary forms, with or without 7modification, are permitted provided that the following conditions are met: 8 --- 14 unchanged lines hidden (view full) --- 23INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26POSSIBILITY OF SUCH DAMAGE. 27 28***************************************************************************/ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: stable/10/sys/dev/cxgb/common/cxgb_mv88e1xxx.c 197791 2009-10-05 20:21:41Z np $"); | 31__FBSDID("$FreeBSD: stable/10/sys/dev/cxgb/common/cxgb_mv88e1xxx.c 277343 2015-01-18 20:38:38Z np $"); |
32 33#include <cxgb_include.h> 34 35/* Marvell PHY interrupt status bits. */ 36#define MV_INTR_JABBER 0x0001 37#define MV_INTR_POLARITY_CHNG 0x0002 38#define MV_INTR_ENG_DETECT_CHNG 0x0010 39#define MV_INTR_DOWNSHIFT 0x0020 --- 140 unchanged lines hidden (view full) --- 180} 181 182static int mv88e1xxx_set_loopback(struct cphy *cphy, int mmd, int dir, int on) 183{ 184 return t3_mdio_change_bits(cphy, 0, MII_BMCR, BMCR_LOOPBACK, 185 on ? BMCR_LOOPBACK : 0); 186} 187 | 32 33#include <cxgb_include.h> 34 35/* Marvell PHY interrupt status bits. */ 36#define MV_INTR_JABBER 0x0001 37#define MV_INTR_POLARITY_CHNG 0x0002 38#define MV_INTR_ENG_DETECT_CHNG 0x0010 39#define MV_INTR_DOWNSHIFT 0x0020 --- 140 unchanged lines hidden (view full) --- 180} 181 182static int mv88e1xxx_set_loopback(struct cphy *cphy, int mmd, int dir, int on) 183{ 184 return t3_mdio_change_bits(cphy, 0, MII_BMCR, BMCR_LOOPBACK, 185 on ? BMCR_LOOPBACK : 0); 186} 187 |
188static int mv88e1xxx_get_link_status(struct cphy *cphy, int *link_ok, | 188static int mv88e1xxx_get_link_status(struct cphy *cphy, int *link_state, |
189 int *speed, int *duplex, int *fc) 190{ 191 u32 status; 192 int sp = -1, dplx = -1, pause = 0; 193 194 mdio_read(cphy, 0, MV88E1XXX_SPECIFIC_STATUS, &status); 195 if ((status & V_PSSR_STATUS_RESOLVED) != 0) { 196 if (status & V_PSSR_RX_PAUSE) --- 4 unchanged lines hidden (view full) --- 201 sp = G_PSSR_SPEED(status); 202 if (sp == 0) 203 sp = SPEED_10; 204 else if (sp == 1) 205 sp = SPEED_100; 206 else 207 sp = SPEED_1000; 208 } | 189 int *speed, int *duplex, int *fc) 190{ 191 u32 status; 192 int sp = -1, dplx = -1, pause = 0; 193 194 mdio_read(cphy, 0, MV88E1XXX_SPECIFIC_STATUS, &status); 195 if ((status & V_PSSR_STATUS_RESOLVED) != 0) { 196 if (status & V_PSSR_RX_PAUSE) --- 4 unchanged lines hidden (view full) --- 201 sp = G_PSSR_SPEED(status); 202 if (sp == 0) 203 sp = SPEED_10; 204 else if (sp == 1) 205 sp = SPEED_100; 206 else 207 sp = SPEED_1000; 208 } |
209 if (link_ok) 210 *link_ok = (status & V_PSSR_LINK) != 0; | 209 if (link_state) 210 *link_state = status & V_PSSR_LINK ? PHY_LINK_UP : 211 PHY_LINK_DOWN; |
211 if (speed) 212 *speed = sp; 213 if (duplex) 214 *duplex = dplx; 215 if (fc) 216 *fc = pause; 217 return 0; 218} --- 98 unchanged lines hidden --- | 212 if (speed) 213 *speed = sp; 214 if (duplex) 215 *duplex = dplx; 216 if (fc) 217 *fc = pause; 218 return 0; 219} --- 98 unchanged lines hidden --- |