1 /* 2 * Copyright (c) 2019, The OpenThread Authors. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * 2. Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution. 12 * 3. Neither the name of the copyright holder nor the 13 * names of its contributors may be used to endorse or promote products 14 * derived from this software without specific prior written permission. 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 * POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 /** 30 * @file 31 * This file includes compile-time configurations for the MAC. 32 */ 33 34 #ifndef CONFIG_MAC_H_ 35 #define CONFIG_MAC_H_ 36 37 /** 38 * @addtogroup config-mac 39 * 40 * @brief 41 * This module includes configuration variables for MAC. 42 * 43 * @{ 44 */ 45 46 #include "config/time_sync.h" 47 #include "config/wakeup.h" 48 49 /** 50 * @def OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT 51 * 52 * The maximum number of backoffs the CSMA-CA algorithm will attempt before declaring a channel access failure. 53 * 54 * Equivalent to macMaxCSMABackoffs in IEEE 802.15.4-2006, default value is 4. 55 */ 56 #ifndef OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT 57 #define OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT 4 58 #endif 59 60 /** 61 * @def OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_INDIRECT 62 * 63 * The maximum number of backoffs the CSMA-CA algorithm will attempt before declaring a channel access failure. 64 * 65 * Equivalent to macMaxCSMABackoffs in IEEE 802.15.4-2006, default value is 4. 66 */ 67 #ifndef OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_INDIRECT 68 #define OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_INDIRECT 4 69 #endif 70 71 /** 72 * @def OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_DIRECT 73 * 74 * The default maximum number of retries allowed after a transmission failure for direct transmissions. 75 * 76 * Equivalent to macMaxFrameRetries, default value is 15. 77 */ 78 #ifndef OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_DIRECT 79 #define OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_DIRECT 15 80 #endif 81 82 /** 83 * @def OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_INDIRECT 84 * 85 * The default maximum number of retries allowed after a transmission failure for indirect transmissions. 86 * 87 * Equivalent to macMaxFrameRetries, default value is 0. 88 */ 89 #ifndef OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_INDIRECT 90 #define OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_INDIRECT 0 91 #endif 92 93 /** 94 * @def OPENTHREAD_CONFIG_MAC_ADD_DELAY_ON_NO_ACK_ERROR_BEFORE_RETRY 95 * 96 * Define as 1 to add random backoff delay in between frame transmission retries when the previous attempt resulted in 97 * no-ack error. 98 */ 99 #ifndef OPENTHREAD_CONFIG_MAC_ADD_DELAY_ON_NO_ACK_ERROR_BEFORE_RETRY 100 #define OPENTHREAD_CONFIG_MAC_ADD_DELAY_ON_NO_ACK_ERROR_BEFORE_RETRY 1 101 #endif 102 103 /** 104 * @def OPENTHREAD_CONFIG_MAC_RETX_DELAY_MIN_BACKOFF_EXPONENT 105 * 106 * Specifies the minimum backoff exponent to start with when adding random delay in between frame transmission 107 * retries on no-ack error. It is applicable only when `OPENTHREAD_CONFIG_MAC_ADD_DELAY_ON_NO_ACK_ERROR_BEFORE_RETRY` 108 * is enabled. 109 */ 110 #ifndef OPENTHREAD_CONFIG_MAC_RETX_DELAY_MIN_BACKOFF_EXPONENT 111 #define OPENTHREAD_CONFIG_MAC_RETX_DELAY_MIN_BACKOFF_EXPONENT 0 112 #endif 113 114 /** 115 * @def OPENTHREAD_CONFIG_MAC_RETX_DELAY_MAX_BACKOFF_EXPONENT 116 * 117 * Specifies the maximum backoff exponent when adding random delay in between frame transmission retries on no-ack 118 * error. It is applicable only when `OPENTHREAD_CONFIG_MAC_ADD_DELAY_ON_NO_ACK_ERROR_BEFORE_RETRY` is enabled. 119 */ 120 #ifndef OPENTHREAD_CONFIG_MAC_RETX_DELAY_MAX_BACKOFF_EXPONENT 121 #define OPENTHREAD_CONFIG_MAC_RETX_DELAY_MAX_BACKOFF_EXPONENT 5 122 #endif 123 124 /** 125 * @def OPENTHREAD_CONFIG_MAC_COLLISION_AVOIDANCE_DELAY_ENABLE 126 * 127 * Define as 1 to enable collision avoidance delay feature, which adds a delay wait time after a successful frame tx 128 * to a neighbor which is expected to forward the frame. This delay is applied before the next direct frame tx (towards 129 * any neighbor) on an FTD. 130 * 131 * The delay interval is specified by `OPENTHREAD_CONFIG_MAC_COLLISION_AVOIDANCE_DELAY_INTERVAL` (in milliseconds). 132 */ 133 #ifndef OPENTHREAD_CONFIG_MAC_COLLISION_AVOIDANCE_DELAY_ENABLE 134 #define OPENTHREAD_CONFIG_MAC_COLLISION_AVOIDANCE_DELAY_ENABLE 1 135 #endif 136 137 /** 138 * @def OPENTHREAD_CONFIG_MAC_COLLISION_AVOIDANCE_DELAY_INTERVAL 139 * 140 * Specifies the collision avoidance delay interval in milliseconds. This is added after a successful frame tx to a 141 * neighbor that is expected to forward the frame (when `OPENTHREAD_CONFIG_MAC_COLLISION_AVOIDANCE_DELAY_ENABLE` is 142 * enabled). 143 */ 144 #ifndef OPENTHREAD_CONFIG_MAC_COLLISION_AVOIDANCE_DELAY_INTERVAL 145 #define OPENTHREAD_CONFIG_MAC_COLLISION_AVOIDANCE_DELAY_INTERVAL 8 146 #endif 147 148 /** 149 * @def OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_ENABLE 150 * 151 * Define to 1 to enable MAC retry packets histogram analysis. 152 */ 153 #ifndef OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_ENABLE 154 #define OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_ENABLE 0 155 #endif 156 157 /** 158 * @def OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_MAX_SIZE_COUNT_DIRECT 159 * 160 * The default size of MAC histogram array for success message retry direct transmission. 161 * 162 * Default value is (OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_DIRECT + 1). 163 */ 164 #ifndef OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_MAX_SIZE_COUNT_DIRECT 165 #define OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_MAX_SIZE_COUNT_DIRECT \ 166 (OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_DIRECT + 1) 167 #endif 168 169 /** 170 * @def OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_MAX_SIZE_COUNT_INDIRECT 171 * 172 * The default size of MAC histogram array for success message retry direct transmission. 173 * 174 * Default value is (OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_INDIRECT + 1). 175 */ 176 #ifndef OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_MAX_SIZE_COUNT_INDIRECT 177 #define OPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_MAX_SIZE_COUNT_INDIRECT \ 178 (OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_INDIRECT + 1) 179 #endif 180 181 /** 182 * @def OPENTHREAD_CONFIG_MAC_MAX_TX_ATTEMPTS_INDIRECT_POLLS 183 * 184 * Maximum number of received IEEE 802.15.4 Data Requests for a queued indirect transaction. 185 * 186 * The indirect frame remains in the transaction queue until it is successfully transmitted or until the indirect 187 * transmission fails after the maximum number of IEEE 802.15.4 Data Request messages have been received. 188 * 189 * Takes the place of macTransactionPersistenceTime. The time period is specified in units of IEEE 802.15.4 Data 190 * Request receptions, rather than being governed by macBeaconOrder. 191 * 192 * @sa OPENTHREAD_CONFIG_MAC_DEFAULT_MAX_FRAME_RETRIES_INDIRECT 193 */ 194 #ifndef OPENTHREAD_CONFIG_MAC_MAX_TX_ATTEMPTS_INDIRECT_POLLS 195 #define OPENTHREAD_CONFIG_MAC_MAX_TX_ATTEMPTS_INDIRECT_POLLS 4 196 #endif 197 198 /** 199 * @def OPENTHREAD_CONFIG_MAC_CSL_REQUEST_AHEAD_US 200 * 201 * Define how many microseconds ahead should MAC deliver CSL frame to SubMac. 202 */ 203 #ifndef OPENTHREAD_CONFIG_MAC_CSL_REQUEST_AHEAD_US 204 #define OPENTHREAD_CONFIG_MAC_CSL_REQUEST_AHEAD_US 2000 205 #endif 206 207 /** 208 * @def OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 209 * 210 * Define to 1 to enable MAC filter support. 211 */ 212 #ifndef OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 213 #define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 0 214 #endif 215 216 /** 217 * @def OPENTHREAD_CONFIG_MAC_FILTER_SIZE 218 * 219 * The number of MAC Filter entries. 220 */ 221 #ifndef OPENTHREAD_CONFIG_MAC_FILTER_SIZE 222 #define OPENTHREAD_CONFIG_MAC_FILTER_SIZE 32 223 #endif 224 225 /** 226 * @def OPENTHREAD_CONFIG_MAC_TX_NUM_BCAST 227 * 228 * The number of times each IEEE 802.15.4 broadcast frame is transmitted. 229 * 230 * The minimum value is 1. Values larger than 1 may improve broadcast reliability by increasing redundancy, but may 231 * also increase congestion. 232 */ 233 #ifndef OPENTHREAD_CONFIG_MAC_TX_NUM_BCAST 234 #define OPENTHREAD_CONFIG_MAC_TX_NUM_BCAST 1 235 #endif 236 237 /** 238 * @def OPENTHREAD_CONFIG_MAC_STAY_AWAKE_BETWEEN_FRAGMENTS 239 * 240 * Define as 1 to stay awake between fragments while transmitting a large packet, 241 * and to stay awake after receiving a packet with frame pending set to true. 242 */ 243 #ifndef OPENTHREAD_CONFIG_MAC_STAY_AWAKE_BETWEEN_FRAGMENTS 244 #define OPENTHREAD_CONFIG_MAC_STAY_AWAKE_BETWEEN_FRAGMENTS 0 245 #endif 246 247 /** 248 * @def OPENTHREAD_CONFIG_MAC_JOIN_BEACON_VERSION 249 * 250 * The Beacon version to use when the beacon join flag is set. 251 */ 252 #ifndef OPENTHREAD_CONFIG_MAC_JOIN_BEACON_VERSION 253 #define OPENTHREAD_CONFIG_MAC_JOIN_BEACON_VERSION OPENTHREAD_CONFIG_THREAD_VERSION 254 #endif 255 256 /** 257 * @def OPENTHREAD_CONFIG_MAC_BEACON_RSP_WHEN_JOINABLE_ENABLE 258 * 259 * Define to 1 to enable IEEE 802.15.4 Beacons when joining is enabled. 260 * 261 * @note When this feature is enabled, the device will transmit IEEE 802.15.4 Beacons in response to IEEE 802.15.4 262 * Beacon Requests even while the device is not router capable and detached. 263 */ 264 #ifndef OPENTHREAD_CONFIG_MAC_BEACON_RSP_WHEN_JOINABLE_ENABLE 265 #define OPENTHREAD_CONFIG_MAC_BEACON_RSP_WHEN_JOINABLE_ENABLE 0 266 #endif 267 268 /** 269 * @def OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT 270 * 271 * Define as 1 to support IEEE 802.15.4-2015 Header IE (Information Element) generation and parsing, it must be set 272 * to support following features: 273 * 1. Time synchronization service feature (i.e., OPENTHREAD_CONFIG_TIME_SYNC_ENABLE is set). 274 * 2. Thread 1.2. 275 * 276 * @note If it's enabled, platform must support interrupt context and concurrent access AES. 277 */ 278 #ifndef OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT 279 #if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE || (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) 280 #define OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT 1 281 #else 282 #define OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT 0 283 #endif 284 #endif 285 286 /** 287 * @def OPENTHREAD_CONFIG_MAC_ATTACH_DATA_POLL_PERIOD 288 * 289 * The Data Poll period during attach in milliseconds. 290 */ 291 #ifndef OPENTHREAD_CONFIG_MAC_ATTACH_DATA_POLL_PERIOD 292 #define OPENTHREAD_CONFIG_MAC_ATTACH_DATA_POLL_PERIOD 100 293 #endif 294 295 /** 296 * @def OPENTHREAD_CONFIG_MAC_MINIMUM_POLL_PERIOD 297 * 298 * This setting configures the minimum poll period in milliseconds. 299 */ 300 #ifndef OPENTHREAD_CONFIG_MAC_MINIMUM_POLL_PERIOD 301 #define OPENTHREAD_CONFIG_MAC_MINIMUM_POLL_PERIOD 10 302 #endif 303 304 /** 305 * @def OPENTHREAD_CONFIG_MAC_RETX_POLL_PERIOD 306 * 307 * This setting configures the retx poll period in milliseconds. 308 */ 309 #ifndef OPENTHREAD_CONFIG_MAC_RETX_POLL_PERIOD 310 #define OPENTHREAD_CONFIG_MAC_RETX_POLL_PERIOD 1000 311 #endif 312 313 /** 314 * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE 315 * 316 * Define to 1 to enable software ACK timeout logic. 317 */ 318 #ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE 319 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE 0 320 #endif 321 322 /** 323 * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE 324 * 325 * Define to 1 to enable software retransmission logic. 326 */ 327 #ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE 328 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE 0 329 #endif 330 331 /** 332 * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE 333 * 334 * Define to 1 to enable software CSMA-CA backoff logic. 335 */ 336 #ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE 337 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE 0 338 #endif 339 340 /** 341 * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE 342 * 343 * Define to 1 to enable software transmission security logic. 344 */ 345 #ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE 346 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE 0 347 #endif 348 349 /** 350 * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE 351 * 352 * Define to 1 to enable software transmission target time logic. 353 */ 354 #ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE 355 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE 0 356 #endif 357 358 /** 359 * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_TIMING_ENABLE 360 * 361 * Define to 1 to enable software reception target time logic. 362 */ 363 #ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_TIMING_ENABLE 364 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_TIMING_ENABLE 0 365 #endif 366 367 /** 368 * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_ENERGY_SCAN_ENABLE 369 * 370 * Define to 1 to enable software energy scanning logic. 371 */ 372 #ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_ENERGY_SCAN_ENABLE 373 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_ENERGY_SCAN_ENABLE 0 374 #endif 375 376 /** 377 * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_ON_WHEN_IDLE_ENABLE 378 * 379 * Define to 1 to enable software rx off when idle switching. 380 */ 381 #ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_ON_WHEN_IDLE_ENABLE 382 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_ON_WHEN_IDLE_ENABLE 0 383 #endif 384 385 /** 386 * @def OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE 387 * 388 * Define to 1 to enable csl transmitter logic. 389 */ 390 #ifndef OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE 391 #define OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) 392 #endif 393 394 /** 395 * @def OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 396 * 397 * This setting configures the CSL receiver feature in Thread 1.2. 398 */ 399 #ifndef OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 400 #define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 0 401 #endif 402 403 /** 404 * @def OPENTHREAD_CONFIG_MAC_MULTIPURPOSE_FRAME 405 * 406 * Define to 1 to enable support for IEEE 802.15.4 MAC Multipurpose frame format. 407 */ 408 #ifndef OPENTHREAD_CONFIG_MAC_MULTIPURPOSE_FRAME 409 #define OPENTHREAD_CONFIG_MAC_MULTIPURPOSE_FRAME \ 410 (OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) 411 #endif 412 413 /** 414 * @def OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 415 * 416 * This setting configures CSL auto synchronization based on data poll mechanism in Thread 1.2. 417 */ 418 #ifndef OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 419 #define OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 420 #endif 421 422 /** 423 * @def OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_LOCAL_TIME_SYNC 424 * 425 * This setting configures the usage of local time rather than radio time for calculating the 426 * elapsed time since last CSL synchronization event in order to schedule the duration of the 427 * CSL receive window. 428 * 429 * This is done at expense of too short or too long receive windows depending on the drift 430 * between the two clocks within the CSL timeout period. In order to compensate for a too 431 * short receive window, CSL uncertainty can be increased. 432 * 433 * This setting can be useful for platforms in which is important to reduce the number of 434 * radio API calls, for instance when they are costly. One typical situation is a multicore 435 * chip architecture in which different instances of current time are being kept in host and 436 * radio cores. In this case, accessing the radio core current time API requires serialization 437 * and it is more costly than just accessing local host time. 438 */ 439 #ifndef OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_LOCAL_TIME_SYNC 440 #define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_LOCAL_TIME_SYNC 0 441 #endif 442 443 /** 444 * @def OPENTHREAD_CONFIG_MAC_CSL_MIN_PERIOD 445 * 446 * This setting configures the minimum CSL period that could be used, in units of milliseconds. 447 */ 448 #ifndef OPENTHREAD_CONFIG_MAC_CSL_MIN_PERIOD 449 #define OPENTHREAD_CONFIG_MAC_CSL_MIN_PERIOD 10 450 #endif 451 452 /** 453 * @def OPENTHREAD_CONFIG_MAC_CSL_MAX_TIMEOUT 454 * 455 * This setting configures the maximum CSL timeout that could be used, in units of seconds. 456 */ 457 #ifndef OPENTHREAD_CONFIG_MAC_CSL_MAX_TIMEOUT 458 #define OPENTHREAD_CONFIG_MAC_CSL_MAX_TIMEOUT 10000 459 #endif 460 461 /** 462 * @def OPENTHREAD_CONFIG_CSL_TIMEOUT 463 * 464 * The default CSL timeout in seconds. 465 */ 466 #ifndef OPENTHREAD_CONFIG_CSL_TIMEOUT 467 #define OPENTHREAD_CONFIG_CSL_TIMEOUT 100 468 #endif 469 470 /** 471 * @def OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE 472 * 473 * CSL receiver debug option. When this option is enabled, a CSL receiver wouldn't actually sleep in CSL state so it 474 * can still receive packets from the CSL transmitter. 475 */ 476 #ifndef OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE 477 #define OPENTHREAD_CONFIG_MAC_CSL_DEBUG_ENABLE 0 478 #endif 479 480 /** 481 * @def OPENTHREAD_CONFIG_CSL_TRANSMIT_TIME_AHEAD 482 * 483 * Transmission scheduling and ramp up time needed for the CSL transmitter to be ready, in units of microseconds. 484 * This time must include at least the radio's turnaround time between end of CCA and start of preamble transmission. 485 * To avoid early CSL transmission it also must not be configured higher than the actual scheduling and ramp up time. 486 */ 487 #ifndef OPENTHREAD_CONFIG_CSL_TRANSMIT_TIME_AHEAD 488 #define OPENTHREAD_CONFIG_CSL_TRANSMIT_TIME_AHEAD 40 489 #endif 490 491 /** 492 * @def OPENTHREAD_CONFIG_CSL_RECEIVE_TIME_AHEAD 493 * 494 * Reception scheduling and ramp up time needed for the CSL receiver to be ready, in units of microseconds. 495 */ 496 #ifndef OPENTHREAD_CONFIG_CSL_RECEIVE_TIME_AHEAD 497 #define OPENTHREAD_CONFIG_CSL_RECEIVE_TIME_AHEAD 320 498 #endif 499 500 /** 501 * @def OPENTHREAD_CONFIG_MIN_RECEIVE_ON_AHEAD 502 * 503 * The minimum time (in microseconds) before the MHR start that the radio should be in receive state and ready to 504 * properly receive in order to properly receive any IEEE 802.15.4 frame. Defaults to the duration of SHR + PHR. 505 */ 506 #ifndef OPENTHREAD_CONFIG_MIN_RECEIVE_ON_AHEAD 507 #define OPENTHREAD_CONFIG_MIN_RECEIVE_ON_AHEAD (6 * 32) 508 #endif 509 510 /** 511 * @def OPENTHREAD_CONFIG_MIN_RECEIVE_ON_AFTER 512 * 513 * The minimum time (in microseconds) after the MHR start that the radio should be in receive state in order 514 * to properly receive any IEEE 802.15.4 frame. Defaults to the duration of a maximum size frame, plus AIFS, 515 * plus the duration of maximum enh-ack frame. Platforms are encouraged to improve this value for energy 516 * efficiency purposes. 517 */ 518 #ifndef OPENTHREAD_CONFIG_MIN_RECEIVE_ON_AFTER 519 #define OPENTHREAD_CONFIG_MIN_RECEIVE_ON_AFTER ((127 + 6 + 39) * 32) 520 #endif 521 522 /** 523 * @def OPENTHREAD_CONFIG_MAC_SCAN_DURATION 524 * 525 * This setting configures the default scan duration in milliseconds. 526 */ 527 #ifndef OPENTHREAD_CONFIG_MAC_SCAN_DURATION 528 #define OPENTHREAD_CONFIG_MAC_SCAN_DURATION 300 529 #endif 530 531 /** 532 * @def OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE 533 * 534 * This setting configures if the beacon payload parsing needs to be enabled in MAC. This is optional and is disabled by 535 * default because Thread 1.2.1 has removed support for beacon payloads. 536 */ 537 #ifndef OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE 538 #define OPENTHREAD_CONFIG_MAC_BEACON_PAYLOAD_PARSING_ENABLE 0 539 #endif 540 541 /** 542 * @def OPENTHREAD_CONFIG_MAC_OUTGOING_BEACON_PAYLOAD_ENABLE 543 * 544 * This setting configures if the beacon payload needs to be enabled in outgoing beacon frames. This is optional and is 545 * disabled by default because Thread 1.2.1 has removed support for beacon payloads. 546 */ 547 #ifndef OPENTHREAD_CONFIG_MAC_OUTGOING_BEACON_PAYLOAD_ENABLE 548 #define OPENTHREAD_CONFIG_MAC_OUTGOING_BEACON_PAYLOAD_ENABLE 0 549 #endif 550 551 /** 552 * @def OPENTHREAD_CONFIG_MAC_DATA_POLL_TIMEOUT 553 * 554 * This setting specifies the timeout for receiving the Data Frame (in msec) - after an ACK with FP bit set was 555 * received. 556 */ 557 #ifndef OPENTHREAD_CONFIG_MAC_DATA_POLL_TIMEOUT 558 #define OPENTHREAD_CONFIG_MAC_DATA_POLL_TIMEOUT 100 559 #endif 560 561 /** 562 * @} 563 */ 564 565 #endif // CONFIG_MAC_H_ 566