Path: blob/main/sys/contrib/dev/iwlwifi/mld/hcmd.h
48285 views
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */1/*2* Copyright (C) 2024-2025 Intel Corporation3*/4#ifndef __iwl_mld_hcmd_h__5#define __iwl_mld_hcmd_h__67static inline int iwl_mld_send_cmd(struct iwl_mld *mld, struct iwl_host_cmd *cmd)8{9/* No commands, including the d3 related commands, should be sent10* after entering d311*/12#ifdef CONFIG_PM_SLEEP13if (WARN_ON(mld->fw_status.in_d3))14return -EIO;15#endif1617if (!(cmd->flags & CMD_ASYNC))18lockdep_assert_wiphy(mld->wiphy);1920/* Devices that need to shutdown immediately on rfkill are not21* supported, so we can send all the cmds in rfkill22*/23cmd->flags |= CMD_SEND_IN_RFKILL;2425return iwl_trans_send_cmd(mld->trans, cmd);26}2728static inline int29__iwl_mld_send_cmd_with_flags_pdu(struct iwl_mld *mld, u32 id,30u32 flags, const void *data, u16 len)31{32struct iwl_host_cmd cmd = {33.id = id,34.len = { data ? len : 0, },35.data = { data, },36.flags = flags,37};3839return iwl_mld_send_cmd(mld, &cmd);40}4142#define _iwl_mld_send_cmd_with_flags_pdu(mld, id, flags, data, len, \43ignored...) \44__iwl_mld_send_cmd_with_flags_pdu(mld, id, flags, data, len)45#define iwl_mld_send_cmd_with_flags_pdu(mld, id, flags, data, len...) \46_iwl_mld_send_cmd_with_flags_pdu(mld, id, flags, data, ##len, \47sizeof(*(data)))4849#define iwl_mld_send_cmd_pdu(mld, id, ...) \50iwl_mld_send_cmd_with_flags_pdu(mld, id, 0, __VA_ARGS__)5152#define iwl_mld_send_cmd_empty(mld, id) \53iwl_mld_send_cmd_with_flags_pdu(mld, id, 0, NULL, 0)5455#endif /* __iwl_mld_hcmd_h__ */565758