config IWL4965
tristate "Intel Wireless WiFi 4965AGN"
- depends on m && PCI && MAC80211 && WLAN_80211 && EXPERIMENTAL
+ depends on PCI && MAC80211 && WLAN_80211 && EXPERIMENTAL
select FW_LOADER
- default m
---help---
Select to build the driver supporting the:
config IWL4965_QOS
bool "Enable Wireless QoS in iwl4965 driver"
depends on IWL4965
- default y
---help---
This option will enable wireless quality of service (QoS) for the
iw4965 driver.
config IWL4965_SPECTRUM_MEASUREMENT
bool "Enable Spectrum Measurement in iw4965 driver"
depends on IWL4965
- default y
---help---
This option will enable spectrum measurement for the iwl4965 driver.
config IWL4965_SENSITIVITY
bool "Enable Sensitivity Calibration in iwl4965 driver"
depends on IWL4965
- default y
---help---
This option will enable sensitivity calibration for the iwl4965
driver.
bool "Enable 802.11n HT features in iwl4965 driver"
depends on EXPERIMENTAL
depends on IWL4965 && MAC80211_HT
- default n
---help---
This option enables IEEE 802.11n High Throughput features
for the iwl4965 driver.
config IWL4965_DEBUG
bool "Enable full debugging output in iwl4965 driver"
depends on IWL4965
- default y
---help---
This option will enable debug tracing output for the iwl4965
driver.
config IWL3945
tristate "Intel PRO/Wireless 3945ABG/BG Network Connection"
- depends on m && PCI && MAC80211 && WLAN_80211 && EXPERIMENTAL
+ depends on PCI && MAC80211 && WLAN_80211 && EXPERIMENTAL
select FW_LOADER
- default m
---help---
Select to build the driver supporting the:
config IWL3945_QOS
bool "Enable Wireless QoS in iwl3945 driver"
depends on IWL3945
- default y
---help---
This option will enable wireless quality of service (QoS) for the
iwl3945 driver.
config IWL3945_SPECTRUM_MEASUREMENT
bool "Enable Spectrum Measurement in iwl3945 drivers"
depends on IWL3945
- default y
---help---
This option will enable spectrum measurement for the iwl3945 driver.
config IWL3945_DEBUG
bool "Enable full debugging output in iwl3945 driver"
depends on IWL3945
- default y
---help---
This option will enable debug tracing output for the iwl3945
driver.
#define IWL_CMD_FAILED_MSK 0x40
-struct iwl_cmd_header {
+struct iwl3945_cmd_header {
u8 cmd;
u8 flags;
/* We have 15 LSB to use as we please (MSB indicates
/*
* REPLY_ALIVE = 0x1 (response only, not a command)
*/
-struct iwl_alive_resp {
+struct iwl3945_alive_resp {
u8 ucode_minor;
u8 ucode_major;
__le16 reserved1;
__le32 is_valid;
} __attribute__ ((packed));
-struct iwl_init_alive_resp {
+struct iwl3945_init_alive_resp {
u8 ucode_minor;
u8 ucode_major;
__le16 reserved1;
/*
* REPLY_ERROR = 0x2 (response only, not a command)
*/
-struct iwl_error_resp {
+struct iwl3945_error_resp {
__le32 error_type;
u8 cmd_id;
u8 reserved1;
/*
* REPLY_RXON = 0x10 (command, has simple generic response)
*/
-struct iwl_rxon_cmd {
+struct iwl3945_rxon_cmd {
u8 node_addr[6];
__le16 reserved1;
u8 bssid_addr[6];
/*
* REPLY_RXON_ASSOC = 0x11 (command, has simple generic response)
*/
-struct iwl_rxon_assoc_cmd {
+struct iwl3945_rxon_assoc_cmd {
__le32 flags;
__le32 filter_flags;
u8 ofdm_basic_rates;
/*
* REPLY_RXON_TIMING = 0x14 (command, has simple generic response)
*/
-struct iwl_rxon_time_cmd {
+struct iwl3945_rxon_time_cmd {
union tsf timestamp;
__le16 beacon_interval;
__le16 atim_window;
__le16 reserved;
} __attribute__ ((packed));
-struct iwl_tx_power {
+struct iwl3945_tx_power {
u8 tx_gain; /* gain for analog radio */
u8 dsp_atten; /* gain for DSP */
} __attribute__ ((packed));
-struct iwl_power_per_rate {
+struct iwl3945_power_per_rate {
u8 rate; /* plcp */
- struct iwl_tx_power tpc;
+ struct iwl3945_tx_power tpc;
u8 reserved;
} __attribute__ ((packed));
/*
* REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response)
*/
-struct iwl_channel_switch_cmd {
+struct iwl3945_channel_switch_cmd {
u8 band;
u8 expect_beacon;
__le16 channel;
__le32 rxon_flags;
__le32 rxon_filter_flags;
__le32 switch_time;
- struct iwl_power_per_rate power[IWL_MAX_RATES];
+ struct iwl3945_power_per_rate power[IWL_MAX_RATES];
} __attribute__ ((packed));
/*
* CHANNEL_SWITCH_NOTIFICATION = 0x73 (notification only, not a command)
*/
-struct iwl_csa_notification {
+struct iwl3945_csa_notification {
__le16 band;
__le16 channel;
__le32 status; /* 0 - OK, 1 - fail */
* Quality-of-Service (QOS) Commands & Responses:
*
*****************************************************************************/
-struct iwl_ac_qos {
+struct iwl3945_ac_qos {
__le16 cw_min;
__le16 cw_max;
u8 aifsn;
/*
* REPLY_QOS_PARAM = 0x13 (command, has simple generic response)
*/
-struct iwl_qosparam_cmd {
+struct iwl3945_qosparam_cmd {
__le32 qos_flags;
- struct iwl_ac_qos ac[AC_NUM];
+ struct iwl3945_ac_qos ac[AC_NUM];
} __attribute__ ((packed));
/******************************************************************************
#define RATE_MCS_ANT_B_MSK 0x8000
#define RATE_MCS_ANT_AB_MSK 0xc000
-struct iwl_keyinfo {
+struct iwl3945_keyinfo {
__le16 key_flags;
u8 tkip_rx_tsc_byte2; /* TSC[2] for key mix ph1 detection */
u8 reserved1;
/*
* REPLY_ADD_STA = 0x18 (command)
*/
-struct iwl_addsta_cmd {
+struct iwl3945_addsta_cmd {
u8 mode;
u8 reserved[3];
struct sta_id_modify sta;
- struct iwl_keyinfo key;
+ struct iwl3945_keyinfo key;
__le32 station_flags;
__le32 station_flags_msk;
__le16 tid_disable_tx;
/*
* REPLY_ADD_STA = 0x18 (response)
*/
-struct iwl_add_sta_resp {
+struct iwl3945_add_sta_resp {
u8 status;
} __attribute__ ((packed));
*
*****************************************************************************/
-struct iwl_rx_frame_stats {
+struct iwl3945_rx_frame_stats {
u8 phy_count;
u8 id;
u8 rssi;
u8 payload[0];
} __attribute__ ((packed));
-struct iwl_rx_frame_hdr {
+struct iwl3945_rx_frame_hdr {
__le16 channel;
__le16 phy_flags;
u8 reserved1;
#define RX_RES_STATUS_BAD_ICV_MIC (0x1 << 11)
#define RX_RES_STATUS_BAD_KEY_TTAK (0x2 << 11)
-struct iwl_rx_frame_end {
+struct iwl3945_rx_frame_end {
__le32 status;
__le64 timestamp;
__le32 beacon_timestamp;
* The actual offsets of the hdr and end are dynamic based on
* stats.phy_count
*/
-struct iwl_rx_frame {
- struct iwl_rx_frame_stats stats;
- struct iwl_rx_frame_hdr hdr;
- struct iwl_rx_frame_end end;
+struct iwl3945_rx_frame {
+ struct iwl3945_rx_frame_stats stats;
+ struct iwl3945_rx_frame_hdr hdr;
+ struct iwl3945_rx_frame_end end;
} __attribute__ ((packed));
/* Fixed (non-configurable) rx data from phy */
* TX command Frame life time
*/
-struct iwl_dram_scratch {
+struct iwl3945_dram_scratch {
u8 try_cnt;
u8 bt_kill_cnt;
__le16 reserved;
/*
* REPLY_TX = 0x1c (command)
*/
-struct iwl_tx_cmd {
+struct iwl3945_tx_cmd {
__le16 len;
__le16 next_frame_len;
__le32 tx_flags;
/*
* REPLY_TX = 0x1c (response)
*/
-struct iwl_tx_resp {
+struct iwl3945_tx_resp {
u8 failure_rts;
u8 failure_frame;
u8 bt_kill_count;
/*
* REPLY_COMPRESSED_BA = 0xc5 (response only, not a command)
*/
-struct iwl_compressed_ba_resp {
+struct iwl3945_compressed_ba_resp {
__le32 sta_addr_lo32;
__le16 sta_addr_hi16;
__le16 reserved;
/*
* REPLY_TX_PWR_TABLE_CMD = 0x97 (command, has simple generic response)
*/
-struct iwl_txpowertable_cmd {
+struct iwl3945_txpowertable_cmd {
u8 band; /* 0: 5 GHz, 1: 2.4 GHz */
u8 reserved;
__le16 channel;
- struct iwl_power_per_rate power[IWL_MAX_RATES];
+ struct iwl3945_power_per_rate power[IWL_MAX_RATES];
} __attribute__ ((packed));
-struct iwl_rate_scaling_info {
+struct iwl3945_rate_scaling_info {
__le16 rate_n_flags;
u8 try_cnt;
u8 next_rate_index;
} __attribute__ ((packed));
/**
- * struct iwl_rate_scaling_cmd - Rate Scaling Command & Response
+ * struct iwl3945_rate_scaling_cmd - Rate Scaling Command & Response
*
* REPLY_RATE_SCALE = 0x47 (command, has simple generic response)
*
* when passed through ofdm_basic_rates on the REPLY_RXON
* command would be bit 0 (1<<0)
*/
-struct iwl_rate_scaling_cmd {
+struct iwl3945_rate_scaling_cmd {
u8 table_id;
u8 reserved[3];
- struct iwl_rate_scaling_info table[IWL_MAX_RATES];
+ struct iwl3945_rate_scaling_info table[IWL_MAX_RATES];
} __attribute__ ((packed));
/*
* REPLY_BT_CONFIG = 0x9b (command, has simple generic response)
*/
-struct iwl_bt_cmd {
+struct iwl3945_bt_cmd {
u8 flags;
u8 lead_time;
u8 max_kill;
RXON_FILTER_ASSOC_MSK | \
RXON_FILTER_BCON_AWARE_MSK)
-struct iwl_measure_channel {
+struct iwl3945_measure_channel {
__le32 duration; /* measurement duration in extended beacon
* format */
u8 channel; /* channel to measure */
- u8 type; /* see enum iwl_measure_type */
+ u8 type; /* see enum iwl3945_measure_type */
__le16 reserved;
} __attribute__ ((packed));
/*
* REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (command)
*/
-struct iwl_spectrum_cmd {
+struct iwl3945_spectrum_cmd {
__le16 len; /* number of bytes starting from token */
u8 token; /* token id */
u8 id; /* measurement id -- 0 or 1 */
__le32 filter_flags; /* rxon filter flags */
__le16 channel_count; /* minimum 1, maximum 10 */
__le16 reserved3;
- struct iwl_measure_channel channels[10];
+ struct iwl3945_measure_channel channels[10];
} __attribute__ ((packed));
/*
* REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (response)
*/
-struct iwl_spectrum_resp {
+struct iwl3945_spectrum_resp {
u8 token;
u8 id; /* id of the prior command replaced, or 0xff */
__le16 status; /* 0 - command will be handled
* measurement) */
} __attribute__ ((packed));
-enum iwl_measurement_state {
+enum iwl3945_measurement_state {
IWL_MEASUREMENT_START = 0,
IWL_MEASUREMENT_STOP = 1,
};
-enum iwl_measurement_status {
+enum iwl3945_measurement_status {
IWL_MEASUREMENT_OK = 0,
IWL_MEASUREMENT_CONCURRENT = 1,
IWL_MEASUREMENT_CSA_CONFLICT = 2,
#define NUM_ELEMENTS_IN_HISTOGRAM 8
-struct iwl_measurement_histogram {
+struct iwl3945_measurement_histogram {
__le32 ofdm[NUM_ELEMENTS_IN_HISTOGRAM]; /* in 0.8usec counts */
__le32 cck[NUM_ELEMENTS_IN_HISTOGRAM]; /* in 1usec counts */
} __attribute__ ((packed));
/* clear channel availability counters */
-struct iwl_measurement_cca_counters {
+struct iwl3945_measurement_cca_counters {
__le32 ofdm;
__le32 cck;
} __attribute__ ((packed));
-enum iwl_measure_type {
+enum iwl3945_measure_type {
IWL_MEASURE_BASIC = (1 << 0),
IWL_MEASURE_CHANNEL_LOAD = (1 << 1),
IWL_MEASURE_HISTOGRAM_RPI = (1 << 2),
/*
* SPECTRUM_MEASURE_NOTIFICATION = 0x75 (notification only, not a command)
*/
-struct iwl_spectrum_notification {
+struct iwl3945_spectrum_notification {
u8 id; /* measurement id -- 0 or 1 */
u8 token;
u8 channel_index; /* index in measurement channel list */
__le32 start_time; /* lower 32-bits of TSF */
u8 band; /* 0 - 5.2GHz, 1 - 2.4GHz */
u8 channel;
- u8 type; /* see enum iwl_measurement_type */
+ u8 type; /* see enum iwl3945_measurement_type */
u8 reserved1;
/* NOTE: cca_ofdm, cca_cck, basic_type, and histogram are only only
* valid if applicable for measurement type requested. */
u8 basic_type; /* 0 - bss, 1 - ofdm preamble, 2 -
* unidentified */
u8 reserved2[3];
- struct iwl_measurement_histogram histogram;
+ struct iwl3945_measurement_histogram histogram;
__le32 stop_time; /* lower 32-bits of TSF */
- __le32 status; /* see iwl_measurement_status */
+ __le32 status; /* see iwl3945_measurement_status */
} __attribute__ ((packed));
/******************************************************************************
*****************************************************************************/
/**
- * struct iwl_powertable_cmd - Power Table Command
+ * struct iwl3945_powertable_cmd - Power Table Command
* @flags: See below:
*
* POWER_TABLE_CMD = 0x77 (command, has simple generic response)
#define IWL_POWER_DRIVER_ALLOW_SLEEP_MSK __constant_cpu_to_le32(1<<0)
#define IWL_POWER_SLEEP_OVER_DTIM_MSK __constant_cpu_to_le32(1<<2)
#define IWL_POWER_PCI_PM_MSK __constant_cpu_to_le32(1<<3)
-struct iwl_powertable_cmd {
+struct iwl3945_powertable_cmd {
__le32 flags;
__le32 rx_data_timeout;
__le32 tx_data_timeout;
* PM_SLEEP_NOTIFICATION = 0x7A (notification only, not a command)
* 3945 and 4965 identical.
*/
-struct iwl_sleep_notification {
+struct iwl3945_sleep_notification {
u8 pm_sleep_mode;
u8 pm_wakeup_src;
__le16 reserved;
#define CARD_STATE_CMD_DISABLE 0x00 /* Put card to sleep */
#define CARD_STATE_CMD_ENABLE 0x01 /* Wake up card */
#define CARD_STATE_CMD_HALT 0x02 /* Power down permanently */
-struct iwl_card_state_cmd {
+struct iwl3945_card_state_cmd {
__le32 status; /* CARD_STATE_CMD_* request new power state */
} __attribute__ ((packed));
/*
* CARD_STATE_NOTIFICATION = 0xa1 (notification only, not a command)
*/
-struct iwl_card_state_notif {
+struct iwl3945_card_state_notif {
__le32 flags;
} __attribute__ ((packed));
#define RF_CARD_DISABLED 0x04
#define RXON_CARD_DISABLED 0x10
-struct iwl_ct_kill_config {
+struct iwl3945_ct_kill_config {
__le32 reserved;
__le32 critical_temperature_M;
__le32 critical_temperature_R;
*
*****************************************************************************/
-struct iwl_scan_channel {
+struct iwl3945_scan_channel {
/* type is defined as:
* 0:0 active (0 - passive)
* 1:4 SSID direct
*/
u8 type;
u8 channel;
- struct iwl_tx_power tpc;
+ struct iwl3945_tx_power tpc;
__le16 active_dwell;
__le16 passive_dwell;
} __attribute__ ((packed));
-struct iwl_ssid_ie {
+struct iwl3945_ssid_ie {
u8 id;
u8 len;
u8 ssid[32];
/*
* REPLY_SCAN_CMD = 0x80 (command)
*/
-struct iwl_scan_cmd {
+struct iwl3945_scan_cmd {
__le16 len;
u8 reserved0;
u8 channel_count;
__le32 flags;
__le32 filter_flags;
- struct iwl_tx_cmd tx_cmd;
- struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
+ struct iwl3945_tx_cmd tx_cmd;
+ struct iwl3945_ssid_ie direct_scan[PROBE_OPTION_MAX];
u8 data[0];
/*
* The channels start after the probe request payload and are of type:
*
- * struct iwl_scan_channel channels[0];
+ * struct iwl3945_scan_channel channels[0];
*
* NOTE: Only one band of channels can be scanned per pass. You
* can not mix 2.4GHz channels and 5.2GHz channels and must
/*
* REPLY_SCAN_CMD = 0x80 (response)
*/
-struct iwl_scanreq_notification {
+struct iwl3945_scanreq_notification {
__le32 status; /* 1: okay, 2: cannot fulfill request */
} __attribute__ ((packed));
/*
* SCAN_START_NOTIFICATION = 0x82 (notification only, not a command)
*/
-struct iwl_scanstart_notification {
+struct iwl3945_scanstart_notification {
__le32 tsf_low;
__le32 tsf_high;
__le32 beacon_timer;
/*
* SCAN_RESULTS_NOTIFICATION = 0x83 (notification only, not a command)
*/
-struct iwl_scanresults_notification {
+struct iwl3945_scanresults_notification {
u8 channel;
u8 band;
u8 reserved[2];
/*
* SCAN_COMPLETE_NOTIFICATION = 0x84 (notification only, not a command)
*/
-struct iwl_scancomplete_notification {
+struct iwl3945_scancomplete_notification {
u8 scanned_channels;
u8 status;
u8 reserved;
/*
* BEACON_NOTIFICATION = 0x90 (notification only, not a command)
*/
-struct iwl_beacon_notif {
- struct iwl_tx_resp beacon_notify_hdr;
+struct iwl3945_beacon_notif {
+ struct iwl3945_tx_resp beacon_notify_hdr;
__le32 low_tsf;
__le32 high_tsf;
__le32 ibss_mgr_status;
/*
* REPLY_TX_BEACON = 0x91 (command, has simple generic response)
*/
-struct iwl_tx_beacon_cmd {
- struct iwl_tx_cmd tx;
+struct iwl3945_tx_beacon_cmd {
+ struct iwl3945_tx_cmd tx;
__le16 tim_idx;
u8 tim_size;
u8 reserved1;
*/
#define IWL_STATS_CONF_CLEAR_STATS __constant_cpu_to_le32(0x1) /* see above */
#define IWL_STATS_CONF_DISABLE_NOTIF __constant_cpu_to_le32(0x2)/* see above */
-struct iwl_statistics_cmd {
+struct iwl3945_statistics_cmd {
__le32 configuration_flags; /* IWL_STATS_CONF_* */
} __attribute__ ((packed));
*/
#define STATISTICS_REPLY_FLG_BAND_24G_MSK __constant_cpu_to_le32(0x2)
#define STATISTICS_REPLY_FLG_FAT_MODE_MSK __constant_cpu_to_le32(0x8)
-struct iwl_notif_statistics {
+struct iwl3945_notif_statistics {
__le32 flag;
struct statistics_rx rx;
struct statistics_tx tx;
* then this notification will be sent. */
#define CONSECUTIVE_MISSED_BCONS_TH 20
-struct iwl_missed_beacon_notif {
+struct iwl3945_missed_beacon_notif {
__le32 consequtive_missed_beacons;
__le32 total_missed_becons;
__le32 num_expected_beacons;
#define PHY_CALIBRATE_DIFF_GAIN_CMD (7)
#define HD_TABLE_SIZE (11)
-struct iwl_sensitivity_cmd {
+struct iwl3945_sensitivity_cmd {
__le16 control;
__le16 table[HD_TABLE_SIZE];
} __attribute__ ((packed));
-struct iwl_calibration_cmd {
+struct iwl3945_calibration_cmd {
u8 opCode;
u8 flags;
__le16 reserved;
* For each of 3 possible LEDs (Activity/Link/Tech, selected by "id" field),
* this command turns it on or off, or sets up a periodic blinking cycle.
*/
-struct iwl_led_cmd {
+struct iwl3945_led_cmd {
__le32 interval; /* "interval" in uSec */
u8 id; /* 1: Activity, 2: Link, 3: Tech */
u8 off; /* # intervals off while blinking;
*
*****************************************************************************/
-struct iwl_rx_packet {
+struct iwl3945_rx_packet {
__le32 len;
- struct iwl_cmd_header hdr;
+ struct iwl3945_cmd_header hdr;
union {
- struct iwl_alive_resp alive_frame;
- struct iwl_rx_frame rx_frame;
- struct iwl_tx_resp tx_resp;
- struct iwl_spectrum_notification spectrum_notif;
- struct iwl_csa_notification csa_notif;
- struct iwl_error_resp err_resp;
- struct iwl_card_state_notif card_state_notif;
- struct iwl_beacon_notif beacon_status;
- struct iwl_add_sta_resp add_sta;
- struct iwl_sleep_notification sleep_notif;
- struct iwl_spectrum_resp spectrum;
- struct iwl_notif_statistics stats;
+ struct iwl3945_alive_resp alive_frame;
+ struct iwl3945_rx_frame rx_frame;
+ struct iwl3945_tx_resp tx_resp;
+ struct iwl3945_spectrum_notification spectrum_notif;
+ struct iwl3945_csa_notification csa_notif;
+ struct iwl3945_error_resp err_resp;
+ struct iwl3945_card_state_notif card_state_notif;
+ struct iwl3945_beacon_notif beacon_status;
+ struct iwl3945_add_sta_resp add_sta;
+ struct iwl3945_sleep_notification sleep_notif;
+ struct iwl3945_spectrum_resp spectrum;
+ struct iwl3945_notif_statistics stats;
__le32 status;
u8 raw[0];
} u;
} __attribute__ ((packed));
-#define IWL_RX_FRAME_SIZE (4 + sizeof(struct iwl_rx_frame))
+#define IWL_RX_FRAME_SIZE (4 + sizeof(struct iwl3945_rx_frame))
-#endif /* __iwl_3945_commands_h__ */
+#endif /* __iwl3945_3945_commands_h__ */
*
*****************************************************************************/
-#ifndef __iwl_debug_h__
-#define __iwl_debug_h__
+#ifndef __iwl3945_debug_h__
+#define __iwl3945_debug_h__
#ifdef CONFIG_IWL3945_DEBUG
-extern u32 iwl_debug_level;
+extern u32 iwl3945_debug_level;
#define IWL_DEBUG(level, fmt, args...) \
-do { if (iwl_debug_level & (level)) \
+do { if (iwl3945_debug_level & (level)) \
printk(KERN_ERR DRV_NAME": %c %s " fmt, \
in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
#define IWL_DEBUG_LIMIT(level, fmt, args...) \
-do { if ((iwl_debug_level & (level)) && net_ratelimit()) \
+do { if ((iwl3945_debug_level & (level)) && net_ratelimit()) \
printk(KERN_ERR DRV_NAME": %c %s " fmt, \
in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
#else
*
* % cat /proc/net/iwl/debug_level
*
- * you simply need to add your entry to the iwl_debug_levels array.
+ * you simply need to add your entry to the iwl3945_debug_levels array.
*
* If you do not see debug_level in /proc/net/iwl then you do not have
* CONFIG_IWL3945_DEBUG defined in your kernel configuration
#define EEPROM_SKU_CAP_OP_MODE_MRC (1 << 7)
/* *regulatory* channel data from eeprom, one for each channel */
-struct iwl_eeprom_channel {
+struct iwl3945_eeprom_channel {
u8 flags; /* flags copied from EEPROM */
s8 max_power_avg; /* max power (dBm) on this chnl, limit 31 */
} __attribute__ ((packed));
* level.
* Data copied from EEPROM.
*/
-struct iwl_eeprom_txpower_sample {
+struct iwl3945_eeprom_txpower_sample {
u8 gain_index; /* index into power (gain) setup table ... */
s8 power; /* ... for this pwr level for this chnl group */
u16 v_det; /* PA output voltage */
* Data copied from EEPROM.
* DO NOT ALTER THIS STRUCTURE!!!
*/
-struct iwl_eeprom_txpower_group {
- struct iwl_eeprom_txpower_sample samples[5]; /* 5 power levels */
+struct iwl3945_eeprom_txpower_group {
+ struct iwl3945_eeprom_txpower_sample samples[5]; /* 5 power levels */
s32 a, b, c, d, e; /* coefficients for voltage->power
* formula (signed) */
s32 Fa, Fb, Fc, Fd, Fe; /* these modify coeffs based on
* difference between current temperature and factory calib temperature.
* Data copied from EEPROM.
*/
-struct iwl_eeprom_temperature_corr {
+struct iwl3945_eeprom_temperature_corr {
u32 Ta;
u32 Tb;
u32 Tc;
u32 Te;
} __attribute__ ((packed));
-struct iwl_eeprom {
+struct iwl3945_eeprom {
u8 reserved0[16];
#define EEPROM_DEVICE_ID (2*0x08) /* 2 bytes */
u16 device_id; /* abs.ofs: 16 */
#define EEPROM_REGULATORY_BAND_1 (2*0x62) /* 2 bytes */
u16 band_1_count; /* abs.ofs: 196 */
#define EEPROM_REGULATORY_BAND_1_CHANNELS (2*0x63) /* 28 bytes */
- struct iwl_eeprom_channel band_1_channels[14]; /* abs.ofs: 196 */
+ struct iwl3945_eeprom_channel band_1_channels[14]; /* abs.ofs: 196 */
#define EEPROM_REGULATORY_BAND_2 (2*0x71) /* 2 bytes */
u16 band_2_count; /* abs.ofs: 226 */
#define EEPROM_REGULATORY_BAND_2_CHANNELS (2*0x72) /* 26 bytes */
- struct iwl_eeprom_channel band_2_channels[13]; /* abs.ofs: 228 */
+ struct iwl3945_eeprom_channel band_2_channels[13]; /* abs.ofs: 228 */
#define EEPROM_REGULATORY_BAND_3 (2*0x7F) /* 2 bytes */
u16 band_3_count; /* abs.ofs: 254 */
#define EEPROM_REGULATORY_BAND_3_CHANNELS (2*0x80) /* 24 bytes */
- struct iwl_eeprom_channel band_3_channels[12]; /* abs.ofs: 256 */
+ struct iwl3945_eeprom_channel band_3_channels[12]; /* abs.ofs: 256 */
#define EEPROM_REGULATORY_BAND_4 (2*0x8C) /* 2 bytes */
u16 band_4_count; /* abs.ofs: 280 */
#define EEPROM_REGULATORY_BAND_4_CHANNELS (2*0x8D) /* 22 bytes */
- struct iwl_eeprom_channel band_4_channels[11]; /* abs.ofs: 282 */
+ struct iwl3945_eeprom_channel band_4_channels[11]; /* abs.ofs: 282 */
#define EEPROM_REGULATORY_BAND_5 (2*0x98) /* 2 bytes */
u16 band_5_count; /* abs.ofs: 304 */
#define EEPROM_REGULATORY_BAND_5_CHANNELS (2*0x99) /* 12 bytes */
- struct iwl_eeprom_channel band_5_channels[6]; /* abs.ofs: 306 */
+ struct iwl3945_eeprom_channel band_5_channels[6]; /* abs.ofs: 306 */
u8 reserved9[194];
#define EEPROM_TXPOWER_CALIB_GROUP3 0x2c0
#define EEPROM_TXPOWER_CALIB_GROUP4 0x300
#define IWL_NUM_TX_CALIB_GROUPS 5
- struct iwl_eeprom_txpower_group groups[IWL_NUM_TX_CALIB_GROUPS];
+ struct iwl3945_eeprom_txpower_group groups[IWL_NUM_TX_CALIB_GROUPS];
/* abs.ofs: 512 */
#define EEPROM_CALIB_TEMPERATURE_CORRECT 0x340
- struct iwl_eeprom_temperature_corr corrections; /* abs.ofs: 832 */
+ struct iwl3945_eeprom_temperature_corr corrections; /* abs.ofs: 832 */
u8 reserved16[172]; /* fill out to full 1024 byte block */
} __attribute__ ((packed));
#define TFD_TX_CMD_SLOTS 256
#define TFD_CMD_SLOTS 32
-#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_cmd) - \
- sizeof(struct iwl_cmd_meta))
+#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl3945_cmd) - \
+ sizeof(struct iwl3945_cmd_meta))
/*
* RX related structures and functions
#define IWL_MAX_DATA_SIZE ALM_RTC_DATA_SIZE
#define IWL_MAX_NUM_QUEUES 8
-static inline int iwl_hw_valid_rtc_data_addr(u32 addr)
+static inline int iwl3945_hw_valid_rtc_data_addr(u32 addr)
{
return (addr >= RTC_DATA_LOWER_BOUND) &&
(addr < ALM_RTC_DATA_UPPER_BOUND);
}
-/* Base physical address of iwl_shared is provided to FH_TSSR_CBB_BASE
- * and &iwl_shared.rx_read_ptr[0] is provided to FH_RCSR_RPTR_ADDR(0) */
-struct iwl_shared {
+/* Base physical address of iwl3945_shared is provided to FH_TSSR_CBB_BASE
+ * and &iwl3945_shared.rx_read_ptr[0] is provided to FH_RCSR_RPTR_ADDR(0) */
+struct iwl3945_shared {
__le32 tx_base_ptr[8];
__le32 rx_read_ptr[3];
} __attribute__ ((packed));
-struct iwl_tfd_frame_data {
+struct iwl3945_tfd_frame_data {
__le32 addr;
__le32 len;
} __attribute__ ((packed));
-struct iwl_tfd_frame {
+struct iwl3945_tfd_frame {
__le32 control_flags;
- struct iwl_tfd_frame_data pa[4];
+ struct iwl3945_tfd_frame_data pa[4];
u8 reserved[28];
} __attribute__ ((packed));
-static inline u8 iwl_hw_get_rate(__le16 rate_n_flags)
+static inline u8 iwl3945_hw_get_rate(__le16 rate_n_flags)
{
return le16_to_cpu(rate_n_flags) & 0xFF;
}
-static inline u16 iwl_hw_get_rate_n_flags(__le16 rate_n_flags)
+static inline u16 iwl3945_hw_get_rate_n_flags(__le16 rate_n_flags)
{
return le16_to_cpu(rate_n_flags);
}
-static inline __le16 iwl_hw_set_rate_n_flags(u8 rate, u16 flags)
+static inline __le16 iwl3945_hw_set_rate_n_flags(u8 rate, u16 flags)
{
return cpu_to_le16((u16)rate|flags);
}
*
*****************************************************************************/
-#ifndef __iwl_io_h__
-#define __iwl_io_h__
+#ifndef __iwl3945_io_h__
+#define __iwl3945_io_h__
#include <linux/io.h>
*
* If you wish to call the function without any debug or state checking,
* you should use the single _ prefix version (as is used by dependent IO
- * routines, for example _iwl_read_direct32 calls the non-check version of
- * _iwl_read32.)
+ * routines, for example _iwl3945_read_direct32 calls the non-check version of
+ * _iwl3945_read32.)
*
* These declarations are *extremely* useful in quickly isolating code deltas
* which result in misconfiguring of the hardware I/O. In combination with
*
*/
-#define _iwl_write32(iwl, ofs, val) writel((val), (iwl)->hw_base + (ofs))
+#define _iwl3945_write32(iwl, ofs, val) writel((val), (iwl)->hw_base + (ofs))
#ifdef CONFIG_IWL3945_DEBUG
-static inline void __iwl_write32(const char *f, u32 l, struct iwl_priv *iwl,
+static inline void __iwl3945_write32(const char *f, u32 l, struct iwl3945_priv *iwl,
u32 ofs, u32 val)
{
IWL_DEBUG_IO("write32(0x%08X, 0x%08X) - %s %d\n", ofs, val, f, l);
- _iwl_write32(iwl, ofs, val);
+ _iwl3945_write32(iwl, ofs, val);
}
-#define iwl_write32(iwl, ofs, val) \
- __iwl_write32(__FILE__, __LINE__, iwl, ofs, val)
+#define iwl3945_write32(iwl, ofs, val) \
+ __iwl3945_write32(__FILE__, __LINE__, iwl, ofs, val)
#else
-#define iwl_write32(iwl, ofs, val) _iwl_write32(iwl, ofs, val)
+#define iwl3945_write32(iwl, ofs, val) _iwl3945_write32(iwl, ofs, val)
#endif
-#define _iwl_read32(iwl, ofs) readl((iwl)->hw_base + (ofs))
+#define _iwl3945_read32(iwl, ofs) readl((iwl)->hw_base + (ofs))
#ifdef CONFIG_IWL3945_DEBUG
-static inline u32 __iwl_read32(char *f, u32 l, struct iwl_priv *iwl, u32 ofs)
+static inline u32 __iwl3945_read32(char *f, u32 l, struct iwl3945_priv *iwl, u32 ofs)
{
IWL_DEBUG_IO("read_direct32(0x%08X) - %s %d\n", ofs, f, l);
- return _iwl_read32(iwl, ofs);
+ return _iwl3945_read32(iwl, ofs);
}
-#define iwl_read32(iwl, ofs) __iwl_read32(__FILE__, __LINE__, iwl, ofs)
+#define iwl3945_read32(iwl, ofs) __iwl3945_read32(__FILE__, __LINE__, iwl, ofs)
#else
-#define iwl_read32(p, o) _iwl_read32(p, o)
+#define iwl3945_read32(p, o) _iwl3945_read32(p, o)
#endif
-static inline int _iwl_poll_bit(struct iwl_priv *priv, u32 addr,
+static inline int _iwl3945_poll_bit(struct iwl3945_priv *priv, u32 addr,
u32 bits, u32 mask, int timeout)
{
int i = 0;
do {
- if ((_iwl_read32(priv, addr) & mask) == (bits & mask))
+ if ((_iwl3945_read32(priv, addr) & mask) == (bits & mask))
return i;
mdelay(10);
i += 10;
return -ETIMEDOUT;
}
#ifdef CONFIG_IWL3945_DEBUG
-static inline int __iwl_poll_bit(const char *f, u32 l,
- struct iwl_priv *priv, u32 addr,
+static inline int __iwl3945_poll_bit(const char *f, u32 l,
+ struct iwl3945_priv *priv, u32 addr,
u32 bits, u32 mask, int timeout)
{
- int ret = _iwl_poll_bit(priv, addr, bits, mask, timeout);
+ int ret = _iwl3945_poll_bit(priv, addr, bits, mask, timeout);
if (unlikely(ret == -ETIMEDOUT))
IWL_DEBUG_IO
("poll_bit(0x%08X, 0x%08X, 0x%08X) - timedout - %s %d\n",
addr, bits, mask, ret, f, l);
return ret;
}
-#define iwl_poll_bit(iwl, addr, bits, mask, timeout) \
- __iwl_poll_bit(__FILE__, __LINE__, iwl, addr, bits, mask, timeout)
+#define iwl3945_poll_bit(iwl, addr, bits, mask, timeout) \
+ __iwl3945_poll_bit(__FILE__, __LINE__, iwl, addr, bits, mask, timeout)
#else
-#define iwl_poll_bit(p, a, b, m, t) _iwl_poll_bit(p, a, b, m, t)
+#define iwl3945_poll_bit(p, a, b, m, t) _iwl3945_poll_bit(p, a, b, m, t)
#endif
-static inline void _iwl_set_bit(struct iwl_priv *priv, u32 reg, u32 mask)
+static inline void _iwl3945_set_bit(struct iwl3945_priv *priv, u32 reg, u32 mask)
{
- _iwl_write32(priv, reg, _iwl_read32(priv, reg) | mask);
+ _iwl3945_write32(priv, reg, _iwl3945_read32(priv, reg) | mask);
}
#ifdef CONFIG_IWL3945_DEBUG
-static inline void __iwl_set_bit(const char *f, u32 l,
- struct iwl_priv *priv, u32 reg, u32 mask)
+static inline void __iwl3945_set_bit(const char *f, u32 l,
+ struct iwl3945_priv *priv, u32 reg, u32 mask)
{
- u32 val = _iwl_read32(priv, reg) | mask;
+ u32 val = _iwl3945_read32(priv, reg) | mask;
IWL_DEBUG_IO("set_bit(0x%08X, 0x%08X) = 0x%08X\n", reg, mask, val);
- _iwl_write32(priv, reg, val);
+ _iwl3945_write32(priv, reg, val);
}
-#define iwl_set_bit(p, r, m) __iwl_set_bit(__FILE__, __LINE__, p, r, m)
+#define iwl3945_set_bit(p, r, m) __iwl3945_set_bit(__FILE__, __LINE__, p, r, m)
#else
-#define iwl_set_bit(p, r, m) _iwl_set_bit(p, r, m)
+#define iwl3945_set_bit(p, r, m) _iwl3945_set_bit(p, r, m)
#endif
-static inline void _iwl_clear_bit(struct iwl_priv *priv, u32 reg, u32 mask)
+static inline void _iwl3945_clear_bit(struct iwl3945_priv *priv, u32 reg, u32 mask)
{
- _iwl_write32(priv, reg, _iwl_read32(priv, reg) & ~mask);
+ _iwl3945_write32(priv, reg, _iwl3945_read32(priv, reg) & ~mask);
}
#ifdef CONFIG_IWL3945_DEBUG
-static inline void __iwl_clear_bit(const char *f, u32 l,
- struct iwl_priv *priv, u32 reg, u32 mask)
+static inline void __iwl3945_clear_bit(const char *f, u32 l,
+ struct iwl3945_priv *priv, u32 reg, u32 mask)
{
- u32 val = _iwl_read32(priv, reg) & ~mask;
+ u32 val = _iwl3945_read32(priv, reg) & ~mask;
IWL_DEBUG_IO("clear_bit(0x%08X, 0x%08X) = 0x%08X\n", reg, mask, val);
- _iwl_write32(priv, reg, val);
+ _iwl3945_write32(priv, reg, val);
}
-#define iwl_clear_bit(p, r, m) __iwl_clear_bit(__FILE__, __LINE__, p, r, m)
+#define iwl3945_clear_bit(p, r, m) __iwl3945_clear_bit(__FILE__, __LINE__, p, r, m)
#else
-#define iwl_clear_bit(p, r, m) _iwl_clear_bit(p, r, m)
+#define iwl3945_clear_bit(p, r, m) _iwl3945_clear_bit(p, r, m)
#endif
-static inline int _iwl_grab_nic_access(struct iwl_priv *priv)
+static inline int _iwl3945_grab_nic_access(struct iwl3945_priv *priv)
{
int ret;
u32 gp_ctl;
"wakes up NIC\n");
/* 10 msec allows time for NIC to complete its data save */
- gp_ctl = _iwl_read32(priv, CSR_GP_CNTRL);
+ gp_ctl = _iwl3945_read32(priv, CSR_GP_CNTRL);
if (gp_ctl & CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY) {
IWL_DEBUG_RF_KILL("Wait for complete power-down, "
"gpctl = 0x%08x\n", gp_ctl);
}
/* this bit wakes up the NIC */
- _iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
- ret = _iwl_poll_bit(priv, CSR_GP_CNTRL,
+ _iwl3945_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
+ ret = _iwl3945_poll_bit(priv, CSR_GP_CNTRL,
CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN,
(CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY |
CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP), 50);
}
#ifdef CONFIG_IWL3945_DEBUG
-static inline int __iwl_grab_nic_access(const char *f, u32 l,
- struct iwl_priv *priv)
+static inline int __iwl3945_grab_nic_access(const char *f, u32 l,
+ struct iwl3945_priv *priv)
{
if (atomic_read(&priv->restrict_refcnt))
IWL_DEBUG_INFO("Grabbing access while already held at "
"line %d.\n", l);
IWL_DEBUG_IO("grabbing nic access - %s %d\n", f, l);
- return _iwl_grab_nic_access(priv);
+ return _iwl3945_grab_nic_access(priv);
}
-#define iwl_grab_nic_access(priv) \
- __iwl_grab_nic_access(__FILE__, __LINE__, priv)
+#define iwl3945_grab_nic_access(priv) \
+ __iwl3945_grab_nic_access(__FILE__, __LINE__, priv)
#else
-#define iwl_grab_nic_access(priv) \
- _iwl_grab_nic_access(priv)
+#define iwl3945_grab_nic_access(priv) \
+ _iwl3945_grab_nic_access(priv)
#endif
-static inline void _iwl_release_nic_access(struct iwl_priv *priv)
+static inline void _iwl3945_release_nic_access(struct iwl3945_priv *priv)
{
#ifdef CONFIG_IWL3945_DEBUG
if (atomic_dec_and_test(&priv->restrict_refcnt))
#endif
- _iwl_clear_bit(priv, CSR_GP_CNTRL,
+ _iwl3945_clear_bit(priv, CSR_GP_CNTRL,
CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
}
#ifdef CONFIG_IWL3945_DEBUG
-static inline void __iwl_release_nic_access(const char *f, u32 l,
- struct iwl_priv *priv)
+static inline void __iwl3945_release_nic_access(const char *f, u32 l,
+ struct iwl3945_priv *priv)
{
if (atomic_read(&priv->restrict_refcnt) <= 0)
IWL_ERROR("Release unheld nic access at line %d.\n", l);
IWL_DEBUG_IO("releasing nic access - %s %d\n", f, l);
- _iwl_release_nic_access(priv);
+ _iwl3945_release_nic_access(priv);
}
-#define iwl_release_nic_access(priv) \
- __iwl_release_nic_access(__FILE__, __LINE__, priv)
+#define iwl3945_release_nic_access(priv) \
+ __iwl3945_release_nic_access(__FILE__, __LINE__, priv)
#else
-#define iwl_release_nic_access(priv) \
- _iwl_release_nic_access(priv)
+#define iwl3945_release_nic_access(priv) \
+ _iwl3945_release_nic_access(priv)
#endif
-static inline u32 _iwl_read_direct32(struct iwl_priv *priv, u32 reg)
+static inline u32 _iwl3945_read_direct32(struct iwl3945_priv *priv, u32 reg)
{
- return _iwl_read32(priv, reg);
+ return _iwl3945_read32(priv, reg);
}
#ifdef CONFIG_IWL3945_DEBUG
-static inline u32 __iwl_read_direct32(const char *f, u32 l,
- struct iwl_priv *priv, u32 reg)
+static inline u32 __iwl3945_read_direct32(const char *f, u32 l,
+ struct iwl3945_priv *priv, u32 reg)
{
- u32 value = _iwl_read_direct32(priv, reg);
+ u32 value = _iwl3945_read_direct32(priv, reg);
if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access not held from %s %d\n", f, l);
IWL_DEBUG_IO("read_direct32(0x%4X) = 0x%08x - %s %d \n", reg, value,
f, l);
return value;
}
-#define iwl_read_direct32(priv, reg) \
- __iwl_read_direct32(__FILE__, __LINE__, priv, reg)
+#define iwl3945_read_direct32(priv, reg) \
+ __iwl3945_read_direct32(__FILE__, __LINE__, priv, reg)
#else
-#define iwl_read_direct32 _iwl_read_direct32
+#define iwl3945_read_direct32 _iwl3945_read_direct32
#endif
-static inline void _iwl_write_direct32(struct iwl_priv *priv,
+static inline void _iwl3945_write_direct32(struct iwl3945_priv *priv,
u32 reg, u32 value)
{
- _iwl_write32(priv, reg, value);
+ _iwl3945_write32(priv, reg, value);
}
#ifdef CONFIG_IWL3945_DEBUG
-static void __iwl_write_direct32(u32 line,
- struct iwl_priv *priv, u32 reg, u32 value)
+static void __iwl3945_write_direct32(u32 line,
+ struct iwl3945_priv *priv, u32 reg, u32 value)
{
if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access not held from line %d\n", line);
- _iwl_write_direct32(priv, reg, value);
+ _iwl3945_write_direct32(priv, reg, value);
}
-#define iwl_write_direct32(priv, reg, value) \
- __iwl_write_direct32(__LINE__, priv, reg, value)
+#define iwl3945_write_direct32(priv, reg, value) \
+ __iwl3945_write_direct32(__LINE__, priv, reg, value)
#else
-#define iwl_write_direct32 _iwl_write_direct32
+#define iwl3945_write_direct32 _iwl3945_write_direct32
#endif
-static inline void iwl_write_reg_buf(struct iwl_priv *priv,
+static inline void iwl3945_write_reg_buf(struct iwl3945_priv *priv,
u32 reg, u32 len, u32 *values)
{
u32 count = sizeof(u32);
if ((priv != NULL) && (values != NULL)) {
for (; 0 < len; len -= count, reg += count, values++)
- _iwl_write_direct32(priv, reg, *values);
+ _iwl3945_write_direct32(priv, reg, *values);
}
}
-static inline int _iwl_poll_direct_bit(struct iwl_priv *priv,
+static inline int _iwl3945_poll_direct_bit(struct iwl3945_priv *priv,
u32 addr, u32 mask, int timeout)
{
int i = 0;
do {
- if ((_iwl_read_direct32(priv, addr) & mask) == mask)
+ if ((_iwl3945_read_direct32(priv, addr) & mask) == mask)
return i;
mdelay(10);
i += 10;
}
#ifdef CONFIG_IWL3945_DEBUG
-static inline int __iwl_poll_direct_bit(const char *f, u32 l,
- struct iwl_priv *priv,
+static inline int __iwl3945_poll_direct_bit(const char *f, u32 l,
+ struct iwl3945_priv *priv,
u32 addr, u32 mask, int timeout)
{
- int ret = _iwl_poll_direct_bit(priv, addr, mask, timeout);
+ int ret = _iwl3945_poll_direct_bit(priv, addr, mask, timeout);
if (unlikely(ret == -ETIMEDOUT))
IWL_DEBUG_IO("poll_direct_bit(0x%08X, 0x%08X) - "
"- %s %d\n", addr, mask, ret, f, l);
return ret;
}
-#define iwl_poll_direct_bit(iwl, addr, mask, timeout) \
- __iwl_poll_direct_bit(__FILE__, __LINE__, iwl, addr, mask, timeout)
+#define iwl3945_poll_direct_bit(iwl, addr, mask, timeout) \
+ __iwl3945_poll_direct_bit(__FILE__, __LINE__, iwl, addr, mask, timeout)
#else
-#define iwl_poll_direct_bit _iwl_poll_direct_bit
+#define iwl3945_poll_direct_bit _iwl3945_poll_direct_bit
#endif
-static inline u32 _iwl_read_prph(struct iwl_priv *priv, u32 reg)
+static inline u32 _iwl3945_read_prph(struct iwl3945_priv *priv, u32 reg)
{
- _iwl_write_direct32(priv, HBUS_TARG_PRPH_RADDR, reg | (3 << 24));
- return _iwl_read_direct32(priv, HBUS_TARG_PRPH_RDAT);
+ _iwl3945_write_direct32(priv, HBUS_TARG_PRPH_RADDR, reg | (3 << 24));
+ return _iwl3945_read_direct32(priv, HBUS_TARG_PRPH_RDAT);
}
#ifdef CONFIG_IWL3945_DEBUG
-static inline u32 __iwl_read_prph(u32 line, struct iwl_priv *priv, u32 reg)
+static inline u32 __iwl3945_read_prph(u32 line, struct iwl3945_priv *priv, u32 reg)
{
if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access not held from line %d\n", line);
- return _iwl_read_prph(priv, reg);
+ return _iwl3945_read_prph(priv, reg);
}
-#define iwl_read_prph(priv, reg) \
- __iwl_read_prph(__LINE__, priv, reg)
+#define iwl3945_read_prph(priv, reg) \
+ __iwl3945_read_prph(__LINE__, priv, reg)
#else
-#define iwl_read_prph _iwl_read_prph
+#define iwl3945_read_prph _iwl3945_read_prph
#endif
-static inline void _iwl_write_prph(struct iwl_priv *priv,
+static inline void _iwl3945_write_prph(struct iwl3945_priv *priv,
u32 addr, u32 val)
{
- _iwl_write_direct32(priv, HBUS_TARG_PRPH_WADDR,
+ _iwl3945_write_direct32(priv, HBUS_TARG_PRPH_WADDR,
((addr & 0x0000FFFF) | (3 << 24)));
- _iwl_write_direct32(priv, HBUS_TARG_PRPH_WDAT, val);
+ _iwl3945_write_direct32(priv, HBUS_TARG_PRPH_WDAT, val);
}
#ifdef CONFIG_IWL3945_DEBUG
-static inline void __iwl_write_prph(u32 line, struct iwl_priv *priv,
+static inline void __iwl3945_write_prph(u32 line, struct iwl3945_priv *priv,
u32 addr, u32 val)
{
if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access from line %d\n", line);
- _iwl_write_prph(priv, addr, val);
+ _iwl3945_write_prph(priv, addr, val);
}
-#define iwl_write_prph(priv, addr, val) \
- __iwl_write_prph(__LINE__, priv, addr, val);
+#define iwl3945_write_prph(priv, addr, val) \
+ __iwl3945_write_prph(__LINE__, priv, addr, val);
#else
-#define iwl_write_prph _iwl_write_prph
+#define iwl3945_write_prph _iwl3945_write_prph
#endif
-#define _iwl_set_bits_prph(priv, reg, mask) \
- _iwl_write_prph(priv, reg, (_iwl_read_prph(priv, reg) | mask))
+#define _iwl3945_set_bits_prph(priv, reg, mask) \
+ _iwl3945_write_prph(priv, reg, (_iwl3945_read_prph(priv, reg) | mask))
#ifdef CONFIG_IWL3945_DEBUG
-static inline void __iwl_set_bits_prph(u32 line, struct iwl_priv *priv,
+static inline void __iwl3945_set_bits_prph(u32 line, struct iwl3945_priv *priv,
u32 reg, u32 mask)
{
if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access not held from line %d\n", line);
- _iwl_set_bits_prph(priv, reg, mask);
+ _iwl3945_set_bits_prph(priv, reg, mask);
}
-#define iwl_set_bits_prph(priv, reg, mask) \
- __iwl_set_bits_prph(__LINE__, priv, reg, mask)
+#define iwl3945_set_bits_prph(priv, reg, mask) \
+ __iwl3945_set_bits_prph(__LINE__, priv, reg, mask)
#else
-#define iwl_set_bits_prph _iwl_set_bits_prph
+#define iwl3945_set_bits_prph _iwl3945_set_bits_prph
#endif
-#define _iwl_set_bits_mask_prph(priv, reg, bits, mask) \
- _iwl_write_prph(priv, reg, ((_iwl_read_prph(priv, reg) & mask) | bits))
+#define _iwl3945_set_bits_mask_prph(priv, reg, bits, mask) \
+ _iwl3945_write_prph(priv, reg, ((_iwl3945_read_prph(priv, reg) & mask) | bits))
#ifdef CONFIG_IWL3945_DEBUG
-static inline void __iwl_set_bits_mask_prph(u32 line,
- struct iwl_priv *priv, u32 reg, u32 bits, u32 mask)
+static inline void __iwl3945_set_bits_mask_prph(u32 line,
+ struct iwl3945_priv *priv, u32 reg, u32 bits, u32 mask)
{
if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access not held from line %d\n", line);
- _iwl_set_bits_mask_prph(priv, reg, bits, mask);
+ _iwl3945_set_bits_mask_prph(priv, reg, bits, mask);
}
-#define iwl_set_bits_mask_prph(priv, reg, bits, mask) \
- __iwl_set_bits_mask_prph(__LINE__, priv, reg, bits, mask)
+#define iwl3945_set_bits_mask_prph(priv, reg, bits, mask) \
+ __iwl3945_set_bits_mask_prph(__LINE__, priv, reg, bits, mask)
#else
-#define iwl_set_bits_mask_prph _iwl_set_bits_mask_prph
+#define iwl3945_set_bits_mask_prph _iwl3945_set_bits_mask_prph
#endif
-static inline void iwl_clear_bits_prph(struct iwl_priv
+static inline void iwl3945_clear_bits_prph(struct iwl3945_priv
*priv, u32 reg, u32 mask)
{
- u32 val = _iwl_read_prph(priv, reg);
- _iwl_write_prph(priv, reg, (val & ~mask));
+ u32 val = _iwl3945_read_prph(priv, reg);
+ _iwl3945_write_prph(priv, reg, (val & ~mask));
}
-static inline u32 iwl_read_targ_mem(struct iwl_priv *priv, u32 addr)
+static inline u32 iwl3945_read_targ_mem(struct iwl3945_priv *priv, u32 addr)
{
- iwl_write_direct32(priv, HBUS_TARG_MEM_RADDR, addr);
- return iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT);
+ iwl3945_write_direct32(priv, HBUS_TARG_MEM_RADDR, addr);
+ return iwl3945_read_direct32(priv, HBUS_TARG_MEM_RDAT);
}
-static inline void iwl_write_targ_mem(struct iwl_priv *priv, u32 addr, u32 val)
+static inline void iwl3945_write_targ_mem(struct iwl3945_priv *priv, u32 addr, u32 val)
{
- iwl_write_direct32(priv, HBUS_TARG_MEM_WADDR, addr);
- iwl_write_direct32(priv, HBUS_TARG_MEM_WDAT, val);
+ iwl3945_write_direct32(priv, HBUS_TARG_MEM_WADDR, addr);
+ iwl3945_write_direct32(priv, HBUS_TARG_MEM_WDAT, val);
}
-static inline void iwl_write_targ_mem_buf(struct iwl_priv *priv, u32 addr,
+static inline void iwl3945_write_targ_mem_buf(struct iwl3945_priv *priv, u32 addr,
u32 len, u32 *values)
{
- iwl_write_direct32(priv, HBUS_TARG_MEM_WADDR, addr);
+ iwl3945_write_direct32(priv, HBUS_TARG_MEM_WADDR, addr);
for (; 0 < len; len -= sizeof(u32), values++)
- iwl_write_direct32(priv, HBUS_TARG_MEM_WDAT, *values);
+ iwl3945_write_direct32(priv, HBUS_TARG_MEM_WDAT, *values);
}
#endif
#define RS_NAME "iwl-3945-rs"
-struct iwl_rate_scale_data {
+struct iwl3945_rate_scale_data {
u64 data;
s32 success_counter;
s32 success_ratio;
unsigned long stamp;
};
-struct iwl_rate_scale_priv {
+struct iwl3945_rate_scale_priv {
spinlock_t lock;
s32 *expected_tpt;
unsigned long last_partial_flush;
u8 start_rate;
u8 ibss_sta_added;
struct timer_list rate_scale_flush;
- struct iwl_rate_scale_data win[IWL_RATE_COUNT];
+ struct iwl3945_rate_scale_data win[IWL_RATE_COUNT];
};
-static s32 iwl_expected_tpt_g[IWL_RATE_COUNT] = {
+static s32 iwl3945_expected_tpt_g[IWL_RATE_COUNT] = {
7, 13, 35, 58, 0, 0, 76, 104, 130, 168, 191, 202
};
-static s32 iwl_expected_tpt_g_prot[IWL_RATE_COUNT] = {
+static s32 iwl3945_expected_tpt_g_prot[IWL_RATE_COUNT] = {
7, 13, 35, 58, 0, 0, 0, 80, 93, 113, 123, 125
};
-static s32 iwl_expected_tpt_a[IWL_RATE_COUNT] = {
+static s32 iwl3945_expected_tpt_a[IWL_RATE_COUNT] = {
0, 0, 0, 0, 40, 57, 72, 98, 121, 154, 177, 186
};
-static s32 iwl_expected_tpt_b[IWL_RATE_COUNT] = {
+static s32 iwl3945_expected_tpt_b[IWL_RATE_COUNT] = {
7, 13, 35, 58, 0, 0, 0, 0, 0, 0, 0, 0
};
-struct iwl_tpt_entry {
+struct iwl3945_tpt_entry {
s8 min_rssi;
u8 index;
};
-static struct iwl_tpt_entry iwl_tpt_table_a[] = {
+static struct iwl3945_tpt_entry iwl3945_tpt_table_a[] = {
{-60, IWL_RATE_54M_INDEX},
{-64, IWL_RATE_48M_INDEX},
{-72, IWL_RATE_36M_INDEX},
{-89, IWL_RATE_6M_INDEX}
};
-static struct iwl_tpt_entry iwl_tpt_table_b[] = {
+static struct iwl3945_tpt_entry iwl3945_tpt_table_b[] = {
{-86, IWL_RATE_11M_INDEX},
{-88, IWL_RATE_5M_INDEX},
{-90, IWL_RATE_2M_INDEX},
};
-static struct iwl_tpt_entry iwl_tpt_table_g[] = {
+static struct iwl3945_tpt_entry iwl3945_tpt_table_g[] = {
{-60, IWL_RATE_54M_INDEX},
{-64, IWL_RATE_48M_INDEX},
{-68, IWL_RATE_36M_INDEX},
#define IWL_RATE_MIN_SUCCESS_TH 8
#define IWL_RATE_DECREASE_TH 1920
-static u8 iwl_get_rate_index_by_rssi(s32 rssi, u8 mode)
+static u8 iwl3945_get_rate_index_by_rssi(s32 rssi, u8 mode)
{
u32 index = 0;
u32 table_size = 0;
- struct iwl_tpt_entry *tpt_table = NULL;
+ struct iwl3945_tpt_entry *tpt_table = NULL;
if ((rssi < IWL_MIN_RSSI_VAL) || (rssi > IWL_MAX_RSSI_VAL))
rssi = IWL_MIN_RSSI_VAL;
switch (mode) {
case MODE_IEEE80211G:
- tpt_table = iwl_tpt_table_g;
- table_size = ARRAY_SIZE(iwl_tpt_table_g);
+ tpt_table = iwl3945_tpt_table_g;
+ table_size = ARRAY_SIZE(iwl3945_tpt_table_g);
break;
case MODE_IEEE80211A:
- tpt_table = iwl_tpt_table_a;
- table_size = ARRAY_SIZE(iwl_tpt_table_a);
+ tpt_table = iwl3945_tpt_table_a;
+ table_size = ARRAY_SIZE(iwl3945_tpt_table_a);
break;
default:
case MODE_IEEE80211B:
- tpt_table = iwl_tpt_table_b;
- table_size = ARRAY_SIZE(iwl_tpt_table_b);
+ tpt_table = iwl3945_tpt_table_b;
+ table_size = ARRAY_SIZE(iwl3945_tpt_table_b);
break;
}
return tpt_table[index].index;
}
-static void iwl_clear_window(struct iwl_rate_scale_data *window)
+static void iwl3945_clear_window(struct iwl3945_rate_scale_data *window)
{
window->data = 0;
window->success_counter = 0;
}
/**
- * iwl_rate_scale_flush_windows - flush out the rate scale windows
+ * iwl3945_rate_scale_flush_windows - flush out the rate scale windows
*
* Returns the number of windows that have gathered data but were
* not flushed. If there were any that were not flushed, then
* reschedule the rate flushing routine.
*/
-static int iwl_rate_scale_flush_windows(struct iwl_rate_scale_priv *rs_priv)
+static int iwl3945_rate_scale_flush_windows(struct iwl3945_rate_scale_priv *rs_priv)
{
int unflushed = 0;
int i;
IWL_DEBUG_RATE("flushing %d samples of rate "
"index %d\n",
rs_priv->win[i].counter, i);
- iwl_clear_window(&rs_priv->win[i]);
+ iwl3945_clear_window(&rs_priv->win[i]);
} else
unflushed++;
spin_unlock_irqrestore(&rs_priv->lock, flags);
#define IWL_RATE_FLUSH_MAX 5000 /* msec */
#define IWL_RATE_FLUSH_MIN 50 /* msec */
-static void iwl_bg_rate_scale_flush(unsigned long data)
+static void iwl3945_bg_rate_scale_flush(unsigned long data)
{
- struct iwl_rate_scale_priv *rs_priv = (void *)data;
+ struct iwl3945_rate_scale_priv *rs_priv = (void *)data;
int unflushed = 0;
unsigned long flags;
u32 packet_count, duration, pps;
IWL_DEBUG_RATE("enter\n");
- unflushed = iwl_rate_scale_flush_windows(rs_priv);
+ unflushed = iwl3945_rate_scale_flush_windows(rs_priv);
spin_lock_irqsave(&rs_priv->lock, flags);
}
/**
- * iwl_collect_tx_data - Update the success/failure sliding window
+ * iwl3945_collect_tx_data - Update the success/failure sliding window
*
* We keep a sliding window of the last 64 packets transmitted
* at this rate. window->data contains the bitmask of successful
* packets.
*/
-static void iwl_collect_tx_data(struct iwl_rate_scale_priv *rs_priv,
- struct iwl_rate_scale_data *window,
+static void iwl3945_collect_tx_data(struct iwl3945_rate_scale_priv *rs_priv,
+ struct iwl3945_rate_scale_data *window,
int success, int retries)
{
unsigned long flags;
static void *rs_alloc_sta(void *priv, gfp_t gfp)
{
- struct iwl_rate_scale_priv *rs_priv;
+ struct iwl3945_rate_scale_priv *rs_priv;
int i;
IWL_DEBUG_RATE("enter\n");
- rs_priv = kzalloc(sizeof(struct iwl_rate_scale_priv), gfp);
+ rs_priv = kzalloc(sizeof(struct iwl3945_rate_scale_priv), gfp);
if (!rs_priv) {
IWL_DEBUG_RATE("leave: ENOMEM\n");
return NULL;
rs_priv->start_rate = IWL_RATE_INVALID;
/* default to just 802.11b */
- rs_priv->expected_tpt = iwl_expected_tpt_b;
+ rs_priv->expected_tpt = iwl3945_expected_tpt_b;
rs_priv->last_partial_flush = jiffies;
rs_priv->last_flush = jiffies;
init_timer(&rs_priv->rate_scale_flush);
rs_priv->rate_scale_flush.data = (unsigned long)rs_priv;
- rs_priv->rate_scale_flush.function = &iwl_bg_rate_scale_flush;
+ rs_priv->rate_scale_flush.function = &iwl3945_bg_rate_scale_flush;
for (i = 0; i < IWL_RATE_COUNT; i++)
- iwl_clear_window(&rs_priv->win[i]);
+ iwl3945_clear_window(&rs_priv->win[i]);
IWL_DEBUG_RATE("leave\n");
static void rs_free_sta(void *priv, void *priv_sta)
{
- struct iwl_rate_scale_priv *rs_priv = priv_sta;
+ struct iwl3945_rate_scale_priv *rs_priv = priv_sta;
IWL_DEBUG_RATE("enter\n");
del_timer_sync(&rs_priv->rate_scale_flush);
* for A and B mode we need to overright prev
* value
*/
-static int rs_adjust_next_rate(struct iwl_priv *priv, int rate)
+static int rs_adjust_next_rate(struct iwl3945_priv *priv, int rate)
{
- int next_rate = iwl_get_prev_ieee_rate(rate);
+ int next_rate = iwl3945_get_prev_ieee_rate(rate);
switch (priv->phymode) {
case MODE_IEEE80211A:
/**
* rs_tx_status - Update rate control values based on Tx results
*
- * NOTE: Uses iwl_priv->retry_rate for the # of retries attempted by
+ * NOTE: Uses iwl3945_priv->retry_rate for the # of retries attempted by
* the hardware for each rate.
*/
static void rs_tx_status(void *priv_rate,
unsigned long flags;
struct sta_info *sta;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
- struct iwl_priv *priv = (struct iwl_priv *)priv_rate;
+ struct iwl3945_priv *priv = (struct iwl3945_priv *)priv_rate;
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
- struct iwl_rate_scale_priv *rs_priv;
+ struct iwl3945_rate_scale_priv *rs_priv;
IWL_DEBUG_RATE("enter\n");
/* Update this rate accounting for as many retries
* as was used for it (per current_count) */
- iwl_collect_tx_data(rs_priv,
+ iwl3945_collect_tx_data(rs_priv,
&rs_priv->win[scale_rate_index],
0, current_count);
IWL_DEBUG_RATE("Update rate %d for %d retries.\n",
last_index,
(tx_resp->flags & IEEE80211_TX_STATUS_ACK) ?
"success" : "failure");
- iwl_collect_tx_data(rs_priv,
+ iwl3945_collect_tx_data(rs_priv,
&rs_priv->win[last_index],
tx_resp->flags & IEEE80211_TX_STATUS_ACK, 1);
return;
}
-static u16 iwl_get_adjacent_rate(struct iwl_rate_scale_priv *rs_priv,
- u8 index, u16 rate_mask, int phymode)
+static u16 iwl3945_get_adjacent_rate(struct iwl3945_rate_scale_priv *rs_priv,
+ u8 index, u16 rate_mask, int phymode)
{
u8 high = IWL_RATE_INVALID;
u8 low = IWL_RATE_INVALID;
low = index;
while (low != IWL_RATE_INVALID) {
if (rs_priv->tgg)
- low = iwl_rates[low].prev_rs_tgg;
+ low = iwl3945_rates[low].prev_rs_tgg;
else
- low = iwl_rates[low].prev_rs;
+ low = iwl3945_rates[low].prev_rs;
if (low == IWL_RATE_INVALID)
break;
if (rate_mask & (1 << low))
high = index;
while (high != IWL_RATE_INVALID) {
if (rs_priv->tgg)
- high = iwl_rates[high].next_rs_tgg;
+ high = iwl3945_rates[high].next_rs_tgg;
else
- high = iwl_rates[high].next_rs;
+ high = iwl3945_rates[high].next_rs;
if (high == IWL_RATE_INVALID)
break;
if (rate_mask & (1 << high))
u8 high = IWL_RATE_INVALID;
u16 high_low;
int index;
- struct iwl_rate_scale_priv *rs_priv;
- struct iwl_rate_scale_data *window = NULL;
+ struct iwl3945_rate_scale_priv *rs_priv;
+ struct iwl3945_rate_scale_data *window = NULL;
int current_tpt = IWL_INVALID_VALUE;
int low_tpt = IWL_INVALID_VALUE;
int high_tpt = IWL_INVALID_VALUE;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
struct sta_info *sta;
u16 rate_mask;
- struct iwl_priv *priv = (struct iwl_priv *)priv_rate;
+ struct iwl3945_priv *priv = (struct iwl3945_priv *)priv_rate;
DECLARE_MAC_BUF(mac);
IWL_DEBUG_RATE("enter\n");
if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) &&
!rs_priv->ibss_sta_added) {
- u8 sta_id = iwl_hw_find_station(priv, hdr->addr1);
+ u8 sta_id = iwl3945_hw_find_station(priv, hdr->addr1);
if (sta_id == IWL_INVALID_STATION) {
IWL_DEBUG_RATE("LQ: ADD station %s\n",
print_mac(mac, hdr->addr1));
- sta_id = iwl_add_station(priv,
+ sta_id = iwl3945_add_station(priv,
hdr->addr1, 0, CMD_ASYNC);
}
if (sta_id != IWL_INVALID_STATION)
rs_priv->expected_tpt[index] + 64) / 128);
current_tpt = window->average_tpt;
- high_low = iwl_get_adjacent_rate(rs_priv, index, rate_mask,
+ high_low = iwl3945_get_adjacent_rate(rs_priv, index, rate_mask,
local->hw.conf.phymode);
low = high_low & 0xff;
high = (high_low >> 8) & 0xff;
.free_sta = rs_free_sta,
};
-int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
+int iwl3945_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
{
struct ieee80211_local *local = hw_to_local(hw);
- struct iwl_priv *priv = hw->priv;
- struct iwl_rate_scale_priv *rs_priv;
+ struct iwl3945_priv *priv = hw->priv;
+ struct iwl3945_rate_scale_priv *rs_priv;
struct sta_info *sta;
unsigned long flags;
int count = 0, i;
int j;
count +=
- sprintf(&buf[count], " %2dMbs: ", iwl_rates[i].ieee / 2);
+ sprintf(&buf[count], " %2dMbs: ", iwl3945_rates[i].ieee / 2);
mask = (1ULL << (IWL_RATE_MAX_WINDOW - 1));
for (j = 0; j < IWL_RATE_MAX_WINDOW; j++, mask >>= 1)
samples += rs_priv->win[i].counter;
good += rs_priv->win[i].success_counter;
- success += rs_priv->win[i].success_counter * iwl_rates[i].ieee;
+ success += rs_priv->win[i].success_counter * iwl3945_rates[i].ieee;
if (rs_priv->win[i].stamp) {
int delta =
} else
buf[count++] = '\n';
- j = iwl_get_prev_ieee_rate(i);
+ j = iwl3945_get_prev_ieee_rate(i);
if (j == i)
break;
i = j;
/* Display the average rate of all samples taken.
*
* NOTE: We multiple # of samples by 2 since the IEEE measurement
- * added from iwl_rates is actually 2X the rate */
+ * added from iwl3945_rates is actually 2X the rate */
if (samples)
count += sprintf(
&buf[count],
return count;
}
-void iwl_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
+void iwl3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
{
- struct iwl_priv *priv = hw->priv;
+ struct iwl3945_priv *priv = hw->priv;
s32 rssi = 0;
unsigned long flags;
struct ieee80211_local *local = hw_to_local(hw);
- struct iwl_rate_scale_priv *rs_priv;
+ struct iwl3945_rate_scale_priv *rs_priv;
struct sta_info *sta;
IWL_DEBUG_RATE("enter\n");
case MODE_IEEE80211G:
if (priv->active_rxon.flags & RXON_FLG_TGG_PROTECT_MSK) {
rs_priv->tgg = 1;
- rs_priv->expected_tpt = iwl_expected_tpt_g_prot;
+ rs_priv->expected_tpt = iwl3945_expected_tpt_g_prot;
} else
- rs_priv->expected_tpt = iwl_expected_tpt_g;
+ rs_priv->expected_tpt = iwl3945_expected_tpt_g;
break;
case MODE_IEEE80211A:
- rs_priv->expected_tpt = iwl_expected_tpt_a;
+ rs_priv->expected_tpt = iwl3945_expected_tpt_a;
break;
default:
IWL_WARNING("Invalid phymode. Defaulting to 802.11b\n");
case MODE_IEEE80211B:
- rs_priv->expected_tpt = iwl_expected_tpt_b;
+ rs_priv->expected_tpt = iwl3945_expected_tpt_b;
break;
}
IWL_DEBUG(IWL_DL_INFO | IWL_DL_RATE, "Network RSSI: %d\n", rssi);
- rs_priv->start_rate = iwl_get_rate_index_by_rssi(rssi, priv->phymode);
+ rs_priv->start_rate = iwl3945_get_rate_index_by_rssi(rssi, priv->phymode);
IWL_DEBUG_RATE("leave: rssi %d assign rate index: "
"%d (plcp 0x%x)\n", rssi, rs_priv->start_rate,
- iwl_rates[rs_priv->start_rate].plcp);
+ iwl3945_rates[rs_priv->start_rate].plcp);
}
-void iwl_rate_control_register(struct ieee80211_hw *hw)
+void iwl3945_rate_control_register(struct ieee80211_hw *hw)
{
ieee80211_rate_control_register(&rs_ops);
}
-void iwl_rate_control_unregister(struct ieee80211_hw *hw)
+void iwl3945_rate_control_unregister(struct ieee80211_hw *hw)
{
ieee80211_rate_control_unregister(&rs_ops);
}
#ifndef __iwl_3945_rs_h__
#define __iwl_3945_rs_h__
-struct iwl_rate_info {
+struct iwl3945_rate_info {
u8 plcp;
u8 ieee;
u8 prev_ieee; /* previous rate in IEEE speeds */
#define IWL_MIN_RSSI_VAL -100
#define IWL_MAX_RSSI_VAL 0
-extern const struct iwl_rate_info iwl_rates[IWL_RATE_COUNT];
+extern const struct iwl3945_rate_info iwl3945_rates[IWL_RATE_COUNT];
-static inline u8 iwl_get_prev_ieee_rate(u8 rate_index)
+static inline u8 iwl3945_get_prev_ieee_rate(u8 rate_index)
{
- u8 rate = iwl_rates[rate_index].prev_ieee;
+ u8 rate = iwl3945_rates[rate_index].prev_ieee;
if (rate == IWL_RATE_INVALID)
rate = rate_index;
}
/**
- * iwl_fill_rs_info - Fill an output text buffer with the rate representation
+ * iwl3945_fill_rs_info - Fill an output text buffer with the rate representation
*
* NOTE: This is provided as a quick mechanism for a user to visualize
* the performance of the rate control algorithm and is not meant to be
* parsed software.
*/
-extern int iwl_fill_rs_info(struct ieee80211_hw *, char *buf, u8 sta_id);
+extern int iwl3945_fill_rs_info(struct ieee80211_hw *, char *buf, u8 sta_id);
/**
- * iwl_rate_scale_init - Initialize the rate scale table based on assoc info
+ * iwl3945_rate_scale_init - Initialize the rate scale table based on assoc info
*
* The specific throughput table used is based on the type of network
* the associated with, including A, B, G, and G w/ TGG protection
*/
-extern void iwl_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id);
+extern void iwl3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id);
/**
- * iwl_rate_control_register - Register the rate control algorithm callbacks
+ * iwl3945_rate_control_register - Register the rate control algorithm callbacks
*
* Since the rate control algorithm is hardware specific, there is no need
* or reason to place it as a stand alone module. The driver can call
- * iwl_rate_control_register in order to register the rate control callbacks
+ * iwl3945_rate_control_register in order to register the rate control callbacks
* with the mac80211 subsystem. This should be performed prior to calling
* ieee80211_register_hw
*
*/
-extern void iwl_rate_control_register(struct ieee80211_hw *hw);
+extern void iwl3945_rate_control_register(struct ieee80211_hw *hw);
/**
- * iwl_rate_control_unregister - Unregister the rate control callbacks
+ * iwl3945_rate_control_unregister - Unregister the rate control callbacks
*
* This should be called after calling ieee80211_unregister_hw, but before
* the driver is unloaded.
*/
-extern void iwl_rate_control_unregister(struct ieee80211_hw *hw);
+extern void iwl3945_rate_control_unregister(struct ieee80211_hw *hw);
#endif
* maps to IWL_RATE_INVALID
*
*/
-const struct iwl_rate_info iwl_rates[IWL_RATE_COUNT] = {
+const struct iwl3945_rate_info iwl3945_rates[IWL_RATE_COUNT] = {
IWL_DECLARE_RATE_INFO(1, INV, 2, INV, 2, INV, 2), /* 1mbps */
IWL_DECLARE_RATE_INFO(2, 1, 5, 1, 5, 1, 5), /* 2mbps */
IWL_DECLARE_RATE_INFO(5, 2, 6, 2, 11, 2, 11), /*5.5mbps */
IWL_DECLARE_RATE_INFO(54, 48, INV, 48, INV, 48, INV),/* 54mbps */
};
-/* 1 = enable the iwl_disable_events() function */
+/* 1 = enable the iwl3945_disable_events() function */
#define IWL_EVT_DISABLE (0)
#define IWL_EVT_DISABLE_SIZE (1532/32)
/**
- * iwl_disable_events - Disable selected events in uCode event log
+ * iwl3945_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).
* Use for only special debugging. This function is just a placeholder as-is,
* you'll need to provide the special bits! ...
* ... and set IWL_EVT_DISABLE to 1. */
-void iwl_disable_events(struct iwl_priv *priv)
+void iwl3945_disable_events(struct iwl3945_priv *priv)
{
int ret;
int i;
};
base = le32_to_cpu(priv->card_alive.log_event_table_ptr);
- if (!iwl_hw_valid_rtc_data_addr(base)) {
+ if (!iwl3945_hw_valid_rtc_data_addr(base)) {
IWL_ERROR("Invalid event log pointer 0x%08X\n", base);
return;
}
- ret = iwl_grab_nic_access(priv);
+ ret = iwl3945_grab_nic_access(priv);
if (ret) {
IWL_WARNING("Can not read from adapter at this time.\n");
return;
}
- disable_ptr = iwl_read_targ_mem(priv, base + (4 * sizeof(u32)));
- array_size = iwl_read_targ_mem(priv, base + (5 * sizeof(u32)));
- iwl_release_nic_access(priv);
+ disable_ptr = iwl3945_read_targ_mem(priv, base + (4 * sizeof(u32)));
+ array_size = iwl3945_read_targ_mem(priv, base + (5 * sizeof(u32)));
+ iwl3945_release_nic_access(priv);
if (IWL_EVT_DISABLE && (array_size == IWL_EVT_DISABLE_SIZE)) {
IWL_DEBUG_INFO("Disabling selected uCode log events at 0x%x\n",
disable_ptr);
- ret = iwl_grab_nic_access(priv);
+ ret = iwl3945_grab_nic_access(priv);
for (i = 0; i < IWL_EVT_DISABLE_SIZE; i++)
- iwl_write_targ_mem(priv,
+ iwl3945_write_targ_mem(priv,
disable_ptr + (i * sizeof(u32)),
evt_disable[i]);
- iwl_release_nic_access(priv);
+ iwl3945_release_nic_access(priv);
} else {
IWL_DEBUG_INFO("Selected uCode log events may be disabled\n");
IWL_DEBUG_INFO(" by writing \"1\"s into disable bitmap\n");
* IWL_ANTENNA_MAIN - Force MAIN antenna
* IWL_ANTENNA_AUX - Force AUX antenna
*/
-__le32 iwl3945_get_antenna_flags(const struct iwl_priv *priv)
+__le32 iwl3945_get_antenna_flags(const struct iwl3945_priv *priv)
{
switch (priv->antenna) {
case IWL_ANTENNA_DIVERSITY:
*
*****************************************************************************/
-void iwl_hw_rx_statistics(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
+void iwl3945_hw_rx_statistics(struct iwl3945_priv *priv, struct iwl3945_rx_mem_buffer *rxb)
{
- struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
+ struct iwl3945_rx_packet *pkt = (void *)rxb->skb->data;
IWL_DEBUG_RX("Statistics notification received (%d vs %d).\n",
- (int)sizeof(struct iwl_notif_statistics),
+ (int)sizeof(struct iwl3945_notif_statistics),
le32_to_cpu(pkt->len));
memcpy(&priv->statistics, pkt->u.raw, sizeof(priv->statistics));
priv->last_statistics_time = jiffies;
}
-static void iwl3945_handle_data_packet(struct iwl_priv *priv, int is_data,
- struct iwl_rx_mem_buffer *rxb,
+static void iwl3945_handle_data_packet(struct iwl3945_priv *priv, int is_data,
+ struct iwl3945_rx_mem_buffer *rxb,
struct ieee80211_rx_status *stats,
u16 phy_flags)
{
struct ieee80211_hdr *hdr;
- struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
- struct iwl_rx_frame_hdr *rx_hdr = IWL_RX_HDR(pkt);
- struct iwl_rx_frame_end *rx_end = IWL_RX_END(pkt);
+ struct iwl3945_rx_packet *pkt = (struct iwl3945_rx_packet *)rxb->skb->data;
+ struct iwl3945_rx_frame_hdr *rx_hdr = IWL_RX_HDR(pkt);
+ struct iwl3945_rx_frame_end *rx_end = IWL_RX_END(pkt);
short len = le16_to_cpu(rx_hdr->len);
/* We received data from the HW, so stop the watchdog */
return;
}
if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) {
- if (iwl_param_hwcrypto)
- iwl_set_decrypted_flag(priv, rxb->skb,
+ if (iwl3945_param_hwcrypto)
+ iwl3945_set_decrypted_flag(priv, rxb->skb,
le32_to_cpu(rx_end->status),
stats);
- iwl_handle_data_packet_monitor(priv, rxb, IWL_RX_DATA(pkt),
+ iwl3945_handle_data_packet_monitor(priv, rxb, IWL_RX_DATA(pkt),
len, stats, phy_flags);
return;
}
hdr = (void *)rxb->skb->data;
- if (iwl_param_hwcrypto)
- iwl_set_decrypted_flag(priv, rxb->skb,
+ if (iwl3945_param_hwcrypto)
+ iwl3945_set_decrypted_flag(priv, rxb->skb,
le32_to_cpu(rx_end->status), stats);
ieee80211_rx_irqsafe(priv->hw, rxb->skb, stats);
rxb->skb = NULL;
}
-static void iwl3945_rx_reply_rx(struct iwl_priv *priv,
- struct iwl_rx_mem_buffer *rxb)
+static void iwl3945_rx_reply_rx(struct iwl3945_priv *priv,
+ struct iwl3945_rx_mem_buffer *rxb)
{
- struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
- struct iwl_rx_frame_stats *rx_stats = IWL_RX_STATS(pkt);
- struct iwl_rx_frame_hdr *rx_hdr = IWL_RX_HDR(pkt);
- struct iwl_rx_frame_end *rx_end = IWL_RX_END(pkt);
+ struct iwl3945_rx_packet *pkt = (void *)rxb->skb->data;
+ struct iwl3945_rx_frame_stats *rx_stats = IWL_RX_STATS(pkt);
+ struct iwl3945_rx_frame_hdr *rx_hdr = IWL_RX_HDR(pkt);
+ struct iwl3945_rx_frame_end *rx_end = IWL_RX_END(pkt);
struct ieee80211_hdr *header;
u16 phy_flags = le16_to_cpu(rx_hdr->phy_flags);
u16 rx_stats_sig_avg = le16_to_cpu(rx_stats->sig_avg);
* Calculate stats.signal (quality indicator in %) based on SNR. */
if (rx_stats_noise_diff) {
snr = rx_stats_sig_avg / rx_stats_noise_diff;
- stats.noise = stats.ssi - iwl_calc_db_from_ratio(snr);
- stats.signal = iwl_calc_sig_qual(stats.ssi, stats.noise);
+ stats.noise = stats.ssi - iwl3945_calc_db_from_ratio(snr);
+ stats.signal = iwl3945_calc_sig_qual(stats.ssi, stats.noise);
/* If noise info not available, calculate signal quality indicator (%)
* using just the dBm signal level. */
} else {
stats.noise = priv->last_rx_noise;
- stats.signal = iwl_calc_sig_qual(stats.ssi, 0);
+ stats.signal = iwl3945_calc_sig_qual(stats.ssi, 0);
}
stats.freq = ieee80211chan2mhz(stats.channel);
- /* can be covered by iwl_report_frame() in most cases */
+ /* can be covered by iwl3945_report_frame() in most cases */
/* IWL_DEBUG_RX("RX status: 0x%08X\n", rx_end->status); */
header = (struct ieee80211_hdr *)IWL_RX_DATA(pkt);
- network_packet = iwl_is_network_packet(priv, header);
+ network_packet = iwl3945_is_network_packet(priv, header);
#ifdef CONFIG_IWL3945_DEBUG
- if (iwl_debug_level & IWL_DL_STATS && net_ratelimit())
+ if (iwl3945_debug_level & IWL_DL_STATS && net_ratelimit())
IWL_DEBUG_STATS
("[%c] %d RSSI: %d Signal: %u, Noise: %u, Rate: %u\n",
network_packet ? '*' : ' ',
stats.channel, stats.ssi, stats.ssi,
stats.ssi, stats.rate);
- if (iwl_debug_level & (IWL_DL_RX))
+ if (iwl3945_debug_level & (IWL_DL_RX))
/* Set "1" to report good data frames in groups of 100 */
- iwl_report_frame(priv, pkt, header, 1);
+ iwl3945_report_frame(priv, pkt, header, 1);
#endif
if (network_packet) {
DECLARE_MAC_BUF(mac2);
DECLARE_MAC_BUF(mac3);
- if (unlikely(is_duplicate_packet(priv, header)))
+ if (unlikely(iwl3945_is_duplicate_packet(priv, header)))
IWL_DEBUG_DROP("Dropping (dup): %s, %s, %s\n",
print_mac(mac1, header->addr1),
print_mac(mac2, header->addr2),
}
}
-int iwl_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv, void *ptr,
+int iwl3945_hw_txq_attach_buf_to_tfd(struct iwl3945_priv *priv, void *ptr,
dma_addr_t addr, u16 len)
{
int count;
u32 pad;
- struct iwl_tfd_frame *tfd = (struct iwl_tfd_frame *)ptr;
+ struct iwl3945_tfd_frame *tfd = (struct iwl3945_tfd_frame *)ptr;
count = TFD_CTL_COUNT_GET(le32_to_cpu(tfd->control_flags));
pad = TFD_CTL_PAD_GET(le32_to_cpu(tfd->control_flags));
}
/**
- * iwl_hw_txq_free_tfd - Free one TFD, those at index [txq->q.read_ptr]
+ * iwl3945_hw_txq_free_tfd - Free one TFD, those at index [txq->q.read_ptr]
*
* Does NOT advance any indexes
*/
-int iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
+int iwl3945_hw_txq_free_tfd(struct iwl3945_priv *priv, struct iwl3945_tx_queue *txq)
{
- struct iwl_tfd_frame *bd_tmp = (struct iwl_tfd_frame *)&txq->bd[0];
- struct iwl_tfd_frame *bd = &bd_tmp[txq->q.read_ptr];
+ struct iwl3945_tfd_frame *bd_tmp = (struct iwl3945_tfd_frame *)&txq->bd[0];
+ struct iwl3945_tfd_frame *bd = &bd_tmp[txq->q.read_ptr];
struct pci_dev *dev = priv->pci_dev;
int i;
int counter;
return 0;
}
-u8 iwl_hw_find_station(struct iwl_priv *priv, const u8 *addr)
+u8 iwl3945_hw_find_station(struct iwl3945_priv *priv, const u8 *addr)
{
int i;
int ret = IWL_INVALID_STATION;
}
/**
- * iwl_hw_build_tx_cmd_rate - Add rate portion to TX_CMD:
+ * iwl3945_hw_build_tx_cmd_rate - Add rate portion to TX_CMD:
*
*/
-void iwl_hw_build_tx_cmd_rate(struct iwl_priv *priv,
- struct iwl_cmd *cmd,
+void iwl3945_hw_build_tx_cmd_rate(struct iwl3945_priv *priv,
+ struct iwl3945_cmd *cmd,
struct ieee80211_tx_control *ctrl,
struct ieee80211_hdr *hdr, int sta_id, int tx_id)
{
__le32 tx_flags;
u16 fc = le16_to_cpu(hdr->frame_control);
- rate = iwl_rates[rate_index].plcp;
+ rate = iwl3945_rates[rate_index].plcp;
tx_flags = cmd->cmd.tx.tx_flags;
/* We need to figure out how to get the sta->supp_rates while
cmd->cmd.tx.supp_rates[1], cmd->cmd.tx.supp_rates[0]);
}
-u8 iwl3945_sync_sta(struct iwl_priv *priv, int sta_id, u16 tx_rate, u8 flags)
+u8 iwl3945_sync_sta(struct iwl3945_priv *priv, int sta_id, u16 tx_rate, u8 flags)
{
unsigned long flags_spin;
- struct iwl_station_entry *station;
+ struct iwl3945_station_entry *station;
if (sta_id == IWL_INVALID_STATION)
return IWL_INVALID_STATION;
spin_unlock_irqrestore(&priv->sta_lock, flags_spin);
- iwl_send_add_station(priv, &station->sta, flags);
+ iwl3945_send_add_station(priv, &station->sta, flags);
IWL_DEBUG_RATE("SCALE sync station %d to rate %d\n",
sta_id, tx_rate);
return sta_id;
}
-static int iwl3945_nic_set_pwr_src(struct iwl_priv *priv, int pwr_max)
+static int iwl3945_nic_set_pwr_src(struct iwl3945_priv *priv, int pwr_max)
{
int rc;
unsigned long flags;
spin_lock_irqsave(&priv->lock, flags);
- rc = iwl_grab_nic_access(priv);
+ rc = iwl3945_grab_nic_access(priv);
if (rc) {
spin_unlock_irqrestore(&priv->lock, flags);
return rc;
rc = pci_read_config_dword(priv->pci_dev,
PCI_POWER_SOURCE, &val);
if (val & PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT) {
- iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG,
+ iwl3945_set_bits_mask_prph(priv, APMG_PS_CTRL_REG,
APMG_PS_CTRL_VAL_PWR_SRC_VAUX,
~APMG_PS_CTRL_MSK_PWR_SRC);
- iwl_release_nic_access(priv);
+ iwl3945_release_nic_access(priv);
- iwl_poll_bit(priv, CSR_GPIO_IN,
+ iwl3945_poll_bit(priv, CSR_GPIO_IN,
CSR_GPIO_IN_VAL_VAUX_PWR_SRC,
CSR_GPIO_IN_BIT_AUX_POWER, 5000);
} else
- iwl_release_nic_access(priv);
+ iwl3945_release_nic_access(priv);
} else {
- iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG,
+ iwl3945_set_bits_mask_prph(priv, APMG_PS_CTRL_REG,
APMG_PS_CTRL_VAL_PWR_SRC_VMAIN,
~APMG_PS_CTRL_MSK_PWR_SRC);
- iwl_release_nic_access(priv);
- iwl_poll_bit(priv, CSR_GPIO_IN, CSR_GPIO_IN_VAL_VMAIN_PWR_SRC,
+ iwl3945_release_nic_access(priv);
+ iwl3945_poll_bit(priv, CSR_GPIO_IN, CSR_GPIO_IN_VAL_VMAIN_PWR_SRC,
CSR_GPIO_IN_BIT_AUX_POWER, 5000); /* uS */
}
spin_unlock_irqrestore(&priv->lock, flags);
return rc;
}
-static int iwl3945_rx_init(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
+static int iwl3945_rx_init(struct iwl3945_priv *priv, struct iwl3945_rx_queue *rxq)
{
int rc;
unsigned long flags;
spin_lock_irqsave(&priv->lock, flags);
- rc = iwl_grab_nic_access(priv);
+ rc = iwl3945_grab_nic_access(priv);
if (rc) {
spin_unlock_irqrestore(&priv->lock, flags);
return rc;
}
- iwl_write_direct32(priv, FH_RCSR_RBD_BASE(0), rxq->dma_addr);
- iwl_write_direct32(priv, FH_RCSR_RPTR_ADDR(0),
+ iwl3945_write_direct32(priv, FH_RCSR_RBD_BASE(0), rxq->dma_addr);
+ iwl3945_write_direct32(priv, FH_RCSR_RPTR_ADDR(0),
priv->hw_setting.shared_phys +
- offsetof(struct iwl_shared, rx_read_ptr[0]));
- iwl_write_direct32(priv, FH_RCSR_WPTR(0), 0);
- iwl_write_direct32(priv, FH_RCSR_CONFIG(0),
+ offsetof(struct iwl3945_shared, rx_read_ptr[0]));
+ iwl3945_write_direct32(priv, FH_RCSR_WPTR(0), 0);
+ iwl3945_write_direct32(priv, FH_RCSR_CONFIG(0),
ALM_FH_RCSR_RX_CONFIG_REG_VAL_DMA_CHNL_EN_ENABLE |
ALM_FH_RCSR_RX_CONFIG_REG_VAL_RDRBD_EN_ENABLE |
ALM_FH_RCSR_RX_CONFIG_REG_BIT_WR_STTS_EN |
ALM_FH_RCSR_RX_CONFIG_REG_VAL_MSG_MODE_FH);
/* fake read to flush all prev I/O */
- iwl_read_direct32(priv, FH_RSSR_CTRL);
+ iwl3945_read_direct32(priv, FH_RSSR_CTRL);
- iwl_release_nic_access(priv);
+ iwl3945_release_nic_access(priv);
spin_unlock_irqrestore(&priv->lock, flags);
return 0;
}
-static int iwl3945_tx_reset(struct iwl_priv *priv)
+static int iwl3945_tx_reset(struct iwl3945_priv *priv)
{
int rc;
unsigned long flags;
spin_lock_irqsave(&priv->lock, flags);
- rc = iwl_grab_nic_access(priv);
+ rc = iwl3945_grab_nic_access(priv);
if (rc) {
spin_unlock_irqrestore(&priv->lock, flags);
return rc;
}
/* bypass mode */
- iwl_write_prph(priv, ALM_SCD_MODE_REG, 0x2);
+ iwl3945_write_prph(priv, ALM_SCD_MODE_REG, 0x2);
/* RA 0 is active */
- iwl_write_prph(priv, ALM_SCD_ARASTAT_REG, 0x01);
+ iwl3945_write_prph(priv, ALM_SCD_ARASTAT_REG, 0x01);
/* all 6 fifo are active */
- iwl_write_prph(priv, ALM_SCD_TXFACT_REG, 0x3f);
+ iwl3945_write_prph(priv, ALM_SCD_TXFACT_REG, 0x3f);
- iwl_write_prph(priv, ALM_SCD_SBYP_MODE_1_REG, 0x010000);
- iwl_write_prph(priv, ALM_SCD_SBYP_MODE_2_REG, 0x030002);
- iwl_write_prph(priv, ALM_SCD_TXF4MF_REG, 0x000004);
- iwl_write_prph(priv, ALM_SCD_TXF5MF_REG, 0x000005);
+ iwl3945_write_prph(priv, ALM_SCD_SBYP_MODE_1_REG, 0x010000);
+ iwl3945_write_prph(priv, ALM_SCD_SBYP_MODE_2_REG, 0x030002);
+ iwl3945_write_prph(priv, ALM_SCD_TXF4MF_REG, 0x000004);
+ iwl3945_write_prph(priv, ALM_SCD_TXF5MF_REG, 0x000005);
- iwl_write_direct32(priv, FH_TSSR_CBB_BASE,
+ iwl3945_write_direct32(priv, FH_TSSR_CBB_BASE,
priv->hw_setting.shared_phys);
- iwl_write_direct32(priv, FH_TSSR_MSG_CONFIG,
+ iwl3945_write_direct32(priv, FH_TSSR_MSG_CONFIG,
ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TXPD_ON |
ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_TXPD_ON |
ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_MAX_FRAG_SIZE_128B |
ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RSP_WAIT_TH |
ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_RSP_WAIT_TH);
- iwl_release_nic_access(priv);
+ iwl3945_release_nic_access(priv);
spin_unlock_irqrestore(&priv->lock, flags);
return 0;
*
* Destroys all DMA structures and initialize them again
*/
-static int iwl3945_txq_ctx_reset(struct iwl_priv *priv)
+static int iwl3945_txq_ctx_reset(struct iwl3945_priv *priv)
{
int rc;
int txq_id, slots_num;
- iwl_hw_txq_ctx_free(priv);
+ iwl3945_hw_txq_ctx_free(priv);
/* Tx CMD queue */
rc = iwl3945_tx_reset(priv);
for (txq_id = 0; txq_id < TFD_QUEUE_MAX; txq_id++) {
slots_num = (txq_id == IWL_CMD_QUEUE_NUM) ?
TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS;
- rc = iwl_tx_queue_init(priv, &priv->txq[txq_id], slots_num,
+ rc = iwl3945_tx_queue_init(priv, &priv->txq[txq_id], slots_num,
txq_id);
if (rc) {
IWL_ERROR("Tx %d queue init failed\n", txq_id);
return rc;
error:
- iwl_hw_txq_ctx_free(priv);
+ iwl3945_hw_txq_ctx_free(priv);
return rc;
}
-int iwl_hw_nic_init(struct iwl_priv *priv)
+int iwl3945_hw_nic_init(struct iwl3945_priv *priv)
{
u8 rev_id;
int rc;
unsigned long flags;
- struct iwl_rx_queue *rxq = &priv->rxq;
+ struct iwl3945_rx_queue *rxq = &priv->rxq;
- iwl_power_init_handle(priv);
+ iwl3945_power_init_handle(priv);
spin_lock_irqsave(&priv->lock, flags);
- iwl_set_bit(priv, CSR_ANA_PLL_CFG, (1 << 24));
- iwl_set_bit(priv, CSR_GIO_CHICKEN_BITS,
+ iwl3945_set_bit(priv, CSR_ANA_PLL_CFG, (1 << 24));
+ iwl3945_set_bit(priv, CSR_GIO_CHICKEN_BITS,
CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX);
- iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
- rc = iwl_poll_bit(priv, CSR_GP_CNTRL,
+ iwl3945_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
+ rc = iwl3945_poll_bit(priv, CSR_GP_CNTRL,
CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
if (rc < 0) {
return rc;
}
- rc = iwl_grab_nic_access(priv);
+ rc = iwl3945_grab_nic_access(priv);
if (rc) {
spin_unlock_irqrestore(&priv->lock, flags);
return rc;
}
- iwl_write_prph(priv, APMG_CLK_EN_REG,
+ iwl3945_write_prph(priv, APMG_CLK_EN_REG,
APMG_CLK_VAL_DMA_CLK_RQT |
APMG_CLK_VAL_BSM_CLK_RQT);
udelay(20);
- iwl_set_bits_prph(priv, APMG_PCIDEV_STT_REG,
+ iwl3945_set_bits_prph(priv, APMG_PCIDEV_STT_REG,
APMG_PCIDEV_STT_VAL_L1_ACT_DIS);
- iwl_release_nic_access(priv);
+ iwl3945_release_nic_access(priv);
spin_unlock_irqrestore(&priv->lock, flags);
/* Determine HW type */
IWL_DEBUG_INFO("RTP type \n");
else if (rev_id & PCI_CFG_REV_ID_BIT_BASIC_SKU) {
IWL_DEBUG_INFO("ALM-MB type\n");
- iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
+ iwl3945_set_bit(priv, CSR_HW_IF_CONFIG_REG,
CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MB);
} else {
IWL_DEBUG_INFO("ALM-MM type\n");
- iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
+ iwl3945_set_bit(priv, CSR_HW_IF_CONFIG_REG,
CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MM);
}
spin_unlock_irqrestore(&priv->lock, flags);
/* Initialize the EEPROM */
- rc = iwl_eeprom_init(priv);
+ rc = iwl3945_eeprom_init(priv);
if (rc)
return rc;
spin_lock_irqsave(&priv->lock, flags);
if (EEPROM_SKU_CAP_OP_MODE_MRC == priv->eeprom.sku_cap) {
IWL_DEBUG_INFO("SKU OP mode is mrc\n");
- iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
+ iwl3945_set_bit(priv, CSR_HW_IF_CONFIG_REG,
CSR_HW_IF_CONFIG_REG_BIT_SKU_MRC);
} else
IWL_DEBUG_INFO("SKU OP mode is basic\n");
if ((priv->eeprom.board_revision & 0xF0) == 0xD0) {
IWL_DEBUG_INFO("3945ABG revision is 0x%X\n",
priv->eeprom.board_revision);
- iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
+ iwl3945_set_bit(priv, CSR_HW_IF_CONFIG_REG,
CSR_HW_IF_CONFIG_REG_BIT_BOARD_TYPE);
} else {
IWL_DEBUG_INFO("3945ABG revision is 0x%X\n",
priv->eeprom.board_revision);
- iwl_clear_bit(priv, CSR_HW_IF_CONFIG_REG,
+ iwl3945_clear_bit(priv, CSR_HW_IF_CONFIG_REG,
CSR_HW_IF_CONFIG_REG_BIT_BOARD_TYPE);
}
if (priv->eeprom.almgor_m_version <= 1) {
- iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
+ iwl3945_set_bit(priv, CSR_HW_IF_CONFIG_REG,
CSR_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_A);
IWL_DEBUG_INFO("Card M type A version is 0x%X\n",
priv->eeprom.almgor_m_version);
} else {
IWL_DEBUG_INFO("Card M type B version is 0x%X\n",
priv->eeprom.almgor_m_version);
- iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
+ iwl3945_set_bit(priv, CSR_HW_IF_CONFIG_REG,
CSR_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_B);
}
spin_unlock_irqrestore(&priv->lock, flags);
/* Allocate the RX queue, or reset if it is already allocated */
if (!rxq->bd) {
- rc = iwl_rx_queue_alloc(priv);
+ rc = iwl3945_rx_queue_alloc(priv);
if (rc) {
IWL_ERROR("Unable to initialize Rx queue\n");
return -ENOMEM;
}
} else
- iwl_rx_queue_reset(priv, rxq);
+ iwl3945_rx_queue_reset(priv, rxq);
- iwl_rx_replenish(priv);
+ iwl3945_rx_replenish(priv);
iwl3945_rx_init(priv, rxq);
/* Look at using this instead:
rxq->need_update = 1;
- iwl_rx_queue_update_write_ptr(priv, rxq);
+ iwl3945_rx_queue_update_write_ptr(priv, rxq);
*/
- rc = iwl_grab_nic_access(priv);
+ rc = iwl3945_grab_nic_access(priv);
if (rc) {
spin_unlock_irqrestore(&priv->lock, flags);
return rc;
}
- iwl_write_direct32(priv, FH_RCSR_WPTR(0), rxq->write & ~7);
- iwl_release_nic_access(priv);
+ iwl3945_write_direct32(priv, FH_RCSR_WPTR(0), rxq->write & ~7);
+ iwl3945_release_nic_access(priv);
spin_unlock_irqrestore(&priv->lock, flags);
}
/**
- * iwl_hw_txq_ctx_free - Free TXQ Context
+ * iwl3945_hw_txq_ctx_free - Free TXQ Context
*
* Destroy all TX DMA queues and structures
*/
-void iwl_hw_txq_ctx_free(struct iwl_priv *priv)
+void iwl3945_hw_txq_ctx_free(struct iwl3945_priv *priv)
{
int txq_id;
/* Tx queues */
for (txq_id = 0; txq_id < TFD_QUEUE_MAX; txq_id++)
- iwl_tx_queue_free(priv, &priv->txq[txq_id]);
+ iwl3945_tx_queue_free(priv, &priv->txq[txq_id]);
}
-void iwl_hw_txq_ctx_stop(struct iwl_priv *priv)
+void iwl3945_hw_txq_ctx_stop(struct iwl3945_priv *priv)
{
int queue;
unsigned long flags;
spin_lock_irqsave(&priv->lock, flags);
- if (iwl_grab_nic_access(priv)) {
+ if (iwl3945_grab_nic_access(priv)) {
spin_unlock_irqrestore(&priv->lock, flags);
- iwl_hw_txq_ctx_free(priv);
+ iwl3945_hw_txq_ctx_free(priv);
return;
}
/* stop SCD */
- iwl_write_prph(priv, ALM_SCD_MODE_REG, 0);
+ iwl3945_write_prph(priv, ALM_SCD_MODE_REG, 0);
/* reset TFD queues */
for (queue = TFD_QUEUE_MIN; queue < TFD_QUEUE_MAX; queue++) {
- iwl_write_direct32(priv, FH_TCSR_CONFIG(queue), 0x0);
- iwl_poll_direct_bit(priv, FH_TSSR_TX_STATUS,
+ iwl3945_write_direct32(priv, FH_TCSR_CONFIG(queue), 0x0);
+ iwl3945_poll_direct_bit(priv, FH_TSSR_TX_STATUS,
ALM_FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(queue),
1000);
}
- iwl_release_nic_access(priv);
+ iwl3945_release_nic_access(priv);
spin_unlock_irqrestore(&priv->lock, flags);
- iwl_hw_txq_ctx_free(priv);
+ iwl3945_hw_txq_ctx_free(priv);
}
-int iwl_hw_nic_stop_master(struct iwl_priv *priv)
+int iwl3945_hw_nic_stop_master(struct iwl3945_priv *priv)
{
int rc = 0;
u32 reg_val;
spin_lock_irqsave(&priv->lock, flags);
/* set stop master bit */
- iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_STOP_MASTER);
+ iwl3945_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_STOP_MASTER);
- reg_val = iwl_read32(priv, CSR_GP_CNTRL);
+ reg_val = iwl3945_read32(priv, CSR_GP_CNTRL);
if (CSR_GP_CNTRL_REG_FLAG_MAC_POWER_SAVE ==
(reg_val & CSR_GP_CNTRL_REG_MSK_POWER_SAVE_TYPE))
IWL_DEBUG_INFO("Card in power save, master is already "
"stopped\n");
else {
- rc = iwl_poll_bit(priv, CSR_RESET,
+ rc = iwl3945_poll_bit(priv, CSR_RESET,
CSR_RESET_REG_FLAG_MASTER_DISABLED,
CSR_RESET_REG_FLAG_MASTER_DISABLED, 100);
if (rc < 0) {
return rc;
}
-int iwl_hw_nic_reset(struct iwl_priv *priv)
+int iwl3945_hw_nic_reset(struct iwl3945_priv *priv)
{
int rc;
unsigned long flags;
- iwl_hw_nic_stop_master(priv);
+ iwl3945_hw_nic_stop_master(priv);
spin_lock_irqsave(&priv->lock, flags);
- iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);
+ iwl3945_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);
- rc = iwl_poll_bit(priv, CSR_GP_CNTRL,
+ rc = iwl3945_poll_bit(priv, CSR_GP_CNTRL,
CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
- rc = iwl_grab_nic_access(priv);
+ rc = iwl3945_grab_nic_access(priv);
if (!rc) {
- iwl_write_prph(priv, APMG_CLK_CTRL_REG,
+ iwl3945_write_prph(priv, APMG_CLK_CTRL_REG,
APMG_CLK_VAL_BSM_CLK_RQT);
udelay(10);
- iwl_set_bit(priv, CSR_GP_CNTRL,
+ iwl3945_set_bit(priv, CSR_GP_CNTRL,
CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
- iwl_write_prph(priv, APMG_RTC_INT_MSK_REG, 0x0);
- iwl_write_prph(priv, APMG_RTC_INT_STT_REG,
+ iwl3945_write_prph(priv, APMG_RTC_INT_MSK_REG, 0x0);
+ iwl3945_write_prph(priv, APMG_RTC_INT_STT_REG,
0xFFFFFFFF);
/* enable DMA */
- iwl_write_prph(priv, APMG_CLK_EN_REG,
+ iwl3945_write_prph(priv, APMG_CLK_EN_REG,
APMG_CLK_VAL_DMA_CLK_RQT |
APMG_CLK_VAL_BSM_CLK_RQT);
udelay(10);
- iwl_set_bits_prph(priv, APMG_PS_CTRL_REG,
+ iwl3945_set_bits_prph(priv, APMG_PS_CTRL_REG,
APMG_PS_CTRL_VAL_RESET_REQ);
udelay(5);
- iwl_clear_bits_prph(priv, APMG_PS_CTRL_REG,
+ iwl3945_clear_bits_prph(priv, APMG_PS_CTRL_REG,
APMG_PS_CTRL_VAL_RESET_REQ);
- iwl_release_nic_access(priv);
+ iwl3945_release_nic_access(priv);
}
/* Clear the 'host command active' bit... */
}
/**
- * iwl_hw_reg_adjust_power_by_temp
+ * iwl3945_hw_reg_adjust_power_by_temp
* return index delta into power gain settings table
*/
-static int iwl_hw_reg_adjust_power_by_temp(int new_reading, int old_reading)
+static int iwl3945_hw_reg_adjust_power_by_temp(int new_reading, int old_reading)
{
return (new_reading - old_reading) * (-11) / 100;
}
/**
- * iwl_hw_reg_temp_out_of_range - Keep temperature in sane range
+ * iwl3945_hw_reg_temp_out_of_range - Keep temperature in sane range
*/
-static inline int iwl_hw_reg_temp_out_of_range(int temperature)
+static inline int iwl3945_hw_reg_temp_out_of_range(int temperature)
{
return (((temperature < -260) || (temperature > 25)) ? 1 : 0);
}
-int iwl_hw_get_temperature(struct iwl_priv *priv)
+int iwl3945_hw_get_temperature(struct iwl3945_priv *priv)
{
- return iwl_read32(priv, CSR_UCODE_DRV_GP2);
+ return iwl3945_read32(priv, CSR_UCODE_DRV_GP2);
}
/**
- * iwl_hw_reg_txpower_get_temperature
+ * iwl3945_hw_reg_txpower_get_temperature
* get the current temperature by reading from NIC
*/
-static int iwl_hw_reg_txpower_get_temperature(struct iwl_priv *priv)
+static int iwl3945_hw_reg_txpower_get_temperature(struct iwl3945_priv *priv)
{
int temperature;
- temperature = iwl_hw_get_temperature(priv);
+ temperature = iwl3945_hw_get_temperature(priv);
/* driver's okay range is -260 to +25.
* human readable okay range is 0 to +285 */
IWL_DEBUG_INFO("Temperature: %d\n", temperature + IWL_TEMP_CONVERT);
/* handle insane temp reading */
- if (iwl_hw_reg_temp_out_of_range(temperature)) {
+ if (iwl3945_hw_reg_temp_out_of_range(temperature)) {
IWL_ERROR("Error bad temperature value %d\n", temperature);
/* if really really hot(?),
* records new temperature in tx_mgr->temperature.
* replaces tx_mgr->last_temperature *only* if calib needed
* (assumes caller will actually do the calibration!). */
-static int is_temp_calib_needed(struct iwl_priv *priv)
+static int is_temp_calib_needed(struct iwl3945_priv *priv)
{
int temp_diff;
- priv->temperature = iwl_hw_reg_txpower_get_temperature(priv);
+ priv->temperature = iwl3945_hw_reg_txpower_get_temperature(priv);
temp_diff = priv->temperature - priv->last_temperature;
/* get absolute value */
/* radio and DSP power table, each step is 1/2 dB.
* 1st number is for RF analog gain, 2nd number is for DSP pre-DAC gain. */
-static struct iwl_tx_power power_gain_table[2][IWL_MAX_GAIN_ENTRIES] = {
+static struct iwl3945_tx_power power_gain_table[2][IWL_MAX_GAIN_ENTRIES] = {
{
{251, 127}, /* 2.4 GHz, highest power */
{251, 127},
{3, 120} } /* 5.x GHz, lowest power */
};
-static inline u8 iwl_hw_reg_fix_power_index(int index)
+static inline u8 iwl3945_hw_reg_fix_power_index(int index)
{
if (index < 0)
return 0;
#define REG_RECALIB_PERIOD (60)
/**
- * iwl_hw_reg_set_scan_power - Set Tx power for scan probe requests
+ * iwl3945_hw_reg_set_scan_power - Set Tx power for scan probe requests
*
* Set (in our channel info database) the direct scan Tx power for 1 Mbit (CCK)
* or 6 Mbit (OFDM) rates.
*/
-static void iwl_hw_reg_set_scan_power(struct iwl_priv *priv, u32 scan_tbl_index,
+static void iwl3945_hw_reg_set_scan_power(struct iwl3945_priv *priv, u32 scan_tbl_index,
s32 rate_index, const s8 *clip_pwrs,
- struct iwl_channel_info *ch_info,
+ struct iwl3945_channel_info *ch_info,
int band_index)
{
- struct iwl_scan_power_info *scan_power_info;
+ struct iwl3945_scan_power_info *scan_power_info;
s8 power;
u8 power_index;
* of the table. */
/* don't exceed table bounds for "real" setting */
- power_index = iwl_hw_reg_fix_power_index(power_index);
+ power_index = iwl3945_hw_reg_fix_power_index(power_index);
scan_power_info->power_table_index = power_index;
scan_power_info->tpc.tx_gain =
}
/**
- * iwl_hw_reg_send_txpower - fill in Tx Power command with gain settings
+ * iwl3945_hw_reg_send_txpower - fill in Tx Power command with gain settings
*
* Configures power settings for all rates for the current channel,
* using values from channel info struct, and send to NIC
*/
-int iwl_hw_reg_send_txpower(struct iwl_priv *priv)
+int iwl3945_hw_reg_send_txpower(struct iwl3945_priv *priv)
{
int rate_idx, i;
- const struct iwl_channel_info *ch_info = NULL;
- struct iwl_txpowertable_cmd txpower = {
+ const struct iwl3945_channel_info *ch_info = NULL;
+ struct iwl3945_txpowertable_cmd txpower = {
.channel = priv->active_rxon.channel,
};
txpower.band = (priv->phymode == MODE_IEEE80211A) ? 0 : 1;
- ch_info = iwl_get_channel_info(priv,
+ ch_info = iwl3945_get_channel_info(priv,
priv->phymode,
le16_to_cpu(priv->active_rxon.channel));
if (!ch_info) {
rate_idx <= IWL_LAST_OFDM_RATE; rate_idx++, i++) {
txpower.power[i].tpc = ch_info->power_info[i].tpc;
- txpower.power[i].rate = iwl_rates[rate_idx].plcp;
+ txpower.power[i].rate = iwl3945_rates[rate_idx].plcp;
IWL_DEBUG_POWER("ch %d:%d rf %d dsp %3d rate code 0x%02x\n",
le16_to_cpu(txpower.channel),
for (rate_idx = IWL_FIRST_CCK_RATE;
rate_idx <= IWL_LAST_CCK_RATE; rate_idx++, i++) {
txpower.power[i].tpc = ch_info->power_info[i].tpc;
- txpower.power[i].rate = iwl_rates[rate_idx].plcp;
+ txpower.power[i].rate = iwl3945_rates[rate_idx].plcp;
IWL_DEBUG_POWER("ch %d:%d rf %d dsp %3d rate code 0x%02x\n",
le16_to_cpu(txpower.channel),
txpower.power[i].rate);
}
- return iwl_send_cmd_pdu(priv, REPLY_TX_PWR_TABLE_CMD,
- sizeof(struct iwl_txpowertable_cmd), &txpower);
+ return iwl3945_send_cmd_pdu(priv, REPLY_TX_PWR_TABLE_CMD,
+ sizeof(struct iwl3945_txpowertable_cmd), &txpower);
}
/**
- * iwl_hw_reg_set_new_power - Configures power tables at new levels
+ * iwl3945_hw_reg_set_new_power - Configures power tables at new levels
* @ch_info: Channel to update. Uses power_info.requested_power.
*
* Replace requested_power and base_power_index ch_info fields for
* properly fill out the scan powers, and actual h/w gain settings,
* and send changes to NIC
*/
-static int iwl_hw_reg_set_new_power(struct iwl_priv *priv,
- struct iwl_channel_info *ch_info)
+static int iwl3945_hw_reg_set_new_power(struct iwl3945_priv *priv,
+ struct iwl3945_channel_info *ch_info)
{
- struct iwl_channel_power_info *power_info;
+ struct iwl3945_channel_power_info *power_info;
int power_changed = 0;
int i;
const s8 *clip_pwrs;
ch_info->power_info[IWL_RATE_12M_INDEX_TABLE].
requested_power + IWL_CCK_FROM_OFDM_POWER_DIFF;
- /* do all CCK rates' iwl_channel_power_info structures */
+ /* do all CCK rates' iwl3945_channel_power_info structures */
for (i = IWL_RATE_1M_INDEX_TABLE; i <= IWL_RATE_11M_INDEX_TABLE; i++) {
power_info->requested_power = power;
power_info->base_power_index =
}
/**
- * iwl_hw_reg_get_ch_txpower_limit - returns new power limit for channel
+ * iwl3945_hw_reg_get_ch_txpower_limit - returns new power limit for channel
*
* NOTE: Returned power limit may be less (but not more) than requested,
* based strictly on regulatory (eeprom and spectrum mgt) limitations
* (no consideration for h/w clipping limitations).
*/
-static int iwl_hw_reg_get_ch_txpower_limit(struct iwl_channel_info *ch_info)
+static int iwl3945_hw_reg_get_ch_txpower_limit(struct iwl3945_channel_info *ch_info)
{
s8 max_power;
}
/**
- * iwl_hw_reg_comp_txpower_temp - Compensate for temperature
+ * iwl3945_hw_reg_comp_txpower_temp - Compensate for temperature
*
* Compensate txpower settings of *all* channels for temperature.
* This only accounts for the difference between current temperature
*
* If RxOn is "associated", this sends the new Txpower to NIC!
*/
-static int iwl_hw_reg_comp_txpower_temp(struct iwl_priv *priv)
+static int iwl3945_hw_reg_comp_txpower_temp(struct iwl3945_priv *priv)
{
- struct iwl_channel_info *ch_info = NULL;
+ struct iwl3945_channel_info *ch_info = NULL;
int delta_index;
const s8 *clip_pwrs; /* array of h/w max power levels for each rate */
u8 a_band;
/* get power index adjustment based on curr and factory
* temps */
- delta_index = iwl_hw_reg_adjust_power_by_temp(temperature,
+ delta_index = iwl3945_hw_reg_adjust_power_by_temp(temperature,
ref_temp);
/* set tx power value for all rates, OFDM and CCK */
power_idx += delta_index;
/* stay within table range */
- power_idx = iwl_hw_reg_fix_power_index(power_idx);
+ power_idx = iwl3945_hw_reg_fix_power_index(power_idx);
ch_info->power_info[rate_index].
power_table_index = (u8) power_idx;
ch_info->power_info[rate_index].tpc =
scan_tbl_index < IWL_NUM_SCAN_RATES; scan_tbl_index++) {
s32 actual_index = (scan_tbl_index == 0) ?
IWL_RATE_1M_INDEX_TABLE : IWL_RATE_6M_INDEX_TABLE;
- iwl_hw_reg_set_scan_power(priv, scan_tbl_index,
+ iwl3945_hw_reg_set_scan_power(priv, scan_tbl_index,
actual_index, clip_pwrs,
ch_info, a_band);
}
}
/* send Txpower command for current channel to ucode */
- return iwl_hw_reg_send_txpower(priv);
+ return iwl3945_hw_reg_send_txpower(priv);
}
-int iwl_hw_reg_set_txpower(struct iwl_priv *priv, s8 power)
+int iwl3945_hw_reg_set_txpower(struct iwl3945_priv *priv, s8 power)
{
- struct iwl_channel_info *ch_info;
+ struct iwl3945_channel_info *ch_info;
s8 max_power;
u8 a_band;
u8 i;
/* find minimum power of all user and regulatory constraints
* (does not consider h/w clipping limitations) */
- max_power = iwl_hw_reg_get_ch_txpower_limit(ch_info);
+ max_power = iwl3945_hw_reg_get_ch_txpower_limit(ch_info);
max_power = min(power, max_power);
if (max_power != ch_info->curr_txpow) {
ch_info->curr_txpow = max_power;
/* this considers the h/w clipping limitations */
- iwl_hw_reg_set_new_power(priv, ch_info);
+ iwl3945_hw_reg_set_new_power(priv, ch_info);
}
}
/* update txpower settings for all channels,
* send to NIC if associated. */
is_temp_calib_needed(priv);
- iwl_hw_reg_comp_txpower_temp(priv);
+ iwl3945_hw_reg_comp_txpower_temp(priv);
return 0;
}
/* will add 3945 channel switch cmd handling later */
-int iwl_hw_channel_switch(struct iwl_priv *priv, u16 channel)
+int iwl3945_hw_channel_switch(struct iwl3945_priv *priv, u16 channel)
{
return 0;
}
* -- 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. */
-void iwl3945_reg_txpower_periodic(struct iwl_priv *priv)
+void iwl3945_reg_txpower_periodic(struct iwl3945_priv *priv)
{
/* This will kick in the "brute force"
- * iwl_hw_reg_comp_txpower_temp() below */
+ * iwl3945_hw_reg_comp_txpower_temp() below */
if (!is_temp_calib_needed(priv))
goto reschedule;
/* Set up a new set of temp-adjusted TxPowers, send to NIC.
* This is based *only* on current temperature,
* ignoring any previous power measurements */
- iwl_hw_reg_comp_txpower_temp(priv);
+ iwl3945_hw_reg_comp_txpower_temp(priv);
reschedule:
queue_delayed_work(priv->workqueue,
static void iwl3945_bg_reg_txpower_periodic(struct work_struct *work)
{
- struct iwl_priv *priv = container_of(work, struct iwl_priv,
+ struct iwl3945_priv *priv = container_of(work, struct iwl3945_priv,
thermal_periodic.work);
if (test_bit(STATUS_EXIT_PENDING, &priv->status))
}
/**
- * iwl_hw_reg_get_ch_grp_index - find the channel-group index (0-4)
+ * iwl3945_hw_reg_get_ch_grp_index - find the channel-group index (0-4)
* for the channel.
*
* This function is used when initializing channel-info structs.
* on A-band, EEPROM's "group frequency" entries represent the top
* channel in each group 1-4. Group 5 All B/G channels are in group 0.
*/
-static u16 iwl_hw_reg_get_ch_grp_index(struct iwl_priv *priv,
- const struct iwl_channel_info *ch_info)
+static u16 iwl3945_hw_reg_get_ch_grp_index(struct iwl3945_priv *priv,
+ const struct iwl3945_channel_info *ch_info)
{
- struct iwl_eeprom_txpower_group *ch_grp = &priv->eeprom.groups[0];
+ struct iwl3945_eeprom_txpower_group *ch_grp = &priv->eeprom.groups[0];
u8 group;
u16 group_index = 0; /* based on factory calib frequencies */
u8 grp_channel;
}
/**
- * iwl_hw_reg_get_matched_power_index - Interpolate to get nominal index
+ * iwl3945_hw_reg_get_matched_power_index - Interpolate to get nominal index
*
* Interpolate to get nominal (i.e. at factory calibration temperature) index
* into radio/DSP gain settings table for requested power.
*/
-static int iwl_hw_reg_get_matched_power_index(struct iwl_priv *priv,
+static int iwl3945_hw_reg_get_matched_power_index(struct iwl3945_priv *priv,
s8 requested_power,
s32 setting_index, s32 *new_index)
{
- const struct iwl_eeprom_txpower_group *chnl_grp = NULL;
+ const struct iwl3945_eeprom_txpower_group *chnl_grp = NULL;
s32 index0, index1;
s32 power = 2 * requested_power;
s32 i;
- const struct iwl_eeprom_txpower_sample *samples;
+ const struct iwl3945_eeprom_txpower_sample *samples;
s32 gains0, gains1;
s32 res;
s32 denominator;
return 0;
}
-static void iwl_hw_reg_init_channel_groups(struct iwl_priv *priv)
+static void iwl3945_hw_reg_init_channel_groups(struct iwl3945_priv *priv)
{
u32 i;
s32 rate_index;
- const struct iwl_eeprom_txpower_group *group;
+ const struct iwl3945_eeprom_txpower_group *group;
IWL_DEBUG_POWER("Initializing factory calib info from EEPROM\n");
*
* This does *not* write values to NIC, just sets up our internal table.
*/
-int iwl3945_txpower_set_from_eeprom(struct iwl_priv *priv)
+int iwl3945_txpower_set_from_eeprom(struct iwl3945_priv *priv)
{
- struct iwl_channel_info *ch_info = NULL;
- struct iwl_channel_power_info *pwr_info;
+ struct iwl3945_channel_info *ch_info = NULL;
+ struct iwl3945_channel_power_info *pwr_info;
int delta_index;
u8 rate_index;
u8 scan_tbl_index;
/* save temperature reference,
* so we can determine next time to calibrate */
- temperature = iwl_hw_reg_txpower_get_temperature(priv);
+ temperature = iwl3945_hw_reg_txpower_get_temperature(priv);
priv->last_temperature = temperature;
- iwl_hw_reg_init_channel_groups(priv);
+ iwl3945_hw_reg_init_channel_groups(priv);
/* initialize Tx power info for each and every channel, 2.4 and 5.x */
for (i = 0, ch_info = priv->channel_info; i < priv->channel_count;
/* find this channel's channel group (*not* "band") index */
ch_info->group_index =
- iwl_hw_reg_get_ch_grp_index(priv, ch_info);
+ iwl3945_hw_reg_get_ch_grp_index(priv, ch_info);
/* Get this chnlgrp's rate->max/clip-powers table */
clip_pwrs = priv->clip_groups[ch_info->group_index].clip_powers;
/* calculate power index *adjustment* value according to
* diff between current temperature and factory temperature */
- delta_index = iwl_hw_reg_adjust_power_by_temp(temperature,
+ delta_index = iwl3945_hw_reg_adjust_power_by_temp(temperature,
priv->eeprom.groups[ch_info->group_index].
temperature);
/* get base (i.e. at factory-measured temperature)
* power table index for this rate's power */
- rc = iwl_hw_reg_get_matched_power_index(priv, pwr,
+ rc = iwl3945_hw_reg_get_matched_power_index(priv, pwr,
ch_info->group_index,
&power_idx);
if (rc) {
power_idx += delta_index;
/* stay within range of gain table */
- power_idx = iwl_hw_reg_fix_power_index(power_idx);
+ power_idx = iwl3945_hw_reg_fix_power_index(power_idx);
- /* fill 1 OFDM rate's iwl_channel_power_info struct */
+ /* fill 1 OFDM rate's iwl3945_channel_power_info struct */
pwr_info->requested_power = pwr;
pwr_info->power_table_index = (u8) power_idx;
pwr_info->tpc.tx_gain =
IWL_CCK_FROM_OFDM_INDEX_DIFF;
/* stay within table range */
- pwr_index = iwl_hw_reg_fix_power_index(pwr_index);
+ pwr_index = iwl3945_hw_reg_fix_power_index(pwr_index);
gain = power_gain_table[a_band][pwr_index].tx_gain;
dsp_atten = power_gain_table[a_band][pwr_index].dsp_atten;
- /* fill each CCK rate's iwl_channel_power_info structure
+ /* fill each CCK rate's iwl3945_channel_power_info structure
* NOTE: All CCK-rate Txpwrs are the same for a given chnl!
* NOTE: CCK rates start at end of OFDM rates! */
for (rate_index = 0;
scan_tbl_index < IWL_NUM_SCAN_RATES; scan_tbl_index++) {
s32 actual_index = (scan_tbl_index == 0) ?
IWL_RATE_1M_INDEX_TABLE : IWL_RATE_6M_INDEX_TABLE;
- iwl_hw_reg_set_scan_power(priv, scan_tbl_index,
+ iwl3945_hw_reg_set_scan_power(priv, scan_tbl_index,
actual_index, clip_pwrs, ch_info, a_band);
}
}
return 0;
}
-int iwl_hw_rxq_stop(struct iwl_priv *priv)
+int iwl3945_hw_rxq_stop(struct iwl3945_priv *priv)
{
int rc;
unsigned long flags;
spin_lock_irqsave(&priv->lock, flags);
- rc = iwl_grab_nic_access(priv);
+ rc = iwl3945_grab_nic_access(priv);
if (rc) {
spin_unlock_irqrestore(&priv->lock, flags);
return rc;
}
- iwl_write_direct32(priv, FH_RCSR_CONFIG(0), 0);
- rc = iwl_poll_direct_bit(priv, FH_RSSR_STATUS, (1 << 24), 1000);
+ iwl3945_write_direct32(priv, FH_RCSR_CONFIG(0), 0);
+ rc = iwl3945_poll_direct_bit(priv, FH_RSSR_STATUS, (1 << 24), 1000);
if (rc < 0)
IWL_ERROR("Can't stop Rx DMA.\n");
- iwl_release_nic_access(priv);
+ iwl3945_release_nic_access(priv);
spin_unlock_irqrestore(&priv->lock, flags);
return 0;
}
-int iwl_hw_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq)
+int iwl3945_hw_tx_queue_init(struct iwl3945_priv *priv, struct iwl3945_tx_queue *txq)
{
int rc;
unsigned long flags;
int txq_id = txq->q.id;
- struct iwl_shared *shared_data = priv->hw_setting.shared_virt;
+ struct iwl3945_shared *shared_data = priv->hw_setting.shared_virt;
shared_data->tx_base_ptr[txq_id] = cpu_to_le32((u32)txq->q.dma_addr);
spin_lock_irqsave(&priv->lock, flags);
- rc = iwl_grab_nic_access(priv);
+ rc = iwl3945_grab_nic_access(priv);
if (rc) {
spin_unlock_irqrestore(&priv->lock, flags);
return rc;
}
- iwl_write_direct32(priv, FH_CBCC_CTRL(txq_id), 0);
- iwl_write_direct32(priv, FH_CBCC_BASE(txq_id), 0);
+ iwl3945_write_direct32(priv, FH_CBCC_CTRL(txq_id), 0);
+ iwl3945_write_direct32(priv, FH_CBCC_BASE(txq_id), 0);
- iwl_write_direct32(priv, FH_TCSR_CONFIG(txq_id),
+ iwl3945_write_direct32(priv, FH_TCSR_CONFIG(txq_id),
ALM_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_RTC_NOINT |
ALM_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_TXF |
ALM_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_IFTFD |
ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_ENABLE_VAL |
ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE);
- iwl_release_nic_access(priv);
+ iwl3945_release_nic_access(priv);
/* fake read to flush all prev. writes */
- iwl_read32(priv, FH_TSSR_CBB_BASE);
+ iwl3945_read32(priv, FH_TSSR_CBB_BASE);
spin_unlock_irqrestore(&priv->lock, flags);
return 0;
}
-int iwl_hw_get_rx_read(struct iwl_priv *priv)
+int iwl3945_hw_get_rx_read(struct iwl3945_priv *priv)
{
- struct iwl_shared *shared_data = priv->hw_setting.shared_virt;
+ struct iwl3945_shared *shared_data = priv->hw_setting.shared_virt;
return le32_to_cpu(shared_data->rx_read_ptr[0]);
}
/**
* iwl3945_init_hw_rate_table - Initialize the hardware rate fallback table
*/
-int iwl3945_init_hw_rate_table(struct iwl_priv *priv)
+int iwl3945_init_hw_rate_table(struct iwl3945_priv *priv)
{
int rc, i, index, prev_index;
- struct iwl_rate_scaling_cmd rate_cmd = {
+ struct iwl3945_rate_scaling_cmd rate_cmd = {
.reserved = {0, 0, 0},
};
- struct iwl_rate_scaling_info *table = rate_cmd.table;
+ struct iwl3945_rate_scaling_info *table = rate_cmd.table;
- for (i = 0; i < ARRAY_SIZE(iwl_rates); i++) {
- index = iwl_rates[i].table_rs_index;
+ for (i = 0; i < ARRAY_SIZE(iwl3945_rates); i++) {
+ index = iwl3945_rates[i].table_rs_index;
table[index].rate_n_flags =
- iwl_hw_set_rate_n_flags(iwl_rates[i].plcp, 0);
+ iwl3945_hw_set_rate_n_flags(iwl3945_rates[i].plcp, 0);
table[index].try_cnt = priv->retry_rate;
- prev_index = iwl_get_prev_ieee_rate(i);
- table[index].next_rate_index = iwl_rates[prev_index].table_rs_index;
+ prev_index = iwl3945_get_prev_ieee_rate(i);
+ table[index].next_rate_index = iwl3945_rates[prev_index].table_rs_index;
}
switch (priv->phymode) {
/* If one of the following CCK rates is used,
* have it fall back to the 6M OFDM rate */
for (i = IWL_RATE_1M_INDEX_TABLE; i <= IWL_RATE_11M_INDEX_TABLE; i++)
- table[i].next_rate_index = iwl_rates[IWL_FIRST_OFDM_RATE].table_rs_index;
+ table[i].next_rate_index = iwl3945_rates[IWL_FIRST_OFDM_RATE].table_rs_index;
/* Don't fall back to CCK rates */
table[IWL_RATE_12M_INDEX_TABLE].next_rate_index = IWL_RATE_9M_INDEX_TABLE;
/* Don't drop out of OFDM rates */
table[IWL_RATE_6M_INDEX_TABLE].next_rate_index =
- iwl_rates[IWL_FIRST_OFDM_RATE].table_rs_index;
+ iwl3945_rates[IWL_FIRST_OFDM_RATE].table_rs_index;
break;
case MODE_IEEE80211B:
/* If an OFDM rate is used, have it fall back to the
* 1M CCK rates */
for (i = IWL_RATE_6M_INDEX_TABLE; i <= IWL_RATE_54M_INDEX_TABLE; i++)
- table[i].next_rate_index = iwl_rates[IWL_FIRST_CCK_RATE].table_rs_index;
+ table[i].next_rate_index = iwl3945_rates[IWL_FIRST_CCK_RATE].table_rs_index;
/* CCK shouldn't fall back to OFDM... */
table[IWL_RATE_11M_INDEX_TABLE].next_rate_index = IWL_RATE_5M_INDEX_TABLE;
/* Update the rate scaling for control frame Tx */
rate_cmd.table_id = 0;
- rc = iwl_send_cmd_pdu(priv, REPLY_RATE_SCALE, sizeof(rate_cmd),
+ rc = iwl3945_send_cmd_pdu(priv, REPLY_RATE_SCALE, sizeof(rate_cmd),
&rate_cmd);
if (rc)
return rc;
/* Update the rate scaling for data frame Tx */
rate_cmd.table_id = 1;
- return iwl_send_cmd_pdu(priv, REPLY_RATE_SCALE, sizeof(rate_cmd),
+ return iwl3945_send_cmd_pdu(priv, REPLY_RATE_SCALE, sizeof(rate_cmd),
&rate_cmd);
}
-int iwl_hw_set_hw_setting(struct iwl_priv *priv)
+int iwl3945_hw_set_hw_setting(struct iwl3945_priv *priv)
{
memset((void *)&priv->hw_setting, 0,
- sizeof(struct iwl_driver_hw_info));
+ sizeof(struct iwl3945_driver_hw_info));
priv->hw_setting.shared_virt =
pci_alloc_consistent(priv->pci_dev,
- sizeof(struct iwl_shared),
+ sizeof(struct iwl3945_shared),
&priv->hw_setting.shared_phys);
if (!priv->hw_setting.shared_virt) {
priv->hw_setting.ac_queue_count = AC_NUM;
priv->hw_setting.rx_buffer_size = IWL_RX_BUF_SIZE;
- priv->hw_setting.tx_cmd_len = sizeof(struct iwl_tx_cmd);
+ priv->hw_setting.tx_cmd_len = sizeof(struct iwl3945_tx_cmd);
priv->hw_setting.max_rxq_size = RX_QUEUE_SIZE;
priv->hw_setting.max_rxq_log = RX_QUEUE_SIZE_LOG;
priv->hw_setting.max_stations = IWL3945_STATION_COUNT;
return 0;
}
-unsigned int iwl_hw_get_beacon_cmd(struct iwl_priv *priv,
- struct iwl_frame *frame, u8 rate)
+unsigned int iwl3945_hw_get_beacon_cmd(struct iwl3945_priv *priv,
+ struct iwl3945_frame *frame, u8 rate)
{
- struct iwl_tx_beacon_cmd *tx_beacon_cmd;
+ struct iwl3945_tx_beacon_cmd *tx_beacon_cmd;
unsigned int frame_size;
- tx_beacon_cmd = (struct iwl_tx_beacon_cmd *)&frame->u;
+ tx_beacon_cmd = (struct iwl3945_tx_beacon_cmd *)&frame->u;
memset(tx_beacon_cmd, 0, sizeof(*tx_beacon_cmd));
tx_beacon_cmd->tx.sta_id = IWL3945_BROADCAST_ID;
tx_beacon_cmd->tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;
- frame_size = iwl_fill_beacon_frame(priv,
+ frame_size = iwl3945_fill_beacon_frame(priv,
tx_beacon_cmd->frame,
- BROADCAST_ADDR,
+ iwl3945_broadcast_addr,
sizeof(frame->u) - sizeof(*tx_beacon_cmd));
BUG_ON(frame_size > MAX_MPDU_SIZE);
tx_beacon_cmd->tx.supp_rates[1] =
(IWL_CCK_BASIC_RATES_MASK & 0xF);
- return (sizeof(struct iwl_tx_beacon_cmd) + frame_size);
+ return (sizeof(struct iwl3945_tx_beacon_cmd) + frame_size);
}
-void iwl_hw_rx_handler_setup(struct iwl_priv *priv)
+void iwl3945_hw_rx_handler_setup(struct iwl3945_priv *priv)
{
priv->rx_handlers[REPLY_3945_RX] = iwl3945_rx_reply_rx;
}
-void iwl_hw_setup_deferred_work(struct iwl_priv *priv)
+void iwl3945_hw_setup_deferred_work(struct iwl3945_priv *priv)
{
INIT_DELAYED_WORK(&priv->thermal_periodic,
iwl3945_bg_reg_txpower_periodic);
}
-void iwl_hw_cancel_deferred_work(struct iwl_priv *priv)
+void iwl3945_hw_cancel_deferred_work(struct iwl3945_priv *priv)
{
cancel_delayed_work(&priv->thermal_periodic);
}
-struct pci_device_id iwl_hw_card_ids[] = {
+struct pci_device_id iwl3945_hw_card_ids[] = {
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4222)},
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4227)},
{0}
};
-inline int iwl_eeprom_acquire_semaphore(struct iwl_priv *priv)
+inline int iwl3945_eeprom_acquire_semaphore(struct iwl3945_priv *priv)
{
- _iwl_clear_bit(priv, CSR_EEPROM_GP, CSR_EEPROM_GP_IF_OWNER_MSK);
+ _iwl3945_clear_bit(priv, CSR_EEPROM_GP, CSR_EEPROM_GP_IF_OWNER_MSK);
return 0;
}
-MODULE_DEVICE_TABLE(pci, iwl_hw_card_ids);
+MODULE_DEVICE_TABLE(pci, iwl3945_hw_card_ids);
#include <linux/kernel.h>
#include <net/ieee80211_radiotap.h>
-struct iwl_priv;
+struct iwl3945_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 iwl3945_hw_card_ids[];
#define DRV_NAME "iwl3945"
#include "iwl-3945-hw.h"
#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 iwl3945_param_hwcrypto;
+extern int iwl3945_param_queues_num;
-enum iwl_antenna {
+enum iwl3945_antenna {
IWL_ANTENNA_DIVERSITY,
IWL_ANTENNA_MAIN,
IWL_ANTENNA_AUX
#define DEFAULT_SHORT_RETRY_LIMIT 7U
#define DEFAULT_LONG_RETRY_LIMIT 4U
-struct iwl_rx_mem_buffer {
+struct iwl3945_rx_mem_buffer {
dma_addr_t dma_addr;
struct sk_buff *skb;
struct list_head list;
};
-struct iwl_rt_rx_hdr {
+struct iwl3945_rt_rx_hdr {
struct ieee80211_radiotap_header rt_hdr;
__le64 rt_tsf; /* TSF */
u8 rt_flags; /* radiotap packet flags */
u8 payload[0]; /* payload... */
} __attribute__ ((packed));
-struct iwl_rt_tx_hdr {
+struct iwl3945_rt_tx_hdr {
struct ieee80211_radiotap_header rt_hdr;
u8 rt_rate; /* rate in 500kb/s */
__le16 rt_channel; /* channel in mHz */
*
* Contains common data for Rx and Tx queues
*/
-struct iwl_queue {
+struct iwl3945_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*/
#define MAX_NUM_OF_TBS (20)
-struct iwl_tx_info {
+struct iwl3945_tx_info {
struct ieee80211_tx_status status;
struct sk_buff *skb[MAX_NUM_OF_TBS];
};
/**
- * struct iwl_tx_queue - Tx Queue for DMA
+ * struct iwl3945_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 iwl3945_tx_queue {
+ struct iwl3945_queue q;
+ struct iwl3945_tfd_frame *bd;
+ struct iwl3945_cmd *cmd;
dma_addr_t dma_addr_cmd;
- struct iwl_tx_info *txb;
+ struct iwl3945_tx_info *txb;
int need_update;
int sched_retry;
int active;
#define IWL_NUM_SCAN_RATES (2)
-struct iwl_channel_tgd_info {
+struct iwl3945_channel_tgd_info {
u8 type;
s8 max_power;
};
-struct iwl_channel_tgh_info {
+struct iwl3945_channel_tgh_info {
s64 last_radar_time;
};
* -- 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 iwl3945_channel_power_info {
+ struct iwl3945_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 */
+struct iwl3945_scan_power_info {
+ struct iwl3945_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 */
};
*/
#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 iwl3945_channel_info {
+ struct iwl3945_channel_tgd_info tgd;
+ struct iwl3945_channel_tgh_info tgh;
+ struct iwl3945_eeprom_channel eeprom; /* EEPROM regulatory limit */
+ struct iwl3945_eeprom_channel fat_eeprom; /* EEPROM regulatory limit for
* FAT channel */
u8 channel; /* channel number */
/* 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 iwl3945_channel_power_info power_info[IWL4965_MAX_RATE];
/* Radio/DSP gain settings for each scan rate, for directed scans. */
- struct iwl_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES];
+ struct iwl3945_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES];
};
-struct iwl_clip_group {
+struct iwl3945_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];
/* Power management (not Tx power) structures */
-struct iwl_power_vec_entry {
- struct iwl_powertable_cmd cmd;
+struct iwl3945_power_vec_entry {
+ struct iwl3945_powertable_cmd cmd;
u8 no_dtim;
};
#define IWL_POWER_RANGE_0 (0)
#define IWL_POWER_ENABLED 0x10
#define IWL_POWER_LEVEL(x) ((x) & IWL_POWER_MASK)
-struct iwl_power_mgr {
+struct iwl3945_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 iwl3945_power_vec_entry pwr_range_0[IWL_POWER_AC];
+ struct iwl3945_power_vec_entry pwr_range_1[IWL_POWER_AC];
u8 active_index;
u32 dtim_val;
};
#define IEEE80211_HLEN (IEEE80211_4ADDR_LEN)
#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN)
-struct iwl_frame {
+struct iwl3945_frame {
union {
struct ieee80211_hdr frame;
- struct iwl_tx_beacon_cmd beacon;
+ struct iwl3945_tx_beacon_cmd beacon;
u8 raw[IEEE80211_FRAME_LEN];
u8 cmd[360];
} u;
CMD_WANT_SKB = (1 << 2),
};
-struct iwl_cmd;
-struct iwl_priv;
+struct iwl3945_cmd;
+struct iwl3945_priv;
-struct iwl_cmd_meta {
- struct iwl_cmd_meta *source;
+struct iwl3945_cmd_meta {
+ struct iwl3945_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 iwl3945_priv *priv,
+ struct iwl3945_cmd *cmd, struct sk_buff *skb);
} __attribute__ ((packed)) u;
/* The CMD_SIZE_HUGE flag bit indicates that the command
} __attribute__ ((packed));
-struct iwl_cmd {
- struct iwl_cmd_meta meta;
- struct iwl_cmd_header hdr;
+struct iwl3945_cmd {
+ struct iwl3945_cmd_meta meta;
+ struct iwl3945_cmd_header hdr;
union {
- struct iwl_addsta_cmd addsta;
- struct iwl_led_cmd led;
+ struct iwl3945_addsta_cmd addsta;
+ struct iwl3945_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 iwl3945_bt_cmd bt;
+ struct iwl3945_rxon_time_cmd rxon_time;
+ struct iwl3945_powertable_cmd powertable;
+ struct iwl3945_qosparam_cmd qosparam;
+ struct iwl3945_tx_cmd tx;
+ struct iwl3945_tx_beacon_cmd tx_beacon;
+ struct iwl3945_rxon_assoc_cmd rxon_assoc;
u8 *indirect;
u8 payload[360];
} __attribute__ ((packed)) cmd;
} __attribute__ ((packed));
-struct iwl_host_cmd {
+struct iwl3945_host_cmd {
u8 id;
u16 len;
- struct iwl_cmd_meta meta;
+ struct iwl3945_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 iwl3945_cmd) - \
+ sizeof(struct iwl3945_cmd_meta))
/*
* RX related structures and functions
#define SUP_RATE_11G_MAX_NUM_CHANNELS 12
/**
- * struct iwl_rx_queue - Rx queue
+ * struct iwl3945_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
* @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 iwl3945_rx_mem_buffers
*/
-struct iwl_rx_queue {
+struct iwl3945_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 iwl3945_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS];
+ struct iwl3945_rx_mem_buffer *queue[RX_QUEUE_SIZE];
u32 processed;
u32 read;
u32 write;
#define IWL_INVALID_RATE 0xFF
#define IWL_INVALID_VALUE -1
-struct iwl_tid_data {
+struct iwl3945_tid_data {
u16 seq_number;
};
-struct iwl_hw_key {
+struct iwl3945_hw_key {
enum ieee80211_key_alg alg;
int keylen;
u8 key[32];
};
-union iwl_ht_rate_supp {
+union iwl3945_ht_rate_supp {
u16 rates;
struct {
u8 siso_rate;
#ifdef CONFIG_IWL3945_QOS
-union iwl_qos_capabity {
+union iwl3945_qos_capabity {
struct {
u8 edca_count:4; /* bit 0-3 */
u8 q_ack:1; /* bit 4 */
};
/* QoS structures */
-struct iwl_qos_info {
+struct iwl3945_qos_info {
int qos_enable;
int qos_active;
- union iwl_qos_capabity qos_cap;
- struct iwl_qosparam_cmd def_qos_parm;
+ union iwl3945_qos_capabity qos_cap;
+ struct iwl3945_qosparam_cmd def_qos_parm;
};
#endif /*CONFIG_IWL3945_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 iwl3945_station_entry {
+ struct iwl3945_addsta_cmd sta;
+ struct iwl3945_tid_data tid[MAX_TID_COUNT];
union {
struct {
u8 rate;
} current_rate;
u8 used;
u8 ps_status;
- struct iwl_hw_key keyinfo;
+ struct iwl3945_hw_key keyinfo;
};
/* one for each uCode image (inst/data, boot/init/runtime) */
};
/* uCode file layout */
-struct iwl_ucode {
+struct iwl3945_ucode {
__le32 ver; /* major/minor/subminor */
__le32 inst_size; /* bytes of runtime instructions */
__le32 data_size; /* bytes of runtime data */
#define IWL_IBSS_MAC_HASH_SIZE 32
-struct iwl_ibss_seq {
+struct iwl3945_ibss_seq {
u8 mac[ETH_ALEN];
u16 seq_num;
u16 frag_num;
struct list_head list;
};
-struct iwl_driver_hw_info {
+struct iwl3945_driver_hw_info {
u16 max_txq_num;
u16 ac_queue_count;
u16 tx_cmd_len;
#define HT_SHORT_GI_40MHZ_ONLY (1 << 1)
-#define IWL_RX_HDR(x) ((struct iwl_rx_frame_hdr *)(\
+#define IWL_RX_HDR(x) ((struct iwl3945_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 iwl3945_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)
* 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 iwl3945_addsta_cmd;
+extern int iwl3945_send_add_station(struct iwl3945_priv *priv,
+ struct iwl3945_addsta_cmd *sta, u8 flags);
+extern u8 iwl3945_add_station(struct iwl3945_priv *priv, const u8 *bssid,
int is_ap, u8 flags);
-extern int iwl_is_network_packet(struct iwl_priv *priv,
+extern int iwl3945_is_network_packet(struct iwl3945_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 iwl3945_power_init_handle(struct iwl3945_priv *priv);
+extern int iwl3945_eeprom_init(struct iwl3945_priv *priv);
#ifdef CONFIG_IWL3945_DEBUG
-extern void iwl_report_frame(struct iwl_priv *priv,
- struct iwl_rx_packet *pkt,
+extern void iwl3945_report_frame(struct iwl3945_priv *priv,
+ struct iwl3945_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 iwl3945_report_frame(struct iwl3945_priv *priv,
+ struct iwl3945_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 iwl3945_handle_data_packet_monitor(struct iwl3945_priv *priv,
+ struct iwl3945_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 iwl3945_is_duplicate_packet(struct iwl3945_priv *priv,
+ struct ieee80211_hdr *header);
+extern int iwl3945_rx_queue_alloc(struct iwl3945_priv *priv);
+extern void iwl3945_rx_queue_reset(struct iwl3945_priv *priv,
+ struct iwl3945_rx_queue *rxq);
+extern int iwl3945_calc_db_from_ratio(int sig_ratio);
+extern int iwl3945_calc_sig_qual(int rssi_dbm, int noise_dbm);
+extern int iwl3945_tx_queue_init(struct iwl3945_priv *priv,
+ struct iwl3945_tx_queue *txq, int count, u32 id);
+extern void iwl3945_rx_replenish(void *data);
+extern void iwl3945_tx_queue_free(struct iwl3945_priv *priv, struct iwl3945_tx_queue *txq);
+extern int iwl3945_send_cmd_pdu(struct iwl3945_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 iwl3945_send_cmd(struct iwl3945_priv *priv,
+ struct iwl3945_host_cmd *cmd);
+extern unsigned int iwl3945_fill_beacon_frame(struct iwl3945_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 iwl3945_rx_queue_update_write_ptr(struct iwl3945_priv *priv,
+ struct iwl3945_rx_queue *q);
+extern int iwl3945_send_statistics_request(struct iwl3945_priv *priv);
+extern void iwl3945_set_decrypted_flag(struct iwl3945_priv *priv, struct sk_buff *skb,
u32 decrypt_res,
struct ieee80211_rx_status *stats);
-extern const u8 BROADCAST_ADDR[ETH_ALEN];
+extern const u8 iwl3945_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 iwl3945_sync_station(struct iwl3945_priv *priv, int sta_id,
u16 tx_rate, u8 flags);
/******************************************************************************
* 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)
+ * iwl3945_ <-- Its part of iwlwifi (should be changed to iwl3945_)
+ * iwl3945_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
+ * iwl3945_bg_ <-- Called from work queue context
+ * iwl3945_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 iwl3945_hw_rx_handler_setup(struct iwl3945_priv *priv);
+extern void iwl3945_hw_setup_deferred_work(struct iwl3945_priv *priv);
+extern void iwl3945_hw_cancel_deferred_work(struct iwl3945_priv *priv);
+extern int iwl3945_hw_rxq_stop(struct iwl3945_priv *priv);
+extern int iwl3945_hw_set_hw_setting(struct iwl3945_priv *priv);
+extern int iwl3945_hw_nic_init(struct iwl3945_priv *priv);
+extern int iwl3945_hw_nic_stop_master(struct iwl3945_priv *priv);
+extern void iwl3945_hw_txq_ctx_free(struct iwl3945_priv *priv);
+extern void iwl3945_hw_txq_ctx_stop(struct iwl3945_priv *priv);
+extern int iwl3945_hw_nic_reset(struct iwl3945_priv *priv);
+extern int iwl3945_hw_txq_attach_buf_to_tfd(struct iwl3945_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 iwl3945_hw_txq_free_tfd(struct iwl3945_priv *priv, struct iwl3945_tx_queue *txq);
+extern int iwl3945_hw_get_temperature(struct iwl3945_priv *priv);
+extern int iwl3945_hw_tx_queue_init(struct iwl3945_priv *priv,
+ struct iwl3945_tx_queue *txq);
+extern unsigned int iwl3945_hw_get_beacon_cmd(struct iwl3945_priv *priv,
+ struct iwl3945_frame *frame, u8 rate);
+extern int iwl3945_hw_get_rx_read(struct iwl3945_priv *priv);
+extern void iwl3945_hw_build_tx_cmd_rate(struct iwl3945_priv *priv,
+ struct iwl3945_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 iwl3945_hw_reg_send_txpower(struct iwl3945_priv *priv);
+extern int iwl3945_hw_reg_set_txpower(struct iwl3945_priv *priv, s8 power);
+extern void iwl3945_hw_rx_statistics(struct iwl3945_priv *priv,
+ struct iwl3945_rx_mem_buffer *rxb);
+extern void iwl3945_disable_events(struct iwl3945_priv *priv);
+extern int iwl4965_get_temperature(const struct iwl3945_priv *priv);
/**
- * iwl_hw_find_station - Find station id for a given BSSID
+ * iwl3945_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 iwl3945_hw_find_station(struct iwl3945_priv *priv, const u8 *bssid);
-extern int iwl_hw_channel_switch(struct iwl_priv *priv, u16 channel);
+extern int iwl3945_hw_channel_switch(struct iwl3945_priv *priv, u16 channel);
/*
* Forward declare iwl-3945.c functions for iwl-base.c
*/
-extern int iwl_eeprom_acquire_semaphore(struct iwl_priv *priv);
-extern __le32 iwl3945_get_antenna_flags(const struct iwl_priv *priv);
-extern int iwl3945_init_hw_rate_table(struct iwl_priv *priv);
-extern void iwl3945_reg_txpower_periodic(struct iwl_priv *priv);
-extern int iwl3945_txpower_set_from_eeprom(struct iwl_priv *priv);
-extern u8 iwl3945_sync_sta(struct iwl_priv *priv, int sta_id,
+extern int iwl3945_eeprom_acquire_semaphore(struct iwl3945_priv *priv);
+extern __le32 iwl3945_get_antenna_flags(const struct iwl3945_priv *priv);
+extern int iwl3945_init_hw_rate_table(struct iwl3945_priv *priv);
+extern void iwl3945_reg_txpower_periodic(struct iwl3945_priv *priv);
+extern int iwl3945_txpower_set_from_eeprom(struct iwl3945_priv *priv);
+extern u8 iwl3945_sync_sta(struct iwl3945_priv *priv, int sta_id,
u16 tx_rate, u8 flags);
#endif
-struct iwl_priv {
+struct iwl3945_priv {
/* ieee device used by generic ieee processing code */
struct ieee80211_hw *hw;
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 iwl3945_priv *priv,
+ struct iwl3945_rx_mem_buffer *rxb);
const struct ieee80211_hw_mode *modes;
#ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT
/* spectrum measurement report caching */
- struct iwl_spectrum_notification measure_report;
+ struct iwl3945_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 iwl3945_channel_info for NIC's valid channels.
* Access via channel # using indirect index array */
- struct iwl_channel_info *channel_info; /* channel info array */
+ struct iwl3945_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 iwl3945_clip_group clip_groups[5];
/* thermal calibration */
s32 temperature; /* degrees Kelvin */
int one_direct_scan;
u8 direct_ssid_len;
u8 direct_ssid[IW_ESSID_MAX_SIZE];
- struct iwl_scan_cmd *scan;
+ struct iwl3945_scan_cmd *scan;
u8 only_active_channel;
/* spinlock */
struct fw_desc ucode_boot; /* bootstrap inst */
- struct iwl_rxon_time_cmd rxon_timing;
+ struct iwl3945_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 iwl3945_rxon_cmd active_rxon;
+ struct iwl3945_rxon_cmd staging_rxon;
int error_recovering;
- struct iwl_rxon_cmd recovery_rxon;
+ struct iwl3945_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 iwl3945_init_alive_resp card_alive_init;
+ struct iwl3945_alive_resp card_alive;
#ifdef LED
/* LED related variables */
- struct iwl_activity_blink activity;
+ struct iwl3945_activity_blink activity;
unsigned long led_packets;
int led_state;
#endif
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 iwl3945_rx_queue rxq;
+ struct iwl3945_tx_queue txq[IWL_MAX_NUM_QUEUES];
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 iwl3945_power_mgr power_data;
- struct iwl_notif_statistics statistics;
+ struct iwl3945_notif_statistics statistics;
unsigned long last_statistics_time;
/* context information */
/*station table variables */
spinlock_t sta_lock;
int num_stations;
- struct iwl_station_entry stations[IWL_STATION_COUNT];
+ struct iwl3945_station_entry stations[IWL_STATION_COUNT];
/* Indication if ieee80211_ops->open has been called */
int is_open;
struct list_head ibss_mac_hash[IWL_IBSS_MAC_HASH_SIZE];
/* eeprom */
- struct iwl_eeprom eeprom;
+ struct iwl3945_eeprom eeprom;
int iw_mode;
u32 timestamp0;
u32 timestamp1;
u16 beacon_int;
- struct iwl_driver_hw_info hw_setting;
+ struct iwl3945_driver_hw_info hw_setting;
int interface_id;
/* Current association information needed to configure the
u8 ps_mode;
#ifdef CONFIG_IWL3945_QOS
- struct iwl_qos_info qos_data;
+ struct iwl3945_qos_info qos_data;
#endif /*CONFIG_IWL3945_QOS */
struct workqueue_struct *workqueue;
u32 framecnt_to_us;
atomic_t restrict_refcnt;
#endif
-}; /*iwl_priv */
+}; /*iwl3945_priv */
-static inline int iwl_is_associated(struct iwl_priv *priv)
+static inline int iwl3945_is_associated(struct iwl3945_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 iwl3945_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 iwl3945_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 iwl3945_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 iwl3945_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 iwl3945_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 iwl3945_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 iwl3945_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 iwl3945_channel_info *iwl3945_get_channel_info(
+ const struct iwl3945_priv *priv, int phymode, u16 channel);
-/* Requires full declaration of iwl_priv before including */
+/* Requires full declaration of iwl3945_priv before including */
#include "iwl-3945-io.h"
#endif
*
*****************************************************************************/
-#ifndef __iwl_commands_h__
-#define __iwl_commands_h__
+#ifndef __iwl4965_commands_h__
+#define __iwl4965_commands_h__
enum {
REPLY_ALIVE = 0x1,
#define IWL_CMD_FAILED_MSK 0x40
-struct iwl_cmd_header {
+struct iwl4965_cmd_header {
u8 cmd;
u8 flags;
/* We have 15 LSB to use as we please (MSB indicates
/*
* REPLY_ALIVE = 0x1 (response only, not a command)
*/
-struct iwl_alive_resp {
+struct iwl4965_alive_resp {
u8 ucode_minor;
u8 ucode_major;
__le16 reserved1;
__le32 is_valid;
} __attribute__ ((packed));
-struct iwl_init_alive_resp {
+struct iwl4965_init_alive_resp {
u8 ucode_minor;
u8 ucode_major;
__le16 reserved1;
/*
* REPLY_ERROR = 0x2 (response only, not a command)
*/
-struct iwl_error_resp {
+struct iwl4965_error_resp {
__le32 error_type;
u8 cmd_id;
u8 reserved1;
/*
* REPLY_RXON = 0x10 (command, has simple generic response)
*/
-struct iwl_rxon_cmd {
+struct iwl4965_rxon_cmd {
u8 node_addr[6];
__le16 reserved1;
u8 bssid_addr[6];
/*
* REPLY_RXON_ASSOC = 0x11 (command, has simple generic response)
*/
-struct iwl_rxon_assoc_cmd {
+struct iwl4965_rxon_assoc_cmd {
__le32 flags;
__le32 filter_flags;
u8 ofdm_basic_rates;
/*
* REPLY_RXON_TIMING = 0x14 (command, has simple generic response)
*/
-struct iwl_rxon_time_cmd {
+struct iwl4965_rxon_time_cmd {
union tsf timestamp;
__le16 beacon_interval;
__le16 atim_window;
__le16 reserved;
} __attribute__ ((packed));
-struct iwl_tx_power {
+struct iwl4965_tx_power {
u8 tx_gain; /* gain for analog radio */
u8 dsp_atten; /* gain for DSP */
} __attribute__ ((packed));
__le32 dw;
} __attribute__ ((packed));
-struct iwl_tx_power_db {
+struct iwl4965_tx_power_db {
struct tx_power_dual_stream power_tbl[POWER_TABLE_NUM_ENTRIES];
} __attribute__ ((packed));
/*
* REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response)
*/
-struct iwl_channel_switch_cmd {
+struct iwl4965_channel_switch_cmd {
u8 band;
u8 expect_beacon;
__le16 channel;
__le32 rxon_flags;
__le32 rxon_filter_flags;
__le32 switch_time;
- struct iwl_tx_power_db tx_power;
+ struct iwl4965_tx_power_db tx_power;
} __attribute__ ((packed));
/*
* CHANNEL_SWITCH_NOTIFICATION = 0x73 (notification only, not a command)
*/
-struct iwl_csa_notification {
+struct iwl4965_csa_notification {
__le16 band;
__le16 channel;
__le32 status; /* 0 - OK, 1 - fail */
* Quality-of-Service (QOS) Commands & Responses:
*
*****************************************************************************/
-struct iwl_ac_qos {
+struct iwl4965_ac_qos {
__le16 cw_min;
__le16 cw_max;
u8 aifsn;
/*
* REPLY_QOS_PARAM = 0x13 (command, has simple generic response)
*/
-struct iwl_qosparam_cmd {
+struct iwl4965_qosparam_cmd {
__le32 qos_flags;
- struct iwl_ac_qos ac[AC_NUM];
+ struct iwl4965_ac_qos ac[AC_NUM];
} __attribute__ ((packed));
/******************************************************************************
#define RATE_MCS_ANT_B_MSK 0x8000
#define RATE_MCS_ANT_AB_MSK 0xc000
-struct iwl_keyinfo {
+struct iwl4965_keyinfo {
__le16 key_flags;
u8 tkip_rx_tsc_byte2; /* TSC[2] for key mix ph1 detection */
u8 reserved1;
/*
* REPLY_ADD_STA = 0x18 (command)
*/
-struct iwl_addsta_cmd {
+struct iwl4965_addsta_cmd {
u8 mode;
u8 reserved[3];
struct sta_id_modify sta;
- struct iwl_keyinfo key;
+ struct iwl4965_keyinfo key;
__le32 station_flags;
__le32 station_flags_msk;
__le16 tid_disable_tx;
/*
* REPLY_ADD_STA = 0x18 (response)
*/
-struct iwl_add_sta_resp {
+struct iwl4965_add_sta_resp {
u8 status;
} __attribute__ ((packed));
*
*****************************************************************************/
-struct iwl_rx_frame_stats {
+struct iwl4965_rx_frame_stats {
u8 phy_count;
u8 id;
u8 rssi;
u8 payload[0];
} __attribute__ ((packed));
-struct iwl_rx_frame_hdr {
+struct iwl4965_rx_frame_hdr {
__le16 channel;
__le16 phy_flags;
u8 reserved1;
#define RX_RES_STATUS_BAD_ICV_MIC (0x1 << 11)
#define RX_RES_STATUS_BAD_KEY_TTAK (0x2 << 11)
-struct iwl_rx_frame_end {
+struct iwl4965_rx_frame_end {
__le32 status;
__le64 timestamp;
__le32 beacon_timestamp;
* The actual offsets of the hdr and end are dynamic based on
* stats.phy_count
*/
-struct iwl_rx_frame {
- struct iwl_rx_frame_stats stats;
- struct iwl_rx_frame_hdr hdr;
- struct iwl_rx_frame_end end;
+struct iwl4965_rx_frame {
+ struct iwl4965_rx_frame_stats stats;
+ struct iwl4965_rx_frame_hdr hdr;
+ struct iwl4965_rx_frame_end end;
} __attribute__ ((packed));
/* Fixed (non-configurable) rx data from phy */
* TX command Frame life time
*/
-struct iwl_dram_scratch {
+struct iwl4965_dram_scratch {
u8 try_cnt;
u8 bt_kill_cnt;
__le16 reserved;
/*
* REPLY_TX = 0x1c (command)
*/
-struct iwl_tx_cmd {
+struct iwl4965_tx_cmd {
__le16 len;
__le16 next_frame_len;
__le32 tx_flags;
- struct iwl_dram_scratch scratch;
+ struct iwl4965_dram_scratch scratch;
__le32 rate_n_flags;
u8 sta_id;
u8 sec_ctl;
/*
* REPLY_TX = 0x1c (response)
*/
-struct iwl_tx_resp {
+struct iwl4965_tx_resp {
u8 frame_count; /* 1 no aggregation, >1 aggregation */
u8 bt_kill_count;
u8 failure_rts;
/*
* REPLY_COMPRESSED_BA = 0xc5 (response only, not a command)
*/
-struct iwl_compressed_ba_resp {
+struct iwl4965_compressed_ba_resp {
__le32 sta_addr_lo32;
__le16 sta_addr_hi16;
__le16 reserved;
/*
* REPLY_TX_PWR_TABLE_CMD = 0x97 (command, has simple generic response)
*/
-struct iwl_txpowertable_cmd {
+struct iwl4965_txpowertable_cmd {
u8 band; /* 0: 5 GHz, 1: 2.4 GHz */
u8 reserved;
__le16 channel;
- struct iwl_tx_power_db tx_power;
+ struct iwl4965_tx_power_db tx_power;
} __attribute__ ((packed));
/*RS_NEW_API: only TLC_RTS remains and moved to bit 0 */
#define LINK_QUAL_ANT_B_MSK (1<<1)
#define LINK_QUAL_ANT_MSK (LINK_QUAL_ANT_A_MSK|LINK_QUAL_ANT_B_MSK)
-struct iwl_link_qual_general_params {
+struct iwl4965_link_qual_general_params {
u8 flags;
u8 mimo_delimiter;
u8 single_stream_ant_msk;
u8 start_rate_index[LINK_QUAL_AC_NUM];
} __attribute__ ((packed));
-struct iwl_link_qual_agg_params {
+struct iwl4965_link_qual_agg_params {
__le16 agg_time_limit;
u8 agg_dis_start_th;
u8 agg_frame_cnt_limit;
/*
* REPLY_TX_LINK_QUALITY_CMD = 0x4e (command, has simple generic response)
*/
-struct iwl_link_quality_cmd {
+struct iwl4965_link_quality_cmd {
u8 sta_id;
u8 reserved1;
__le16 control;
- struct iwl_link_qual_general_params general_params;
- struct iwl_link_qual_agg_params agg_params;
+ struct iwl4965_link_qual_general_params general_params;
+ struct iwl4965_link_qual_agg_params agg_params;
struct {
__le32 rate_n_flags;
} rs_table[LINK_QUAL_MAX_RETRY_NUM];
/*
* REPLY_BT_CONFIG = 0x9b (command, has simple generic response)
*/
-struct iwl_bt_cmd {
+struct iwl4965_bt_cmd {
u8 flags;
u8 lead_time;
u8 max_kill;
RXON_FILTER_ASSOC_MSK | \
RXON_FILTER_BCON_AWARE_MSK)
-struct iwl_measure_channel {
+struct iwl4965_measure_channel {
__le32 duration; /* measurement duration in extended beacon
* format */
u8 channel; /* channel to measure */
- u8 type; /* see enum iwl_measure_type */
+ u8 type; /* see enum iwl4965_measure_type */
__le16 reserved;
} __attribute__ ((packed));
/*
* REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (command)
*/
-struct iwl_spectrum_cmd {
+struct iwl4965_spectrum_cmd {
__le16 len; /* number of bytes starting from token */
u8 token; /* token id */
u8 id; /* measurement id -- 0 or 1 */
__le32 filter_flags; /* rxon filter flags */
__le16 channel_count; /* minimum 1, maximum 10 */
__le16 reserved3;
- struct iwl_measure_channel channels[10];
+ struct iwl4965_measure_channel channels[10];
} __attribute__ ((packed));
/*
* REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (response)
*/
-struct iwl_spectrum_resp {
+struct iwl4965_spectrum_resp {
u8 token;
u8 id; /* id of the prior command replaced, or 0xff */
__le16 status; /* 0 - command will be handled
* measurement) */
} __attribute__ ((packed));
-enum iwl_measurement_state {
+enum iwl4965_measurement_state {
IWL_MEASUREMENT_START = 0,
IWL_MEASUREMENT_STOP = 1,
};
-enum iwl_measurement_status {
+enum iwl4965_measurement_status {
IWL_MEASUREMENT_OK = 0,
IWL_MEASUREMENT_CONCURRENT = 1,
IWL_MEASUREMENT_CSA_CONFLICT = 2,
#define NUM_ELEMENTS_IN_HISTOGRAM 8
-struct iwl_measurement_histogram {
+struct iwl4965_measurement_histogram {
__le32 ofdm[NUM_ELEMENTS_IN_HISTOGRAM]; /* in 0.8usec counts */
__le32 cck[NUM_ELEMENTS_IN_HISTOGRAM]; /* in 1usec counts */
} __attribute__ ((packed));
/* clear channel availability counters */
-struct iwl_measurement_cca_counters {
+struct iwl4965_measurement_cca_counters {
__le32 ofdm;
__le32 cck;
} __attribute__ ((packed));
-enum iwl_measure_type {
+enum iwl4965_measure_type {
IWL_MEASURE_BASIC = (1 << 0),
IWL_MEASURE_CHANNEL_LOAD = (1 << 1),
IWL_MEASURE_HISTOGRAM_RPI = (1 << 2),
/*
* SPECTRUM_MEASURE_NOTIFICATION = 0x75 (notification only, not a command)
*/
-struct iwl_spectrum_notification {
+struct iwl4965_spectrum_notification {
u8 id; /* measurement id -- 0 or 1 */
u8 token;
u8 channel_index; /* index in measurement channel list */
__le32 start_time; /* lower 32-bits of TSF */
u8 band; /* 0 - 5.2GHz, 1 - 2.4GHz */
u8 channel;
- u8 type; /* see enum iwl_measurement_type */
+ u8 type; /* see enum iwl4965_measurement_type */
u8 reserved1;
/* NOTE: cca_ofdm, cca_cck, basic_type, and histogram are only only
* valid if applicable for measurement type requested. */
u8 basic_type; /* 0 - bss, 1 - ofdm preamble, 2 -
* unidentified */
u8 reserved2[3];
- struct iwl_measurement_histogram histogram;
+ struct iwl4965_measurement_histogram histogram;
__le32 stop_time; /* lower 32-bits of TSF */
- __le32 status; /* see iwl_measurement_status */
+ __le32 status; /* see iwl4965_measurement_status */
} __attribute__ ((packed));
/******************************************************************************
*****************************************************************************/
/**
- * struct iwl_powertable_cmd - Power Table Command
+ * struct iwl4965_powertable_cmd - Power Table Command
* @flags: See below:
*
* POWER_TABLE_CMD = 0x77 (command, has simple generic response)
#define IWL_POWER_SLEEP_OVER_DTIM_MSK __constant_cpu_to_le16(1<<2)
#define IWL_POWER_PCI_PM_MSK __constant_cpu_to_le16(1<<3)
-struct iwl_powertable_cmd {
+struct iwl4965_powertable_cmd {
__le16 flags;
u8 keep_alive_seconds;
u8 debug_flags;
* PM_SLEEP_NOTIFICATION = 0x7A (notification only, not a command)
* 3945 and 4965 identical.
*/
-struct iwl_sleep_notification {
+struct iwl4965_sleep_notification {
u8 pm_sleep_mode;
u8 pm_wakeup_src;
__le16 reserved;
#define CARD_STATE_CMD_DISABLE 0x00 /* Put card to sleep */
#define CARD_STATE_CMD_ENABLE 0x01 /* Wake up card */
#define CARD_STATE_CMD_HALT 0x02 /* Power down permanently */
-struct iwl_card_state_cmd {
+struct iwl4965_card_state_cmd {
__le32 status; /* CARD_STATE_CMD_* request new power state */
} __attribute__ ((packed));
/*
* CARD_STATE_NOTIFICATION = 0xa1 (notification only, not a command)
*/
-struct iwl_card_state_notif {
+struct iwl4965_card_state_notif {
__le32 flags;
} __attribute__ ((packed));
#define RF_CARD_DISABLED 0x04
#define RXON_CARD_DISABLED 0x10
-struct iwl_ct_kill_config {
+struct iwl4965_ct_kill_config {
__le32 reserved;
__le32 critical_temperature_M;
__le32 critical_temperature_R;
*
*****************************************************************************/
-struct iwl_scan_channel {
+struct iwl4965_scan_channel {
/* type is defined as:
* 0:0 active (0 - passive)
* 1:4 SSID direct
*/
u8 type;
u8 channel;
- struct iwl_tx_power tpc;
+ struct iwl4965_tx_power tpc;
__le16 active_dwell;
__le16 passive_dwell;
} __attribute__ ((packed));
-struct iwl_ssid_ie {
+struct iwl4965_ssid_ie {
u8 id;
u8 len;
u8 ssid[32];
/*
* REPLY_SCAN_CMD = 0x80 (command)
*/
-struct iwl_scan_cmd {
+struct iwl4965_scan_cmd {
__le16 len;
u8 reserved0;
u8 channel_count;
__le32 flags;
__le32 filter_flags;
- struct iwl_tx_cmd tx_cmd;
- struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
+ struct iwl4965_tx_cmd tx_cmd;
+ struct iwl4965_ssid_ie direct_scan[PROBE_OPTION_MAX];
u8 data[0];
/*
* The channels start after the probe request payload and are of type:
*
- * struct iwl_scan_channel channels[0];
+ * struct iwl4965_scan_channel channels[0];
*
* NOTE: Only one band of channels can be scanned per pass. You
* can not mix 2.4GHz channels and 5.2GHz channels and must
/*
* REPLY_SCAN_CMD = 0x80 (response)
*/
-struct iwl_scanreq_notification {
+struct iwl4965_scanreq_notification {
__le32 status; /* 1: okay, 2: cannot fulfill request */
} __attribute__ ((packed));
/*
* SCAN_START_NOTIFICATION = 0x82 (notification only, not a command)
*/
-struct iwl_scanstart_notification {
+struct iwl4965_scanstart_notification {
__le32 tsf_low;
__le32 tsf_high;
__le32 beacon_timer;
/*
* SCAN_RESULTS_NOTIFICATION = 0x83 (notification only, not a command)
*/
-struct iwl_scanresults_notification {
+struct iwl4965_scanresults_notification {
u8 channel;
u8 band;
u8 reserved[2];
/*
* SCAN_COMPLETE_NOTIFICATION = 0x84 (notification only, not a command)
*/
-struct iwl_scancomplete_notification {
+struct iwl4965_scancomplete_notification {
u8 scanned_channels;
u8 status;
u8 reserved;
/*
* BEACON_NOTIFICATION = 0x90 (notification only, not a command)
*/
-struct iwl_beacon_notif {
- struct iwl_tx_resp beacon_notify_hdr;
+struct iwl4965_beacon_notif {
+ struct iwl4965_tx_resp beacon_notify_hdr;
__le32 low_tsf;
__le32 high_tsf;
__le32 ibss_mgr_status;
/*
* REPLY_TX_BEACON = 0x91 (command, has simple generic response)
*/
-struct iwl_tx_beacon_cmd {
- struct iwl_tx_cmd tx;
+struct iwl4965_tx_beacon_cmd {
+ struct iwl4965_tx_cmd tx;
__le16 tim_idx;
u8 tim_size;
u8 reserved1;
*/
#define IWL_STATS_CONF_CLEAR_STATS __constant_cpu_to_le32(0x1) /* see above */
#define IWL_STATS_CONF_DISABLE_NOTIF __constant_cpu_to_le32(0x2)/* see above */
-struct iwl_statistics_cmd {
+struct iwl4965_statistics_cmd {
__le32 configuration_flags; /* IWL_STATS_CONF_* */
} __attribute__ ((packed));
*/
#define STATISTICS_REPLY_FLG_BAND_24G_MSK __constant_cpu_to_le32(0x2)
#define STATISTICS_REPLY_FLG_FAT_MODE_MSK __constant_cpu_to_le32(0x8)
-struct iwl_notif_statistics {
+struct iwl4965_notif_statistics {
__le32 flag;
struct statistics_rx rx;
struct statistics_tx tx;
* then this notification will be sent. */
#define CONSECUTIVE_MISSED_BCONS_TH 20
-struct iwl_missed_beacon_notif {
+struct iwl4965_missed_beacon_notif {
__le32 consequtive_missed_beacons;
__le32 total_missed_becons;
__le32 num_expected_beacons;
#define PHY_CALIBRATE_DIFF_GAIN_CMD (7)
#define HD_TABLE_SIZE (11)
-struct iwl_sensitivity_cmd {
+struct iwl4965_sensitivity_cmd {
__le16 control;
__le16 table[HD_TABLE_SIZE];
} __attribute__ ((packed));
-struct iwl_calibration_cmd {
+struct iwl4965_calibration_cmd {
u8 opCode;
u8 flags;
__le16 reserved;
* For each of 3 possible LEDs (Activity/Link/Tech, selected by "id" field),
* this command turns it on or off, or sets up a periodic blinking cycle.
*/
-struct iwl_led_cmd {
+struct iwl4965_led_cmd {
__le32 interval; /* "interval" in uSec */
u8 id; /* 1: Activity, 2: Link, 3: Tech */
u8 off; /* # intervals off while blinking;
*
*****************************************************************************/
-struct iwl_rx_packet {
+struct iwl4965_rx_packet {
__le32 len;
- struct iwl_cmd_header hdr;
+ struct iwl4965_cmd_header hdr;
union {
- struct iwl_alive_resp alive_frame;
- struct iwl_rx_frame rx_frame;
- struct iwl_tx_resp tx_resp;
- struct iwl_spectrum_notification spectrum_notif;
- struct iwl_csa_notification csa_notif;
- struct iwl_error_resp err_resp;
- struct iwl_card_state_notif card_state_notif;
- struct iwl_beacon_notif beacon_status;
- struct iwl_add_sta_resp add_sta;
- struct iwl_sleep_notification sleep_notif;
- struct iwl_spectrum_resp spectrum;
- struct iwl_notif_statistics stats;
- struct iwl_compressed_ba_resp compressed_ba;
- struct iwl_missed_beacon_notif missed_beacon;
+ struct iwl4965_alive_resp alive_frame;
+ struct iwl4965_rx_frame rx_frame;
+ struct iwl4965_tx_resp tx_resp;
+ struct iwl4965_spectrum_notification spectrum_notif;
+ struct iwl4965_csa_notification csa_notif;
+ struct iwl4965_error_resp err_resp;
+ struct iwl4965_card_state_notif card_state_notif;
+ struct iwl4965_beacon_notif beacon_status;
+ struct iwl4965_add_sta_resp add_sta;
+ struct iwl4965_sleep_notification sleep_notif;
+ struct iwl4965_spectrum_resp spectrum;
+ struct iwl4965_notif_statistics stats;
+ struct iwl4965_compressed_ba_resp compressed_ba;
+ struct iwl4965_missed_beacon_notif missed_beacon;
__le32 status;
u8 raw[0];
} u;
} __attribute__ ((packed));
-#define IWL_RX_FRAME_SIZE (4 + sizeof(struct iwl_rx_frame))
+#define IWL_RX_FRAME_SIZE (4 + sizeof(struct iwl4965_rx_frame))
-#endif /* __iwl_commands_h__ */
+#endif /* __iwl4965_commands_h__ */
*
*****************************************************************************/
-#ifndef __iwl_debug_h__
-#define __iwl_debug_h__
+#ifndef __iwl4965_debug_h__
+#define __iwl4965_debug_h__
#ifdef CONFIG_IWL4965_DEBUG
-extern u32 iwl_debug_level;
+extern u32 iwl4965_debug_level;
#define IWL_DEBUG(level, fmt, args...) \
-do { if (iwl_debug_level & (level)) \
+do { if (iwl4965_debug_level & (level)) \
printk(KERN_ERR DRV_NAME": %c %s " fmt, \
in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
#define IWL_DEBUG_LIMIT(level, fmt, args...) \
-do { if ((iwl_debug_level & (level)) && net_ratelimit()) \
+do { if ((iwl4965_debug_level & (level)) && net_ratelimit()) \
printk(KERN_ERR DRV_NAME": %c %s " fmt, \
in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
#else
*
* % cat /proc/net/iwl/debug_level
*
- * you simply need to add your entry to the iwl_debug_levels array.
+ * you simply need to add your entry to the iwl4965_debug_levels array.
*
* If you do not see debug_level in /proc/net/iwl then you do not have
* CONFIG_IWL4965_DEBUG defined in your kernel configuration
#define EEPROM_SKU_CAP_OP_MODE_MRC (1 << 7)
/* *regulatory* channel data from eeprom, one for each channel */
-struct iwl_eeprom_channel {
+struct iwl4965_eeprom_channel {
u8 flags; /* flags copied from EEPROM */
s8 max_power_avg; /* max power (dBm) on this chnl, limit 31 */
} __attribute__ ((packed));
* level.
* Data copied from EEPROM.
*/
-struct iwl_eeprom_txpower_sample {
+struct iwl4965_eeprom_txpower_sample {
u8 gain_index; /* index into power (gain) setup table ... */
s8 power; /* ... for this pwr level for this chnl group */
u16 v_det; /* PA output voltage */
* Data copied from EEPROM.
* DO NOT ALTER THIS STRUCTURE!!!
*/
-struct iwl_eeprom_txpower_group {
- struct iwl_eeprom_txpower_sample samples[5]; /* 5 power levels */
+struct iwl4965_eeprom_txpower_group {
+ struct iwl4965_eeprom_txpower_sample samples[5]; /* 5 power levels */
s32 a, b, c, d, e; /* coefficients for voltage->power
* formula (signed) */
s32 Fa, Fb, Fc, Fd, Fe; /* these modify coeffs based on
* difference between current temperature and factory calib temperature.
* Data copied from EEPROM.
*/
-struct iwl_eeprom_temperature_corr {
+struct iwl4965_eeprom_temperature_corr {
u32 Ta;
u32 Tb;
u32 Tc;
#define EEPROM_TX_POWER_VERSION (2)
#define EEPROM_TX_POWER_VERSION_NEW (5)
-struct iwl_eeprom_calib_measure {
+struct iwl4965_eeprom_calib_measure {
u8 temperature;
u8 gain_idx;
u8 actual_pow;
s8 pa_det;
} __attribute__ ((packed));
-struct iwl_eeprom_calib_ch_info {
+struct iwl4965_eeprom_calib_ch_info {
u8 ch_num;
- struct iwl_eeprom_calib_measure measurements[EEPROM_TX_POWER_TX_CHAINS]
+ struct iwl4965_eeprom_calib_measure measurements[EEPROM_TX_POWER_TX_CHAINS]
[EEPROM_TX_POWER_MEASUREMENTS];
} __attribute__ ((packed));
-struct iwl_eeprom_calib_subband_info {
+struct iwl4965_eeprom_calib_subband_info {
u8 ch_from;
u8 ch_to;
- struct iwl_eeprom_calib_ch_info ch1;
- struct iwl_eeprom_calib_ch_info ch2;
+ struct iwl4965_eeprom_calib_ch_info ch1;
+ struct iwl4965_eeprom_calib_ch_info ch2;
} __attribute__ ((packed));
-struct iwl_eeprom_calib_info {
+struct iwl4965_eeprom_calib_info {
u8 saturation_power24;
u8 saturation_power52;
s16 voltage; /* signed */
- struct iwl_eeprom_calib_subband_info band_info[EEPROM_TX_POWER_BANDS];
+ struct iwl4965_eeprom_calib_subband_info band_info[EEPROM_TX_POWER_BANDS];
} __attribute__ ((packed));
-struct iwl_eeprom {
+struct iwl4965_eeprom {
u8 reserved0[16];
#define EEPROM_DEVICE_ID (2*0x08) /* 2 bytes */
u16 device_id; /* abs.ofs: 16 */
#define EEPROM_REGULATORY_BAND_1 (2*0x62) /* 2 bytes */
u16 band_1_count; /* abs.ofs: 196 */
#define EEPROM_REGULATORY_BAND_1_CHANNELS (2*0x63) /* 28 bytes */
- struct iwl_eeprom_channel band_1_channels[14]; /* abs.ofs: 196 */
+ struct iwl4965_eeprom_channel band_1_channels[14]; /* abs.ofs: 196 */
#define EEPROM_REGULATORY_BAND_2 (2*0x71) /* 2 bytes */
u16 band_2_count; /* abs.ofs: 226 */
#define EEPROM_REGULATORY_BAND_2_CHANNELS (2*0x72) /* 26 bytes */
- struct iwl_eeprom_channel band_2_channels[13]; /* abs.ofs: 228 */
+ struct iwl4965_eeprom_channel band_2_channels[13]; /* abs.ofs: 228 */
#define EEPROM_REGULATORY_BAND_3 (2*0x7F) /* 2 bytes */
u16 band_3_count; /* abs.ofs: 254 */
#define EEPROM_REGULATORY_BAND_3_CHANNELS (2*0x80) /* 24 bytes */
- struct iwl_eeprom_channel band_3_channels[12]; /* abs.ofs: 256 */
+ struct iwl4965_eeprom_channel band_3_channels[12]; /* abs.ofs: 256 */
#define EEPROM_REGULATORY_BAND_4 (2*0x8C) /* 2 bytes */
u16 band_4_count; /* abs.ofs: 280 */
#define EEPROM_REGULATORY_BAND_4_CHANNELS (2*0x8D) /* 22 bytes */
- struct iwl_eeprom_channel band_4_channels[11]; /* abs.ofs: 282 */
+ struct iwl4965_eeprom_channel band_4_channels[11]; /* abs.ofs: 282 */
#define EEPROM_REGULATORY_BAND_5 (2*0x98) /* 2 bytes */
u16 band_5_count; /* abs.ofs: 304 */
#define EEPROM_REGULATORY_BAND_5_CHANNELS (2*0x99) /* 12 bytes */
- struct iwl_eeprom_channel band_5_channels[6]; /* abs.ofs: 306 */
+ struct iwl4965_eeprom_channel band_5_channels[6]; /* abs.ofs: 306 */
u8 reserved10[2];
#define EEPROM_REGULATORY_BAND_24_FAT_CHANNELS (2*0xA0) /* 14 bytes */
- struct iwl_eeprom_channel band_24_channels[7]; /* abs.ofs: 320 */
+ struct iwl4965_eeprom_channel band_24_channels[7]; /* abs.ofs: 320 */
u8 reserved11[2];
#define EEPROM_REGULATORY_BAND_52_FAT_CHANNELS (2*0xA8) /* 22 bytes */
- struct iwl_eeprom_channel band_52_channels[11]; /* abs.ofs: 336 */
+ struct iwl4965_eeprom_channel band_52_channels[11]; /* abs.ofs: 336 */
u8 reserved12[6];
#define EEPROM_CALIB_VERSION_OFFSET (2*0xB6) /* 2 bytes */
u16 calib_version; /* abs.ofs: 364 */
u16 satruation_power; /* abs.ofs: 368 */
u8 reserved14[94];
#define EEPROM_IWL_CALIB_TXPOWER_OFFSET (2*0xE8) /* 48 bytes */
- struct iwl_eeprom_calib_info calib_info; /* abs.ofs: 464 */
+ struct iwl4965_eeprom_calib_info calib_info; /* abs.ofs: 464 */
u8 reserved16[140]; /* fill out to full 1024 byte block */
#define TFD_TX_CMD_SLOTS 256
#define TFD_CMD_SLOTS 32
-#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
#define IWL_MAX_INST_SIZE KDR_RTC_INST_SIZE
#define IWL_MAX_DATA_SIZE KDR_RTC_DATA_SIZE
-static inline int iwl_hw_valid_rtc_data_addr(u32 addr)
+static inline int iwl4965_hw_valid_rtc_data_addr(u32 addr)
{
return (addr >= RTC_DATA_LOWER_BOUND) &&
(addr < KDR_RTC_DATA_UPPER_BOUND);
#define CALIB_IWL_TX_ATTEN_GR5_LCH 20
-union iwl_tx_power_dual_stream {
+union iwl4965_tx_power_dual_stream {
struct {
u8 radio_tx_gain[2];
u8 dsp_predis_atten[2];
#define CSR_HW_IF_CONFIG_REG_BIT_MAC_SI (0x00000100)
#define CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI (0x00000200)
-static inline u8 iwl_hw_get_rate(__le32 rate_n_flags)
+static inline u8 iwl4965_hw_get_rate(__le32 rate_n_flags)
{
return le32_to_cpu(rate_n_flags) & 0xFF;
}
-static inline u16 iwl_hw_get_rate_n_flags(__le32 rate_n_flags)
+static inline u16 iwl4965_hw_get_rate_n_flags(__le32 rate_n_flags)
{
return le32_to_cpu(rate_n_flags) & 0xFFFF;
}
-static inline __le32 iwl_hw_set_rate_n_flags(u8 rate, u16 flags)
+static inline __le32 iwl4965_hw_set_rate_n_flags(u8 rate, u16 flags)
{
return cpu_to_le32(flags|(u16)rate);
}
-struct iwl_tfd_frame_data {
+struct iwl4965_tfd_frame_data {
__le32 tb1_addr;
__le32 val1;
#define IWL_tb2_len_SYM val2
} __attribute__ ((packed));
-struct iwl_tfd_frame {
+struct iwl4965_tfd_frame {
__le32 val0;
/* __le32 rsvd1:24; */
/* __le32 num_tbs:5; */
#define IWL_num_tbs_SYM val0
/* __le32 rsvd2:1; */
/* __le32 padding:2; */
- struct iwl_tfd_frame_data pa[10];
+ struct iwl4965_tfd_frame_data pa[10];
__le32 reserved;
} __attribute__ ((packed));
sizeof(__le16)];
} __attribute__ ((packed));
-/* Base physical address of iwl_shared is provided to KDR_SCD_DRAM_BASE_ADDR
- * and &iwl_shared.val0 is provided to FH_RSCSR_CHNL0_STTS_WPTR_REG */
-struct iwl_shared {
+/* Base physical address of iwl4965_shared is provided to KDR_SCD_DRAM_BASE_ADDR
+ * and &iwl4965_shared.val0 is provided to FH_RSCSR_CHNL0_STTS_WPTR_REG */
+struct iwl4965_shared {
struct iwl4965_sched_queue_byte_cnt_tbl
queues_byte_cnt_tbls[IWL_MAX_NUM_QUEUES];
__le32 val0;
__le32 padding2;
} __attribute__ ((packed));
-#endif /* __iwl_4965_hw_h__ */
+#endif /* __iwl4965_4965_hw_h__ */
*
*****************************************************************************/
-#ifndef __iwl_io_h__
-#define __iwl_io_h__
+#ifndef __iwl4965_io_h__
+#define __iwl4965_io_h__
#include <linux/io.h>
*
* If you wish to call the function without any debug or state checking,
* you should use the single _ prefix version (as is used by dependent IO
- * routines, for example _iwl_read_direct32 calls the non-check version of
- * _iwl_read32.)
+ * routines, for example _iwl4965_read_direct32 calls the non-check version of
+ * _iwl4965_read32.)
*
* These declarations are *extremely* useful in quickly isolating code deltas
* which result in misconfiguring of the hardware I/O. In combination with
*
*/
-#define _iwl_write32(iwl, ofs, val) writel((val), (iwl)->hw_base + (ofs))
+#define _iwl4965_write32(iwl, ofs, val) writel((val), (iwl)->hw_base + (ofs))
#ifdef CONFIG_IWL4965_DEBUG
-static inline void __iwl_write32(const char *f, u32 l, struct iwl_priv *iwl,
+static inline void __iwl4965_write32(const char *f, u32 l, struct iwl4965_priv *iwl,
u32 ofs, u32 val)
{
IWL_DEBUG_IO("write32(0x%08X, 0x%08X) - %s %d\n", ofs, val, f, l);
- _iwl_write32(iwl, ofs, val);
+ _iwl4965_write32(iwl, ofs, val);
}
-#define iwl_write32(iwl, ofs, val) \
- __iwl_write32(__FILE__, __LINE__, iwl, ofs, val)
+#define iwl4965_write32(iwl, ofs, val) \
+ __iwl4965_write32(__FILE__, __LINE__, iwl, ofs, val)
#else
-#define iwl_write32(iwl, ofs, val) _iwl_write32(iwl, ofs, val)
+#define iwl4965_write32(iwl, ofs, val) _iwl4965_write32(iwl, ofs, val)
#endif
-#define _iwl_read32(iwl, ofs) readl((iwl)->hw_base + (ofs))
+#define _iwl4965_read32(iwl, ofs) readl((iwl)->hw_base + (ofs))
#ifdef CONFIG_IWL4965_DEBUG
-static inline u32 __iwl_read32(char *f, u32 l, struct iwl_priv *iwl, u32 ofs)
+static inline u32 __iwl4965_read32(char *f, u32 l, struct iwl4965_priv *iwl, u32 ofs)
{
IWL_DEBUG_IO("read_direct32(0x%08X) - %s %d\n", ofs, f, l);
- return _iwl_read32(iwl, ofs);
+ return _iwl4965_read32(iwl, ofs);
}
-#define iwl_read32(iwl, ofs) __iwl_read32(__FILE__, __LINE__, iwl, ofs)
+#define iwl4965_read32(iwl, ofs) __iwl4965_read32(__FILE__, __LINE__, iwl, ofs)
#else
-#define iwl_read32(p, o) _iwl_read32(p, o)
+#define iwl4965_read32(p, o) _iwl4965_read32(p, o)
#endif
-static inline int _iwl_poll_bit(struct iwl_priv *priv, u32 addr,
+static inline int _iwl4965_poll_bit(struct iwl4965_priv *priv, u32 addr,
u32 bits, u32 mask, int timeout)
{
int i = 0;
do {
- if ((_iwl_read32(priv, addr) & mask) == (bits & mask))
+ if ((_iwl4965_read32(priv, addr) & mask) == (bits & mask))
return i;
mdelay(10);
i += 10;
return -ETIMEDOUT;
}
#ifdef CONFIG_IWL4965_DEBUG
-static inline int __iwl_poll_bit(const char *f, u32 l,
- struct iwl_priv *priv, u32 addr,
+static inline int __iwl4965_poll_bit(const char *f, u32 l,
+ struct iwl4965_priv *priv, u32 addr,
u32 bits, u32 mask, int timeout)
{
- int ret = _iwl_poll_bit(priv, addr, bits, mask, timeout);
+ int ret = _iwl4965_poll_bit(priv, addr, bits, mask, timeout);
if (unlikely(ret == -ETIMEDOUT))
IWL_DEBUG_IO
("poll_bit(0x%08X, 0x%08X, 0x%08X) - timedout - %s %d\n",
addr, bits, mask, ret, f, l);
return ret;
}
-#define iwl_poll_bit(iwl, addr, bits, mask, timeout) \
- __iwl_poll_bit(__FILE__, __LINE__, iwl, addr, bits, mask, timeout)
+#define iwl4965_poll_bit(iwl, addr, bits, mask, timeout) \
+ __iwl4965_poll_bit(__FILE__, __LINE__, iwl, addr, bits, mask, timeout)
#else
-#define iwl_poll_bit(p, a, b, m, t) _iwl_poll_bit(p, a, b, m, t)
+#define iwl4965_poll_bit(p, a, b, m, t) _iwl4965_poll_bit(p, a, b, m, t)
#endif
-static inline void _iwl_set_bit(struct iwl_priv *priv, u32 reg, u32 mask)
+static inline void _iwl4965_set_bit(struct iwl4965_priv *priv, u32 reg, u32 mask)
{
- _iwl_write32(priv, reg, _iwl_read32(priv, reg) | mask);
+ _iwl4965_write32(priv, reg, _iwl4965_read32(priv, reg) | mask);
}
#ifdef CONFIG_IWL4965_DEBUG
-static inline void __iwl_set_bit(const char *f, u32 l,
- struct iwl_priv *priv, u32 reg, u32 mask)
+static inline void __iwl4965_set_bit(const char *f, u32 l,
+ struct iwl4965_priv *priv, u32 reg, u32 mask)
{
- u32 val = _iwl_read32(priv, reg) | mask;
+ u32 val = _iwl4965_read32(priv, reg) | mask;
IWL_DEBUG_IO("set_bit(0x%08X, 0x%08X) = 0x%08X\n", reg, mask, val);
- _iwl_write32(priv, reg, val);
+ _iwl4965_write32(priv, reg, val);
}
-#define iwl_set_bit(p, r, m) __iwl_set_bit(__FILE__, __LINE__, p, r, m)
+#define iwl4965_set_bit(p, r, m) __iwl4965_set_bit(__FILE__, __LINE__, p, r, m)
#else
-#define iwl_set_bit(p, r, m) _iwl_set_bit(p, r, m)
+#define iwl4965_set_bit(p, r, m) _iwl4965_set_bit(p, r, m)
#endif
-static inline void _iwl_clear_bit(struct iwl_priv *priv, u32 reg, u32 mask)
+static inline void _iwl4965_clear_bit(struct iwl4965_priv *priv, u32 reg, u32 mask)
{
- _iwl_write32(priv, reg, _iwl_read32(priv, reg) & ~mask);
+ _iwl4965_write32(priv, reg, _iwl4965_read32(priv, reg) & ~mask);
}
#ifdef CONFIG_IWL4965_DEBUG
-static inline void __iwl_clear_bit(const char *f, u32 l,
- struct iwl_priv *priv, u32 reg, u32 mask)
+static inline void __iwl4965_clear_bit(const char *f, u32 l,
+ struct iwl4965_priv *priv, u32 reg, u32 mask)
{
- u32 val = _iwl_read32(priv, reg) & ~mask;
+ u32 val = _iwl4965_read32(priv, reg) & ~mask;
IWL_DEBUG_IO("clear_bit(0x%08X, 0x%08X) = 0x%08X\n", reg, mask, val);
- _iwl_write32(priv, reg, val);
+ _iwl4965_write32(priv, reg, val);
}
-#define iwl_clear_bit(p, r, m) __iwl_clear_bit(__FILE__, __LINE__, p, r, m)
+#define iwl4965_clear_bit(p, r, m) __iwl4965_clear_bit(__FILE__, __LINE__, p, r, m)
#else
-#define iwl_clear_bit(p, r, m) _iwl_clear_bit(p, r, m)
+#define iwl4965_clear_bit(p, r, m) _iwl4965_clear_bit(p, r, m)
#endif
-static inline int _iwl_grab_nic_access(struct iwl_priv *priv)
+static inline int _iwl4965_grab_nic_access(struct iwl4965_priv *priv)
{
int ret;
u32 gp_ctl;
"wakes up NIC\n");
/* 10 msec allows time for NIC to complete its data save */
- gp_ctl = _iwl_read32(priv, CSR_GP_CNTRL);
+ gp_ctl = _iwl4965_read32(priv, CSR_GP_CNTRL);
if (gp_ctl & CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY) {
IWL_DEBUG_RF_KILL("Wait for complete power-down, "
"gpctl = 0x%08x\n", gp_ctl);
}
/* this bit wakes up the NIC */
- _iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
- ret = _iwl_poll_bit(priv, CSR_GP_CNTRL,
+ _iwl4965_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
+ ret = _iwl4965_poll_bit(priv, CSR_GP_CNTRL,
CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN,
(CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY |
CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP), 50);
}
#ifdef CONFIG_IWL4965_DEBUG
-static inline int __iwl_grab_nic_access(const char *f, u32 l,
- struct iwl_priv *priv)
+static inline int __iwl4965_grab_nic_access(const char *f, u32 l,
+ struct iwl4965_priv *priv)
{
if (atomic_read(&priv->restrict_refcnt))
IWL_DEBUG_INFO("Grabbing access while already held at "
"line %d.\n", l);
IWL_DEBUG_IO("grabbing nic access - %s %d\n", f, l);
- return _iwl_grab_nic_access(priv);
+ return _iwl4965_grab_nic_access(priv);
}
-#define iwl_grab_nic_access(priv) \
- __iwl_grab_nic_access(__FILE__, __LINE__, priv)
+#define iwl4965_grab_nic_access(priv) \
+ __iwl4965_grab_nic_access(__FILE__, __LINE__, priv)
#else
-#define iwl_grab_nic_access(priv) \
- _iwl_grab_nic_access(priv)
+#define iwl4965_grab_nic_access(priv) \
+ _iwl4965_grab_nic_access(priv)
#endif
-static inline void _iwl_release_nic_access(struct iwl_priv *priv)
+static inline void _iwl4965_release_nic_access(struct iwl4965_priv *priv)
{
#ifdef CONFIG_IWL4965_DEBUG
if (atomic_dec_and_test(&priv->restrict_refcnt))
#endif
- _iwl_clear_bit(priv, CSR_GP_CNTRL,
+ _iwl4965_clear_bit(priv, CSR_GP_CNTRL,
CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
}
#ifdef CONFIG_IWL4965_DEBUG
-static inline void __iwl_release_nic_access(const char *f, u32 l,
- struct iwl_priv *priv)
+static inline void __iwl4965_release_nic_access(const char *f, u32 l,
+ struct iwl4965_priv *priv)
{
if (atomic_read(&priv->restrict_refcnt) <= 0)
IWL_ERROR("Release unheld nic access at line %d.\n", l);
IWL_DEBUG_IO("releasing nic access - %s %d\n", f, l);
- _iwl_release_nic_access(priv);
+ _iwl4965_release_nic_access(priv);
}
-#define iwl_release_nic_access(priv) \
- __iwl_release_nic_access(__FILE__, __LINE__, priv)
+#define iwl4965_release_nic_access(priv) \
+ __iwl4965_release_nic_access(__FILE__, __LINE__, priv)
#else
-#define iwl_release_nic_access(priv) \
- _iwl_release_nic_access(priv)
+#define iwl4965_release_nic_access(priv) \
+ _iwl4965_release_nic_access(priv)
#endif
-static inline u32 _iwl_read_direct32(struct iwl_priv *priv, u32 reg)
+static inline u32 _iwl4965_read_direct32(struct iwl4965_priv *priv, u32 reg)
{
- return _iwl_read32(priv, reg);
+ return _iwl4965_read32(priv, reg);
}
#ifdef CONFIG_IWL4965_DEBUG
-static inline u32 __iwl_read_direct32(const char *f, u32 l,
- struct iwl_priv *priv, u32 reg)
+static inline u32 __iwl4965_read_direct32(const char *f, u32 l,
+ struct iwl4965_priv *priv, u32 reg)
{
- u32 value = _iwl_read_direct32(priv, reg);
+ u32 value = _iwl4965_read_direct32(priv, reg);
if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access not held from %s %d\n", f, l);
IWL_DEBUG_IO("read_direct32(0x%4X) = 0x%08x - %s %d \n", reg, value,
f, l);
return value;
}
-#define iwl_read_direct32(priv, reg) \
- __iwl_read_direct32(__FILE__, __LINE__, priv, reg)
+#define iwl4965_read_direct32(priv, reg) \
+ __iwl4965_read_direct32(__FILE__, __LINE__, priv, reg)
#else
-#define iwl_read_direct32 _iwl_read_direct32
+#define iwl4965_read_direct32 _iwl4965_read_direct32
#endif
-static inline void _iwl_write_direct32(struct iwl_priv *priv,
+static inline void _iwl4965_write_direct32(struct iwl4965_priv *priv,
u32 reg, u32 value)
{
- _iwl_write32(priv, reg, value);
+ _iwl4965_write32(priv, reg, value);
}
#ifdef CONFIG_IWL4965_DEBUG
-static void __iwl_write_direct32(u32 line,
- struct iwl_priv *priv, u32 reg, u32 value)
+static void __iwl4965_write_direct32(u32 line,
+ struct iwl4965_priv *priv, u32 reg, u32 value)
{
if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access not held from line %d\n", line);
- _iwl_write_direct32(priv, reg, value);
+ _iwl4965_write_direct32(priv, reg, value);
}
-#define iwl_write_direct32(priv, reg, value) \
- __iwl_write_direct32(__LINE__, priv, reg, value)
+#define iwl4965_write_direct32(priv, reg, value) \
+ __iwl4965_write_direct32(__LINE__, priv, reg, value)
#else
-#define iwl_write_direct32 _iwl_write_direct32
+#define iwl4965_write_direct32 _iwl4965_write_direct32
#endif
-static inline void iwl_write_reg_buf(struct iwl_priv *priv,
+static inline void iwl4965_write_reg_buf(struct iwl4965_priv *priv,
u32 reg, u32 len, u32 *values)
{
u32 count = sizeof(u32);
if ((priv != NULL) && (values != NULL)) {
for (; 0 < len; len -= count, reg += count, values++)
- _iwl_write_direct32(priv, reg, *values);
+ _iwl4965_write_direct32(priv, reg, *values);
}
}
-static inline int _iwl_poll_direct_bit(struct iwl_priv *priv,
+static inline int _iwl4965_poll_direct_bit(struct iwl4965_priv *priv,
u32 addr, u32 mask, int timeout)
{
int i = 0;
do {
- if ((_iwl_read_direct32(priv, addr) & mask) == mask)
+ if ((_iwl4965_read_direct32(priv, addr) & mask) == mask)
return i;
mdelay(10);
i += 10;
}
#ifdef CONFIG_IWL4965_DEBUG
-static inline int __iwl_poll_direct_bit(const char *f, u32 l,
- struct iwl_priv *priv,
+static inline int __iwl4965_poll_direct_bit(const char *f, u32 l,
+ struct iwl4965_priv *priv,
u32 addr, u32 mask, int timeout)
{
- int ret = _iwl_poll_direct_bit(priv, addr, mask, timeout);
+ int ret = _iwl4965_poll_direct_bit(priv, addr, mask, timeout);
if (unlikely(ret == -ETIMEDOUT))
IWL_DEBUG_IO("poll_direct_bit(0x%08X, 0x%08X) - "
"- %s %d\n", addr, mask, ret, f, l);
return ret;
}
-#define iwl_poll_direct_bit(iwl, addr, mask, timeout) \
- __iwl_poll_direct_bit(__FILE__, __LINE__, iwl, addr, mask, timeout)
+#define iwl4965_poll_direct_bit(iwl, addr, mask, timeout) \
+ __iwl4965_poll_direct_bit(__FILE__, __LINE__, iwl, addr, mask, timeout)
#else
-#define iwl_poll_direct_bit _iwl_poll_direct_bit
+#define iwl4965_poll_direct_bit _iwl4965_poll_direct_bit
#endif
-static inline u32 _iwl_read_prph(struct iwl_priv *priv, u32 reg)
+static inline u32 _iwl4965_read_prph(struct iwl4965_priv *priv, u32 reg)
{
- _iwl_write_direct32(priv, HBUS_TARG_PRPH_RADDR, reg | (3 << 24));
- return _iwl_read_direct32(priv, HBUS_TARG_PRPH_RDAT);
+ _iwl4965_write_direct32(priv, HBUS_TARG_PRPH_RADDR, reg | (3 << 24));
+ return _iwl4965_read_direct32(priv, HBUS_TARG_PRPH_RDAT);
}
#ifdef CONFIG_IWL4965_DEBUG
-static inline u32 __iwl_read_prph(u32 line, struct iwl_priv *priv, u32 reg)
+static inline u32 __iwl4965_read_prph(u32 line, struct iwl4965_priv *priv, u32 reg)
{
if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access not held from line %d\n", line);
- return _iwl_read_prph(priv, reg);
+ return _iwl4965_read_prph(priv, reg);
}
-#define iwl_read_prph(priv, reg) \
- __iwl_read_prph(__LINE__, priv, reg)
+#define iwl4965_read_prph(priv, reg) \
+ __iwl4965_read_prph(__LINE__, priv, reg)
#else
-#define iwl_read_prph _iwl_read_prph
+#define iwl4965_read_prph _iwl4965_read_prph
#endif
-static inline void _iwl_write_prph(struct iwl_priv *priv,
+static inline void _iwl4965_write_prph(struct iwl4965_priv *priv,
u32 addr, u32 val)
{
- _iwl_write_direct32(priv, HBUS_TARG_PRPH_WADDR,
+ _iwl4965_write_direct32(priv, HBUS_TARG_PRPH_WADDR,
((addr & 0x0000FFFF) | (3 << 24)));
- _iwl_write_direct32(priv, HBUS_TARG_PRPH_WDAT, val);
+ _iwl4965_write_direct32(priv, HBUS_TARG_PRPH_WDAT, val);
}
#ifdef CONFIG_IWL4965_DEBUG
-static inline void __iwl_write_prph(u32 line, struct iwl_priv *priv,
+static inline void __iwl4965_write_prph(u32 line, struct iwl4965_priv *priv,
u32 addr, u32 val)
{
if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access from line %d\n", line);
- _iwl_write_prph(priv, addr, val);
+ _iwl4965_write_prph(priv, addr, val);
}
-#define iwl_write_prph(priv, addr, val) \
- __iwl_write_prph(__LINE__, priv, addr, val);
+#define iwl4965_write_prph(priv, addr, val) \
+ __iwl4965_write_prph(__LINE__, priv, addr, val);
#else
-#define iwl_write_prph _iwl_write_prph
+#define iwl4965_write_prph _iwl4965_write_prph
#endif
-#define _iwl_set_bits_prph(priv, reg, mask) \
- _iwl_write_prph(priv, reg, (_iwl_read_prph(priv, reg) | mask))
+#define _iwl4965_set_bits_prph(priv, reg, mask) \
+ _iwl4965_write_prph(priv, reg, (_iwl4965_read_prph(priv, reg) | mask))
#ifdef CONFIG_IWL4965_DEBUG
-static inline void __iwl_set_bits_prph(u32 line, struct iwl_priv *priv,
+static inline void __iwl4965_set_bits_prph(u32 line, struct iwl4965_priv *priv,
u32 reg, u32 mask)
{
if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access not held from line %d\n", line);
- _iwl_set_bits_prph(priv, reg, mask);
+ _iwl4965_set_bits_prph(priv, reg, mask);
}
-#define iwl_set_bits_prph(priv, reg, mask) \
- __iwl_set_bits_prph(__LINE__, priv, reg, mask)
+#define iwl4965_set_bits_prph(priv, reg, mask) \
+ __iwl4965_set_bits_prph(__LINE__, priv, reg, mask)
#else
-#define iwl_set_bits_prph _iwl_set_bits_prph
+#define iwl4965_set_bits_prph _iwl4965_set_bits_prph
#endif
-#define _iwl_set_bits_mask_prph(priv, reg, bits, mask) \
- _iwl_write_prph(priv, reg, ((_iwl_read_prph(priv, reg) & mask) | bits))
+#define _iwl4965_set_bits_mask_prph(priv, reg, bits, mask) \
+ _iwl4965_write_prph(priv, reg, ((_iwl4965_read_prph(priv, reg) & mask) | bits))
#ifdef CONFIG_IWL4965_DEBUG
-static inline void __iwl_set_bits_mask_prph(u32 line,
- struct iwl_priv *priv, u32 reg, u32 bits, u32 mask)
+static inline void __iwl4965_set_bits_mask_prph(u32 line,
+ struct iwl4965_priv *priv, u32 reg, u32 bits, u32 mask)
{
if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access not held from line %d\n", line);
- _iwl_set_bits_mask_prph(priv, reg, bits, mask);
+ _iwl4965_set_bits_mask_prph(priv, reg, bits, mask);
}
-#define iwl_set_bits_mask_prph(priv, reg, bits, mask) \
- __iwl_set_bits_mask_prph(__LINE__, priv, reg, bits, mask)
+#define iwl4965_set_bits_mask_prph(priv, reg, bits, mask) \
+ __iwl4965_set_bits_mask_prph(__LINE__, priv, reg, bits, mask)
#else
-#define iwl_set_bits_mask_prph _iwl_set_bits_mask_prph
+#define iwl4965_set_bits_mask_prph _iwl4965_set_bits_mask_prph
#endif
-static inline void iwl_clear_bits_prph(struct iwl_priv
+static inline void iwl4965_clear_bits_prph(struct iwl4965_priv
*priv, u32 reg, u32 mask)
{
- u32 val = _iwl_read_prph(priv, reg);
- _iwl_write_prph(priv, reg, (val & ~mask));
+ u32 val = _iwl4965_read_prph(priv, reg);
+ _iwl4965_write_prph(priv, reg, (val & ~mask));
}
-static inline u32 iwl_read_targ_mem(struct iwl_priv *priv, u32 addr)
+static inline u32 iwl4965_read_targ_mem(struct iwl4965_priv *priv, u32 addr)
{
- iwl_write_direct32(priv, HBUS_TARG_MEM_RADDR, addr);
- return iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT);
+ iwl4965_write_direct32(priv, HBUS_TARG_MEM_RADDR, addr);
+ return iwl4965_read_direct32(priv, HBUS_TARG_MEM_RDAT);
}
-static inline void iwl_write_targ_mem(struct iwl_priv *priv, u32 addr, u32 val)
+static inline void iwl4965_write_targ_mem(struct iwl4965_priv *priv, u32 addr, u32 val)
{
- iwl_write_direct32(priv, HBUS_TARG_MEM_WADDR, addr);
- iwl_write_direct32(priv, HBUS_TARG_MEM_WDAT, val);
+ iwl4965_write_direct32(priv, HBUS_TARG_MEM_WADDR, addr);
+ iwl4965_write_direct32(priv, HBUS_TARG_MEM_WDAT, val);
}
-static inline void iwl_write_targ_mem_buf(struct iwl_priv *priv, u32 addr,
+static inline void iwl4965_write_targ_mem_buf(struct iwl4965_priv *priv, u32 addr,
u32 len, u32 *values)
{
- iwl_write_direct32(priv, HBUS_TARG_MEM_WADDR, addr);
+ iwl4965_write_direct32(priv, HBUS_TARG_MEM_WADDR, addr);
for (; 0 < len; len -= sizeof(u32), values++)
- iwl_write_direct32(priv, HBUS_TARG_MEM_WDAT, *values);
+ iwl4965_write_direct32(priv, HBUS_TARG_MEM_WDAT, *values);
}
#endif
IWL_RATE_48M_INDEX, IWL_RATE_54M_INDEX
};
-struct iwl_rate {
+struct iwl4965_rate {
u32 rate_n_flags;
} __attribute__ ((packed));
-struct iwl_rate_scale_data {
+struct iwl4965_rate_scale_data {
u64 data;
s32 success_counter;
s32 success_ratio;
unsigned long stamp;
};
-struct iwl_scale_tbl_info {
- enum iwl_table_type lq_type;
- enum iwl_antenna_type antenna_type;
+struct iwl4965_scale_tbl_info {
+ enum iwl4965_table_type lq_type;
+ enum iwl4965_antenna_type antenna_type;
u8 is_SGI;
u8 is_fat;
u8 is_dup;
u8 action;
s32 *expected_tpt;
- struct iwl_rate current_rate;
- struct iwl_rate_scale_data win[IWL_RATE_COUNT];
+ struct iwl4965_rate current_rate;
+ struct iwl4965_rate_scale_data win[IWL_RATE_COUNT];
};
-struct iwl_rate_scale_priv {
+struct iwl4965_rate_scale_priv {
u8 active_tbl;
u8 enable_counter;
u8 stay_in_tbl;
u16 active_siso_rate;
u16 active_mimo_rate;
u16 active_rate_basic;
- struct iwl_link_quality_cmd lq;
- struct iwl_scale_tbl_info lq_info[LQ_SIZE];
+ struct iwl4965_link_quality_cmd lq;
+ struct iwl4965_scale_tbl_info lq_info[LQ_SIZE];
#ifdef CONFIG_MAC80211_DEBUGFS
struct dentry *rs_sta_dbgfs_scale_table_file;
struct dentry *rs_sta_dbgfs_stats_table_file;
- struct iwl_rate dbg_fixed;
- struct iwl_priv *drv;
+ struct iwl4965_rate dbg_fixed;
+ struct iwl4965_priv *drv;
#endif
};
-static void rs_rate_scale_perform(struct iwl_priv *priv,
+static void rs_rate_scale_perform(struct iwl4965_priv *priv,
struct net_device *dev,
struct ieee80211_hdr *hdr,
struct sta_info *sta);
-static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
- struct iwl_rate *tx_mcs,
- struct iwl_link_quality_cmd *tbl);
+static void rs_fill_link_cmd(struct iwl4965_rate_scale_priv *lq_data,
+ struct iwl4965_rate *tx_mcs,
+ struct iwl4965_link_quality_cmd *tbl);
#ifdef CONFIG_MAC80211_DEBUGFS
-static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv,
- struct iwl_rate *mcs, int index);
+static void rs_dbgfs_set_mcs(struct iwl4965_rate_scale_priv *rs_priv,
+ struct iwl4965_rate *mcs, int index);
#else
-static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv,
- struct iwl_rate *mcs, int index)
+static void rs_dbgfs_set_mcs(struct iwl4965_rate_scale_priv *rs_priv,
+ struct iwl4965_rate *mcs, int index)
{}
#endif
static s32 expected_tpt_A[IWL_RATE_COUNT] = {
0, 0, 0, 0, 131, 131, 191, 222, 242, 270, 284, 289, 293
};
-static int iwl_lq_sync_callback(struct iwl_priv *priv,
- struct iwl_cmd *cmd, struct sk_buff *skb)
+static int iwl4965_lq_sync_callback(struct iwl4965_priv *priv,
+ struct iwl4965_cmd *cmd, struct sk_buff *skb)
{
/*We didn't cache the SKB; let the caller free it */
return 1;
}
-static inline u8 iwl_rate_get_rate(u32 rate_n_flags)
+static inline u8 iwl4965_rate_get_rate(u32 rate_n_flags)
{
return (u8)(rate_n_flags & 0xFF);
}
-static int rs_send_lq_cmd(struct iwl_priv *priv,
- struct iwl_link_quality_cmd *lq, u8 flags)
+static int rs_send_lq_cmd(struct iwl4965_priv *priv,
+ struct iwl4965_link_quality_cmd *lq, u8 flags)
{
#ifdef CONFIG_IWL4965_DEBUG
int i;
#endif
- struct iwl_host_cmd cmd = {
+ struct iwl4965_host_cmd cmd = {
.id = REPLY_TX_LINK_QUALITY_CMD,
- .len = sizeof(struct iwl_link_quality_cmd),
+ .len = sizeof(struct iwl4965_link_quality_cmd),
.meta.flags = flags,
.data = lq,
};
#endif
if (flags & CMD_ASYNC)
- cmd.meta.u.callback = iwl_lq_sync_callback;
+ cmd.meta.u.callback = iwl4965_lq_sync_callback;
- if (iwl_is_associated(priv) && priv->assoc_station_added &&
+ if (iwl4965_is_associated(priv) && priv->assoc_station_added &&
priv->lq_mngr.lq_ready)
- return iwl_send_cmd(priv, &cmd);
+ return iwl4965_send_cmd(priv, &cmd);
return 0;
}
-static void rs_rate_scale_clear_window(struct iwl_rate_scale_data *window)
+static void rs_rate_scale_clear_window(struct iwl4965_rate_scale_data *window)
{
window->data = 0;
window->success_counter = 0;
window->stamp = 0;
}
-static int rs_collect_tx_data(struct iwl_rate_scale_data *windows,
+static int rs_collect_tx_data(struct iwl4965_rate_scale_data *windows,
int scale_index, s32 tpt, u32 status)
{
- struct iwl_rate_scale_data *window = NULL;
+ struct iwl4965_rate_scale_data *window = NULL;
u64 mask;
u8 win_size = IWL_RATE_MAX_WINDOW;
s32 fail_count;
return 0;
}
-static void rs_mcs_from_tbl(struct iwl_rate *mcs_rate,
- struct iwl_scale_tbl_info *tbl,
+static void rs_mcs_from_tbl(struct iwl4965_rate *mcs_rate,
+ struct iwl4965_scale_tbl_info *tbl,
int index, u8 use_green)
{
if (is_legacy(tbl->lq_type)) {
- mcs_rate->rate_n_flags = iwl_rates[index].plcp;
+ mcs_rate->rate_n_flags = iwl4965_rates[index].plcp;
if (index >= IWL_FIRST_CCK_RATE && index <= IWL_LAST_CCK_RATE)
mcs_rate->rate_n_flags |= RATE_MCS_CCK_MSK;
} else if (is_siso(tbl->lq_type)) {
if (index > IWL_LAST_OFDM_RATE)
index = IWL_LAST_OFDM_RATE;
- mcs_rate->rate_n_flags = iwl_rates[index].plcp_siso |
+ mcs_rate->rate_n_flags = iwl4965_rates[index].plcp_siso |
RATE_MCS_HT_MSK;
} else {
if (index > IWL_LAST_OFDM_RATE)
index = IWL_LAST_OFDM_RATE;
- mcs_rate->rate_n_flags = iwl_rates[index].plcp_mimo |
+ mcs_rate->rate_n_flags = iwl4965_rates[index].plcp_mimo |
RATE_MCS_HT_MSK;
}
}
}
-static int rs_get_tbl_info_from_mcs(const struct iwl_rate *mcs_rate,
- int phymode, struct iwl_scale_tbl_info *tbl,
+static int rs_get_tbl_info_from_mcs(const struct iwl4965_rate *mcs_rate,
+ int phymode, struct iwl4965_scale_tbl_info *tbl,
int *rate_idx)
{
int index;
u32 ant_msk;
- index = iwl_rate_index_from_plcp(mcs_rate->rate_n_flags);
+ index = iwl4965_rate_index_from_plcp(mcs_rate->rate_n_flags);
if (index == IWL_RATE_INVALID) {
*rate_idx = -1;
}
*rate_idx = index;
- } else if (iwl_rate_get_rate(mcs_rate->rate_n_flags)
+ } else if (iwl4965_rate_get_rate(mcs_rate->rate_n_flags)
<= IWL_RATE_SISO_60M_PLCP) {
tbl->lq_type = LQ_SISO;
return 0;
}
-static inline void rs_toggle_antenna(struct iwl_rate *new_rate,
- struct iwl_scale_tbl_info *tbl)
+static inline void rs_toggle_antenna(struct iwl4965_rate *new_rate,
+ struct iwl4965_scale_tbl_info *tbl)
{
if (tbl->antenna_type == ANT_AUX) {
tbl->antenna_type = ANT_MAIN;
}
}
-static inline u8 rs_use_green(struct iwl_priv *priv)
+static inline u8 rs_use_green(struct iwl4965_priv *priv)
{
#ifdef CONFIG_IWL4965_HT
if (!priv->is_ht_enabled || !priv->current_assoc_ht.is_ht)
* basic available rates.
*
*/
-static void rs_get_supported_rates(struct iwl_rate_scale_priv *lq_data,
+static void rs_get_supported_rates(struct iwl4965_rate_scale_priv *lq_data,
struct ieee80211_hdr *hdr,
- enum iwl_table_type rate_type,
+ enum iwl4965_table_type rate_type,
u16 *data_rate)
{
if (is_legacy(rate_type))
low = index;
while (low != IWL_RATE_INVALID) {
- low = iwl_rates[low].prev_rs;
+ low = iwl4965_rates[low].prev_rs;
if (low == IWL_RATE_INVALID)
break;
if (rate_mask & (1 << low))
high = index;
while (high != IWL_RATE_INVALID) {
- high = iwl_rates[high].next_rs;
+ high = iwl4965_rates[high].next_rs;
if (high == IWL_RATE_INVALID)
break;
if (rate_mask & (1 << high))
return (high << 8) | low;
}
-static void rs_get_lower_rate(struct iwl_rate_scale_priv *lq_data,
- struct iwl_scale_tbl_info *tbl, u8 scale_index,
- u8 ht_possible, struct iwl_rate *mcs_rate)
+static void rs_get_lower_rate(struct iwl4965_rate_scale_priv *lq_data,
+ struct iwl4965_scale_tbl_info *tbl, u8 scale_index,
+ u8 ht_possible, struct iwl4965_rate *mcs_rate)
{
s32 low;
u16 rate_mask;
int status;
u8 retries;
int rs_index, index = 0;
- struct iwl_rate_scale_priv *lq;
- struct iwl_link_quality_cmd *table;
+ struct iwl4965_rate_scale_priv *lq;
+ struct iwl4965_link_quality_cmd *table;
struct sta_info *sta;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
- struct iwl_priv *priv = (struct iwl_priv *)priv_rate;
+ struct iwl4965_priv *priv = (struct iwl4965_priv *)priv_rate;
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
- struct iwl_rate_scale_data *window = NULL;
- struct iwl_rate_scale_data *search_win = NULL;
- struct iwl_rate tx_mcs;
- struct iwl_scale_tbl_info tbl_type;
- struct iwl_scale_tbl_info *curr_tbl, *search_tbl;
+ struct iwl4965_rate_scale_data *window = NULL;
+ struct iwl4965_rate_scale_data *search_win = NULL;
+ struct iwl4965_rate tx_mcs;
+ struct iwl4965_scale_tbl_info tbl_type;
+ struct iwl4965_scale_tbl_info *curr_tbl, *search_tbl;
u8 active_index = 0;
u16 fc = le16_to_cpu(hdr->frame_control);
s32 tpt = 0;
return;
}
- lq = (struct iwl_rate_scale_priv *)sta->rate_ctrl_priv;
+ lq = (struct iwl4965_rate_scale_priv *)sta->rate_ctrl_priv;
if (!priv->lq_mngr.lq_ready)
return;
lq->antenna = lq->valid_antenna;
curr_tbl = &(lq->lq_info[active_index]);
search_tbl = &(lq->lq_info[(1 - active_index)]);
- window = (struct iwl_rate_scale_data *)
+ window = (struct iwl4965_rate_scale_data *)
&(curr_tbl->win[0]);
- search_win = (struct iwl_rate_scale_data *)
+ search_win = (struct iwl4965_rate_scale_data *)
&(search_tbl->win[0]);
tx_mcs.rate_n_flags = tx_resp->control.tx_rate;
}
static u8 rs_is_ant_connected(u8 valid_antenna,
- enum iwl_antenna_type antenna_type)
+ enum iwl4965_antenna_type antenna_type)
{
if (antenna_type == ANT_AUX)
return ((valid_antenna & 0x2) ? 1:0);
}
static u8 rs_is_other_ant_connected(u8 valid_antenna,
- enum iwl_antenna_type antenna_type)
+ enum iwl4965_antenna_type antenna_type)
{
if (antenna_type == ANT_AUX)
return rs_is_ant_connected(valid_antenna, ANT_MAIN);
}
static void rs_set_stay_in_table(u8 is_legacy,
- struct iwl_rate_scale_priv *lq_data)
+ struct iwl4965_rate_scale_priv *lq_data)
{
IWL_DEBUG_HT("we are staying in the same table\n");
lq_data->stay_in_tbl = 1;
lq_data->total_success = 0;
}
-static void rs_get_expected_tpt_table(struct iwl_rate_scale_priv *lq_data,
- struct iwl_scale_tbl_info *tbl)
+static void rs_get_expected_tpt_table(struct iwl4965_rate_scale_priv *lq_data,
+ struct iwl4965_scale_tbl_info *tbl)
{
if (is_legacy(tbl->lq_type)) {
if (!is_a_band(tbl->lq_type))
}
#ifdef CONFIG_IWL4965_HT
-static s32 rs_get_best_rate(struct iwl_priv *priv,
- struct iwl_rate_scale_priv *lq_data,
- struct iwl_scale_tbl_info *tbl,
+static s32 rs_get_best_rate(struct iwl4965_priv *priv,
+ struct iwl4965_rate_scale_priv *lq_data,
+ struct iwl4965_scale_tbl_info *tbl,
u16 rate_mask, s8 index, s8 rate)
{
- struct iwl_scale_tbl_info *active_tbl =
+ struct iwl4965_scale_tbl_info *active_tbl =
&(lq_data->lq_info[lq_data->active_tbl]);
s32 new_rate, high, low, start_hi;
s32 active_sr = active_tbl->win[index].success_ratio;
return (rs_is_ant_connected(valid_antenna, ANT_BOTH));
}
-static int rs_switch_to_mimo(struct iwl_priv *priv,
- struct iwl_rate_scale_priv *lq_data,
- struct iwl_scale_tbl_info *tbl, int index)
+static int rs_switch_to_mimo(struct iwl4965_priv *priv,
+ struct iwl4965_rate_scale_priv *lq_data,
+ struct iwl4965_scale_tbl_info *tbl, int index)
{
#ifdef CONFIG_IWL4965_HT
u16 rate_mask;
#endif /*CONFIG_IWL4965_HT */
}
-static int rs_switch_to_siso(struct iwl_priv *priv,
- struct iwl_rate_scale_priv *lq_data,
- struct iwl_scale_tbl_info *tbl, int index)
+static int rs_switch_to_siso(struct iwl4965_priv *priv,
+ struct iwl4965_rate_scale_priv *lq_data,
+ struct iwl4965_scale_tbl_info *tbl, int index)
{
#ifdef CONFIG_IWL4965_HT
u16 rate_mask;
#endif /*CONFIG_IWL4965_HT */
}
-static int rs_move_legacy_other(struct iwl_priv *priv,
- struct iwl_rate_scale_priv *lq_data,
+static int rs_move_legacy_other(struct iwl4965_priv *priv,
+ struct iwl4965_rate_scale_priv *lq_data,
int index)
{
int ret = 0;
- struct iwl_scale_tbl_info *tbl =
+ struct iwl4965_scale_tbl_info *tbl =
&(lq_data->lq_info[lq_data->active_tbl]);
- struct iwl_scale_tbl_info *search_tbl =
+ struct iwl4965_scale_tbl_info *search_tbl =
&(lq_data->lq_info[(1 - lq_data->active_tbl)]);
- struct iwl_rate_scale_data *window = &(tbl->win[index]);
- u32 sz = (sizeof(struct iwl_scale_tbl_info) -
- (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT));
+ struct iwl4965_rate_scale_data *window = &(tbl->win[index]);
+ u32 sz = (sizeof(struct iwl4965_scale_tbl_info) -
+ (sizeof(struct iwl4965_rate_scale_data) * IWL_RATE_COUNT));
u8 start_action = tbl->action;
for (; ;) {
}
-static int rs_move_siso_to_other(struct iwl_priv *priv,
- struct iwl_rate_scale_priv *lq_data,
+static int rs_move_siso_to_other(struct iwl4965_priv *priv,
+ struct iwl4965_rate_scale_priv *lq_data,
int index)
{
int ret;
u8 is_green = lq_data->is_green;
- struct iwl_scale_tbl_info *tbl =
+ struct iwl4965_scale_tbl_info *tbl =
&(lq_data->lq_info[lq_data->active_tbl]);
- struct iwl_scale_tbl_info *search_tbl =
+ struct iwl4965_scale_tbl_info *search_tbl =
&(lq_data->lq_info[(1 - lq_data->active_tbl)]);
- struct iwl_rate_scale_data *window = &(tbl->win[index]);
- u32 sz = (sizeof(struct iwl_scale_tbl_info) -
- (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT));
+ struct iwl4965_rate_scale_data *window = &(tbl->win[index]);
+ u32 sz = (sizeof(struct iwl4965_scale_tbl_info) -
+ (sizeof(struct iwl4965_rate_scale_data) * IWL_RATE_COUNT));
u8 start_action = tbl->action;
for (;;) {
return 0;
}
-static int rs_move_mimo_to_other(struct iwl_priv *priv,
- struct iwl_rate_scale_priv *lq_data,
+static int rs_move_mimo_to_other(struct iwl4965_priv *priv,
+ struct iwl4965_rate_scale_priv *lq_data,
int index)
{
int ret;
s8 is_green = lq_data->is_green;
- struct iwl_scale_tbl_info *tbl =
+ struct iwl4965_scale_tbl_info *tbl =
&(lq_data->lq_info[lq_data->active_tbl]);
- struct iwl_scale_tbl_info *search_tbl =
+ struct iwl4965_scale_tbl_info *search_tbl =
&(lq_data->lq_info[(1 - lq_data->active_tbl)]);
- u32 sz = (sizeof(struct iwl_scale_tbl_info) -
- (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT));
+ u32 sz = (sizeof(struct iwl4965_scale_tbl_info) -
+ (sizeof(struct iwl4965_rate_scale_data) * IWL_RATE_COUNT));
u8 start_action = tbl->action;
for (;;) {
}
-static void rs_stay_in_table(struct iwl_rate_scale_priv *lq_data)
+static void rs_stay_in_table(struct iwl4965_rate_scale_priv *lq_data)
{
- struct iwl_scale_tbl_info *tbl;
+ struct iwl4965_scale_tbl_info *tbl;
int i;
int active_tbl;
int flush_interval_passed = 0;
}
}
-static void rs_rate_scale_perform(struct iwl_priv *priv,
+static void rs_rate_scale_perform(struct iwl4965_priv *priv,
struct net_device *dev,
struct ieee80211_hdr *hdr,
struct sta_info *sta)
int high = IWL_RATE_INVALID;
int index;
int i;
- struct iwl_rate_scale_data *window = NULL;
+ struct iwl4965_rate_scale_data *window = NULL;
int current_tpt = IWL_INVALID_VALUE;
int low_tpt = IWL_INVALID_VALUE;
int high_tpt = IWL_INVALID_VALUE;
s8 scale_action = 0;
u16 fc, rate_mask;
u8 update_lq = 0;
- struct iwl_rate_scale_priv *lq_data;
- struct iwl_scale_tbl_info *tbl, *tbl1;
+ struct iwl4965_rate_scale_priv *lq_data;
+ struct iwl4965_scale_tbl_info *tbl, *tbl1;
u16 rate_scale_index_msk = 0;
- struct iwl_rate mcs_rate;
+ struct iwl4965_rate mcs_rate;
u8 is_green = 0;
u8 active_tbl = 0;
u8 done_search = 0;
IWL_DEBUG_RATE("still rate scaling not ready\n");
return;
}
- lq_data = (struct iwl_rate_scale_priv *)sta->rate_ctrl_priv;
+ lq_data = (struct iwl4965_rate_scale_priv *)sta->rate_ctrl_priv;
if (!lq_data->search_better_tbl)
active_tbl = lq_data->active_tbl;
active_tbl = lq_data->active_tbl;
tbl = &(lq_data->lq_info[active_tbl]);
- index = iwl_rate_index_from_plcp(
+ index = iwl4965_rate_index_from_plcp(
tbl->current_rate.rate_n_flags);
update_lq = 1;
for (i = 0; i < IWL_RATE_COUNT; i++)
rs_rate_scale_clear_window(&(tbl->win[i]));
- index = iwl_rate_index_from_plcp(
+ index = iwl4965_rate_index_from_plcp(
tbl->current_rate.rate_n_flags);
IWL_DEBUG_HT("Switch current mcs: %X index: %d\n",
}
-static void rs_initialize_lq(struct iwl_priv *priv,
+static void rs_initialize_lq(struct iwl4965_priv *priv,
struct sta_info *sta)
{
int i;
- struct iwl_rate_scale_priv *lq;
- struct iwl_scale_tbl_info *tbl;
+ struct iwl4965_rate_scale_priv *lq;
+ struct iwl4965_scale_tbl_info *tbl;
u8 active_tbl = 0;
int rate_idx;
u8 use_green = rs_use_green(priv);
- struct iwl_rate mcs_rate;
+ struct iwl4965_rate mcs_rate;
if (!sta || !sta->rate_ctrl_priv)
goto out;
- lq = (struct iwl_rate_scale_priv *)sta->rate_ctrl_priv;
+ lq = (struct iwl4965_rate_scale_priv *)sta->rate_ctrl_priv;
i = sta->last_txrate;
if ((lq->lq.sta_id == 0xff) &&
if ((i < 0) || (i >= IWL_RATE_COUNT))
i = 0;
- mcs_rate.rate_n_flags = iwl_rates[i].plcp ;
+ mcs_rate.rate_n_flags = iwl4965_rates[i].plcp ;
mcs_rate.rate_n_flags |= RATE_MCS_ANT_B_MSK;
mcs_rate.rate_n_flags &= ~RATE_MCS_ANT_A_MSK;
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
struct sta_info *sta;
- struct iwl_priv *priv = (struct iwl_priv *)priv_rate;
- struct iwl_rate_scale_priv *lq;
+ struct iwl4965_priv *priv = (struct iwl4965_priv *)priv_rate;
+ struct iwl4965_rate_scale_priv *lq;
IWL_DEBUG_RATE_LIMIT("rate scale calculate new rate for skb\n");
return;
}
- lq = (struct iwl_rate_scale_priv *)sta->rate_ctrl_priv;
+ lq = (struct iwl4965_rate_scale_priv *)sta->rate_ctrl_priv;
i = sta->last_txrate;
if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && !lq->ibss_sta_added) {
- u8 sta_id = iwl_hw_find_station(priv, hdr->addr1);
+ u8 sta_id = iwl4965_hw_find_station(priv, hdr->addr1);
DECLARE_MAC_BUF(mac);
if (sta_id == IWL_INVALID_STATION) {
IWL_DEBUG_RATE("LQ: ADD station %s\n",
print_mac(mac, hdr->addr1));
- sta_id = iwl_add_station(priv,
+ sta_id = iwl4965_add_station_flags(priv,
hdr->addr1, 0, CMD_ASYNC);
}
if ((sta_id != IWL_INVALID_STATION)) {
static void *rs_alloc_sta(void *priv, gfp_t gfp)
{
- struct iwl_rate_scale_priv *crl;
+ struct iwl4965_rate_scale_priv *crl;
int i, j;
IWL_DEBUG_RATE("create station rate scale window\n");
- crl = kzalloc(sizeof(struct iwl_rate_scale_priv), gfp);
+ crl = kzalloc(sizeof(struct iwl4965_rate_scale_priv), gfp);
if (crl == NULL)
return NULL;
{
int i, j;
struct ieee80211_hw_mode *mode = local->oper_hw_mode;
- struct iwl_priv *priv = (struct iwl_priv *)priv_rate;
- struct iwl_rate_scale_priv *crl = priv_sta;
+ struct iwl4965_priv *priv = (struct iwl4965_priv *)priv_rate;
+ struct iwl4965_rate_scale_priv *crl = priv_sta;
crl->flush_timer = 0;
crl->supp_rates = sta->supp_rates;
crl->ibss_sta_added = 0;
if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {
- u8 sta_id = iwl_hw_find_station(priv, sta->addr);
+ u8 sta_id = iwl4965_hw_find_station(priv, sta->addr);
DECLARE_MAC_BUF(mac);
/* for IBSS the call are from tasklet */
if (sta_id == IWL_INVALID_STATION) {
IWL_DEBUG_RATE("LQ: ADD station %s\n",
print_mac(mac, sta->addr));
- sta_id = iwl_add_station(priv,
+ sta_id = iwl4965_add_station_flags(priv,
sta->addr, 0, CMD_ASYNC);
}
if ((sta_id != IWL_INVALID_STATION)) {
rs_initialize_lq(priv, sta);
}
-static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
- struct iwl_rate *tx_mcs,
- struct iwl_link_quality_cmd *lq_cmd)
+static void rs_fill_link_cmd(struct iwl4965_rate_scale_priv *lq_data,
+ struct iwl4965_rate *tx_mcs,
+ struct iwl4965_link_quality_cmd *lq_cmd)
{
int index = 0;
int rate_idx;
int repeat_rate = 0;
u8 ant_toggle_count = 0;
u8 use_ht_possible = 1;
- struct iwl_rate new_rate;
- struct iwl_scale_tbl_info tbl_type = { 0 };
+ struct iwl4965_rate new_rate;
+ struct iwl4965_scale_tbl_info tbl_type = { 0 };
rs_dbgfs_set_mcs(lq_data, tx_mcs, index);
static void rs_clear(void *priv_rate)
{
- struct iwl_priv *priv = (struct iwl_priv *) priv_rate;
+ struct iwl4965_priv *priv = (struct iwl4965_priv *) priv_rate;
IWL_DEBUG_RATE("enter\n");
static void rs_free_sta(void *priv, void *priv_sta)
{
- struct iwl_rate_scale_priv *rs_priv = priv_sta;
+ struct iwl4965_rate_scale_priv *rs_priv = priv_sta;
IWL_DEBUG_RATE("enter\n");
kfree(rs_priv);
file->private_data = inode->i_private;
return 0;
}
-static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv,
- struct iwl_rate *mcs, int index)
+static void rs_dbgfs_set_mcs(struct iwl4965_rate_scale_priv *rs_priv,
+ struct iwl4965_rate *mcs, int index)
{
u32 base_rate;
static ssize_t rs_sta_dbgfs_scale_table_write(struct file *file,
const char __user *user_buf, size_t count, loff_t *ppos)
{
- struct iwl_rate_scale_priv *rs_priv = file->private_data;
+ struct iwl4965_rate_scale_priv *rs_priv = file->private_data;
char buf[64];
int buf_size;
u32 parsed_rate;
int desc = 0;
int i = 0;
- struct iwl_rate_scale_priv *rs_priv = file->private_data;
+ struct iwl4965_rate_scale_priv *rs_priv = file->private_data;
desc += sprintf(buff+desc, "sta_id %d\n", rs_priv->lq.sta_id);
desc += sprintf(buff+desc, "failed=%d success=%d rate=0%X\n",
int desc = 0;
int i, j;
- struct iwl_rate_scale_priv *rs_priv = file->private_data;
+ struct iwl4965_rate_scale_priv *rs_priv = file->private_data;
for (i = 0; i < LQ_SIZE; i++) {
desc += sprintf(buff+desc, "%s type=%d SGI=%d FAT=%d DUP=%d\n"
"rate=0x%X\n",
static void rs_add_debugfs(void *priv, void *priv_sta,
struct dentry *dir)
{
- struct iwl_rate_scale_priv *rs_priv = priv_sta;
+ struct iwl4965_rate_scale_priv *rs_priv = priv_sta;
rs_priv->rs_sta_dbgfs_scale_table_file =
debugfs_create_file("rate_scale_table", 0600, dir,
rs_priv, &rs_sta_dbgfs_scale_table_ops);
static void rs_remove_debugfs(void *priv, void *priv_sta)
{
- struct iwl_rate_scale_priv *rs_priv = priv_sta;
+ struct iwl4965_rate_scale_priv *rs_priv = priv_sta;
debugfs_remove(rs_priv->rs_sta_dbgfs_scale_table_file);
debugfs_remove(rs_priv->rs_sta_dbgfs_stats_table_file);
}
#endif
};
-int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
+int iwl4965_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
{
struct ieee80211_local *local = hw_to_local(hw);
- struct iwl_priv *priv = hw->priv;
- struct iwl_rate_scale_priv *rs_priv;
+ struct iwl4965_priv *priv = hw->priv;
+ struct iwl4965_rate_scale_priv *rs_priv;
struct sta_info *sta;
int count = 0, i;
u32 samples = 0, success = 0, good = 0;
int active = rs_priv->active_tbl;
count +=
- sprintf(&buf[count], " %2dMbs: ", iwl_rates[i].ieee / 2);
+ sprintf(&buf[count], " %2dMbs: ", iwl4965_rates[i].ieee / 2);
mask = (1ULL << (IWL_RATE_MAX_WINDOW - 1));
for (j = 0; j < IWL_RATE_MAX_WINDOW; j++, mask >>= 1)
samples += rs_priv->lq_info[active].win[i].counter;
good += rs_priv->lq_info[active].win[i].success_counter;
success += rs_priv->lq_info[active].win[i].success_counter *
- iwl_rates[i].ieee;
+ iwl4965_rates[i].ieee;
if (rs_priv->lq_info[active].win[i].stamp) {
int delta =
} else
buf[count++] = '\n';
- j = iwl_get_prev_ieee_rate(i);
+ j = iwl4965_get_prev_ieee_rate(i);
if (j == i)
break;
i = j;
/* Display the average rate of all samples taken.
*
* NOTE: We multiple # of samples by 2 since the IEEE measurement
- * added from iwl_rates is actually 2X the rate */
+ * added from iwl4965_rates is actually 2X the rate */
if (samples)
count += sprintf(&buf[count],
"\nAverage rate is %3d.%02dMbs over last %4dms\n"
return count;
}
-void iwl_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
+void iwl4965_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
{
- struct iwl_priv *priv = hw->priv;
+ struct iwl4965_priv *priv = hw->priv;
priv->lq_mngr.lq_ready = 1;
}
-void iwl_rate_control_register(struct ieee80211_hw *hw)
+void iwl4965_rate_control_register(struct ieee80211_hw *hw)
{
ieee80211_rate_control_register(&rs_ops);
}
-void iwl_rate_control_unregister(struct ieee80211_hw *hw)
+void iwl4965_rate_control_unregister(struct ieee80211_hw *hw)
{
ieee80211_rate_control_unregister(&rs_ops);
}
#include "iwl-4965.h"
-struct iwl_rate_info {
+struct iwl4965_rate_info {
u8 plcp;
u8 plcp_siso;
u8 plcp_mimo;
#define LQ_SIZE 2
-extern const struct iwl_rate_info iwl_rates[IWL_RATE_COUNT];
+extern const struct iwl4965_rate_info iwl4965_rates[IWL_RATE_COUNT];
-enum iwl_table_type {
+enum iwl4965_table_type {
LQ_NONE,
LQ_G,
LQ_A,
LQ_MAX,
};
-enum iwl_antenna_type {
+enum iwl4965_antenna_type {
ANT_NONE,
ANT_MAIN,
ANT_AUX,
ANT_BOTH,
};
-static inline u8 iwl_get_prev_ieee_rate(u8 rate_index)
+static inline u8 iwl4965_get_prev_ieee_rate(u8 rate_index)
{
- u8 rate = iwl_rates[rate_index].prev_ieee;
+ u8 rate = iwl4965_rates[rate_index].prev_ieee;
if (rate == IWL_RATE_INVALID)
rate = rate_index;
return rate;
}
-extern int iwl_rate_index_from_plcp(int plcp);
+extern int iwl4965_rate_index_from_plcp(int plcp);
/**
- * iwl_fill_rs_info - Fill an output text buffer with the rate representation
+ * iwl4965_fill_rs_info - Fill an output text buffer with the rate representation
*
* NOTE: This is provided as a quick mechanism for a user to visualize
* the performance of the rate control algorithm and is not meant to be
* parsed software.
*/
-extern int iwl_fill_rs_info(struct ieee80211_hw *, char *buf, u8 sta_id);
+extern int iwl4965_fill_rs_info(struct ieee80211_hw *, char *buf, u8 sta_id);
/**
- * iwl_rate_scale_init - Initialize the rate scale table based on assoc info
+ * iwl4965_rate_scale_init - Initialize the rate scale table based on assoc info
*
* The specific throughput table used is based on the type of network
* the associated with, including A, B, G, and G w/ TGG protection
*/
-extern void iwl_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id);
+extern void iwl4965_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id);
/**
- * iwl_rate_control_register - Register the rate control algorithm callbacks
+ * iwl4965_rate_control_register - Register the rate control algorithm callbacks
*
* Since the rate control algorithm is hardware specific, there is no need
* or reason to place it as a stand alone module. The driver can call
- * iwl_rate_control_register in order to register the rate control callbacks
+ * iwl4965_rate_control_register in order to register the rate control callbacks
* with the mac80211 subsystem. This should be performed prior to calling
* ieee80211_register_hw
*
*/
-extern void iwl_rate_control_register(struct ieee80211_hw *hw);
+extern void iwl4965_rate_control_register(struct ieee80211_hw *hw);
/**
- * iwl_rate_control_unregister - Unregister the rate control callbacks
+ * iwl4965_rate_control_unregister - Unregister the rate control callbacks
*
* This should be called after calling ieee80211_unregister_hw, but before
* the driver is unloaded.
*/
-extern void iwl_rate_control_unregister(struct ieee80211_hw *hw);
+extern void iwl4965_rate_control_unregister(struct ieee80211_hw *hw);
#endif
#include "iwl-4965.h"
#include "iwl-helpers.h"
-static void iwl_hw_card_show_info(struct iwl_priv *priv);
+static void iwl4965_hw_card_show_info(struct iwl4965_priv *priv);
#define IWL_DECLARE_RATE_INFO(r, s, ip, in, rp, rn, pp, np) \
[IWL_RATE_##r##M_INDEX] = { IWL_RATE_##r##M_PLCP, \
* maps to IWL_RATE_INVALID
*
*/
-const struct iwl_rate_info iwl_rates[IWL_RATE_COUNT] = {
+const struct iwl4965_rate_info iwl4965_rates[IWL_RATE_COUNT] = {
IWL_DECLARE_RATE_INFO(1, INV, INV, 2, INV, 2, INV, 2), /* 1mbps */
IWL_DECLARE_RATE_INFO(2, INV, 1, 5, 1, 5, 1, 5), /* 2mbps */
IWL_DECLARE_RATE_INFO(5, INV, 2, 6, 2, 11, 2, 11), /*5.5mbps */
(rxon_flags & RXON_FLG_CHANNEL_MODE_MIXED_MSK);
}
-static u8 is_single_stream(struct iwl_priv *priv)
+static u8 is_single_stream(struct iwl4965_priv *priv)
{
#ifdef CONFIG_IWL4965_HT
if (!priv->is_ht_enabled || !priv->current_assoc_ht.is_ht ||
* MIMO (dual stream) requires at least 2, but works better with 3.
* This does not determine *which* chains to use, just how many.
*/
-static int iwl4965_get_rx_chain_counter(struct iwl_priv *priv,
+static int iwl4965_get_rx_chain_counter(struct iwl4965_priv *priv,
u8 *idle_state, u8 *rx_state)
{
u8 is_single = is_single_stream(priv);
return 0;
}
-int iwl_hw_rxq_stop(struct iwl_priv *priv)
+int iwl4965_hw_rxq_stop(struct iwl4965_priv *priv)
{
int rc;
unsigned long flags;
spin_lock_irqsave(&priv->lock, flags);
- rc = iwl_grab_nic_access(priv);
+ rc = iwl4965_grab_nic_access(priv);
if (rc) {
spin_unlock_irqrestore(&priv->lock, flags);
return rc;
}
/* stop HW */
- iwl_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG, 0);
- rc = iwl_poll_direct_bit(priv, FH_MEM_RSSR_RX_STATUS_REG,
+ iwl4965_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG, 0);
+ rc = iwl4965_poll_direct_bit(priv, FH_MEM_RSSR_RX_STATUS_REG,
(1 << 24), 1000);
if (rc < 0)
IWL_ERROR("Can't stop Rx DMA.\n");
- iwl_release_nic_access(priv);
+ iwl4965_release_nic_access(priv);
spin_unlock_irqrestore(&priv->lock, flags);
return 0;
}
-u8 iwl_hw_find_station(struct iwl_priv *priv, const u8 *addr)
+u8 iwl4965_hw_find_station(struct iwl4965_priv *priv, const u8 *addr)
{
int i;
int start = 0;
return ret;
}
-static int iwl4965_nic_set_pwr_src(struct iwl_priv *priv, int pwr_max)
+static int iwl4965_nic_set_pwr_src(struct iwl4965_priv *priv, int pwr_max)
{
int ret;
unsigned long flags;
spin_lock_irqsave(&priv->lock, flags);
- ret = iwl_grab_nic_access(priv);
+ ret = iwl4965_grab_nic_access(priv);
if (ret) {
spin_unlock_irqrestore(&priv->lock, flags);
return ret;
&val);
if (val & PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT)
- iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG,
+ iwl4965_set_bits_mask_prph(priv, APMG_PS_CTRL_REG,
APMG_PS_CTRL_VAL_PWR_SRC_VAUX,
~APMG_PS_CTRL_MSK_PWR_SRC);
} else
- iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG,
+ iwl4965_set_bits_mask_prph(priv, APMG_PS_CTRL_REG,
APMG_PS_CTRL_VAL_PWR_SRC_VMAIN,
~APMG_PS_CTRL_MSK_PWR_SRC);
- iwl_release_nic_access(priv);
+ iwl4965_release_nic_access(priv);
spin_unlock_irqrestore(&priv->lock, flags);
return ret;
}
-static int iwl4965_rx_init(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
+static int iwl4965_rx_init(struct iwl4965_priv *priv, struct iwl4965_rx_queue *rxq)
{
int rc;
unsigned long flags;
spin_lock_irqsave(&priv->lock, flags);
- rc = iwl_grab_nic_access(priv);
+ rc = iwl4965_grab_nic_access(priv);
if (rc) {
spin_unlock_irqrestore(&priv->lock, flags);
return rc;
}
/* stop HW */
- iwl_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG, 0);
+ iwl4965_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG, 0);
- iwl_write_direct32(priv, FH_RSCSR_CHNL0_RBDCB_WPTR_REG, 0);
- iwl_write_direct32(priv, FH_RSCSR_CHNL0_RBDCB_BASE_REG,
+ iwl4965_write_direct32(priv, FH_RSCSR_CHNL0_RBDCB_WPTR_REG, 0);
+ iwl4965_write_direct32(priv, FH_RSCSR_CHNL0_RBDCB_BASE_REG,
rxq->dma_addr >> 8);
- iwl_write_direct32(priv, FH_RSCSR_CHNL0_STTS_WPTR_REG,
+ iwl4965_write_direct32(priv, FH_RSCSR_CHNL0_STTS_WPTR_REG,
(priv->hw_setting.shared_phys +
- offsetof(struct iwl_shared, val0)) >> 4);
+ offsetof(struct iwl4965_shared, val0)) >> 4);
- iwl_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG,
+ iwl4965_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG,
FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL |
FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL |
IWL_FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K |
FH_RCSR_RX_CONFIG_RBDCB_SIZE_BITSHIFT));
/*
- * iwl_write32(priv,CSR_INT_COAL_REG,0);
+ * iwl4965_write32(priv,CSR_INT_COAL_REG,0);
*/
- iwl_release_nic_access(priv);
+ iwl4965_release_nic_access(priv);
spin_unlock_irqrestore(&priv->lock, flags);
return 0;
}
-static int iwl4965_kw_init(struct iwl_priv *priv)
+static int iwl4965_kw_init(struct iwl4965_priv *priv)
{
unsigned long flags;
int rc;
spin_lock_irqsave(&priv->lock, flags);
- rc = iwl_grab_nic_access(priv);
+ rc = iwl4965_grab_nic_access(priv);
if (rc)
goto out;
- iwl_write_direct32(priv, IWL_FH_KW_MEM_ADDR_REG,
+ iwl4965_write_direct32(priv, IWL_FH_KW_MEM_ADDR_REG,
priv->kw.dma_addr >> 4);
- iwl_release_nic_access(priv);
+ iwl4965_release_nic_access(priv);
out:
spin_unlock_irqrestore(&priv->lock, flags);
return rc;
}
-static int iwl4965_kw_alloc(struct iwl_priv *priv)
+static int iwl4965_kw_alloc(struct iwl4965_priv *priv)
{
struct pci_dev *dev = priv->pci_dev;
- struct iwl_kw *kw = &priv->kw;
+ struct iwl4965_kw *kw = &priv->kw;
kw->size = IWL4965_KW_SIZE; /* TBW need set somewhere else */
kw->v_addr = pci_alloc_consistent(dev, kw->size, &kw->dma_addr);
#define CHECK_AND_PRINT(x) ((eeprom_ch->flags & EEPROM_CHANNEL_##x) \
? # x " " : "")
-int iwl4965_set_fat_chan_info(struct iwl_priv *priv, int phymode, u16 channel,
- const struct iwl_eeprom_channel *eeprom_ch,
+int iwl4965_set_fat_chan_info(struct iwl4965_priv *priv, int phymode, u16 channel,
+ const struct iwl4965_eeprom_channel *eeprom_ch,
u8 fat_extension_channel)
{
- struct iwl_channel_info *ch_info;
+ struct iwl4965_channel_info *ch_info;
- ch_info = (struct iwl_channel_info *)
- iwl_get_channel_info(priv, phymode, channel);
+ ch_info = (struct iwl4965_channel_info *)
+ iwl4965_get_channel_info(priv, phymode, channel);
if (!is_channel_valid(ch_info))
return -1;
return 0;
}
-static void iwl4965_kw_free(struct iwl_priv *priv)
+static void iwl4965_kw_free(struct iwl4965_priv *priv)
{
struct pci_dev *dev = priv->pci_dev;
- struct iwl_kw *kw = &priv->kw;
+ struct iwl4965_kw *kw = &priv->kw;
if (kw->v_addr) {
pci_free_consistent(dev, kw->size, kw->v_addr, kw->dma_addr);
* @param priv
* @return error code
*/
-static int iwl4965_txq_ctx_reset(struct iwl_priv *priv)
+static int iwl4965_txq_ctx_reset(struct iwl4965_priv *priv)
{
int rc = 0;
int txq_id, slots_num;
iwl4965_kw_free(priv);
- iwl_hw_txq_ctx_free(priv);
+ iwl4965_hw_txq_ctx_free(priv);
/* Tx CMD queue */
rc = iwl4965_kw_alloc(priv);
spin_lock_irqsave(&priv->lock, flags);
- rc = iwl_grab_nic_access(priv);
+ rc = iwl4965_grab_nic_access(priv);
if (unlikely(rc)) {
IWL_ERROR("TX reset failed");
spin_unlock_irqrestore(&priv->lock, flags);
goto error_reset;
}
- iwl_write_prph(priv, KDR_SCD_TXFACT, 0);
- iwl_release_nic_access(priv);
+ iwl4965_write_prph(priv, KDR_SCD_TXFACT, 0);
+ iwl4965_release_nic_access(priv);
spin_unlock_irqrestore(&priv->lock, flags);
rc = iwl4965_kw_init(priv);
for (txq_id = 0; txq_id < priv->hw_setting.max_txq_num; txq_id++) {
slots_num = (txq_id == IWL_CMD_QUEUE_NUM) ?
TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS;
- rc = iwl_tx_queue_init(priv, &priv->txq[txq_id], slots_num,
+ rc = iwl4965_tx_queue_init(priv, &priv->txq[txq_id], slots_num,
txq_id);
if (rc) {
IWL_ERROR("Tx %d queue init failed\n", txq_id);
return rc;
error:
- iwl_hw_txq_ctx_free(priv);
+ iwl4965_hw_txq_ctx_free(priv);
error_reset:
iwl4965_kw_free(priv);
error_kw:
return rc;
}
-int iwl_hw_nic_init(struct iwl_priv *priv)
+int iwl4965_hw_nic_init(struct iwl4965_priv *priv)
{
int rc;
unsigned long flags;
- struct iwl_rx_queue *rxq = &priv->rxq;
+ struct iwl4965_rx_queue *rxq = &priv->rxq;
u8 rev_id;
u32 val;
u8 val_link;
- iwl_power_init_handle(priv);
+ iwl4965_power_init_handle(priv);
/* nic_init */
spin_lock_irqsave(&priv->lock, flags);
- iwl_set_bit(priv, CSR_GIO_CHICKEN_BITS,
+ iwl4965_set_bit(priv, CSR_GIO_CHICKEN_BITS,
&n