lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFSJ42Z7OiPvKO3S3=DZo_t6Mu2AhY1aPnM7=LU1fL40PQoXXQ@mail.gmail.com>
Date:	Tue, 27 Jan 2015 19:58:28 +0000
From:	Eugene Krasnikov <k.eugene.e@...il.com>
To:	Andy Green <andy.green@...aro.org>
Cc:	Kalle Valo <kvalo@...eaurora.org>,
	wcn36xx <wcn36xx@...ts.infradead.org>,
	linux-wireless <linux-wireless@...r.kernel.org>,
	netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH 7/7] net: wireless: wcn36xx: handle new trigger_ba format

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@...aro.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@...aro.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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