Prefix all symbols with iwl3945_ or iwl4965_ and thus allow building
the driver into the kernel. Also remove all the useless default
statements in Kconfig while we're at it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Christoph Hellwig 2008-01-27 16:41:47 -08:00 коммит произвёл David S. Miller
Родитель 403ab56b1c
Коммит bb8c093bde
19 изменённых файлов: 4090 добавлений и 4103 удалений

Просмотреть файл

@ -1,8 +1,7 @@
config IWL4965 config IWL4965
tristate "Intel Wireless WiFi 4965AGN" tristate "Intel Wireless WiFi 4965AGN"
depends on m && PCI && MAC80211 && WLAN_80211 && EXPERIMENTAL depends on PCI && MAC80211 && WLAN_80211 && EXPERIMENTAL
select FW_LOADER select FW_LOADER
default m
---help--- ---help---
Select to build the driver supporting the: Select to build the driver supporting the:
@ -30,7 +29,6 @@ config IWL4965
config IWL4965_QOS config IWL4965_QOS
bool "Enable Wireless QoS in iwl4965 driver" bool "Enable Wireless QoS in iwl4965 driver"
depends on IWL4965 depends on IWL4965
default y
---help--- ---help---
This option will enable wireless quality of service (QoS) for the This option will enable wireless quality of service (QoS) for the
iw4965 driver. iw4965 driver.
@ -38,14 +36,12 @@ config IWL4965_QOS
config IWL4965_SPECTRUM_MEASUREMENT config IWL4965_SPECTRUM_MEASUREMENT
bool "Enable Spectrum Measurement in iw4965 driver" bool "Enable Spectrum Measurement in iw4965 driver"
depends on IWL4965 depends on IWL4965
default y
---help--- ---help---
This option will enable spectrum measurement for the iwl4965 driver. This option will enable spectrum measurement for the iwl4965 driver.
config IWL4965_SENSITIVITY config IWL4965_SENSITIVITY
bool "Enable Sensitivity Calibration in iwl4965 driver" bool "Enable Sensitivity Calibration in iwl4965 driver"
depends on IWL4965 depends on IWL4965
default y
---help--- ---help---
This option will enable sensitivity calibration for the iwl4965 This option will enable sensitivity calibration for the iwl4965
driver. driver.
@ -54,7 +50,6 @@ config IWL4965_HT
bool "Enable 802.11n HT features in iwl4965 driver" bool "Enable 802.11n HT features in iwl4965 driver"
depends on EXPERIMENTAL depends on EXPERIMENTAL
depends on IWL4965 && MAC80211_HT depends on IWL4965 && MAC80211_HT
default n
---help--- ---help---
This option enables IEEE 802.11n High Throughput features This option enables IEEE 802.11n High Throughput features
for the iwl4965 driver. for the iwl4965 driver.
@ -62,7 +57,6 @@ config IWL4965_HT
config IWL4965_DEBUG config IWL4965_DEBUG
bool "Enable full debugging output in iwl4965 driver" bool "Enable full debugging output in iwl4965 driver"
depends on IWL4965 depends on IWL4965
default y
---help--- ---help---
This option will enable debug tracing output for the iwl4965 This option will enable debug tracing output for the iwl4965
driver. driver.
@ -88,9 +82,8 @@ config IWL4965_DEBUG
config IWL3945 config IWL3945
tristate "Intel PRO/Wireless 3945ABG/BG Network Connection" 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 select FW_LOADER
default m
---help--- ---help---
Select to build the driver supporting the: Select to build the driver supporting the:
@ -118,7 +111,6 @@ config IWL3945
config IWL3945_QOS config IWL3945_QOS
bool "Enable Wireless QoS in iwl3945 driver" bool "Enable Wireless QoS in iwl3945 driver"
depends on IWL3945 depends on IWL3945
default y
---help--- ---help---
This option will enable wireless quality of service (QoS) for the This option will enable wireless quality of service (QoS) for the
iwl3945 driver. iwl3945 driver.
@ -126,14 +118,12 @@ config IWL3945_QOS
config IWL3945_SPECTRUM_MEASUREMENT config IWL3945_SPECTRUM_MEASUREMENT
bool "Enable Spectrum Measurement in iwl3945 drivers" bool "Enable Spectrum Measurement in iwl3945 drivers"
depends on IWL3945 depends on IWL3945
default y
---help--- ---help---
This option will enable spectrum measurement for the iwl3945 driver. This option will enable spectrum measurement for the iwl3945 driver.
config IWL3945_DEBUG config IWL3945_DEBUG
bool "Enable full debugging output in iwl3945 driver" bool "Enable full debugging output in iwl3945 driver"
depends on IWL3945 depends on IWL3945
default y
---help--- ---help---
This option will enable debug tracing output for the iwl3945 This option will enable debug tracing output for the iwl3945
driver. driver.

Просмотреть файл

