···1414 default n15151616config IWLWIFI_RFKILL1717- boolean "IWLWIFI RF kill support"1717+ boolean "Iwlwifi RF kill support"1818 depends on IWLCORE19192020-config IWL49652121- tristate "Intel Wireless WiFi 4965AGN"2020+config IWLWIFI_DEBUG2121+ bool "Enable full debugging output in iwlagn driver"2222+ depends on IWLCORE2323+ ---help---2424+ This option will enable debug tracing output for the iwlwifi drivers2525+2626+ This will result in the kernel module being ~100k larger. You can2727+ control which debug output is sent to the kernel log by setting the2828+ value in2929+3030+ /sys/class/net/wlan0/device/debug_level3131+3232+ This entry will only exist if this option is enabled.3333+3434+ To set a value, simply echo an 8-byte hex value to the same file:3535+3636+ % echo 0x43fff > /sys/class/net/wlan0/device/debug_level3737+3838+ You can find the list of debug mask values in:3939+ drivers/net/wireless/iwlwifi/iwl-debug.h4040+4141+ If this is your first time using this driver, you should say Y here4242+ as the debug information can assist others in helping you resolve4343+ any problems you may encounter.4444+4545+config IWLWIFI_DEBUGFS4646+ bool "Iwlwifi debugfs support"4747+ depends on IWLCORE && IWLWIFI_DEBUG && MAC80211_DEBUGFS4848+ ---help---4949+ Enable creation of debugfs files for the iwlwifi drivers.5050+5151+config IWLAGN5252+ tristate "Intel Wireless WiFi Next Gen AGN"2253 depends on PCI && MAC80211 && WLAN_80211 && EXPERIMENTAL2354 select FW_LOADER2455 select IWLCORE2556 ---help---2657 Select to build the driver supporting the:27582828- Intel Wireless WiFi Link 4965AGN5959+ Intel Wireless WiFi Link Next-Gen AGN29603061 This driver uses the kernel's mac80211 subsystem.3162···7342 If you want to compile the driver as a module ( = code which can be7443 inserted in and removed from the running kernel whenever you want),7544 say M here and read <file:Documentation/kbuild/modules.txt>. The7676- module will be called iwl4965.ko.4545+ module will be called iwlagn.ko.77467878-config IWL4965_LEDS7979- bool "Enable LEDS features in iwl4965 driver"8080- depends on IWL49654747+config IWLAGN_SPECTRUM_MEASUREMENT4848+ bool "Enable Spectrum Measurement in iwlagn driver"4949+ depends on IWLAGN5050+ ---help---5151+ This option will enable spectrum measurement for the iwlagn driver.5252+5353+config IWLAGN_LEDS5454+ bool "Enable LEDS features in iwlagn driver"5555+ depends on IWLAGN8156 select IWLWIFI_LEDS8257 ---help---8383- This option enables LEDS for the iwlwifi drivers5858+ This option enables LEDS for the iwlagn drivers845985608686-config IWL4965_SPECTRUM_MEASUREMENT8787- bool "Enable Spectrum Measurement in iwl4965 driver"8888- depends on IWL49656161+config IWL49656262+ bool "Intel Wireless WiFi 4965AGN"6363+ depends on IWLAGN8964 ---help---9090- This option will enable spectrum measurement for the iwl4965 driver.9191-9292-config IWLWIFI_DEBUG9393- bool "Enable full debugging output in iwl4965 driver"9494- depends on IWL49659595- ---help---9696- This option will enable debug tracing output for the iwl49659797- driver.9898-9999- This will result in the kernel module being ~100k larger. You can100100- control which debug output is sent to the kernel log by setting the101101- value in102102-103103- /sys/class/net/wlan0/device/debug_level104104-105105- This entry will only exist if this option is enabled.106106-107107- To set a value, simply echo an 8-byte hex value to the same file:108108-109109- % echo 0x43fff > /sys/class/net/wlan0/device/debug_level110110-111111- You can find the list of debug mask values in:112112- drivers/net/wireless/iwlwifi/iwl-4965-debug.h113113-114114- If this is your first time using this driver, you should say Y here115115- as the debug information can assist others in helping you resolve116116- any problems you may encounter.6565+ This option enables support for Intel Wireless WiFi Link 4965AGN1176611867config IWL500011968 bool "Intel Wireless WiFi 5000AGN"120120- depends on IWL49656969+ depends on IWLAGN12170 ---help---12271 This option enables support for Intel Wireless WiFi Link 5000AGN Family123123- Dependency on 4965 is temporary124124-125125-config IWLWIFI_DEBUGFS126126- bool "Iwlwifi debugfs support"127127- depends on IWLCORE && IWLWIFI_DEBUG && MAC80211_DEBUGFS128128- ---help---129129- Enable creation of debugfs files for the iwlwifi drivers.1307213173config IWL394513274 tristate "Intel PRO/Wireless 3945ABG/BG Network Connection"
···2424 *2525 *****************************************************************************/26262727-#ifndef __iwl_4965_rs_h__2828-#define __iwl_4965_rs_h__2727+#ifndef __iwl_agn_rs_h__2828+#define __iwl_agn_rs_h__29293030#include "iwl-dev.h"3131···8888#define IWL_RATE_5M_MASK (1 << IWL_RATE_5M_INDEX)8989#define IWL_RATE_11M_MASK (1 << IWL_RATE_11M_INDEX)90909191-/* 4965 uCode API values for legacy bit rates, both OFDM and CCK */9191+/* uCode API values for legacy bit rates, both OFDM and CCK */9292enum {9393 IWL_RATE_6M_PLCP = 13,9494 IWL_RATE_9M_PLCP = 15,···107107 /*FIXME:RS:add IWL_RATE_LEGACY_INVM_PLCP = 0,*/108108};109109110110-/* 4965 uCode API values for OFDM high-throughput (HT) bit rates */110110+/* uCode API values for OFDM high-throughput (HT) bit rates */111111enum {112112 IWL_RATE_SISO_6M_PLCP = 0,113113 IWL_RATE_SISO_12M_PLCP = 1,···287287}288288289289/**290290- * iwl4965_fill_rs_info - Fill an output text buffer with the rate representation291291- *292292- * NOTE: This is provided as a quick mechanism for a user to visualize293293- * the performance of the rate control algorithm and is not meant to be294294- * parsed software.295295- */296296-extern int iwl4965_fill_rs_info(struct ieee80211_hw *, char *buf, u8 sta_id);297297-298298-/**299290 * iwl4965_rate_control_register - Register the rate control algorithm callbacks300291 *301292 * Since the rate control algorithm is hardware specific, there is no need···296305 * ieee80211_register_hw297306 *298307 */299299-extern int iwl4965_rate_control_register(void);308308+extern int iwlagn_rate_control_register(void);300309301310/**302311 * iwl4965_rate_control_unregister - Unregister the rate control callbacks···304313 * This should be called after calling ieee80211_unregister_hw, but before305314 * the driver is unloaded.306315 */307307-extern void iwl4965_rate_control_unregister(void);316316+extern void iwlagn_rate_control_unregister(void);308317309309-#endif318318+#endif /* __iwl_agn__rs__ */
+40-116
drivers/net/wireless/iwlwifi/iwl-4965.c
···341341 return -EINVAL;342342343343}344344-int iwl4965_set_pwr_src(struct iwl_priv *priv, enum iwl_pwr_src src)345345-{346346- int ret;347347- unsigned long flags;348348-349349- spin_lock_irqsave(&priv->lock, flags);350350- ret = iwl_grab_nic_access(priv);351351- if (ret) {352352- spin_unlock_irqrestore(&priv->lock, flags);353353- return ret;354354- }355355-356356- if (src == IWL_PWR_SRC_VAUX) {357357- u32 val;358358- ret = pci_read_config_dword(priv->pci_dev, PCI_POWER_SOURCE,359359- &val);360360-361361- if (val & PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT) {362362- iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG,363363- APMG_PS_CTRL_VAL_PWR_SRC_VAUX,364364- ~APMG_PS_CTRL_MSK_PWR_SRC);365365- }366366- } else {367367- iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG,368368- APMG_PS_CTRL_VAL_PWR_SRC_VMAIN,369369- ~APMG_PS_CTRL_MSK_PWR_SRC);370370- }371371-372372- iwl_release_nic_access(priv);373373- spin_unlock_irqrestore(&priv->lock, flags);374374-375375- return ret;376376-}377344378345/*379346 * Activate/Deactivat Tx DMA/FIFO channels according tx fifos mask···840873 priv->hw_params.sens = &iwl4965_sensitivity;841874842875 return 0;843843-}844844-845845-/* set card power command */846846-static int iwl4965_set_power(struct iwl_priv *priv,847847- void *cmd)848848-{849849- int ret = 0;850850-851851- ret = iwl_send_cmd_pdu_async(priv, POWER_TABLE_CMD,852852- sizeof(struct iwl4965_powertable_cmd),853853- cmd, NULL);854854- return ret;855876}856877857878static s32 iwl4965_math_div_round(s32 num, s32 denom, s32 *res)···15151560 c, atten_value, power_index,15161561 tx_power.s.radio_tx_gain[c],15171562 tx_power.s.dsp_predis_atten[c]);15181518- }/* for each chain */15631563+ } /* for each chain */1519156415201565 tx_power_tbl->power_tbl[i].dw = cpu_to_le32(tx_power.dw);1521156615221522- }/* for each rate */15671567+ } /* for each rate */1523156815241569 return 0;15251570}···16541699{16551700 struct iwl4965_shared *s = priv->shared_virt;16561701 return le32_to_cpu(s->rb_closed) & 0xFFF;16571657-}16581658-16591659-unsigned int iwl4965_hw_get_beacon_cmd(struct iwl_priv *priv,16601660- struct iwl_frame *frame, u8 rate)16611661-{16621662- struct iwl4965_tx_beacon_cmd *tx_beacon_cmd;16631663- unsigned int frame_size;16641664-16651665- tx_beacon_cmd = &frame->u.beacon;16661666- memset(tx_beacon_cmd, 0, sizeof(*tx_beacon_cmd));16671667-16681668- tx_beacon_cmd->tx.sta_id = priv->hw_params.bcast_sta_id;16691669- tx_beacon_cmd->tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;16701670-16711671- frame_size = iwl4965_fill_beacon_frame(priv,16721672- tx_beacon_cmd->frame,16731673- iwl_bcast_addr,16741674- sizeof(frame->u) - sizeof(*tx_beacon_cmd));16751675-16761676- BUG_ON(frame_size > MAX_MPDU_SIZE);16771677- tx_beacon_cmd->tx.len = cpu_to_le16((u16)frame_size);16781678-16791679- if ((rate == IWL_RATE_1M_PLCP) || (rate >= IWL_RATE_2M_PLCP))16801680- tx_beacon_cmd->tx.rate_n_flags =16811681- iwl_hw_set_rate_n_flags(rate, RATE_MCS_CCK_MSK);16821682- else16831683- tx_beacon_cmd->tx.rate_n_flags =16841684- iwl_hw_set_rate_n_flags(rate, 0);16851685-16861686- tx_beacon_cmd->tx.tx_flags = (TX_CMD_FLG_SEQ_CTL_MSK |16871687- TX_CMD_FLG_TSF_MSK | TX_CMD_FLG_STA_RATE_MSK);16881688- return (sizeof(*tx_beacon_cmd) + frame_size);16891702}1690170316911704static int iwl4965_alloc_shared_mem(struct iwl_priv *priv)···20022079 return 0;20032080}2004208120052005-int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw,20062006- enum ieee80211_ampdu_mlme_action action,20072007- const u8 *addr, u16 tid, u16 *ssn)20082008-{20092009- struct iwl_priv *priv = hw->priv;20102010- DECLARE_MAC_BUF(mac);20112011-20122012- IWL_DEBUG_HT("A-MPDU action on addr %s tid %d\n",20132013- print_mac(mac, addr), tid);20142014-20152015- if (!(priv->cfg->sku & IWL_SKU_N))20162016- return -EACCES;20172017-20182018- switch (action) {20192019- case IEEE80211_AMPDU_RX_START:20202020- IWL_DEBUG_HT("start Rx\n");20212021- return iwl_rx_agg_start(priv, addr, tid, *ssn);20222022- case IEEE80211_AMPDU_RX_STOP:20232023- IWL_DEBUG_HT("stop Rx\n");20242024- return iwl_rx_agg_stop(priv, addr, tid);20252025- case IEEE80211_AMPDU_TX_START:20262026- IWL_DEBUG_HT("start Tx\n");20272027- return iwl_tx_agg_start(priv, addr, tid, ssn);20282028- case IEEE80211_AMPDU_TX_STOP:20292029- IWL_DEBUG_HT("stop Tx\n");20302030- return iwl_tx_agg_stop(priv, addr, tid);20312031- default:20322032- IWL_DEBUG_HT("unknown\n");20332033- return -EINVAL;20342034- break;20352035- }20362036- return 0;20372037-}2038208220392083static u16 iwl4965_get_hcmd_size(u8 cmd_id, u16 len)20402084{···21302240 bitmap = bitmap << sh;21312241 sh = 0;21322242 }21332133- bitmap |= (1 << sh);21342134- IWL_DEBUG_TX_REPLY("start=%d bitmap=0x%x\n",21352135- start, (u32)(bitmap & 0xFFFFFFFF));22432243+ bitmap |= 1ULL << sh;22442244+ IWL_DEBUG_TX_REPLY("start=%d bitmap=0x%llx\n",22452245+ start, (unsigned long long)bitmap);21362246 }2137224721382248 agg->bitmap = bitmap;···22582368 IWL_ERROR("TODO: Implement Tx ABORT REQUIRED!!!\n");22592369}2260237023712371+static int iwl4965_calc_rssi(struct iwl_priv *priv,23722372+ struct iwl_rx_phy_res *rx_resp)23732373+{23742374+ /* data from PHY/DSP regarding signal strength, etc.,23752375+ * contents are always there, not configurable by host. */23762376+ struct iwl4965_rx_non_cfg_phy *ncphy =23772377+ (struct iwl4965_rx_non_cfg_phy *)rx_resp->non_cfg_phy_buf;23782378+ u32 agc = (le16_to_cpu(ncphy->agc_info) & IWL49_AGC_DB_MASK)23792379+ >> IWL49_AGC_DB_POS;23802380+23812381+ u32 valid_antennae =23822382+ (le16_to_cpu(rx_resp->phy_flags) & IWL49_RX_PHY_FLAGS_ANTENNAE_MASK)23832383+ >> IWL49_RX_PHY_FLAGS_ANTENNAE_OFFSET;23842384+ u8 max_rssi = 0;23852385+ u32 i;23862386+23872387+ /* Find max rssi among 3 possible receivers.23882388+ * These values are measured by the digital signal processor (DSP).23892389+ * They should stay fairly constant even as the signal strength varies,23902390+ * if the radio's automatic gain control (AGC) is working right.23912391+ * AGC value (see below) will provide the "interesting" info. */23922392+ for (i = 0; i < 3; i++)23932393+ if (valid_antennae & (1 << i))23942394+ max_rssi = max(ncphy->rssi_info[i << 1], max_rssi);23952395+23962396+ IWL_DEBUG_STATS("Rssi In A %d B %d C %d Max %d AGC dB %d\n",23972397+ ncphy->rssi_info[0], ncphy->rssi_info[2], ncphy->rssi_info[4],23982398+ max_rssi, agc);23992399+24002400+ /* dBm = max_rssi dB - agc dB - constant.24012401+ * Higher AGC (higher radio gain) means lower signal. */24022402+ return max_rssi - agc - IWL_RSSI_OFFSET;24032403+}24042404+2261240522622406/* Set up 4965-specific Rx frame reply handlers */22632407static void iwl4965_rx_handler_setup(struct iwl_priv *priv)···23232399 .chain_noise_reset = iwl4965_chain_noise_reset,23242400 .gain_computation = iwl4965_gain_computation,23252401 .rts_tx_cmd_flag = iwl4965_rts_tx_cmd_flag,24022402+ .calc_rssi = iwl4965_calc_rssi,23262403};2327240423282405static struct iwl_lib_ops iwl4965_lib = {···23652440 .check_version = iwl4965_eeprom_check_version,23662441 .query_addr = iwlcore_eeprom_query_addr,23672442 },23682368- .set_power = iwl4965_set_power,23692443 .send_tx_power = iwl4965_send_tx_power,23702444 .update_chain_flags = iwl4965_update_chain_flags,23712445 .temperature = iwl4965_temperature_calib,
+64-7
drivers/net/wireless/iwlwifi/iwl-5000.c
···9393 iwl_set_bit(priv, CSR_GIO_CHICKEN_BITS,9494 CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX);95959696+ /* Set FH wait treshold to maximum (HW error during stress W/A) */9797+ iwl_set_bit(priv, CSR_DBG_HPET_MEM_REG, CSR_DBG_HPET_MEM_REG_VAL);9898+9999+ /* enable HAP INTA to move device L1a -> L0s */100100+ iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,101101+ CSR_HW_IF_CONFIG_REG_BIT_HAP_WAKE_L1A);102102+96103 iwl_set_bit(priv, CSR_ANA_PLL_CFG, CSR50_ANA_PLL_CFG_VAL);9710498105 /* set "initialization complete" bit to move adapter···236229 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,237230 CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI |238231 CSR_HW_IF_CONFIG_REG_BIT_MAC_SI);232232+233233+ /* W/A : NIC is stuck in a reset state after Early PCIe power off234234+ * (PCIe power is lost before PERST# is asserted),235235+ * causing ME FW to lose ownership and not being able to obtain it back.236236+ */237237+ iwl_grab_nic_access(priv);238238+ iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG,239239+ APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS,240240+ ~APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS);241241+ iwl_release_nic_access(priv);239242240243 spin_unlock_irqrestore(&priv->lock, flags);241244}···941924 len = byte_cnt + IWL_TX_CRC_SIZE + IWL_TX_DELIMITER_SIZE;942925943926 if (txq_id != IWL_CMD_QUEUE_NUM) {944944- sta = txq->cmd[txq->q.write_ptr].cmd.tx.sta_id;945945- sec_ctl = txq->cmd[txq->q.write_ptr].cmd.tx.sec_ctl;927927+ sta = txq->cmd[txq->q.write_ptr]->cmd.tx.sta_id;928928+ sec_ctl = txq->cmd[txq->q.write_ptr]->cmd.tx.sec_ctl;946929947930 switch (sec_ctl & TX_CMD_SEC_MSK) {948931 case TX_CMD_SEC_CCM:···981964 u8 sta = 0;982965983966 if (txq_id != IWL_CMD_QUEUE_NUM)984984- sta = txq->cmd[txq->q.read_ptr].cmd.tx.sta_id;967967+ sta = txq->cmd[txq->q.read_ptr]->cmd.tx.sta_id;985968986969 shared_data->queues_byte_cnt_tbls[txq_id].tfd_offset[txq->q.read_ptr].987970 val = cpu_to_le16(1 | (sta << 12));···1148113111491132static inline u32 iwl5000_get_scd_ssn(struct iwl5000_tx_resp *tx_resp)11501133{11511151- return le32_to_cpup((__le32*)&tx_resp->status +11341134+ return le32_to_cpup((__le32 *)&tx_resp->status +11521135 tx_resp->frame_count) & MAX_SN;11531136}11541137···12451228 bitmap = bitmap << sh;12461229 sh = 0;12471230 }12481248- bitmap |= (1 << sh);12491249- IWL_DEBUG_TX_REPLY("start=%d bitmap=0x%x\n",12501250- start, (u32)(bitmap & 0xFFFFFFFF));12311231+ bitmap |= 1ULL << sh;12321232+ IWL_DEBUG_TX_REPLY("start=%d bitmap=0x%llx\n",12331233+ start, (unsigned long long)bitmap);12511234 }1252123512531236 agg->bitmap = bitmap;···14611444 priv->temperature = le32_to_cpu(priv->statistics.general.temperature);14621445}1463144614471447+/* Calc max signal level (dBm) among 3 possible receivers */14481448+static int iwl5000_calc_rssi(struct iwl_priv *priv,14491449+ struct iwl_rx_phy_res *rx_resp)14501450+{14511451+ /* data from PHY/DSP regarding signal strength, etc.,14521452+ * contents are always there, not configurable by host14531453+ */14541454+ struct iwl5000_non_cfg_phy *ncphy =14551455+ (struct iwl5000_non_cfg_phy *)rx_resp->non_cfg_phy_buf;14561456+ u32 val, rssi_a, rssi_b, rssi_c, max_rssi;14571457+ u8 agc;14581458+14591459+ val = le32_to_cpu(ncphy->non_cfg_phy[IWL50_RX_RES_AGC_IDX]);14601460+ agc = (val & IWL50_OFDM_AGC_MSK) >> IWL50_OFDM_AGC_BIT_POS;14611461+14621462+ /* Find max rssi among 3 possible receivers.14631463+ * These values are measured by the digital signal processor (DSP).14641464+ * They should stay fairly constant even as the signal strength varies,14651465+ * if the radio's automatic gain control (AGC) is working right.14661466+ * AGC value (see below) will provide the "interesting" info.14671467+ */14681468+ val = le32_to_cpu(ncphy->non_cfg_phy[IWL50_RX_RES_RSSI_AB_IDX]);14691469+ rssi_a = (val & IWL50_OFDM_RSSI_A_MSK) >> IWL50_OFDM_RSSI_A_BIT_POS;14701470+ rssi_b = (val & IWL50_OFDM_RSSI_B_MSK) >> IWL50_OFDM_RSSI_B_BIT_POS;14711471+ val = le32_to_cpu(ncphy->non_cfg_phy[IWL50_RX_RES_RSSI_C_IDX]);14721472+ rssi_c = (val & IWL50_OFDM_RSSI_C_MSK) >> IWL50_OFDM_RSSI_C_BIT_POS;14731473+14741474+ max_rssi = max_t(u32, rssi_a, rssi_b);14751475+ max_rssi = max_t(u32, max_rssi, rssi_c);14761476+14771477+ IWL_DEBUG_STATS("Rssi In A %d B %d C %d Max %d AGC dB %d\n",14781478+ rssi_a, rssi_b, rssi_c, max_rssi, agc);14791479+14801480+ /* dBm = max_rssi dB - agc dB - constant.14811481+ * Higher AGC (higher radio gain) means lower signal. */14821482+ return max_rssi - agc - IWL_RSSI_OFFSET;14831483+}14841484+14641485static struct iwl_hcmd_ops iwl5000_hcmd = {14651486 .rxon_assoc = iwl5000_send_rxon_assoc,14661487};···15091454 .gain_computation = iwl5000_gain_computation,15101455 .chain_noise_reset = iwl5000_chain_noise_reset,15111456 .rts_tx_cmd_flag = iwl5000_rts_tx_cmd_flag,14571457+ .calc_rssi = iwl5000_calc_rssi,15121458};1513145915141460static struct iwl_lib_ops iwl5000_lib = {···15301474 .alive_notify = iwl5000_alive_notify,15311475 .send_tx_power = iwl5000_send_tx_power,15321476 .temperature = iwl5000_temperature,14771477+ .update_chain_flags = iwl4965_update_chain_flags,15331478 .apm_ops = {15341479 .init = iwl5000_apm_init,15351480 .reset = iwl5000_apm_reset,
+31-13
drivers/net/wireless/iwlwifi/iwl-commands.h
···666666 __le16 reserved;667667} __attribute__ ((packed));668668669669-670670-669669+#define IWL_CONN_MAX_LISTEN_INTERVAL 10671670672671/*673672 * REPLY_RXON_TIMING = 0x14 (command, has simple generic response)···10751076} __attribute__ ((packed));1076107710771078/* Fixed (non-configurable) rx data from phy */10781078-#define RX_PHY_FLAGS_ANTENNAE_OFFSET (4)10791079-#define RX_PHY_FLAGS_ANTENNAE_MASK (0x70)10801080-#define IWL_AGC_DB_MASK (0x3f80) /* MASK(7,13) */10811081-#define IWL_AGC_DB_POS (7)10791079+10801080+#define IWL49_RX_RES_PHY_CNT 1410811081+#define IWL49_RX_PHY_FLAGS_ANTENNAE_OFFSET (4)10821082+#define IWL49_RX_PHY_FLAGS_ANTENNAE_MASK (0x70)10831083+#define IWL49_AGC_DB_MASK (0x3f80) /* MASK(7,13) */10841084+#define IWL49_AGC_DB_POS (7)10821085struct iwl4965_rx_non_cfg_phy {10831086 __le16 ant_selection; /* ant A bit 4, ant B bit 5, ant C bit 6 */10841087 __le16 agc_info; /* agc code 0:6, agc dB 7:13, reserved 14:15 */···10881087 u8 pad[0];10891088} __attribute__ ((packed));1090108910901090+10911091+#define IWL50_RX_RES_PHY_CNT 810921092+#define IWL50_RX_RES_AGC_IDX 110931093+#define IWL50_RX_RES_RSSI_AB_IDX 210941094+#define IWL50_RX_RES_RSSI_C_IDX 310951095+#define IWL50_OFDM_AGC_MSK 0xfe0010961096+#define IWL50_OFDM_AGC_BIT_POS 910971097+#define IWL50_OFDM_RSSI_A_MSK 0x00ff10981098+#define IWL50_OFDM_RSSI_A_BIT_POS 010991099+#define IWL50_OFDM_RSSI_B_MSK 0xff000011001100+#define IWL50_OFDM_RSSI_B_BIT_POS 1611011101+#define IWL50_OFDM_RSSI_C_MSK 0x00ff11021102+#define IWL50_OFDM_RSSI_C_BIT_POS 011031103+11041104+struct iwl5000_non_cfg_phy {11051105+ __le32 non_cfg_phy[IWL50_RX_RES_PHY_CNT]; /* upto 8 phy entries */11061106+} __attribute__ ((packed));11071107+11081108+10911109/*10921110 * REPLY_RX = 0xc3 (response only, not a command)10931111 * Used only for legacy (non 11n) frames.10941112 */10951095-#define RX_RES_PHY_CNT 1410961096-struct iwl4965_rx_phy_res {11131113+struct iwl_rx_phy_res {10971114 u8 non_cfg_phy_cnt; /* non configurable DSP phy data byte count */10981115 u8 cfg_phy_cnt; /* configurable DSP phy data byte count */10991116 u8 stat_id; /* configurable DSP phy data set ID */···11201101 __le32 beacon_time_stamp; /* beacon at on-air rise */11211102 __le16 phy_flags; /* general phy flags: band, modulation, ... */11221103 __le16 channel; /* channel number */11231123- __le16 non_cfg_phy[RX_RES_PHY_CNT]; /* upto 14 phy entries */11241124- __le32 reserved2;11041104+ u8 non_cfg_phy_buf[32]; /* for various implementations of non_cfg_phy */11251105 __le32 rate_n_flags; /* RATE_MCS_* */11261106 __le16 byte_count; /* frame's byte-count */11271107 __le16 reserved3;···20111993 *****************************************************************************/2012199420131995/**20142014- * struct iwl4965_powertable_cmd - Power Table Command19961996+ * struct iwl_powertable_cmd - Power Table Command20151997 * @flags: See below:20161998 *20171999 * POWER_TABLE_CMD = 0x77 (command, has simple generic response)···20452027#define IWL_POWER_PCI_PM_MSK __constant_cpu_to_le16(1 << 3)20462028#define IWL_POWER_FAST_PD __constant_cpu_to_le16(1 << 4)2047202920482048-struct iwl4965_powertable_cmd {20302030+struct iwl_powertable_cmd {20492031 __le16 flags;20502032 u8 keep_alive_seconds;20512033 u8 debug_flags;···23422324/*23432325 * REPLY_TX_BEACON = 0x91 (command, has simple generic response)23442326 */23452345-struct iwl4965_tx_beacon_cmd {23272327+struct iwl_tx_beacon_cmd {23462328 struct iwl_tx_cmd tx;23472329 __le16 tim_idx;23482330 u8 tim_size;
···228228 * TX cmd queue. Otherwise in case the cmd comes229229 * in later, it will possibly set an invalid230230 * address (cmd->meta.source). */231231- qcmd = &priv->txq[IWL_CMD_QUEUE_NUM].cmd[cmd_idx];231231+ qcmd = priv->txq[IWL_CMD_QUEUE_NUM].cmd[cmd_idx];232232 qcmd->meta.flags &= ~CMD_WANT_SKB;233233 }234234fail:
+41-28
drivers/net/wireless/iwlwifi/iwl-led.c
···161161/* Set led register off */162162static int iwl4965_led_off_reg(struct iwl_priv *priv, int led_id)163163{164164- IWL_DEBUG_LED("radio off\n");164164+ IWL_DEBUG_LED("LED Reg off\n");165165 iwl_write32(priv, CSR_LED_REG, CSR_LED_REG_TRUN_OFF);166166+ return 0;167167+}168168+169169+/*170170+ * Set led register in case of disassociation according to rfkill state171171+ */172172+static int iwl_led_associate(struct iwl_priv *priv, int led_id)173173+{174174+ IWL_DEBUG_LED("Associated\n");175175+ priv->allow_blinking = 1;176176+ return iwl4965_led_on_reg(priv, led_id);177177+}178178+static int iwl_led_disassociate(struct iwl_priv *priv, int led_id)179179+{180180+ priv->allow_blinking = 0;181181+ if (iwl_is_rfkill(priv))182182+ iwl4965_led_off_reg(priv, led_id);183183+ else184184+ iwl4965_led_on_reg(priv, led_id);185185+166186 return 0;167187}168188···219199 led_type_str[led->type], brightness);220200 switch (brightness) {221201 case LED_FULL:222222- if (led->type == IWL_LED_TRG_ASSOC)223223- priv->allow_blinking = 1;224224-225202 if (led->led_on)226203 led->led_on(priv, IWL_LED_LINK);227204 break;228205 case LED_OFF:229229- if (led->type == IWL_LED_TRG_ASSOC)230230- priv->allow_blinking = 0;231231-232206 if (led->led_off)233207 led->led_off(priv, IWL_LED_LINK);234208 break;···242228 */243229static int iwl_leds_register_led(struct iwl_priv *priv, struct iwl_led *led,244230 enum led_type type, u8 set_led,245245- const char *name, char *trigger)231231+ char *trigger)246232{247233 struct device *device = wiphy_dev(priv->hw->wiphy);248234 int ret;249235250250- led->led_dev.name = name;236236+ led->led_dev.name = led->name;251237 led->led_dev.brightness_set = iwl_led_brightness_set;252238 led->led_dev.default_trigger = trigger;253239···298284 return i;299285}300286301301-static inline int is_rf_kill(struct iwl_priv *priv)302302-{303303- return test_bit(STATUS_RF_KILL_HW, &priv->status) ||304304- test_bit(STATUS_RF_KILL_SW, &priv->status);305305-}306306-307287/*308288 * this function called from handler. Since setting Led command can309289 * happen very frequent we postpone led command to be called from···311303 priv->last_blink_time = 0;312304 return;313305 }314314- if (is_rf_kill(priv)) {306306+ if (iwl_is_rfkill(priv)) {315307 priv->last_blink_time = 0;316308 return;317309 }···345337int iwl_leds_register(struct iwl_priv *priv)346338{347339 char *trigger;348348- char name[32];349340 int ret;350341351342 priv->last_blink_rate = 0;···353346 priv->allow_blinking = 0;354347355348 trigger = ieee80211_get_radio_led_name(priv->hw);356356- snprintf(name, sizeof(name), "iwl-%s:radio",349349+ snprintf(priv->led[IWL_LED_TRG_RADIO].name,350350+ sizeof(priv->led[IWL_LED_TRG_RADIO].name), "iwl-%s:radio",357351 wiphy_name(priv->hw->wiphy));358352359353 priv->led[IWL_LED_TRG_RADIO].led_on = iwl4965_led_on_reg;···362354 priv->led[IWL_LED_TRG_RADIO].led_pattern = NULL;363355364356 ret = iwl_leds_register_led(priv, &priv->led[IWL_LED_TRG_RADIO],365365- IWL_LED_TRG_RADIO, 1, name, trigger);357357+ IWL_LED_TRG_RADIO, 1, trigger);366358 if (ret)367359 goto exit_fail;368360369361 trigger = ieee80211_get_assoc_led_name(priv->hw);370370- snprintf(name, sizeof(name), "iwl-%s:assoc",362362+ snprintf(priv->led[IWL_LED_TRG_ASSOC].name,363363+ sizeof(priv->led[IWL_LED_TRG_ASSOC].name), "iwl-%s:assoc",371364 wiphy_name(priv->hw->wiphy));372365373366 ret = iwl_leds_register_led(priv, &priv->led[IWL_LED_TRG_ASSOC],374374- IWL_LED_TRG_ASSOC, 0, name, trigger);367367+ IWL_LED_TRG_ASSOC, 0, trigger);375368376369 /* for assoc always turn led on */377377- priv->led[IWL_LED_TRG_ASSOC].led_on = iwl4965_led_on_reg;378378- priv->led[IWL_LED_TRG_ASSOC].led_off = iwl4965_led_on_reg;370370+ priv->led[IWL_LED_TRG_ASSOC].led_on = iwl_led_associate;371371+ priv->led[IWL_LED_TRG_ASSOC].led_off = iwl_led_disassociate;379372 priv->led[IWL_LED_TRG_ASSOC].led_pattern = NULL;380373381374 if (ret)382375 goto exit_fail;383376384377 trigger = ieee80211_get_rx_led_name(priv->hw);385385- snprintf(name, sizeof(name), "iwl-%s:RX", wiphy_name(priv->hw->wiphy));386386-378378+ snprintf(priv->led[IWL_LED_TRG_RX].name,379379+ sizeof(priv->led[IWL_LED_TRG_RX].name), "iwl-%s:RX",380380+ wiphy_name(priv->hw->wiphy));387381388382 ret = iwl_leds_register_led(priv, &priv->led[IWL_LED_TRG_RX],389389- IWL_LED_TRG_RX, 0, name, trigger);383383+ IWL_LED_TRG_RX, 0, trigger);390384391385 priv->led[IWL_LED_TRG_RX].led_on = iwl_led_associated;392386 priv->led[IWL_LED_TRG_RX].led_off = iwl_led_associated;···398388 goto exit_fail;399389400390 trigger = ieee80211_get_tx_led_name(priv->hw);401401- snprintf(name, sizeof(name), "iwl-%s:TX", wiphy_name(priv->hw->wiphy));391391+ snprintf(priv->led[IWL_LED_TRG_TX].name,392392+ sizeof(priv->led[IWL_LED_TRG_TX].name), "iwl-%s:TX",393393+ wiphy_name(priv->hw->wiphy));394394+402395 ret = iwl_leds_register_led(priv, &priv->led[IWL_LED_TRG_TX],403403- IWL_LED_TRG_TX, 0, name, trigger);396396+ IWL_LED_TRG_TX, 0, trigger);404397405398 priv->led[IWL_LED_TRG_TX].led_on = iwl_led_associated;406399 priv->led[IWL_LED_TRG_TX].led_off = iwl_led_associated;
+1
drivers/net/wireless/iwlwifi/iwl-led.h
···5252struct iwl_led {5353 struct iwl_priv *priv;5454 struct led_classdev led_dev;5555+ char name[32];55565657 int (*led_on) (struct iwl_priv *priv, int led_id);5758 int (*led_off) (struct iwl_priv *priv, int led_id);
+28-17
drivers/net/wireless/iwlwifi/iwl-power.c
···82828383/* default power management (not Tx power) table values */8484/* for tim 0-10 */8585-static struct iwl_power_vec_entry range_0[IWL_POWER_AC] = {8585+static struct iwl_power_vec_entry range_0[IWL_POWER_MAX] = {8686 {{NOSLP, SLP_TOUT(0), SLP_TOUT(0), SLP_VEC(0, 0, 0, 0, 0)}, 0},8787 {{SLP, SLP_TOUT(200), SLP_TOUT(500), SLP_VEC(1, 2, 2, 2, 0xFF)}, 0},8888 {{SLP, SLP_TOUT(200), SLP_TOUT(300), SLP_VEC(1, 2, 2, 2, 0xFF)}, 0},···939394949595/* for tim = 3-10 */9696-static struct iwl_power_vec_entry range_1[IWL_POWER_AC] = {9696+static struct iwl_power_vec_entry range_1[IWL_POWER_MAX] = {9797 {{NOSLP, SLP_TOUT(0), SLP_TOUT(0), SLP_VEC(0, 0, 0, 0, 0)}, 0},9898 {{SLP, SLP_TOUT(200), SLP_TOUT(500), SLP_VEC(1, 2, 3, 4, 4)}, 0},9999 {{SLP, SLP_TOUT(200), SLP_TOUT(300), SLP_VEC(1, 2, 3, 4, 7)}, 0},···103103};104104105105/* for tim > 11 */106106-static struct iwl_power_vec_entry range_2[IWL_POWER_AC] = {106106+static struct iwl_power_vec_entry range_2[IWL_POWER_MAX] = {107107 {{NOSLP, SLP_TOUT(0), SLP_TOUT(0), SLP_VEC(0, 0, 0, 0, 0)}, 0},108108 {{SLP, SLP_TOUT(200), SLP_TOUT(500), SLP_VEC(1, 2, 3, 4, 0xFF)}, 0},109109 {{SLP, SLP_TOUT(200), SLP_TOUT(300), SLP_VEC(2, 4, 6, 7, 0xFF)}, 0},···112112 {{SLP, SLP_TOUT(25), SLP_TOUT(25), SLP_VEC(4, 7, 10, 10, 0xFF)}, 0}113113};114114115115+/* set card power command */116116+static int iwl_set_power(struct iwl_priv *priv, void *cmd)117117+{118118+ return iwl_send_cmd_pdu_async(priv, POWER_TABLE_CMD,119119+ sizeof(struct iwl_powertable_cmd),120120+ cmd, NULL);121121+}115122/* decide the right power level according to association status116123 * and battery status117124 */118125static u16 iwl_get_auto_power_mode(struct iwl_priv *priv)119126{120120- u16 mode = priv->power_data.user_power_setting;127127+ u16 mode;121128122129 switch (priv->power_data.user_power_setting) {123130 case IWL_POWER_AUTO:···136129 else137130 mode = IWL_POWER_ON_AC_DISASSOC;138131 break;132132+ /* FIXME: remove battery and ac from here */139133 case IWL_POWER_BATTERY:140134 mode = IWL_POWER_INDEX_3;141135 break;142136 case IWL_POWER_AC:143137 mode = IWL_POWER_MODE_CAM;138138+ break;139139+ default:140140+ mode = priv->power_data.user_power_setting;144141 break;145142 }146143 return mode;···155144{156145 int ret = 0, i;157146 struct iwl_power_mgr *pow_data;158158- int size = sizeof(struct iwl_power_vec_entry) * IWL_POWER_AC;147147+ int size = sizeof(struct iwl_power_vec_entry) * IWL_POWER_MAX;159148 u16 pci_pm;160149161150 IWL_DEBUG_POWER("Initialize power \n");···173162 if (ret != 0)174163 return 0;175164 else {176176- struct iwl4965_powertable_cmd *cmd;165165+ struct iwl_powertable_cmd *cmd;177166178167 IWL_DEBUG_POWER("adjust power command flags\n");179168180180- for (i = 0; i < IWL_POWER_AC; i++) {169169+ for (i = 0; i < IWL_POWER_MAX; i++) {181170 cmd = &pow_data->pwr_range_0[i].cmd;182171183172 if (pci_pm & 0x1)···191180192181/* adjust power command according to dtim period and power level*/193182static int iwl_update_power_command(struct iwl_priv *priv,194194- struct iwl4965_powertable_cmd *cmd,183183+ struct iwl_powertable_cmd *cmd,195184 u16 mode)196185{197186 int ret = 0, i;···215204 range = &pow_data->pwr_range_2[0];216205217206 period = pow_data->dtim_period;218218- memcpy(cmd, &range[mode].cmd, sizeof(struct iwl4965_powertable_cmd));207207+ memcpy(cmd, &range[mode].cmd, sizeof(struct iwl_powertable_cmd));219208220209 if (period == 0) {221210 period = 1;···269258 * else user level */270259271260 switch (setting->system_power_setting) {272272- case IWL_POWER_AUTO:261261+ case IWL_POWER_SYS_AUTO:273262 final_mode = iwl_get_auto_power_mode(priv);274263 break;275275- case IWL_POWER_BATTERY:264264+ case IWL_POWER_SYS_BATTERY:276265 final_mode = IWL_POWER_INDEX_3;277266 break;278278- case IWL_POWER_AC:267267+ case IWL_POWER_SYS_AC:279268 final_mode = IWL_POWER_MODE_CAM;280269 break;281270 default:282282- final_mode = setting->system_power_setting;271271+ final_mode = IWL_POWER_INDEX_3;272272+ WARN_ON(1);283273 }284274285275 if (setting->critical_power_setting > final_mode)···292280293281 if (!iwl_is_rfkill(priv) && !setting->power_disabled &&294282 ((setting->power_mode != final_mode) || refresh)) {295295- struct iwl4965_powertable_cmd cmd;283283+ struct iwl_powertable_cmd cmd;296284297285 if (final_mode != IWL_POWER_MODE_CAM)298286 set_bit(STATUS_POWER_PMI, &priv->status);···303291 if (final_mode == IWL_POWER_INDEX_5)304292 cmd.flags |= IWL_POWER_FAST_PD;305293306306- if (priv->cfg->ops->lib->set_power)307307- ret = priv->cfg->ops->lib->set_power(priv, &cmd);294294+ ret = iwl_set_power(priv, &cmd);308295309296 if (final_mode == IWL_POWER_MODE_CAM)310297 clear_bit(STATUS_POWER_PMI, &priv->status);···399388 iwl_power_init_handle(priv);400389 priv->power_data.user_power_setting = IWL_POWER_AUTO;401390 priv->power_data.power_disabled = 0;402402- priv->power_data.system_power_setting = IWL_POWER_AUTO;391391+ priv->power_data.system_power_setting = IWL_POWER_SYS_AUTO;403392 priv->power_data.is_battery_active = 0;404393 priv->power_data.power_disabled = 0;405394 priv->power_data.critical_power_setting = 0;
···823823 if (lq->sta_id == 0xFF)824824 lq->sta_id = IWL_AP_ID;825825826826- iwl_dump_lq_cmd(priv,lq);826826+ iwl_dump_lq_cmd(priv, lq);827827828828 if (iwl_is_associated(priv) && priv->assoc_station_added)829829 return iwl_send_cmd(priv, &cmd);···839839 * for automatic fallback during transmission.840840 *841841 * NOTE: This sets up a default set of values. These will be replaced later842842- * if the driver's iwl-4965-rs rate scaling algorithm is used, instead of842842+ * if the driver's iwl-agn-rs rate scaling algorithm is used, instead of843843 * rc80211_simple.844844 *845845 * NOTE: Run REPLY_ADD_STA command to set up station table entry, before
+55-23
drivers/net/wireless/iwlwifi/iwl-tx.c
···208208 * Free all buffers.209209 * 0-fill, but do not free "txq" descriptor structure.210210 */211211-static void iwl_tx_queue_free(struct iwl_priv *priv, struct iwl_tx_queue *txq)211211+static void iwl_tx_queue_free(struct iwl_priv *priv, int txq_id)212212{213213+ struct iwl_tx_queue *txq = &priv->txq[txq_id];213214 struct iwl_queue *q = &txq->q;214215 struct pci_dev *dev = priv->pci_dev;215215- int len;216216+ int i, slots_num, len;216217217218 if (q->n_bd == 0)218219 return;···228227 len += IWL_MAX_SCAN_SIZE;229228230229 /* De-alloc array of command/tx buffers */231231- pci_free_consistent(dev, len, txq->cmd, txq->dma_addr_cmd);230230+ slots_num = (txq_id == IWL_CMD_QUEUE_NUM) ?231231+ TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS;232232+ for (i = 0; i < slots_num; i++)233233+ kfree(txq->cmd[i]);234234+ if (txq_id == IWL_CMD_QUEUE_NUM)235235+ kfree(txq->cmd[slots_num]);232236233237 /* De-alloc circular buffer of TFDs */234238 if (txq->q.n_bd)···406400 struct iwl_tx_queue *txq,407401 int slots_num, u32 txq_id)408402{409409- struct pci_dev *dev = priv->pci_dev;410410- int len;403403+ int i, len;411404 int rc = 0;412405413406 /*···417412 * For normal Tx queues (all other queues), no super-size command418413 * space is needed.419414 */420420- len = sizeof(struct iwl_cmd) * slots_num;421421- if (txq_id == IWL_CMD_QUEUE_NUM)422422- len += IWL_MAX_SCAN_SIZE;423423- txq->cmd = pci_alloc_consistent(dev, len, &txq->dma_addr_cmd);424424- if (!txq->cmd)425425- return -ENOMEM;415415+ len = sizeof(struct iwl_cmd);416416+ for (i = 0; i <= slots_num; i++) {417417+ if (i == slots_num) {418418+ if (txq_id == IWL_CMD_QUEUE_NUM)419419+ len += IWL_MAX_SCAN_SIZE;420420+ else421421+ continue;422422+ }423423+424424+ txq->cmd[i] = kmalloc(len, GFP_KERNEL | GFP_DMA);425425+ if (!txq->cmd[i])426426+ return -ENOMEM;427427+ }426428427429 /* Alloc driver data array and TFD circular buffer */428430 rc = iwl_tx_queue_alloc(priv, txq, txq_id);429431 if (rc) {430430- pci_free_consistent(dev, len, txq->cmd, txq->dma_addr_cmd);432432+ for (i = 0; i < slots_num; i++)433433+ kfree(txq->cmd[i]);431434432435 return -ENOMEM;433436 }···464451465452 /* Tx queues */466453 for (txq_id = 0; txq_id < priv->hw_params.max_txq_num; txq_id++)467467- iwl_tx_queue_free(priv, &priv->txq[txq_id]);454454+ iwl_tx_queue_free(priv, txq_id);468455469456 /* Keep-warm buffer */470457 iwl_kw_free(priv);···872859 txq->txb[q->write_ptr].skb[0] = skb;873860874861 /* Set up first empty entry in queue's array of Tx/cmd buffers */875875- out_cmd = &txq->cmd[idx];862862+ out_cmd = txq->cmd[idx];876863 tx_cmd = &out_cmd->cmd.tx;877864 memset(&out_cmd->hdr, 0, sizeof(out_cmd->hdr));878865 memset(tx_cmd, 0, sizeof(struct iwl_tx_cmd));···912899913900 /* Physical address of this Tx command's header (not MAC header!),914901 * within command buffer array. */915915- txcmd_phys = txq->dma_addr_cmd + sizeof(struct iwl_cmd) * idx +916916- offsetof(struct iwl_cmd, hdr);902902+ txcmd_phys = pci_map_single(priv->pci_dev, out_cmd,903903+ sizeof(struct iwl_cmd), PCI_DMA_TODEVICE);904904+ txcmd_phys += offsetof(struct iwl_cmd, hdr);917905918906 /* Add buffer containing Tx command and MAC(!) header to TFD's919907 * first entry */···10181004 u32 idx;10191005 u16 fix_size;10201006 dma_addr_t phys_addr;10211021- int ret;10071007+ int len, ret;10221008 unsigned long flags;1023100910241010 cmd->len = priv->cfg->ops->utils->get_hcmd_size(cmd->id, cmd->len);···10481034 control_flags = (u32 *) tfd;1049103510501036 idx = get_cmd_index(q, q->write_ptr, cmd->meta.flags & CMD_SIZE_HUGE);10511051- out_cmd = &txq->cmd[idx];10371037+ out_cmd = txq->cmd[idx];1052103810531039 out_cmd->hdr.cmd = cmd->id;10541040 memcpy(&out_cmd->meta, &cmd->meta, sizeof(cmd->meta));···10621048 INDEX_TO_SEQ(q->write_ptr));10631049 if (out_cmd->meta.flags & CMD_SIZE_HUGE)10641050 out_cmd->hdr.sequence |= cpu_to_le16(SEQ_HUGE_FRAME);10651065-10661066- phys_addr = txq->dma_addr_cmd + sizeof(txq->cmd[0]) * idx +10671067- offsetof(struct iwl_cmd, hdr);10511051+ len = (idx == TFD_CMD_SLOTS) ?10521052+ IWL_MAX_SCAN_SIZE : sizeof(struct iwl_cmd);10531053+ phys_addr = pci_map_single(priv->pci_dev, out_cmd, len,10541054+ PCI_DMA_TODEVICE);10551055+ phys_addr += offsetof(struct iwl_cmd, hdr);10681056 iwl_hw_txq_attach_buf_to_tfd(priv, tfd, phys_addr, fix_size);1069105710701058 IWL_DEBUG_HC("Sending command %s (#%x), seq: 0x%04X, "···11311115{11321116 struct iwl_tx_queue *txq = &priv->txq[txq_id];11331117 struct iwl_queue *q = &txq->q;11181118+ struct iwl_tfd_frame *bd = &txq->bd[index];11191119+ dma_addr_t dma_addr;11201120+ int is_odd, buf_len;11341121 int nfreed = 0;1135112211361123 if ((index >= q->n_bd) || (iwl_queue_used(q, index) == 0)) {···11511132 q->write_ptr, q->read_ptr);11521133 queue_work(priv->workqueue, &priv->restart);11531134 }11351135+ is_odd = (index/2) & 0x1;11361136+ if (is_odd) {11371137+ dma_addr = IWL_GET_BITS(bd->pa[index], tb2_addr_lo16) |11381138+ (IWL_GET_BITS(bd->pa[index],11391139+ tb2_addr_hi20) << 16);11401140+ buf_len = IWL_GET_BITS(bd->pa[index], tb2_len);11411141+ } else {11421142+ dma_addr = le32_to_cpu(bd->pa[index].tb1_addr);11431143+ buf_len = IWL_GET_BITS(bd->pa[index], tb1_len);11441144+ }11451145+11461146+ pci_unmap_single(priv->pci_dev, dma_addr, buf_len,11471147+ PCI_DMA_TODEVICE);11541148 nfreed++;11551149 }11561150}···11951163 BUG_ON(txq_id != IWL_CMD_QUEUE_NUM);1196116411971165 cmd_index = get_cmd_index(&priv->txq[IWL_CMD_QUEUE_NUM].q, index, huge);11981198- cmd = &priv->txq[IWL_CMD_QUEUE_NUM].cmd[cmd_index];11661166+ cmd = priv->txq[IWL_CMD_QUEUE_NUM].cmd[cmd_index];1199116712001168 /* Input error checking is done when commands are added to queue. */12011169 if (cmd->meta.flags & CMD_WANT_SKB) {···14231391 /* For each frame attempted in aggregation,14241392 * update driver's record of tx frame's status. */14251393 for (i = 0; i < agg->frame_count ; i++) {14261426- ack = bitmap & (1 << i);13941394+ ack = bitmap & (1ULL << i);14271395 successes += !!ack;14281396 IWL_DEBUG_TX_REPLY("%s ON i=%d idx=%d raw=%d\n",14291397 ack? "ACK":"NACK", i, (agg->start_idx + i) & 0xff,
+22-34
drivers/net/wireless/iwlwifi/iwl3945-base.c
···275275 return 0;276276277277 error:278278- if (txq->txb) {279279- kfree(txq->txb);280280- txq->txb = NULL;281281- }278278+ kfree(txq->txb);279279+ txq->txb = NULL;282280283281 return -ENOMEM;284282}···363365 txq->q.n_bd, txq->bd, txq->q.dma_addr);364366365367 /* De-alloc array of per-TFD driver data */366366- if (txq->txb) {367367- kfree(txq->txb);368368- txq->txb = NULL;369369- }368368+ kfree(txq->txb);369369+ txq->txb = NULL;370370371371 /* 0-fill queue descriptor structure */372372 memset(txq, 0, sizeof(*txq));···2699270327002704 if (!ieee80211_has_morefrags(hdr->frame_control)) {27012705 txq->need_update = 1;27022702- if (qc) {27062706+ if (qc)27032707 priv->stations[sta_id].tid[tid].seq_number = seq_number;27042704- }27052708 } else {27062709 wait_write_ptr = 1;27072710 txq->need_update = 0;···38083813 /* 100:1 or higher, divide by 10 and use table,38093814 * add 20 dB to make up for divide by 10 */38103815 if (sig_ratio >= 100)38113811- return (20 + (int)ratio2dB[sig_ratio/10]);38163816+ return 20 + (int)ratio2dB[sig_ratio/10];3812381738133818 /* We shouldn't see this */38143819 if (sig_ratio < 1)···50835088 * iwl3945_verify_inst_full - verify runtime uCode image in card vs. host,50845089 * looking at all data.50855090 */50865086-static int iwl3945_verify_inst_full(struct iwl3945_priv *priv, __le32 * image, u32 len)50915091+static int iwl3945_verify_inst_full(struct iwl3945_priv *priv, __le32 *image, u32 len)50875092{50885093 u32 val;50895094 u32 save_len = len;···52325237 val = iwl3945_read_prph(priv, BSM_WR_DWCOUNT_REG);52335238 for (reg = BSM_SRAM_LOWER_BOUND;52345239 reg < BSM_SRAM_LOWER_BOUND + len;52355235- reg += sizeof(u32), image ++) {52405240+ reg += sizeof(u32), image++) {52365241 val = iwl3945_read_prph(priv, reg);52375242 if (val != le32_to_cpu(*image)) {52385243 IWL_ERROR("BSM uCode verification failed at "···63316336 DECLARE_MAC_BUF(mac);6332633763336338 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {63346334- IWL_ERROR("%s Should not be called in AP mode\n", __FUNCTION__);63396339+ IWL_ERROR("%s Should not be called in AP mode\n", __func__);63356340 return;63366341 }63376342···6412641764136418 default:64146419 IWL_ERROR("%s Should not be called in %d mode\n",64156415- __FUNCTION__, priv->iw_mode);64206420+ __func__, priv->iw_mode);64166421 break;64176422 }64186423···65886593 struct iwl3945_priv *priv = hw->priv;6589659465906595 IWL_DEBUG_MAC80211("enter\n");65916591-65926592- if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) {65936593- IWL_DEBUG_MAC80211("leave - monitor\n");65946594- dev_kfree_skb_any(skb);65956595- return 0;65966596- }6597659665986597 IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len,65996598 ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate);···74457456 struct iwl3945_priv *priv = dev_get_drvdata(d);74467457 struct iwl3945_spectrum_notification measure_report;74477458 u32 size = sizeof(measure_report), len = 0, ofs = 0;74487448- u8 *data = (u8 *) & measure_report;74597459+ u8 *data = (u8 *)&measure_report;74497460 unsigned long flags;7450746174517462 spin_lock_irqsave(&priv->lock, flags);···76167627 else76177628 p += sprintf(p, " \n");7618762976197619- return (p - buf + 1);76307630+ return p - buf + 1;7620763176217632}76227633···76387649 struct iwl3945_priv *priv = dev_get_drvdata(d);76397650 u32 size = sizeof(struct iwl3945_notif_statistics);76407651 u32 len = 0, ofs = 0;76417641- u8 *data = (u8 *) & priv->statistics;76527652+ u8 *data = (u8 *)&priv->statistics;76427653 int rc = 0;7643765476447655 if (!iwl3945_is_alive(priv))···7992800379938004 /* nic init */79948005 iwl3945_set_bit(priv, CSR_GIO_CHICKEN_BITS,79957995- CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER);80068006+ CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER);7996800779977997- iwl3945_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);79987998- err = iwl3945_poll_bit(priv, CSR_GP_CNTRL,79997999- CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,80008000- CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);80018001- if (err < 0) {80028002- IWL_DEBUG_INFO("Failed to init the card\n");80088008+ iwl3945_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);80098009+ err = iwl3945_poll_bit(priv, CSR_GP_CNTRL,80108010+ CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,80118011+ CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);80128012+ if (err < 0) {80138013+ IWL_DEBUG_INFO("Failed to init the card\n");80038014 goto out_remove_sysfs;80048004- }80158015+ }80058016 /* Read the EEPROM */80068017 err = iwl3945_eeprom_init(priv);80078018 if (err) {···81038114 iwl3945_unset_hw_setting(priv);81048115 iwl3945_clear_stations_table(priv);8105811681068106- if (priv->mac80211_registered) {81178117+ if (priv->mac80211_registered)81078118 ieee80211_unregister_hw(priv->hw);81088108- }8109811981108120 /*netif_stop_queue(dev); */81118121 flush_workqueue(priv->workqueue);
···633633 rt2x00dev->link.vgc_level = value;634634}635635636636+/*637637+ * NOTE: This function is directly ported from legacy driver, but638638+ * despite it being declared it was never called. Although link tuning639639+ * sounds like a good idea, and usually works well for the other drivers,640640+ * it does _not_ work with rt2500usb. Enabling this function will result641641+ * in TX capabilities only until association kicks in. Immediately642642+ * after the successful association all TX frames will be kept in the643643+ * hardware queue and never transmitted.644644+ */645645+#if 0636646static void rt2500usb_link_tuner(struct rt2x00_dev *rt2x00dev)637647{638648 int rssi = rt2x00_get_link_rssi(&rt2x00dev->link);···762752 rt2x00dev->link.vgc_level = r17;763753 }764754}755755+#else756756+#define rt2500usb_link_tuner NULL757757+#endif765758766759/*767760 * Initialization functions.···17501737 __set_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags);17511738 __set_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags);17521739 __set_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags);17401740+ __set_bit(CONFIG_DISABLE_LINK_TUNING, &rt2x00dev->flags);1753174117541742 /*17551743 * Set the rssi offset.
···177177 * @aid: association ID number, valid only when @assoc is true178178 * @use_cts_prot: use CTS protection179179 * @use_short_preamble: use 802.11b short preamble180180+ * @dtim_period: num of beacons before the next DTIM, for PSM180181 * @timestamp: beacon timestamp181182 * @beacon_int: beacon interval182182- * @assoc_capability: capabbilities taken from assoc resp183183+ * @assoc_capability: capabilities taken from assoc resp183184 * @assoc_ht: association in HT mode184185 * @ht_conf: ht capabilities185186 * @ht_bss_conf: ht extended capabilities···192191 /* erp related data */193192 bool use_cts_prot;194193 bool use_short_preamble;194194+ u8 dtim_period;195195 u16 beacon_int;196196 u16 assoc_capability;197197 u64 timestamp;···432430 * @radio_enabled: when zero, driver is required to switch off the radio.433431 * TODO make a flag434432 * @beacon_int: beacon interval (TODO make interface config)433433+ * @listen_interval: listen interval in units of beacon interval435434 * @flags: configuration flags defined above436435 * @power_level: requested transmit power (in dBm)437436 * @max_antenna_gain: maximum antenna gain (in dBi)···447444 int radio_enabled;448445449446 int beacon_int;447447+ u16 listen_interval;450448 u32 flags;451449 int power_level;452450 int max_antenna_gain;···789785 * @max_signal: Maximum value for signal (rssi) in RX information, used790786 * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB791787 *788788+ * @max_listen_interval: max listen interval in units of beacon interval789789+ * that HW supports790790+ *792791 * @queues: number of available hardware transmit queues for793792 * data packets. WMM/QoS requires at least four, these794793 * queues need to have configurable access parameters.···819812 unsigned int extra_tx_headroom;820813 int channel_change_time;821814 int vif_data_size;822822- u16 queues, ampdu_queues;815815+ u16 queues;816816+ u16 ampdu_queues;817817+ u16 max_listen_interval;823818 s8 max_signal;824819};825820
+1
net/mac80211/ieee80211_i.h
···82828383 u8 bssid[ETH_ALEN];8484 u8 ssid[IEEE80211_MAX_SSID_LEN];8585+ u8 dtim_period;8586 u16 capability; /* host byte order */8687 enum ieee80211_band band;8788 int freq;