From: Debabrata Purohit Date: Mon, 18 Jun 2018 16:23:07 +0000 (+0100) Subject: [9610] wlbt: traffic monitor - update hysteresis X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a97b0a7c2d96bd0123a3db107d847458be3d9c2d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [9610] wlbt: traffic monitor - update hysteresis The transitions from high throughput to mid throughput and vice versa are too frequent. Add more hysteresis to transition from High to mid. Change-Id: I8662eaf21d52073acb34ec229933e649be73bcf6 SCSC-Bug-Id: SSB-41039 Signed-off-by: Debabrata Purohit --- diff --git a/drivers/net/wireless/scsc/traffic_monitor.c b/drivers/net/wireless/scsc/traffic_monitor.c index 7476ea9ff2e1..4648c453d9fb 100644 --- a/drivers/net/wireless/scsc/traffic_monitor.c +++ b/drivers/net/wireless/scsc/traffic_monitor.c @@ -43,13 +43,15 @@ static inline void traffic_mon_invoke_client_callback(struct slsi_dev *sdev, u32 traffic_client->traffic_mon_client_cb(traffic_client->client_ctx, TRAFFIC_MON_CLIENT_STATE_HIGH, tput_tx, tput_rx); } } else if ((traffic_client->mid_tput) && ((tput_tx + tput_rx) > traffic_client->mid_tput)) { - if (traffic_client->state != TRAFFIC_MON_CLIENT_STATE_MID && - (traffic_client->hysteresis++ > SLSI_TRAFFIC_MON_HYSTERESIS_HIGH)) { - SLSI_DBG1(sdev, SLSI_HIP, "notify traffic event (tput:%u, state:%u --> MID)\n", (tput_tx + tput_rx), traffic_client->state); - traffic_client->hysteresis = 0; - traffic_client->state = TRAFFIC_MON_CLIENT_STATE_MID; - if (traffic_client->traffic_mon_client_cb) - traffic_client->traffic_mon_client_cb(traffic_client->client_ctx, TRAFFIC_MON_CLIENT_STATE_MID, tput_tx, tput_rx); + if (traffic_client->state != TRAFFIC_MON_CLIENT_STATE_MID) { + if ((traffic_client->state == TRAFFIC_MON_CLIENT_STATE_LOW && (traffic_client->hysteresis++ > SLSI_TRAFFIC_MON_HYSTERESIS_HIGH)) || + (traffic_client->state == TRAFFIC_MON_CLIENT_STATE_HIGH && (traffic_client->hysteresis++ > SLSI_TRAFFIC_MON_HYSTERESIS_LOW))) { + SLSI_DBG1(sdev, SLSI_HIP, "notify traffic event (tput:%u, state:%u --> MID)\n", (tput_tx + tput_rx), traffic_client->state); + traffic_client->hysteresis = 0; + traffic_client->state = TRAFFIC_MON_CLIENT_STATE_MID; + if (traffic_client->traffic_mon_client_cb) + traffic_client->traffic_mon_client_cb(traffic_client->client_ctx, TRAFFIC_MON_CLIENT_STATE_MID, tput_tx, tput_rx); + } } } else if (traffic_client->state != TRAFFIC_MON_CLIENT_STATE_LOW && (traffic_client->hysteresis++ > SLSI_TRAFFIC_MON_HYSTERESIS_LOW)) {