@ -141,7 +141,7 @@ enum {
#define IWL_CMD_FAILED_MSK 0x40 #define IWL_CMD_FAILED_MSK 0x40
struct iwl_cmd_header { struct iwl3945_cmd_header {
u8 cmd; u8 cmd;
u8 flags; u8 flags;
/* We have 15 LSB to use as we please (MSB indicates /* We have 15 LSB to use as we please (MSB indicates
@ -173,7 +173,7 @@ struct iwl_cmd_header {
/* /*
* REPLY_ALIVE = 0x1 (response only, not a command) * REPLY_ALIVE = 0x1 (response only, not a command)
*/ */
struct iwl_alive_resp { struct iwl3945_alive_resp {
u8 ucode_minor; u8 ucode_minor;
u8 ucode_major; u8 ucode_major;
__le16 reserved1; __le16 reserved1;
@ -187,7 +187,7 @@ struct iwl_alive_resp {
__le32 is_valid; __le32 is_valid;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_init_alive_resp { struct iwl3945_init_alive_resp {
u8 ucode_minor; u8 ucode_minor;
u8 ucode_major; u8 ucode_major;
__le16 reserved1; __le16 reserved1;
@ -210,7 +210,7 @@ union tsf {
/* /*
* REPLY_ERROR = 0x2 (response only, not a command) * REPLY_ERROR = 0x2 (response only, not a command)
*/ */
struct iwl_error_resp { struct iwl3945_error_resp {
__le32 error_type; __le32 error_type;
u8 cmd_id; u8 cmd_id;
u8 reserved1; u8 reserved1;
@ -279,7 +279,7 @@ enum {
/* /*
* REPLY_RXON = 0x10 (command, has simple generic response) * REPLY_RXON = 0x10 (command, has simple generic response)
*/ */
struct iwl_rxon_cmd { struct iwl3945_rxon_cmd {
u8 node_addr[6]; u8 node_addr[6];
__le16 reserved1; __le16 reserved1;
u8 bssid_addr[6]; u8 bssid_addr[6];
@ -301,7 +301,7 @@ struct iwl_rxon_cmd {
/* /*
* REPLY_RXON_ASSOC = 0x11 (command, has simple generic response) * REPLY_RXON_ASSOC = 0x11 (command, has simple generic response)
*/ */
struct iwl_rxon_assoc_cmd { struct iwl3945_rxon_assoc_cmd {
__le32 flags; __le32 flags;
__le32 filter_flags; __le32 filter_flags;
u8 ofdm_basic_rates; u8 ofdm_basic_rates;
@ -312,7 +312,7 @@ struct iwl_rxon_assoc_cmd {
/* /*
* REPLY_RXON_TIMING = 0x14 (command, has simple generic response) * REPLY_RXON_TIMING = 0x14 (command, has simple generic response)
*/ */
struct iwl_rxon_time_cmd { struct iwl3945_rxon_time_cmd {
union tsf timestamp; union tsf timestamp;
__le16 beacon_interval; __le16 beacon_interval;
__le16 atim_window; __le16 atim_window;
@ -321,34 +321,34 @@ struct iwl_rxon_time_cmd {
__le16 reserved; __le16 reserved;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_tx_power { struct iwl3945_tx_power {
u8 tx_gain; /* gain for analog radio */ u8 tx_gain; /* gain for analog radio */
u8 dsp_atten; /* gain for DSP */ u8 dsp_atten; /* gain for DSP */
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_power_per_rate { struct iwl3945_power_per_rate {
u8 rate; /* plcp */ u8 rate; /* plcp */
struct iwl_tx_power tpc; struct iwl3945_tx_power tpc;
u8 reserved; u8 reserved;
} __attribute__ ((packed)); } __attribute__ ((packed));
/* /*
* REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response) * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response)
*/ */
struct iwl_channel_switch_cmd { struct iwl3945_channel_switch_cmd {
u8 band; u8 band;
u8 expect_beacon; u8 expect_beacon;
__le16 channel; __le16 channel;
__le32 rxon_flags; __le32 rxon_flags;
__le32 rxon_filter_flags; __le32 rxon_filter_flags;
__le32 switch_time; __le32 switch_time;
struct iwl_power_per_rate power[IWL_MAX_RATES]; struct iwl3945_power_per_rate power[IWL_MAX_RATES];
} __attribute__ ((packed)); } __attribute__ ((packed));
/* /*
* CHANNEL_SWITCH_NOTIFICATION = 0x73 (notification only, not a command) * CHANNEL_SWITCH_NOTIFICATION = 0x73 (notification only, not a command)
*/ */
struct iwl_csa_notification { struct iwl3945_csa_notification {
__le16 band; __le16 band;
__le16 channel; __le16 channel;
__le32 status; /* 0 - OK, 1 - fail */ __le32 status; /* 0 - OK, 1 - fail */
@ -359,7 +359,7 @@ struct iwl_csa_notification {
* Quality-of-Service (QOS) Commands & Responses: * Quality-of-Service (QOS) Commands & Responses:
* *
*****************************************************************************/ *****************************************************************************/
struct iwl_ac_qos { struct iwl3945_ac_qos {
__le16 cw_min; __le16 cw_min;
__le16 cw_max; __le16 cw_max;
u8 aifsn; u8 aifsn;
@ -381,9 +381,9 @@ struct iwl_ac_qos {
/* /*
* REPLY_QOS_PARAM = 0x13 (command, has simple generic response) * REPLY_QOS_PARAM = 0x13 (command, has simple generic response)
*/ */
struct iwl_qosparam_cmd { struct iwl3945_qosparam_cmd {
__le32 qos_flags; __le32 qos_flags;
struct iwl_ac_qos ac[AC_NUM]; struct iwl3945_ac_qos ac[AC_NUM];
} __attribute__ ((packed)); } __attribute__ ((packed));
/****************************************************************************** /******************************************************************************
@ -442,7 +442,7 @@ struct iwl_qosparam_cmd {
#define RATE_MCS_ANT_B_MSK 0x8000 #define RATE_MCS_ANT_B_MSK 0x8000
#define RATE_MCS_ANT_AB_MSK 0xc000 #define RATE_MCS_ANT_AB_MSK 0xc000
struct iwl_keyinfo { struct iwl3945_keyinfo {
__le16 key_flags; __le16 key_flags;
u8 tkip_rx_tsc_byte2; /* TSC[2] for key mix ph1 detection */ u8 tkip_rx_tsc_byte2; /* TSC[2] for key mix ph1 detection */
u8 reserved1; u8 reserved1;
@ -462,11 +462,11 @@ struct sta_id_modify {
/* /*
* REPLY_ADD_STA = 0x18 (command) * REPLY_ADD_STA = 0x18 (command)
*/ */
struct iwl_addsta_cmd { struct iwl3945_addsta_cmd {
u8 mode; u8 mode;
u8 reserved[3]; u8 reserved[3];
struct sta_id_modify sta; struct sta_id_modify sta;
struct iwl_keyinfo key; struct iwl3945_keyinfo key;
__le32 station_flags; __le32 station_flags;
__le32 station_flags_msk; __le32 station_flags_msk;
__le16 tid_disable_tx; __le16 tid_disable_tx;
@ -479,7 +479,7 @@ struct iwl_addsta_cmd {
/* /*
* REPLY_ADD_STA = 0x18 (response) * REPLY_ADD_STA = 0x18 (response)
*/ */
struct iwl_add_sta_resp { struct iwl3945_add_sta_resp {
u8 status; u8 status;
} __attribute__ ((packed)); } __attribute__ ((packed));
@ -491,7 +491,7 @@ struct iwl_add_sta_resp {
* *
*****************************************************************************/ *****************************************************************************/
struct iwl_rx_frame_stats { struct iwl3945_rx_frame_stats {
u8 phy_count; u8 phy_count;
u8 id; u8 id;
u8 rssi; u8 rssi;
@ -501,7 +501,7 @@ struct iwl_rx_frame_stats {
u8 payload[0]; u8 payload[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_rx_frame_hdr { struct iwl3945_rx_frame_hdr {
__le16 channel; __le16 channel;
__le16 phy_flags; __le16 phy_flags;
u8 reserved1; u8 reserved1;
@ -531,7 +531,7 @@ struct iwl_rx_frame_hdr {
#define RX_RES_STATUS_BAD_ICV_MIC (0x1 << 11) #define RX_RES_STATUS_BAD_ICV_MIC (0x1 << 11)
#define RX_RES_STATUS_BAD_KEY_TTAK (0x2 << 11) #define RX_RES_STATUS_BAD_KEY_TTAK (0x2 << 11)
struct iwl_rx_frame_end { struct iwl3945_rx_frame_end {
__le32 status; __le32 status;
__le64 timestamp; __le64 timestamp;
__le32 beacon_timestamp; __le32 beacon_timestamp;
@ -545,10 +545,10 @@ struct iwl_rx_frame_end {
* The actual offsets of the hdr and end are dynamic based on * The actual offsets of the hdr and end are dynamic based on
* stats.phy_count * stats.phy_count
*/ */
struct iwl_rx_frame { struct iwl3945_rx_frame {
struct iwl_rx_frame_stats stats; struct iwl3945_rx_frame_stats stats;
struct iwl_rx_frame_hdr hdr; struct iwl3945_rx_frame_hdr hdr;
struct iwl_rx_frame_end end; struct iwl3945_rx_frame_end end;
} __attribute__ ((packed)); } __attribute__ ((packed));
/* Fixed (non-configurable) rx data from phy */ /* Fixed (non-configurable) rx data from phy */
@ -643,7 +643,7 @@ struct iwl4965_rx_mpdu_res_start {
* TX command Frame life time * TX command Frame life time
*/ */
struct iwl_dram_scratch { struct iwl3945_dram_scratch {
u8 try_cnt; u8 try_cnt;
u8 bt_kill_cnt; u8 bt_kill_cnt;
__le16 reserved; __le16 reserved;
@ -652,7 +652,7 @@ struct iwl_dram_scratch {
/* /*
* REPLY_TX = 0x1c (command) * REPLY_TX = 0x1c (command)
*/ */
struct iwl_tx_cmd { struct iwl3945_tx_cmd {
__le16 len; __le16 len;
__le16 next_frame_len; __le16 next_frame_len;
__le32 tx_flags; __le32 tx_flags;
@ -784,7 +784,7 @@ enum {
/* /*
* REPLY_TX = 0x1c (response) * REPLY_TX = 0x1c (response)
*/ */
struct iwl_tx_resp { struct iwl3945_tx_resp {
u8 failure_rts; u8 failure_rts;
u8 failure_frame; u8 failure_frame;
u8 bt_kill_count; u8 bt_kill_count;
@ -796,7 +796,7 @@ struct iwl_tx_resp {
/* /*
* REPLY_COMPRESSED_BA = 0xc5 (response only, not a command) * REPLY_COMPRESSED_BA = 0xc5 (response only, not a command)
*/ */
struct iwl_compressed_ba_resp { struct iwl3945_compressed_ba_resp {
__le32 sta_addr_lo32; __le32 sta_addr_lo32;
__le16 sta_addr_hi16; __le16 sta_addr_hi16;
__le16 reserved; __le16 reserved;
@ -812,21 +812,21 @@ struct iwl_compressed_ba_resp {
/* /*
* REPLY_TX_PWR_TABLE_CMD = 0x97 (command, has simple generic response) * 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 band; /* 0: 5 GHz, 1: 2.4 GHz */
u8 reserved; u8 reserved;
__le16 channel; __le16 channel;
struct iwl_power_per_rate power[IWL_MAX_RATES]; struct iwl3945_power_per_rate power[IWL_MAX_RATES];
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_rate_scaling_info { struct iwl3945_rate_scaling_info {
__le16 rate_n_flags; __le16 rate_n_flags;
u8 try_cnt; u8 try_cnt;
u8 next_rate_index; u8 next_rate_index;
} __attribute__ ((packed)); } __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) * REPLY_RATE_SCALE = 0x47 (command, has simple generic response)
* *
@ -840,16 +840,16 @@ struct iwl_rate_scaling_info {
* when passed through ofdm_basic_rates on the REPLY_RXON * when passed through ofdm_basic_rates on the REPLY_RXON
* command would be bit 0 (1<<0) * command would be bit 0 (1<<0)
*/ */
struct iwl_rate_scaling_cmd { struct iwl3945_rate_scaling_cmd {
u8 table_id; u8 table_id;
u8 reserved[3]; u8 reserved[3];
struct iwl_rate_scaling_info table[IWL_MAX_RATES]; struct iwl3945_rate_scaling_info table[IWL_MAX_RATES];
} __attribute__ ((packed)); } __attribute__ ((packed));
/* /*
* REPLY_BT_CONFIG = 0x9b (command, has simple generic response) * REPLY_BT_CONFIG = 0x9b (command, has simple generic response)
*/ */
struct iwl_bt_cmd { struct iwl3945_bt_cmd {
u8 flags; u8 flags;
u8 lead_time; u8 lead_time;
u8 max_kill; u8 max_kill;
@ -875,18 +875,18 @@ struct iwl_bt_cmd {
RXON_FILTER_ASSOC_MSK | \ RXON_FILTER_ASSOC_MSK | \
RXON_FILTER_BCON_AWARE_MSK) RXON_FILTER_BCON_AWARE_MSK)
struct iwl_measure_channel { struct iwl3945_measure_channel {
__le32 duration; /* measurement duration in extended beacon __le32 duration; /* measurement duration in extended beacon
* format */ * format */
u8 channel; /* channel to measure */ u8 channel; /* channel to measure */
u8 type; /* see enum iwl_measure_type */ u8 type; /* see enum iwl3945_measure_type */
__le16 reserved; __le16 reserved;
} __attribute__ ((packed)); } __attribute__ ((packed));
/* /*
* REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (command) * REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (command)
*/ */
struct iwl_spectrum_cmd { struct iwl3945_spectrum_cmd {
__le16 len; /* number of bytes starting from token */ __le16 len; /* number of bytes starting from token */
u8 token; /* token id */ u8 token; /* token id */
u8 id; /* measurement id -- 0 or 1 */ u8 id; /* measurement id -- 0 or 1 */
@ -899,13 +899,13 @@ struct iwl_spectrum_cmd {
__le32 filter_flags; /* rxon filter flags */ __le32 filter_flags; /* rxon filter flags */
__le16 channel_count; /* minimum 1, maximum 10 */ __le16 channel_count; /* minimum 1, maximum 10 */
__le16 reserved3; __le16 reserved3;
struct iwl_measure_channel channels[10]; struct iwl3945_measure_channel channels[10];
} __attribute__ ((packed)); } __attribute__ ((packed));
/* /*
* REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (response) * REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (response)
*/ */
struct iwl_spectrum_resp { struct iwl3945_spectrum_resp {
u8 token; u8 token;
u8 id; /* id of the prior command replaced, or 0xff */ u8 id; /* id of the prior command replaced, or 0xff */
__le16 status; /* 0 - command will be handled __le16 status; /* 0 - command will be handled
@ -913,12 +913,12 @@ struct iwl_spectrum_resp {
* measurement) */ * measurement) */
} __attribute__ ((packed)); } __attribute__ ((packed));
enum iwl_measurement_state { enum iwl3945_measurement_state {
IWL_MEASUREMENT_START = 0, IWL_MEASUREMENT_START = 0,
IWL_MEASUREMENT_STOP = 1, IWL_MEASUREMENT_STOP = 1,
}; };
enum iwl_measurement_status { enum iwl3945_measurement_status {
IWL_MEASUREMENT_OK = 0, IWL_MEASUREMENT_OK = 0,
IWL_MEASUREMENT_CONCURRENT = 1, IWL_MEASUREMENT_CONCURRENT = 1,
IWL_MEASUREMENT_CSA_CONFLICT = 2, IWL_MEASUREMENT_CSA_CONFLICT = 2,
@ -931,18 +931,18 @@ enum iwl_measurement_status {
#define NUM_ELEMENTS_IN_HISTOGRAM 8 #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 ofdm[NUM_ELEMENTS_IN_HISTOGRAM]; /* in 0.8usec counts */
__le32 cck[NUM_ELEMENTS_IN_HISTOGRAM]; /* in 1usec counts */ __le32 cck[NUM_ELEMENTS_IN_HISTOGRAM]; /* in 1usec counts */
} __attribute__ ((packed)); } __attribute__ ((packed));
/* clear channel availability counters */ /* clear channel availability counters */
struct iwl_measurement_cca_counters { struct iwl3945_measurement_cca_counters {
__le32 ofdm; __le32 ofdm;
__le32 cck; __le32 cck;
} __attribute__ ((packed)); } __attribute__ ((packed));
enum iwl_measure_type { enum iwl3945_measure_type {
IWL_MEASURE_BASIC = (1 << 0), IWL_MEASURE_BASIC = (1 << 0),
IWL_MEASURE_CHANNEL_LOAD = (1 << 1), IWL_MEASURE_CHANNEL_LOAD = (1 << 1),
IWL_MEASURE_HISTOGRAM_RPI = (1 << 2), IWL_MEASURE_HISTOGRAM_RPI = (1 << 2),
@ -955,7 +955,7 @@ enum iwl_measure_type {
/* /*
* SPECTRUM_MEASURE_NOTIFICATION = 0x75 (notification only, not a command) * 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 id; /* measurement id -- 0 or 1 */
u8 token; u8 token;
u8 channel_index; /* index in measurement channel list */ u8 channel_index; /* index in measurement channel list */
@ -963,7 +963,7 @@ struct iwl_spectrum_notification {
__le32 start_time; /* lower 32-bits of TSF */ __le32 start_time; /* lower 32-bits of TSF */
u8 band; /* 0 - 5.2GHz, 1 - 2.4GHz */ u8 band; /* 0 - 5.2GHz, 1 - 2.4GHz */
u8 channel; u8 channel;
u8 type; /* see enum iwl_measurement_type */ u8 type; /* see enum iwl3945_measurement_type */
u8 reserved1; u8 reserved1;
/* NOTE: cca_ofdm, cca_cck, basic_type, and histogram are only only /* NOTE: cca_ofdm, cca_cck, basic_type, and histogram are only only
* valid if applicable for measurement type requested. */ * valid if applicable for measurement type requested. */
@ -973,9 +973,9 @@ struct iwl_spectrum_notification {
u8 basic_type; /* 0 - bss, 1 - ofdm preamble, 2 - u8 basic_type; /* 0 - bss, 1 - ofdm preamble, 2 -
* unidentified */ * unidentified */
u8 reserved2[3]; u8 reserved2[3];
struct iwl_measurement_histogram histogram; struct iwl3945_measurement_histogram histogram;
__le32 stop_time; /* lower 32-bits of TSF */ __le32 stop_time; /* lower 32-bits of TSF */
__le32 status; /* see iwl_measurement_status */ __le32 status; /* see iwl3945_measurement_status */
} __attribute__ ((packed)); } __attribute__ ((packed));
/****************************************************************************** /******************************************************************************
@ -985,7 +985,7 @@ struct iwl_spectrum_notification {
*****************************************************************************/ *****************************************************************************/
/** /**
* struct iwl_powertable_cmd - Power Table Command * struct iwl3945_powertable_cmd - Power Table Command
* @flags: See below: * @flags: See below:
* *
* POWER_TABLE_CMD = 0x77 (command, has simple generic response) * POWER_TABLE_CMD = 0x77 (command, has simple generic response)
@ -1017,7 +1017,7 @@ struct iwl_spectrum_notification {
#define IWL_POWER_DRIVER_ALLOW_SLEEP_MSK __constant_cpu_to_le32(1<<0) #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_SLEEP_OVER_DTIM_MSK __constant_cpu_to_le32(1<<2)
#define IWL_POWER_PCI_PM_MSK __constant_cpu_to_le32(1<<3) #define IWL_POWER_PCI_PM_MSK __constant_cpu_to_le32(1<<3)
struct iwl_powertable_cmd { struct iwl3945_powertable_cmd {
__le32 flags; __le32 flags;
__le32 rx_data_timeout; __le32 rx_data_timeout;
__le32 tx_data_timeout; __le32 tx_data_timeout;
@ -1028,7 +1028,7 @@ struct iwl_powertable_cmd {
* PM_SLEEP_NOTIFICATION = 0x7A (notification only, not a command) * PM_SLEEP_NOTIFICATION = 0x7A (notification only, not a command)
* 3945 and 4965 identical. * 3945 and 4965 identical.
*/ */
struct iwl_sleep_notification { struct iwl3945_sleep_notification {
u8 pm_sleep_mode; u8 pm_sleep_mode;
u8 pm_wakeup_src; u8 pm_wakeup_src;
__le16 reserved; __le16 reserved;
@ -1058,14 +1058,14 @@ enum {
#define CARD_STATE_CMD_DISABLE 0x00 /* Put card to sleep */ #define CARD_STATE_CMD_DISABLE 0x00 /* Put card to sleep */
#define CARD_STATE_CMD_ENABLE 0x01 /* Wake up card */ #define CARD_STATE_CMD_ENABLE 0x01 /* Wake up card */
#define CARD_STATE_CMD_HALT 0x02 /* Power down permanently */ #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 */ __le32 status; /* CARD_STATE_CMD_* request new power state */
} __attribute__ ((packed)); } __attribute__ ((packed));
/* /*
* CARD_STATE_NOTIFICATION = 0xa1 (notification only, not a command) * CARD_STATE_NOTIFICATION = 0xa1 (notification only, not a command)
*/ */
struct iwl_card_state_notif { struct iwl3945_card_state_notif {
__le32 flags; __le32 flags;
} __attribute__ ((packed)); } __attribute__ ((packed));
@ -1074,7 +1074,7 @@ struct iwl_card_state_notif {
#define RF_CARD_DISABLED 0x04 #define RF_CARD_DISABLED 0x04
#define RXON_CARD_DISABLED 0x10 #define RXON_CARD_DISABLED 0x10
struct iwl_ct_kill_config { struct iwl3945_ct_kill_config {
__le32 reserved; __le32 reserved;
__le32 critical_temperature_M; __le32 critical_temperature_M;
__le32 critical_temperature_R; __le32 critical_temperature_R;
@ -1086,7 +1086,7 @@ struct iwl_ct_kill_config {
* *
*****************************************************************************/ *****************************************************************************/
struct iwl_scan_channel { struct iwl3945_scan_channel {
/* type is defined as: /* type is defined as:
* 0:0 active (0 - passive) * 0:0 active (0 - passive)
* 1:4 SSID direct * 1:4 SSID direct
@ -1095,12 +1095,12 @@ struct iwl_scan_channel {
*/ */
u8 type; u8 type;
u8 channel; u8 channel;
struct iwl_tx_power tpc; struct iwl3945_tx_power tpc;
__le16 active_dwell; __le16 active_dwell;
__le16 passive_dwell; __le16 passive_dwell;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_ssid_ie { struct iwl3945_ssid_ie {
u8 id; u8 id;
u8 len; u8 len;
u8 ssid[32]; u8 ssid[32];
@ -1114,7 +1114,7 @@ struct iwl_ssid_ie {
/* /*
* REPLY_SCAN_CMD = 0x80 (command) * REPLY_SCAN_CMD = 0x80 (command)
*/ */
struct iwl_scan_cmd { struct iwl3945_scan_cmd {
__le16 len; __le16 len;
u8 reserved0; u8 reserved0;
u8 channel_count; u8 channel_count;
@ -1133,14 +1133,14 @@ struct iwl_scan_cmd {
__le32 flags; __le32 flags;
__le32 filter_flags; __le32 filter_flags;
struct iwl_tx_cmd tx_cmd; struct iwl3945_tx_cmd tx_cmd;
struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX]; struct iwl3945_ssid_ie direct_scan[PROBE_OPTION_MAX];
u8 data[0]; u8 data[0];
/* /*
* The channels start after the probe request payload and are of type: * 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 * NOTE: Only one band of channels can be scanned per pass. You
* can not mix 2.4GHz channels and 5.2GHz channels and must * can not mix 2.4GHz channels and 5.2GHz channels and must
@ -1157,14 +1157,14 @@ struct iwl_scan_cmd {
/* /*
* REPLY_SCAN_CMD = 0x80 (response) * REPLY_SCAN_CMD = 0x80 (response)
*/ */
struct iwl_scanreq_notification { struct iwl3945_scanreq_notification {
__le32 status; /* 1: okay, 2: cannot fulfill request */ __le32 status; /* 1: okay, 2: cannot fulfill request */
} __attribute__ ((packed)); } __attribute__ ((packed));
/* /*
* SCAN_START_NOTIFICATION = 0x82 (notification only, not a command) * SCAN_START_NOTIFICATION = 0x82 (notification only, not a command)
*/ */
struct iwl_scanstart_notification { struct iwl3945_scanstart_notification {
__le32 tsf_low; __le32 tsf_low;
__le32 tsf_high; __le32 tsf_high;
__le32 beacon_timer; __le32 beacon_timer;
@ -1181,7 +1181,7 @@ struct iwl_scanstart_notification {
/* /*
* SCAN_RESULTS_NOTIFICATION = 0x83 (notification only, not a command) * SCAN_RESULTS_NOTIFICATION = 0x83 (notification only, not a command)
*/ */
struct iwl_scanresults_notification { struct iwl3945_scanresults_notification {
u8 channel; u8 channel;
u8 band; u8 band;
u8 reserved[2]; u8 reserved[2];
@ -1193,7 +1193,7 @@ struct iwl_scanresults_notification {
/* /*
* SCAN_COMPLETE_NOTIFICATION = 0x84 (notification only, not a command) * SCAN_COMPLETE_NOTIFICATION = 0x84 (notification only, not a command)
*/ */
struct iwl_scancomplete_notification { struct iwl3945_scancomplete_notification {
u8 scanned_channels; u8 scanned_channels;
u8 status; u8 status;
u8 reserved; u8 reserved;
@ -1212,8 +1212,8 @@ struct iwl_scancomplete_notification {
/* /*
* BEACON_NOTIFICATION = 0x90 (notification only, not a command) * BEACON_NOTIFICATION = 0x90 (notification only, not a command)
*/ */
struct iwl_beacon_notif { struct iwl3945_beacon_notif {
struct iwl_tx_resp beacon_notify_hdr; struct iwl3945_tx_resp beacon_notify_hdr;
__le32 low_tsf; __le32 low_tsf;
__le32 high_tsf; __le32 high_tsf;
__le32 ibss_mgr_status; __le32 ibss_mgr_status;
@ -1222,8 +1222,8 @@ struct iwl_beacon_notif {
/* /*
* REPLY_TX_BEACON = 0x91 (command, has simple generic response) * REPLY_TX_BEACON = 0x91 (command, has simple generic response)
*/ */
struct iwl_tx_beacon_cmd { struct iwl3945_tx_beacon_cmd {
struct iwl_tx_cmd tx; struct iwl3945_tx_cmd tx;
__le16 tim_idx; __le16 tim_idx;
u8 tim_size; u8 tim_size;
u8 reserved1; u8 reserved1;
@ -1345,7 +1345,7 @@ struct statistics_general {
*/ */
#define IWL_STATS_CONF_CLEAR_STATS __constant_cpu_to_le32(0x1) /* see above */ #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 */ #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_* */ __le32 configuration_flags; /* IWL_STATS_CONF_* */
} __attribute__ ((packed)); } __attribute__ ((packed));
@ -1366,7 +1366,7 @@ struct iwl_statistics_cmd {
*/ */
#define STATISTICS_REPLY_FLG_BAND_24G_MSK __constant_cpu_to_le32(0x2) #define STATISTICS_REPLY_FLG_BAND_24G_MSK __constant_cpu_to_le32(0x2)
#define STATISTICS_REPLY_FLG_FAT_MODE_MSK __constant_cpu_to_le32(0x8) #define STATISTICS_REPLY_FLG_FAT_MODE_MSK __constant_cpu_to_le32(0x8)
struct iwl_notif_statistics { struct iwl3945_notif_statistics {
__le32 flag; __le32 flag;
struct statistics_rx rx; struct statistics_rx rx;
struct statistics_tx tx; struct statistics_tx tx;
@ -1381,7 +1381,7 @@ struct iwl_notif_statistics {
* then this notification will be sent. */ * then this notification will be sent. */
#define CONSECUTIVE_MISSED_BCONS_TH 20 #define CONSECUTIVE_MISSED_BCONS_TH 20
struct iwl_missed_beacon_notif { struct iwl3945_missed_beacon_notif {
__le32 consequtive_missed_beacons; __le32 consequtive_missed_beacons;
__le32 total_missed_becons; __le32 total_missed_becons;
__le32 num_expected_beacons; __le32 num_expected_beacons;
@ -1397,12 +1397,12 @@ struct iwl_missed_beacon_notif {
#define PHY_CALIBRATE_DIFF_GAIN_CMD (7) #define PHY_CALIBRATE_DIFF_GAIN_CMD (7)
#define HD_TABLE_SIZE (11) #define HD_TABLE_SIZE (11)
struct iwl_sensitivity_cmd { struct iwl3945_sensitivity_cmd {
__le16 control; __le16 control;
__le16 table[HD_TABLE_SIZE]; __le16 table[HD_TABLE_SIZE];
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_calibration_cmd { struct iwl3945_calibration_cmd {
u8 opCode; u8 opCode;
u8 flags; u8 flags;
__le16 reserved; __le16 reserved;
@ -1425,7 +1425,7 @@ struct iwl_calibration_cmd {
* For each of 3 possible LEDs (Activity/Link/Tech, selected by "id" field), * 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. * 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 */ __le32 interval; /* "interval" in uSec */
u8 id; /* 1: Activity, 2: Link, 3: Tech */ u8 id; /* 1: Activity, 2: Link, 3: Tech */
u8 off; /* # intervals off while blinking; u8 off; /* # intervals off while blinking;
@ -1441,27 +1441,27 @@ struct iwl_led_cmd {
* *
*****************************************************************************/ *****************************************************************************/
struct iwl_rx_packet { struct iwl3945_rx_packet {
__le32 len; __le32 len;
struct iwl_cmd_header hdr; struct iwl3945_cmd_header hdr;
union { union {
struct iwl_alive_resp alive_frame; struct iwl3945_alive_resp alive_frame;
struct iwl_rx_frame rx_frame; struct iwl3945_rx_frame rx_frame;
struct iwl_tx_resp tx_resp; struct iwl3945_tx_resp tx_resp;
struct iwl_spectrum_notification spectrum_notif; struct iwl3945_spectrum_notification spectrum_notif;
struct iwl_csa_notification csa_notif; struct iwl3945_csa_notification csa_notif;
struct iwl_error_resp err_resp; struct iwl3945_error_resp err_resp;
struct iwl_card_state_notif card_state_notif; struct iwl3945_card_state_notif card_state_notif;
struct iwl_beacon_notif beacon_status; struct iwl3945_beacon_notif beacon_status;
struct iwl_add_sta_resp add_sta; struct iwl3945_add_sta_resp add_sta;
struct iwl_sleep_notification sleep_notif; struct iwl3945_sleep_notification sleep_notif;
struct iwl_spectrum_resp spectrum; struct iwl3945_spectrum_resp spectrum;
struct iwl_notif_statistics stats; struct iwl3945_notif_statistics stats;
__le32 status; __le32 status;
u8 raw[0]; u8 raw[0];
} u; } u;
} __attribute__ ((packed)); } __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__ */

Просмотреть файл

@ -26,18 +26,18 @@
* *
*****************************************************************************/ *****************************************************************************/
#ifndef __iwl_debug_h__ #ifndef __iwl3945_debug_h__
#define __iwl_debug_h__ #define __iwl3945_debug_h__
#ifdef CONFIG_IWL3945_DEBUG #ifdef CONFIG_IWL3945_DEBUG
extern u32 iwl_debug_level; extern u32 iwl3945_debug_level;
#define IWL_DEBUG(level, fmt, args...) \ #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, \ printk(KERN_ERR DRV_NAME": %c %s " fmt, \
in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
#define IWL_DEBUG_LIMIT(level, fmt, args...) \ #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, \ printk(KERN_ERR DRV_NAME": %c %s " fmt, \
in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
#else #else
@ -68,7 +68,7 @@ static inline void IWL_DEBUG_LIMIT(int level, const char *fmt, ...)
* *
* % cat /proc/net/iwl/debug_level * % 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 * If you do not see debug_level in /proc/net/iwl then you do not have
* CONFIG_IWL3945_DEBUG defined in your kernel configuration * CONFIG_IWL3945_DEBUG defined in your kernel configuration

Просмотреть файл

@ -133,7 +133,7 @@ enum {
#define EEPROM_SKU_CAP_OP_MODE_MRC (1 << 7) #define EEPROM_SKU_CAP_OP_MODE_MRC (1 << 7)
/* *regulatory* channel data from eeprom, one for each channel */ /* *regulatory* channel data from eeprom, one for each channel */
struct iwl_eeprom_channel { struct iwl3945_eeprom_channel {
u8 flags; /* flags copied from EEPROM */ u8 flags; /* flags copied from EEPROM */
s8 max_power_avg; /* max power (dBm) on this chnl, limit 31 */ s8 max_power_avg; /* max power (dBm) on this chnl, limit 31 */
} __attribute__ ((packed)); } __attribute__ ((packed));
@ -148,7 +148,7 @@ struct iwl_eeprom_channel {
* level. * level.
* Data copied from EEPROM. * Data copied from EEPROM.
*/ */
struct iwl_eeprom_txpower_sample { struct iwl3945_eeprom_txpower_sample {
u8 gain_index; /* index into power (gain) setup table ... */ u8 gain_index; /* index into power (gain) setup table ... */
s8 power; /* ... for this pwr level for this chnl group */ s8 power; /* ... for this pwr level for this chnl group */
u16 v_det; /* PA output voltage */ u16 v_det; /* PA output voltage */
@ -162,8 +162,8 @@ struct iwl_eeprom_txpower_sample {
* Data copied from EEPROM. * Data copied from EEPROM.
* DO NOT ALTER THIS STRUCTURE!!! * DO NOT ALTER THIS STRUCTURE!!!
*/ */
struct iwl_eeprom_txpower_group { struct iwl3945_eeprom_txpower_group {
struct iwl_eeprom_txpower_sample samples[5]; /* 5 power levels */ struct iwl3945_eeprom_txpower_sample samples[5]; /* 5 power levels */
s32 a, b, c, d, e; /* coefficients for voltage->power s32 a, b, c, d, e; /* coefficients for voltage->power
* formula (signed) */ * formula (signed) */
s32 Fa, Fb, Fc, Fd, Fe; /* these modify coeffs based on s32 Fa, Fb, Fc, Fd, Fe; /* these modify coeffs based on
@ -181,7 +181,7 @@ struct iwl_eeprom_txpower_group {
* difference between current temperature and factory calib temperature. * difference between current temperature and factory calib temperature.
* Data copied from EEPROM. * Data copied from EEPROM.
*/ */
struct iwl_eeprom_temperature_corr { struct iwl3945_eeprom_temperature_corr {
u32 Ta; u32 Ta;
u32 Tb; u32 Tb;
u32 Tc; u32 Tc;
@ -189,7 +189,7 @@ struct iwl_eeprom_temperature_corr {
u32 Te; u32 Te;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_eeprom { struct iwl3945_eeprom {
u8 reserved0[16]; u8 reserved0[16];
#define EEPROM_DEVICE_ID (2*0x08) /* 2 bytes */ #define EEPROM_DEVICE_ID (2*0x08) /* 2 bytes */
u16 device_id; /* abs.ofs: 16 */ u16 device_id; /* abs.ofs: 16 */
@ -232,23 +232,23 @@ struct iwl_eeprom {
#define EEPROM_REGULATORY_BAND_1 (2*0x62) /* 2 bytes */ #define EEPROM_REGULATORY_BAND_1 (2*0x62) /* 2 bytes */
u16 band_1_count; /* abs.ofs: 196 */ u16 band_1_count; /* abs.ofs: 196 */
#define EEPROM_REGULATORY_BAND_1_CHANNELS (2*0x63) /* 28 bytes */ #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 */ #define EEPROM_REGULATORY_BAND_2 (2*0x71) /* 2 bytes */
u16 band_2_count; /* abs.ofs: 226 */ u16 band_2_count; /* abs.ofs: 226 */
#define EEPROM_REGULATORY_BAND_2_CHANNELS (2*0x72) /* 26 bytes */ #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 */ #define EEPROM_REGULATORY_BAND_3 (2*0x7F) /* 2 bytes */
u16 band_3_count; /* abs.ofs: 254 */ u16 band_3_count; /* abs.ofs: 254 */
#define EEPROM_REGULATORY_BAND_3_CHANNELS (2*0x80) /* 24 bytes */ #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 */ #define EEPROM_REGULATORY_BAND_4 (2*0x8C) /* 2 bytes */
u16 band_4_count; /* abs.ofs: 280 */ u16 band_4_count; /* abs.ofs: 280 */
#define EEPROM_REGULATORY_BAND_4_CHANNELS (2*0x8D) /* 22 bytes */ #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 */ #define EEPROM_REGULATORY_BAND_5 (2*0x98) /* 2 bytes */
u16 band_5_count; /* abs.ofs: 304 */ u16 band_5_count; /* abs.ofs: 304 */
#define EEPROM_REGULATORY_BAND_5_CHANNELS (2*0x99) /* 12 bytes */ #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]; u8 reserved9[194];
@ -258,10 +258,10 @@ struct iwl_eeprom {
#define EEPROM_TXPOWER_CALIB_GROUP3 0x2c0 #define EEPROM_TXPOWER_CALIB_GROUP3 0x2c0
#define EEPROM_TXPOWER_CALIB_GROUP4 0x300 #define EEPROM_TXPOWER_CALIB_GROUP4 0x300
#define IWL_NUM_TX_CALIB_GROUPS 5 #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 */ /* abs.ofs: 512 */
#define EEPROM_CALIB_TEMPERATURE_CORRECT 0x340 #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 */ u8 reserved16[172]; /* fill out to full 1024 byte block */
} __attribute__ ((packed)); } __attribute__ ((packed));
@ -681,8 +681,8 @@ struct iwl_eeprom {
#define TFD_TX_CMD_SLOTS 256 #define TFD_TX_CMD_SLOTS 256
#define TFD_CMD_SLOTS 32 #define TFD_CMD_SLOTS 32
#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_cmd) - \ #define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl3945_cmd) - \
sizeof(struct iwl_cmd_meta)) sizeof(struct iwl3945_cmd_meta))
/* /*
* RX related structures and functions * RX related structures and functions
@ -704,41 +704,41 @@ struct iwl_eeprom {
#define IWL_MAX_DATA_SIZE ALM_RTC_DATA_SIZE #define IWL_MAX_DATA_SIZE ALM_RTC_DATA_SIZE
#define IWL_MAX_NUM_QUEUES 8 #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) && return (addr >= RTC_DATA_LOWER_BOUND) &&
(addr < ALM_RTC_DATA_UPPER_BOUND); (addr < ALM_RTC_DATA_UPPER_BOUND);
} }
/* Base physical address of iwl_shared is provided to FH_TSSR_CBB_BASE /* Base physical address of iwl3945_shared is provided to FH_TSSR_CBB_BASE
* and &iwl_shared.rx_read_ptr[0] is provided to FH_RCSR_RPTR_ADDR(0) */ * and &iwl3945_shared.rx_read_ptr[0] is provided to FH_RCSR_RPTR_ADDR(0) */
struct iwl_shared { struct iwl3945_shared {
__le32 tx_base_ptr[8]; __le32 tx_base_ptr[8];
__le32 rx_read_ptr[3]; __le32 rx_read_ptr[3];
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_tfd_frame_data { struct iwl3945_tfd_frame_data {
__le32 addr; __le32 addr;
__le32 len; __le32 len;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_tfd_frame { struct iwl3945_tfd_frame {
__le32 control_flags; __le32 control_flags;
struct iwl_tfd_frame_data pa[4]; struct iwl3945_tfd_frame_data pa[4];
u8 reserved[28]; u8 reserved[28];
} __attribute__ ((packed)); } __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; 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); 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); return cpu_to_le16((u16)rate|flags);
} }

Просмотреть файл

@ -26,8 +26,8 @@
* *
*****************************************************************************/ *****************************************************************************/
#ifndef __iwl_io_h__ #ifndef __iwl3945_io_h__
#define __iwl_io_h__ #define __iwl3945_io_h__
#include <linux/io.h> #include <linux/io.h>
@ -49,8 +49,8 @@
* *
* If you wish to call the function without any debug or state checking, * 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 * 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 * routines, for example _iwl3945_read_direct32 calls the non-check version of
* _iwl_read32.) * _iwl3945_read32.)
* *
* These declarations are *extremely* useful in quickly isolating code deltas * These declarations are *extremely* useful in quickly isolating code deltas
* which result in misconfiguring of the hardware I/O. In combination with * which result in misconfiguring of the hardware I/O. In combination with
@ -59,39 +59,39 @@
* *
*/ */
#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 #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) u32 ofs, u32 val)
{ {
IWL_DEBUG_IO("write32(0x%08X, 0x%08X) - %s %d\n", ofs, val, f, l); 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) \ #define iwl3945_write32(iwl, ofs, val) \
__iwl_write32(__FILE__, __LINE__, iwl, ofs, val) __iwl3945_write32(__FILE__, __LINE__, iwl, ofs, val)
#else #else
#define iwl_write32(iwl, ofs, val) _iwl_write32(iwl, ofs, val) #define iwl3945_write32(iwl, ofs, val) _iwl3945_write32(iwl, ofs, val)
#endif #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 #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); 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 #else
#define iwl_read32(p, o) _iwl_read32(p, o) #define iwl3945_read32(p, o) _iwl3945_read32(p, o)
#endif #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) u32 bits, u32 mask, int timeout)
{ {
int i = 0; int i = 0;
do { do {
if ((_iwl_read32(priv, addr) & mask) == (bits & mask)) if ((_iwl3945_read32(priv, addr) & mask) == (bits & mask))
return i; return i;
mdelay(10); mdelay(10);
i += 10; i += 10;
@ -100,11 +100,11 @@ static inline int _iwl_poll_bit(struct iwl_priv *priv, u32 addr,
return -ETIMEDOUT; return -ETIMEDOUT;
} }
#ifdef CONFIG_IWL3945_DEBUG #ifdef CONFIG_IWL3945_DEBUG
static inline int __iwl_poll_bit(const char *f, u32 l, static inline int __iwl3945_poll_bit(const char *f, u32 l,
struct iwl_priv *priv, u32 addr, struct iwl3945_priv *priv, u32 addr,
u32 bits, u32 mask, int timeout) 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)) if (unlikely(ret == -ETIMEDOUT))
IWL_DEBUG_IO IWL_DEBUG_IO
("poll_bit(0x%08X, 0x%08X, 0x%08X) - timedout - %s %d\n", ("poll_bit(0x%08X, 0x%08X, 0x%08X) - timedout - %s %d\n",
@ -115,47 +115,47 @@ static inline int __iwl_poll_bit(const char *f, u32 l,
addr, bits, mask, ret, f, l); addr, bits, mask, ret, f, l);
return ret; return ret;
} }
#define iwl_poll_bit(iwl, addr, bits, mask, timeout) \ #define iwl3945_poll_bit(iwl, addr, bits, mask, timeout) \
__iwl_poll_bit(__FILE__, __LINE__, iwl, addr, bits, mask, timeout) __iwl3945_poll_bit(__FILE__, __LINE__, iwl, addr, bits, mask, timeout)
#else #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 #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 #ifdef CONFIG_IWL3945_DEBUG
static inline void __iwl_set_bit(const char *f, u32 l, static inline void __iwl3945_set_bit(const char *f, u32 l,
struct iwl_priv *priv, u32 reg, u32 mask) 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_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 #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 #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 #ifdef CONFIG_IWL3945_DEBUG
static inline void __iwl_clear_bit(const char *f, u32 l, static inline void __iwl3945_clear_bit(const char *f, u32 l,
struct iwl_priv *priv, u32 reg, u32 mask) 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_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 #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 #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; int ret;
u32 gp_ctl; u32 gp_ctl;
@ -170,7 +170,7 @@ static inline int _iwl_grab_nic_access(struct iwl_priv *priv)
"wakes up NIC\n"); "wakes up NIC\n");
/* 10 msec allows time for NIC to complete its data save */ /* 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) { if (gp_ctl & CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY) {
IWL_DEBUG_RF_KILL("Wait for complete power-down, " IWL_DEBUG_RF_KILL("Wait for complete power-down, "
"gpctl = 0x%08x\n", gp_ctl); "gpctl = 0x%08x\n", gp_ctl);
@ -181,8 +181,8 @@ static inline int _iwl_grab_nic_access(struct iwl_priv *priv)
} }
/* this bit wakes up the NIC */ /* this bit wakes up the NIC */
_iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); _iwl3945_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
ret = _iwl_poll_bit(priv, CSR_GP_CNTRL, ret = _iwl3945_poll_bit(priv, CSR_GP_CNTRL,
CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN, CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN,
(CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY | (CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY |
CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP), 50); CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP), 50);
@ -198,106 +198,106 @@ static inline int _iwl_grab_nic_access(struct iwl_priv *priv)
} }
#ifdef CONFIG_IWL3945_DEBUG #ifdef CONFIG_IWL3945_DEBUG
static inline int __iwl_grab_nic_access(const char *f, u32 l, static inline int __iwl3945_grab_nic_access(const char *f, u32 l,
struct iwl_priv *priv) struct iwl3945_priv *priv)
{ {
if (atomic_read(&priv->restrict_refcnt)) if (atomic_read(&priv->restrict_refcnt))
IWL_DEBUG_INFO("Grabbing access while already held at " IWL_DEBUG_INFO("Grabbing access while already held at "
"line %d.\n", l); "line %d.\n", l);
IWL_DEBUG_IO("grabbing nic access - %s %d\n", f, 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) \ #define iwl3945_grab_nic_access(priv) \
__iwl_grab_nic_access(__FILE__, __LINE__, priv) __iwl3945_grab_nic_access(__FILE__, __LINE__, priv)
#else #else
#define iwl_grab_nic_access(priv) \ #define iwl3945_grab_nic_access(priv) \
_iwl_grab_nic_access(priv) _iwl3945_grab_nic_access(priv)
#endif #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 #ifdef CONFIG_IWL3945_DEBUG
if (atomic_dec_and_test(&priv->restrict_refcnt)) if (atomic_dec_and_test(&priv->restrict_refcnt))
#endif #endif
_iwl_clear_bit(priv, CSR_GP_CNTRL, _iwl3945_clear_bit(priv, CSR_GP_CNTRL,
CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
} }
#ifdef CONFIG_IWL3945_DEBUG #ifdef CONFIG_IWL3945_DEBUG
static inline void __iwl_release_nic_access(const char *f, u32 l, static inline void __iwl3945_release_nic_access(const char *f, u32 l,
struct iwl_priv *priv) struct iwl3945_priv *priv)
{ {
if (atomic_read(&priv->restrict_refcnt) <= 0) if (atomic_read(&priv->restrict_refcnt) <= 0)
IWL_ERROR("Release unheld nic access at line %d.\n", l); IWL_ERROR("Release unheld nic access at line %d.\n", l);
IWL_DEBUG_IO("releasing nic access - %s %d\n", f, 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) \ #define iwl3945_release_nic_access(priv) \
__iwl_release_nic_access(__FILE__, __LINE__, priv) __iwl3945_release_nic_access(__FILE__, __LINE__, priv)
#else #else
#define iwl_release_nic_access(priv) \ #define iwl3945_release_nic_access(priv) \
_iwl_release_nic_access(priv) _iwl3945_release_nic_access(priv)
#endif #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 #ifdef CONFIG_IWL3945_DEBUG
static inline u32 __iwl_read_direct32(const char *f, u32 l, static inline u32 __iwl3945_read_direct32(const char *f, u32 l,
struct iwl_priv *priv, u32 reg) 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)) if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access not held from %s %d\n", f, l); 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, IWL_DEBUG_IO("read_direct32(0x%4X) = 0x%08x - %s %d \n", reg, value,
f, l); f, l);
return value; return value;
} }
#define iwl_read_direct32(priv, reg) \ #define iwl3945_read_direct32(priv, reg) \
__iwl_read_direct32(__FILE__, __LINE__, priv, reg) __iwl3945_read_direct32(__FILE__, __LINE__, priv, reg)
#else #else
#define iwl_read_direct32 _iwl_read_direct32 #define iwl3945_read_direct32 _iwl3945_read_direct32
#endif #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) u32 reg, u32 value)
{ {
_iwl_write32(priv, reg, value); _iwl3945_write32(priv, reg, value);
} }
#ifdef CONFIG_IWL3945_DEBUG #ifdef CONFIG_IWL3945_DEBUG
static void __iwl_write_direct32(u32 line, static void __iwl3945_write_direct32(u32 line,
struct iwl_priv *priv, u32 reg, u32 value) struct iwl3945_priv *priv, u32 reg, u32 value)
{ {
if (!atomic_read(&priv->restrict_refcnt)) if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access not held from line %d\n", line); 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) \ #define iwl3945_write_direct32(priv, reg, value) \
__iwl_write_direct32(__LINE__, priv, reg, value) __iwl3945_write_direct32(__LINE__, priv, reg, value)
#else #else
#define iwl_write_direct32 _iwl_write_direct32 #define iwl3945_write_direct32 _iwl3945_write_direct32
#endif #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 reg, u32 len, u32 *values)
{ {
u32 count = sizeof(u32); u32 count = sizeof(u32);
if ((priv != NULL) && (values != NULL)) { if ((priv != NULL) && (values != NULL)) {
for (; 0 < len; len -= count, reg += count, values++) 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) u32 addr, u32 mask, int timeout)
{ {
int i = 0; int i = 0;
do { do {
if ((_iwl_read_direct32(priv, addr) & mask) == mask) if ((_iwl3945_read_direct32(priv, addr) & mask) == mask)
return i; return i;
mdelay(10); mdelay(10);
i += 10; i += 10;
@ -307,11 +307,11 @@ static inline int _iwl_poll_direct_bit(struct iwl_priv *priv,
} }
#ifdef CONFIG_IWL3945_DEBUG #ifdef CONFIG_IWL3945_DEBUG
static inline int __iwl_poll_direct_bit(const char *f, u32 l, static inline int __iwl3945_poll_direct_bit(const char *f, u32 l,
struct iwl_priv *priv, struct iwl3945_priv *priv,
u32 addr, u32 mask, int timeout) 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)) if (unlikely(ret == -ETIMEDOUT))
IWL_DEBUG_IO("poll_direct_bit(0x%08X, 0x%08X) - " IWL_DEBUG_IO("poll_direct_bit(0x%08X, 0x%08X) - "
@ -321,111 +321,111 @@ static inline int __iwl_poll_direct_bit(const char *f, u32 l,
"- %s %d\n", addr, mask, ret, f, l); "- %s %d\n", addr, mask, ret, f, l);
return ret; return ret;
} }
#define iwl_poll_direct_bit(iwl, addr, mask, timeout) \ #define iwl3945_poll_direct_bit(iwl, addr, mask, timeout) \
__iwl_poll_direct_bit(__FILE__, __LINE__, iwl, addr, mask, timeout) __iwl3945_poll_direct_bit(__FILE__, __LINE__, iwl, addr, mask, timeout)
#else #else
#define iwl_poll_direct_bit _iwl_poll_direct_bit #define iwl3945_poll_direct_bit _iwl3945_poll_direct_bit
#endif #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)); _iwl3945_write_direct32(priv, HBUS_TARG_PRPH_RADDR, reg | (3 << 24));
return _iwl_read_direct32(priv, HBUS_TARG_PRPH_RDAT); return _iwl3945_read_direct32(priv, HBUS_TARG_PRPH_RDAT);
} }
#ifdef CONFIG_IWL3945_DEBUG #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)) if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access not held from line %d\n", line); 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) \ #define iwl3945_read_prph(priv, reg) \
__iwl_read_prph(__LINE__, priv, reg) __iwl3945_read_prph(__LINE__, priv, reg)
#else #else
#define iwl_read_prph _iwl_read_prph #define iwl3945_read_prph _iwl3945_read_prph
#endif #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) u32 addr, u32 val)
{ {
_iwl_write_direct32(priv, HBUS_TARG_PRPH_WADDR, _iwl3945_write_direct32(priv, HBUS_TARG_PRPH_WADDR,
((addr & 0x0000FFFF) | (3 << 24))); ((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 #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) u32 addr, u32 val)
{ {
if (!atomic_read(&priv->restrict_refcnt)) if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access from line %d\n", line); 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) \ #define iwl3945_write_prph(priv, addr, val) \
__iwl_write_prph(__LINE__, priv, addr, val); __iwl3945_write_prph(__LINE__, priv, addr, val);
#else #else
#define iwl_write_prph _iwl_write_prph #define iwl3945_write_prph _iwl3945_write_prph
#endif #endif
#define _iwl_set_bits_prph(priv, reg, mask) \ #define _iwl3945_set_bits_prph(priv, reg, mask) \
_iwl_write_prph(priv, reg, (_iwl_read_prph(priv, reg) | mask)) _iwl3945_write_prph(priv, reg, (_iwl3945_read_prph(priv, reg) | mask))
#ifdef CONFIG_IWL3945_DEBUG #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) u32 reg, u32 mask)
{ {
if (!atomic_read(&priv->restrict_refcnt)) if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access not held from line %d\n", line); 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) \ #define iwl3945_set_bits_prph(priv, reg, mask) \
__iwl_set_bits_prph(__LINE__, priv, reg, mask) __iwl3945_set_bits_prph(__LINE__, priv, reg, mask)
#else #else
#define iwl_set_bits_prph _iwl_set_bits_prph #define iwl3945_set_bits_prph _iwl3945_set_bits_prph
#endif #endif
#define _iwl_set_bits_mask_prph(priv, reg, bits, mask) \ #define _iwl3945_set_bits_mask_prph(priv, reg, bits, mask) \
_iwl_write_prph(priv, reg, ((_iwl_read_prph(priv, reg) & mask) | bits)) _iwl3945_write_prph(priv, reg, ((_iwl3945_read_prph(priv, reg) & mask) | bits))
#ifdef CONFIG_IWL3945_DEBUG #ifdef CONFIG_IWL3945_DEBUG
static inline void __iwl_set_bits_mask_prph(u32 line, static inline void __iwl3945_set_bits_mask_prph(u32 line,
struct iwl_priv *priv, u32 reg, u32 bits, u32 mask) struct iwl3945_priv *priv, u32 reg, u32 bits, u32 mask)
{ {
if (!atomic_read(&priv->restrict_refcnt)) if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access not held from line %d\n", line); 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) \ #define iwl3945_set_bits_mask_prph(priv, reg, bits, mask) \
__iwl_set_bits_mask_prph(__LINE__, priv, reg, bits, mask) __iwl3945_set_bits_mask_prph(__LINE__, priv, reg, bits, mask)
#else #else
#define iwl_set_bits_mask_prph _iwl_set_bits_mask_prph #define iwl3945_set_bits_mask_prph _iwl3945_set_bits_mask_prph
#endif #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) *priv, u32 reg, u32 mask)
{ {
u32 val = _iwl_read_prph(priv, reg); u32 val = _iwl3945_read_prph(priv, reg);
_iwl_write_prph(priv, reg, (val & ~mask)); _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); iwl3945_write_direct32(priv, HBUS_TARG_MEM_RADDR, addr);
return iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT); 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); iwl3945_write_direct32(priv, HBUS_TARG_MEM_WADDR, addr);
iwl_write_direct32(priv, HBUS_TARG_MEM_WDAT, val); 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) 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++) 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 #endif

Просмотреть файл

@ -43,7 +43,7 @@
#define RS_NAME "iwl-3945-rs" #define RS_NAME "iwl-3945-rs"
struct iwl_rate_scale_data { struct iwl3945_rate_scale_data {
u64 data; u64 data;
s32 success_counter; s32 success_counter;
s32 success_ratio; s32 success_ratio;
@ -52,7 +52,7 @@ struct iwl_rate_scale_data {
unsigned long stamp; unsigned long stamp;
}; };
struct iwl_rate_scale_priv { struct iwl3945_rate_scale_priv {
spinlock_t lock; spinlock_t lock;
s32 *expected_tpt; s32 *expected_tpt;
unsigned long last_partial_flush; unsigned long last_partial_flush;
@ -65,31 +65,31 @@ struct iwl_rate_scale_priv {
u8 start_rate; u8 start_rate;
u8 ibss_sta_added; u8 ibss_sta_added;
struct timer_list rate_scale_flush; 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 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 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 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 7, 13, 35, 58, 0, 0, 0, 0, 0, 0, 0, 0
}; };
struct iwl_tpt_entry { struct iwl3945_tpt_entry {
s8 min_rssi; s8 min_rssi;
u8 index; 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}, {-60, IWL_RATE_54M_INDEX},
{-64, IWL_RATE_48M_INDEX}, {-64, IWL_RATE_48M_INDEX},
{-72, IWL_RATE_36M_INDEX}, {-72, IWL_RATE_36M_INDEX},
@ -100,7 +100,7 @@ static struct iwl_tpt_entry iwl_tpt_table_a[] = {
{-89, IWL_RATE_6M_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}, {-86, IWL_RATE_11M_INDEX},
{-88, IWL_RATE_5M_INDEX}, {-88, IWL_RATE_5M_INDEX},
{-90, IWL_RATE_2M_INDEX}, {-90, IWL_RATE_2M_INDEX},
@ -108,7 +108,7 @@ static struct iwl_tpt_entry iwl_tpt_table_b[] = {
}; };
static struct iwl_tpt_entry iwl_tpt_table_g[] = { static struct iwl3945_tpt_entry iwl3945_tpt_table_g[] = {
{-60, IWL_RATE_54M_INDEX}, {-60, IWL_RATE_54M_INDEX},
{-64, IWL_RATE_48M_INDEX}, {-64, IWL_RATE_48M_INDEX},
{-68, IWL_RATE_36M_INDEX}, {-68, IWL_RATE_36M_INDEX},
@ -129,30 +129,30 @@ static struct iwl_tpt_entry iwl_tpt_table_g[] = {
#define IWL_RATE_MIN_SUCCESS_TH 8 #define IWL_RATE_MIN_SUCCESS_TH 8
#define IWL_RATE_DECREASE_TH 1920 #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 index = 0;
u32 table_size = 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)) if ((rssi < IWL_MIN_RSSI_VAL) || (rssi > IWL_MAX_RSSI_VAL))
rssi = IWL_MIN_RSSI_VAL; rssi = IWL_MIN_RSSI_VAL;
switch (mode) { switch (mode) {
case MODE_IEEE80211G: case MODE_IEEE80211G:
tpt_table = iwl_tpt_table_g; tpt_table = iwl3945_tpt_table_g;
table_size = ARRAY_SIZE(iwl_tpt_table_g); table_size = ARRAY_SIZE(iwl3945_tpt_table_g);
break; break;
case MODE_IEEE80211A: case MODE_IEEE80211A:
tpt_table = iwl_tpt_table_a; tpt_table = iwl3945_tpt_table_a;
table_size = ARRAY_SIZE(iwl_tpt_table_a); table_size = ARRAY_SIZE(iwl3945_tpt_table_a);
break; break;
default: default:
case MODE_IEEE80211B: case MODE_IEEE80211B:
tpt_table = iwl_tpt_table_b; tpt_table = iwl3945_tpt_table_b;
table_size = ARRAY_SIZE(iwl_tpt_table_b); table_size = ARRAY_SIZE(iwl3945_tpt_table_b);
break; break;
} }
@ -164,7 +164,7 @@ static u8 iwl_get_rate_index_by_rssi(s32 rssi, u8 mode)
return tpt_table[index].index; 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->data = 0;
window->success_counter = 0; window->success_counter = 0;
@ -175,13 +175,13 @@ static void iwl_clear_window(struct iwl_rate_scale_data *window)
} }
/** /**
* 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 * Returns the number of windows that have gathered data but were
* not flushed. If there were any that were not flushed, then * not flushed. If there were any that were not flushed, then
* reschedule the rate flushing routine. * 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 unflushed = 0;
int i; int i;
@ -202,7 +202,7 @@ static int iwl_rate_scale_flush_windows(struct iwl_rate_scale_priv *rs_priv)
IWL_DEBUG_RATE("flushing %d samples of rate " IWL_DEBUG_RATE("flushing %d samples of rate "
"index %d\n", "index %d\n",
rs_priv->win[i].counter, i); rs_priv->win[i].counter, i);
iwl_clear_window(&rs_priv->win[i]); iwl3945_clear_window(&rs_priv->win[i]);
} else } else
unflushed++; unflushed++;
spin_unlock_irqrestore(&rs_priv->lock, flags); spin_unlock_irqrestore(&rs_priv->lock, flags);
@ -214,16 +214,16 @@ static int iwl_rate_scale_flush_windows(struct iwl_rate_scale_priv *rs_priv)
#define IWL_RATE_FLUSH_MAX 5000 /* msec */ #define IWL_RATE_FLUSH_MAX 5000 /* msec */
#define IWL_RATE_FLUSH_MIN 50 /* 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; int unflushed = 0;
unsigned long flags; unsigned long flags;
u32 packet_count, duration, pps; u32 packet_count, duration, pps;
IWL_DEBUG_RATE("enter\n"); 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); spin_lock_irqsave(&rs_priv->lock, flags);
@ -277,14 +277,14 @@ static void iwl_bg_rate_scale_flush(unsigned long data)
} }
/** /**
* 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 * We keep a sliding window of the last 64 packets transmitted
* at this rate. window->data contains the bitmask of successful * at this rate. window->data contains the bitmask of successful
* packets. * packets.
*/ */
static void iwl_collect_tx_data(struct iwl_rate_scale_priv *rs_priv, static void iwl3945_collect_tx_data(struct iwl3945_rate_scale_priv *rs_priv,
struct iwl_rate_scale_data *window, struct iwl3945_rate_scale_data *window,
int success, int retries) int success, int retries)
{ {
unsigned long flags; unsigned long flags;
@ -373,12 +373,12 @@ static void rs_clear(void *priv)
static void *rs_alloc_sta(void *priv, gfp_t gfp) 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; int i;
IWL_DEBUG_RATE("enter\n"); 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) { if (!rs_priv) {
IWL_DEBUG_RATE("leave: ENOMEM\n"); IWL_DEBUG_RATE("leave: ENOMEM\n");
return NULL; return NULL;
@ -389,7 +389,7 @@ static void *rs_alloc_sta(void *priv, gfp_t gfp)
rs_priv->start_rate = IWL_RATE_INVALID; rs_priv->start_rate = IWL_RATE_INVALID;
/* default to just 802.11b */ /* 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_partial_flush = jiffies;
rs_priv->last_flush = jiffies; rs_priv->last_flush = jiffies;
@ -399,10 +399,10 @@ static void *rs_alloc_sta(void *priv, gfp_t gfp)
init_timer(&rs_priv->rate_scale_flush); init_timer(&rs_priv->rate_scale_flush);
rs_priv->rate_scale_flush.data = (unsigned long)rs_priv; 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++) 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"); IWL_DEBUG_RATE("leave\n");
@ -411,7 +411,7 @@ static void *rs_alloc_sta(void *priv, gfp_t gfp)
static void rs_free_sta(void *priv, void *priv_sta) 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"); IWL_DEBUG_RATE("enter\n");
del_timer_sync(&rs_priv->rate_scale_flush); del_timer_sync(&rs_priv->rate_scale_flush);
@ -425,9 +425,9 @@ static void rs_free_sta(void *priv, void *priv_sta)
* for A and B mode we need to overright prev * for A and B mode we need to overright prev
* value * 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) { switch (priv->phymode) {
case MODE_IEEE80211A: case MODE_IEEE80211A:
@ -449,7 +449,7 @@ static int rs_adjust_next_rate(struct iwl_priv *priv, int rate)
/** /**
* rs_tx_status - Update rate control values based on Tx results * 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. * the hardware for each rate.
*/ */
static void rs_tx_status(void *priv_rate, static void rs_tx_status(void *priv_rate,
@ -462,9 +462,9 @@ static void rs_tx_status(void *priv_rate,
unsigned long flags; unsigned long flags;
struct sta_info *sta; struct sta_info *sta;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 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 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"); IWL_DEBUG_RATE("enter\n");
@ -514,7 +514,7 @@ static void rs_tx_status(void *priv_rate,
/* Update this rate accounting for as many retries /* Update this rate accounting for as many retries
* as was used for it (per current_count) */ * 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], &rs_priv->win[scale_rate_index],
0, current_count); 0, current_count);
IWL_DEBUG_RATE("Update rate %d for %d retries.\n", IWL_DEBUG_RATE("Update rate %d for %d retries.\n",
@ -533,7 +533,7 @@ static void rs_tx_status(void *priv_rate,
last_index, last_index,
(tx_resp->flags & IEEE80211_TX_STATUS_ACK) ? (tx_resp->flags & IEEE80211_TX_STATUS_ACK) ?
"success" : "failure"); "success" : "failure");
iwl_collect_tx_data(rs_priv, iwl3945_collect_tx_data(rs_priv,
&rs_priv->win[last_index], &rs_priv->win[last_index],
tx_resp->flags & IEEE80211_TX_STATUS_ACK, 1); tx_resp->flags & IEEE80211_TX_STATUS_ACK, 1);
@ -560,8 +560,8 @@ static void rs_tx_status(void *priv_rate,
return; return;
} }
static u16 iwl_get_adjacent_rate(struct iwl_rate_scale_priv *rs_priv, static u16 iwl3945_get_adjacent_rate(struct iwl3945_rate_scale_priv *rs_priv,
u8 index, u16 rate_mask, int phymode) u8 index, u16 rate_mask, int phymode)
{ {
u8 high = IWL_RATE_INVALID; u8 high = IWL_RATE_INVALID;
u8 low = IWL_RATE_INVALID; u8 low = IWL_RATE_INVALID;
@ -596,9 +596,9 @@ static u16 iwl_get_adjacent_rate(struct iwl_rate_scale_priv *rs_priv,
low = index; low = index;
while (low != IWL_RATE_INVALID) { while (low != IWL_RATE_INVALID) {
if (rs_priv->tgg) if (rs_priv->tgg)
low = iwl_rates[low].prev_rs_tgg; low = iwl3945_rates[low].prev_rs_tgg;
else else
low = iwl_rates[low].prev_rs; low = iwl3945_rates[low].prev_rs;
if (low == IWL_RATE_INVALID) if (low == IWL_RATE_INVALID)
break; break;
if (rate_mask & (1 << low)) if (rate_mask & (1 << low))
@ -609,9 +609,9 @@ static u16 iwl_get_adjacent_rate(struct iwl_rate_scale_priv *rs_priv,
high = index; high = index;
while (high != IWL_RATE_INVALID) { while (high != IWL_RATE_INVALID) {
if (rs_priv->tgg) if (rs_priv->tgg)
high = iwl_rates[high].next_rs_tgg; high = iwl3945_rates[high].next_rs_tgg;
else else
high = iwl_rates[high].next_rs; high = iwl3945_rates[high].next_rs;
if (high == IWL_RATE_INVALID) if (high == IWL_RATE_INVALID)
break; break;
if (rate_mask & (1 << high)) if (rate_mask & (1 << high))
@ -646,8 +646,8 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev,
u8 high = IWL_RATE_INVALID; u8 high = IWL_RATE_INVALID;
u16 high_low; u16 high_low;
int index; int index;
struct iwl_rate_scale_priv *rs_priv; struct iwl3945_rate_scale_priv *rs_priv;
struct iwl_rate_scale_data *window = NULL; struct iwl3945_rate_scale_data *window = NULL;
int current_tpt = IWL_INVALID_VALUE; int current_tpt = IWL_INVALID_VALUE;
int low_tpt = IWL_INVALID_VALUE; int low_tpt = IWL_INVALID_VALUE;
int high_tpt = IWL_INVALID_VALUE; int high_tpt = IWL_INVALID_VALUE;
@ -658,7 +658,7 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev,
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
struct sta_info *sta; struct sta_info *sta;
u16 rate_mask; 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); DECLARE_MAC_BUF(mac);
IWL_DEBUG_RATE("enter\n"); IWL_DEBUG_RATE("enter\n");
@ -682,12 +682,12 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev,
if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) &&
!rs_priv->ibss_sta_added) { !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) { if (sta_id == IWL_INVALID_STATION) {
IWL_DEBUG_RATE("LQ: ADD station %s\n", IWL_DEBUG_RATE("LQ: ADD station %s\n",
print_mac(mac, hdr->addr1)); print_mac(mac, hdr->addr1));
sta_id = iwl_add_station(priv, sta_id = iwl3945_add_station(priv,
hdr->addr1, 0, CMD_ASYNC); hdr->addr1, 0, CMD_ASYNC);
} }
if (sta_id != IWL_INVALID_STATION) if (sta_id != IWL_INVALID_STATION)
@ -725,7 +725,7 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev,
rs_priv->expected_tpt[index] + 64) / 128); rs_priv->expected_tpt[index] + 64) / 128);
current_tpt = window->average_tpt; 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); local->hw.conf.phymode);
low = high_low & 0xff; low = high_low & 0xff;
high = (high_low >> 8) & 0xff; high = (high_low >> 8) & 0xff;
@ -830,11 +830,11 @@ static struct rate_control_ops rs_ops = {
.free_sta = rs_free_sta, .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 ieee80211_local *local = hw_to_local(hw);
struct iwl_priv *priv = hw->priv; struct iwl3945_priv *priv = hw->priv;
struct iwl_rate_scale_priv *rs_priv; struct iwl3945_rate_scale_priv *rs_priv;
struct sta_info *sta; struct sta_info *sta;
unsigned long flags; unsigned long flags;
int count = 0, i; int count = 0, i;
@ -860,7 +860,7 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
int j; int j;
count += 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)); mask = (1ULL << (IWL_RATE_MAX_WINDOW - 1));
for (j = 0; j < IWL_RATE_MAX_WINDOW; j++, mask >>= 1) for (j = 0; j < IWL_RATE_MAX_WINDOW; j++, mask >>= 1)
@ -869,7 +869,7 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
samples += rs_priv->win[i].counter; samples += rs_priv->win[i].counter;
good += rs_priv->win[i].success_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) { if (rs_priv->win[i].stamp) {
int delta = int delta =
@ -882,7 +882,7 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
} else } else
buf[count++] = '\n'; buf[count++] = '\n';
j = iwl_get_prev_ieee_rate(i); j = iwl3945_get_prev_ieee_rate(i);
if (j == i) if (j == i)
break; break;
i = j; i = j;
@ -893,7 +893,7 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
/* Display the average rate of all samples taken. /* Display the average rate of all samples taken.
* *
* NOTE: We multiple # of samples by 2 since the IEEE measurement * 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) if (samples)
count += sprintf( count += sprintf(
&buf[count], &buf[count],
@ -907,13 +907,13 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
return 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; s32 rssi = 0;
unsigned long flags; unsigned long flags;
struct ieee80211_local *local = hw_to_local(hw); 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; struct sta_info *sta;
IWL_DEBUG_RATE("enter\n"); IWL_DEBUG_RATE("enter\n");
@ -942,19 +942,19 @@ void iwl_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
case MODE_IEEE80211G: case MODE_IEEE80211G:
if (priv->active_rxon.flags & RXON_FLG_TGG_PROTECT_MSK) { if (priv->active_rxon.flags & RXON_FLG_TGG_PROTECT_MSK) {
rs_priv->tgg = 1; rs_priv->tgg = 1;
rs_priv->expected_tpt = iwl_expected_tpt_g_prot; rs_priv->expected_tpt = iwl3945_expected_tpt_g_prot;
} else } else
rs_priv->expected_tpt = iwl_expected_tpt_g; rs_priv->expected_tpt = iwl3945_expected_tpt_g;
break; break;
case MODE_IEEE80211A: case MODE_IEEE80211A:
rs_priv->expected_tpt = iwl_expected_tpt_a; rs_priv->expected_tpt = iwl3945_expected_tpt_a;
break; break;
default: default:
IWL_WARNING("Invalid phymode. Defaulting to 802.11b\n"); IWL_WARNING("Invalid phymode. Defaulting to 802.11b\n");
case MODE_IEEE80211B: case MODE_IEEE80211B:
rs_priv->expected_tpt = iwl_expected_tpt_b; rs_priv->expected_tpt = iwl3945_expected_tpt_b;
break; break;
} }
@ -967,19 +967,19 @@ void iwl_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
IWL_DEBUG(IWL_DL_INFO | IWL_DL_RATE, "Network RSSI: %d\n", rssi); 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: " IWL_DEBUG_RATE("leave: rssi %d assign rate index: "
"%d (plcp 0x%x)\n", rssi, rs_priv->start_rate, "%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); 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); ieee80211_rate_control_unregister(&rs_ops);
} }

Просмотреть файл

@ -27,7 +27,7 @@
#ifndef __iwl_3945_rs_h__ #ifndef __iwl_3945_rs_h__
#define __iwl_3945_rs_h__ #define __iwl_3945_rs_h__
struct iwl_rate_info { struct iwl3945_rate_info {
u8 plcp; u8 plcp;
u8 ieee; u8 ieee;
u8 prev_ieee; /* previous rate in IEEE speeds */ u8 prev_ieee; /* previous rate in IEEE speeds */
@ -159,11 +159,11 @@ enum {
#define IWL_MIN_RSSI_VAL -100 #define IWL_MIN_RSSI_VAL -100
#define IWL_MAX_RSSI_VAL 0 #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) if (rate == IWL_RATE_INVALID)
rate = rate_index; rate = rate_index;
@ -171,40 +171,40 @@ static inline u8 iwl_get_prev_ieee_rate(u8 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 * 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 * the performance of the rate control algorithm and is not meant to be
* parsed software. * 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 specific throughput table used is based on the type of network
* the associated with, including A, B, G, and G w/ TGG protection * 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 * 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 * 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 * with the mac80211 subsystem. This should be performed prior to calling
* ieee80211_register_hw * 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 * This should be called after calling ieee80211_unregister_hw, but before
* the driver is unloaded. * 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 #endif

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -31,10 +31,10 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <net/ieee80211_radiotap.h> #include <net/ieee80211_radiotap.h>
struct iwl_priv; struct iwl3945_priv;
/* Hardware specific file defines the PCI IDs table for that hardware module */ /* 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" #define DRV_NAME "iwl3945"
#include "iwl-3945-hw.h" #include "iwl-3945-hw.h"
@ -55,10 +55,10 @@ extern struct pci_device_id iwl_hw_card_ids[];
#define IWL_NOISE_MEAS_NOT_AVAILABLE (-127) #define IWL_NOISE_MEAS_NOT_AVAILABLE (-127)
/* Module parameters accessible from iwl-*.c */ /* Module parameters accessible from iwl-*.c */
extern int iwl_param_hwcrypto; extern int iwl3945_param_hwcrypto;
extern int iwl_param_queues_num; extern int iwl3945_param_queues_num;
enum iwl_antenna { enum iwl3945_antenna {
IWL_ANTENNA_DIVERSITY, IWL_ANTENNA_DIVERSITY,
IWL_ANTENNA_MAIN, IWL_ANTENNA_MAIN,
IWL_ANTENNA_AUX IWL_ANTENNA_AUX
@ -81,13 +81,13 @@ enum iwl_antenna {
#define DEFAULT_SHORT_RETRY_LIMIT 7U #define DEFAULT_SHORT_RETRY_LIMIT 7U
#define DEFAULT_LONG_RETRY_LIMIT 4U #define DEFAULT_LONG_RETRY_LIMIT 4U
struct iwl_rx_mem_buffer { struct iwl3945_rx_mem_buffer {
dma_addr_t dma_addr; dma_addr_t dma_addr;
struct sk_buff *skb; struct sk_buff *skb;
struct list_head list; struct list_head list;
}; };
struct iwl_rt_rx_hdr { struct iwl3945_rt_rx_hdr {
struct ieee80211_radiotap_header rt_hdr; struct ieee80211_radiotap_header rt_hdr;
__le64 rt_tsf; /* TSF */ __le64 rt_tsf; /* TSF */
u8 rt_flags; /* radiotap packet flags */ u8 rt_flags; /* radiotap packet flags */
@ -100,7 +100,7 @@ struct iwl_rt_rx_hdr {
u8 payload[0]; /* payload... */ u8 payload[0]; /* payload... */
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_rt_tx_hdr { struct iwl3945_rt_tx_hdr {
struct ieee80211_radiotap_header rt_hdr; struct ieee80211_radiotap_header rt_hdr;
u8 rt_rate; /* rate in 500kb/s */ u8 rt_rate; /* rate in 500kb/s */
__le16 rt_channel; /* channel in mHz */ __le16 rt_channel; /* channel in mHz */
@ -115,7 +115,7 @@ struct iwl_rt_tx_hdr {
* *
* Contains common data for Rx and Tx queues * Contains common data for Rx and Tx queues
*/ */
struct iwl_queue { struct iwl3945_queue {
int n_bd; /* number of BDs in this queue */ int n_bd; /* number of BDs in this queue */
int write_ptr; /* 1-st empty entry (index) host_w*/ int write_ptr; /* 1-st empty entry (index) host_w*/
int read_ptr; /* last used entry (index) host_r*/ int read_ptr; /* last used entry (index) host_r*/
@ -130,24 +130,24 @@ struct iwl_queue {
#define MAX_NUM_OF_TBS (20) #define MAX_NUM_OF_TBS (20)
struct iwl_tx_info { struct iwl3945_tx_info {
struct ieee80211_tx_status status; struct ieee80211_tx_status status;
struct sk_buff *skb[MAX_NUM_OF_TBS]; 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 * @need_update: need to update read/write index
* @shed_retry: queue is HT AGG enabled * @shed_retry: queue is HT AGG enabled
* *
* Queue consists of circular buffer of BD's and required locking structures. * Queue consists of circular buffer of BD's and required locking structures.
*/ */
struct iwl_tx_queue { struct iwl3945_tx_queue {
struct iwl_queue q; struct iwl3945_queue q;
struct iwl_tfd_frame *bd; struct iwl3945_tfd_frame *bd;
struct iwl_cmd *cmd; struct iwl3945_cmd *cmd;
dma_addr_t dma_addr_cmd; dma_addr_t dma_addr_cmd;
struct iwl_tx_info *txb; struct iwl3945_tx_info *txb;
int need_update; int need_update;
int sched_retry; int sched_retry;
int active; int active;
@ -155,12 +155,12 @@ struct iwl_tx_queue {
#define IWL_NUM_SCAN_RATES (2) #define IWL_NUM_SCAN_RATES (2)
struct iwl_channel_tgd_info { struct iwl3945_channel_tgd_info {
u8 type; u8 type;
s8 max_power; s8 max_power;
}; };
struct iwl_channel_tgh_info { struct iwl3945_channel_tgh_info {
s64 last_radar_time; s64 last_radar_time;
}; };
@ -171,8 +171,8 @@ struct iwl_channel_tgh_info {
* -- spectrum management * -- spectrum management
* -- user preference (e.g. iwconfig) * -- user preference (e.g. iwconfig)
* when requested power is set, base power index must also be set. */ * when requested power is set, base power index must also be set. */
struct iwl_channel_power_info { struct iwl3945_channel_power_info {
struct iwl_tx_power tpc; /* actual radio and DSP gain settings */ struct iwl3945_tx_power tpc; /* actual radio and DSP gain settings */
s8 power_table_index; /* actual (compenst'd) index into gain table */ s8 power_table_index; /* actual (compenst'd) index into gain table */
s8 base_power_index; /* gain index for power at factory temp. */ s8 base_power_index; /* gain index for power at factory temp. */
s8 requested_power; /* power (dBm) requested for this chnl/rate */ s8 requested_power; /* power (dBm) requested for this chnl/rate */
@ -180,8 +180,8 @@ struct iwl_channel_power_info {
/* current scan Tx power values to use, one for each scan rate for each /* current scan Tx power values to use, one for each scan rate for each
* channel. */ * channel. */
struct iwl_scan_power_info { struct iwl3945_scan_power_info {
struct iwl_tx_power tpc; /* actual radio and DSP gain settings */ struct iwl3945_tx_power tpc; /* actual radio and DSP gain settings */
s8 power_table_index; /* actual (compenst'd) index into gain table */ s8 power_table_index; /* actual (compenst'd) index into gain table */
s8 requested_power; /* scan pwr (dBm) requested for chnl/rate */ s8 requested_power; /* scan pwr (dBm) requested for chnl/rate */
}; };
@ -201,11 +201,11 @@ struct iwl_scan_power_info {
*/ */
#define IWL4965_MAX_RATE (33) #define IWL4965_MAX_RATE (33)
struct iwl_channel_info { struct iwl3945_channel_info {
struct iwl_channel_tgd_info tgd; struct iwl3945_channel_tgd_info tgd;
struct iwl_channel_tgh_info tgh; struct iwl3945_channel_tgh_info tgh;
struct iwl_eeprom_channel eeprom; /* EEPROM regulatory limit */ struct iwl3945_eeprom_channel eeprom; /* EEPROM regulatory limit */
struct iwl_eeprom_channel fat_eeprom; /* EEPROM regulatory limit for struct iwl3945_eeprom_channel fat_eeprom; /* EEPROM regulatory limit for
* FAT channel */ * FAT channel */
u8 channel; /* channel number */ u8 channel; /* channel number */
@ -222,13 +222,13 @@ struct iwl_channel_info {
/* Radio/DSP gain settings for each "normal" data Tx rate. /* Radio/DSP gain settings for each "normal" data Tx rate.
* These include, in addition to RF and DSP gain, a few fields for * These include, in addition to RF and DSP gain, a few fields for
* remembering/modifying gain settings (indexes). */ * 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. */ /* 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 /* maximum power level to prevent clipping for each rate, derived by
* us from this band's saturation power in EEPROM */ * us from this band's saturation power in EEPROM */
const s8 clip_powers[IWL_MAX_RATES]; const s8 clip_powers[IWL_MAX_RATES];
@ -249,8 +249,8 @@ struct iwl_clip_group {
/* Power management (not Tx power) structures */ /* Power management (not Tx power) structures */
struct iwl_power_vec_entry { struct iwl3945_power_vec_entry {
struct iwl_powertable_cmd cmd; struct iwl3945_powertable_cmd cmd;
u8 no_dtim; u8 no_dtim;
}; };
#define IWL_POWER_RANGE_0 (0) #define IWL_POWER_RANGE_0 (0)
@ -266,10 +266,10 @@ struct iwl_power_vec_entry {
#define IWL_POWER_ENABLED 0x10 #define IWL_POWER_ENABLED 0x10
#define IWL_POWER_LEVEL(x) ((x) & IWL_POWER_MASK) #define IWL_POWER_LEVEL(x) ((x) & IWL_POWER_MASK)
struct iwl_power_mgr { struct iwl3945_power_mgr {
spinlock_t lock; spinlock_t lock;
struct iwl_power_vec_entry pwr_range_0[IWL_POWER_AC]; struct iwl3945_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_1[IWL_POWER_AC];
u8 active_index; u8 active_index;
u32 dtim_val; u32 dtim_val;
}; };
@ -279,10 +279,10 @@ struct iwl_power_mgr {
#define IEEE80211_HLEN (IEEE80211_4ADDR_LEN) #define IEEE80211_HLEN (IEEE80211_4ADDR_LEN)
#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) #define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN)
struct iwl_frame { struct iwl3945_frame {
union { union {
struct ieee80211_hdr frame; struct ieee80211_hdr frame;
struct iwl_tx_beacon_cmd beacon; struct iwl3945_tx_beacon_cmd beacon;
u8 raw[IEEE80211_FRAME_LEN]; u8 raw[IEEE80211_FRAME_LEN];
u8 cmd[360]; u8 cmd[360];
} u; } u;
@ -308,15 +308,15 @@ enum {
CMD_WANT_SKB = (1 << 2), CMD_WANT_SKB = (1 << 2),
}; };
struct iwl_cmd; struct iwl3945_cmd;
struct iwl_priv; struct iwl3945_priv;
struct iwl_cmd_meta { struct iwl3945_cmd_meta {
struct iwl_cmd_meta *source; struct iwl3945_cmd_meta *source;
union { union {
struct sk_buff *skb; struct sk_buff *skb;
int (*callback)(struct iwl_priv *priv, int (*callback)(struct iwl3945_priv *priv,
struct iwl_cmd *cmd, struct sk_buff *skb); struct iwl3945_cmd *cmd, struct sk_buff *skb);
} __attribute__ ((packed)) u; } __attribute__ ((packed)) u;
/* The CMD_SIZE_HUGE flag bit indicates that the command /* The CMD_SIZE_HUGE flag bit indicates that the command
@ -325,37 +325,37 @@ struct iwl_cmd_meta {
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_cmd { struct iwl3945_cmd {
struct iwl_cmd_meta meta; struct iwl3945_cmd_meta meta;
struct iwl_cmd_header hdr; struct iwl3945_cmd_header hdr;
union { union {
struct iwl_addsta_cmd addsta; struct iwl3945_addsta_cmd addsta;
struct iwl_led_cmd led; struct iwl3945_led_cmd led;
u32 flags; u32 flags;
u8 val8; u8 val8;
u16 val16; u16 val16;
u32 val32; u32 val32;
struct iwl_bt_cmd bt; struct iwl3945_bt_cmd bt;
struct iwl_rxon_time_cmd rxon_time; struct iwl3945_rxon_time_cmd rxon_time;
struct iwl_powertable_cmd powertable; struct iwl3945_powertable_cmd powertable;
struct iwl_qosparam_cmd qosparam; struct iwl3945_qosparam_cmd qosparam;
struct iwl_tx_cmd tx; struct iwl3945_tx_cmd tx;
struct iwl_tx_beacon_cmd tx_beacon; struct iwl3945_tx_beacon_cmd tx_beacon;
struct iwl_rxon_assoc_cmd rxon_assoc; struct iwl3945_rxon_assoc_cmd rxon_assoc;
u8 *indirect; u8 *indirect;
u8 payload[360]; u8 payload[360];
} __attribute__ ((packed)) cmd; } __attribute__ ((packed)) cmd;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_host_cmd { struct iwl3945_host_cmd {
u8 id; u8 id;
u16 len; u16 len;
struct iwl_cmd_meta meta; struct iwl3945_cmd_meta meta;
const void *data; const void *data;
}; };
#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_cmd) - \ #define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl3945_cmd) - \
sizeof(struct iwl_cmd_meta)) sizeof(struct iwl3945_cmd_meta))
/* /*
* RX related structures and functions * RX related structures and functions
@ -368,7 +368,7 @@ struct iwl_host_cmd {
#define SUP_RATE_11G_MAX_NUM_CHANNELS 12 #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 * @processed: Internal index to last handled Rx packet
* @read: Shared index to newest available Rx buffer * @read: Shared index to newest available Rx buffer
* @write: Shared index to oldest written Rx packet * @write: Shared index to oldest written Rx packet
@ -377,13 +377,13 @@ struct iwl_host_cmd {
* @rx_used: List of Rx buffers with no SKB * @rx_used: List of Rx buffers with no SKB
* @need_update: flag to indicate we need to update read/write index * @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; __le32 *bd;
dma_addr_t dma_addr; dma_addr_t dma_addr;
struct iwl_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS]; struct iwl3945_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS];
struct iwl_rx_mem_buffer *queue[RX_QUEUE_SIZE]; struct iwl3945_rx_mem_buffer *queue[RX_QUEUE_SIZE];
u32 processed; u32 processed;
u32 read; u32 read;
u32 write; u32 write;
@ -427,17 +427,17 @@ struct iwl_rx_queue {
#define IWL_INVALID_RATE 0xFF #define IWL_INVALID_RATE 0xFF
#define IWL_INVALID_VALUE -1 #define IWL_INVALID_VALUE -1
struct iwl_tid_data { struct iwl3945_tid_data {
u16 seq_number; u16 seq_number;
}; };
struct iwl_hw_key { struct iwl3945_hw_key {
enum ieee80211_key_alg alg; enum ieee80211_key_alg alg;
int keylen; int keylen;
u8 key[32]; u8 key[32];
}; };
union iwl_ht_rate_supp { union iwl3945_ht_rate_supp {
u16 rates; u16 rates;
struct { struct {
u8 siso_rate; u8 siso_rate;
@ -472,7 +472,7 @@ struct sta_ht_info {
#ifdef CONFIG_IWL3945_QOS #ifdef CONFIG_IWL3945_QOS
union iwl_qos_capabity { union iwl3945_qos_capabity {
struct { struct {
u8 edca_count:4; /* bit 0-3 */ u8 edca_count:4; /* bit 0-3 */
u8 q_ack:1; /* bit 4 */ u8 q_ack:1; /* bit 4 */
@ -493,20 +493,20 @@ union iwl_qos_capabity {
}; };
/* QoS structures */ /* QoS structures */
struct iwl_qos_info { struct iwl3945_qos_info {
int qos_enable; int qos_enable;
int qos_active; int qos_active;
union iwl_qos_capabity qos_cap; union iwl3945_qos_capabity qos_cap;
struct iwl_qosparam_cmd def_qos_parm; struct iwl3945_qosparam_cmd def_qos_parm;
}; };
#endif /*CONFIG_IWL3945_QOS */ #endif /*CONFIG_IWL3945_QOS */
#define STA_PS_STATUS_WAKE 0 #define STA_PS_STATUS_WAKE 0
#define STA_PS_STATUS_SLEEP 1 #define STA_PS_STATUS_SLEEP 1
struct iwl_station_entry { struct iwl3945_station_entry {
struct iwl_addsta_cmd sta; struct iwl3945_addsta_cmd sta;
struct iwl_tid_data tid[MAX_TID_COUNT]; struct iwl3945_tid_data tid[MAX_TID_COUNT];
union { union {
struct { struct {
u8 rate; u8 rate;
@ -516,7 +516,7 @@ struct iwl_station_entry {
} current_rate; } current_rate;
u8 used; u8 used;
u8 ps_status; u8 ps_status;
struct iwl_hw_key keyinfo; struct iwl3945_hw_key keyinfo;
}; };
/* one for each uCode image (inst/data, boot/init/runtime) */ /* one for each uCode image (inst/data, boot/init/runtime) */
@ -527,7 +527,7 @@ struct fw_desc {
}; };
/* uCode file layout */ /* uCode file layout */
struct iwl_ucode { struct iwl3945_ucode {
__le32 ver; /* major/minor/subminor */ __le32 ver; /* major/minor/subminor */
__le32 inst_size; /* bytes of runtime instructions */ __le32 inst_size; /* bytes of runtime instructions */
__le32 data_size; /* bytes of runtime data */ __le32 data_size; /* bytes of runtime data */
@ -539,7 +539,7 @@ struct iwl_ucode {
#define IWL_IBSS_MAC_HASH_SIZE 32 #define IWL_IBSS_MAC_HASH_SIZE 32
struct iwl_ibss_seq { struct iwl3945_ibss_seq {
u8 mac[ETH_ALEN]; u8 mac[ETH_ALEN];
u16 seq_num; u16 seq_num;
u16 frag_num; u16 frag_num;
@ -547,7 +547,7 @@ struct iwl_ibss_seq {
struct list_head list; struct list_head list;
}; };
struct iwl_driver_hw_info { struct iwl3945_driver_hw_info {
u16 max_txq_num; u16 max_txq_num;
u16 ac_queue_count; u16 ac_queue_count;
u16 tx_cmd_len; u16 tx_cmd_len;
@ -573,10 +573,10 @@ struct iwl_driver_hw_info {
#define HT_SHORT_GI_40MHZ_ONLY (1 << 1) #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.payload + \
x->u.rx_frame.stats.phy_count)) 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 + \ IWL_RX_HDR(x)->payload + \
le16_to_cpu(IWL_RX_HDR(x)->len))) le16_to_cpu(IWL_RX_HDR(x)->len)))
#define IWL_RX_STATS(x) (&x->u.rx_frame.stats) #define IWL_RX_STATS(x) (&x->u.rx_frame.stats)
@ -589,61 +589,61 @@ struct iwl_driver_hw_info {
* for use by iwl-*.c * for use by iwl-*.c
* *
*****************************************************************************/ *****************************************************************************/
struct iwl_addsta_cmd; struct iwl3945_addsta_cmd;
extern int iwl_send_add_station(struct iwl_priv *priv, extern int iwl3945_send_add_station(struct iwl3945_priv *priv,
struct iwl_addsta_cmd *sta, u8 flags); struct iwl3945_addsta_cmd *sta, u8 flags);
extern u8 iwl_add_station(struct iwl_priv *priv, const u8 *bssid, extern u8 iwl3945_add_station(struct iwl3945_priv *priv, const u8 *bssid,
int is_ap, u8 flags); 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); struct ieee80211_hdr *header);
extern int iwl_power_init_handle(struct iwl_priv *priv); extern int iwl3945_power_init_handle(struct iwl3945_priv *priv);
extern int iwl_eeprom_init(struct iwl_priv *priv); extern int iwl3945_eeprom_init(struct iwl3945_priv *priv);
#ifdef CONFIG_IWL3945_DEBUG #ifdef CONFIG_IWL3945_DEBUG
extern void iwl_report_frame(struct iwl_priv *priv, extern void iwl3945_report_frame(struct iwl3945_priv *priv,
struct iwl_rx_packet *pkt, struct iwl3945_rx_packet *pkt,
struct ieee80211_hdr *header, int group100); struct ieee80211_hdr *header, int group100);
#else #else
static inline void iwl_report_frame(struct iwl_priv *priv, static inline void iwl3945_report_frame(struct iwl3945_priv *priv,
struct iwl_rx_packet *pkt, struct iwl3945_rx_packet *pkt,
struct ieee80211_hdr *header, struct ieee80211_hdr *header,
int group100) {} int group100) {}
#endif #endif
extern void iwl_handle_data_packet_monitor(struct iwl_priv *priv, extern void iwl3945_handle_data_packet_monitor(struct iwl3945_priv *priv,
struct iwl_rx_mem_buffer *rxb, struct iwl3945_rx_mem_buffer *rxb,
void *data, short len, void *data, short len,
struct ieee80211_rx_status *stats, struct ieee80211_rx_status *stats,
u16 phy_flags); u16 phy_flags);
extern int is_duplicate_packet(struct iwl_priv *priv, struct ieee80211_hdr extern int iwl3945_is_duplicate_packet(struct iwl3945_priv *priv,
*header); struct ieee80211_hdr *header);
extern int iwl_rx_queue_alloc(struct iwl_priv *priv); extern int iwl3945_rx_queue_alloc(struct iwl3945_priv *priv);
extern void iwl_rx_queue_reset(struct iwl_priv *priv, extern void iwl3945_rx_queue_reset(struct iwl3945_priv *priv,
struct iwl_rx_queue *rxq); struct iwl3945_rx_queue *rxq);
extern int iwl_calc_db_from_ratio(int sig_ratio); extern int iwl3945_calc_db_from_ratio(int sig_ratio);
extern int iwl_calc_sig_qual(int rssi_dbm, int noise_dbm); extern int iwl3945_calc_sig_qual(int rssi_dbm, int noise_dbm);
extern int iwl_tx_queue_init(struct iwl_priv *priv, extern int iwl3945_tx_queue_init(struct iwl3945_priv *priv,
struct iwl_tx_queue *txq, int count, u32 id); struct iwl3945_tx_queue *txq, int count, u32 id);
extern void iwl_rx_replenish(void *data); extern void iwl3945_rx_replenish(void *data);
extern void iwl_tx_queue_free(struct iwl_priv *priv, struct iwl_tx_queue *txq); extern void iwl3945_tx_queue_free(struct iwl3945_priv *priv, struct iwl3945_tx_queue *txq);
extern int iwl_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len, extern int iwl3945_send_cmd_pdu(struct iwl3945_priv *priv, u8 id, u16 len,
const void *data); const void *data);
extern int __must_check iwl_send_cmd(struct iwl_priv *priv, extern int __must_check iwl3945_send_cmd(struct iwl3945_priv *priv,
struct iwl_host_cmd *cmd); struct iwl3945_host_cmd *cmd);
extern unsigned int iwl_fill_beacon_frame(struct iwl_priv *priv, extern unsigned int iwl3945_fill_beacon_frame(struct iwl3945_priv *priv,
struct ieee80211_hdr *hdr, struct ieee80211_hdr *hdr,
const u8 *dest, int left); const u8 *dest, int left);
extern int iwl_rx_queue_update_write_ptr(struct iwl_priv *priv, extern int iwl3945_rx_queue_update_write_ptr(struct iwl3945_priv *priv,
struct iwl_rx_queue *q); struct iwl3945_rx_queue *q);
extern int iwl_send_statistics_request(struct iwl_priv *priv); extern int iwl3945_send_statistics_request(struct iwl3945_priv *priv);
extern void iwl_set_decrypted_flag(struct iwl_priv *priv, struct sk_buff *skb, extern void iwl3945_set_decrypted_flag(struct iwl3945_priv *priv, struct sk_buff *skb,
u32 decrypt_res, u32 decrypt_res,
struct ieee80211_rx_status *stats); 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 * Currently used by iwl-3945-rs... look at restructuring so that it doesn't
* call this... todo... fix that. * 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); u16 tx_rate, u8 flags);
/****************************************************************************** /******************************************************************************
@ -655,65 +655,65 @@ extern u8 iwl_sync_station(struct iwl_priv *priv, int sta_id,
* which is why they are in the hardware specific files (vs. iwl-base.c) * which is why they are in the hardware specific files (vs. iwl-base.c)
* *
* Naming convention -- * Naming convention --
* iwl_ <-- Its part of iwlwifi (should be changed to iwl_) * iwl3945_ <-- Its part of iwlwifi (should be changed to iwl3945_)
* iwl_hw_ <-- Hardware specific (implemented in iwl-XXXX.c by all HW) * iwl3945_hw_ <-- Hardware specific (implemented in iwl-XXXX.c by all HW)
* iwlXXXX_ <-- Hardware specific (implemented in iwl-XXXX.c for XXXX) * iwlXXXX_ <-- Hardware specific (implemented in iwl-XXXX.c for XXXX)
* iwl_bg_ <-- Called from work queue context * iwl3945_bg_ <-- Called from work queue context
* iwl_mac_ <-- mac80211 callback * iwl3945_mac_ <-- mac80211 callback
* *
****************************************************************************/ ****************************************************************************/
extern void iwl_hw_rx_handler_setup(struct iwl_priv *priv); extern void iwl3945_hw_rx_handler_setup(struct iwl3945_priv *priv);
extern void iwl_hw_setup_deferred_work(struct iwl_priv *priv); extern void iwl3945_hw_setup_deferred_work(struct iwl3945_priv *priv);
extern void iwl_hw_cancel_deferred_work(struct iwl_priv *priv); extern void iwl3945_hw_cancel_deferred_work(struct iwl3945_priv *priv);
extern int iwl_hw_rxq_stop(struct iwl_priv *priv); extern int iwl3945_hw_rxq_stop(struct iwl3945_priv *priv);
extern int iwl_hw_set_hw_setting(struct iwl_priv *priv); extern int iwl3945_hw_set_hw_setting(struct iwl3945_priv *priv);
extern int iwl_hw_nic_init(struct iwl_priv *priv); extern int iwl3945_hw_nic_init(struct iwl3945_priv *priv);
extern int iwl_hw_nic_stop_master(struct iwl_priv *priv); extern int iwl3945_hw_nic_stop_master(struct iwl3945_priv *priv);
extern void iwl_hw_txq_ctx_free(struct iwl_priv *priv); extern void iwl3945_hw_txq_ctx_free(struct iwl3945_priv *priv);
extern void iwl_hw_txq_ctx_stop(struct iwl_priv *priv); extern void iwl3945_hw_txq_ctx_stop(struct iwl3945_priv *priv);
extern int iwl_hw_nic_reset(struct iwl_priv *priv); extern int iwl3945_hw_nic_reset(struct iwl3945_priv *priv);
extern int iwl_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv, void *tfd, extern int iwl3945_hw_txq_attach_buf_to_tfd(struct iwl3945_priv *priv, void *tfd,
dma_addr_t addr, u16 len); dma_addr_t addr, u16 len);
extern int iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq); extern int iwl3945_hw_txq_free_tfd(struct iwl3945_priv *priv, struct iwl3945_tx_queue *txq);
extern int iwl_hw_get_temperature(struct iwl_priv *priv); extern int iwl3945_hw_get_temperature(struct iwl3945_priv *priv);
extern int iwl_hw_tx_queue_init(struct iwl_priv *priv, extern int iwl3945_hw_tx_queue_init(struct iwl3945_priv *priv,
struct iwl_tx_queue *txq); struct iwl3945_tx_queue *txq);
extern unsigned int iwl_hw_get_beacon_cmd(struct iwl_priv *priv, extern unsigned int iwl3945_hw_get_beacon_cmd(struct iwl3945_priv *priv,
struct iwl_frame *frame, u8 rate); struct iwl3945_frame *frame, u8 rate);
extern int iwl_hw_get_rx_read(struct iwl_priv *priv); extern int iwl3945_hw_get_rx_read(struct iwl3945_priv *priv);
extern void iwl_hw_build_tx_cmd_rate(struct iwl_priv *priv, extern void iwl3945_hw_build_tx_cmd_rate(struct iwl3945_priv *priv,
struct iwl_cmd *cmd, struct iwl3945_cmd *cmd,
struct ieee80211_tx_control *ctrl, struct ieee80211_tx_control *ctrl,
struct ieee80211_hdr *hdr, struct ieee80211_hdr *hdr,
int sta_id, int tx_id); int sta_id, int tx_id);
extern int iwl_hw_reg_send_txpower(struct iwl_priv *priv); extern int iwl3945_hw_reg_send_txpower(struct iwl3945_priv *priv);
extern int iwl_hw_reg_set_txpower(struct iwl_priv *priv, s8 power); extern int iwl3945_hw_reg_set_txpower(struct iwl3945_priv *priv, s8 power);
extern void iwl_hw_rx_statistics(struct iwl_priv *priv, extern void iwl3945_hw_rx_statistics(struct iwl3945_priv *priv,
struct iwl_rx_mem_buffer *rxb); struct iwl3945_rx_mem_buffer *rxb);
extern void iwl_disable_events(struct iwl_priv *priv); extern void iwl3945_disable_events(struct iwl3945_priv *priv);
extern int iwl4965_get_temperature(const struct iwl_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 * @bssid: MAC address of station ID to find
* *
* NOTE: This should not be hardware specific but the code has * NOTE: This should not be hardware specific but the code has
* not yet been merged into a single common layer for managing the * not yet been merged into a single common layer for managing the
* station tables. * 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 * Forward declare iwl-3945.c functions for iwl-base.c
*/ */
extern int iwl_eeprom_acquire_semaphore(struct iwl_priv *priv); extern int iwl3945_eeprom_acquire_semaphore(struct iwl3945_priv *priv);
extern __le32 iwl3945_get_antenna_flags(const struct iwl_priv *priv); extern __le32 iwl3945_get_antenna_flags(const struct iwl3945_priv *priv);
extern int iwl3945_init_hw_rate_table(struct iwl_priv *priv); extern int iwl3945_init_hw_rate_table(struct iwl3945_priv *priv);
extern void iwl3945_reg_txpower_periodic(struct iwl_priv *priv); extern void iwl3945_reg_txpower_periodic(struct iwl3945_priv *priv);
extern int iwl3945_txpower_set_from_eeprom(struct iwl_priv *priv); extern int iwl3945_txpower_set_from_eeprom(struct iwl3945_priv *priv);
extern u8 iwl3945_sync_sta(struct iwl_priv *priv, int sta_id, extern u8 iwl3945_sync_sta(struct iwl3945_priv *priv, int sta_id,
u16 tx_rate, u8 flags); u16 tx_rate, u8 flags);
@ -726,7 +726,7 @@ enum {
#endif #endif
struct iwl_priv { struct iwl3945_priv {
/* ieee device used by generic ieee processing code */ /* ieee device used by generic ieee processing code */
struct ieee80211_hw *hw; struct ieee80211_hw *hw;
@ -740,27 +740,27 @@ struct iwl_priv {
u8 phymode; u8 phymode;
int alloc_rxb_skb; int alloc_rxb_skb;
void (*rx_handlers[REPLY_MAX])(struct iwl_priv *priv, void (*rx_handlers[REPLY_MAX])(struct iwl3945_priv *priv,
struct iwl_rx_mem_buffer *rxb); struct iwl3945_rx_mem_buffer *rxb);
const struct ieee80211_hw_mode *modes; const struct ieee80211_hw_mode *modes;
#ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT #ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT
/* spectrum measurement report caching */ /* spectrum measurement report caching */
struct iwl_spectrum_notification measure_report; struct iwl3945_spectrum_notification measure_report;
u8 measurement_status; u8 measurement_status;
#endif #endif
/* ucode beacon time */ /* ucode beacon time */
u32 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 */ * 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 */ u8 channel_count; /* # of channels */
/* each calibration channel group in the EEPROM has a derived /* each calibration channel group in the EEPROM has a derived
* clip setting for each rate. */ * clip setting for each rate. */
const struct iwl_clip_group clip_groups[5]; const struct iwl3945_clip_group clip_groups[5];
/* thermal calibration */ /* thermal calibration */
s32 temperature; /* degrees Kelvin */ s32 temperature; /* degrees Kelvin */
@ -775,7 +775,7 @@ struct iwl_priv {
int one_direct_scan; int one_direct_scan;
u8 direct_ssid_len; u8 direct_ssid_len;
u8 direct_ssid[IW_ESSID_MAX_SIZE]; u8 direct_ssid[IW_ESSID_MAX_SIZE];
struct iwl_scan_cmd *scan; struct iwl3945_scan_cmd *scan;
u8 only_active_channel; u8 only_active_channel;
/* spinlock */ /* spinlock */
@ -798,26 +798,26 @@ struct iwl_priv {
struct fw_desc ucode_boot; /* bootstrap inst */ 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 /* We declare this const so it can only be
* changed via explicit cast within the * changed via explicit cast within the
* routines that actually update the physical * routines that actually update the physical
* hardware */ * hardware */
const struct iwl_rxon_cmd active_rxon; const struct iwl3945_rxon_cmd active_rxon;
struct iwl_rxon_cmd staging_rxon; struct iwl3945_rxon_cmd staging_rxon;
int error_recovering; int error_recovering;
struct iwl_rxon_cmd recovery_rxon; struct iwl3945_rxon_cmd recovery_rxon;
/* 1st responses from initialize and runtime uCode images. /* 1st responses from initialize and runtime uCode images.
* 4965's initialize alive response contains some calibration data. */ * 4965's initialize alive response contains some calibration data. */
struct iwl_init_alive_resp card_alive_init; struct iwl3945_init_alive_resp card_alive_init;
struct iwl_alive_resp card_alive; struct iwl3945_alive_resp card_alive;
#ifdef LED #ifdef LED
/* LED related variables */ /* LED related variables */
struct iwl_activity_blink activity; struct iwl3945_activity_blink activity;
unsigned long led_packets; unsigned long led_packets;
int led_state; int led_state;
#endif #endif
@ -836,8 +836,8 @@ struct iwl_priv {
int activity_timer_active; int activity_timer_active;
/* Rx and Tx DMA processing queues */ /* Rx and Tx DMA processing queues */
struct iwl_rx_queue rxq; struct iwl3945_rx_queue rxq;
struct iwl_tx_queue txq[IWL_MAX_NUM_QUEUES]; struct iwl3945_tx_queue txq[IWL_MAX_NUM_QUEUES];
unsigned long status; unsigned long status;
u32 config; u32 config;
@ -845,9 +845,9 @@ struct iwl_priv {
int last_rx_rssi; /* From Rx packet statisitics */ int last_rx_rssi; /* From Rx packet statisitics */
int last_rx_noise; /* From beacon statistics */ 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; unsigned long last_statistics_time;
/* context information */ /* context information */
@ -864,7 +864,7 @@ struct iwl_priv {
/*station table variables */ /*station table variables */
spinlock_t sta_lock; spinlock_t sta_lock;
int num_stations; 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 */ /* Indication if ieee80211_ops->open has been called */
int is_open; int is_open;
@ -885,7 +885,7 @@ struct iwl_priv {
struct list_head ibss_mac_hash[IWL_IBSS_MAC_HASH_SIZE]; struct list_head ibss_mac_hash[IWL_IBSS_MAC_HASH_SIZE];
/* eeprom */ /* eeprom */
struct iwl_eeprom eeprom; struct iwl3945_eeprom eeprom;
int iw_mode; int iw_mode;
@ -895,7 +895,7 @@ struct iwl_priv {
u32 timestamp0; u32 timestamp0;
u32 timestamp1; u32 timestamp1;
u16 beacon_int; u16 beacon_int;
struct iwl_driver_hw_info hw_setting; struct iwl3945_driver_hw_info hw_setting;
int interface_id; int interface_id;
/* Current association information needed to configure the /* Current association information needed to configure the
@ -905,7 +905,7 @@ struct iwl_priv {
u8 ps_mode; u8 ps_mode;
#ifdef CONFIG_IWL3945_QOS #ifdef CONFIG_IWL3945_QOS
struct iwl_qos_info qos_data; struct iwl3945_qos_info qos_data;
#endif /*CONFIG_IWL3945_QOS */ #endif /*CONFIG_IWL3945_QOS */
struct workqueue_struct *workqueue; struct workqueue_struct *workqueue;
@ -946,55 +946,55 @@ struct iwl_priv {
u32 framecnt_to_us; u32 framecnt_to_us;
atomic_t restrict_refcnt; atomic_t restrict_refcnt;
#endif #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; 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) if (ch_info == NULL)
return 0; return 0;
return (ch_info->flags & EEPROM_CHANNEL_VALID) ? 1 : 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; 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; 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; 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) || return ((ch_info->phymode == MODE_IEEE80211B) ||
(ch_info->phymode == MODE_IEEE80211G)); (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; 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; return ((ch->flags & EEPROM_CHANNEL_IBSS)) ? 1 : 0;
} }
extern const struct iwl_channel_info *iwl_get_channel_info( extern const struct iwl3945_channel_info *iwl3945_get_channel_info(
const struct iwl_priv *priv, int phymode, u16 channel); 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" #include "iwl-3945-io.h"
#endif #endif

Просмотреть файл

@ -61,8 +61,8 @@
* *
*****************************************************************************/ *****************************************************************************/
#ifndef __iwl_commands_h__ #ifndef __iwl4965_commands_h__
#define __iwl_commands_h__ #define __iwl4965_commands_h__
enum { enum {
REPLY_ALIVE = 0x1, REPLY_ALIVE = 0x1,
@ -147,7 +147,7 @@ enum {
#define IWL_CMD_FAILED_MSK 0x40 #define IWL_CMD_FAILED_MSK 0x40
struct iwl_cmd_header { struct iwl4965_cmd_header {
u8 cmd; u8 cmd;
u8 flags; u8 flags;
/* We have 15 LSB to use as we please (MSB indicates /* We have 15 LSB to use as we please (MSB indicates
@ -179,7 +179,7 @@ struct iwl_cmd_header {
/* /*
* REPLY_ALIVE = 0x1 (response only, not a command) * REPLY_ALIVE = 0x1 (response only, not a command)
*/ */
struct iwl_alive_resp { struct iwl4965_alive_resp {
u8 ucode_minor; u8 ucode_minor;
u8 ucode_major; u8 ucode_major;
__le16 reserved1; __le16 reserved1;
@ -193,7 +193,7 @@ struct iwl_alive_resp {
__le32 is_valid; __le32 is_valid;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_init_alive_resp { struct iwl4965_init_alive_resp {
u8 ucode_minor; u8 ucode_minor;
u8 ucode_major; u8 ucode_major;
__le16 reserved1; __le16 reserved1;
@ -225,7 +225,7 @@ union tsf {
/* /*
* REPLY_ERROR = 0x2 (response only, not a command) * REPLY_ERROR = 0x2 (response only, not a command)
*/ */
struct iwl_error_resp { struct iwl4965_error_resp {
__le32 error_type; __le32 error_type;
u8 cmd_id; u8 cmd_id;
u8 reserved1; u8 reserved1;
@ -293,7 +293,7 @@ enum {
/* /*
* REPLY_RXON = 0x10 (command, has simple generic response) * REPLY_RXON = 0x10 (command, has simple generic response)
*/ */
struct iwl_rxon_cmd { struct iwl4965_rxon_cmd {
u8 node_addr[6]; u8 node_addr[6];
__le16 reserved1; __le16 reserved1;
u8 bssid_addr[6]; u8 bssid_addr[6];
@ -316,7 +316,7 @@ struct iwl_rxon_cmd {
/* /*
* REPLY_RXON_ASSOC = 0x11 (command, has simple generic response) * REPLY_RXON_ASSOC = 0x11 (command, has simple generic response)
*/ */
struct iwl_rxon_assoc_cmd { struct iwl4965_rxon_assoc_cmd {
__le32 flags; __le32 flags;
__le32 filter_flags; __le32 filter_flags;
u8 ofdm_basic_rates; u8 ofdm_basic_rates;
@ -330,7 +330,7 @@ struct iwl_rxon_assoc_cmd {
/* /*
* REPLY_RXON_TIMING = 0x14 (command, has simple generic response) * REPLY_RXON_TIMING = 0x14 (command, has simple generic response)
*/ */
struct iwl_rxon_time_cmd { struct iwl4965_rxon_time_cmd {
union tsf timestamp; union tsf timestamp;
__le16 beacon_interval; __le16 beacon_interval;
__le16 atim_window; __le16 atim_window;
@ -339,7 +339,7 @@ struct iwl_rxon_time_cmd {
__le16 reserved; __le16 reserved;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_tx_power { struct iwl4965_tx_power {
u8 tx_gain; /* gain for analog radio */ u8 tx_gain; /* gain for analog radio */
u8 dsp_atten; /* gain for DSP */ u8 dsp_atten; /* gain for DSP */
} __attribute__ ((packed)); } __attribute__ ((packed));
@ -351,27 +351,27 @@ struct tx_power_dual_stream {
__le32 dw; __le32 dw;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_tx_power_db { struct iwl4965_tx_power_db {
struct tx_power_dual_stream power_tbl[POWER_TABLE_NUM_ENTRIES]; struct tx_power_dual_stream power_tbl[POWER_TABLE_NUM_ENTRIES];
} __attribute__ ((packed)); } __attribute__ ((packed));
/* /*
* REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response) * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response)
*/ */
struct iwl_channel_switch_cmd { struct iwl4965_channel_switch_cmd {
u8 band; u8 band;
u8 expect_beacon; u8 expect_beacon;
__le16 channel; __le16 channel;
__le32 rxon_flags; __le32 rxon_flags;
__le32 rxon_filter_flags; __le32 rxon_filter_flags;
__le32 switch_time; __le32 switch_time;
struct iwl_tx_power_db tx_power; struct iwl4965_tx_power_db tx_power;
} __attribute__ ((packed)); } __attribute__ ((packed));
/* /*
* CHANNEL_SWITCH_NOTIFICATION = 0x73 (notification only, not a command) * CHANNEL_SWITCH_NOTIFICATION = 0x73 (notification only, not a command)
*/ */
struct iwl_csa_notification { struct iwl4965_csa_notification {
__le16 band; __le16 band;
__le16 channel; __le16 channel;
__le32 status; /* 0 - OK, 1 - fail */ __le32 status; /* 0 - OK, 1 - fail */
@ -382,7 +382,7 @@ struct iwl_csa_notification {
* Quality-of-Service (QOS) Commands & Responses: * Quality-of-Service (QOS) Commands & Responses:
* *
*****************************************************************************/ *****************************************************************************/
struct iwl_ac_qos { struct iwl4965_ac_qos {
__le16 cw_min; __le16 cw_min;
__le16 cw_max; __le16 cw_max;
u8 aifsn; u8 aifsn;
@ -404,9 +404,9 @@ struct iwl_ac_qos {
/* /*
* REPLY_QOS_PARAM = 0x13 (command, has simple generic response) * REPLY_QOS_PARAM = 0x13 (command, has simple generic response)
*/ */
struct iwl_qosparam_cmd { struct iwl4965_qosparam_cmd {
__le32 qos_flags; __le32 qos_flags;
struct iwl_ac_qos ac[AC_NUM]; struct iwl4965_ac_qos ac[AC_NUM];
} __attribute__ ((packed)); } __attribute__ ((packed));
/****************************************************************************** /******************************************************************************
@ -464,7 +464,7 @@ struct iwl_qosparam_cmd {
#define RATE_MCS_ANT_B_MSK 0x8000 #define RATE_MCS_ANT_B_MSK 0x8000
#define RATE_MCS_ANT_AB_MSK 0xc000 #define RATE_MCS_ANT_AB_MSK 0xc000
struct iwl_keyinfo { struct iwl4965_keyinfo {
__le16 key_flags; __le16 key_flags;
u8 tkip_rx_tsc_byte2; /* TSC[2] for key mix ph1 detection */ u8 tkip_rx_tsc_byte2; /* TSC[2] for key mix ph1 detection */
u8 reserved1; u8 reserved1;
@ -484,11 +484,11 @@ struct sta_id_modify {
/* /*
* REPLY_ADD_STA = 0x18 (command) * REPLY_ADD_STA = 0x18 (command)
*/ */
struct iwl_addsta_cmd { struct iwl4965_addsta_cmd {
u8 mode; u8 mode;
u8 reserved[3]; u8 reserved[3];
struct sta_id_modify sta; struct sta_id_modify sta;
struct iwl_keyinfo key; struct iwl4965_keyinfo key;
__le32 station_flags; __le32 station_flags;
__le32 station_flags_msk; __le32 station_flags_msk;
__le16 tid_disable_tx; __le16 tid_disable_tx;
@ -502,7 +502,7 @@ struct iwl_addsta_cmd {
/* /*
* REPLY_ADD_STA = 0x18 (response) * REPLY_ADD_STA = 0x18 (response)
*/ */
struct iwl_add_sta_resp { struct iwl4965_add_sta_resp {
u8 status; u8 status;
} __attribute__ ((packed)); } __attribute__ ((packed));
@ -514,7 +514,7 @@ struct iwl_add_sta_resp {
* *
*****************************************************************************/ *****************************************************************************/
struct iwl_rx_frame_stats { struct iwl4965_rx_frame_stats {
u8 phy_count; u8 phy_count;
u8 id; u8 id;
u8 rssi; u8 rssi;
@ -524,7 +524,7 @@ struct iwl_rx_frame_stats {
u8 payload[0]; u8 payload[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_rx_frame_hdr { struct iwl4965_rx_frame_hdr {
__le16 channel; __le16 channel;
__le16 phy_flags; __le16 phy_flags;
u8 reserved1; u8 reserved1;
@ -554,7 +554,7 @@ struct iwl_rx_frame_hdr {
#define RX_RES_STATUS_BAD_ICV_MIC (0x1 << 11) #define RX_RES_STATUS_BAD_ICV_MIC (0x1 << 11)
#define RX_RES_STATUS_BAD_KEY_TTAK (0x2 << 11) #define RX_RES_STATUS_BAD_KEY_TTAK (0x2 << 11)
struct iwl_rx_frame_end { struct iwl4965_rx_frame_end {
__le32 status; __le32 status;
__le64 timestamp; __le64 timestamp;
__le32 beacon_timestamp; __le32 beacon_timestamp;
@ -568,10 +568,10 @@ struct iwl_rx_frame_end {
* The actual offsets of the hdr and end are dynamic based on * The actual offsets of the hdr and end are dynamic based on
* stats.phy_count * stats.phy_count
*/ */
struct iwl_rx_frame { struct iwl4965_rx_frame {
struct iwl_rx_frame_stats stats; struct iwl4965_rx_frame_stats stats;
struct iwl_rx_frame_hdr hdr; struct iwl4965_rx_frame_hdr hdr;
struct iwl_rx_frame_end end; struct iwl4965_rx_frame_end end;
} __attribute__ ((packed)); } __attribute__ ((packed));
/* Fixed (non-configurable) rx data from phy */ /* Fixed (non-configurable) rx data from phy */
@ -666,7 +666,7 @@ struct iwl4965_rx_mpdu_res_start {
* TX command Frame life time * TX command Frame life time
*/ */
struct iwl_dram_scratch { struct iwl4965_dram_scratch {
u8 try_cnt; u8 try_cnt;
u8 bt_kill_cnt; u8 bt_kill_cnt;
__le16 reserved; __le16 reserved;
@ -675,11 +675,11 @@ struct iwl_dram_scratch {
/* /*
* REPLY_TX = 0x1c (command) * REPLY_TX = 0x1c (command)
*/ */
struct iwl_tx_cmd { struct iwl4965_tx_cmd {
__le16 len; __le16 len;
__le16 next_frame_len; __le16 next_frame_len;
__le32 tx_flags; __le32 tx_flags;
struct iwl_dram_scratch scratch; struct iwl4965_dram_scratch scratch;
__le32 rate_n_flags; __le32 rate_n_flags;
u8 sta_id; u8 sta_id;
u8 sec_ctl; u8 sec_ctl;
@ -807,7 +807,7 @@ enum {
/* /*
* REPLY_TX = 0x1c (response) * REPLY_TX = 0x1c (response)
*/ */
struct iwl_tx_resp { struct iwl4965_tx_resp {
u8 frame_count; /* 1 no aggregation, >1 aggregation */ u8 frame_count; /* 1 no aggregation, >1 aggregation */
u8 bt_kill_count; u8 bt_kill_count;
u8 failure_rts; u8 failure_rts;
@ -823,7 +823,7 @@ struct iwl_tx_resp {
/* /*
* REPLY_COMPRESSED_BA = 0xc5 (response only, not a command) * REPLY_COMPRESSED_BA = 0xc5 (response only, not a command)
*/ */
struct iwl_compressed_ba_resp { struct iwl4965_compressed_ba_resp {
__le32 sta_addr_lo32; __le32 sta_addr_lo32;
__le16 sta_addr_hi16; __le16 sta_addr_hi16;
__le16 reserved; __le16 reserved;
@ -839,11 +839,11 @@ struct iwl_compressed_ba_resp {
/* /*
* REPLY_TX_PWR_TABLE_CMD = 0x97 (command, has simple generic response) * 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 band; /* 0: 5 GHz, 1: 2.4 GHz */
u8 reserved; u8 reserved;
__le16 channel; __le16 channel;
struct iwl_tx_power_db tx_power; struct iwl4965_tx_power_db tx_power;
} __attribute__ ((packed)); } __attribute__ ((packed));
/*RS_NEW_API: only TLC_RTS remains and moved to bit 0 */ /*RS_NEW_API: only TLC_RTS remains and moved to bit 0 */
@ -856,7 +856,7 @@ struct iwl_txpowertable_cmd {
#define LINK_QUAL_ANT_B_MSK (1<<1) #define LINK_QUAL_ANT_B_MSK (1<<1)
#define LINK_QUAL_ANT_MSK (LINK_QUAL_ANT_A_MSK|LINK_QUAL_ANT_B_MSK) #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 flags;
u8 mimo_delimiter; u8 mimo_delimiter;
u8 single_stream_ant_msk; u8 single_stream_ant_msk;
@ -864,7 +864,7 @@ struct iwl_link_qual_general_params {
u8 start_rate_index[LINK_QUAL_AC_NUM]; u8 start_rate_index[LINK_QUAL_AC_NUM];
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_link_qual_agg_params { struct iwl4965_link_qual_agg_params {
__le16 agg_time_limit; __le16 agg_time_limit;
u8 agg_dis_start_th; u8 agg_dis_start_th;
u8 agg_frame_cnt_limit; u8 agg_frame_cnt_limit;
@ -874,12 +874,12 @@ struct iwl_link_qual_agg_params {
/* /*
* REPLY_TX_LINK_QUALITY_CMD = 0x4e (command, has simple generic response) * 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 sta_id;
u8 reserved1; u8 reserved1;
__le16 control; __le16 control;
struct iwl_link_qual_general_params general_params; struct iwl4965_link_qual_general_params general_params;
struct iwl_link_qual_agg_params agg_params; struct iwl4965_link_qual_agg_params agg_params;
struct { struct {
__le32 rate_n_flags; __le32 rate_n_flags;
} rs_table[LINK_QUAL_MAX_RETRY_NUM]; } rs_table[LINK_QUAL_MAX_RETRY_NUM];
@ -889,7 +889,7 @@ struct iwl_link_quality_cmd {
/* /*
* REPLY_BT_CONFIG = 0x9b (command, has simple generic response) * REPLY_BT_CONFIG = 0x9b (command, has simple generic response)
*/ */
struct iwl_bt_cmd { struct iwl4965_bt_cmd {
u8 flags; u8 flags;
u8 lead_time; u8 lead_time;
u8 max_kill; u8 max_kill;
@ -915,18 +915,18 @@ struct iwl_bt_cmd {
RXON_FILTER_ASSOC_MSK | \ RXON_FILTER_ASSOC_MSK | \
RXON_FILTER_BCON_AWARE_MSK) RXON_FILTER_BCON_AWARE_MSK)
struct iwl_measure_channel { struct iwl4965_measure_channel {
__le32 duration; /* measurement duration in extended beacon __le32 duration; /* measurement duration in extended beacon
* format */ * format */
u8 channel; /* channel to measure */ u8 channel; /* channel to measure */
u8 type; /* see enum iwl_measure_type */ u8 type; /* see enum iwl4965_measure_type */
__le16 reserved; __le16 reserved;
} __attribute__ ((packed)); } __attribute__ ((packed));
/* /*
* REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (command) * REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (command)
*/ */
struct iwl_spectrum_cmd { struct iwl4965_spectrum_cmd {
__le16 len; /* number of bytes starting from token */ __le16 len; /* number of bytes starting from token */
u8 token; /* token id */ u8 token; /* token id */
u8 id; /* measurement id -- 0 or 1 */ u8 id; /* measurement id -- 0 or 1 */
@ -939,13 +939,13 @@ struct iwl_spectrum_cmd {
__le32 filter_flags; /* rxon filter flags */ __le32 filter_flags; /* rxon filter flags */
__le16 channel_count; /* minimum 1, maximum 10 */ __le16 channel_count; /* minimum 1, maximum 10 */
__le16 reserved3; __le16 reserved3;
struct iwl_measure_channel channels[10]; struct iwl4965_measure_channel channels[10];
} __attribute__ ((packed)); } __attribute__ ((packed));
/* /*
* REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (response) * REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (response)
*/ */
struct iwl_spectrum_resp { struct iwl4965_spectrum_resp {
u8 token; u8 token;
u8 id; /* id of the prior command replaced, or 0xff */ u8 id; /* id of the prior command replaced, or 0xff */
__le16 status; /* 0 - command will be handled __le16 status; /* 0 - command will be handled
@ -953,12 +953,12 @@ struct iwl_spectrum_resp {
* measurement) */ * measurement) */
} __attribute__ ((packed)); } __attribute__ ((packed));
enum iwl_measurement_state { enum iwl4965_measurement_state {
IWL_MEASUREMENT_START = 0, IWL_MEASUREMENT_START = 0,
IWL_MEASUREMENT_STOP = 1, IWL_MEASUREMENT_STOP = 1,
}; };
enum iwl_measurement_status { enum iwl4965_measurement_status {
IWL_MEASUREMENT_OK = 0, IWL_MEASUREMENT_OK = 0,
IWL_MEASUREMENT_CONCURRENT = 1, IWL_MEASUREMENT_CONCURRENT = 1,
IWL_MEASUREMENT_CSA_CONFLICT = 2, IWL_MEASUREMENT_CSA_CONFLICT = 2,
@ -971,18 +971,18 @@ enum iwl_measurement_status {
#define NUM_ELEMENTS_IN_HISTOGRAM 8 #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 ofdm[NUM_ELEMENTS_IN_HISTOGRAM]; /* in 0.8usec counts */
__le32 cck[NUM_ELEMENTS_IN_HISTOGRAM]; /* in 1usec counts */ __le32 cck[NUM_ELEMENTS_IN_HISTOGRAM]; /* in 1usec counts */
} __attribute__ ((packed)); } __attribute__ ((packed));
/* clear channel availability counters */ /* clear channel availability counters */
struct iwl_measurement_cca_counters { struct iwl4965_measurement_cca_counters {
__le32 ofdm; __le32 ofdm;
__le32 cck; __le32 cck;
} __attribute__ ((packed)); } __attribute__ ((packed));
enum iwl_measure_type { enum iwl4965_measure_type {
IWL_MEASURE_BASIC = (1 << 0), IWL_MEASURE_BASIC = (1 << 0),
IWL_MEASURE_CHANNEL_LOAD = (1 << 1), IWL_MEASURE_CHANNEL_LOAD = (1 << 1),
IWL_MEASURE_HISTOGRAM_RPI = (1 << 2), IWL_MEASURE_HISTOGRAM_RPI = (1 << 2),
@ -995,7 +995,7 @@ enum iwl_measure_type {
/* /*
* SPECTRUM_MEASURE_NOTIFICATION = 0x75 (notification only, not a command) * 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 id; /* measurement id -- 0 or 1 */
u8 token; u8 token;
u8 channel_index; /* index in measurement channel list */ u8 channel_index; /* index in measurement channel list */
@ -1003,7 +1003,7 @@ struct iwl_spectrum_notification {
__le32 start_time; /* lower 32-bits of TSF */ __le32 start_time; /* lower 32-bits of TSF */
u8 band; /* 0 - 5.2GHz, 1 - 2.4GHz */ u8 band; /* 0 - 5.2GHz, 1 - 2.4GHz */
u8 channel; u8 channel;
u8 type; /* see enum iwl_measurement_type */ u8 type; /* see enum iwl4965_measurement_type */
u8 reserved1; u8 reserved1;
/* NOTE: cca_ofdm, cca_cck, basic_type, and histogram are only only /* NOTE: cca_ofdm, cca_cck, basic_type, and histogram are only only
* valid if applicable for measurement type requested. */ * valid if applicable for measurement type requested. */
@ -1013,9 +1013,9 @@ struct iwl_spectrum_notification {
u8 basic_type; /* 0 - bss, 1 - ofdm preamble, 2 - u8 basic_type; /* 0 - bss, 1 - ofdm preamble, 2 -
* unidentified */ * unidentified */
u8 reserved2[3]; u8 reserved2[3];
struct iwl_measurement_histogram histogram; struct iwl4965_measurement_histogram histogram;
__le32 stop_time; /* lower 32-bits of TSF */ __le32 stop_time; /* lower 32-bits of TSF */
__le32 status; /* see iwl_measurement_status */ __le32 status; /* see iwl4965_measurement_status */
} __attribute__ ((packed)); } __attribute__ ((packed));
/****************************************************************************** /******************************************************************************
@ -1025,7 +1025,7 @@ struct iwl_spectrum_notification {
*****************************************************************************/ *****************************************************************************/
/** /**
* struct iwl_powertable_cmd - Power Table Command * struct iwl4965_powertable_cmd - Power Table Command
* @flags: See below: * @flags: See below:
* *
* POWER_TABLE_CMD = 0x77 (command, has simple generic response) * POWER_TABLE_CMD = 0x77 (command, has simple generic response)
@ -1058,7 +1058,7 @@ struct iwl_spectrum_notification {
#define IWL_POWER_SLEEP_OVER_DTIM_MSK __constant_cpu_to_le16(1<<2) #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) #define IWL_POWER_PCI_PM_MSK __constant_cpu_to_le16(1<<3)
struct iwl_powertable_cmd { struct iwl4965_powertable_cmd {
__le16 flags; __le16 flags;
u8 keep_alive_seconds; u8 keep_alive_seconds;
u8 debug_flags; u8 debug_flags;
@ -1072,7 +1072,7 @@ struct iwl_powertable_cmd {
* PM_SLEEP_NOTIFICATION = 0x7A (notification only, not a command) * PM_SLEEP_NOTIFICATION = 0x7A (notification only, not a command)
* 3945 and 4965 identical. * 3945 and 4965 identical.
*/ */
struct iwl_sleep_notification { struct iwl4965_sleep_notification {
u8 pm_sleep_mode; u8 pm_sleep_mode;
u8 pm_wakeup_src; u8 pm_wakeup_src;
__le16 reserved; __le16 reserved;
@ -1102,14 +1102,14 @@ enum {
#define CARD_STATE_CMD_DISABLE 0x00 /* Put card to sleep */ #define CARD_STATE_CMD_DISABLE 0x00 /* Put card to sleep */
#define CARD_STATE_CMD_ENABLE 0x01 /* Wake up card */ #define CARD_STATE_CMD_ENABLE 0x01 /* Wake up card */
#define CARD_STATE_CMD_HALT 0x02 /* Power down permanently */ #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 */ __le32 status; /* CARD_STATE_CMD_* request new power state */
} __attribute__ ((packed)); } __attribute__ ((packed));
/* /*
* CARD_STATE_NOTIFICATION = 0xa1 (notification only, not a command) * CARD_STATE_NOTIFICATION = 0xa1 (notification only, not a command)
*/ */
struct iwl_card_state_notif { struct iwl4965_card_state_notif {
__le32 flags; __le32 flags;
} __attribute__ ((packed)); } __attribute__ ((packed));
@ -1118,7 +1118,7 @@ struct iwl_card_state_notif {
#define RF_CARD_DISABLED 0x04 #define RF_CARD_DISABLED 0x04
#define RXON_CARD_DISABLED 0x10 #define RXON_CARD_DISABLED 0x10
struct iwl_ct_kill_config { struct iwl4965_ct_kill_config {
__le32 reserved; __le32 reserved;
__le32 critical_temperature_M; __le32 critical_temperature_M;
__le32 critical_temperature_R; __le32 critical_temperature_R;
@ -1130,7 +1130,7 @@ struct iwl_ct_kill_config {
* *
*****************************************************************************/ *****************************************************************************/
struct iwl_scan_channel { struct iwl4965_scan_channel {
/* type is defined as: /* type is defined as:
* 0:0 active (0 - passive) * 0:0 active (0 - passive)
* 1:4 SSID direct * 1:4 SSID direct
@ -1139,12 +1139,12 @@ struct iwl_scan_channel {
*/ */
u8 type; u8 type;
u8 channel; u8 channel;
struct iwl_tx_power tpc; struct iwl4965_tx_power tpc;
__le16 active_dwell; __le16 active_dwell;
__le16 passive_dwell; __le16 passive_dwell;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_ssid_ie { struct iwl4965_ssid_ie {
u8 id; u8 id;
u8 len; u8 len;
u8 ssid[32]; u8 ssid[32];
@ -1158,7 +1158,7 @@ struct iwl_ssid_ie {
/* /*
* REPLY_SCAN_CMD = 0x80 (command) * REPLY_SCAN_CMD = 0x80 (command)
*/ */
struct iwl_scan_cmd { struct iwl4965_scan_cmd {
__le16 len; __le16 len;
u8 reserved0; u8 reserved0;
u8 channel_count; u8 channel_count;
@ -1177,14 +1177,14 @@ struct iwl_scan_cmd {
__le32 flags; __le32 flags;
__le32 filter_flags; __le32 filter_flags;
struct iwl_tx_cmd tx_cmd; struct iwl4965_tx_cmd tx_cmd;
struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX]; struct iwl4965_ssid_ie direct_scan[PROBE_OPTION_MAX];
u8 data[0]; u8 data[0];
/* /*
* The channels start after the probe request payload and are of type: * 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 * NOTE: Only one band of channels can be scanned per pass. You
* can not mix 2.4GHz channels and 5.2GHz channels and must * can not mix 2.4GHz channels and 5.2GHz channels and must
@ -1201,14 +1201,14 @@ struct iwl_scan_cmd {
/* /*
* REPLY_SCAN_CMD = 0x80 (response) * REPLY_SCAN_CMD = 0x80 (response)
*/ */
struct iwl_scanreq_notification { struct iwl4965_scanreq_notification {
__le32 status; /* 1: okay, 2: cannot fulfill request */ __le32 status; /* 1: okay, 2: cannot fulfill request */
} __attribute__ ((packed)); } __attribute__ ((packed));
/* /*
* SCAN_START_NOTIFICATION = 0x82 (notification only, not a command) * SCAN_START_NOTIFICATION = 0x82 (notification only, not a command)
*/ */
struct iwl_scanstart_notification { struct iwl4965_scanstart_notification {
__le32 tsf_low; __le32 tsf_low;
__le32 tsf_high; __le32 tsf_high;
__le32 beacon_timer; __le32 beacon_timer;
@ -1225,7 +1225,7 @@ struct iwl_scanstart_notification {
/* /*
* SCAN_RESULTS_NOTIFICATION = 0x83 (notification only, not a command) * SCAN_RESULTS_NOTIFICATION = 0x83 (notification only, not a command)
*/ */
struct iwl_scanresults_notification { struct iwl4965_scanresults_notification {
u8 channel; u8 channel;
u8 band; u8 band;
u8 reserved[2]; u8 reserved[2];
@ -1237,7 +1237,7 @@ struct iwl_scanresults_notification {
/* /*
* SCAN_COMPLETE_NOTIFICATION = 0x84 (notification only, not a command) * SCAN_COMPLETE_NOTIFICATION = 0x84 (notification only, not a command)
*/ */
struct iwl_scancomplete_notification { struct iwl4965_scancomplete_notification {
u8 scanned_channels; u8 scanned_channels;
u8 status; u8 status;
u8 reserved; u8 reserved;
@ -1256,8 +1256,8 @@ struct iwl_scancomplete_notification {
/* /*
* BEACON_NOTIFICATION = 0x90 (notification only, not a command) * BEACON_NOTIFICATION = 0x90 (notification only, not a command)
*/ */
struct iwl_beacon_notif { struct iwl4965_beacon_notif {
struct iwl_tx_resp beacon_notify_hdr; struct iwl4965_tx_resp beacon_notify_hdr;
__le32 low_tsf; __le32 low_tsf;
__le32 high_tsf; __le32 high_tsf;
__le32 ibss_mgr_status; __le32 ibss_mgr_status;
@ -1266,8 +1266,8 @@ struct iwl_beacon_notif {
/* /*
* REPLY_TX_BEACON = 0x91 (command, has simple generic response) * REPLY_TX_BEACON = 0x91 (command, has simple generic response)
*/ */
struct iwl_tx_beacon_cmd { struct iwl4965_tx_beacon_cmd {
struct iwl_tx_cmd tx; struct iwl4965_tx_cmd tx;
__le16 tim_idx; __le16 tim_idx;
u8 tim_size; u8 tim_size;
u8 reserved1; u8 reserved1;
@ -1458,7 +1458,7 @@ struct statistics_general {
*/ */
#define IWL_STATS_CONF_CLEAR_STATS __constant_cpu_to_le32(0x1) /* see above */ #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 */ #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_* */ __le32 configuration_flags; /* IWL_STATS_CONF_* */
} __attribute__ ((packed)); } __attribute__ ((packed));
@ -1479,7 +1479,7 @@ struct iwl_statistics_cmd {
*/ */
#define STATISTICS_REPLY_FLG_BAND_24G_MSK __constant_cpu_to_le32(0x2) #define STATISTICS_REPLY_FLG_BAND_24G_MSK __constant_cpu_to_le32(0x2)
#define STATISTICS_REPLY_FLG_FAT_MODE_MSK __constant_cpu_to_le32(0x8) #define STATISTICS_REPLY_FLG_FAT_MODE_MSK __constant_cpu_to_le32(0x8)
struct iwl_notif_statistics { struct iwl4965_notif_statistics {
__le32 flag; __le32 flag;
struct statistics_rx rx; struct statistics_rx rx;
struct statistics_tx tx; struct statistics_tx tx;
@ -1494,7 +1494,7 @@ struct iwl_notif_statistics {
* then this notification will be sent. */ * then this notification will be sent. */
#define CONSECUTIVE_MISSED_BCONS_TH 20 #define CONSECUTIVE_MISSED_BCONS_TH 20
struct iwl_missed_beacon_notif { struct iwl4965_missed_beacon_notif {
__le32 consequtive_missed_beacons; __le32 consequtive_missed_beacons;
__le32 total_missed_becons; __le32 total_missed_becons;
__le32 num_expected_beacons; __le32 num_expected_beacons;
@ -1510,12 +1510,12 @@ struct iwl_missed_beacon_notif {
#define PHY_CALIBRATE_DIFF_GAIN_CMD (7) #define PHY_CALIBRATE_DIFF_GAIN_CMD (7)
#define HD_TABLE_SIZE (11) #define HD_TABLE_SIZE (11)
struct iwl_sensitivity_cmd { struct iwl4965_sensitivity_cmd {
__le16 control; __le16 control;
__le16 table[HD_TABLE_SIZE]; __le16 table[HD_TABLE_SIZE];
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_calibration_cmd { struct iwl4965_calibration_cmd {
u8 opCode; u8 opCode;
u8 flags; u8 flags;
__le16 reserved; __le16 reserved;
@ -1538,7 +1538,7 @@ struct iwl_calibration_cmd {
* For each of 3 possible LEDs (Activity/Link/Tech, selected by "id" field), * 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. * 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 */ __le32 interval; /* "interval" in uSec */
u8 id; /* 1: Activity, 2: Link, 3: Tech */ u8 id; /* 1: Activity, 2: Link, 3: Tech */
u8 off; /* # intervals off while blinking; u8 off; /* # intervals off while blinking;
@ -1554,29 +1554,29 @@ struct iwl_led_cmd {
* *
*****************************************************************************/ *****************************************************************************/
struct iwl_rx_packet { struct iwl4965_rx_packet {
__le32 len; __le32 len;
struct iwl_cmd_header hdr; struct iwl4965_cmd_header hdr;
union { union {
struct iwl_alive_resp alive_frame; struct iwl4965_alive_resp alive_frame;
struct iwl_rx_frame rx_frame; struct iwl4965_rx_frame rx_frame;
struct iwl_tx_resp tx_resp; struct iwl4965_tx_resp tx_resp;
struct iwl_spectrum_notification spectrum_notif; struct iwl4965_spectrum_notification spectrum_notif;
struct iwl_csa_notification csa_notif; struct iwl4965_csa_notification csa_notif;
struct iwl_error_resp err_resp; struct iwl4965_error_resp err_resp;
struct iwl_card_state_notif card_state_notif; struct iwl4965_card_state_notif card_state_notif;
struct iwl_beacon_notif beacon_status; struct iwl4965_beacon_notif beacon_status;
struct iwl_add_sta_resp add_sta; struct iwl4965_add_sta_resp add_sta;
struct iwl_sleep_notification sleep_notif; struct iwl4965_sleep_notification sleep_notif;
struct iwl_spectrum_resp spectrum; struct iwl4965_spectrum_resp spectrum;
struct iwl_notif_statistics stats; struct iwl4965_notif_statistics stats;
struct iwl_compressed_ba_resp compressed_ba; struct iwl4965_compressed_ba_resp compressed_ba;
struct iwl_missed_beacon_notif missed_beacon; struct iwl4965_missed_beacon_notif missed_beacon;
__le32 status; __le32 status;
u8 raw[0]; u8 raw[0];
} u; } u;
} __attribute__ ((packed)); } __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__ */

Просмотреть файл

@ -26,18 +26,18 @@
* *
*****************************************************************************/ *****************************************************************************/
#ifndef __iwl_debug_h__ #ifndef __iwl4965_debug_h__
#define __iwl_debug_h__ #define __iwl4965_debug_h__
#ifdef CONFIG_IWL4965_DEBUG #ifdef CONFIG_IWL4965_DEBUG
extern u32 iwl_debug_level; extern u32 iwl4965_debug_level;
#define IWL_DEBUG(level, fmt, args...) \ #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, \ printk(KERN_ERR DRV_NAME": %c %s " fmt, \
in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
#define IWL_DEBUG_LIMIT(level, fmt, args...) \ #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, \ printk(KERN_ERR DRV_NAME": %c %s " fmt, \
in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
#else #else
@ -68,7 +68,7 @@ static inline void IWL_DEBUG_LIMIT(int level, const char *fmt, ...)
* *
* % cat /proc/net/iwl/debug_level * % 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 * If you do not see debug_level in /proc/net/iwl then you do not have
* CONFIG_IWL4965_DEBUG defined in your kernel configuration * CONFIG_IWL4965_DEBUG defined in your kernel configuration

Просмотреть файл

@ -137,7 +137,7 @@ enum {
#define EEPROM_SKU_CAP_OP_MODE_MRC (1 << 7) #define EEPROM_SKU_CAP_OP_MODE_MRC (1 << 7)
/* *regulatory* channel data from eeprom, one for each channel */ /* *regulatory* channel data from eeprom, one for each channel */
struct iwl_eeprom_channel { struct iwl4965_eeprom_channel {
u8 flags; /* flags copied from EEPROM */ u8 flags; /* flags copied from EEPROM */
s8 max_power_avg; /* max power (dBm) on this chnl, limit 31 */ s8 max_power_avg; /* max power (dBm) on this chnl, limit 31 */
} __attribute__ ((packed)); } __attribute__ ((packed));
@ -152,7 +152,7 @@ struct iwl_eeprom_channel {
* level. * level.
* Data copied from EEPROM. * Data copied from EEPROM.
*/ */
struct iwl_eeprom_txpower_sample { struct iwl4965_eeprom_txpower_sample {
u8 gain_index; /* index into power (gain) setup table ... */ u8 gain_index; /* index into power (gain) setup table ... */
s8 power; /* ... for this pwr level for this chnl group */ s8 power; /* ... for this pwr level for this chnl group */
u16 v_det; /* PA output voltage */ u16 v_det; /* PA output voltage */
@ -166,8 +166,8 @@ struct iwl_eeprom_txpower_sample {
* Data copied from EEPROM. * Data copied from EEPROM.
* DO NOT ALTER THIS STRUCTURE!!! * DO NOT ALTER THIS STRUCTURE!!!
*/ */
struct iwl_eeprom_txpower_group { struct iwl4965_eeprom_txpower_group {
struct iwl_eeprom_txpower_sample samples[5]; /* 5 power levels */ struct iwl4965_eeprom_txpower_sample samples[5]; /* 5 power levels */
s32 a, b, c, d, e; /* coefficients for voltage->power s32 a, b, c, d, e; /* coefficients for voltage->power
* formula (signed) */ * formula (signed) */
s32 Fa, Fb, Fc, Fd, Fe; /* these modify coeffs based on s32 Fa, Fb, Fc, Fd, Fe; /* these modify coeffs based on
@ -185,7 +185,7 @@ struct iwl_eeprom_txpower_group {
* difference between current temperature and factory calib temperature. * difference between current temperature and factory calib temperature.
* Data copied from EEPROM. * Data copied from EEPROM.
*/ */
struct iwl_eeprom_temperature_corr { struct iwl4965_eeprom_temperature_corr {
u32 Ta; u32 Ta;
u32 Tb; u32 Tb;
u32 Tc; u32 Tc;
@ -199,35 +199,35 @@ struct iwl_eeprom_temperature_corr {
#define EEPROM_TX_POWER_VERSION (2) #define EEPROM_TX_POWER_VERSION (2)
#define EEPROM_TX_POWER_VERSION_NEW (5) #define EEPROM_TX_POWER_VERSION_NEW (5)
struct iwl_eeprom_calib_measure { struct iwl4965_eeprom_calib_measure {
u8 temperature; u8 temperature;
u8 gain_idx; u8 gain_idx;
u8 actual_pow; u8 actual_pow;
s8 pa_det; s8 pa_det;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_eeprom_calib_ch_info { struct iwl4965_eeprom_calib_ch_info {
u8 ch_num; 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]; [EEPROM_TX_POWER_MEASUREMENTS];
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_eeprom_calib_subband_info { struct iwl4965_eeprom_calib_subband_info {
u8 ch_from; u8 ch_from;
u8 ch_to; u8 ch_to;
struct iwl_eeprom_calib_ch_info ch1; struct iwl4965_eeprom_calib_ch_info ch1;
struct iwl_eeprom_calib_ch_info ch2; struct iwl4965_eeprom_calib_ch_info ch2;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_eeprom_calib_info { struct iwl4965_eeprom_calib_info {
u8 saturation_power24; u8 saturation_power24;
u8 saturation_power52; u8 saturation_power52;
s16 voltage; /* signed */ 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)); } __attribute__ ((packed));
struct iwl_eeprom { struct iwl4965_eeprom {
u8 reserved0[16]; u8 reserved0[16];
#define EEPROM_DEVICE_ID (2*0x08) /* 2 bytes */ #define EEPROM_DEVICE_ID (2*0x08) /* 2 bytes */
u16 device_id; /* abs.ofs: 16 */ u16 device_id; /* abs.ofs: 16 */
@ -276,30 +276,30 @@ struct iwl_eeprom {
#define EEPROM_REGULATORY_BAND_1 (2*0x62) /* 2 bytes */ #define EEPROM_REGULATORY_BAND_1 (2*0x62) /* 2 bytes */
u16 band_1_count; /* abs.ofs: 196 */ u16 band_1_count; /* abs.ofs: 196 */
#define EEPROM_REGULATORY_BAND_1_CHANNELS (2*0x63) /* 28 bytes */ #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 */ #define EEPROM_REGULATORY_BAND_2 (2*0x71) /* 2 bytes */
u16 band_2_count; /* abs.ofs: 226 */ u16 band_2_count; /* abs.ofs: 226 */
#define EEPROM_REGULATORY_BAND_2_CHANNELS (2*0x72) /* 26 bytes */ #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 */ #define EEPROM_REGULATORY_BAND_3 (2*0x7F) /* 2 bytes */
u16 band_3_count; /* abs.ofs: 254 */ u16 band_3_count; /* abs.ofs: 254 */
#define EEPROM_REGULATORY_BAND_3_CHANNELS (2*0x80) /* 24 bytes */ #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 */ #define EEPROM_REGULATORY_BAND_4 (2*0x8C) /* 2 bytes */
u16 band_4_count; /* abs.ofs: 280 */ u16 band_4_count; /* abs.ofs: 280 */
#define EEPROM_REGULATORY_BAND_4_CHANNELS (2*0x8D) /* 22 bytes */ #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 */ #define EEPROM_REGULATORY_BAND_5 (2*0x98) /* 2 bytes */
u16 band_5_count; /* abs.ofs: 304 */ u16 band_5_count; /* abs.ofs: 304 */
#define EEPROM_REGULATORY_BAND_5_CHANNELS (2*0x99) /* 12 bytes */ #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]; u8 reserved10[2];
#define EEPROM_REGULATORY_BAND_24_FAT_CHANNELS (2*0xA0) /* 14 bytes */ #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]; u8 reserved11[2];
#define EEPROM_REGULATORY_BAND_52_FAT_CHANNELS (2*0xA8) /* 22 bytes */ #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]; u8 reserved12[6];
#define EEPROM_CALIB_VERSION_OFFSET (2*0xB6) /* 2 bytes */ #define EEPROM_CALIB_VERSION_OFFSET (2*0xB6) /* 2 bytes */
u16 calib_version; /* abs.ofs: 364 */ u16 calib_version; /* abs.ofs: 364 */
@ -308,7 +308,7 @@ struct iwl_eeprom {
u16 satruation_power; /* abs.ofs: 368 */ u16 satruation_power; /* abs.ofs: 368 */
u8 reserved14[94]; u8 reserved14[94];
#define EEPROM_IWL_CALIB_TXPOWER_OFFSET (2*0xE8) /* 48 bytes */ #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 */ u8 reserved16[140]; /* fill out to full 1024 byte block */
@ -731,8 +731,8 @@ struct iwl_eeprom {
#define TFD_TX_CMD_SLOTS 256 #define TFD_TX_CMD_SLOTS 256
#define TFD_CMD_SLOTS 32 #define TFD_CMD_SLOTS 32
#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_cmd) - \ #define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl4965_cmd) - \
sizeof(struct iwl_cmd_meta)) sizeof(struct iwl4965_cmd_meta))
/* /*
* RX related structures and functions * RX related structures and functions
@ -751,7 +751,7 @@ struct iwl_eeprom {
#define IWL_MAX_INST_SIZE KDR_RTC_INST_SIZE #define IWL_MAX_INST_SIZE KDR_RTC_INST_SIZE
#define IWL_MAX_DATA_SIZE KDR_RTC_DATA_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) && return (addr >= RTC_DATA_LOWER_BOUND) &&
(addr < KDR_RTC_DATA_UPPER_BOUND); (addr < KDR_RTC_DATA_UPPER_BOUND);
@ -873,7 +873,7 @@ enum {
#define CALIB_IWL_TX_ATTEN_GR5_LCH 20 #define CALIB_IWL_TX_ATTEN_GR5_LCH 20
union iwl_tx_power_dual_stream { union iwl4965_tx_power_dual_stream {
struct { struct {
u8 radio_tx_gain[2]; u8 radio_tx_gain[2];
u8 dsp_predis_atten[2]; u8 dsp_predis_atten[2];
@ -1115,20 +1115,20 @@ union iwl_tx_power_dual_stream {
#define CSR_HW_IF_CONFIG_REG_BIT_MAC_SI (0x00000100) #define CSR_HW_IF_CONFIG_REG_BIT_MAC_SI (0x00000100)
#define CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI (0x00000200) #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; 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; 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); return cpu_to_le32(flags|(u16)rate);
} }
struct iwl_tfd_frame_data { struct iwl4965_tfd_frame_data {
__le32 tb1_addr; __le32 tb1_addr;
__le32 val1; __le32 val1;
@ -1156,7 +1156,7 @@ struct iwl_tfd_frame_data {
#define IWL_tb2_len_SYM val2 #define IWL_tb2_len_SYM val2
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_tfd_frame { struct iwl4965_tfd_frame {
__le32 val0; __le32 val0;
/* __le32 rsvd1:24; */ /* __le32 rsvd1:24; */
/* __le32 num_tbs:5; */ /* __le32 num_tbs:5; */
@ -1165,7 +1165,7 @@ struct iwl_tfd_frame {
#define IWL_num_tbs_SYM val0 #define IWL_num_tbs_SYM val0
/* __le32 rsvd2:1; */ /* __le32 rsvd2:1; */
/* __le32 padding:2; */ /* __le32 padding:2; */
struct iwl_tfd_frame_data pa[10]; struct iwl4965_tfd_frame_data pa[10];
__le32 reserved; __le32 reserved;
} __attribute__ ((packed)); } __attribute__ ((packed));
@ -1191,9 +1191,9 @@ struct iwl4965_sched_queue_byte_cnt_tbl {
sizeof(__le16)]; sizeof(__le16)];
} __attribute__ ((packed)); } __attribute__ ((packed));
/* Base physical address of iwl_shared is provided to KDR_SCD_DRAM_BASE_ADDR /* Base physical address of iwl4965_shared is provided to KDR_SCD_DRAM_BASE_ADDR
* and &iwl_shared.val0 is provided to FH_RSCSR_CHNL0_STTS_WPTR_REG */ * and &iwl4965_shared.val0 is provided to FH_RSCSR_CHNL0_STTS_WPTR_REG */
struct iwl_shared { struct iwl4965_shared {
struct iwl4965_sched_queue_byte_cnt_tbl struct iwl4965_sched_queue_byte_cnt_tbl
queues_byte_cnt_tbls[IWL_MAX_NUM_QUEUES]; queues_byte_cnt_tbls[IWL_MAX_NUM_QUEUES];
__le32 val0; __le32 val0;
@ -1225,4 +1225,4 @@ struct iwl_shared {
__le32 padding2; __le32 padding2;
} __attribute__ ((packed)); } __attribute__ ((packed));
#endif /* __iwl_4965_hw_h__ */ #endif /* __iwl4965_4965_hw_h__ */

Просмотреть файл

@ -26,8 +26,8 @@
* *
*****************************************************************************/ *****************************************************************************/
#ifndef __iwl_io_h__ #ifndef __iwl4965_io_h__
#define __iwl_io_h__ #define __iwl4965_io_h__
#include <linux/io.h> #include <linux/io.h>
@ -49,8 +49,8 @@
* *
* If you wish to call the function without any debug or state checking, * 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 * 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 * routines, for example _iwl4965_read_direct32 calls the non-check version of
* _iwl_read32.) * _iwl4965_read32.)
* *
* These declarations are *extremely* useful in quickly isolating code deltas * These declarations are *extremely* useful in quickly isolating code deltas
* which result in misconfiguring of the hardware I/O. In combination with * which result in misconfiguring of the hardware I/O. In combination with
@ -59,39 +59,39 @@
* *
*/ */
#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 #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) u32 ofs, u32 val)
{ {
IWL_DEBUG_IO("write32(0x%08X, 0x%08X) - %s %d\n", ofs, val, f, l); 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) \ #define iwl4965_write32(iwl, ofs, val) \
__iwl_write32(__FILE__, __LINE__, iwl, ofs, val) __iwl4965_write32(__FILE__, __LINE__, iwl, ofs, val)
#else #else
#define iwl_write32(iwl, ofs, val) _iwl_write32(iwl, ofs, val) #define iwl4965_write32(iwl, ofs, val) _iwl4965_write32(iwl, ofs, val)
#endif #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 #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); 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 #else
#define iwl_read32(p, o) _iwl_read32(p, o) #define iwl4965_read32(p, o) _iwl4965_read32(p, o)
#endif #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) u32 bits, u32 mask, int timeout)
{ {
int i = 0; int i = 0;
do { do {
if ((_iwl_read32(priv, addr) & mask) == (bits & mask)) if ((_iwl4965_read32(priv, addr) & mask) == (bits & mask))
return i; return i;
mdelay(10); mdelay(10);
i += 10; i += 10;
@ -100,11 +100,11 @@ static inline int _iwl_poll_bit(struct iwl_priv *priv, u32 addr,
return -ETIMEDOUT; return -ETIMEDOUT;
} }
#ifdef CONFIG_IWL4965_DEBUG #ifdef CONFIG_IWL4965_DEBUG
static inline int __iwl_poll_bit(const char *f, u32 l, static inline int __iwl4965_poll_bit(const char *f, u32 l,
struct iwl_priv *priv, u32 addr, struct iwl4965_priv *priv, u32 addr,
u32 bits, u32 mask, int timeout) 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)) if (unlikely(ret == -ETIMEDOUT))
IWL_DEBUG_IO IWL_DEBUG_IO
("poll_bit(0x%08X, 0x%08X, 0x%08X) - timedout - %s %d\n", ("poll_bit(0x%08X, 0x%08X, 0x%08X) - timedout - %s %d\n",
@ -115,47 +115,47 @@ static inline int __iwl_poll_bit(const char *f, u32 l,
addr, bits, mask, ret, f, l); addr, bits, mask, ret, f, l);
return ret; return ret;
} }
#define iwl_poll_bit(iwl, addr, bits, mask, timeout) \ #define iwl4965_poll_bit(iwl, addr, bits, mask, timeout) \
__iwl_poll_bit(__FILE__, __LINE__, iwl, addr, bits, mask, timeout) __iwl4965_poll_bit(__FILE__, __LINE__, iwl, addr, bits, mask, timeout)
#else #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 #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 #ifdef CONFIG_IWL4965_DEBUG
static inline void __iwl_set_bit(const char *f, u32 l, static inline void __iwl4965_set_bit(const char *f, u32 l,
struct iwl_priv *priv, u32 reg, u32 mask) 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_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 #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 #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 #ifdef CONFIG_IWL4965_DEBUG
static inline void __iwl_clear_bit(const char *f, u32 l, static inline void __iwl4965_clear_bit(const char *f, u32 l,
struct iwl_priv *priv, u32 reg, u32 mask) 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_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 #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 #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; int ret;
u32 gp_ctl; u32 gp_ctl;
@ -170,7 +170,7 @@ static inline int _iwl_grab_nic_access(struct iwl_priv *priv)
"wakes up NIC\n"); "wakes up NIC\n");
/* 10 msec allows time for NIC to complete its data save */ /* 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) { if (gp_ctl & CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY) {
IWL_DEBUG_RF_KILL("Wait for complete power-down, " IWL_DEBUG_RF_KILL("Wait for complete power-down, "
"gpctl = 0x%08x\n", gp_ctl); "gpctl = 0x%08x\n", gp_ctl);
@ -181,8 +181,8 @@ static inline int _iwl_grab_nic_access(struct iwl_priv *priv)
} }
/* this bit wakes up the NIC */ /* this bit wakes up the NIC */
_iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); _iwl4965_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
ret = _iwl_poll_bit(priv, CSR_GP_CNTRL, ret = _iwl4965_poll_bit(priv, CSR_GP_CNTRL,
CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN, CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN,
(CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY | (CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY |
CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP), 50); CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP), 50);
@ -198,106 +198,106 @@ static inline int _iwl_grab_nic_access(struct iwl_priv *priv)
} }
#ifdef CONFIG_IWL4965_DEBUG #ifdef CONFIG_IWL4965_DEBUG
static inline int __iwl_grab_nic_access(const char *f, u32 l, static inline int __iwl4965_grab_nic_access(const char *f, u32 l,
struct iwl_priv *priv) struct iwl4965_priv *priv)
{ {
if (atomic_read(&priv->restrict_refcnt)) if (atomic_read(&priv->restrict_refcnt))
IWL_DEBUG_INFO("Grabbing access while already held at " IWL_DEBUG_INFO("Grabbing access while already held at "
"line %d.\n", l); "line %d.\n", l);
IWL_DEBUG_IO("grabbing nic access - %s %d\n", f, 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) \ #define iwl4965_grab_nic_access(priv) \
__iwl_grab_nic_access(__FILE__, __LINE__, priv) __iwl4965_grab_nic_access(__FILE__, __LINE__, priv)
#else #else
#define iwl_grab_nic_access(priv) \ #define iwl4965_grab_nic_access(priv) \
_iwl_grab_nic_access(priv) _iwl4965_grab_nic_access(priv)
#endif #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 #ifdef CONFIG_IWL4965_DEBUG
if (atomic_dec_and_test(&priv->restrict_refcnt)) if (atomic_dec_and_test(&priv->restrict_refcnt))
#endif #endif
_iwl_clear_bit(priv, CSR_GP_CNTRL, _iwl4965_clear_bit(priv, CSR_GP_CNTRL,
CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
} }
#ifdef CONFIG_IWL4965_DEBUG #ifdef CONFIG_IWL4965_DEBUG
static inline void __iwl_release_nic_access(const char *f, u32 l, static inline void __iwl4965_release_nic_access(const char *f, u32 l,
struct iwl_priv *priv) struct iwl4965_priv *priv)
{ {
if (atomic_read(&priv->restrict_refcnt) <= 0) if (atomic_read(&priv->restrict_refcnt) <= 0)
IWL_ERROR("Release unheld nic access at line %d.\n", l); IWL_ERROR("Release unheld nic access at line %d.\n", l);
IWL_DEBUG_IO("releasing nic access - %s %d\n", f, 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) \ #define iwl4965_release_nic_access(priv) \
__iwl_release_nic_access(__FILE__, __LINE__, priv) __iwl4965_release_nic_access(__FILE__, __LINE__, priv)
#else #else
#define iwl_release_nic_access(priv) \ #define iwl4965_release_nic_access(priv) \
_iwl_release_nic_access(priv) _iwl4965_release_nic_access(priv)
#endif #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 #ifdef CONFIG_IWL4965_DEBUG
static inline u32 __iwl_read_direct32(const char *f, u32 l, static inline u32 __iwl4965_read_direct32(const char *f, u32 l,
struct iwl_priv *priv, u32 reg) 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)) if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access not held from %s %d\n", f, l); 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, IWL_DEBUG_IO("read_direct32(0x%4X) = 0x%08x - %s %d \n", reg, value,
f, l); f, l);
return value; return value;
} }
#define iwl_read_direct32(priv, reg) \ #define iwl4965_read_direct32(priv, reg) \
__iwl_read_direct32(__FILE__, __LINE__, priv, reg) __iwl4965_read_direct32(__FILE__, __LINE__, priv, reg)
#else #else
#define iwl_read_direct32 _iwl_read_direct32 #define iwl4965_read_direct32 _iwl4965_read_direct32
#endif #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) u32 reg, u32 value)
{ {
_iwl_write32(priv, reg, value); _iwl4965_write32(priv, reg, value);
} }
#ifdef CONFIG_IWL4965_DEBUG #ifdef CONFIG_IWL4965_DEBUG
static void __iwl_write_direct32(u32 line, static void __iwl4965_write_direct32(u32 line,
struct iwl_priv *priv, u32 reg, u32 value) struct iwl4965_priv *priv, u32 reg, u32 value)
{ {
if (!atomic_read(&priv->restrict_refcnt)) if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access not held from line %d\n", line); 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) \ #define iwl4965_write_direct32(priv, reg, value) \
__iwl_write_direct32(__LINE__, priv, reg, value) __iwl4965_write_direct32(__LINE__, priv, reg, value)
#else #else
#define iwl_write_direct32 _iwl_write_direct32 #define iwl4965_write_direct32 _iwl4965_write_direct32
#endif #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 reg, u32 len, u32 *values)
{ {
u32 count = sizeof(u32); u32 count = sizeof(u32);
if ((priv != NULL) && (values != NULL)) { if ((priv != NULL) && (values != NULL)) {
for (; 0 < len; len -= count, reg += count, values++) 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) u32 addr, u32 mask, int timeout)
{ {
int i = 0; int i = 0;
do { do {
if ((_iwl_read_direct32(priv, addr) & mask) == mask) if ((_iwl4965_read_direct32(priv, addr) & mask) == mask)
return i; return i;
mdelay(10); mdelay(10);
i += 10; i += 10;
@ -307,11 +307,11 @@ static inline int _iwl_poll_direct_bit(struct iwl_priv *priv,
} }
#ifdef CONFIG_IWL4965_DEBUG #ifdef CONFIG_IWL4965_DEBUG
static inline int __iwl_poll_direct_bit(const char *f, u32 l, static inline int __iwl4965_poll_direct_bit(const char *f, u32 l,
struct iwl_priv *priv, struct iwl4965_priv *priv,
u32 addr, u32 mask, int timeout) 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)) if (unlikely(ret == -ETIMEDOUT))
IWL_DEBUG_IO("poll_direct_bit(0x%08X, 0x%08X) - " IWL_DEBUG_IO("poll_direct_bit(0x%08X, 0x%08X) - "
@ -321,111 +321,111 @@ static inline int __iwl_poll_direct_bit(const char *f, u32 l,
"- %s %d\n", addr, mask, ret, f, l); "- %s %d\n", addr, mask, ret, f, l);
return ret; return ret;
} }
#define iwl_poll_direct_bit(iwl, addr, mask, timeout) \ #define iwl4965_poll_direct_bit(iwl, addr, mask, timeout) \
__iwl_poll_direct_bit(__FILE__, __LINE__, iwl, addr, mask, timeout) __iwl4965_poll_direct_bit(__FILE__, __LINE__, iwl, addr, mask, timeout)
#else #else
#define iwl_poll_direct_bit _iwl_poll_direct_bit #define iwl4965_poll_direct_bit _iwl4965_poll_direct_bit
#endif #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)); _iwl4965_write_direct32(priv, HBUS_TARG_PRPH_RADDR, reg | (3 << 24));
return _iwl_read_direct32(priv, HBUS_TARG_PRPH_RDAT); return _iwl4965_read_direct32(priv, HBUS_TARG_PRPH_RDAT);
} }
#ifdef CONFIG_IWL4965_DEBUG #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)) if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access not held from line %d\n", line); 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) \ #define iwl4965_read_prph(priv, reg) \
__iwl_read_prph(__LINE__, priv, reg) __iwl4965_read_prph(__LINE__, priv, reg)
#else #else
#define iwl_read_prph _iwl_read_prph #define iwl4965_read_prph _iwl4965_read_prph
#endif #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) u32 addr, u32 val)
{ {
_iwl_write_direct32(priv, HBUS_TARG_PRPH_WADDR, _iwl4965_write_direct32(priv, HBUS_TARG_PRPH_WADDR,
((addr & 0x0000FFFF) | (3 << 24))); ((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 #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) u32 addr, u32 val)
{ {
if (!atomic_read(&priv->restrict_refcnt)) if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access from line %d\n", line); 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) \ #define iwl4965_write_prph(priv, addr, val) \
__iwl_write_prph(__LINE__, priv, addr, val); __iwl4965_write_prph(__LINE__, priv, addr, val);
#else #else
#define iwl_write_prph _iwl_write_prph #define iwl4965_write_prph _iwl4965_write_prph
#endif #endif
#define _iwl_set_bits_prph(priv, reg, mask) \ #define _iwl4965_set_bits_prph(priv, reg, mask) \
_iwl_write_prph(priv, reg, (_iwl_read_prph(priv, reg) | mask)) _iwl4965_write_prph(priv, reg, (_iwl4965_read_prph(priv, reg) | mask))
#ifdef CONFIG_IWL4965_DEBUG #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) u32 reg, u32 mask)
{ {
if (!atomic_read(&priv->restrict_refcnt)) if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access not held from line %d\n", line); 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) \ #define iwl4965_set_bits_prph(priv, reg, mask) \
__iwl_set_bits_prph(__LINE__, priv, reg, mask) __iwl4965_set_bits_prph(__LINE__, priv, reg, mask)
#else #else
#define iwl_set_bits_prph _iwl_set_bits_prph #define iwl4965_set_bits_prph _iwl4965_set_bits_prph
#endif #endif
#define _iwl_set_bits_mask_prph(priv, reg, bits, mask) \ #define _iwl4965_set_bits_mask_prph(priv, reg, bits, mask) \
_iwl_write_prph(priv, reg, ((_iwl_read_prph(priv, reg) & mask) | bits)) _iwl4965_write_prph(priv, reg, ((_iwl4965_read_prph(priv, reg) & mask) | bits))
#ifdef CONFIG_IWL4965_DEBUG #ifdef CONFIG_IWL4965_DEBUG
static inline void __iwl_set_bits_mask_prph(u32 line, static inline void __iwl4965_set_bits_mask_prph(u32 line,
struct iwl_priv *priv, u32 reg, u32 bits, u32 mask) struct iwl4965_priv *priv, u32 reg, u32 bits, u32 mask)
{ {
if (!atomic_read(&priv->restrict_refcnt)) if (!atomic_read(&priv->restrict_refcnt))
IWL_ERROR("Nic access not held from line %d\n", line); 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) \ #define iwl4965_set_bits_mask_prph(priv, reg, bits, mask) \
__iwl_set_bits_mask_prph(__LINE__, priv, reg, bits, mask) __iwl4965_set_bits_mask_prph(__LINE__, priv, reg, bits, mask)
#else #else
#define iwl_set_bits_mask_prph _iwl_set_bits_mask_prph #define iwl4965_set_bits_mask_prph _iwl4965_set_bits_mask_prph
#endif #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) *priv, u32 reg, u32 mask)
{ {
u32 val = _iwl_read_prph(priv, reg); u32 val = _iwl4965_read_prph(priv, reg);
_iwl_write_prph(priv, reg, (val & ~mask)); _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); iwl4965_write_direct32(priv, HBUS_TARG_MEM_RADDR, addr);
return iwl_read_direct32(priv, HBUS_TARG_MEM_RDAT); 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); iwl4965_write_direct32(priv, HBUS_TARG_MEM_WADDR, addr);
iwl_write_direct32(priv, HBUS_TARG_MEM_WDAT, val); 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) 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++) 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 #endif

Просмотреть файл

@ -65,11 +65,11 @@ static u8 rs_ht_to_legacy[] = {
IWL_RATE_48M_INDEX, IWL_RATE_54M_INDEX IWL_RATE_48M_INDEX, IWL_RATE_54M_INDEX
}; };
struct iwl_rate { struct iwl4965_rate {
u32 rate_n_flags; u32 rate_n_flags;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_rate_scale_data { struct iwl4965_rate_scale_data {
u64 data; u64 data;
s32 success_counter; s32 success_counter;
s32 success_ratio; s32 success_ratio;
@ -78,19 +78,19 @@ struct iwl_rate_scale_data {
unsigned long stamp; unsigned long stamp;
}; };
struct iwl_scale_tbl_info { struct iwl4965_scale_tbl_info {
enum iwl_table_type lq_type; enum iwl4965_table_type lq_type;
enum iwl_antenna_type antenna_type; enum iwl4965_antenna_type antenna_type;
u8 is_SGI; u8 is_SGI;
u8 is_fat; u8 is_fat;
u8 is_dup; u8 is_dup;
u8 action; u8 action;
s32 *expected_tpt; s32 *expected_tpt;
struct iwl_rate current_rate; struct iwl4965_rate current_rate;
struct iwl_rate_scale_data win[IWL_RATE_COUNT]; struct iwl4965_rate_scale_data win[IWL_RATE_COUNT];
}; };
struct iwl_rate_scale_priv { struct iwl4965_rate_scale_priv {
u8 active_tbl; u8 active_tbl;
u8 enable_counter; u8 enable_counter;
u8 stay_in_tbl; u8 stay_in_tbl;
@ -115,31 +115,31 @@ struct iwl_rate_scale_priv {
u16 active_siso_rate; u16 active_siso_rate;
u16 active_mimo_rate; u16 active_mimo_rate;
u16 active_rate_basic; u16 active_rate_basic;
struct iwl_link_quality_cmd lq; struct iwl4965_link_quality_cmd lq;
struct iwl_scale_tbl_info lq_info[LQ_SIZE]; struct iwl4965_scale_tbl_info lq_info[LQ_SIZE];
#ifdef CONFIG_MAC80211_DEBUGFS #ifdef CONFIG_MAC80211_DEBUGFS
struct dentry *rs_sta_dbgfs_scale_table_file; struct dentry *rs_sta_dbgfs_scale_table_file;
struct dentry *rs_sta_dbgfs_stats_table_file; struct dentry *rs_sta_dbgfs_stats_table_file;
struct iwl_rate dbg_fixed; struct iwl4965_rate dbg_fixed;
struct iwl_priv *drv; struct iwl4965_priv *drv;
#endif #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 net_device *dev,
struct ieee80211_hdr *hdr, struct ieee80211_hdr *hdr,
struct sta_info *sta); struct sta_info *sta);
static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data, static void rs_fill_link_cmd(struct iwl4965_rate_scale_priv *lq_data,
struct iwl_rate *tx_mcs, struct iwl4965_rate *tx_mcs,
struct iwl_link_quality_cmd *tbl); struct iwl4965_link_quality_cmd *tbl);
#ifdef CONFIG_MAC80211_DEBUGFS #ifdef CONFIG_MAC80211_DEBUGFS
static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv, static void rs_dbgfs_set_mcs(struct iwl4965_rate_scale_priv *rs_priv,
struct iwl_rate *mcs, int index); struct iwl4965_rate *mcs, int index);
#else #else
static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv, static void rs_dbgfs_set_mcs(struct iwl4965_rate_scale_priv *rs_priv,
struct iwl_rate *mcs, int index) struct iwl4965_rate *mcs, int index)
{} {}
#endif #endif
static s32 expected_tpt_A[IWL_RATE_COUNT] = { static s32 expected_tpt_A[IWL_RATE_COUNT] = {
@ -182,27 +182,27 @@ static s32 expected_tpt_mimo40MHzSGI[IWL_RATE_COUNT] = {
0, 0, 0, 0, 131, 131, 191, 222, 242, 270, 284, 289, 293 0, 0, 0, 0, 131, 131, 191, 222, 242, 270, 284, 289, 293
}; };
static int iwl_lq_sync_callback(struct iwl_priv *priv, static int iwl4965_lq_sync_callback(struct iwl4965_priv *priv,
struct iwl_cmd *cmd, struct sk_buff *skb) struct iwl4965_cmd *cmd, struct sk_buff *skb)
{ {
/*We didn't cache the SKB; let the caller free it */ /*We didn't cache the SKB; let the caller free it */
return 1; 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); return (u8)(rate_n_flags & 0xFF);
} }
static int rs_send_lq_cmd(struct iwl_priv *priv, static int rs_send_lq_cmd(struct iwl4965_priv *priv,
struct iwl_link_quality_cmd *lq, u8 flags) struct iwl4965_link_quality_cmd *lq, u8 flags)
{ {
#ifdef CONFIG_IWL4965_DEBUG #ifdef CONFIG_IWL4965_DEBUG
int i; int i;
#endif #endif
struct iwl_host_cmd cmd = { struct iwl4965_host_cmd cmd = {
.id = REPLY_TX_LINK_QUALITY_CMD, .id = REPLY_TX_LINK_QUALITY_CMD,
.len = sizeof(struct iwl_link_quality_cmd), .len = sizeof(struct iwl4965_link_quality_cmd),
.meta.flags = flags, .meta.flags = flags,
.data = lq, .data = lq,
}; };
@ -225,16 +225,16 @@ static int rs_send_lq_cmd(struct iwl_priv *priv,
#endif #endif
if (flags & CMD_ASYNC) 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) priv->lq_mngr.lq_ready)
return iwl_send_cmd(priv, &cmd); return iwl4965_send_cmd(priv, &cmd);
return 0; 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->data = 0;
window->success_counter = 0; window->success_counter = 0;
@ -244,10 +244,10 @@ static void rs_rate_scale_clear_window(struct iwl_rate_scale_data *window)
window->stamp = 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) int scale_index, s32 tpt, u32 status)
{ {
struct iwl_rate_scale_data *window = NULL; struct iwl4965_rate_scale_data *window = NULL;
u64 mask; u64 mask;
u8 win_size = IWL_RATE_MAX_WINDOW; u8 win_size = IWL_RATE_MAX_WINDOW;
s32 fail_count; s32 fail_count;
@ -295,24 +295,24 @@ static int rs_collect_tx_data(struct iwl_rate_scale_data *windows,
return 0; return 0;
} }
static void rs_mcs_from_tbl(struct iwl_rate *mcs_rate, static void rs_mcs_from_tbl(struct iwl4965_rate *mcs_rate,
struct iwl_scale_tbl_info *tbl, struct iwl4965_scale_tbl_info *tbl,
int index, u8 use_green) int index, u8 use_green)
{ {
if (is_legacy(tbl->lq_type)) { 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) if (index >= IWL_FIRST_CCK_RATE && index <= IWL_LAST_CCK_RATE)
mcs_rate->rate_n_flags |= RATE_MCS_CCK_MSK; mcs_rate->rate_n_flags |= RATE_MCS_CCK_MSK;
} else if (is_siso(tbl->lq_type)) { } else if (is_siso(tbl->lq_type)) {
if (index > IWL_LAST_OFDM_RATE) if (index > IWL_LAST_OFDM_RATE)
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; RATE_MCS_HT_MSK;
} else { } else {
if (index > IWL_LAST_OFDM_RATE) if (index > IWL_LAST_OFDM_RATE)
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; RATE_MCS_HT_MSK;
} }
@ -349,14 +349,14 @@ static void rs_mcs_from_tbl(struct iwl_rate *mcs_rate,
} }
} }
static int rs_get_tbl_info_from_mcs(const struct iwl_rate *mcs_rate, static int rs_get_tbl_info_from_mcs(const struct iwl4965_rate *mcs_rate,
int phymode, struct iwl_scale_tbl_info *tbl, int phymode, struct iwl4965_scale_tbl_info *tbl,
int *rate_idx) int *rate_idx)
{ {
int index; int index;
u32 ant_msk; 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) { if (index == IWL_RATE_INVALID) {
*rate_idx = -1; *rate_idx = -1;
@ -386,7 +386,7 @@ static int rs_get_tbl_info_from_mcs(const struct iwl_rate *mcs_rate,
} }
*rate_idx = index; *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) { <= IWL_RATE_SISO_60M_PLCP) {
tbl->lq_type = LQ_SISO; tbl->lq_type = LQ_SISO;
@ -426,8 +426,8 @@ static int rs_get_tbl_info_from_mcs(const struct iwl_rate *mcs_rate,
return 0; return 0;
} }
static inline void rs_toggle_antenna(struct iwl_rate *new_rate, static inline void rs_toggle_antenna(struct iwl4965_rate *new_rate,
struct iwl_scale_tbl_info *tbl) struct iwl4965_scale_tbl_info *tbl)
{ {
if (tbl->antenna_type == ANT_AUX) { if (tbl->antenna_type == ANT_AUX) {
tbl->antenna_type = ANT_MAIN; tbl->antenna_type = ANT_MAIN;
@ -440,7 +440,7 @@ static inline void rs_toggle_antenna(struct iwl_rate *new_rate,
} }
} }
static inline u8 rs_use_green(struct iwl_priv *priv) static inline u8 rs_use_green(struct iwl4965_priv *priv)
{ {
#ifdef CONFIG_IWL4965_HT #ifdef CONFIG_IWL4965_HT
if (!priv->is_ht_enabled || !priv->current_assoc_ht.is_ht) if (!priv->is_ht_enabled || !priv->current_assoc_ht.is_ht)
@ -459,9 +459,9 @@ static inline u8 rs_use_green(struct iwl_priv *priv)
* basic available rates. * 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, struct ieee80211_hdr *hdr,
enum iwl_table_type rate_type, enum iwl4965_table_type rate_type,
u16 *data_rate) u16 *data_rate)
{ {
if (is_legacy(rate_type)) if (is_legacy(rate_type))
@ -512,7 +512,7 @@ static u16 rs_get_adjacent_rate(u8 index, u16 rate_mask, int rate_type)
low = index; low = index;
while (low != IWL_RATE_INVALID) { while (low != IWL_RATE_INVALID) {
low = iwl_rates[low].prev_rs; low = iwl4965_rates[low].prev_rs;
if (low == IWL_RATE_INVALID) if (low == IWL_RATE_INVALID)
break; break;
if (rate_mask & (1 << low)) if (rate_mask & (1 << low))
@ -522,7 +522,7 @@ static u16 rs_get_adjacent_rate(u8 index, u16 rate_mask, int rate_type)
high = index; high = index;
while (high != IWL_RATE_INVALID) { while (high != IWL_RATE_INVALID) {
high = iwl_rates[high].next_rs; high = iwl4965_rates[high].next_rs;
if (high == IWL_RATE_INVALID) if (high == IWL_RATE_INVALID)
break; break;
if (rate_mask & (1 << high)) if (rate_mask & (1 << high))
@ -533,9 +533,9 @@ static u16 rs_get_adjacent_rate(u8 index, u16 rate_mask, int rate_type)
return (high << 8) | low; return (high << 8) | low;
} }
static void rs_get_lower_rate(struct iwl_rate_scale_priv *lq_data, static void rs_get_lower_rate(struct iwl4965_rate_scale_priv *lq_data,
struct iwl_scale_tbl_info *tbl, u8 scale_index, struct iwl4965_scale_tbl_info *tbl, u8 scale_index,
u8 ht_possible, struct iwl_rate *mcs_rate) u8 ht_possible, struct iwl4965_rate *mcs_rate)
{ {
s32 low; s32 low;
u16 rate_mask; u16 rate_mask;
@ -596,17 +596,17 @@ static void rs_tx_status(void *priv_rate,
int status; int status;
u8 retries; u8 retries;
int rs_index, index = 0; int rs_index, index = 0;
struct iwl_rate_scale_priv *lq; struct iwl4965_rate_scale_priv *lq;
struct iwl_link_quality_cmd *table; struct iwl4965_link_quality_cmd *table;
struct sta_info *sta; struct sta_info *sta;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 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 ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct iwl_rate_scale_data *window = NULL; struct iwl4965_rate_scale_data *window = NULL;
struct iwl_rate_scale_data *search_win = NULL; struct iwl4965_rate_scale_data *search_win = NULL;
struct iwl_rate tx_mcs; struct iwl4965_rate tx_mcs;
struct iwl_scale_tbl_info tbl_type; struct iwl4965_scale_tbl_info tbl_type;
struct iwl_scale_tbl_info *curr_tbl, *search_tbl; struct iwl4965_scale_tbl_info *curr_tbl, *search_tbl;
u8 active_index = 0; u8 active_index = 0;
u16 fc = le16_to_cpu(hdr->frame_control); u16 fc = le16_to_cpu(hdr->frame_control);
s32 tpt = 0; s32 tpt = 0;
@ -630,7 +630,7 @@ static void rs_tx_status(void *priv_rate,
return; 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) if (!priv->lq_mngr.lq_ready)
return; return;
@ -648,9 +648,9 @@ static void rs_tx_status(void *priv_rate,
lq->antenna = lq->valid_antenna; lq->antenna = lq->valid_antenna;
curr_tbl = &(lq->lq_info[active_index]); curr_tbl = &(lq->lq_info[active_index]);
search_tbl = &(lq->lq_info[(1 - 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]); &(curr_tbl->win[0]);
search_win = (struct iwl_rate_scale_data *) search_win = (struct iwl4965_rate_scale_data *)
&(search_tbl->win[0]); &(search_tbl->win[0]);
tx_mcs.rate_n_flags = tx_resp->control.tx_rate; tx_mcs.rate_n_flags = tx_resp->control.tx_rate;
@ -751,7 +751,7 @@ static void rs_tx_status(void *priv_rate,
} }
static u8 rs_is_ant_connected(u8 valid_antenna, 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) if (antenna_type == ANT_AUX)
return ((valid_antenna & 0x2) ? 1:0); return ((valid_antenna & 0x2) ? 1:0);
@ -764,7 +764,7 @@ static u8 rs_is_ant_connected(u8 valid_antenna,
} }
static u8 rs_is_other_ant_connected(u8 valid_antenna, 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) if (antenna_type == ANT_AUX)
return rs_is_ant_connected(valid_antenna, ANT_MAIN); return rs_is_ant_connected(valid_antenna, ANT_MAIN);
@ -775,7 +775,7 @@ static u8 rs_is_other_ant_connected(u8 valid_antenna,
} }
static void rs_set_stay_in_table(u8 is_legacy, 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"); IWL_DEBUG_HT("we are staying in the same table\n");
lq_data->stay_in_tbl = 1; lq_data->stay_in_tbl = 1;
@ -793,8 +793,8 @@ static void rs_set_stay_in_table(u8 is_legacy,
lq_data->total_success = 0; lq_data->total_success = 0;
} }
static void rs_get_expected_tpt_table(struct iwl_rate_scale_priv *lq_data, static void rs_get_expected_tpt_table(struct iwl4965_rate_scale_priv *lq_data,
struct iwl_scale_tbl_info *tbl) struct iwl4965_scale_tbl_info *tbl)
{ {
if (is_legacy(tbl->lq_type)) { if (is_legacy(tbl->lq_type)) {
if (!is_a_band(tbl->lq_type)) if (!is_a_band(tbl->lq_type))
@ -827,12 +827,12 @@ static void rs_get_expected_tpt_table(struct iwl_rate_scale_priv *lq_data,
} }
#ifdef CONFIG_IWL4965_HT #ifdef CONFIG_IWL4965_HT
static s32 rs_get_best_rate(struct iwl_priv *priv, static s32 rs_get_best_rate(struct iwl4965_priv *priv,
struct iwl_rate_scale_priv *lq_data, struct iwl4965_rate_scale_priv *lq_data,
struct iwl_scale_tbl_info *tbl, struct iwl4965_scale_tbl_info *tbl,
u16 rate_mask, s8 index, s8 rate) 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]); &(lq_data->lq_info[lq_data->active_tbl]);
s32 new_rate, high, low, start_hi; s32 new_rate, high, low, start_hi;
s32 active_sr = active_tbl->win[index].success_ratio; s32 active_sr = active_tbl->win[index].success_ratio;
@ -886,9 +886,9 @@ static inline u8 rs_is_both_ant_supp(u8 valid_antenna)
return (rs_is_ant_connected(valid_antenna, ANT_BOTH)); return (rs_is_ant_connected(valid_antenna, ANT_BOTH));
} }
static int rs_switch_to_mimo(struct iwl_priv *priv, static int rs_switch_to_mimo(struct iwl4965_priv *priv,
struct iwl_rate_scale_priv *lq_data, struct iwl4965_rate_scale_priv *lq_data,
struct iwl_scale_tbl_info *tbl, int index) struct iwl4965_scale_tbl_info *tbl, int index)
{ {
#ifdef CONFIG_IWL4965_HT #ifdef CONFIG_IWL4965_HT
u16 rate_mask; u16 rate_mask;
@ -943,9 +943,9 @@ static int rs_switch_to_mimo(struct iwl_priv *priv,
#endif /*CONFIG_IWL4965_HT */ #endif /*CONFIG_IWL4965_HT */
} }
static int rs_switch_to_siso(struct iwl_priv *priv, static int rs_switch_to_siso(struct iwl4965_priv *priv,
struct iwl_rate_scale_priv *lq_data, struct iwl4965_rate_scale_priv *lq_data,
struct iwl_scale_tbl_info *tbl, int index) struct iwl4965_scale_tbl_info *tbl, int index)
{ {
#ifdef CONFIG_IWL4965_HT #ifdef CONFIG_IWL4965_HT
u16 rate_mask; u16 rate_mask;
@ -999,18 +999,18 @@ static int rs_switch_to_siso(struct iwl_priv *priv,
#endif /*CONFIG_IWL4965_HT */ #endif /*CONFIG_IWL4965_HT */
} }
static int rs_move_legacy_other(struct iwl_priv *priv, static int rs_move_legacy_other(struct iwl4965_priv *priv,
struct iwl_rate_scale_priv *lq_data, struct iwl4965_rate_scale_priv *lq_data,
int index) int index)
{ {
int ret = 0; int ret = 0;
struct iwl_scale_tbl_info *tbl = struct iwl4965_scale_tbl_info *tbl =
&(lq_data->lq_info[lq_data->active_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)]); &(lq_data->lq_info[(1 - lq_data->active_tbl)]);
struct iwl_rate_scale_data *window = &(tbl->win[index]); struct iwl4965_rate_scale_data *window = &(tbl->win[index]);
u32 sz = (sizeof(struct iwl_scale_tbl_info) - u32 sz = (sizeof(struct iwl4965_scale_tbl_info) -
(sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); (sizeof(struct iwl4965_rate_scale_data) * IWL_RATE_COUNT));
u8 start_action = tbl->action; u8 start_action = tbl->action;
for (; ;) { for (; ;) {
@ -1083,19 +1083,19 @@ static int rs_move_legacy_other(struct iwl_priv *priv,
} }
static int rs_move_siso_to_other(struct iwl_priv *priv, static int rs_move_siso_to_other(struct iwl4965_priv *priv,
struct iwl_rate_scale_priv *lq_data, struct iwl4965_rate_scale_priv *lq_data,
int index) int index)
{ {
int ret; int ret;
u8 is_green = lq_data->is_green; 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]); &(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)]); &(lq_data->lq_info[(1 - lq_data->active_tbl)]);
struct iwl_rate_scale_data *window = &(tbl->win[index]); struct iwl4965_rate_scale_data *window = &(tbl->win[index]);
u32 sz = (sizeof(struct iwl_scale_tbl_info) - u32 sz = (sizeof(struct iwl4965_scale_tbl_info) -
(sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); (sizeof(struct iwl4965_rate_scale_data) * IWL_RATE_COUNT));
u8 start_action = tbl->action; u8 start_action = tbl->action;
for (;;) { for (;;) {
@ -1173,18 +1173,18 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,
return 0; return 0;
} }
static int rs_move_mimo_to_other(struct iwl_priv *priv, static int rs_move_mimo_to_other(struct iwl4965_priv *priv,
struct iwl_rate_scale_priv *lq_data, struct iwl4965_rate_scale_priv *lq_data,
int index) int index)
{ {
int ret; int ret;
s8 is_green = lq_data->is_green; 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]); &(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)]); &(lq_data->lq_info[(1 - lq_data->active_tbl)]);
u32 sz = (sizeof(struct iwl_scale_tbl_info) - u32 sz = (sizeof(struct iwl4965_scale_tbl_info) -
(sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); (sizeof(struct iwl4965_rate_scale_data) * IWL_RATE_COUNT));
u8 start_action = tbl->action; u8 start_action = tbl->action;
for (;;) { for (;;) {
@ -1253,9 +1253,9 @@ static int rs_move_mimo_to_other(struct iwl_priv *priv,
} }
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 i;
int active_tbl; int active_tbl;
int flush_interval_passed = 0; int flush_interval_passed = 0;
@ -1305,7 +1305,7 @@ static void rs_stay_in_table(struct iwl_rate_scale_priv *lq_data)
} }
} }
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 net_device *dev,
struct ieee80211_hdr *hdr, struct ieee80211_hdr *hdr,
struct sta_info *sta) struct sta_info *sta)
@ -1314,7 +1314,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
int high = IWL_RATE_INVALID; int high = IWL_RATE_INVALID;
int index; int index;
int i; int i;
struct iwl_rate_scale_data *window = NULL; struct iwl4965_rate_scale_data *window = NULL;
int current_tpt = IWL_INVALID_VALUE; int current_tpt = IWL_INVALID_VALUE;
int low_tpt = IWL_INVALID_VALUE; int low_tpt = IWL_INVALID_VALUE;
int high_tpt = IWL_INVALID_VALUE; int high_tpt = IWL_INVALID_VALUE;
@ -1322,10 +1322,10 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
s8 scale_action = 0; s8 scale_action = 0;
u16 fc, rate_mask; u16 fc, rate_mask;
u8 update_lq = 0; u8 update_lq = 0;
struct iwl_rate_scale_priv *lq_data; struct iwl4965_rate_scale_priv *lq_data;
struct iwl_scale_tbl_info *tbl, *tbl1; struct iwl4965_scale_tbl_info *tbl, *tbl1;
u16 rate_scale_index_msk = 0; u16 rate_scale_index_msk = 0;
struct iwl_rate mcs_rate; struct iwl4965_rate mcs_rate;
u8 is_green = 0; u8 is_green = 0;
u8 active_tbl = 0; u8 active_tbl = 0;
u8 done_search = 0; u8 done_search = 0;
@ -1348,7 +1348,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
IWL_DEBUG_RATE("still rate scaling not ready\n"); IWL_DEBUG_RATE("still rate scaling not ready\n");
return; 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) if (!lq_data->search_better_tbl)
active_tbl = lq_data->active_tbl; active_tbl = lq_data->active_tbl;
@ -1445,7 +1445,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
active_tbl = lq_data->active_tbl; active_tbl = lq_data->active_tbl;
tbl = &(lq_data->lq_info[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); tbl->current_rate.rate_n_flags);
update_lq = 1; update_lq = 1;
@ -1559,7 +1559,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
for (i = 0; i < IWL_RATE_COUNT; i++) for (i = 0; i < IWL_RATE_COUNT; i++)
rs_rate_scale_clear_window(&(tbl->win[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); tbl->current_rate.rate_n_flags);
IWL_DEBUG_HT("Switch current mcs: %X index: %d\n", IWL_DEBUG_HT("Switch current mcs: %X index: %d\n",
@ -1615,21 +1615,21 @@ out:
} }
static void rs_initialize_lq(struct iwl_priv *priv, static void rs_initialize_lq(struct iwl4965_priv *priv,
struct sta_info *sta) struct sta_info *sta)
{ {
int i; int i;
struct iwl_rate_scale_priv *lq; struct iwl4965_rate_scale_priv *lq;
struct iwl_scale_tbl_info *tbl; struct iwl4965_scale_tbl_info *tbl;
u8 active_tbl = 0; u8 active_tbl = 0;
int rate_idx; int rate_idx;
u8 use_green = rs_use_green(priv); u8 use_green = rs_use_green(priv);
struct iwl_rate mcs_rate; struct iwl4965_rate mcs_rate;
if (!sta || !sta->rate_ctrl_priv) if (!sta || !sta->rate_ctrl_priv)
goto out; 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; i = sta->last_txrate;
if ((lq->lq.sta_id == 0xff) && if ((lq->lq.sta_id == 0xff) &&
@ -1646,7 +1646,7 @@ static void rs_initialize_lq(struct iwl_priv *priv,
if ((i < 0) || (i >= IWL_RATE_COUNT)) if ((i < 0) || (i >= IWL_RATE_COUNT))
i = 0; 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_B_MSK;
mcs_rate.rate_n_flags &= ~RATE_MCS_ANT_A_MSK; mcs_rate.rate_n_flags &= ~RATE_MCS_ANT_A_MSK;
@ -1676,8 +1676,8 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev,
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
struct sta_info *sta; struct sta_info *sta;
struct iwl_priv *priv = (struct iwl_priv *)priv_rate; struct iwl4965_priv *priv = (struct iwl4965_priv *)priv_rate;
struct iwl_rate_scale_priv *lq; struct iwl4965_rate_scale_priv *lq;
IWL_DEBUG_RATE_LIMIT("rate scale calculate new rate for skb\n"); IWL_DEBUG_RATE_LIMIT("rate scale calculate new rate for skb\n");
@ -1690,17 +1690,17 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev,
return; 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; i = sta->last_txrate;
if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && !lq->ibss_sta_added) { 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); DECLARE_MAC_BUF(mac);
if (sta_id == IWL_INVALID_STATION) { if (sta_id == IWL_INVALID_STATION) {
IWL_DEBUG_RATE("LQ: ADD station %s\n", IWL_DEBUG_RATE("LQ: ADD station %s\n",
print_mac(mac, hdr->addr1)); print_mac(mac, hdr->addr1));
sta_id = iwl_add_station(priv, sta_id = iwl4965_add_station_flags(priv,
hdr->addr1, 0, CMD_ASYNC); hdr->addr1, 0, CMD_ASYNC);
} }
if ((sta_id != IWL_INVALID_STATION)) { if ((sta_id != IWL_INVALID_STATION)) {
@ -1725,12 +1725,12 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev,
static void *rs_alloc_sta(void *priv, gfp_t gfp) 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; int i, j;
IWL_DEBUG_RATE("create station rate scale window\n"); 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) if (crl == NULL)
return NULL; return NULL;
@ -1750,8 +1750,8 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
{ {
int i, j; int i, j;
struct ieee80211_hw_mode *mode = local->oper_hw_mode; struct ieee80211_hw_mode *mode = local->oper_hw_mode;
struct iwl_priv *priv = (struct iwl_priv *)priv_rate; struct iwl4965_priv *priv = (struct iwl4965_priv *)priv_rate;
struct iwl_rate_scale_priv *crl = priv_sta; struct iwl4965_rate_scale_priv *crl = priv_sta;
crl->flush_timer = 0; crl->flush_timer = 0;
crl->supp_rates = sta->supp_rates; crl->supp_rates = sta->supp_rates;
@ -1768,7 +1768,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
crl->ibss_sta_added = 0; crl->ibss_sta_added = 0;
if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { 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); DECLARE_MAC_BUF(mac);
/* for IBSS the call are from tasklet */ /* for IBSS the call are from tasklet */
@ -1778,7 +1778,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
if (sta_id == IWL_INVALID_STATION) { if (sta_id == IWL_INVALID_STATION) {
IWL_DEBUG_RATE("LQ: ADD station %s\n", IWL_DEBUG_RATE("LQ: ADD station %s\n",
print_mac(mac, sta->addr)); print_mac(mac, sta->addr));
sta_id = iwl_add_station(priv, sta_id = iwl4965_add_station_flags(priv,
sta->addr, 0, CMD_ASYNC); sta->addr, 0, CMD_ASYNC);
} }
if ((sta_id != IWL_INVALID_STATION)) { if ((sta_id != IWL_INVALID_STATION)) {
@ -1832,17 +1832,17 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
rs_initialize_lq(priv, sta); rs_initialize_lq(priv, sta);
} }
static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data, static void rs_fill_link_cmd(struct iwl4965_rate_scale_priv *lq_data,
struct iwl_rate *tx_mcs, struct iwl4965_rate *tx_mcs,
struct iwl_link_quality_cmd *lq_cmd) struct iwl4965_link_quality_cmd *lq_cmd)
{ {
int index = 0; int index = 0;
int rate_idx; int rate_idx;
int repeat_rate = 0; int repeat_rate = 0;
u8 ant_toggle_count = 0; u8 ant_toggle_count = 0;
u8 use_ht_possible = 1; u8 use_ht_possible = 1;
struct iwl_rate new_rate; struct iwl4965_rate new_rate;
struct iwl_scale_tbl_info tbl_type = { 0 }; struct iwl4965_scale_tbl_info tbl_type = { 0 };
rs_dbgfs_set_mcs(lq_data, tx_mcs, index); rs_dbgfs_set_mcs(lq_data, tx_mcs, index);
@ -1935,7 +1935,7 @@ static void rs_free(void *priv_rate)
static void rs_clear(void *priv_rate) 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"); IWL_DEBUG_RATE("enter\n");
@ -1952,7 +1952,7 @@ static void rs_clear(void *priv_rate)
static void rs_free_sta(void *priv, void *priv_sta) 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"); IWL_DEBUG_RATE("enter\n");
kfree(rs_priv); kfree(rs_priv);
@ -1966,8 +1966,8 @@ static int open_file_generic(struct inode *inode, struct file *file)
file->private_data = inode->i_private; file->private_data = inode->i_private;
return 0; return 0;
} }
static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv, static void rs_dbgfs_set_mcs(struct iwl4965_rate_scale_priv *rs_priv,
struct iwl_rate *mcs, int index) struct iwl4965_rate *mcs, int index)
{ {
u32 base_rate; u32 base_rate;
@ -1991,7 +1991,7 @@ static void rs_dbgfs_set_mcs(struct iwl_rate_scale_priv *rs_priv,
static ssize_t rs_sta_dbgfs_scale_table_write(struct file *file, static ssize_t rs_sta_dbgfs_scale_table_write(struct file *file,
const char __user *user_buf, size_t count, loff_t *ppos) 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]; char buf[64];
int buf_size; int buf_size;
u32 parsed_rate; u32 parsed_rate;
@ -2028,7 +2028,7 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
int desc = 0; int desc = 0;
int i = 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, "sta_id %d\n", rs_priv->lq.sta_id);
desc += sprintf(buff+desc, "failed=%d success=%d rate=0%X\n", desc += sprintf(buff+desc, "failed=%d success=%d rate=0%X\n",
@ -2076,7 +2076,7 @@ static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file,
int desc = 0; int desc = 0;
int i, j; 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++) { for (i = 0; i < LQ_SIZE; i++) {
desc += sprintf(buff+desc, "%s type=%d SGI=%d FAT=%d DUP=%d\n" desc += sprintf(buff+desc, "%s type=%d SGI=%d FAT=%d DUP=%d\n"
"rate=0x%X\n", "rate=0x%X\n",
@ -2105,7 +2105,7 @@ static const struct file_operations rs_sta_dbgfs_stats_table_ops = {
static void rs_add_debugfs(void *priv, void *priv_sta, static void rs_add_debugfs(void *priv, void *priv_sta,
struct dentry *dir) 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 = rs_priv->rs_sta_dbgfs_scale_table_file =
debugfs_create_file("rate_scale_table", 0600, dir, debugfs_create_file("rate_scale_table", 0600, dir,
rs_priv, &rs_sta_dbgfs_scale_table_ops); rs_priv, &rs_sta_dbgfs_scale_table_ops);
@ -2116,7 +2116,7 @@ static void rs_add_debugfs(void *priv, void *priv_sta,
static void rs_remove_debugfs(void *priv, void *priv_sta) 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_scale_table_file);
debugfs_remove(rs_priv->rs_sta_dbgfs_stats_table_file); debugfs_remove(rs_priv->rs_sta_dbgfs_stats_table_file);
} }
@ -2139,11 +2139,11 @@ static struct rate_control_ops rs_ops = {
#endif #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 ieee80211_local *local = hw_to_local(hw);
struct iwl_priv *priv = hw->priv; struct iwl4965_priv *priv = hw->priv;
struct iwl_rate_scale_priv *rs_priv; struct iwl4965_rate_scale_priv *rs_priv;
struct sta_info *sta; struct sta_info *sta;
int count = 0, i; int count = 0, i;
u32 samples = 0, success = 0, good = 0; u32 samples = 0, success = 0, good = 0;
@ -2176,7 +2176,7 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
int active = rs_priv->active_tbl; int active = rs_priv->active_tbl;
count += 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)); mask = (1ULL << (IWL_RATE_MAX_WINDOW - 1));
for (j = 0; j < IWL_RATE_MAX_WINDOW; j++, mask >>= 1) for (j = 0; j < IWL_RATE_MAX_WINDOW; j++, mask >>= 1)
@ -2187,7 +2187,7 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
samples += rs_priv->lq_info[active].win[i].counter; samples += rs_priv->lq_info[active].win[i].counter;
good += rs_priv->lq_info[active].win[i].success_counter; good += rs_priv->lq_info[active].win[i].success_counter;
success += 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) { if (rs_priv->lq_info[active].win[i].stamp) {
int delta = int delta =
@ -2201,7 +2201,7 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
} else } else
buf[count++] = '\n'; buf[count++] = '\n';
j = iwl_get_prev_ieee_rate(i); j = iwl4965_get_prev_ieee_rate(i);
if (j == i) if (j == i)
break; break;
i = j; i = j;
@ -2210,7 +2210,7 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
/* Display the average rate of all samples taken. /* Display the average rate of all samples taken.
* *
* NOTE: We multiple # of samples by 2 since the IEEE measurement * 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) if (samples)
count += sprintf(&buf[count], count += sprintf(&buf[count],
"\nAverage rate is %3d.%02dMbs over last %4dms\n" "\nAverage rate is %3d.%02dMbs over last %4dms\n"
@ -2227,19 +2227,19 @@ int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
return count; 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; 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); 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); ieee80211_rate_control_unregister(&rs_ops);
} }

Просмотреть файл

@ -29,7 +29,7 @@
#include "iwl-4965.h" #include "iwl-4965.h"
struct iwl_rate_info { struct iwl4965_rate_info {
u8 plcp; u8 plcp;
u8 plcp_siso; u8 plcp_siso;
u8 plcp_mimo; u8 plcp_mimo;
@ -197,9 +197,9 @@ enum {
#define LQ_SIZE 2 #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_NONE,
LQ_G, LQ_G,
LQ_A, LQ_A,
@ -208,59 +208,59 @@ enum iwl_table_type {
LQ_MAX, LQ_MAX,
}; };
enum iwl_antenna_type { enum iwl4965_antenna_type {
ANT_NONE, ANT_NONE,
ANT_MAIN, ANT_MAIN,
ANT_AUX, ANT_AUX,
ANT_BOTH, 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) if (rate == IWL_RATE_INVALID)
rate = rate_index; rate = rate_index;
return rate; 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 * 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 * the performance of the rate control algorithm and is not meant to be
* parsed software. * 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 specific throughput table used is based on the type of network
* the associated with, including A, B, G, and G w/ TGG protection * 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 * 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 * 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 * with the mac80211 subsystem. This should be performed prior to calling
* ieee80211_register_hw * 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 * This should be called after calling ieee80211_unregister_hw, but before
* the driver is unloaded. * 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 #endif

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -30,10 +30,10 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <net/ieee80211_radiotap.h> #include <net/ieee80211_radiotap.h>
struct iwl_priv; struct iwl4965_priv;
/* Hardware specific file defines the PCI IDs table for that hardware module */ /* Hardware specific file defines the PCI IDs table for that hardware module */
extern struct pci_device_id iwl_hw_card_ids[]; extern struct pci_device_id iwl4965_hw_card_ids[];
#define DRV_NAME "iwl4965" #define DRV_NAME "iwl4965"
#include "iwl-4965-hw.h" #include "iwl-4965-hw.h"
@ -54,10 +54,10 @@ extern struct pci_device_id iwl_hw_card_ids[];
#define IWL_NOISE_MEAS_NOT_AVAILABLE (-127) #define IWL_NOISE_MEAS_NOT_AVAILABLE (-127)
/* Module parameters accessible from iwl-*.c */ /* Module parameters accessible from iwl-*.c */
extern int iwl_param_hwcrypto; extern int iwl4965_param_hwcrypto;
extern int iwl_param_queues_num; extern int iwl4965_param_queues_num;
enum iwl_antenna { enum iwl4965_antenna {
IWL_ANTENNA_DIVERSITY, IWL_ANTENNA_DIVERSITY,
IWL_ANTENNA_MAIN, IWL_ANTENNA_MAIN,
IWL_ANTENNA_AUX IWL_ANTENNA_AUX
@ -80,13 +80,13 @@ enum iwl_antenna {
#define DEFAULT_SHORT_RETRY_LIMIT 7U #define DEFAULT_SHORT_RETRY_LIMIT 7U
#define DEFAULT_LONG_RETRY_LIMIT 4U #define DEFAULT_LONG_RETRY_LIMIT 4U
struct iwl_rx_mem_buffer { struct iwl4965_rx_mem_buffer {
dma_addr_t dma_addr; dma_addr_t dma_addr;
struct sk_buff *skb; struct sk_buff *skb;
struct list_head list; struct list_head list;
}; };
struct iwl_rt_rx_hdr { struct iwl4965_rt_rx_hdr {
struct ieee80211_radiotap_header rt_hdr; struct ieee80211_radiotap_header rt_hdr;
__le64 rt_tsf; /* TSF */ __le64 rt_tsf; /* TSF */
u8 rt_flags; /* radiotap packet flags */ u8 rt_flags; /* radiotap packet flags */
@ -99,7 +99,7 @@ struct iwl_rt_rx_hdr {
u8 payload[0]; /* payload... */ u8 payload[0]; /* payload... */
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_rt_tx_hdr { struct iwl4965_rt_tx_hdr {
struct ieee80211_radiotap_header rt_hdr; struct ieee80211_radiotap_header rt_hdr;
u8 rt_rate; /* rate in 500kb/s */ u8 rt_rate; /* rate in 500kb/s */
__le16 rt_channel; /* channel in mHz */ __le16 rt_channel; /* channel in mHz */
@ -114,7 +114,7 @@ struct iwl_rt_tx_hdr {
* *
* Contains common data for Rx and Tx queues * Contains common data for Rx and Tx queues
*/ */
struct iwl_queue { struct iwl4965_queue {
int n_bd; /* number of BDs in this queue */ int n_bd; /* number of BDs in this queue */
int write_ptr; /* 1-st empty entry (index) host_w*/ int write_ptr; /* 1-st empty entry (index) host_w*/
int read_ptr; /* last used entry (index) host_r*/ int read_ptr; /* last used entry (index) host_r*/
@ -129,24 +129,24 @@ struct iwl_queue {
#define MAX_NUM_OF_TBS (20) #define MAX_NUM_OF_TBS (20)
struct iwl_tx_info { struct iwl4965_tx_info {
struct ieee80211_tx_status status; struct ieee80211_tx_status status;
struct sk_buff *skb[MAX_NUM_OF_TBS]; struct sk_buff *skb[MAX_NUM_OF_TBS];
}; };
/** /**
* struct iwl_tx_queue - Tx Queue for DMA * struct iwl4965_tx_queue - Tx Queue for DMA
* @need_update: need to update read/write index * @need_update: need to update read/write index
* @shed_retry: queue is HT AGG enabled * @shed_retry: queue is HT AGG enabled
* *
* Queue consists of circular buffer of BD's and required locking structures. * Queue consists of circular buffer of BD's and required locking structures.
*/ */
struct iwl_tx_queue { struct iwl4965_tx_queue {
struct iwl_queue q; struct iwl4965_queue q;
struct iwl_tfd_frame *bd; struct iwl4965_tfd_frame *bd;
struct iwl_cmd *cmd; struct iwl4965_cmd *cmd;
dma_addr_t dma_addr_cmd; dma_addr_t dma_addr_cmd;
struct iwl_tx_info *txb; struct iwl4965_tx_info *txb;
int need_update; int need_update;
int sched_retry; int sched_retry;
int active; int active;
@ -154,12 +154,12 @@ struct iwl_tx_queue {
#define IWL_NUM_SCAN_RATES (2) #define IWL_NUM_SCAN_RATES (2)
struct iwl_channel_tgd_info { struct iwl4965_channel_tgd_info {
u8 type; u8 type;
s8 max_power; s8 max_power;
}; };
struct iwl_channel_tgh_info { struct iwl4965_channel_tgh_info {
s64 last_radar_time; s64 last_radar_time;
}; };
@ -170,8 +170,8 @@ struct iwl_channel_tgh_info {
* -- spectrum management * -- spectrum management
* -- user preference (e.g. iwconfig) * -- user preference (e.g. iwconfig)
* when requested power is set, base power index must also be set. */ * when requested power is set, base power index must also be set. */
struct iwl_channel_power_info { struct iwl4965_channel_power_info {
struct iwl_tx_power tpc; /* actual radio and DSP gain settings */ struct iwl4965_tx_power tpc; /* actual radio and DSP gain settings */
s8 power_table_index; /* actual (compenst'd) index into gain table */ s8 power_table_index; /* actual (compenst'd) index into gain table */
s8 base_power_index; /* gain index for power at factory temp. */ s8 base_power_index; /* gain index for power at factory temp. */
s8 requested_power; /* power (dBm) requested for this chnl/rate */ s8 requested_power; /* power (dBm) requested for this chnl/rate */
@ -179,8 +179,8 @@ struct iwl_channel_power_info {
/* current scan Tx power values to use, one for each scan rate for each /* current scan Tx power values to use, one for each scan rate for each
* channel. */ * channel. */
struct iwl_scan_power_info { struct iwl4965_scan_power_info {
struct iwl_tx_power tpc; /* actual radio and DSP gain settings */ struct iwl4965_tx_power tpc; /* actual radio and DSP gain settings */
s8 power_table_index; /* actual (compenst'd) index into gain table */ s8 power_table_index; /* actual (compenst'd) index into gain table */
s8 requested_power; /* scan pwr (dBm) requested for chnl/rate */ s8 requested_power; /* scan pwr (dBm) requested for chnl/rate */
}; };
@ -200,11 +200,11 @@ struct iwl_scan_power_info {
*/ */
#define IWL4965_MAX_RATE (33) #define IWL4965_MAX_RATE (33)
struct iwl_channel_info { struct iwl4965_channel_info {
struct iwl_channel_tgd_info tgd; struct iwl4965_channel_tgd_info tgd;
struct iwl_channel_tgh_info tgh; struct iwl4965_channel_tgh_info tgh;
struct iwl_eeprom_channel eeprom; /* EEPROM regulatory limit */ struct iwl4965_eeprom_channel eeprom; /* EEPROM regulatory limit */
struct iwl_eeprom_channel fat_eeprom; /* EEPROM regulatory limit for struct iwl4965_eeprom_channel fat_eeprom; /* EEPROM regulatory limit for
* FAT channel */ * FAT channel */
u8 channel; /* channel number */ u8 channel; /* channel number */
@ -221,7 +221,7 @@ struct iwl_channel_info {
/* Radio/DSP gain settings for each "normal" data Tx rate. /* Radio/DSP gain settings for each "normal" data Tx rate.
* These include, in addition to RF and DSP gain, a few fields for * These include, in addition to RF and DSP gain, a few fields for
* remembering/modifying gain settings (indexes). */ * remembering/modifying gain settings (indexes). */
struct iwl_channel_power_info power_info[IWL4965_MAX_RATE]; struct iwl4965_channel_power_info power_info[IWL4965_MAX_RATE];
/* FAT channel info */ /* FAT channel info */
s8 fat_max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */ s8 fat_max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */
@ -232,10 +232,10 @@ struct iwl_channel_info {
u8 fat_extension_channel; u8 fat_extension_channel;
/* Radio/DSP gain settings for each scan rate, for directed scans. */ /* Radio/DSP gain settings for each scan rate, for directed scans. */
struct iwl_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES]; struct iwl4965_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES];
}; };
struct iwl_clip_group { struct iwl4965_clip_group {
/* maximum power level to prevent clipping for each rate, derived by /* maximum power level to prevent clipping for each rate, derived by
* us from this band's saturation power in EEPROM */ * us from this band's saturation power in EEPROM */
const s8 clip_powers[IWL_MAX_RATES]; const s8 clip_powers[IWL_MAX_RATES];
@ -256,8 +256,8 @@ struct iwl_clip_group {
/* Power management (not Tx power) structures */ /* Power management (not Tx power) structures */
struct iwl_power_vec_entry { struct iwl4965_power_vec_entry {
struct iwl_powertable_cmd cmd; struct iwl4965_powertable_cmd cmd;
u8 no_dtim; u8 no_dtim;
}; };
#define IWL_POWER_RANGE_0 (0) #define IWL_POWER_RANGE_0 (0)
@ -273,10 +273,10 @@ struct iwl_power_vec_entry {
#define IWL_POWER_ENABLED 0x10 #define IWL_POWER_ENABLED 0x10
#define IWL_POWER_LEVEL(x) ((x) & IWL_POWER_MASK) #define IWL_POWER_LEVEL(x) ((x) & IWL_POWER_MASK)
struct iwl_power_mgr { struct iwl4965_power_mgr {
spinlock_t lock; spinlock_t lock;
struct iwl_power_vec_entry pwr_range_0[IWL_POWER_AC]; struct iwl4965_power_vec_entry pwr_range_0[IWL_POWER_AC];
struct iwl_power_vec_entry pwr_range_1[IWL_POWER_AC]; struct iwl4965_power_vec_entry pwr_range_1[IWL_POWER_AC];
u8 active_index; u8 active_index;
u32 dtim_val; u32 dtim_val;
}; };
@ -286,10 +286,10 @@ struct iwl_power_mgr {
#define IEEE80211_HLEN (IEEE80211_4ADDR_LEN) #define IEEE80211_HLEN (IEEE80211_4ADDR_LEN)
#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) #define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN)
struct iwl_frame { struct iwl4965_frame {
union { union {
struct ieee80211_hdr frame; struct ieee80211_hdr frame;
struct iwl_tx_beacon_cmd beacon; struct iwl4965_tx_beacon_cmd beacon;
u8 raw[IEEE80211_FRAME_LEN]; u8 raw[IEEE80211_FRAME_LEN];
u8 cmd[360]; u8 cmd[360];
} u; } u;
@ -315,15 +315,15 @@ enum {
CMD_WANT_SKB = (1 << 2), CMD_WANT_SKB = (1 << 2),
}; };
struct iwl_cmd; struct iwl4965_cmd;
struct iwl_priv; struct iwl4965_priv;
struct iwl_cmd_meta { struct iwl4965_cmd_meta {
struct iwl_cmd_meta *source; struct iwl4965_cmd_meta *source;
union { union {
struct sk_buff *skb; struct sk_buff *skb;
int (*callback)(struct iwl_priv *priv, int (*callback)(struct iwl4965_priv *priv,
struct iwl_cmd *cmd, struct sk_buff *skb); struct iwl4965_cmd *cmd, struct sk_buff *skb);
} __attribute__ ((packed)) u; } __attribute__ ((packed)) u;
/* The CMD_SIZE_HUGE flag bit indicates that the command /* The CMD_SIZE_HUGE flag bit indicates that the command
@ -332,37 +332,37 @@ struct iwl_cmd_meta {
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_cmd { struct iwl4965_cmd {
struct iwl_cmd_meta meta; struct iwl4965_cmd_meta meta;
struct iwl_cmd_header hdr; struct iwl4965_cmd_header hdr;
union { union {
struct iwl_addsta_cmd addsta; struct iwl4965_addsta_cmd addsta;
struct iwl_led_cmd led; struct iwl4965_led_cmd led;
u32 flags; u32 flags;
u8 val8; u8 val8;
u16 val16; u16 val16;
u32 val32; u32 val32;
struct iwl_bt_cmd bt; struct iwl4965_bt_cmd bt;
struct iwl_rxon_time_cmd rxon_time; struct iwl4965_rxon_time_cmd rxon_time;
struct iwl_powertable_cmd powertable; struct iwl4965_powertable_cmd powertable;
struct iwl_qosparam_cmd qosparam; struct iwl4965_qosparam_cmd qosparam;
struct iwl_tx_cmd tx; struct iwl4965_tx_cmd tx;
struct iwl_tx_beacon_cmd tx_beacon; struct iwl4965_tx_beacon_cmd tx_beacon;
struct iwl_rxon_assoc_cmd rxon_assoc; struct iwl4965_rxon_assoc_cmd rxon_assoc;
u8 *indirect; u8 *indirect;
u8 payload[360]; u8 payload[360];
} __attribute__ ((packed)) cmd; } __attribute__ ((packed)) cmd;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct iwl_host_cmd { struct iwl4965_host_cmd {
u8 id; u8 id;
u16 len; u16 len;
struct iwl_cmd_meta meta; struct iwl4965_cmd_meta meta;
const void *data; const void *data;
}; };
#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_cmd) - \ #define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl4965_cmd) - \
sizeof(struct iwl_cmd_meta)) sizeof(struct iwl4965_cmd_meta))
/* /*
* RX related structures and functions * RX related structures and functions
@ -375,7 +375,7 @@ struct iwl_host_cmd {
#define SUP_RATE_11G_MAX_NUM_CHANNELS 12 #define SUP_RATE_11G_MAX_NUM_CHANNELS 12
/** /**
* struct iwl_rx_queue - Rx queue * struct iwl4965_rx_queue - Rx queue
* @processed: Internal index to last handled Rx packet * @processed: Internal index to last handled Rx packet
* @read: Shared index to newest available Rx buffer * @read: Shared index to newest available Rx buffer
* @write: Shared index to oldest written Rx packet * @write: Shared index to oldest written Rx packet
@ -384,13 +384,13 @@ struct iwl_host_cmd {
* @rx_used: List of Rx buffers with no SKB * @rx_used: List of Rx buffers with no SKB
* @need_update: flag to indicate we need to update read/write index * @need_update: flag to indicate we need to update read/write index
* *
* NOTE: rx_free and rx_used are used as a FIFO for iwl_rx_mem_buffers * NOTE: rx_free and rx_used are used as a FIFO for iwl4965_rx_mem_buffers
*/ */
struct iwl_rx_queue { struct iwl4965_rx_queue {
__le32 *bd; __le32 *bd;
dma_addr_t dma_addr; dma_addr_t dma_addr;
struct iwl_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS]; struct iwl4965_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS];
struct iwl_rx_mem_buffer *queue[RX_QUEUE_SIZE]; struct iwl4965_rx_mem_buffer *queue[RX_QUEUE_SIZE];
u32 processed; u32 processed;
u32 read; u32 read;
u32 write; u32 write;
@ -436,7 +436,7 @@ struct iwl_rx_queue {
#ifdef CONFIG_IWL4965_HT #ifdef CONFIG_IWL4965_HT
#ifdef CONFIG_IWL4965_HT_AGG #ifdef CONFIG_IWL4965_HT_AGG
struct iwl_ht_agg { struct iwl4965_ht_agg {
u16 txq_id; u16 txq_id;
u16 frame_count; u16 frame_count;
u16 wait_for_ba; u16 wait_for_ba;
@ -448,22 +448,22 @@ struct iwl_ht_agg {
#endif /* CONFIG_IWL4965_HT_AGG */ #endif /* CONFIG_IWL4965_HT_AGG */
#endif /* CONFIG_IWL4965_HT */ #endif /* CONFIG_IWL4965_HT */
struct iwl_tid_data { struct iwl4965_tid_data {
u16 seq_number; u16 seq_number;
#ifdef CONFIG_IWL4965_HT #ifdef CONFIG_IWL4965_HT
#ifdef CONFIG_IWL4965_HT_AGG #ifdef CONFIG_IWL4965_HT_AGG
struct iwl_ht_agg agg; struct iwl4965_ht_agg agg;
#endif /* CONFIG_IWL4965_HT_AGG */ #endif /* CONFIG_IWL4965_HT_AGG */
#endif /* CONFIG_IWL4965_HT */ #endif /* CONFIG_IWL4965_HT */
}; };
struct iwl_hw_key { struct iwl4965_hw_key {
enum ieee80211_key_alg alg; enum ieee80211_key_alg alg;
int keylen; int keylen;
u8 key[32]; u8 key[32];
}; };
union iwl_ht_rate_supp { union iwl4965_ht_rate_supp {
u16 rates; u16 rates;
struct { struct {
u8 siso_rate; u8 siso_rate;
@ -498,7 +498,7 @@ struct sta_ht_info {
#ifdef CONFIG_IWL4965_QOS #ifdef CONFIG_IWL4965_QOS
union iwl_qos_capabity { union iwl4965_qos_capabity {
struct { struct {
u8 edca_count:4; /* bit 0-3 */ u8 edca_count:4; /* bit 0-3 */
u8 q_ack:1; /* bit 4 */ u8 q_ack:1; /* bit 4 */
@ -519,23 +519,23 @@ union iwl_qos_capabity {
}; };
/* QoS structures */ /* QoS structures */
struct iwl_qos_info { struct iwl4965_qos_info {
int qos_enable; int qos_enable;
int qos_active; int qos_active;
union iwl_qos_capabity qos_cap; union iwl4965_qos_capabity qos_cap;
struct iwl_qosparam_cmd def_qos_parm; struct iwl4965_qosparam_cmd def_qos_parm;
}; };
#endif /*CONFIG_IWL4965_QOS */ #endif /*CONFIG_IWL4965_QOS */
#define STA_PS_STATUS_WAKE 0 #define STA_PS_STATUS_WAKE 0
#define STA_PS_STATUS_SLEEP 1 #define STA_PS_STATUS_SLEEP 1
struct iwl_station_entry { struct iwl4965_station_entry {
struct iwl_addsta_cmd sta; struct iwl4965_addsta_cmd sta;
struct iwl_tid_data tid[MAX_TID_COUNT]; struct iwl4965_tid_data tid[MAX_TID_COUNT];
u8 used; u8 used;
u8 ps_status; u8 ps_status;
struct iwl_hw_key keyinfo; struct iwl4965_hw_key keyinfo;
}; };
/* one for each uCode image (inst/data, boot/init/runtime) */ /* one for each uCode image (inst/data, boot/init/runtime) */
@ -546,7 +546,7 @@ struct fw_desc {
}; };
/* uCode file layout */ /* uCode file layout */
struct iwl_ucode { struct iwl4965_ucode {
__le32 ver; /* major/minor/subminor */ __le32 ver; /* major/minor/subminor */
__le32 inst_size; /* bytes of runtime instructions */ __le32 inst_size; /* bytes of runtime instructions */
__le32 data_size; /* bytes of runtime data */ __le32 data_size; /* bytes of runtime data */
@ -558,7 +558,7 @@ struct iwl_ucode {
#define IWL_IBSS_MAC_HASH_SIZE 32 #define IWL_IBSS_MAC_HASH_SIZE 32
struct iwl_ibss_seq { struct iwl4965_ibss_seq {
u8 mac[ETH_ALEN]; u8 mac[ETH_ALEN];
u16 seq_num; u16 seq_num;
u16 frag_num; u16 frag_num;
@ -566,7 +566,7 @@ struct iwl_ibss_seq {
struct list_head list; struct list_head list;
}; };
struct iwl_driver_hw_info { struct iwl4965_driver_hw_info {
u16 max_txq_num; u16 max_txq_num;
u16 ac_queue_count; u16 ac_queue_count;
u16 tx_cmd_len; u16 tx_cmd_len;
@ -592,10 +592,10 @@ struct iwl_driver_hw_info {
#define HT_SHORT_GI_40MHZ_ONLY (1 << 1) #define HT_SHORT_GI_40MHZ_ONLY (1 << 1)
#define IWL_RX_HDR(x) ((struct iwl_rx_frame_hdr *)(\ #define IWL_RX_HDR(x) ((struct iwl4965_rx_frame_hdr *)(\
x->u.rx_frame.stats.payload + \ x->u.rx_frame.stats.payload + \
x->u.rx_frame.stats.phy_count)) x->u.rx_frame.stats.phy_count))
#define IWL_RX_END(x) ((struct iwl_rx_frame_end *)(\ #define IWL_RX_END(x) ((struct iwl4965_rx_frame_end *)(\
IWL_RX_HDR(x)->payload + \ IWL_RX_HDR(x)->payload + \
le16_to_cpu(IWL_RX_HDR(x)->len))) le16_to_cpu(IWL_RX_HDR(x)->len)))
#define IWL_RX_STATS(x) (&x->u.rx_frame.stats) #define IWL_RX_STATS(x) (&x->u.rx_frame.stats)
@ -608,63 +608,63 @@ struct iwl_driver_hw_info {
* for use by iwl-*.c * for use by iwl-*.c
* *
*****************************************************************************/ *****************************************************************************/
struct iwl_addsta_cmd; struct iwl4965_addsta_cmd;
extern int iwl_send_add_station(struct iwl_priv *priv, extern int iwl4965_send_add_station(struct iwl4965_priv *priv,
struct iwl_addsta_cmd *sta, u8 flags); struct iwl4965_addsta_cmd *sta, u8 flags);
extern u8 iwl_add_station(struct iwl_priv *priv, const u8 *bssid, extern u8 iwl4965_add_station_flags(struct iwl4965_priv *priv, const u8 *bssid,
int is_ap, u8 flags); int is_ap, u8 flags);
extern int iwl_is_network_packet(struct iwl_priv *priv, extern int iwl4965_is_network_packet(struct iwl4965_priv *priv,
struct ieee80211_hdr *header); struct ieee80211_hdr *header);
extern int iwl_power_init_handle(struct iwl_priv *priv); extern int iwl4965_power_init_handle(struct iwl4965_priv *priv);
extern int iwl_eeprom_init(struct iwl_priv *priv); extern int iwl4965_eeprom_init(struct iwl4965_priv *priv);
#ifdef CONFIG_IWL4965_DEBUG #ifdef CONFIG_IWL4965_DEBUG
extern void iwl_report_frame(struct iwl_priv *priv, extern void iwl4965_report_frame(struct iwl4965_priv *priv,
struct iwl_rx_packet *pkt, struct iwl4965_rx_packet *pkt,
struct ieee80211_hdr *header, int group100); struct ieee80211_hdr *header, int group100);
#else #else
static inline void iwl_report_frame(struct iwl_priv *priv, static inline void iwl4965_report_frame(struct iwl4965_priv *priv,
struct iwl_rx_packet *pkt, struct iwl4965_rx_packet *pkt,
struct ieee80211_hdr *header, struct ieee80211_hdr *header,
int group100) {} int group100) {}
#endif #endif
extern void iwl_handle_data_packet_monitor(struct iwl_priv *priv, extern void iwl4965_handle_data_packet_monitor(struct iwl4965_priv *priv,
struct iwl_rx_mem_buffer *rxb, struct iwl4965_rx_mem_buffer *rxb,
void *data, short len, void *data, short len,
struct ieee80211_rx_status *stats, struct ieee80211_rx_status *stats,
u16 phy_flags); u16 phy_flags);
extern int is_duplicate_packet(struct iwl_priv *priv, struct ieee80211_hdr extern int iwl4965_is_duplicate_packet(struct iwl4965_priv *priv,
*header); struct ieee80211_hdr *header);
extern int iwl_rx_queue_alloc(struct iwl_priv *priv); extern int iwl4965_rx_queue_alloc(struct iwl4965_priv *priv);
extern void iwl_rx_queue_reset(struct iwl_priv *priv, extern void iwl4965_rx_queue_reset(struct iwl4965_priv *priv,
struct iwl_rx_queue *rxq); struct iwl4965_rx_queue *rxq);
extern int iwl_calc_db_from_ratio(int sig_ratio); extern int iwl4965_calc_db_from_ratio(int sig_ratio);
extern int iwl_calc_sig_qual(int rssi_dbm, int noise_dbm); extern int iwl4965_calc_sig_qual(int rssi_dbm, int noise_dbm);
extern int iwl_tx_queue_init(struct iwl_priv *priv, extern int iwl4965_tx_queue_init(struct iwl4965_priv *priv,
struct iwl_tx_queue *txq, int count, u32 id); struct iwl4965_tx_queue *txq, int count, u32 id);
extern void iwl_rx_replenish(void *data); extern void iwl4965_rx_replenish(void *data);
extern void iwl_tx_queue_free(struct iwl_priv *priv, struct iwl_tx_queue *txq); extern void iwl4965_tx_queue_free(struct iwl4965_priv *priv, struct iwl4965_tx_queue *txq);
extern int iwl_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len, extern int iwl4965_send_cmd_pdu(struct iwl4965_priv *priv, u8 id, u16 len,
const void *data); const void *data);
extern int __must_check iwl_send_cmd(struct iwl_priv *priv, extern int __must_check iwl4965_send_cmd(struct iwl4965_priv *priv,
struct iwl_host_cmd *cmd); struct iwl4965_host_cmd *cmd);
extern unsigned int iwl_fill_beacon_frame(struct iwl_priv *priv, extern unsigned int iwl4965_fill_beacon_frame(struct iwl4965_priv *priv,
struct ieee80211_hdr *hdr, struct ieee80211_hdr *hdr,
const u8 *dest, int left); const u8 *dest, int left);
extern int iwl_rx_queue_update_write_ptr(struct iwl_priv *priv, extern int iwl4965_rx_queue_update_write_ptr(struct iwl4965_priv *priv,
struct iwl_rx_queue *q); struct iwl4965_rx_queue *q);
extern int iwl_send_statistics_request(struct iwl_priv *priv); extern int iwl4965_send_statistics_request(struct iwl4965_priv *priv);
extern void iwl_set_decrypted_flag(struct iwl_priv *priv, struct sk_buff *skb, extern void iwl4965_set_decrypted_flag(struct iwl4965_priv *priv, struct sk_buff *skb,
u32 decrypt_res, u32 decrypt_res,
struct ieee80211_rx_status *stats); struct ieee80211_rx_status *stats);
extern __le16 *ieee80211_get_qos_ctrl(struct ieee80211_hdr *hdr); extern __le16 *ieee80211_get_qos_ctrl(struct ieee80211_hdr *hdr);
extern const u8 BROADCAST_ADDR[ETH_ALEN]; extern const u8 iwl4965_broadcast_addr[ETH_ALEN];
/* /*
* Currently used by iwl-3945-rs... look at restructuring so that it doesn't * Currently used by iwl-3945-rs... look at restructuring so that it doesn't
* call this... todo... fix that. * call this... todo... fix that.
*/ */
extern u8 iwl_sync_station(struct iwl_priv *priv, int sta_id, extern u8 iwl4965_sync_station(struct iwl4965_priv *priv, int sta_id,
u16 tx_rate, u8 flags); u16 tx_rate, u8 flags);
/****************************************************************************** /******************************************************************************
@ -676,112 +676,110 @@ extern u8 iwl_sync_station(struct iwl_priv *priv, int sta_id,
* which is why they are in the hardware specific files (vs. iwl-base.c) * which is why they are in the hardware specific files (vs. iwl-base.c)
* *
* Naming convention -- * Naming convention --
* iwl_ <-- Its part of iwlwifi (should be changed to iwl_) * iwl4965_ <-- Its part of iwlwifi (should be changed to iwl4965_)
* iwl_hw_ <-- Hardware specific (implemented in iwl-XXXX.c by all HW) * iwl4965_hw_ <-- Hardware specific (implemented in iwl-XXXX.c by all HW)
* iwlXXXX_ <-- Hardware specific (implemented in iwl-XXXX.c for XXXX) * iwlXXXX_ <-- Hardware specific (implemented in iwl-XXXX.c for XXXX)
* iwl_bg_ <-- Called from work queue context * iwl4965_bg_ <-- Called from work queue context
* iwl_mac_ <-- mac80211 callback * iwl4965_mac_ <-- mac80211 callback
* *
****************************************************************************/ ****************************************************************************/
extern void iwl_hw_rx_handler_setup(struct iwl_priv *priv); extern void iwl4965_hw_rx_handler_setup(struct iwl4965_priv *priv);
extern void iwl_hw_setup_deferred_work(struct iwl_priv *priv); extern void iwl4965_hw_setup_deferred_work(struct iwl4965_priv *priv);
extern void iwl_hw_cancel_deferred_work(struct iwl_priv *priv); extern void iwl4965_hw_cancel_deferred_work(struct iwl4965_priv *priv);
extern int iwl_hw_rxq_stop(struct iwl_priv *priv); extern int iwl4965_hw_rxq_stop(struct iwl4965_priv *priv);
extern int iwl_hw_set_hw_setting(struct iwl_priv *priv); extern int iwl4965_hw_set_hw_setting(struct iwl4965_priv *priv);
extern int iwl_hw_nic_init(struct iwl_priv *priv); extern int iwl4965_hw_nic_init(struct iwl4965_priv *priv);
extern int iwl_hw_nic_stop_master(struct iwl_priv *priv); extern int iwl4965_hw_nic_stop_master(struct iwl4965_priv *priv);
extern void iwl_hw_txq_ctx_free(struct iwl_priv *priv); extern void iwl4965_hw_txq_ctx_free(struct iwl4965_priv *priv);
extern void iwl_hw_txq_ctx_stop(struct iwl_priv *priv); extern void iwl4965_hw_txq_ctx_stop(struct iwl4965_priv *priv);
extern int iwl_hw_nic_reset(struct iwl_priv *priv); extern int iwl4965_hw_nic_reset(struct iwl4965_priv *priv);
extern int iwl_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv, void *tfd, extern int iwl4965_hw_txq_attach_buf_to_tfd(struct iwl4965_priv *priv, void *tfd,
dma_addr_t addr, u16 len); dma_addr_t addr, u16 len);
extern int iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq); extern int iwl4965_hw_txq_free_tfd(struct iwl4965_priv *priv, struct iwl4965_tx_queue *txq);
extern int iwl_hw_get_temperature(struct iwl_priv *priv); extern int iwl4965_hw_get_temperature(struct iwl4965_priv *priv);
extern int iwl_hw_tx_queue_init(struct iwl_priv *priv, extern int iwl4965_hw_tx_queue_init(struct iwl4965_priv *priv,
struct iwl_tx_queue *txq); struct iwl4965_tx_queue *txq);
extern unsigned int iwl_hw_get_beacon_cmd(struct iwl_priv *priv, extern unsigned int iwl4965_hw_get_beacon_cmd(struct iwl4965_priv *priv,
struct iwl_frame *frame, u8 rate); struct iwl4965_frame *frame, u8 rate);
extern int iwl_hw_get_rx_read(struct iwl_priv *priv); extern int iwl4965_hw_get_rx_read(struct iwl4965_priv *priv);
extern void iwl_hw_build_tx_cmd_rate(struct iwl_priv *priv, extern void iwl4965_hw_build_tx_cmd_rate(struct iwl4965_priv *priv,
struct iwl_cmd *cmd, struct iwl4965_cmd *cmd,
struct ieee80211_tx_control *ctrl, struct ieee80211_tx_control *ctrl,
struct ieee80211_hdr *hdr, struct ieee80211_hdr *hdr,
int sta_id, int tx_id); int sta_id, int tx_id);
extern int iwl_hw_reg_send_txpower(struct iwl_priv *priv); extern int iwl4965_hw_reg_send_txpower(struct iwl4965_priv *priv);
extern int iwl_hw_reg_set_txpower(struct iwl_priv *priv, s8 power); extern int iwl4965_hw_reg_set_txpower(struct iwl4965_priv *priv, s8 power);
extern void iwl_hw_rx_statistics(struct iwl_priv *priv, extern void iwl4965_hw_rx_statistics(struct iwl4965_priv *priv,
struct iwl_rx_mem_buffer *rxb); struct iwl4965_rx_mem_buffer *rxb);
extern void iwl_disable_events(struct iwl_priv *priv); extern void iwl4965_disable_events(struct iwl4965_priv *priv);
extern int iwl4965_get_temperature(const struct iwl_priv *priv); extern int iwl4965_get_temperature(const struct iwl4965_priv *priv);
/** /**
* iwl_hw_find_station - Find station id for a given BSSID * iwl4965_hw_find_station - Find station id for a given BSSID
* @bssid: MAC address of station ID to find * @bssid: MAC address of station ID to find
* *
* NOTE: This should not be hardware specific but the code has * NOTE: This should not be hardware specific but the code has
* not yet been merged into a single common layer for managing the * not yet been merged into a single common layer for managing the
* station tables. * station tables.
*/ */
extern u8 iwl_hw_find_station(struct iwl_priv *priv, const u8 *bssid); extern u8 iwl4965_hw_find_station(struct iwl4965_priv *priv, const u8 *bssid);
extern int iwl_hw_channel_switch(struct iwl_priv *priv, u16 channel); extern int iwl4965_hw_channel_switch(struct iwl4965_priv *priv, u16 channel);
extern int iwl_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index); extern int iwl4965_tx_queue_reclaim(struct iwl4965_priv *priv, int txq_id, int index);
struct iwl_priv; struct iwl4965_priv;
struct sta_ht_info; struct sta_ht_info;
/* /*
* Forward declare iwl-4965.c functions for iwl-base.c * Forward declare iwl-4965.c functions for iwl-base.c
*/ */
extern int iwl_eeprom_acquire_semaphore(struct iwl_priv *priv); extern int iwl4965_eeprom_acquire_semaphore(struct iwl4965_priv *priv);
extern void iwl_eeprom_release_semaphore(struct iwl_priv *priv); extern void iwl4965_eeprom_release_semaphore(struct iwl4965_priv *priv);
extern int iwl4965_tx_queue_update_wr_ptr(struct iwl_priv *priv, extern int iwl4965_tx_queue_update_wr_ptr(struct iwl4965_priv *priv,
struct iwl_tx_queue *txq, struct iwl4965_tx_queue *txq,
u16 byte_cnt); u16 byte_cnt);
extern void iwl4965_add_station(struct iwl_priv *priv, const u8 *addr, extern void iwl4965_add_station(struct iwl4965_priv *priv, const u8 *addr,
int is_ap); int is_ap);
extern void iwl4965_set_rxon_ht(struct iwl_priv *priv, extern void iwl4965_set_rxon_ht(struct iwl4965_priv *priv,
struct sta_ht_info *ht_info); struct sta_ht_info *ht_info);
extern void iwl4965_set_rxon_chain(struct iwl_priv *priv); extern void iwl4965_set_rxon_chain(struct iwl4965_priv *priv);
extern int iwl4965_tx_cmd(struct iwl_priv *priv, struct iwl_cmd *out_cmd, extern int iwl4965_tx_cmd(struct iwl4965_priv *priv, struct iwl4965_cmd *out_cmd,
u8 sta_id, dma_addr_t txcmd_phys, u8 sta_id, dma_addr_t txcmd_phys,
struct ieee80211_hdr *hdr, u8 hdr_len, struct ieee80211_hdr *hdr, u8 hdr_len,
struct ieee80211_tx_control *ctrl, void *sta_in); struct ieee80211_tx_control *ctrl, void *sta_in);
extern int iwl4965_init_hw_rates(struct iwl_priv *priv, extern int iwl4965_alive_notify(struct iwl4965_priv *priv);
struct ieee80211_rate *rates); extern void iwl4965_update_rate_scaling(struct iwl4965_priv *priv, u8 mode);
extern int iwl4965_alive_notify(struct iwl_priv *priv); extern void iwl4965_set_ht_add_station(struct iwl4965_priv *priv, u8 index);
extern void iwl4965_update_rate_scaling(struct iwl_priv *priv, u8 mode);
extern void iwl4965_set_ht_add_station(struct iwl_priv *priv, u8 index);
extern void iwl4965_chain_noise_reset(struct iwl_priv *priv); extern void iwl4965_chain_noise_reset(struct iwl4965_priv *priv);
extern void iwl4965_init_sensitivity(struct iwl_priv *priv, u8 flags, extern void iwl4965_init_sensitivity(struct iwl4965_priv *priv, u8 flags,
u8 force); u8 force);
extern int iwl4965_set_fat_chan_info(struct iwl_priv *priv, int phymode, extern int iwl4965_set_fat_chan_info(struct iwl4965_priv *priv, int phymode,
u16 channel, u16 channel,
const struct iwl_eeprom_channel *eeprom_ch, const struct iwl4965_eeprom_channel *eeprom_ch,
u8 fat_extension_channel); u8 fat_extension_channel);
extern void iwl4965_rf_kill_ct_config(struct iwl_priv *priv); extern void iwl4965_rf_kill_ct_config(struct iwl4965_priv *priv);
#ifdef CONFIG_IWL4965_HT #ifdef CONFIG_IWL4965_HT
#ifdef CONFIG_IWL4965_HT_AGG #ifdef CONFIG_IWL4965_HT_AGG
extern int iwl_mac_ht_tx_agg_start(struct ieee80211_hw *hw, u8 *da, extern int iwl4965_mac_ht_tx_agg_start(struct ieee80211_hw *hw, u8 *da,
u16 tid, u16 *start_seq_num); u16 tid, u16 *start_seq_num);
extern int iwl_mac_ht_rx_agg_start(struct ieee80211_hw *hw, u8 *da, extern int iwl4965_mac_ht_rx_agg_start(struct ieee80211_hw *hw, u8 *da,
u16 tid, u16 start_seq_num); u16 tid, u16 start_seq_num);
extern int iwl_mac_ht_rx_agg_stop(struct ieee80211_hw *hw, u8 *da, extern int iwl4965_mac_ht_rx_agg_stop(struct ieee80211_hw *hw, u8 *da,
u16 tid, int generator); u16 tid, int generator);
extern int iwl_mac_ht_tx_agg_stop(struct ieee80211_hw *hw, u8 *da, extern int iwl4965_mac_ht_tx_agg_stop(struct ieee80211_hw *hw, u8 *da,
u16 tid, int generator); u16 tid, int generator);
extern void iwl4965_turn_off_agg(struct iwl_priv *priv, u8 tid); extern void iwl4965_turn_off_agg(struct iwl4965_priv *priv, u8 tid);
#endif /* CONFIG_IWL4965_HT_AGG */ #endif /* CONFIG_IWL4965_HT_AGG */
#endif /*CONFIG_IWL4965_HT */ #endif /*CONFIG_IWL4965_HT */
/* Structures, enum, and defines specific to the 4965 */ /* Structures, enum, and defines specific to the 4965 */
#define IWL4965_KW_SIZE 0x1000 /*4k */ #define IWL4965_KW_SIZE 0x1000 /*4k */
struct iwl_kw { struct iwl4965_kw {
dma_addr_t dma_addr; dma_addr_t dma_addr;
void *v_addr; void *v_addr;
size_t size; size_t size;
@ -835,7 +833,7 @@ struct iwl_kw {
#define IWL_TX_POWER_CCK_COMPENSATION_B_STEP (9) #define IWL_TX_POWER_CCK_COMPENSATION_B_STEP (9)
#define IWL_TX_POWER_CCK_COMPENSATION_C_STEP (5) #define IWL_TX_POWER_CCK_COMPENSATION_C_STEP (5)
struct iwl_traffic_load { struct iwl4965_traffic_load {
unsigned long time_stamp; unsigned long time_stamp;
u32 packet_count[TID_QUEUE_MAX_SIZE]; u32 packet_count[TID_QUEUE_MAX_SIZE];
u8 queue_count; u8 queue_count;
@ -844,7 +842,7 @@ struct iwl_traffic_load {
}; };
#ifdef CONFIG_IWL4965_HT_AGG #ifdef CONFIG_IWL4965_HT_AGG
struct iwl_agg_control { struct iwl4965_agg_control {
unsigned long next_retry; unsigned long next_retry;
u32 wait_for_agg_status; u32 wait_for_agg_status;
u32 tid_retry; u32 tid_retry;
@ -853,13 +851,13 @@ struct iwl_agg_control {
u8 auto_agg; u8 auto_agg;
u32 tid_traffic_load_threshold; u32 tid_traffic_load_threshold;
u32 ba_timeout; u32 ba_timeout;
struct iwl_traffic_load traffic_load[TID_MAX_LOAD_COUNT]; struct iwl4965_traffic_load traffic_load[TID_MAX_LOAD_COUNT];
}; };
#endif /*CONFIG_IWL4965_HT_AGG */ #endif /*CONFIG_IWL4965_HT_AGG */
struct iwl_lq_mngr { struct iwl4965_lq_mngr {
#ifdef CONFIG_IWL4965_HT_AGG #ifdef CONFIG_IWL4965_HT_AGG
struct iwl_agg_control agg_ctrl; struct iwl4965_agg_control agg_ctrl;
#endif #endif
spinlock_t lock; spinlock_t lock;
s32 max_window_size; s32 max_window_size;
@ -940,24 +938,24 @@ struct iwl_lq_mngr {
#define IN_BAND_FILTER 0xFF #define IN_BAND_FILTER 0xFF
#define MIN_AVERAGE_NOISE_MAX_VALUE 0xFFFFFFFF #define MIN_AVERAGE_NOISE_MAX_VALUE 0xFFFFFFFF
enum iwl_false_alarm_state { enum iwl4965_false_alarm_state {
IWL_FA_TOO_MANY = 0, IWL_FA_TOO_MANY = 0,
IWL_FA_TOO_FEW = 1, IWL_FA_TOO_FEW = 1,
IWL_FA_GOOD_RANGE = 2, IWL_FA_GOOD_RANGE = 2,
}; };
enum iwl_chain_noise_state { enum iwl4965_chain_noise_state {
IWL_CHAIN_NOISE_ALIVE = 0, /* must be 0 */ IWL_CHAIN_NOISE_ALIVE = 0, /* must be 0 */
IWL_CHAIN_NOISE_ACCUMULATE = 1, IWL_CHAIN_NOISE_ACCUMULATE = 1,
IWL_CHAIN_NOISE_CALIBRATED = 2, IWL_CHAIN_NOISE_CALIBRATED = 2,
}; };
enum iwl_sensitivity_state { enum iwl4965_sensitivity_state {
IWL_SENS_CALIB_ALLOWED = 0, IWL_SENS_CALIB_ALLOWED = 0,
IWL_SENS_CALIB_NEED_REINIT = 1, IWL_SENS_CALIB_NEED_REINIT = 1,
}; };
enum iwl_calib_enabled_state { enum iwl4965_calib_enabled_state {
IWL_CALIB_DISABLED = 0, /* must be 0 */ IWL_CALIB_DISABLED = 0, /* must be 0 */
IWL_CALIB_ENABLED = 1, IWL_CALIB_ENABLED = 1,
}; };
@ -972,7 +970,7 @@ struct statistics_general_data {
}; };
/* Sensitivity calib data */ /* Sensitivity calib data */
struct iwl_sensitivity_data { struct iwl4965_sensitivity_data {
u32 auto_corr_ofdm; u32 auto_corr_ofdm;
u32 auto_corr_ofdm_mrc; u32 auto_corr_ofdm_mrc;
u32 auto_corr_ofdm_x1; u32 auto_corr_ofdm_x1;
@ -1001,7 +999,7 @@ struct iwl_sensitivity_data {
}; };
/* Chain noise (differential Rx gain) calib data */ /* Chain noise (differential Rx gain) calib data */
struct iwl_chain_noise_data { struct iwl4965_chain_noise_data {
u8 state; u8 state;
u16 beacon_count; u16 beacon_count;
u32 chain_noise_a; u32 chain_noise_a;
@ -1049,7 +1047,7 @@ enum {
#endif #endif
struct iwl_priv { struct iwl4965_priv {
/* ieee device used by generic ieee processing code */ /* ieee device used by generic ieee processing code */
struct ieee80211_hw *hw; struct ieee80211_hw *hw;
@ -1063,27 +1061,27 @@ struct iwl_priv {
u8 phymode; u8 phymode;
int alloc_rxb_skb; int alloc_rxb_skb;
void (*rx_handlers[REPLY_MAX])(struct iwl_priv *priv, void (*rx_handlers[REPLY_MAX])(struct iwl4965_priv *priv,
struct iwl_rx_mem_buffer *rxb); struct iwl4965_rx_mem_buffer *rxb);
const struct ieee80211_hw_mode *modes; const struct ieee80211_hw_mode *modes;
#ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT #ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT
/* spectrum measurement report caching */ /* spectrum measurement report caching */
struct iwl_spectrum_notification measure_report; struct iwl4965_spectrum_notification measure_report;
u8 measurement_status; u8 measurement_status;
#endif #endif
/* ucode beacon time */ /* ucode beacon time */
u32 ucode_beacon_time; u32 ucode_beacon_time;
/* we allocate array of iwl_channel_info for NIC's valid channels. /* we allocate array of iwl4965_channel_info for NIC's valid channels.
* Access via channel # using indirect index array */ * Access via channel # using indirect index array */
struct iwl_channel_info *channel_info; /* channel info array */ struct iwl4965_channel_info *channel_info; /* channel info array */
u8 channel_count; /* # of channels */ u8 channel_count; /* # of channels */
/* each calibration channel group in the EEPROM has a derived /* each calibration channel group in the EEPROM has a derived
* clip setting for each rate. */ * clip setting for each rate. */
const struct iwl_clip_group clip_groups[5]; const struct iwl4965_clip_group clip_groups[5];
/* thermal calibration */ /* thermal calibration */
s32 temperature; /* degrees Kelvin */ s32 temperature; /* degrees Kelvin */
@ -1098,7 +1096,7 @@ struct iwl_priv {
int one_direct_scan; int one_direct_scan;
u8 direct_ssid_len; u8 direct_ssid_len;
u8 direct_ssid[IW_ESSID_MAX_SIZE]; u8 direct_ssid[IW_ESSID_MAX_SIZE];
struct iwl_scan_cmd *scan; struct iwl4965_scan_cmd *scan;
u8 only_active_channel; u8 only_active_channel;
/* spinlock */ /* spinlock */
@ -1121,26 +1119,26 @@ struct iwl_priv {
struct fw_desc ucode_boot; /* bootstrap inst */ struct fw_desc ucode_boot; /* bootstrap inst */
struct iwl_rxon_time_cmd rxon_timing; struct iwl4965_rxon_time_cmd rxon_timing;
/* We declare this const so it can only be /* We declare this const so it can only be
* changed via explicit cast within the * changed via explicit cast within the
* routines that actually update the physical * routines that actually update the physical
* hardware */ * hardware */
const struct iwl_rxon_cmd active_rxon; const struct iwl4965_rxon_cmd active_rxon;
struct iwl_rxon_cmd staging_rxon; struct iwl4965_rxon_cmd staging_rxon;
int error_recovering; int error_recovering;
struct iwl_rxon_cmd recovery_rxon; struct iwl4965_rxon_cmd recovery_rxon;
/* 1st responses from initialize and runtime uCode images. /* 1st responses from initialize and runtime uCode images.
* 4965's initialize alive response contains some calibration data. */ * 4965's initialize alive response contains some calibration data. */
struct iwl_init_alive_resp card_alive_init; struct iwl4965_init_alive_resp card_alive_init;
struct iwl_alive_resp card_alive; struct iwl4965_alive_resp card_alive;
#ifdef LED #ifdef LED
/* LED related variables */ /* LED related variables */
struct iwl_activity_blink activity; struct iwl4965_activity_blink activity;
unsigned long led_packets; unsigned long led_packets;
int led_state; int led_state;
#endif #endif
@ -1158,8 +1156,8 @@ struct iwl_priv {
u8 current_channel_width; u8 current_channel_width;
u8 valid_antenna; /* Bit mask of antennas actually connected */ u8 valid_antenna; /* Bit mask of antennas actually connected */
#ifdef CONFIG_IWL4965_SENSITIVITY #ifdef CONFIG_IWL4965_SENSITIVITY
struct iwl_sensitivity_data sensitivity_data; struct iwl4965_sensitivity_data sensitivity_data;
struct iwl_chain_noise_data chain_noise_data; struct iwl4965_chain_noise_data chain_noise_data;
u8 start_calib; u8 start_calib;
__le16 sensitivity_tbl[HD_TABLE_SIZE]; __le16 sensitivity_tbl[HD_TABLE_SIZE];
#endif /*CONFIG_IWL4965_SENSITIVITY*/ #endif /*CONFIG_IWL4965_SENSITIVITY*/
@ -1171,7 +1169,7 @@ struct iwl_priv {
u8 last_phy_res[100]; u8 last_phy_res[100];
/* Rate scaling data */ /* Rate scaling data */
struct iwl_lq_mngr lq_mngr; struct iwl4965_lq_mngr lq_mngr;
/* Rate scaling data */ /* Rate scaling data */
s8 data_retry_limit; s8 data_retry_limit;
@ -1182,10 +1180,10 @@ struct iwl_priv {
int activity_timer_active; int activity_timer_active;
/* Rx and Tx DMA processing queues */ /* Rx and Tx DMA processing queues */
struct iwl_rx_queue rxq; struct iwl4965_rx_queue rxq;
struct iwl_tx_queue txq[IWL_MAX_NUM_QUEUES]; struct iwl4965_tx_queue txq[IWL_MAX_NUM_QUEUES];
unsigned long txq_ctx_active_msk; unsigned long txq_ctx_active_msk;
struct iwl_kw kw; /* keep warm address */ struct iwl4965_kw kw; /* keep warm address */
u32 scd_base_addr; /* scheduler sram base address */ u32 scd_base_addr; /* scheduler sram base address */
unsigned long status; unsigned long status;
@ -1194,9 +1192,9 @@ struct iwl_priv {
int last_rx_rssi; /* From Rx packet statisitics */ int last_rx_rssi; /* From Rx packet statisitics */
int last_rx_noise; /* From beacon statistics */ int last_rx_noise; /* From beacon statistics */
struct iwl_power_mgr power_data; struct iwl4965_power_mgr power_data;
struct iwl_notif_statistics statistics; struct iwl4965_notif_statistics statistics;
unsigned long last_statistics_time; unsigned long last_statistics_time;
/* context information */ /* context information */
@ -1213,7 +1211,7 @@ struct iwl_priv {
/*station table variables */ /*station table variables */
spinlock_t sta_lock; spinlock_t sta_lock;
int num_stations; int num_stations;
struct iwl_station_entry stations[IWL_STATION_COUNT]; struct iwl4965_station_entry stations[IWL_STATION_COUNT];
/* Indication if ieee80211_ops->open has been called */ /* Indication if ieee80211_ops->open has been called */
int is_open; int is_open;
@ -1234,7 +1232,7 @@ struct iwl_priv {
struct list_head ibss_mac_hash[IWL_IBSS_MAC_HASH_SIZE]; struct list_head ibss_mac_hash[IWL_IBSS_MAC_HASH_SIZE];
/* eeprom */ /* eeprom */
struct iwl_eeprom eeprom; struct iwl4965_eeprom eeprom;
int iw_mode; int iw_mode;
@ -1244,7 +1242,7 @@ struct iwl_priv {
u32 timestamp0; u32 timestamp0;
u32 timestamp1; u32 timestamp1;
u16 beacon_int; u16 beacon_int;
struct iwl_driver_hw_info hw_setting; struct iwl4965_driver_hw_info hw_setting;
int interface_id; int interface_id;
/* Current association information needed to configure the /* Current association information needed to configure the
@ -1254,7 +1252,7 @@ struct iwl_priv {
u8 ps_mode; u8 ps_mode;
#ifdef CONFIG_IWL4965_QOS #ifdef CONFIG_IWL4965_QOS
struct iwl_qos_info qos_data; struct iwl4965_qos_info qos_data;
#endif /*CONFIG_IWL4965_QOS */ #endif /*CONFIG_IWL4965_QOS */
struct workqueue_struct *workqueue; struct workqueue_struct *workqueue;
@ -1306,55 +1304,55 @@ struct iwl_priv {
#ifdef CONFIG_IWL4965_HT_AGG #ifdef CONFIG_IWL4965_HT_AGG
struct work_struct agg_work; struct work_struct agg_work;
#endif #endif
}; /*iwl_priv */ }; /*iwl4965_priv */
static inline int iwl_is_associated(struct iwl_priv *priv) static inline int iwl4965_is_associated(struct iwl4965_priv *priv)
{ {
return (priv->active_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0; return (priv->active_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0;
} }
static inline int is_channel_valid(const struct iwl_channel_info *ch_info) static inline int is_channel_valid(const struct iwl4965_channel_info *ch_info)
{ {
if (ch_info == NULL) if (ch_info == NULL)
return 0; return 0;
return (ch_info->flags & EEPROM_CHANNEL_VALID) ? 1 : 0; return (ch_info->flags & EEPROM_CHANNEL_VALID) ? 1 : 0;
} }
static inline int is_channel_narrow(const struct iwl_channel_info *ch_info) static inline int is_channel_narrow(const struct iwl4965_channel_info *ch_info)
{ {
return (ch_info->flags & EEPROM_CHANNEL_NARROW) ? 1 : 0; return (ch_info->flags & EEPROM_CHANNEL_NARROW) ? 1 : 0;
} }
static inline int is_channel_radar(const struct iwl_channel_info *ch_info) static inline int is_channel_radar(const struct iwl4965_channel_info *ch_info)
{ {
return (ch_info->flags & EEPROM_CHANNEL_RADAR) ? 1 : 0; return (ch_info->flags & EEPROM_CHANNEL_RADAR) ? 1 : 0;
} }
static inline u8 is_channel_a_band(const struct iwl_channel_info *ch_info) static inline u8 is_channel_a_band(const struct iwl4965_channel_info *ch_info)
{ {
return ch_info->phymode == MODE_IEEE80211A; return ch_info->phymode == MODE_IEEE80211A;
} }
static inline u8 is_channel_bg_band(const struct iwl_channel_info *ch_info) static inline u8 is_channel_bg_band(const struct iwl4965_channel_info *ch_info)
{ {
return ((ch_info->phymode == MODE_IEEE80211B) || return ((ch_info->phymode == MODE_IEEE80211B) ||
(ch_info->phymode == MODE_IEEE80211G)); (ch_info->phymode == MODE_IEEE80211G));
} }
static inline int is_channel_passive(const struct iwl_channel_info *ch) static inline int is_channel_passive(const struct iwl4965_channel_info *ch)
{ {
return (!(ch->flags & EEPROM_CHANNEL_ACTIVE)) ? 1 : 0; return (!(ch->flags & EEPROM_CHANNEL_ACTIVE)) ? 1 : 0;
} }
static inline int is_channel_ibss(const struct iwl_channel_info *ch) static inline int is_channel_ibss(const struct iwl4965_channel_info *ch)
{ {
return ((ch->flags & EEPROM_CHANNEL_IBSS)) ? 1 : 0; return ((ch->flags & EEPROM_CHANNEL_IBSS)) ? 1 : 0;
} }
extern const struct iwl_channel_info *iwl_get_channel_info( extern const struct iwl4965_channel_info *iwl4965_get_channel_info(
const struct iwl_priv *priv, int phymode, u16 channel); const struct iwl4965_priv *priv, int phymode, u16 channel);
/* Requires full declaration of iwl_priv before including */ /* Requires full declaration of iwl4965_priv before including */
#include "iwl-4965-io.h" #include "iwl-4965-io.h"
#endif /* __iwl_4965_h__ */ #endif /* __iwl4965_4965_h__ */

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу