Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Commit

Permalink
Implement Roaming assistant (closes #56)
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Oct 31, 2020
1 parent 1e1ed66 commit 937b63e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
1 change: 1 addition & 0 deletions release/src/router/rc/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -3858,6 +3858,7 @@ int init_nvram(void)
add_rc_support("rawifi");
add_rc_support("11AC");
add_rc_support("manual_stb");
add_rc_support("user_low_rssi");
add_rc_support("loclist");
add_rc_support("mfp");
nvram_set("wl0_HT_TxStream", "2");
Expand Down
4 changes: 2 additions & 2 deletions release/src/router/rc/lan.c
Original file line number Diff line number Diff line change
Expand Up @@ -5845,9 +5845,9 @@ void restart_wireless(void)
if(nvram_get_int("AllLED") == 0) setAllLedOff();
#endif

#ifdef RTCONFIG_NEW_USER_LOW_RSSI
//#ifdef RTCONFIG_NEW_USER_LOW_RSSI
start_roamast();
#endif
//#endif

#if defined(RTCONFIG_RALINK_MT7621)
setup_smp(); /* for adjust smp_affinity of cpu */
Expand Down
26 changes: 22 additions & 4 deletions release/src/router/rc/services.c
Original file line number Diff line number Diff line change
Expand Up @@ -7549,9 +7549,9 @@ start_services(void)
#ifdef RTCONFIG_QCA_PLC_UTILS
start_plchost();
#endif
#ifdef RTCONFIG_NEW_USER_LOW_RSSI
//#ifdef RTCONFIG_NEW_USER_LOW_RSSI
start_roamast();
#endif
//#endif

#if defined(RTCONFIG_KEY_GUARD)
start_keyguard();
Expand Down Expand Up @@ -11773,9 +11773,9 @@ _dprintf("multipath(%s): unit_now: (%d, %d, %s), unit_next: (%d, %d, %s).\n", mo
start_dnsmasq();
start_httpd();
start_telnetd();
#ifdef RTCONFIG_NEW_USER_LOW_RSSI
//#ifdef RTCONFIG_NEW_USER_LOW_RSSI
start_roamast();
#endif
//#endif

#ifdef RTCONFIG_SSH
start_sshd();
Expand Down Expand Up @@ -13594,6 +13594,24 @@ void start_roamast(void){
}
}
}
#elif defined(RTMIR3G) || defined(RTMIR4A) || defined(RTRM2100) || defined(RTR2100)
void start_roamast(void){
int rssi, i;
char prefix[] = "wl_XXXXX";
char cmd[64], tmp[32];
for (i = 0; i < 2; i++) {
sprintf(prefix, "wl%d_", i);
rssi = nvram_get_int(strcat_r(prefix, "user_rssi", tmp));
if ((rssi < -1) && (rssi > -100)) {
snprintf(cmd, 64, "iwpriv ra%s0 set KickStaRssiLow=%d", i ? "i" : "", rssi);
system(cmd);
snprintf(cmd, 64, "iwpriv ra%s0 set AssocReqRssiThres=%d", i ? "i" : "", rssi);
system(cmd);
}
}
}
#else
inline void start_roamast(void) {}
#endif

#if defined(RTCONFIG_KEY_GUARD)
Expand Down

0 comments on commit 937b63e

Please sign in to comment.