aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-02-07 03:24:20 (GMT)
committerJouni Malinen <j@w1.fi>2008-02-07 03:24:20 (GMT)
commitd4aa9369f4d10cc485b1e579d293ec6f7a89c9a8 (patch)
tree54f37ab63bef4840e9a9908e16f722ffdaa498df
parentec77a039611c4ba3f6f002a3a235dbad092fb208 (diff)
downloadhostap-history-d4aa9369f4d10cc485b1e579d293ec6f7a89c9a8.zip
hostap-history-d4aa9369f4d10cc485b1e579d293ec6f7a89c9a8.tar.gz
hostap-history-d4aa9369f4d10cc485b1e579d293ec6f7a89c9a8.tar.bz2
nl80211 driver: remove broken ioctls
This patch removes a whole bunch of ioctls that are no longer included in the kernel and therefore always fail. For almost all of these, replacements will have to be implemented. Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
-rw-r--r--hostapd/driver_nl80211.c136
1 files changed, 7 insertions, 129 deletions
diff --git a/hostapd/driver_nl80211.c b/hostapd/driver_nl80211.c
index 61b3132..8a6792d 100644
--- a/hostapd/driver_nl80211.c
+++ b/hostapd/driver_nl80211.c
@@ -454,55 +454,7 @@ static int i802_get_seqnum(const char *iface, void *priv, const u8 *addr,
static int i802_set_rate_sets(void *priv, int *supp_rates, int *basic_rates,
int mode)
{
- struct i802_driver_data *drv = priv;
- struct prism2_hostapd_param *param;
- u8 *buf;
- u16 *pos;
- size_t blen;
- int ret = 0;
- int i, num_supp = 0, num_basic = 0;
-
- if (supp_rates)
- for (i = 0; supp_rates[i] >= 0; i++)
- num_supp++;
- if (basic_rates)
- for (i = 0; basic_rates[i] >= 0; i++)
- num_basic++;
-
- blen = sizeof(*param) + (num_supp + num_basic) * 2;
- buf = os_zalloc(blen);
- if (buf == NULL)
- return -1;
-
- param = (struct prism2_hostapd_param *) buf;
- param->cmd = PRISM2_HOSTAPD_SET_RATE_SETS;
- switch (mode) {
- case HOSTAPD_MODE_IEEE80211A:
- param->u.set_rate_sets.mode = MODE_IEEE80211A;
- break;
- case HOSTAPD_MODE_IEEE80211B:
- param->u.set_rate_sets.mode = MODE_IEEE80211B;
- break;
- case HOSTAPD_MODE_IEEE80211G:
- param->u.set_rate_sets.mode = MODE_IEEE80211G;
- break;
- }
- param->u.set_rate_sets.num_supported_rates = num_supp;
- param->u.set_rate_sets.num_basic_rates = num_basic;
- pos = (u16 *) param->u.set_rate_sets.data;
-
- for (i = 0; i < num_supp; i++)
- *pos++ = supp_rates[i];
- for (i = 0; i < num_basic; i++)
- *pos++ = basic_rates[i];
-
- if (hostapd_ioctl(drv, param, blen)) {
- printf("Failed to set rate sets.\n");
- ret = -1;
- }
- free(buf);
-
- return ret;
+ return -1;
}
@@ -609,20 +561,6 @@ static int i802_set_freq(void *priv, int mode, int freq)
struct i802_driver_data *drv = priv;
struct iwreq iwr;
- switch (mode) {
- case HOSTAPD_MODE_IEEE80211A:
- mode = MODE_IEEE80211A;
- break;
- case HOSTAPD_MODE_IEEE80211B:
- mode = MODE_IEEE80211B;
- break;
- case HOSTAPD_MODE_IEEE80211G:
- mode = MODE_IEEE80211G;
- break;
- }
-
- hostap_ioctl_prism2param(drv, PRISM2_PARAM_NEXT_MODE, mode);
-
memset(&iwr, 0, sizeof(iwr));
os_strlcpy(iwr.ifr_name, drv->hapd->conf->iface, IFNAMSIZ);
iwr.u.freq.m = freq;
@@ -1087,74 +1025,20 @@ static int i802_set_channel_flag(void *priv, int mode, int chan, int flag,
unsigned char power_level,
unsigned char antenna_max)
{
- struct i802_driver_data *drv = priv;
- struct prism2_hostapd_param param;
-
- memset(&param, 0, sizeof(param));
- param.cmd = PRISM2_HOSTAPD_SET_CHANNEL_FLAG;
- switch (mode) {
- case HOSTAPD_MODE_IEEE80211A:
- param.u.set_channel_flag.mode = MODE_IEEE80211A;
- break;
- case HOSTAPD_MODE_IEEE80211B:
- param.u.set_channel_flag.mode = MODE_IEEE80211B;
- break;
- case HOSTAPD_MODE_IEEE80211G:
- param.u.set_channel_flag.mode = MODE_IEEE80211G;
- break;
- }
-
- param.u.set_channel_flag.chan = chan;
- param.u.set_channel_flag.flag = flag;
- param.u.set_channel_flag.power_level = power_level;
- param.u.set_channel_flag.antenna_max = antenna_max;
-
- if (hostapd_ioctl(drv, &param, sizeof(param))) {
- printf("Failed to set channel flag (mode=%d chan=%d flag=0x%x)"
- "\n", mode, chan, flag);
- return -1;
- }
-
- return 0;
+ return -1;
}
static int i802_set_regulatory_domain(void *priv, unsigned int rd)
{
- struct i802_driver_data *drv = priv;
- struct prism2_hostapd_param param;
-
- memset(&param, 0, sizeof(param));
- param.cmd = PRISM2_HOSTAPD_SET_REGULATORY_DOMAIN;
- param.u.set_regulatory_domain.rd = rd;
-
- if (hostapd_ioctl(drv, &param, sizeof(param))) {
- printf("Failed to set regulatory domain (%x)\n", rd);
- return -1;
- }
-
- return 0;
+ return -1;
}
static int i802_set_tx_queue_params(void *priv, int queue, int aifs,
int cw_min, int cw_max, int burst_time)
{
- struct i802_driver_data *drv = priv;
- struct prism2_hostapd_param param;
-
- memset(&param, 0, sizeof(param));
- param.cmd = PRISM2_HOSTAPD_SET_TX_QUEUE_PARAMS;
- param.u.tx_queue_params.queue = queue;
- param.u.tx_queue_params.aifs = aifs;
- param.u.tx_queue_params.cw_min = cw_min;
- param.u.tx_queue_params.cw_max = cw_max;
- param.u.tx_queue_params.burst_time = burst_time;
-
- if (hostapd_ioctl(drv, &param, sizeof(param)))
- return -1;
-
- return 0;
+ return -1;
}
@@ -1458,25 +1342,19 @@ static int i802_set_dtim_period(const char *iface, void *priv, int value)
static int i802_set_cts_protect(void *priv, int value)
{
- struct i802_driver_data *drv = priv;
- return hostap_ioctl_prism2param(drv,
- PRISM2_PARAM_CTS_PROTECT_ERP_FRAMES,
- value);
+ return -1;
}
static int i802_set_preamble(void *priv, int value)
{
- struct i802_driver_data *drv = priv;
- return hostap_ioctl_prism2param(drv, PRISM2_PARAM_PREAMBLE, value);
+ return -1;
}
static int i802_set_short_slot_time(void *priv, int value)
{
- struct i802_driver_data *drv = priv;
- return hostap_ioctl_prism2param(drv, PRISM2_PARAM_SHORT_SLOT_TIME,
- value);
+ return -1;
}