Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
3945.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/firmware.h>
#include <linux/etherdevice.h>
#include <asm/unaligned.h>
#include <net/mac80211.h>
#include "common.h"
#include "3945.h"

Go to the source code of this file.

Macros

#define IL_DECLARE_RATE_INFO(r, ip, in, rp, rn, pp, np)
 
#define IL_EVT_DISABLE   (0)
 
#define IL_EVT_DISABLE_SIZE   (1532/32)
 
#define IL_DELAY_NEXT_SCAN_AFTER_ASSOC   (HZ*6)
 
#define IL_TEMPERATURE_LIMIT_TIMER   6
 
#define IL_MAX_GAIN_ENTRIES   78
 
#define IL_CCK_FROM_OFDM_POWER_DIFF   -5
 
#define IL_CCK_FROM_OFDM_IDX_DIFF   (10)
 
#define REG_RECALIB_PERIOD   (60)
 

Functions

void il3945_disable_events (struct il_priv *il)
 
int il3945_rs_next_rate (struct il_priv *il, int rate)
 
void il3945_hdl_stats (struct il_priv *il, struct il_rx_buf *rxb)
 
void il3945_hdl_c_stats (struct il_priv *il, struct il_rx_buf *rxb)
 
int il3945_hw_txq_attach_buf_to_tfd (struct il_priv *il, struct il_tx_queue *txq, dma_addr_t addr, u16 len, u8 reset, u8 pad)
 
void il3945_hw_txq_free_tfd (struct il_priv *il, struct il_tx_queue *txq)
 
void il3945_hw_build_tx_cmd_rate (struct il_priv *il, struct il_device_cmd *cmd, struct ieee80211_tx_info *info, struct ieee80211_hdr *hdr, int sta_id)
 
int il3945_hw_nic_init (struct il_priv *il)
 
void il3945_hw_txq_ctx_free (struct il_priv *il)
 
void il3945_hw_txq_ctx_stop (struct il_priv *il)
 
int il3945_hw_get_temperature (struct il_priv *il)
 
int il3945_hw_reg_set_txpower (struct il_priv *il, s8 power)
 
int il3945_commit_rxon (struct il_priv *il)
 
void il3945_reg_txpower_periodic (struct il_priv *il)
 
int il3945_txpower_set_from_eeprom (struct il_priv *il)
 
int il3945_hw_rxq_stop (struct il_priv *il)
 
int il3945_hw_tx_queue_init (struct il_priv *il, struct il_tx_queue *txq)
 
int il3945_init_hw_rate_table (struct il_priv *il)
 
int il3945_hw_set_hw_params (struct il_priv *il)
 
unsigned int il3945_hw_get_beacon_cmd (struct il_priv *il, struct il3945_frame *frame, u8 rate)
 
void il3945_hw_handler_setup (struct il_priv *il)
 
void il3945_hw_setup_deferred_work (struct il_priv *il)
 
void il3945_hw_cancel_deferred_work (struct il_priv *il)
 
 DEFINE_PCI_DEVICE_TABLE (il3945_hw_card_ids)
 
 MODULE_DEVICE_TABLE (pci, il3945_hw_card_ids)
 

Variables

struct il3945_rate_info il3945_rates [RATE_COUNT_3945]
 
struct il_ops il3945_ops
 

Macro Definition Documentation

#define IL_CCK_FROM_OFDM_IDX_DIFF   (10)

Definition at line 1128 of file 3945.c.

#define IL_CCK_FROM_OFDM_POWER_DIFF   -5

Definition at line 1127 of file 3945.c.

