Commit aed03e17 authored by Anjan Chanda's avatar Anjan Chanda

add more radio info attrs

parent 60e12e7b
......@@ -457,7 +457,7 @@ static int wl_radio_status(struct ubus_context *ctx, struct ubus_object *obj,
//char macaddr[17] = {0};
unsigned long rate;
int bandwidth, noise;
//struct bss b;
struct wifi_radio radio;
struct blob_buf bb;
memset(&bb, 0, sizeof(bb));
......@@ -477,6 +477,9 @@ static int wl_radio_status(struct ubus_context *ctx, struct ubus_object *obj,
wifi_get_maxrate(wldev, &rate);
wifi_get_noise(wldev, &noise);
memset(&radio, 0, sizeof(struct wifi_radio));
wifi_radio_info(wldev, &radio);
blob_buf_init(&bb, 0);
blobmsg_add_string(&bb, "radio", wldev);
blobmsg_add_u8(&bb, "isup", (ifs & IFF_UP) ? true : false);
......@@ -485,6 +488,12 @@ static int wl_radio_status(struct ubus_context *ctx, struct ubus_object *obj,
blobmsg_add_u32(&bb, "bandwidth", bw_int[bw]);
blobmsg_add_u32(&bb, "noise", noise);
blobmsg_add_u64(&bb, "rate", rate);
blobmsg_add_u32(&bb, "beacon_int", radio.beacon_int);
blobmsg_add_u32(&bb, "dtim_period", radio.dtim_period);
blobmsg_add_u32(&bb, "short_retry_limit", radio.srl);
blobmsg_add_u32(&bb, "long_retry_limit", radio.lrl);
blobmsg_add_u32(&bb, "frag_threshold", radio.frag);
blobmsg_add_u32(&bb, "rts_threshold", radio.rts);
ubus_send_reply(ctx, req, bb.head);
blob_buf_free(&bb);
......@@ -605,6 +614,7 @@ static int wl_interface_status(struct ubus_context *ctx, struct ubus_object *obj
}
wifi_get_channel(ifname, &channel, &bw);
wifi_get_bandwidth(ifname, &bw);
if (bw < bw20 || bw > bw160) { // FIXME: in libwifi
bw = bw8080 + 1; // Unknown
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment