Commit e606469e authored by Anjan Chanda's avatar Anjan Chanda

show bssload and tx/rx airtime of stations

parent aed03e17
......@@ -595,12 +595,13 @@ static int wl_interface_status(struct ubus_context *ctx, struct ubus_object *obj
unsigned long rate;
int bandwidth, noise;
char auth_buf[32] = {0};
//struct bss b; // use struct ap
struct wifi_ap ap;
struct wifi_bss *bss = &ap.bss;
struct blob_buf bb;
uint32_t channel;
enum wifi_bw bw;
char std_buf[32] = {0};
char std_buf2[32] = "802.11";
memset(&bb, 0, sizeof(bb));
memset(&ap, 0, sizeof(struct wifi_ap));
......@@ -649,6 +650,14 @@ static int wl_interface_status(struct ubus_context *ctx, struct ubus_object *obj
blobmsg_add_u32(&bb, "bandwidth", bw_int[bw]);
//blobmsg_add_u64(&bb, "rate", rate);
sprintf(std_buf2 + strlen(std_buf2), "%s",
etostr(ap.bss.oper_std, std_buf, MODE_MAX, standard_str));
blobmsg_add_string(&bb, "standard", std_buf2);
blobmsg_add_u32(&bb, "num_stations", ap.bss.load.sta_count);
blobmsg_add_u32(&bb, "utilization", ap.bss.load.utilization);
blobmsg_add_u32(&bb, "adm_capacity", ap.bss.load.available);
blobmsg_add_u8(&bb, "hidden", !ap.ssid_advertised ? true : false);
blobmsg_add_u32(&bb, "max_stations", ap.assoclist_max);
wl_dump_capabilities(&bb, &bss->caps, bss->cbitmap);
......@@ -981,8 +990,15 @@ static int wl_dump_stations(struct blob_buf *bb, const char *ifname,
blobmsg_add_u32(bb, "snr", snr);
blobmsg_add_u32(bb, "idle", sx.sta_info.idle_time);
blobmsg_add_u32(bb, "in_network", sx.sta_info.conn_time);
blobmsg_add_u32(bb, "tx_airtime", sx.sta_info.tx_airtime);
blobmsg_add_u32(bb, "rx_airtime", sx.sta_info.rx_airtime);
blobmsg_add_u32(bb, "airtime", sx.sta_info.airtime);
//blobmsg_add_u32(bb, "max_rate", sx.sta_info.maxrate);
blobmsg_add_u32(bb, "max_rate", sx.sta_info.maxrate);
s = blobmsg_open_table(bb, "status");
blobmsg_add_u8(bb, "wmm", true); // FIXME
blobmsg_add_u8(bb, "ps", false); // FIXME
blobmsg_close_table(bb, s);
#if 0
f = blobmsg_open_table(bb, "capabilities");
......@@ -1327,7 +1343,8 @@ static void wl_scanresult_print(struct blob_buf *bb, void *buf, bool detail)
wifi_security_str(b->sec, b->enc, b->g_enc, sec_str);
blobmsg_add_string(bb, "encryption", sec_str);
blobmsg_add_string(bb, "band",
b->band == Band_5 ? "5GHz" : "2.4GHz");
b->band == Band_5 ? "5GHz" :
b->band == Band_2 ? "2.4GHz" : "unknown");
blobmsg_add_u32(bb, "rssi", b->rssi);
//blobmsg_add_u32(bb, "snr", b->snr);
sprintf(std_buf2 + strlen(std_buf2), "%s",
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment