cxgb_t3_hw.c (256281) | cxgb_t3_hw.c (277343) |
---|---|
1/************************************************************************** 2 3Copyright (c) 2007-2009, 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-2009, 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_t3_hw.c 249582 2013-04-17 11:40:10Z gabor $"); | 31__FBSDID("$FreeBSD: stable/10/sys/dev/cxgb/common/cxgb_t3_hw.c 277343 2015-01-18 20:38:38Z np $"); |
32 33 34#include <cxgb_include.h> 35 36#undef msleep 37#define msleep t3_os_sleep 38 39/** --- 1475 unchanged lines hidden (view full) --- 1515 * @port_id: the port index that changed link state 1516 * 1517 * Called when a port's link settings change to propagate the new values 1518 * to the associated PHY and MAC. After performing the common tasks it 1519 * invokes an OS-specific handler. 1520 */ 1521void t3_link_changed(adapter_t *adapter, int port_id) 1522{ | 32 33 34#include <cxgb_include.h> 35 36#undef msleep 37#define msleep t3_os_sleep 38 39/** --- 1475 unchanged lines hidden (view full) --- 1515 * @port_id: the port index that changed link state 1516 * 1517 * Called when a port's link settings change to propagate the new values 1518 * to the associated PHY and MAC. After performing the common tasks it 1519 * invokes an OS-specific handler. 1520 */ 1521void t3_link_changed(adapter_t *adapter, int port_id) 1522{ |
1523 int link_ok, speed, duplex, fc, link_fault; | 1523 int link_ok, speed, duplex, fc, link_fault, link_state; |
1524 struct port_info *pi = adap2pinfo(adapter, port_id); 1525 struct cphy *phy = &pi->phy; 1526 struct cmac *mac = &pi->mac; 1527 struct link_config *lc = &pi->link_config; 1528 1529 link_ok = lc->link_ok; 1530 speed = lc->speed; 1531 duplex = lc->duplex; 1532 fc = lc->fc; 1533 link_fault = 0; 1534 | 1524 struct port_info *pi = adap2pinfo(adapter, port_id); 1525 struct cphy *phy = &pi->phy; 1526 struct cmac *mac = &pi->mac; 1527 struct link_config *lc = &pi->link_config; 1528 1529 link_ok = lc->link_ok; 1530 speed = lc->speed; 1531 duplex = lc->duplex; 1532 fc = lc->fc; 1533 link_fault = 0; 1534 |
1535 phy->ops->get_link_status(phy, &link_ok, &speed, &duplex, &fc); | 1535 phy->ops->get_link_status(phy, &link_state, &speed, &duplex, &fc); 1536 link_ok = (link_state == PHY_LINK_UP); 1537 if (link_state != PHY_LINK_PARTIAL) 1538 phy->rst = 0; 1539 else if (++phy->rst == 3) { 1540 phy->ops->reset(phy, 0); 1541 phy->rst = 0; 1542 } |
1536 1537 if (link_ok == 0) 1538 pi->link_fault = LF_NO; 1539 1540 if (lc->requested_fc & PAUSE_AUTONEG) 1541 fc &= lc->requested_fc; 1542 else 1543 fc = lc->requested_fc & (PAUSE_RX | PAUSE_TX); --- 3248 unchanged lines hidden --- | 1543 1544 if (link_ok == 0) 1545 pi->link_fault = LF_NO; 1546 1547 if (lc->requested_fc & PAUSE_AUTONEG) 1548 fc &= lc->requested_fc; 1549 else 1550 fc = lc->requested_fc & (PAUSE_RX | PAUSE_TX); --- 3248 unchanged lines hidden --- |