Revert "[RAMEN9610-10619][Common][9610] wlbt: [ACS] Rssi factor calculation issue."
authorYuseok Kim <yuseok21.kim@samsung.com>
Fri, 25 Jan 2019 16:26:50 +0000 (01:26 +0900)
committerhskang <hs1218.kang@samsung.com>
Sat, 26 Jan 2019 06:33:10 +0000 (15:33 +0900)
This reverts commit ed9173ce3a5b49984107d65d66ec758da44fbd07.

Change-Id: Id75b8ce543e86f9903065dacd876781f1e5955ae

drivers/net/wireless/scsc/nl80211_vendor.c
drivers/net/wireless/scsc/nl80211_vendor.h
drivers/net/wireless/scsc/rx.c

index c475041fa73e04d7ade6d50987a82e8781958dfa..d011b1db74ff82ce672f7f9b678eab8ddbf7a685 100755 (executable)
@@ -6232,13 +6232,11 @@ static int slsi_acs_init(struct wiphy *wiphy,
                                return -ENOMEM;
                        }
                        memcpy(freq_list, nla_data(attr), nla_len(attr));
-                       freq_list_len = nla_len(attr) / sizeof(u32);
-                       SLSI_INFO(sdev, "ACS freq_list_len: %d\n", freq_list_len);
+                       freq_list_len = nla_len(attr);
                        break;
                }
                default:
-                       if (type > SLSI_ACS_ATTR_MAX)
-                               SLSI_ERR(sdev, "Invalid type : %d\n", type);
+                       SLSI_ERR(sdev, "Invalid type : %d\n", type);
                        break;
                }
        }
index 2d456372e790a1dbfcca7cc6964625ad527d4cc9..1d75011004db8f3dce60b2dbda1e9688a1323b82 100755 (executable)
@@ -1649,8 +1649,8 @@ struct slsi_acs_chan_info {
        u8 num_bss_load_ap;
        u8 total_chan_utilization;
        u8 avg_chan_utilization;
-       int rssi_factor;
-       int adj_rssi_factor;
+       u8 rssi_factor;
+       u8 adj_rssi_factor;
 };
 
 struct slsi_acs_selected_channels {
index 693f6e9ad026e9dedbca27ffd94d1edee8d53816..9d1fb2f887699da194b38876e93300808613bef3 100755 (executable)
@@ -575,7 +575,7 @@ int slsi_set_2g_auto_channel(struct slsi_dev *sdev, struct netdev_vif  *ndev_vif
                             struct slsi_acs_selected_channels *acs_selected_channels,
                             struct slsi_acs_chan_info *ch_info)
 {
-       int i = 0, j = 0, avg_load, total_num_ap, total_rssi, adjacent_rssi;
+       int i = 0, j = 0, adjacent_rssi, avg_load, total_num_ap, total_rssi;
        bool all_bss_load = true, none_bss_load = true;
        int  min_avg_chan_utilization = INT_MAX, min_adjacent_rssi = INT_MAX;
        int ch_idx_min_load = 0, ch_idx_min_rssi = 0;
@@ -814,24 +814,6 @@ int slsi_set_5g_auto_channel(struct slsi_dev *sdev, struct netdev_vif  *ndev_vif
        return ret;
 }
 
-int slsi_acs_get_rssi_factor(struct slsi_dev *sdev, int rssi, int ch_util)
-{
-       int frac_pow_val[10] = {10, 12, 15, 19, 25, 31, 39, 50, 63, 79};
-       int res = 1;
-       int i;
-
-       if (rssi < 0)
-               rssi = 0 - rssi;
-       else
-               return INT_MAX;
-       for (i = 0; i < rssi / 10; i++)
-               res *= 10;
-       res = (10000000 * ch_util / res)  / frac_pow_val[rssi % 10];
-
-       SLSI_DBG3(sdev, SLSI_MLME, "ch_util:%d\n", ch_util);
-       return res;
-}
-
 struct slsi_acs_chan_info *slsi_acs_scan_results(struct slsi_dev *sdev, struct netdev_vif  *ndev_vif, u16 scan_id)
 {
        struct sk_buff *scan_res;
@@ -887,14 +869,9 @@ struct slsi_acs_chan_info *slsi_acs_scan_results(struct slsi_dev *sdev, struct n
                                        ch_info[idx].total_chan_utilization += ch_util;
                                }
                        }
-                       if (idx == scan_channel->hw_value - 1)  {    /*if 2.4GHZ channel */
-                               int res = 0;
-
-                               res = slsi_acs_get_rssi_factor(sdev, fapi_get_s16(scan_res, u.mlme_scan_ind.rssi),
-                                                              ch_util);
-                               ch_info[idx].rssi_factor += res;
-                               SLSI_DBG3(sdev, SLSI_MLME, "ch_info[idx].rssi_factor:%d\n", ch_info[idx].rssi_factor);
-                       }
+                       if (idx == scan_channel->hw_value - 1)   /*if 2.4GHZ channel */
+                               ch_info[idx].rssi_factor += 10 ^ (fapi_get_s16(scan_res,
+                                                                 u.mlme_scan_ind.rssi) / 10) * ch_util;
                } else {
                        goto next_scan;
                }