mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 08:36:12 -04:00
qcacmn: Merge remote-tracking branch 'origin/wlan-cmn.driver.lnx.1.0-dev' into wlan-cmn.driver.lnx.2.0-dev
* origin/wlan-cmn.driver.lnx.1.0-dev: qcacmn: Use suspend_noirq callback instead of disabling irqs Release 5.1.0.23C qcacmn: Implement QDF API to get queue mapping and total ram size qcacmn: Fixing incorrect qdf_mem_set API usage in wmi_unified_non_tlv.c qcacmn: Fix for kernel panic in wifi down path for peregrine Release 5.1.0.23B qcacmn: Free WMI HB command buffer in case of errors Release 5.1.0.23A qcacmn: Add WMI API for setting bandwidth fairness Release 5.1.0.23 qcacmn: unmap buffer for CE destination ring en-queue error Release 5.1.0.22Z qcacmn: Add WCN3990 to hw names qcacmn: Add htc_pm_runtime put/get apis Release 5.1.0.22Y qcacmn: Fix compilation errors in WMI for Big Endian platform Release 5.1.0.22X qcacmn: Fail PM suspend if target has sent initial wake up
This commit is contained in:
commit
20114535de
27 changed files with 319 additions and 114 deletions
|
|
@ -1,2 +1,2 @@
|
|||
Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.22W
|
||||
Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.23C
|
||||
Matches Component wlan-cld3.driver.lnx.1.1 version 5.1.0.22C
|
||||
|
|
|
|||
|
|
@ -573,6 +573,8 @@ bool hif_can_suspend_link(struct hif_opaque_softc *);
|
|||
|
||||
int hif_bus_resume(struct hif_opaque_softc *);
|
||||
int hif_bus_suspend(struct hif_opaque_softc *);
|
||||
int hif_bus_resume_noirq(struct hif_opaque_softc *);
|
||||
int hif_bus_suspend_noirq(struct hif_opaque_softc *);
|
||||
|
||||
#ifdef FEATURE_RUNTIME_PM
|
||||
int hif_pre_runtime_suspend(struct hif_opaque_softc *hif_ctx);
|
||||
|
|
|
|||
|
|
@ -1647,6 +1647,8 @@ static int hif_post_recv_buffers_for_pipe(struct HIF_CE_pipe_info *pipe_info)
|
|||
__func__, pipe_info->pipe_num,
|
||||
atomic_read(&pipe_info->recv_bufs_needed),
|
||||
pipe_info->nbuf_ce_enqueue_err_count);
|
||||
qdf_nbuf_unmap_single(scn->qdf_dev, nbuf,
|
||||
QDF_DMA_FROM_DEVICE);
|
||||
atomic_inc(&pipe_info->recv_bufs_needed);
|
||||
qdf_nbuf_free(nbuf);
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -83,6 +83,34 @@ int hif_dummy_bus_resume(struct hif_softc *hif_ctx)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* hif_dummy_suspend_noirq() - suspend the bus
|
||||
* @hif_ctx: hif context
|
||||
*
|
||||
* dummy for busses that don't need to syncronize
|
||||
* with interrupt disable.
|
||||
*
|
||||
* Return: 0 for success and non-zero for failure
|
||||
*/
|
||||
int hif_dummy_bus_suspend_noirq(struct hif_softc *hif_ctx)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* hif_dummy_resume_noirq() - resume the bus
|
||||
* @hif_ctx: hif context
|
||||
*
|
||||
* dummy for busses that don't need to syncronize
|
||||
* with interrupt disable.
|
||||
*
|
||||
* Return: 0 for success and non-zero for failure
|
||||
*/
|
||||
int hif_dummy_bus_resume_noirq(struct hif_softc *hif_ctx)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* hif_dummy_target_sleep_state_adjust() - api to adjust state of target
|
||||
* @scn: hif context
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ void hif_dummy_bus_prevent_linkdown(struct hif_softc *scn, bool flag);
|
|||
void hif_dummy_reset_soc(struct hif_softc *scn);
|
||||
int hif_dummy_bus_suspend(struct hif_softc *hif_ctx);
|
||||
int hif_dummy_bus_resume(struct hif_softc *hif_ctx);
|
||||
int hif_dummy_bus_suspend_noirq(struct hif_softc *hif_ctx);
|
||||
int hif_dummy_bus_resume_noirq(struct hif_softc *hif_ctx);
|
||||
int hif_dummy_target_sleep_state_adjust(struct hif_softc *scn,
|
||||
bool sleep_ok, bool wait_for_it);
|
||||
void hif_dummy_enable_power_management(struct hif_softc *hif_ctx,
|
||||
|
|
|
|||
|
|
@ -55,8 +55,10 @@ static void hif_intialize_default_ops(struct hif_softc *hif_sc)
|
|||
&hif_dummy_display_stats;
|
||||
bus_ops->hif_clear_stats =
|
||||
&hif_dummy_clear_stats;
|
||||
bus_ops->hif_set_bundle_mode = hif_dummy_set_bundle_mode;
|
||||
bus_ops->hif_bus_reset_resume = hif_dummy_bus_reset_resume;
|
||||
bus_ops->hif_set_bundle_mode = &hif_dummy_set_bundle_mode;
|
||||
bus_ops->hif_bus_reset_resume = &hif_dummy_bus_reset_resume;
|
||||
bus_ops->hif_bus_suspend_noirq = &hif_dummy_bus_suspend_noirq;
|
||||
bus_ops->hif_bus_resume_noirq = &hif_dummy_bus_resume_noirq;
|
||||
}
|
||||
|
||||
#define NUM_OPS (sizeof(struct hif_bus_ops) / sizeof(void *))
|
||||
|
|
@ -195,6 +197,18 @@ int hif_bus_resume(struct hif_opaque_softc *hif_ctx)
|
|||
return hif_sc->bus_ops.hif_bus_resume(hif_sc);
|
||||
}
|
||||
|
||||
int hif_bus_suspend_noirq(struct hif_opaque_softc *hif_ctx)
|
||||
{
|
||||
struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_ctx);
|
||||
return hif_sc->bus_ops.hif_bus_suspend_noirq(hif_sc);
|
||||
}
|
||||
|
||||
int hif_bus_resume_noirq(struct hif_opaque_softc *hif_ctx)
|
||||
{
|
||||
struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_ctx);
|
||||
return hif_sc->bus_ops.hif_bus_resume_noirq(hif_sc);
|
||||
}
|
||||
|
||||
int hif_target_sleep_state_adjust(struct hif_softc *hif_sc,
|
||||
bool sleep_ok, bool wait_for_it)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ struct hif_bus_ops {
|
|||
void (*hif_reset_soc)(struct hif_softc *hif_sc);
|
||||
int (*hif_bus_suspend)(struct hif_softc *hif_ctx);
|
||||
int (*hif_bus_resume)(struct hif_softc *hif_ctx);
|
||||
int (*hif_bus_suspend_noirq)(struct hif_softc *hif_ctx);
|
||||
int (*hif_bus_resume_noirq)(struct hif_softc *hif_ctx);
|
||||
int (*hif_target_sleep_state_adjust)(struct hif_softc *scn,
|
||||
bool sleep_ok, bool wait_for_it);
|
||||
void (*hif_disable_isr)(struct hif_softc *hif_sc);
|
||||
|
|
|
|||
|
|
@ -47,6 +47,9 @@ QDF_STATUS hif_initialize_snoc_ops(struct hif_bus_ops *bus_ops)
|
|||
bus_ops->hif_reset_soc = &hif_dummy_reset_soc;
|
||||
bus_ops->hif_bus_suspend = &hif_snoc_bus_suspend;
|
||||
bus_ops->hif_bus_resume = &hif_snoc_bus_resume;
|
||||
bus_ops->hif_bus_suspend_noirq = &hif_snoc_bus_suspend_noirq;
|
||||
/* snoc_bus_resume_noirq had no side effects, use dummy resume_noirq */
|
||||
bus_ops->hif_bus_resume_noirq = &hif_dummy_bus_resume_noirq;
|
||||
bus_ops->hif_target_sleep_state_adjust =
|
||||
&hif_dummy_target_sleep_state_adjust;
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ QDF_STATUS hif_snoc_open(struct hif_softc *hif_ctx,
|
|||
void hif_snoc_close(struct hif_softc *hif_ctx);
|
||||
int hif_snoc_bus_suspend(struct hif_softc *hif_ctx);
|
||||
int hif_snoc_bus_resume(struct hif_softc *hif_ctx);
|
||||
int hif_snoc_bus_suspend_noirq(struct hif_softc *scn);
|
||||
void hif_snoc_disable_isr(struct hif_softc *hif_ctx);
|
||||
void hif_snoc_nointrs(struct hif_softc *scn);
|
||||
QDF_STATUS hif_snoc_enable_bus(struct hif_softc *ol_sc,
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#define AR6004_VERSION_REV1_3 0x31c8088a
|
||||
#define AR9888_REV2_VERSION 0x4100016c
|
||||
#define AR9887_REV1_VERSION 0x4100016d
|
||||
#define AR6320_REV1_VERSION 0x5000000
|
||||
#define AR6320_REV1_1_VERSION 0x5000001
|
||||
#define AR6320_REV1_3_VERSION 0x5000003
|
||||
|
|
@ -39,6 +40,7 @@
|
|||
#define AR6320_REV3_2_VERSION 0x5030000
|
||||
#define AR6320_DEV_VERSION 0x1000000
|
||||
#define QCA9377_REV1_1_VERSION 0x5020001
|
||||
#define WCN3990_v1 0x40000000
|
||||
|
||||
struct qwlan_hw {
|
||||
u32 id;
|
||||
|
|
|
|||
|
|
@ -289,6 +289,11 @@ static const struct qwlan_hw qwlan_hw_list[] = {
|
|||
.id = AR6320_REV3_2_VERSION,
|
||||
.subid = 0xA,
|
||||
.name = "AR6320_REV3_2_VERSION",
|
||||
},
|
||||
{
|
||||
.id = WCN3990_v1,
|
||||
.subid = 0x0,
|
||||
.name = "WCN3990_V1",
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,9 @@
|
|||
* For maximum performance and no power management, set this to 1.
|
||||
* For power management at the cost of performance, set this to 0.
|
||||
*/
|
||||
#ifndef CONFIG_ATH_PCIE_MAX_PERF
|
||||
#define CONFIG_ATH_PCIE_MAX_PERF 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* For keeping the target awake till the driver is
|
||||
|
|
|
|||
|
|
@ -2417,6 +2417,7 @@ void hif_pci_disable_bus(struct hif_softc *scn)
|
|||
struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn);
|
||||
struct pci_dev *pdev;
|
||||
void __iomem *mem;
|
||||
struct hif_target_info *tgt_info = &scn->target_info;
|
||||
|
||||
/* Attach did not succeed, all resources have been
|
||||
* freed in error handler
|
||||
|
|
@ -2431,7 +2432,18 @@ void hif_pci_disable_bus(struct hif_softc *scn)
|
|||
HOST_GROUP0_MASK);
|
||||
}
|
||||
|
||||
#if defined(CPU_WARM_RESET_WAR)
|
||||
/* Currently CPU warm reset sequence is tested only for AR9888_REV2
|
||||
* Need to enable for AR9888_REV1 once CPU warm reset sequence is
|
||||
* verified for AR9888_REV1
|
||||
*/
|
||||
if ((tgt_info->target_version == AR9888_REV2_VERSION) || (tgt_info->target_version == AR9887_REV1_VERSION))
|
||||
hif_pci_device_warm_reset(sc);
|
||||
else
|
||||
hif_pci_device_reset(sc);
|
||||
#else
|
||||
hif_pci_device_reset(sc);
|
||||
#endif
|
||||
mem = (void __iomem *)sc->mem;
|
||||
if (mem) {
|
||||
pci_disable_msi(pdev);
|
||||
|
|
|
|||
|
|
@ -145,6 +145,10 @@ static QDF_STATUS hif_snoc_get_soc_info(struct hif_softc *scn)
|
|||
|
||||
scn->mem = soc_info.v_addr;
|
||||
scn->mem_pa = soc_info.p_addr;
|
||||
|
||||
scn->target_info.soc_version = soc_info.soc_id;
|
||||
scn->target_info.target_version = soc_info.soc_id;
|
||||
scn->target_info.target_revision = 0;
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -376,75 +380,6 @@ QDF_STATUS hif_snoc_setup_wakeup_sources(struct hif_softc *scn, bool enable)
|
|||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* __hif_snoc_irq_state_vote() - enable/disable all the ce interrupts
|
||||
* @scn: hif context pointer
|
||||
* @enble: true to enable the interrupts false to disable
|
||||
*
|
||||
* takes care of unwinding partial successes.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success
|
||||
*/
|
||||
|
||||
static QDF_STATUS __hif_snoc_irq_state_vote(struct hif_softc *scn, bool enable)
|
||||
{
|
||||
int num_ce = scn->ce_count;
|
||||
int ce_id = 0;
|
||||
int irq;
|
||||
|
||||
while (ce_id < num_ce) {
|
||||
irq = icnss_get_irq(ce_id);
|
||||
if (irq < 0)
|
||||
goto error;
|
||||
|
||||
if (enable)
|
||||
enable_irq(irq);
|
||||
else
|
||||
disable_irq(irq);
|
||||
|
||||
ce_id++;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
||||
error:
|
||||
HIF_ERROR("%s: failed to map ce to irq", __func__);
|
||||
|
||||
while (--ce_id >= 0) {
|
||||
irq = icnss_get_irq(ce_id);
|
||||
if (irq < 0)
|
||||
continue;
|
||||
|
||||
if (enable)
|
||||
disable_irq(irq);
|
||||
else
|
||||
enable_irq(irq);
|
||||
}
|
||||
return QDF_STATUS_E_FAULT;
|
||||
}
|
||||
|
||||
/**
|
||||
* hif_snoc_enable_irqs() - enable the ce irqs
|
||||
* @scn: hif context
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success
|
||||
*/
|
||||
static QDF_STATUS hif_snoc_enable_irqs(struct hif_softc *scn)
|
||||
{
|
||||
return __hif_snoc_irq_state_vote(scn, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* hif_snoc_enable_irqs() - enable the ce irqs
|
||||
* @scn: hif context
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success
|
||||
*/
|
||||
static QDF_STATUS hif_snoc_disable_irqs(struct hif_softc *scn)
|
||||
{
|
||||
return __hif_snoc_irq_state_vote(scn, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* hif_snoc_bus_suspend() - prepare to suspend the bus
|
||||
* @scn: hif context
|
||||
|
|
@ -459,24 +394,8 @@ static QDF_STATUS hif_snoc_disable_irqs(struct hif_softc *scn)
|
|||
int hif_snoc_bus_suspend(struct hif_softc *scn)
|
||||
{
|
||||
if (hif_snoc_setup_wakeup_sources(scn, true) != QDF_STATUS_SUCCESS)
|
||||
goto error;
|
||||
|
||||
if (hif_snoc_disable_irqs(scn) != QDF_STATUS_SUCCESS)
|
||||
goto wakeup_sources;
|
||||
|
||||
if (hif_drain_tasklets(scn) != 0)
|
||||
goto enable_irqs;
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
|
||||
enable_irqs:
|
||||
if (hif_snoc_enable_irqs(scn) != QDF_STATUS_SUCCESS)
|
||||
QDF_BUG(0);
|
||||
wakeup_sources:
|
||||
if (hif_snoc_setup_wakeup_sources(scn, false) != QDF_STATUS_SUCCESS)
|
||||
QDF_BUG(0);
|
||||
error:
|
||||
return -EFAULT;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -493,8 +412,22 @@ int hif_snoc_bus_resume(struct hif_softc *scn)
|
|||
if (hif_snoc_setup_wakeup_sources(scn, false) != QDF_STATUS_SUCCESS)
|
||||
QDF_BUG(0);
|
||||
|
||||
if (hif_snoc_enable_irqs(scn) != QDF_STATUS_SUCCESS)
|
||||
QDF_BUG(0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* hif_snoc_bus_suspend_noirq() - ensure there are no pending transactions
|
||||
* @scn: hif context
|
||||
*
|
||||
* Ensure that if we recieved the wakeup message before the irq
|
||||
* was disabled that the message is pocessed before suspending.
|
||||
*
|
||||
* Return: -EBUSY if we fail to flush the tasklets.
|
||||
*/
|
||||
int hif_snoc_bus_suspend_noirq(struct hif_softc *scn)
|
||||
{
|
||||
if (hif_drain_tasklets(scn) != 0)
|
||||
return -EBUSY;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
18
htc/htc.c
18
htc/htc.c
|
|
@ -992,3 +992,21 @@ bool htc_can_suspend_link(HTC_HANDLE htc_handle)
|
|||
|
||||
return hif_can_suspend_link(target->hif_dev);
|
||||
}
|
||||
|
||||
#ifdef FEATURE_RUNTIME_PM
|
||||
int htc_pm_runtime_get(HTC_HANDLE htc_handle)
|
||||
{
|
||||
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_handle);
|
||||
|
||||
HTC_INFO("%s: %pS\n", __func__, (void *)_RET_IP_);
|
||||
return hif_pm_runtime_get(target->hif_dev);
|
||||
}
|
||||
|
||||
int htc_pm_runtime_put(HTC_HANDLE htc_handle)
|
||||
{
|
||||
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_handle);
|
||||
|
||||
HTC_INFO("%s: %pS\n", __func__, (void *)_RET_IP_);
|
||||
return hif_pm_runtime_put(target->hif_dev);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ typedef struct _HTC_INIT_INFO {
|
|||
void *pContext; /* context for target notifications */
|
||||
void (*TargetFailure)(void *Instance, QDF_STATUS Status);
|
||||
void (*TargetSendSuspendComplete)(void *ctx, bool is_nack);
|
||||
void (*target_initial_wakeup_cb)(void);
|
||||
} HTC_INIT_INFO;
|
||||
|
||||
/* Struct for HTC layer packet stats*/
|
||||
|
|
@ -749,4 +750,11 @@ void htc_dump_bundle_stats(HTC_HANDLE HTCHandle);
|
|||
void htc_clear_bundle_stats(HTC_HANDLE HTCHandle);
|
||||
#endif
|
||||
|
||||
#ifdef FEATURE_RUNTIME_PM
|
||||
int htc_pm_runtime_get(HTC_HANDLE htc_handle);
|
||||
int htc_pm_runtime_put(HTC_HANDLE htc_handle);
|
||||
#else
|
||||
static inline int htc_pm_runtime_get(HTC_HANDLE htc_handle) { return 0; }
|
||||
static inline int htc_pm_runtime_put(HTC_HANDLE htc_handle) { return 0; }
|
||||
#endif
|
||||
#endif /* _HTC_API_H_ */
|
||||
|
|
|
|||
|
|
@ -440,16 +440,21 @@ QDF_STATUS htc_rx_completion_handler(void *Context, qdf_nbuf_t netbuf,
|
|||
|
||||
qdf_event_set(&target->ctrl_response_valid);
|
||||
break;
|
||||
#ifdef CONFIG_MCL
|
||||
#ifdef HTC_MSG_WAKEUP_FROM_SUSPEND_ID
|
||||
case HTC_MSG_WAKEUP_FROM_SUSPEND_ID:
|
||||
AR_DEBUG_PRINTF(ATH_DEBUG_ANY,
|
||||
("Received initial wake up\n"));
|
||||
("Received initial wake up"));
|
||||
LOCK_HTC_CREDIT(target);
|
||||
htc_credit_record(HTC_INITIAL_WAKE_UP,
|
||||
pEndpoint->TxCredits,
|
||||
HTC_PACKET_QUEUE_DEPTH(
|
||||
&pEndpoint->TxQueue));
|
||||
UNLOCK_HTC_CREDIT(target);
|
||||
if (target->HTCInitInfo.target_initial_wakeup_cb)
|
||||
target->HTCInitInfo.target_initial_wakeup_cb();
|
||||
else
|
||||
AR_DEBUG_PRINTF(ATH_DEBUG_ANY,
|
||||
("No initial wake up cb"));
|
||||
break;
|
||||
#endif
|
||||
case HTC_MSG_SEND_SUSPEND_COMPLETE:
|
||||
|
|
|
|||
|
|
@ -2041,6 +2041,12 @@ static inline void qdf_nbuf_set_priority(qdf_nbuf_t buf, uint32_t p)
|
|||
__qdf_nbuf_set_priority(buf, p);
|
||||
}
|
||||
|
||||
static inline uint16_t
|
||||
qdf_nbuf_get_queue_mapping(qdf_nbuf_t buf)
|
||||
{
|
||||
return __qdf_nbuf_get_queue_mapping(buf);
|
||||
}
|
||||
|
||||
static inline uint8_t *
|
||||
qdf_nbuf_get_priv_ptr(qdf_nbuf_t buf)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -433,5 +433,10 @@ static inline int qdf_device_init_wakeup(qdf_device_t qdf_dev, bool enable)
|
|||
return __qdf_device_init_wakeup(qdf_dev, enable);
|
||||
}
|
||||
|
||||
static inline
|
||||
uint64_t qdf_get_totalramsize(void)
|
||||
{
|
||||
return __qdf_get_totalramsize();
|
||||
}
|
||||
|
||||
#endif /*_QDF_UTIL_H*/
|
||||
|
|
|
|||
|
|
@ -1670,4 +1670,16 @@ __qdf_nbuf_mark_wakeup_frame(__qdf_nbuf_t buf)
|
|||
buf->mark |= QDF_MARK_FIRST_WAKEUP_PACKET;
|
||||
}
|
||||
|
||||
/**
|
||||
* __qdf_nbuf_get_queue_mapping() - get the queue mapping set by linux kernel
|
||||
*
|
||||
* @buf: sk buff
|
||||
*
|
||||
* Return: Queue mapping
|
||||
*/
|
||||
static inline uint16_t
|
||||
__qdf_nbuf_get_queue_mapping(struct sk_buff *skb)
|
||||
{
|
||||
return skb->queue_mapping;
|
||||
}
|
||||
#endif /*_I_QDF_NET_BUF_H */
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
#include <linux/compiler.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/mm.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <linux/random.h>
|
||||
|
|
@ -195,6 +196,8 @@ static inline bool __qdf_is_macaddr_equal(struct qdf_mac_addr *mac_addr1,
|
|||
#define __qdf_min(_a, _b) ((_a) < (_b) ? _a : _b)
|
||||
#define __qdf_max(_a, _b) ((_a) > (_b) ? _a : _b)
|
||||
|
||||
#define MEMINFO_KB(x) ((x) << (PAGE_SHIFT - 10)) /* In kilobytes */
|
||||
|
||||
/**
|
||||
* @brief Assert
|
||||
*/
|
||||
|
|
@ -276,4 +279,17 @@ static inline int __qdf_device_init_wakeup(__qdf_device_t qdf_dev, bool enable)
|
|||
return device_init_wakeup(qdf_dev->dev, enable);
|
||||
}
|
||||
|
||||
/**
|
||||
* __qdf_get_totalramsize() - Get total ram size in Kb
|
||||
*
|
||||
* Return: Total ram size in Kb
|
||||
*/
|
||||
static inline uint64_t
|
||||
__qdf_get_totalramsize(void)
|
||||
{
|
||||
struct sysinfo meminfo;
|
||||
si_meminfo(&meminfo);
|
||||
return MEMINFO_KB(meminfo.totalram);
|
||||
}
|
||||
|
||||
#endif /*_I_QDF_UTIL_H*/
|
||||
|
|
|
|||
|
|
@ -854,6 +854,9 @@ QDF_STATUS wmi_unified_stats_request_send(void *wmi_hdl,
|
|||
QDF_STATUS wmi_unified_pdev_get_tpc_config_cmd_send(void *wmi_hdl,
|
||||
uint32_t param);
|
||||
|
||||
QDF_STATUS wmi_unified_set_bwf_cmd_send(void *wmi_hdl,
|
||||
struct set_bwf_params *param);
|
||||
|
||||
QDF_STATUS wmi_unified_set_atf_cmd_send(void *wmi_hdl,
|
||||
struct set_atf_params *param);
|
||||
|
||||
|
|
|
|||
|
|
@ -121,6 +121,14 @@
|
|||
#define WMI_HOST_MAX_BUFFER_SIZE 1712
|
||||
#define WMI_HAL_MAX_SANTENNA 4
|
||||
|
||||
#ifdef CONFIG_WIN
|
||||
#if ATH_SUPPORT_FIPS
|
||||
#define FIPS_ALIGN 4
|
||||
#define FIPS_ALIGNTO(__addr, __to) ((((unsigned long int)(__addr)) + (__to) - 1) & ~((__to) - 1))
|
||||
#define FIPS_IS_ALIGNED(__addr, __to) (!(((unsigned long int)(__addr)) & ((__to)-1)))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define WMI_HOST_F_MS(_v, _f) \
|
||||
(((_v) & (_f)) >> (_f##_S))
|
||||
|
||||
|
|
@ -3717,6 +3725,32 @@ typedef struct {
|
|||
uint32_t percentage_peer;
|
||||
} atf_peer_info;
|
||||
|
||||
/**
|
||||
* struct bwf_peer_info_t - BWF peer info params
|
||||
* @peer_macaddr: peer mac addr
|
||||
* @throughput: Throughput
|
||||
* @max_airtime: Max airtime
|
||||
* @priority: Priority level
|
||||
* @reserved: Reserved array
|
||||
*/
|
||||
typedef struct {
|
||||
struct wmi_macaddr_t peer_macaddr;
|
||||
uint32_t throughput;
|
||||
uint32_t max_airtime;
|
||||
uint32_t priority;
|
||||
uint32_t reserved[4];
|
||||
} bwf_peer_info;
|
||||
|
||||
/**
|
||||
* struct set_bwf_params - BWF params
|
||||
* @num_peers: number of peers
|
||||
* @atf_peer_info: BWF peer info
|
||||
*/
|
||||
struct set_bwf_params {
|
||||
uint32_t num_peers;
|
||||
bwf_peer_info peer_info[1];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct set_atf_params - ATF params
|
||||
* @num_peers: number of peers
|
||||
|
|
|
|||
|
|
@ -708,6 +708,9 @@ QDF_STATUS (*send_get_buf_extscan_hotlist_cmd)(wmi_unified_t wmi_handle,
|
|||
QDF_STATUS (*send_pdev_get_tpc_config_cmd)(wmi_unified_t wmi_handle,
|
||||
uint32_t param);
|
||||
|
||||
QDF_STATUS (*send_set_bwf_cmd)(wmi_unified_t wmi_handle,
|
||||
struct set_bwf_params *param);
|
||||
|
||||
QDF_STATUS (*send_set_atf_cmd)(wmi_unified_t wmi_handle,
|
||||
struct set_atf_params *param);
|
||||
|
||||
|
|
|
|||
|
|
@ -3443,6 +3443,24 @@ QDF_STATUS wmi_unified_pdev_get_tpc_config_cmd_send(void *wmi_hdl,
|
|||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
/**
|
||||
* wmi_unified_set_bwf_cmd_send() - WMI set bwf function
|
||||
* @param wmi_handle : handle to WMI.
|
||||
* @param param : pointer to set bwf param
|
||||
*
|
||||
* @return QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
||||
*/
|
||||
QDF_STATUS wmi_unified_set_bwf_cmd_send(void *wmi_hdl,
|
||||
struct set_bwf_params *param)
|
||||
{
|
||||
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
|
||||
|
||||
if (wmi_handle->ops->send_set_bwf_cmd)
|
||||
return wmi_handle->ops->send_set_bwf_cmd(wmi_handle, param);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
/**
|
||||
* wmi_unified_set_atf_cmd_send() - WMI set atf function
|
||||
* @param wmi_handle : handle to WMI.
|
||||
|
|
|
|||
|
|
@ -789,7 +789,7 @@ send_pdev_utf_cmd_non_tlv(wmi_unified_t wmi_handle,
|
|||
srcp = (uint32_t *)bufpos;
|
||||
for (i = 0; i < (roundup(chunkLen,
|
||||
sizeof(uint32_t)) / 4); i++) {
|
||||
*destp = le32_to_cpu(*srcp);
|
||||
*destp = qdf_le32_to_cpu(*srcp);
|
||||
destp++; srcp++;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1513,7 +1513,7 @@ QDF_STATUS send_beacon_send_cmd_non_tlv(wmi_unified_t wmi_handle,
|
|||
srcp = (u_int32_t *)wmi_buf_data(param->wbuf);
|
||||
for (i = 0; i < (roundup(bcn_len,
|
||||
sizeof(u_int32_t))/4); i++) {
|
||||
*destp = le32_to_cpu(*srcp);
|
||||
*destp = qdf_le32_to_cpu(*srcp);
|
||||
destp++; srcp++;
|
||||
}
|
||||
}
|
||||
|
|
@ -1625,6 +1625,9 @@ QDF_STATUS send_peer_assoc_cmd_non_tlv(wmi_unified_t wmi_handle,
|
|||
{
|
||||
wmi_peer_assoc_complete_cmd *cmd;
|
||||
int len = sizeof(wmi_peer_assoc_complete_cmd);
|
||||
#ifdef BIG_ENDIAN_HOST
|
||||
int i;
|
||||
#endif
|
||||
|
||||
wmi_buf_t buf;
|
||||
|
||||
|
|
@ -1732,12 +1735,11 @@ QDF_STATUS send_peer_assoc_cmd_non_tlv(wmi_unified_t wmi_handle,
|
|||
param->peer_legacy_rates.rates,
|
||||
param->peer_legacy_rates.num_rates);
|
||||
#ifdef BIG_ENDIAN_HOST
|
||||
int i;
|
||||
for (i = 0;
|
||||
i < param->peer_legacy_rates.num_rates/sizeof(A_UINT32) + 1;
|
||||
i++)
|
||||
cmd->peer_legacy_rates.rates[i] =
|
||||
le32_to_cpu(cmd->peer_legacy_rates.rates[i]);
|
||||
qdf_le32_to_cpu(cmd->peer_legacy_rates.rates[i]);
|
||||
#endif
|
||||
|
||||
cmd->peer_ht_rates.num_rates = param->peer_ht_rates.num_rates;
|
||||
|
|
@ -1748,7 +1750,7 @@ QDF_STATUS send_peer_assoc_cmd_non_tlv(wmi_unified_t wmi_handle,
|
|||
for (i = 0; i < param->peer_ht_rates.num_rates/sizeof(A_UINT32) + 1;
|
||||
i++)
|
||||
cmd->peer_ht_rates.rates[i] =
|
||||
le32_to_cpu(cmd->peer_ht_rates.rates[i]);
|
||||
qdf_le32_to_cpu(cmd->peer_ht_rates.rates[i]);
|
||||
#endif
|
||||
|
||||
if (param->ht_flag &&
|
||||
|
|
@ -2837,9 +2839,9 @@ send_mgmt_cmd_non_tlv(wmi_unified_t wmi_handle,
|
|||
u_int32_t *destp, *srcp;
|
||||
destp = (u_int32_t *)cmd->bufp;
|
||||
srcp = (u_int32_t *)wmi_buf_data(param->tx_frame);
|
||||
for (i = 0; i < (roundup(param->buf_len,
|
||||
for (i = 0; i < (roundup(param->frm_len,
|
||||
sizeof(u_int32_t))/4); i++) {
|
||||
*destp = le32_to_cpu(*srcp);
|
||||
*destp = qdf_le32_to_cpu(*srcp);
|
||||
destp++; srcp++;
|
||||
}
|
||||
}
|
||||
|
|
@ -3138,6 +3140,49 @@ send_pdev_get_tpc_config_cmd_non_tlv(wmi_unified_t wmi_handle,
|
|||
WMI_PDEV_GET_TPC_CONFIG_CMDID);
|
||||
}
|
||||
|
||||
/**
|
||||
* send_set_bwf_cmd_non_tlv() - send set bwf command to fw
|
||||
* @wmi_handle: wmi handle
|
||||
* @param: pointer to set bwf param
|
||||
*
|
||||
* Return: 0 for success or error code
|
||||
*/
|
||||
QDF_STATUS
|
||||
send_set_bwf_cmd_non_tlv(wmi_unified_t wmi_handle,
|
||||
struct set_bwf_params *param)
|
||||
{
|
||||
struct wmi_bwf_peer_info *peer_info;
|
||||
wmi_peer_bwf_request *cmd;
|
||||
wmi_buf_t buf;
|
||||
int len = sizeof(wmi_peer_bwf_request);
|
||||
int i, retval = 0;
|
||||
|
||||
len += param->num_peers * sizeof(struct wmi_bwf_peer_info);
|
||||
buf = wmi_buf_alloc(wmi_handle, len);
|
||||
if (!buf) {
|
||||
qdf_print("%s:wmi_buf_alloc failed\n", __func__);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
cmd = (wmi_peer_bwf_request *)wmi_buf_data(buf);
|
||||
qdf_mem_copy((void *)&(cmd->num_peers),
|
||||
(void *)&(param->num_peers),
|
||||
sizeof(u_int32_t));
|
||||
peer_info = (struct wmi_bwf_peer_info *)&(cmd->peer_info[0]);
|
||||
for (i = 0; i < param->num_peers; i++) {
|
||||
qdf_mem_copy((void *)&(peer_info[i]),
|
||||
(void *)&(param->peer_info[i]),
|
||||
sizeof(struct wmi_bwf_peer_info));
|
||||
}
|
||||
|
||||
retval = wmi_unified_cmd_send(wmi_handle, buf, len,
|
||||
WMI_PEER_BWF_REQUEST_CMDID);
|
||||
|
||||
if (retval)
|
||||
wmi_buf_free(buf);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* send_set_atf_cmd_non_tlv() - send set atf command to fw
|
||||
* @wmi_handle: wmi handle
|
||||
|
|
@ -3311,6 +3356,21 @@ send_wlan_profile_trigger_cmd_non_tlv(wmi_unified_t wmi_handle,
|
|||
WMI_WLAN_PROFILE_TRIGGER_CMDID);
|
||||
}
|
||||
|
||||
#ifdef BIG_ENDIAN_HOST
|
||||
void wmi_host_swap_bytes(void *pv, size_t n)
|
||||
{
|
||||
int noWords;
|
||||
int i;
|
||||
A_UINT32 *wordPtr;
|
||||
|
||||
noWords = n/sizeof(u_int32_t);
|
||||
wordPtr = (u_int32_t *)pv;
|
||||
for (i = 0; i < noWords; i++)
|
||||
*(wordPtr + i) = __cpu_to_le32(*(wordPtr + i));
|
||||
}
|
||||
#define WMI_HOST_SWAPME(x, len) wmi_host_swap_bytes(&x, len);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* send_set_ht_ie_cmd_non_tlv() - send ht ie command to fw
|
||||
* @wmi_handle: wmi handle
|
||||
|
|
@ -3340,8 +3400,8 @@ send_set_ht_ie_cmd_non_tlv(wmi_unified_t wmi_handle,
|
|||
cmd->ie_len = param->ie_len;
|
||||
qdf_mem_copy(cmd->ie_data, param->ie_data, param->ie_len);
|
||||
#ifdef BIG_ENDIAN_HOST
|
||||
SWAPME(cmd->ie_data, len-(offsetof(wmi_pdev_set_ht_ie_cmd,
|
||||
param->ie_data)));
|
||||
WMI_HOST_SWAPME(cmd->ie_data, len-(offsetof(wmi_pdev_set_ht_ie_cmd,
|
||||
ie_data)));
|
||||
#endif
|
||||
return wmi_unified_cmd_send(wmi_handle, buf, len,
|
||||
WMI_PDEV_SET_HT_CAP_IE_CMDID);
|
||||
|
|
@ -3376,8 +3436,8 @@ send_set_vht_ie_cmd_non_tlv(wmi_unified_t wmi_handle,
|
|||
cmd->ie_len = param->ie_len;
|
||||
qdf_mem_copy(cmd->ie_data, param->ie_data, param->ie_len);
|
||||
#ifdef BIG_ENDIAN_HOST
|
||||
SWAPME(cmd->ie_data, len-(offsetof(wmi_pdev_set_vht_ie_cmd,
|
||||
param->ie_data)));
|
||||
WMI_HOST_SWAPME(cmd->ie_data, len-(offsetof(wmi_pdev_set_vht_ie_cmd,
|
||||
ie_data)));
|
||||
#endif
|
||||
return wmi_unified_cmd_send(wmi_handle, buf, len,
|
||||
WMI_PDEV_SET_VHT_CAP_IE_CMDID);
|
||||
|
|
@ -4411,7 +4471,7 @@ send_rtt_meas_req_test_cmd_non_tlv(wmi_unified_t wmi_handle,
|
|||
}
|
||||
|
||||
p = (u_int8_t *) wmi_buf_data(buf);
|
||||
qdf_mem_set(p, 0, len);
|
||||
qdf_mem_set(p, len, 0);
|
||||
|
||||
head = (wmi_rtt_measreq_head *) p;
|
||||
WMI_RTT_REQ_ID_SET(head->req_id, param->req_id);
|
||||
|
|
@ -4549,7 +4609,7 @@ send_rtt_meas_req_cmd_non_tlv(wmi_unified_t wmi_handle,
|
|||
}
|
||||
|
||||
p = (uint8_t *) wmi_buf_data(buf);
|
||||
qdf_mem_set(p, 0, len);
|
||||
qdf_mem_set(p, len, 0);
|
||||
|
||||
/* encode header */
|
||||
head = (wmi_rtt_measreq_head *) p;
|
||||
|
|
@ -4619,7 +4679,7 @@ send_rtt_meas_req_cmd_non_tlv(wmi_unified_t wmi_handle,
|
|||
WMI_SET_CHANNEL_FLAG(w_chan, WMI_CHAN_FLAG_DFS);
|
||||
|
||||
WMI_CHAR_ARRAY_TO_MAC_ADDR(((uint8_t *)peer), &body->dest_mac);
|
||||
qdf_mem_set(spoof, 0 , 6);
|
||||
qdf_mem_set(spoof, IEEE80211_ADDR_LEN, 0);
|
||||
WMI_CHAR_ARRAY_TO_MAC_ADDR(((uint8_t *)param->spoof_mac_addr),
|
||||
&body->spoof_bssid);
|
||||
|
||||
|
|
@ -4717,7 +4777,7 @@ send_lci_set_cmd_non_tlv(wmi_unified_t wmi_handle,
|
|||
}
|
||||
|
||||
p = (uint8_t *) wmi_buf_data(buf);
|
||||
qdf_mem_set(p, 0, len);
|
||||
qdf_mem_set(p, len, 0);
|
||||
|
||||
head = (wmi_oem_measreq_head *)p;
|
||||
head->sub_type = TARGET_OEM_CONFIGURE_LCI;
|
||||
|
|
@ -4787,7 +4847,7 @@ send_lcr_set_cmd_non_tlv(wmi_unified_t wmi_handle,
|
|||
}
|
||||
|
||||
p = (uint8_t *) wmi_buf_data(buf);
|
||||
qdf_mem_set(p, 0, len);
|
||||
qdf_mem_set(p, len, 0);
|
||||
|
||||
head = (wmi_oem_measreq_head *)p;
|
||||
head->sub_type = TARGET_OEM_CONFIGURE_LCR;
|
||||
|
|
@ -5325,7 +5385,7 @@ static QDF_STATUS extract_fips_event_data_non_tlv(wmi_unified_t wmi_handle,
|
|||
/*****************LE to BE conversion*************************/
|
||||
|
||||
/* Assigning unaligned space to copy the data */
|
||||
unsigned char *data_unaligned = qdf_mem_malloc(NULL,
|
||||
unsigned char *data_unaligned = qdf_mem_malloc(
|
||||
(sizeof(u_int8_t)*event->data_len + FIPS_ALIGN));
|
||||
|
||||
u_int8_t *data_aligned = NULL;
|
||||
|
|
@ -5350,7 +5410,7 @@ static QDF_STATUS extract_fips_event_data_non_tlv(wmi_unified_t wmi_handle,
|
|||
/* Endianness to LE */
|
||||
for (c = 0; c < event->data_len/4; c++) {
|
||||
*((u_int32_t *)data_aligned+c) =
|
||||
qdf_os_le32_to_cpu(*((u_int32_t *)data_aligned+c));
|
||||
qdf_le32_to_cpu(*((u_int32_t *)data_aligned+c));
|
||||
}
|
||||
|
||||
/* Copy content to event->data */
|
||||
|
|
@ -7190,6 +7250,7 @@ struct wmi_ops non_tlv_ops = {
|
|||
.send_scan_chan_list_cmd = send_scan_chan_list_cmd_non_tlv,
|
||||
.send_pdev_get_tpc_config_cmd = send_pdev_get_tpc_config_cmd_non_tlv,
|
||||
.send_set_atf_cmd = send_set_atf_cmd_non_tlv,
|
||||
.send_set_bwf_cmd = send_set_bwf_cmd_non_tlv,
|
||||
.send_pdev_fips_cmd = send_pdev_fips_cmd_non_tlv,
|
||||
.send_wlan_profile_enable_cmd = send_wlan_profile_enable_cmd_non_tlv,
|
||||
.send_wlan_profile_trigger_cmd = send_wlan_profile_trigger_cmd_non_tlv,
|
||||
|
|
|
|||
|
|
@ -6372,6 +6372,7 @@ QDF_STATUS send_lphb_config_tcp_params_cmd_tlv(wmi_unified_t wmi_handle,
|
|||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
WMI_LOGE("wmi_unified_cmd_send WMI_HB_SET_TCP_PARAMS returned Error %d",
|
||||
status);
|
||||
wmi_buf_free(buf);
|
||||
}
|
||||
|
||||
return status;
|
||||
|
|
@ -6421,6 +6422,7 @@ QDF_STATUS send_lphb_config_tcp_pkt_filter_cmd_tlv(wmi_unified_t wmi_handle,
|
|||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
WMI_LOGE("wmi_unified_cmd_send WMI_HB_SET_TCP_PKT_FILTER returned Error %d",
|
||||
status);
|
||||
wmi_buf_free(buf);
|
||||
}
|
||||
|
||||
return status;
|
||||
|
|
@ -6470,9 +6472,11 @@ QDF_STATUS send_lphb_config_udp_params_cmd_tlv(wmi_unified_t wmi_handle,
|
|||
|
||||
status = wmi_unified_cmd_send(wmi_handle, buf,
|
||||
len, WMI_HB_SET_UDP_PARAMS_CMDID);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
WMI_LOGE("wmi_unified_cmd_send WMI_HB_SET_UDP_PARAMS returned Error %d",
|
||||
status);
|
||||
wmi_buf_free(buf);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
@ -6518,9 +6522,11 @@ QDF_STATUS send_lphb_config_udp_pkt_filter_cmd_tlv(wmi_unified_t wmi_handle,
|
|||
|
||||
status = wmi_unified_cmd_send(wmi_handle, buf,
|
||||
len, WMI_HB_SET_UDP_PKT_FILTER_CMDID);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
WMI_LOGE("wmi_unified_cmd_send WMI_HB_SET_UDP_PKT_FILTER returned Error %d",
|
||||
status);
|
||||
wmi_buf_free(buf);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
@ -6566,9 +6572,11 @@ QDF_STATUS send_process_dhcp_ind_cmd_tlv(wmi_unified_t wmi_handle,
|
|||
|
||||
status = wmi_unified_cmd_send(wmi_handle, buf,
|
||||
len, WMI_PEER_SET_PARAM_CMDID);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
WMI_LOGE("%s: wmi_unified_cmd_send WMI_PEER_SET_PARAM_CMD"
|
||||
" returned Error %d", __func__, status);
|
||||
wmi_buf_free(buf);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue