3 * This code reads the /proc/driver/poldhu/eth# file for the No Wires Needed poldhu
4 * cards. Since there seems to be no official range for the 'Quality' value I assume
5 * it's between 0 and 15, and multiply by 4 to get the range 0-63...
9 #ifdef ENABLE_NWN_SUPPORT
14 #define POLDHUPATH "/proc/driver/poldhu/%s"
15 #define SWALLOWPATH "/proc/driver/swallow/%s"
17 int nwn_get_link(char *ifname
)
27 sprintf(buf
, POLDHUPATH
, ifname
);
31 sprintf(buf
, SWALLOWPATH
, ifname
);
39 while(fgets(buf
, sizeof(buf
), f
)) {
40 p
= strchr(buf
, '\n');
50 while((*p
== ' ') || (*p
== '\t')) {
55 if(strcmp(key
, "Current BSSID") == 0) {
59 if((strcmp(key
, "BSSID") == 0) &&
60 (strcmp(val
, bssid
) == 0)) {
65 (strcmp(key
, "Quality") == 0)) {
66 sscanf(val
, "%X", &link
);