Re: [PATCH 1/2 v3] drivers: staging: rtl8723au: Changed rssi_cmd to little-endian param

2015-10-18 Thread Jacob Kiefer
> I am fine with this code in principle, but has it been tested? This
> stuff will break the driver miserably if it's wrong.
> 
> Thanks,
> Jes
> 

This patchset has not been tested.
Unfortunately, I don't have to proper card to test this patch on my
local. It built for me, and that's as far as I went.

Is there a way for me to test this patch locally _without_ the
corresponding wireless card? I will gladly do this, I just need to know
the tools to use and methodology.

Otherwise, can anyone with the correct wireless card apply these patches to a 
copy of the kernel and
test that nothing breaks because of the patch on their machine? Again
this is for the RTL8723au wireless card.

Thanks,
Jake
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2 v3] drivers: staging: rtl8723au: Changed rssi_cmd to little-endian param

2015-10-10 Thread Jes Sorensen
Jacob Kiefer  writes:
> From: Jacob Kiefer 
>
> Changed rssi_cmd interface to accept le32 param instead of
> unnecessary u8 * conversion. Updated existing calls to rssi_cmd.
> This patch pushes responsibility to caller to convert to
> le32. This cleans up the code quite a bit.
> Also removed magic numbers.
>
> This patch fixes the following sparse error:
>
>   CHECK   drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
> ...
> drivers/staging/rtl8723au/hal/rtl8723a_cmd.c:118:25: \
>   warning: incorrect type in assignment (different base types)
> drivers/staging/rtl8723au/hal/rtl8723a_cmd.c:118:25: \
>   expected unsigned int [unsigned] [usertype] 
> drivers/staging/rtl8723au/hal/rtl8723a_cmd.c:118:25:  \
>   got restricted __le32 [usertype] 
> ...
>
> Signed-off-by: Jacob Kiefer 
> ---
> In v3, opted to change the interface rather than just the internal
> code to clear the sparse errors and make the code more sane.

I am fine with this code in principle, but has it been tested? This
stuff will break the driver miserably if it's wrong.

Thanks,
Jes

> ---
>  drivers/staging/rtl8723au/hal/odm.c  | 3 ++-
>  drivers/staging/rtl8723au/hal/rtl8723a_cmd.c | 7 +++
>  drivers/staging/rtl8723au/include/rtl8723a_cmd.h | 2 +-
>  3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/rtl8723au/hal/odm.c 
> b/drivers/staging/rtl8723au/hal/odm.c
> index 6b9dbef..c7f45c7 100644
> --- a/drivers/staging/rtl8723au/hal/odm.c
> +++ b/drivers/staging/rtl8723au/hal/odm.c
> @@ -1274,7 +1274,8 @@ static void odm_RSSIMonitorCheck(struct dm_odm_t 
> *pDM_Odm)
>
>   for (i = 0; i < sta_cnt; i++) {
>   if (PWDB_rssi[i] != (0))
> - rtl8723a_set_rssi_cmd(Adapter, (u8 *)&PWDB_rssi[i]);
> + rtl8723a_set_rssi_cmd(Adapter,
> + cpu_to_le32(PWDB_rssi[i]));
>   }
>
>   pdmpriv->EntryMaxUndecoratedSmoothedPWDB = MaxDB;
> diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c 
> b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
> index 9733aa6..97d23c3 100644
> --- a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
> +++ b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
> @@ -25,6 +25,7 @@
>  #define RTL92C_MAX_CMD_LEN   5
>  #define MESSAGE_BOX_SIZE 4
>  #define EX_MESSAGE_BOX_SIZE  2
> +#define RSSI_CMD_LEN 3
>
>  static u8 _is_fw_read_cmd_down(struct rtw_adapter *padapter, u8 msgbox_num)
>  {
> @@ -113,11 +114,9 @@ exit:
>   return ret;
>  }
>
> -int rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, u8 *param)
> +int rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, __le32 param)
>  {
> - *((u32 *)param) = cpu_to_le32(*((u32 *)param));
> -
> - FillH2CCmd(padapter, RSSI_SETTING_EID, 3, param);
> + FillH2CCmd(padapter, RSSI_SETTING_EID, RSSI_CMD_LEN, (u8 *)¶m);
>
>   return _SUCCESS;
>  }
> diff --git a/drivers/staging/rtl8723au/include/rtl8723a_cmd.h 
> b/drivers/staging/rtl8723au/include/rtl8723a_cmd.h
> index 014c02e..e281543 100644
> --- a/drivers/staging/rtl8723au/include/rtl8723a_cmd.h
> +++ b/drivers/staging/rtl8723au/include/rtl8723a_cmd.h
> @@ -149,7 +149,7 @@ void rtl8723a_set_BTCoex_AP_mode_FwRsvdPkt_cmd(struct 
> rtw_adapter *padapter);
>  #else
>  #define rtl8723a_set_BTCoex_AP_mode_FwRsvdPkt_cmd(padapter) do {} while(0)
>  #endif
> -int rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, u8 *param);
> +int rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, __le32 param);
>  int rtl8723a_set_raid_cmd(struct rtw_adapter *padapter, u32 mask, u8 arg);
>  void rtl8723a_add_rateatid(struct rtw_adapter *padapter, u32 bitmap, u8 arg, 
> u8 rssi_level);
>
> --
> 1.8.3.2
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel