---
name: "ieee80211"
section: "4"
platform: "linux"
package: "freebsd-manpages"
version: "6.0-5"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/ieee80211"
---

# ieee80211(4)

standard interface to IEEE 802.11 devices

## NAME

**ieee80211** – standard interface to IEEE 802.11 devices

## SYNOPSIS

**#include \<sys/types.h\>**

**#include \<sys/socket.h\>**

**#include \<net/if.h\>**

**#include \<net/ethernet.h\>**

**#include \<net/if\_ieee80211.h\>**

## DESCRIPTION

This section describes the standard interface to configuration and status information on IEEE 802.11 devices. Most devices support options not configurable by this interface. They must be set by their respective, specific control program. The interface is via one of the following [ioctl(2)](/ioctl/2.md) calls on a socket:

- SIOCG80211

  Get configuration or status information.

- SIOCS80211

  Set configuration information.

These requests are made via a modified *ifreq* structure. This structure is defined as follows:

```
struct ieee80211req {
	char		i_name[IFNAMSIZ];	/* if_name, e.g. "wi0" */
	u_int16_t	i_type;			/* req type */
	int16_t		i_val;			/* Index or simple value */
	int16_t		i_len;			/* Index or simple value */
	void		*i_data;		/* Extra data */
};
```

For SIOCG80211 the following values of *i\_type* are valid:

- IEEE80211\_IOC\_SSID

  Returns the requested SSID by copying it into the buffer pointed to by *i\_data* and setting *i\_len* to the length. If *i\_val* is ≥ 0 then the request refers to the configured value for that slot. Generally, 0 is the only valid value, but some interfaces support more SSIDs. If *i\_val* is -1 then the request refers to the currently active value.

- IEEE80211\_IOC\_NUMSSIDS

  Returns the number of SSIDs this card supports. In most cases, this is 1, but some devices such as [an(4)](/an/4.md) support more.

- IEEE80211\_IOC\_WEP

  Returns the current WEP status in *i\_val*. Valid values are IEEE80211\_WEP\_NOSUP, IEEE80211\_WEP\_ON, IEEE80211\_WEP\_OFF, and IEEE80211\_WEP\_MIXED. Respectively, these values mean unsupported, mandatory for all devices, off, and on, but not required for all devices.

- IEEE80211\_IOC\_WEPKEY

  Returns the requested WEP key via *i\_data* and its length via *i\_len*. If the device does not support returning the WEP key or the user is not root then the key may be returned as all zeros. Technically this is a valid key, but it is the kind of key an idiot would put on his luggage so we use it as a special value. Generally, only four WEP keys are allowed, but some devices support more. If so, the first four (0-3) are the standard keys stored in volatile storage and the others are device specific.

- IEEE80211\_IOC\_NUMWEPKEYS

  Returns the number of WEP keys supported by this device, generally 4. A device that does not support WEP may either report 0 or simply return EINVAL.

- IEEE80211\_IOC\_WEPTXKEY

  Returns the WEP key used for transmission.

- IEEE80211\_IOC\_AUTHMODE

  Returns the current authentication mode in *i\_val*. Valid values are IEEE80211\_AUTH\_NONE, IEEE80211\_AUTH\_OPEN, and IEEE80211\_AUTH\_SHARED.

- IEEE80211\_IOC\_STATIONNAME

  Returns the station name via *i\_data* and its length via *i\_len*. While all known devices seem to support this in some way or another, they all do it differently and it appears to not have anything to do with the actual IEEE 802.11 standard so making up an answer may be necessary for future devices.

- IEEE80211\_IOC\_CHANNEL

  Returns the current direct sequence spread spectrum channel in use.

- IEEE80211\_IOC\_POWERSAVE

  Returns the current powersaving mode. Valid values are IEEE80211\_POWERSAVE\_NOSUP, IEEE80211\_POWERSAVE\_OFF, IEEE80211\_POWERSAVE\_ON, IEEE80211\_POWERSAVE\_CAM, IEEE80211\_POWERSAVE\_PSP, and IEEE80211\_POWERSAVE\_PSP\_CAM. Currently, IEEE80211\_POWERSAVE\_ON is defined to be equal to IEEE80211\_POWERSAVE\_CAM, but this may be incorrect.

- IEEE80211\_IOC\_POWERSAVESLEEP

  Returns the powersave sleep time in msec in *i\_val*.

For SIOCS80211 the following values of *i\_type* are valid:

- IEEE80211\_IOC\_SSID

  Set the desired SSID for infrastructure and ad-hoc modes to value given by *i\_data* and *i\_len*. The length should be no longer than 32 characters.

- IEEE80211\_IOC\_WEP

  Set the current WEP mode to the value given in *i\_val*. Valid values are the same as those for this value above. Devices which do not support all modes may choose to either return EINVAL or choose a reasonable alternate (supported) setting.

- IEEE80211\_IOC\_WEPKEY

  Set the WEP key indicated by *i\_val* to the value given by *i\_data* and *i\_len*. Generally, valid values of *i\_len* are 0, 5, and 13 though not all devices with WEP support have support for 13-byte keys.

- IEEE80211\_IOC\_WEPTXKEY

  Set the WEP key used for transmission to the value in *i\_val*. Not all values which are valid for setting keys may be valid for setting transmit keys due to strange device interfaces.

- IEEE80211\_IOC\_AUTHMODE

  Set the current authorization mode to the value given in *i\_val*. Valid values are given above. Not all devices support this.

- IEEE80211\_IOC\_STATIONNAME

  Set the station name to the value given by *i\_data* and *i\_len*. The standard does not appear to deal with this feature so the range of valid values may vary from device to device.

- IEEE80211\_IOC\_CHANNEL

  Set the desired ad-hoc channel to the value given by *i\_val*. On some devices this has an impact on infrastructure mode as well. Valid values are 1-14, but 0 should be allowed and should return the device to the default value. May devices support this directly by converting any invalid value to the default value.

- IEEE80211\_IOC\_POWERSAVE

  Set the current powersaving mode to the value given in *i\_val*. Valid values are the same as those for this value above. Devices which do not support all modes may choose to either return EINVAL or choose a reasonable alternate (supported) setting. Most devices only support CAM mode.

- IEEE80211\_IOC\_POWERSAVESLEEP

  Set the powersave sleep time in msec to the value in *i\_val*.

## SEE ALSO

[ioctl(2)](/ioctl/2.md), [an(4)](/an/4.md), [ray(4)](/ray/4.md), [wi(4)](/wi/4.md), ancontrol(8), [ifconfig(8)](/ifconfig/8.md), raycontrol(8), wicontrol(8)

## HISTORY

The **ieee80211** manual appeared in FreeBSD 4.3.
