Search Linux Wireless

Re: [PATCH v4 02/10] rtlwifi: Add BT_MP_INFO to c2h handler.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Larry Finger <Larry.Finger@xxxxxxxxxxxx> writes:

> From: Ping-Ke Shih <pkshih@xxxxxxxxxxx>
>
> We use H2C to ask BT's status, and C2H will return the status.
>
> Signed-off-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx>
> Signed-off-by: Larry Finger <Larry.Finger@xxxxxxxxxxxx>
> Cc: Yan-Hsuan Chuang <yhchuang@xxxxxxxxxxx>
> Cc: Birming Chiu <birming@xxxxxxxxxxx>
> Cc: Shaofu <shaofu@xxxxxxxxxxx>
> Cc: Steven Ting <steventing@xxxxxxxxxxx>

[...]

> --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> @@ -327,7 +327,22 @@ static void halbtc_aggregation_check(struct btc_coexist *btcoexist)
>  
>  static u32 halbtc_get_bt_patch_version(struct btc_coexist *btcoexist)
>  {
> -	return 0;
> +	struct rtl_priv *rtlpriv = btcoexist->adapter;
> +	u8 cmd_buffer[4] = {0};
> +	u8 oper_ver = 0;
> +	u8 req_num = 0x0E;
> +
> +	if (btcoexist->bt_info.bt_real_fw_ver)
> +		goto label_done;
> +
> +	cmd_buffer[0] |= (oper_ver & 0x0f);	/* Set OperVer */
> +	cmd_buffer[0] |= ((req_num << 4) & 0xf0);	/* Set ReqNum */
> +	cmd_buffer[1] = 0; /* BT_OP_GET_BT_VERSION = 0 */
> +	rtlpriv->cfg->ops->fill_h2c_cmd(rtlpriv->mac80211.hw, 0x67, 4,
> +					&cmd_buffer[0]);
> +
> +label_done:
> +	return btcoexist->bt_info.bt_real_fw_ver;
>  }

I don't remember if I have mentioned before but there's way too much
magic numbers. There should an enum for all req_num values and
cmd_buffer should be a struct so that is serves as documentation at the
same time. No need to resend because of this but take this into account
in the future.

As an example rsi driver is having similar problems and Prameela is
fixing those:

https://patchwork.kernel.org/patch/9832895/

-- 
Kalle Valo



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux