Lines Matching +full:clip +full:- +full:x +full:- +full:high
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 */
128 int high_mark; /* high watermark, stop queue if free
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 */ argument
335 #define EEPROM_RF_CFG_STEP_MSK(x) ((x >> 2) & 0x3) /* bits 2-3 */ argument
336 #define EEPROM_RF_CFG_DASH_MSK(x) ((x >> 4) & 0x3) /* bits 4-5 */ argument
337 #define EEPROM_RF_CFG_PNUM_MSK(x) ((x >> 6) & 0x3) /* bits 6-7 */ argument
338 #define EEPROM_RF_CFG_TX_ANT_MSK(x) ((x >> 8) & 0xF) /* bits 8-11 */ argument
339 #define EEPROM_RF_CFG_RX_ANT_MSK(x) ((x >> 12) & 0xF) /* bits 12-15 */ argument
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
571 u8 payload[IL_MAX_CMD_SIZE - sizeof(struct il_cmd_header)];
590 * struct il_rx_queue - Rx queue
595 * @free_count: Number of pre-allocated buffers in rx_free
626 #define IL_INVALID_VALUE -1
629 * struct il_ht_agg -- aggregation status while waiting for block-ack
632 * @wait_for_ba: Expect block-ack before next Tx reply
635 * @bitmap1: High order, one bit for each frame pending ACK in Tx win
687 * 4 - 2us density
688 * 5 - 4us density
689 * 6 - 8us density
690 * 7 - 16us density
730 * struct il_vif_priv - driver's ilate per-interface information
803 * @max_rxq_size: Max # Rx frames in Rx queue (must be power-of-2)
804 * @max_rxq_log: Log-base-2 of max_rxq_size
836 u32 ct_kill_threshold; /* value in hw-dependent units */
844 * for use by iwl-[4-5].c
849 * Naming convention --
850 * il_ <-- Is part of iwlwifi
851 * iwlXXXX_ <-- Hardware specific (implemented in iwl-XXXX.c for XXXX)
852 * il4965_bg_ <-- Called from work queue context
853 * il4965_mac_ <-- mac80211 callback
862 return q->write_ptr >= q->read_ptr ? (i >= q->read_ptr && in il_queue_used()
863 i < q->write_ptr) : !(i < in il_queue_used()
864 q->read_ptr in il_queue_used()
866 q-> in il_queue_used()
879 return q->n_win; /* must be power of 2 */ in il_get_cmd_idx()
882 return idx & (q->n_win - 1); in il_get_cmd_idx()
899 #define TX_POWER_IL_ILLEGAL_VOLTAGE -10000
1071 * the CSR_INT_COALESCING is an 8 bit register in 32-usec unit
1073 * default interrupt coalescing timer is 64 x 32 = 2048 usecs
1074 * default interrupt coalescing calibration timer is 16 x 32 = 512 usecs
1101 * bits 31:24 - extended
1102 * bits 23:0 - interval
1107 * bits 31:22 - extended
1108 * bits 21:0 - interval
1186 /* basic pci-network driver stuff */
1303 /* Indication if ieee80211_ops->open has been called */
1308 /* eeprom -- this is in the card's little endian byte order */
1342 * EEPROM has a derived clip setting for
1439 set_bit(txq_id, &il->txq_ctx_active_msk); in il_txq_ctx_activate()
1445 clear_bit(txq_id, &il->txq_ctx_active_msk); in il_txq_ctx_deactivate()
1451 return (il->active.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0; in il_is_associated()
1465 return (ch_info->flags & EEPROM_CHANNEL_VALID) ? 1 : 0; in il_is_channel_valid()
1471 return (ch_info->flags & EEPROM_CHANNEL_RADAR) ? 1 : 0; in il_is_channel_radar()
1477 return ch_info->band == NL80211_BAND_5GHZ; in il_is_channel_a_band()
1483 return (!(ch->flags & EEPROM_CHANNEL_ACTIVE)) ? 1 : 0; in il_is_channel_passive()
1489 return (ch->flags & EEPROM_CHANNEL_IBSS) ? 1 : 0; in il_is_channel_ibss()
1495 __free_pages(page, il->hw_params.rx_page_order); in __il_free_pages()
1496 il->alloc_rxb_page--; in __il_free_pages()
1502 free_pages(page, il->hw_params.rx_page_order); in il_free_pages()
1503 il->alloc_rxb_page--; in il_free_pages()
1506 #define IWLWIFI_VERSION "in-tree:"
1507 #define DRV_COPYRIGHT "Copyright(c) 2003-2011 Intel Corporation"
1521 #define IL_CMD(x) case x: return #x argument
1642 * if (IL_UCODE_API(il->ucode_ver) >= 2) {
1893 return test_bit(S_READY, &il->status) && in il_is_ready()
1894 test_bit(S_GEO_CONFIGURED, &il->status) && in il_is_ready()
1895 !test_bit(S_EXIT_PENDING, &il->status); in il_is_ready()
1901 return test_bit(S_ALIVE, &il->status); in il_is_alive()
1907 return test_bit(S_INIT, &il->status); in il_is_init()
1913 return test_bit(S_RFKILL, &il->status); in il_is_rfkill()
1919 return test_bit(S_CT_KILL, &il->status); in il_is_ctkill()
1944 return il->ops->rxon_assoc(il); in il_send_rxon_assoc()
1950 return il->ops->commit_rxon(il); in il_commit_rxon()
1956 return il->hw->wiphy->bands[band]; in il_get_hw_mode()
1982 * to a (driver-originated) command. If the packet (e.g. Rx frame) in il_need_reclaim()
1984 * Ucode should set SEQ_RX_FRAME bit if ucode-originated, but in il_need_reclaim()
1987 return !(pkt->hdr.sequence & SEQ_RX_FRAME) && in il_need_reclaim()
1988 pkt->hdr.cmd != N_STATS && pkt->hdr.cmd != C_TX && in il_need_reclaim()
1989 pkt->hdr.cmd != N_RX_PHY && pkt->hdr.cmd != N_RX && in il_need_reclaim()
1990 pkt->hdr.cmd != N_RX_MPDU && pkt->hdr.cmd != N_COMPRESSED_BA; in il_need_reclaim()
1996 writeb(val, il->hw_base + ofs); in _il_write8()
2003 writel(val, il->hw_base + ofs); in _il_wr()
2009 return readl(il->hw_base + ofs); in _il_rd()
2036 spin_lock_irqsave(&il->reg_lock, reg_flags); in il_rd()
2040 spin_unlock_irqrestore(&il->reg_lock, reg_flags); in il_rd()
2049 spin_lock_irqsave(&il->reg_lock, reg_flags); in il_wr()
2054 spin_unlock_irqrestore(&il->reg_lock, reg_flags); in il_wr()
2076 spin_lock_irqsave(&il->reg_lock, reg_flags); in il_set_bits_prph()
2081 spin_unlock_irqrestore(&il->reg_lock, reg_flags); in il_set_bits_prph()
2089 spin_lock_irqsave(&il->reg_lock, reg_flags); in il_set_bits_mask_prph()
2094 spin_unlock_irqrestore(&il->reg_lock, reg_flags); in il_set_bits_mask_prph()
2103 spin_lock_irqsave(&il->reg_lock, reg_flags); in il_clear_bits_prph()
2109 spin_unlock_irqrestore(&il->reg_lock, reg_flags); in il_clear_bits_prph()
2141 * il_clear_driver_stations - clear knowledge of all stations from driver
2146 * able to reconfigure stations -- if we're getting there in the
2154 spin_lock_irqsave(&il->sta_lock, flags); in il_clear_driver_stations()
2155 memset(il->stations, 0, sizeof(il->stations)); in il_clear_driver_stations()
2156 il->num_stations = 0; in il_clear_driver_stations()
2157 il->ucode_key_table = 0; in il_clear_driver_stations()
2158 spin_unlock_irqrestore(&il->sta_lock, flags); in il_clear_driver_stations()
2167 return ((struct il_station_priv_common *)sta->drv_priv)->sta_id; in il_sta_id()
2171 * il_sta_id_or_broadcast - return sta_id or broadcast sta
2187 return il->hw_params.bcast_id; in il_sta_id_or_broadcast()
2201 * il_queue_inc_wrap - increment queue idx, wrap back to beginning
2202 * @idx -- current idx
2203 * @n_bd -- total number of entries in queue (must be power of 2)
2208 return ++idx & (n_bd - 1); in il_queue_inc_wrap()
2212 * il_queue_dec_wrap - decrement queue idx, wrap back to end
2213 * @idx -- current idx
2214 * @n_bd -- total number of entries in queue (must be power of 2)
2219 return --idx & (n_bd - 1); in il_queue_dec_wrap()
2222 /* TODO: Move fw_desc functions to iwl-pci.ko */
2226 if (desc->v_addr) in il_free_fw_desc()
2227 dma_free_coherent(&pci_dev->dev, desc->len, desc->v_addr, in il_free_fw_desc()
2228 desc->p_addr); in il_free_fw_desc()
2229 desc->v_addr = NULL; in il_free_fw_desc()
2230 desc->len = 0; in il_free_fw_desc()
2236 if (!desc->len) { in il_alloc_fw_desc()
2237 desc->v_addr = NULL; in il_alloc_fw_desc()
2238 return -EINVAL; in il_alloc_fw_desc()
2241 desc->v_addr = dma_alloc_coherent(&pci_dev->dev, desc->len, in il_alloc_fw_desc()
2242 &desc->p_addr, GFP_KERNEL); in il_alloc_fw_desc()
2243 return (desc->v_addr != NULL) ? 0 : -ENOMEM; in il_alloc_fw_desc()
2251 * | | | | | | +-+-------- AC queue (0-3)
2253 * | +-+-+-+-+------------ HW queue ID
2255 * +---------------------- unused
2263 txq->swq_id = (hwq << 2) | ac; in il_set_swq_id()
2269 if (atomic_dec_return(&il->queue_stop_count[ac]) <= 0) in _il_wake_queue()
2270 ieee80211_wake_queue(il->hw, ac); in _il_wake_queue()
2276 if (atomic_inc_return(&il->queue_stop_count[ac]) > 0) in _il_stop_queue()
2277 ieee80211_stop_queue(il->hw, ac); in _il_stop_queue()
2282 u8 queue = txq->swq_id; in il_wake_queue()
2286 if (test_and_clear_bit(hwq, il->queue_stopped)) in il_wake_queue()
2293 u8 queue = txq->swq_id; in il_stop_queue()
2297 if (!test_and_set_bit(hwq, il->queue_stopped)) in il_stop_queue()
2306 if (test_and_clear_bit(reason, &il->stop_reason)) in il_wake_queues_by_reason()
2316 if (!test_and_set_bit(reason, &il->stop_reason)) in il_stop_queues_by_reason()
2336 clear_bit(S_INT_ENABLED, &il->status); in il_disable_interrupts()
2356 set_bit(S_INT_ENABLED, &il->status); in il_enable_interrupts()
2357 _il_wr(il, CSR_INT_MASK, il->inta_mask); in il_enable_interrupts()
2361 * il_beacon_time_mask_low - mask of lower 32 bit of beacon time
2362 * @il -- pointer to il_priv data structure
2363 * @tsf_bits -- number of bits need to shift for masking)
2368 return (1 << tsf_bits) - 1; in il_beacon_time_mask_low()
2372 * il_beacon_time_mask_high - mask of higher 32 bit of beacon time
2373 * @il -- pointer to il_priv data structure
2374 * @tsf_bits -- number of bits need to shift for masking)
2379 return ((1 << (32 - tsf_bits)) - 1) << tsf_bits; in il_beacon_time_mask_high()
2383 * struct il_rb_status - reseve buffer status host memory mapped FH registers
2385 * @closed_rb_num [0:11] - Indicates the idx of the RB which was closed
2386 * @closed_fr_num [0:11] - Indicates the idx of the RX Frame which was closed
2387 * @finished_rb_num [0:11] - Indicates the idx of the current RB
2389 * @finished_fr_num [0:11] - Indicates the idx of the RX Frame
2419 * @hi_n_len: 0-3 [35:32] portion of dma
2420 * 4-15 length of the tx buffer
2433 * @ num_tbs 0-4 number of active tbs
2435 * 6-7 padding (not used)
2441 * contiguous 256 TFDs x 128 bytes-per-TFD = 32 KBytes
2450 * of (4K - 4). The concatenates all of a TFD's buffers into a single
2509 RATE_COUNT_LEGACY = RATE_COUNT - 1, /* Excluding 60M */
2510 RATE_COUNT_3945 = RATE_COUNT - 1,
2528 RATE_INVM_IDX_TBL = RATE_INVM_IDX - 1,
2572 /* uCode API values for OFDM high-throughput (HT) bit rates */
2637 #define RATES_MASK ((1 << RATE_COUNT) - 1)
2638 #define RATES_MASK_3945 ((1 << RATE_COUNT_3945) - 1)
2640 #define IL_INVALID_VALUE -1
2642 #define IL_MIN_RSSI_VAL -100
2692 /* load per tid defines for A-MPDU activation */
2701 #define TID_MAX_TIME_DIFF ((TID_QUEUE_MAX_SIZE - 1) * TID_QUEUE_CELL_SPACING)
2702 #define TIME_WRAP_AROUND(x, y) (((y) > (x)) ? (y) - (x) : (0-(x)) + (y)) argument
2710 LQ_SISO, /* high-throughput types */
2740 * struct il_rate_scale_data -- tx success history for one rate
2745 s32 success_ratio; /* per-cent * 128 */
2752 * struct il_scale_tbl_info -- tx params and success history for all rates
2782 * struct il_lq_sta -- driver's rate scaling ilate structure
2787 u8 active_tbl; /* idx of active table, range 0-1 */
2802 u8 action_counter; /* # mode-switch actions tried */
2835 * When mac80211 creates a station it reserves some space (hw->sta_data_size)
2867 * il3945_rate_scale_init - Initialize the rate scale table based on assoc info
2881 * il_rate_control_register - Register the rate control algorithm callbacks
2894 * il_rate_control_unregister - Unregister the rate control callbacks
2918 if (il->debug_level) in il_get_debug_level()
2919 return il->debug_level; in il_get_debug_level()
2941 dev_err(&il->hw->wiphy->dev, "%s " fmt, __func__, \
2997 /* 0x0000000F - 0x00000001 */
3002 /* 0x000000F0 - 0x00000010 */
3007 /* 0x00000F00 - 0x00000100 */
3012 /* 0x0000F000 - 0x00001000 */
3017 /* 0x000F0000 - 0x00010000 */
3022 /* 0x00F00000 - 0x00100000 */
3027 /* 0x0F000000 - 0x01000000 */
3031 /* 0xF0000000 - 0x10000000 */