svn commit: r317864 - head/sys/dev/etherswitch/infineon
Adrian Chadd
adrian at FreeBSD.org
Sat May 6 05:50:09 UTC 2017
Author: adrian
Date: Sat May 6 05:50:07 2017
New Revision: 317864
URL: https://svnweb.freebsd.org/changeset/base/317864
Log:
[infineon] [etherswitch] no hardcode tagging port setting at amd6996fc
Tagging port can set by etherswitchcfg command.
Tested:
* on Netgear_WGR614Cv7
Submitted by: Hiroki Mori <yamori813 at yahoo.co.jp>
Reviewed by: mizhka
Modified:
head/sys/dev/etherswitch/infineon/adm6996fc.c
Modified: head/sys/dev/etherswitch/infineon/adm6996fc.c
==============================================================================
--- head/sys/dev/etherswitch/infineon/adm6996fc.c Sat May 6 05:37:36 2017 (r317863)
+++ head/sys/dev/etherswitch/infineon/adm6996fc.c Sat May 6 05:50:07 2017 (r317864)
@@ -35,6 +35,7 @@
* This code suppose ADM6996FC SDC/SDIO connect to SOC network interface
* MDC/MDIO.
* This code development on Netgear WGR614Cv7.
+ * etherswitchcfg command port option support addtag.
*/
#include <sys/param.h>
@@ -462,8 +463,6 @@ adm6996fc_getport(device_t dev, etherswi
p->es_pvid = ADM6996FC_PVIDBYDATA(data1, data2);
if (((data1 >> ADM6996FC_OPTE_SHIFT) & 0x01) == 1)
p->es_flags |= ETHERSWITCH_PORT_ADDTAG;
- else
- p->es_flags |= ETHERSWITCH_PORT_STRIPTAG;
} else {
p->es_pvid = 0;
}
@@ -517,6 +516,10 @@ adm6996fc_setport(device_t dev, etherswi
data = ADM6996FC_READREG(parent, bcaddr[p->es_port]);
data &= ~(0xf << 10);
data |= (p->es_pvid & 0xf) << ADM6996FC_PVID_SHIFT;
+ if (p->es_flags & ETHERSWITCH_PORT_ADDTAG)
+ data |= 1 << ADM6996FC_OPTE_SHIFT;
+ else
+ data &= ~(1 << ADM6996FC_OPTE_SHIFT);
ADM6996FC_WRITEREG(parent, bcaddr[p->es_port], data);
data = ADM6996FC_READREG(parent, vidaddr[p->es_port]);
/* only port 4 is hi bit */
@@ -670,9 +673,6 @@ adm6996fc_setconf(device_t dev, etherswi
/* Private VID set 1 */
data &= ~(0xf << 10);
data |= (1 << 10);
- /* Output Packet Tagging Enable */
- if (i == 5)
- data |= (1 << 4);
ADM6996FC_WRITEREG(parent, bcaddr[i], data);
}
for (i = 2;i <= 15; ++i) {
More information about the svn-src-head
mailing list