Lines Matching +full:vif +full:- +full:supply
1 /* SPDX-License-Identifier: GPL-2.0-only */
4 * Copyright(c) 2003 - 2011 Intel Corporation. All rights reserved.
8 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
31 #define IL_ERR(f, a...) dev_err(&il->pci_dev->dev, f, ## a)
32 #define IL_WARN(f, a...) dev_warn(&il->pci_dev->dev, f, ## a)
33 #define IL_WARN_ONCE(f, a...) dev_warn_once(&il->pci_dev->dev, f, ## a)
34 #define IL_INFO(f, a...) dev_info(&il->pci_dev->dev, f, ## a)
46 #define U32_PAD(n) ((4-(n))&0x3)
48 /* CT-KILL constants */
56 * Use default noise value of -127 ... this is below the range of measurable
58 * Also, -127 works better than 0 when averaging frames with/without
62 #define IL_NOISE_MEAS_NOT_AVAILABLE (-127)
87 #define rxb_addr(r) page_address(r->page)
97 * (which is somewhat stupid -- look at common.c for instance
120 int write_ptr; /* 1-st empty entry (idx) host_w */
133 * struct il_tx_queue - Tx Queue for DMA
139 * @skbs: array of per-TFD socket buffer pointers
142 * @sched_retry: indicates queue is high-throughput aggregation (HT AGG) enabled
169 * Driver reads 16-bit value from bits 31-16 of CSR_EEPROM_REG.
249 * This refers to the "well-known" gain tables (see 4965.h).
251 * 3) Actual measured output power, in half-dBm ("34" = 17 dBm).
258 u8 actual_pow; /* Measured RF output power, half-dBm */
297 * 1) Factory-measured saturation power levels (maximum levels at which
302 * 2) Factory-measured power supply voltage level. This is assumed to be
306 * 3) Up to 8 sets of factory-measured txpower calibration values.
315 u8 saturation_power24; /* half-dBm (e.g. "34" = 17 dBm) */
316 u8 saturation_power52; /* half-dBm */
334 #define EEPROM_RF_CFG_TYPE_MSK(x) (x & 0x3) /* bits 0-1 */
335 #define EEPROM_RF_CFG_STEP_MSK(x) ((x >> 2) & 0x3) /* bits 2-3 */
336 #define EEPROM_RF_CFG_DASH_MSK(x) ((x >> 4) & 0x3) /* bits 4-5 */
337 #define EEPROM_RF_CFG_PNUM_MSK(x) ((x >> 6) & 0x3) /* bits 6-7 */
338 #define EEPROM_RF_CFG_TX_ANT_MSK(x) ((x >> 8) & 0xF) /* bits 8-11 */
339 #define EEPROM_RF_CFG_RX_ANT_MSK(x) ((x >> 12) & 0xF) /* bits 12-15 */
345 * Per-channel regulatory data.
363 * (4915-5080MHz) (none of these is ever supported)
370 * (5170-5320MHz)
377 * (5500-5700MHz)
384 * (5725-5825MHz)
445 * -- regulatory EEPROM limits for this channel
446 * -- hardware capabilities (clip-powers)
447 * -- spectrum management
448 * -- user preference (e.g. iwconfig)
484 u8 group_idx; /* 0-4, maps channel to group1/2/3/4/5 */
485 u8 band_idx; /* 0-4, maps channel to band1/2/3/4/5 */
506 #define IL_TX_FIFO_UNUSED -1
578 * struct il_rx_queue - Rx queue
583 * @free_count: Number of pre-allocated buffers in rx_free
614 #define IL_INVALID_VALUE -1
617 * struct il_ht_agg -- aggregation status while waiting for block-ack
620 * @wait_for_ba: Expect block-ack before next Tx reply
675 * 4 - 2us density
676 * 5 - 4us density
677 * 6 - 8us density
678 * 7 - 16us density
718 * struct il_vif_priv - driver's ilate per-interface information
791 * @max_rxq_size: Max # Rx frames in Rx queue (must be power-of-2)
792 * @max_rxq_log: Log-base-2 of max_rxq_size
824 u32 ct_kill_threshold; /* value in hw-dependent units */
832 * for use by iwl-[4-5].c
837 * Naming convention --
838 * il_ <-- Is part of iwlwifi
839 * iwlXXXX_ <-- Hardware specific (implemented in iwl-XXXX.c for XXXX)
840 * il4965_bg_ <-- Called from work queue context
841 * il4965_mac_ <-- mac80211 callback
850 return q->write_ptr >= q->read_ptr ? (i >= q->read_ptr && in il_queue_used()
851 i < q->write_ptr) : !(i < in il_queue_used()
852 q->read_ptr in il_queue_used()
854 q-> in il_queue_used()
867 return q->n_win; /* must be power of 2 */ in il_get_cmd_idx()
870 return idx & (q->n_win - 1); in il_get_cmd_idx()
887 #define TX_POWER_IL_ILLEGAL_VOLTAGE -10000
1059 * the CSR_INT_COALESCING is an 8 bit register in 32-usec unit
1089 * bits 31:24 - extended
1090 * bits 23:0 - interval
1095 * bits 31:22 - extended
1096 * bits 21:0 - interval
1101 struct ieee80211_vif *vif; member
1174 /* basic pci-network driver stuff */
1206 struct ieee80211_vif *vif; member
1291 /* Indication if ieee80211_ops->open has been called */
1296 /* eeprom -- this is in the card's little endian byte order */
1427 set_bit(txq_id, &il->txq_ctx_active_msk); in il_txq_ctx_activate()
1433 clear_bit(txq_id, &il->txq_ctx_active_msk); in il_txq_ctx_deactivate()
1439 return (il->active.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0; in il_is_associated()
1453 return (ch_info->flags & EEPROM_CHANNEL_VALID) ? 1 : 0; in il_is_channel_valid()
1459 return (ch_info->flags & EEPROM_CHANNEL_RADAR) ? 1 : 0; in il_is_channel_radar()
1465 return ch_info->band == NL80211_BAND_5GHZ; in il_is_channel_a_band()
1471 return (!(ch->flags & EEPROM_CHANNEL_ACTIVE)) ? 1 : 0; in il_is_channel_passive()
1477 return (ch->flags & EEPROM_CHANNEL_IBSS) ? 1 : 0; in il_is_channel_ibss()
1483 __free_pages(page, il->hw_params.rx_page_order); in __il_free_pages()
1484 il->alloc_rxb_page--; in __il_free_pages()
1490 free_pages(page, il->hw_params.rx_page_order); in il_free_pages()
1491 il->alloc_rxb_page--; in il_free_pages()
1494 #define IWLWIFI_VERSION "in-tree:"
1495 #define DRV_COPYRIGHT "Copyright(c) 2003-2011 Intel Corporation"
1567 int (*request_scan) (struct il_priv *il, struct ieee80211_vif *vif);
1574 struct ieee80211_vif *vif, bool add);
1630 * if (IL_UCODE_API(il->ucode_ver) >= 2) {
1685 int il_mac_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1694 struct ieee80211_vif *vif);
1704 int il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
1706 struct ieee80211_vif *vif);
1707 int il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1709 void il_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1772 int il_mac_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1782 struct ieee80211_vif *vif);
1880 return test_bit(S_READY, &il->status) && in il_is_ready()
1881 test_bit(S_GEO_CONFIGURED, &il->status) && in il_is_ready()
1882 !test_bit(S_EXIT_PENDING, &il->status); in il_is_ready()
1888 return test_bit(S_ALIVE, &il->status); in il_is_alive()
1894 return test_bit(S_INIT, &il->status); in il_is_init()
1900 return test_bit(S_RFKILL, &il->status); in il_is_rfkill()
1906 return test_bit(S_CT_KILL, &il->status); in il_is_ctkill()
1931 return il->ops->rxon_assoc(il); in il_send_rxon_assoc()
1937 return il->ops->commit_rxon(il); in il_commit_rxon()
1943 return il->hw->wiphy->bands[band]; in il_get_hw_mode()
1948 void il_mac_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
1949 void il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1969 * to a (driver-originated) command. If the packet (e.g. Rx frame) in il_need_reclaim()
1971 * Ucode should set SEQ_RX_FRAME bit if ucode-originated, but in il_need_reclaim()
1974 return !(pkt->hdr.sequence & SEQ_RX_FRAME) && in il_need_reclaim()
1975 pkt->hdr.cmd != N_STATS && pkt->hdr.cmd != C_TX && in il_need_reclaim()
1976 pkt->hdr.cmd != N_RX_PHY && pkt->hdr.cmd != N_RX && in il_need_reclaim()
1977 pkt->hdr.cmd != N_RX_MPDU && pkt->hdr.cmd != N_COMPRESSED_BA; in il_need_reclaim()
1983 writeb(val, il->hw_base + ofs); in _il_write8()
1990 writel(val, il->hw_base + ofs); in _il_wr()
1996 return readl(il->hw_base + ofs); in _il_rd()
2023 spin_lock_irqsave(&il->reg_lock, reg_flags); in il_rd()
2027 spin_unlock_irqrestore(&il->reg_lock, reg_flags); in il_rd()
2036 spin_lock_irqsave(&il->reg_lock, reg_flags); in il_wr()
2041 spin_unlock_irqrestore(&il->reg_lock, reg_flags); in il_wr()
2063 spin_lock_irqsave(&il->reg_lock, reg_flags); in il_set_bits_prph()
2068 spin_unlock_irqrestore(&il->reg_lock, reg_flags); in il_set_bits_prph()
2076 spin_lock_irqsave(&il->reg_lock, reg_flags); in il_set_bits_mask_prph()
2081 spin_unlock_irqrestore(&il->reg_lock, reg_flags); in il_set_bits_mask_prph()
2090 spin_lock_irqsave(&il->reg_lock, reg_flags); in il_clear_bits_prph()
2096 spin_unlock_irqrestore(&il->reg_lock, reg_flags); in il_clear_bits_prph()
2118 int il_mac_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2128 * il_clear_driver_stations - clear knowledge of all stations from driver
2133 * able to reconfigure stations -- if we're getting there in the
2141 spin_lock_irqsave(&il->sta_lock, flags); in il_clear_driver_stations()
2142 memset(il->stations, 0, sizeof(il->stations)); in il_clear_driver_stations()
2143 il->num_stations = 0; in il_clear_driver_stations()
2144 il->ucode_key_table = 0; in il_clear_driver_stations()
2145 spin_unlock_irqrestore(&il->sta_lock, flags); in il_clear_driver_stations()
2154 return ((struct il_station_priv_common *)sta->drv_priv)->sta_id; in il_sta_id()
2158 * il_sta_id_or_broadcast - return sta_id or broadcast sta
2174 return il->hw_params.bcast_id; in il_sta_id_or_broadcast()
2188 * il_queue_inc_wrap - increment queue idx, wrap back to beginning
2189 * @idx -- current idx
2190 * @n_bd -- total number of entries in queue (must be power of 2)
2195 return ++idx & (n_bd - 1); in il_queue_inc_wrap()
2199 * il_queue_dec_wrap - decrement queue idx, wrap back to end
2200 * @idx -- current idx
2201 * @n_bd -- total number of entries in queue (must be power of 2)
2206 return --idx & (n_bd - 1); in il_queue_dec_wrap()
2209 /* TODO: Move fw_desc functions to iwl-pci.ko */
2213 if (desc->v_addr) in il_free_fw_desc()
2214 dma_free_coherent(&pci_dev->dev, desc->len, desc->v_addr, in il_free_fw_desc()
2215 desc->p_addr); in il_free_fw_desc()
2216 desc->v_addr = NULL; in il_free_fw_desc()
2217 desc->len = 0; in il_free_fw_desc()
2223 if (!desc->len) { in il_alloc_fw_desc()
2224 desc->v_addr = NULL; in il_alloc_fw_desc()
2225 return -EINVAL; in il_alloc_fw_desc()
2228 desc->v_addr = dma_alloc_coherent(&pci_dev->dev, desc->len, in il_alloc_fw_desc()
2229 &desc->p_addr, GFP_KERNEL); in il_alloc_fw_desc()
2230 return (desc->v_addr != NULL) ? 0 : -ENOMEM; in il_alloc_fw_desc()
2238 * | | | | | | +-+-------- AC queue (0-3)
2240 * | +-+-+-+-+------------ HW queue ID
2242 * +---------------------- unused
2250 txq->swq_id = (hwq << 2) | ac; in il_set_swq_id()
2256 if (atomic_dec_return(&il->queue_stop_count[ac]) <= 0) in _il_wake_queue()
2257 ieee80211_wake_queue(il->hw, ac); in _il_wake_queue()
2263 if (atomic_inc_return(&il->queue_stop_count[ac]) > 0) in _il_stop_queue()
2264 ieee80211_stop_queue(il->hw, ac); in _il_stop_queue()
2269 u8 queue = txq->swq_id; in il_wake_queue()
2273 if (test_and_clear_bit(hwq, il->queue_stopped)) in il_wake_queue()
2280 u8 queue = txq->swq_id; in il_stop_queue()
2284 if (!test_and_set_bit(hwq, il->queue_stopped)) in il_stop_queue()
2293 if (test_and_clear_bit(reason, &il->stop_reason)) in il_wake_queues_by_reason()
2303 if (!test_and_set_bit(reason, &il->stop_reason)) in il_stop_queues_by_reason()
2323 clear_bit(S_INT_ENABLED, &il->status); in il_disable_interrupts()
2343 set_bit(S_INT_ENABLED, &il->status); in il_enable_interrupts()
2344 _il_wr(il, CSR_INT_MASK, il->inta_mask); in il_enable_interrupts()
2348 * il_beacon_time_mask_low - mask of lower 32 bit of beacon time
2349 * @il -- pointer to il_priv data structure
2350 * @tsf_bits -- number of bits need to shift for masking)
2355 return (1 << tsf_bits) - 1; in il_beacon_time_mask_low()
2359 * il_beacon_time_mask_high - mask of higher 32 bit of beacon time
2360 * @il -- pointer to il_priv data structure
2361 * @tsf_bits -- number of bits need to shift for masking)
2366 return ((1 << (32 - tsf_bits)) - 1) << tsf_bits; in il_beacon_time_mask_high()
2370 * struct il_rb_status - reseve buffer status host memory mapped FH registers
2372 * @closed_rb_num [0:11] - Indicates the idx of the RB which was closed
2373 * @closed_fr_num [0:11] - Indicates the idx of the RX Frame which was closed
2374 * @finished_rb_num [0:11] - Indicates the idx of the current RB
2376 * @finished_fr_num [0:11] - Indicates the idx of the RX Frame
2406 * @hi_n_len: 0-3 [35:32] portion of dma
2407 * 4-15 length of the tx buffer
2420 * @ num_tbs 0-4 number of active tbs
2422 * 6-7 padding (not used)
2428 * contiguous 256 TFDs x 128 bytes-per-TFD = 32 KBytes
2437 * of (4K - 4). The concatenates all of a TFD's buffers into a single
2496 RATE_COUNT_LEGACY = RATE_COUNT - 1, /* Excluding 60M */
2497 RATE_COUNT_3945 = RATE_COUNT - 1,
2515 RATE_INVM_IDX_TBL = RATE_INVM_IDX - 1,
2559 /* uCode API values for OFDM high-throughput (HT) bit rates */
2624 #define RATES_MASK ((1 << RATE_COUNT) - 1)
2625 #define RATES_MASK_3945 ((1 << RATE_COUNT_3945) - 1)
2627 #define IL_INVALID_VALUE -1
2629 #define IL_MIN_RSSI_VAL -100
2679 /* load per tid defines for A-MPDU activation */
2688 #define TID_MAX_TIME_DIFF ((TID_QUEUE_MAX_SIZE - 1) * TID_QUEUE_CELL_SPACING)
2689 #define TIME_WRAP_AROUND(x, y) (((y) > (x)) ? (y) - (x) : (0-(x)) + (y))
2697 LQ_SISO, /* high-throughput types */
2727 * struct il_rate_scale_data -- tx success history for one rate
2732 s32 success_ratio; /* per-cent * 128 */
2739 * struct il_scale_tbl_info -- tx params and success history for all rates
2769 * struct il_lq_sta -- driver's rate scaling ilate structure
2774 u8 active_tbl; /* idx of active table, range 0-1 */
2789 u8 action_counter; /* # mode-switch actions tried */
2822 * When mac80211 creates a station it reserves some space (hw->sta_data_size)
2854 * il3945_rate_scale_init - Initialize the rate scale table based on assoc info
2868 * il_rate_control_register - Register the rate control algorithm callbacks
2881 * il_rate_control_unregister - Unregister the rate control callbacks
2905 if (il->debug_level) in il_get_debug_level()
2906 return il->debug_level; in il_get_debug_level()
2928 dev_err(&il->hw->wiphy->dev, "%s " fmt, __func__, \
2984 /* 0x0000000F - 0x00000001 */
2989 /* 0x000000F0 - 0x00000010 */
2994 /* 0x00000F00 - 0x00000100 */
2999 /* 0x0000F000 - 0x00001000 */
3004 /* 0x000F0000 - 0x00010000 */
3009 /* 0x00F00000 - 0x00100000 */
3014 /* 0x0F000000 - 0x01000000 */
3018 /* 0xF0000000 - 0x10000000 */