linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH v6 6/7] iwlwifi: mvm: add vendor commands needed for iwlmei
Date: Mon, 18 Oct 2021 14:19:36 +0300	[thread overview]
Message-ID: <87czo2vauv.fsf@codeaurora.org> (raw)
In-Reply-To: <20210811105541.43426-6-emmanuel.grumbach@intel.com> (Emmanuel Grumbach's message of "Wed, 11 Aug 2021 13:55:40 +0300")

Emmanuel Grumbach <emmanuel.grumbach@intel.com> writes:

> Add the vendor commands that must be used by the network manager
> to allow proper operation of iwlmei.
>
> * Send information on the AP CSME is connected to
> * Notify the userspace when roaming is forbidden
> * Allow the userspace to require ownership
>
> Co-Developed-by: Ayala Beker <ayala.beker@intel.com>
> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

[...]

> --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
> @@ -1952,16 +1952,16 @@ void iwl_mvm_enter_ctkill(struct iwl_mvm *mvm);
>  int iwl_mvm_send_temp_report_ths_cmd(struct iwl_mvm *mvm);
>  int iwl_mvm_ctdp_command(struct iwl_mvm *mvm, u32 op, u32 budget);
>  
> -#ifdef CONFIG_IWLMVM_VENDOR_CMDS
> +#if IS_ENABLED(CONFIG_IWLMEI)
>  
>  /* vendor commands */
>  void iwl_mvm_vendor_cmds_register(struct iwl_mvm *mvm);
>  
> -#else // IWLMVM_VENDOR_CMDS
> +#else // CONFIG_IWLMEI
>  
>  static inline void iwl_mvm_vendor_cmds_register(struct iwl_mvm *mvm) {}
>  
> -#endif // IWLMVM_VENDOR_CMDS
> +#endif // CONFIG_IWLMEI

No C++ style comments, please.

> --- /dev/null
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/vendor-cmd.c
> @@ -0,0 +1,176 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (C) 2012-2014, 2018-2021 Intel Corporation
> + * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
> + * Copyright (C) 2016-2017 Intel Deutschland GmbH
> + */
> +#include "mvm.h"
> +#include <linux/nl80211-vnd-intel.h>
> +
> +static const struct nla_policy
> +iwl_mvm_vendor_attr_policy[NUM_IWL_MVM_VENDOR_ATTR] = {
> +	[IWL_MVM_VENDOR_ATTR_ROAMING_FORBIDDEN] = { .type = NLA_U8 },
> +	[IWL_MVM_VENDOR_ATTR_AUTH_MODE] = { .type = NLA_U32 },
> +	[IWL_MVM_VENDOR_ATTR_CHANNEL_NUM] = { .type = NLA_U8 },
> +	[IWL_MVM_VENDOR_ATTR_SSID] = { .type = NLA_BINARY,
> +				       .len = IEEE80211_MAX_SSID_LEN },
> +	[IWL_MVM_VENDOR_ATTR_BAND] = { .type = NLA_U8 },
> +	[IWL_MVM_VENDOR_ATTR_COLLOC_CHANNEL] = { .type = NLA_U8 },
> +	[IWL_MVM_VENDOR_ATTR_COLLOC_ADDR] = { .type = NLA_BINARY, .len = ETH_ALEN },
> +};
> +
> +__maybe_unused static struct nlattr **
> +iwl_mvm_parse_vendor_data(const void *data, int data_len)
> +{
> +	struct nlattr **tb;
> +	int err;
> +
> +	if (!data)
> +		return ERR_PTR(-EINVAL);
> +
> +	tb = kcalloc(MAX_IWL_MVM_VENDOR_ATTR + 1, sizeof(*tb), GFP_KERNEL);
> +	if (!tb)
> +		return ERR_PTR(-ENOMEM);
> +
> +	err = nla_parse(tb, MAX_IWL_MVM_VENDOR_ATTR, data, data_len,
> +			iwl_mvm_vendor_attr_policy, NULL);
> +	if (err) {
> +		kfree(tb);
> +		return ERR_PTR(err);
> +	}
> +
> +	return tb;
> +}

I was wondering why you had __maybe_unused but when noticed you are not
really using this function anywhere. So why not just remove it?

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

  reply	other threads:[~2021-10-18 11:20 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11 10:55 [PATCH v6 1/7] mei: bus: add client dma interface Emmanuel Grumbach
2021-08-11 10:55 ` [PATCH v6 2/7] iwlwifi: mei: add the driver to allow cooperation with CSME Emmanuel Grumbach
2021-10-18  9:28   ` Kalle Valo
2021-10-18  9:40     ` Emmanuel Grumbach
2021-10-18 11:17       ` Emmanuel Grumbach
2021-10-20  8:21         ` Kalle Valo
2021-10-18 10:56   ` Kalle Valo
2021-10-18 11:03     ` Emmanuel Grumbach
2021-10-20  8:30       ` Kalle Valo
2021-10-20  9:44         ` Emmanuel Grumbach
2021-11-10  9:40           ` Kalle Valo
2021-11-10  9:51             ` Emmanuel Grumbach
2021-11-12  6:21               ` Kalle Valo
2021-10-18 11:06   ` Kalle Valo
2021-10-18 19:17     ` Emmanuel Grumbach
2021-10-20  5:10       ` Emmanuel Grumbach
2021-08-11 10:55 ` [PATCH v6 3/7] iwlwifi: mei: add debugfs hooks Emmanuel Grumbach
2021-08-11 10:55 ` [PATCH v6 4/7] iwlwifi: integrate with iwlmei Emmanuel Grumbach
2021-10-18 11:03   ` Kalle Valo
2021-08-11 10:55 ` [PATCH v6 5/7] nl80211: vendor-cmd: add Intel vendor commands for iwlmei usage Emmanuel Grumbach
2021-10-18 11:16   ` Kalle Valo
2021-10-18 11:34     ` Emmanuel Grumbach
2021-08-11 10:55 ` [PATCH v6 6/7] iwlwifi: mvm: add vendor commands needed for iwlmei Emmanuel Grumbach
2021-10-18 11:19   ` Kalle Valo [this message]
2021-08-11 10:55 ` [PATCH v6 7/7] iwlwifi: mvm: read the rfkill state and feed it to iwlmei Emmanuel Grumbach
2021-10-18 11:20   ` Kalle Valo
2021-10-18 11:23     ` Emmanuel Grumbach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87czo2vauv.fsf@codeaurora.org \
    --to=kvalo@codeaurora.org \
    --cc=emmanuel.grumbach@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).