1#
2# Copyright (c) 2020 Siddharth Chandrasekaran <siddharth@embedjournal.com>
3#
4# SPDX-License-Identifier: Apache-2.0
5#
6
7menuconfig OSDP
8	bool "Open Supervised Device Protocol (OSDP) driver"
9	select RING_BUFFER
10	imply SERIAL_SUPPORT_INTERRUPT
11	imply UART_INTERRUPT_DRIVEN
12	imply UART_USE_RUNTIME_CONFIGURE
13	select CRC
14	help
15	  Add support for Open Supervised Device Protocol (OSDP)
16
17if OSDP
18
19choice
20	prompt "OSDP Mode of Operation"
21	config OSDP_MODE_PD
22		bool "Configure OSDP in Peripheral Device mode"
23		help
24		  Configure this device to operate as a PD (Peripheral Device)
25	config OSDP_MODE_CP
26		bool "Configure OSDP in Control Panel mode"
27		help
28		  Configure this device to operate as a CP (Control Panel)
29endchoice
30
31config OSDP_UART_BAUD_RATE
32	int "OSDP UART baud rate"
33	default 115200
34	help
35	  OSDP defines that baud rate can be either 9600 or 38400 or
36	  115200.
37
38config OSDP_LOG_LEVEL
39	int "OSDP Logging Level"
40	default 1
41	help
42	  Set the logging level for the OSDP driver
43
44config OSDP_UART_BUFFER_LENGTH
45	int "OSDP UART buffer length"
46	default 256
47	help
48	  OSDP RX and TX buffer FIFO length.
49
50config OSDP_THREAD_STACK_SIZE
51	int "OSDP Thread stack size"
52	default 1024
53	help
54	  Thread stack size for osdp refresh thread
55
56config OSDP_PACKET_TRACE
57	bool "Print bytes sent/received over OSDP to console"
58	help
59	  Prints bytes sent/received over OSDP to console for debugging.
60	  LOG_HEXDUMP_DBG() is used to achieve this and can be very verbose.
61
62config OSDP_SKIP_MARK_BYTE
63	bool "Skip sending the initial marking byte (0xFF)"
64	help
65	  As per the OSDP specification, the first byte in the channel has
66	  to be a MARK byte which is 0xFF. Since this is not stated in the
67	  packet structure definition, some commercial CPs and PDs do not
68	  handle the initial mark byte correctly. This option can be used to
69	  completely disable sending/expecting a mark byte to work with
70	  such non-conforming devices.
71
72config OSDP_SC_ENABLED
73	bool "OSDP Secure Channel"
74	depends on CSPRNG_ENABLED
75	default y
76	select CRYPTO
77	select CRYPTO_MBEDTLS_SHIM
78	select MBEDTLS
79	select MBEDTLS_CIPHER_AES_ENABLED
80	select MBEDTLS_CIPHER_CCM_ENABLED
81	help
82	  Secure the OSDP communication channel with encryption and mutual
83	  authentication.
84
85if OSDP_SC_ENABLED
86
87config OSDP_SC_RETRY_WAIT_SEC
88	int "Retry wait time in seconds after a Secure Channel error"
89	default 600
90	help
91	  Time in seconds to wait after a secure channel failure, and before
92	  retrying to establish it.
93
94config OSDP_CRYPTO_DRV_NAME
95	string "Crypto driver to use with OSDP"
96	default "CRYPTO_MTLS"
97	help
98	  OSDP Secure Channel uses AES-128 to secure communication between
99	  CP and PD. Provide an available crypto driver name here.
100
101endif # OSDP_SC_ENABLED
102
103if OSDP_MODE_PD
104source "subsys/mgmt/osdp/Kconfig.pd"
105endif
106
107if OSDP_MODE_CP
108source "subsys/mgmt/osdp/Kconfig.cp"
109endif
110
111endif # OSDP
112