mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
treewide: cleanup code
- Remove some unused data fields - Fix a few typos in comments, etc [cleanup commit message] Signed-off-by: Nick Hainke <vincent@systemli.org>
This commit is contained in:
parent
8064e56899
commit
ba305bb2c2
7 changed files with 7 additions and 27 deletions
|
|
@ -77,7 +77,6 @@ struct time_config_s uci_get_time_config() {
|
|||
.update_hostapd = 10,
|
||||
.remove_ap = 460,
|
||||
.update_tcp_con = 10,
|
||||
.denied_req_threshold = 30,
|
||||
.update_chan_util = 5,
|
||||
.update_beacon_reports = 20,
|
||||
};
|
||||
|
|
@ -96,7 +95,6 @@ struct time_config_s uci_get_time_config() {
|
|||
DAWN_SET_CONFIG_TIME(ret, s, update_hostapd);
|
||||
DAWN_SET_CONFIG_TIME(ret, s, remove_ap);
|
||||
DAWN_SET_CONFIG_TIME(ret, s, update_tcp_con);
|
||||
DAWN_SET_CONFIG_TIME(ret, s, denied_req_threshold);
|
||||
DAWN_SET_CONFIG_TIME(ret, s, update_chan_util);
|
||||
DAWN_SET_CONFIG_TIME(ret, s, update_beacon_reports);
|
||||
return ret;
|
||||
|
|
@ -244,7 +242,6 @@ struct probe_metric_s uci_get_dawn_metric() {
|
|||
.disassoc_nr_length = 6,
|
||||
.max_station_diff = 1,
|
||||
.bandwidth_threshold = 6,
|
||||
.use_driver_recog = 1,
|
||||
.chan_util_avg_period = 3,
|
||||
.duration = 0,
|
||||
.rrm_mode_mask = WLAN_RRM_CAPS_BEACON_REPORT_PASSIVE |
|
||||
|
|
@ -299,7 +296,6 @@ struct probe_metric_s uci_get_dawn_metric() {
|
|||
DAWN_SET_CONFIG_INT(ret, global_s, disassoc_nr_length);
|
||||
DAWN_SET_CONFIG_INT(ret, global_s, max_station_diff);
|
||||
DAWN_SET_CONFIG_INT(ret, global_s, bandwidth_threshold);
|
||||
DAWN_SET_CONFIG_INT(ret, global_s, use_driver_recog);
|
||||
DAWN_SET_CONFIG_INT(ret, global_s, chan_util_avg_period);
|
||||
DAWN_SET_CONFIG_INT(ret, global_s, duration);
|
||||
ret.rrm_mode_mask = parse_rrm_mode(ret.rrm_mode_order,
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ double iee80211_calculate_expected_throughput_mbit(int exp_thr) {
|
|||
return (((double) exp_thr) / 1000);
|
||||
}
|
||||
|
||||
// FIXME: This calculation seems to be unreliable. Is it device specific?
|
||||
int rcpi_to_rssi(int rcpi)
|
||||
{
|
||||
return rcpi / 2 - 110;
|
||||
|
|
|
|||
|
|
@ -681,7 +681,6 @@ static const struct blobmsg_policy uci_metric_policy[__UCI_METRIC_MAX] = {
|
|||
[UCI_KICKING_THRESHOLD] = {.name = "kicking_threshold", .type = BLOBMSG_TYPE_INT32},
|
||||
[UCI_DENY_AUTH_REASON] = {.name = "deny_auth_reason", .type = BLOBMSG_TYPE_INT32},
|
||||
[UCI_DENY_ASSOC_REASON] = {.name = "deny_assoc_reason", .type = BLOBMSG_TYPE_INT32},
|
||||
[UCI_USE_DRIVER_RECOG] = {.name = "use_driver_recog", .type = BLOBMSG_TYPE_INT32},
|
||||
[UCI_MIN_NUMBER_TO_KICK] = {.name = "min_number_to_kick", .type = BLOBMSG_TYPE_INT32},
|
||||
[UCI_CHAN_UTIL_AVG_PERIOD] = {.name = "chan_util_avg_period", .type = BLOBMSG_TYPE_INT32},
|
||||
[UCI_SET_HOSTAPD_NR] = {.name = "set_hostapd_nr", .type = BLOBMSG_TYPE_INT32},
|
||||
|
|
@ -776,9 +775,6 @@ static int handle_uci_config(struct blob_attr* msg) {
|
|||
sprintf(cmd_buffer, "dawn.global.deny_assoc_reason=%d", blobmsg_get_u32(tb_metric[UCI_DENY_ASSOC_REASON]));
|
||||
uci_set_network(cmd_buffer);
|
||||
|
||||
sprintf(cmd_buffer, "dawn.global.use_driver_recog=%d", blobmsg_get_u32(tb_metric[UCI_USE_DRIVER_RECOG]));
|
||||
uci_set_network(cmd_buffer);
|
||||
|
||||
sprintf(cmd_buffer, "dawn.global.min_number_to_kick=%d", blobmsg_get_u32(tb_metric[UCI_MIN_NUMBER_TO_KICK]));
|
||||
uci_set_network(cmd_buffer);
|
||||
|
||||
|
|
|
|||
|
|
@ -446,7 +446,7 @@ static int handle_assoc_req(struct blob_attr *msg) {
|
|||
}
|
||||
else if (own_probe->counter < dawn_metric.min_probe_count) {
|
||||
dawnlog_trace(MACSTR " Deny association due to low probe count", MAC2STR(assoc_req->client_addr.u8));
|
||||
ret = dawn_metric.deny_auth_reason;
|
||||
ret = dawn_metric.deny_assoc_reason;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1009,7 +1009,6 @@ void ubus_send_beacon_request(client *c, ap *a, int id)
|
|||
struct blob_buf b = {0};
|
||||
dawnlog_debug_func("Entering...");
|
||||
|
||||
dawnlog_debug("Crafting Beacon Report\n");
|
||||
int timeout = 1;
|
||||
|
||||
blob_buf_init(&b, 0);
|
||||
|
|
@ -1038,18 +1037,18 @@ void update_beacon_reports(struct uloop_timeout *t) {
|
|||
}
|
||||
dawnlog_debug("Sending beacon requests!\n");
|
||||
struct hostapd_sock_entry *sub;
|
||||
dawn_mutex_lock(&ap_array_mutex);
|
||||
|
||||
list_for_each_entry(sub, &hostapd_sock_list, list)
|
||||
{
|
||||
dawn_mutex_lock(&ap_array_mutex);
|
||||
|
||||
dawn_mutex_require(&ap_array_mutex);
|
||||
if (sub->subscribed && (a = ap_array_get_ap(sub->bssid_addr))) {
|
||||
dawnlog_debug("Sending beacon request Sub!\n");
|
||||
send_beacon_requests(a, sub->id);
|
||||
}
|
||||
|
||||
dawn_mutex_unlock(&ap_array_mutex);
|
||||
}
|
||||
|
||||
dawn_mutex_unlock(&ap_array_mutex);
|
||||
uloop_timeout_set(&beacon_reports_timer, timeout_config.update_beacon_reports * 1000);
|
||||
}
|
||||
|
||||
|
|
@ -1713,7 +1712,6 @@ int uci_send_via_network()
|
|||
blobmsg_add_u32(&b, "kicking_threshold", dawn_metric.kicking_threshold);
|
||||
blobmsg_add_u32(&b, "deny_auth_reason", dawn_metric.deny_auth_reason);
|
||||
blobmsg_add_u32(&b, "deny_assoc_reason", dawn_metric.deny_assoc_reason);
|
||||
blobmsg_add_u32(&b, "use_driver_recog", dawn_metric.use_driver_recog);
|
||||
blobmsg_add_u32(&b, "min_number_to_kick", dawn_metric.min_number_to_kick);
|
||||
blobmsg_add_u32(&b, "chan_util_avg_period", dawn_metric.chan_util_avg_period);
|
||||
blobmsg_add_u32(&b, "set_hostapd_nr", dawn_metric.set_hostapd_nr);
|
||||
|
|
@ -1748,7 +1746,6 @@ int uci_send_via_network()
|
|||
|
||||
times = blobmsg_open_table(&b, "times");
|
||||
blobmsg_add_u32(&b, "update_client", timeout_config.update_client);
|
||||
blobmsg_add_u32(&b, "denied_req_threshold", timeout_config.denied_req_threshold);
|
||||
blobmsg_add_u32(&b, "remove_client", timeout_config.remove_client);
|
||||
blobmsg_add_u32(&b, "remove_probe", timeout_config.remove_probe);
|
||||
blobmsg_add_u32(&b, "remove_ap", timeout_config.remove_ap);
|
||||
|
|
@ -1810,7 +1807,7 @@ int build_hearing_map_sort_client(struct blob_buf *b) {
|
|||
if (dawnlog_showing(DAWNLOG_DEBUG))
|
||||
print_probe_array();
|
||||
|
||||
// Build a linked list of probe entried in correct order for hearing map
|
||||
// Build a linked list of probe entries in correct order for hearing map
|
||||
struct probe_sort_entry *hearing_list = NULL;
|
||||
dawn_mutex_require(&probe_array_mutex);
|
||||
probe_entry* i = probe_set.first_probe;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue