tdls.h 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. /******************************************************************************
  2. *
  3. * This file is provided under a dual BSD/GPLv2 license. When using or
  4. * redistributing this file, you may do so under either license.
  5. *
  6. * GPL LICENSE SUMMARY
  7. *
  8. * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  9. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
  10. * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of version 2 of the GNU General Public License as
  14. * published by the Free Software Foundation.
  15. *
  16. * This program is distributed in the hope that it will be useful, but
  17. * WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  19. * General Public License for more details.
  20. *
  21. * The full GNU General Public License is included in this distribution
  22. * in the file called COPYING.
  23. *
  24. * Contact Information:
  25. * Intel Linux Wireless <linuxwifi@intel.com>
  26. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  27. *
  28. * BSD LICENSE
  29. *
  30. * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  31. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
  32. * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
  33. * All rights reserved.
  34. *
  35. * Redistribution and use in source and binary forms, with or without
  36. * modification, are permitted provided that the following conditions
  37. * are met:
  38. *
  39. * * Redistributions of source code must retain the above copyright
  40. * notice, this list of conditions and the following disclaimer.
  41. * * Redistributions in binary form must reproduce the above copyright
  42. * notice, this list of conditions and the following disclaimer in
  43. * the documentation and/or other materials provided with the
  44. * distribution.
  45. * * Neither the name Intel Corporation nor the names of its
  46. * contributors may be used to endorse or promote products derived
  47. * from this software without specific prior written permission.
  48. *
  49. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  50. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  51. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  52. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  53. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  54. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  55. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  56. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  57. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  58. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  59. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  60. *
  61. *****************************************************************************/
  62. #ifndef __iwl_fw_api_tdls_h__
  63. #define __iwl_fw_api_tdls_h__
  64. #include "fw/api/tx.h"
  65. #include "fw/api/phy-ctxt.h"
  66. #define IWL_MVM_TDLS_STA_COUNT 4
  67. /* Type of TDLS request */
  68. enum iwl_tdls_channel_switch_type {
  69. TDLS_SEND_CHAN_SW_REQ = 0,
  70. TDLS_SEND_CHAN_SW_RESP_AND_MOVE_CH,
  71. TDLS_MOVE_CH,
  72. }; /* TDLS_STA_CHANNEL_SWITCH_CMD_TYPE_API_E_VER_1 */
  73. /**
  74. * struct iwl_tdls_channel_switch_timing - Switch timing in TDLS channel-switch
  75. * @frame_timestamp: GP2 timestamp of channel-switch request/response packet
  76. * received from peer
  77. * @max_offchan_duration: What amount of microseconds out of a DTIM is given
  78. * to the TDLS off-channel communication. For instance if the DTIM is
  79. * 200TU and the TDLS peer is to be given 25% of the time, the value
  80. * given will be 50TU, or 50 * 1024 if translated into microseconds.
  81. * @switch_time: switch time the peer sent in its channel switch timing IE
  82. * @switch_timeout: switch timeout the peer sent in its channel switch timing IE
  83. */
  84. struct iwl_tdls_channel_switch_timing {
  85. __le32 frame_timestamp; /* GP2 time of peer packet Rx */
  86. __le32 max_offchan_duration; /* given in micro-seconds */
  87. __le32 switch_time; /* given in micro-seconds */
  88. __le32 switch_timeout; /* given in micro-seconds */
  89. } __packed; /* TDLS_STA_CHANNEL_SWITCH_TIMING_DATA_API_S_VER_1 */
  90. #define IWL_TDLS_CH_SW_FRAME_MAX_SIZE 200
  91. /**
  92. * struct iwl_tdls_channel_switch_frame - TDLS channel switch frame template
  93. *
  94. * A template representing a TDLS channel-switch request or response frame
  95. *
  96. * @switch_time_offset: offset to the channel switch timing IE in the template
  97. * @tx_cmd: Tx parameters for the frame
  98. * @data: frame data
  99. */
  100. struct iwl_tdls_channel_switch_frame {
  101. __le32 switch_time_offset;
  102. struct iwl_tx_cmd tx_cmd;
  103. u8 data[IWL_TDLS_CH_SW_FRAME_MAX_SIZE];
  104. } __packed; /* TDLS_STA_CHANNEL_SWITCH_FRAME_API_S_VER_1 */
  105. /**
  106. * struct iwl_tdls_channel_switch_cmd - TDLS channel switch command
  107. *
  108. * The command is sent to initiate a channel switch and also in response to
  109. * incoming TDLS channel-switch request/response packets from remote peers.
  110. *
  111. * @switch_type: see &enum iwl_tdls_channel_switch_type
  112. * @peer_sta_id: station id of TDLS peer
  113. * @ci: channel we switch to
  114. * @timing: timing related data for command
  115. * @frame: channel-switch request/response template, depending to switch_type
  116. */
  117. struct iwl_tdls_channel_switch_cmd {
  118. u8 switch_type;
  119. __le32 peer_sta_id;
  120. struct iwl_fw_channel_info ci;
  121. struct iwl_tdls_channel_switch_timing timing;
  122. struct iwl_tdls_channel_switch_frame frame;
  123. } __packed; /* TDLS_STA_CHANNEL_SWITCH_CMD_API_S_VER_1 */
  124. /**
  125. * struct iwl_tdls_channel_switch_notif - TDLS channel switch start notification
  126. *
  127. * @status: non-zero on success
  128. * @offchannel_duration: duration given in microseconds
  129. * @sta_id: peer currently performing the channel-switch with
  130. */
  131. struct iwl_tdls_channel_switch_notif {
  132. __le32 status;
  133. __le32 offchannel_duration;
  134. __le32 sta_id;
  135. } __packed; /* TDLS_STA_CHANNEL_SWITCH_NTFY_API_S_VER_1 */
  136. /**
  137. * struct iwl_tdls_sta_info - TDLS station info
  138. *
  139. * @sta_id: station id of the TDLS peer
  140. * @tx_to_peer_tid: TID reserved vs. the peer for FW based Tx
  141. * @tx_to_peer_ssn: initial SSN the FW should use for Tx on its TID vs the peer
  142. * @is_initiator: 1 if the peer is the TDLS link initiator, 0 otherwise
  143. */
  144. struct iwl_tdls_sta_info {
  145. u8 sta_id;
  146. u8 tx_to_peer_tid;
  147. __le16 tx_to_peer_ssn;
  148. __le32 is_initiator;
  149. } __packed; /* TDLS_STA_INFO_VER_1 */
  150. /**
  151. * struct iwl_tdls_config_cmd - TDLS basic config command
  152. *
  153. * @id_and_color: MAC id and color being configured
  154. * @tdls_peer_count: amount of currently connected TDLS peers
  155. * @tx_to_ap_tid: TID reverved vs. the AP for FW based Tx
  156. * @tx_to_ap_ssn: initial SSN the FW should use for Tx on its TID vs. the AP
  157. * @sta_info: per-station info. Only the first tdls_peer_count entries are set
  158. * @pti_req_data_offset: offset of network-level data for the PTI template
  159. * @pti_req_tx_cmd: Tx parameters for PTI request template
  160. * @pti_req_template: PTI request template data
  161. */
  162. struct iwl_tdls_config_cmd {
  163. __le32 id_and_color; /* mac id and color */
  164. u8 tdls_peer_count;
  165. u8 tx_to_ap_tid;
  166. __le16 tx_to_ap_ssn;
  167. struct iwl_tdls_sta_info sta_info[IWL_MVM_TDLS_STA_COUNT];
  168. __le32 pti_req_data_offset;
  169. struct iwl_tx_cmd pti_req_tx_cmd;
  170. u8 pti_req_template[0];
  171. } __packed; /* TDLS_CONFIG_CMD_API_S_VER_1 */
  172. /**
  173. * struct iwl_tdls_config_sta_info_res - TDLS per-station config information
  174. *
  175. * @sta_id: station id of the TDLS peer
  176. * @tx_to_peer_last_seq: last sequence number used by FW during FW-based Tx to
  177. * the peer
  178. */
  179. struct iwl_tdls_config_sta_info_res {
  180. __le16 sta_id;
  181. __le16 tx_to_peer_last_seq;
  182. } __packed; /* TDLS_STA_INFO_RSP_VER_1 */
  183. /**
  184. * struct iwl_tdls_config_res - TDLS config information from FW
  185. *
  186. * @tx_to_ap_last_seq: last sequence number used by FW during FW-based Tx to AP
  187. * @sta_info: per-station TDLS config information
  188. */
  189. struct iwl_tdls_config_res {
  190. __le32 tx_to_ap_last_seq;
  191. struct iwl_tdls_config_sta_info_res sta_info[IWL_MVM_TDLS_STA_COUNT];
  192. } __packed; /* TDLS_CONFIG_RSP_API_S_VER_1 */
  193. #endif /* __iwl_fw_api_tdls_h__ */