Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
cbe1bc23
Commit
cbe1bc23
authored
Dec 01, 2014
by
John W. Linville
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'for-linville' of
git://github.com/kvalo/ath
parents
992066c8
fe2407a8
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1257 additions
and
749 deletions
+1257
-749
drivers/net/wireless/ath/ath10k/core.c
drivers/net/wireless/ath/ath10k/core.c
+13
-0
drivers/net/wireless/ath/ath10k/core.h
drivers/net/wireless/ath/ath10k/core.h
+11
-2
drivers/net/wireless/ath/ath10k/debug.c
drivers/net/wireless/ath/ath10k/debug.c
+248
-14
drivers/net/wireless/ath/ath10k/debug.h
drivers/net/wireless/ath/ath10k/debug.h
+1
-9
drivers/net/wireless/ath/ath10k/hif.h
drivers/net/wireless/ath/ath10k/hif.h
+39
-4
drivers/net/wireless/ath/ath10k/htc.c
drivers/net/wireless/ath/ath10k/htc.c
+8
-5
drivers/net/wireless/ath/ath10k/htt.h
drivers/net/wireless/ath/ath10k/htt.h
+6
-1
drivers/net/wireless/ath/ath10k/htt_rx.c
drivers/net/wireless/ath/ath10k/htt_rx.c
+594
-575
drivers/net/wireless/ath/ath10k/htt_tx.c
drivers/net/wireless/ath/ath10k/htt_tx.c
+4
-3
drivers/net/wireless/ath/ath10k/hw.h
drivers/net/wireless/ath/ath10k/hw.h
+10
-5
drivers/net/wireless/ath/ath10k/mac.c
drivers/net/wireless/ath/ath10k/mac.c
+162
-40
drivers/net/wireless/ath/ath10k/mac.h
drivers/net/wireless/ath/ath10k/mac.h
+4
-0
drivers/net/wireless/ath/ath10k/pci.c
drivers/net/wireless/ath/ath10k/pci.c
+20
-8
drivers/net/wireless/ath/ath10k/trace.h
drivers/net/wireless/ath/ath10k/trace.h
+17
-14
drivers/net/wireless/ath/ath10k/wmi.c
drivers/net/wireless/ath/ath10k/wmi.c
+52
-9
drivers/net/wireless/ath/ath10k/wmi.h
drivers/net/wireless/ath/ath10k/wmi.h
+68
-60
No files found.
drivers/net/wireless/ath/ath10k/core.c
View file @
cbe1bc23
...
@@ -799,6 +799,17 @@ static void ath10k_core_restart(struct work_struct *work)
...
@@ -799,6 +799,17 @@ static void ath10k_core_restart(struct work_struct *work)
mutex_unlock
(
&
ar
->
conf_mutex
);
mutex_unlock
(
&
ar
->
conf_mutex
);
}
}
static
void
ath10k_core_init_max_sta_count
(
struct
ath10k
*
ar
)
{
if
(
test_bit
(
ATH10K_FW_FEATURE_WMI_10X
,
ar
->
fw_features
))
{
ar
->
max_num_peers
=
TARGET_10X_NUM_PEERS
;
ar
->
max_num_stations
=
TARGET_10X_NUM_STATIONS
;
}
else
{
ar
->
max_num_peers
=
TARGET_NUM_PEERS
;
ar
->
max_num_stations
=
TARGET_NUM_STATIONS
;
}
}
int
ath10k_core_start
(
struct
ath10k
*
ar
,
enum
ath10k_firmware_mode
mode
)
int
ath10k_core_start
(
struct
ath10k
*
ar
,
enum
ath10k_firmware_mode
mode
)
{
{
int
status
;
int
status
;
...
@@ -1035,6 +1046,8 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
...
@@ -1035,6 +1046,8 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
return
ret
;
return
ret
;
}
}
ath10k_core_init_max_sta_count
(
ar
);
mutex_lock
(
&
ar
->
conf_mutex
);
mutex_lock
(
&
ar
->
conf_mutex
);
ret
=
ath10k_core_start
(
ar
,
ATH10K_FIRMWARE_MODE_NORMAL
);
ret
=
ath10k_core_start
(
ar
,
ATH10K_FIRMWARE_MODE_NORMAL
);
...
...
drivers/net/wireless/ath/ath10k/core.h
View file @
cbe1bc23
...
@@ -79,10 +79,12 @@ static inline const char *ath10k_bus_str(enum ath10k_bus bus)
...
@@ -79,10 +79,12 @@ static inline const char *ath10k_bus_str(enum ath10k_bus bus)
struct
ath10k_skb_cb
{
struct
ath10k_skb_cb
{
dma_addr_t
paddr
;
dma_addr_t
paddr
;
u8
eid
;
u8
vdev_id
;
u8
vdev_id
;
struct
{
struct
{
u8
tid
;
u8
tid
;
u16
freq
;
bool
is_offchan
;
bool
is_offchan
;
struct
ath10k_htt_txbuf
*
txbuf
;
struct
ath10k_htt_txbuf
*
txbuf
;
u32
txbuf_paddr
;
u32
txbuf_paddr
;
...
@@ -122,6 +124,7 @@ struct ath10k_wmi {
...
@@ -122,6 +124,7 @@ struct ath10k_wmi {
struct
completion
service_ready
;
struct
completion
service_ready
;
struct
completion
unified_ready
;
struct
completion
unified_ready
;
wait_queue_head_t
tx_credits_wq
;
wait_queue_head_t
tx_credits_wq
;
DECLARE_BITMAP
(
svc_map
,
WMI_SERVICE_MAX
);
struct
wmi_cmd_map
*
cmd
;
struct
wmi_cmd_map
*
cmd
;
struct
wmi_vdev_param_map
*
vdev_param
;
struct
wmi_vdev_param_map
*
vdev_param
;
struct
wmi_pdev_param_map
*
pdev_param
;
struct
wmi_pdev_param_map
*
pdev_param
;
...
@@ -218,6 +221,8 @@ struct ath10k_peer {
...
@@ -218,6 +221,8 @@ struct ath10k_peer {
int
vdev_id
;
int
vdev_id
;
u8
addr
[
ETH_ALEN
];
u8
addr
[
ETH_ALEN
];
DECLARE_BITMAP
(
peer_ids
,
ATH10K_MAX_NUM_PEER_IDS
);
DECLARE_BITMAP
(
peer_ids
,
ATH10K_MAX_NUM_PEER_IDS
);
/* protected by ar->data_lock */
struct
ieee80211_key_conf
*
keys
[
WMI_MAX_KEY_INDEX
+
1
];
struct
ieee80211_key_conf
*
keys
[
WMI_MAX_KEY_INDEX
+
1
];
};
};
...
@@ -310,7 +315,6 @@ struct ath10k_debug {
...
@@ -310,7 +315,6 @@ struct ath10k_debug {
struct
ath10k_fw_stats
fw_stats
;
struct
ath10k_fw_stats
fw_stats
;
struct
completion
fw_stats_complete
;
struct
completion
fw_stats_complete
;
bool
fw_stats_done
;
bool
fw_stats_done
;
DECLARE_BITMAP
(
wmi_service_bitmap
,
WMI_SERVICE_MAX
);
unsigned
long
htt_stats_mask
;
unsigned
long
htt_stats_mask
;
struct
delayed_work
htt_stats_dwork
;
struct
delayed_work
htt_stats_dwork
;
...
@@ -320,6 +324,7 @@ struct ath10k_debug {
...
@@ -320,6 +324,7 @@ struct ath10k_debug {
/* protected by conf_mutex */
/* protected by conf_mutex */
u32
fw_dbglog_mask
;
u32
fw_dbglog_mask
;
u32
pktlog_filter
;
u32
pktlog_filter
;
u32
reg_addr
;
u8
htt_max_amsdu
;
u8
htt_max_amsdu
;
u8
htt_max_ampdu
;
u8
htt_max_ampdu
;
...
@@ -560,8 +565,12 @@ struct ath10k {
...
@@ -560,8 +565,12 @@ struct ath10k {
struct
list_head
peers
;
struct
list_head
peers
;
wait_queue_head_t
peer_mapping_wq
;
wait_queue_head_t
peer_mapping_wq
;
/*
number of created peers; protected by data_lock
*/
/*
protected by conf_mutex
*/
int
num_peers
;
int
num_peers
;
int
num_stations
;
int
max_num_peers
;
int
max_num_stations
;
struct
work_struct
offchan_tx_work
;
struct
work_struct
offchan_tx_work
;
struct
sk_buff_head
offchan_tx_queue
;
struct
sk_buff_head
offchan_tx_queue
;
...
...
drivers/net/wireless/ath/ath10k/debug.c
View file @
cbe1bc23
...
@@ -17,9 +17,8 @@
...
@@ -17,9 +17,8 @@
#include <linux/module.h>
#include <linux/module.h>
#include <linux/debugfs.h>
#include <linux/debugfs.h>
#include <linux/version.h>
#include <linux/vermagic.h>
#include <linux/vmalloc.h>
#include <linux/vmalloc.h>
#include <linux/utsname.h>
#include "core.h"
#include "core.h"
#include "debug.h"
#include "debug.h"
...
@@ -124,7 +123,7 @@ EXPORT_SYMBOL(ath10k_info);
...
@@ -124,7 +123,7 @@ EXPORT_SYMBOL(ath10k_info);
void
ath10k_print_driver_info
(
struct
ath10k
*
ar
)
void
ath10k_print_driver_info
(
struct
ath10k
*
ar
)
{
{
ath10k_info
(
ar
,
"%s (0x%08x, 0x%08x) fw %s api %d htt %d.%d wmi %d.%d.%d.%d cal %s
\n
"
,
ath10k_info
(
ar
,
"%s (0x%08x, 0x%08x) fw %s api %d htt %d.%d wmi %d.%d.%d.%d cal %s
max_sta %d
\n
"
,
ar
->
hw_params
.
name
,
ar
->
hw_params
.
name
,
ar
->
target_version
,
ar
->
target_version
,
ar
->
chip_id
,
ar
->
chip_id
,
...
@@ -136,7 +135,8 @@ void ath10k_print_driver_info(struct ath10k *ar)
...
@@ -136,7 +135,8 @@ void ath10k_print_driver_info(struct ath10k *ar)
ar
->
fw_version_minor
,
ar
->
fw_version_minor
,
ar
->
fw_version_release
,
ar
->
fw_version_release
,
ar
->
fw_version_build
,
ar
->
fw_version_build
,
ath10k_cal_mode_str
(
ar
->
cal_mode
));
ath10k_cal_mode_str
(
ar
->
cal_mode
),
ar
->
max_num_stations
);
ath10k_info
(
ar
,
"debug %d debugfs %d tracing %d dfs %d testmode %d
\n
"
,
ath10k_info
(
ar
,
"debug %d debugfs %d tracing %d dfs %d testmode %d
\n
"
,
config_enabled
(
CONFIG_ATH10K_DEBUG
),
config_enabled
(
CONFIG_ATH10K_DEBUG
),
config_enabled
(
CONFIG_ATH10K_DEBUGFS
),
config_enabled
(
CONFIG_ATH10K_DEBUGFS
),
...
@@ -179,13 +179,6 @@ EXPORT_SYMBOL(ath10k_warn);
...
@@ -179,13 +179,6 @@ EXPORT_SYMBOL(ath10k_warn);
#ifdef CONFIG_ATH10K_DEBUGFS
#ifdef CONFIG_ATH10K_DEBUGFS
void
ath10k_debug_read_service_map
(
struct
ath10k
*
ar
,
const
void
*
service_map
,
size_t
map_size
)
{
memcpy
(
ar
->
debug
.
wmi_service_bitmap
,
service_map
,
map_size
);
}
static
ssize_t
ath10k_read_wmi_services
(
struct
file
*
file
,
static
ssize_t
ath10k_read_wmi_services
(
struct
file
*
file
,
char
__user
*
user_buf
,
char
__user
*
user_buf
,
size_t
count
,
loff_t
*
ppos
)
size_t
count
,
loff_t
*
ppos
)
...
@@ -207,8 +200,9 @@ static ssize_t ath10k_read_wmi_services(struct file *file,
...
@@ -207,8 +200,9 @@ static ssize_t ath10k_read_wmi_services(struct file *file,
if
(
len
>
buf_len
)
if
(
len
>
buf_len
)
len
=
buf_len
;
len
=
buf_len
;
spin_lock_bh
(
&
ar
->
data_lock
);
for
(
i
=
0
;
i
<
WMI_SERVICE_MAX
;
i
++
)
{
for
(
i
=
0
;
i
<
WMI_SERVICE_MAX
;
i
++
)
{
enabled
=
test_bit
(
i
,
ar
->
debug
.
wmi_service_bit
map
);
enabled
=
test_bit
(
i
,
ar
->
wmi
.
svc_
map
);
name
=
wmi_service_name
(
i
);
name
=
wmi_service_name
(
i
);
if
(
!
name
)
{
if
(
!
name
)
{
...
@@ -224,6 +218,7 @@ static ssize_t ath10k_read_wmi_services(struct file *file,
...
@@ -224,6 +218,7 @@ static ssize_t ath10k_read_wmi_services(struct file *file,
"%-40s %s
\n
"
,
"%-40s %s
\n
"
,
name
,
enabled
?
"enabled"
:
"-"
);
name
,
enabled
?
"enabled"
:
"-"
);
}
}
spin_unlock_bh
(
&
ar
->
data_lock
);
ret_cnt
=
simple_read_from_buffer
(
user_buf
,
count
,
ppos
,
buf
,
len
);
ret_cnt
=
simple_read_from_buffer
(
user_buf
,
count
,
ppos
,
buf
,
len
);
...
@@ -866,8 +861,8 @@ static struct ath10k_dump_file_data *ath10k_build_dump_file(struct ath10k *ar)
...
@@ -866,8 +861,8 @@ static struct ath10k_dump_file_data *ath10k_build_dump_file(struct ath10k *ar)
strlcpy
(
dump_data
->
fw_ver
,
ar
->
hw
->
wiphy
->
fw_version
,
strlcpy
(
dump_data
->
fw_ver
,
ar
->
hw
->
wiphy
->
fw_version
,
sizeof
(
dump_data
->
fw_ver
));
sizeof
(
dump_data
->
fw_ver
));
dump_data
->
kernel_ver_code
=
cpu_to_le32
(
LINUX_VERSION_CODE
)
;
dump_data
->
kernel_ver_code
=
0
;
strlcpy
(
dump_data
->
kernel_ver
,
VERMAGIC_STRING
,
strlcpy
(
dump_data
->
kernel_ver
,
init_utsname
()
->
release
,
sizeof
(
dump_data
->
kernel_ver
));
sizeof
(
dump_data
->
kernel_ver
));
dump_data
->
tv_sec
=
cpu_to_le64
(
crash_data
->
timestamp
.
tv_sec
);
dump_data
->
tv_sec
=
cpu_to_le64
(
crash_data
->
timestamp
.
tv_sec
);
...
@@ -929,6 +924,236 @@ static const struct file_operations fops_fw_crash_dump = {
...
@@ -929,6 +924,236 @@ static const struct file_operations fops_fw_crash_dump = {
.
llseek
=
default_llseek
,
.
llseek
=
default_llseek
,
};
};
static
ssize_t
ath10k_reg_addr_read
(
struct
file
*
file
,
char
__user
*
user_buf
,
size_t
count
,
loff_t
*
ppos
)
{
struct
ath10k
*
ar
=
file
->
private_data
;
u8
buf
[
32
];
unsigned
int
len
=
0
;
u32
reg_addr
;
mutex_lock
(
&
ar
->
conf_mutex
);
reg_addr
=
ar
->
debug
.
reg_addr
;
mutex_unlock
(
&
ar
->
conf_mutex
);
len
+=
scnprintf
(
buf
+
len
,
sizeof
(
buf
)
-
len
,
"0x%x
\n
"
,
reg_addr
);
return
simple_read_from_buffer
(
user_buf
,
count
,
ppos
,
buf
,
len
);
}
static
ssize_t
ath10k_reg_addr_write
(
struct
file
*
file
,
const
char
__user
*
user_buf
,
size_t
count
,
loff_t
*
ppos
)
{
struct
ath10k
*
ar
=
file
->
private_data
;
u32
reg_addr
;
int
ret
;
ret
=
kstrtou32_from_user
(
user_buf
,
count
,
0
,
&
reg_addr
);
if
(
ret
)
return
ret
;
if
(
!
IS_ALIGNED
(
reg_addr
,
4
))
return
-
EFAULT
;
mutex_lock
(
&
ar
->
conf_mutex
);
ar
->
debug
.
reg_addr
=
reg_addr
;
mutex_unlock
(
&
ar
->
conf_mutex
);
return
count
;
}
static
const
struct
file_operations
fops_reg_addr
=
{
.
read
=
ath10k_reg_addr_read
,
.
write
=
ath10k_reg_addr_write
,
.
open
=
simple_open
,
.
owner
=
THIS_MODULE
,
.
llseek
=
default_llseek
,
};
static
ssize_t
ath10k_reg_value_read
(
struct
file
*
file
,
char
__user
*
user_buf
,
size_t
count
,
loff_t
*
ppos
)
{
struct
ath10k
*
ar
=
file
->
private_data
;
u8
buf
[
48
];
unsigned
int
len
;
u32
reg_addr
,
reg_val
;
int
ret
;
mutex_lock
(
&
ar
->
conf_mutex
);
if
(
ar
->
state
!=
ATH10K_STATE_ON
&&
ar
->
state
!=
ATH10K_STATE_UTF
)
{
ret
=
-
ENETDOWN
;
goto
exit
;
}
reg_addr
=
ar
->
debug
.
reg_addr
;
reg_val
=
ath10k_hif_read32
(
ar
,
reg_addr
);
len
=
scnprintf
(
buf
,
sizeof
(
buf
),
"0x%08x:0x%08x
\n
"
,
reg_addr
,
reg_val
);
ret
=
simple_read_from_buffer
(
user_buf
,
count
,
ppos
,
buf
,
len
);
exit:
mutex_unlock
(
&
ar
->
conf_mutex
);
return
ret
;
}
static
ssize_t
ath10k_reg_value_write
(
struct
file
*
file
,
const
char
__user
*
user_buf
,
size_t
count
,
loff_t
*
ppos
)
{
struct
ath10k
*
ar
=
file
->
private_data
;
u32
reg_addr
,
reg_val
;
int
ret
;
mutex_lock
(
&
ar
->
conf_mutex
);
if
(
ar
->
state
!=
ATH10K_STATE_ON
&&
ar
->
state
!=
ATH10K_STATE_UTF
)
{
ret
=
-
ENETDOWN
;
goto
exit
;
}
reg_addr
=
ar
->
debug
.
reg_addr
;
ret
=
kstrtou32_from_user
(
user_buf
,
count
,
0
,
&
reg_val
);
if
(
ret
)
goto
exit
;
ath10k_hif_write32
(
ar
,
reg_addr
,
reg_val
);
ret
=
count
;
exit:
mutex_unlock
(
&
ar
->
conf_mutex
);
return
ret
;
}
static
const
struct
file_operations
fops_reg_value
=
{
.
read
=
ath10k_reg_value_read
,
.
write
=
ath10k_reg_value_write
,
.
open
=
simple_open
,
.
owner
=
THIS_MODULE
,
.
llseek
=
default_llseek
,
};
static
ssize_t
ath10k_mem_value_read
(
struct
file
*
file
,
char
__user
*
user_buf
,
size_t
count
,
loff_t
*
ppos
)
{
struct
ath10k
*
ar
=
file
->
private_data
;
u8
*
buf
;
int
ret
;
if
(
*
ppos
<
0
)
return
-
EINVAL
;
if
(
!
count
)
return
0
;
mutex_lock
(
&
ar
->
conf_mutex
);
buf
=
vmalloc
(
count
);
if
(
!
buf
)
{
ret
=
-
ENOMEM
;
goto
exit
;
}
if
(
ar
->
state
!=
ATH10K_STATE_ON
&&
ar
->
state
!=
ATH10K_STATE_UTF
)
{
ret
=
-
ENETDOWN
;
goto
exit
;
}
ret
=
ath10k_hif_diag_read
(
ar
,
*
ppos
,
buf
,
count
);
if
(
ret
)
{
ath10k_warn
(
ar
,
"failed to read address 0x%08x via diagnose window fnrom debugfs: %d
\n
"
,
(
u32
)(
*
ppos
),
ret
);
goto
exit
;
}
ret
=
copy_to_user
(
user_buf
,
buf
,
count
);
if
(
ret
)
{
ret
=
-
EFAULT
;
goto
exit
;
}
count
-=
ret
;
*
ppos
+=
count
;
ret
=
count
;
exit:
vfree
(
buf
);
mutex_unlock
(
&
ar
->
conf_mutex
);
return
ret
;
}
static
ssize_t
ath10k_mem_value_write
(
struct
file
*
file
,
const
char
__user
*
user_buf
,
size_t
count
,
loff_t
*
ppos
)
{
struct
ath10k
*
ar
=
file
->
private_data
;
u8
*
buf
;
int
ret
;
if
(
*
ppos
<
0
)
return
-
EINVAL
;
if
(
!
count
)
return
0
;
mutex_lock
(
&
ar
->
conf_mutex
);
buf
=
vmalloc
(
count
);
if
(
!
buf
)
{
ret
=
-
ENOMEM
;
goto
exit
;
}
if
(
ar
->
state
!=
ATH10K_STATE_ON
&&
ar
->
state
!=
ATH10K_STATE_UTF
)
{
ret
=
-
ENETDOWN
;
goto
exit
;
}
ret
=
copy_from_user
(
buf
,
user_buf
,
count
);
if
(
ret
)
{
ret
=
-
EFAULT
;
goto
exit
;
}
ret
=
ath10k_hif_diag_write
(
ar
,
*
ppos
,
buf
,
count
);
if
(
ret
)
{
ath10k_warn
(
ar
,
"failed to write address 0x%08x via diagnose window from debugfs: %d
\n
"
,
(
u32
)(
*
ppos
),
ret
);
goto
exit
;
}
*
ppos
+=
count
;
ret
=
count
;
exit:
vfree
(
buf
);
mutex_unlock
(
&
ar
->
conf_mutex
);
return
ret
;
}
static
const
struct
file_operations
fops_mem_value
=
{
.
read
=
ath10k_mem_value_read
,
.
write
=
ath10k_mem_value_write
,
.
open
=
simple_open
,
.
owner
=
THIS_MODULE
,
.
llseek
=
default_llseek
,
};
static
int
ath10k_debug_htt_stats_req
(
struct
ath10k
*
ar
)
static
int
ath10k_debug_htt_stats_req
(
struct
ath10k
*
ar
)
{
{
u64
cookie
;
u64
cookie
;
...
@@ -1630,6 +1855,15 @@ int ath10k_debug_register(struct ath10k *ar)
...
@@ -1630,6 +1855,15 @@ int ath10k_debug_register(struct ath10k *ar)
debugfs_create_file
(
"fw_crash_dump"
,
S_IRUSR
,
ar
->
debug
.
debugfs_phy
,
debugfs_create_file
(
"fw_crash_dump"
,
S_IRUSR
,
ar
->
debug
.
debugfs_phy
,
ar
,
&
fops_fw_crash_dump
);
ar
,
&
fops_fw_crash_dump
);
debugfs_create_file
(
"reg_addr"
,
S_IRUSR
|
S_IWUSR
,
ar
->
debug
.
debugfs_phy
,
ar
,
&
fops_reg_addr
);
debugfs_create_file
(
"reg_value"
,
S_IRUSR
|
S_IWUSR
,
ar
->
debug
.
debugfs_phy
,
ar
,
&
fops_reg_value
);
debugfs_create_file
(
"mem_value"
,
S_IRUSR
|
S_IWUSR
,
ar
->
debug
.
debugfs_phy
,
ar
,
&
fops_mem_value
);
debugfs_create_file
(
"chip_id"
,
S_IRUSR
,
ar
->
debug
.
debugfs_phy
,
debugfs_create_file
(
"chip_id"
,
S_IRUSR
,
ar
->
debug
.
debugfs_phy
,
ar
,
&
fops_chip_id
);
ar
,
&
fops_chip_id
);
...
...
drivers/net/wireless/ath/ath10k/debug.h
View file @
cbe1bc23
...
@@ -35,6 +35,7 @@ enum ath10k_debug_mask {
...
@@ -35,6 +35,7 @@ enum ath10k_debug_mask {
ATH10K_DBG_BMI
=
0x00000400
,
ATH10K_DBG_BMI
=
0x00000400
,
ATH10K_DBG_REGULATORY
=
0x00000800
,
ATH10K_DBG_REGULATORY
=
0x00000800
,
ATH10K_DBG_TESTMODE
=
0x00001000
,
ATH10K_DBG_TESTMODE
=
0x00001000
,
ATH10K_DBG_WMI_PRINT
=
0x00002000
,
ATH10K_DBG_ANY
=
0xffffffff
,
ATH10K_DBG_ANY
=
0xffffffff
,
};
};
...
@@ -61,9 +62,6 @@ int ath10k_debug_create(struct ath10k *ar);
...
@@ -61,9 +62,6 @@ int ath10k_debug_create(struct ath10k *ar);
void
ath10k_debug_destroy
(
struct
ath10k
*
ar
);
void
ath10k_debug_destroy
(
struct
ath10k
*
ar
);
int
ath10k_debug_register
(
struct
ath10k
*
ar
);
int
ath10k_debug_register
(
struct
ath10k
*
ar
);
void
ath10k_debug_unregister
(
struct
ath10k
*
ar
);
void
ath10k_debug_unregister
(
struct
ath10k
*
ar
);
void
ath10k_debug_read_service_map
(
struct
ath10k
*
ar
,
const
void
*
service_map
,
size_t
map_size
);
void
ath10k_debug_fw_stats_process
(
struct
ath10k
*
ar
,
struct
sk_buff
*
skb
);
void
ath10k_debug_fw_stats_process
(
struct
ath10k
*
ar
,
struct
sk_buff
*
skb
);
struct
ath10k_fw_crash_data
*
struct
ath10k_fw_crash_data
*
ath10k_debug_get_new_fw_crash_data
(
struct
ath10k
*
ar
);
ath10k_debug_get_new_fw_crash_data
(
struct
ath10k
*
ar
);
...
@@ -108,12 +106,6 @@ static inline void ath10k_debug_unregister(struct ath10k *ar)
...
@@ -108,12 +106,6 @@ static inline void ath10k_debug_unregister(struct ath10k *ar)
{
{
}
}
static
inline
void
ath10k_debug_read_service_map
(
struct
ath10k
*
ar
,
const
void
*
service_map
,
size_t
map_size
)
{
}
static
inline
void
ath10k_debug_fw_stats_process
(
struct
ath10k
*
ar
,
static
inline
void
ath10k_debug_fw_stats_process
(
struct
ath10k
*
ar
,
struct
sk_buff
*
skb
)
struct
sk_buff
*
skb
)
{
{
...
...
drivers/net/wireless/ath/ath10k/hif.h
View file @
cbe1bc23
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include <linux/kernel.h>
#include <linux/kernel.h>
#include "core.h"
#include "core.h"
#include "debug.h"
struct
ath10k_hif_sg_item
{
struct
ath10k_hif_sg_item
{
u16
transfer_id
;
u16
transfer_id
;
...
@@ -31,11 +32,9 @@ struct ath10k_hif_sg_item {
...
@@ -31,11 +32,9 @@ struct ath10k_hif_sg_item {
struct
ath10k_hif_cb
{
struct
ath10k_hif_cb
{
int
(
*
tx_completion
)(
struct
ath10k
*
ar
,
int
(
*
tx_completion
)(
struct
ath10k
*
ar
,
struct
sk_buff
*
wbuf
,
struct
sk_buff
*
wbuf
);
unsigned
transfer_id
);
int
(
*
rx_completion
)(
struct
ath10k
*
ar
,
int
(
*
rx_completion
)(
struct
ath10k
*
ar
,
struct
sk_buff
*
wbuf
,
struct
sk_buff
*
wbuf
);
u8
pipe_id
);
};
};
struct
ath10k_hif_ops
{
struct
ath10k_hif_ops
{
...
@@ -47,6 +46,8 @@ struct ath10k_hif_ops {
...
@@ -47,6 +46,8 @@ struct ath10k_hif_ops {
int
(
*
diag_read
)(
struct
ath10k
*
ar
,
u32
address
,
void
*
buf
,
int
(
*
diag_read
)(
struct
ath10k
*
ar
,
u32
address
,
void
*
buf
,
size_t
buf_len
);
size_t
buf_len
);
int
(
*
diag_write
)(
struct
ath10k
*
ar
,
u32
address
,
const
void
*
data
,
int
nbytes
);
/*
/*
* API to handle HIF-specific BMI message exchanges, this API is
* API to handle HIF-specific BMI message exchanges, this API is
* synchronous and only allowed to be called from a context that
* synchronous and only allowed to be called from a context that
...
@@ -84,6 +85,10 @@ struct ath10k_hif_ops {
...
@@ -84,6 +85,10 @@ struct ath10k_hif_ops {
u16
(
*
get_free_queue_number
)(
struct
ath10k
*
ar
,
u8
pipe_id
);
u16
(
*
get_free_queue_number
)(
struct
ath10k
*
ar
,
u8
pipe_id
);
u32
(
*
read32
)(
struct
ath10k
*
ar
,
u32
address
);
void
(
*
write32
)(
struct
ath10k
*
ar
,
u32
address
,
u32
value
);
/* Power up the device and enter BMI transfer mode for FW download */
/* Power up the device and enter BMI transfer mode for FW download */
int
(
*
power_up
)(
struct
ath10k
*
ar
);
int
(
*
power_up
)(
struct
ath10k
*
ar
);
...
@@ -108,6 +113,15 @@ static inline int ath10k_hif_diag_read(struct ath10k *ar, u32 address, void *buf
...
@@ -108,6 +113,15 @@ static inline int ath10k_hif_diag_read(struct ath10k *ar, u32 address, void *buf
return
ar
->
hif
.
ops
->
diag_read
(
ar
,
address
,
buf
,
buf_len
);
return
ar
->
hif
.
ops
->
diag_read
(
ar
,
address
,
buf
,
buf_len
);
}
}
static
inline
int
ath10k_hif_diag_write
(
struct
ath10k
*
ar
,
u32
address
,
const
void
*
data
,
int
nbytes
)
{
if
(
!
ar
->
hif
.
ops
->
diag_write
)
return
-
EOPNOTSUPP
;
return
ar
->
hif
.
ops
->
diag_write
(
ar
,
address
,
data
,
nbytes
);
}
static
inline
int
ath10k_hif_exchange_bmi_msg
(
struct
ath10k
*
ar
,
static
inline
int
ath10k_hif_exchange_bmi_msg
(
struct
ath10k
*
ar
,
void
*
request
,
u32
request_len
,
void
*
request
,
u32
request_len
,
void
*
response
,
u32
*
response_len
)
void
*
response
,
u32
*
response_len
)
...
@@ -187,4 +201,25 @@ static inline int ath10k_hif_resume(struct ath10k *ar)
...
@@ -187,4 +201,25 @@ static inline int ath10k_hif_resume(struct ath10k *ar)
return
ar
->
hif
.
ops
->
resume
(
ar
);
return
ar
->
hif
.
ops
->
resume
(
ar
);
}
}
static
inline
u32
ath10k_hif_read32
(
struct
ath10k
*
ar
,
u32
address
)
{
if
(
!
ar
->
hif
.
ops
->
read32
)
{
ath10k_warn
(
ar
,
"hif read32 not supported
\n
"
);
return
0xdeaddead
;
}
return
ar
->
hif
.
ops
->
read32
(
ar
,
address
);
}
static
inline
void
ath10k_hif_write32
(
struct
ath10k
*
ar
,
u32
address
,
u32
data
)
{
if
(
!
ar
->
hif
.
ops
->
write32
)
{
ath10k_warn
(
ar
,
"hif write32 not supported
\n
"
);
return
;
}
ar
->
hif
.
ops
->
write32
(
ar
,
address
,
data
);
}
#endif
/* _HIF_H_ */
#endif
/* _HIF_H_ */
drivers/net/wireless/ath/ath10k/htc.c
View file @
cbe1bc23
...
@@ -160,6 +160,7 @@ int ath10k_htc_send(struct ath10k_htc *htc,
...
@@ -160,6 +160,7 @@ int ath10k_htc_send(struct ath10k_htc *htc,
ath10k_htc_prepare_tx_skb
(
ep
,
skb
);
ath10k_htc_prepare_tx_skb
(
ep
,
skb
);
skb_cb
->
eid
=
eid
;
skb_cb
->
paddr
=
dma_map_single
(
dev
,
skb
->
data
,
skb
->
len
,
DMA_TO_DEVICE
);
skb_cb
->
paddr
=
dma_map_single
(
dev
,
skb
->
data
,
skb
->
len
,
DMA_TO_DEVICE
);
ret
=
dma_mapping_error
(
dev
,
skb_cb
->
paddr
);
ret
=
dma_mapping_error
(
dev
,
skb_cb
->
paddr
);
if
(
ret
)
if
(
ret
)
...
@@ -197,15 +198,18 @@ int ath10k_htc_send(struct ath10k_htc *htc,
...
@@ -197,15 +198,18 @@ int ath10k_htc_send(struct ath10k_htc *htc,
}
}
static
int
ath10k_htc_tx_completion_handler
(
struct
ath10k
*
ar
,
static
int
ath10k_htc_tx_completion_handler
(
struct
ath10k
*
ar
,
struct
sk_buff
*
skb
,
struct
sk_buff
*
skb
)
unsigned
int
eid
)
{
{
struct
ath10k_htc
*
htc
=
&
ar
->
htc
;
struct
ath10k_htc
*
htc
=
&
ar
->
htc
;
struct
ath10k_htc_ep
*
ep
=
&
htc
->
endpoint
[
eid
];
struct
ath10k_skb_cb
*
skb_cb
;
struct
ath10k_htc_ep
*
ep
;
if
(
WARN_ON_ONCE
(
!
skb
))
if
(
WARN_ON_ONCE
(
!
skb
))
return
0
;
return
0
;
skb_cb
=
ATH10K_SKB_CB
(
skb
);
ep
=
&
htc
->
endpoint
[
skb_cb
->
eid
];
ath10k_htc_notify_tx_completion
(
ep
,
skb
);
ath10k_htc_notify_tx_completion
(
ep
,
skb
);
/* the skb now belongs to the completion handler */
/* the skb now belongs to the completion handler */
...
@@ -317,8 +321,7 @@ static int ath10k_htc_process_trailer(struct ath10k_htc *htc,
...
@@ -317,8 +321,7 @@ static int ath10k_htc_process_trailer(struct ath10k_htc *htc,
}
}
static
int
ath10k_htc_rx_completion_handler
(
struct
ath10k
*
ar
,
static
int
ath10k_htc_rx_completion_handler
(
struct
ath10k
*
ar
,
struct
sk_buff
*
skb
,
struct
sk_buff
*
skb
)
u8
pipe_id
)
{
{
int
status
=
0
;
int
status
=
0
;
struct
ath10k_htc
*
htc
=
&
ar
->
htc
;
struct
ath10k_htc
*
htc
=
&
ar
->
htc
;
...
...
drivers/net/wireless/ath/ath10k/htt.h
View file @
cbe1bc23
...
@@ -126,6 +126,7 @@ enum htt_data_tx_ext_tid {
...
@@ -126,6 +126,7 @@ enum htt_data_tx_ext_tid {
* (HL hosts manage queues on the host )
* (HL hosts manage queues on the host )
* more_in_batch: only for HL hosts. indicates if more packets are
* more_in_batch: only for HL hosts. indicates if more packets are
* pending. this allows target to wait and aggregate
* pending. this allows target to wait and aggregate
* freq: 0 means home channel of given vdev. intended for offchannel
*/
*/
struct
htt_data_tx_desc
{
struct
htt_data_tx_desc
{
u8
flags0
;
/* %HTT_DATA_TX_DESC_FLAGS0_ */
u8
flags0
;
/* %HTT_DATA_TX_DESC_FLAGS0_ */
...
@@ -133,7 +134,8 @@ struct htt_data_tx_desc {
...
@@ -133,7 +134,8 @@ struct htt_data_tx_desc {
__le16
len
;
__le16
len
;
__le16
id
;
__le16
id
;
__le32
frags_paddr
;
__le32
frags_paddr
;
__le32
peerid
;
__le16
peerid
;
__le16
freq
;
u8
prefetch
[
0
];
/* start of frame, for FW classification engine */
u8
prefetch
[
0
];
/* start of frame, for FW classification engine */
}
__packed
;
}
__packed
;
...
@@ -156,6 +158,9 @@ enum htt_rx_ring_flags {
...
@@ -156,6 +158,9 @@ enum htt_rx_ring_flags {
HTT_RX_RING_FLAGS_PHY_DATA_RX
=
1
<<
15
HTT_RX_RING_FLAGS_PHY_DATA_RX
=
1
<<
15
};
};
#define HTT_RX_RING_SIZE_MIN 128
#define HTT_RX_RING_SIZE_MAX 2048
struct
htt_rx_ring_setup_ring
{
struct
htt_rx_ring_setup_ring
{
__le32
fw_idx_shadow_reg_paddr
;
__le32
fw_idx_shadow_reg_paddr
;
__le32
rx_ring_base_paddr
;
__le32
rx_ring_base_paddr
;
...
...
drivers/net/wireless/ath/ath10k/htt_rx.c
View file @
cbe1bc23
This diff is collapsed.
Click to expand it.
drivers/net/wireless/ath/ath10k/htt_tx.c
View file @
cbe1bc23
...
@@ -554,13 +554,14 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
...
@@ -554,13 +554,14 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
skb_cb
->
htt
.
txbuf
->
cmd_tx
.
len
=
__cpu_to_le16
(
msdu
->
len
);
skb_cb
->
htt
.
txbuf
->
cmd_tx
.
len
=
__cpu_to_le16
(
msdu
->
len
);
skb_cb
->
htt
.
txbuf
->
cmd_tx
.
id
=
__cpu_to_le16
(
msdu_id
);
skb_cb
->
htt
.
txbuf
->
cmd_tx
.
id
=
__cpu_to_le16
(
msdu_id
);
skb_cb
->
htt
.
txbuf
->
cmd_tx
.
frags_paddr
=
__cpu_to_le32
(
frags_paddr
);
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
);
skb_cb
->
htt
.
txbuf
->
cmd_tx
.
peerid
=
__cpu_to_le16
(
HTT_INVALID_PEERID
);
skb_cb
->
htt
.
txbuf
->
cmd_tx
.
freq
=
__cpu_to_le16
(
skb_cb
->
htt
.
freq
);
trace_ath10k_htt_tx
(
ar
,
msdu_id
,
msdu
->
len
,
vdev_id
,
tid
);
trace_ath10k_htt_tx
(
ar
,
msdu_id
,
msdu
->
len
,
vdev_id
,
tid
);
ath10k_dbg
(
ar
,
ATH10K_DBG_HTT
,
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
"
,
"htt tx flags0 %hhu flags1 %hu len %d id %hu frags_paddr %08x, msdu_paddr %08x vdev %hhu tid %hhu
freq %hu
\n
"
,
flags0
,
flags1
,
msdu
->
len
,
msdu_id
,
frags_paddr
,
flags0
,
flags1
,
msdu
->
len
,
msdu_id
,
frags_paddr
,
(
u32
)
skb_cb
->
paddr
,
vdev_id
,
tid
);
(
u32
)
skb_cb
->
paddr
,
vdev_id
,
tid
,
skb_cb
->
htt
.
freq
);
ath10k_dbg_dump
(
ar
,
ATH10K_DBG_HTT_DUMP
,
NULL
,
"htt tx msdu: "
,
ath10k_dbg_dump
(
ar
,
ATH10K_DBG_HTT_DUMP
,
NULL
,
"htt tx msdu: "
,
msdu
->
data
,
msdu
->
len
);
msdu
->
data
,
msdu
->
len
);
trace_ath10k_tx_hdr
(
ar
,
msdu
->
data
,
msdu
->
len
);
trace_ath10k_tx_hdr
(
ar
,
msdu
->
data
,
msdu
->
len
);
...
...
drivers/net/wireless/ath/ath10k/hw.h
View file @
cbe1bc23
...
@@ -97,11 +97,13 @@ struct ath10k_pktlog_hdr {
...
@@ -97,11 +97,13 @@ struct ath10k_pktlog_hdr {
#define TARGET_DMA_BURST_SIZE 0
#define TARGET_DMA_BURST_SIZE 0
#define TARGET_MAC_AGGR_DELIM 0
#define TARGET_MAC_AGGR_DELIM 0
#define TARGET_AST_SKID_LIMIT 16
#define TARGET_AST_SKID_LIMIT 16
#define TARGET_NUM_PEERS 16
#define TARGET_NUM_STATIONS 16
#define TARGET_NUM_PEERS ((TARGET_NUM_STATIONS) + \
(TARGET_NUM_VDEVS))
#define TARGET_NUM_OFFLOAD_PEERS 0
#define TARGET_NUM_OFFLOAD_PEERS 0
#define TARGET_NUM_OFFLOAD_REORDER_BUFS 0
#define TARGET_NUM_OFFLOAD_REORDER_BUFS 0
#define TARGET_NUM_PEER_KEYS 2
#define TARGET_NUM_PEER_KEYS 2
#define TARGET_NUM_TIDS
(2 * ((TARGET_NUM_PEERS) + (TARGET_NUM_VDEVS))
)
#define TARGET_NUM_TIDS
((TARGET_NUM_PEERS) * 2
)
#define TARGET_TX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2))
#define TARGET_TX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2))
#define TARGET_RX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2))
#define TARGET_RX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2))
#define TARGET_RX_TIMEOUT_LO_PRI 100
#define TARGET_RX_TIMEOUT_LO_PRI 100
...
@@ -132,12 +134,15 @@ struct ath10k_pktlog_hdr {
...
@@ -132,12 +134,15 @@ struct ath10k_pktlog_hdr {
#define TARGET_10X_DMA_BURST_SIZE 0
#define TARGET_10X_DMA_BURST_SIZE 0
#define TARGET_10X_MAC_AGGR_DELIM 0
#define TARGET_10X_MAC_AGGR_DELIM 0
#define TARGET_10X_AST_SKID_LIMIT 16
#define TARGET_10X_AST_SKID_LIMIT 16
#define TARGET_10X_NUM_PEERS (128 + (TARGET_10X_NUM_VDEVS))
#define TARGET_10X_NUM_STATIONS 128
#define TARGET_10X_NUM_PEERS_MAX 128
#define TARGET_10X_NUM_PEERS ((TARGET_10X_NUM_STATIONS) + \
(TARGET_10X_NUM_VDEVS))
#define TARGET_10X_NUM_OFFLOAD_PEERS 0
#define TARGET_10X_NUM_OFFLOAD_PEERS 0
#define TARGET_10X_NUM_OFFLOAD_REORDER_BUFS 0
#define TARGET_10X_NUM_OFFLOAD_REORDER_BUFS 0
#define TARGET_10X_NUM_PEER_KEYS 2
#define TARGET_10X_NUM_PEER_KEYS 2
#define TARGET_10X_NUM_TIDS 256
#define TARGET_10X_NUM_TIDS_MAX 256
#define TARGET_10X_NUM_TIDS min((TARGET_10X_NUM_TIDS_MAX), \
(TARGET_10X_NUM_PEERS) * 2)
#define TARGET_10X_TX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2))
#define TARGET_10X_TX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2))
#define TARGET_10X_RX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2))
#define TARGET_10X_RX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2))
#define TARGET_10X_RX_TIMEOUT_LO_PRI 100
#define TARGET_10X_RX_TIMEOUT_LO_PRI 100
...
...
drivers/net/wireless/ath/ath10k/mac.c
View file @
cbe1bc23
This diff is collapsed.
Click to expand it.
drivers/net/wireless/ath/ath10k/mac.h
View file @
cbe1bc23
...
@@ -21,6 +21,8 @@
...
@@ -21,6 +21,8 @@
#include <net/mac80211.h>
#include <net/mac80211.h>
#include "core.h"
#include "core.h"
#define WEP_KEYID_SHIFT 6
struct
ath10k_generic_iter
{
struct
ath10k_generic_iter
{
struct
ath10k
*
ar
;
struct
ath10k
*
ar
;
int
ret
;
int
ret
;
...
@@ -41,6 +43,8 @@ void ath10k_mgmt_over_wmi_tx_work(struct work_struct *work);
...
@@ -41,6 +43,8 @@ void ath10k_mgmt_over_wmi_tx_work(struct work_struct *work);
void
ath10k_halt
(
struct
ath10k
*
ar
);
void
ath10k_halt
(
struct
ath10k
*
ar
);
void
ath10k_mac_vif_beacon_free
(
struct
ath10k_vif
*
arvif
);
void
ath10k_mac_vif_beacon_free
(
struct
ath10k_vif
*
arvif
);
void
ath10k_drain_tx
(
struct
ath10k
*
ar
);
void
ath10k_drain_tx
(
struct
ath10k
*
ar
);
bool
ath10k_mac_is_peer_wep_key_set
(
struct
ath10k
*
ar
,
const
u8
*
addr
,
u8
keyidx
);
static
inline
struct
ath10k_vif
*
ath10k_vif_to_arvif
(
struct
ieee80211_vif
*
vif
)
static
inline
struct
ath10k_vif
*
ath10k_vif_to_arvif
(
struct
ieee80211_vif
*
vif
)
{
{
...
...
drivers/net/wireless/ath/ath10k/pci.c
View file @
cbe1bc23
...
@@ -823,20 +823,24 @@ static void ath10k_pci_ce_send_done(struct ath10k_ce_pipe *ce_state)
...
@@ -823,20 +823,24 @@ static void ath10k_pci_ce_send_done(struct ath10k_ce_pipe *ce_state)
struct
ath10k
*
ar
=
ce_state
->
ar
;
struct
ath10k
*
ar
=
ce_state
->
ar
;
struct
ath10k_pci
*
ar_pci
=
ath10k_pci_priv
(
ar
);
struct
ath10k_pci
*
ar_pci
=
ath10k_pci_priv
(
ar
);
struct
ath10k_hif_cb
*
cb
=
&
ar_pci
->
msg_callbacks_current
;
struct
ath10k_hif_cb
*
cb
=
&
ar_pci
->
msg_callbacks_current
;
void
*
transfer_context
;
struct
sk_buff_head
list
;
struct
sk_buff
*
skb
;
u32
ce_data
;
u32
ce_data
;
unsigned
int
nbytes
;
unsigned
int
nbytes
;
unsigned
int
transfer_id
;
unsigned
int
transfer_id
;
while
(
ath10k_ce_completed_send_next
(
ce_state
,
&
transfer_context
,
__skb_queue_head_init
(
&
list
);
&
ce_data
,
&
nbytes
,
while
(
ath10k_ce_completed_send_next
(
ce_state
,
(
void
**
)
&
skb
,
&
ce_data
,
&
transfer_id
)
==
0
)
{
&
nbytes
,
&
transfer_id
)
==
0
)
{
/* no need to call tx completion for NULL pointers */
/* no need to call tx completion for NULL pointers */
if
(
transfer_context
==
NULL
)
if
(
skb
==
NULL
)
continue
;
continue
;
cb
->
tx_completion
(
ar
,
transfer_context
,
transfer_id
);
__skb_queue_tail
(
&
list
,
skb
);
}
}
while
((
skb
=
__skb_dequeue
(
&
list
)))
cb
->
tx_completion
(
ar
,
skb
);
}
}
/* Called by lower (CE) layer when data is received from the Target. */
/* Called by lower (CE) layer when data is received from the Target. */
...
@@ -847,12 +851,14 @@ static void ath10k_pci_ce_recv_data(struct ath10k_ce_pipe *ce_state)
...
@@ -847,12 +851,14 @@ static void ath10k_pci_ce_recv_data(struct ath10k_ce_pipe *ce_state)
struct
ath10k_pci_pipe
*
pipe_info
=
&
ar_pci
->
pipe_info
[
ce_state
->
id
];
struct
ath10k_pci_pipe
*
pipe_info
=
&
ar_pci
->
pipe_info
[
ce_state
->
id
];
struct
ath10k_hif_cb
*
cb
=
&
ar_pci
->
msg_callbacks_current
;
struct
ath10k_hif_cb
*
cb
=
&
ar_pci
->
msg_callbacks_current
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
struct
sk_buff_head
list
;
void
*
transfer_context
;
void
*
transfer_context
;
u32
ce_data
;
u32
ce_data
;
unsigned
int
nbytes
,
max_nbytes
;
unsigned
int
nbytes
,
max_nbytes
;
unsigned
int
transfer_id
;
unsigned
int
transfer_id
;
unsigned
int
flags
;
unsigned
int
flags
;
__skb_queue_head_init
(
&
list
);
while
(
ath10k_ce_completed_recv_next
(
ce_state
,
&
transfer_context
,
while
(
ath10k_ce_completed_recv_next
(
ce_state
,
&
transfer_context
,
&
ce_data
,
&
nbytes
,
&
transfer_id
,
&
ce_data
,
&
nbytes
,
&
transfer_id
,
&
flags
)
==
0
)
{
&
flags
)
==
0
)
{
...
@@ -869,13 +875,16 @@ static void ath10k_pci_ce_recv_data(struct ath10k_ce_pipe *ce_state)
...
@@ -869,13 +875,16 @@ static void ath10k_pci_ce_recv_data(struct ath10k_ce_pipe *ce_state)
}
}
skb_put
(
skb
,
nbytes
);
skb_put
(
skb
,
nbytes
);
__skb_queue_tail
(
&
list
,
skb
);
}
while
((
skb
=
__skb_dequeue
(
&
list
)))
{
ath10k_dbg
(
ar
,
ATH10K_DBG_PCI
,
"pci rx ce pipe %d len %d
\n
"
,
ath10k_dbg
(
ar
,
ATH10K_DBG_PCI
,
"pci rx ce pipe %d len %d
\n
"
,
ce_state
->
id
,
skb
->
len
);
ce_state
->
id
,
skb
->
len
);
ath10k_dbg_dump
(
ar
,
ATH10K_DBG_PCI_DUMP
,
NULL
,
"pci rx: "
,
ath10k_dbg_dump
(
ar
,
ATH10K_DBG_PCI_DUMP
,
NULL
,
"pci rx: "
,
skb
->
data
,
skb
->
len
);
skb
->
data
,
skb
->
len
);
cb
->
rx_completion
(
ar
,
skb
,
pipe_info
->
pipe_num
);
cb
->
rx_completion
(
ar
,
skb
);
}
}
ath10k_pci_rx_post_pipe
(
pipe_info
);
ath10k_pci_rx_post_pipe
(
pipe_info
);
...
@@ -1263,7 +1272,7 @@ static void ath10k_pci_tx_pipe_cleanup(struct ath10k_pci_pipe *pci_pipe)
...
@@ -1263,7 +1272,7 @@ static void ath10k_pci_tx_pipe_cleanup(struct ath10k_pci_pipe *pci_pipe)
id
=
MS
(
__le16_to_cpu
(
ce_desc
[
i
].
flags
),
id
=
MS
(
__le16_to_cpu
(
ce_desc
[
i
].
flags
),
CE_DESC_FLAGS_META_DATA
);
CE_DESC_FLAGS_META_DATA
);
ar_pci
->
msg_callbacks_current
.
tx_completion
(
ar
,
skb
,
id
);
ar_pci
->
msg_callbacks_current
.
tx_completion
(
ar
,
skb
);
}
}
}
}
...
@@ -1988,6 +1997,7 @@ static int ath10k_pci_hif_resume(struct ath10k *ar)
...
@@ -1988,6 +1997,7 @@ static int ath10k_pci_hif_resume(struct ath10k *ar)
static
const
struct
ath10k_hif_ops
ath10k_pci_hif_ops
=
{
static
const
struct
ath10k_hif_ops
ath10k_pci_hif_ops
=
{
.
tx_sg
=
ath10k_pci_hif_tx_sg
,
.
tx_sg
=
ath10k_pci_hif_tx_sg
,
.
diag_read
=
ath10k_pci_hif_diag_read
,
.
diag_read
=
ath10k_pci_hif_diag_read
,
.
diag_write
=
ath10k_pci_diag_write_mem
,
.
exchange_bmi_msg
=
ath10k_pci_hif_exchange_bmi_msg
,
.
exchange_bmi_msg
=
ath10k_pci_hif_exchange_bmi_msg
,
.
start
=
ath10k_pci_hif_start
,
.
start
=
ath10k_pci_hif_start
,
.
stop
=
ath10k_pci_hif_stop
,
.
stop
=
ath10k_pci_hif_stop
,
...
@@ -1998,6 +2008,8 @@ static const struct ath10k_hif_ops ath10k_pci_hif_ops = {
...
@@ -1998,6 +2008,8 @@ static const struct ath10k_hif_ops ath10k_pci_hif_ops = {
.
get_free_queue_number
=
ath10k_pci_hif_get_free_queue_number
,
.
get_free_queue_number
=
ath10k_pci_hif_get_free_queue_number
,
.
power_up
=
ath10k_pci_hif_power_up
,
.
power_up
=
ath10k_pci_hif_power_up
,
.
power_down
=
ath10k_pci_hif_power_down
,
.
power_down
=
ath10k_pci_hif_power_down
,
.
read32
=
ath10k_pci_read32
,
.
write32
=
ath10k_pci_write32
,
#ifdef CONFIG_PM
#ifdef CONFIG_PM
.
suspend
=
ath10k_pci_hif_suspend
,
.
suspend
=
ath10k_pci_hif_suspend
,
.
resume
=
ath10k_pci_hif_resume
,
.
resume
=
ath10k_pci_hif_resume
,
...
...
drivers/net/wireless/ath/ath10k/trace.h
View file @
cbe1bc23
...
@@ -21,9 +21,11 @@
...
@@ -21,9 +21,11 @@
#include "core.h"
#include "core.h"
#if !defined(_TRACE_H_)
#if !defined(_TRACE_H_)
static
inline
u32
ath10k_frm_hdr_len
(
void
*
buf
)
static
inline
u32
ath10k_frm_hdr_len
(
const
void
*
buf
)
{
{
return
ieee80211_hdrlen
(((
struct
ieee80211_hdr
*
)
buf
)
->
frame_control
);
const
struct
ieee80211_hdr
*
hdr
=
buf
;
return
ieee80211_hdrlen
(
hdr
->
frame_control
);
}
}
#endif
#endif
...
@@ -145,7 +147,8 @@ TRACE_EVENT(ath10k_log_dbg_dump,
...
@@ -145,7 +147,8 @@ TRACE_EVENT(ath10k_log_dbg_dump,
);
);
TRACE_EVENT
(
ath10k_wmi_cmd
,
TRACE_EVENT
(
ath10k_wmi_cmd
,
TP_PROTO
(
struct
ath10k
*
ar
,
int
id
,
void
*
buf
,
size_t
buf_len
,
int
ret
),
TP_PROTO
(
struct
ath10k
*
ar
,
int
id
,
const
void
*
buf
,
size_t
buf_len
,
int
ret
),
TP_ARGS
(
ar
,
id
,
buf
,
buf_len
,
ret
),
TP_ARGS
(
ar
,
id
,
buf
,
buf_len
,
ret
),
...
@@ -178,7 +181,7 @@ TRACE_EVENT(ath10k_wmi_cmd,
...
@@ -178,7 +181,7 @@ TRACE_EVENT(ath10k_wmi_cmd,
);
);
TRACE_EVENT
(
ath10k_wmi_event
,
TRACE_EVENT
(
ath10k_wmi_event
,
TP_PROTO
(
struct
ath10k
*
ar
,
int
id
,
void
*
buf
,
size_t
buf_len
),
TP_PROTO
(
struct
ath10k
*
ar
,
int
id
,
const
void
*
buf
,
size_t
buf_len
),
TP_ARGS
(
ar
,
id
,
buf
,
buf_len
),
TP_ARGS
(
ar
,
id
,
buf
,
buf_len
),
...
@@ -208,7 +211,7 @@ TRACE_EVENT(ath10k_wmi_event,
...
@@ -208,7 +211,7 @@ TRACE_EVENT(ath10k_wmi_event,
);
);
TRACE_EVENT
(
ath10k_htt_stats
,
TRACE_EVENT
(
ath10k_htt_stats
,
TP_PROTO
(
struct
ath10k
*
ar
,
void
*
buf
,
size_t
buf_len
),
TP_PROTO
(
struct
ath10k
*
ar
,
const
void
*
buf
,
size_t
buf_len
),
TP_ARGS
(
ar
,
buf
,
buf_len
),
TP_ARGS
(
ar
,
buf
,
buf_len
),
...
@@ -235,7 +238,7 @@ TRACE_EVENT(ath10k_htt_stats,
...
@@ -235,7 +238,7 @@ TRACE_EVENT(ath10k_htt_stats,
);
);
TRACE_EVENT
(
ath10k_wmi_dbglog
,
TRACE_EVENT
(
ath10k_wmi_dbglog
,
TP_PROTO
(
struct
ath10k
*
ar
,
void
*
buf
,
size_t
buf_len
),
TP_PROTO
(
struct
ath10k
*
ar
,
const
void
*
buf
,
size_t
buf_len
),
TP_ARGS
(
ar
,
buf
,
buf_len
),
TP_ARGS
(
ar
,
buf
,
buf_len
),
...
@@ -262,7 +265,7 @@ TRACE_EVENT(ath10k_wmi_dbglog,
...
@@ -262,7 +265,7 @@ TRACE_EVENT(ath10k_wmi_dbglog,
);
);
TRACE_EVENT
(
ath10k_htt_pktlog
,
TRACE_EVENT
(
ath10k_htt_pktlog
,
TP_PROTO
(
struct
ath10k
*
ar
,
void
*
buf
,
u16
buf_len
),
TP_PROTO
(
struct
ath10k
*
ar
,
const
void
*
buf
,
u16
buf_len
),
TP_ARGS
(
ar
,
buf
,
buf_len
),
TP_ARGS
(
ar
,
buf
,
buf_len
),
...
@@ -349,7 +352,7 @@ TRACE_EVENT(ath10k_txrx_tx_unref,
...
@@ -349,7 +352,7 @@ TRACE_EVENT(ath10k_txrx_tx_unref,
);
);
DECLARE_EVENT_CLASS
(
ath10k_hdr_event
,
DECLARE_EVENT_CLASS
(
ath10k_hdr_event
,
TP_PROTO
(
struct
ath10k
*
ar
,
void
*
data
,
size_t
len
),
TP_PROTO
(
struct
ath10k
*
ar
,
const
void
*
data
,
size_t
len
),
TP_ARGS
(
ar
,
data
,
len
),
TP_ARGS
(
ar
,
data
,
len
),
...
@@ -376,7 +379,7 @@ DECLARE_EVENT_CLASS(ath10k_hdr_event,
...
@@ -376,7 +379,7 @@ DECLARE_EVENT_CLASS(ath10k_hdr_event,
);
);
DECLARE_EVENT_CLASS
(
ath10k_payload_event
,
DECLARE_EVENT_CLASS
(
ath10k_payload_event
,
TP_PROTO
(
struct
ath10k
*
ar
,
void
*
data
,
size_t
len
),
TP_PROTO
(
struct
ath10k
*
ar
,
const
void
*
data
,
size_t
len
),
TP_ARGS
(
ar
,
data
,
len
),
TP_ARGS
(
ar
,
data
,
len
),
...
@@ -404,27 +407,27 @@ DECLARE_EVENT_CLASS(ath10k_payload_event,
...
@@ -404,27 +407,27 @@ DECLARE_EVENT_CLASS(ath10k_payload_event,
);
);
DEFINE_EVENT
(
ath10k_hdr_event
,
ath10k_tx_hdr
,
DEFINE_EVENT
(
ath10k_hdr_event
,
ath10k_tx_hdr
,
TP_PROTO
(
struct
ath10k
*
ar
,
void
*
data
,
size_t
len
),
TP_PROTO
(
struct
ath10k
*
ar
,
const
void
*
data
,
size_t
len
),
TP_ARGS
(
ar
,
data
,
len
)
TP_ARGS
(
ar
,
data
,
len
)
);
);
DEFINE_EVENT
(
ath10k_payload_event
,
ath10k_tx_payload
,
DEFINE_EVENT
(
ath10k_payload_event
,
ath10k_tx_payload
,
TP_PROTO
(
struct
ath10k
*
ar
,
void
*
data
,
size_t
len
),
TP_PROTO
(
struct
ath10k
*
ar
,
const
void
*
data
,
size_t
len
),
TP_ARGS
(
ar
,
data
,
len
)
TP_ARGS
(
ar
,
data
,
len
)
);
);
DEFINE_EVENT
(
ath10k_hdr_event
,
ath10k_rx_hdr
,
DEFINE_EVENT
(
ath10k_hdr_event
,
ath10k_rx_hdr
,
TP_PROTO
(
struct
ath10k
*
ar
,
void
*
data
,
size_t
len
),
TP_PROTO
(
struct
ath10k
*
ar
,
const
void
*
data
,
size_t
len
),
TP_ARGS
(
ar
,
data
,
len
)
TP_ARGS
(
ar
,
data
,
len
)
);
);
DEFINE_EVENT
(
ath10k_payload_event
,
ath10k_rx_payload
,
DEFINE_EVENT
(
ath10k_payload_event
,
ath10k_rx_payload
,
TP_PROTO
(
struct
ath10k
*
ar
,
void
*
data
,
size_t
len
),
TP_PROTO
(
struct
ath10k
*
ar
,
const
void
*
data
,
size_t
len
),
TP_ARGS
(
ar
,
data
,
len
)
TP_ARGS
(
ar
,
data
,
len
)
);
);
TRACE_EVENT
(
ath10k_htt_rx_desc
,
TRACE_EVENT
(
ath10k_htt_rx_desc
,
TP_PROTO
(
struct
ath10k
*
ar
,
void
*
data
,
size_t
len
),
TP_PROTO
(
struct
ath10k
*
ar
,
const
void
*
data
,
size_t
len
),
TP_ARGS
(
ar
,
data
,
len
),
TP_ARGS
(
ar
,
data
,
len
),
...
...
drivers/net/wireless/ath/ath10k/wmi.c
View file @
cbe1bc23
...
@@ -1113,6 +1113,40 @@ static inline u8 get_rate_idx(u32 rate, enum ieee80211_band band)
...
@@ -1113,6 +1113,40 @@ static inline u8 get_rate_idx(u32 rate, enum ieee80211_band band)
return
rate_idx
;
return
rate_idx
;
}
}
/* If keys are configured, HW decrypts all frames
* with protected bit set. Mark such frames as decrypted.
*/
static
void
ath10k_wmi_handle_wep_reauth
(
struct
ath10k
*
ar
,
struct
sk_buff
*
skb
,
struct
ieee80211_rx_status
*
status
)
{
struct
ieee80211_hdr
*
hdr
=
(
struct
ieee80211_hdr
*
)
skb
->
data
;
unsigned
int
hdrlen
;
bool
peer_key
;
u8
*
addr
,
keyidx
;
if
(
!
ieee80211_is_auth
(
hdr
->
frame_control
)
||
!
ieee80211_has_protected
(
hdr
->
frame_control
))
return
;
hdrlen
=
ieee80211_hdrlen
(
hdr
->
frame_control
);
if
(
skb
->
len
<
(
hdrlen
+
IEEE80211_WEP_IV_LEN
))
return
;
keyidx
=
skb
->
data
[
hdrlen
+
(
IEEE80211_WEP_IV_LEN
-
1
)]
>>
WEP_KEYID_SHIFT
;
addr
=
ieee80211_get_SA
(
hdr
);
spin_lock_bh
(
&
ar
->
data_lock
);
peer_key
=
ath10k_mac_is_peer_wep_key_set
(
ar
,
addr
,
keyidx
);
spin_unlock_bh
(
&
ar
->
data_lock
);
if
(
peer_key
)
{
ath10k_dbg
(
ar
,
ATH10K_DBG_MAC
,
"mac wep key present for peer %pM
\n
"
,
addr
);
status
->
flag
|=
RX_FLAG_DECRYPTED
;
}
}
static
int
ath10k_wmi_event_mgmt_rx
(
struct
ath10k
*
ar
,
struct
sk_buff
*
skb
)
static
int
ath10k_wmi_event_mgmt_rx
(
struct
ath10k
*
ar
,
struct
sk_buff
*
skb
)
{
{
struct
wmi_mgmt_rx_event_v1
*
ev_v1
;
struct
wmi_mgmt_rx_event_v1
*
ev_v1
;
...
@@ -1166,8 +1200,11 @@ static int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
...
@@ -1166,8 +1200,11 @@ static int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
return
0
;
return
0
;
}
}
if
(
rx_status
&
WMI_RX_STATUS_ERR_CRC
)
if
(
rx_status
&
WMI_RX_STATUS_ERR_CRC
)
{
status
->
flag
|=
RX_FLAG_FAILED_FCS_CRC
;
dev_kfree_skb
(
skb
);
return
0
;
}
if
(
rx_status
&
WMI_RX_STATUS_ERR_MIC
)
if
(
rx_status
&
WMI_RX_STATUS_ERR_MIC
)
status
->
flag
|=
RX_FLAG_MMIC_ERROR
;
status
->
flag
|=
RX_FLAG_MMIC_ERROR
;
...
@@ -1200,6 +1237,8 @@ static int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
...
@@ -1200,6 +1237,8 @@ static int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
hdr
=
(
struct
ieee80211_hdr
*
)
skb
->
data
;
hdr
=
(
struct
ieee80211_hdr
*
)
skb
->
data
;
fc
=
le16_to_cpu
(
hdr
->
frame_control
);
fc
=
le16_to_cpu
(
hdr
->
frame_control
);
ath10k_wmi_handle_wep_reauth
(
ar
,
skb
,
status
);
/* FW delivers WEP Shared Auth frame with Protected Bit set and
/* FW delivers WEP Shared Auth frame with Protected Bit set and
* encrypted payload. However in case of PMF it delivers decrypted
* encrypted payload. However in case of PMF it delivers decrypted
* frames with Protected Bit set. */
* frames with Protected Bit set. */
...
@@ -2261,7 +2300,7 @@ static void ath10k_wmi_event_debug_print(struct ath10k *ar,
...
@@ -2261,7 +2300,7 @@ static void ath10k_wmi_event_debug_print(struct ath10k *ar,
/* the last byte is always reserved for the null character */
/* the last byte is always reserved for the null character */
buf
[
i
]
=
'\0'
;
buf
[
i
]
=
'\0'
;
ath10k_dbg
(
ar
,
ATH10K_DBG_WMI
,
"wmi event debug
print '%s'
\n
"
,
buf
);
ath10k_dbg
(
ar
,
ATH10K_DBG_WMI
_PRINT
,
"wmi
print '%s'
\n
"
,
buf
);
}
}
static
void
ath10k_wmi_event_pdev_qvit
(
struct
ath10k
*
ar
,
struct
sk_buff
*
skb
)
static
void
ath10k_wmi_event_pdev_qvit
(
struct
ath10k
*
ar
,
struct
sk_buff
*
skb
)
...
@@ -2418,6 +2457,7 @@ static int ath10k_wmi_main_pull_svc_rdy_ev(struct sk_buff *skb,
...
@@ -2418,6 +2457,7 @@ static int ath10k_wmi_main_pull_svc_rdy_ev(struct sk_buff *skb,
arg
->
eeprom_rd
=
ev
->
hal_reg_capabilities
.
eeprom_rd
;
arg
->
eeprom_rd
=
ev
->
hal_reg_capabilities
.
eeprom_rd
;
arg
->
num_mem_reqs
=
ev
->
num_mem_reqs
;
arg
->
num_mem_reqs
=
ev
->
num_mem_reqs
;
arg
->
service_map
=
ev
->
wmi_service_bitmap
;
arg
->
service_map
=
ev
->
wmi_service_bitmap
;
arg
->
service_map_len
=
sizeof
(
ev
->
wmi_service_bitmap
);
n
=
min_t
(
size_t
,
__le32_to_cpu
(
arg
->
num_mem_reqs
),
n
=
min_t
(
size_t
,
__le32_to_cpu
(
arg
->
num_mem_reqs
),
ARRAY_SIZE
(
arg
->
mem_reqs
));
ARRAY_SIZE
(
arg
->
mem_reqs
));
...
@@ -2452,6 +2492,7 @@ static int ath10k_wmi_10x_pull_svc_rdy_ev(struct sk_buff *skb,
...
@@ -2452,6 +2492,7 @@ static int ath10k_wmi_10x_pull_svc_rdy_ev(struct sk_buff *skb,
arg
->
eeprom_rd
=
ev
->
hal_reg_capabilities
.
eeprom_rd
;
arg
->
eeprom_rd
=
ev
->
hal_reg_capabilities
.
eeprom_rd
;
arg
->
num_mem_reqs
=
ev
->
num_mem_reqs
;
arg
->
num_mem_reqs
=
ev
->
num_mem_reqs
;
arg
->
service_map
=
ev
->
wmi_service_bitmap
;
arg
->
service_map
=
ev
->
wmi_service_bitmap
;
arg
->
service_map_len
=
sizeof
(
ev
->
wmi_service_bitmap
);
n
=
min_t
(
size_t
,
__le32_to_cpu
(
arg
->
num_mem_reqs
),
n
=
min_t
(
size_t
,
__le32_to_cpu
(
arg
->
num_mem_reqs
),
ARRAY_SIZE
(
arg
->
mem_reqs
));
ARRAY_SIZE
(
arg
->
mem_reqs
));
...
@@ -2470,15 +2511,18 @@ static void ath10k_wmi_event_service_ready(struct ath10k *ar,
...
@@ -2470,15 +2511,18 @@ static void ath10k_wmi_event_service_ready(struct ath10k *ar,
{
{
struct
wmi_svc_rdy_ev_arg
arg
=
{};
struct
wmi_svc_rdy_ev_arg
arg
=
{};
u32
num_units
,
req_id
,
unit_size
,
num_mem_reqs
,
num_unit_info
,
i
;
u32
num_units
,
req_id
,
unit_size
,
num_mem_reqs
,
num_unit_info
,
i
;
DECLARE_BITMAP
(
svc_bmap
,
WMI_SERVICE_MAX
)
=
{};
int
ret
;
int
ret
;
memset
(
&
ar
->
wmi
.
svc_map
,
0
,
sizeof
(
ar
->
wmi
.
svc_map
));
if
(
test_bit
(
ATH10K_FW_FEATURE_WMI_10X
,
ar
->
fw_features
))
{
if
(
test_bit
(
ATH10K_FW_FEATURE_WMI_10X
,
ar
->
fw_features
))
{
ret
=
ath10k_wmi_10x_pull_svc_rdy_ev
(
skb
,
&
arg
);
ret
=
ath10k_wmi_10x_pull_svc_rdy_ev
(
skb
,
&
arg
);
wmi_10x_svc_map
(
arg
.
service_map
,
svc_bmap
);
wmi_10x_svc_map
(
arg
.
service_map
,
ar
->
wmi
.
svc_map
,
arg
.
service_map_len
);
}
else
{
}
else
{
ret
=
ath10k_wmi_main_pull_svc_rdy_ev
(
skb
,
&
arg
);
ret
=
ath10k_wmi_main_pull_svc_rdy_ev
(
skb
,
&
arg
);
wmi_main_svc_map
(
arg
.
service_map
,
svc_bmap
);
wmi_main_svc_map
(
arg
.
service_map
,
ar
->
wmi
.
svc_map
,
arg
.
service_map_len
);
}
}
if
(
ret
)
{
if
(
ret
)
{
...
@@ -2500,9 +2544,8 @@ static void ath10k_wmi_event_service_ready(struct ath10k *ar,
...
@@ -2500,9 +2544,8 @@ static void ath10k_wmi_event_service_ready(struct ath10k *ar,
ar
->
num_rf_chains
=
__le32_to_cpu
(
arg
.
num_rf_chains
);
ar
->
num_rf_chains
=
__le32_to_cpu
(
arg
.
num_rf_chains
);
ar
->
ath_common
.
regulatory
.
current_rd
=
__le32_to_cpu
(
arg
.
eeprom_rd
);
ar
->
ath_common
.
regulatory
.
current_rd
=
__le32_to_cpu
(
arg
.
eeprom_rd
);
ath10k_debug_read_service_map
(
ar
,
svc_bmap
,
sizeof
(
svc_bmap
));
ath10k_dbg_dump
(
ar
,
ATH10K_DBG_WMI
,
NULL
,
"wmi svc: "
,
ath10k_dbg_dump
(
ar
,
ATH10K_DBG_WMI
,
NULL
,
"wmi svc: "
,
arg
.
service_map
,
sizeof
(
arg
.
service_map
)
);
arg
.
service_map
,
arg
.
service_map_len
);
/* only manually set fw features when not using FW IE format */
/* only manually set fw features when not using FW IE format */
if
(
ar
->
fw_api
==
1
&&
ar
->
fw_version_build
>
636
)
if
(
ar
->
fw_api
==
1
&&
ar
->
fw_version_build
>
636
)
...
@@ -3142,7 +3185,7 @@ static int ath10k_wmi_main_cmd_init(struct ath10k *ar)
...
@@ -3142,7 +3185,7 @@ static int ath10k_wmi_main_cmd_init(struct ath10k *ar)
u32
len
,
val
;
u32
len
,
val
;
config
.
num_vdevs
=
__cpu_to_le32
(
TARGET_NUM_VDEVS
);
config
.
num_vdevs
=
__cpu_to_le32
(
TARGET_NUM_VDEVS
);
config
.
num_peers
=
__cpu_to_le32
(
TARGET_NUM_PEERS
+
TARGET_NUM_VDEVS
);
config
.
num_peers
=
__cpu_to_le32
(
TARGET_NUM_PEERS
);
config
.
num_offload_peers
=
__cpu_to_le32
(
TARGET_NUM_OFFLOAD_PEERS
);
config
.
num_offload_peers
=
__cpu_to_le32
(
TARGET_NUM_OFFLOAD_PEERS
);
config
.
num_offload_reorder_bufs
=
config
.
num_offload_reorder_bufs
=
...
...
drivers/net/wireless/ath/ath10k/wmi.h
View file @
cbe1bc23
...
@@ -222,128 +222,131 @@ static inline char *wmi_service_name(int service_id)
...
@@ -222,128 +222,131 @@ static inline char *wmi_service_name(int service_id)
#undef SVCSTR
#undef SVCSTR
}
}
#define WMI_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id) \
#define WMI_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id, len) \
(__le32_to_cpu((wmi_svc_bmap)[(svc_id)/(sizeof(u32))]) & \
((svc_id) < (len) && \
__le32_to_cpu((wmi_svc_bmap)[(svc_id)/(sizeof(u32))]) & \
BIT((svc_id)%(sizeof(u32))))
BIT((svc_id)%(sizeof(u32))))
#define SVCMAP(x, y) \
#define SVCMAP(x, y
, len
) \
do { \
do { \
if (WMI_SERVICE_IS_ENABLED((in), (x))) \
if (WMI_SERVICE_IS_ENABLED((in), (x)
, (len)
)) \
__set_bit(y, out); \
__set_bit(y, out); \
} while (0)
} while (0)
static
inline
void
wmi_10x_svc_map
(
const
__le32
*
in
,
unsigned
long
*
out
)
static
inline
void
wmi_10x_svc_map
(
const
__le32
*
in
,
unsigned
long
*
out
,
size_t
len
)
{
{
SVCMAP
(
WMI_10X_SERVICE_BEACON_OFFLOAD
,
SVCMAP
(
WMI_10X_SERVICE_BEACON_OFFLOAD
,
WMI_SERVICE_BEACON_OFFLOAD
);
WMI_SERVICE_BEACON_OFFLOAD
,
len
);
SVCMAP
(
WMI_10X_SERVICE_SCAN_OFFLOAD
,
SVCMAP
(
WMI_10X_SERVICE_SCAN_OFFLOAD
,
WMI_SERVICE_SCAN_OFFLOAD
);
WMI_SERVICE_SCAN_OFFLOAD
,
len
);
SVCMAP
(
WMI_10X_SERVICE_ROAM_OFFLOAD
,
SVCMAP
(
WMI_10X_SERVICE_ROAM_OFFLOAD
,
WMI_SERVICE_ROAM_OFFLOAD
);
WMI_SERVICE_ROAM_OFFLOAD
,
len
);
SVCMAP
(
WMI_10X_SERVICE_BCN_MISS_OFFLOAD
,
SVCMAP
(
WMI_10X_SERVICE_BCN_MISS_OFFLOAD
,
WMI_SERVICE_BCN_MISS_OFFLOAD
);
WMI_SERVICE_BCN_MISS_OFFLOAD
,
len
);
SVCMAP
(
WMI_10X_SERVICE_STA_PWRSAVE
,
SVCMAP
(
WMI_10X_SERVICE_STA_PWRSAVE
,
WMI_SERVICE_STA_PWRSAVE
);
WMI_SERVICE_STA_PWRSAVE
,
len
);
SVCMAP
(
WMI_10X_SERVICE_STA_ADVANCED_PWRSAVE
,
SVCMAP
(
WMI_10X_SERVICE_STA_ADVANCED_PWRSAVE
,
WMI_SERVICE_STA_ADVANCED_PWRSAVE
);
WMI_SERVICE_STA_ADVANCED_PWRSAVE
,
len
);
SVCMAP
(
WMI_10X_SERVICE_AP_UAPSD
,
SVCMAP
(
WMI_10X_SERVICE_AP_UAPSD
,
WMI_SERVICE_AP_UAPSD
);
WMI_SERVICE_AP_UAPSD
,
len
);
SVCMAP
(
WMI_10X_SERVICE_AP_DFS
,
SVCMAP
(
WMI_10X_SERVICE_AP_DFS
,
WMI_SERVICE_AP_DFS
);
WMI_SERVICE_AP_DFS
,
len
);
SVCMAP
(
WMI_10X_SERVICE_11AC
,
SVCMAP
(
WMI_10X_SERVICE_11AC
,
WMI_SERVICE_11AC
);
WMI_SERVICE_11AC
,
len
);
SVCMAP
(
WMI_10X_SERVICE_BLOCKACK
,
SVCMAP
(
WMI_10X_SERVICE_BLOCKACK
,
WMI_SERVICE_BLOCKACK
);
WMI_SERVICE_BLOCKACK
,
len
);
SVCMAP
(
WMI_10X_SERVICE_PHYERR
,
SVCMAP
(
WMI_10X_SERVICE_PHYERR
,
WMI_SERVICE_PHYERR
);
WMI_SERVICE_PHYERR
,
len
);
SVCMAP
(
WMI_10X_SERVICE_BCN_FILTER
,
SVCMAP
(
WMI_10X_SERVICE_BCN_FILTER
,
WMI_SERVICE_BCN_FILTER
);
WMI_SERVICE_BCN_FILTER
,
len
);
SVCMAP
(
WMI_10X_SERVICE_RTT
,
SVCMAP
(
WMI_10X_SERVICE_RTT
,
WMI_SERVICE_RTT
);
WMI_SERVICE_RTT
,
len
);
SVCMAP
(
WMI_10X_SERVICE_RATECTRL
,
SVCMAP
(
WMI_10X_SERVICE_RATECTRL
,
WMI_SERVICE_RATECTRL
);
WMI_SERVICE_RATECTRL
,
len
);
SVCMAP
(
WMI_10X_SERVICE_WOW
,
SVCMAP
(
WMI_10X_SERVICE_WOW
,
WMI_SERVICE_WOW
);
WMI_SERVICE_WOW
,
len
);
SVCMAP
(
WMI_10X_SERVICE_RATECTRL_CACHE
,
SVCMAP
(
WMI_10X_SERVICE_RATECTRL_CACHE
,
WMI_SERVICE_RATECTRL_CACHE
);
WMI_SERVICE_RATECTRL_CACHE
,
len
);
SVCMAP
(
WMI_10X_SERVICE_IRAM_TIDS
,
SVCMAP
(
WMI_10X_SERVICE_IRAM_TIDS
,
WMI_SERVICE_IRAM_TIDS
);
WMI_SERVICE_IRAM_TIDS
,
len
);
SVCMAP
(
WMI_10X_SERVICE_BURST
,
SVCMAP
(
WMI_10X_SERVICE_BURST
,
WMI_SERVICE_BURST
);
WMI_SERVICE_BURST
,
len
);
SVCMAP
(
WMI_10X_SERVICE_SMART_ANTENNA_SW_SUPPORT
,
SVCMAP
(
WMI_10X_SERVICE_SMART_ANTENNA_SW_SUPPORT
,
WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT
);
WMI_SERVICE_SMART_ANTENNA_SW_SUPPORT
,
len
);
SVCMAP
(
WMI_10X_SERVICE_FORCE_FW_HANG
,
SVCMAP
(
WMI_10X_SERVICE_FORCE_FW_HANG
,
WMI_SERVICE_FORCE_FW_HANG
);
WMI_SERVICE_FORCE_FW_HANG
,
len
);
SVCMAP
(
WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT
,
SVCMAP
(
WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT
,
WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT
);
WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT
,
len
);
}
}
static
inline
void
wmi_main_svc_map
(
const
__le32
*
in
,
unsigned
long
*
out
)
static
inline
void
wmi_main_svc_map
(
const
__le32
*
in
,
unsigned
long
*
out
,
size_t
len
)
{
{
SVCMAP
(
WMI_MAIN_SERVICE_BEACON_OFFLOAD
,
SVCMAP
(
WMI_MAIN_SERVICE_BEACON_OFFLOAD
,
WMI_SERVICE_BEACON_OFFLOAD
);
WMI_SERVICE_BEACON_OFFLOAD
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_SCAN_OFFLOAD
,
SVCMAP
(
WMI_MAIN_SERVICE_SCAN_OFFLOAD
,
WMI_SERVICE_SCAN_OFFLOAD
);
WMI_SERVICE_SCAN_OFFLOAD
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_ROAM_OFFLOAD
,
SVCMAP
(
WMI_MAIN_SERVICE_ROAM_OFFLOAD
,
WMI_SERVICE_ROAM_OFFLOAD
);
WMI_SERVICE_ROAM_OFFLOAD
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_BCN_MISS_OFFLOAD
,
SVCMAP
(
WMI_MAIN_SERVICE_BCN_MISS_OFFLOAD
,
WMI_SERVICE_BCN_MISS_OFFLOAD
);
WMI_SERVICE_BCN_MISS_OFFLOAD
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_STA_PWRSAVE
,
SVCMAP
(
WMI_MAIN_SERVICE_STA_PWRSAVE
,
WMI_SERVICE_STA_PWRSAVE
);
WMI_SERVICE_STA_PWRSAVE
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_STA_ADVANCED_PWRSAVE
,
SVCMAP
(
WMI_MAIN_SERVICE_STA_ADVANCED_PWRSAVE
,
WMI_SERVICE_STA_ADVANCED_PWRSAVE
);
WMI_SERVICE_STA_ADVANCED_PWRSAVE
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_AP_UAPSD
,
SVCMAP
(
WMI_MAIN_SERVICE_AP_UAPSD
,
WMI_SERVICE_AP_UAPSD
);
WMI_SERVICE_AP_UAPSD
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_AP_DFS
,
SVCMAP
(
WMI_MAIN_SERVICE_AP_DFS
,
WMI_SERVICE_AP_DFS
);
WMI_SERVICE_AP_DFS
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_11AC
,
SVCMAP
(
WMI_MAIN_SERVICE_11AC
,
WMI_SERVICE_11AC
);
WMI_SERVICE_11AC
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_BLOCKACK
,
SVCMAP
(
WMI_MAIN_SERVICE_BLOCKACK
,
WMI_SERVICE_BLOCKACK
);
WMI_SERVICE_BLOCKACK
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_PHYERR
,
SVCMAP
(
WMI_MAIN_SERVICE_PHYERR
,
WMI_SERVICE_PHYERR
);
WMI_SERVICE_PHYERR
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_BCN_FILTER
,
SVCMAP
(
WMI_MAIN_SERVICE_BCN_FILTER
,
WMI_SERVICE_BCN_FILTER
);
WMI_SERVICE_BCN_FILTER
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_RTT
,
SVCMAP
(
WMI_MAIN_SERVICE_RTT
,
WMI_SERVICE_RTT
);
WMI_SERVICE_RTT
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_RATECTRL
,
SVCMAP
(
WMI_MAIN_SERVICE_RATECTRL
,
WMI_SERVICE_RATECTRL
);
WMI_SERVICE_RATECTRL
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_WOW
,
SVCMAP
(
WMI_MAIN_SERVICE_WOW
,
WMI_SERVICE_WOW
);
WMI_SERVICE_WOW
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_RATECTRL_CACHE
,
SVCMAP
(
WMI_MAIN_SERVICE_RATECTRL_CACHE
,
WMI_SERVICE_RATECTRL_CACHE
);
WMI_SERVICE_RATECTRL_CACHE
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_IRAM_TIDS
,
SVCMAP
(
WMI_MAIN_SERVICE_IRAM_TIDS
,
WMI_SERVICE_IRAM_TIDS
);
WMI_SERVICE_IRAM_TIDS
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_ARPNS_OFFLOAD
,
SVCMAP
(
WMI_MAIN_SERVICE_ARPNS_OFFLOAD
,
WMI_SERVICE_ARPNS_OFFLOAD
);
WMI_SERVICE_ARPNS_OFFLOAD
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_NLO
,
SVCMAP
(
WMI_MAIN_SERVICE_NLO
,
WMI_SERVICE_NLO
);
WMI_SERVICE_NLO
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_GTK_OFFLOAD
,
SVCMAP
(
WMI_MAIN_SERVICE_GTK_OFFLOAD
,
WMI_SERVICE_GTK_OFFLOAD
);
WMI_SERVICE_GTK_OFFLOAD
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_SCAN_SCH
,
SVCMAP
(
WMI_MAIN_SERVICE_SCAN_SCH
,
WMI_SERVICE_SCAN_SCH
);
WMI_SERVICE_SCAN_SCH
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_CSA_OFFLOAD
,
SVCMAP
(
WMI_MAIN_SERVICE_CSA_OFFLOAD
,
WMI_SERVICE_CSA_OFFLOAD
);
WMI_SERVICE_CSA_OFFLOAD
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_CHATTER
,
SVCMAP
(
WMI_MAIN_SERVICE_CHATTER
,
WMI_SERVICE_CHATTER
);
WMI_SERVICE_CHATTER
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_COEX_FREQAVOID
,
SVCMAP
(
WMI_MAIN_SERVICE_COEX_FREQAVOID
,
WMI_SERVICE_COEX_FREQAVOID
);
WMI_SERVICE_COEX_FREQAVOID
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_PACKET_POWER_SAVE
,
SVCMAP
(
WMI_MAIN_SERVICE_PACKET_POWER_SAVE
,
WMI_SERVICE_PACKET_POWER_SAVE
);
WMI_SERVICE_PACKET_POWER_SAVE
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_FORCE_FW_HANG
,
SVCMAP
(
WMI_MAIN_SERVICE_FORCE_FW_HANG
,
WMI_SERVICE_FORCE_FW_HANG
);
WMI_SERVICE_FORCE_FW_HANG
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_GPIO
,
SVCMAP
(
WMI_MAIN_SERVICE_GPIO
,
WMI_SERVICE_GPIO
);
WMI_SERVICE_GPIO
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_STA_DTIM_PS_MODULATED_DTIM
,
SVCMAP
(
WMI_MAIN_SERVICE_STA_DTIM_PS_MODULATED_DTIM
,
WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM
);
WMI_SERVICE_STA_DTIM_PS_MODULATED_DTIM
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG
,
SVCMAP
(
WMI_MAIN_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG
,
WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG
);
WMI_SERVICE_STA_UAPSD_BASIC_AUTO_TRIG
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_STA_UAPSD_VAR_AUTO_TRIG
,
SVCMAP
(
WMI_MAIN_SERVICE_STA_UAPSD_VAR_AUTO_TRIG
,
WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG
);
WMI_SERVICE_STA_UAPSD_VAR_AUTO_TRIG
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_STA_KEEP_ALIVE
,
SVCMAP
(
WMI_MAIN_SERVICE_STA_KEEP_ALIVE
,
WMI_SERVICE_STA_KEEP_ALIVE
);
WMI_SERVICE_STA_KEEP_ALIVE
,
len
);
SVCMAP
(
WMI_MAIN_SERVICE_TX_ENCAP
,
SVCMAP
(
WMI_MAIN_SERVICE_TX_ENCAP
,
WMI_SERVICE_TX_ENCAP
);
WMI_SERVICE_TX_ENCAP
,
len
);
}
}
#undef SVCMAP
#undef SVCMAP
...
@@ -1952,6 +1955,11 @@ struct wmi_ssid_list {
...
@@ -1952,6 +1955,11 @@ struct wmi_ssid_list {
#define WLAN_SCAN_PARAMS_MAX_BSSID 4
#define WLAN_SCAN_PARAMS_MAX_BSSID 4
#define WLAN_SCAN_PARAMS_MAX_IE_LEN 256
#define WLAN_SCAN_PARAMS_MAX_IE_LEN 256
/* Values lower than this may be refused by some firmware revisions with a scan
* completion with a timedout reason.
*/
#define WMI_SCAN_CHAN_MIN_TIME_MSEC 40
/* Scan priority numbers must be sequential, starting with 0 */
/* Scan priority numbers must be sequential, starting with 0 */
enum
wmi_scan_priority
{
enum
wmi_scan_priority
{
WMI_SCAN_PRIORITY_VERY_LOW
=
0
,
WMI_SCAN_PRIORITY_VERY_LOW
=
0
,
...
@@ -4547,7 +4555,6 @@ struct wmi_dbglog_cfg_cmd {
...
@@ -4547,7 +4555,6 @@ struct wmi_dbglog_cfg_cmd {
__le32
config_valid
;
__le32
config_valid
;
}
__packed
;
}
__packed
;
#define ATH10K_RTS_MAX 2347
#define ATH10K_FRAGMT_THRESHOLD_MIN 540
#define ATH10K_FRAGMT_THRESHOLD_MIN 540
#define ATH10K_FRAGMT_THRESHOLD_MAX 2346
#define ATH10K_FRAGMT_THRESHOLD_MAX 2346
...
@@ -4572,6 +4579,7 @@ struct wmi_svc_rdy_ev_arg {
...
@@ -4572,6 +4579,7 @@ struct wmi_svc_rdy_ev_arg {
__le32
eeprom_rd
;
__le32
eeprom_rd
;
__le32
num_mem_reqs
;
__le32
num_mem_reqs
;
const
__le32
*
service_map
;
const
__le32
*
service_map
;
size_t
service_map_len
;
const
struct
wlan_host_mem_req
*
mem_reqs
[
WMI_MAX_MEM_REQS
];
const
struct
wlan_host_mem_req
*
mem_reqs
[
WMI_MAX_MEM_REQS
];
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment