Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0409c532 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ipa3: add hasting AP+STA quota/stats support"

parents 342a282f 092de254
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
@@ -1996,6 +1996,43 @@ int ipa_get_wdi_stats(struct IpaHwStatsWDIInfoData_t *stats)
}
EXPORT_SYMBOL(ipa_get_wdi_stats);

/**
 * ipa_uc_bw_monitor() - start uc bw monitoring
 * @info:	[inout] set info populated by driver
 *
 * Returns:	0 on success, negative on failure
 *
 * @note Cannot be called from atomic context
 *
 */
int ipa_uc_bw_monitor(struct ipa_wdi_bw_info *info)
{
	int ret;

	IPA_API_DISPATCH_RETURN(ipa_uc_bw_monitor, info);

	return ret;
}
EXPORT_SYMBOL(ipa_uc_bw_monitor);

/**
 * ipa_set_wlan_tx_info() -set WDI statistics from uc
 * @info:	[inout] set info populated by driver
 *
 * Returns:	0 on success, negative on failure
 *
 * @note Cannot be called from atomic context
 *
 */
int ipa_set_wlan_tx_info(struct ipa_wdi_tx_info *info)
{
	int ret;

	IPA_API_DISPATCH_RETURN(ipa_set_wlan_tx_info, info);

	return ret;
}
EXPORT_SYMBOL(ipa_set_wlan_tx_info);
/**
 * ipa_get_smem_restr_bytes()- Return IPA smem restricted bytes
 *
+4 −0
Original line number Diff line number Diff line
@@ -212,6 +212,10 @@ struct ipa_api_controller {

	int (*ipa_get_wdi_stats)(struct IpaHwStatsWDIInfoData_t *stats);

	int (*ipa_uc_bw_monitor)(struct ipa_wdi_bw_info *info);

	int (*ipa_set_wlan_tx_info)(struct ipa_wdi_tx_info *info);

	u16 (*ipa_get_smem_restr_bytes)(void);

	int (*ipa_broadcast_wdi_quota_reach_ind)(uint32_t fid,
+12 −0
Original line number Diff line number Diff line
@@ -760,3 +760,15 @@ int ipa_wdi_get_stats(struct IpaHwStatsWDIInfoData_t *stats)
	return ipa_get_wdi_stats(stats);
}
EXPORT_SYMBOL(ipa_wdi_get_stats);

int ipa_wdi_bw_monitor(struct ipa_wdi_bw_info *info)
{
	return ipa_uc_bw_monitor(info);
}
EXPORT_SYMBOL(ipa_wdi_bw_monitor);

int ipa_wdi_sw_stats(struct ipa_wdi_tx_info *info)
{
	return ipa_set_wlan_tx_info(info);
}
EXPORT_SYMBOL(ipa_wdi_sw_stats);
+42 −0
Original line number Diff line number Diff line
@@ -132,6 +132,7 @@ static int ipa3_ioctl_add_flt_rule_after_v2(unsigned long arg);
static int ipa3_ioctl_mdfy_flt_rule_v2(unsigned long arg);
static int ipa3_ioctl_fnr_counter_alloc(unsigned long arg);
static int ipa3_ioctl_fnr_counter_query(unsigned long arg);
static int ipa3_ioctl_fnr_counter_set(unsigned long arg);

static struct ipa3_plat_drv_res ipa3_res = {0, };

@@ -1480,6 +1481,43 @@ static int ipa3_ioctl_fnr_counter_query(unsigned long arg)
	return retval;
}

static int ipa3_ioctl_fnr_counter_set(unsigned long arg)
{
	u8 header[128] = { 0 };
	uint8_t value;

	if (copy_from_user(header, (const void __user *)arg,
		sizeof(struct ipa_ioc_fnr_index_info))) {
		IPAERR_RL("copy_from_user fails\n");
		return -EFAULT;
	}

	value = ((struct ipa_ioc_fnr_index_info *)
		header)->hw_counter_offset;
	if (value <= 0 || value > IPA_MAX_FLT_RT_CNT_INDEX) {
		IPAERR("hw_counter_offset failed: num %d\n",
			value);
		return -EPERM;
	}

	ipa3_ctx->fnr_info.hw_counter_offset = value;

	value = ((struct ipa_ioc_fnr_index_info *)
		header)->sw_counter_offset;
	if (value <= 0 || value > IPA_MAX_FLT_RT_CNT_INDEX) {
		IPAERR("sw_counter_offset failed: num %d\n",
			value);
		return -EPERM;
	}
	ipa3_ctx->fnr_info.sw_counter_offset = value;
	/* reset when ipacm-cleanup */
	ipa3_ctx->fnr_info.valid = true;
	IPADBG("fnr_info hw=%d, hw=%d\n",
		ipa3_ctx->fnr_info.hw_counter_offset,
		ipa3_ctx->fnr_info.sw_counter_offset);
	return 0;
}

