Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
490f0dc4
cloud-kernel
项目概览
openanolis
/
cloud-kernel
接近 2 年 前同步成功
通知
170
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
490f0dc4
编写于
10月 27, 2014
作者:
J
John W. Linville
浏览文件
操作
浏览文件
下载
差异文件
Merge tag 'for-linville-20141024' of
git://github.com/kvalo/ath
Conflicts: drivers/net/wireless/ath/wil6210/wil6210.h
上级
61ed53de
84cbf3a7
变更
24
展开全部
隐藏空白更改
内联
并排
Showing
24 changed file
with
2258 addition
and
1373 deletion
+2258
-1373
drivers/net/wireless/ath/ath10k/ce.c
drivers/net/wireless/ath/ath10k/ce.c
+42
-41
drivers/net/wireless/ath/ath10k/ce.h
drivers/net/wireless/ath/ath10k/ce.h
+17
-4
drivers/net/wireless/ath/ath10k/core.c
drivers/net/wireless/ath/ath10k/core.c
+88
-23
drivers/net/wireless/ath/ath10k/core.h
drivers/net/wireless/ath/ath10k/core.h
+63
-17
drivers/net/wireless/ath/ath10k/debug.c
drivers/net/wireless/ath/ath10k/debug.c
+670
-221
drivers/net/wireless/ath/ath10k/debug.h
drivers/net/wireless/ath/ath10k/debug.h
+30
-10
drivers/net/wireless/ath/ath10k/hif.h
drivers/net/wireless/ath/ath10k/hif.h
+10
-0
drivers/net/wireless/ath/ath10k/htt.h
drivers/net/wireless/ath/ath10k/htt.h
+1
-1
drivers/net/wireless/ath/ath10k/htt_rx.c
drivers/net/wireless/ath/ath10k/htt_rx.c
+18
-2
drivers/net/wireless/ath/ath10k/htt_tx.c
drivers/net/wireless/ath/ath10k/htt_tx.c
+2
-0
drivers/net/wireless/ath/ath10k/hw.h
drivers/net/wireless/ath/ath10k/hw.h
+15
-2
drivers/net/wireless/ath/ath10k/mac.c
drivers/net/wireless/ath/ath10k/mac.c
+284
-225
drivers/net/wireless/ath/ath10k/mac.h
drivers/net/wireless/ath/ath10k/mac.h
+1
-0
drivers/net/wireless/ath/ath10k/pci.c
drivers/net/wireless/ath/ath10k/pci.c
+122
-81
drivers/net/wireless/ath/ath10k/spectral.c
drivers/net/wireless/ath/ath10k/spectral.c
+10
-24
drivers/net/wireless/ath/ath10k/spectral.h
drivers/net/wireless/ath/ath10k/spectral.h
+4
-4
drivers/net/wireless/ath/ath10k/trace.h
drivers/net/wireless/ath/ath10k/trace.h
+163
-0
drivers/net/wireless/ath/ath10k/txrx.c
drivers/net/wireless/ath/ath10k/txrx.c
+1
-0
drivers/net/wireless/ath/ath10k/wmi.c
drivers/net/wireless/ath/ath10k/wmi.c
+633
-483
drivers/net/wireless/ath/ath10k/wmi.h
drivers/net/wireless/ath/ath10k/wmi.h
+66
-207
drivers/net/wireless/ath/ath6kl/common.h
drivers/net/wireless/ath/ath6kl/common.h
+1
-1
drivers/net/wireless/ath/ath6kl/debug.c
drivers/net/wireless/ath/ath6kl/debug.c
+8
-20
drivers/net/wireless/ath/ath6kl/debug.h
drivers/net/wireless/ath/ath6kl/debug.h
+6
-7
drivers/net/wireless/ath/wil6210/wil6210.h
drivers/net/wireless/ath/wil6210/wil6210.h
+3
-0
未找到文件。
drivers/net/wireless/ath/ath10k/ce.c
浏览文件 @
490f0dc4
...
...
@@ -443,12 +443,12 @@ int ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, u32 paddr)
* Guts of ath10k_ce_completed_recv_next.
* The caller takes responsibility for any necessary locking.
*/
static
int
ath10k_ce_completed_recv_next_nolock
(
struct
ath10k_ce_pipe
*
ce_state
,
void
**
per_transfer_contextp
,
u32
*
bufferp
,
unsigned
int
*
nbytesp
,
unsigned
int
*
transfer_idp
,
unsigned
int
*
flagsp
)
int
ath10k_ce_completed_recv_next_nolock
(
struct
ath10k_ce_pipe
*
ce_state
,
void
**
per_transfer_contextp
,
u32
*
bufferp
,
unsigned
int
*
nbytesp
,
unsigned
int
*
transfer_idp
,
unsigned
int
*
flagsp
)
{
struct
ath10k_ce_ring
*
dest_ring
=
ce_state
->
dest_ring
;
unsigned
int
nentries_mask
=
dest_ring
->
nentries_mask
;
...
...
@@ -576,11 +576,11 @@ int ath10k_ce_revoke_recv_next(struct ath10k_ce_pipe *ce_state,
* Guts of ath10k_ce_completed_send_next.
* The caller takes responsibility for any necessary locking.
*/
static
int
ath10k_ce_completed_send_next_nolock
(
struct
ath10k_ce_pipe
*
ce_state
,
void
**
per_transfer_contextp
,
u32
*
bufferp
,
unsigned
int
*
nbytesp
,
unsigned
int
*
transfer_idp
)
int
ath10k_ce_completed_send_next_nolock
(
struct
ath10k_ce_pipe
*
ce_state
,
void
**
per_transfer_contextp
,
u32
*
bufferp
,
unsigned
int
*
nbytesp
,
unsigned
int
*
transfer_idp
)
{
struct
ath10k_ce_ring
*
src_ring
=
ce_state
->
src_ring
;
u32
ctrl_addr
=
ce_state
->
ctrl_addr
;
...
...
@@ -817,7 +817,10 @@ void ath10k_ce_enable_interrupts(struct ath10k *ar)
struct
ath10k_pci
*
ar_pci
=
ath10k_pci_priv
(
ar
);
int
ce_id
;
for
(
ce_id
=
0
;
ce_id
<
CE_COUNT
;
ce_id
++
)
/* Skip the last copy engine, CE7 the diagnostic window, as that
* uses polling and isn't initialized for interrupts.
*/
for
(
ce_id
=
0
;
ce_id
<
CE_COUNT
-
1
;
ce_id
++
)
ath10k_ce_per_engine_handler_adjust
(
&
ar_pci
->
ce_states
[
ce_id
]);
}
...
...
@@ -1020,37 +1023,10 @@ ath10k_ce_alloc_dest_ring(struct ath10k *ar, unsigned int ce_id,
* initialized by software/firmware.
*/
int
ath10k_ce_init_pipe
(
struct
ath10k
*
ar
,
unsigned
int
ce_id
,
const
struct
ce_attr
*
attr
,
void
(
*
send_cb
)(
struct
ath10k_ce_pipe
*
),
void
(
*
recv_cb
)(
struct
ath10k_ce_pipe
*
))
const
struct
ce_attr
*
attr
)
{
struct
ath10k_pci
*
ar_pci
=
ath10k_pci_priv
(
ar
);
struct
ath10k_ce_pipe
*
ce_state
=
&
ar_pci
->
ce_states
[
ce_id
];
int
ret
;
/*
* Make sure there's enough CE ringbuffer entries for HTT TX to avoid
* additional TX locking checks.
*
* For the lack of a better place do the check here.
*/
BUILD_BUG_ON
(
2
*
TARGET_NUM_MSDU_DESC
>
(
CE_HTT_H2T_MSG_SRC_NENTRIES
-
1
));
BUILD_BUG_ON
(
2
*
TARGET_10X_NUM_MSDU_DESC
>
(
CE_HTT_H2T_MSG_SRC_NENTRIES
-
1
));
spin_lock_bh
(
&
ar_pci
->
ce_lock
);
ce_state
->
ar
=
ar
;
ce_state
->
id
=
ce_id
;
ce_state
->
ctrl_addr
=
ath10k_ce_base_address
(
ce_id
);
ce_state
->
attr_flags
=
attr
->
flags
;
ce_state
->
src_sz_max
=
attr
->
src_sz_max
;
if
(
attr
->
src_nentries
)
ce_state
->
send_cb
=
send_cb
;
if
(
attr
->
dest_nentries
)
ce_state
->
recv_cb
=
recv_cb
;
spin_unlock_bh
(
&
ar_pci
->
ce_lock
);
if
(
attr
->
src_nentries
)
{
ret
=
ath10k_ce_init_src_ring
(
ar
,
ce_id
,
attr
);
if
(
ret
)
{
...
...
@@ -1098,12 +1074,37 @@ void ath10k_ce_deinit_pipe(struct ath10k *ar, unsigned int ce_id)
}
int
ath10k_ce_alloc_pipe
(
struct
ath10k
*
ar
,
int
ce_id
,
const
struct
ce_attr
*
attr
)
const
struct
ce_attr
*
attr
,
void
(
*
send_cb
)(
struct
ath10k_ce_pipe
*
),
void
(
*
recv_cb
)(
struct
ath10k_ce_pipe
*
))
{
struct
ath10k_pci
*
ar_pci
=
ath10k_pci_priv
(
ar
);
struct
ath10k_ce_pipe
*
ce_state
=
&
ar_pci
->
ce_states
[
ce_id
];
int
ret
;
/*
* Make sure there's enough CE ringbuffer entries for HTT TX to avoid
* additional TX locking checks.
*
* For the lack of a better place do the check here.
*/
BUILD_BUG_ON
(
2
*
TARGET_NUM_MSDU_DESC
>
(
CE_HTT_H2T_MSG_SRC_NENTRIES
-
1
));
BUILD_BUG_ON
(
2
*
TARGET_10X_NUM_MSDU_DESC
>
(
CE_HTT_H2T_MSG_SRC_NENTRIES
-
1
));
ce_state
->
ar
=
ar
;
ce_state
->
id
=
ce_id
;
ce_state
->
ctrl_addr
=
ath10k_ce_base_address
(
ce_id
);
ce_state
->
attr_flags
=
attr
->
flags
;
ce_state
->
src_sz_max
=
attr
->
src_sz_max
;
if
(
attr
->
src_nentries
)
ce_state
->
send_cb
=
send_cb
;
if
(
attr
->
dest_nentries
)
ce_state
->
recv_cb
=
recv_cb
;
if
(
attr
->
src_nentries
)
{
ce_state
->
src_ring
=
ath10k_ce_alloc_src_ring
(
ar
,
ce_id
,
attr
);
if
(
IS_ERR
(
ce_state
->
src_ring
))
{
...
...
drivers/net/wireless/ath/ath10k/ce.h
浏览文件 @
490f0dc4
...
...
@@ -192,15 +192,21 @@ int ath10k_ce_completed_send_next(struct ath10k_ce_pipe *ce_state,
unsigned
int
*
nbytesp
,
unsigned
int
*
transfer_idp
);
int
ath10k_ce_completed_send_next_nolock
(
struct
ath10k_ce_pipe
*
ce_state
,
void
**
per_transfer_contextp
,
u32
*
bufferp
,
unsigned
int
*
nbytesp
,
unsigned
int
*
transfer_idp
);
/*==================CE Engine Initialization=======================*/
int
ath10k_ce_init_pipe
(
struct
ath10k
*
ar
,
unsigned
int
ce_id
,
const
struct
ce_attr
*
attr
,
void
(
*
send_cb
)(
struct
ath10k_ce_pipe
*
),
void
(
*
recv_cb
)(
struct
ath10k_ce_pipe
*
));
const
struct
ce_attr
*
attr
);
void
ath10k_ce_deinit_pipe
(
struct
ath10k
*
ar
,
unsigned
int
ce_id
);
int
ath10k_ce_alloc_pipe
(
struct
ath10k
*
ar
,
int
ce_id
,
const
struct
ce_attr
*
attr
);
const
struct
ce_attr
*
attr
,
void
(
*
send_cb
)(
struct
ath10k_ce_pipe
*
),
void
(
*
recv_cb
)(
struct
ath10k_ce_pipe
*
));
void
ath10k_ce_free_pipe
(
struct
ath10k
*
ar
,
int
ce_id
);
/*==================CE Engine Shutdown=======================*/
...
...
@@ -213,6 +219,13 @@ int ath10k_ce_revoke_recv_next(struct ath10k_ce_pipe *ce_state,
void
**
per_transfer_contextp
,
u32
*
bufferp
);
int
ath10k_ce_completed_recv_next_nolock
(
struct
ath10k_ce_pipe
*
ce_state
,
void
**
per_transfer_contextp
,
u32
*
bufferp
,
unsigned
int
*
nbytesp
,
unsigned
int
*
transfer_idp
,
unsigned
int
*
flagsp
);
/*
* Support clean shutdown by allowing the caller to cancel
* pending sends. Target DMA must be stopped before using
...
...
drivers/net/wireless/ath/ath10k/core.c
浏览文件 @
490f0dc4
...
...
@@ -138,7 +138,8 @@ static const struct firmware *ath10k_fetch_fw_file(struct ath10k *ar,
return
fw
;
}
static
int
ath10k_push_board_ext_data
(
struct
ath10k
*
ar
)
static
int
ath10k_push_board_ext_data
(
struct
ath10k
*
ar
,
const
void
*
data
,
size_t
data_len
)
{
u32
board_data_size
=
QCA988X_BOARD_DATA_SZ
;
u32
board_ext_data_size
=
QCA988X_BOARD_EXT_DATA_SZ
;
...
...
@@ -159,14 +160,14 @@ static int ath10k_push_board_ext_data(struct ath10k *ar)
if
(
board_ext_data_addr
==
0
)
return
0
;
if
(
ar
->
board
_len
!=
(
board_data_size
+
board_ext_data_size
))
{
if
(
data
_len
!=
(
board_data_size
+
board_ext_data_size
))
{
ath10k_err
(
ar
,
"invalid board (ext) data sizes %zu != %d+%d
\n
"
,
ar
->
board
_len
,
board_data_size
,
board_ext_data_size
);
data
_len
,
board_data_size
,
board_ext_data_size
);
return
-
EINVAL
;
}
ret
=
ath10k_bmi_write_memory
(
ar
,
board_ext_data_addr
,
ar
->
board_
data
+
board_data_size
,
data
+
board_data_size
,
board_ext_data_size
);
if
(
ret
)
{
ath10k_err
(
ar
,
"could not write board ext data (%d)
\n
"
,
ret
);
...
...
@@ -184,13 +185,14 @@ static int ath10k_push_board_ext_data(struct ath10k *ar)
return
0
;
}
static
int
ath10k_download_board_data
(
struct
ath10k
*
ar
)
static
int
ath10k_download_board_data
(
struct
ath10k
*
ar
,
const
void
*
data
,
size_t
data_len
)
{
u32
board_data_size
=
QCA988X_BOARD_DATA_SZ
;
u32
address
;
int
ret
;
ret
=
ath10k_push_board_ext_data
(
ar
);
ret
=
ath10k_push_board_ext_data
(
ar
,
data
,
data_len
);
if
(
ret
)
{
ath10k_err
(
ar
,
"could not push board ext data (%d)
\n
"
,
ret
);
goto
exit
;
...
...
@@ -202,9 +204,9 @@ static int ath10k_download_board_data(struct ath10k *ar)
goto
exit
;
}
ret
=
ath10k_bmi_write_memory
(
ar
,
address
,
ar
->
board_
data
,
ret
=
ath10k_bmi_write_memory
(
ar
,
address
,
data
,
min_t
(
u32
,
board_data_size
,
ar
->
board
_len
));
data
_len
));
if
(
ret
)
{
ath10k_err
(
ar
,
"could not write board data (%d)
\n
"
,
ret
);
goto
exit
;
...
...
@@ -220,11 +222,39 @@ static int ath10k_download_board_data(struct ath10k *ar)
return
ret
;
}
static
int
ath10k_download_cal_file
(
struct
ath10k
*
ar
)
{
int
ret
;
if
(
!
ar
->
cal_file
)
return
-
ENOENT
;
if
(
IS_ERR
(
ar
->
cal_file
))
return
PTR_ERR
(
ar
->
cal_file
);
ret
=
ath10k_download_board_data
(
ar
,
ar
->
cal_file
->
data
,
ar
->
cal_file
->
size
);
if
(
ret
)
{
ath10k_err
(
ar
,
"failed to download cal_file data: %d
\n
"
,
ret
);
return
ret
;
}
ath10k_dbg
(
ar
,
ATH10K_DBG_BOOT
,
"boot cal file downloaded
\n
"
);
return
0
;
}
static
int
ath10k_download_and_run_otp
(
struct
ath10k
*
ar
)
{
u32
result
,
address
=
ar
->
hw_params
.
patch_load_addr
;
int
ret
;
ret
=
ath10k_download_board_data
(
ar
,
ar
->
board_data
,
ar
->
board_len
);
if
(
ret
)
{
ath10k_err
(
ar
,
"failed to download board data: %d
\n
"
,
ret
);
return
ret
;
}
/* OTP is optional */
if
(
!
ar
->
otp_data
||
!
ar
->
otp_len
)
{
...
...
@@ -308,6 +338,9 @@ static void ath10k_core_free_firmware_files(struct ath10k *ar)
if
(
ar
->
firmware
&&
!
IS_ERR
(
ar
->
firmware
))
release_firmware
(
ar
->
firmware
);
if
(
ar
->
cal_file
&&
!
IS_ERR
(
ar
->
cal_file
))
release_firmware
(
ar
->
cal_file
);
ar
->
board
=
NULL
;
ar
->
board_data
=
NULL
;
ar
->
board_len
=
0
;
...
...
@@ -319,6 +352,27 @@ static void ath10k_core_free_firmware_files(struct ath10k *ar)
ar
->
firmware
=
NULL
;
ar
->
firmware_data
=
NULL
;
ar
->
firmware_len
=
0
;
ar
->
cal_file
=
NULL
;
}
static
int
ath10k_fetch_cal_file
(
struct
ath10k
*
ar
)
{
char
filename
[
100
];
/* cal-<bus>-<id>.bin */
scnprintf
(
filename
,
sizeof
(
filename
),
"cal-%s-%s.bin"
,
ath10k_bus_str
(
ar
->
hif
.
bus
),
dev_name
(
ar
->
dev
));
ar
->
cal_file
=
ath10k_fetch_fw_file
(
ar
,
ATH10K_FW_DIR
,
filename
);
if
(
IS_ERR
(
ar
->
cal_file
))
/* calibration file is optional, don't print any warnings */
return
PTR_ERR
(
ar
->
cal_file
);
ath10k_dbg
(
ar
,
ATH10K_DBG_BOOT
,
"found calibration file %s/%s
\n
"
,
ATH10K_FW_DIR
,
filename
);
return
0
;
}
static
int
ath10k_core_fetch_firmware_api_1
(
struct
ath10k
*
ar
)
...
...
@@ -562,6 +616,9 @@ static int ath10k_core_fetch_firmware_files(struct ath10k *ar)
{
int
ret
;
/* calibration file is optional, don't check for any errors */
ath10k_fetch_cal_file
(
ar
);
ar
->
fw_api
=
3
;
ath10k_dbg
(
ar
,
ATH10K_DBG_BOOT
,
"trying fw api %d
\n
"
,
ar
->
fw_api
);
...
...
@@ -589,30 +646,32 @@ static int ath10k_core_fetch_firmware_files(struct ath10k *ar)
return
0
;
}
static
int
ath10k_init_download_firmware
(
struct
ath10k
*
ar
,
enum
ath10k_firmware_mode
mode
)
static
int
ath10k_download_cal_data
(
struct
ath10k
*
ar
)
{
int
ret
;
ret
=
ath10k_download_
board_data
(
ar
);
if
(
ret
)
{
a
th10k_err
(
ar
,
"failed to download board data: %d
\n
"
,
ret
)
;
return
ret
;
ret
=
ath10k_download_
cal_file
(
ar
);
if
(
ret
==
0
)
{
a
r
->
cal_mode
=
ATH10K_CAL_MODE_FILE
;
goto
done
;
}
ath10k_dbg
(
ar
,
ATH10K_DBG_BOOT
,
"boot did not find a calibration file, try OTP next: %d
\n
"
,
ret
);
ret
=
ath10k_download_and_run_otp
(
ar
);
if
(
ret
)
{
ath10k_err
(
ar
,
"failed to run otp: %d
\n
"
,
ret
);
return
ret
;
}
ret
=
ath10k_download_fw
(
ar
,
mode
);
if
(
ret
)
{
ath10k_err
(
ar
,
"failed to download firmware: %d
\n
"
,
ret
);
return
ret
;
}
ar
->
cal_mode
=
ATH10K_CAL_MODE_OTP
;
return
ret
;
done:
ath10k_dbg
(
ar
,
ATH10K_DBG_BOOT
,
"boot using calibration mode %s
\n
"
,
ath10k_cal_mode_str
(
ar
->
cal_mode
));
return
0
;
}
static
int
ath10k_init_uart
(
struct
ath10k
*
ar
)
...
...
@@ -729,7 +788,11 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode)
goto
err
;
}
status
=
ath10k_init_download_firmware
(
ar
,
mode
);
status
=
ath10k_download_cal_data
(
ar
);
if
(
status
)
goto
err
;
status
=
ath10k_download_fw
(
ar
,
mode
);
if
(
status
)
goto
err
;
...
...
@@ -846,9 +909,9 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode)
goto
err_hif_stop
;
if
(
test_bit
(
ATH10K_FW_FEATURE_WMI_10X
,
ar
->
fw_features
))
ar
->
free_vdev_map
=
(
1
<<
TARGET_10X_NUM_VDEVS
)
-
1
;
ar
->
free_vdev_map
=
(
1
LL
<<
TARGET_10X_NUM_VDEVS
)
-
1
;
else
ar
->
free_vdev_map
=
(
1
<<
TARGET_NUM_VDEVS
)
-
1
;
ar
->
free_vdev_map
=
(
1
LL
<<
TARGET_NUM_VDEVS
)
-
1
;
INIT_LIST_HEAD
(
&
ar
->
arvifs
);
...
...
@@ -1084,6 +1147,7 @@ void ath10k_core_unregister(struct ath10k *ar)
EXPORT_SYMBOL
(
ath10k_core_unregister
);
struct
ath10k
*
ath10k_core_create
(
size_t
priv_size
,
struct
device
*
dev
,
enum
ath10k_bus
bus
,
const
struct
ath10k_hif_ops
*
hif_ops
)
{
struct
ath10k
*
ar
;
...
...
@@ -1100,6 +1164,7 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev,
ar
->
dev
=
dev
;
ar
->
hif
.
ops
=
hif_ops
;
ar
->
hif
.
bus
=
bus
;
init_completion
(
&
ar
->
scan
.
started
);
init_completion
(
&
ar
->
scan
.
completed
);
...
...
drivers/net/wireless/ath/ath10k/core.h
浏览文件 @
490f0dc4
...
...
@@ -63,6 +63,20 @@
struct
ath10k
;
enum
ath10k_bus
{
ATH10K_BUS_PCI
,
};
static
inline
const
char
*
ath10k_bus_str
(
enum
ath10k_bus
bus
)
{
switch
(
bus
)
{
case
ATH10K_BUS_PCI
:
return
"pci"
;
}
return
"unknown"
;
}
struct
ath10k_skb_cb
{
dma_addr_t
paddr
;
u8
vdev_id
;
...
...
@@ -96,8 +110,6 @@ struct ath10k_bmi {
bool
done_sent
;
};
#define ATH10K_MAX_MEM_REQS 16
struct
ath10k_mem_chunk
{
void
*
vaddr
;
dma_addr_t
paddr
;
...
...
@@ -115,17 +127,21 @@ struct ath10k_wmi {
struct
wmi_pdev_param_map
*
pdev_param
;
u32
num_mem_chunks
;
struct
ath10k_mem_chunk
mem_chunks
[
ATH10K
_MAX_MEM_REQS
];
struct
ath10k_mem_chunk
mem_chunks
[
WMI
_MAX_MEM_REQS
];
};
struct
ath10k_peer_stat
{
struct
ath10k_fw_stats_peer
{
struct
list_head
list
;
u8
peer_macaddr
[
ETH_ALEN
];
u32
peer_rssi
;
u32
peer_tx_rate
;
u32
peer_rx_rate
;
/* 10x only */
};
struct
ath10k_target_stats
{
struct
ath10k_fw_stats_pdev
{
struct
list_head
list
;
/* PDEV stats */
s32
ch_noise_floor
;
u32
tx_frame_count
;
...
...
@@ -180,15 +196,11 @@ struct ath10k_target_stats {
s32
phy_errs
;
s32
phy_err_drop
;
s32
mpdu_errs
;
};
/* VDEV STATS */
/* PEER STATS */
u8
peers
;
struct
ath10k_peer_stat
peer_stat
[
TARGET_NUM_PEERS
];
/* TODO: Beacon filter stats */
struct
ath10k_fw_stats
{
struct
list_head
pdevs
;
struct
list_head
peers
;
};
struct
ath10k_dfs_stats
{
...
...
@@ -234,6 +246,8 @@ struct ath10k_vif {
struct
sk_buff
*
beacon
;
/* protected by data_lock */
bool
beacon_sent
;
void
*
beacon_buf
;
dma_addr_t
beacon_paddr
;
struct
ath10k
*
ar
;
struct
ieee80211_vif
*
vif
;
...
...
@@ -273,6 +287,7 @@ struct ath10k_vif {
u8
force_sgi
;
bool
use_cts_prot
;
int
num_legacy_stations
;
int
txpower
;
};
struct
ath10k_vif_iter
{
...
...
@@ -292,17 +307,19 @@ struct ath10k_fw_crash_data {
struct
ath10k_debug
{
struct
dentry
*
debugfs_phy
;
struct
ath10k_target_stats
target_stats
;
struct
ath10k_fw_stats
fw_stats
;
struct
completion
fw_stats_complete
;
bool
fw_stats_done
;
DECLARE_BITMAP
(
wmi_service_bitmap
,
WMI_SERVICE_MAX
);
struct
completion
event_stats_compl
;
unsigned
long
htt_stats_mask
;
struct
delayed_work
htt_stats_dwork
;
struct
ath10k_dfs_stats
dfs_stats
;
struct
ath_dfs_pool_stats
dfs_pool_stats
;
/* protected by conf_mutex */
u32
fw_dbglog_mask
;
u32
pktlog_filter
;
u8
htt_max_amsdu
;
u8
htt_max_ampdu
;
...
...
@@ -371,6 +388,23 @@ enum ath10k_dev_flags {
ATH10K_FLAG_CORE_REGISTERED
,
};
enum
ath10k_cal_mode
{
ATH10K_CAL_MODE_FILE
,
ATH10K_CAL_MODE_OTP
,
};
static
inline
const
char
*
ath10k_cal_mode_str
(
enum
ath10k_cal_mode
mode
)
{
switch
(
mode
)
{
case
ATH10K_CAL_MODE_FILE
:
return
"file"
;
case
ATH10K_CAL_MODE_OTP
:
return
"otp"
;
}
return
"unknown"
;
}
enum
ath10k_scan_state
{
ATH10K_SCAN_IDLE
,
ATH10K_SCAN_STARTING
,
...
...
@@ -421,6 +455,7 @@ struct ath10k {
bool
p2p
;
struct
{
enum
ath10k_bus
bus
;
const
struct
ath10k_hif_ops
*
ops
;
}
hif
;
...
...
@@ -456,7 +491,10 @@ struct ath10k {
const
void
*
firmware_data
;
size_t
firmware_len
;
const
struct
firmware
*
cal_file
;
int
fw_api
;
enum
ath10k_cal_mode
cal_mode
;
struct
{
struct
completion
started
;
...
...
@@ -482,7 +520,7 @@ struct ath10k {
/* current operating channel definition */
struct
cfg80211_chan_def
chandef
;
int
free_vdev_map
;
unsigned
long
long
free_vdev_map
;
bool
monitor
;
int
monitor_vdev_id
;
bool
monitor_started
;
...
...
@@ -563,11 +601,19 @@ struct ath10k {
bool
utf_monitor
;
}
testmode
;
struct
{
/* protected by data_lock */
u32
fw_crash_counter
;
u32
fw_warm_reset_counter
;
u32
fw_cold_reset_counter
;
}
stats
;
/* must be last */
u8
drv_priv
[
0
]
__aligned
(
sizeof
(
void
*
));
};
struct
ath10k
*
ath10k_core_create
(
size_t
priv_size
,
struct
device
*
dev
,
enum
ath10k_bus
bus
,
const
struct
ath10k_hif_ops
*
hif_ops
);
void
ath10k_core_destroy
(
struct
ath10k
*
ar
);
...
...
drivers/net/wireless/ath/ath10k/debug.c
浏览文件 @
490f0dc4
此差异已折叠。
点击以展开。
drivers/net/wireless/ath/ath10k/debug.h
浏览文件 @
490f0dc4
...
...
@@ -38,11 +38,20 @@ enum ath10k_debug_mask {
ATH10K_DBG_ANY
=
0xffffffff
,
};
enum
ath10k_pktlog_filter
{
ATH10K_PKTLOG_RX
=
0x000000001
,
ATH10K_PKTLOG_TX
=
0x000000002
,
ATH10K_PKTLOG_RCFIND
=
0x000000004
,
ATH10K_PKTLOG_RCUPDATE
=
0x000000008
,
ATH10K_PKTLOG_DBG_PRINT
=
0x000000010
,
ATH10K_PKTLOG_ANY
=
0x00000001f
,
};
extern
unsigned
int
ath10k_debug_mask
;
__printf
(
2
,
3
)
int
ath10k_info
(
struct
ath10k
*
ar
,
const
char
*
fmt
,
...);
__printf
(
2
,
3
)
int
ath10k_err
(
struct
ath10k
*
ar
,
const
char
*
fmt
,
...);
__printf
(
2
,
3
)
int
ath10k_warn
(
struct
ath10k
*
ar
,
const
char
*
fmt
,
...);
__printf
(
2
,
3
)
void
ath10k_info
(
struct
ath10k
*
ar
,
const
char
*
fmt
,
...);
__printf
(
2
,
3
)
void
ath10k_err
(
struct
ath10k
*
ar
,
const
char
*
fmt
,
...);
__printf
(
2
,
3
)
void
ath10k_warn
(
struct
ath10k
*
ar
,
const
char
*
fmt
,
...);
void
ath10k_print_driver_info
(
struct
ath10k
*
ar
);
#ifdef CONFIG_ATH10K_DEBUGFS
...
...
@@ -53,17 +62,24 @@ void ath10k_debug_destroy(struct ath10k *ar);
int
ath10k_debug_register
(
struct
ath10k
*
ar
);
void
ath10k_debug_unregister
(
struct
ath10k
*
ar
);
void
ath10k_debug_read_service_map
(
struct
ath10k
*
ar
,
void
*
service_map
,
const
void
*
service_map
,
size_t
map_size
);
void
ath10k_debug_read_target_stats
(
struct
ath10k
*
ar
,
struct
wmi_stats_event
*
ev
);
void
ath10k_debug_fw_stats_process
(
struct
ath10k
*
ar
,
struct
sk_buff
*
skb
);
struct
ath10k_fw_crash_data
*
ath10k_debug_get_new_fw_crash_data
(
struct
ath10k
*
ar
);
void
ath10k_debug_dbglog_add
(
struct
ath10k
*
ar
,
u8
*
buffer
,
int
len
);
#define ATH10K_DFS_STAT_INC(ar, c) (ar->debug.dfs_stats.c++)
void
ath10k_debug_get_et_strings
(
struct
ieee80211_hw
*
hw
,
struct
ieee80211_vif
*
vif
,
u32
sset
,
u8
*
data
);
int
ath10k_debug_get_et_sset_count
(
struct
ieee80211_hw
*
hw
,
struct
ieee80211_vif
*
vif
,
int
sset
);
void
ath10k_debug_get_et_stats
(
struct
ieee80211_hw
*
hw
,
struct
ieee80211_vif
*
vif
,
struct
ethtool_stats
*
stats
,
u64
*
data
);
#else
static
inline
int
ath10k_debug_start
(
struct
ath10k
*
ar
)
{
...
...
@@ -93,13 +109,13 @@ static inline void ath10k_debug_unregister(struct ath10k *ar)
}
static
inline
void
ath10k_debug_read_service_map
(
struct
ath10k
*
ar
,
void
*
service_map
,
const
void
*
service_map
,
size_t
map_size
)
{
}
static
inline
void
ath10k_debug_
read_target_stat
s
(
struct
ath10k
*
ar
,
struct
wmi_stats_event
*
ev
)
static
inline
void
ath10k_debug_
fw_stats_proces
s
(
struct
ath10k
*
ar
,
struct
sk_buff
*
skb
)
{
}
...
...
@@ -116,6 +132,10 @@ ath10k_debug_get_new_fw_crash_data(struct ath10k *ar)
#define ATH10K_DFS_STAT_INC(ar, c) do { } while (0)
#define ath10k_debug_get_et_strings NULL
#define ath10k_debug_get_et_sset_count NULL
#define ath10k_debug_get_et_stats NULL
#endif
/* CONFIG_ATH10K_DEBUGFS */
#ifdef CONFIG_ATH10K_DEBUG
...
...
drivers/net/wireless/ath/ath10k/hif.h
浏览文件 @
490f0dc4
...
...
@@ -43,6 +43,10 @@ struct ath10k_hif_ops {
int
(
*
tx_sg
)(
struct
ath10k
*
ar
,
u8
pipe_id
,
struct
ath10k_hif_sg_item
*
items
,
int
n_items
);
/* read firmware memory through the diagnose interface */
int
(
*
diag_read
)(
struct
ath10k
*
ar
,
u32
address
,
void
*
buf
,
size_t
buf_len
);
/*
* API to handle HIF-specific BMI message exchanges, this API is
* synchronous and only allowed to be called from a context that
...
...
@@ -98,6 +102,12 @@ static inline int ath10k_hif_tx_sg(struct ath10k *ar, u8 pipe_id,
return
ar
->
hif
.
ops
->
tx_sg
(
ar
,
pipe_id
,
items
,
n_items
);
}
static
inline
int
ath10k_hif_diag_read
(
struct
ath10k
*
ar
,
u32
address
,
void
*
buf
,
size_t
buf_len
)
{
return
ar
->
hif
.
ops
->
diag_read
(
ar
,
address
,
buf
,
buf_len
);
}
static
inline
int
ath10k_hif_exchange_bmi_msg
(
struct
ath10k
*
ar
,
void
*
request
,
u32
request_len
,
void
*
response
,
u32
*
response_len
)
...
...
drivers/net/wireless/ath/ath10k/htt.h
浏览文件 @
490f0dc4
...
...
@@ -725,7 +725,7 @@ static inline u8 *htt_rx_test_get_chars(struct htt_rx_test *rx_test)
*/
struct
htt_pktlog_msg
{
u8
pad
[
3
];
__le32
payload
[
1
/* or more */
];
u8
payload
[
0
];
}
__packed
;
struct
htt_dbg_stats_rx_reorder_stats
{
...
...
drivers/net/wireless/ath/ath10k/htt_rx.c
浏览文件 @
490f0dc4
...
...
@@ -291,6 +291,9 @@ static inline struct sk_buff *ath10k_htt_rx_netbuf_pop(struct ath10k_htt *htt)
htt
->
rx_ring
.
sw_rd_idx
.
msdu_payld
=
idx
;
htt
->
rx_ring
.
fill_cnt
--
;
trace_ath10k_htt_rx_pop_msdu
(
ar
,
msdu
->
data
,
msdu
->
len
+
skb_tailroom
(
msdu
));
return
msdu
;
}
...
...
@@ -316,6 +319,7 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt,
int
msdu_len
,
msdu_chaining
=
0
;
struct
sk_buff
*
msdu
,
*
next
;
struct
htt_rx_desc
*
rx_desc
;
u32
tsf
;
lockdep_assert_held
(
&
htt
->
rx_ring
.
lock
);
...
...
@@ -447,6 +451,9 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt,
last_msdu
=
__le32_to_cpu
(
rx_desc
->
msdu_end
.
info0
)
&
RX_MSDU_END_INFO0_LAST_MSDU
;
tsf
=
__le32_to_cpu
(
rx_desc
->
ppdu_end
.
tsf_timestamp
);
trace_ath10k_htt_rx_desc
(
ar
,
tsf
,
&
rx_desc
->
attention
,
sizeof
(
*
rx_desc
)
-
sizeof
(
u32
));
if
(
last_msdu
)
{
msdu
->
next
=
NULL
;
break
;
...
...
@@ -1674,6 +1681,15 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
case
HTT_T2H_MSG_TYPE_RX_DELBA
:
ath10k_htt_rx_delba
(
ar
,
resp
);
break
;
case
HTT_T2H_MSG_TYPE_PKTLOG
:
{
struct
ath10k_pktlog_hdr
*
hdr
=
(
struct
ath10k_pktlog_hdr
*
)
resp
->
pktlog_msg
.
payload
;
trace_ath10k_htt_pktlog
(
ar
,
resp
->
pktlog_msg
.
payload
,
sizeof
(
*
hdr
)
+
__le16_to_cpu
(
hdr
->
size
));
break
;
}
case
HTT_T2H_MSG_TYPE_RX_FLUSH
:
{
/* Ignore this event because mac80211 takes care of Rx
* aggregation reordering.
...
...
@@ -1681,8 +1697,8 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
break
;
}
default:
ath10k_
dbg
(
ar
,
ATH10K_DBG_HTT
,
"htt event (%d) not handled
\n
"
,
resp
->
hdr
.
msg_type
);
ath10k_
warn
(
ar
,
"htt event (%d) not handled
\n
"
,
resp
->
hdr
.
msg_type
);
ath10k_dbg_dump
(
ar
,
ATH10K_DBG_HTT_DUMP
,
NULL
,
"htt event: "
,
skb
->
data
,
skb
->
len
);
break
;
...
...
drivers/net/wireless/ath/ath10k/htt_tx.c
浏览文件 @
490f0dc4
...
...
@@ -557,12 +557,14 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
skb_cb
->
htt
.
txbuf
->
cmd_tx
.
frags_paddr
=
__cpu_to_le32
(
frags_paddr
);
skb_cb
->
htt
.
txbuf
->
cmd_tx
.
peerid
=
__cpu_to_le32
(
HTT_INVALID_PEERID
);
trace_ath10k_htt_tx
(
ar
,
msdu_id
,
msdu
->
len
,
vdev_id
,
tid
);
ath10k_dbg
(
ar
,
ATH10K_DBG_HTT
,
"htt tx flags0 %hhu flags1 %hu len %d id %hu frags_paddr %08x, msdu_paddr %08x vdev %hhu tid %hhu
\n
"
,
flags0
,
flags1
,
msdu
->
len
,
msdu_id
,
frags_paddr
,
(
u32
)
skb_cb
->
paddr
,
vdev_id
,
tid
);
ath10k_dbg_dump
(
ar
,
ATH10K_DBG_HTT_DUMP
,
NULL
,
"htt tx msdu: "
,
msdu
->
data
,
msdu
->
len
);
trace_ath10k_htt_tx_msdu
(
ar
,
msdu
->
data
,
msdu
->
len
);
sg_items
[
0
].
transfer_id
=
0
;
sg_items
[
0
].
transfer_context
=
NULL
;
...
...
drivers/net/wireless/ath/ath10k/hw.h
浏览文件 @
490f0dc4
...
...
@@ -20,15 +20,16 @@
#include "targaddrs.h"
#define ATH10K_FW_DIR "ath10k"
/* QCA988X 1.0 definitions (unsupported) */
#define QCA988X_HW_1_0_CHIP_ID_REV 0x0
/* QCA988X 2.0 definitions */
#define QCA988X_HW_2_0_VERSION 0x4100016c
#define QCA988X_HW_2_0_CHIP_ID_REV 0x2
#define QCA988X_HW_2_0_FW_DIR
"ath10k
/QCA988X/hw2.0"
#define QCA988X_HW_2_0_FW_DIR
ATH10K_FW_DIR "
/QCA988X/hw2.0"
#define QCA988X_HW_2_0_FW_FILE "firmware.bin"
#define QCA988X_HW_2_0_FW_3_FILE "firmware-3.bin"
#define QCA988X_HW_2_0_OTP_FILE "otp.bin"
#define QCA988X_HW_2_0_BOARD_DATA_FILE "board.bin"
#define QCA988X_HW_2_0_PATCH_LOAD_ADDR 0x1234
...
...
@@ -43,6 +44,8 @@
#define REG_DUMP_COUNT_QCA988X 60
#define QCA988X_CAL_DATA_LEN 2116
struct
ath10k_fw_ie
{
__le32
id
;
__le32
len
;
...
...
@@ -78,6 +81,15 @@ enum ath10k_mcast2ucast_mode {
ATH10K_MCAST2UCAST_ENABLED
=
1
,
};
struct
ath10k_pktlog_hdr
{
__le16
flags
;
__le16
missed_cnt
;
__le16
log_type
;
__le16
size
;
__le32
timestamp
;
u8
payload
[
0
];
}
__packed
;
/* Target specific defines for MAIN firmware */
#define TARGET_NUM_VDEVS 8
#define TARGET_NUM_PEER_AST 2
...
...
@@ -279,6 +291,7 @@ enum ath10k_mcast2ucast_mode {
#define SI_RX_DATA1_OFFSET 0x00000014
#define CORE_CTRL_CPU_INTR_MASK 0x00002000
#define CORE_CTRL_PCIE_REG_31_MASK 0x00000800
#define CORE_CTRL_ADDRESS 0x0000
#define PCIE_INTR_ENABLE_ADDRESS 0x0008
#define PCIE_INTR_CAUSE_ADDRESS 0x000c
...
...
drivers/net/wireless/ath/ath10k/mac.c
浏览文件 @
490f0dc4
此差异已折叠。
点击以展开。
drivers/net/wireless/ath/ath10k/mac.h
浏览文件 @
490f0dc4
...
...
@@ -39,6 +39,7 @@ void ath10k_offchan_tx_work(struct work_struct *work);
void
ath10k_mgmt_over_wmi_tx_purge
(
struct
ath10k
*
ar
);
void
ath10k_mgmt_over_wmi_tx_work
(
struct
work_struct
*
work
);
void
ath10k_halt
(
struct
ath10k
*
ar
);
void
ath10k_mac_vif_beacon_free
(
struct
ath10k_vif
*
arvif
);
static
inline
struct
ath10k_vif
*
ath10k_vif_to_arvif
(
struct
ieee80211_vif
*
vif
)
{
...
...
drivers/net/wireless/ath/ath10k/pci.c
浏览文件 @
490f0dc4
...
...
@@ -485,6 +485,8 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
void
*
data_buf
=
NULL
;
int
i
;
spin_lock_bh
(
&
ar_pci
->
ce_lock
);
ce_diag
=
ar_pci
->
ce_diag
;
/*
...
...
@@ -511,7 +513,7 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
nbytes
=
min_t
(
unsigned
int
,
remaining_bytes
,
DIAG_TRANSFER_LIMIT
);
ret
=
ath10k_ce_rx_post_buf
(
ce_diag
,
NULL
,
ce_data
);
ret
=
__
ath10k_ce_rx_post_buf
(
ce_diag
,
NULL
,
ce_data
);
if
(
ret
!=
0
)
goto
done
;
...
...
@@ -527,15 +529,15 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
address
=
TARG_CPU_SPACE_TO_CE_SPACE
(
ar
,
ar_pci
->
mem
,
address
);
ret
=
ath10k_ce_send
(
ce_diag
,
NULL
,
(
u32
)
address
,
nbytes
,
0
,
0
);
ret
=
ath10k_ce_send
_nolock
(
ce_diag
,
NULL
,
(
u32
)
address
,
nbytes
,
0
,
0
);
if
(
ret
)
goto
done
;
i
=
0
;
while
(
ath10k_ce_completed_send_next
(
ce_diag
,
NULL
,
&
buf
,
&
completed_nbytes
,
&
id
)
!=
0
)
{
while
(
ath10k_ce_completed_send_next
_nolock
(
ce_diag
,
NULL
,
&
buf
,
&
completed_nbytes
,
&
id
)
!=
0
)
{
mdelay
(
1
);
if
(
i
++
>
DIAG_ACCESS_CE_TIMEOUT_MS
)
{
ret
=
-
EBUSY
;
...
...
@@ -554,9 +556,9 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
}
i
=
0
;
while
(
ath10k_ce_completed_recv_next
(
ce_diag
,
NULL
,
&
buf
,
&
completed_nbytes
,
&
id
,
&
flags
)
!=
0
)
{
while
(
ath10k_ce_completed_recv_next
_nolock
(
ce_diag
,
NULL
,
&
buf
,
&
completed_nbytes
,
&
id
,
&
flags
)
!=
0
)
{
mdelay
(
1
);
if
(
i
++
>
DIAG_ACCESS_CE_TIMEOUT_MS
)
{
...
...
@@ -591,6 +593,8 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, void *data,
dma_free_coherent
(
ar
->
dev
,
orig_nbytes
,
data_buf
,
ce_data_base
);
spin_unlock_bh
(
&
ar_pci
->
ce_lock
);
return
ret
;
}
...
...
@@ -648,6 +652,8 @@ static int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address,
dma_addr_t
ce_data_base
=
0
;
int
i
;
spin_lock_bh
(
&
ar_pci
->
ce_lock
);
ce_diag
=
ar_pci
->
ce_diag
;
/*
...
...
@@ -688,7 +694,7 @@ static int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address,
nbytes
=
min_t
(
int
,
remaining_bytes
,
DIAG_TRANSFER_LIMIT
);
/* Set up to receive directly into Target(!) address */
ret
=
ath10k_ce_rx_post_buf
(
ce_diag
,
NULL
,
address
);
ret
=
__
ath10k_ce_rx_post_buf
(
ce_diag
,
NULL
,
address
);
if
(
ret
!=
0
)
goto
done
;
...
...
@@ -696,15 +702,15 @@ static int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address,
* Request CE to send caller-supplied data that
* was copied to bounce buffer to Target(!) address.
*/
ret
=
ath10k_ce_send
(
ce_diag
,
NULL
,
(
u32
)
ce_data
,
nbytes
,
0
,
0
);
ret
=
ath10k_ce_send
_nolock
(
ce_diag
,
NULL
,
(
u32
)
ce_data
,
nbytes
,
0
,
0
);
if
(
ret
!=
0
)
goto
done
;
i
=
0
;
while
(
ath10k_ce_completed_send_next
(
ce_diag
,
NULL
,
&
buf
,
&
completed_nbytes
,
&
id
)
!=
0
)
{
while
(
ath10k_ce_completed_send_next
_nolock
(
ce_diag
,
NULL
,
&
buf
,
&
completed_nbytes
,
&
id
)
!=
0
)
{
mdelay
(
1
);
if
(
i
++
>
DIAG_ACCESS_CE_TIMEOUT_MS
)
{
...
...
@@ -724,9 +730,9 @@ static int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address,
}
i
=
0
;
while
(
ath10k_ce_completed_recv_next
(
ce_diag
,
NULL
,
&
buf
,
&
completed_nbytes
,
&
id
,
&
flags
)
!=
0
)
{
while
(
ath10k_ce_completed_recv_next
_nolock
(
ce_diag
,
NULL
,
&
buf
,
&
completed_nbytes
,
&
id
,
&
flags
)
!=
0
)
{
mdelay
(
1
);
if
(
i
++
>
DIAG_ACCESS_CE_TIMEOUT_MS
)
{
...
...
@@ -760,6 +766,8 @@ static int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address,
ath10k_warn
(
ar
,
"failed to write diag value at 0x%x: %d
\n
"
,
address
,
ret
);
spin_unlock_bh
(
&
ar_pci
->
ce_lock
);
return
ret
;
}
...
...
@@ -861,6 +869,12 @@ static void ath10k_pci_ce_recv_data(struct ath10k_ce_pipe *ce_state)
}
skb_put
(
skb
,
nbytes
);
ath10k_dbg
(
ar
,
ATH10K_DBG_PCI
,
"pci rx ce pipe %d len %d
\n
"
,
ce_state
->
id
,
skb
->
len
);
ath10k_dbg_dump
(
ar
,
ATH10K_DBG_PCI_DUMP
,
NULL
,
"pci rx: "
,
skb
->
data
,
skb
->
len
);
cb
->
rx_completion
(
ar
,
skb
,
pipe_info
->
pipe_num
);
}
...
...
@@ -936,6 +950,12 @@ static int ath10k_pci_hif_tx_sg(struct ath10k *ar, u8 pipe_id,
return
err
;
}
static
int
ath10k_pci_hif_diag_read
(
struct
ath10k
*
ar
,
u32
address
,
void
*
buf
,
size_t
buf_len
)
{
return
ath10k_pci_diag_read_mem
(
ar
,
address
,
buf
,
buf_len
);
}
static
u16
ath10k_pci_hif_get_free_queue_number
(
struct
ath10k
*
ar
,
u8
pipe
)
{
struct
ath10k_pci
*
ar_pci
=
ath10k_pci_priv
(
ar
);
...
...
@@ -986,6 +1006,8 @@ static void ath10k_pci_fw_crashed_dump(struct ath10k *ar)
spin_lock_bh
(
&
ar
->
data_lock
);
ar
->
stats
.
fw_crash_counter
++
;
crash_data
=
ath10k_debug_get_new_fw_crash_data
(
ar
);
if
(
crash_data
)
...
...
@@ -1121,14 +1143,37 @@ static void ath10k_pci_hif_get_default_pipe(struct ath10k *ar,
&
dl_is_polled
);
}
static
void
ath10k_pci_irq_
disable
(
struct
ath10k
*
ar
)
static
void
ath10k_pci_irq_
msi_fw_mask
(
struct
ath10k
*
ar
)
{
struct
ath10k_pci
*
ar_pci
=
ath10k_pci_priv
(
ar
);
int
i
;
u32
val
;
val
=
ath10k_pci_read32
(
ar
,
SOC_CORE_BASE_ADDRESS
+
CORE_CTRL_ADDRESS
);
val
&=
~
CORE_CTRL_PCIE_REG_31_MASK
;
ath10k_pci_write32
(
ar
,
SOC_CORE_BASE_ADDRESS
+
CORE_CTRL_ADDRESS
,
val
);
}
static
void
ath10k_pci_irq_msi_fw_unmask
(
struct
ath10k
*
ar
)
{
u32
val
;
val
=
ath10k_pci_read32
(
ar
,
SOC_CORE_BASE_ADDRESS
+
CORE_CTRL_ADDRESS
);
val
|=
CORE_CTRL_PCIE_REG_31_MASK
;
ath10k_pci_write32
(
ar
,
SOC_CORE_BASE_ADDRESS
+
CORE_CTRL_ADDRESS
,
val
);
}
static
void
ath10k_pci_irq_disable
(
struct
ath10k
*
ar
)
{
ath10k_ce_disable_interrupts
(
ar
);
ath10k_pci_disable_and_clear_legacy_irq
(
ar
);
/* FIXME: How to mask all MSI interrupts? */
ath10k_pci_irq_msi_fw_mask
(
ar
);
}
static
void
ath10k_pci_irq_sync
(
struct
ath10k
*
ar
)
{
struct
ath10k_pci
*
ar_pci
=
ath10k_pci_priv
(
ar
);
int
i
;
for
(
i
=
0
;
i
<
max
(
1
,
ar_pci
->
num_msi_intrs
);
i
++
)
synchronize_irq
(
ar_pci
->
pdev
->
irq
+
i
);
...
...
@@ -1138,7 +1183,7 @@ static void ath10k_pci_irq_enable(struct ath10k *ar)
{
ath10k_ce_enable_interrupts
(
ar
);
ath10k_pci_enable_legacy_irq
(
ar
);
/* FIXME: How to unmask all MSI interrupts? */
ath10k_pci_irq_msi_fw_unmask
(
ar
);
}
static
int
ath10k_pci_hif_start
(
struct
ath10k
*
ar
)
...
...
@@ -1266,6 +1311,7 @@ static void ath10k_pci_hif_stop(struct ath10k *ar)
ath10k_pci_warm_reset
(
ar
);
ath10k_pci_irq_disable
(
ar
);
ath10k_pci_irq_sync
(
ar
);
ath10k_pci_flush
(
ar
);
}
...
...
@@ -1569,23 +1615,40 @@ static int ath10k_pci_init_config(struct ath10k *ar)
return
0
;
}
static
int
ath10k_pci_alloc_
ce
(
struct
ath10k
*
ar
)
static
int
ath10k_pci_alloc_
pipes
(
struct
ath10k
*
ar
)
{
struct
ath10k_pci
*
ar_pci
=
ath10k_pci_priv
(
ar
);
struct
ath10k_pci_pipe
*
pipe
;
int
i
,
ret
;
for
(
i
=
0
;
i
<
CE_COUNT
;
i
++
)
{
ret
=
ath10k_ce_alloc_pipe
(
ar
,
i
,
&
host_ce_config_wlan
[
i
]);
pipe
=
&
ar_pci
->
pipe_info
[
i
];
pipe
->
ce_hdl
=
&
ar_pci
->
ce_states
[
i
];
pipe
->
pipe_num
=
i
;
pipe
->
hif_ce_state
=
ar
;
ret
=
ath10k_ce_alloc_pipe
(
ar
,
i
,
&
host_ce_config_wlan
[
i
],
ath10k_pci_ce_send_done
,
ath10k_pci_ce_recv_data
);
if
(
ret
)
{
ath10k_err
(
ar
,
"failed to allocate copy engine pipe %d: %d
\n
"
,
i
,
ret
);
return
ret
;
}
/* Last CE is Diagnostic Window */
if
(
i
==
CE_COUNT
-
1
)
{
ar_pci
->
ce_diag
=
pipe
->
ce_hdl
;
continue
;
}
pipe
->
buf_sz
=
(
size_t
)(
host_ce_config_wlan
[
i
].
src_sz_max
);
}
return
0
;
}
static
void
ath10k_pci_free_
ce
(
struct
ath10k
*
ar
)
static
void
ath10k_pci_free_
pipes
(
struct
ath10k
*
ar
)
{
int
i
;
...
...
@@ -1593,39 +1656,17 @@ static void ath10k_pci_free_ce(struct ath10k *ar)
ath10k_ce_free_pipe
(
ar
,
i
);
}
static
int
ath10k_pci_
ce_init
(
struct
ath10k
*
ar
)
static
int
ath10k_pci_
init_pipes
(
struct
ath10k
*
ar
)
{
struct
ath10k_pci
*
ar_pci
=
ath10k_pci_priv
(
ar
);
struct
ath10k_pci_pipe
*
pipe_info
;
const
struct
ce_attr
*
attr
;
int
pipe_num
,
ret
;
int
i
,
ret
;
for
(
pipe_num
=
0
;
pipe_num
<
CE_COUNT
;
pipe_num
++
)
{
pipe_info
=
&
ar_pci
->
pipe_info
[
pipe_num
];
pipe_info
->
ce_hdl
=
&
ar_pci
->
ce_states
[
pipe_num
];
pipe_info
->
pipe_num
=
pipe_num
;
pipe_info
->
hif_ce_state
=
ar
;
attr
=
&
host_ce_config_wlan
[
pipe_num
];
ret
=
ath10k_ce_init_pipe
(
ar
,
pipe_num
,
attr
,
ath10k_pci_ce_send_done
,
ath10k_pci_ce_recv_data
);
for
(
i
=
0
;
i
<
CE_COUNT
;
i
++
)
{
ret
=
ath10k_ce_init_pipe
(
ar
,
i
,
&
host_ce_config_wlan
[
i
]);
if
(
ret
)
{
ath10k_err
(
ar
,
"failed to initialize copy engine pipe %d: %d
\n
"
,
pipe_num
,
ret
);
i
,
ret
);
return
ret
;
}
if
(
pipe_num
==
CE_COUNT
-
1
)
{
/*
* Reserve the ultimate CE for
* diagnostic Window support
*/
ar_pci
->
ce_diag
=
pipe_info
->
ce_hdl
;
continue
;
}
pipe_info
->
buf_sz
=
(
size_t
)(
attr
->
src_sz_max
);
}
return
0
;
...
...
@@ -1672,6 +1713,12 @@ static int ath10k_pci_warm_reset(struct ath10k *ar)
ath10k_dbg
(
ar
,
ATH10K_DBG_BOOT
,
"boot warm reset
\n
"
);
spin_lock_bh
(
&
ar
->
data_lock
);
ar
->
stats
.
fw_warm_reset_counter
++
;
spin_unlock_bh
(
&
ar
->
data_lock
);
/* debug */
val
=
ath10k_pci_read32
(
ar
,
SOC_CORE_BASE_ADDRESS
+
PCIE_INTR_CAUSE_ADDRESS
);
...
...
@@ -1773,7 +1820,7 @@ static int __ath10k_pci_hif_power_up(struct ath10k *ar, bool cold_reset)
goto
err
;
}
ret
=
ath10k_pci_
ce_init
(
ar
);
ret
=
ath10k_pci_
init_pipes
(
ar
);
if
(
ret
)
{
ath10k_err
(
ar
,
"failed to initialize CE: %d
\n
"
,
ret
);
goto
err
;
...
...
@@ -1921,6 +1968,7 @@ static int ath10k_pci_hif_resume(struct ath10k *ar)
static
const
struct
ath10k_hif_ops
ath10k_pci_hif_ops
=
{
.
tx_sg
=
ath10k_pci_hif_tx_sg
,
.
diag_read
=
ath10k_pci_hif_diag_read
,
.
exchange_bmi_msg
=
ath10k_pci_hif_exchange_bmi_msg
,
.
start
=
ath10k_pci_hif_start
,
.
stop
=
ath10k_pci_hif_stop
,
...
...
@@ -2250,14 +2298,14 @@ static int ath10k_pci_wait_for_target_init(struct ath10k *ar)
if
(
ar_pci
->
num_msi_intrs
==
0
)
/* Fix potential race by repeating CORE_BASE writes */
ath10k_pci_write32
(
ar
,
SOC_CORE_BASE_ADDRESS
+
PCIE_INTR_ENABLE_ADDRESS
,
PCIE_INTR_FIRMWARE_MASK
|
PCIE_INTR_CE_MASK_ALL
);
ath10k_pci_enable_legacy_irq
(
ar
);
mdelay
(
10
);
}
while
(
time_before
(
jiffies
,
timeout
));
ath10k_pci_disable_and_clear_legacy_irq
(
ar
);
ath10k_pci_irq_msi_fw_mask
(
ar
);
if
(
val
==
0xffffffff
)
{
ath10k_err
(
ar
,
"failed to read device register, device is gone
\n
"
);
return
-
EIO
;
...
...
@@ -2287,6 +2335,12 @@ static int ath10k_pci_cold_reset(struct ath10k *ar)
ath10k_dbg
(
ar
,
ATH10K_DBG_BOOT
,
"boot cold reset
\n
"
);
spin_lock_bh
(
&
ar
->
data_lock
);
ar
->
stats
.
fw_cold_reset_counter
++
;
spin_unlock_bh
(
&
ar
->
data_lock
);
/* Put Target, including PCIe, into RESET. */
val
=
ath10k_pci_reg_read32
(
ar
,
SOC_GLOBAL_RESET_ADDRESS
);
val
|=
1
;
...
...
@@ -2400,6 +2454,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
u32
chip_id
;
ar
=
ath10k_core_create
(
sizeof
(
*
ar_pci
),
&
pdev
->
dev
,
ATH10K_BUS_PCI
,
&
ath10k_pci_hif_ops
);
if
(
!
ar
)
{
dev_err
(
&
pdev
->
dev
,
"failed to allocate core
\n
"
);
...
...
@@ -2435,7 +2490,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
goto
err_sleep
;
}
ret
=
ath10k_pci_alloc_
ce
(
ar
);
ret
=
ath10k_pci_alloc_
pipes
(
ar
);
if
(
ret
)
{
ath10k_err
(
ar
,
"failed to allocate copy engine pipes: %d
\n
"
,
ret
);
...
...
@@ -2443,25 +2498,12 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
}
ath10k_pci_ce_deinit
(
ar
);
ret
=
ath10k_ce_disable_interrupts
(
ar
);
if
(
ret
)
{
ath10k_err
(
ar
,
"failed to disable copy engine interrupts: %d
\n
"
,
ret
);
goto
err_free_ce
;
}
/* Workaround: There's no known way to mask all possible interrupts via
* device CSR. The only way to make sure device doesn't assert
* interrupts is to reset it. Interrupts are then disabled on host
* after handlers are registered.
*/
ath10k_pci_warm_reset
(
ar
);
ath10k_pci_irq_disable
(
ar
);
ret
=
ath10k_pci_init_irq
(
ar
);
if
(
ret
)
{
ath10k_err
(
ar
,
"failed to init irqs: %d
\n
"
,
ret
);
goto
err_free_
ce
;
goto
err_free_
pipes
;
}
ath10k_info
(
ar
,
"pci irq %s interrupts %d irq_mode %d reset_mode %d
\n
"
,
...
...
@@ -2474,9 +2516,6 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
goto
err_deinit_irq
;
}
/* This shouldn't race as the device has been reset above. */
ath10k_pci_irq_disable
(
ar
);
ret
=
ath10k_core_register
(
ar
,
chip_id
);
if
(
ret
)
{
ath10k_err
(
ar
,
"failed to register driver core: %d
\n
"
,
ret
);
...
...
@@ -2492,8 +2531,8 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
err_deinit_irq:
ath10k_pci_deinit_irq
(
ar
);
err_free_
ce
:
ath10k_pci_free_
ce
(
ar
);
err_free_
pipes
:
ath10k_pci_free_
pipes
(
ar
);
err_sleep:
ath10k_pci_sleep
(
ar
);
...
...
@@ -2527,7 +2566,7 @@ static void ath10k_pci_remove(struct pci_dev *pdev)
ath10k_pci_kill_tasklet
(
ar
);
ath10k_pci_deinit_irq
(
ar
);
ath10k_pci_ce_deinit
(
ar
);
ath10k_pci_free_
ce
(
ar
);
ath10k_pci_free_
pipes
(
ar
);
ath10k_pci_sleep
(
ar
);
ath10k_pci_release
(
ar
);
ath10k_core_destroy
(
ar
);
...
...
@@ -2565,5 +2604,7 @@ module_exit(ath10k_pci_exit);
MODULE_AUTHOR
(
"Qualcomm Atheros"
);
MODULE_DESCRIPTION
(
"Driver support for Atheros QCA988X PCIe devices"
);
MODULE_LICENSE
(
"Dual BSD/GPL"
);
MODULE_FIRMWARE
(
QCA988X_HW_2_0_FW_DIR
"/"
QCA988X_HW_2_0_FW_3_FILE
);
MODULE_FIRMWARE
(
QCA988X_HW_2_0_FW_DIR
"/"
QCA988X_HW_2_0_FW_FILE
);
MODULE_FIRMWARE
(
QCA988X_HW_2_0_FW_DIR
"/"
ATH10K_FW_API2_FILE
);
MODULE_FIRMWARE
(
QCA988X_HW_2_0_FW_DIR
"/"
ATH10K_FW_API3_FILE
);
MODULE_FIRMWARE
(
QCA988X_HW_2_0_FW_DIR
"/"
QCA988X_HW_2_0_BOARD_DATA_FILE
);
drivers/net/wireless/ath/ath10k/spectral.c
浏览文件 @
490f0dc4
...
...
@@ -56,14 +56,14 @@ static uint8_t get_max_exp(s8 max_index, u16 max_magnitude, size_t bin_len,
}
int
ath10k_spectral_process_fft
(
struct
ath10k
*
ar
,
struct
wmi_single_phyerr_rx_event
*
event
,
struct
phyerr_fft_report
*
fftr
,
const
struct
wmi_phyerr
*
phyerr
,
const
struct
phyerr_fft_report
*
fftr
,
size_t
bin_len
,
u64
tsf
)
{
struct
fft_sample_ath10k
*
fft_sample
;
u8
buf
[
sizeof
(
*
fft_sample
)
+
SPECTRAL_ATH10K_MAX_NUM_BINS
];
u16
freq1
,
freq2
,
total_gain_db
,
base_pwr_db
,
length
,
peak_mag
;
u32
reg0
,
reg1
,
nf_list1
,
nf_list2
;
u32
reg0
,
reg1
;
u8
chain_idx
,
*
bins
;
int
dc_pos
;
...
...
@@ -82,7 +82,7 @@ int ath10k_spectral_process_fft(struct ath10k *ar,
/* TODO: there might be a reason why the hardware reports 20/40/80 MHz,
* but the results/plots suggest that its actually 22/44/88 MHz.
*/
switch
(
event
->
hdr
.
chan_width_mhz
)
{
switch
(
phyerr
->
chan_width_mhz
)
{
case
20
:
fft_sample
->
chan_width_mhz
=
22
;
break
;
...
...
@@ -101,7 +101,7 @@ int ath10k_spectral_process_fft(struct ath10k *ar,
fft_sample
->
chan_width_mhz
=
88
;
break
;
default:
fft_sample
->
chan_width_mhz
=
event
->
hdr
.
chan_width_mhz
;
fft_sample
->
chan_width_mhz
=
phyerr
->
chan_width_mhz
;
}
fft_sample
->
relpwr_db
=
MS
(
reg1
,
SEARCH_FFT_REPORT_REG1_RELPWR_DB
);
...
...
@@ -110,36 +110,22 @@ int ath10k_spectral_process_fft(struct ath10k *ar,
peak_mag
=
MS
(
reg1
,
SEARCH_FFT_REPORT_REG1_PEAK_MAG
);
fft_sample
->
max_magnitude
=
__cpu_to_be16
(
peak_mag
);
fft_sample
->
max_index
=
MS
(
reg0
,
SEARCH_FFT_REPORT_REG0_PEAK_SIDX
);
fft_sample
->
rssi
=
event
->
hdr
.
rssi_combined
;
fft_sample
->
rssi
=
phyerr
->
rssi_combined
;
total_gain_db
=
MS
(
reg0
,
SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB
);
base_pwr_db
=
MS
(
reg0
,
SEARCH_FFT_REPORT_REG0_BASE_PWR_DB
);
fft_sample
->
total_gain_db
=
__cpu_to_be16
(
total_gain_db
);
fft_sample
->
base_pwr_db
=
__cpu_to_be16
(
base_pwr_db
);
freq1
=
__le16_to_cpu
(
event
->
hdr
.
freq1
);
freq2
=
__le16_to_cpu
(
event
->
hdr
.
freq2
);
freq1
=
__le16_to_cpu
(
phyerr
->
freq1
);
freq2
=
__le16_to_cpu
(
phyerr
->
freq2
);
fft_sample
->
freq1
=
__cpu_to_be16
(
freq1
);
fft_sample
->
freq2
=
__cpu_to_be16
(
freq2
);
nf_list1
=
__le32_to_cpu
(
event
->
hdr
.
nf_list_1
);
nf_list2
=
__le32_to_cpu
(
event
->
hdr
.
nf_list_2
);
chain_idx
=
MS
(
reg0
,
SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX
);
switch
(
chain_idx
)
{
case
0
:
fft_sample
->
noise
=
__cpu_to_be16
(
nf_list1
&
0xffffu
);
break
;
case
1
:
fft_sample
->
noise
=
__cpu_to_be16
((
nf_list1
>>
16
)
&
0xffffu
);
break
;
case
2
:
fft_sample
->
noise
=
__cpu_to_be16
(
nf_list2
&
0xffffu
);
break
;
case
3
:
fft_sample
->
noise
=
__cpu_to_be16
((
nf_list2
>>
16
)
&
0xffffu
);
break
;
}
fft_sample
->
noise
=
__cpu_to_be16
(
__le16_to_cpu
(
phyerr
->
nf_chains
[
chain_idx
]));
bins
=
(
u8
*
)
fftr
;
bins
+=
sizeof
(
*
fftr
);
...
...
drivers/net/wireless/ath/ath10k/spectral.h
浏览文件 @
490f0dc4
...
...
@@ -47,8 +47,8 @@ enum ath10k_spectral_mode {
#ifdef CONFIG_ATH10K_DEBUGFS
int
ath10k_spectral_process_fft
(
struct
ath10k
*
ar
,
struct
wmi_single_phyerr_rx_event
*
event
,
struct
phyerr_fft_report
*
fftr
,
const
struct
wmi_phyerr
*
phyerr
,
const
struct
phyerr_fft_report
*
fftr
,
size_t
bin_len
,
u64
tsf
);
int
ath10k_spectral_start
(
struct
ath10k
*
ar
);
int
ath10k_spectral_vif_stop
(
struct
ath10k_vif
*
arvif
);
...
...
@@ -59,8 +59,8 @@ void ath10k_spectral_destroy(struct ath10k *ar);
static
inline
int
ath10k_spectral_process_fft
(
struct
ath10k
*
ar
,
struct
wmi_single_phyerr_rx_event
*
event
,
struct
phyerr_fft_report
*
fftr
,
const
struct
wmi_phyerr
*
phyerr
,
const
struct
phyerr_fft_report
*
fftr
,
size_t
bin_len
,
u64
tsf
)
{
return
0
;
...
...
drivers/net/wireless/ath/ath10k/trace.h
浏览文件 @
490f0dc4
...
...
@@ -254,6 +254,169 @@ TRACE_EVENT(ath10k_wmi_dbglog,
)
);
TRACE_EVENT
(
ath10k_htt_pktlog
,
TP_PROTO
(
struct
ath10k
*
ar
,
void
*
buf
,
u16
buf_len
),
TP_ARGS
(
ar
,
buf
,
buf_len
),
TP_STRUCT__entry
(
__string
(
device
,
dev_name
(
ar
->
dev
))
__string
(
driver
,
dev_driver_string
(
ar
->
dev
))
__field
(
u16
,
buf_len
)
__dynamic_array
(
u8
,
pktlog
,
buf_len
)
),
TP_fast_assign
(
__assign_str
(
device
,
dev_name
(
ar
->
dev
));
__assign_str
(
driver
,
dev_driver_string
(
ar
->
dev
));
__entry
->
buf_len
=
buf_len
;
memcpy
(
__get_dynamic_array
(
pktlog
),
buf
,
buf_len
);
),
TP_printk
(
"%s %s size %hu"
,
__get_str
(
driver
),
__get_str
(
device
),
__entry
->
buf_len
)
);
TRACE_EVENT
(
ath10k_htt_rx_desc
,
TP_PROTO
(
struct
ath10k
*
ar
,
u32
tsf
,
void
*
rxdesc
,
u16
len
),
TP_ARGS
(
ar
,
tsf
,
rxdesc
,
len
),
TP_STRUCT__entry
(
__string
(
device
,
dev_name
(
ar
->
dev
))
__string
(
driver
,
dev_driver_string
(
ar
->
dev
))
__field
(
u32
,
tsf
)
__field
(
u16
,
len
)
__dynamic_array
(
u8
,
rxdesc
,
len
)
),
TP_fast_assign
(
__assign_str
(
device
,
dev_name
(
ar
->
dev
));
__assign_str
(
driver
,
dev_driver_string
(
ar
->
dev
));
__entry
->
tsf
=
tsf
;
__entry
->
len
=
len
;
memcpy
(
__get_dynamic_array
(
rxdesc
),
rxdesc
,
len
);
),
TP_printk
(
"%s %s %u len %hu"
,
__get_str
(
driver
),
__get_str
(
device
),
__entry
->
tsf
,
__entry
->
len
)
);
TRACE_EVENT
(
ath10k_htt_tx
,
TP_PROTO
(
struct
ath10k
*
ar
,
u16
msdu_id
,
u16
msdu_len
,
u8
vdev_id
,
u8
tid
),
TP_ARGS
(
ar
,
msdu_id
,
msdu_len
,
vdev_id
,
tid
),
TP_STRUCT__entry
(
__string
(
device
,
dev_name
(
ar
->
dev
))
__string
(
driver
,
dev_driver_string
(
ar
->
dev
))
__field
(
u16
,
msdu_id
)
__field
(
u16
,
msdu_len
)
__field
(
u8
,
vdev_id
)
__field
(
u8
,
tid
)
),
TP_fast_assign
(
__assign_str
(
device
,
dev_name
(
ar
->
dev
));
__assign_str
(
driver
,
dev_driver_string
(
ar
->
dev
));
__entry
->
msdu_id
=
msdu_id
;
__entry
->
msdu_len
=
msdu_len
;
__entry
->
vdev_id
=
vdev_id
;
__entry
->
tid
=
tid
;
),
TP_printk
(
"%s %s msdu_id %d msdu_len %d vdev_id %d tid %d"
,
__get_str
(
driver
),
__get_str
(
device
),
__entry
->
msdu_id
,
__entry
->
msdu_len
,
__entry
->
vdev_id
,
__entry
->
tid
)
);
TRACE_EVENT
(
ath10k_txrx_tx_unref
,
TP_PROTO
(
struct
ath10k
*
ar
,
u16
msdu_id
),
TP_ARGS
(
ar
,
msdu_id
),
TP_STRUCT__entry
(
__string
(
device
,
dev_name
(
ar
->
dev
))
__string
(
driver
,
dev_driver_string
(
ar
->
dev
))
__field
(
u16
,
msdu_id
)
),
TP_fast_assign
(
__assign_str
(
device
,
dev_name
(
ar
->
dev
));
__assign_str
(
driver
,
dev_driver_string
(
ar
->
dev
));
__entry
->
msdu_id
=
msdu_id
;
),
TP_printk
(
"%s %s msdu_id %d"
,
__get_str
(
driver
),
__get_str
(
device
),
__entry
->
msdu_id
)
);
DECLARE_EVENT_CLASS
(
ath10k_data_event
,
TP_PROTO
(
struct
ath10k
*
ar
,
void
*
data
,
size_t
len
),
TP_ARGS
(
ar
,
data
,
len
),
TP_STRUCT__entry
(
__string
(
device
,
dev_name
(
ar
->
dev
))
__string
(
driver
,
dev_driver_string
(
ar
->
dev
))
__field
(
size_t
,
len
)
__dynamic_array
(
u8
,
data
,
len
)
),
TP_fast_assign
(
__assign_str
(
device
,
dev_name
(
ar
->
dev
));
__assign_str
(
driver
,
dev_driver_string
(
ar
->
dev
));
__entry
->
len
=
len
;
memcpy
(
__get_dynamic_array
(
data
),
data
,
len
);
),
TP_printk
(
"%s %s len %zu
\n
"
,
__get_str
(
driver
),
__get_str
(
device
),
__entry
->
len
)
);
DEFINE_EVENT
(
ath10k_data_event
,
ath10k_htt_tx_msdu
,
TP_PROTO
(
struct
ath10k
*
ar
,
void
*
data
,
size_t
len
),
TP_ARGS
(
ar
,
data
,
len
)
);
DEFINE_EVENT
(
ath10k_data_event
,
ath10k_htt_rx_pop_msdu
,
TP_PROTO
(
struct
ath10k
*
ar
,
void
*
data
,
size_t
len
),
TP_ARGS
(
ar
,
data
,
len
)
);
DEFINE_EVENT
(
ath10k_data_event
,
ath10k_wmi_mgmt_tx
,
TP_PROTO
(
struct
ath10k
*
ar
,
void
*
data
,
size_t
len
),
TP_ARGS
(
ar
,
data
,
len
)
);
DEFINE_EVENT
(
ath10k_data_event
,
ath10k_wmi_bcn_tx
,
TP_PROTO
(
struct
ath10k
*
ar
,
void
*
data
,
size_t
len
),
TP_ARGS
(
ar
,
data
,
len
)
);
#endif
/* _TRACE_H_ || TRACE_HEADER_MULTI_READ*/
/* we don't want to use include/trace/events */
...
...
drivers/net/wireless/ath/ath10k/txrx.c
浏览文件 @
490f0dc4
...
...
@@ -78,6 +78,7 @@ void ath10k_txrx_tx_unref(struct ath10k_htt *htt,
info
=
IEEE80211_SKB_CB
(
msdu
);
memset
(
&
info
->
status
,
0
,
sizeof
(
info
->
status
));
trace_ath10k_txrx_tx_unref
(
ar
,
tx_done
->
msdu_id
);
if
(
tx_done
->
discard
)
{
ieee80211_free_txskb
(
htt
->
ar
->
hw
,
msdu
);
...
...
drivers/net/wireless/ath/ath10k/wmi.c
浏览文件 @
490f0dc4
此差异已折叠。
点击以展开。
drivers/net/wireless/ath/ath10k/wmi.h
浏览文件 @
490f0dc4
此差异已折叠。
点击以展开。
drivers/net/wireless/ath/ath6kl/common.h
浏览文件 @
490f0dc4
...
...
@@ -22,7 +22,7 @@
#define ATH6KL_MAX_IE 256
__printf
(
2
,
3
)
int
ath6kl_printk
(
const
char
*
level
,
const
char
*
fmt
,
...);
__printf
(
2
,
3
)
void
ath6kl_printk
(
const
char
*
level
,
const
char
*
fmt
,
...);
/*
* Reflects the version of binary interface exposed by ATH6KL target
...
...
drivers/net/wireless/ath/ath6kl/debug.c
浏览文件 @
490f0dc4
此差异已折叠。
点击以展开。
drivers/net/wireless/ath/ath6kl/debug.h
浏览文件 @
490f0dc4
...
...
@@ -50,10 +50,10 @@ enum ATH6K_DEBUG_MASK {
};
extern
unsigned
int
debug_mask
;
__printf
(
2
,
3
)
int
ath6kl_printk
(
const
char
*
level
,
const
char
*
fmt
,
...);
__printf
(
1
,
2
)
int
ath6kl_info
(
const
char
*
fmt
,
...);
__printf
(
1
,
2
)
int
ath6kl_err
(
const
char
*
fmt
,
...);
__printf
(
1
,
2
)
int
ath6kl_warn
(
const
char
*
fmt
,
...);
__printf
(
2
,
3
)
void
ath6kl_printk
(
const
char
*
level
,
const
char
*
fmt
,
...);
__printf
(
1
,
2
)
void
ath6kl_info
(
const
char
*
fmt
,
...);
__printf
(
1
,
2
)
void
ath6kl_err
(
const
char
*
fmt
,
...);
__printf
(
1
,
2
)
void
ath6kl_warn
(
const
char
*
fmt
,
...);
enum
ath6kl_war
{
ATH6KL_WAR_INVALID_RATE
,
...
...
@@ -81,10 +81,9 @@ int ath6kl_debug_init_fs(struct ath6kl *ar);
void
ath6kl_debug_cleanup
(
struct
ath6kl
*
ar
);
#else
static
inline
int
ath6kl_dbg
(
enum
ATH6K_DEBUG_MASK
dbg_mask
,
const
char
*
fmt
,
...)
static
inline
void
ath6kl_dbg
(
enum
ATH6K_DEBUG_MASK
dbg_mask
,
const
char
*
fmt
,
...)
{
return
0
;
}
static
inline
void
ath6kl_dbg_dump
(
enum
ATH6K_DEBUG_MASK
mask
,
...
...
drivers/net/wireless/ath/wil6210/wil6210.h
浏览文件 @
490f0dc4
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录