atu.h revision 9f758caf94c37c3ad28c48cfe503f9fc830a66d5
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 2003
* Daan Vreeken <Danovitsch@Vitsch.net>. 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
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Daan Vreeken.
* 4. Neither the name of the author nor the names of any co-contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY DAAN VREEKEN 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 Daan Vreeken OR THE VOICES IN HIS HEAD
* 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.
*
*/
#ifndef _ATU_H
#define _ATU_H
#ifdef __cplusplus
extern "C" {
#endif
enum atu_radio_type {
};
struct atu_dev_type {
enum atu_radio_type atu_radio;
};
struct atu_firmware {
enum atu_radio_type atur_type;
};
struct atu_softc {
struct ieee80211com sc_ic;
char sc_name[16];
enum atu_radio_type sc_radio;
int tx_queued;
int rx_queued;
int (*sc_newstate)(struct ieee80211com *,
enum ieee80211_state, int);
};
#define ATU_FLAG_RUNNING (1<<0)
#define ATU_RX_LIST_CNT 1
#define ATU_TX_LIST_CNT 8
#define ATU_MIN_FRAMELEN sizeof (struct ieee80211_frame_min)
#define ATU_RX_BUFSZ \
(ATU_RX_HDRLEN + \
sizeof (struct ieee80211_frame_addr4) + \
2312 + 4)
#define ATU_TX_BUFSZ \
(ATU_TX_HDRLEN + \
sizeof (struct ieee80211_frame_addr4) + 2312)
#define ATU_DEF_CHAN 10
#define ATU_DEF_TX_RATE 3
#define ATU_JOIN_TIMEOUT 2000
#define ATU_QUIRK_NONE 0x0000
#define ATU_QUIRK_NO_REMAP 0x0001
#define ATU_QUIRK_FW_DELAY 0x0002
#define ATU_ENC_NONE 0
#define ATU_ENC_WEP40 1
#define ATU_ENC_WEP104 2
#define ATU_MODE_IBSS 1
#define ATU_MODE_STA 2
#define ATU_POWER_ACTIVE 1
#define ATU_POWER_SAVE 2
#define ATU_POWER_SMART 3
#define ATU_PREAMBLE_LONG 0
#define ATU_PREAMBLE_SHORT 1
/* AT76c503 operating modes */
#define ATU_DEV_UNKNOWN 0x00
#define ATU_DEV_READY 0x01
#define ATU_DEV_CONFIG 0x02
#define ATU_DEV_DFU 0x03
#define ATU_DEV_STAGE2 0x04
/* AT76c503 commands */
#define CMD_SET_MIB 0x01
#define CMD_START_SCAN 0x03
#define CMD_JOIN 0x04
#define CMD_START_IBSS 0x05
#define CMD_RADIO 0x06
#define CMD_RADIO_ON 0x06
#define CMD_RADIO_OFF 0x07
#define CMD_STARTUP 0x0b
/* AT76c503 wait status */
#define STATUS_IDLE 0x00
#define STATUS_COMPLETE 0x01
#define STATUS_UNKNOWN 0x02
#define STATUS_INVALID_PARAMETER 0x03
#define STATUS_FUNCTION_NOT_SUPPORTED 0x04
#define STATUS_TIME_OUT 0x07
#define STATUS_IN_PROGRESS 0x08
#define STATUS_HOST_FAILURE 0xff
#define STATUS_SCAN_FAILED 0xf0
/* Name Type Size Index */
#define MIB_LOCAL 0x01
#define MIB_MAC_ADDR 0x02
#define MIB_MAC 0x03
#define MIB_MAC_MGMT 0x05
#define MIB_MAC_WEP 0x06
#define MIB_PHY 0x07
#define MIB_FW_VERSION 0x08
#define MIB_DOMAIN 0x09
/* USB request types */
#define ATU_CLASS_IF_IN \
#define ATU_VENDOR_IF_IN \
#define ATU_VENDOR_DEV_OUT \
#define ATU_CLASS_IF_OUT \
#define ATU_VENDOR_IF_OUT \
/* standard DFU commands */
/* DFU states */
#define DFUState_AppIdle 0
#define DFUState_AppDetach 1
#define DFUState_DFUIdle 2
#define DFUState_DnLoadSync 3
#define DFUState_DnLoadBusy 4
#define DFUState_DnLoadIdle 5
#define DFUState_ManifestSync 6
#define DFUState_Manifest 7
#define DFUState_ManifestWait 8
#define DFUState_UploadIdle 9
#define DFUState_DFUError 10
#define DFU_MaxBlockSize 1024
#pragma pack(1)
/* AT76c503 command header */
struct atu_cmd {
};
/* CMD_SET_MIB command (0x01) */
struct atu_cmd_set_mib {
/* AT76c503 command header */
/* MIB header */
/* MIB data */
};
/* CMD_STARTUP command (0x0b) */
struct atu_cmd_card_config {
};
/* CMD_SCAN command (0x03) */
struct atu_cmd_do_scan {
};
#define ATU_SCAN_ACTIVE 0x00
#define ATU_SCAN_PASSIVE 0x01
/* CMD_JOIN command (0x04) */
struct atu_cmd_join {
};
/* CMD_START_IBSS (0x05) */
struct atu_cmd_start_ibss {
};
/*
* The At76c503 adapters come with different types of radios on them.
* At this moment the driver supports adapters with RFMD and Intersil radios.
*/
/* The config structure of an RFMD radio */
struct atu_rfmd_conf {
/* then we have 84 bytes, somehow Windows reads 95?? */
};
/* The config structure of an Intersil radio */
struct atu_intersil_conf {
/* From the HFA3861B manual : */
/* Manual TX power control (7bit : -64 to 63) */
/* TX power measurement */
};
struct atu_rx_hdr {
};
#define ATU_RX_HDRLEN sizeof (struct atu_rx_hdr)
struct atu_tx_hdr {
};
#define ATU_TX_HDRLEN sizeof (struct atu_tx_hdr)
#pragma pack()
static struct atu_dev_type atu_dev_table[] = {
};
static struct atu_firmware atu_fw_table[] = {
{
sizeof (atmel_fw_rfmd_int),
sizeof (atmel_fw_rfmd_ext),
0
},
{
sizeof (atmel_fw_rfmd2958_int),
sizeof (atmel_fw_rfmd2958_ext),
81
},
{
sizeof (atmel_fw_rfmd2958_smc_int),
sizeof (atmel_fw_rfmd2958_smc_ext),
0
},
{
sizeof (atmel_fw_intersil_int),
sizeof (atmel_fw_intersil_ext),
0
},
{
sizeof (atmel_at76c503_i3863_fw_int),
sizeof (atmel_at76c503_i3863_fw_ext),
0
},
{
sizeof (atmel_at76c503_rfmd_acc_fw_int),
sizeof (atmel_at76c503_rfmd_acc_fw_ext),
0
},
{
sizeof (atmel_at76c505_rfmd_fw_int),
sizeof (atmel_at76c505_rfmd_fw_ext),
0
}
};
#ifdef __cplusplus
}
#endif
#endif /* _ATU_H */