if (ptable[0] == PTABLE_MAGIC)
return 0;
- glob("/lib/modules/2.4.*/wl.o", 0, NULL, &globbuf);
+ glob("/lib/modules/2.4.*/wl.o.patch", 0, NULL, &globbuf);
if (globbuf.gl_pathv[0] == NULL)
return -1;
if (fstat(fd, &statbuf) < 0)
goto failed;
- if (statbuf.st_size <= 512)
+ if (statbuf.st_size < 512)
goto failed;
-
- if (lseek(fd, statbuf.st_size - 512, SEEK_SET) < 0) {
- perror("lseek");
- goto failed;
- }
if (read(fd, ptable, 512) < 512)
goto failed;
return ret;
}
+static int wlc_ifname(wlc_param param, void *data, void *value)
+{
+ char *val = (char *) value;
+ int ret = 0;
+
+ if (param & SET) {
+ if (strlen(val) < 16)
+ strcpy(interface, val);
+ else ret = -1;
+ }
+ if (param & GET) {
+ strcpy(val, interface);
+ }
+
+ return ret;
+}
+
+static int wlc_wdsmac(wlc_param param, void *data, void *value)
+{
+ static struct ether_addr mac;
+ int ret = 0;
+
+ ret = wl_ioctl(interface, WLC_WDS_GET_REMOTE_HWADDR, &mac, 6);
+ if (ret == 0) {
+ strcpy((char *) value, ether_ntoa(&mac));
+ }
+
+ return ret;
+}
+
static const struct wlc_call wlc_calls[] = {
{
.name = "version",
.data.ptr = &fromstdin,
.desc = "Accept input from stdin"
},
+ {
+ .name = "ifname",
+ .param = STRING,
+ .handler = wlc_ifname,
+ .desc = "interface to send commands to"
+ },
{
.name = "up",
.param = NOARG,
.data.num = ((WLC_GET_CHANNEL << 16) | WLC_SET_CHANNEL),
.desc = "Channel",
},
+ {
+ .name = "vlan_mode",
+ .param = INT,
+ .handler = wlc_bssiovar,
+ .data.str = "vlan_mode",
+ .desc = "Parse 802.1Q tags",
+ },
{
.name = "vif",
.param = INT,
.data.str = "wdstimeout",
.desc = "WDS link detection timeout"
},
+ {
+ .name = "wdsmac",
+ .param = STRING|NOARG,
+ .handler = wlc_wdsmac,
+ .desc = "MAC of the remote WDS endpoint (only with wds0.* interfaces)"
+ },
{
.name = "afterburner",
.param = INT,