📄 wlan.h
字号:
/***************************************************************************** This file is part of the WLAN-Ethernut device driver.** Copyright (c) 2004 by Michael Fischer. All rights reserved.** Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met:* * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer.* 2. Redistributions in binary form must reproduce the above copyright* notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution.* 3. Neither the name of the author nor the names of its contributors may * be used to endorse or promote products derived from this software * without specific prior written permission.** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE.****************************************************************************** History:** 27.01.04 mifi First Version ****************************************************************************/#ifndef __WLAN_H__#define __WLAN_H__#include <dev/netbuf.h>#include <net/if_var.h>/* * Available drivers.*/extern NUTDEVICE devWlan;/*-------------------------------------------------------------------------*//* global defines *//*-------------------------------------------------------------------------*/#ifndef DEV_ETHER#define DEV_ETHER devWlan#endif/* * Networkname*/ #define WLAN_NETWORK_NAME_MAX_LEN 32/* * WEP */#define WLAN_WEP_MAX_KEY_COUNT 4#define WLAN_WEP_MAX_KEY_SIZE 16/*-------------------------------------------------------------------------*//* global types *//*-------------------------------------------------------------------------*//* * IOCTL commands */ typedef enum { WLAN_IOCTL_GET_MAC_ADDRESS = 1, WLAN_IOCTL_SET_CONFIG, WLAN_IOCTL_GET_STATUS } WLAN_IOCTL;/* * WLAN mode*/typedef enum { WLAN_MODE_STOP = 0, WLAN_MODE_STATION, WLAN_MODE_ADHOC} WLAN_MODE; /* * Port status */typedef enum { WLAN_STATUS_PORT_DISABLE = 1, WLAN_STATUS_PORT_SEARCHING = 2, WLAN_STATUS_PORT_CONN_IBSS = 3, WLAN_STATUS_PORT_CONN_ESS = 4, WLAN_STATUS_PORT_OOR_ESS = 5} WLAN_STATUS_PORT;/* * WLAN_WEP*/typedef enum { WLAN_USE_NO_WEP = 0, WLAN_USE_64BIT_WEP = 5, WLAN_USE_128BIT_WEP = 13 } WLAN_WEP;typedef struct _wlan_wep_key { u_char KeyLen; u_char Key[WLAN_WEP_MAX_KEY_SIZE];} WLAN_WEP_KEY;typedef struct _wlan_config { u_short Size; WLAN_MODE Mode; char Networkname[WLAN_NETWORK_NAME_MAX_LEN]; WLAN_WEP UseWEP; u_char UseWEPTxKey; WLAN_WEP_KEY WEPKey[WLAN_WEP_MAX_KEY_COUNT];} WLAN_CONFIG;typedef struct _wlan_status { u_char Size; WLAN_STATUS_PORT PortStatus; // Current port status u_char BSSIDAddress[6]; // MAC address of the AP? u_char Channel; // Current Channel u_char TxRate; // Current TxRate u_short Quality; // Quality in dBm u_short Signal; // Signal in dBm negative value u_short Noise; // Noise in dBm negative value} WLAN_STATUS;/*-------------------------------------------------------------------------*//* global macros *//*-------------------------------------------------------------------------*//*-------------------------------------------------------------------------*//* Prototypes *//*-------------------------------------------------------------------------*//* * Driver routines.*/extern int WlanInit(NUTDEVICE * dev);extern int WlanIOCtl(NUTDEVICE * dev, int req, void *conf);extern int WlanOutput(NUTDEVICE * dev, NETBUF * nb);#endif /* !__WLAN_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -