OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [linux/] [wireless.h] - Diff between revs 1765 and 1782

Only display areas with differences | Details | Blame | View Log

Rev 1765 Rev 1782
/*
/*
 * This file define a set of standard wireless extensions
 * This file define a set of standard wireless extensions
 *
 *
 * Version :    6       18.2.99
 * Version :    6       18.2.99
 *
 *
 * Authors :    Jean Tourrilhes - HPLB - <jt@hplb.hpl.hp.com>
 * Authors :    Jean Tourrilhes - HPLB - <jt@hplb.hpl.hp.com>
 */
 */
 
 
#ifndef _LINUX_WIRELESS_H
#ifndef _LINUX_WIRELESS_H
#define _LINUX_WIRELESS_H
#define _LINUX_WIRELESS_H
 
 
/************************** DOCUMENTATION **************************/
/************************** DOCUMENTATION **************************/
/*
/*
 * Basically, the wireless extensions are for now a set of standard ioctl
 * Basically, the wireless extensions are for now a set of standard ioctl
 * call + /proc/net/wireless
 * call + /proc/net/wireless
 *
 *
 * The entry /proc/net/wireless give statistics and information on the
 * The entry /proc/net/wireless give statistics and information on the
 * driver.
 * driver.
 * This is better than having each driver having its entry because
 * This is better than having each driver having its entry because
 * its centralised and we may remove the driver module safely.
 * its centralised and we may remove the driver module safely.
 *
 *
 * Ioctl are used to configure the driver and issue commands.  This is
 * Ioctl are used to configure the driver and issue commands.  This is
 * better than command line options of insmod because we may want to
 * better than command line options of insmod because we may want to
 * change dynamically (while the driver is running) some parameters.
 * change dynamically (while the driver is running) some parameters.
 *
 *
 * The ioctl mechanimsm are copied from standard devices ioctl.
 * The ioctl mechanimsm are copied from standard devices ioctl.
 * We have the list of command plus a structure descibing the
 * We have the list of command plus a structure descibing the
 * data exchanged...
 * data exchanged...
 * Note that to add these ioctl, I was obliged to modify :
 * Note that to add these ioctl, I was obliged to modify :
 *      net/core/dev.c (two place + add include)
 *      net/core/dev.c (two place + add include)
 *      net/ipv4/af_inet.c (one place + add include)
 *      net/ipv4/af_inet.c (one place + add include)
 *
 *
 * /proc/net/wireless is a copy of /proc/net/dev.
 * /proc/net/wireless is a copy of /proc/net/dev.
 * We have a structure for data passed from the driver to /proc/net/wireless
 * We have a structure for data passed from the driver to /proc/net/wireless
 * Too add this, I've modified :
 * Too add this, I've modified :
 *      net/core/dev.c (two other places)
 *      net/core/dev.c (two other places)
 *      include/linux/netdevice.h (one place)
 *      include/linux/netdevice.h (one place)
 *      include/linux/proc_fs.h (one place)
 *      include/linux/proc_fs.h (one place)
 *
 *
 * Do not add here things that are redundant with other mechanisms
 * Do not add here things that are redundant with other mechanisms
 * (drivers init, ifconfig, /proc/net/dev, ...) and with are not
 * (drivers init, ifconfig, /proc/net/dev, ...) and with are not
 * wireless specific.
 * wireless specific.
 *
 *
 * These wireless extensions are not magic : each driver has to provide
 * These wireless extensions are not magic : each driver has to provide
 * support for them...
 * support for them...
 *
 *
 * IMPORTANT NOTE : As everything in the kernel, this is very much a
 * IMPORTANT NOTE : As everything in the kernel, this is very much a
 * work in progress. Contact me if you have ideas of improvements...
 * work in progress. Contact me if you have ideas of improvements...
 */
 */
 
 
