Deleted Added
full compact
ar9300_recv_ds.c (250007) ar9300_recv_ds.c (250008)
1/*
2 * Copyright (c) 2013 Qualcomm Atheros, Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 * PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#include "opt_ah.h"
18
1/*
2 * Copyright (c) 2013 Qualcomm Atheros, Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 * PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#include "opt_ah.h"
18
19#ifdef AH_SUPPORT_AR9300
20
21#include "ah.h"
22#include "ah_desc.h"
23#include "ah_internal.h"
24
25#include "ar9300/ar9300.h"
26#include "ar9300/ar9300reg.h"
27#include "ar9300/ar9300desc.h"
28
29
19#include "ah.h"
20#include "ah_desc.h"
21#include "ah_internal.h"
22
23#include "ar9300/ar9300.h"
24#include "ar9300/ar9300reg.h"
25#include "ar9300/ar9300desc.h"
26
27
30
31/*
32 * Process an RX descriptor, and return the status to the caller.
33 * Copy some hardware specific items into the software portion
34 * of the descriptor.
35 *
36 * NB: the caller is responsible for validating the memory contents
37 * of the descriptor (e.g. flushing any cached copy).
38 */

--- 33 unchanged lines hidden (view full) ---

72 rxs->rs_status = 0;
73 rxs->rs_flags = 0;
74
75 rxs->rs_datalen = rxsp->status2 & AR_data_len;
76 rxs->rs_tstamp = rxsp->status3;
77
78 /* XXX what about key_cache_miss? */
79 rxs->rs_rssi = MS(rxsp->status5, AR_rx_rssi_combined);
28/*
29 * Process an RX descriptor, and return the status to the caller.
30 * Copy some hardware specific items into the software portion
31 * of the descriptor.
32 *
33 * NB: the caller is responsible for validating the memory contents
34 * of the descriptor (e.g. flushing any cached copy).
35 */

--- 33 unchanged lines hidden (view full) ---

69 rxs->rs_status = 0;
70 rxs->rs_flags = 0;
71
72 rxs->rs_datalen = rxsp->status2 & AR_data_len;
73 rxs->rs_tstamp = rxsp->status3;
74
75 /* XXX what about key_cache_miss? */
76 rxs->rs_rssi = MS(rxsp->status5, AR_rx_rssi_combined);
80 rxs->rs_rssi_ctl0 = MS(rxsp->status1, AR_rx_rssi_ant00);
81 rxs->rs_rssi_ctl1 = MS(rxsp->status1, AR_rx_rssi_ant01);
82 rxs->rs_rssi_ctl2 = MS(rxsp->status1, AR_rx_rssi_ant02);
83 rxs->rs_rssi_ext0 = MS(rxsp->status5, AR_rx_rssi_ant10);
84 rxs->rs_rssi_ext1 = MS(rxsp->status5, AR_rx_rssi_ant11);
85 rxs->rs_rssi_ext2 = MS(rxsp->status5, AR_rx_rssi_ant12);
77 rxs->rs_rssi_ctl[0] = MS(rxsp->status1, AR_rx_rssi_ant00);
78 rxs->rs_rssi_ctl[1] = MS(rxsp->status1, AR_rx_rssi_ant01);
79 rxs->rs_rssi_ctl[2] = MS(rxsp->status1, AR_rx_rssi_ant02);
80 rxs->rs_rssi_ext[0] = MS(rxsp->status5, AR_rx_rssi_ant10);
81 rxs->rs_rssi_ext[1] = MS(rxsp->status5, AR_rx_rssi_ant11);
82 rxs->rs_rssi_ext[2] = MS(rxsp->status5, AR_rx_rssi_ant12);
86 if (rxsp->status11 & AR_rx_key_idx_valid) {
87 rxs->rs_keyix = MS(rxsp->status11, AR_key_idx);
88 } else {
89 rxs->rs_keyix = HAL_RXKEYIX_INVALID;
90 }
91 /* NB: caller expected to do rate table mapping */
92 rxs->rs_rate = MS(rxsp->status1, AR_rx_rate);
93 rxs->rs_more = (rxsp->status2 & AR_rx_more) ? 1 : 0;
94
95 rxs->rs_isaggr = (rxsp->status11 & AR_rx_aggr) ? 1 : 0;
96 rxs->rs_moreaggr = (rxsp->status11 & AR_rx_more_aggr) ? 1 : 0;
97 rxs->rs_antenna = (MS(rxsp->status4, AR_rx_antenna) & 0x7);
83 if (rxsp->status11 & AR_rx_key_idx_valid) {
84 rxs->rs_keyix = MS(rxsp->status11, AR_key_idx);
85 } else {
86 rxs->rs_keyix = HAL_RXKEYIX_INVALID;
87 }
88 /* NB: caller expected to do rate table mapping */
89 rxs->rs_rate = MS(rxsp->status1, AR_rx_rate);
90 rxs->rs_more = (rxsp->status2 & AR_rx_more) ? 1 : 0;
91
92 rxs->rs_isaggr = (rxsp->status11 & AR_rx_aggr) ? 1 : 0;
93 rxs->rs_moreaggr = (rxsp->status11 & AR_rx_more_aggr) ? 1 : 0;
94 rxs->rs_antenna = (MS(rxsp->status4, AR_rx_antenna) & 0x7);
98 rxs->rs_isapsd = (rxsp->status11 & AR_apsd_trig) ? 1 : 0;
99 rxs->rs_flags = (rxsp->status4 & AR_gi) ? HAL_RX_GI : 0;
95 rxs->rs_flags = (rxsp->status11 & AR_apsd_trig) ? HAL_RX_IS_APSD : 0;
96 rxs->rs_flags |= (rxsp->status4 & AR_gi) ? HAL_RX_GI : 0;
100 rxs->rs_flags |= (rxsp->status4 & AR_2040) ? HAL_RX_2040 : 0;
101
102 /* Copy EVM information */
97 rxs->rs_flags |= (rxsp->status4 & AR_2040) ? HAL_RX_2040 : 0;
98
99 /* Copy EVM information */
103 rxs->evm0 = rxsp->status6;
104 rxs->evm1 = rxsp->status7;
105 rxs->evm2 = rxsp->status8;
106 rxs->evm3 = rxsp->status9;
107 rxs->evm4 = (rxsp->status10 & 0xffff);
100 rxs->rs_evm0 = rxsp->status6;
101 rxs->rs_evm1 = rxsp->status7;
102 rxs->rs_evm2 = rxsp->status8;
103 rxs->rs_evm3 = rxsp->status9;
104 rxs->rs_evm4 = (rxsp->status10 & 0xffff);
108
109 if (rxsp->status11 & AR_pre_delim_crc_err) {
110 rxs->rs_flags |= HAL_RX_DELIM_CRC_PRE;
111 }
112 if (rxsp->status11 & AR_post_delim_crc_err) {
113 rxs->rs_flags |= HAL_RX_DELIM_CRC_POST;
114 }
115 if (rxsp->status11 & AR_decrypt_busy_err) {

--- 75 unchanged lines hidden (view full) ---

191HAL_STATUS
192ar9300_get_rx_key_idx(struct ath_hal *ah, struct ath_desc *ds, u_int8_t *keyix,
193 u_int8_t *status)
194{
195 *status = 0;
196 *keyix = HAL_RXKEYIX_INVALID;
197 return HAL_ENOTSUPP;
198}
105
106 if (rxsp->status11 & AR_pre_delim_crc_err) {
107 rxs->rs_flags |= HAL_RX_DELIM_CRC_PRE;
108 }
109 if (rxsp->status11 & AR_post_delim_crc_err) {
110 rxs->rs_flags |= HAL_RX_DELIM_CRC_POST;
111 }
112 if (rxsp->status11 & AR_decrypt_busy_err) {

--- 75 unchanged lines hidden (view full) ---

188HAL_STATUS
189ar9300_get_rx_key_idx(struct ath_hal *ah, struct ath_desc *ds, u_int8_t *keyix,
190 u_int8_t *status)
191{
192 *status = 0;
193 *keyix = HAL_RXKEYIX_INVALID;
194 return HAL_ENOTSUPP;
195}
199
200
201#endif