struct blob_attr *msg)
{
struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj);
+ struct hostap_sta_driver_data sta_driver_data;
struct sta_info *sta;
void *list, *c;
char mac_buf[20];
void *r;
int i;
+ if (hostapd_drv_read_sta_data(hapd, &sta_driver_data, sta->addr) < 0)
+ continue;
+
sprintf(mac_buf, MACSTR, MAC2STR(sta->addr));
c = blobmsg_open_table(&b, mac_buf);
for (i = 0; i < ARRAY_SIZE(sta_flags); i++)
if (retrieve_sta_taxonomy(hapd, sta, r, 1024) > 0)
blobmsg_add_string_buffer(&b);
#endif
+
+ /* Driver information */
+ r = blobmsg_open_table(&b, "bytes");
+ blobmsg_add_u64(&b, "rx", sta_driver_data.rx_bytes);
+ blobmsg_add_u64(&b, "tx", sta_driver_data.tx_bytes);
+ blobmsg_close_table(&b,r);
+ r = blobmsg_open_table(&b, "airtime");
+ blobmsg_add_u64(&b, "rx", sta_driver_data.rx_airtime);
+ blobmsg_add_u64(&b, "tx", sta_driver_data.tx_airtime);
+ blobmsg_close_table(&b,r);
+ r = blobmsg_open_table(&b, "packets");
+ blobmsg_add_u32(&b, "rx", sta_driver_data.rx_packets);
+ blobmsg_add_u32(&b, "tx", sta_driver_data.tx_packets);
+ blobmsg_close_table(&b,r);
+ r = blobmsg_open_table(&b, "current_rate");
+ /* Rate in kbits */
+ blobmsg_add_u32(&b, "rx", sta_driver_data.current_rx_rate * 100);
+ blobmsg_add_u32(&b, "tx", sta_driver_data.current_tx_rate * 100);
+ blobmsg_close_table(&b,r);
+ blobmsg_add_u32(&b, "signal", sta_driver_data.signal);
+
blobmsg_close_table(&b, c);
}
blobmsg_close_array(&b, list);