6loWPAN: More configurtion settings.

This commit is contained in:
Gregory Nutt
2017-03-28 11:16:28 -06:00
parent f32fe172d4
commit d9e32ee337
4 changed files with 33 additions and 17 deletions
+4
View File
@@ -223,6 +223,10 @@
(((a)->u16[6]) == 0) && \ (((a)->u16[6]) == 0) && \
(((a)->u8[14]) == 0)) (((a)->u8[14]) == 0))
/* Maximum size of an IEEE802.15.4 frame */
#define SIXLOWPAN_MAC_MAXFRAME 127
/**************************************************************************** /****************************************************************************
* Public Types * Public Types
****************************************************************************/ ****************************************************************************/
+1 -1
View File
@@ -230,7 +230,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
#ifdef CONFIG_NET_6LOWPAN #ifdef CONFIG_NET_6LOWPAN
case NET_LL_6LOWPAN: /* IEEE 802.15.4 */ case NET_LL_6LOWPAN: /* IEEE 802.15.4 */
dev->d_llhdrlen = 0; /* REVISIT */ dev->d_llhdrlen = 0; /* REVISIT */
dev->d_mtu = CONFIG_NET_6LOWPAN_MTU; dev->d_mtu = SIXLOWPAN_MAC_MAXFRAME;
#ifdef CONFIG_NET_TCP #ifdef CONFIG_NET_TCP
dev->d_recvwndo = CONFIG_NET_6LOWPAN_TCP_RECVWNDO; dev->d_recvwndo = CONFIG_NET_6LOWPAN_TCP_RECVWNDO;
#endif #endif
+26 -14
View File
@@ -43,6 +43,14 @@ config NET_6LOWPAN_COMPRESSION_HC06
endchoice # 6loWPAN Compression endchoice # 6loWPAN Compression
config NET_6LOWPAN_COMPRESSION_THRESHOLD
int "Lower compression threshold"
default 63
depends on !NET_6LOWPAN_COMPRESSION_IPv6
---help---
CONFIG_NET_6LOWPAN_COMPRESSION_THRESHOLD sets a lower threshold for
when packets should not be compressed.
if NET_6LOWPAN_COMPRESSION_HC06 if NET_6LOWPAN_COMPRESSION_HC06
config NET_6LOWPAN_MAXADDRCONTEXT config NET_6LOWPAN_MAXADDRCONTEXT
@@ -119,27 +127,31 @@ config NET_SIXLOWPAN_MAXAGE
---help--- ---help---
Timeout for packet reassembly at the 6lowpan layer (should be < 60s) Timeout for packet reassembly at the 6lowpan layer (should be < 60s)
config NET_6LOWPAN_MTU config NET_6LOWPAN_MAX_MACTRANSMITS
int "6LoWPAN packet buffer size (MTU)" int "Max MAC transmissions"
default 1294 default 4
range 590 1518
---help--- ---help---
Packet buffer size. This size includes the TCP/UDP payload plus the CONFIG_NET_6LOWPAN_MAX_MACTRANSMITS specifies how many times the MAC
size of TCP/UDP header, the IP header, and data link layer headers. layer should resend packets if no link-layer ACK wasreceived. This
This value is normally referred to as the MTU (Maximum Transmission only makes sense with the csma_driver.
Unit); the payload is the MSS (Maximum Segment Size).
IPv6 hosts are required to be able to handle an MSS of 1220 octets, config NET_SIXLOWPAN_MAXPAYLOAD
resulting in a minimum buffer size of of 1220+20+40+xx = xx. REVISIT! int "Max packet size"
default 102
---help---
CONFIG_NET_SIXLOWPAN_MAXPAYLOAD specifies the maximum size of packets
before they get fragmented. The default is 127 bytes (the maximum size
of a 802.15.4 frame) - 25 bytes (for the 802.15.4 MAClayer header). This
can be increased for systems with larger packet sizes.
config NET_6LOWPAN_TCP_RECVWNDO config NET_6LOWPAN_TCP_RECVWNDO
int "6LoWPAN TCP receive window size" int "6LoWPAN TCP receive window size"
default 1220 default 102
depends on NET_TCP depends on NET_TCP
---help--- ---help---
The size of the advertised receiver's window. Should be set low The size of the advertised receiver's window. Should be set low
(i.e., to the size of the MSS) if the application is slow to process (i.e., to the size of the IEEE802.15.4 frame payload) if the application
incoming data, or high (32768 bytes) if the application processes is slow to process incoming data, or high (32768 bytes) if the
data quickly. REVISIT! application processes data quickly. REVISIT!
endif # NET_6LOWPAN endif # NET_6LOWPAN
+2 -2
View File
@@ -150,8 +150,8 @@ void sixlowpan_hc06_initialize(void)
g_hc06_addrcontexts[2].used = 1; g_hc06_addrcontexts[2].used = 1;
g_hc06_addrcontexts[2].number = 2; g_hc06_addrcontexts[2].number = 2;
g_hc06_addrcontexts[2].prefix[0] = CONFIG_NET_6LOWPAN_MAXADDRCONTEXT_PREFIX_1_0; g_hc06_addrcontexts[2].prefix[0] = CONFIG_NET_6LOWPAN_MAXADDRCONTEXT_PREFIX_2_0;
g_hc06_addrcontexts[2].prefix[1] = CONFIG_NET_6LOWPAN_MAXADDRCONTEXT_PREFIX_1_1; g_hc06_addrcontexts[2].prefix[1] = CONFIG_NET_6LOWPAN_MAXADDRCONTEXT_PREFIX_2_1;
} }
else else
#endif /* SIXLOWPAN_CONF_ADDR_CONTEXT_2 */ #endif /* SIXLOWPAN_CONF_ADDR_CONTEXT_2 */