aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorNavdeep Parhar <np@FreeBSD.org>2014-11-12 23:29:22 +0000
committerNavdeep Parhar <np@FreeBSD.org>2014-11-12 23:29:22 +0000
commit05c4567dd973cc81284f626dc0097ece97c3b19d (patch)
tree29c93f764e3dc735854be6207a8a84fdfaea4e3a /sys
parent794a349c6f54febe41eaab0d33f1c735c37b331b (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/cxgbe/common/t4_hw.c8
-rw-r--r--sys/dev/cxgbe/t4_main.c12
2 files changed, 12 insertions, 8 deletions
diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c
index d81f45ee8e89b..2d5d79d752f07 100644
--- a/sys/dev/cxgbe/common/t4_hw.c
+++ b/sys/dev/cxgbe/common/t4_hw.c
@@ -5420,6 +5420,10 @@ int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl)
}
lc = &pi->link_cfg;
+ if (mod != pi->mod_type) {
+ pi->mod_type = mod;
+ t4_os_portmod_changed(adap, i);
+ }
if (link_ok != lc->link_ok || speed != lc->speed ||
fc != lc->fc) { /* something changed */
int reason;
@@ -5435,10 +5439,6 @@ int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl)
lc->supported = ntohs(p->u.info.pcap);
t4_os_link_changed(adap, i, link_ok, reason);
}
- if (mod != pi->mod_type) {
- pi->mod_type = mod;
- t4_os_portmod_changed(adap, i);
- }
} else {
CH_WARN_RATELIMIT(adap,
"Unknown firmware reply 0x%x (0x%x)\n", opcode, action);
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index 4c141de4a5da3..8089eb4cf053e 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -1590,7 +1590,9 @@ cxgbe_media_status(struct ifnet *ifp, struct ifmediareq *ifmr)
struct ifmedia *media = NULL;
struct ifmedia_entry *cur;
int speed = pi->link_cfg.speed;
+#ifdef INVARIANTS
int data = (pi->port_type << 8) | pi->mod_type;
+#endif
if (ifp == pi->ifp)
media = &pi->media;
@@ -1601,10 +1603,7 @@ cxgbe_media_status(struct ifnet *ifp, struct ifmediareq *ifmr)
MPASS(media != NULL);
cur = media->ifm_cur;
- if (cur->ifm_data != data) {
- build_medialist(pi, media);
- cur = media->ifm_cur;
- }
+ MPASS(cur->ifm_data == data);
ifmr->ifm_status = IFM_AVALID;
if (!pi->link_cfg.link_ok)
@@ -8005,6 +8004,11 @@ t4_os_portmod_changed(const struct adapter *sc, int idx)
NULL, "LR", "SR", "ER", "TWINAX", "active TWINAX", "LRM"
};
+ build_medialist(pi, &pi->media);
+#ifdef DEV_NETMAP
+ build_medialist(pi, &pi->nm_media);
+#endif
+
if (pi->mod_type == FW_PORT_MOD_TYPE_NONE)
if_printf(pi->ifp, "transceiver unplugged.\n");
else if (pi->mod_type == FW_PORT_MOD_TYPE_UNKNOWN)