| .. | .. |
|---|
| 8 | 8 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
|---|
| 9 | 9 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH |
|---|
| 10 | 10 | * Copyright(c) 2015 - 2017 Intel Deutschland GmbH |
|---|
| 11 | + * Copyright (C) 2018 - 2020 Intel Corporation |
|---|
| 11 | 12 | * |
|---|
| 12 | 13 | * This program is free software; you can redistribute it and/or modify |
|---|
| 13 | 14 | * it under the terms of version 2 of the GNU General Public License as |
|---|
| .. | .. |
|---|
| 30 | 31 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
|---|
| 31 | 32 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH |
|---|
| 32 | 33 | * Copyright(c) 2015 - 2017 Intel Deutschland GmbH |
|---|
| 34 | + * Copyright (C) 2018 - 2020 Intel Corporation |
|---|
| 33 | 35 | * All rights reserved. |
|---|
| 34 | 36 | * |
|---|
| 35 | 37 | * Redistribution and use in source and binary forms, with or without |
|---|
| .. | .. |
|---|
| 198 | 200 | * @DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK: |
|---|
| 199 | 201 | * '1' Allow to save power by turning off |
|---|
| 200 | 202 | * receiver and transmitter. '0' - does not allow. |
|---|
| 203 | + * @DEVICE_POWER_FLAGS_ALLOW_MEM_RETENTION_MSK: |
|---|
| 204 | + * Device Retention indication, '1' indicate retention is enabled. |
|---|
| 205 | + * @DEVICE_POWER_FLAGS_32K_CLK_VALID_MSK: |
|---|
| 206 | + * 32Khz external slow clock valid indication, '1' indicate cloack is |
|---|
| 207 | + * valid. |
|---|
| 201 | 208 | */ |
|---|
| 202 | 209 | enum iwl_device_power_flags { |
|---|
| 203 | | - DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK = BIT(0), |
|---|
| 210 | + DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK = BIT(0), |
|---|
| 211 | + DEVICE_POWER_FLAGS_ALLOW_MEM_RETENTION_MSK = BIT(1), |
|---|
| 212 | + DEVICE_POWER_FLAGS_32K_CLK_VALID_MSK = BIT(12), |
|---|
| 204 | 213 | }; |
|---|
| 205 | 214 | |
|---|
| 206 | 215 | /** |
|---|
| .. | .. |
|---|
| 316 | 325 | IWL_TX_POWER_MODE_SET_DEVICE = 1, |
|---|
| 317 | 326 | IWL_TX_POWER_MODE_SET_CHAINS = 2, |
|---|
| 318 | 327 | IWL_TX_POWER_MODE_SET_ACK = 3, |
|---|
| 319 | | -}; /* TX_POWER_REDUCED_FLAGS_TYPE_API_E_VER_4 */; |
|---|
| 328 | + IWL_TX_POWER_MODE_SET_SAR_TIMER = 4, |
|---|
| 329 | + IWL_TX_POWER_MODE_SET_SAR_TIMER_DEFAULT_TABLE = 5, |
|---|
| 330 | +}; /* TX_POWER_REDUCED_FLAGS_TYPE_API_E_VER_5 */; |
|---|
| 320 | 331 | |
|---|
| 332 | +#define IWL_NUM_CHAIN_TABLES 1 |
|---|
| 333 | +#define IWL_NUM_CHAIN_TABLES_V2 2 |
|---|
| 321 | 334 | #define IWL_NUM_CHAIN_LIMITS 2 |
|---|
| 322 | 335 | #define IWL_NUM_SUB_BANDS 5 |
|---|
| 336 | +#define IWL_NUM_SUB_BANDS_V2 11 |
|---|
| 323 | 337 | |
|---|
| 324 | 338 | /** |
|---|
| 325 | | - * struct iwl_dev_tx_power_cmd - TX power reduction command |
|---|
| 339 | + * struct iwl_dev_tx_power_common - Common part of the TX power reduction cmd |
|---|
| 326 | 340 | * @set_mode: see &enum iwl_dev_tx_power_cmd_mode |
|---|
| 327 | 341 | * @mac_context_id: id of the mac ctx for which we are reducing TX power. |
|---|
| 328 | 342 | * @pwr_restriction: TX power restriction in 1/8 dBms. |
|---|
| 329 | 343 | * @dev_24: device TX power restriction in 1/8 dBms |
|---|
| 330 | 344 | * @dev_52_low: device TX power restriction upper band - low |
|---|
| 331 | 345 | * @dev_52_high: device TX power restriction upper band - high |
|---|
| 332 | | - * @per_chain_restriction: per chain restrictions |
|---|
| 333 | 346 | */ |
|---|
| 334 | | -struct iwl_dev_tx_power_cmd_v3 { |
|---|
| 347 | +struct iwl_dev_tx_power_common { |
|---|
| 335 | 348 | __le32 set_mode; |
|---|
| 336 | 349 | __le32 mac_context_id; |
|---|
| 337 | 350 | __le16 pwr_restriction; |
|---|
| 338 | 351 | __le16 dev_24; |
|---|
| 339 | 352 | __le16 dev_52_low; |
|---|
| 340 | 353 | __le16 dev_52_high; |
|---|
| 341 | | - __le16 per_chain_restriction[IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS]; |
|---|
| 354 | +}; |
|---|
| 355 | + |
|---|
| 356 | +/** |
|---|
| 357 | + * struct iwl_dev_tx_power_cmd_v3 - TX power reduction command version 3 |
|---|
| 358 | + * @per_chain: per chain restrictions |
|---|
| 359 | + */ |
|---|
| 360 | +struct iwl_dev_tx_power_cmd_v3 { |
|---|
| 361 | + __le16 per_chain[IWL_NUM_CHAIN_TABLES][IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS]; |
|---|
| 342 | 362 | } __packed; /* TX_REDUCED_POWER_API_S_VER_3 */ |
|---|
| 343 | 363 | |
|---|
| 344 | 364 | #define IWL_DEV_MAX_TX_POWER 0x7FFF |
|---|
| 345 | 365 | |
|---|
| 346 | 366 | /** |
|---|
| 347 | | - * struct iwl_dev_tx_power_cmd - TX power reduction command |
|---|
| 348 | | - * @v3: version 3 of the command, embedded here for easier software handling |
|---|
| 367 | + * struct iwl_dev_tx_power_cmd_v4 - TX power reduction command version 4 |
|---|
| 368 | + * @per_chain: per chain restrictions |
|---|
| 349 | 369 | * @enable_ack_reduction: enable or disable close range ack TX power |
|---|
| 350 | 370 | * reduction. |
|---|
| 351 | 371 | * @reserved: reserved (padding) |
|---|
| 352 | 372 | */ |
|---|
| 353 | | -struct iwl_dev_tx_power_cmd { |
|---|
| 354 | | - /* v4 is just an extension of v3 - keep this here */ |
|---|
| 355 | | - struct iwl_dev_tx_power_cmd_v3 v3; |
|---|
| 373 | +struct iwl_dev_tx_power_cmd_v4 { |
|---|
| 374 | + __le16 per_chain[IWL_NUM_CHAIN_TABLES][IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS]; |
|---|
| 356 | 375 | u8 enable_ack_reduction; |
|---|
| 357 | 376 | u8 reserved[3]; |
|---|
| 358 | 377 | } __packed; /* TX_REDUCED_POWER_API_S_VER_4 */ |
|---|
| 359 | 378 | |
|---|
| 379 | +/** |
|---|
| 380 | + * struct iwl_dev_tx_power_cmd_v5 - TX power reduction command version 5 |
|---|
| 381 | + * @per_chain: per chain restrictions |
|---|
| 382 | + * @enable_ack_reduction: enable or disable close range ack TX power |
|---|
| 383 | + * reduction. |
|---|
| 384 | + * @per_chain_restriction_changed: is per_chain_restriction has changed |
|---|
| 385 | + * from last command. used if set_mode is |
|---|
| 386 | + * IWL_TX_POWER_MODE_SET_SAR_TIMER. |
|---|
| 387 | + * note: if not changed, the command is used for keep alive only. |
|---|
| 388 | + * @reserved: reserved (padding) |
|---|
| 389 | + * @timer_period: timer in milliseconds. if expires FW will change to default |
|---|
| 390 | + * BIOS values. relevant if setMode is IWL_TX_POWER_MODE_SET_SAR_TIMER |
|---|
| 391 | + */ |
|---|
| 392 | +struct iwl_dev_tx_power_cmd_v5 { |
|---|
| 393 | + __le16 per_chain[IWL_NUM_CHAIN_TABLES][IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS]; |
|---|
| 394 | + u8 enable_ack_reduction; |
|---|
| 395 | + u8 per_chain_restriction_changed; |
|---|
| 396 | + u8 reserved[2]; |
|---|
| 397 | + __le32 timer_period; |
|---|
| 398 | +} __packed; /* TX_REDUCED_POWER_API_S_VER_5 */ |
|---|
| 399 | + |
|---|
| 400 | +/** |
|---|
| 401 | + * struct iwl_dev_tx_power_cmd_v5 - TX power reduction command version 5 |
|---|
| 402 | + * @per_chain: per chain restrictions |
|---|
| 403 | + * @enable_ack_reduction: enable or disable close range ack TX power |
|---|
| 404 | + * reduction. |
|---|
| 405 | + * @per_chain_restriction_changed: is per_chain_restriction has changed |
|---|
| 406 | + * from last command. used if set_mode is |
|---|
| 407 | + * IWL_TX_POWER_MODE_SET_SAR_TIMER. |
|---|
| 408 | + * note: if not changed, the command is used for keep alive only. |
|---|
| 409 | + * @reserved: reserved (padding) |
|---|
| 410 | + * @timer_period: timer in milliseconds. if expires FW will change to default |
|---|
| 411 | + * BIOS values. relevant if setMode is IWL_TX_POWER_MODE_SET_SAR_TIMER |
|---|
| 412 | + */ |
|---|
| 413 | +struct iwl_dev_tx_power_cmd_v6 { |
|---|
| 414 | + __le16 per_chain[IWL_NUM_CHAIN_TABLES_V2][IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V2]; |
|---|
| 415 | + u8 enable_ack_reduction; |
|---|
| 416 | + u8 per_chain_restriction_changed; |
|---|
| 417 | + u8 reserved[2]; |
|---|
| 418 | + __le32 timer_period; |
|---|
| 419 | +} __packed; /* TX_REDUCED_POWER_API_S_VER_6 */ |
|---|
| 420 | + |
|---|
| 421 | +/** |
|---|
| 422 | + * struct iwl_dev_tx_power_cmd - TX power reduction command (multiversion) |
|---|
| 423 | + * @common: common part of the command |
|---|
| 424 | + * @v3: version 3 part of the command |
|---|
| 425 | + * @v4: version 4 part of the command |
|---|
| 426 | + * @v5: version 5 part of the command |
|---|
| 427 | + * @v6: version 6 part of the command |
|---|
| 428 | + */ |
|---|
| 429 | +struct iwl_dev_tx_power_cmd { |
|---|
| 430 | + struct iwl_dev_tx_power_common common; |
|---|
| 431 | + union { |
|---|
| 432 | + struct iwl_dev_tx_power_cmd_v3 v3; |
|---|
| 433 | + struct iwl_dev_tx_power_cmd_v4 v4; |
|---|
| 434 | + struct iwl_dev_tx_power_cmd_v5 v5; |
|---|
| 435 | + struct iwl_dev_tx_power_cmd_v6 v6; |
|---|
| 436 | + }; |
|---|
| 437 | +}; |
|---|
| 438 | + |
|---|
| 360 | 439 | #define IWL_NUM_GEO_PROFILES 3 |
|---|
| 440 | +#define IWL_NUM_BANDS_PER_CHAIN_V1 2 |
|---|
| 441 | +#define IWL_NUM_BANDS_PER_CHAIN_V2 3 |
|---|
| 361 | 442 | |
|---|
| 362 | 443 | /** |
|---|
| 363 | 444 | * enum iwl_geo_per_chain_offset_operation - type of operation |
|---|
| .. | .. |
|---|
| 381 | 462 | u8 chain_b; |
|---|
| 382 | 463 | } __packed; /* PER_CHAIN_LIMIT_OFFSET_PER_CHAIN_S_VER_1 */ |
|---|
| 383 | 464 | |
|---|
| 384 | | -struct iwl_per_chain_offset_group { |
|---|
| 385 | | - struct iwl_per_chain_offset lb; |
|---|
| 386 | | - struct iwl_per_chain_offset hb; |
|---|
| 387 | | -} __packed; /* PER_CHAIN_LIMIT_OFFSET_GROUP_S_VER_1 */ |
|---|
| 388 | | - |
|---|
| 389 | 465 | /** |
|---|
| 390 | | - * struct iwl_geo_tx_power_profile_cmd - struct for GEO_TX_POWER_LIMIT cmd. |
|---|
| 466 | + * struct iwl_geo_tx_power_profile_cmd_v1 - struct for GEO_TX_POWER_LIMIT cmd. |
|---|
| 391 | 467 | * @ops: operations, value from &enum iwl_geo_per_chain_offset_operation |
|---|
| 392 | 468 | * @table: offset profile per band. |
|---|
| 393 | 469 | */ |
|---|
| 394 | | -struct iwl_geo_tx_power_profiles_cmd { |
|---|
| 470 | +struct iwl_geo_tx_power_profiles_cmd_v1 { |
|---|
| 395 | 471 | __le32 ops; |
|---|
| 396 | | - struct iwl_per_chain_offset_group table[IWL_NUM_GEO_PROFILES]; |
|---|
| 397 | | -} __packed; /* GEO_TX_POWER_LIMIT */ |
|---|
| 472 | + struct iwl_per_chain_offset table[IWL_NUM_GEO_PROFILES][IWL_NUM_BANDS_PER_CHAIN_V1]; |
|---|
| 473 | +} __packed; /* GEO_TX_POWER_LIMIT_VER_1 */ |
|---|
| 474 | + |
|---|
| 475 | +/** |
|---|
| 476 | + * struct iwl_geo_tx_power_profile_cmd_v2 - struct for GEO_TX_POWER_LIMIT cmd. |
|---|
| 477 | + * @ops: operations, value from &enum iwl_geo_per_chain_offset_operation |
|---|
| 478 | + * @table: offset profile per band. |
|---|
| 479 | + * @table_revision: BIOS table revision. |
|---|
| 480 | + */ |
|---|
| 481 | +struct iwl_geo_tx_power_profiles_cmd_v2 { |
|---|
| 482 | + __le32 ops; |
|---|
| 483 | + struct iwl_per_chain_offset table[IWL_NUM_GEO_PROFILES][IWL_NUM_BANDS_PER_CHAIN_V1]; |
|---|
| 484 | + __le32 table_revision; |
|---|
| 485 | +} __packed; /* GEO_TX_POWER_LIMIT_VER_2 */ |
|---|
| 486 | + |
|---|
| 487 | +/** |
|---|
| 488 | + * struct iwl_geo_tx_power_profile_cmd_v3 - struct for GEO_TX_POWER_LIMIT cmd. |
|---|
| 489 | + * @ops: operations, value from &enum iwl_geo_per_chain_offset_operation |
|---|
| 490 | + * @table: offset profile per band. |
|---|
| 491 | + * @table_revision: BIOS table revision. |
|---|
| 492 | + */ |
|---|
| 493 | +struct iwl_geo_tx_power_profiles_cmd_v3 { |
|---|
| 494 | + __le32 ops; |
|---|
| 495 | + struct iwl_per_chain_offset table[IWL_NUM_GEO_PROFILES][IWL_NUM_BANDS_PER_CHAIN_V2]; |
|---|
| 496 | + __le32 table_revision; |
|---|
| 497 | +} __packed; /* GEO_TX_POWER_LIMIT_VER_3 */ |
|---|
| 498 | + |
|---|
| 499 | +union iwl_geo_tx_power_profiles_cmd { |
|---|
| 500 | + struct iwl_geo_tx_power_profiles_cmd_v1 v1; |
|---|
| 501 | + struct iwl_geo_tx_power_profiles_cmd_v2 v2; |
|---|
| 502 | + struct iwl_geo_tx_power_profiles_cmd_v3 v3; |
|---|
| 503 | +}; |
|---|
| 398 | 504 | |
|---|
| 399 | 505 | /** |
|---|
| 400 | 506 | * struct iwl_geo_tx_power_profiles_resp - response to GEO_TX_POWER_LIMIT cmd |
|---|
| .. | .. |
|---|
| 403 | 509 | struct iwl_geo_tx_power_profiles_resp { |
|---|
| 404 | 510 | __le32 profile_idx; |
|---|
| 405 | 511 | } __packed; /* GEO_TX_POWER_LIMIT_RESP */ |
|---|
| 512 | + |
|---|
| 513 | +/** |
|---|
| 514 | + * union iwl_ppag_table_cmd - union for all versions of PPAG command |
|---|
| 515 | + * @v1: version 1, table revision = 0 |
|---|
| 516 | + * @v2: version 2, table revision = 1 |
|---|
| 517 | + * |
|---|
| 518 | + * @enabled: 1 if PPAG is enabled, 0 otherwise |
|---|
| 519 | + * @gain: table of antenna gain values per chain and sub-band |
|---|
| 520 | + * @reserved: reserved |
|---|
| 521 | + */ |
|---|
| 522 | +union iwl_ppag_table_cmd { |
|---|
| 523 | + struct { |
|---|
| 524 | + __le32 enabled; |
|---|
| 525 | + s8 gain[IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS]; |
|---|
| 526 | + s8 reserved[2]; |
|---|
| 527 | + } v1; |
|---|
| 528 | + struct { |
|---|
| 529 | + __le32 enabled; |
|---|
| 530 | + s8 gain[IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V2]; |
|---|
| 531 | + s8 reserved[2]; |
|---|
| 532 | + } v2; |
|---|
| 533 | +} __packed; |
|---|
| 406 | 534 | |
|---|
| 407 | 535 | /** |
|---|
| 408 | 536 | * struct iwl_beacon_filter_cmd |
|---|
| .. | .. |
|---|
| 444 | 572 | * @ba_escape_timer: Fully receive and parse beacon if no beacons were passed |
|---|
| 445 | 573 | * for a longer period of time then this escape-timeout. Units: Beacons. |
|---|
| 446 | 574 | * @ba_enable_beacon_abort: 1, beacon abort is enabled; 0, disabled. |
|---|
| 575 | + * @bf_threshold_absolute_low: See below. |
|---|
| 576 | + * @bf_threshold_absolute_high: Send Beacon to driver if Energy value calculated |
|---|
| 577 | + * for this beacon crossed this absolute threshold. For the 'Increase' |
|---|
| 578 | + * direction the bf_energy_absolute_low[i] is used. For the 'Decrease' |
|---|
| 579 | + * direction the bf_energy_absolute_high[i] is used. Zero value means |
|---|
| 580 | + * that this specific threshold is ignored for beacon filtering, and |
|---|
| 581 | + * beacon will not be forced to be sent to driver due to this setting. |
|---|
| 447 | 582 | */ |
|---|
| 448 | 583 | struct iwl_beacon_filter_cmd { |
|---|
| 449 | 584 | __le32 bf_energy_delta; |
|---|
| .. | .. |
|---|
| 457 | 592 | __le32 bf_escape_timer; |
|---|
| 458 | 593 | __le32 ba_escape_timer; |
|---|
| 459 | 594 | __le32 ba_enable_beacon_abort; |
|---|
| 460 | | -} __packed; |
|---|
| 595 | + __le32 bf_threshold_absolute_low[2]; |
|---|
| 596 | + __le32 bf_threshold_absolute_high[2]; |
|---|
| 597 | +} __packed; /* BEACON_FILTER_CONFIG_API_S_VER_4 */ |
|---|
| 461 | 598 | |
|---|
| 462 | 599 | /* Beacon filtering and beacon abort */ |
|---|
| 463 | 600 | #define IWL_BF_ENERGY_DELTA_DEFAULT 5 |
|---|