mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-03 21:14:40 +08:00
LWIP_VLAN_PCP==1: initialize tci correctly (disabled); add pcb_tci_*() functions to access the tci
This commit is contained in:
parent
84fde1ebbf
commit
b92faffaaa
@ -610,6 +610,7 @@ raw_new(u8_t proto)
|
|||||||
#if LWIP_MULTICAST_TX_OPTIONS
|
#if LWIP_MULTICAST_TX_OPTIONS
|
||||||
raw_set_multicast_ttl(pcb, RAW_TTL);
|
raw_set_multicast_ttl(pcb, RAW_TTL);
|
||||||
#endif /* LWIP_MULTICAST_TX_OPTIONS */
|
#endif /* LWIP_MULTICAST_TX_OPTIONS */
|
||||||
|
pcb_tci_init(pcb);
|
||||||
pcb->next = raw_pcbs;
|
pcb->next = raw_pcbs;
|
||||||
raw_pcbs = pcb;
|
raw_pcbs = pcb;
|
||||||
}
|
}
|
||||||
|
@ -1929,6 +1929,7 @@ tcp_alloc(u8_t prio)
|
|||||||
pcb->keep_intvl = TCP_KEEPINTVL_DEFAULT;
|
pcb->keep_intvl = TCP_KEEPINTVL_DEFAULT;
|
||||||
pcb->keep_cnt = TCP_KEEPCNT_DEFAULT;
|
pcb->keep_cnt = TCP_KEEPCNT_DEFAULT;
|
||||||
#endif /* LWIP_TCP_KEEPALIVE */
|
#endif /* LWIP_TCP_KEEPALIVE */
|
||||||
|
pcb_tci_init(pcb);
|
||||||
}
|
}
|
||||||
return pcb;
|
return pcb;
|
||||||
}
|
}
|
||||||
|
@ -1238,6 +1238,7 @@ udp_new(void)
|
|||||||
#if LWIP_MULTICAST_TX_OPTIONS
|
#if LWIP_MULTICAST_TX_OPTIONS
|
||||||
udp_set_multicast_ttl(pcb, UDP_TTL);
|
udp_set_multicast_ttl(pcb, UDP_TTL);
|
||||||
#endif /* LWIP_MULTICAST_TX_OPTIONS */
|
#endif /* LWIP_MULTICAST_TX_OPTIONS */
|
||||||
|
pcb_tci_init(pcb);
|
||||||
}
|
}
|
||||||
return pcb;
|
return pcb;
|
||||||
}
|
}
|
||||||
|
@ -93,6 +93,17 @@ struct ip_pcb {
|
|||||||
IP_PCB;
|
IP_PCB;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if LWIP_VLAN_PCP
|
||||||
|
#define pcb_has_tci(pcb) ((pcb)->netif_hints.tci >= 0)
|
||||||
|
#define pcb_tci_get(pcb) ((pcb)->netif_hints.tci)
|
||||||
|
#define pcb_tci_clear(pcb) do { (pcb)->netif_hints.tci = -1; } while(0)
|
||||||
|
#define pcb_tci_set(pcb, tci_val) do { (pcb)->netif_hints.tci = (tci_val) & 0xffff; } while(0)
|
||||||
|
#define pcb_tci_set_pcp_dei_vid(pcb, pcp, dei, vid) pcb_tci_set(pcb, (((pcp) & 7) << 13) | (((dei) & 1) << 12) | ((vid) & 0xFFF))
|
||||||
|
#define pcb_tci_init(pcb) pcb_tci_clear(pcb)
|
||||||
|
#else
|
||||||
|
#define pcb_tci_init(pcb)
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Option flags per-socket. These are the same like SO_XXX in sockets.h
|
* Option flags per-socket. These are the same like SO_XXX in sockets.h
|
||||||
*/
|
*/
|
||||||
|
@ -672,11 +672,13 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* LWIP_VLAN_PCP==1: Enable outgoing VLAN taggning of frames on a per-PCB basis
|
* LWIP_VLAN_PCP==1: Enable outgoing VLAN taggning of frames on a per-PCB basis
|
||||||
* for QoS purposes. With this feature enabled, each PCB has a new variable: "tci".
|
* for QoS purposes. With this feature enabled, each PCB has a new variable:
|
||||||
* (Tag Control Identifier). The TCI contains three fields: VID, CFI and PCP.
|
* "netif_hints.tci" (Tag Control Identifier).
|
||||||
* VID is the VLAN ID, which should be set to zero.
|
* The TCI contains three fields: VID, CFI and PCP.
|
||||||
* The "CFI" bit is used to enable or disable VLAN tags for the PCB.
|
* - VID is the VLAN ID, which should be set to zero.
|
||||||
* PCP (Priority Code Point) is a 3 bit field used for Ethernet level QoS.
|
* - The "CFI" bit is used to enable or disable VLAN tags for the PCB.
|
||||||
|
* - PCP (Priority Code Point) is a 3 bit field used for Ethernet level QoS.
|
||||||
|
* See pcb_tci_*() functions to get/set/clear this.
|
||||||
*/
|
*/
|
||||||
#ifndef LWIP_VLAN_PCP
|
#ifndef LWIP_VLAN_PCP
|
||||||
#define LWIP_VLAN_PCP 0
|
#define LWIP_VLAN_PCP 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user