linux/drivers/net/wireless/intel/ipw2x00/ipw2100.h

/* SPDX-License-Identifier: GPL-2.0-only */
/******************************************************************************

  Copyright(c) 2003 - 2006 Intel Corporation. All rights reserved.


  Contact Information:
  Intel Linux Wireless <[email protected]>
  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497

******************************************************************************/
#ifndef _IPW2100_H
#define _IPW2100_H

#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/list.h>
#include <linux/delay.h>
#include <linux/skbuff.h>
#include <asm/io.h>
#include <linux/socket.h>
#include <linux/if_arp.h>
#include <linux/wireless.h>
#include <net/iw_handler.h>	// new driver API

#ifdef CONFIG_IPW2100_MONITOR
#include <net/ieee80211_radiotap.h>
#endif

#include <linux/workqueue.h>
#include <linux/mutex.h>

#include "libipw.h"

struct ipw2100_priv;
struct ipw2100_tx_packet;
struct ipw2100_rx_packet;

#define IPW_DL_UNINIT
#define IPW_DL_NONE
#define IPW_DL_ALL

/*
 * To use the debug system;
 *
 * If you are defining a new debug classification, simply add it to the #define
 * list here in the form of:
 *
 * #define IPW_DL_xxxx VALUE
 *
 * shifting value to the left one bit from the previous entry.  xxxx should be
 * the name of the classification (for example, WEP)
 *
 * You then need to either add a IPW2100_xxxx_DEBUG() macro definition for your
 * classification, or use IPW_DEBUG(IPW_DL_xxxx, ...) whenever you want
 * to send output to that classification.
 *
 * To add your debug level to the list of levels seen when you perform
 *
 * % cat /proc/net/ipw2100/debug_level
 *
 * you simply need to add your entry to the ipw2100_debug_levels array.
 *
 * If you do not see debug_level in /proc/net/ipw2100 then you do not have
 * CONFIG_IPW2100_DEBUG defined in your kernel configuration
 *
 */

#define IPW_DL_ERROR
#define IPW_DL_WARNING
#define IPW_DL_INFO
#define IPW_DL_WX
#define IPW_DL_HC
#define IPW_DL_STATE

#define IPW_DL_NOTIF
#define IPW_DL_SCAN
#define IPW_DL_ASSOC
#define IPW_DL_DROP

#define IPW_DL_IOCTL
#define IPW_DL_RF_KILL

#define IPW_DL_MANAGE
#define IPW_DL_FW

#define IPW_DL_FRAG
#define IPW_DL_WEP
#define IPW_DL_TX
#define IPW_DL_RX
#define IPW_DL_ISR
#define IPW_DL_IO
#define IPW_DL_TRACE

#define IPW_DEBUG_ERROR(f, a...)
#define IPW_DEBUG_WARNING(f, a...)
#define IPW_DEBUG_INFO(f...)
#define IPW_DEBUG_WX(f...)
#define IPW_DEBUG_SCAN(f...)
#define IPW_DEBUG_NOTIF(f...)
#define IPW_DEBUG_TRACE(f...)
#define IPW_DEBUG_RX(f...)
#define IPW_DEBUG_TX(f...)
#define IPW_DEBUG_ISR(f...)
#define IPW_DEBUG_MANAGEMENT(f...)
#define IPW_DEBUG_WEP(f...)
#define IPW_DEBUG_HC(f...)
#define IPW_DEBUG_FRAG(f...)
#define IPW_DEBUG_FW(f...)
#define IPW_DEBUG_RF_KILL(f...)
#define IPW_DEBUG_DROP(f...)
#define IPW_DEBUG_IO(f...)
#define IPW_DEBUG_IOCTL(f...)
#define IPW_DEBUG_STATE(f, a...)
#define IPW_DEBUG_ASSOC(f, a...)

enum {};

extern const char *port_type_str[];
extern const char *band_str[];

#define NUMBER_OF_BD_PER_COMMAND_PACKET
#define NUMBER_OF_BD_PER_DATA_PACKET

#define IPW_MAX_BDS
#define NUMBER_OF_OVERHEAD_BDS_PER_PACKETR
#define NUMBER_OF_BDS_TO_LEAVE_FOR_COMMANDS

#define REQUIRED_SPACE_IN_RING_FOR_COMMAND_PACKET

struct bd_status {} __packed;

struct ipw2100_bd {} __packed;

#define IPW_BD_QUEUE_LENGTH(n)
#define IPW_BD_ALIGNMENT(L)

#define IPW_BD_STATUS_TX_FRAME_802_3
#define IPW_BD_STATUS_TX_FRAME_NOT_LAST_FRAGMENT
#define IPW_BD_STATUS_TX_FRAME_COMMAND
#define IPW_BD_STATUS_TX_FRAME_802_11
#define IPW_BD_STATUS_TX_INTERRUPT_ENABLE

struct ipw2100_bd_queue {};

#define RX_QUEUE_LENGTH
#define TX_QUEUE_LENGTH
#define HW_QUEUE_LENGTH

#define TX_PENDED_QUEUE_LENGTH

#define STATUS_TYPE_MASK
#define COMMAND_STATUS_VAL
#define STATUS_CHANGE_VAL
#define P80211_DATA_VAL
#define P8023_DATA_VAL
#define HOST_NOTIFICATION_VAL

#define IPW2100_RSSI_TO_DBM

struct ipw2100_status {} __packed;

struct ipw2100_status_queue {};

#define HOST_COMMAND_PARAMS_REG_LEN
#define CMD_STATUS_PARAMS_REG_LEN

#define IPW_WPA_CAPABILITIES
#define IPW_WPA_LISTENINTERVAL
#define IPW_WPA_AP_ADDRESS

#define IPW_MAX_VAR_IE_LEN

struct ipw2100_wpa_assoc_frame {};

#define IPW_BSS
#define IPW_MONITOR
#define IPW_IBSS

/**
 * @struct _tx_cmd - HWCommand
 * @brief H/W command structure.
 */
struct ipw2100_cmd_header {} __packed;

struct ipw2100_data_header {} __packed;

/* Host command data structure */
struct host_command {} __packed;

ipw2100_reset_event;

enum {};

struct ipw2100_tx_packet {};

struct ipw2100_rx_packet {};

#define FRAG_DISABLED
#define RTS_DISABLED
#define MAX_RTS_THRESHOLD
#define MIN_RTS_THRESHOLD
#define DEFAULT_RTS_THRESHOLD

#define DEFAULT_BEACON_INTERVAL
#define DEFAULT_SHORT_RETRY_LIMIT
#define DEFAULT_LONG_RETRY_LIMIT

struct ipw2100_ordinals {};

/* Host Notification header */
struct ipw2100_notification {} __packed;

#define MAX_KEY_SIZE
#define MAX_KEYS

#define IPW2100_WEP_ENABLE
#define IPW2100_WEP_DROP_CLEAR

#define IPW_NONE_CIPHER
#define IPW_WEP40_CIPHER
#define IPW_TKIP_CIPHER
#define IPW_CCMP_CIPHER
#define IPW_WEP104_CIPHER
#define IPW_CKIP_CIPHER

#define IPW_AUTH_OPEN
#define IPW_AUTH_SHARED
#define IPW_AUTH_LEAP
#define IPW_AUTH_LEAP_CISCO_ID

struct statistic {};

#define INIT_STAT(x)
#define SET_STAT(x,y)
#define INC_STAT(x)
#define DEC_STAT(x)

#define IPW2100_ERROR_QUEUE

/* Power management code: enable or disable? */
enum {};

#define STATUS_POWERED
#define STATUS_CMD_ACTIVE
#define STATUS_RUNNING
#define STATUS_ENABLED
#define STATUS_STOPPING
#define STATUS_INITIALIZED
#define STATUS_ASSOCIATING
#define STATUS_ASSOCIATED
#define STATUS_INT_ENABLED
#define STATUS_RF_KILL_HW
#define STATUS_RF_KILL_SW
#define STATUS_RF_KILL_MASK
#define STATUS_EXIT_PENDING

#define STATUS_SCAN_PENDING
#define STATUS_SCANNING
#define STATUS_SCAN_ABORTING
#define STATUS_SCAN_COMPLETE
#define STATUS_WX_EVENT_PENDING
#define STATUS_RESET_PENDING
#define STATUS_SECURITY_UPDATED

/* Internal NIC states */
#define IPW_STATE_INITIALIZED
#define IPW_STATE_COUNTRY_FOUND
#define IPW_STATE_ASSOCIATED
#define IPW_STATE_ASSN_LOST
#define IPW_STATE_ASSN_CHANGED
#define IPW_STATE_SCAN_COMPLETE
#define IPW_STATE_ENTERED_PSP
#define IPW_STATE_LEFT_PSP
#define IPW_STATE_RF_KILL
#define IPW_STATE_DISABLED
#define IPW_STATE_POWER_DOWN
#define IPW_STATE_SCANNING

