hfa384x.h revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
*
* Defines the constants and data structures for the hfa384x
*
* Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved.
* --------------------------------------------------------------------
*
* linux-wlan
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU Public License version 2 (the "GPL"), in which
* case the provisions of the GPL are applicable instead of the
* above. If you wish to allow the use of your version of this file
* only under the terms of the GPL and not to allow others to use
* your version of this file under the MPL, indicate your decision
* by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL. If you do not delete
* the provisions above, a recipient may use your version of this
* file under either the MPL or the GPL.
*
* --------------------------------------------------------------------
*
* Inquiries regarding the linux-wlan Open Source project can be
* made directly to:
*
* AbsoluteValue Systems Inc.
* info@linux-wlan.com
*
* --------------------------------------------------------------------
*
* Portions of the development of this software were funded by
* Intersil Corporation as part of PRISM(R) chipset product development.
*
* --------------------------------------------------------------------
*
* [Implementation and usage notes]
*
* [References]
* CW10 Programmer's Manual v1.5
* IEEE 802.11 D10.0
*
* --------------------------------------------------------------------
*/
#ifndef _HFA384x_H
#define _HFA384x_H
/*=============================================================*/
/*------ Constants --------------------------------------------*/
/*--- Mins & Maxs -----------------------------------*/
#define HFA384x_DRVR_FIDSTACKLEN_MAX (10)
#define HFA384x_DRVR_TXBUF_MAX (sizeof(hfa384x_tx_frame_t) + \
WLAN_DATA_MAXLEN - \
WLAN_WEP_IV_LEN - \
WLAN_WEP_ICV_LEN + 2)
#define HFA384x_DRVR_MAGIC (0x4a2d)
#define HFA384x_INFODATA_MAXLEN (sizeof(hfa384x_infodata_t))
#define HFA384x_INFOFRM_MAXLEN (sizeof(hfa384x_InfFrame_t))
#define HFA384x_USB_RWMEM_MAXLEN 2048
/*--- Support Constants -----------------------------*/
#define HFA384x_BAP_PROC ((UINT16)0)
#define HFA384x_WEPFLAGS_IV_INTERVAL1 ((UINT16)0)
/*--- Just some symbolic names for legibility -------*/
#define HFA384x_TXCMD_NORECL ((UINT16)0)
/*--- MAC Internal memory constants and macros ------*/
/* masks and macros used to manipulate MAC internal memory addresses. */
/* MAC internal memory addresses are 23 bit quantities. The MAC uses
* a paged address space where the upper 16 bits are the page number
* and the lower 7 bits are the offset. There are various Host API
* elements that require two 16-bit quantities to specify a MAC
* internal memory address. Unfortunately, some of the API's use a
* bits and the page is the remaining 16 bits. Some of the API's
* assume that the 23 bit address has been split at the 16th bit. We
* refer to these two formats as AUX format and CMD format. The
* macros below help handle some of this.
*/
/* Handy constant */
/* Mask bits for discarding unwanted pieces in a flat address */
#define HFA384x_ADDR_FLAT_AUX_PAGE_MASK (0x007fff80)
#define HFA384x_ADDR_FLAT_AUX_OFF_MASK (0x0000007f)
#define HFA384x_ADDR_FLAT_CMD_PAGE_MASK (0xffff0000)
#define HFA384x_ADDR_FLAT_CMD_OFF_MASK (0x0000ffff)
/* Mask bits for discarding unwanted pieces in AUX format 16-bit address parts */
#define HFA384x_ADDR_AUX_PAGE_MASK (0xffff)
#define HFA384x_ADDR_AUX_OFF_MASK (0x007f)
/* Mask bits for discarding unwanted pieces in CMD format 16-bit address parts */
#define HFA384x_ADDR_CMD_PAGE_MASK (0x007f)
#define HFA384x_ADDR_CMD_OFF_MASK (0xffff)
/* Make a 32-bit flat address from AUX format 16-bit page and offset */
#define HFA384x_ADDR_AUX_MKFLAT(p,o) \
/* Make a 32-bit flat address from CMD format 16-bit page and offset */
#define HFA384x_ADDR_CMD_MKFLAT(p,o) \
/* Make AUX format offset and page from a 32-bit flat address */
#define HFA384x_ADDR_AUX_MKPAGE(f) \
#define HFA384x_ADDR_AUX_MKOFF(f) \
/* Make CMD format offset and page from a 32-bit flat address */
#define HFA384x_ADDR_CMD_MKPAGE(f) \
#define HFA384x_ADDR_CMD_MKOFF(f) \
/* Some of the upper bits of the AUX offset register are used to */
/* select address space. */
#define HFA384x_AUX_CTL_EXTDS (0x00)
#define HFA384x_AUX_CTL_NV (0x01)
#define HFA384x_AUX_CTL_PHY (0x02)
#define HFA384x_AUX_CTL_ICSRAM (0x03)
/* Make AUX register offset and page values from a flat address */
#define HFA384x_AUX_MKOFF(f, c) \
#define HFA384x_AUX_MKPAGE(f) HFA384x_ADDR_AUX_MKPAGE(f)
/*--- Controller Memory addresses -------------------*/
#define HFA3842_PDA_BASE (0x007f0000UL)
#define HFA3841_PDA_BASE (0x003f0000UL)
#define HFA3841_PDA_BOGUS_BASE (0x00390000UL)
/*--- Driver Download states -----------------------*/
#define HFA384x_DLSTATE_DISABLED 0
#define HFA384x_DLSTATE_RAMENABLED 1
#define HFA384x_DLSTATE_FLASHENABLED 2
#define HFA384x_DLSTATE_FLASHWRITTEN 3
#define HFA384x_DLSTATE_FLASHWRITEPENDING 4
/*--- Register I/O offsets --------------------------*/
#define HFA384x_CMD_OFF (0x00)
#define HFA384x_PARAM0_OFF (0x02)
#define HFA384x_PARAM1_OFF (0x04)
#define HFA384x_PARAM2_OFF (0x06)
#define HFA384x_STATUS_OFF (0x08)
#define HFA384x_RESP0_OFF (0x0A)
#define HFA384x_RESP1_OFF (0x0C)
#define HFA384x_RESP2_OFF (0x0E)
#define HFA384x_INFOFID_OFF (0x10)
#define HFA384x_RXFID_OFF (0x20)
#define HFA384x_ALLOCFID_OFF (0x22)
#define HFA384x_TXCOMPLFID_OFF (0x24)
#define HFA384x_SELECT0_OFF (0x18)
#define HFA384x_OFFSET0_OFF (0x1C)
#define HFA384x_DATA0_OFF (0x36)
#define HFA384x_SELECT1_OFF (0x1A)
#define HFA384x_OFFSET1_OFF (0x1E)
#define HFA384x_DATA1_OFF (0x38)
#define HFA384x_EVSTAT_OFF (0x30)
#define HFA384x_INTEN_OFF (0x32)
#define HFA384x_EVACK_OFF (0x34)
#define HFA384x_CONTROL_OFF (0x14)
#define HFA384x_SWSUPPORT0_OFF (0x28)
#define HFA384x_SWSUPPORT1_OFF (0x2A)
#define HFA384x_SWSUPPORT2_OFF (0x2C)
#define HFA384x_AUXPAGE_OFF (0x3A)
#define HFA384x_AUXOFFSET_OFF (0x3C)
#define HFA384x_AUXDATA_OFF (0x3E)
#define HFA384x_CMD_OFF (0x00)
#define HFA384x_PARAM0_OFF (0x04)
#define HFA384x_PARAM1_OFF (0x08)
#define HFA384x_PARAM2_OFF (0x0c)
#define HFA384x_STATUS_OFF (0x10)
#define HFA384x_RESP0_OFF (0x14)
#define HFA384x_RESP1_OFF (0x18)
#define HFA384x_RESP2_OFF (0x1c)
#define HFA384x_INFOFID_OFF (0x20)
#define HFA384x_RXFID_OFF (0x40)
#define HFA384x_ALLOCFID_OFF (0x44)
#define HFA384x_TXCOMPLFID_OFF (0x48)
#define HFA384x_SELECT0_OFF (0x30)
#define HFA384x_OFFSET0_OFF (0x38)
#define HFA384x_DATA0_OFF (0x6c)
#define HFA384x_SELECT1_OFF (0x34)
#define HFA384x_OFFSET1_OFF (0x3c)
#define HFA384x_DATA1_OFF (0x70)
#define HFA384x_EVSTAT_OFF (0x60)
#define HFA384x_INTEN_OFF (0x64)
#define HFA384x_EVACK_OFF (0x68)
#define HFA384x_CONTROL_OFF (0x28)
#define HFA384x_SWSUPPORT0_OFF (0x50)
#define HFA384x_SWSUPPORT1_OFF (0x54)
#define HFA384x_SWSUPPORT2_OFF (0x58)
#define HFA384x_AUXPAGE_OFF (0x74)
#define HFA384x_AUXOFFSET_OFF (0x78)
#define HFA384x_AUXDATA_OFF (0x7c)
#define HFA384x_PCICOR_OFF (0x4c)
#define HFA384x_PCIHCR_OFF (0x5c)
#define HFA384x_PCI_M0_ADDRH_OFF (0x80)
#define HFA384x_PCI_M0_ADDRL_OFF (0x84)
#define HFA384x_PCI_M0_LEN_OFF (0x88)
#define HFA384x_PCI_M0_CTL_OFF (0x8c)
#define HFA384x_PCI_STATUS_OFF (0x98)
#define HFA384x_PCI_M1_ADDRH_OFF (0xa0)
#define HFA384x_PCI_M1_ADDRL_OFF (0xa4)
#define HFA384x_PCI_M1_LEN_OFF (0xa8)
#define HFA384x_PCI_M1_CTL_OFF (0xac)
#endif
/*--- Register Field Masks --------------------------*/
#define HFA384x_OFFSET_DATAOFF ((UINT16)(BIT11 | BIT10 | BIT9 | BIT8 | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1))
/*--- Command Code Constants --------------------------*/
/*--- Controller Commands --------------------------*/
/*--- Buffer Mgmt Commands --------------------------*/
/*--- Regulate Commands --------------------------*/
/*--- Configure Commands --------------------------*/
/*--- Debugging Commands -----------------------------*/
/*--- Result Codes --------------------------*/
/*--- Programming Modes --------------------------
MODE 0: Disable programming
MODE 1: Enable volatile memory programming
MODE 2: Enable non-volatile memory programming
MODE 3: Program non-volatile memory section
--------------------------------------------------*/
/*--- AUX register enable --------------------------*/
/*--- Record ID Constants --------------------------*/
/*--------------------------------------------------------------------
Configuration RIDs: Network Parameters, Static Configuration Entities
--------------------------------------------------------------------*/
/*--------------------------------------------------------------------
Configuration RID lengths: Network Params, Static Config Entities
This is the length of JUST the DATA part of the RID (does not
include the len or code fields)
--------------------------------------------------------------------*/
/* TODO: fill in the rest of these */
#define HFA384x_RID_CNFSYSSCALE_LEN ((UINT16)0)
#define HFA384x_RID_CNFMAXDATALEN_LEN ((UINT16)0)
#define HFA384x_RID_CNFPMENABLED_LEN ((UINT16)0)
#define HFA384x_RID_CNFPMEPS_LEN ((UINT16)0)
#define HFA384x_RID_CNFMULTICASTRX_LEN ((UINT16)0)
#define HFA384x_RID_CNFMAXSLEEPDUR_LEN ((UINT16)0)
#define HFA384x_RID_CNFPMHOLDDUR_LEN ((UINT16)0)
#define HFA384x_RID_CNFOWNDTIMPER_LEN ((UINT16)0)
#define HFA384x_RID_CNFMCASTPMBUFF_LEN ((UINT16)0)
#define HFA384x_RID_CNFMAXSLEEPDUR_LEN ((UINT16)0)
/*--------------------------------------------------------------------
Configuration RIDs: Network Parameters, Dynamic Configuration Entities
--------------------------------------------------------------------*/
/*--------------------------------------------------------------------
Configuration RID Lengths: Network Param, Dynamic Config Entities
This is the length of JUST the DATA part of the RID (does not
include the len or code fields)
--------------------------------------------------------------------*/
/* TODO: fill in the rest of these */
#define HFA384x_RID_CREATEIBSS_LEN ((UINT16)0)
#define HFA384x_RID_FRAGTHRESH_LEN ((UINT16)0)
#define HFA384x_RID_RTSTHRESH_LEN ((UINT16)0)
#define HFA384x_RID_FRAGTHRESH0_LEN ((UINT16)0)
#define HFA384x_RID_FRAGTHRESH1_LEN ((UINT16)0)
#define HFA384x_RID_FRAGTHRESH2_LEN ((UINT16)0)
#define HFA384x_RID_FRAGTHRESH3_LEN ((UINT16)0)
#define HFA384x_RID_FRAGTHRESH4_LEN ((UINT16)0)
#define HFA384x_RID_FRAGTHRESH5_LEN ((UINT16)0)
#define HFA384x_RID_FRAGTHRESH6_LEN ((UINT16)0)
#define HFA384x_RID_RTSTHRESH0_LEN ((UINT16)0)
#define HFA384x_RID_RTSTHRESH1_LEN ((UINT16)0)
#define HFA384x_RID_RTSTHRESH2_LEN ((UINT16)0)
#define HFA384x_RID_RTSTHRESH3_LEN ((UINT16)0)
#define HFA384x_RID_RTSTHRESH4_LEN ((UINT16)0)
#define HFA384x_RID_RTSTHRESH5_LEN ((UINT16)0)
#define HFA384x_RID_RTSTHRESH6_LEN ((UINT16)0)
#define HFA384x_RID_TXRATECNTL0_LEN ((UINT16)0)
#define HFA384x_RID_TXRATECNTL1_LEN ((UINT16)0)
#define HFA384x_RID_TXRATECNTL2_LEN ((UINT16)0)
#define HFA384x_RID_TXRATECNTL3_LEN ((UINT16)0)
#define HFA384x_RID_TXRATECNTL4_LEN ((UINT16)0)
#define HFA384x_RID_TXRATECNTL5_LEN ((UINT16)0)
#define HFA384x_RID_TXRATECNTL6_LEN ((UINT16)0)
/*--------------------------------------------------------------------
Configuration RIDs: Behavior Parameters
--------------------------------------------------------------------*/
/*--------------------------------------------------------------------
Configuration RID Lengths: Behavior Parameters
This is the length of JUST the DATA part of the RID (does not
include the len or code fields)
--------------------------------------------------------------------*/
/*----------------------------------------------------------------------
Information RIDs: NIC Information
--------------------------------------------------------------------*/
/*----------------------------------------------------------------------
Information RID Lengths: NIC Information
This is the length of JUST the DATA part of the RID (does not
include the len or code fields)
--------------------------------------------------------------------*/
#define HFA384x_RID_MAXLOADTIME_LEN ((UINT16)0)
#define HFA384x_RID_CHANNELLIST_LEN ((UINT16)0)
#define HFA384x_RID_TEMPTYPE_LEN ((UINT16)0)
/*--------------------------------------------------------------------
Information RIDs: MAC Information
--------------------------------------------------------------------*/
// #define HFA384x_RID_PCFINFO ((UINT16)0xFD87)
/*--------------------------------------------------------------------
Information RID Lengths: MAC Information
This is the length of JUST the DATA part of the RID (does not
include the len or code fields)
--------------------------------------------------------------------*/
#define HFA384x_RID_PORTSTATUS_LEN ((UINT16)0)
#define HFA384x_RID_CURRENTTXRATE_LEN ((UINT16)0)
#define HFA384x_RID_CURRENTBCNINT_LEN ((UINT16)0)
#define HFA384x_RID_PROTOCOLRSPTIME_LEN ((UINT16)0)
#define HFA384x_RID_SHORTRETRYLIMIT_LEN ((UINT16)0)
#define HFA384x_RID_LONGRETRYLIMIT_LEN ((UINT16)0)
#define HFA384x_RID_MAXTXLIFETIME_LEN ((UINT16)0)
#define HFA384x_RID_MAXRXLIFETIME_LEN ((UINT16)0)
#define HFA384x_RID_CFPOLLABLE_LEN ((UINT16)0)
#define HFA384x_RID_PRIVACYOPTIMP_LEN ((UINT16)0)
#define HFA384x_RID_CURRENTTXRATE1_LEN ((UINT16)0)
#define HFA384x_RID_CURRENTTXRATE2_LEN ((UINT16)0)
#define HFA384x_RID_CURRENTTXRATE3_LEN ((UINT16)0)
#define HFA384x_RID_CURRENTTXRATE4_LEN ((UINT16)0)
#define HFA384x_RID_CURRENTTXRATE5_LEN ((UINT16)0)
#define HFA384x_RID_CURRENTTXRATE6_LEN ((UINT16)0)
/*--------------------------------------------------------------------
Information RIDs: Modem Information
--------------------------------------------------------------------*/
/*--------------------------------------------------------------------
Information RID Lengths: Modem Information
This is the length of JUST the DATA part of the RID (does not
include the len or code fields)
--------------------------------------------------------------------*/
#define HFA384x_RID_PHYTYPE_LEN ((UINT16)0)
#define HFA384x_RID_CURRENTCHANNEL_LEN ((UINT16)0)
#define HFA384x_RID_CURRENTPOWERSTATE_LEN ((UINT16)0)
#define HFA384x_RID_CCAMODE_LEN ((UINT16)0)
/*--------------------------------------------------------------------
API ENHANCEMENTS (NOT ALREADY IMPLEMENTED)
--------------------------------------------------------------------*/
// #define HFA384x_RID_CNFMMLIFE ((UINT16)0xFC31)
/*--------------------------------------------------------------------
PD Record codes
--------------------------------------------------------------------*/
/*=============================================================*/
/*------ Macros -----------------------------------------------*/
/*--- Register ID macros ------------------------*/
#define HFA384x_CMD HFA384x_CMD_OFF
#define HFA384x_PARAM0 HFA384x_PARAM0_OFF
#define HFA384x_PARAM1 HFA384x_PARAM1_OFF
#define HFA384x_PARAM2 HFA384x_PARAM2_OFF
#define HFA384x_STATUS HFA384x_STATUS_OFF
#define HFA384x_RESP0 HFA384x_RESP0_OFF
#define HFA384x_RESP1 HFA384x_RESP1_OFF
#define HFA384x_RESP2 HFA384x_RESP2_OFF
#define HFA384x_INFOFID HFA384x_INFOFID_OFF
#define HFA384x_RXFID HFA384x_RXFID_OFF
#define HFA384x_ALLOCFID HFA384x_ALLOCFID_OFF
#define HFA384x_SELECT0 HFA384x_SELECT0_OFF
#define HFA384x_OFFSET0 HFA384x_OFFSET0_OFF
#define HFA384x_DATA0 HFA384x_DATA0_OFF
#define HFA384x_SELECT1 HFA384x_SELECT1_OFF
#define HFA384x_OFFSET1 HFA384x_OFFSET1_OFF
#define HFA384x_DATA1 HFA384x_DATA1_OFF
#define HFA384x_EVSTAT HFA384x_EVSTAT_OFF
#define HFA384x_INTEN HFA384x_INTEN_OFF
#define HFA384x_EVACK HFA384x_EVACK_OFF
#define HFA384x_CONTROL HFA384x_CONTROL_OFF
#define HFA384x_AUXPAGE HFA384x_AUXPAGE_OFF
#define HFA384x_AUXDATA HFA384x_AUXDATA_OFF
#define HFA384x_PCICOR HFA384x_PCICOR_OFF
#define HFA384x_CMD_MACPORT_GET(value) ((UINT16)(HFA384x_CMD_AINFO_GET((UINT16)(value) & HFA384x_CMD_MACPORT)))
#define HFA384x_CMD_ISRECL(value) ((UINT16)(HFA384x_CMD_AINFO_GET((UINT16)(value) & HFA384x_CMD_RECL)))
#define HFA384x_CMD_ISWRITE(value) ((UINT16)(HFA384x_CMD_AINFO_GET((UINT16)(value) & HFA384x_CMD_WRITE)))
#define HFA384x_CMD_PROGMODE_GET(value) ((UINT16)(HFA384x_CMD_AINFO_GET((UINT16)(value) & HFA384x_CMD_PROGMODE)))
#define HFA384x_STATUS_RESULT_GET(value) ((UINT16)((((UINT16)(value)) & HFA384x_STATUS_RESULT) >> 8))
/* Byte Order */
/* Host Maintained State Info */
#define HFA384x_STATE_PREINIT 0
#define HFA384x_STATE_INIT 1
#define HFA384x_STATE_RUNNING 2
/*=============================================================*/
/*------ Types and their related constants --------------------*/
/*-------------------------------------------------------------*/
/* Commonly used basic types */
typedef struct hfa384x_bytestr
{
typedef struct hfa384x_bytestr32
{
/*--------------------------------------------------------------------
Configuration Record Structures:
Network Parameters, Static Configuration Entities
--------------------------------------------------------------------*/
/* Prototype structure: all configuration record structures start with
these members */
typedef struct hfa384x_record
{
typedef struct hfa384x_record16
{
typedef struct hfa384x_record32
{
typedef struct hfa384x_compident
{
typedef struct hfa384x_caplevel
{
/*-- Configuration Record: cnfPortType --*/
typedef struct hfa384x_cnfPortType
{
/*-- Configuration Record: cnfOwnMACAddress --*/
typedef struct hfa384x_cnfOwnMACAddress
{
/*-- Configuration Record: cnfDesiredSSID --*/
typedef struct hfa384x_cnfDesiredSSID
{
/*-- Configuration Record: cnfOwnChannel --*/
typedef struct hfa384x_cnfOwnChannel
{
/*-- Configuration Record: cnfOwnSSID --*/
typedef struct hfa384x_cnfOwnSSID
{
/*-- Configuration Record: cnfOwnATIMWindow --*/
typedef struct hfa384x_cnfOwnATIMWindow
{
/*-- Configuration Record: cnfSystemScale --*/
typedef struct hfa384x_cnfSystemScale
{
/*-- Configuration Record: cnfMaxDataLength --*/
typedef struct hfa384x_cnfMaxDataLength
{
/*-- Configuration Record: cnfWDSAddress --*/
typedef struct hfa384x_cnfWDSAddress
{
/*-- Configuration Record: cnfPMEnabled --*/
typedef struct hfa384x_cnfPMEnabled
{
/*-- Configuration Record: cnfPMEPS --*/
typedef struct hfa384x_cnfPMEPS
{
/*-- Configuration Record: cnfMulticastReceive --*/
typedef struct hfa384x_cnfMulticastReceive
{
/*-- Configuration Record: cnfAuthentication --*/
#define HFA384x_CNFAUTHENTICATION_OPENSYSTEM 0x0001
#define HFA384x_CNFAUTHENTICATION_SHAREDKEY 0x0002
/*-- Configuration Record: cnfMaxSleepDuration --*/
typedef struct hfa384x_cnfMaxSleepDuration
{
/*-- Configuration Record: cnfPMHoldoverDuration --*/
typedef struct hfa384x_cnfPMHoldoverDuration
{
/*-- Configuration Record: cnfOwnName --*/
typedef struct hfa384x_cnfOwnName
{
/*-- Configuration Record: cnfOwnDTIMPeriod --*/
typedef struct hfa384x_cnfOwnDTIMPeriod
{
/*-- Configuration Record: cnfWDSAddress --*/
typedef struct hfa384x_cnfWDSAddressN
{
/*-- Configuration Record: cnfMulticastPMBuffering --*/
typedef struct hfa384x_cnfMulticastPMBuffering
{
/*--------------------------------------------------------------------
Configuration Record Structures:
Network Parameters, Dynamic Configuration Entities
--------------------------------------------------------------------*/
/*-- Configuration Record: GroupAddresses --*/
typedef struct hfa384x_GroupAddresses
{
/*-- Configuration Record: CreateIBSS --*/
typedef struct hfa384x_CreateIBSS
{
#define HFA384x_CREATEIBSS_JOINCREATEIBSS 0
#define HFA384x_CREATEIBSS_JOINIBSS 2
#define HFA384x_CREATEIBSS_JOINESS_JOINIBSS 3
/*-- Configuration Record: FragmentationThreshold --*/
typedef struct hfa384x_FragmentationThreshold
{
/*-- Configuration Record: RTSThreshold --*/
typedef struct hfa384x_RTSThreshold
{
/*-- Configuration Record: TxRateControl --*/
typedef struct hfa384x_TxRateControl
{
/*-- Configuration Record: PromiscuousMode --*/
typedef struct hfa384x_PromiscuousMode
{
/*-- Configuration Record: ScanRequest (data portion only) --*/
typedef struct hfa384x_ScanRequest_data
{
/*-- Configuration Record: HostScanRequest (data portion only) --*/
typedef struct hfa384x_HostScanRequest_data
{
/*-- Configuration Record: JoinRequest (data portion only) --*/
typedef struct hfa384x_JoinRequest_data
{
/*-- Configuration Record: authenticateStation (data portion only) --*/
typedef struct hfa384x_authenticateStation_data
{
/*-- Configuration Record: ChannelInfoRequest (data portion only) --*/
typedef struct hfa384x_ChannelInfoRequest_data
{
/*--------------------------------------------------------------------
Configuration Record Structures: Behavior Parameters
--------------------------------------------------------------------*/
/*-- Configuration Record: TickTime --*/
typedef struct hfa384x_TickTime
{
/*--------------------------------------------------------------------
Information Record Structures: NIC Information
--------------------------------------------------------------------*/
/*-- Information Record: MaxLoadTime --*/
typedef struct hfa384x_MaxLoadTime
{
/*-- Information Record: DownLoadBuffer --*/
/* NOTE: The page and offset are in AUX format */
typedef struct hfa384x_downloadbuffer
{
/*-- Information Record: PRIIdentity --*/
typedef struct hfa384x_PRIIdentity
{
/*-- Information Record: PRISupRange --*/
typedef struct hfa384x_PRISupRange
{
/*-- Information Record: CFIActRanges --*/
typedef struct hfa384x_CFIActRanges
{
/*-- Information Record: NICSerialNumber --*/
typedef struct hfa384x_NICSerialNumber
{
/*-- Information Record: NICIdentity --*/
typedef struct hfa384x_NICIdentity
{
/*-- Information Record: MFISupRange --*/
typedef struct hfa384x_MFISupRange
{
/*-- Information Record: CFISupRange --*/
typedef struct hfa384x_CFISupRange
{
/*-- Information Record: BUILDSEQ:BuildSeq --*/
typedef struct hfa384x_BuildSeq {
/*-- Information Record: FWID --*/
#define HFA384x_FWID_LEN 14
typedef struct hfa384x_FWID {
/*-- Information Record: ChannelList --*/
typedef struct hfa384x_ChannelList
{
/*-- Information Record: RegulatoryDomains --*/
typedef struct hfa384x_RegulatoryDomains
{
/*-- Information Record: TempType --*/
typedef struct hfa384x_TempType
{
/*-- Information Record: CIS --*/
typedef struct hfa384x_CIS
{
/*-- Information Record: STAIdentity --*/
typedef struct hfa384x_STAIdentity
{
/*-- Information Record: STASupRange --*/
typedef struct hfa384x_STASupRange
{
/*-- Information Record: MFIActRanges --*/
typedef struct hfa384x_MFIActRanges
{
/*--------------------------------------------------------------------
Information Record Structures: NIC Information
--------------------------------------------------------------------*/
/*-- Information Record: PortStatus --*/
typedef struct hfa384x_PortStatus
{
/*-- Information Record: CurrentSSID --*/
typedef struct hfa384x_CurrentSSID
{
/*-- Information Record: CurrentBSSID --*/
typedef struct hfa384x_CurrentBSSID
{
/*-- Information Record: commsquality --*/
typedef struct hfa384x_commsquality
{
/*-- Information Record: dmbcommsquality --*/
typedef struct hfa384x_dbmcommsquality
{
/*-- Information Record: CurrentTxRate --*/
typedef struct hfa384x_CurrentTxRate
{
/*-- Information Record: CurrentBeaconInterval --*/
typedef struct hfa384x_CurrentBeaconInterval
{
/*-- Information Record: CurrentScaleThresholds --*/
typedef struct hfa384x_CurrentScaleThresholds
{
/*-- Information Record: ProtocolRspTime --*/
typedef struct hfa384x_ProtocolRspTime
{
/*-- Information Record: ShortRetryLimit --*/
typedef struct hfa384x_ShortRetryLimit
{
/*-- Information Record: LongRetryLimit --*/
typedef struct hfa384x_LongRetryLimit
{
/*-- Information Record: MaxTransmitLifetime --*/
typedef struct hfa384x_MaxTransmitLifetime
{
/*-- Information Record: MaxReceiveLifetime --*/
typedef struct hfa384x_MaxReceiveLifetime
{
/*-- Information Record: CFPollable --*/
typedef struct hfa384x_CFPollable
{
/*-- Information Record: AuthenticationAlgorithms --*/
typedef struct hfa384x_AuthenticationAlgorithms
{
/*-- Information Record: AuthenticationAlgorithms
(data only --*/
typedef struct hfa384x_AuthenticationAlgorithms_data
{
/*-- Information Record: PrivacyOptionImplemented --*/
typedef struct hfa384x_PrivacyOptionImplemented
{
/*-- Information Record: OwnMACAddress --*/
typedef struct hfa384x_OwnMACAddress
{
/*-- Information Record: PCFInfo --*/
typedef struct hfa384x_PCFInfo
{
/*-- Information Record: PCFInfo (data portion only) --*/
typedef struct hfa384x_PCFInfo_data
{
/*--------------------------------------------------------------------
Information Record Structures: Modem Information Records
--------------------------------------------------------------------*/
/*-- Information Record: PHYType --*/
typedef struct hfa384x_PHYType
{
/*-- Information Record: CurrentChannel --*/
typedef struct hfa384x_CurrentChannel
{
/*-- Information Record: CurrentPowerState --*/
typedef struct hfa384x_CurrentPowerState
{
/*-- Information Record: CCAMode --*/
typedef struct hfa384x_CCAMode
{
/*-- Information Record: SupportedDataRates --*/
typedef struct hfa384x_SupportedDataRates
{
/*--------------------------------------------------------------------
FRAME DESCRIPTORS AND FRAME STRUCTURES
FRAME DESCRIPTORS: Offsets
----------------------------------------------------------------------
Control Info (offset 44-51)
--------------------------------------------------------------------*/
/*--------------------------------------------------------------------
802.11 Header (offset 52-6B)
--------------------------------------------------------------------*/
/*--------------------------------------------------------------------
802.3 Header (offset 72-7F)
--------------------------------------------------------------------*/
/*--------------------------------------------------------------------
FRAME STRUCTURES: Communication Frames
----------------------------------------------------------------------
Communication Frames: Transmit Frames
--------------------------------------------------------------------*/
/*-- Communication Frame: Transmit Frame Structure --*/
typedef struct hfa384x_tx_frame
{
/*-- 802.11 Header Information --*/
/*-- 802.3 Header Information --*/
/*--------------------------------------------------------------------
Communication Frames: Field Masks for Transmit Frames
--------------------------------------------------------------------*/
/*-- Status Field --*/
/*-- Transmit Control Field --*/
/*--------------------------------------------------------------------
--------------------------------------------------------------------*/
/*-- Status Field --*/
#define HFA384x_TXSTATUS_ISERROR(v) \
(((UINT16)(v))&\
/*--------------------------------------------------------------------
Communication Frames: Receive Frames
--------------------------------------------------------------------*/
/*-- Communication Frame: Receive Frame Structure --*/
typedef struct hfa384x_rx_frame
{
/*-- MAC rx descriptor (hfa384x byte order) --*/
/*-- 802.11 Header Information (802.11 byte order) --*/
/*-- 802.3 Header Information --*/
/*--------------------------------------------------------------------
Communication Frames: Field Masks for Receive Frames
--------------------------------------------------------------------*/
/*-- Offsets --------*/
/*-- Status Fields --*/
/*--------------------------------------------------------------------
--------------------------------------------------------------------*/
#define HFA384x_RXSTATUS_MSGTYPE_GET(value) ((UINT16)((((UINT16)(value)) & HFA384x_RXSTATUS_MSGTYPE) >> 13))
#define HFA384x_RXSTATUS_MACPORT_GET(value) ((UINT16)((((UINT16)(value)) & HFA384x_RXSTATUS_MACPORT) >> 8))
/*--------------------------------------------------------------------
FRAME STRUCTURES: Information Types and Information Frame Structures
----------------------------------------------------------------------
Information Types
--------------------------------------------------------------------*/
/*--------------------------------------------------------------------
Information Frames Structures
----------------------------------------------------------------------
Information Frames: Notification Frame Structures
--------------------------------------------------------------------*/
/*-- Notification Frame,MAC Mgmt: Handover Address --*/
typedef struct hfa384x_HandoverAddr
{
/*-- Inquiry Frame, Diagnose: Communication Tallies --*/
typedef struct __WLAN_ATTRIB_PACK__ hfa384x_CommTallies16
{
typedef struct __WLAN_ATTRIB_PACK__ hfa384x_CommTallies32
{
/*-- Inquiry Frame, Diagnose: Scan Results & Subfields--*/
typedef struct hfa384x_ScanResultSub
{
typedef struct hfa384x_ScanResult
{
/*-- Inquiry Frame, Diagnose: ChInfo Results & Subfields--*/
typedef struct hfa384x_ChInfoResultSub
{
#define HFA384x_CHINFORESULT_BSSACTIVE BIT0
#define HFA384x_CHINFORESULT_PCFACTIVE BIT1
typedef struct hfa384x_ChInfoResult
{
/*-- Inquiry Frame, Diagnose: Host Scan Results & Subfields--*/
typedef struct hfa384x_HScanResultSub
{
typedef struct hfa384x_HScanResult
{
/*-- Unsolicited Frame, MAC Mgmt: LinkStatus --*/
#define HFA384x_LINK_NOTCONNECTED ((UINT16)0)
typedef struct hfa384x_LinkStatus
{
/*-- Unsolicited Frame, MAC Mgmt: AssociationStatus (--*/
typedef struct hfa384x_AssocStatus
{
/* old_ap_addr is only valid if assocstatus == 2 */
/*-- Unsolicited Frame, MAC Mgmt: AuthRequest (AP Only) --*/
typedef struct hfa384x_AuthRequest
{
/*-- Unsolicited Frame, MAC Mgmt: PSUserCount (AP Only) --*/
typedef struct hfa384x_PSUserCount
{
/*-- Collection of all Inf frames ---------------*/
typedef union hfa384x_infodata {
typedef struct hfa384x_InfFrame
{
#if (WLAN_HOSTIF == WLAN_USB)
/*--------------------------------------------------------------------
USB Packet structures and constants.
--------------------------------------------------------------------*/
/* Should be sent to the ctrlout endpoint */
#define HFA384x_USB_ENBULKIN 6
/* Should be sent to the bulkout endpoint */
#define HFA384x_USB_TXFRM 0
#define HFA384x_USB_CMDREQ 1
#define HFA384x_USB_WRIDREQ 2
#define HFA384x_USB_RRIDREQ 3
#define HFA384x_USB_WMEMREQ 4
#define HFA384x_USB_RMEMREQ 5
/* Received from the bulkin endpoint */
#define HFA384x_USB_ISFRM(a) ((a) < 0x7fff)
#define HFA384x_USB_INFOFRM 0x8000
#define HFA384x_USB_CMDRESP 0x8001
#define HFA384x_USB_WRIDRESP 0x8002
#define HFA384x_USB_RRIDRESP 0x8003
#define HFA384x_USB_WMEMRESP 0x8004
#define HFA384x_USB_RMEMRESP 0x8005
#define HFA384x_USB_BUFAVAIL 0x8006
#define HFA384x_USB_ERROR 0x8007
/*------------------------------------*/
/* Request (bulk OUT) packet contents */
typedef struct hfa384x_usb_txfrm {
typedef struct hfa384x_usb_cmdreq {
typedef struct hfa384x_usb_wridreq {
typedef struct hfa384x_usb_rridreq {
typedef struct hfa384x_usb_wmemreq {
typedef struct hfa384x_usb_rmemreq {
/*------------------------------------*/
/* Response (bulk IN) packet contents */
typedef struct hfa384x_usb_rxfrm {
typedef struct hfa384x_usb_infofrm {
typedef struct hfa384x_usb_cmdresp {
typedef struct hfa384x_usb_wridresp {
typedef struct hfa384x_usb_rridresp {
typedef struct hfa384x_usb_wmemresp {
typedef struct hfa384x_usb_rmemresp {
typedef struct hfa384x_usb_bufavail {
typedef struct hfa384x_usb_error {
/*----------------------------------------------------------*/
/* Unions for packaging all the known packet types together */
typedef union hfa384x_usbout {
typedef union hfa384x_usbin {
#endif /* WLAN_USB */
/*--------------------------------------------------------------------
PD record structures.
--------------------------------------------------------------------*/
typedef struct hfa384x_pdr_pcb_partnum
{
typedef struct hfa384x_pdr_pcb_tracenum
{
typedef struct hfa384x_pdr_nic_serial
{
typedef struct hfa384x_pdr_mkk_measurements
{
double carrier_freq __WLAN_ATTRIB_PACK__;
double occupied_band __WLAN_ATTRIB_PACK__;
double power_density __WLAN_ATTRIB_PACK__;
double tx_spur_f1 __WLAN_ATTRIB_PACK__;
double tx_spur_f2 __WLAN_ATTRIB_PACK__;
double tx_spur_f3 __WLAN_ATTRIB_PACK__;
double tx_spur_f4 __WLAN_ATTRIB_PACK__;
double tx_spur_l1 __WLAN_ATTRIB_PACK__;
double tx_spur_l2 __WLAN_ATTRIB_PACK__;
double tx_spur_l3 __WLAN_ATTRIB_PACK__;
double tx_spur_l4 __WLAN_ATTRIB_PACK__;
double rx_spur_f1 __WLAN_ATTRIB_PACK__;
double rx_spur_f2 __WLAN_ATTRIB_PACK__;
double rx_spur_l1 __WLAN_ATTRIB_PACK__;
double rx_spur_l2 __WLAN_ATTRIB_PACK__;
typedef struct hfa384x_pdr_nic_ramsize
{
typedef struct hfa384x_pdr_mfisuprange
{
typedef struct hfa384x_pdr_cfisuprange
{
typedef struct hfa384x_pdr_nicid
{
typedef struct hfa384x_pdr_refdac_measurements
{
typedef struct hfa384x_pdr_vgdac_measurements
{
typedef struct hfa384x_pdr_level_comp_measurements
{
typedef struct hfa384x_pdr_mac_address
{
typedef struct hfa384x_pdr_mkk_callname
{
typedef struct hfa384x_pdr_regdomain
{
typedef struct hfa384x_pdr_allowed_channel
{
typedef struct hfa384x_pdr_default_channel
{
typedef struct hfa384x_pdr_privacy_option
{
typedef struct hfa384x_pdr_temptype
{
typedef struct hfa384x_pdr_refdac_setup
{
typedef struct hfa384x_pdr_vgdac_setup
{
typedef struct hfa384x_pdr_level_comp_setup
{
typedef struct hfa384x_pdr_trimdac_setup
{
typedef struct hfa384x_pdr_ifr_setting
{
typedef struct hfa384x_pdr_rfr_setting
{
typedef struct hfa384x_pdr_hfa3861_baseline
{
typedef struct hfa384x_pdr_hfa3861_shadow
{
typedef struct hfa384x_pdr_hfa3861_ifrf
{
typedef struct hfa384x_pdr_hfa3861_chcalsp
{
typedef struct hfa384x_pdr_hfa3861_chcali
{
typedef struct hfa384x_pdr_hfa3861_nic_config
{
typedef struct hfa384x_pdr_hfa3861_manf_testsp
{
typedef struct hfa384x_pdr_hfa3861_manf_testi
{
typedef struct hfa384x_end_of_pda
{
typedef struct hfa384x_pdrec
{
union pdr {
#ifdef __KERNEL__
/*--------------------------------------------------------------------
--- MAC state structure, argument to all functions --
--- Also, a collection of support types --
--------------------------------------------------------------------*/
struct hfa384x; /* forward declaration,grrr */
typedef void (*ctlx_usercb_t)(
void *ctlxresult,
void *usercb_data);
#if (WLAN_HOSTIF == WLAN_USB)
/* USB Control Exchange (CTLX):
* A queue of the structure below is maintained for all of the
*/
/* The following hfa384x_async_* structures are arguments to
* the usercb() for the different CTLX types.
*/
typedef struct hfa384x_async_cmdresult
{
typedef struct hfa384x_async_rridresult
{
void *riddata;
typedef struct hfa384x_async_wridresult
{
typedef struct hfa384x_async_rmemresult
{
typedef struct hfa384x_async_wmemresult
{
typedef struct hfa384x_usbctlx
{
int wanna_wakeup; /* Flag to wakeup sync calls */
int is_async; /* Q'd by sync or async call */
void *usercb_data; /* at CTLX completion */
int variant; /* Identifies cmd variant */
/* hfa384x_usbcmd_t.state values */
#define HFA384x_USBCTLX_COMPLETE 0 /* Exchange successfully complete */
typedef struct hfa384x_usbctlxq
{
#endif
typedef struct hfa484x_metacmd
{
#if 0 //XXX cmd irq stuff
int bulklen; /* how much to copy from BAP */
char *bulkdata; /* And to where? */
#endif
typedef struct hfa384x
{
#if (WLAN_HOSTIF != WLAN_USB)
/* Resource config */
#else
/* USB support data */
struct usb_device *usb;
void *usbcontext; /* actually a wlandev */
int rxurb_posted;
int endp_in;
int endp_out;
#endif /* !USB */
int sniff_fcs;
int sniff_channel;
int sniff_truncate;
/* Controller state */
#if (WLAN_HOSTIF != WLAN_USB)
#endif /* !USB */
/* Download support */
#if (WLAN_HOSTIF != WLAN_USB)
int cmdflag; /* wait queue flag */
/* BAP support */
/* MAC buffer ids */
struct semaphore infofid_sem;
#endif /* !USB */
int scanflag; /* to signal scan comlete */
int join_ap; /* are we joined to a specific ap */
int join_retries; /* number of join retries till we fail */
} hfa384x_t;
/*=============================================================*/
/*--- Function Declarations -----------------------------------*/
/*=============================================================*/
#if (WLAN_HOSTIF == WLAN_USB)
void
struct usb_device *usb,
void *usbcontext);
#else
void
#endif
void
int irq,
void *dev_id,
int
int
int
int
int
int
int
int
int
int
int
void
void *usercb_data);
int
int
int
int
int
int
int
int
int
int
int
int
int
void
void *buf,
void *usercb_data);
int
int
int
hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb, p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep);
int
int
int
int
int
int
int
int
int
int
int
int
int
int
int
void *buf,
int
void *buf,
void
void *buf,
void
void *buf,
#if (WLAN_HOSTIF != WLAN_USB)
/*
HFA384x is a LITTLE ENDIAN part.
the _noswap variants do not perform a byte-swap on the data.
*/
static inline UINT16
static inline void
static inline UINT16
static inline void
#ifdef REVERSE_ENDIAN
#else
#define hfa384x_getreg __hfa384x_getreg
#define hfa384x_setreg __hfa384x_setreg
#endif
/*----------------------------------------------------------------
* hfa384x_getreg
*
* Retrieve the value of one of the MAC registers. Done here
* because different PRISM2 MAC parts use different buses and such.
* NOTE: This function returns the value in HOST ORDER!!!!!!
*
* Arguments:
* hw MAC part structure
* reg Register identifier (offset for I/O based i/f)
*
* Returns:
* Value from the register in HOST ORDER!!!!
----------------------------------------------------------------*/
static inline UINT16
{
/* printk(KERN_DEBUG "Reading from 0x%0x\n", hw->membase + reg); */
#endif
}
/*----------------------------------------------------------------
* hfa384x_setreg
*
* Set the value of one of the MAC registers. Done here
* because different PRISM2 MAC parts use different buses and such.
* NOTE: This function assumes the value is in HOST ORDER!!!!!!
*
* Arguments:
* hw MAC part structure
* val Value, in HOST ORDER!!, to put in the register
* reg Register identifier (offset for I/O based i/f)
*
* Returns:
* Nothing
----------------------------------------------------------------*/
static inline void
{
return;
return;
#endif
}
/*----------------------------------------------------------------
* hfa384x_getreg_noswap
*
* Retrieve the value of one of the MAC registers. Done here
* because different PRISM2 MAC parts use different buses and such.
*
* Arguments:
* hw MAC part structure
* reg Register identifier (offset for I/O based i/f)
*
* Returns:
* Value from the register.
----------------------------------------------------------------*/
static inline UINT16
{
#endif
}
/*----------------------------------------------------------------
* hfa384x_setreg_noswap
*
* Set the value of one of the MAC registers. Done here
* because different PRISM2 MAC parts use different buses and such.
*
* Arguments:
* hw MAC part structure
* val Value to put in the register
* reg Register identifier (offset for I/O based i/f)
*
* Returns:
* Nothing
----------------------------------------------------------------*/
static inline void
{
return;
return;
#endif
}
#endif /* WLAN_HOSTIF != WLAN_USB */
#endif /* __KERNEL__ */
#endif /* _HFA384x_H */