/***************************** INCLUDES *****************************/
/***************************** INCLUDES *****************************/
 
 
#include <linux/types.h>                /* for "caddr_t" et al          */
#include <linux/types.h>                /* for "caddr_t" et al          */
#include <linux/socket.h>               /* for "struct sockaddr" et al  */
#include <linux/socket.h>               /* for "struct sockaddr" et al  */
#include <linux/if.h>                   /* for IFNAMSIZ and co... */
#include <linux/if.h>                   /* for IFNAMSIZ and co... */
 
 
/**************************** CONSTANTS ****************************/
/**************************** CONSTANTS ****************************/
 
 
/* --------------------------- VERSION --------------------------- */
/* --------------------------- VERSION --------------------------- */
/*
/*
 * This constant is used to know the availability of the wireless
 * This constant is used to know the availability of the wireless
 * extensions and to know which version of wireless extensions it is
 * extensions and to know which version of wireless extensions it is
 * (there is some stuff that will be added in the future...)
 * (there is some stuff that will be added in the future...)
 * I just plan to increment with each new version.
 * I just plan to increment with each new version.
 */
 */
#define WIRELESS_EXT    6
#define WIRELESS_EXT    6
 
 
/*
/*
 * Changes :
 * Changes :
 *
 *
 * V2 to V3
 * V2 to V3
 * --------
 * --------
 *      Alan Cox start some incompatibles changes. I've integrated a bit more.
 *      Alan Cox start some incompatibles changes. I've integrated a bit more.
 *      - Encryption renamed to Encode to avoid US regulation problems
 *      - Encryption renamed to Encode to avoid US regulation problems
 *      - Frequency changed from float to struct to avoid problems on old 386
 *      - Frequency changed from float to struct to avoid problems on old 386
 *
 *
 * V3 to V4
 * V3 to V4
 * --------
 * --------
 *      - Add sensitivity
 *      - Add sensitivity
 *
 *
 * V4 to V5
 * V4 to V5
 * --------
 * --------
 *      - Missing encoding definitions in range
 *      - Missing encoding definitions in range
 *      - Access points stuff
 *      - Access points stuff
 *
 *
 * V5 to V6
 * V5 to V6
 * --------
 * --------
 *      - 802.11 support
 *      - 802.11 support
 */
 */
 
 
