1menu "Example Configuration"
2
3    config SNIFFER_GPIO_RANGE_MIN
4        int
5        default 0
6
7    config SNIFFER_GPIO_RANGE_MAX
8        int
9        default 33 if IDF_TARGET_ESP32
10        default 46 if IDF_TARGET_ESP32S2
11        default 19 if IDF_TARGET_ESP32C3
12        default 48 if IDF_TARGET_ESP32S3
13
14    config SNIFFER_STORE_HISTORY
15        bool "Store command history into flash"
16        default y
17        help
18            Linenoise line editing library provides functions to save and load command history.
19            If this option is enabled, initalizes a FAT filesystem and uses it to store command history.
20
21    choice SNIFFER_PCAP_DESTINATION
22        prompt "Select destination to store pcap file"
23        default SNIFFER_PCAP_DESTINATION_SD
24        help
25            Select where to store the pcap file.
26            Currently support storing files to SD card or to host via JTAG interface with 'Trace memory' enabled.
27        config SNIFFER_PCAP_DESTINATION_SD
28            bool "SD Card"
29            help
30                Store pcap file to SD card.
31        config SNIFFER_PCAP_DESTINATION_JTAG
32            bool "JTAG (App Trace)"
33            depends on APPTRACE_DEST_TRAX
34            help
35                Store pcap file to host via JTAG interface.
36        config SNIFFER_PCAP_DESTINATION_MEMORY
37            bool "Memory"
38            help
39                Store pcap file to memory.
40    endchoice
41
42    if SNIFFER_PCAP_DESTINATION_SD
43        choice SNIFFER_SD_MODE
44            prompt "Select SD card work mode"
45            default SNIFFER_SD_SDMMC_MODE
46            help
47                Select whitch peripheral SD card should use.
48            config SNIFFER_SD_SDMMC_MODE
49                bool "SDMMC"
50                depends on IDF_TARGET_ESP32 || IDF_TARGET_ESP32S3
51                help
52                    Use SDMMC mode (Not support on esp32c3).
53            config SNIFFER_SD_SPI_MODE
54                bool "SPI"
55                help
56                    Use SPI mode.
57        endchoice
58        config SNIFFER_MOUNT_POINT
59            string "SD card mount point in the filesystem"
60            default "/sdcard"
61            help
62                Specify the mount point in the VFS (Virtual File System) for SD card.
63
64        config SNIFFER_PCAP_FILE_NAME_MAX_LEN
65            int "Max name length of pcap file"
66            default 32
67            help
68                Specify maximum name length of pcap file.
69    endif
70
71    if SNIFFER_PCAP_DESTINATION_MEMORY
72        config SNIFFER_PCAP_MEMORY_SIZE
73            int "Memory size of the '.pcap' file in memory"
74            default 4096
75            help
76                Max memory size to storage packet in memory.
77    endif
78
79    config SNIFFER_WORK_QUEUE_LEN
80        int "Length of sniffer work queue"
81        default 128
82        help
83            The sniffer callback function should not do heavy work, so we put all heavy IO operation to another task.
84            The task gets some basic info of sniffer packet via queue.
85            Here you should specify the length of queue.
86
87    config SNIFFER_TASK_STACK_SIZE
88        int "Stack size of sniffer task"
89        default 4096
90        help
91            Stack size of sniffer task.
92
93    config SNIFFER_TASK_PRIORITY
94        int "Priority of sniffer task"
95        default 2
96        help
97            Priority of sniffer task.
98
99    config SNIFFER_USE_SPI_ETHERNET
100        bool
101
102    choice SNIFFER_ETHERNET_TYPE
103        prompt "Ethernet Type"
104        default SNIFFER_NO_ETHERNET
105        help
106            Select which kind of Ethernet will be used in the example.
107
108        config SNIFFER_NO_ETHERNET
109            bool "No Ethernet"
110            help
111                No Ethernet.
112
113        config SNIFFER_USE_INTERNAL_ETHERNET
114            depends on IDF_TARGET_ESP32
115            select ETH_USE_ESP32_EMAC
116            bool "Internal EMAC"
117            help
118                Select internal Ethernet MAC controller.
119
120        config SNIFFER_USE_DM9051
121            bool "DM9051 Module"
122            select SNIFFER_USE_SPI_ETHERNET
123            select ETH_USE_SPI_ETHERNET
124            select ETH_SPI_ETHERNET_DM9051
125            help
126                Select external SPI-Ethernet module (DM9051).
127
128        config SNIFFER_USE_W5500
129            bool "W5500 Module"
130            select SNIFFER_USE_SPI_ETHERNET
131            select ETH_USE_SPI_ETHERNET
132            select ETH_SPI_ETHERNET_W5500
133            help
134                Select external SPI-Ethernet module (W5500).
135
136        config SNIFFER_USE_KSZ8851SNL
137            bool "KSZ8851SNL Module"
138            select SNIFFER_USE_SPI_ETHERNET
139            select ETH_USE_SPI_ETHERNET
140            select ETH_SPI_ETHERNET_KSZ8851SNL
141            help
142                Select external SPI-Ethernet module (KSZ8851SNL).
143    endchoice # SNIFFER_ETHERNET_TYPE
144
145    if SNIFFER_USE_INTERNAL_ETHERNET
146        choice SNIFFER_ETH_PHY_MODEL
147            prompt "Ethernet PHY Device"
148            default SNIFFER_ETH_PHY_IP101
149            help
150                Select the Ethernet PHY device to use in the example.
151
152            config SNIFFER_ETH_PHY_IP101
153                bool "IP101"
154                help
155                    IP101 is a single port 10/100 MII/RMII/TP/Fiber Fast Ethernet Transceiver.
156                    Goto http://www.icplus.com.tw/pp-IP101G.html for more information about it.
157
158            config SNIFFER_ETH_PHY_RTL8201
159                bool "RTL8201/SR8201"
160                help
161                    RTL8201F/SR8201F is a single port 10/100Mb Ethernet Transceiver with auto MDIX.
162                    Goto http://www.corechip-sz.com/productsview.asp?id=22 for more information about it.
163
164            config SNIFFER_ETH_PHY_LAN87XX
165                bool "LAN87xx"
166                help
167                    Below chips are supported:
168                    LAN8710A is a small footprint MII/RMII 10/100 Ethernet Transceiver with HP Auto-MDIX and
169                        flexPWR® Technology.
170                    LAN8720A is a small footprint RMII 10/100 Ethernet Transceiver with HP Auto-MDIX Support.
171                    LAN8740A/LAN8741A is a small footprint MII/RMII 10/100 Energy Efficient Ethernet Transceiver
172                        with HP Auto-MDIX and flexPWR® Technology.
173                    LAN8742A is a small footprint RMII 10/100 Ethernet Transceiver with HP Auto-MDIX and
174                        flexPWR® Technology.
175                    Goto https://www.microchip.com for more information about them.
176
177            config SNIFFER_ETH_PHY_DP83848
178                bool "DP83848"
179                help
180                    DP83848 is a single port 10/100Mb/s Ethernet Physical Layer Transceiver.
181                    Goto http://www.ti.com/product/DP83848J for more information about it.
182
183            config SNIFFER_ETH_PHY_KSZ8041
184                bool "KSZ8041"
185                help
186                    The KSZ8041 is a single supply 10Base-T/100Base-TX Physical Layer Transceiver.
187                    Goto https://www.microchip.com/wwwproducts/en/KSZ8041 for more information about it.
188
189            config SNIFFER_ETH_PHY_KSZ8081
190                bool "KSZ8081"
191                help
192                    The KSZ8081 is a single supply 10Base-T/100Base-TX Physical Layer Transceiver.
193                    Goto https://www.microchip.com/wwwproducts/en/KSZ8081 for more information about it.
194        endchoice # SNIFFER_ETH_PHY_MODEL
195
196        config SNIFFER_ETH_MDC_GPIO
197            int "SMI MDC GPIO number"
198            range SNIFFER_GPIO_RANGE_MIN SNIFFER_GPIO_RANGE_MAX
199            default 23
200            help
201                Set the GPIO number used by SMI MDC.
202
203        config SNIFFER_ETH_MDIO_GPIO
204            int "SMI MDIO GPIO number"
205            range SNIFFER_GPIO_RANGE_MIN SNIFFER_GPIO_RANGE_MAX
206            default 18
207            help
208                Set the GPIO number used by SMI MDIO.
209    endif # SNIFFER_USE_INTERNAL_ETHERNET
210
211    if SNIFFER_USE_SPI_ETHERNET
212        config SNIFFER_ETH_SPI_HOST
213            int "SPI Host Number"
214            range 0 2
215            default 1
216            help
217                Set the SPI host used to communicate with the SPI Ethernet Controller.
218
219        config SNIFFER_ETH_SPI_SCLK_GPIO
220            int "SPI SCLK GPIO number"
221            range SNIFFER_GPIO_RANGE_MIN SNIFFER_GPIO_RANGE_MAX
222            default 14 if IDF_TARGET_ESP32
223            default 12 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
224            default 6 if IDF_TARGET_ESP32C3
225            help
226                Set the GPIO number used by SPI SCLK.
227
228        config SNIFFER_ETH_SPI_MOSI_GPIO
229            int "SPI MOSI GPIO number"
230            range SNIFFER_GPIO_RANGE_MIN SNIFFER_GPIO_RANGE_MAX
231            default 13 if IDF_TARGET_ESP32
232            default 11 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
233            default 7 if IDF_TARGET_ESP32C3
234            help
235                Set the GPIO number used by SPI MOSI.
236
237        config SNIFFER_ETH_SPI_MISO_GPIO
238            int "SPI MISO GPIO number"
239            range SNIFFER_GPIO_RANGE_MIN SNIFFER_GPIO_RANGE_MAX
240            default 12 if IDF_TARGET_ESP32
241            default 13 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
242            default 2 if IDF_TARGET_ESP32C3
243            help
244                Set the GPIO number used by SPI MISO.
245
246        config SNIFFER_ETH_SPI_CS_GPIO
247            int "SPI CS GPIO number"
248            range SNIFFER_GPIO_RANGE_MIN SNIFFER_GPIO_RANGE_MAX
249            default 15 if IDF_TARGET_ESP32
250            default 10 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3
251            help
252                Set the GPIO number used by SPI CS.
253
254        config SNIFFER_ETH_SPI_CLOCK_MHZ
255            int "SPI clock speed (MHz)"
256            range 5 80
257            default 12 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32C3
258            default 36 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
259            help
260                Set the clock speed (MHz) of SPI interface.
261
262        config SNIFFER_ETH_SPI_INT_GPIO
263            int "Interrupt GPIO number"
264            range SNIFFER_GPIO_RANGE_MIN SNIFFER_GPIO_RANGE_MAX
265            default 4 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3
266            help
267                Set the GPIO number used by the SPI Ethernet module interrupt line.
268    endif # SNIFFER_USE_SPI_ETHERNET
269
270    if !SNIFFER_NO_ETHERNET
271        config SNIFFER_ETH_PHY_RST_GPIO
272            int "PHY Reset GPIO number"
273            range -1 SNIFFER_GPIO_RANGE_MAX
274            default 5
275            help
276                Set the GPIO number used to reset PHY chip.
277                Set to -1 to disable PHY chip hardware reset.
278
279        config SNIFFER_ETH_PHY_ADDR
280            int "PHY Address"
281            range 0 31
282            default 1
283            help
284                Set PHY address according your board schematic.
285    endif # !SNIFFER_NO_ETHERNET
286endmenu
287