-#define WLCOMPAT_SET_MONITOR SIOCIWFIRSTPRIV + 0
-#define WLCOMPAT_GET_MONITOR SIOCIWFIRSTPRIV + 1
-#define WLCOMPAT_SET_TXPWR_LIMIT SIOCIWFIRSTPRIV + 2
-#define WLCOMPAT_GET_TXPWR_LIMIT SIOCIWFIRSTPRIV + 3
-#define WLCOMPAT_SET_ANTDIV SIOCIWFIRSTPRIV + 4
-#define WLCOMPAT_GET_ANTDIV SIOCIWFIRSTPRIV + 5
-#define WLCOMPAT_SET_TXANT SIOCIWFIRSTPRIV + 6
-#define WLCOMPAT_GET_TXANT SIOCIWFIRSTPRIV + 7
-#define WLCOMPAT_SET_BSS_FORCE SIOCIWFIRSTPRIV + 8
-#define WLCOMPAT_GET_BSS_FORCE SIOCIWFIRSTPRIV + 9
-
-
-static int wlcompat_private_ioctl(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu,
- char *extra)
-{
- int *value = (int *) wrqu->name;
-
- switch (info->cmd) {
- case WLCOMPAT_SET_MONITOR:
- {
- if (wl_ioctl(dev, WLC_SET_MONITOR, value, sizeof(int)) < 0)
- return -EINVAL;
-
- break;
- }
- case WLCOMPAT_GET_MONITOR:
- {
- if (wl_ioctl(dev, WLC_GET_MONITOR, extra, sizeof(int)) < 0)
- return -EINVAL;
-
- break;
- }
- case WLCOMPAT_SET_TXPWR_LIMIT:
- {
- int val;
-
-
- if (wl_get_val(dev, "qtxpower", &val, sizeof(int)) < 0)
- return -EINVAL;
-
- if (*extra > 0)
- val |= WL_TXPWR_OVERRIDE;
- else
- val &= ~WL_TXPWR_OVERRIDE;
-
- if (wl_set_val(dev, "qtxpower", &val, sizeof(int)) < 0)
- return -EINVAL;
-
- break;
- }
- case WLCOMPAT_GET_TXPWR_LIMIT:
- {
- if (wl_get_val(dev, "qtxpower", value, sizeof(int)) < 0)
- return -EINVAL;
-
- *value = ((*value & WL_TXPWR_OVERRIDE) == WL_TXPWR_OVERRIDE ? 1 : 0);
-
- break;
- }
- case WLCOMPAT_SET_ANTDIV:
- {
- if (wl_ioctl(dev, WLC_SET_ANTDIV, value, sizeof(int)) < 0)
- return -EINVAL;
-
- break;
- }
- case WLCOMPAT_GET_ANTDIV:
- {
- if (wl_ioctl(dev, WLC_GET_ANTDIV, extra, sizeof(int)) < 0)
- return -EINVAL;
-
- break;
- }
- case WLCOMPAT_SET_TXANT:
- {
- if (wl_ioctl(dev, WLC_SET_TXANT, value, sizeof(int)) < 0)
- return -EINVAL;
-
- break;
- }
- case WLCOMPAT_GET_TXANT:
- {
- if (wl_ioctl(dev, WLC_GET_TXANT, extra, sizeof(int)) < 0)
- return -EINVAL;
-
- break;
- }
- case WLCOMPAT_SET_BSS_FORCE:
- {
- bss_force = (unsigned short) *value;
- break;
- }
- case WLCOMPAT_GET_BSS_FORCE:
- {
- *extra = (int) bss_force;
- break;
- }
- default:
- {
- return -EINVAL;
- }
-
- }
- return 0;
-}
-
-static const struct iw_priv_args wlcompat_private_args[] =
-{
- { WLCOMPAT_SET_MONITOR,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- 0,
- "set_monitor"
- },
- { WLCOMPAT_GET_MONITOR,
- 0,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- "get_monitor"
- },
- { WLCOMPAT_SET_TXPWR_LIMIT,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- 0,
- "set_txpwr_force"
- },
- { WLCOMPAT_GET_TXPWR_LIMIT,
- 0,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- "get_txpwr_force"
- },
- { WLCOMPAT_SET_ANTDIV,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- 0,
- "set_antdiv"
- },
- { WLCOMPAT_GET_ANTDIV,
- 0,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- "get_antdiv"
- },
- { WLCOMPAT_SET_TXANT,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- 0,
- "set_txant"
- },
- { WLCOMPAT_GET_TXANT,
- 0,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- "get_txant"
- },
- { WLCOMPAT_SET_BSS_FORCE,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- 0,
- "set_bss_force"
- },
- { WLCOMPAT_GET_BSS_FORCE,
- 0,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- "get_bss_force"
- },
-};
-
-static const iw_handler wlcompat_private[] =
-{
- wlcompat_private_ioctl,
- NULL
-};
-
-