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_CCM_ENABLED
80	help
81	  Secure the OSDP communication channel with encryption and mutual
82	  authentication.
83
84if OSDP_SC_ENABLED
85
86config OSDP_SC_RETRY_WAIT_SEC
87	int "Retry wait time in seconds after a Secure Channel error"
88	default 600
89	help
90	  Time in seconds to wait after a secure channel failure, and before
91	  retrying to establish it.
92
93config OSDP_CRYPTO_DRV_NAME
94	string "Crypto driver to use with OSDP"
95	default "CRYPTO_MTLS"
96	help
97	  OSDP Secure Channel uses AES-128 to secure communication between
98	  CP and PD. Provide an available crypto driver name here.
99
100endif # OSDP_SC_ENABLED
101
102if OSDP_MODE_PD
103source "subsys/mgmt/osdp/Kconfig.pd"
104endif
105
106if OSDP_MODE_CP
107source "subsys/mgmt/osdp/Kconfig.cp"
108endif
109
110endif # OSDP
111