Commit 59e25676 authored by John W. Linville's avatar John W. Linville

Merge branch 'for-linville' of git://github.com/kvalo/ath

parents 7bb75da1 0fdc14e4
...@@ -25,6 +25,7 @@ config ATH10K_DEBUG ...@@ -25,6 +25,7 @@ config ATH10K_DEBUG
config ATH10K_DEBUGFS config ATH10K_DEBUGFS
bool "Atheros ath10k debugfs support" bool "Atheros ath10k debugfs support"
depends on ATH10K depends on ATH10K
select RELAY
---help--- ---help---
Enabled debugfs support Enabled debugfs support
......
...@@ -10,6 +10,7 @@ ath10k_core-y += mac.o \ ...@@ -10,6 +10,7 @@ ath10k_core-y += mac.o \
wmi.o \ wmi.o \
bmi.o bmi.o
ath10k_core-$(CONFIG_ATH10K_DEBUGFS) += spectral.o
ath10k_core-$(CONFIG_ATH10K_TRACING) += trace.o ath10k_core-$(CONFIG_ATH10K_TRACING) += trace.o
obj-$(CONFIG_ATH10K_PCI) += ath10k_pci.o obj-$(CONFIG_ATH10K_PCI) += ath10k_pci.o
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
void ath10k_bmi_start(struct ath10k *ar) void ath10k_bmi_start(struct ath10k *ar)
{ {
ath10k_dbg(ATH10K_DBG_BMI, "bmi start\n"); ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi start\n");
ar->bmi.done_sent = false; ar->bmi.done_sent = false;
} }
...@@ -33,10 +33,10 @@ int ath10k_bmi_done(struct ath10k *ar) ...@@ -33,10 +33,10 @@ int ath10k_bmi_done(struct ath10k *ar)
u32 cmdlen = sizeof(cmd.id) + sizeof(cmd.done); u32 cmdlen = sizeof(cmd.id) + sizeof(cmd.done);
int ret; int ret;
ath10k_dbg(ATH10K_DBG_BMI, "bmi done\n"); ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi done\n");
if (ar->bmi.done_sent) { if (ar->bmi.done_sent) {
ath10k_dbg(ATH10K_DBG_BMI, "bmi skipped\n"); ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi skipped\n");
return 0; return 0;
} }
...@@ -45,7 +45,7 @@ int ath10k_bmi_done(struct ath10k *ar) ...@@ -45,7 +45,7 @@ int ath10k_bmi_done(struct ath10k *ar)
ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, NULL, NULL); ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, NULL, NULL);
if (ret) { if (ret) {
ath10k_warn("unable to write to the device: %d\n", ret); ath10k_warn(ar, "unable to write to the device: %d\n", ret);
return ret; return ret;
} }
...@@ -61,10 +61,10 @@ int ath10k_bmi_get_target_info(struct ath10k *ar, ...@@ -61,10 +61,10 @@ int ath10k_bmi_get_target_info(struct ath10k *ar,
u32 resplen = sizeof(resp.get_target_info); u32 resplen = sizeof(resp.get_target_info);
int ret; int ret;
ath10k_dbg(ATH10K_DBG_BMI, "bmi get target info\n"); ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi get target info\n");
if (ar->bmi.done_sent) { if (ar->bmi.done_sent) {
ath10k_warn("BMI Get Target Info Command disallowed\n"); ath10k_warn(ar, "BMI Get Target Info Command disallowed\n");
return -EBUSY; return -EBUSY;
} }
...@@ -72,12 +72,12 @@ int ath10k_bmi_get_target_info(struct ath10k *ar, ...@@ -72,12 +72,12 @@ int ath10k_bmi_get_target_info(struct ath10k *ar,
ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, &resp, &resplen); ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, &resp, &resplen);
if (ret) { if (ret) {
ath10k_warn("unable to get target info from device\n"); ath10k_warn(ar, "unable to get target info from device\n");
return ret; return ret;
} }
if (resplen < sizeof(resp.get_target_info)) { if (resplen < sizeof(resp.get_target_info)) {
ath10k_warn("invalid get_target_info response length (%d)\n", ath10k_warn(ar, "invalid get_target_info response length (%d)\n",
resplen); resplen);
return -EIO; return -EIO;
} }
...@@ -97,11 +97,11 @@ int ath10k_bmi_read_memory(struct ath10k *ar, ...@@ -97,11 +97,11 @@ int ath10k_bmi_read_memory(struct ath10k *ar,
u32 rxlen; u32 rxlen;
int ret; int ret;
ath10k_dbg(ATH10K_DBG_BMI, "bmi read address 0x%x length %d\n", ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi read address 0x%x length %d\n",
address, length); address, length);
if (ar->bmi.done_sent) { if (ar->bmi.done_sent) {
ath10k_warn("command disallowed\n"); ath10k_warn(ar, "command disallowed\n");
return -EBUSY; return -EBUSY;
} }
...@@ -115,7 +115,7 @@ int ath10k_bmi_read_memory(struct ath10k *ar, ...@@ -115,7 +115,7 @@ int ath10k_bmi_read_memory(struct ath10k *ar,
ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen,
&resp, &rxlen); &resp, &rxlen);
if (ret) { if (ret) {
ath10k_warn("unable to read from the device (%d)\n", ath10k_warn(ar, "unable to read from the device (%d)\n",
ret); ret);
return ret; return ret;
} }
...@@ -137,11 +137,11 @@ int ath10k_bmi_write_memory(struct ath10k *ar, ...@@ -137,11 +137,11 @@ int ath10k_bmi_write_memory(struct ath10k *ar,
u32 txlen; u32 txlen;
int ret; int ret;
ath10k_dbg(ATH10K_DBG_BMI, "bmi write address 0x%x length %d\n", ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi write address 0x%x length %d\n",
address, length); address, length);
if (ar->bmi.done_sent) { if (ar->bmi.done_sent) {
ath10k_warn("command disallowed\n"); ath10k_warn(ar, "command disallowed\n");
return -EBUSY; return -EBUSY;
} }
...@@ -159,7 +159,7 @@ int ath10k_bmi_write_memory(struct ath10k *ar, ...@@ -159,7 +159,7 @@ int ath10k_bmi_write_memory(struct ath10k *ar,
ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, hdrlen + txlen, ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, hdrlen + txlen,
NULL, NULL); NULL, NULL);
if (ret) { if (ret) {
ath10k_warn("unable to write to the device (%d)\n", ath10k_warn(ar, "unable to write to the device (%d)\n",
ret); ret);
return ret; return ret;
} }
...@@ -183,11 +183,11 @@ int ath10k_bmi_execute(struct ath10k *ar, u32 address, u32 param, u32 *result) ...@@ -183,11 +183,11 @@ int ath10k_bmi_execute(struct ath10k *ar, u32 address, u32 param, u32 *result)
u32 resplen = sizeof(resp.execute); u32 resplen = sizeof(resp.execute);
int ret; int ret;
ath10k_dbg(ATH10K_DBG_BMI, "bmi execute address 0x%x param 0x%x\n", ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi execute address 0x%x param 0x%x\n",
address, param); address, param);
if (ar->bmi.done_sent) { if (ar->bmi.done_sent) {
ath10k_warn("command disallowed\n"); ath10k_warn(ar, "command disallowed\n");
return -EBUSY; return -EBUSY;
} }
...@@ -197,19 +197,19 @@ int ath10k_bmi_execute(struct ath10k *ar, u32 address, u32 param, u32 *result) ...@@ -197,19 +197,19 @@ int ath10k_bmi_execute(struct ath10k *ar, u32 address, u32 param, u32 *result)
ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, &resp, &resplen); ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, &resp, &resplen);
if (ret) { if (ret) {
ath10k_warn("unable to read from the device\n"); ath10k_warn(ar, "unable to read from the device\n");
return ret; return ret;
} }
if (resplen < sizeof(resp.execute)) { if (resplen < sizeof(resp.execute)) {
ath10k_warn("invalid execute response length (%d)\n", ath10k_warn(ar, "invalid execute response length (%d)\n",
resplen); resplen);
return -EIO; return -EIO;
} }
*result = __le32_to_cpu(resp.execute.result); *result = __le32_to_cpu(resp.execute.result);
ath10k_dbg(ATH10K_DBG_BMI, "bmi execute result 0x%x\n", *result); ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi execute result 0x%x\n", *result);
return 0; return 0;
} }
...@@ -221,11 +221,11 @@ int ath10k_bmi_lz_data(struct ath10k *ar, const void *buffer, u32 length) ...@@ -221,11 +221,11 @@ int ath10k_bmi_lz_data(struct ath10k *ar, const void *buffer, u32 length)
u32 txlen; u32 txlen;
int ret; int ret;
ath10k_dbg(ATH10K_DBG_BMI, "bmi lz data buffer 0x%p length %d\n", ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi lz data buffer 0x%p length %d\n",
buffer, length); buffer, length);
if (ar->bmi.done_sent) { if (ar->bmi.done_sent) {
ath10k_warn("command disallowed\n"); ath10k_warn(ar, "command disallowed\n");
return -EBUSY; return -EBUSY;
} }
...@@ -241,7 +241,7 @@ int ath10k_bmi_lz_data(struct ath10k *ar, const void *buffer, u32 length) ...@@ -241,7 +241,7 @@ int ath10k_bmi_lz_data(struct ath10k *ar, const void *buffer, u32 length)
ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, hdrlen + txlen, ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, hdrlen + txlen,
NULL, NULL); NULL, NULL);
if (ret) { if (ret) {
ath10k_warn("unable to write to the device\n"); ath10k_warn(ar, "unable to write to the device\n");
return ret; return ret;
} }
...@@ -258,11 +258,11 @@ int ath10k_bmi_lz_stream_start(struct ath10k *ar, u32 address) ...@@ -258,11 +258,11 @@ int ath10k_bmi_lz_stream_start(struct ath10k *ar, u32 address)
u32 cmdlen = sizeof(cmd.id) + sizeof(cmd.lz_start); u32 cmdlen = sizeof(cmd.id) + sizeof(cmd.lz_start);
int ret; int ret;
ath10k_dbg(ATH10K_DBG_BMI, "bmi lz stream start address 0x%x\n", ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi lz stream start address 0x%x\n",
address); address);
if (ar->bmi.done_sent) { if (ar->bmi.done_sent) {
ath10k_warn("command disallowed\n"); ath10k_warn(ar, "command disallowed\n");
return -EBUSY; return -EBUSY;
} }
...@@ -271,7 +271,7 @@ int ath10k_bmi_lz_stream_start(struct ath10k *ar, u32 address) ...@@ -271,7 +271,7 @@ int ath10k_bmi_lz_stream_start(struct ath10k *ar, u32 address)
ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, NULL, NULL); ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, NULL, NULL);
if (ret) { if (ret) {
ath10k_warn("unable to Start LZ Stream to the device\n"); ath10k_warn(ar, "unable to Start LZ Stream to the device\n");
return ret; return ret;
} }
...@@ -286,7 +286,7 @@ int ath10k_bmi_fast_download(struct ath10k *ar, ...@@ -286,7 +286,7 @@ int ath10k_bmi_fast_download(struct ath10k *ar,
u32 trailer_len = length - head_len; u32 trailer_len = length - head_len;
int ret; int ret;
ath10k_dbg(ATH10K_DBG_BMI, ath10k_dbg(ar, ATH10K_DBG_BMI,
"bmi fast download address 0x%x buffer 0x%p length %d\n", "bmi fast download address 0x%x buffer 0x%p length %d\n",
address, buffer, length); address, buffer, length);
......
This diff is collapsed.
...@@ -162,30 +162,13 @@ int ath10k_ce_send_nolock(struct ath10k_ce_pipe *ce_state, ...@@ -162,30 +162,13 @@ int ath10k_ce_send_nolock(struct ath10k_ce_pipe *ce_state,
void __ath10k_ce_send_revert(struct ath10k_ce_pipe *pipe); void __ath10k_ce_send_revert(struct ath10k_ce_pipe *pipe);
void ath10k_ce_send_cb_register(struct ath10k_ce_pipe *ce_state,
void (*send_cb)(struct ath10k_ce_pipe *),
int disable_interrupts);
int ath10k_ce_num_free_src_entries(struct ath10k_ce_pipe *pipe); int ath10k_ce_num_free_src_entries(struct ath10k_ce_pipe *pipe);
/*==================Recv=======================*/ /*==================Recv=======================*/
/* int __ath10k_ce_rx_num_free_bufs(struct ath10k_ce_pipe *pipe);
* Make a buffer available to receive. The buffer must be at least of a int __ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, u32 paddr);
* minimal size appropriate for this copy engine (src_sz_max attribute). int ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, u32 paddr);
* ce - which copy engine to use
* per_transfer_recv_context - context passed back to caller's recv_cb
* buffer - address of buffer in CE space
* Returns 0 on success; otherwise an error status.
*
* Implemenation note: Pushes a buffer to Dest ring.
*/
int ath10k_ce_recv_buf_enqueue(struct ath10k_ce_pipe *ce_state,
void *per_transfer_recv_context,
u32 buffer);
void ath10k_ce_recv_cb_register(struct ath10k_ce_pipe *ce_state,
void (*recv_cb)(struct ath10k_ce_pipe *));
/* recv flags */ /* recv flags */
/* Data is byte-swapped */ /* Data is byte-swapped */
...@@ -214,7 +197,9 @@ int ath10k_ce_completed_send_next(struct ath10k_ce_pipe *ce_state, ...@@ -214,7 +197,9 @@ int ath10k_ce_completed_send_next(struct ath10k_ce_pipe *ce_state,
/*==================CE Engine Initialization=======================*/ /*==================CE Engine Initialization=======================*/
int ath10k_ce_init_pipe(struct ath10k *ar, unsigned int ce_id, int ath10k_ce_init_pipe(struct ath10k *ar, unsigned 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_deinit_pipe(struct ath10k *ar, unsigned int ce_id); void ath10k_ce_deinit_pipe(struct ath10k *ar, unsigned int ce_id);
int ath10k_ce_alloc_pipe(struct ath10k *ar, int ce_id, int ath10k_ce_alloc_pipe(struct ath10k *ar, int ce_id,
const struct ce_attr *attr); const struct ce_attr *attr);
...@@ -245,6 +230,7 @@ int ath10k_ce_cancel_send_next(struct ath10k_ce_pipe *ce_state, ...@@ -245,6 +230,7 @@ int ath10k_ce_cancel_send_next(struct ath10k_ce_pipe *ce_state,
void ath10k_ce_per_engine_service_any(struct ath10k *ar); void ath10k_ce_per_engine_service_any(struct ath10k *ar);
void ath10k_ce_per_engine_service(struct ath10k *ar, unsigned int ce_id); void ath10k_ce_per_engine_service(struct ath10k *ar, unsigned int ce_id);
int ath10k_ce_disable_interrupts(struct ath10k *ar); int ath10k_ce_disable_interrupts(struct ath10k *ar);
void ath10k_ce_enable_interrupts(struct ath10k *ar);
/* ce_attr.flags values */ /* ce_attr.flags values */
/* Use NonSnooping PCIe accesses? */ /* Use NonSnooping PCIe accesses? */
......
This diff is collapsed.
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#include <linux/if_ether.h> #include <linux/if_ether.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/uuid.h>
#include <linux/time.h>
#include "htt.h" #include "htt.h"
#include "htc.h" #include "htc.h"
...@@ -31,6 +33,7 @@ ...@@ -31,6 +33,7 @@
#include "../ath.h" #include "../ath.h"
#include "../regd.h" #include "../regd.h"
#include "../dfs_pattern_detector.h" #include "../dfs_pattern_detector.h"
#include "spectral.h"
#define MS(_v, _f) (((_v) & _f##_MASK) >> _f##_LSB) #define MS(_v, _f) (((_v) & _f##_MASK) >> _f##_LSB)
#define SM(_v, _f) (((_v) << _f##_LSB) & _f##_MASK) #define SM(_v, _f) (((_v) << _f##_LSB) & _f##_MASK)
...@@ -237,6 +240,7 @@ struct ath10k_vif { ...@@ -237,6 +240,7 @@ struct ath10k_vif {
bool is_started; bool is_started;
bool is_up; bool is_up;
bool spectral_enabled;
u32 aid; u32 aid;
u8 bssid[ETH_ALEN]; u8 bssid[ETH_ALEN];
...@@ -276,11 +280,20 @@ struct ath10k_vif_iter { ...@@ -276,11 +280,20 @@ struct ath10k_vif_iter {
struct ath10k_vif *arvif; struct ath10k_vif *arvif;
}; };
/* used for crash-dump storage, protected by data-lock */
struct ath10k_fw_crash_data {
bool crashed_since_read;
uuid_le uuid;
struct timespec timestamp;
__le32 registers[REG_DUMP_COUNT_QCA988X];
};
struct ath10k_debug { struct ath10k_debug {
struct dentry *debugfs_phy; struct dentry *debugfs_phy;
struct ath10k_target_stats target_stats; struct ath10k_target_stats target_stats;
u32 wmi_service_bitmap[WMI_SERVICE_BM_SIZE]; DECLARE_BITMAP(wmi_service_bitmap, WMI_SERVICE_BM_SIZE);
struct completion event_stats_compl; struct completion event_stats_compl;
...@@ -293,6 +306,8 @@ struct ath10k_debug { ...@@ -293,6 +306,8 @@ struct ath10k_debug {
u8 htt_max_amsdu; u8 htt_max_amsdu;
u8 htt_max_ampdu; u8 htt_max_ampdu;
struct ath10k_fw_crash_data *fw_crash_data;
}; };
enum ath10k_state { enum ath10k_state {
...@@ -330,6 +345,11 @@ enum ath10k_fw_features { ...@@ -330,6 +345,11 @@ enum ath10k_fw_features {
/* Firmware does not support P2P */ /* Firmware does not support P2P */
ATH10K_FW_FEATURE_NO_P2P = 3, ATH10K_FW_FEATURE_NO_P2P = 3,
/* Firmware 10.2 feature bit. The ATH10K_FW_FEATURE_WMI_10X feature bit
* is required to be set as well.
*/
ATH10K_FW_FEATURE_WMI_10_2 = 4,
/* keep last */ /* keep last */
ATH10K_FW_FEATURE_COUNT, ATH10K_FW_FEATURE_COUNT,
}; };
...@@ -337,10 +357,32 @@ enum ath10k_fw_features { ...@@ -337,10 +357,32 @@ enum ath10k_fw_features {
enum ath10k_dev_flags { enum ath10k_dev_flags {
/* Indicates that ath10k device is during CAC phase of DFS */ /* Indicates that ath10k device is during CAC phase of DFS */
ATH10K_CAC_RUNNING, ATH10K_CAC_RUNNING,
ATH10K_FLAG_FIRST_BOOT_DONE,
ATH10K_FLAG_CORE_REGISTERED, ATH10K_FLAG_CORE_REGISTERED,
}; };
enum ath10k_scan_state {
ATH10K_SCAN_IDLE,
ATH10K_SCAN_STARTING,
ATH10K_SCAN_RUNNING,
ATH10K_SCAN_ABORTING,
};
static inline const char *ath10k_scan_state_str(enum ath10k_scan_state state)
{
switch (state) {
case ATH10K_SCAN_IDLE:
return "idle";
case ATH10K_SCAN_STARTING:
return "starting";
case ATH10K_SCAN_RUNNING:
return "running";
case ATH10K_SCAN_ABORTING:
return "aborting";
}
return "unknown";
}
struct ath10k { struct ath10k {
struct ath_common ath_common; struct ath_common ath_common;
struct ieee80211_hw *hw; struct ieee80211_hw *hw;
...@@ -368,7 +410,6 @@ struct ath10k { ...@@ -368,7 +410,6 @@ struct ath10k {
bool p2p; bool p2p;
struct { struct {
void *priv;
const struct ath10k_hif_ops *ops; const struct ath10k_hif_ops *ops;
} hif; } hif;
...@@ -410,10 +451,9 @@ struct ath10k { ...@@ -410,10 +451,9 @@ struct ath10k {
struct completion started; struct completion started;
struct completion completed; struct completion completed;
struct completion on_channel; struct completion on_channel;
struct timer_list timeout; struct delayed_work timeout;
enum ath10k_scan_state state;
bool is_roc; bool is_roc;
bool in_progress;
bool aborting;
int vdev_id; int vdev_id;
int roc_freq; int roc_freq;
} scan; } scan;
...@@ -494,9 +534,21 @@ struct ath10k { ...@@ -494,9 +534,21 @@ struct ath10k {
#ifdef CONFIG_ATH10K_DEBUGFS #ifdef CONFIG_ATH10K_DEBUGFS
struct ath10k_debug debug; struct ath10k_debug debug;
#endif #endif
struct {
/* relay(fs) channel for spectral scan */
struct rchan *rfs_chan_spec_scan;
/* spectral_mode and spec_config are protected by conf_mutex */
enum ath10k_spectral_mode mode;
struct ath10k_spec_scan config;
} spectral;
/* must be last */
u8 drv_priv[0] __aligned(sizeof(void *));
}; };
struct ath10k *ath10k_core_create(void *hif_priv, struct device *dev, struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev,
const struct ath10k_hif_ops *hif_ops); const struct ath10k_hif_ops *hif_ops);
void ath10k_core_destroy(struct ath10k *ar); void ath10k_core_destroy(struct ath10k *ar);
......
This diff is collapsed.
...@@ -39,9 +39,10 @@ enum ath10k_debug_mask { ...@@ -39,9 +39,10 @@ enum ath10k_debug_mask {
extern unsigned int ath10k_debug_mask; extern unsigned int ath10k_debug_mask;
__printf(1, 2) int ath10k_info(const char *fmt, ...); __printf(2, 3) int ath10k_info(struct ath10k *ar, const char *fmt, ...);
__printf(1, 2) int ath10k_err(const char *fmt, ...); __printf(2, 3) int ath10k_err(struct ath10k *ar, const char *fmt, ...);
__printf(1, 2) int ath10k_warn(const char *fmt, ...); __printf(2, 3) int ath10k_warn(struct ath10k *ar, const char *fmt, ...);
void ath10k_print_driver_info(struct ath10k *ar);
#ifdef CONFIG_ATH10K_DEBUGFS #ifdef CONFIG_ATH10K_DEBUGFS
int ath10k_debug_start(struct ath10k *ar); int ath10k_debug_start(struct ath10k *ar);
...@@ -53,6 +54,10 @@ void ath10k_debug_read_service_map(struct ath10k *ar, ...@@ -53,6 +54,10 @@ void ath10k_debug_read_service_map(struct ath10k *ar,
size_t map_size); size_t map_size);
void ath10k_debug_read_target_stats(struct ath10k *ar, void ath10k_debug_read_target_stats(struct ath10k *ar,
struct wmi_stats_event *ev); struct wmi_stats_event *ev);
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++) #define ATH10K_DFS_STAT_INC(ar, c) (ar->debug.dfs_stats.c++)
...@@ -86,25 +91,40 @@ static inline void ath10k_debug_read_target_stats(struct ath10k *ar, ...@@ -86,25 +91,40 @@ static inline void ath10k_debug_read_target_stats(struct ath10k *ar,
{ {
} }
static inline void ath10k_debug_dbglog_add(struct ath10k *ar, u8 *buffer,
int len)
{
}
static inline struct ath10k_fw_crash_data *
ath10k_debug_get_new_fw_crash_data(struct ath10k *ar)
{
return NULL;
}
#define ATH10K_DFS_STAT_INC(ar, c) do { } while (0) #define ATH10K_DFS_STAT_INC(ar, c) do { } while (0)
#endif /* CONFIG_ATH10K_DEBUGFS */ #endif /* CONFIG_ATH10K_DEBUGFS */
#ifdef CONFIG_ATH10K_DEBUG #ifdef CONFIG_ATH10K_DEBUG
__printf(2, 3) void ath10k_dbg(enum ath10k_debug_mask mask, __printf(3, 4) void ath10k_dbg(struct ath10k *ar,
enum ath10k_debug_mask mask,
const char *fmt, ...); const char *fmt, ...);
void ath10k_dbg_dump(enum ath10k_debug_mask mask, void ath10k_dbg_dump(struct ath10k *ar,
enum ath10k_debug_mask mask,
const char *msg, const char *prefix, const char *msg, const char *prefix,
const void *buf, size_t len); const void *buf, size_t len);
#else /* CONFIG_ATH10K_DEBUG */ #else /* CONFIG_ATH10K_DEBUG */
static inline int ath10k_dbg(enum ath10k_debug_mask dbg_mask, static inline int ath10k_dbg(struct ath10k *ar,
enum ath10k_debug_mask dbg_mask,
const char *fmt, ...) const char *fmt, ...)
{ {
return 0; return 0;
} }
static inline void ath10k_dbg_dump(enum ath10k_debug_mask mask, static inline void ath10k_dbg_dump(struct ath10k *ar,
enum ath10k_debug_mask mask,
const char *msg, const char *prefix, const char *msg, const char *prefix,
const void *buf, size_t len) const void *buf, size_t len)
{ {
......
This diff is collapsed.
...@@ -332,7 +332,7 @@ struct ath10k_htc { ...@@ -332,7 +332,7 @@ struct ath10k_htc {
struct ath10k *ar; struct ath10k *ar;
struct ath10k_htc_ep endpoint[ATH10K_HTC_EP_COUNT]; struct ath10k_htc_ep endpoint[ATH10K_HTC_EP_COUNT];
/* protects endpoint and stopped fields */ /* protects endpoints */
spinlock_t tx_lock; spinlock_t tx_lock;
struct ath10k_htc_ops htc_ops; struct ath10k_htc_ops htc_ops;
...@@ -345,8 +345,6 @@ struct ath10k_htc { ...@@ -345,8 +345,6 @@ struct ath10k_htc {
int total_transmit_credits; int total_transmit_credits;
struct ath10k_htc_svc_tx_credits service_tx_alloc[ATH10K_HTC_EP_COUNT]; struct ath10k_htc_svc_tx_credits service_tx_alloc[ATH10K_HTC_EP_COUNT];
int target_credit_size; int target_credit_size;
bool stopped;
}; };
int ath10k_htc_init(struct ath10k *ar); int ath10k_htc_init(struct ath10k *ar);
...@@ -357,7 +355,6 @@ int ath10k_htc_connect_service(struct ath10k_htc *htc, ...@@ -357,7 +355,6 @@ int ath10k_htc_connect_service(struct ath10k_htc *htc,
struct ath10k_htc_svc_conn_resp *conn_resp); struct ath10k_htc_svc_conn_resp *conn_resp);
int ath10k_htc_send(struct ath10k_htc *htc, enum ath10k_htc_ep_id eid, int ath10k_htc_send(struct ath10k_htc *htc, enum ath10k_htc_ep_id eid,
struct sk_buff *packet); struct sk_buff *packet);
void ath10k_htc_stop(struct ath10k_htc *htc); struct sk_buff *ath10k_htc_alloc_skb(struct ath10k *ar, int size);
struct sk_buff *ath10k_htc_alloc_skb(int size);
#endif #endif
...@@ -74,12 +74,14 @@ int ath10k_htt_init(struct ath10k *ar) ...@@ -74,12 +74,14 @@ int ath10k_htt_init(struct ath10k *ar)
static int ath10k_htt_verify_version(struct ath10k_htt *htt) static int ath10k_htt_verify_version(struct ath10k_htt *htt)
{ {
ath10k_dbg(ATH10K_DBG_BOOT, "htt target version %d.%d\n", struct ath10k *ar = htt->ar;
ath10k_dbg(ar, ATH10K_DBG_BOOT, "htt target version %d.%d\n",
htt->target_version_major, htt->target_version_minor); htt->target_version_major, htt->target_version_minor);
if (htt->target_version_major != 2 && if (htt->target_version_major != 2 &&
htt->target_version_major != 3) { htt->target_version_major != 3) {
ath10k_err("unsupported htt major version %d. supported versions are 2 and 3\n", ath10k_err(ar, "unsupported htt major version %d. supported versions are 2 and 3\n",
htt->target_version_major); htt->target_version_major);
return -ENOTSUPP; return -ENOTSUPP;
} }
...@@ -89,6 +91,7 @@ static int ath10k_htt_verify_version(struct ath10k_htt *htt) ...@@ -89,6 +91,7 @@ static int ath10k_htt_verify_version(struct ath10k_htt *htt)
int ath10k_htt_setup(struct ath10k_htt *htt) int ath10k_htt_setup(struct ath10k_htt *htt)
{ {
struct ath10k *ar = htt->ar;
int status; int status;
init_completion(&htt->target_version_received); init_completion(&htt->target_version_received);
...@@ -100,7 +103,7 @@ int ath10k_htt_setup(struct ath10k_htt *htt) ...@@ -100,7 +103,7 @@ int ath10k_htt_setup(struct ath10k_htt *htt)
status = wait_for_completion_timeout(&htt->target_version_received, status = wait_for_completion_timeout(&htt->target_version_received,
HTT_TARGET_VERSION_TIMEOUT_HZ); HTT_TARGET_VERSION_TIMEOUT_HZ);
if (status <= 0) { if (status <= 0) {
ath10k_warn("htt version request timed out\n"); ath10k_warn(ar, "htt version request timed out\n");
return -ETIMEDOUT; return -ETIMEDOUT;
} }
......
This diff is collapsed.
...@@ -58,6 +58,7 @@ static int ath10k_htt_tx_inc_pending(struct ath10k_htt *htt) ...@@ -58,6 +58,7 @@ static int ath10k_htt_tx_inc_pending(struct ath10k_htt *htt)
int ath10k_htt_tx_alloc_msdu_id(struct ath10k_htt *htt) int ath10k_htt_tx_alloc_msdu_id(struct ath10k_htt *htt)
{ {
struct ath10k *ar = htt->ar;
int msdu_id; int msdu_id;
lockdep_assert_held(&htt->tx_lock); lockdep_assert_held(&htt->tx_lock);
...@@ -67,24 +68,29 @@ int ath10k_htt_tx_alloc_msdu_id(struct ath10k_htt *htt) ...@@ -67,24 +68,29 @@ int ath10k_htt_tx_alloc_msdu_id(struct ath10k_htt *htt)
if (msdu_id == htt->max_num_pending_tx) if (msdu_id == htt->max_num_pending_tx)
return -ENOBUFS; return -ENOBUFS;
ath10k_dbg(ATH10K_DBG_HTT, "htt tx alloc msdu_id %d\n", msdu_id); ath10k_dbg(ar, ATH10K_DBG_HTT, "htt tx alloc msdu_id %d\n", msdu_id);
__set_bit(msdu_id, htt->used_msdu_ids); __set_bit(msdu_id, htt->used_msdu_ids);
return msdu_id; return msdu_id;
} }
void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt, u16 msdu_id) void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt, u16 msdu_id)
{ {
struct ath10k *ar = htt->ar;
lockdep_assert_held(&htt->tx_lock); lockdep_assert_held(&htt->tx_lock);
if (!test_bit(msdu_id, htt->used_msdu_ids)) if (!test_bit(msdu_id, htt->used_msdu_ids))
ath10k_warn("trying to free unallocated msdu_id %d\n", msdu_id); ath10k_warn(ar, "trying to free unallocated msdu_id %d\n",
msdu_id);
ath10k_dbg(ATH10K_DBG_HTT, "htt tx free msdu_id %hu\n", msdu_id); ath10k_dbg(ar, ATH10K_DBG_HTT, "htt tx free msdu_id %hu\n", msdu_id);
__clear_bit(msdu_id, htt->used_msdu_ids); __clear_bit(msdu_id, htt->used_msdu_ids);
} }
int ath10k_htt_tx_alloc(struct ath10k_htt *htt) int ath10k_htt_tx_alloc(struct ath10k_htt *htt)
{ {
struct ath10k *ar = htt->ar;
spin_lock_init(&htt->tx_lock); spin_lock_init(&htt->tx_lock);
init_waitqueue_head(&htt->empty_tx_wq); init_waitqueue_head(&htt->empty_tx_wq);
...@@ -93,7 +99,7 @@ int ath10k_htt_tx_alloc(struct ath10k_htt *htt) ...@@ -93,7 +99,7 @@ int ath10k_htt_tx_alloc(struct ath10k_htt *htt)
else else
htt->max_num_pending_tx = TARGET_NUM_MSDU_DESC; htt->max_num_pending_tx = TARGET_NUM_MSDU_DESC;
ath10k_dbg(ATH10K_DBG_BOOT, "htt tx max num pending tx %d\n", ath10k_dbg(ar, ATH10K_DBG_BOOT, "htt tx max num pending tx %d\n",
htt->max_num_pending_tx); htt->max_num_pending_tx);
htt->pending_tx = kzalloc(sizeof(*htt->pending_tx) * htt->pending_tx = kzalloc(sizeof(*htt->pending_tx) *
...@@ -122,6 +128,7 @@ int ath10k_htt_tx_alloc(struct ath10k_htt *htt) ...@@ -122,6 +128,7 @@ int ath10k_htt_tx_alloc(struct ath10k_htt *htt)
static void ath10k_htt_tx_free_pending(struct ath10k_htt *htt) static void ath10k_htt_tx_free_pending(struct ath10k_htt *htt)
{ {
struct ath10k *ar = htt->ar;
struct htt_tx_done tx_done = {0}; struct htt_tx_done tx_done = {0};
int msdu_id; int msdu_id;
...@@ -130,7 +137,7 @@ static void ath10k_htt_tx_free_pending(struct ath10k_htt *htt) ...@@ -130,7 +137,7 @@ static void ath10k_htt_tx_free_pending(struct ath10k_htt *htt)
if (!test_bit(msdu_id, htt->used_msdu_ids)) if (!test_bit(msdu_id, htt->used_msdu_ids))
continue; continue;
ath10k_dbg(ATH10K_DBG_HTT, "force cleanup msdu_id %hu\n", ath10k_dbg(ar, ATH10K_DBG_HTT, "force cleanup msdu_id %hu\n",
msdu_id); msdu_id);
tx_done.discard = 1; tx_done.discard = 1;
...@@ -157,6 +164,7 @@ void ath10k_htt_htc_tx_complete(struct ath10k *ar, struct sk_buff *skb) ...@@ -157,6 +164,7 @@ void ath10k_htt_htc_tx_complete(struct ath10k *ar, struct sk_buff *skb)
int ath10k_htt_h2t_ver_req_msg(struct ath10k_htt *htt) int ath10k_htt_h2t_ver_req_msg(struct ath10k_htt *htt)
{ {
struct ath10k *ar = htt->ar;
struct sk_buff *skb; struct sk_buff *skb;
struct htt_cmd *cmd; struct htt_cmd *cmd;
int len = 0; int len = 0;
...@@ -165,7 +173,7 @@ int ath10k_htt_h2t_ver_req_msg(struct ath10k_htt *htt) ...@@ -165,7 +173,7 @@ int ath10k_htt_h2t_ver_req_msg(struct ath10k_htt *htt)
len += sizeof(cmd->hdr); len += sizeof(cmd->hdr);
len += sizeof(cmd->ver_req); len += sizeof(cmd->ver_req);
skb = ath10k_htc_alloc_skb(len); skb = ath10k_htc_alloc_skb(ar, len);
if (!skb) if (!skb)
return -ENOMEM; return -ENOMEM;
...@@ -184,6 +192,7 @@ int ath10k_htt_h2t_ver_req_msg(struct ath10k_htt *htt) ...@@ -184,6 +192,7 @@ int ath10k_htt_h2t_ver_req_msg(struct ath10k_htt *htt)
int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie) int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie)
{ {
struct ath10k *ar = htt->ar;
struct htt_stats_req *req; struct htt_stats_req *req;
struct sk_buff *skb; struct sk_buff *skb;
struct htt_cmd *cmd; struct htt_cmd *cmd;
...@@ -192,7 +201,7 @@ int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie) ...@@ -192,7 +201,7 @@ int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie)
len += sizeof(cmd->hdr); len += sizeof(cmd->hdr);
len += sizeof(cmd->stats_req); len += sizeof(cmd->stats_req);
skb = ath10k_htc_alloc_skb(len); skb = ath10k_htc_alloc_skb(ar, len);
if (!skb) if (!skb)
return -ENOMEM; return -ENOMEM;
...@@ -214,7 +223,8 @@ int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie) ...@@ -214,7 +223,8 @@ int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie)
ret = ath10k_htc_send(&htt->ar->htc, htt->eid, skb); ret = ath10k_htc_send(&htt->ar->htc, htt->eid, skb);
if (ret) { if (ret) {
ath10k_warn("failed to send htt type stats request: %d", ret); ath10k_warn(ar, "failed to send htt type stats request: %d",
ret);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return ret; return ret;
} }
...@@ -224,6 +234,7 @@ int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie) ...@@ -224,6 +234,7 @@ int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie)
int ath10k_htt_send_rx_ring_cfg_ll(struct ath10k_htt *htt) int ath10k_htt_send_rx_ring_cfg_ll(struct ath10k_htt *htt)
{ {
struct ath10k *ar = htt->ar;
struct sk_buff *skb; struct sk_buff *skb;
struct htt_cmd *cmd; struct htt_cmd *cmd;
struct htt_rx_ring_setup_ring *ring; struct htt_rx_ring_setup_ring *ring;
...@@ -242,7 +253,7 @@ int ath10k_htt_send_rx_ring_cfg_ll(struct ath10k_htt *htt) ...@@ -242,7 +253,7 @@ int ath10k_htt_send_rx_ring_cfg_ll(struct ath10k_htt *htt)
len = sizeof(cmd->hdr) + sizeof(cmd->rx_setup.hdr) len = sizeof(cmd->hdr) + sizeof(cmd->rx_setup.hdr)
+ (sizeof(*ring) * num_rx_ring); + (sizeof(*ring) * num_rx_ring);
skb = ath10k_htc_alloc_skb(len); skb = ath10k_htc_alloc_skb(ar, len);
if (!skb) if (!skb)
return -ENOMEM; return -ENOMEM;
...@@ -311,6 +322,7 @@ int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt, ...@@ -311,6 +322,7 @@ int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt,
u8 max_subfrms_ampdu, u8 max_subfrms_ampdu,
u8 max_subfrms_amsdu) u8 max_subfrms_amsdu)
{ {
struct ath10k *ar = htt->ar;
struct htt_aggr_conf *aggr_conf; struct htt_aggr_conf *aggr_conf;
struct sk_buff *skb; struct sk_buff *skb;
struct htt_cmd *cmd; struct htt_cmd *cmd;
...@@ -328,7 +340,7 @@ int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt, ...@@ -328,7 +340,7 @@ int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt,
len = sizeof(cmd->hdr); len = sizeof(cmd->hdr);
len += sizeof(cmd->aggr_conf); len += sizeof(cmd->aggr_conf);
skb = ath10k_htc_alloc_skb(len); skb = ath10k_htc_alloc_skb(ar, len);
if (!skb) if (!skb)
return -ENOMEM; return -ENOMEM;
...@@ -340,7 +352,7 @@ int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt, ...@@ -340,7 +352,7 @@ int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt,
aggr_conf->max_num_ampdu_subframes = max_subfrms_ampdu; aggr_conf->max_num_ampdu_subframes = max_subfrms_ampdu;
aggr_conf->max_num_amsdu_subframes = max_subfrms_amsdu; aggr_conf->max_num_amsdu_subframes = max_subfrms_amsdu;
ath10k_dbg(ATH10K_DBG_HTT, "htt h2t aggr cfg msg amsdu %d ampdu %d", ath10k_dbg(ar, ATH10K_DBG_HTT, "htt h2t aggr cfg msg amsdu %d ampdu %d",
aggr_conf->max_num_amsdu_subframes, aggr_conf->max_num_amsdu_subframes,
aggr_conf->max_num_ampdu_subframes); aggr_conf->max_num_ampdu_subframes);
...@@ -355,7 +367,8 @@ int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt, ...@@ -355,7 +367,8 @@ int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt,
int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu) int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
{ {
struct device *dev = htt->ar->dev; struct ath10k *ar = htt->ar;
struct device *dev = ar->dev;
struct sk_buff *txdesc = NULL; struct sk_buff *txdesc = NULL;
struct htt_cmd *cmd; struct htt_cmd *cmd;
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(msdu); struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(msdu);
...@@ -382,7 +395,7 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu) ...@@ -382,7 +395,7 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
htt->pending_tx[msdu_id] = msdu; htt->pending_tx[msdu_id] = msdu;
spin_unlock_bh(&htt->tx_lock); spin_unlock_bh(&htt->tx_lock);
txdesc = ath10k_htc_alloc_skb(len); txdesc = ath10k_htc_alloc_skb(ar, len);
if (!txdesc) { if (!txdesc) {
res = -ENOMEM; res = -ENOMEM;
goto err_free_msdu_id; goto err_free_msdu_id;
...@@ -429,7 +442,8 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu) ...@@ -429,7 +442,8 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu) int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
{ {
struct device *dev = htt->ar->dev; struct ath10k *ar = htt->ar;
struct device *dev = ar->dev;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)msdu->data; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)msdu->data;
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(msdu); struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(msdu);
struct ath10k_hif_sg_item sg_items[2]; struct ath10k_hif_sg_item sg_items[2];
...@@ -545,11 +559,11 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu) ...@@ -545,11 +559,11 @@ 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.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_le32(HTT_INVALID_PEERID);
ath10k_dbg(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\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);
ath10k_dbg_dump(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);
sg_items[0].transfer_id = 0; sg_items[0].transfer_id = 0;
......
...@@ -28,16 +28,19 @@ ...@@ -28,16 +28,19 @@
#define QCA988X_HW_2_0_CHIP_ID_REV 0x2 #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/QCA988X/hw2.0"
#define QCA988X_HW_2_0_FW_FILE "firmware.bin" #define QCA988X_HW_2_0_FW_FILE "firmware.bin"
#define QCA988X_HW_2_0_FW_2_FILE "firmware-2.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_OTP_FILE "otp.bin"
#define QCA988X_HW_2_0_BOARD_DATA_FILE "board.bin" #define QCA988X_HW_2_0_BOARD_DATA_FILE "board.bin"
#define QCA988X_HW_2_0_PATCH_LOAD_ADDR 0x1234 #define QCA988X_HW_2_0_PATCH_LOAD_ADDR 0x1234
#define ATH10K_FW_API2_FILE "firmware-2.bin" #define ATH10K_FW_API2_FILE "firmware-2.bin"
#define ATH10K_FW_API3_FILE "firmware-3.bin"
/* includes also the null byte */ /* includes also the null byte */
#define ATH10K_FIRMWARE_MAGIC "QCA-ATH10K" #define ATH10K_FIRMWARE_MAGIC "QCA-ATH10K"
#define REG_DUMP_COUNT_QCA988X 60
struct ath10k_fw_ie { struct ath10k_fw_ie {
__le32 id; __le32 id;
__le32 len; __le32 len;
......
This diff is collapsed.
...@@ -26,12 +26,14 @@ struct ath10k_generic_iter { ...@@ -26,12 +26,14 @@ struct ath10k_generic_iter {
int ret; int ret;
}; };
struct ath10k *ath10k_mac_create(void); struct ath10k *ath10k_mac_create(size_t priv_size);
void ath10k_mac_destroy(struct ath10k *ar); void ath10k_mac_destroy(struct ath10k *ar);
int ath10k_mac_register(struct ath10k *ar); int ath10k_mac_register(struct ath10k *ar);
void ath10k_mac_unregister(struct ath10k *ar); void ath10k_mac_unregister(struct ath10k *ar);
struct ath10k_vif *ath10k_get_arvif(struct ath10k *ar, u32 vdev_id); struct ath10k_vif *ath10k_get_arvif(struct ath10k *ar, u32 vdev_id);
void ath10k_reset_scan(unsigned long ptr); void __ath10k_scan_finish(struct ath10k *ar);
void ath10k_scan_finish(struct ath10k *ar);
void ath10k_scan_timeout_work(struct work_struct *work);
void ath10k_offchan_tx_purge(struct ath10k *ar); void ath10k_offchan_tx_purge(struct ath10k *ar);
void ath10k_offchan_tx_work(struct work_struct *work); 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_purge(struct ath10k *ar);
......
This diff is collapsed.
...@@ -23,9 +23,6 @@ ...@@ -23,9 +23,6 @@
#include "hw.h" #include "hw.h"
#include "ce.h" #include "ce.h"
/* FW dump area */
#define REG_DUMP_COUNT_QCA988X 60
/* /*
* maximum number of bytes that can be handled atomically by DiagRead/DiagWrite * maximum number of bytes that can be handled atomically by DiagRead/DiagWrite
*/ */
...@@ -103,12 +100,12 @@ struct pcie_state { ...@@ -103,12 +100,12 @@ struct pcie_state {
* NOTE: Structure is shared between Host software and Target firmware! * NOTE: Structure is shared between Host software and Target firmware!
*/ */
struct ce_pipe_config { struct ce_pipe_config {
u32 pipenum; __le32 pipenum;
u32 pipedir; __le32 pipedir;
u32 nentries; __le32 nentries;
u32 nbytes_max; __le32 nbytes_max;
u32 flags; __le32 flags;
u32 reserved; __le32 reserved;
}; };
/* /*
...@@ -130,17 +127,9 @@ struct ce_pipe_config { ...@@ -130,17 +127,9 @@ struct ce_pipe_config {
/* Establish a mapping between a service/direction and a pipe. */ /* Establish a mapping between a service/direction and a pipe. */
struct service_to_pipe { struct service_to_pipe {
u32 service_id; __le32 service_id;
u32 pipedir; __le32 pipedir;
u32 pipenum; __le32 pipenum;
};
enum ath10k_pci_features {
ATH10K_PCI_FEATURE_MSI_X = 0,
ATH10K_PCI_FEATURE_SOC_POWER_SAVE = 1,
/* keep last */
ATH10K_PCI_FEATURE_COUNT
}; };
/* Per-pipe state. */ /* Per-pipe state. */
...@@ -169,8 +158,6 @@ struct ath10k_pci { ...@@ -169,8 +158,6 @@ struct ath10k_pci {
struct ath10k *ar; struct ath10k *ar;
void __iomem *mem; void __iomem *mem;
DECLARE_BITMAP(features, ATH10K_PCI_FEATURE_COUNT);
/* /*
* Number of MSI interrupts granted, 0 --> using legacy PCI line * Number of MSI interrupts granted, 0 --> using legacy PCI line
* interrupts. * interrupts.
...@@ -179,12 +166,6 @@ struct ath10k_pci { ...@@ -179,12 +166,6 @@ struct ath10k_pci {
struct tasklet_struct intr_tq; struct tasklet_struct intr_tq;
struct tasklet_struct msi_fw_err; struct tasklet_struct msi_fw_err;
struct tasklet_struct early_irq_tasklet;
int started;
atomic_t keep_awake_count;
bool verified_awake;
struct ath10k_pci_pipe pipe_info[CE_COUNT_MAX]; struct ath10k_pci_pipe pipe_info[CE_COUNT_MAX];
...@@ -198,27 +179,15 @@ struct ath10k_pci { ...@@ -198,27 +179,15 @@ struct ath10k_pci {
/* Map CE id to ce_state */ /* Map CE id to ce_state */
struct ath10k_ce_pipe ce_states[CE_COUNT_MAX]; struct ath10k_ce_pipe ce_states[CE_COUNT_MAX];
struct timer_list rx_post_retry;
}; };
static inline struct ath10k_pci *ath10k_pci_priv(struct ath10k *ar) static inline struct ath10k_pci *ath10k_pci_priv(struct ath10k *ar)
{ {
return ar->hif.priv; return (struct ath10k_pci *)ar->drv_priv;
}
static inline u32 ath10k_pci_reg_read32(struct ath10k *ar, u32 addr)
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
return ioread32(ar_pci->mem + PCIE_LOCAL_BASE_ADDRESS + addr);
}
static inline void ath10k_pci_reg_write32(struct ath10k *ar, u32 addr, u32 val)
{
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
iowrite32(val, ar_pci->mem + PCIE_LOCAL_BASE_ADDRESS + addr);
} }
#define ATH10K_PCI_RX_POST_RETRY_MS 50
#define ATH_PCI_RESET_WAIT_MAX 10 /* ms */ #define ATH_PCI_RESET_WAIT_MAX 10 /* ms */
#define PCIE_WAKE_TIMEOUT 5000 /* 5ms */ #define PCIE_WAKE_TIMEOUT 5000 /* 5ms */
...@@ -242,35 +211,17 @@ static inline void ath10k_pci_reg_write32(struct ath10k *ar, u32 addr, u32 val) ...@@ -242,35 +211,17 @@ static inline void ath10k_pci_reg_write32(struct ath10k *ar, u32 addr, u32 val)
/* Wait up to this many Ms for a Diagnostic Access CE operation to complete */ /* Wait up to this many Ms for a Diagnostic Access CE operation to complete */
#define DIAG_ACCESS_CE_TIMEOUT_MS 10 #define DIAG_ACCESS_CE_TIMEOUT_MS 10
/* /* Target exposes its registers for direct access. However before host can
* This API allows the Host to access Target registers directly * access them it needs to make sure the target is awake (ath10k_pci_wake,
* and relatively efficiently over PCIe. * ath10k_pci_wake_wait, ath10k_pci_is_awake). Once target is awake it won't go
* This allows the Host to avoid extra overhead associated with * to sleep unless host tells it to (ath10k_pci_sleep).
* sending a message to firmware and waiting for a response message
* from firmware, as is done on other interconnects.
*
* Yet there is some complexity with direct accesses because the
* Target's power state is not known a priori. The Host must issue
* special PCIe reads/writes in order to explicitly wake the Target
* and to verify that it is awake and will remain awake.
*
* Usage:
* *
* Use ath10k_pci_read32 and ath10k_pci_write32 to access Target space. * If host tries to access target registers without waking it up it can
* These calls must be bracketed by ath10k_pci_wake and * scribble over host memory.
* ath10k_pci_sleep. A single BEGIN/END pair is adequate for
* multiple READ/WRITE operations.
* *
* Use ath10k_pci_wake to put the Target in a state in * If target is asleep waking it up may take up to even 2ms.
* which it is legal for the Host to directly access it. This
* may involve waking the Target from a low power state, which
* may take up to 2Ms!
*
* Use ath10k_pci_sleep to tell the Target that as far as
* this code path is concerned, it no longer needs to remain
* directly accessible. BEGIN/END is under a reference counter;
* multiple code paths may issue BEGIN/END on a single targid.
*/ */
static inline void ath10k_pci_write32(struct ath10k *ar, u32 offset, static inline void ath10k_pci_write32(struct ath10k *ar, u32 offset,
u32 value) u32 value)
{ {
...@@ -296,25 +247,18 @@ static inline void ath10k_pci_soc_write32(struct ath10k *ar, u32 addr, u32 val) ...@@ -296,25 +247,18 @@ static inline void ath10k_pci_soc_write32(struct ath10k *ar, u32 addr, u32 val)
ath10k_pci_write32(ar, RTC_SOC_BASE_ADDRESS + addr, val); ath10k_pci_write32(ar, RTC_SOC_BASE_ADDRESS + addr, val);
} }
int ath10k_do_pci_wake(struct ath10k *ar); static inline u32 ath10k_pci_reg_read32(struct ath10k *ar, u32 addr)
void ath10k_do_pci_sleep(struct ath10k *ar);
static inline int ath10k_pci_wake(struct ath10k *ar)
{ {
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
if (test_bit(ATH10K_PCI_FEATURE_SOC_POWER_SAVE, ar_pci->features)) return ioread32(ar_pci->mem + PCIE_LOCAL_BASE_ADDRESS + addr);
return ath10k_do_pci_wake(ar);
return 0;
} }
static inline void ath10k_pci_sleep(struct ath10k *ar) static inline void ath10k_pci_reg_write32(struct ath10k *ar, u32 addr, u32 val)
{ {
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
if (test_bit(ATH10K_PCI_FEATURE_SOC_POWER_SAVE, ar_pci->features)) iowrite32(val, ar_pci->mem + PCIE_LOCAL_BASE_ADDRESS + addr);
ath10k_do_pci_sleep(ar);
} }
#endif /* _PCI_H_ */ #endif /* _PCI_H_ */
This diff is collapsed.
/*
* Copyright (c) 2013 Qualcomm Atheros, Inc.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef SPECTRAL_H
#define SPECTRAL_H
#include "../spectral_common.h"
/**
* struct ath10k_spec_scan - parameters for Atheros spectral scan
*
* @count: number of scan results requested for manual mode
* @fft_size: number of bins to be requested = 2^(fft_size - bin_scale)
*/
struct ath10k_spec_scan {
u8 count;
u8 fft_size;
};
/* enum ath10k_spectral_mode:
*
* @SPECTRAL_DISABLED: spectral mode is disabled
* @SPECTRAL_BACKGROUND: hardware sends samples when it is not busy with
* something else.
* @SPECTRAL_MANUAL: spectral scan is enabled, triggering for samples
* is performed manually.
*/
enum ath10k_spectral_mode {
SPECTRAL_DISABLED = 0,
SPECTRAL_BACKGROUND,
SPECTRAL_MANUAL,
};
#ifdef CONFIG_ATH10K_DEBUGFS
int ath10k_spectral_process_fft(struct ath10k *ar,
struct wmi_single_phyerr_rx_event *event,
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);
int ath10k_spectral_create(struct ath10k *ar);
void ath10k_spectral_destroy(struct ath10k *ar);
#else
static inline int
ath10k_spectral_process_fft(struct ath10k *ar,
struct wmi_single_phyerr_rx_event *event,
struct phyerr_fft_report *fftr,
size_t bin_len, u64 tsf)
{
return 0;
}
static inline int ath10k_spectral_start(struct ath10k *ar)
{
return 0;
}
static inline int ath10k_spectral_vif_stop(struct ath10k_vif *arvif)
{
return 0;
}
static inline int ath10k_spectral_create(struct ath10k *ar)
{
return 0;
}
static inline void ath10k_spectral_destroy(struct ath10k *ar)
{
}
#endif /* CONFIG_ATH10K_DEBUGFS */
#endif /* SPECTRAL_H */
...@@ -32,14 +32,14 @@ static void ath10k_report_offchan_tx(struct ath10k *ar, struct sk_buff *skb) ...@@ -32,14 +32,14 @@ static void ath10k_report_offchan_tx(struct ath10k *ar, struct sk_buff *skb)
* offchan_tx_skb. */ * offchan_tx_skb. */
spin_lock_bh(&ar->data_lock); spin_lock_bh(&ar->data_lock);
if (ar->offchan_tx_skb != skb) { if (ar->offchan_tx_skb != skb) {
ath10k_warn("completed old offchannel frame\n"); ath10k_warn(ar, "completed old offchannel frame\n");
goto out; goto out;
} }
complete(&ar->offchan_tx_completed); complete(&ar->offchan_tx_completed);
ar->offchan_tx_skb = NULL; /* just for sanity */ ar->offchan_tx_skb = NULL; /* just for sanity */
ath10k_dbg(ATH10K_DBG_HTT, "completed offchannel skb %p\n", skb); ath10k_dbg(ar, ATH10K_DBG_HTT, "completed offchannel skb %p\n", skb);
out: out:
spin_unlock_bh(&ar->data_lock); spin_unlock_bh(&ar->data_lock);
} }
...@@ -47,18 +47,19 @@ static void ath10k_report_offchan_tx(struct ath10k *ar, struct sk_buff *skb) ...@@ -47,18 +47,19 @@ static void ath10k_report_offchan_tx(struct ath10k *ar, struct sk_buff *skb)
void ath10k_txrx_tx_unref(struct ath10k_htt *htt, void ath10k_txrx_tx_unref(struct ath10k_htt *htt,
const struct htt_tx_done *tx_done) const struct htt_tx_done *tx_done)
{ {
struct device *dev = htt->ar->dev; struct ath10k *ar = htt->ar;
struct device *dev = ar->dev;
struct ieee80211_tx_info *info; struct ieee80211_tx_info *info;
struct ath10k_skb_cb *skb_cb; struct ath10k_skb_cb *skb_cb;
struct sk_buff *msdu; struct sk_buff *msdu;
lockdep_assert_held(&htt->tx_lock); lockdep_assert_held(&htt->tx_lock);
ath10k_dbg(ATH10K_DBG_HTT, "htt tx completion msdu_id %u discard %d no_ack %d\n", ath10k_dbg(ar, ATH10K_DBG_HTT, "htt tx completion msdu_id %u discard %d no_ack %d\n",
tx_done->msdu_id, !!tx_done->discard, !!tx_done->no_ack); tx_done->msdu_id, !!tx_done->discard, !!tx_done->no_ack);
if (tx_done->msdu_id >= htt->max_num_pending_tx) { if (tx_done->msdu_id >= htt->max_num_pending_tx) {
ath10k_warn("warning: msdu_id %d too big, ignoring\n", ath10k_warn(ar, "warning: msdu_id %d too big, ignoring\n",
tx_done->msdu_id); tx_done->msdu_id);
return; return;
} }
...@@ -182,7 +183,7 @@ void ath10k_peer_map_event(struct ath10k_htt *htt, ...@@ -182,7 +183,7 @@ void ath10k_peer_map_event(struct ath10k_htt *htt,
wake_up(&ar->peer_mapping_wq); wake_up(&ar->peer_mapping_wq);
} }
ath10k_dbg(ATH10K_DBG_HTT, "htt peer map vdev %d peer %pM id %d\n", ath10k_dbg(ar, ATH10K_DBG_HTT, "htt peer map vdev %d peer %pM id %d\n",
ev->vdev_id, ev->addr, ev->peer_id); ev->vdev_id, ev->addr, ev->peer_id);
set_bit(ev->peer_id, peer->peer_ids); set_bit(ev->peer_id, peer->peer_ids);
...@@ -199,12 +200,12 @@ void ath10k_peer_unmap_event(struct ath10k_htt *htt, ...@@ -199,12 +200,12 @@ void ath10k_peer_unmap_event(struct ath10k_htt *htt,
spin_lock_bh(&ar->data_lock); spin_lock_bh(&ar->data_lock);
peer = ath10k_peer_find_by_id(ar, ev->peer_id); peer = ath10k_peer_find_by_id(ar, ev->peer_id);
if (!peer) { if (!peer) {
ath10k_warn("peer-unmap-event: unknown peer id %d\n", ath10k_warn(ar, "peer-unmap-event: unknown peer id %d\n",
ev->peer_id); ev->peer_id);
goto exit; goto exit;
} }
ath10k_dbg(ATH10K_DBG_HTT, "htt peer unmap vdev %d peer %pM id %d\n", ath10k_dbg(ar, ATH10K_DBG_HTT, "htt peer unmap vdev %d peer %pM id %d\n",
peer->vdev_id, peer->addr, ev->peer_id); peer->vdev_id, peer->addr, ev->peer_id);
clear_bit(ev->peer_id, peer->peer_ids); clear_bit(ev->peer_id, peer->peer_ids);
......
This diff is collapsed.
This diff is collapsed.
...@@ -1049,7 +1049,7 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name) ...@@ -1049,7 +1049,7 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name)
ar->hw.reserved_ram_size = le32_to_cpup(val); ar->hw.reserved_ram_size = le32_to_cpup(val);
ath6kl_dbg(ATH6KL_DBG_BOOT, ath6kl_dbg(ATH6KL_DBG_BOOT,
"found reserved ram size ie 0x%d\n", "found reserved ram size ie %d\n",
ar->hw.reserved_ram_size); ar->hw.reserved_ram_size);
break; break;
case ATH6KL_FW_IE_CAPABILITIES: case ATH6KL_FW_IE_CAPABILITIES:
......
...@@ -225,7 +225,7 @@ int ath6kl_diag_write32(struct ath6kl *ar, u32 address, __le32 value) ...@@ -225,7 +225,7 @@ int ath6kl_diag_write32(struct ath6kl *ar, u32 address, __le32 value)
ret = ath6kl_hif_diag_write32(ar, address, value); ret = ath6kl_hif_diag_write32(ar, address, value);
if (ret) { if (ret) {
ath6kl_err("failed to write 0x%x during diagnose window to 0x%d\n", ath6kl_err("failed to write 0x%x during diagnose window to 0x%x\n",
address, value); address, value);
return ret; return ret;
} }
......
...@@ -1400,6 +1400,7 @@ static const struct sdio_device_id ath6kl_sdio_devices[] = { ...@@ -1400,6 +1400,7 @@ static const struct sdio_device_id ath6kl_sdio_devices[] = {
{SDIO_DEVICE(MANUFACTURER_CODE, (MANUFACTURER_ID_AR6003_BASE | 0x1))}, {SDIO_DEVICE(MANUFACTURER_CODE, (MANUFACTURER_ID_AR6003_BASE | 0x1))},
{SDIO_DEVICE(MANUFACTURER_CODE, (MANUFACTURER_ID_AR6004_BASE | 0x0))}, {SDIO_DEVICE(MANUFACTURER_CODE, (MANUFACTURER_ID_AR6004_BASE | 0x0))},
{SDIO_DEVICE(MANUFACTURER_CODE, (MANUFACTURER_ID_AR6004_BASE | 0x1))}, {SDIO_DEVICE(MANUFACTURER_CODE, (MANUFACTURER_ID_AR6004_BASE | 0x1))},
{SDIO_DEVICE(MANUFACTURER_CODE, (MANUFACTURER_ID_AR6004_BASE | 0x2))},
{}, {},
}; };
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment