Lines Matching +full:differential +full:- +full:pair

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.
188 * HT40 channel pair.
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
975 /* Chain noise (differential Rx gain) calib data */
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
1174 /* basic pci-network driver stuff */
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"
1630 * if (IL_UCODE_API(il->ucode_ver) >= 2) {
1881 return test_bit(S_READY, &il->status) && in il_is_ready()
1882 test_bit(S_GEO_CONFIGURED, &il->status) && in il_is_ready()
1883 !test_bit(S_EXIT_PENDING, &il->status); in il_is_ready()
1889 return test_bit(S_ALIVE, &il->status); in il_is_alive()
1895 return test_bit(S_INIT, &il->status); in il_is_init()
1901 return test_bit(S_RFKILL, &il->status); in il_is_rfkill()
1907 return test_bit(S_CT_KILL, &il->status); in il_is_ctkill()
1932 return il->ops->rxon_assoc(il); in il_send_rxon_assoc()
1938 return il->ops->commit_rxon(il); in il_commit_rxon()
1944 return il->hw->wiphy->bands[band]; in il_get_hw_mode()
1970 * to a (driver-originated) command. If the packet (e.g. Rx frame) in il_need_reclaim()
1972 * Ucode should set SEQ_RX_FRAME bit if ucode-originated, but in il_need_reclaim()
1975 return !(pkt->hdr.sequence & SEQ_RX_FRAME) && in il_need_reclaim()
1976 pkt->hdr.cmd != N_STATS && pkt->hdr.cmd != C_TX && in il_need_reclaim()
1977 pkt->hdr.cmd != N_RX_PHY && pkt->hdr.cmd != N_RX && in il_need_reclaim()
1978 pkt->hdr.cmd != N_RX_MPDU && pkt->hdr.cmd != N_COMPRESSED_BA; in il_need_reclaim()
1984 writeb(val, il->hw_base + ofs); in _il_write8()
1991 writel(val, il->hw_base + ofs); in _il_wr()
1997 return readl(il->hw_base + ofs); in _il_rd()
2024 spin_lock_irqsave(&il->reg_lock, reg_flags); in il_rd()
2028 spin_unlock_irqrestore(&il->reg_lock, reg_flags); in il_rd()
2037 spin_lock_irqsave(&il->reg_lock, reg_flags); in il_wr()
2042 spin_unlock_irqrestore(&il->reg_lock, reg_flags); in il_wr()
2064 spin_lock_irqsave(&il->reg_lock, reg_flags); in il_set_bits_prph()
2069 spin_unlock_irqrestore(&il->reg_lock, reg_flags); in il_set_bits_prph()
2077 spin_lock_irqsave(&il->reg_lock, reg_flags); in il_set_bits_mask_prph()
2082 spin_unlock_irqrestore(&il->reg_lock, reg_flags); in il_set_bits_mask_prph()
2091 spin_lock_irqsave(&il->reg_lock, reg_flags); in il_clear_bits_prph()
2097 spin_unlock_irqrestore(&il->reg_lock, reg_flags); in il_clear_bits_prph()
2129 * il_clear_driver_stations - clear knowledge of all stations from driver
2134 * able to reconfigure stations -- if we're getting there in the
2142 spin_lock_irqsave(&il->sta_lock, flags); in il_clear_driver_stations()
2143 memset(il->stations, 0, sizeof(il->stations)); in il_clear_driver_stations()
2144 il->num_stations = 0; in il_clear_driver_stations()
2145 il->ucode_key_table = 0; in il_clear_driver_stations()
2146 spin_unlock_irqrestore(&il->sta_lock, flags); in il_clear_driver_stations()
2155 return ((struct il_station_priv_common *)sta->drv_priv)->sta_id; in il_sta_id()
2159 * il_sta_id_or_broadcast - return sta_id or broadcast sta
2175 return il->hw_params.bcast_id; in il_sta_id_or_broadcast()
2189 * il_queue_inc_wrap - increment queue idx, wrap back to beginning
2190 * @idx -- current idx
2191 * @n_bd -- total number of entries in queue (must be power of 2)
2196 return ++idx & (n_bd - 1); in il_queue_inc_wrap()
2200 * il_queue_dec_wrap - decrement queue idx, wrap back to end
2201 * @idx -- current idx
2202 * @n_bd -- total number of entries in queue (must be power of 2)
2207 return --idx & (n_bd - 1); in il_queue_dec_wrap()
2210 /* TODO: Move fw_desc functions to iwl-pci.ko */
2214 if (desc->v_addr) in il_free_fw_desc()
2215 dma_free_coherent(&pci_dev->dev, desc->len, desc->v_addr, in il_free_fw_desc()
2216 desc->p_addr); in il_free_fw_desc()
2217 desc->v_addr = NULL; in il_free_fw_desc()
2218 desc->len = 0; in il_free_fw_desc()
2224 if (!desc->len) { in il_alloc_fw_desc()
2225 desc->v_addr = NULL; in il_alloc_fw_desc()
2226 return -EINVAL; in il_alloc_fw_desc()
2229 desc->v_addr = dma_alloc_coherent(&pci_dev->dev, desc->len, in il_alloc_fw_desc()
2230 &desc->p_addr, GFP_KERNEL); in il_alloc_fw_desc()
2231 return (desc->v_addr != NULL) ? 0 : -ENOMEM; in il_alloc_fw_desc()
2239 * | | | | | | +-+-------- AC queue (0-3)
2241 * | +-+-+-+-+------------ HW queue ID
2243 * +---------------------- unused
2251 txq->swq_id = (hwq << 2) | ac; in il_set_swq_id()
2257 if (atomic_dec_return(&il->queue_stop_count[ac]) <= 0) in _il_wake_queue()
2258 ieee80211_wake_queue(il->hw, ac); in _il_wake_queue()
2264 if (atomic_inc_return(&il->queue_stop_count[ac]) > 0) in _il_stop_queue()
2265 ieee80211_stop_queue(il->hw, ac); in _il_stop_queue()
2270 u8 queue = txq->swq_id; in il_wake_queue()
2274 if (test_and_clear_bit(hwq, il->queue_stopped)) in il_wake_queue()
2281 u8 queue = txq->swq_id; in il_stop_queue()
2285 if (!test_and_set_bit(hwq, il->queue_stopped)) in il_stop_queue()
2294 if (test_and_clear_bit(reason, &il->stop_reason)) in il_wake_queues_by_reason()
2304 if (!test_and_set_bit(reason, &il->stop_reason)) in il_stop_queues_by_reason()
2324 clear_bit(S_INT_ENABLED, &il->status); in il_disable_interrupts()
2344 set_bit(S_INT_ENABLED, &il->status); in il_enable_interrupts()
2345 _il_wr(il, CSR_INT_MASK, il->inta_mask); in il_enable_interrupts()
2349 * il_beacon_time_mask_low - mask of lower 32 bit of beacon time
2350 * @il -- pointer to il_priv data structure
2351 * @tsf_bits -- number of bits need to shift for masking)
2356 return (1 << tsf_bits) - 1; in il_beacon_time_mask_low()
2360 * il_beacon_time_mask_high - mask of higher 32 bit of beacon time
2361 * @il -- pointer to il_priv data structure
2362 * @tsf_bits -- number of bits need to shift for masking)
2367 return ((1 << (32 - tsf_bits)) - 1) << tsf_bits; in il_beacon_time_mask_high()
2371 * struct il_rb_status - reseve buffer status host memory mapped FH registers
2373 * @closed_rb_num [0:11] - Indicates the idx of the RB which was closed
2374 * @closed_fr_num [0:11] - Indicates the idx of the RX Frame which was closed
2375 * @finished_rb_num [0:11] - Indicates the idx of the current RB
2377 * @finished_fr_num [0:11] - Indicates the idx of the RX Frame
2407 * @hi_n_len: 0-3 [35:32] portion of dma
2408 * 4-15 length of the tx buffer
2421 * @ num_tbs 0-4 number of active tbs
2423 * 6-7 padding (not used)
2429 * contiguous 256 TFDs x 128 bytes-per-TFD = 32 KBytes
2438 * of (4K - 4). The concatenates all of a TFD's buffers into a single
2497 RATE_COUNT_LEGACY = RATE_COUNT - 1, /* Excluding 60M */
2498 RATE_COUNT_3945 = RATE_COUNT - 1,
2516 RATE_INVM_IDX_TBL = RATE_INVM_IDX - 1,
2560 /* uCode API values for OFDM high-throughput (HT) bit rates */
2625 #define RATES_MASK ((1 << RATE_COUNT) - 1)
2626 #define RATES_MASK_3945 ((1 << RATE_COUNT_3945) - 1)
2628 #define IL_INVALID_VALUE -1
2630 #define IL_MIN_RSSI_VAL -100
2680 /* load per tid defines for A-MPDU activation */
2689 #define TID_MAX_TIME_DIFF ((TID_QUEUE_MAX_SIZE - 1) * TID_QUEUE_CELL_SPACING)
2690 #define TIME_WRAP_AROUND(x, y) (((y) > (x)) ? (y) - (x) : (0-(x)) + (y))
2698 LQ_SISO, /* high-throughput types */
2728 * struct il_rate_scale_data -- tx success history for one rate
2733 s32 success_ratio; /* per-cent * 128 */
2740 * struct il_scale_tbl_info -- tx params and success history for all rates
2770 * struct il_lq_sta -- driver's rate scaling ilate structure
2775 u8 active_tbl; /* idx of active table, range 0-1 */
2790 u8 action_counter; /* # mode-switch actions tried */
2823 * When mac80211 creates a station it reserves some space (hw->sta_data_size)
2855 * il3945_rate_scale_init - Initialize the rate scale table based on assoc info
2869 * il_rate_control_register - Register the rate control algorithm callbacks
2882 * il_rate_control_unregister - Unregister the rate control callbacks
2906 if (il->debug_level) in il_get_debug_level()
2907 return il->debug_level; in il_get_debug_level()
2929 dev_err(&il->hw->wiphy->dev, "%s " fmt, __func__, \
2985 /* 0x0000000F - 0x00000001 */
2990 /* 0x000000F0 - 0x00000010 */
2995 /* 0x00000F00 - 0x00000100 */
3000 /* 0x0000F000 - 0x00001000 */
3005 /* 0x000F0000 - 0x00010000 */
3010 /* 0x00F00000 - 0x00100000 */
3015 /* 0x0F000000 - 0x01000000 */
3019 /* 0xF0000000 - 0x10000000 */