Linux Audio

Check our new training course

Loading...
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
# Kconfig - IP stack config

#
# Copyright (c) 2016 Intel Corporation.
#
# SPDX-License-Identifier: Apache-2.0
#

menu "IP stack"

# Hidden option
config NET_RAW_MODE
	bool
	help
	  This is a very specific option used to built only the very minimal
	  part of the net stack in order to get network drivers working without
	  any net stack above: core, L2 etc... Basically this will build only
	  net_pkt part. It is currently used only by IEEE 802.15.4 drivers,
	  though any type of net drivers could use it.

if !NET_RAW_MODE

choice
	prompt "Qemu networking"
	default NET_QEMU_SLIP
	depends on QEMU_TARGET
	help
	  Can be used to select how the network connectivity is established
	  from inside qemu to host system. This can be done either via
	  serial connection (SLIP) or via Qemu ethernet driver.

config NET_QEMU_SLIP
	bool "SLIP"
	help
	  Connect to host or to another Qemu via SLIP.

config NET_QEMU_ETHERNET
	bool "Ethernet"
	help
	  Connect to host system via Qemu ethernet driver support. One such
	  driver that Zephyr supports is Intel e1000 ethernet driver.

endchoice

config NET_INIT_PRIO
	int
	default 90
	help
	  Network initialization priority level. This number tells how
	  early in the boot the network stack is initialized.

source "subsys/net/ip/Kconfig.ipv6"

source "subsys/net/ip/Kconfig.ipv4"

config NET_SHELL
	bool "Enable network shell utilities"
	select SHELL
	help
	  Activate shell module that provides network commands like
	  ping to the console.

config NET_SHELL_DYN_CMD_COMPLETION
	bool "Enable network shell dynamic command completion"
	depends on NET_SHELL
	default y
	help
	  Enable various net-shell command to support dynamic command
	  completion. This means that for example the nbr command can
	  automatically complete the neighboring IPv6 address and user
	  does not need to type it manually.
	  Please note that this uses more memory in order to save the
	  dynamic command strings. For example for nbr command the
	  increase is 320 bytes (8 neighbors * 40 bytes for IPv6 address
	  length) by default. Other dynamic completion commands in
	  net-shell require also some smaller amount of memory.

config NET_TC_TX_COUNT
	int "How many Tx traffic classes to have for each network device"
	default 1
	range 1 8
	help
	  Define how many Tx traffic classes (queues) the system should have
	  when sending a network packet. The network packet priority can then
	  be mapped to this traffic class so that higher prioritized packets
	  can be processed before lower prioritized ones. Each queue is handled
	  by a separate thread which will need RAM for stack space.
	  Only increase the value from 1 if you really need this feature.
	  The default value is 1 which means that all the network traffic is
	  handled equally. In this implementation, the higher traffic class
	  value corresponds to lower thread priority.

config NET_TC_RX_COUNT
	int "How many Rx traffic classes to have for each network device"
	default 1
	range 1 8
	help
	  Define how many Rx traffic classes (queues) the system should have
	  when receiving a network packet. The network packet priority can then
	  be mapped to this traffic class so that higher prioritized packets
	  can be processed before lower prioritized ones. Each queue is handled
	  by a separate thread which will need RAM for stack space.
	  Only increase the value from 1 if you really need this feature.
	  The default value is 1 which means that all the network traffic is
	  handled equally. In this implementation, the higher traffic class
	  value corresponds to lower thread priority.

choice
	prompt "Priority to traffic class mapping"
	help
	  Select mapping to use to map network packet priorities to traffic
	  classes.

config NET_TC_MAPPING_STRICT
	bool "Strict priority mapping"
	help
	  This is the recommended default priority to traffic class mapping.
	  Use it for implementations that do not support the credit-based
	  shaper transmission selection algorithm.
	  See 802.1Q, chapter 8.6.6 for more information.

config NET_TC_MAPPING_SR_CLASS_A_AND_B
	bool "SR class A and class B mapping"
	depends on NET_TC_TX_COUNT >= 2
	depends on NET_TC_RX_COUNT >= 2
	help
	  This is the recommended priority to traffic class mapping for a
	  system that supports SR (Stream Reservation) class A and SR class B.
	  See 802.1Q, chapter 34.5 for more information.

config NET_TC_MAPPING_SR_CLASS_B_ONLY
	bool "SR class B only mapping"
	depends on NET_TC_TX_COUNT >= 2
	depends on NET_TC_RX_COUNT >= 2
	help
	  This is the recommended priority to traffic class mapping for a
	  system that supports SR (Stream Reservation) class B only.
	  See 802.1Q, chapter 34.5 for more information.
endchoice

config NET_TX_DEFAULT_PRIORITY
	int "Default network packet priority if none have been set"
	default 1
	range 0 7
	help
	  What is the default network packet priority if user has not specified
	  one. The value 0 means lowest priority and 7 is the highest.

config NET_IP_ADDR_CHECK
	bool "Check IP address validity before sending IP packet"
	default y
	help
	  Check that either the source or destination address is
	  correct before sending either IPv4 or IPv6 network packet.

config NET_MAX_ROUTERS
	int "How many routers are supported"
	default 2 if NET_IPV4 && NET_IPV6
	default 1 if NET_IPV4 && !NET_IPV6
	default 1 if !NET_IPV4 && NET_IPV6
	range 1 254
	help
	  The value depends on your network needs.

# Normally the route support is enabled by RPL or similar technology
# that needs to use the routing infrastructure.
config NET_ROUTE
	bool
	depends on NET_IPV6_NBR_CACHE
	default y if NET_IPV6_NBR_CACHE

config NET_ROUTING
	bool "IP routing between interfaces"
	depends on NET_ROUTE
	help
	  Allow IPv6 routing between different network interfaces and
	  technologies.

config	NET_MAX_ROUTES
	int "Max number of routing entries stored."
	default NET_IPV6_MAX_NEIGHBORS
	depends on NET_ROUTE
	help
	  This determines how many entries can be stored in routing table.

config	NET_MAX_NEXTHOPS
	int "Max number of next hop entries stored."
	default NET_MAX_ROUTES
	depends on NET_ROUTE
	help
	  This determines how many entries can be stored in nexthop table.

config NET_ROUTE_MCAST
	bool
	depends on NET_ROUTE

config	NET_MAX_MCAST_ROUTES
	int "Max number of multicast routing entries stored."
	default 1
	depends on NET_ROUTE_MCAST
	help
	  This determines how many entries can be stored in multicast
	  routing table.

config NET_TCP
	bool "Enable TCP"
	help
	  The value depends on your network needs.

config NET_TCP_CHECKSUM
	bool "Check TCP checksum"
	default y
	depends on NET_TCP
	help
	  Enables TCP handler to check TCP checksum. If the checksum is invalid,
	  then the packet is discarded.

if NET_TCP
module = NET_TCP
module-dep = NET_LOG
module-str = Log level for TCP
module-help = Enables TCP handler output debug messages
source "subsys/net/Kconfig.template.log_config.net"
endif # NET_TCP

config NET_TCP_BACKLOG_SIZE
	int "Number of simultaneous incoming TCP connections"
	depends on NET_TCP
	default 1
	range 1 128
	help
	  The number of simultaneous TCP connection attempts, i.e. outstanding
	  TCP connections waiting for initial ACK.

config NET_TCP_AUTO_ACCEPT
	bool "Auto accept incoming TCP data"
	default n
	depends on NET_TCP
	help
	  Automatically accept incoming TCP data packet to the valid
	  connection even if the application has not yet called accept().
	  This speeds up incoming data processing and is done like in Linux.
	  Drawback is that we allocate data for the incoming packets even if
	  the application has not yet accepted the connection. If the peer
	  sends lot of packets, we might run out of memory in this case.

