blob: b030cb439d3b149512b520e617307427c7d59120 [file] [log] [blame]
/*
* Host AP (software wireless LAN access point) user space daemon for
* Host AP kernel driver
* Copyright 2002-2003, Jouni Malinen <jkmaline@cc.hut.fi>
* Copyright 2002-2004, Instant802 Networks, Inc.
* Copyright 2005, Devicescape Software, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef HOSTAPD_IOCTL_H
#define HOSTAPD_IOCTL_H
#ifdef __KERNEL__
#include <linux/types.h>
#endif /* __KERNEL__ */
#define PRISM2_IOCTL_PRISM2_PARAM (SIOCIWFIRSTPRIV + 0)
#define PRISM2_IOCTL_GET_PRISM2_PARAM (SIOCIWFIRSTPRIV + 1)
#define PRISM2_IOCTL_HOSTAPD (SIOCIWFIRSTPRIV + 3)
/* PRISM2_IOCTL_PRISM2_PARAM ioctl() subtypes:
* This table is no longer added to, the whole sub-ioctl
* mess shall be deleted completely. */
enum {
PRISM2_PARAM_BEACON_INT = 3,
PRISM2_PARAM_AP_BRIDGE_PACKETS = 10,
PRISM2_PARAM_DTIM_PERIOD = 11,
PRISM2_PARAM_IEEE_802_1X = 23,
/* Instant802 additions */
PRISM2_PARAM_CTS_PROTECT_ERP_FRAMES = 1001,
PRISM2_PARAM_PREAMBLE = 1003,
PRISM2_PARAM_SHORT_SLOT_TIME = 1006,
PRISM2_PARAM_NEXT_MODE = 1008,
PRISM2_PARAM_PRIVACY_INVOKED = 1014,
PRISM2_PARAM_EAPOL = 1023,
PRISM2_PARAM_WIFI_WME_NOACK_TEST = 1033,
PRISM2_PARAM_SCAN_FLAGS = 1035,
PRISM2_PARAM_HW_MODES = 1036,
PRISM2_PARAM_CREATE_IBSS = 1037,
PRISM2_PARAM_WMM_ENABLED = 1038,
PRISM2_PARAM_MIXED_CELL = 1039,
PRISM2_PARAM_USER_SPACE_MLME = 1045,
PRISM2_PARAM_MGMT_IF = 1046,
};
/* PRISM2_IOCTL_HOSTAPD ioctl() cmd:
* This table is no longer added to, the hostapd ioctl
* shall be deleted completely. */
enum {
PRISM2_HOSTAPD_FLUSH = 1,
PRISM2_HOSTAPD_ADD_STA = 2,
PRISM2_HOSTAPD_REMOVE_STA = 3,
PRISM2_HOSTAPD_GET_INFO_STA = 4,
PRISM2_SET_ENCRYPTION = 6,
PRISM2_GET_ENCRYPTION = 7,
PRISM2_HOSTAPD_SET_FLAGS_STA = 8,
/* Instant802 additions */
PRISM2_HOSTAPD_SET_BEACON = 1001,
PRISM2_HOSTAPD_GET_HW_FEATURES = 1002,
PRISM2_HOSTAPD_SET_RATE_SETS = 1005,
PRISM2_HOSTAPD_SET_STA_VLAN = 1010,
PRISM2_HOSTAPD_SET_CHANNEL_FLAG = 1012,
PRISM2_HOSTAPD_SET_REGULATORY_DOMAIN = 1013,
PRISM2_HOSTAPD_SET_TX_QUEUE_PARAMS = 1014,
};
#define PRISM2_HOSTAPD_MAX_BUF_SIZE 2048
#define HOSTAP_CRYPT_ALG_NAME_LEN 16
#ifndef ALIGNED
#define ALIGNED __attribute__ ((aligned))
#endif
struct prism2_hostapd_param {
u32 cmd;
u8 sta_addr[ETH_ALEN];
u8 pad[2];
union {
struct {
u16 aid;
u16 capability;
u8 supp_rates[32];
u8 wds_flags;
#define IEEE80211_STA_DYNAMIC_ENC BIT(0)
u8 enc_flags;
u16 listen_interval;
} add_sta;
struct {
u32 inactive_msec;
u32 rx_packets;
u32 tx_packets;
u32 rx_bytes;
u32 tx_bytes;
u32 current_tx_rate; /* in 100 kbps */
u32 channel_use;
u32 flags;
u32 num_ps_buf_frames;
u32 tx_retry_failed;
u32 tx_retry_count;
u32 last_rssi;
u32 last_ack_rssi;
} get_info_sta;
struct {
char alg[HOSTAP_CRYPT_ALG_NAME_LEN];
u32 flags;
u32 err;
u8 idx;
#define HOSTAP_SEQ_COUNTER_SIZE 8
u8 seq_counter[HOSTAP_SEQ_COUNTER_SIZE];
u16 key_len;
u8 key[0] ALIGNED;
} crypt;
struct {
u32 flags_and;
u32 flags_or;
} set_flags_sta;
struct {
u16 head_len;
u16 tail_len;
u8 data[0] ALIGNED; /* head_len + tail_len bytes */
} beacon;
struct {
u16 num_modes;
u16 flags;
u8 data[0] ALIGNED; /* num_modes * feature data */
} hw_features;
struct {
u8 now;
s8 our_mode_only;
s16 last_rx;
u16 channel;
s16 interval; /* seconds */
s32 listen; /* microseconds */
} scan;
struct {
u16 mode; /* MODE_* */
u16 num_supported_rates;
u16 num_basic_rates;
u8 data[0] ALIGNED; /* num_supported_rates * u16 +
* num_basic_rates * u16 */
} set_rate_sets;
struct {
u8 type; /* WDS, VLAN, etc */
u8 name[IFNAMSIZ];
u8 data[0] ALIGNED;
} if_info;
struct {
char vlan_name[IFNAMSIZ];
int vlan_id;
} set_sta_vlan;
struct {
u16 mode; /* MODE_* */
u16 chan;
u32 flag;
u8 power_level; /* regulatory limit in dBm */
u8 antenna_max;
} set_channel_flag;
struct {
u32 rd;
} set_regulatory_domain;
struct {
u32 queue;
s32 aifs;
u32 cw_min;
u32 cw_max;
u32 burst_time; /* maximum burst time in 0.1 ms, i.e.,
* 10 = 1 ms */
} tx_queue_params;
struct {
u8 dummy[80]; /* Make sizeof() this struct large enough
* with some compiler versions. */
} dummy;
} u;
};
#define HOSTAP_CRYPT_FLAG_SET_TX_KEY BIT(0)
#define HOSTAP_CRYPT_FLAG_PERMANENT BIT(1)
/* Data structures used for get_hw_features ioctl */
struct hostapd_ioctl_hw_modes_hdr {
int mode;
int num_channels;
int num_rates;
};
struct ieee80211_channel_data {
short chan; /* channel number (IEEE 802.11) */
short freq; /* frequency in MHz */
int flag; /* flag for hostapd use (IEEE80211_CHAN_*) */
};
struct ieee80211_rate_data {
int rate; /* rate in 100 kbps */
int flags; /* IEEE80211_RATE_ flags */
};
#endif /* HOSTAPD_IOCTL_H */