+
+ if (index >= 0)
+ if (wl_ioctl(dev, WLC_SET_KEY_PRIMARY, &index, sizeof(index)) < 0)
+ return -EINVAL;
+
+ if (wl_ioctl(dev, WLC_GET_WSEC, &val, sizeof(val)) < 0)
+ return -EINVAL;
+ val |= wep;
+ if (wl_ioctl(dev, WLC_SET_WSEC, &val, sizeof(val)) < 0)
+ return -EINVAL;
+
+ if (wrestrict >= 0)
+ if (wl_ioctl(dev, WLC_SET_WEP_RESTRICT, &wrestrict, sizeof(wrestrict)) < 0)
+ return -EINVAL;
+ break;