summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorHanhui <sylixos@gmail.com>2015-12-18 11:43:08 (GMT)
committer Hanhui <sylixos@gmail.com>2015-12-18 11:43:08 (GMT)
commit6accdcc6eb4e070963ff095efbe0a41323853436 (patch)
treed8d0bc810d35d5238edb5c974f0cd5060f80aa18
parent429a3cf1e2e1a739d0aaf6a918242bcd17192018 (diff)
downloadbspam335x-6accdcc6eb4e070963ff095efbe0a41323853436.zip
bspam335x-6accdcc6eb4e070963ff095efbe0a41323853436.tar.gz
bspam335x-6accdcc6eb4e070963ff095efbe0a41323853436.tar.bz2
Ethernet driver support VLAN forward.
-rw-r--r--SylixOS/driver/netif/cpswif.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/SylixOS/driver/netif/cpswif.c b/SylixOS/driver/netif/cpswif.c
index d00eac3..88a8abd 100644
--- a/SylixOS/driver/netif/cpswif.c
+++ b/SylixOS/driver/netif/cpswif.c
@@ -132,7 +132,7 @@
#define CPDMA_BD_PKTLEN_MASK 0xFFFF
#define MAX_TRANSFER_UNIT 1500
-#define PBUF_LEN_MAX 1520
+#define PBUF_LEN_MAX 1524 /* include VLAN header and counter */
#define MIN_PKT_LEN 60
@@ -1657,6 +1657,11 @@ cpswif_rxbd_alloc(struct cpswinst *cpswinst) {
*/
if(p != NULL) {
#ifdef SYLIXOS
+
+#if ETHARP_SUPPORT_VLAN
+ pbuf_header(p, -SIZEOF_VLAN_HDR); /* pre-save 4 bytes space for ip_forward() vlan header */
+#endif
+
#if ETH_PAD_SIZE
pbuf_header(p, -ETH_PAD_SIZE);
#endif