static long ipa3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
	int retval = 0;
@@ -2648,6 +2686,10 @@ static long ipa3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
		retval = ipa3_ioctl_fnr_counter_query(arg);
		break;

	case IPA_IOC_SET_FNR_COUNTER_INFO:
		retval = ipa3_ioctl_fnr_counter_set(arg);
		break;

	case IPA_IOC_WIGIG_FST_SWITCH:
		IPADBG("Got IPA_IOCTL_WIGIG_FST_SWITCH\n");
		if (copy_from_user(&fst_switch, (const void __user *)arg,
+27 −0
Original line number Diff line number Diff line
@@ -1412,6 +1412,12 @@ struct ipa3_uc_ctx {
	u32 rdy_comp_ring_size;
	u32 *rdy_ring_rp_va;
	u32 *rdy_comp_ring_wp_va;
	bool uc_event_ring_valid;
	struct ipa_mem_buffer event_ring;
	u32 ering_wp_local;
	u32 ering_rp_local;
	u32 ering_wp;
	u32 ering_rp;
};

/**
@@ -1501,6 +1507,17 @@ struct ipa3cm_client_info {
	bool uplink;
};

/**
 * struct ipacm_fnr_info - the fnr-info indicated from IPACM
 * @ipacm_client_enum: the enum to indicate tether-client
 * @ipacm_client_uplink: the bool to indicate pipe for uplink
 */
struct ipacm_fnr_info {
	bool valid;
	uint8_t hw_counter_offset;
	uint8_t sw_counter_offset;
};

struct ipa3_smp2p_info {
	u32 out_base_id;
	u32 in_base_id;
@@ -1893,6 +1910,7 @@ struct ipa3_context {
	struct IpaHwOffloadStatsAllocCmdData_t
		gsi_info[IPA_HW_PROTOCOL_MAX];
	bool ipa_wan_skb_page;
	struct ipacm_fnr_info fnr_info;
};

struct ipa3_plat_drv_res {
@@ -2572,6 +2590,9 @@ bool ipa3_get_client_uplink(int pipe_idx);
int ipa3_get_wlan_stats(struct ipa_get_wdi_sap_stats *wdi_sap_stats);

int ipa3_set_wlan_quota(struct ipa_set_wifi_quota *wdi_quota);

int ipa3_inform_wlan_bw(struct ipa_inform_wlan_bw *wdi_bw);

/*
 * IPADMA
 */
@@ -2839,6 +2860,10 @@ int ipa3_uc_send_remote_ipa_info(u32 remote_addr, uint32_t mbox_n);
int ipa3_uc_debug_stats_alloc(
	struct IpaHwOffloadStatsAllocCmdData_t cmdinfo);
int ipa3_uc_debug_stats_dealloc(uint32_t protocol);
int ipa3_uc_quota_monitor(uint64_t quota);
int ipa3_uc_bw_monitor(struct ipa_wdi_bw_info *info);
int ipa3_uc_setup_event_ring(void);
int ipa3_set_wlan_tx_info(struct ipa_wdi_tx_info *info);
void ipa3_tag_destroy_imm(void *user1, int user2);
const struct ipa_gsi_ep_config *ipa3_get_gsi_ep_info
	(enum ipa_client_type client);
@@ -2897,6 +2922,8 @@ int ipa_get_flt_rt_stats(struct ipa_ioc_flt_rt_query *query);

int ipa_set_flt_rt_stats(int index, struct ipa_flt_rt_stats stats);

bool ipa_get_fnr_info(struct ipacm_fnr_info *fnr_info);

u32 ipa3_get_num_pipes(void);
struct ipa_smmu_cb_ctx *ipa3_get_smmu_ctx(enum ipa_smmu_cb_type);
struct iommu_domain *ipa3_get_smmu_domain(void);
Loading