ramips: add support for the Senao/EnGenius ESR-9753 board
[openwrt.git] / package / iwinfo / src / iwinfo_wl.c
index b322791..7b39a9b 100644 (file)
@@ -135,6 +135,7 @@ int wl_get_frequency(const char *ifname, int *buf)
 
 int wl_get_txpower(const char *ifname, int *buf)
 {
+       /* WLC_GET_VAR "qtxpower" */
        return wext_get_txpower(ifname, buf);
 }
 
@@ -556,3 +557,56 @@ int wl_get_mbssid_support(const char *ifname, int *buf)
 
        return -1;
 }
+
+int wl_get_hardware_id(const char *ifname, char *buf)
+{
+       wlc_rev_info_t revinfo;
+       struct iwinfo_hardware_id *ids = (struct iwinfo_hardware_id *)buf;
+
+       if (wl_ioctl(ifname, WLC_GET_REVINFO, &revinfo, sizeof(revinfo)))
+               return -1;
+
+       ids->vendor_id = revinfo.vendorid;
+       ids->device_id = revinfo.deviceid;
+       ids->subsystem_vendor_id = revinfo.boardvendor;
+       ids->subsystem_device_id = revinfo.boardid;
+
+       return 0;
+}
+
+int wl_get_hardware_name(const char *ifname, char *buf)
+{
+       struct iwinfo_hardware_id ids;
+
+       if (wl_get_hardware_id(ifname, (char *)&ids))
+               return -1;
+
+       sprintf(buf, "Broadcom BCM%04X", ids.device_id);
+
+       return 0;
+}
+
+int wl_get_txpower_offset(const char *ifname, int *buf)
+{
+       FILE *p;
+       char off[8];
+
+       *buf = 0;
+
+       if ((p = popen("/usr/sbin/nvram get opo", "r")) != NULL)
+       {
+               if (fread(off, 1, sizeof(off), p))
+                       *buf = strtoul(off, NULL, 16);
+
+               pclose(p);
+       }
+
+       return 0;
+}
+
+int wl_get_frequency_offset(const char *ifname, int *buf)
+{
+       /* Stub */
+       *buf = 0;
+       return -1;
+}
This page took 0.021351 seconds and 4 git commands to generate.