All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Kazior <michal.kazior@tieto.com>
To: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: "ath10k@lists.infradead.org" <ath10k@lists.infradead.org>,
	linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH v3 2/7] ath10k: add ATH10K_FW_IE_WMI_OP_VERSION
Date: Tue, 2 Dec 2014 13:16:33 +0100	[thread overview]
Message-ID: <CA+BoTQkXnHnMsLvRt2PnnDCAv8P8gDsJTLNFPmf+CNaDX0frfg@mail.gmail.com> (raw)
In-Reply-To: <20141201144507.18248.9856.stgit@potku.adurom.net>

On 1 December 2014 at 15:45, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
[...]
> @@ -801,11 +812,24 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
>         }
>
>         if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) {
> -               ar->max_num_peers = TARGET_10X_NUM_PEERS;
> -               ar->max_num_stations = TARGET_10X_NUM_STATIONS;
> +               if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, ar->fw_features))
> +                       ar->wmi.op_version = ATH10K_FW_WMI_OP_VERSION_10_2;
> +               else
> +                       ar->wmi.op_version = ATH10K_FW_WMI_OP_VERSION_10_1;
>         } else {
> +               ar->wmi.op_version = ATH10K_FW_WMI_OP_VERSION_MAIN;
> +       }

You always overwrite ar->wmi.op_version with MAIN if it's not 10.x
which means TLV is/wiil be effectively overwritten.

Perhaps the op_version enum values should start with 1 so that 0 can
be used as "unset" and only in that case should the above fallback be
attempted.


Also, I think it might be a good idea to reset ar->wmi.op_version in
ath10k_core_fetch_firmware_api_n (and api_1 as well) so that if any
attempt fails (e.g. due to IE binary corruption) ar->wmi.op_version
isn't propagated/left unchanged to another fw API attempt.


Michał

WARNING: multiple messages have this Message-ID (diff)
From: Michal Kazior <michal.kazior@tieto.com>
To: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	"ath10k@lists.infradead.org" <ath10k@lists.infradead.org>
Subject: Re: [PATCH v3 2/7] ath10k: add ATH10K_FW_IE_WMI_OP_VERSION
Date: Tue, 2 Dec 2014 13:16:33 +0100	[thread overview]
Message-ID: <CA+BoTQkXnHnMsLvRt2PnnDCAv8P8gDsJTLNFPmf+CNaDX0frfg@mail.gmail.com> (raw)
In-Reply-To: <20141201144507.18248.9856.stgit@potku.adurom.net>

On 1 December 2014 at 15:45, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
[...]
> @@ -801,11 +812,24 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
>         }
>
>         if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) {
> -               ar->max_num_peers = TARGET_10X_NUM_PEERS;
> -               ar->max_num_stations = TARGET_10X_NUM_STATIONS;
> +               if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, ar->fw_features))
> +                       ar->wmi.op_version = ATH10K_FW_WMI_OP_VERSION_10_2;
> +               else
> +                       ar->wmi.op_version = ATH10K_FW_WMI_OP_VERSION_10_1;
>         } else {
> +               ar->wmi.op_version = ATH10K_FW_WMI_OP_VERSION_MAIN;
> +       }

You always overwrite ar->wmi.op_version with MAIN if it's not 10.x
which means TLV is/wiil be effectively overwritten.

Perhaps the op_version enum values should start with 1 so that 0 can
be used as "unset" and only in that case should the above fallback be
attempted.


Also, I think it might be a good idea to reset ar->wmi.op_version in
ath10k_core_fetch_firmware_api_n (and api_1 as well) so that if any
attempt fails (e.g. due to IE binary corruption) ar->wmi.op_version
isn't propagated/left unchanged to another fw API attempt.


Michał

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

  parent reply	other threads:[~2014-12-02 12:16 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-01 14:44 [PATCH v3 0/7] ath10k: add support for new wmi-tlv backend Kalle Valo
2014-12-01 14:44 ` Kalle Valo
2014-12-01 14:44 ` [PATCH v3 1/7] ath10k: create ath10k_core_init_features() Kalle Valo
2014-12-01 14:44   ` Kalle Valo
2014-12-02  6:58   ` Michal Kazior
2014-12-02  6:58     ` Michal Kazior
2014-12-02  7:09     ` Kalle Valo
2014-12-02  7:09       ` Kalle Valo
2014-12-01 14:45 ` [PATCH v3 2/7] ath10k: add ATH10K_FW_IE_WMI_OP_VERSION Kalle Valo
2014-12-01 14:45   ` Kalle Valo
2014-12-02  8:28   ` Michal Kazior
2014-12-02  8:28     ` Michal Kazior
2014-12-02  8:48     ` Kalle Valo
2014-12-02  8:48       ` Kalle Valo
2014-12-02 11:51   ` Michal Kazior
2014-12-02 11:51     ` Michal Kazior
2014-12-03  6:32     ` Kalle Valo
2014-12-03  6:32       ` Kalle Valo
2014-12-02 12:16   ` Michal Kazior [this message]
2014-12-02 12:16     ` Michal Kazior
2014-12-03  6:30     ` Kalle Valo
2014-12-03  6:30       ` Kalle Valo
2014-12-01 14:45 ` [PATCH v3 3/7] ath10k: set max_num_pending_tx in ath10k_core_init_firmware_features() Kalle Valo
2014-12-01 14:45   ` Kalle Valo
2014-12-01 14:45 ` [PATCH v3 4/7] ath10k: implement intermediate event args Kalle Valo
2014-12-01 14:45   ` Kalle Valo
2014-12-01 14:46 ` [PATCH v3 5/7] ath10k: introduce wmi ops Kalle Valo
2014-12-01 14:46   ` Kalle Valo
2014-12-01 14:46 ` [PATCH v3 6/7] ath10k: make some wmi functions public Kalle Valo
2014-12-01 14:46   ` Kalle Valo
2014-12-01 14:46 ` [PATCH v3 7/7] ath10k: implement wmi-tlv backend Kalle Valo
2014-12-01 14:46   ` Kalle Valo
2014-12-02  6:38   ` Michal Kazior
2014-12-02  6:38     ` Michal Kazior

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=CA+BoTQkXnHnMsLvRt2PnnDCAv8P8gDsJTLNFPmf+CNaDX0frfg@mail.gmail.com \
    --to=michal.kazior@tieto.com \
    --cc=ath10k@lists.infradead.org \
    --cc=kvalo@qca.qualcomm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.