*/
CANCEL_CHANNEL_SWITCH_CMD = 0x6,
/**
- * @MAC_CONFIG_CMD: &struct iwl_mac_config_cmd
+ * @MAC_CONFIG_CMD: &struct iwl_mac_config_cmd_v3 or
+ * &struct iwl_mac_config_cmd
*/
MAC_CONFIG_CMD = 0x8,
/**
} __packed;
/**
- * struct iwl_mac_config_cmd - command structure to configure MAC contexts in
+ * struct iwl_mac_config_cmd_v3 - command structure to configure MAC contexts in
* MLD API for versions 2 and 3
* ( MAC_CONTEXT_CONFIG_CMD = 0x8 )
*
* @client: client mac data
* @p2p_dev: mac data for p2p device
*/
-struct iwl_mac_config_cmd {
+struct iwl_mac_config_cmd_v3 {
__le32 id_and_color;
__le32 action;
/* MAC_CONTEXT_TYPE_API_E */
struct iwl_mac_client_data client;
struct iwl_mac_p2p_dev_data p2p_dev;
};
-} __packed; /* MAC_CONTEXT_CONFIG_CMD_API_S_VER_2_VER_3 */
+} __packed; /* MAC_CONTEXT_CONFIG_CMD_API_S_VER_2, _VER_3 */
+
+/**
+ * struct iwl_mac_nan_data - NAN specific MAC data
+ * @ndi_addrs: extra NDI addresses being used
+ * @ndi_addrs_count: number of extra NDI addresses
+ */
+struct iwl_mac_nan_data {
+ struct {
+ u8 addr[ETH_ALEN];
+ __le16 reserved;
+ } __packed ndi_addrs[2];
+ __le32 ndi_addrs_count;
+} __packed; /* MAC_CONTEXT_CONFIG_NAN_DATA_API_S_VER_1 */
+
+/**
+ * struct iwl_mac_config_cmd - command structure to configure MAC contexts in
+ * MLD API for versions 4
+ * ( MAC_CONTEXT_CONFIG_CMD = 0x8 )
+ *
+ * @id_and_color: ID and color of the MAC
+ * @action: action to perform, see &enum iwl_ctxt_action
+ * @mac_type: one of &enum iwl_mac_types
+ * @local_mld_addr: mld address
+ * @reserved_for_local_mld_addr: reserved
+ * @filter_flags: combination of &enum iwl_mac_config_filter_flags
+ * @wifi_gen_v2: he/eht parameters as in cmd version 2
+ * @wifi_gen: he/eht/uhr parameters as in cmd version 3
+ * @nic_not_ack_enabled: mark that the NIC doesn't support receiving
+ * ACK-enabled AGG, (i.e. both BACK and non-BACK frames in single AGG).
+ * If the NIC is not ACK_ENABLED it may use the EOF-bit in first non-0
+ * len delim to determine if AGG or single.
+ * @client: client mac data
+ * @p2p_dev: mac data for p2p device
+ * @nan: NAN specific data (NAN data interface addresses)
+ */
+struct iwl_mac_config_cmd {
+ __le32 id_and_color;
+ __le32 action;
+ /* MAC_CONTEXT_TYPE_API_E */
+ __le32 mac_type;
+ u8 local_mld_addr[6];
+ __le16 reserved_for_local_mld_addr;
+ __le32 filter_flags;
+ union {
+ struct iwl_mac_wifi_gen_support_v2 wifi_gen_v2;
+ struct iwl_mac_wifi_gen_support wifi_gen;
+ };
+ __le32 nic_not_ack_enabled;
+ /* MAC_CONTEXT_CONFIG_SPECIFIC_DATA_API_U_VER_3 */
+ union {
+ struct iwl_mac_client_data client;
+ struct iwl_mac_p2p_dev_data p2p_dev;
+ struct iwl_mac_nan_data nan;
+ };
+} __packed; /* MAC_CONTEXT_CONFIG_CMD_API_S_VER_4 */
/**
* enum iwl_link_ctx_modify_flags - indicate to the fw what fields are being
* @FW_MAC_TYPE_P2P_DEVICE: P2P Device
* @FW_MAC_TYPE_P2P_STA: P2P client
* @FW_MAC_TYPE_GO: P2P GO
- * @FW_MAC_TYPE_TEST: ?
- * @FW_MAC_TYPE_MAX: highest support MAC type
+ * @FW_MAC_TYPE_NAN: NAN (since version 4)
*/
enum iwl_mac_types {
FW_MAC_TYPE_FIRST = 1,
FW_MAC_TYPE_P2P_DEVICE,
FW_MAC_TYPE_P2P_STA,
FW_MAC_TYPE_GO,
- FW_MAC_TYPE_TEST,
- FW_MAC_TYPE_MAX = FW_MAC_TYPE_TEST
+ FW_MAC_TYPE_NAN,
}; /* MAC_CONTEXT_TYPE_API_E_VER_1 */
/**
static int iwl_mld_send_mac_cmd(struct iwl_mld *mld,
struct iwl_mac_config_cmd *cmd)
{
+ u16 cmd_id = WIDE_ID(MAC_CONF_GROUP, MAC_CONFIG_CMD);
+ int len = sizeof(*cmd);
int ret;
lockdep_assert_wiphy(mld->wiphy);
- ret = iwl_mld_send_cmd_pdu(mld,
- WIDE_ID(MAC_CONF_GROUP, MAC_CONFIG_CMD),
- cmd);
+ if (iwl_fw_lookup_cmd_ver(mld->fw, cmd_id, 0) < 4) {
+ if (WARN_ON(cmd->mac_type == cpu_to_le32(FW_MAC_TYPE_NAN)))
+ return -EINVAL;
+
+ len = sizeof(struct iwl_mac_config_cmd_v3);
+ }
+
+ ret = iwl_mld_send_cmd_pdu(mld, cmd_id, cmd, len);
if (ret)
IWL_ERR(mld, "Failed to send MAC_CONFIG_CMD ret = %d\n", ret);
static void iwl_mvm_mld_set_he_support(struct iwl_mvm *mvm,
struct ieee80211_vif *vif,
- struct iwl_mac_config_cmd *cmd,
+ struct iwl_mac_config_cmd_v3 *cmd,
int cmd_ver)
{
if (vif->type == NL80211_IFTYPE_AP) {
static void iwl_mvm_mld_mac_ctxt_cmd_common(struct iwl_mvm *mvm,
struct ieee80211_vif *vif,
- struct iwl_mac_config_cmd *cmd,
+ struct iwl_mac_config_cmd_v3 *cmd,
u32 action)
{
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
}
static int iwl_mvm_mld_mac_ctxt_send_cmd(struct iwl_mvm *mvm,
- struct iwl_mac_config_cmd *cmd)
+ struct iwl_mac_config_cmd_v3 *cmd)
{
int ret = iwl_mvm_send_cmd_pdu(mvm,
WIDE_ID(MAC_CONF_GROUP, MAC_CONFIG_CMD),
struct ieee80211_vif *vif,
u32 action, bool force_assoc_off)
{
- struct iwl_mac_config_cmd cmd = {};
+ struct iwl_mac_config_cmd_v3 cmd = {};
WARN_ON(vif->type != NL80211_IFTYPE_STATION);
struct ieee80211_vif *vif,
u32 action)
{
- struct iwl_mac_config_cmd cmd = {};
+ struct iwl_mac_config_cmd_v3 cmd = {};
WARN_ON(vif->type != NL80211_IFTYPE_MONITOR);
struct ieee80211_vif *vif,
u32 action)
{
- struct iwl_mac_config_cmd cmd = {};
+ struct iwl_mac_config_cmd_v3 cmd = {};
WARN_ON(vif->type != NL80211_IFTYPE_ADHOC);
struct ieee80211_vif *vif,
u32 action)
{
- struct iwl_mac_config_cmd cmd = {};
+ struct iwl_mac_config_cmd_v3 cmd = {};
WARN_ON(vif->type != NL80211_IFTYPE_P2P_DEVICE);
u32 action)
{
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
- struct iwl_mac_config_cmd cmd = {};
+ struct iwl_mac_config_cmd_v3 cmd = {};
WARN_ON(vif->type != NL80211_IFTYPE_AP);
int iwl_mvm_mld_mac_ctxt_remove(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
{
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
- struct iwl_mac_config_cmd cmd = {
+ struct iwl_mac_config_cmd_v3 cmd = {
.action = cpu_to_le32(FW_CTXT_ACTION_REMOVE),
.id_and_color = cpu_to_le32(mvmvif->id),
};