config NET_TCP_TIME_WAIT_DELAY
	int "How long to wait in TIME_WAIT state (in milliseconds)"
	depends on NET_TCP
	default 250
	help
	  To avoid a (low-probability) issue when delayed packets from
	  previous connection get delivered to next connection reusing
	  the same local/remote ports, RFC 793 (TCP) suggests to keep
	  an old, closed connection in a special "TIME_WAIT" state for
	  the duration of 2*MSL (Maximum Segment Lifetime). The RFC
	  suggests to use MSL of 2 minutes, but notes "This is an
	  engineering choice, and may be changed if experience indicates
	  it is desirable to do so." For low-resource systems, having
	  large MSL may lead to quick resource exhaustion (and related
	  DoS attacks). At the same time, the issue of packet misdelivery
	  is largely alleviated in the modern TCP stacks by using random,
	  non-repeating port numbers and initial sequence numbers. Due
	  to this, Zephyr uses much lower value of 250ms by default.
	  Value of 0 disables TIME_WAIT state completely.

config NET_TCP_ACK_TIMEOUT
	int "How long to wait for ACK (in milliseconds)"
	depends on NET_TCP
	default 1000
	range 1 2147483647
	help
	  This value affects the timeout when waiting ACK to arrive in
	  various TCP states. The value is in milliseconds. Note that
	  having a very low value here could prevent connectivity.

config NET_TCP_INIT_RETRANSMISSION_TIMEOUT
	int "Initial value of Retransmission Timeout (RTO) (in milliseconds)"
	depends on NET_TCP
	default 200
	range 100 60000
	help
	  This value affects the timeout between initial retransmission
	  of TCP data packets. The value is in milliseconds.

config NET_TCP_RETRY_COUNT
	int "Maximum number of TCP segment retransmissions"
	depends on NET_TCP
	default 9
	help
	  The following formula can be used to determine the time (in ms)
	  that a segment will be be buffered awaiting retransmission:
	  n=NET_TCP_RETRY_COUNT
	  Sum((1<<n) * NET_TCP_INIT_RETRANSMISSION_TIMEOUT)
	  n=0
	  With the default value of 9, the IP stack will try to
	  retransmit for up to 1:42 minutes.  This is as close as possible
	  to the minimum value recommended by RFC1122 (1:40 minutes).
	  Only 5 bits are dedicated for the retransmission count, so accepted
	  values are in the 0-31 range.  It's highly recommended to not go
	  below 9, though.
	  Should a retransmission timeout occur, the receive callback is
	  called with -ECONNRESET error code and the context is dereferenced.

config NET_UDP
	bool "Enable UDP"
	default y
	help
	  The value depends on your network needs.

config NET_UDP_CHECKSUM
	bool "Check UDP checksum"
	default y
	depends on NET_UDP
	help
	  Enables UDP handler to check UDP checksum. If the checksum is invalid,
	  then the packet is discarded.

config NET_UDP_MISSING_CHECKSUM
	bool "Accept missing checksum (IPv4 only)"
	depends on NET_UDP && NET_IPV4
	help
	  RFC 768 states the possibility to have a missing checksum, for
	  debugging purposes for instance. That feature is however valid only
	  for IPv4 and on reception only, since Zephyr will always compute the
	  UDP checksum in transmission path.

if NET_UDP
module = NET_UDP
module-dep = NET_LOG
module-str = Log level for UDP
module-help = Enables UDP handler output debug messages
source "subsys/net/Kconfig.template.log_config.net"
endif # NET_UDP

config NET_MAX_CONN
	int "How many network connections are supported"
	depends on NET_UDP || NET_TCP || NET_SOCKETS_PACKET || NET_SOCKETS_CAN
	default 8 if NET_IPV6 && NET_IPV4
	default 4
	help
	  The value depends on your network needs. The value
	  should include both UDP and TCP connections.

config NET_CONN_CACHE
	bool "Cache network connections"
	depends on NET_UDP || NET_TCP
	help
	  Caching takes slight more memory but will speedup connection
	  handling of UDP and TCP connections.

config NET_MAX_CONTEXTS
	int "Number of network contexts to allocate"
	default 6
	help
	  Each network context is used to describe a network 5-tuple that
	  is used when listening or sending network traffic. This is very
	  similar as one could call a network socket in some other systems.

