On 02/11/2016 07:38 PM, Andrew Bradford wrote:
RTL8188E can only have a maximum of 2 chains so match that in the actual
phy_rx_agc_info structure within phy_status_rpt.  This will cause the
other data received from the PHY, such as signal strength indication of
beacons, to properly align and allow extraction and use within the
signal strength record-keeping mechanisms.

Signed-off-by: Andrew Bradford <and...@bradfordembedded.com>

Good catch. I only have two comments/suggestions. The first is minor - when sending patches for drivers in staging, it is customary to use "staging:" as the beginning of the subject. Accordingly, yours should be "staging: rtl8188eu: fix...".

My second point is that with RF_PATH_MAX reduced to 2, there are parts of the code that are flagged with array overrun errors by Smatch. None of these statements will ever be executed, thus there are no run-time errors. I could fix these, but as such a patch would conflict with this one, I suggest you add a second patch. The file with needed changes is drivers/staging/rtl8188eu/hal/phy.c in the code that starts at line 183. The else if tests for TxCount == RF_PATH_C and TxCount == RF_PATH_D should be removed in their entirety.

There are other changes that should be made, but as they do not conflict, I will do that myself.

Thanks,

Larry

---
  drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h | 2 +-
  drivers/staging/rtl8188eu/include/odm_HWConfig.h   | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h 
b/drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h
index e058162..b8833fa 100644
--- a/drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h
+++ b/drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h
@@ -75,7 +75,7 @@ enum rf_radio_path {

  #define MAX_PG_GROUP 13

-#define        RF_PATH_MAX                     3
+#define        RF_PATH_MAX                     2
  #define               MAX_RF_PATH             RF_PATH_MAX
  #define               MAX_TX_COUNT            4 /* path numbers */

diff --git a/drivers/staging/rtl8188eu/include/odm_HWConfig.h 
b/drivers/staging/rtl8188eu/include/odm_HWConfig.h
index 62a0049..ef792bf 100644
--- a/drivers/staging/rtl8188eu/include/odm_HWConfig.h
+++ b/drivers/staging/rtl8188eu/include/odm_HWConfig.h
@@ -69,7 +69,7 @@ struct phy_rx_agc_info {
  };

  struct phy_status_rpt {
-       struct phy_rx_agc_info path_agc[3];
+       struct phy_rx_agc_info path_agc[RF_PATH_MAX];
        u8      ch_corr[2];
        u8      cck_sig_qual_ofdm_pwdb_all;
        u8      cck_agc_rpt_ofdm_cfosho_a;


_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to