From 91e1747384b80813c2a6c7a9d2dd99722d5b9e1e Mon Sep 17 00:00:00 2001 From: Ian Schram Date: Thu, 25 Oct 2007 17:15:23 +0800 Subject: iwlwifi: rename iwl_eeprom_aqcuire_semaphore to _acquire_ Correct the spelling of aqcuire. Signed-off-by: Ian Schram Signed-off-by: Zhu Yi Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index 4c700812b45..b31a7e4b7d7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -32,7 +32,7 @@ struct sta_ht_info; /* * Forward declare iwl-4965.c functions for iwl-base.c */ -extern int iwl_eeprom_aqcuire_semaphore(struct iwl_priv *priv); +extern int iwl_eeprom_acquire_semaphore(struct iwl_priv *priv); extern void iwl_eeprom_release_semaphore(struct iwl_priv *priv); extern int iwl4965_tx_queue_update_wr_ptr(struct iwl_priv *priv, -- cgit v1.2.3 From 5d08cd1dfdc57dc834c47eb9f023fcf861f3d6bf Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 25 Oct 2007 17:15:50 +0800 Subject: iwlwifi: keep 3945 and 4965 headers separate The iwl3945 and iwl4965 devices share some common structure, but with a lot of difference split all over. Currently the two drivers share a lot of headers and use ugly preprocessor magic to manage the difference. This patch keeps two entirely separate copies of the headers to get rid of these hacks an ease future development. Signed-off-by: Christoph Hellwig Signed-off-by: Zhu Yi Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 1019 +++++++++++++++++++++++++++++++ 1 file changed, 1019 insertions(+) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index b31a7e4b7d7..bf174d3b8fb 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -26,6 +26,707 @@ #ifndef __iwl_4965_h__ #define __iwl_4965_h__ +#include /* for struct pci_device_id */ +#include +#include + +struct iwl_priv; + +/* Hardware specific file defines the PCI IDs table for that hardware module */ +extern struct pci_device_id iwl_hw_card_ids[]; + +#define DRV_NAME "iwl4965" +#include "iwl-4965-hw.h" +#include "iwl-prph.h" +#include "iwl-4965-debug.h" + +/* Default noise level to report when noise measurement is not available. + * This may be because we're: + * 1) Not associated (4965, no beacon statistics being sent to driver) + * 2) Scanning (noise measurement does not apply to associated channel) + * 3) Receiving CCK (3945 delivers noise info only for OFDM frames) + * Use default noise value of -127 ... this is below the range of measurable + * Rx dBm for either 3945 or 4965, so it can indicate "unmeasurable" to user. + * Also, -127 works better than 0 when averaging frames with/without + * noise info (e.g. averaging might be done in app); measured dBm values are + * always negative ... using a negative value as the default keeps all + * averages within an s8's (used in some apps) range of negative values. */ +#define IWL_NOISE_MEAS_NOT_AVAILABLE (-127) + +/* Module parameters accessible from iwl-*.c */ +extern int iwl_param_hwcrypto; +extern int iwl_param_queues_num; + +enum iwl_antenna { + IWL_ANTENNA_DIVERSITY, + IWL_ANTENNA_MAIN, + IWL_ANTENNA_AUX +}; + +/* + * RTS threshold here is total size [2347] minus 4 FCS bytes + * Per spec: + * a value of 0 means RTS on all data/management packets + * a value > max MSDU size means no RTS + * else RTS for data/management frames where MPDU is larger + * than RTS value. + */ +#define DEFAULT_RTS_THRESHOLD 2347U +#define MIN_RTS_THRESHOLD 0U +#define MAX_RTS_THRESHOLD 2347U +#define MAX_MSDU_SIZE 2304U +#define MAX_MPDU_SIZE 2346U +#define DEFAULT_BEACON_INTERVAL 100U +#define DEFAULT_SHORT_RETRY_LIMIT 7U +#define DEFAULT_LONG_RETRY_LIMIT 4U + +struct iwl_rx_mem_buffer { + dma_addr_t dma_addr; + struct sk_buff *skb; + struct list_head list; +}; + +struct iwl_rt_rx_hdr { + struct ieee80211_radiotap_header rt_hdr; + __le64 rt_tsf; /* TSF */ + u8 rt_flags; /* radiotap packet flags */ + u8 rt_rate; /* rate in 500kb/s */ + __le16 rt_channelMHz; /* channel in MHz */ + __le16 rt_chbitmask; /* channel bitfield */ + s8 rt_dbmsignal; /* signal in dBm, kluged to signed */ + s8 rt_dbmnoise; + u8 rt_antenna; /* antenna number */ + u8 payload[0]; /* payload... */ +} __attribute__ ((packed)); + +struct iwl_rt_tx_hdr { + struct ieee80211_radiotap_header rt_hdr; + u8 rt_rate; /* rate in 500kb/s */ + __le16 rt_channel; /* channel in mHz */ + __le16 rt_chbitmask; /* channel bitfield */ + s8 rt_dbmsignal; /* signal in dBm, kluged to signed */ + u8 rt_antenna; /* antenna number */ + u8 payload[0]; /* payload... */ +} __attribute__ ((packed)); + +/* + * Generic queue structure + * + * Contains common data for Rx and Tx queues + */ +struct iwl_queue { + int n_bd; /* number of BDs in this queue */ + int write_ptr; /* 1-st empty entry (index) host_w*/ + int read_ptr; /* last used entry (index) host_r*/ + dma_addr_t dma_addr; /* physical addr for BD's */ + int n_window; /* safe queue window */ + u32 id; + int low_mark; /* low watermark, resume queue if free + * space more than this */ + int high_mark; /* high watermark, stop queue if free + * space less than this */ +} __attribute__ ((packed)); + +#define MAX_NUM_OF_TBS (20) + +struct iwl_tx_info { + struct ieee80211_tx_status status; + struct sk_buff *skb[MAX_NUM_OF_TBS]; +}; + +/** + * struct iwl_tx_queue - Tx Queue for DMA + * @need_update: need to update read/write index + * @shed_retry: queue is HT AGG enabled + * + * Queue consists of circular buffer of BD's and required locking structures. + */ +struct iwl_tx_queue { + struct iwl_queue q; + struct iwl_tfd_frame *bd; + struct iwl_cmd *cmd; + dma_addr_t dma_addr_cmd; + struct iwl_tx_info *txb; + int need_update; + int sched_retry; + int active; +}; + +#define IWL_NUM_SCAN_RATES (2) + +struct iwl_channel_tgd_info { + u8 type; + s8 max_power; +}; + +struct iwl_channel_tgh_info { + s64 last_radar_time; +}; + +/* current Tx power values to use, one for each rate for each channel. + * requested power is limited by: + * -- regulatory EEPROM limits for this channel + * -- hardware capabilities (clip-powers) + * -- spectrum management + * -- user preference (e.g. iwconfig) + * when requested power is set, base power index must also be set. */ +struct iwl_channel_power_info { + struct iwl_tx_power tpc; /* actual radio and DSP gain settings */ + s8 power_table_index; /* actual (compenst'd) index into gain table */ + s8 base_power_index; /* gain index for power at factory temp. */ + s8 requested_power; /* power (dBm) requested for this chnl/rate */ +}; + +/* current scan Tx power values to use, one for each scan rate for each + * channel. */ +struct iwl_scan_power_info { + struct iwl_tx_power tpc; /* actual radio and DSP gain settings */ + s8 power_table_index; /* actual (compenst'd) index into gain table */ + s8 requested_power; /* scan pwr (dBm) requested for chnl/rate */ +}; + +/* Channel unlock period is 15 seconds. If no beacon or probe response + * has been received within 15 seconds on a locked channel then the channel + * remains locked. */ +#define TX_UNLOCK_PERIOD 15 + +/* CSA lock period is 15 seconds. If a CSA has been received on a channel in + * the last 15 seconds, the channel is locked */ +#define CSA_LOCK_PERIOD 15 +/* + * One for each channel, holds all channel setup data + * Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant + * with one another! + */ +#define IWL4965_MAX_RATE (33) + +struct iwl_channel_info { + struct iwl_channel_tgd_info tgd; + struct iwl_channel_tgh_info tgh; + struct iwl_eeprom_channel eeprom; /* EEPROM regulatory limit */ + struct iwl_eeprom_channel fat_eeprom; /* EEPROM regulatory limit for + * FAT channel */ + + u8 channel; /* channel number */ + u8 flags; /* flags copied from EEPROM */ + s8 max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */ + s8 curr_txpow; /* (dBm) regulatory/spectrum/user (not h/w) */ + s8 min_power; /* always 0 */ + s8 scan_power; /* (dBm) regul. eeprom, direct scans, any rate */ + + u8 group_index; /* 0-4, maps channel to group1/2/3/4/5 */ + u8 band_index; /* 0-4, maps channel to band1/2/3/4/5 */ + u8 phymode; /* MODE_IEEE80211{A,B,G} */ + + /* Radio/DSP gain settings for each "normal" data Tx rate. + * These include, in addition to RF and DSP gain, a few fields for + * remembering/modifying gain settings (indexes). */ + struct iwl_channel_power_info power_info[IWL4965_MAX_RATE]; + + /* FAT channel info */ + s8 fat_max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */ + s8 fat_curr_txpow; /* (dBm) regulatory/spectrum/user (not h/w) */ + s8 fat_min_power; /* always 0 */ + s8 fat_scan_power; /* (dBm) eeprom, direct scans, any rate */ + u8 fat_flags; /* flags copied from EEPROM */ + u8 fat_extension_channel; + + /* Radio/DSP gain settings for each scan rate, for directed scans. */ + struct iwl_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES]; +}; + +struct iwl_clip_group { + /* maximum power level to prevent clipping for each rate, derived by + * us from this band's saturation power in EEPROM */ + const s8 clip_powers[IWL_MAX_RATES]; +}; + +#include "iwl-4965-rs.h" + +#define IWL_TX_FIFO_AC0 0 +#define IWL_TX_FIFO_AC1 1 +#define IWL_TX_FIFO_AC2 2 +#define IWL_TX_FIFO_AC3 3 +#define IWL_TX_FIFO_HCCA_1 5 +#define IWL_TX_FIFO_HCCA_2 6 +#define IWL_TX_FIFO_NONE 7 + +/* Minimum number of queues. MAX_NUM is defined in hw specific files */ +#define IWL_MIN_NUM_QUEUES 4 + +/* Power management (not Tx power) structures */ + +struct iwl_power_vec_entry { + struct iwl_powertable_cmd cmd; + u8 no_dtim; +}; +#define IWL_POWER_RANGE_0 (0) +#define IWL_POWER_RANGE_1 (1) + +#define IWL_POWER_MODE_CAM 0x00 /* Continuously Aware Mode, always on */ +#define IWL_POWER_INDEX_3 0x03 +#define IWL_POWER_INDEX_5 0x05 +#define IWL_POWER_AC 0x06 +#define IWL_POWER_BATTERY 0x07 +#define IWL_POWER_LIMIT 0x07 +#define IWL_POWER_MASK 0x0F +#define IWL_POWER_ENABLED 0x10 +#define IWL_POWER_LEVEL(x) ((x) & IWL_POWER_MASK) + +struct iwl_power_mgr { + spinlock_t lock; + struct iwl_power_vec_entry pwr_range_0[IWL_POWER_AC]; + struct iwl_power_vec_entry pwr_range_1[IWL_POWER_AC]; + u8 active_index; + u32 dtim_val; +}; + +#define IEEE80211_DATA_LEN 2304 +#define IEEE80211_4ADDR_LEN 30 +#define IEEE80211_HLEN (IEEE80211_4ADDR_LEN) +#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) + +struct iwl_frame { + union { + struct ieee80211_hdr frame; + struct iwl_tx_beacon_cmd beacon; + u8 raw[IEEE80211_FRAME_LEN]; + u8 cmd[360]; + } u; + struct list_head list; +}; + +#define SEQ_TO_QUEUE(x) ((x >> 8) & 0xbf) +#define QUEUE_TO_SEQ(x) ((x & 0xbf) << 8) +#define SEQ_TO_INDEX(x) (x & 0xff) +#define INDEX_TO_SEQ(x) (x & 0xff) +#define SEQ_HUGE_FRAME (0x4000) +#define SEQ_RX_FRAME __constant_cpu_to_le16(0x8000) +#define SEQ_TO_SN(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4) +#define SN_TO_SEQ(ssn) (((ssn) << 4) & IEEE80211_SCTL_SEQ) +#define MAX_SN ((IEEE80211_SCTL_SEQ) >> 4) + +enum { + /* CMD_SIZE_NORMAL = 0, */ + CMD_SIZE_HUGE = (1 << 0), + /* CMD_SYNC = 0, */ + CMD_ASYNC = (1 << 1), + /* CMD_NO_SKB = 0, */ + CMD_WANT_SKB = (1 << 2), +}; + +struct iwl_cmd; +struct iwl_priv; + +struct iwl_cmd_meta { + struct iwl_cmd_meta *source; + union { + struct sk_buff *skb; + int (*callback)(struct iwl_priv *priv, + struct iwl_cmd *cmd, struct sk_buff *skb); + } __attribute__ ((packed)) u; + + /* The CMD_SIZE_HUGE flag bit indicates that the command + * structure is stored at the end of the shared queue memory. */ + u32 flags; + +} __attribute__ ((packed)); + +struct iwl_cmd { + struct iwl_cmd_meta meta; + struct iwl_cmd_header hdr; + union { + struct iwl_addsta_cmd addsta; + struct iwl_led_cmd led; + u32 flags; + u8 val8; + u16 val16; + u32 val32; + struct iwl_bt_cmd bt; + struct iwl_rxon_time_cmd rxon_time; + struct iwl_powertable_cmd powertable; + struct iwl_qosparam_cmd qosparam; + struct iwl_tx_cmd tx; + struct iwl_tx_beacon_cmd tx_beacon; + struct iwl_rxon_assoc_cmd rxon_assoc; + u8 *indirect; + u8 payload[360]; + } __attribute__ ((packed)) cmd; +} __attribute__ ((packed)); + +struct iwl_host_cmd { + u8 id; + u16 len; + struct iwl_cmd_meta meta; + const void *data; +}; + +#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_cmd) - \ + sizeof(struct iwl_cmd_meta)) + +/* + * RX related structures and functions + */ +#define RX_FREE_BUFFERS 64 +#define RX_LOW_WATERMARK 8 + +#define SUP_RATE_11A_MAX_NUM_CHANNELS 8 +#define SUP_RATE_11B_MAX_NUM_CHANNELS 4 +#define SUP_RATE_11G_MAX_NUM_CHANNELS 12 + +/** + * struct iwl_rx_queue - Rx queue + * @processed: Internal index to last handled Rx packet + * @read: Shared index to newest available Rx buffer + * @write: Shared index to oldest written Rx packet + * @free_count: Number of pre-allocated buffers in rx_free + * @rx_free: list of free SKBs for use + * @rx_used: List of Rx buffers with no SKB + * @need_update: flag to indicate we need to update read/write index + * + * NOTE: rx_free and rx_used are used as a FIFO for iwl_rx_mem_buffers + */ +struct iwl_rx_queue { + __le32 *bd; + dma_addr_t dma_addr; + struct iwl_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS]; + struct iwl_rx_mem_buffer *queue[RX_QUEUE_SIZE]; + u32 processed; + u32 read; + u32 write; + u32 free_count; + struct list_head rx_free; + struct list_head rx_used; + int need_update; + spinlock_t lock; +}; + +#define IWL_SUPPORTED_RATES_IE_LEN 8 + +#define SCAN_INTERVAL 100 + +#define MAX_A_CHANNELS 252 +#define MIN_A_CHANNELS 7 + +#define MAX_B_CHANNELS 14 +#define MIN_B_CHANNELS 1 + +#define STATUS_HCMD_ACTIVE 0 /* host command in progress */ +#define STATUS_INT_ENABLED 1 +#define STATUS_RF_KILL_HW 2 +#define STATUS_RF_KILL_SW 3 +#define STATUS_INIT 4 +#define STATUS_ALIVE 5 +#define STATUS_READY 6 +#define STATUS_TEMPERATURE 7 +#define STATUS_GEO_CONFIGURED 8 +#define STATUS_EXIT_PENDING 9 +#define STATUS_IN_SUSPEND 10 +#define STATUS_STATISTICS 11 +#define STATUS_SCANNING 12 +#define STATUS_SCAN_ABORTING 13 +#define STATUS_SCAN_HW 14 +#define STATUS_POWER_PMI 15 +#define STATUS_FW_ERROR 16 + +#define MAX_TID_COUNT 9 + +#define IWL_INVALID_RATE 0xFF +#define IWL_INVALID_VALUE -1 + +#ifdef CONFIG_IWLWIFI_HT +#ifdef CONFIG_IWLWIFI_HT_AGG +struct iwl_ht_agg { + u16 txq_id; + u16 frame_count; + u16 wait_for_ba; + u16 start_idx; + u32 bitmap0; + u32 bitmap1; + u32 rate_n_flags; +}; +#endif /* CONFIG_IWLWIFI_HT_AGG */ +#endif /* CONFIG_IWLWIFI_HT */ + +struct iwl_tid_data { + u16 seq_number; +#ifdef CONFIG_IWLWIFI_HT +#ifdef CONFIG_IWLWIFI_HT_AGG + struct iwl_ht_agg agg; +#endif /* CONFIG_IWLWIFI_HT_AGG */ +#endif /* CONFIG_IWLWIFI_HT */ +}; + +struct iwl_hw_key { + enum ieee80211_key_alg alg; + int keylen; + u8 key[32]; +}; + +union iwl_ht_rate_supp { + u16 rates; + struct { + u8 siso_rate; + u8 mimo_rate; + }; +}; + +#ifdef CONFIG_IWLWIFI_HT +#define CFG_HT_RX_AMPDU_FACTOR_DEF (0x3) +#define HT_IE_MAX_AMSDU_SIZE_4K (0) +#define CFG_HT_MPDU_DENSITY_2USEC (0x5) +#define CFG_HT_MPDU_DENSITY_DEF CFG_HT_MPDU_DENSITY_2USEC + +struct sta_ht_info { + u8 is_ht; + u16 rx_mimo_ps_mode; + u16 tx_mimo_ps_mode; + u16 control_channel; + u8 max_amsdu_size; + u8 ampdu_factor; + u8 mpdu_density; + u8 operating_mode; + u8 supported_chan_width; + u8 extension_chan_offset; + u8 is_green_field; + u8 sgf; + u8 supp_rates[16]; + u8 tx_chan_width; + u8 chan_width_cap; +}; +#endif /*CONFIG_IWLWIFI_HT */ + +#ifdef CONFIG_IWLWIFI_QOS + +union iwl_qos_capabity { + struct { + u8 edca_count:4; /* bit 0-3 */ + u8 q_ack:1; /* bit 4 */ + u8 queue_request:1; /* bit 5 */ + u8 txop_request:1; /* bit 6 */ + u8 reserved:1; /* bit 7 */ + } q_AP; + struct { + u8 acvo_APSD:1; /* bit 0 */ + u8 acvi_APSD:1; /* bit 1 */ + u8 ac_bk_APSD:1; /* bit 2 */ + u8 ac_be_APSD:1; /* bit 3 */ + u8 q_ack:1; /* bit 4 */ + u8 max_len:2; /* bit 5-6 */ + u8 more_data_ack:1; /* bit 7 */ + } q_STA; + u8 val; +}; + +/* QoS structures */ +struct iwl_qos_info { + int qos_enable; + int qos_active; + union iwl_qos_capabity qos_cap; + struct iwl_qosparam_cmd def_qos_parm; +}; +#endif /*CONFIG_IWLWIFI_QOS */ + +#define STA_PS_STATUS_WAKE 0 +#define STA_PS_STATUS_SLEEP 1 + +struct iwl_station_entry { + struct iwl_addsta_cmd sta; + struct iwl_tid_data tid[MAX_TID_COUNT]; + u8 used; + u8 ps_status; + struct iwl_hw_key keyinfo; +}; + +/* one for each uCode image (inst/data, boot/init/runtime) */ +struct fw_desc { + void *v_addr; /* access by driver */ + dma_addr_t p_addr; /* access by card's busmaster DMA */ + u32 len; /* bytes */ +}; + +/* uCode file layout */ +struct iwl_ucode { + __le32 ver; /* major/minor/subminor */ + __le32 inst_size; /* bytes of runtime instructions */ + __le32 data_size; /* bytes of runtime data */ + __le32 init_size; /* bytes of initialization instructions */ + __le32 init_data_size; /* bytes of initialization data */ + __le32 boot_size; /* bytes of bootstrap instructions */ + u8 data[0]; /* data in same order as "size" elements */ +}; + +#define IWL_IBSS_MAC_HASH_SIZE 32 + +struct iwl_ibss_seq { + u8 mac[ETH_ALEN]; + u16 seq_num; + u16 frag_num; + unsigned long packet_time; + struct list_head list; +}; + +struct iwl_driver_hw_info { + u16 max_txq_num; + u16 ac_queue_count; + u16 tx_cmd_len; + u16 max_rxq_size; + u32 rx_buffer_size; + u16 max_rxq_log; + u8 max_stations; + u8 bcast_sta_id; + void *shared_virt; + dma_addr_t shared_phys; +}; + + +#define STA_FLG_RTS_MIMO_PROT_MSK __constant_cpu_to_le32(1 << 17) +#define STA_FLG_AGG_MPDU_8US_MSK __constant_cpu_to_le32(1 << 18) +#define STA_FLG_MAX_AGG_SIZE_POS (19) +#define STA_FLG_MAX_AGG_SIZE_MSK __constant_cpu_to_le32(3 << 19) +#define STA_FLG_FAT_EN_MSK __constant_cpu_to_le32(1 << 21) +#define STA_FLG_MIMO_DIS_MSK __constant_cpu_to_le32(1 << 22) +#define STA_FLG_AGG_MPDU_DENSITY_POS (23) +#define STA_FLG_AGG_MPDU_DENSITY_MSK __constant_cpu_to_le32(7 << 23) +#define HT_SHORT_GI_20MHZ_ONLY (1 << 0) +#define HT_SHORT_GI_40MHZ_ONLY (1 << 1) + + +#define IWL_RX_HDR(x) ((struct iwl_rx_frame_hdr *)(\ + x->u.rx_frame.stats.payload + \ + x->u.rx_frame.stats.phy_count)) +#define IWL_RX_END(x) ((struct iwl_rx_frame_end *)(\ + IWL_RX_HDR(x)->payload + \ + le16_to_cpu(IWL_RX_HDR(x)->len))) +#define IWL_RX_STATS(x) (&x->u.rx_frame.stats) +#define IWL_RX_DATA(x) (IWL_RX_HDR(x)->payload) + + +/****************************************************************************** + * + * Functions implemented in iwl-base.c which are forward declared here + * for use by iwl-*.c + * + *****************************************************************************/ +struct iwl_addsta_cmd; +extern int iwl_send_add_station(struct iwl_priv *priv, + struct iwl_addsta_cmd *sta, u8 flags); +extern u8 iwl_add_station(struct iwl_priv *priv, const u8 *bssid, + int is_ap, u8 flags); +extern int iwl_is_network_packet(struct iwl_priv *priv, + struct ieee80211_hdr *header); +extern int iwl_power_init_handle(struct iwl_priv *priv); +extern int iwl_eeprom_init(struct iwl_priv *priv); +#ifdef CONFIG_IWLWIFI_DEBUG +extern void iwl_report_frame(struct iwl_priv *priv, + struct iwl_rx_packet *pkt, + struct ieee80211_hdr *header, int group100); +#else +static inline void iwl_report_frame(struct iwl_priv *priv, + struct iwl_rx_packet *pkt, + struct ieee80211_hdr *header, + int group100) {} +#endif +extern void iwl_handle_data_packet_monitor(struct iwl_priv *priv, + struct iwl_rx_mem_buffer *rxb, + void *data, short len, + struct ieee80211_rx_status *stats, + u16 phy_flags); +extern int is_duplicate_packet(struct iwl_priv *priv, struct ieee80211_hdr + *header); +extern int iwl_rx_queue_alloc(struct iwl_priv *priv); +extern void iwl_rx_queue_reset(struct iwl_priv *priv, + struct iwl_rx_queue *rxq); +extern int iwl_calc_db_from_ratio(int sig_ratio); +extern int iwl_calc_sig_qual(int rssi_dbm, int noise_dbm); +extern int iwl_tx_queue_init(struct iwl_priv *priv, + struct iwl_tx_queue *txq, int count, u32 id); +extern void iwl_rx_replenish(void *data); +extern void iwl_tx_queue_free(struct iwl_priv *priv, struct iwl_tx_queue *txq); +extern int iwl_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len, + const void *data); +extern int __must_check iwl_send_cmd(struct iwl_priv *priv, + struct iwl_host_cmd *cmd); +extern unsigned int iwl_fill_beacon_frame(struct iwl_priv *priv, + struct ieee80211_hdr *hdr, + const u8 *dest, int left); +extern int iwl_rx_queue_update_write_ptr(struct iwl_priv *priv, + struct iwl_rx_queue *q); +extern int iwl_send_statistics_request(struct iwl_priv *priv); +extern void iwl_set_decrypted_flag(struct iwl_priv *priv, struct sk_buff *skb, + u32 decrypt_res, + struct ieee80211_rx_status *stats); +extern __le16 *ieee80211_get_qos_ctrl(struct ieee80211_hdr *hdr); + +extern const u8 BROADCAST_ADDR[ETH_ALEN]; + +/* + * Currently used by iwl-3945-rs... look at restructuring so that it doesn't + * call this... todo... fix that. +*/ +extern u8 iwl_sync_station(struct iwl_priv *priv, int sta_id, + u16 tx_rate, u8 flags); + +/****************************************************************************** + * + * Functions implemented in iwl-[34]*.c which are forward declared here + * for use by iwl-base.c + * + * NOTE: The implementation of these functions are hardware specific + * which is why they are in the hardware specific files (vs. iwl-base.c) + * + * Naming convention -- + * iwl_ <-- Its part of iwlwifi (should be changed to iwl_) + * iwl_hw_ <-- Hardware specific (implemented in iwl-XXXX.c by all HW) + * iwlXXXX_ <-- Hardware specific (implemented in iwl-XXXX.c for XXXX) + * iwl_bg_ <-- Called from work queue context + * iwl_mac_ <-- mac80211 callback + * + ****************************************************************************/ +extern void iwl_hw_rx_handler_setup(struct iwl_priv *priv); +extern void iwl_hw_setup_deferred_work(struct iwl_priv *priv); +extern void iwl_hw_cancel_deferred_work(struct iwl_priv *priv); +extern int iwl_hw_rxq_stop(struct iwl_priv *priv); +extern int iwl_hw_set_hw_setting(struct iwl_priv *priv); +extern int iwl_hw_nic_init(struct iwl_priv *priv); +extern int iwl_hw_nic_stop_master(struct iwl_priv *priv); +extern void iwl_hw_txq_ctx_free(struct iwl_priv *priv); +extern void iwl_hw_txq_ctx_stop(struct iwl_priv *priv); +extern int iwl_hw_nic_reset(struct iwl_priv *priv); +extern int iwl_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv, void *tfd, + dma_addr_t addr, u16 len); +extern int iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq); +extern int iwl_hw_get_temperature(struct iwl_priv *priv); +extern int iwl_hw_tx_queue_init(struct iwl_priv *priv, + struct iwl_tx_queue *txq); +extern unsigned int iwl_hw_get_beacon_cmd(struct iwl_priv *priv, + struct iwl_frame *frame, u8 rate); +extern int iwl_hw_get_rx_read(struct iwl_priv *priv); +extern void iwl_hw_build_tx_cmd_rate(struct iwl_priv *priv, + struct iwl_cmd *cmd, + struct ieee80211_tx_control *ctrl, + struct ieee80211_hdr *hdr, + int sta_id, int tx_id); +extern int iwl_hw_reg_send_txpower(struct iwl_priv *priv); +extern int iwl_hw_reg_set_txpower(struct iwl_priv *priv, s8 power); +extern void iwl_hw_rx_statistics(struct iwl_priv *priv, + struct iwl_rx_mem_buffer *rxb); +extern void iwl_disable_events(struct iwl_priv *priv); +extern int iwl4965_get_temperature(const struct iwl_priv *priv); + +/** + * iwl_hw_find_station - Find station id for a given BSSID + * @bssid: MAC address of station ID to find + * + * NOTE: This should not be hardware specific but the code has + * not yet been merged into a single common layer for managing the + * station tables. + */ +extern u8 iwl_hw_find_station(struct iwl_priv *priv, const u8 *bssid); + +extern int iwl_hw_channel_switch(struct iwl_priv *priv, u16 channel); +extern int iwl_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index); + struct iwl_priv; struct sta_ht_info; @@ -338,4 +1039,322 @@ struct iwl_chain_noise_data { #define EEPROM_SEM_TIMEOUT 10 #define EEPROM_SEM_RETRY_LIMIT 1000 + +#ifdef CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT + +enum { + MEASUREMENT_READY = (1 << 0), + MEASUREMENT_ACTIVE = (1 << 1), +}; + +#endif + +struct iwl_priv { + + /* ieee device used by generic ieee processing code */ + struct ieee80211_hw *hw; + struct ieee80211_channel *ieee_channels; + struct ieee80211_rate *ieee_rates; + + /* temporary frame storage list */ + struct list_head free_frames; + int frames_count; + + u8 phymode; + int alloc_rxb_skb; + + void (*rx_handlers[REPLY_MAX])(struct iwl_priv *priv, + struct iwl_rx_mem_buffer *rxb); + + const struct ieee80211_hw_mode *modes; + +#ifdef CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT + /* spectrum measurement report caching */ + struct iwl_spectrum_notification measure_report; + u8 measurement_status; +#endif + /* ucode beacon time */ + u32 ucode_beacon_time; + + /* we allocate array of iwl_channel_info for NIC's valid channels. + * Access via channel # using indirect index array */ + struct iwl_channel_info *channel_info; /* channel info array */ + u8 channel_count; /* # of channels */ + + /* each calibration channel group in the EEPROM has a derived + * clip setting for each rate. */ + const struct iwl_clip_group clip_groups[5]; + + /* thermal calibration */ + s32 temperature; /* degrees Kelvin */ + s32 last_temperature; + + /* Scan related variables */ + unsigned long last_scan_jiffies; + unsigned long scan_start; + unsigned long scan_pass_start; + unsigned long scan_start_tsf; + int scan_bands; + int one_direct_scan; + u8 direct_ssid_len; + u8 direct_ssid[IW_ESSID_MAX_SIZE]; + struct iwl_scan_cmd *scan; + u8 only_active_channel; + + /* spinlock */ + spinlock_t lock; /* protect general shared data */ + spinlock_t hcmd_lock; /* protect hcmd */ + struct mutex mutex; + + /* basic pci-network driver stuff */ + struct pci_dev *pci_dev; + + /* pci hardware address support */ + void __iomem *hw_base; + + /* uCode images, save to reload in case of failure */ + struct fw_desc ucode_code; /* runtime inst */ + struct fw_desc ucode_data; /* runtime data original */ + struct fw_desc ucode_data_backup; /* runtime data save/restore */ + struct fw_desc ucode_init; /* initialization inst */ + struct fw_desc ucode_init_data; /* initialization data */ + struct fw_desc ucode_boot; /* bootstrap inst */ + + + struct iwl_rxon_time_cmd rxon_timing; + + /* We declare this const so it can only be + * changed via explicit cast within the + * routines that actually update the physical + * hardware */ + const struct iwl_rxon_cmd active_rxon; + struct iwl_rxon_cmd staging_rxon; + + int error_recovering; + struct iwl_rxon_cmd recovery_rxon; + + /* 1st responses from initialize and runtime uCode images. + * 4965's initialize alive response contains some calibration data. */ + struct iwl_init_alive_resp card_alive_init; + struct iwl_alive_resp card_alive; + +#ifdef LED + /* LED related variables */ + struct iwl_activity_blink activity; + unsigned long led_packets; + int led_state; +#endif + + u16 active_rate; + u16 active_rate_basic; + + u8 call_post_assoc_from_beacon; + u8 assoc_station_added; + u8 use_ant_b_for_management_frame; /* Tx antenna selection */ + /* HT variables */ + u8 is_dup; + u8 is_ht_enabled; + u8 channel_width; /* 0=20MHZ, 1=40MHZ */ + u8 current_channel_width; + u8 valid_antenna; /* Bit mask of antennas actually connected */ +#ifdef CONFIG_IWLWIFI_SENSITIVITY + struct iwl_sensitivity_data sensitivity_data; + struct iwl_chain_noise_data chain_noise_data; + u8 start_calib; + __le16 sensitivity_tbl[HD_TABLE_SIZE]; +#endif /*CONFIG_IWLWIFI_SENSITIVITY*/ + +#ifdef CONFIG_IWLWIFI_HT + struct sta_ht_info current_assoc_ht; +#endif + u8 active_rate_ht[2]; + u8 last_phy_res[100]; + + /* Rate scaling data */ + struct iwl_lq_mngr lq_mngr; + + /* Rate scaling data */ + s8 data_retry_limit; + u8 retry_rate; + + wait_queue_head_t wait_command_queue; + + int activity_timer_active; + + /* Rx and Tx DMA processing queues */ + struct iwl_rx_queue rxq; + struct iwl_tx_queue txq[IWL_MAX_NUM_QUEUES]; + unsigned long txq_ctx_active_msk; + struct iwl_kw kw; /* keep warm address */ + u32 scd_base_addr; /* scheduler sram base address */ + + unsigned long status; + u32 config; + + int last_rx_rssi; /* From Rx packet statisitics */ + int last_rx_noise; /* From beacon statistics */ + + struct iwl_power_mgr power_data; + + struct iwl_notif_statistics statistics; + unsigned long last_statistics_time; + + /* context information */ + u8 essid[IW_ESSID_MAX_SIZE]; + u8 essid_len; + u16 rates_mask; + + u32 power_mode; + u32 antenna; + u8 bssid[ETH_ALEN]; + u16 rts_threshold; + u8 mac_addr[ETH_ALEN]; + + /*station table variables */ + spinlock_t sta_lock; + int num_stations; + struct iwl_station_entry stations[IWL_STATION_COUNT]; + + /* Indication if ieee80211_ops->open has been called */ + int is_open; + + u8 mac80211_registered; + int is_abg; + + u32 notif_missed_beacons; + + /* Rx'd packet timing information */ + u32 last_beacon_time; + u64 last_tsf; + + /* Duplicate packet detection */ + u16 last_seq_num; + u16 last_frag_num; + unsigned long last_packet_time; + struct list_head ibss_mac_hash[IWL_IBSS_MAC_HASH_SIZE]; + + /* eeprom */ + struct iwl_eeprom eeprom; + + int iw_mode; + + struct sk_buff *ibss_beacon; + + /* Last Rx'd beacon timestamp */ + u32 timestamp0; + u32 timestamp1; + u16 beacon_int; + struct iwl_driver_hw_info hw_setting; + int interface_id; + + /* Current association information needed to configure the + * hardware */ + u16 assoc_id; + u16 assoc_capability; + u8 ps_mode; + +#ifdef CONFIG_IWLWIFI_QOS + struct iwl_qos_info qos_data; +#endif /*CONFIG_IWLWIFI_QOS */ + + struct workqueue_struct *workqueue; + + struct work_struct up; + struct work_struct restart; + struct work_struct calibrated_work; + struct work_struct scan_completed; + struct work_struct rx_replenish; + struct work_struct rf_kill; + struct work_struct abort_scan; + struct work_struct update_link_led; + struct work_struct auth_work; + struct work_struct report_work; + struct work_struct request_scan; + struct work_struct beacon_update; + + struct tasklet_struct irq_tasklet; + + struct delayed_work init_alive_start; + struct delayed_work alive_start; + struct delayed_work activity_timer; + struct delayed_work thermal_periodic; + struct delayed_work gather_stats; + struct delayed_work scan_check; + struct delayed_work post_associate; + +#define IWL_DEFAULT_TX_POWER 0x0F + s8 user_txpower_limit; + s8 max_channel_txpower_limit; + +#ifdef CONFIG_PM + u32 pm_state[16]; +#endif + +#ifdef CONFIG_IWLWIFI_DEBUG + /* debugging info */ + u32 framecnt_to_us; + atomic_t restrict_refcnt; +#endif + + struct work_struct txpower_work; +#ifdef CONFIG_IWLWIFI_SENSITIVITY + struct work_struct sensitivity_work; +#endif + struct work_struct statistics_work; + struct timer_list statistics_periodic; + +#ifdef CONFIG_IWLWIFI_HT_AGG + struct work_struct agg_work; +#endif +}; /*iwl_priv */ + +static inline int iwl_is_associated(struct iwl_priv *priv) +{ + return (priv->active_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0; +} + +static inline int is_channel_valid(const struct iwl_channel_info *ch_info) +{ + if (ch_info == NULL) + return 0; + return (ch_info->flags & EEPROM_CHANNEL_VALID) ? 1 : 0; +} + +static inline int is_channel_narrow(const struct iwl_channel_info *ch_info) +{ + return (ch_info->flags & EEPROM_CHANNEL_NARROW) ? 1 : 0; +} + +static inline int is_channel_radar(const struct iwl_channel_info *ch_info) +{ + return (ch_info->flags & EEPROM_CHANNEL_RADAR) ? 1 : 0; +} + +static inline u8 is_channel_a_band(const struct iwl_channel_info *ch_info) +{ + return ch_info->phymode == MODE_IEEE80211A; +} + +static inline u8 is_channel_bg_band(const struct iwl_channel_info *ch_info) +{ + return ((ch_info->phymode == MODE_IEEE80211B) || + (ch_info->phymode == MODE_IEEE80211G)); +} + +static inline int is_channel_passive(const struct iwl_channel_info *ch) +{ + return (!(ch->flags & EEPROM_CHANNEL_ACTIVE)) ? 1 : 0; +} + +static inline int is_channel_ibss(const struct iwl_channel_info *ch) +{ + return ((ch->flags & EEPROM_CHANNEL_IBSS)) ? 1 : 0; +} + +extern const struct iwl_channel_info *iwl_get_channel_info( + const struct iwl_priv *priv, int phymode, u16 channel); + +/* Requires full declaration of iwl_priv before including */ +#include "iwl-4965-io.h" + #endif /* __iwl_4965_h__ */ -- cgit v1.2.3 From c8b0e6e19c0bcd30689cb6c6f64eb140f5d61894 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 25 Oct 2007 17:15:51 +0800 Subject: iwlwifi: cleanup Kconfig and ifdefs to split 3945 and 4965 Currently the iwl3945 & iwl4965 drivers share some common Kconfig symbols. This split it up into options for the individual drivers and gets rid of all the CONFIG_IWLWIFI cruft. Signed-off-by: Christoph Hellwig Signed-off-by: Zhu Yi Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 60 ++++++++++++++++----------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index bf174d3b8fb..d61cf0e26e8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -434,8 +434,8 @@ struct iwl_rx_queue { #define IWL_INVALID_RATE 0xFF #define IWL_INVALID_VALUE -1 -#ifdef CONFIG_IWLWIFI_HT -#ifdef CONFIG_IWLWIFI_HT_AGG +#ifdef CONFIG_IWL4965_HT +#ifdef CONFIG_IWL4965_HT_AGG struct iwl_ht_agg { u16 txq_id; u16 frame_count; @@ -445,16 +445,16 @@ struct iwl_ht_agg { u32 bitmap1; u32 rate_n_flags; }; -#endif /* CONFIG_IWLWIFI_HT_AGG */ -#endif /* CONFIG_IWLWIFI_HT */ +#endif /* CONFIG_IWL4965_HT_AGG */ +#endif /* CONFIG_IWL4965_HT */ struct iwl_tid_data { u16 seq_number; -#ifdef CONFIG_IWLWIFI_HT -#ifdef CONFIG_IWLWIFI_HT_AGG +#ifdef CONFIG_IWL4965_HT +#ifdef CONFIG_IWL4965_HT_AGG struct iwl_ht_agg agg; -#endif /* CONFIG_IWLWIFI_HT_AGG */ -#endif /* CONFIG_IWLWIFI_HT */ +#endif /* CONFIG_IWL4965_HT_AGG */ +#endif /* CONFIG_IWL4965_HT */ }; struct iwl_hw_key { @@ -471,7 +471,7 @@ union iwl_ht_rate_supp { }; }; -#ifdef CONFIG_IWLWIFI_HT +#ifdef CONFIG_IWL4965_HT #define CFG_HT_RX_AMPDU_FACTOR_DEF (0x3) #define HT_IE_MAX_AMSDU_SIZE_4K (0) #define CFG_HT_MPDU_DENSITY_2USEC (0x5) @@ -494,9 +494,9 @@ struct sta_ht_info { u8 tx_chan_width; u8 chan_width_cap; }; -#endif /*CONFIG_IWLWIFI_HT */ +#endif /*CONFIG_IWL4965_HT */ -#ifdef CONFIG_IWLWIFI_QOS +#ifdef CONFIG_IWL4965_QOS union iwl_qos_capabity { struct { @@ -525,7 +525,7 @@ struct iwl_qos_info { union iwl_qos_capabity qos_cap; struct iwl_qosparam_cmd def_qos_parm; }; -#endif /*CONFIG_IWLWIFI_QOS */ +#endif /*CONFIG_IWL4965_QOS */ #define STA_PS_STATUS_WAKE 0 #define STA_PS_STATUS_SLEEP 1 @@ -617,7 +617,7 @@ extern int iwl_is_network_packet(struct iwl_priv *priv, struct ieee80211_hdr *header); extern int iwl_power_init_handle(struct iwl_priv *priv); extern int iwl_eeprom_init(struct iwl_priv *priv); -#ifdef CONFIG_IWLWIFI_DEBUG +#ifdef CONFIG_IWL4965_DEBUG extern void iwl_report_frame(struct iwl_priv *priv, struct iwl_rx_packet *pkt, struct ieee80211_hdr *header, int group100); @@ -764,8 +764,8 @@ extern int iwl4965_set_fat_chan_info(struct iwl_priv *priv, int phymode, u8 fat_extension_channel); extern void iwl4965_rf_kill_ct_config(struct iwl_priv *priv); -#ifdef CONFIG_IWLWIFI_HT -#ifdef CONFIG_IWLWIFI_HT_AGG +#ifdef CONFIG_IWL4965_HT +#ifdef CONFIG_IWL4965_HT_AGG extern int iwl_mac_ht_tx_agg_start(struct ieee80211_hw *hw, u8 *da, u16 tid, u16 *start_seq_num); extern int iwl_mac_ht_rx_agg_start(struct ieee80211_hw *hw, u8 *da, @@ -775,8 +775,8 @@ extern int iwl_mac_ht_rx_agg_stop(struct ieee80211_hw *hw, u8 *da, extern int iwl_mac_ht_tx_agg_stop(struct ieee80211_hw *hw, u8 *da, u16 tid, int generator); extern void iwl4965_turn_off_agg(struct iwl_priv *priv, u8 tid); -#endif /* CONFIG_IWLWIFI_HT_AGG */ -#endif /*CONFIG_IWLWIFI_HT */ +#endif /* CONFIG_IWL4965_HT_AGG */ +#endif /*CONFIG_IWL4965_HT */ /* Structures, enum, and defines specific to the 4965 */ #define IWL4965_KW_SIZE 0x1000 /*4k */ @@ -843,7 +843,7 @@ struct iwl_traffic_load { u32 total; }; -#ifdef CONFIG_IWLWIFI_HT_AGG +#ifdef CONFIG_IWL4965_HT_AGG struct iwl_agg_control { unsigned long next_retry; u32 wait_for_agg_status; @@ -855,10 +855,10 @@ struct iwl_agg_control { u32 ba_timeout; struct iwl_traffic_load traffic_load[TID_MAX_LOAD_COUNT]; }; -#endif /*CONFIG_IWLWIFI_HT_AGG */ +#endif /*CONFIG_IWL4965_HT_AGG */ struct iwl_lq_mngr { -#ifdef CONFIG_IWLWIFI_HT_AGG +#ifdef CONFIG_IWL4965_HT_AGG struct iwl_agg_control agg_ctrl; #endif spinlock_t lock; @@ -1040,7 +1040,7 @@ struct iwl_chain_noise_data { #define EEPROM_SEM_RETRY_LIMIT 1000 -#ifdef CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT +#ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT enum { MEASUREMENT_READY = (1 << 0), @@ -1068,7 +1068,7 @@ struct iwl_priv { const struct ieee80211_hw_mode *modes; -#ifdef CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT +#ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT /* spectrum measurement report caching */ struct iwl_spectrum_notification measure_report; u8 measurement_status; @@ -1157,14 +1157,14 @@ struct iwl_priv { u8 channel_width; /* 0=20MHZ, 1=40MHZ */ u8 current_channel_width; u8 valid_antenna; /* Bit mask of antennas actually connected */ -#ifdef CONFIG_IWLWIFI_SENSITIVITY +#ifdef CONFIG_IWL4965_SENSITIVITY struct iwl_sensitivity_data sensitivity_data; struct iwl_chain_noise_data chain_noise_data; u8 start_calib; __le16 sensitivity_tbl[HD_TABLE_SIZE]; -#endif /*CONFIG_IWLWIFI_SENSITIVITY*/ +#endif /*CONFIG_IWL4965_SENSITIVITY*/ -#ifdef CONFIG_IWLWIFI_HT +#ifdef CONFIG_IWL4965_HT struct sta_ht_info current_assoc_ht; #endif u8 active_rate_ht[2]; @@ -1253,9 +1253,9 @@ struct iwl_priv { u16 assoc_capability; u8 ps_mode; -#ifdef CONFIG_IWLWIFI_QOS +#ifdef CONFIG_IWL4965_QOS struct iwl_qos_info qos_data; -#endif /*CONFIG_IWLWIFI_QOS */ +#endif /*CONFIG_IWL4965_QOS */ struct workqueue_struct *workqueue; @@ -1290,20 +1290,20 @@ struct iwl_priv { u32 pm_state[16]; #endif -#ifdef CONFIG_IWLWIFI_DEBUG +#ifdef CONFIG_IWL4965_DEBUG /* debugging info */ u32 framecnt_to_us; atomic_t restrict_refcnt; #endif struct work_struct txpower_work; -#ifdef CONFIG_IWLWIFI_SENSITIVITY +#ifdef CONFIG_IWL4965_SENSITIVITY struct work_struct sensitivity_work; #endif struct work_struct statistics_work; struct timer_list statistics_periodic; -#ifdef CONFIG_IWLWIFI_HT_AGG +#ifdef CONFIG_IWL4965_HT_AGG struct work_struct agg_work; #endif }; /*iwl_priv */ -- cgit v1.2.3 From bb8c093bdea62f2ae371b98ebff81b0407852faf Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sun, 27 Jan 2008 16:41:47 -0800 Subject: iwlwifi: cleanup namespace Prefix all symbols with iwl3945_ or iwl4965_ and thus allow building the driver into the kernel. Also remove all the useless default statements in Kconfig while we're at it. Signed-off-by: Christoph Hellwig Signed-off-by: Zhu Yi Signed-off-by: Reinette Chatre Signed-off-by: John W. Linville Signed-off-by: David S. Miller --- drivers/net/wireless/iwlwifi/iwl-4965.h | 452 ++++++++++++++++---------------- 1 file changed, 225 insertions(+), 227 deletions(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index d61cf0e26e8..5944b4b9828 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -30,10 +30,10 @@ #include #include -struct iwl_priv; +struct iwl4965_priv; /* Hardware specific file defines the PCI IDs table for that hardware module */ -extern struct pci_device_id iwl_hw_card_ids[]; +extern struct pci_device_id iwl4965_hw_card_ids[]; #define DRV_NAME "iwl4965" #include "iwl-4965-hw.h" @@ -54,10 +54,10 @@ extern struct pci_device_id iwl_hw_card_ids[]; #define IWL_NOISE_MEAS_NOT_AVAILABLE (-127) /* Module parameters accessible from iwl-*.c */ -extern int iwl_param_hwcrypto; -extern int iwl_param_queues_num; +extern int iwl4965_param_hwcrypto; +extern int iwl4965_param_queues_num; -enum iwl_antenna { +enum iwl4965_antenna { IWL_ANTENNA_DIVERSITY, IWL_ANTENNA_MAIN, IWL_ANTENNA_AUX @@ -80,13 +80,13 @@ enum iwl_antenna { #define DEFAULT_SHORT_RETRY_LIMIT 7U #define DEFAULT_LONG_RETRY_LIMIT 4U -struct iwl_rx_mem_buffer { +struct iwl4965_rx_mem_buffer { dma_addr_t dma_addr; struct sk_buff *skb; struct list_head list; }; -struct iwl_rt_rx_hdr { +struct iwl4965_rt_rx_hdr { struct ieee80211_radiotap_header rt_hdr; __le64 rt_tsf; /* TSF */ u8 rt_flags; /* radiotap packet flags */ @@ -99,7 +99,7 @@ struct iwl_rt_rx_hdr { u8 payload[0]; /* payload... */ } __attribute__ ((packed)); -struct iwl_rt_tx_hdr { +struct iwl4965_rt_tx_hdr { struct ieee80211_radiotap_header rt_hdr; u8 rt_rate; /* rate in 500kb/s */ __le16 rt_channel; /* channel in mHz */ @@ -114,7 +114,7 @@ struct iwl_rt_tx_hdr { * * Contains common data for Rx and Tx queues */ -struct iwl_queue { +struct iwl4965_queue { int n_bd; /* number of BDs in this queue */ int write_ptr; /* 1-st empty entry (index) host_w*/ int read_ptr; /* last used entry (index) host_r*/ @@ -129,24 +129,24 @@ struct iwl_queue { #define MAX_NUM_OF_TBS (20) -struct iwl_tx_info { +struct iwl4965_tx_info { struct ieee80211_tx_status status; struct sk_buff *skb[MAX_NUM_OF_TBS]; }; /** - * struct iwl_tx_queue - Tx Queue for DMA + * struct iwl4965_tx_queue - Tx Queue for DMA * @need_update: need to update read/write index * @shed_retry: queue is HT AGG enabled * * Queue consists of circular buffer of BD's and required locking structures. */ -struct iwl_tx_queue { - struct iwl_queue q; - struct iwl_tfd_frame *bd; - struct iwl_cmd *cmd; +struct iwl4965_tx_queue { + struct iwl4965_queue q; + struct iwl4965_tfd_frame *bd; + struct iwl4965_cmd *cmd; dma_addr_t dma_addr_cmd; - struct iwl_tx_info *txb; + struct iwl4965_tx_info *txb; int need_update; int sched_retry; int active; @@ -154,12 +154,12 @@ struct iwl_tx_queue { #define IWL_NUM_SCAN_RATES (2) -struct iwl_channel_tgd_info { +struct iwl4965_channel_tgd_info { u8 type; s8 max_power; }; -struct iwl_channel_tgh_info { +struct iwl4965_channel_tgh_info { s64 last_radar_time; }; @@ -170,8 +170,8 @@ struct iwl_channel_tgh_info { * -- spectrum management * -- user preference (e.g. iwconfig) * when requested power is set, base power index must also be set. */ -struct iwl_channel_power_info { - struct iwl_tx_power tpc; /* actual radio and DSP gain settings */ +struct iwl4965_channel_power_info { + struct iwl4965_tx_power tpc; /* actual radio and DSP gain settings */ s8 power_table_index; /* actual (compenst'd) index into gain table */ s8 base_power_index; /* gain index for power at factory temp. */ s8 requested_power; /* power (dBm) requested for this chnl/rate */ @@ -179,8 +179,8 @@ struct iwl_channel_power_info { /* current scan Tx power values to use, one for each scan rate for each * channel. */ -struct iwl_scan_power_info { - struct iwl_tx_power tpc; /* actual radio and DSP gain settings */ +struct iwl4965_scan_power_info { + struct iwl4965_tx_power tpc; /* actual radio and DSP gain settings */ s8 power_table_index; /* actual (compenst'd) index into gain table */ s8 requested_power; /* scan pwr (dBm) requested for chnl/rate */ }; @@ -200,11 +200,11 @@ struct iwl_scan_power_info { */ #define IWL4965_MAX_RATE (33) -struct iwl_channel_info { - struct iwl_channel_tgd_info tgd; - struct iwl_channel_tgh_info tgh; - struct iwl_eeprom_channel eeprom; /* EEPROM regulatory limit */ - struct iwl_eeprom_channel fat_eeprom; /* EEPROM regulatory limit for +struct iwl4965_channel_info { + struct iwl4965_channel_tgd_info tgd; + struct iwl4965_channel_tgh_info tgh; + struct iwl4965_eeprom_channel eeprom; /* EEPROM regulatory limit */ + struct iwl4965_eeprom_channel fat_eeprom; /* EEPROM regulatory limit for * FAT channel */ u8 channel; /* channel number */ @@ -221,7 +221,7 @@ struct iwl_channel_info { /* Radio/DSP gain settings for each "normal" data Tx rate. * These include, in addition to RF and DSP gain, a few fields for * remembering/modifying gain settings (indexes). */ - struct iwl_channel_power_info power_info[IWL4965_MAX_RATE]; + struct iwl4965_channel_power_info power_info[IWL4965_MAX_RATE]; /* FAT channel info */ s8 fat_max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */ @@ -232,10 +232,10 @@ struct iwl_channel_info { u8 fat_extension_channel; /* Radio/DSP gain settings for each scan rate, for directed scans. */ - struct iwl_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES]; + struct iwl4965_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES]; }; -struct iwl_clip_group { +struct iwl4965_clip_group { /* maximum power level to prevent clipping for each rate, derived by * us from this band's saturation power in EEPROM */ const s8 clip_powers[IWL_MAX_RATES]; @@ -256,8 +256,8 @@ struct iwl_clip_group { /* Power management (not Tx power) structures */ -struct iwl_power_vec_entry { - struct iwl_powertable_cmd cmd; +struct iwl4965_power_vec_entry { + struct iwl4965_powertable_cmd cmd; u8 no_dtim; }; #define IWL_POWER_RANGE_0 (0) @@ -273,10 +273,10 @@ struct iwl_power_vec_entry { #define IWL_POWER_ENABLED 0x10 #define IWL_POWER_LEVEL(x) ((x) & IWL_POWER_MASK) -struct iwl_power_mgr { +struct iwl4965_power_mgr { spinlock_t lock; - struct iwl_power_vec_entry pwr_range_0[IWL_POWER_AC]; - struct iwl_power_vec_entry pwr_range_1[IWL_POWER_AC]; + struct iwl4965_power_vec_entry pwr_range_0[IWL_POWER_AC]; + struct iwl4965_power_vec_entry pwr_range_1[IWL_POWER_AC]; u8 active_index; u32 dtim_val; }; @@ -286,10 +286,10 @@ struct iwl_power_mgr { #define IEEE80211_HLEN (IEEE80211_4ADDR_LEN) #define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) -struct iwl_frame { +struct iwl4965_frame { union { struct ieee80211_hdr frame; - struct iwl_tx_beacon_cmd beacon; + struct iwl4965_tx_beacon_cmd beacon; u8 raw[IEEE80211_FRAME_LEN]; u8 cmd[360]; } u; @@ -315,15 +315,15 @@ enum { CMD_WANT_SKB = (1 << 2), }; -struct iwl_cmd; -struct iwl_priv; +struct iwl4965_cmd; +struct iwl4965_priv; -struct iwl_cmd_meta { - struct iwl_cmd_meta *source; +struct iwl4965_cmd_meta { + struct iwl4965_cmd_meta *source; union { struct sk_buff *skb; - int (*callback)(struct iwl_priv *priv, - struct iwl_cmd *cmd, struct sk_buff *skb); + int (*callback)(struct iwl4965_priv *priv, + struct iwl4965_cmd *cmd, struct sk_buff *skb); } __attribute__ ((packed)) u; /* The CMD_SIZE_HUGE flag bit indicates that the command @@ -332,37 +332,37 @@ struct iwl_cmd_meta { } __attribute__ ((packed)); -struct iwl_cmd { - struct iwl_cmd_meta meta; - struct iwl_cmd_header hdr; +struct iwl4965_cmd { + struct iwl4965_cmd_meta meta; + struct iwl4965_cmd_header hdr; union { - struct iwl_addsta_cmd addsta; - struct iwl_led_cmd led; + struct iwl4965_addsta_cmd addsta; + struct iwl4965_led_cmd led; u32 flags; u8 val8; u16 val16; u32 val32; - struct iwl_bt_cmd bt; - struct iwl_rxon_time_cmd rxon_time; - struct iwl_powertable_cmd powertable; - struct iwl_qosparam_cmd qosparam; - struct iwl_tx_cmd tx; - struct iwl_tx_beacon_cmd tx_beacon; - struct iwl_rxon_assoc_cmd rxon_assoc; + struct iwl4965_bt_cmd bt; + struct iwl4965_rxon_time_cmd rxon_time; + struct iwl4965_powertable_cmd powertable; + struct iwl4965_qosparam_cmd qosparam; + struct iwl4965_tx_cmd tx; + struct iwl4965_tx_beacon_cmd tx_beacon; + struct iwl4965_rxon_assoc_cmd rxon_assoc; u8 *indirect; u8 payload[360]; } __attribute__ ((packed)) cmd; } __attribute__ ((packed)); -struct iwl_host_cmd { +struct iwl4965_host_cmd { u8 id; u16 len; - struct iwl_cmd_meta meta; + struct iwl4965_cmd_meta meta; const void *data; }; -#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_cmd) - \ - sizeof(struct iwl_cmd_meta)) +#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl4965_cmd) - \ + sizeof(struct iwl4965_cmd_meta)) /* * RX related structures and functions @@ -375,7 +375,7 @@ struct iwl_host_cmd { #define SUP_RATE_11G_MAX_NUM_CHANNELS 12 /** - * struct iwl_rx_queue - Rx queue + * struct iwl4965_rx_queue - Rx queue * @processed: Internal index to last handled Rx packet * @read: Shared index to newest available Rx buffer * @write: Shared index to oldest written Rx packet @@ -384,13 +384,13 @@ struct iwl_host_cmd { * @rx_used: List of Rx buffers with no SKB * @need_update: flag to indicate we need to update read/write index * - * NOTE: rx_free and rx_used are used as a FIFO for iwl_rx_mem_buffers + * NOTE: rx_free and rx_used are used as a FIFO for iwl4965_rx_mem_buffers */ -struct iwl_rx_queue { +struct iwl4965_rx_queue { __le32 *bd; dma_addr_t dma_addr; - struct iwl_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS]; - struct iwl_rx_mem_buffer *queue[RX_QUEUE_SIZE]; + struct iwl4965_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS]; + struct iwl4965_rx_mem_buffer *queue[RX_QUEUE_SIZE]; u32 processed; u32 read; u32 write; @@ -436,7 +436,7 @@ struct iwl_rx_queue { #ifdef CONFIG_IWL4965_HT #ifdef CONFIG_IWL4965_HT_AGG -struct iwl_ht_agg { +struct iwl4965_ht_agg { u16 txq_id; u16 frame_count; u16 wait_for_ba; @@ -448,22 +448,22 @@ struct iwl_ht_agg { #endif /* CONFIG_IWL4965_HT_AGG */ #endif /* CONFIG_IWL4965_HT */ -struct iwl_tid_data { +struct iwl4965_tid_data { u16 seq_number; #ifdef CONFIG_IWL4965_HT #ifdef CONFIG_IWL4965_HT_AGG - struct iwl_ht_agg agg; + struct iwl4965_ht_agg agg; #endif /* CONFIG_IWL4965_HT_AGG */ #endif /* CONFIG_IWL4965_HT */ }; -struct iwl_hw_key { +struct iwl4965_hw_key { enum ieee80211_key_alg alg; int keylen; u8 key[32]; }; -union iwl_ht_rate_supp { +union iwl4965_ht_rate_supp { u16 rates; struct { u8 siso_rate; @@ -498,7 +498,7 @@ struct sta_ht_info { #ifdef CONFIG_IWL4965_QOS -union iwl_qos_capabity { +union iwl4965_qos_capabity { struct { u8 edca_count:4; /* bit 0-3 */ u8 q_ack:1; /* bit 4 */ @@ -519,23 +519,23 @@ union iwl_qos_capabity { }; /* QoS structures */ -struct iwl_qos_info { +struct iwl4965_qos_info { int qos_enable; int qos_active; - union iwl_qos_capabity qos_cap; - struct iwl_qosparam_cmd def_qos_parm; + union iwl4965_qos_capabity qos_cap; + struct iwl4965_qosparam_cmd def_qos_parm; }; #endif /*CONFIG_IWL4965_QOS */ #define STA_PS_STATUS_WAKE 0 #define STA_PS_STATUS_SLEEP 1 -struct iwl_station_entry { - struct iwl_addsta_cmd sta; - struct iwl_tid_data tid[MAX_TID_COUNT]; +struct iwl4965_station_entry { + struct iwl4965_addsta_cmd sta; + struct iwl4965_tid_data tid[MAX_TID_COUNT]; u8 used; u8 ps_status; - struct iwl_hw_key keyinfo; + struct iwl4965_hw_key keyinfo; }; /* one for each uCode image (inst/data, boot/init/runtime) */ @@ -546,7 +546,7 @@ struct fw_desc { }; /* uCode file layout */ -struct iwl_ucode { +struct iwl4965_ucode { __le32 ver; /* major/minor/subminor */ __le32 inst_size; /* bytes of runtime instructions */ __le32 data_size; /* bytes of runtime data */ @@ -558,7 +558,7 @@ struct iwl_ucode { #define IWL_IBSS_MAC_HASH_SIZE 32 -struct iwl_ibss_seq { +struct iwl4965_ibss_seq { u8 mac[ETH_ALEN]; u16 seq_num; u16 frag_num; @@ -566,7 +566,7 @@ struct iwl_ibss_seq { struct list_head list; }; -struct iwl_driver_hw_info { +struct iwl4965_driver_hw_info { u16 max_txq_num; u16 ac_queue_count; u16 tx_cmd_len; @@ -592,10 +592,10 @@ struct iwl_driver_hw_info { #define HT_SHORT_GI_40MHZ_ONLY (1 << 1) -#define IWL_RX_HDR(x) ((struct iwl_rx_frame_hdr *)(\ +#define IWL_RX_HDR(x) ((struct iwl4965_rx_frame_hdr *)(\ x->u.rx_frame.stats.payload + \ x->u.rx_frame.stats.phy_count)) -#define IWL_RX_END(x) ((struct iwl_rx_frame_end *)(\ +#define IWL_RX_END(x) ((struct iwl4965_rx_frame_end *)(\ IWL_RX_HDR(x)->payload + \ le16_to_cpu(IWL_RX_HDR(x)->len))) #define IWL_RX_STATS(x) (&x->u.rx_frame.stats) @@ -608,63 +608,63 @@ struct iwl_driver_hw_info { * for use by iwl-*.c * *****************************************************************************/ -struct iwl_addsta_cmd; -extern int iwl_send_add_station(struct iwl_priv *priv, - struct iwl_addsta_cmd *sta, u8 flags); -extern u8 iwl_add_station(struct iwl_priv *priv, const u8 *bssid, +struct iwl4965_addsta_cmd; +extern int iwl4965_send_add_station(struct iwl4965_priv *priv, + struct iwl4965_addsta_cmd *sta, u8 flags); +extern u8 iwl4965_add_station_flags(struct iwl4965_priv *priv, const u8 *bssid, int is_ap, u8 flags); -extern int iwl_is_network_packet(struct iwl_priv *priv, +extern int iwl4965_is_network_packet(struct iwl4965_priv *priv, struct ieee80211_hdr *header); -extern int iwl_power_init_handle(struct iwl_priv *priv); -extern int iwl_eeprom_init(struct iwl_priv *priv); +extern int iwl4965_power_init_handle(struct iwl4965_priv *priv); +extern int iwl4965_eeprom_init(struct iwl4965_priv *priv); #ifdef CONFIG_IWL4965_DEBUG -extern void iwl_report_frame(struct iwl_priv *priv, - struct iwl_rx_packet *pkt, +extern void iwl4965_report_frame(struct iwl4965_priv *priv, + struct iwl4965_rx_packet *pkt, struct ieee80211_hdr *header, int group100); #else -static inline void iwl_report_frame(struct iwl_priv *priv, - struct iwl_rx_packet *pkt, +static inline void iwl4965_report_frame(struct iwl4965_priv *priv, + struct iwl4965_rx_packet *pkt, struct ieee80211_hdr *header, int group100) {} #endif -extern void iwl_handle_data_packet_monitor(struct iwl_priv *priv, - struct iwl_rx_mem_buffer *rxb, +extern void iwl4965_handle_data_packet_monitor(struct iwl4965_priv *priv, + struct iwl4965_rx_mem_buffer *rxb, void *data, short len, struct ieee80211_rx_status *stats, u16 phy_flags); -extern int is_duplicate_packet(struct iwl_priv *priv, struct ieee80211_hdr - *header); -extern int iwl_rx_queue_alloc(struct iwl_priv *priv); -extern void iwl_rx_queue_reset(struct iwl_priv *priv, - struct iwl_rx_queue *rxq); -extern int iwl_calc_db_from_ratio(int sig_ratio); -extern int iwl_calc_sig_qual(int rssi_dbm, int noise_dbm); -extern int iwl_tx_queue_init(struct iwl_priv *priv, - struct iwl_tx_queue *txq, int count, u32 id); -extern void iwl_rx_replenish(void *data); -extern void iwl_tx_queue_free(struct iwl_priv *priv, struct iwl_tx_queue *txq); -extern int iwl_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len, +extern int iwl4965_is_duplicate_packet(struct iwl4965_priv *priv, + struct ieee80211_hdr *header); +extern int iwl4965_rx_queue_alloc(struct iwl4965_priv *priv); +extern void iwl4965_rx_queue_reset(struct iwl4965_priv *priv, + struct iwl4965_rx_queue *rxq); +extern int iwl4965_calc_db_from_ratio(int sig_ratio); +extern int iwl4965_calc_sig_qual(int rssi_dbm, int noise_dbm); +extern int iwl4965_tx_queue_init(struct iwl4965_priv *priv, + struct iwl4965_tx_queue *txq, int count, u32 id); +extern void iwl4965_rx_replenish(void *data); +extern void iwl4965_tx_queue_free(struct iwl4965_priv *priv, struct iwl4965_tx_queue *txq); +extern int iwl4965_send_cmd_pdu(struct iwl4965_priv *priv, u8 id, u16 len, const void *data); -extern int __must_check iwl_send_cmd(struct iwl_priv *priv, - struct iwl_host_cmd *cmd); -extern unsigned int iwl_fill_beacon_frame(struct iwl_priv *priv, +extern int __must_check iwl4965_send_cmd(struct iwl4965_priv *priv, + struct iwl4965_host_cmd *cmd); +extern unsigned int iwl4965_fill_beacon_frame(struct iwl4965_priv *priv, struct ieee80211_hdr *hdr, const u8 *dest, int left); -extern int iwl_rx_queue_update_write_ptr(struct iwl_priv *priv, - struct iwl_rx_queue *q); -extern int iwl_send_statistics_request(struct iwl_priv *priv); -extern void iwl_set_decrypted_flag(struct iwl_priv *priv, struct sk_buff *skb, +extern int iwl4965_rx_queue_update_write_ptr(struct iwl4965_priv *priv, + struct iwl4965_rx_queue *q); +extern int iwl4965_send_statistics_request(struct iwl4965_priv *priv); +extern void iwl4965_set_decrypted_flag(struct iwl4965_priv *priv, struct sk_buff *skb, u32 decrypt_res, struct ieee80211_rx_status *stats); extern __le16 *ieee80211_get_qos_ctrl(struct ieee80211_hdr *hdr); -extern const u8 BROADCAST_ADDR[ETH_ALEN]; +extern const u8 iwl4965_broadcast_addr[ETH_ALEN]; /* * Currently used by iwl-3945-rs... look at restructuring so that it doesn't * call this... todo... fix that. */ -extern u8 iwl_sync_station(struct iwl_priv *priv, int sta_id, +extern u8 iwl4965_sync_station(struct iwl4965_priv *priv, int sta_id, u16 tx_rate, u8 flags); /****************************************************************************** @@ -676,112 +676,110 @@ extern u8 iwl_sync_station(struct iwl_priv *priv, int sta_id, * which is why they are in the hardware specific files (vs. iwl-base.c) * * Naming convention -- - * iwl_ <-- Its part of iwlwifi (should be changed to iwl_) - * iwl_hw_ <-- Hardware specific (implemented in iwl-XXXX.c by all HW) + * iwl4965_ <-- Its part of iwlwifi (should be changed to iwl4965_) + * iwl4965_hw_ <-- Hardware specific (implemented in iwl-XXXX.c by all HW) * iwlXXXX_ <-- Hardware specific (implemented in iwl-XXXX.c for XXXX) - * iwl_bg_ <-- Called from work queue context - * iwl_mac_ <-- mac80211 callback + * iwl4965_bg_ <-- Called from work queue context + * iwl4965_mac_ <-- mac80211 callback * ****************************************************************************/ -extern void iwl_hw_rx_handler_setup(struct iwl_priv *priv); -extern void iwl_hw_setup_deferred_work(struct iwl_priv *priv); -extern void iwl_hw_cancel_deferred_work(struct iwl_priv *priv); -extern int iwl_hw_rxq_stop(struct iwl_priv *priv); -extern int iwl_hw_set_hw_setting(struct iwl_priv *priv); -extern int iwl_hw_nic_init(struct iwl_priv *priv); -extern int iwl_hw_nic_stop_master(struct iwl_priv *priv); -extern void iwl_hw_txq_ctx_free(struct iwl_priv *priv); -extern void iwl_hw_txq_ctx_stop(struct iwl_priv *priv); -extern int iwl_hw_nic_reset(struct iwl_priv *priv); -extern int iwl_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv, void *tfd, +extern void iwl4965_hw_rx_handler_setup(struct iwl4965_priv *priv); +extern void iwl4965_hw_setup_deferred_work(struct iwl4965_priv *priv); +extern void iwl4965_hw_cancel_deferred_work(struct iwl4965_priv *priv); +extern int iwl4965_hw_rxq_stop(struct iwl4965_priv *priv); +extern int iwl4965_hw_set_hw_setting(struct iwl4965_priv *priv); +extern int iwl4965_hw_nic_init(struct iwl4965_priv *priv); +extern int iwl4965_hw_nic_stop_master(struct iwl4965_priv *priv); +extern void iwl4965_hw_txq_ctx_free(struct iwl4965_priv *priv); +extern void iwl4965_hw_txq_ctx_stop(struct iwl4965_priv *priv); +extern int iwl4965_hw_nic_reset(struct iwl4965_priv *priv); +extern int iwl4965_hw_txq_attach_buf_to_tfd(struct iwl4965_priv *priv, void *tfd, dma_addr_t addr, u16 len); -extern int iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq); -extern int iwl_hw_get_temperature(struct iwl_priv *priv); -extern int iwl_hw_tx_queue_init(struct iwl_priv *priv, - struct iwl_tx_queue *txq); -extern unsigned int iwl_hw_get_beacon_cmd(struct iwl_priv *priv, - struct iwl_frame *frame, u8 rate); -extern int iwl_hw_get_rx_read(struct iwl_priv *priv); -extern void iwl_hw_build_tx_cmd_rate(struct iwl_priv *priv, - struct iwl_cmd *cmd, +extern int iwl4965_hw_txq_free_tfd(struct iwl4965_priv *priv, struct iwl4965_tx_queue *txq); +extern int iwl4965_hw_get_temperature(struct iwl4965_priv *priv); +extern int iwl4965_hw_tx_queue_init(struct iwl4965_priv *priv, + struct iwl4965_tx_queue *txq); +extern unsigned int iwl4965_hw_get_beacon_cmd(struct iwl4965_priv *priv, + struct iwl4965_frame *frame, u8 rate); +extern int iwl4965_hw_get_rx_read(struct iwl4965_priv *priv); +extern void iwl4965_hw_build_tx_cmd_rate(struct iwl4965_priv *priv, + struct iwl4965_cmd *cmd, struct ieee80211_tx_control *ctrl, struct ieee80211_hdr *hdr, int sta_id, int tx_id); -extern int iwl_hw_reg_send_txpower(struct iwl_priv *priv); -extern int iwl_hw_reg_set_txpower(struct iwl_priv *priv, s8 power); -extern void iwl_hw_rx_statistics(struct iwl_priv *priv, - struct iwl_rx_mem_buffer *rxb); -extern void iwl_disable_events(struct iwl_priv *priv); -extern int iwl4965_get_temperature(const struct iwl_priv *priv); +extern int iwl4965_hw_reg_send_txpower(struct iwl4965_priv *priv); +extern int iwl4965_hw_reg_set_txpower(struct iwl4965_priv *priv, s8 power); +extern void iwl4965_hw_rx_statistics(struct iwl4965_priv *priv, + struct iwl4965_rx_mem_buffer *rxb); +extern void iwl4965_disable_events(struct iwl4965_priv *priv); +extern int iwl4965_get_temperature(const struct iwl4965_priv *priv); /** - * iwl_hw_find_station - Find station id for a given BSSID + * iwl4965_hw_find_station - Find station id for a given BSSID * @bssid: MAC address of station ID to find * * NOTE: This should not be hardware specific but the code has * not yet been merged into a single common layer for managing the * station tables. */ -extern u8 iwl_hw_find_station(struct iwl_priv *priv, const u8 *bssid); +extern u8 iwl4965_hw_find_station(struct iwl4965_priv *priv, const u8 *bssid); -extern int iwl_hw_channel_switch(struct iwl_priv *priv, u16 channel); -extern int iwl_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index); +extern int iwl4965_hw_channel_switch(struct iwl4965_priv *priv, u16 channel); +extern int iwl4965_tx_queue_reclaim(struct iwl4965_priv *priv, int txq_id, int index); -struct iwl_priv; +struct iwl4965_priv; struct sta_ht_info; /* * Forward declare iwl-4965.c functions for iwl-base.c */ -extern int iwl_eeprom_acquire_semaphore(struct iwl_priv *priv); -extern void iwl_eeprom_release_semaphore(struct iwl_priv *priv); +extern int iwl4965_eeprom_acquire_semaphore(struct iwl4965_priv *priv); +extern void iwl4965_eeprom_release_semaphore(struct iwl4965_priv *priv); -extern int iwl4965_tx_queue_update_wr_ptr(struct iwl_priv *priv, - struct iwl_tx_queue *txq, +extern int iwl4965_tx_queue_update_wr_ptr(struct iwl4965_priv *priv, + struct iwl4965_tx_queue *txq, u16 byte_cnt); -extern void iwl4965_add_station(struct iwl_priv *priv, const u8 *addr, +extern void iwl4965_add_station(struct iwl4965_priv *priv, const u8 *addr, int is_ap); -extern void iwl4965_set_rxon_ht(struct iwl_priv *priv, +extern void iwl4965_set_rxon_ht(struct iwl4965_priv *priv, struct sta_ht_info *ht_info); -extern void iwl4965_set_rxon_chain(struct iwl_priv *priv); -extern int iwl4965_tx_cmd(struct iwl_priv *priv, struct iwl_cmd *out_cmd, +extern void iwl4965_set_rxon_chain(struct iwl4965_priv *priv); +extern int iwl4965_tx_cmd(struct iwl4965_priv *priv, struct iwl4965_cmd *out_cmd, u8 sta_id, dma_addr_t txcmd_phys, struct ieee80211_hdr *hdr, u8 hdr_len, struct ieee80211_tx_control *ctrl, void *sta_in); -extern int iwl4965_init_hw_rates(struct iwl_priv *priv, - struct ieee80211_rate *rates); -extern int iwl4965_alive_notify(struct iwl_priv *priv); -extern void iwl4965_update_rate_scaling(struct iwl_priv *priv, u8 mode); -extern void iwl4965_set_ht_add_station(struct iwl_priv *priv, u8 index); - -extern void iwl4965_chain_noise_reset(struct iwl_priv *priv); -extern void iwl4965_init_sensitivity(struct iwl_priv *priv, u8 flags, +extern int iwl4965_alive_notify(struct iwl4965_priv *priv); +extern void iwl4965_update_rate_scaling(struct iwl4965_priv *priv, u8 mode); +extern void iwl4965_set_ht_add_station(struct iwl4965_priv *priv, u8 index); + +extern void iwl4965_chain_noise_reset(struct iwl4965_priv *priv); +extern void iwl4965_init_sensitivity(struct iwl4965_priv *priv, u8 flags, u8 force); -extern int iwl4965_set_fat_chan_info(struct iwl_priv *priv, int phymode, +extern int iwl4965_set_fat_chan_info(struct iwl4965_priv *priv, int phymode, u16 channel, - const struct iwl_eeprom_channel *eeprom_ch, + const struct iwl4965_eeprom_channel *eeprom_ch, u8 fat_extension_channel); -extern void iwl4965_rf_kill_ct_config(struct iwl_priv *priv); +extern void iwl4965_rf_kill_ct_config(struct iwl4965_priv *priv); #ifdef CONFIG_IWL4965_HT #ifdef CONFIG_IWL4965_HT_AGG -extern int iwl_mac_ht_tx_agg_start(struct ieee80211_hw *hw, u8 *da, +extern int iwl4965_mac_ht_tx_agg_start(struct ieee80211_hw *hw, u8 *da, u16 tid, u16 *start_seq_num); -extern int iwl_mac_ht_rx_agg_start(struct ieee80211_hw *hw, u8 *da, +extern int iwl4965_mac_ht_rx_agg_start(struct ieee80211_hw *hw, u8 *da, u16 tid, u16 start_seq_num); -extern int iwl_mac_ht_rx_agg_stop(struct ieee80211_hw *hw, u8 *da, +extern int iwl4965_mac_ht_rx_agg_stop(struct ieee80211_hw *hw, u8 *da, u16 tid, int generator); -extern int iwl_mac_ht_tx_agg_stop(struct ieee80211_hw *hw, u8 *da, +extern int iwl4965_mac_ht_tx_agg_stop(struct ieee80211_hw *hw, u8 *da, u16 tid, int generator); -extern void iwl4965_turn_off_agg(struct iwl_priv *priv, u8 tid); +extern void iwl4965_turn_off_agg(struct iwl4965_priv *priv, u8 tid); #endif /* CONFIG_IWL4965_HT_AGG */ #endif /*CONFIG_IWL4965_HT */ /* Structures, enum, and defines specific to the 4965 */ #define IWL4965_KW_SIZE 0x1000 /*4k */ -struct iwl_kw { +struct iwl4965_kw { dma_addr_t dma_addr; void *v_addr; size_t size; @@ -835,7 +833,7 @@ struct iwl_kw { #define IWL_TX_POWER_CCK_COMPENSATION_B_STEP (9) #define IWL_TX_POWER_CCK_COMPENSATION_C_STEP (5) -struct iwl_traffic_load { +struct iwl4965_traffic_load { unsigned long time_stamp; u32 packet_count[TID_QUEUE_MAX_SIZE]; u8 queue_count; @@ -844,7 +842,7 @@ struct iwl_traffic_load { }; #ifdef CONFIG_IWL4965_HT_AGG -struct iwl_agg_control { +struct iwl4965_agg_control { unsigned long next_retry; u32 wait_for_agg_status; u32 tid_retry; @@ -853,13 +851,13 @@ struct iwl_agg_control { u8 auto_agg; u32 tid_traffic_load_threshold; u32 ba_timeout; - struct iwl_traffic_load traffic_load[TID_MAX_LOAD_COUNT]; + struct iwl4965_traffic_load traffic_load[TID_MAX_LOAD_COUNT]; }; #endif /*CONFIG_IWL4965_HT_AGG */ -struct iwl_lq_mngr { +struct iwl4965_lq_mngr { #ifdef CONFIG_IWL4965_HT_AGG - struct iwl_agg_control agg_ctrl; + struct iwl4965_agg_control agg_ctrl; #endif spinlock_t lock; s32 max_window_size; @@ -940,24 +938,24 @@ struct iwl_lq_mngr { #define IN_BAND_FILTER 0xFF #define MIN_AVERAGE_NOISE_MAX_VALUE 0xFFFFFFFF -enum iwl_false_alarm_state { +enum iwl4965_false_alarm_state { IWL_FA_TOO_MANY = 0, IWL_FA_TOO_FEW = 1, IWL_FA_GOOD_RANGE = 2, }; -enum iwl_chain_noise_state { +enum iwl4965_chain_noise_state { IWL_CHAIN_NOISE_ALIVE = 0, /* must be 0 */ IWL_CHAIN_NOISE_ACCUMULATE = 1, IWL_CHAIN_NOISE_CALIBRATED = 2, }; -enum iwl_sensitivity_state { +enum iwl4965_sensitivity_state { IWL_SENS_CALIB_ALLOWED = 0, IWL_SENS_CALIB_NEED_REINIT = 1, }; -enum iwl_calib_enabled_state { +enum iwl4965_calib_enabled_state { IWL_CALIB_DISABLED = 0, /* must be 0 */ IWL_CALIB_ENABLED = 1, }; @@ -972,7 +970,7 @@ struct statistics_general_data { }; /* Sensitivity calib data */ -struct iwl_sensitivity_data { +struct iwl4965_sensitivity_data { u32 auto_corr_ofdm; u32 auto_corr_ofdm_mrc; u32 auto_corr_ofdm_x1; @@ -1001,7 +999,7 @@ struct iwl_sensitivity_data { }; /* Chain noise (differential Rx gain) calib data */ -struct iwl_chain_noise_data { +struct iwl4965_chain_noise_data { u8 state; u16 beacon_count; u32 chain_noise_a; @@ -1049,7 +1047,7 @@ enum { #endif -struct iwl_priv { +struct iwl4965_priv { /* ieee device used by generic ieee processing code */ struct ieee80211_hw *hw; @@ -1063,27 +1061,27 @@ struct iwl_priv { u8 phymode; int alloc_rxb_skb; - void (*rx_handlers[REPLY_MAX])(struct iwl_priv *priv, - struct iwl_rx_mem_buffer *rxb); + void (*rx_handlers[REPLY_MAX])(struct iwl4965_priv *priv, + struct iwl4965_rx_mem_buffer *rxb); const struct ieee80211_hw_mode *modes; #ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT /* spectrum measurement report caching */ - struct iwl_spectrum_notification measure_report; + struct iwl4965_spectrum_notification measure_report; u8 measurement_status; #endif /* ucode beacon time */ u32 ucode_beacon_time; - /* we allocate array of iwl_channel_info for NIC's valid channels. + /* we allocate array of iwl4965_channel_info for NIC's valid channels. * Access via channel # using indirect index array */ - struct iwl_channel_info *channel_info; /* channel info array */ + struct iwl4965_channel_info *channel_info; /* channel info array */ u8 channel_count; /* # of channels */ /* each calibration channel group in the EEPROM has a derived * clip setting for each rate. */ - const struct iwl_clip_group clip_groups[5]; + const struct iwl4965_clip_group clip_groups[5]; /* thermal calibration */ s32 temperature; /* degrees Kelvin */ @@ -1098,7 +1096,7 @@ struct iwl_priv { int one_direct_scan; u8 direct_ssid_len; u8 direct_ssid[IW_ESSID_MAX_SIZE]; - struct iwl_scan_cmd *scan; + struct iwl4965_scan_cmd *scan; u8 only_active_channel; /* spinlock */ @@ -1121,26 +1119,26 @@ struct iwl_priv { struct fw_desc ucode_boot; /* bootstrap inst */ - struct iwl_rxon_time_cmd rxon_timing; + struct iwl4965_rxon_time_cmd rxon_timing; /* We declare this const so it can only be * changed via explicit cast within the * routines that actually update the physical * hardware */ - const struct iwl_rxon_cmd active_rxon; - struct iwl_rxon_cmd staging_rxon; + const struct iwl4965_rxon_cmd active_rxon; + struct iwl4965_rxon_cmd staging_rxon; int error_recovering; - struct iwl_rxon_cmd recovery_rxon; + struct iwl4965_rxon_cmd recovery_rxon; /* 1st responses from initialize and runtime uCode images. * 4965's initialize alive response contains some calibration data. */ - struct iwl_init_alive_resp card_alive_init; - struct iwl_alive_resp card_alive; + struct iwl4965_init_alive_resp card_alive_init; + struct iwl4965_alive_resp card_alive; #ifdef LED /* LED related variables */ - struct iwl_activity_blink activity; + struct iwl4965_activity_blink activity; unsigned long led_packets; int led_state; #endif @@ -1158,8 +1156,8 @@ struct iwl_priv { u8 current_channel_width; u8 valid_antenna; /* Bit mask of antennas actually connected */ #ifdef CONFIG_IWL4965_SENSITIVITY - struct iwl_sensitivity_data sensitivity_data; - struct iwl_chain_noise_data chain_noise_data; + struct iwl4965_sensitivity_data sensitivity_data; + struct iwl4965_chain_noise_data chain_noise_data; u8 start_calib; __le16 sensitivity_tbl[HD_TABLE_SIZE]; #endif /*CONFIG_IWL4965_SENSITIVITY*/ @@ -1171,7 +1169,7 @@ struct iwl_priv { u8 last_phy_res[100]; /* Rate scaling data */ - struct iwl_lq_mngr lq_mngr; + struct iwl4965_lq_mngr lq_mngr; /* Rate scaling data */ s8 data_retry_limit; @@ -1182,10 +1180,10 @@ struct iwl_priv { int activity_timer_active; /* Rx and Tx DMA processing queues */ - struct iwl_rx_queue rxq; - struct iwl_tx_queue txq[IWL_MAX_NUM_QUEUES]; + struct iwl4965_rx_queue rxq; + struct iwl4965_tx_queue txq[IWL_MAX_NUM_QUEUES]; unsigned long txq_ctx_active_msk; - struct iwl_kw kw; /* keep warm address */ + struct iwl4965_kw kw; /* keep warm address */ u32 scd_base_addr; /* scheduler sram base address */ unsigned long status; @@ -1194,9 +1192,9 @@ struct iwl_priv { int last_rx_rssi; /* From Rx packet statisitics */ int last_rx_noise; /* From beacon statistics */ - struct iwl_power_mgr power_data; + struct iwl4965_power_mgr power_data; - struct iwl_notif_statistics statistics; + struct iwl4965_notif_statistics statistics; unsigned long last_statistics_time; /* context information */ @@ -1213,7 +1211,7 @@ struct iwl_priv { /*station table variables */ spinlock_t sta_lock; int num_stations; - struct iwl_station_entry stations[IWL_STATION_COUNT]; + struct iwl4965_station_entry stations[IWL_STATION_COUNT]; /* Indication if ieee80211_ops->open has been called */ int is_open; @@ -1234,7 +1232,7 @@ struct iwl_priv { struct list_head ibss_mac_hash[IWL_IBSS_MAC_HASH_SIZE]; /* eeprom */ - struct iwl_eeprom eeprom; + struct iwl4965_eeprom eeprom; int iw_mode; @@ -1244,7 +1242,7 @@ struct iwl_priv { u32 timestamp0; u32 timestamp1; u16 beacon_int; - struct iwl_driver_hw_info hw_setting; + struct iwl4965_driver_hw_info hw_setting; int interface_id; /* Current association information needed to configure the @@ -1254,7 +1252,7 @@ struct iwl_priv { u8 ps_mode; #ifdef CONFIG_IWL4965_QOS - struct iwl_qos_info qos_data; + struct iwl4965_qos_info qos_data; #endif /*CONFIG_IWL4965_QOS */ struct workqueue_struct *workqueue; @@ -1306,55 +1304,55 @@ struct iwl_priv { #ifdef CONFIG_IWL4965_HT_AGG struct work_struct agg_work; #endif -}; /*iwl_priv */ +}; /*iwl4965_priv */ -static inline int iwl_is_associated(struct iwl_priv *priv) +static inline int iwl4965_is_associated(struct iwl4965_priv *priv) { return (priv->active_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0; } -static inline int is_channel_valid(const struct iwl_channel_info *ch_info) +static inline int is_channel_valid(const struct iwl4965_channel_info *ch_info) { if (ch_info == NULL) return 0; return (ch_info->flags & EEPROM_CHANNEL_VALID) ? 1 : 0; } -static inline int is_channel_narrow(const struct iwl_channel_info *ch_info) +static inline int is_channel_narrow(const struct iwl4965_channel_info *ch_info) { return (ch_info->flags & EEPROM_CHANNEL_NARROW) ? 1 : 0; } -static inline int is_channel_radar(const struct iwl_channel_info *ch_info) +static inline int is_channel_radar(const struct iwl4965_channel_info *ch_info) { return (ch_info->flags & EEPROM_CHANNEL_RADAR) ? 1 : 0; } -static inline u8 is_channel_a_band(const struct iwl_channel_info *ch_info) +static inline u8 is_channel_a_band(const struct iwl4965_channel_info *ch_info) { return ch_info->phymode == MODE_IEEE80211A; } -static inline u8 is_channel_bg_band(const struct iwl_channel_info *ch_info) +static inline u8 is_channel_bg_band(const struct iwl4965_channel_info *ch_info) { return ((ch_info->phymode == MODE_IEEE80211B) || (ch_info->phymode == MODE_IEEE80211G)); } -static inline int is_channel_passive(const struct iwl_channel_info *ch) +static inline int is_channel_passive(const struct iwl4965_channel_info *ch) { return (!(ch->flags & EEPROM_CHANNEL_ACTIVE)) ? 1 : 0; } -static inline int is_channel_ibss(const struct iwl_channel_info *ch) +static inline int is_channel_ibss(const struct iwl4965_channel_info *ch) { return ((ch->flags & EEPROM_CHANNEL_IBSS)) ? 1 : 0; } -extern const struct iwl_channel_info *iwl_get_channel_info( - const struct iwl_priv *priv, int phymode, u16 channel); +extern const struct iwl4965_channel_info *iwl4965_get_channel_info( + const struct iwl4965_priv *priv, int phymode, u16 channel); -/* Requires full declaration of iwl_priv before including */ +/* Requires full declaration of iwl4965_priv before including */ #include "iwl-4965-io.h" -#endif /* __iwl_4965_h__ */ +#endif /* __iwl4965_4965_h__ */ -- cgit v1.2.3 From 7762635547ad31ecb045e7073989e76ae13e6c54 Mon Sep 17 00:00:00 2001 From: Ben Cahill Date: Thu, 29 Nov 2007 11:09:44 +0800 Subject: iwl4965: add comments to rate scaling code Add comments to rate scaling code. Signed-off-by: Ben Cahill Signed-off-by: Zhu Yi Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index 5944b4b9828..d0abbb3a5ac 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -489,7 +489,7 @@ struct sta_ht_info { u8 supported_chan_width; u8 extension_chan_offset; u8 is_green_field; - u8 sgf; + u8 sgf; /* HT_SHORT_GI_* short guard interval */ u8 supp_rates[16]; u8 tx_chan_width; u8 chan_width_cap; -- cgit v1.2.3 From bc47279f558e7e9ea70dad1d484d2816ec239bb0 Mon Sep 17 00:00:00 2001 From: Ben Cahill Date: Thu, 29 Nov 2007 11:09:49 +0800 Subject: iwlwifi: Add comments to some driver data structures Add comments to some driver data structures Remove unused "sched_retry" member from struct iwl3945_tx_queue Signed-off-by: Ben Cahill Signed-off-by: Zhu Yi Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 58 +++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 7 deletions(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index d0abbb3a5ac..30001482c48 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -129,6 +129,7 @@ struct iwl4965_queue { #define MAX_NUM_OF_TBS (20) +/* One for each TFD */ struct iwl4965_tx_info { struct ieee80211_tx_status status; struct sk_buff *skb[MAX_NUM_OF_TBS]; @@ -136,10 +137,16 @@ struct iwl4965_tx_info { /** * struct iwl4965_tx_queue - Tx Queue for DMA - * @need_update: need to update read/write index - * @shed_retry: queue is HT AGG enabled + * @q: generic Rx/Tx queue descriptor + * @bd: base of circular buffer of TFDs + * @cmd: array of command/Tx buffers + * @dma_addr_cmd: physical address of cmd/tx buffer array + * @txb: array of per-TFD driver data + * @need_update: indicates need to update read/write index + * @sched_retry: indicates queue is high-throughput aggregation (HT AGG) enabled * - * Queue consists of circular buffer of BD's and required locking structures. + * A Tx queue consists of circular buffer of BDs (a.k.a. TFDs, transmit frame + * descriptors) and required locking structures. */ struct iwl4965_tx_queue { struct iwl4965_queue q; @@ -332,9 +339,16 @@ struct iwl4965_cmd_meta { } __attribute__ ((packed)); +/** + * struct iwl4965_cmd + * + * For allocation of the command and tx queues, this establishes the overall + * size of the largest command we send to uCode, except for a scan command + * (which is relatively huge; space is allocated separately). + */ struct iwl4965_cmd { - struct iwl4965_cmd_meta meta; - struct iwl4965_cmd_header hdr; + struct iwl4965_cmd_meta meta; /* driver data */ + struct iwl4965_cmd_header hdr; /* uCode API */ union { struct iwl4965_addsta_cmd addsta; struct iwl4965_led_cmd led; @@ -436,6 +450,20 @@ struct iwl4965_rx_queue { #ifdef CONFIG_IWL4965_HT #ifdef CONFIG_IWL4965_HT_AGG +/** + * struct iwl4965_ht_agg -- aggregation status while waiting for block-ack + * @txq_id: Tx queue used for Tx attempt + * @frame_count: # frames attempted by Tx command + * @wait_for_ba: Expect block-ack before next Tx reply + * @start_idx: Index of 1st Transmit Frame Descriptor (TFD) in Tx window + * @bitmap0: Low order bitmap, one bit for each frame pending ACK in Tx window + * @bitmap1: High order, one bit for each frame pending ACK in Tx window + * @rate_n_flags: Rate at which Tx was attempted + * + * If REPLY_TX indicates that aggregation was attempted, driver must wait + * for block ack (REPLY_COMPRESSED_BA). This struct stores tx reply info + * until block ack arrives. + */ struct iwl4965_ht_agg { u16 txq_id; u16 frame_count; @@ -566,6 +594,19 @@ struct iwl4965_ibss_seq { struct list_head list; }; +/** + * struct iwl4965_driver_hw_info + * @max_txq_num: Max # Tx queues supported + * @ac_queue_count: # Tx queues for EDCA Access Categories (AC) + * @tx_cmd_len: Size of Tx command (but not including frame itself) + * @max_rxq_size: Max # Rx frames in Rx queue (must be power-of-2) + * @rx_buffer_size: + * @max_rxq_log: Log-base-2 of max_rxq_size + * @max_stations: + * @bcast_sta_id: + * @shared_virt: Pointer to driver/uCode shared Tx Byte Counts and Rx status + * @shared_phys: Physical Pointer to Tx Byte Counts and Rx status + */ struct iwl4965_driver_hw_info { u16 max_txq_num; u16 ac_queue_count; @@ -1149,10 +1190,11 @@ struct iwl4965_priv { u8 call_post_assoc_from_beacon; u8 assoc_station_added; u8 use_ant_b_for_management_frame; /* Tx antenna selection */ - /* HT variables */ + + /* High Throughput (HT) variables */ u8 is_dup; u8 is_ht_enabled; - u8 channel_width; /* 0=20MHZ, 1=40MHZ */ + u8 channel_width; /* 0=20MHZ, 1=40MHZ supported */ u8 current_channel_width; u8 valid_antenna; /* Bit mask of antennas actually connected */ #ifdef CONFIG_IWL4965_SENSITIVITY @@ -1229,6 +1271,8 @@ struct iwl4965_priv { u16 last_seq_num; u16 last_frag_num; unsigned long last_packet_time; + + /* Hash table for finding stations in IBSS network */ struct list_head ibss_mac_hash[IWL_IBSS_MAC_HASH_SIZE]; /* eeprom */ -- cgit v1.2.3 From abceddb40728397fcfd0b295d7530920a606ab88 Mon Sep 17 00:00:00 2001 From: Ben Cahill Date: Thu, 29 Nov 2007 11:09:50 +0800 Subject: iwlwifi: Document 4965 rate_n_flags bits Document 4965 rate_n_flags bits Signed-off-by: Ben Cahill Signed-off-by: Zhu Yi Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index 30001482c48..af3497442a4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -883,6 +883,11 @@ struct iwl4965_traffic_load { }; #ifdef CONFIG_IWL4965_HT_AGG +/** + * struct iwl4965_agg_control + * @requested_ba: bit map of tids requesting aggregation/block-ack + * @granted_ba: bit map of tids granted aggregation/block-ack + */ struct iwl4965_agg_control { unsigned long next_retry; u32 wait_for_agg_status; @@ -1054,29 +1059,8 @@ struct iwl4965_chain_noise_data { u8 radio_write; }; -/* IWL4965 */ -#define RATE_MCS_CODE_MSK 0x7 -#define RATE_MCS_MIMO_POS 3 -#define RATE_MCS_MIMO_MSK 0x8 -#define RATE_MCS_HT_DUP_POS 5 -#define RATE_MCS_HT_DUP_MSK 0x20 -#define RATE_MCS_FLAGS_POS 8 -#define RATE_MCS_HT_POS 8 -#define RATE_MCS_HT_MSK 0x100 -#define RATE_MCS_CCK_POS 9 -#define RATE_MCS_CCK_MSK 0x200 -#define RATE_MCS_GF_POS 10 -#define RATE_MCS_GF_MSK 0x400 - -#define RATE_MCS_FAT_POS 11 -#define RATE_MCS_FAT_MSK 0x800 -#define RATE_MCS_DUP_POS 12 -#define RATE_MCS_DUP_MSK 0x1000 -#define RATE_MCS_SGI_POS 13 -#define RATE_MCS_SGI_MSK 0x2000 - -#define EEPROM_SEM_TIMEOUT 10 -#define EEPROM_SEM_RETRY_LIMIT 1000 +#define EEPROM_SEM_TIMEOUT 10 /* milliseconds */ +#define EEPROM_SEM_RETRY_LIMIT 1000 /* number of attempts (not time) */ #ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT -- cgit v1.2.3 From f7d09d7c453f197d802c50172b27170a43e1a816 Mon Sep 17 00:00:00 2001 From: Ben Cahill Date: Thu, 29 Nov 2007 11:09:51 +0800 Subject: iwlwifi: Document Rx calibration Document Rx calibration Signed-off-by: Ben Cahill Signed-off-by: Zhu Yi Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index af3497442a4..321767f5390 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -924,22 +924,6 @@ struct iwl4965_lq_mngr { #define CAL_NUM_OF_BEACONS 20 #define MAXIMUM_ALLOWED_PATHLOSS 15 -/* Param table within SENSITIVITY_CMD */ -#define HD_MIN_ENERGY_CCK_DET_INDEX (0) -#define HD_MIN_ENERGY_OFDM_DET_INDEX (1) -#define HD_AUTO_CORR32_X1_TH_ADD_MIN_INDEX (2) -#define HD_AUTO_CORR32_X1_TH_ADD_MIN_MRC_INDEX (3) -#define HD_AUTO_CORR40_X4_TH_ADD_MIN_MRC_INDEX (4) -#define HD_AUTO_CORR32_X4_TH_ADD_MIN_INDEX (5) -#define HD_AUTO_CORR32_X4_TH_ADD_MIN_MRC_INDEX (6) -#define HD_BARKER_CORR_TH_ADD_MIN_INDEX (7) -#define HD_BARKER_CORR_TH_ADD_MIN_MRC_INDEX (8) -#define HD_AUTO_CORR40_X4_TH_ADD_MIN_INDEX (9) -#define HD_OFDM_ENERGY_TH_IN_INDEX (10) - -#define SENSITIVITY_CMD_CONTROL_DEFAULT_TABLE __constant_cpu_to_le16(0) -#define SENSITIVITY_CMD_CONTROL_WORK_TABLE __constant_cpu_to_le16(1) - #define CHAIN_NOISE_MAX_DELTA_GAIN_CODE 3 #define MAX_FA_OFDM 50 @@ -967,8 +951,6 @@ struct iwl4965_lq_mngr { #define AUTO_CORR_STEP_CCK 3 #define AUTO_CORR_MAX_TH_CCK 160 -#define NRG_ALG 0 -#define AUTO_CORR_ALG 1 #define NRG_DIFF 2 #define NRG_STEP_CCK 2 #define NRG_MARGIN 8 -- cgit v1.2.3 From 74093ddf4c42da74922b63fb6844989e21164d9e Mon Sep 17 00:00:00 2001 From: Ben Cahill Date: Thu, 29 Nov 2007 11:09:53 +0800 Subject: iwlwifi: clean up some unused definitions in iwl-4965.h and iwl-3945.h Clean up some unused definitions in iwl-4965.h and iwl-3945.h Move STA_FLG_ definitions to iwl-4965-commands.h Signed-off-by: Ben Cahill Signed-off-by: Zhu Yi Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index 321767f5390..9438c635f45 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -192,14 +192,6 @@ struct iwl4965_scan_power_info { s8 requested_power; /* scan pwr (dBm) requested for chnl/rate */ }; -/* Channel unlock period is 15 seconds. If no beacon or probe response - * has been received within 15 seconds on a locked channel then the channel - * remains locked. */ -#define TX_UNLOCK_PERIOD 15 - -/* CSA lock period is 15 seconds. If a CSA has been received on a channel in - * the last 15 seconds, the channel is locked */ -#define CSA_LOCK_PERIOD 15 /* * One for each channel, holds all channel setup data * Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant @@ -620,15 +612,6 @@ struct iwl4965_driver_hw_info { dma_addr_t shared_phys; }; - -#define STA_FLG_RTS_MIMO_PROT_MSK __constant_cpu_to_le32(1 << 17) -#define STA_FLG_AGG_MPDU_8US_MSK __constant_cpu_to_le32(1 << 18) -#define STA_FLG_MAX_AGG_SIZE_POS (19) -#define STA_FLG_MAX_AGG_SIZE_MSK __constant_cpu_to_le32(3 << 19) -#define STA_FLG_FAT_EN_MSK __constant_cpu_to_le32(1 << 21) -#define STA_FLG_MIMO_DIS_MSK __constant_cpu_to_le32(1 << 22) -#define STA_FLG_AGG_MPDU_DENSITY_POS (23) -#define STA_FLG_AGG_MPDU_DENSITY_MSK __constant_cpu_to_le32(7 << 23) #define HT_SHORT_GI_20MHZ_ONLY (1 << 0) #define HT_SHORT_GI_40MHZ_ONLY (1 << 1) @@ -860,17 +843,8 @@ struct iwl4965_kw { #define NRG_NUM_PREV_STAT_L 20 #define NUM_RX_CHAINS (3) -#define TX_POWER_IWL_ILLEGAL_VDET -100000 #define TX_POWER_IWL_ILLEGAL_VOLTAGE -10000 -#define TX_POWER_IWL_CLOSED_LOOP_MIN_POWER 18 -#define TX_POWER_IWL_CLOSED_LOOP_MAX_POWER 34 -#define TX_POWER_IWL_VDET_SLOPE_BELOW_NOMINAL 17 -#define TX_POWER_IWL_VDET_SLOPE_ABOVE_NOMINAL 20 -#define TX_POWER_IWL_NOMINAL_POWER 26 -#define TX_POWER_IWL_CLOSED_LOOP_ITERATION_LIMIT 1 #define TX_POWER_IWL_VOLTAGE_CODES_PER_03V 7 -#define TX_POWER_IWL_DEGREES_PER_VDET_CODE 11 -#define IWL_TX_POWER_MAX_NUM_PA_MEASUREMENTS 1 #define IWL_TX_POWER_CCK_COMPENSATION_B_STEP (9) #define IWL_TX_POWER_CCK_COMPENSATION_C_STEP (5) -- cgit v1.2.3 From fcd427bbba10fc315d1c958b85bba74448db4eb4 Mon Sep 17 00:00:00 2001 From: Ben Cahill Date: Thu, 29 Nov 2007 11:10:00 +0800 Subject: iwlwifi: move HT_IE_EXT_CHANNEL_* driver definitions to iwl-4965.h Move HT_IE_EXT_CHANNEL_* driver definitions to iwl-4965.h Add comments to guide .h file usage (hw/api/driver definitions) Minor comment cleanup Signed-off-by: Ben Cahill Signed-off-by: Zhu Yi Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index 9438c635f45..4a1ec9442c8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -23,6 +23,12 @@ * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 * *****************************************************************************/ +/* + * Please use this file (iwl-4965.h) for driver implementation definitions. + * Please use iwl-4965-commands.h for uCode API definitions. + * Please use iwl-4965-hw.h for hardware-related definitions. + */ + #ifndef __iwl_4965_h__ #define __iwl_4965_h__ @@ -192,6 +198,15 @@ struct iwl4965_scan_power_info { s8 requested_power; /* scan pwr (dBm) requested for chnl/rate */ }; +/* For fat_extension_channel */ +enum { + HT_IE_EXT_CHANNEL_NONE = 0, + HT_IE_EXT_CHANNEL_ABOVE, + HT_IE_EXT_CHANNEL_INVALID, + HT_IE_EXT_CHANNEL_BELOW, + HT_IE_EXT_CHANNEL_MAX +}; + /* * One for each channel, holds all channel setup data * Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant @@ -202,14 +217,14 @@ struct iwl4965_scan_power_info { struct iwl4965_channel_info { struct iwl4965_channel_tgd_info tgd; struct iwl4965_channel_tgh_info tgh; - struct iwl4965_eeprom_channel eeprom; /* EEPROM regulatory limit */ - struct iwl4965_eeprom_channel fat_eeprom; /* EEPROM regulatory limit for - * FAT channel */ + struct iwl4965_eeprom_channel eeprom; /* EEPROM regulatory limit */ + struct iwl4965_eeprom_channel fat_eeprom; /* EEPROM regulatory limit for + * FAT channel */ u8 channel; /* channel number */ u8 flags; /* flags copied from EEPROM */ s8 max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */ - s8 curr_txpow; /* (dBm) regulatory/spectrum/user (not h/w) */ + s8 curr_txpow; /* (dBm) regulatory/spectrum/user (not h/w) limit */ s8 min_power; /* always 0 */ s8 scan_power; /* (dBm) regul. eeprom, direct scans, any rate */ @@ -228,7 +243,7 @@ struct iwl4965_channel_info { s8 fat_min_power; /* always 0 */ s8 fat_scan_power; /* (dBm) eeprom, direct scans, any rate */ u8 fat_flags; /* flags copied from EEPROM */ - u8 fat_extension_channel; + u8 fat_extension_channel; /* HT_IE_EXT_CHANNEL_* */ /* Radio/DSP gain settings for each scan rate, for directed scans. */ struct iwl4965_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES]; -- cgit v1.2.3 From 0c434c5a7f9983c8ee3c8943924db8c5fb1d12bd Mon Sep 17 00:00:00 2001 From: Ben Cahill Date: Thu, 29 Nov 2007 11:10:02 +0800 Subject: iwlwifi: document txpower calculations Document txpower calculations Signed-off-by: Ben Cahill Signed-off-by: Zhu Yi Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index 4a1ec9442c8..2930c10b5ed 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -859,9 +859,6 @@ struct iwl4965_kw { #define NUM_RX_CHAINS (3) #define TX_POWER_IWL_ILLEGAL_VOLTAGE -10000 -#define TX_POWER_IWL_VOLTAGE_CODES_PER_03V 7 -#define IWL_TX_POWER_CCK_COMPENSATION_B_STEP (9) -#define IWL_TX_POWER_CCK_COMPENSATION_C_STEP (5) struct iwl4965_traffic_load { unsigned long time_stamp; -- cgit v1.2.3 From 7878a5a4fcc5002e805c054730c4c5639c9d071d Mon Sep 17 00:00:00 2001 From: Mohamed Abbas Date: Thu, 29 Nov 2007 11:10:13 +0800 Subject: iwlwifi: enhance WPA authenication stability This patch enhanced WPA authenication stability by avoiding scan immediately followed by association. We don't do any scanning right after association in next several seconds. This will allow WPA authentication to take place without any interruption. Signed-off-by: Mohamed Abbas Signed-off-by: Zhu Yi Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index 2930c10b5ed..c0627386122 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -1082,6 +1082,7 @@ struct iwl4965_priv { /* Scan related variables */ unsigned long last_scan_jiffies; + unsigned long next_scan_jiffies; unsigned long scan_start; unsigned long scan_pass_start; unsigned long scan_start_tsf; -- cgit v1.2.3 From a84fd3452d65bd3ec39168ff976f9316f33ab8eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Bot=C3=B3n?= Date: Sun, 25 Nov 2007 15:58:07 +0100 Subject: iwlwifi: remove redundant declaration of 'iwl3945_priv' and 'iwl4965_priv' structs This patch removes a redundant declaration of 'iwl3945_priv' and 'iwl4965_priv' structs. Signed-off-by: Miguel Boton Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index c0627386122..42ce27f2eee 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -36,8 +36,6 @@ #include #include -struct iwl4965_priv; - /* Hardware specific file defines the PCI IDs table for that hardware module */ extern struct pci_device_id iwl4965_hw_card_ids[]; -- cgit v1.2.3 From 76bb77e03f5b01fb83fb9fa79febba6e499f948b Mon Sep 17 00:00:00 2001 From: Zhu Yi Date: Thu, 22 Nov 2007 10:53:22 +0800 Subject: iwlwifi: cache mac80211 conf setting during a hardware scan This patch caches mac80211 configuration setting during a hardware scan for the iwlwifi drivers. Signed-off-by: Zhu Yi Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index 42ce27f2eee..dda2bfbcb05 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -1044,6 +1044,7 @@ struct iwl4965_priv { struct ieee80211_hw *hw; struct ieee80211_channel *ieee_channels; struct ieee80211_rate *ieee_rates; + struct ieee80211_conf *cache_conf; /* temporary frame storage list */ struct list_head free_frames; -- cgit v1.2.3 From 9e0cc6de99792151b16dbd622b11ba6607a85b72 Mon Sep 17 00:00:00 2001 From: Ron Rindjunsky Date: Mon, 26 Nov 2007 16:14:36 +0200 Subject: iwlwifi: 802.11n new framework structures preperation This patch removes unnecessary or duplicate 802.11n data from structures in the code, and prepares them for new mac80211's 802.11n framework Signed-off-by: Ron Rindjunsky Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index dda2bfbcb05..c0e9747ca49 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -510,22 +510,23 @@ union iwl4965_ht_rate_supp { #define CFG_HT_MPDU_DENSITY_2USEC (0x5) #define CFG_HT_MPDU_DENSITY_DEF CFG_HT_MPDU_DENSITY_2USEC -struct sta_ht_info { +struct iwl_ht_info { + /* self configuration data */ u8 is_ht; - u16 rx_mimo_ps_mode; + u8 supported_chan_width; u16 tx_mimo_ps_mode; - u16 control_channel; + u8 is_green_field; + u8 sgf; u8 max_amsdu_size; u8 ampdu_factor; u8 mpdu_density; - u8 operating_mode; - u8 supported_chan_width; + u8 supp_mcs_set[16]; + /* BSS related data */ + u8 control_channel; u8 extension_chan_offset; - u8 is_green_field; - u8 sgf; /* HT_SHORT_GI_* short guard interval */ - u8 supp_rates[16]; u8 tx_chan_width; - u8 chan_width_cap; + u8 ht_protection; + u8 non_GF_STA_present; }; #endif /*CONFIG_IWL4965_HT */ @@ -1142,12 +1143,6 @@ struct iwl4965_priv { u8 call_post_assoc_from_beacon; u8 assoc_station_added; u8 use_ant_b_for_management_frame; /* Tx antenna selection */ - - /* High Throughput (HT) variables */ - u8 is_dup; - u8 is_ht_enabled; - u8 channel_width; /* 0=20MHZ, 1=40MHZ supported */ - u8 current_channel_width; u8 valid_antenna; /* Bit mask of antennas actually connected */ #ifdef CONFIG_IWL4965_SENSITIVITY struct iwl4965_sensitivity_data sensitivity_data; @@ -1157,9 +1152,8 @@ struct iwl4965_priv { #endif /*CONFIG_IWL4965_SENSITIVITY*/ #ifdef CONFIG_IWL4965_HT - struct sta_ht_info current_assoc_ht; + struct iwl_ht_info current_ht_config; #endif - u8 active_rate_ht[2]; u8 last_phy_res[100]; /* Rate scaling data */ -- cgit v1.2.3 From 326eeee807ca7ed4489cb21d4ebe8e52079c11c3 Mon Sep 17 00:00:00 2001 From: Ron Rindjunsky Date: Mon, 26 Nov 2007 16:14:37 +0200 Subject: iwlwifi: 802.11n configuring hw_mode parameters to support HT in A/G This patch fills the mac80211's ieee80211_hw_mode structures with the needed 802.11n data needed for the new framework Signed-off-by: Ron Rindjunsky Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index c0e9747ca49..5fd01149ebf 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -801,6 +801,8 @@ extern int iwl4965_set_fat_chan_info(struct iwl4965_priv *priv, int phymode, extern void iwl4965_rf_kill_ct_config(struct iwl4965_priv *priv); #ifdef CONFIG_IWL4965_HT +extern void iwl4965_init_ht_hw_capab(struct ieee80211_ht_info *ht_info, + int mode); #ifdef CONFIG_IWL4965_HT_AGG extern int iwl4965_mac_ht_tx_agg_start(struct ieee80211_hw *hw, u8 *da, u16 tid, u16 *start_seq_num); -- cgit v1.2.3 From fd105e79d19439d29a6561178fb5fe511e141f6b Mon Sep 17 00:00:00 2001 From: Ron Rindjunsky Date: Mon, 26 Nov 2007 16:14:39 +0200 Subject: iwlwifi: 802.11n comply HT self configuration flow with mac80211 framework This patch conforms HW configuration changes according to new mac80211's HT framework Signed-off-by: Ron Rindjunsky Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index 5fd01149ebf..6fdfb4a3be9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -766,7 +766,6 @@ extern int iwl4965_hw_channel_switch(struct iwl4965_priv *priv, u16 channel); extern int iwl4965_tx_queue_reclaim(struct iwl4965_priv *priv, int txq_id, int index); struct iwl4965_priv; -struct sta_ht_info; /* * Forward declare iwl-4965.c functions for iwl-base.c @@ -779,9 +778,6 @@ extern int iwl4965_tx_queue_update_wr_ptr(struct iwl4965_priv *priv, u16 byte_cnt); extern void iwl4965_add_station(struct iwl4965_priv *priv, const u8 *addr, int is_ap); -extern void iwl4965_set_rxon_ht(struct iwl4965_priv *priv, - struct sta_ht_info *ht_info); - extern void iwl4965_set_rxon_chain(struct iwl4965_priv *priv); extern int iwl4965_tx_cmd(struct iwl4965_priv *priv, struct iwl4965_cmd *out_cmd, u8 sta_id, dma_addr_t txcmd_phys, @@ -803,6 +799,8 @@ extern void iwl4965_rf_kill_ct_config(struct iwl4965_priv *priv); #ifdef CONFIG_IWL4965_HT extern void iwl4965_init_ht_hw_capab(struct ieee80211_ht_info *ht_info, int mode); +extern void iwl4965_set_rxon_ht(struct iwl4965_priv *priv, + struct iwl_ht_info *ht_info); #ifdef CONFIG_IWL4965_HT_AGG extern int iwl4965_mac_ht_tx_agg_start(struct ieee80211_hw *hw, u8 *da, u16 tid, u16 *start_seq_num); -- cgit v1.2.3 From 67d620357a186adc0f4e7d1f5b095ea2c77e7072 Mon Sep 17 00:00:00 2001 From: Ron Rindjunsky Date: Mon, 26 Nov 2007 16:14:40 +0200 Subject: iwlwifi: 802.11n comply HT add station flow with mac80211 framework This patch conforms the addition of a new station to the iwlwifi station table according to the new mac80211's HT framework Signed-off-by: Ron Rindjunsky Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index 6fdfb4a3be9..50209e6cdd0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -649,8 +649,8 @@ struct iwl4965_driver_hw_info { struct iwl4965_addsta_cmd; extern int iwl4965_send_add_station(struct iwl4965_priv *priv, struct iwl4965_addsta_cmd *sta, u8 flags); -extern u8 iwl4965_add_station_flags(struct iwl4965_priv *priv, const u8 *bssid, - int is_ap, u8 flags); +extern u8 iwl4965_add_station_flags(struct iwl4965_priv *priv, const u8 *addr, + int is_ap, u8 flags, void *ht_data); extern int iwl4965_is_network_packet(struct iwl4965_priv *priv, struct ieee80211_hdr *header); extern int iwl4965_power_init_handle(struct iwl4965_priv *priv); @@ -785,8 +785,6 @@ extern int iwl4965_tx_cmd(struct iwl4965_priv *priv, struct iwl4965_cmd *out_cmd struct ieee80211_tx_control *ctrl, void *sta_in); extern int iwl4965_alive_notify(struct iwl4965_priv *priv); extern void iwl4965_update_rate_scaling(struct iwl4965_priv *priv, u8 mode); -extern void iwl4965_set_ht_add_station(struct iwl4965_priv *priv, u8 index); - extern void iwl4965_chain_noise_reset(struct iwl4965_priv *priv); extern void iwl4965_init_sensitivity(struct iwl4965_priv *priv, u8 flags, u8 force); @@ -801,6 +799,8 @@ extern void iwl4965_init_ht_hw_capab(struct ieee80211_ht_info *ht_info, int mode); extern void iwl4965_set_rxon_ht(struct iwl4965_priv *priv, struct iwl_ht_info *ht_info); +extern void iwl4965_set_ht_add_station(struct iwl4965_priv *priv, u8 index, + struct ieee80211_ht_info *sta_ht_inf); #ifdef CONFIG_IWL4965_HT_AGG extern int iwl4965_mac_ht_tx_agg_start(struct ieee80211_hw *hw, u8 *da, u16 tid, u16 *start_seq_num); -- cgit v1.2.3 From 9ee1ba474fc37bcaf6a958bf7e995006fc69893b Mon Sep 17 00:00:00 2001 From: Ron Rindjunsky Date: Mon, 26 Nov 2007 16:14:42 +0200 Subject: iwlwifi: 802.11n add support to 8K A-MSDU Rx frames This patch give the iwlwifi the ability to support A-MSDU up to 8K Please notice - in order to work in 8K A-MSDU ucode support is needed, version 4.44.1.19 (soon to be published). 4K A-MSDU works in current ucode version as well. Signed-off-by: Ron Rindjunsky Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index 50209e6cdd0..5a410e284b9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -60,6 +60,7 @@ extern struct pci_device_id iwl4965_hw_card_ids[]; /* Module parameters accessible from iwl-*.c */ extern int iwl4965_param_hwcrypto; extern int iwl4965_param_queues_num; +extern int iwl4965_param_amsdu_size_8K; enum iwl4965_antenna { IWL_ANTENNA_DIVERSITY, @@ -506,7 +507,6 @@ union iwl4965_ht_rate_supp { #ifdef CONFIG_IWL4965_HT #define CFG_HT_RX_AMPDU_FACTOR_DEF (0x3) -#define HT_IE_MAX_AMSDU_SIZE_4K (0) #define CFG_HT_MPDU_DENSITY_2USEC (0x5) #define CFG_HT_MPDU_DENSITY_DEF CFG_HT_MPDU_DENSITY_2USEC @@ -618,7 +618,8 @@ struct iwl4965_driver_hw_info { u16 ac_queue_count; u16 tx_cmd_len; u16 max_rxq_size; - u32 rx_buffer_size; + u32 rx_buf_size; + u32 max_pkt_size; u16 max_rxq_log; u8 max_stations; u8 bcast_sta_id; -- cgit v1.2.3 From bb54244be7d12c2a5985226061d598edb49c9078 Mon Sep 17 00:00:00 2001 From: Tomas Winkler Date: Wed, 5 Dec 2007 20:59:59 +0200 Subject: iwlwifi: add missing comments This patch add comments that escaped from the previous merge Signed-off-by: Tomas Winkler Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index 5a410e284b9..267ae75254f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -516,7 +516,7 @@ struct iwl_ht_info { u8 supported_chan_width; u16 tx_mimo_ps_mode; u8 is_green_field; - u8 sgf; + u8 sgf; /* HT_SHORT_GI_* short guard interval */ u8 max_amsdu_size; u8 ampdu_factor; u8 mpdu_density; -- cgit v1.2.3 From 12342c475f5de17071eaf24ea2938ba8dfe285f2 Mon Sep 17 00:00:00 2001 From: Zhu Yi Date: Thu, 20 Dec 2007 11:27:32 +0800 Subject: iwlwifi: proper monitor support This patch changes the iwlwifi driver to properly support monitor interfaces after the filter flags change. The patch is originally created by Johannes Berg for iwl4965. I fixed some of the comments and created a similar patch for iwl3945. Signed-off-by: Johannes Berg Signed-off-by: Zhu Yi Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index 267ae75254f..9a975efc946 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -91,29 +91,6 @@ struct iwl4965_rx_mem_buffer { struct list_head list; }; -struct iwl4965_rt_rx_hdr { - struct ieee80211_radiotap_header rt_hdr; - __le64 rt_tsf; /* TSF */ - u8 rt_flags; /* radiotap packet flags */ - u8 rt_rate; /* rate in 500kb/s */ - __le16 rt_channelMHz; /* channel in MHz */ - __le16 rt_chbitmask; /* channel bitfield */ - s8 rt_dbmsignal; /* signal in dBm, kluged to signed */ - s8 rt_dbmnoise; - u8 rt_antenna; /* antenna number */ - u8 payload[0]; /* payload... */ -} __attribute__ ((packed)); - -struct iwl4965_rt_tx_hdr { - struct ieee80211_radiotap_header rt_hdr; - u8 rt_rate; /* rate in 500kb/s */ - __le16 rt_channel; /* channel in mHz */ - __le16 rt_chbitmask; /* channel bitfield */ - s8 rt_dbmsignal; /* signal in dBm, kluged to signed */ - u8 rt_antenna; /* antenna number */ - u8 payload[0]; /* payload... */ -} __attribute__ ((packed)); - /* * Generic queue structure * @@ -1054,6 +1031,7 @@ struct iwl4965_priv { u8 phymode; int alloc_rxb_skb; + bool add_radiotap; void (*rx_handlers[REPLY_MAX])(struct iwl4965_priv *priv, struct iwl4965_rx_mem_buffer *rxb); -- cgit v1.2.3 From a0646470e8a965df59054a5c82e53e5572bf04a0 Mon Sep 17 00:00:00 2001 From: Zhu Yi Date: Thu, 20 Dec 2007 14:10:01 +0800 Subject: iwlwifi: skip mac80211 conf during a hardware scan and replay it afterwards This patch skips mac80211 configuration setting during a hardware scan and replays it afterwards for the iwlwifi drivers. Cc: Johannes Berg Signed-off-by: Zhu Yi Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index 9a975efc946..241f4448a4a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -425,6 +425,7 @@ struct iwl4965_rx_queue { #define STATUS_SCAN_HW 14 #define STATUS_POWER_PMI 15 #define STATUS_FW_ERROR 16 +#define STATUS_CONF_PENDING 17 #define MAX_TID_COUNT 9 @@ -1023,7 +1024,6 @@ struct iwl4965_priv { struct ieee80211_hw *hw; struct ieee80211_channel *ieee_channels; struct ieee80211_rate *ieee_rates; - struct ieee80211_conf *cache_conf; /* temporary frame storage list */ struct list_head free_frames; -- cgit v1.2.3 From 32bfd35d4b63bd63de4bb0d791ef049c3c868726 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Wed, 19 Dec 2007 01:31:26 +0100 Subject: mac80211: dont use interface indices in drivers This patch gets rid of the if_id stuff where possible in favour of a new per-virtual-interface structure "struct ieee80211_vif". This structure is located at the end of the per-interface structure and contains a variable length driver-use data area. This has two advantages: * removes the need to look up interfaces by if_id, this is better for working with network namespaces and performance * allows drivers to store and retrieve per-interface data without having to allocate own lists/hash tables Signed-off-by: Johannes Berg Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index 241f4448a4a..aad7f70bab7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -1212,7 +1212,7 @@ struct iwl4965_priv { u32 timestamp1; u16 beacon_int; struct iwl4965_driver_hw_info hw_setting; - int interface_id; + struct ieee80211_vif *vif; /* Current association information needed to configure the * hardware */ -- cgit v1.2.3 From 9ab461732a3cd8e7a7cf13cc46ed4c1ac7907824 Mon Sep 17 00:00:00 2001 From: Ron Rindjunsky Date: Tue, 25 Dec 2007 17:00:38 +0200 Subject: iwlwifi: A-MPDU Rx flow enabled This patch enables the A-MPDU Rx flow. it contains several adjustments to new mac80211 A-MPDU Rx flow. Signed-off-by: Ron Rindjunsky Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index aad7f70bab7..c38648216dc 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -780,13 +780,12 @@ extern void iwl4965_set_rxon_ht(struct iwl4965_priv *priv, struct iwl_ht_info *ht_info); extern void iwl4965_set_ht_add_station(struct iwl4965_priv *priv, u8 index, struct ieee80211_ht_info *sta_ht_inf); +extern int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw, + enum ieee80211_ampdu_mlme_action action, + const u8 *addr, u16 tid, u16 ssn); #ifdef CONFIG_IWL4965_HT_AGG extern int iwl4965_mac_ht_tx_agg_start(struct ieee80211_hw *hw, u8 *da, u16 tid, u16 *start_seq_num); -extern int iwl4965_mac_ht_rx_agg_start(struct ieee80211_hw *hw, u8 *da, - u16 tid, u16 start_seq_num); -extern int iwl4965_mac_ht_rx_agg_stop(struct ieee80211_hw *hw, u8 *da, - u16 tid, int generator); extern int iwl4965_mac_ht_tx_agg_stop(struct ieee80211_hw *hw, u8 *da, u16 tid, int generator); extern void iwl4965_turn_off_agg(struct iwl4965_priv *priv, u8 tid); -- cgit v1.2.3 From 87e4f7dfe56dbaa5470e047d991c077f8e479d21 Mon Sep 17 00:00:00 2001 From: Tomas Winkler Date: Mon, 14 Jan 2008 17:46:16 -0800 Subject: iwlwifi: remove iwl4965_tx_cmd This patch removes iwl4965_tx_cmd function and splits its content to iwl4965_hw_build_tx_cmd_rate, iwl4965_build_tx_cmd_basic, and iwl4965_tl_get_stats function. The latest one will be deprecated when traffic load will move to rate scale module. Signed-off-by: Tomas Winkler Signed-off-by: Zhu Yi Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl-4965.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index c38648216dc..78bc148c9f7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -758,10 +758,6 @@ extern int iwl4965_tx_queue_update_wr_ptr(struct iwl4965_priv *priv, extern void iwl4965_add_station(struct iwl4965_priv *priv, const u8 *addr, int is_ap); extern void iwl4965_set_rxon_chain(struct iwl4965_priv *priv); -extern int iwl4965_tx_cmd(struct iwl4965_priv *priv, struct iwl4965_cmd *out_cmd, - u8 sta_id, dma_addr_t txcmd_phys, - struct ieee80211_hdr *hdr, u8 hdr_len, - struct ieee80211_tx_control *ctrl, void *sta_in); extern int iwl4965_alive_notify(struct iwl4965_priv *priv); extern void iwl4965_update_rate_scaling(struct iwl4965_priv *priv, u8 mode); extern void iwl4965_chain_noise_reset(struct iwl4965_priv *priv); @@ -789,6 +785,8 @@ extern int iwl4965_mac_ht_tx_agg_start(struct ieee80211_hw *hw, u8 *da, extern int iwl4965_mac_ht_tx_agg_stop(struct ieee80211_hw *hw, u8 *da, u16 tid, int generator); extern void iwl4965_turn_off_agg(struct iwl4965_priv *priv, u8 tid); +extern void iwl4965_tl_get_stats(struct iwl4965_priv *priv, + struct ieee80211_hdr *hdr); #endif /* CONFIG_IWL4965_HT_AGG */ #endif /*CONFIG_IWL4965_HT */ /* Structures, enum, and defines specific to the 4965 */ -- cgit v1.2.3 From 74a3a2509dccba5b4e5eb5808cc59edf2c21560b Mon Sep 17 00:00:00 2001 From: Reinette Chatre Date: Wed, 23 Jan 2008 10:15:19 -0800 Subject: iwlwifi: cleanup usage of inline functions Be consistent when using inline functions. If the function only used once we move it to where it is used - no need for externs. Signed-off-by: Reinette Chatre Cc: Johannes Berg Signed-off-by: John W. Linville Signed-off-by: David S. Miller --- drivers/net/wireless/iwlwifi/iwl-4965.h | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.h') diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index 78bc148c9f7..9cb82be0ff8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h @@ -750,7 +750,6 @@ struct iwl4965_priv; * Forward declare iwl-4965.c functions for iwl-base.c */ extern int iwl4965_eeprom_acquire_semaphore(struct iwl4965_priv *priv); -extern void iwl4965_eeprom_release_semaphore(struct iwl4965_priv *priv); extern int iwl4965_tx_queue_update_wr_ptr(struct iwl4965_priv *priv, struct iwl4965_tx_queue *txq, -- cgit v1.2.3