/* -------------------------- IOCTL LIST -------------------------- */
/* -------------------------- IOCTL LIST -------------------------- */
 
 
/* Basic operations */
/* Basic operations */
#define SIOCSIWNAME     0x8B00          /* Unused ??? */
#define SIOCSIWNAME     0x8B00          /* Unused ??? */
#define SIOCGIWNAME     0x8B01          /* get name */
#define SIOCGIWNAME     0x8B01          /* get name */
#define SIOCSIWNWID     0x8B02          /* set network id */
#define SIOCSIWNWID     0x8B02          /* set network id */
#define SIOCGIWNWID     0x8B03          /* get network id */
#define SIOCGIWNWID     0x8B03          /* get network id */
#define SIOCSIWFREQ     0x8B04          /* set channel/frequency */
#define SIOCSIWFREQ     0x8B04          /* set channel/frequency */
#define SIOCGIWFREQ     0x8B05          /* get channel/frequency */
#define SIOCGIWFREQ     0x8B05          /* get channel/frequency */
#define SIOCSIWENCODE   0x8B06          /* set encoding info */
#define SIOCSIWENCODE   0x8B06          /* set encoding info */
#define SIOCGIWENCODE   0x8B07          /* get encoding info */
#define SIOCGIWENCODE   0x8B07          /* get encoding info */
#define SIOCSIWSENS     0x8B08          /* set sensitivity */
#define SIOCSIWSENS     0x8B08          /* set sensitivity */
#define SIOCGIWSENS     0x8B09          /* get sensitivity */
#define SIOCGIWSENS     0x8B09          /* get sensitivity */
 
 
/* Informative stuff */
/* Informative stuff */
#define SIOCSIWRANGE    0x8B0A          /* Unused ??? */
#define SIOCSIWRANGE    0x8B0A          /* Unused ??? */
#define SIOCGIWRANGE    0x8B0B          /* Get range of parameters */
#define SIOCGIWRANGE    0x8B0B          /* Get range of parameters */
#define SIOCSIWPRIV     0x8B0C          /* Unused ??? */
#define SIOCSIWPRIV     0x8B0C          /* Unused ??? */
#define SIOCGIWPRIV     0x8B0D          /* get private ioctl interface info */
#define SIOCGIWPRIV     0x8B0D          /* get private ioctl interface info */
 
 
/* Mobile IP support */
/* Mobile IP support */
#define SIOCSIWSPY      0x8B10          /* set spy addresses */
#define SIOCSIWSPY      0x8B10          /* set spy addresses */
#define SIOCGIWSPY      0x8B11          /* get spy info (quality of link) */
#define SIOCGIWSPY      0x8B11          /* get spy info (quality of link) */
 
 
/* Access Point manipulation */
/* Access Point manipulation */
#define SIOCSIWAP       0x8B14          /* set access point hardware addresses */
#define SIOCSIWAP       0x8B14          /* set access point hardware addresses */
#define SIOCGIWAP       0x8B15          /* get access point hardware addresses */
#define SIOCGIWAP       0x8B15          /* get access point hardware addresses */
#define SIOCGIWAPLIST   0x8B17          /* get list of access point in range */
#define SIOCGIWAPLIST   0x8B17          /* get list of access point in range */
 
 
/* 802.11 specific support */
/* 802.11 specific support */
#define SIOCSIWESSID    0x8B1A          /* set ESSID (network name) */
#define SIOCSIWESSID    0x8B1A          /* set ESSID (network name) */
#define SIOCGIWESSID    0x8B1B          /* get ESSID */
#define SIOCGIWESSID    0x8B1B          /* get ESSID */
/* As the ESSID is a string up to 32 bytes long, it doesn't fit within the
/* As the ESSID is a string up to 32 bytes long, it doesn't fit within the
 * 'iwreq' structure, so we need to use the 'data' member to point to a
 * 'iwreq' structure, so we need to use the 'data' member to point to a
 * string in user space, like it is done for RANGE...
 * string in user space, like it is done for RANGE...
 */
 */
 
 
/* ------------------------- IOCTL STUFF ------------------------- */
/* ------------------------- IOCTL STUFF ------------------------- */
 
 
/* The first and the last (range) */
/* The first and the last (range) */
#define SIOCIWFIRST     0x8B00
#define SIOCIWFIRST     0x8B00
#define SIOCIWLAST      0x8B1B
#define SIOCIWLAST      0x8B1B
 
 
/* Even : get (world access), odd : set (root access) */
/* Even : get (world access), odd : set (root access) */
#define IW_IS_SET(cmd)  (!((cmd) & 0x1))
#define IW_IS_SET(cmd)  (!((cmd) & 0x1))
#define IW_IS_GET(cmd)  ((cmd) & 0x1)
#define IW_IS_GET(cmd)  ((cmd) & 0x1)
 
 
/* ------------------------- PRIVATE INFO ------------------------- */
/* ------------------------- PRIVATE INFO ------------------------- */
/*
/*
 * The following is used with SIOCGIWPRIV. It allow a driver to define
 * The following is used with SIOCGIWPRIV. It allow a driver to define
 * the interface (name, type of data) for its private ioctl.
 * the interface (name, type of data) for its private ioctl.
 * Privates ioctl are SIOCDEVPRIVATE -> SIOCDEVPRIVATE + 0xF
 * Privates ioctl are SIOCDEVPRIVATE -> SIOCDEVPRIVATE + 0xF
 */
 */
 
 
#define IW_PRIV_TYPE_MASK       0x7000  /* Type of arguments */
#define IW_PRIV_TYPE_MASK       0x7000  /* Type of arguments */
#define IW_PRIV_TYPE_NONE       0x0000
#define IW_PRIV_TYPE_NONE       0x0000
#define IW_PRIV_TYPE_BYTE       0x1000  /* Char as number */
#define IW_PRIV_TYPE_BYTE       0x1000  /* Char as number */
#define IW_PRIV_TYPE_CHAR       0x2000  /* Char as character */
#define IW_PRIV_TYPE_CHAR       0x2000  /* Char as character */
#define IW_PRIV_TYPE_INT        0x4000  /* 32 bits int */
#define IW_PRIV_TYPE_INT        0x4000  /* 32 bits int */
#define IW_PRIV_TYPE_FLOAT      0x5000
#define IW_PRIV_TYPE_FLOAT      0x5000
 
 
#define IW_PRIV_SIZE_FIXED      0x0800  /* Variable or fixed nuber of args */
#define IW_PRIV_SIZE_FIXED      0x0800  /* Variable or fixed nuber of args */
 
 
#define IW_PRIV_SIZE_MASK       0x07FF  /* Max number of those args */
#define IW_PRIV_SIZE_MASK       0x07FF  /* Max number of those args */
 
 
/*
/*
 * Note : if the number of args is fixed and the size < 16 octets,
 * Note : if the number of args is fixed and the size < 16 octets,
 * instead of passing a pointer we will put args in the iwreq struct...
 * instead of passing a pointer we will put args in the iwreq struct...
 */
 */
 
 
/* ----------------------- OTHER CONSTANTS ----------------------- */
/* ----------------------- OTHER CONSTANTS ----------------------- */
 
 
/* Maximum frequencies in the range struct */
/* Maximum frequencies in the range struct */
#define IW_MAX_FREQUENCIES      16
#define IW_MAX_FREQUENCIES      16
/* Note : if you have something like 80 frequencies,
/* Note : if you have something like 80 frequencies,
 * don't increase this constant and don't fill the frequency list.
 * don't increase this constant and don't fill the frequency list.
 * The user will be able to set by channel anyway... */
 * The user will be able to set by channel anyway... */
 
 
/* Maximum of address that you may set with SPY */
/* Maximum of address that you may set with SPY */
#define IW_MAX_SPY              8
#define IW_MAX_SPY              8
 
 
/****************************** TYPES ******************************/
/****************************** TYPES ******************************/
 
 
/* --------------------------- SUBTYPES --------------------------- */
/* --------------------------- SUBTYPES --------------------------- */
/*
/*
 *      A frequency
 *      A frequency
 *      For numbers lower than 10^9, we encode the number in 'mant' and
 *      For numbers lower than 10^9, we encode the number in 'mant' and
 *      set 'exp' to 0
 *      set 'exp' to 0
 *      For number greater than 10^9, we divide it by a power of 10.
 *      For number greater than 10^9, we divide it by a power of 10.
 *      The power of 10 is in 'exp', the result is in 'mant'.
 *      The power of 10 is in 'exp', the result is in 'mant'.
 */
 */
struct  iw_freq
struct  iw_freq
{
{
        __u32           m;              /* Mantissa */
        __u32           m;              /* Mantissa */
        __u16           e;              /* Exponent */
        __u16           e;              /* Exponent */
};
};
 
 
/*
/*
 *      Quality of the link
 *      Quality of the link
 */
 */
struct  iw_quality
struct  iw_quality
{
{
        __u8            qual;           /* link quality (SNR or better...) */
        __u8            qual;           /* link quality (SNR or better...) */
        __u8            level;          /* signal level */
        __u8            level;          /* signal level */
        __u8            noise;          /* noise level */
        __u8            noise;          /* noise level */
        __u8            updated;        /* Flags to know if updated */
        __u8            updated;        /* Flags to know if updated */
};
};
 
 
/*
/*
 *      Packet discarded in the wireless adapter due to
 *      Packet discarded in the wireless adapter due to
 *      "wireless" specific problems...
 *      "wireless" specific problems...
 */
 */
struct  iw_discarded
struct  iw_discarded
{
{
        __u32           nwid;           /* Wrong nwid */
        __u32           nwid;           /* Wrong nwid */
        __u32           code;           /* Unable to code/decode */
        __u32           code;           /* Unable to code/decode */
        __u32           misc;           /* Others cases */
        __u32           misc;           /* Others cases */
};
};
 
 
/*
/*
 *      Encoding information (setting and so on)
 *      Encoding information (setting and so on)
 *      Encoding might be hardware encryption, scrambing or others
 *      Encoding might be hardware encryption, scrambing or others
 */
 */
struct  iw_encoding
struct  iw_encoding
{
{
  __u8  method;                 /* Algorithm number / key used */
  __u8  method;                 /* Algorithm number / key used */
  __u64 code;                   /* Data/key used for algorithm */
  __u64 code;                   /* Data/key used for algorithm */
};
};
 
 
 
 
/* ------------------------ WIRELESS STATS ------------------------ */
/* ------------------------ WIRELESS STATS ------------------------ */
/*
/*
 * Wireless statistics (used for /proc/net/wireless)
 * Wireless statistics (used for /proc/net/wireless)
 */
 */
struct  iw_statistics
struct  iw_statistics
{
{
        __u8            status;         /* Status
        __u8            status;         /* Status
                                         * - device dependant for now */
                                         * - device dependant for now */
 
 
        struct iw_quality       qual;           /* Quality of the link
        struct iw_quality       qual;           /* Quality of the link
                                                 * (instant/mean/max) */
                                                 * (instant/mean/max) */
        struct iw_discarded     discard;        /* Packet discarded counts */
        struct iw_discarded     discard;        /* Packet discarded counts */
};
};
 
 
/* ------------------------ IOCTL REQUEST ------------------------ */
/* ------------------------ IOCTL REQUEST ------------------------ */
/*
/*
 * The structure to exchange data for ioctl.
 * The structure to exchange data for ioctl.
 * This structure is the same as 'struct ifreq', but (re)defined for
 * This structure is the same as 'struct ifreq', but (re)defined for
 * convenience...
 * convenience...
 *
 *
 * Note that it should fit on the same memory footprint !
 * Note that it should fit on the same memory footprint !
 * You should check this when increasing the above structures (16 octets)
 * You should check this when increasing the above structures (16 octets)
 * 16 octets = 128 bits. Warning, pointers might be 64 bits wide...
 * 16 octets = 128 bits. Warning, pointers might be 64 bits wide...
 */
 */
struct  iwreq
struct  iwreq
{
{
        union
        union
        {
        {
                char    ifrn_name[IFNAMSIZ];    /* if name, e.g. "en0" */
                char    ifrn_name[IFNAMSIZ];    /* if name, e.g. "en0" */
        } ifr_ifrn;
        } ifr_ifrn;
 
 
        /* Data part */
        /* Data part */
        union
        union
        {
        {
                /* Config - generic */
                /* Config - generic */
                char    name[IFNAMSIZ];
                char    name[IFNAMSIZ];
                /* Name : used to verify the presence of  wireless extensions.
                /* Name : used to verify the presence of  wireless extensions.
                 * Name of the protocol/provider... */
                 * Name of the protocol/provider... */
 
 
                struct          /* network id (or domain) : used to */
                struct          /* network id (or domain) : used to */
                {               /* create logical channels on the air */
                {               /* create logical channels on the air */
                        __u32   nwid;           /* value */
                        __u32   nwid;           /* value */
                        __u8    on;             /* active/unactive nwid */
                        __u8    on;             /* active/unactive nwid */
                }       nwid;
                }       nwid;
 
 
                struct iw_freq  freq;   /* frequency or channel :
                struct iw_freq  freq;   /* frequency or channel :
                                         * 0-1000 = channel
                                         * 0-1000 = channel
                                         * > 1000 = frequency in Hz */
                                         * > 1000 = frequency in Hz */
 
 
                struct iw_encoding      encoding;       /* Encoding stuff */
                struct iw_encoding      encoding;       /* Encoding stuff */
 
 
                __u32   sensitivity;            /* signal level threshold */
                __u32   sensitivity;            /* signal level threshold */
 
 
                struct sockaddr ap_addr;        /* Access point address */
                struct sockaddr ap_addr;        /* Access point address */
 
 
                struct          /* For all data bigger than 16 octets */
                struct          /* For all data bigger than 16 octets */
                {
                {
                        caddr_t pointer;        /* Pointer to the data
                        caddr_t pointer;        /* Pointer to the data
                                                 * (in user space) */
                                                 * (in user space) */
                        __u16   length;         /* fields or byte size */
                        __u16   length;         /* fields or byte size */
                        __u16   flags;          /* Unused */
                        __u16   flags;          /* Unused */
                }       data;
                }       data;
        }       u;
        }       u;
};
};
 
 
/* -------------------------- IOCTL DATA -------------------------- */
/* -------------------------- IOCTL DATA -------------------------- */
/*
/*
 *      For those ioctl which want to exchange mode data that what could
 *      For those ioctl which want to exchange mode data that what could
 *      fit in the above structure...
 *      fit in the above structure...
 */
 */
 
 
/*
/*
 *      Range of parameters
 *      Range of parameters
 */
 */
 
 
struct  iw_range
struct  iw_range
{
{
        /* Informative stuff (to choose between different interface) */
        /* Informative stuff (to choose between different interface) */
        __u32           throughput;     /* To give an idea... */
        __u32           throughput;     /* To give an idea... */
 
 
        /* NWID (or domain id) */
        /* NWID (or domain id) */
        __u32           min_nwid;       /* Minimal NWID we are able to set */
        __u32           min_nwid;       /* Minimal NWID we are able to set */
        __u32           max_nwid;       /* Maximal NWID we are able to set */
        __u32           max_nwid;       /* Maximal NWID we are able to set */
 
 
        /* Frequency */
        /* Frequency */
        __u16           num_channels;   /* Number of channels [0; num - 1] */
        __u16           num_channels;   /* Number of channels [0; num - 1] */
        __u8            num_frequency;  /* Number of entry in the list */
        __u8            num_frequency;  /* Number of entry in the list */
        struct iw_freq  freq[IW_MAX_FREQUENCIES];       /* list */
        struct iw_freq  freq[IW_MAX_FREQUENCIES];       /* list */
        /* Note : this frequency list doesn't need to fit channel numbers */
        /* Note : this frequency list doesn't need to fit channel numbers */
 
 
        /* signal level threshold range */
        /* signal level threshold range */
        __u32   sensitivity;
        __u32   sensitivity;
 
 
        /* Quality of link & SNR stuff */
        /* Quality of link & SNR stuff */
        struct iw_quality       max_qual;       /* Quality of the link */
        struct iw_quality       max_qual;       /* Quality of the link */
 
 
        /* Encoder stuff */
        /* Encoder stuff */
        struct iw_encoding      max_encoding;   /* Encoding max range */
        struct iw_encoding      max_encoding;   /* Encoding max range */
};
};
 
 
/*
/*
 * Private ioctl interface information
 * Private ioctl interface information
 */
 */
 
 
struct  iw_priv_args
struct  iw_priv_args
{
{
        __u32           cmd;            /* Number of the ioctl to issue */
        __u32           cmd;            /* Number of the ioctl to issue */
        __u16           set_args;       /* Type and number of args */
        __u16           set_args;       /* Type and number of args */
        __u16           get_args;       /* Type and number of args */
        __u16           get_args;       /* Type and number of args */
        char            name[IFNAMSIZ]; /* Name of the extension */
        char            name[IFNAMSIZ]; /* Name of the extension */
};
};
 
 
#endif  /* _LINUX_WIRELESS_H */
#endif  /* _LINUX_WIRELESS_H */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.