#define CFG_STATIC_CHANNEL
#define CFG_STATIC_ESSID
#define CFG_STATIC_BSSID
#define CFG_CUSTOM_MAC
#define CFG_LONG_PREAMBLE
#define CFG_ASSOCIATE
#define CFG_FIXED_RATE
#define CFG_ADHOC_CREATE
#define CFG_PASSIVE_SCAN
#ifdef CONFIG_IPW2100_MONITOR
#define CFG_CRC_CHECK
#endif

#define CAP_SHARED_KEY
#define CAP_PRIVACY_ON

struct ipw2100_priv {};

/*********************************************************
 * Host Command -> From Driver to FW
 *********************************************************/

/**
 * Host command identifiers
 */
#define HOST_COMPLETE
#define SYSTEM_CONFIG
#define SSID
#define MANDATORY_BSSID
#define AUTHENTICATION_TYPE
#define ADAPTER_ADDRESS
#define PORT_TYPE
#define INTERNATIONAL_MODE
#define CHANNEL
#define RTS_THRESHOLD
#define FRAG_THRESHOLD
#define POWER_MODE
#define TX_RATES
#define BASIC_TX_RATES
#define WEP_KEY_INFO
#define WEP_KEY_INDEX
#define WEP_FLAGS
#define ADD_MULTICAST
#define CLEAR_ALL_MULTICAST
#define BEACON_INTERVAL
#define ATIM_WINDOW
#define CLEAR_STATISTICS
#define SEND
#define TX_POWER_INDEX
#define BROADCAST_SCAN
#define CARD_DISABLE
#define PREFERRED_BSSID
#define SET_SCAN_OPTIONS
#define SCAN_DWELL_TIME
#define SWEEP_TABLE
#define AP_OR_STATION_TABLE
#define GROUP_ORDINALS
#define SHORT_RETRY_LIMIT
#define LONG_RETRY_LIMIT

#define HOST_PRE_POWER_DOWN
#define CARD_DISABLE_PHY_OFF
#define MSDU_TX_RATES

/* Rogue AP Detection */
#define SET_STATION_STAT_BITS
#define CLEAR_STATIONS_STAT_BITS
#define LEAP_ROGUE_MODE
#define SET_SECURITY_INFORMATION
#define DISASSOCIATION_BSSID
#define SET_WPA_IE

/* system configuration bit mask: */
#define IPW_CFG_MONITOR
#define IPW_CFG_PREAMBLE_AUTO
#define IPW_CFG_IBSS_AUTO_START
#define IPW_CFG_LOOPBACK
#define IPW_CFG_ANSWER_BCSSID_PROBE
#define IPW_CFG_BT_SIDEBAND_SIGNAL
#define IPW_CFG_802_1x_ENABLE
#define IPW_CFG_BSS_MASK
#define IPW_CFG_IBSS_MASK

#define IPW_SCAN_NOASSOCIATE
#define IPW_SCAN_MIXED_CELL
/* RESERVED (1<<2) */
#define IPW_SCAN_PASSIVE

#define IPW_NIC_FATAL_ERROR
#define IPW_ERROR_ADDR(x)
#define IPW_ERROR_CODE(x)
#define IPW2100_ERR_C3_CORRUPTION
#define IPW2100_ERR_MSG_TIMEOUT
#define IPW2100_ERR_FW_LOAD

#define IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND
#define IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND

#define IPW_MEM_HOST_SHARED_RX_BD_BASE
#define IPW_MEM_HOST_SHARED_RX_STATUS_BASE
#define IPW_MEM_HOST_SHARED_RX_BD_SIZE
#define IPW_MEM_HOST_SHARED_RX_READ_INDEX

#define IPW_MEM_HOST_SHARED_TX_QUEUE_BD_BASE
#define IPW_MEM_HOST_SHARED_TX_QUEUE_BD_SIZE
#define IPW_MEM_HOST_SHARED_TX_QUEUE_READ_INDEX

#define IPW_MEM_HOST_SHARED_RX_WRITE_INDEX

#define IPW_MEM_HOST_SHARED_TX_QUEUE_WRITE_INDEX

#define IPW_MEM_HOST_SHARED_ORDINALS_TABLE_1
#define IPW_MEM_HOST_SHARED_ORDINALS_TABLE_2