config NET_CONTEXT_NET_PKT_POOL
	bool "Enable net_buf TX pool / context"
	default y if NET_TCP && NET_6LO
	help
	  If enabled, then it is possible to fine-tune network packet pool
	  for each context when sending network data. If this setting is
	  enabled, then you should define the context pools in your application
	  using NET_PKT_TX_POOL_DEFINE() and NET_PKT_DATA_POOL_DEFINE()
	  macros and tie these pools to desired context using the
	  net_context_setup_pools() function.

config NET_CONTEXT_SYNC_RECV
	bool "Support synchronous functionality in net_context_recv() API"
	default y
	help
	  You can disable sync support to save some memory if you are calling
	  net_context_recv() in async way only when timeout is set to 0.

config NET_CONTEXT_CHECK
	bool "Check options when calling various net_context functions"
	default y
	help
	  If you know that the options passed to net_context...() functions
	  are ok, then you can disable the checks to save some memory.

config NET_CONTEXT_PRIORITY
	bool "Add priority support to net_context"
	help
	  It is possible to prioritize network traffic. This requires
	  also traffic class support to work as expected.

config NET_CONTEXT_TIMESTAMP
	bool "Add timepstamp support to net_context"
	select NET_PKT_TIMESTAMP
	help
	  It is possible to timestamp outgoing packets.

config NET_TEST
	bool "Network Testing"
	help
	  Used for self-contained networking tests that do not require a
	  network device.

config NET_SLIP_TAP
	bool "TAP SLIP driver"
	depends on NET_QEMU_SLIP
	select SLIP
	select UART_PIPE
	select UART_INTERRUPT_DRIVEN
	select SLIP_TAP
	default y if (QEMU_TARGET && !NET_TEST && !NET_L2_BT)
	help
	  SLIP TAP support is necessary when testing with QEMU. The host
	  needs to have tunslip6 with TAP support running in order to
	  communicate via the SLIP driver. See net-tools project at
	  https://github.com/zephyrproject-rtos/net-tools for more details.

config NET_TRICKLE
	bool "Enable Trickle library"
	help
	  Normally this is enabled automatically if needed,
	  so say 'n' if unsure.

if NET_TRICKLE
module = NET_TRICKLE
module-dep = NET_LOG
module-str = Log level for Trickle algorithm
module-help = Enables Trickle library output debug messages
source "subsys/net/Kconfig.template.log_config.net"
endif # NET_TRICKLE

endif # NET_RAW_MODE

config NET_PKT_RX_COUNT
	int "How many packet receives can be pending at the same time"
	default 14 if NET_L2_ETHERNET
	default 4
	help
	  Each RX buffer will occupy smallish amount of memory.
	  See include/net/net_pkt.h and the sizeof(struct net_pkt)

config NET_PKT_TX_COUNT
	int "How many packet sends can be pending at the same time"
	default 14 if NET_L2_ETHERNET
	default 4
	help
	  Each TX buffer will occupy smallish amount of memory.
	  See include/net/net_pkt.h and the sizeof(struct net_pkt)

config NET_BUF_RX_COUNT
	int "How many network buffers are allocated for receiving data"
	default 36 if NET_L2_ETHERNET
	default 16
	help
	  Each data buffer will occupy CONFIG_NET_BUF_DATA_SIZE + smallish
	  header (sizeof(struct net_buf)) amount of data.

config NET_BUF_TX_COUNT
	int "How many network buffers are allocated for sending data"
	default 36 if NET_L2_ETHERNET
	default 16
	help
	  Each data buffer will occupy CONFIG_NET_BUF_DATA_SIZE + smallish
	  header (sizeof(struct net_buf)) amount of data.

choice
	prompt "Network packet data allocator type"
	default NET_BUF_FIXED_DATA_SIZE
	help
	  Select the memory allocator for the network buffers that hold the
	  packet data.

config NET_BUF_FIXED_DATA_SIZE
	bool "Fixed data size buffer"
	help
	  Each buffer comes with a built time configured size. If runtime
	  requested is bigger than that, it will allocate as many net_buf
	  as necessary to reach that request.

config NET_BUF_VARIABLE_DATA_SIZE
	bool "Variable data size buffer [EXPERIMENTAL]"
	help
	  The buffer is dynamically allocated from runtime requested size.

endchoice

config NET_BUF_DATA_SIZE
	int "Size of each network data fragment"
	default 128
	depends on NET_BUF_FIXED_DATA_SIZE
	help
	  This value tells what is the fixed size of each network buffer.

config NET_BUF_DATA_POOL_SIZE
	int "Size of the memory pool where buffers are allocated from"
	default 4096 if NET_L2_ETHERNET
	default 2048
	depends on NET_BUF_VARIABLE_DATA_SIZE
	help
	 This value tell what is the size of the memory pool where each
	 network buffer is allocated from.

config NET_HEADERS_ALWAYS_CONTIGUOUS
	bool
	help
	  This a hidden option, which one should use with a lot of care.
	  NO bug reports will be accepted if that option is enabled!
	  You are warned.
	  If you are 100% sure the headers memory space is always in a
	  contiguous space, this will save stack usage and ROM in net core.
	  This is a possible case when using IPv4 only, with
	  NET_BUF_FIXED_DATA_SIZE enabled and NET_BUF_DATA_SIZE of 128 for
	  instance.

choice
	prompt "Default Network Interface"
	default NET_DEFAULT_IF_FIRST
	help
	  If system has multiple interfaces enabled, then user shall be able
	  to choose default interface. Otherwise first interface will be the
	  default interface.

config NET_DEFAULT_IF_FIRST
	bool "First available interface"

config NET_DEFAULT_IF_ETHERNET
	bool "Ethernet"
	depends on NET_L2_ETHERNET

config NET_DEFAULT_IF_BLUETOOTH
	bool "Bluetooth"
	depends on NET_L2_BT

config NET_DEFAULT_IF_IEEE802154
	bool "IEEE 802.15.4"
	depends on NET_L2_IEEE802154

config NET_DEFAULT_IF_OFFLOAD
	bool "Offloaded interface"
	depends on NET_OFFLOAD

config NET_DEFAULT_IF_DUMMY
	bool "Dummy testing interface"
	depends on NET_L2_DUMMY

config NET_DEFAULT_IF_CANBUS
	bool "Socket CAN interface"
	depends on NET_L2_CANBUS

endchoice

config NET_PKT_TIMESTAMP
	bool "Enable network packet timestamp support"
	help
	  Enable network packet timestamp support. This is needed for
	  example in gPTP which needs to know how long it takes to send
	  a network packet.

config NET_PKT_TIMESTAMP_STACK_SIZE
	int "Timestamp thread stack size"
	default 1024
	depends on NET_PKT_TIMESTAMP
	help
	  Set the timestamp thread stack size in bytes. The timestamp
	  thread waits for timestamped TX frames and calls registered
	  callbacks.

config NET_PROMISCUOUS_MODE
	bool "Enable promiscuous mode support [EXPERIMENTAL]"
	select NET_MGMT
	select NET_MGMT_EVENT
	select NET_L2_ETHERNET_MGMT if NET_L2_ETHERNET
	help
	  Enable promiscuous mode support. This only works if the network
	  device driver supports promiscuous mode. The user application
	  also needs to read the promiscuous mode data.

if NET_PROMISCUOUS_MODE
module = NET_PROMISC
module-dep = NET_LOG
module-str = Log level for promiscuous mode
module-help = Enables promiscuous mode to output debug messages.
source "subsys/net/Kconfig.template.log_config.net"
endif # NET_PROMISCUOUS_MODE

source "subsys/net/ip/Kconfig.stack"

source "subsys/net/ip/Kconfig.mgmt"

source "subsys/net/ip/Kconfig.stats"

config NET_OFFLOAD
	bool "Offload IP stack [EXPERIMENTAL]"
	help
	  Enables TCP/IP stack to be offload to a co-processor.

if NET_OFFLOAD
module = NET_OFFLOAD
module-dep = NET_LOG
module-str = Log level for offload layer
module-help = Enables offload layer to output debug messages.
source "subsys/net/Kconfig.template.log_config.net"
endif # NET_OFFLOAD

source "subsys/net/ip/Kconfig.debug"

endmenu