All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eugene Krasnikov <k.eugene.e@gmail.com>
To: Andy Green <andy.green@linaro.org>
Cc: Kalle Valo <kvalo@codeaurora.org>,
	wcn36xx <wcn36xx@lists.infradead.org>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH 7/7] net: wireless: wcn36xx: handle new trigger_ba format
Date: Tue, 27 Jan 2015 19:58:28 +0000	[thread overview]
Message-ID: <CAFSJ42Z7OiPvKO3S3=DZo_t6Mu2AhY1aPnM7=LU1fL40PQoXXQ@mail.gmail.com> (raw)
In-Reply-To: <20150118051117.31866.68634.stgit@114-36-241-182.dynamic.hinet.net>

arg... it looks like the code is starting to have to many
if(chip_version) cases. Mabe we should concider separate files for
chip specific logic.

2015-01-18 5:11 GMT+00:00 Andy Green <andy.green@linaro.org>:
> wcn3620 has a new message structure for the reply to trigger_ba
> We don't know what to do with the candidate list he sends back,
> but we can at least accept and ignore it nicely instead of dying.
>
> Signed-off-by: Andy Green <andy.green@linaro.org>
> ---
>  drivers/net/wireless/ath/wcn36xx/smd.c |   28 ++++++++++++++++++++++++++--
>  drivers/net/wireless/ath/wcn36xx/smd.h |    9 +++++++++
>  2 files changed, 35 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
> index 819741c..dc24e1b 100644
> --- a/drivers/net/wireless/ath/wcn36xx/smd.c
> +++ b/drivers/net/wireless/ath/wcn36xx/smd.c
> @@ -243,8 +243,31 @@ static int wcn36xx_smd_rsp_status_check(void *buf, size_t len)
>         rsp = (struct wcn36xx_fw_msg_status_rsp *)
>                 (buf + sizeof(struct wcn36xx_hal_msg_header));
>
> -       if (WCN36XX_FW_MSG_RESULT_SUCCESS != rsp->status)
> +       if (WCN36XX_FW_MSG_RESULT_SUCCESS != rsp->status) {
> +               pr_err("%s: bad status, len = %d\n", __func__, len);
> +               return rsp->status;
> +       }
> +
> +       return 0;
> +}
> +
> +static int wcn36xx_smd_rsp_status_check_bav2(struct wcn36xx *wcn, void *buf,
> +                                            size_t len)
> +{
> +       struct wcn36xx_fw_msg_status_rspv2 *rsp;
> +
> +       if (wcn->chip_version != WCN36XX_CHIP_3620)
> +               return wcn36xx_smd_rsp_status_check(buf, len);
> +
> +       if (len < sizeof(struct wcn36xx_hal_msg_header) + sizeof(*rsp))
> +               return -EIO;
> +
> +       rsp = buf + sizeof(struct wcn36xx_hal_msg_header);
> +
> +       if (WCN36XX_FW_MSG_RESULT_SUCCESS != rsp->status) {
> +               pr_err("%s: bad status, len = %d\n", __func__, len);
>                 return rsp->status;
> +       }
>
>         return 0;
>  }
> @@ -1884,7 +1907,8 @@ int wcn36xx_smd_trigger_ba(struct wcn36xx *wcn, u8 sta_index)
>                 wcn36xx_err("Sending hal_trigger_ba failed\n");
>                 goto out;
>         }
> -       ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len);
> +       ret = wcn36xx_smd_rsp_status_check_bav2(wcn, wcn->hal_buf,
> +                                               wcn->hal_rsp_len);
>         if (ret) {
>                 wcn36xx_err("hal_trigger_ba response failed err=%d\n", ret);
>                 goto out;
> diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h
> index 008d034..432d3b8 100644
> --- a/drivers/net/wireless/ath/wcn36xx/smd.h
> +++ b/drivers/net/wireless/ath/wcn36xx/smd.h
> @@ -44,6 +44,15 @@ struct wcn36xx_fw_msg_status_rsp {
>         u32     status;
>  } __packed;
>
> +/* wcn3620 returns this for tigger_ba */
> +
> +struct wcn36xx_fw_msg_status_rspv2 {
> +       u8      bss_id[6];
> +       u32     status __packed;
> +       u16     count_following_candidates __packed;
> +       /* candidate list follows */
> +};
> +
>  struct wcn36xx_hal_ind_msg {
>         struct list_head list;
>         u8 *msg;
>



-- 
Best regards,
Eugene

      reply	other threads:[~2015-01-27 19:58 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-18  5:10 [PATCH 0/7] net: wireless: wcn36xx: add basic wcn3620 support Andy Green
2015-01-18  5:10 ` Andy Green
2015-01-18  5:10 ` [PATCH 1/7] net: wireless: wcn36xx: add wcn3620 chip type definition Andy Green
2015-01-18  5:10   ` Andy Green
2015-01-18 14:17   ` Kalle Valo
2015-01-19  0:24     ` Andy Green
2015-01-23 15:39       ` Kalle Valo
2015-01-23 15:39         ` Kalle Valo
2015-01-18  5:10 ` [PATCH 2/7] net: wireless: wcn36xx: get chip type from platform ops Andy Green
2015-01-18  8:36   ` Pat Erley
2015-01-18  8:36     ` Pat Erley
2015-01-18  5:10 ` [PATCH 3/7] net: wireless: wcn36xx: use 3680 dxe regs for 3620 Andy Green
2015-01-18  5:11 ` [PATCH 4/7] net: wireless: wcn36xx: introduce WCN36XX_HAL_AVOID_FREQ_RANGE_IND Andy Green
2015-01-27 20:01   ` Eugene Krasnikov
2015-01-27 20:57     ` Andy Green
2015-01-18  5:11 ` [PATCH 5/7] net: wireless: wcn36xx: swallow two wcn3620 IND messages Andy Green
2015-01-18 11:47   ` Sergei Shtylyov
2015-01-18 11:47     ` Sergei Shtylyov
2015-01-18 12:59     ` Andy Green
2015-01-18  5:11 ` [PATCH 6/7] net: wireless: wcn36xx: remove powersaving for wcn3620 Andy Green
2015-02-09 17:54   ` Bjorn Andersson
2015-02-09 17:54     ` Bjorn Andersson
2015-02-09 21:07     ` Andy Green
2015-02-09 21:07       ` Andy Green
     [not found]       ` <CAJAp7OjLDCzLYeb3LHNs1sOHWM64XZWzr46UQ2vNirH_2JibNg@mail.gmail.com>
2015-02-09 21:28         ` Andy Green
2015-02-09 21:28           ` Andy Green
2015-02-09 21:40           ` Bjorn Andersson
2015-02-09 22:01             ` Andy Green
2015-01-18  5:11 ` [PATCH 7/7] net: wireless: wcn36xx: handle new trigger_ba format Andy Green
2015-01-27 19:58   ` Eugene Krasnikov [this message]

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='CAFSJ42Z7OiPvKO3S3=DZo_t6Mu2AhY1aPnM7=LU1fL40PQoXXQ@mail.gmail.com' \
    --to=k.eugene.e@gmail.com \
    --cc=andy.green@linaro.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=wcn36xx@lists.infradead.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.