#define IL_DECLARE_RATE_INFO (   r,
  ip,
  in,
  rp,
  rn,
  pp,
  np 
)
Value:
[RATE_##r##M_IDX] = { RATE_##r##M_PLCP, \
RATE_##r##M_IEEE, \
RATE_##ip##M_IDX, \
RATE_##in##M_IDX, \
RATE_##rp##M_IDX, \
RATE_##rn##M_IDX, \
RATE_##pp##M_IDX, \
RATE_##np##M_IDX, \
RATE_##r##M_IDX_TBL, \
RATE_##ip##M_IDX_TBL }

Definition at line 60 of file 3945.c.

#define IL_DELAY_NEXT_SCAN_AFTER_ASSOC   (HZ*6)

Definition at line 513 of file 3945.c.

#define IL_EVT_DISABLE   (0)

Definition at line 106 of file 3945.c.

#define IL_EVT_DISABLE_SIZE   (1532/32)

Definition at line 107 of file 3945.c.

#define IL_MAX_GAIN_ENTRIES   78

Definition at line 1126 of file 3945.c.

#define IL_TEMPERATURE_LIMIT_TIMER   6

Definition at line 1087 of file 3945.c.

#define REG_RECALIB_PERIOD   (60)

Definition at line 1306 of file 3945.c.

Function Documentation

DEFINE_PCI_DEVICE_TABLE ( il3945_hw_card_ids  )
int il3945_commit_rxon ( struct il_priv il)

il3945_commit_rxon - commit staging_rxon to hardware

The RXON command in staging_rxon is committed to the hardware and the active_rxon structure is updated with the new data. This function correctly transitions out of the RXON_ASSOC_MSK state if a HW tune is required based on the RXON structure changes.

Definition at line 1703 of file 3945.c.

void il3945_disable_events ( struct il_priv il)

il3945_disable_events - Disable selected events in uCode event log

Disable an event by writing "1"s into "disable" bitmap in SRAM. Bit position corresponds to Event # (id/type). Default values of 0 enable uCode events to be logged. Use for only special debugging. This function is just a placeholder as-is, you'll need to provide the special bits! ... ... and set IL_EVT_DISABLE to 1.

Definition at line 119 of file 3945.c.

void il3945_hdl_c_stats ( struct il_priv il,
struct il_rx_buf rxb 
)

Definition at line 422 of file 3945.c.

void il3945_hdl_stats ( struct il_priv il,
struct il_rx_buf rxb 
)

Definition at line 407 of file 3945.c.

void il3945_hw_build_tx_cmd_rate ( struct il_priv il,
struct il_device_cmd cmd,
struct ieee80211_tx_info info,
struct ieee80211_hdr hdr,
int  sta_id 
)

il3945_hw_build_tx_cmd_rate - Add rate portion to TX_CMD:

Definition at line 674 of file 3945.c.

void il3945_hw_cancel_deferred_work ( struct il_priv il)

Definition at line 2455 of file 3945.c.

unsigned int il3945_hw_get_beacon_cmd ( struct il_priv il,
struct il3945_frame frame,
u8  rate 
)

Definition at line 2408 of file 3945.c.

int il3945_hw_get_temperature ( struct il_priv il)

Definition at line 1048 of file 3945.c.

void il3945_hw_handler_setup ( struct il_priv il)

Definition at line 2441 of file 3945.c.

int il3945_hw_nic_init ( struct il_priv il)

Definition at line 944 of file 3945.c.

int il3945_hw_reg_set_txpower ( struct il_priv il,
s8  power 
)

Definition at line 1608 of file 3945.c.

int il3945_hw_rxq_stop ( struct il_priv il)

Definition at line 2173 of file 3945.c.

int il3945_hw_set_hw_params ( struct il_priv il)

Definition at line 2375 of file 3945.c.

void il3945_hw_setup_deferred_work ( struct il_priv il)

Definition at line 2448 of file 3945.c.

int il3945_hw_tx_queue_init ( struct il_priv il,
struct il_tx_queue txq 
)

Definition at line 2189 of file 3945.c.

int il3945_hw_txq_attach_buf_to_tfd ( struct il_priv il,
struct il_tx_queue txq,
dma_addr_t  addr,
u16  len,
u8  reset,
u8  pad 
)

Definition at line 588 of file 3945.c.

void il3945_hw_txq_ctx_free ( struct il_priv il)

il3945_hw_txq_ctx_free - Free TXQ Context

Destroy all TX DMA queues and structures

Definition at line 993 of file 3945.c.

void il3945_hw_txq_ctx_stop ( struct il_priv il)

Definition at line 1010 of file 3945.c.

void il3945_hw_txq_free_tfd ( struct il_priv il,
struct il_tx_queue txq 
)

il3945_hw_txq_free_tfd - Free one TFD, those at idx [txq->q.read_ptr]

Does NOT advance any idxes

Definition at line 627 of file 3945.c.

int il3945_init_hw_rate_table ( struct il_priv il)

il3945_init_hw_rate_table - Initialize the hardware rate fallback table

Definition at line 2304 of file 3945.c.

void il3945_reg_txpower_periodic ( struct il_priv il)

il3945_reg_txpower_periodic - called when time to check our temperature.

– reset periodic timer – see if temp has changed enough to warrant re-calibration ... if so: – correct coeffs for temp (can reset temp timer) – save this temp as "last", – send new set of gain settings to NIC NOTE: This should continue working, even when we're not associated, so we can keep our internal table of scan powers current.

Definition at line 1836 of file 3945.c.

int il3945_rs_next_rate ( struct il_priv il,
int  rate 
)

Definition at line 254 of file 3945.c.

int il3945_txpower_set_from_eeprom ( struct il_priv il)

il3945_txpower_set_from_eeprom - Set channel power info based on EEPROM

Second pass (during init) to set up il->channel_info

Set up Tx-power settings in our channel info database for each VALID (for this geo/SKU) channel, at all Tx data rates, based on eeprom values and current temperature.

Since this is based on current temperature (at init time), these values may not be valid for very long, but it gives us a starting/default point, and allows us to active (i.e. using Tx) scan.

This does not write values to NIC, just sets up our internal table.

Definition at line 2046 of file 3945.c.

MODULE_DEVICE_TABLE ( pci  ,
il3945_hw_card_ids   
)

Variable Documentation

struct il_ops il3945_ops
Initial value:
= {
.txq_attach_buf_to_tfd = il3945_hw_txq_attach_buf_to_tfd,
.txq_free_tfd = il3945_hw_txq_free_tfd,
.load_ucode = il3945_load_bsm,
.dump_nic_error_log = il3945_dump_nic_error_log,
.apm_init = il3945_apm_init,
.send_tx_power = il3945_send_tx_power,
.is_valid_rtc_data_addr = il3945_hw_valid_rtc_data_addr,
.eeprom_acquire_semaphore = il3945_eeprom_acquire_semaphore,
.eeprom_release_semaphore = il3945_eeprom_release_semaphore,
.rxon_assoc = il3945_send_rxon_assoc,
.commit_rxon = il3945_commit_rxon,
.get_hcmd_size = il3945_get_hcmd_size,
.build_addsta_hcmd = il3945_build_addsta_hcmd,
.request_scan = il3945_request_scan,
.post_scan = il3945_post_scan,
.post_associate = il3945_post_associate,
.config_ap = il3945_config_ap,
.manage_ibss_station = il3945_manage_ibss_station,
.send_led_cmd = il3945_send_led_cmd,
}

Definition at line 2624 of file 3945.c.

Initial value:
= {
IL_DECLARE_RATE_INFO(1, INV, 2, INV, 2, INV, 2),
IL_DECLARE_RATE_INFO(2, 1, 5, 1, 5, 1, 5),
IL_DECLARE_RATE_INFO(5, 2, 6, 2, 11, 2, 11),
IL_DECLARE_RATE_INFO(11, 9, 12, 5, 12, 5, 18),
IL_DECLARE_RATE_INFO(6, 5, 9, 5, 11, 5, 11),
IL_DECLARE_RATE_INFO(9, 6, 11, 5, 11, 5, 11),
IL_DECLARE_RATE_INFO(12, 11, 18, 11, 18, 11, 18),
IL_DECLARE_RATE_INFO(18, 12, 24, 12, 24, 11, 24),
IL_DECLARE_RATE_INFO(24, 18, 36, 18, 36, 18, 36),
IL_DECLARE_RATE_INFO(36, 24, 48, 24, 48, 24, 48),
IL_DECLARE_RATE_INFO(48, 36, 54, 36, 54, 36, 54),
IL_DECLARE_RATE_INFO(54, 48, INV, 48, INV, 48, INV),
}

Definition at line 80 of file 3945.c.