summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorloos <loos@FreeBSD.org>2014-07-05 19:31:22 +0000
committerloos <loos@FreeBSD.org>2014-07-05 19:31:22 +0000
commitd4ce3e761472b2b554de7d6c46776bd02baaa322 (patch)
tree62a588928b58dfbba466e998f423c7cf2f80ca3f /sys/dev
parentdd9568e89220188d1c2f0861713f1ec90ccaae02 (diff)
downloadFreeBSD-src-d4ce3e761472b2b554de7d6c46776bd02baaa322.zip
FreeBSD-src-d4ce3e761472b2b554de7d6c46776bd02baaa322.tar.gz
Allow the PVID setting on CPU port.
Return our static list of supported media for the CPU port. Tested on TP-Link 1043ND.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/etherswitch/rtl8366/rtl8366rb.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/etherswitch/rtl8366/rtl8366rb.c b/sys/dev/etherswitch/rtl8366/rtl8366rb.c
index 78eae5d..d14f4660 100644
--- a/sys/dev/etherswitch/rtl8366/rtl8366rb.c
+++ b/sys/dev/etherswitch/rtl8366/rtl8366rb.c
@@ -579,13 +579,19 @@ rtl_getport(device_t dev, etherswitch_port_t *p)
} else {
/* fill in fixed values for CPU port */
p->es_flags |= ETHERSWITCH_PORT_CPU;
- ifmr->ifm_count = 0;
smi_read(dev, RTL8366RB_PLSR_BASE + (RTL8366RB_NUM_PHYS)/2, &v, RTL_WAITOK);
v = v >> (8 * ((RTL8366RB_NUM_PHYS) % 2));
rtl8366rb_update_ifmedia(v, &ifmr->ifm_status, &ifmr->ifm_active);
ifmr->ifm_current = ifmr->ifm_active;
ifmr->ifm_mask = 0;
ifmr->ifm_status = IFM_ACTIVE | IFM_AVALID;
+ /* Return our static media list. */
+ if (ifmr->ifm_count > 0) {
+ ifmr->ifm_count = 1;
+ ifmr->ifm_ulist[0] = IFM_MAKEWORD(IFM_ETHER, IFM_1000_T,
+ IFM_FDX, 0);
+ } else
+ ifmr->ifm_count = 0;
}
return (0);
}
@@ -598,7 +604,7 @@ rtl_setport(device_t dev, etherswitch_port_t *p)
struct ifmedia *ifm;
struct mii_data *mii;
- if (p->es_port < 0 || p->es_port >= RTL8366RB_NUM_PHYS)
+ if (p->es_port < 0 || p->es_port >= RTL8366RB_NUM_PORTS)
return (ENXIO);
sc = device_get_softc(dev);
vlangroup = -1;
OpenPOWER on IntegriCloud