#define IPW2100_INTA_TX_TRANSFER
#define IPW2100_INTA_RX_TRANSFER
#define IPW2100_INTA_TX_COMPLETE
#define IPW2100_INTA_EVENT_INTERRUPT
#define IPW2100_INTA_STATUS_CHANGE
#define IPW2100_INTA_BEACON_PERIOD_EXPIRED
#define IPW2100_INTA_SLAVE_MODE_HOST_COMMAND_DONE
#define IPW2100_INTA_FW_INIT_DONE
#define IPW2100_INTA_FW_CALIBRATION_CALC
#define IPW2100_INTA_FATAL_ERROR
#define IPW2100_INTA_PARITY_ERROR

#define IPW_AUX_HOST_RESET_REG_PRINCETON_RESET
#define IPW_AUX_HOST_RESET_REG_FORCE_NMI
#define IPW_AUX_HOST_RESET_REG_PCI_HOST_CLUSTER_FATAL_NMI
#define IPW_AUX_HOST_RESET_REG_CORE_FATAL_NMI
#define IPW_AUX_HOST_RESET_REG_SW_RESET
#define IPW_AUX_HOST_RESET_REG_MASTER_DISABLED
#define IPW_AUX_HOST_RESET_REG_STOP_MASTER

#define IPW_AUX_HOST_GP_CNTRL_BIT_CLOCK_READY
#define IPW_AUX_HOST_GP_CNTRL_BIT_HOST_ALLOWS_STANDBY
#define IPW_AUX_HOST_GP_CNTRL_BIT_INIT_DONE
#define IPW_AUX_HOST_GP_CNTRL_BITS_SYS_CONFIG
#define IPW_AUX_HOST_GP_CNTRL_BIT_BUS_TYPE
#define IPW_AUX_HOST_GP_CNTRL_BIT_BAR0_BLOCK_SIZE
#define IPW_AUX_HOST_GP_CNTRL_BIT_USB_MODE
#define IPW_AUX_HOST_GP_CNTRL_BIT_HOST_FORCES_SYS_CLK
#define IPW_AUX_HOST_GP_CNTRL_BIT_FW_FORCES_SYS_CLK

#define IPW_BIT_GPIO_GPIO1_MASK
#define IPW_BIT_GPIO_GPIO3_MASK
#define IPW_BIT_GPIO_GPIO1_ENABLE
#define IPW_BIT_GPIO_RF_KILL

#define IPW_BIT_GPIO_LED_OFF

#define IPW_REG_DOMAIN_0_OFFSET
#define IPW_REG_DOMAIN_1_OFFSET

#define IPW_REG_INTA
#define IPW_REG_INTA_MASK
#define IPW_REG_INDIRECT_ACCESS_ADDRESS
#define IPW_REG_INDIRECT_ACCESS_DATA
#define IPW_REG_AUTOINCREMENT_ADDRESS
#define IPW_REG_AUTOINCREMENT_DATA
#define IPW_REG_RESET_REG
#define IPW_REG_GP_CNTRL
#define IPW_REG_GPIO
#define IPW_REG_FW_TYPE
#define IPW_REG_FW_VERSION
#define IPW_REG_FW_COMPATIBILITY_VERSION

#define IPW_REG_INDIRECT_ADDR_MASK

#define IPW_INTERRUPT_MASK

#define IPW2100_CONTROL_REG
#define IPW2100_CONTROL_PHY_OFF

#define IPW2100_COMMAND
#define IPW2100_COMMAND_PHY_ON
#define IPW2100_COMMAND_PHY_OFF

/* in DEBUG_AREA, values of memory always 0xd55555d5 */
#define IPW_REG_DOA_DEBUG_AREA_START
#define IPW_REG_DOA_DEBUG_AREA_END
#define IPW_DATA_DOA_DEBUG_VALUE

#define IPW_INTERNAL_REGISTER_HALT_AND_RESET

#define IPW_WAIT_CLOCK_STABILIZATION_DELAY
#define IPW_WAIT_RESET_ARC_COMPLETE_DELAY
#define IPW_WAIT_RESET_MASTER_ASSERT_COMPLETE_DELAY

// BD ring queue read/write difference
#define IPW_BD_QUEUE_W_R_MIN_SPARE

#define IPW_CACHE_LINE_LENGTH_DEFAULT

#define IPW_CARD_DISABLE_PHY_OFF_COMPLETE_WAIT
#define IPW_PREPARE_POWER_DOWN_COMPLETE_WAIT

