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...
7 * $Id: nwn.c,v 1.2 2002/09/15 14:31:41 ico Exp $
11 #ifdef ENABLE_NWN_SUPPORT
16 #define POLDHUPATH "/proc/driver/poldhu/%s"
17 #define SWALLOWPATH "/proc/driver/swallow/%s"
19 int nwn_get_link(char *ifname
)
29 sprintf(buf
, POLDHUPATH
, ifname
);
33 sprintf(buf
, SWALLOWPATH
, ifname
);
41 while(fgets(buf
, sizeof(buf
), f
)) {
42 p
= strchr(buf
, '\n');
52 while((*p
== ' ') || (*p
== '\t')) {
57 if(strcmp(key
, "Current BSSID") == 0) {
61 if((strcmp(key
, "BSSID") == 0) &&
62 (strcmp(val
, bssid
) == 0)) {
67 (strcmp(key
, "Quality") == 0)) {
68 sscanf(val
, "%X", (unsigned int *) &link
);