1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-24 21:42:04 +02:00

add repeater mode for IWMODE

git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@587 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd 2005-04-08 17:15:40 +00:00
parent e2e9c79b6e
commit b9cb3d1ffb

View File

@ -203,37 +203,39 @@ static int wlcompat_ioctl(struct net_device *dev,
} }
case SIOCSIWMODE: case SIOCSIWMODE:
{ {
int ap = -1, infra = -1, passive = -1; int ap = -1, infra = -1, passive = 0, wet = 0;
switch (wrqu->mode) { switch (wrqu->mode) {
case IW_MODE_MONITOR: case IW_MODE_MONITOR:
passive = 1; passive = 1;
break; break;
case IW_MODE_ADHOC: case IW_MODE_ADHOC:
passive = 0;
infra = 0; infra = 0;
ap = 0; ap = 0;
break; break;
case IW_MODE_MASTER: case IW_MODE_MASTER:
passive = 0;
infra = 1; infra = 1;
ap = 1; ap = 1;
break; break;
case IW_MODE_INFRA: case IW_MODE_INFRA:
passive = 0;
infra = 1; infra = 1;
ap = 0; ap = 0;
break; break;
case IW_MODE_REPEAT:
infra = 1;
ap = 0;
wet = 1;
break;
default: default:
return -EINVAL; return -EINVAL;
} }
if (passive >= 0) { if (wl_ioctl(dev, WLC_SET_PASSIVE, &passive, sizeof(passive)) < 0)
if (wl_ioctl(dev, WLC_SET_PASSIVE, &passive, sizeof(passive)) < 0) return -EINVAL;
return -EINVAL; if (wl_ioctl(dev, WLC_SET_MONITOR, &passive, sizeof(passive)) < 0)
if (wl_ioctl(dev, WLC_SET_MONITOR, &passive, sizeof(passive)) < 0) return -EINVAL;
return -EINVAL; if (wl_ioctl(dev, WLC_SET_WET, &wet, sizeof(wet)) < 0)
} return -EINVAL;
if (ap >= 0) if (ap >= 0)
if (wl_ioctl(dev, WLC_SET_AP, &ap, sizeof(ap)) < 0) if (wl_ioctl(dev, WLC_SET_AP, &ap, sizeof(ap)) < 0)
return -EINVAL; return -EINVAL;
@ -246,16 +248,16 @@ static int wlcompat_ioctl(struct net_device *dev,
} }
case SIOCGIWMODE: case SIOCGIWMODE:
{ {
int ap, infra, passive; int ap, infra, wet, passive;
if (wl_ioctl(dev, WLC_GET_AP, &ap, sizeof(ap)) < 0) if (wl_ioctl(dev, WLC_GET_AP, &ap, sizeof(ap)) < 0)
return -EINVAL; return -EINVAL;
if (wl_ioctl(dev, WLC_GET_INFRA, &infra, sizeof(infra)) < 0) if (wl_ioctl(dev, WLC_GET_INFRA, &infra, sizeof(infra)) < 0)
return -EINVAL; return -EINVAL;
if (wl_ioctl(dev, WLC_GET_PASSIVE, &passive, sizeof(passive)) < 0) if (wl_ioctl(dev, WLC_GET_PASSIVE, &passive, sizeof(passive)) < 0)
return -EINVAL; return -EINVAL;
if (wl_ioctl(dev, WLC_GET_WET, &wet, sizeof(wet)) < 0)
return -EINVAL;
if (passive) { if (passive) {
wrqu->mode = IW_MODE_MONITOR; wrqu->mode = IW_MODE_MONITOR;
@ -265,7 +267,11 @@ static int wlcompat_ioctl(struct net_device *dev,
if (ap) { if (ap) {
wrqu->mode = IW_MODE_MASTER; wrqu->mode = IW_MODE_MASTER;
} else { } else {
wrqu->mode = IW_MODE_INFRA; if (wet) {
wrqu->mode = IW_MODE_REPEAT;
} else {
wrqu->mode = IW_MODE_INFRA;
}
} }
} }
break; break;