#define IPW_HEADER_802_11_SIZE
#define IPW_MAX_80211_PAYLOAD_SIZE
#define IPW_MAX_802_11_PAYLOAD_LENGTH
#define IPW_MAX_ACCEPTABLE_TX_FRAME_LENGTH
#define IPW_MIN_ACCEPTABLE_RX_FRAME_LENGTH
#define IPW_MAX_ACCEPTABLE_RX_FRAME_LENGTH

#define IPW_802_11_FCS_LENGTH
#define IPW_RX_NIC_BUFFER_LENGTH

#define IPW_802_11_PAYLOAD_OFFSET

struct ipw2100_rx {} __packed;

/* Bit 0-7 are for 802.11b tx rates - .  Bit 5-7 are reserved */
#define TX_RATE_1_MBIT
#define TX_RATE_2_MBIT
#define TX_RATE_5_5_MBIT
#define TX_RATE_11_MBIT
#define TX_RATE_MASK
#define DEFAULT_TX_RATES

#define IPW_POWER_MODE_CAM
#define IPW_POWER_INDEX_1
#define IPW_POWER_INDEX_2
#define IPW_POWER_INDEX_3
#define IPW_POWER_INDEX_4
#define IPW_POWER_INDEX_5
#define IPW_POWER_AUTO
#define IPW_POWER_MASK
#define IPW_POWER_ENABLED
#define IPW_POWER_LEVEL(x)

#define IPW_TX_POWER_AUTO
#define IPW_TX_POWER_ENHANCED

#define IPW_TX_POWER_DEFAULT
#define IPW_TX_POWER_MIN
#define IPW_TX_POWER_MAX
#define IPW_TX_POWER_MIN_DBM
#define IPW_TX_POWER_MAX_DBM

#define FW_SCAN_DONOT_ASSOCIATE
#define FW_SCAN_PASSIVE

#define REG_MIN_CHANNEL
#define REG_MAX_CHANNEL

#define REG_CHANNEL_MASK
#define IPW_IBSS_11B_DEFAULT_MASK

#define DIVERSITY_EITHER
#define DIVERSITY_ANTENNA_A
#define DIVERSITY_ANTENNA_B

#define HOST_COMMAND_WAIT
#define HOST_COMMAND_NO_WAIT

#define LOCK_NONE
#define LOCK_DRIVER
#define LOCK_FW

#define TYPE_SWEEP_ORD
#define TYPE_IBSS_STTN_ORD
#define TYPE_BSS_AP_ORD
#define TYPE_RAW_BEACON_ENTRY
#define TYPE_CALIBRATION_DATA
#define TYPE_ROGUE_AP_DATA
#define TYPE_ASSOCIATION_REQUEST
#define TYPE_REASSOCIATION_REQUEST

#define HW_FEATURE_RFKILL
#define RF_KILLSWITCH_OFF
#define RF_KILLSWITCH_ON

#define IPW_COMMAND_POOL_SIZE

#define IPW_START_ORD_TAB_1
#define IPW_START_ORD_TAB_2

#define IPW_ORD_TAB_1_ENTRY_SIZE

#define IS_ORDINAL_TABLE_ONE(mgr,id)
#define IS_ORDINAL_TABLE_TWO(mgr,id)

#define BSS_ID_LENGTH

// Fixed size data: Ordinal Table 1
ORDINALTABLE1;

// ordinal table 2
// Variable length data:
#define IPW_FIRST_VARIABLE_LENGTH_ORDINAL

ORDINALTABLE2;		// NS - means Not Supported by FW

#define IPW_LAST_VARIABLE_LENGTH_ORDINAL

#ifndef WIRELESS_SPY
#define WIRELESS_SPY
#endif

#define IPW_HOST_FW_SHARED_AREA0
#define IPW_HOST_FW_SHARED_AREA0_END

#define IPW_HOST_FW_SHARED_AREA1
#define IPW_HOST_FW_SHARED_AREA1_END

#define IPW_HOST_FW_SHARED_AREA2
#define IPW_HOST_FW_SHARED_AREA2_END

#define IPW_HOST_FW_SHARED_AREA3
#define IPW_HOST_FW_SHARED_AREA3_END

#define IPW_HOST_FW_INTERRUPT_AREA
#define IPW_HOST_FW_INTERRUPT_AREA_END

struct ipw2100_fw_chunk {};

struct ipw2100_fw_chunk_set {};

struct ipw2100_fw {};

#define MAX_FW_VERSION_LEN

#endif				/* _IPW2100_H */