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