+ struct iwreq req = {
+ .ifr_ifrn.ifrn_name = {0},
+ };
+ sstrncpy(req.ifr_ifrn.ifrn_name, device, sizeof(req.ifr_ifrn.ifrn_name));
+ if (ioctl(sock, SIOCGIWRATE, &req) == -1) {
+ WARNING("wireless plugin: ioctl(SIOCGIWRATE): %s", STRERRNO);
+ } else {
+ wireless_submit(device, "bitrate", (double)req.u.bitrate.value);
+ }
+