1# Copyright (c) 2020 Intel Corporation
2# SPDX-License-Identifier: Apache-2.0
3
4config GSM_MUX
5	bool "GSM 07.10 muxing protocol"
6	select CRC
7	help
8	  Enable GSM 07.10 muxing protocol defined in
9	  https://www.etsi.org/deliver/etsi_ts/101300_101399/101369/07.01.00_60/ts_101369v070100p.pdf
10	  The muxing protocol allows GSM modem to share the same UART for both
11	  the PPP data and AT commands.
12
13config GSM_MUX_MAX
14	int "Max number of GSM mux instances"
15	default 1
16	depends on GSM_MUX
17	help
18	  Usually we only need one GSM mux instance. You need to increase
19	  this if you have more than one GSM modems.
20
21config GSM_MUX_DLCI_MAX
22	int "Max number of GSM data link connection (DLC) instances"
23	default 3
24	range 1 64
25	depends on GSM_MUX
26	help
27	  For our purposes we will manage with 3 DLCI (control, ppp, and AT
28	  commands) so making it the default value. If GSM modem also provides
29	  GNSS (location) services and you want to create a DLCI for it, then
30	  you need to increase this to 4.
31
32config GSM_MUX_DLCI_AT
33	int "DLCI id of the AT commands channel"
34	default 2 if MODEM_GSM_SIMCOM
35	default 1
36	range 1 63
37	depends on GSM_MUX
38	help
39	  Channel number for the AT commands to the modem.
40
41config GSM_MUX_DLCI_PPP
42	int "DLCI id of the PPP connection channel"
43	default 1 if MODEM_GSM_SIMCOM
44	default 2
45	range 1 63
46	depends on GSM_MUX
47	help
48	  Channel number for the PPP connection to the modem.
49	  SIMCOM modem has 16kb buffer for DLCI 1 so the manual recommends
50	  it for PPP traffic. For other DLCIs in that modem, the buffer size
51	  is only 1kb.
52
53config GSM_MUX_PENDING_CMD_MAX
54	int "Max number of pending GSM mux commands"
55	default 2
56	range 1 8
57	depends on GSM_MUX
58	help
59	  How many pending GSM mux commands can exists.
60
61config GSM_MUX_MRU_DEFAULT_LEN
62	int "Default size of received user data (MRU)"
63	default 127 if MODEM_GSM_SIMCOM
64	default 127 if MODEM_GSM_QUECTEL
65	default 31
66	range 1 1509
67	depends on GSM_MUX
68	help
69	  Default MRU (Maximum Receive Unit) data size. The default
70	  value for Basic mode is 31 bytes. The 1509 limit comes from
71	  ublox-sara modem and it means we can transfer full Ethernet sized
72	  frame and muxing headers.
73
74config GSM_MUX_MRU_MAX_LEN
75	int "Max size of received user data (MRU)"
76	default 255 if MODEM_GSM_SIMCOM
77	default 128
78	range 1 1509
79	depends on GSM_MUX
80	help
81	  Max MRU (Maximum Receive Unit) data size. The default max
82	  value for Basic mode is 128 bytes.
83
84config GSM_MUX_INITIATOR
85	bool "Are we the initiator of the connection"
86	default y
87	depends on GSM_MUX
88	help
89	  Default value when deciding whether we are the initiator of the
90	  connection attempt. Normally this should be enabled.
91
92config GSM_MUX_T1_TIMEOUT
93	int "T1 timeout in ms"
94	default 0
95	range 0 5000
96	depends on GSM_MUX
97	help
98	  T1 timeout is initial command timeout when establishing
99	  the connection. The value is in milliseconds. Zero value
100	  means that default (100 ms) specified in the code is used.
101
102if GSM_MUX
103
104module = GSM_MUX
105module-dep = LOG
106module-str = Log level for GSM 07.10 Mux driver
107module-help = Sets log level for GSM 07.10 Mux Device Driver.
108source "subsys/net/Kconfig.template.log_config.net"
109
110config GSM_MUX_VERBOSE_DEBUG
111	bool "Print hexdump of sent and received packets"
112	depends on GSM_MUX_LOG_LEVEL_DBG
113	help
114	  As there might be lot of debug output printed, only enable
115	  this if really needed.
116
117endif
118