Loading drivers/platform/msm/ipa/ipa_v2/ipa.c +15 −15 Original line number Diff line number Diff line Loading @@ -642,7 +642,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_nat_dma_cmd *)param)->entries != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_nat_dma_cmd *)param)->entries, pre_entry); retval = -EINVAL; Loading Loading @@ -689,7 +689,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_add_hdr *)param)->num_hdrs != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_add_hdr *)param)->num_hdrs, pre_entry); retval = -EINVAL; Loading Loading @@ -728,7 +728,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_del_hdr *)param)->num_hdls != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_del_hdr *)param)->num_hdls, pre_entry); retval = -EINVAL; Loading Loading @@ -768,7 +768,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_add_rt_rule *)param)->num_rules != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_add_rt_rule *)param)-> num_rules, pre_entry); Loading Loading @@ -808,7 +808,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_mdfy_rt_rule *)param)->num_rules != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_mdfy_rt_rule *)param)-> num_rules, pre_entry); Loading Loading @@ -848,7 +848,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_del_rt_rule *)param)->num_hdls != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_del_rt_rule *)param)->num_hdls, pre_entry); retval = -EINVAL; Loading Loading @@ -887,7 +887,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_add_flt_rule *)param)->num_rules != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_add_flt_rule *)param)-> num_rules, pre_entry); Loading Loading @@ -927,7 +927,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_del_flt_rule *)param)->num_hdls != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_del_flt_rule *)param)-> num_hdls, pre_entry); Loading Loading @@ -967,7 +967,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_mdfy_flt_rule *)param)->num_rules != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_mdfy_flt_rule *)param)-> num_rules, pre_entry); Loading Loading @@ -1105,7 +1105,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) if (unlikely(((struct ipa_ioc_query_intf_tx_props *) param)->num_tx_props != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_query_intf_tx_props *) param)->num_tx_props, pre_entry); retval = -EINVAL; Loading Loading @@ -1150,7 +1150,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_query_intf_rx_props *) param)->num_rx_props != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_query_intf_rx_props *) param)->num_rx_props, pre_entry); retval = -EINVAL; Loading Loading @@ -1195,7 +1195,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_query_intf_ext_props *) param)->num_ext_props != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_query_intf_ext_props *) param)->num_ext_props, pre_entry); retval = -EINVAL; Loading Loading @@ -1233,7 +1233,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_msg_meta *)param)->msg_len != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_msg_meta *)param)->msg_len, pre_entry); retval = -EINVAL; Loading Loading @@ -1373,7 +1373,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_add_hdr_proc_ctx *) param)->num_proc_ctxs != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_add_hdr_proc_ctx *) param)->num_proc_ctxs, pre_entry); retval = -EINVAL; Loading Loading @@ -1412,7 +1412,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_del_hdr_proc_ctx *) param)->num_hdls != pre_entry)) { IPAERR(" prevent memory corruption( %d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_del_hdr_proc_ctx *)param)-> num_hdls, pre_entry); Loading drivers/platform/msm/ipa/ipa_v2/ipa_flt.c +23 −23 Original line number Diff line number Diff line Loading @@ -1017,25 +1017,25 @@ static int __ipa_add_flt_rule(struct ipa_flt_tbl *tbl, enum ipa_ip_type ip, if (rule->action != IPA_PASS_TO_EXCEPTION) { if (!rule->eq_attrib_type) { if (!rule->rt_tbl_hdl) { IPAERR("invalid RT tbl\n"); IPAERR_RL("invalid RT tbl\n"); goto error; } rt_tbl = ipa_id_find(rule->rt_tbl_hdl); if (rt_tbl == NULL) { IPAERR("RT tbl not found\n"); IPAERR_RL("RT tbl not found\n"); goto error; } if (rt_tbl->cookie != IPA_RT_TBL_COOKIE) { IPAERR("RT table cookie is invalid\n"); IPAERR_RL("RT table cookie is invalid\n"); goto error; } } else { if (rule->rt_tbl_idx > ((ip == IPA_IP_v4) ? IPA_MEM_PART(v4_modem_rt_index_hi) : IPA_MEM_PART(v6_modem_rt_index_hi))) { IPAERR("invalid RT tbl\n"); IPAERR_RL("invalid RT tbl\n"); goto error; } } Loading Loading @@ -1091,12 +1091,12 @@ static int __ipa_del_flt_rule(u32 rule_hdl) entry = ipa_id_find(rule_hdl); if (entry == NULL) { IPAERR("lookup failed\n"); IPAERR_RL("lookup failed\n"); return -EINVAL; } if (entry->cookie != IPA_FLT_COOKIE) { IPAERR("bad params\n"); IPAERR_RL("bad params\n"); return -EINVAL; } id = entry->id; Loading @@ -1123,12 +1123,12 @@ static int __ipa_mdfy_flt_rule(struct ipa_flt_rule_mdfy *frule, entry = ipa_id_find(frule->rule_hdl); if (entry == NULL) { IPAERR("lookup failed\n"); IPAERR_RL("lookup failed\n"); goto error; } if (entry->cookie != IPA_FLT_COOKIE) { IPAERR("bad params\n"); IPAERR_RL("bad params\n"); goto error; } Loading @@ -1138,25 +1138,25 @@ static int __ipa_mdfy_flt_rule(struct ipa_flt_rule_mdfy *frule, if (frule->rule.action != IPA_PASS_TO_EXCEPTION) { if (!frule->rule.eq_attrib_type) { if (!frule->rule.rt_tbl_hdl) { IPAERR("invalid RT tbl\n"); IPAERR_RL("invalid RT tbl\n"); goto error; } rt_tbl = ipa_id_find(frule->rule.rt_tbl_hdl); if (rt_tbl == NULL) { IPAERR("RT tbl not found\n"); IPAERR_RL("RT tbl not found\n"); goto error; } if (rt_tbl->cookie != IPA_RT_TBL_COOKIE) { IPAERR("RT table cookie is invalid\n"); IPAERR_RL("RT table cookie is invalid\n"); goto error; } } else { if (frule->rule.rt_tbl_idx > ((ip == IPA_IP_v4) ? IPA_MEM_PART(v4_modem_rt_index_hi) : IPA_MEM_PART(v6_modem_rt_index_hi))) { IPAERR("invalid RT tbl\n"); IPAERR_RL("invalid RT tbl\n"); goto error; } } Loading @@ -1180,7 +1180,7 @@ static int __ipa_add_global_flt_rule(enum ipa_ip_type ip, struct ipa_flt_tbl *tbl; if (rule == NULL || rule_hdl == NULL) { IPAERR("bad parms rule=%p rule_hdl=%p\n", rule, rule_hdl); IPAERR_RL("bad parms rule=%p rule_hdl=%p\n", rule, rule_hdl); return -EINVAL; } Loading @@ -1199,14 +1199,14 @@ static int __ipa_add_ep_flt_rule(enum ipa_ip_type ip, enum ipa_client_type ep, int ipa_ep_idx; if (rule == NULL || rule_hdl == NULL || ep >= IPA_CLIENT_MAX) { IPAERR("bad parms rule=%p rule_hdl=%p ep=%d\n", rule, IPAERR_RL("bad parms rule=%p rule_hdl=%p ep=%d\n", rule, rule_hdl, ep); return -EINVAL; } ipa_ep_idx = ipa2_get_ep_mapping(ep); if (ipa_ep_idx == IPA_FLT_TABLE_INDEX_NOT_FOUND) { IPAERR("ep not valid ep=%d\n", ep); IPAERR_RL("ep not valid ep=%d\n", ep); return -EINVAL; } if (ipa_ctx->ep[ipa_ep_idx].valid == 0) Loading @@ -1233,7 +1233,7 @@ int ipa2_add_flt_rule(struct ipa_ioc_add_flt_rule *rules) if (rules == NULL || rules->num_rules == 0 || rules->ip >= IPA_IP_MAX) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } Loading @@ -1251,7 +1251,7 @@ int ipa2_add_flt_rule(struct ipa_ioc_add_flt_rule *rules) rules->rules[i].at_rear, &rules->rules[i].flt_rule_hdl); if (result) { IPAERR("failed to add flt rule %d\n", i); IPAERR_RL("failed to add flt rule %d\n", i); rules->rules[i].status = IPA_FLT_STATUS_OF_ADD_FAILED; } else { rules->rules[i].status = 0; Loading Loading @@ -1284,14 +1284,14 @@ int ipa2_del_flt_rule(struct ipa_ioc_del_flt_rule *hdls) int result; if (hdls == NULL || hdls->num_hdls == 0 || hdls->ip >= IPA_IP_MAX) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } mutex_lock(&ipa_ctx->lock); for (i = 0; i < hdls->num_hdls; i++) { if (__ipa_del_flt_rule(hdls->hdl[i].hdl)) { IPAERR("failed to del rt rule %i\n", i); IPAERR_RL("failed to del rt rule %i\n", i); hdls->hdl[i].status = IPA_FLT_STATUS_OF_DEL_FAILED; } else { hdls->hdl[i].status = 0; Loading Loading @@ -1324,14 +1324,14 @@ int ipa2_mdfy_flt_rule(struct ipa_ioc_mdfy_flt_rule *hdls) int result; if (hdls == NULL || hdls->num_rules == 0 || hdls->ip >= IPA_IP_MAX) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } mutex_lock(&ipa_ctx->lock); for (i = 0; i < hdls->num_rules; i++) { if (__ipa_mdfy_flt_rule(&hdls->rules[i], hdls->ip)) { IPAERR("failed to mdfy rt rule %i\n", i); IPAERR_RL("failed to mdfy rt rule %i\n", i); hdls->rules[i].status = IPA_FLT_STATUS_OF_MDFY_FAILED; } else { hdls->rules[i].status = 0; Loading Loading @@ -1365,7 +1365,7 @@ int ipa2_commit_flt(enum ipa_ip_type ip) int result; if (ip >= IPA_IP_MAX) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } Loading Loading @@ -1401,7 +1401,7 @@ int ipa2_reset_flt(enum ipa_ip_type ip) int id; if (ip >= IPA_IP_MAX) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } Loading drivers/platform/msm/ipa/ipa_v2/ipa_hdr.c +26 −26 Original line number Diff line number Diff line Loading @@ -558,13 +558,13 @@ static int __ipa_add_hdr_proc_ctx(struct ipa_hdr_proc_ctx_add *proc_ctx, proc_ctx->type, proc_ctx->hdr_hdl); if (!HDR_PROC_TYPE_IS_VALID(proc_ctx->type)) { IPAERR("invalid processing type %d\n", proc_ctx->type); IPAERR_RL("invalid processing type %d\n", proc_ctx->type); return -EINVAL; } hdr_entry = ipa_id_find(proc_ctx->hdr_hdl); if (!hdr_entry || (hdr_entry->cookie != IPA_HDR_COOKIE)) { IPAERR("hdr_hdl is invalid\n"); IPAERR_RL("hdr_hdl is invalid\n"); return -EINVAL; } Loading Loading @@ -592,7 +592,7 @@ static int __ipa_add_hdr_proc_ctx(struct ipa_hdr_proc_ctx_add *proc_ctx, ipa_hdr_proc_ctx_bin_sz[IPA_HDR_PROC_CTX_BIN1]) { bin = IPA_HDR_PROC_CTX_BIN1; } else { IPAERR("unexpected needed len %d\n", needed_len); IPAERR_RL("unexpected needed len %d\n", needed_len); WARN_ON(1); goto bad_len; } Loading @@ -602,7 +602,7 @@ static int __ipa_add_hdr_proc_ctx(struct ipa_hdr_proc_ctx_add *proc_ctx, IPA_MEM_PART(apps_hdr_proc_ctx_size_ddr); if (list_empty(&htbl->head_free_offset_list[bin])) { if (htbl->end + ipa_hdr_proc_ctx_bin_sz[bin] > mem_size) { IPAERR("hdr proc ctx table overflow\n"); IPAERR_RL("hdr proc ctx table overflow\n"); goto bad_len; } Loading Loading @@ -676,12 +676,12 @@ static int __ipa_add_hdr(struct ipa_hdr_add *hdr) gfp_t flag = GFP_KERNEL | (ipa_ctx->use_dma_zone ? GFP_DMA : 0); if (hdr->hdr_len == 0 || hdr->hdr_len > IPA_HDR_MAX_SIZE) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); goto error; } if (!HDR_TYPE_IS_VALID(hdr->type)) { IPAERR("invalid hdr type %d\n", hdr->type); IPAERR_RL("invalid hdr type %d\n", hdr->type); goto error; } Loading Loading @@ -713,7 +713,7 @@ static int __ipa_add_hdr(struct ipa_hdr_add *hdr) else if (hdr->hdr_len <= ipa_hdr_bin_sz[IPA_HDR_BIN4]) bin = IPA_HDR_BIN4; else { IPAERR("unexpected hdr len %d\n", hdr->hdr_len); IPAERR_RL("unexpected hdr len %d\n", hdr->hdr_len); goto bad_hdr_len; } Loading Loading @@ -844,7 +844,7 @@ static int __ipa_del_hdr_proc_ctx(u32 proc_ctx_hdl, entry = ipa_id_find(proc_ctx_hdl); if (!entry || (entry->cookie != IPA_PROC_HDR_COOKIE)) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } Loading @@ -852,7 +852,7 @@ static int __ipa_del_hdr_proc_ctx(u32 proc_ctx_hdl, htbl->proc_ctx_cnt, entry->offset_entry->offset); if (by_user && entry->user_deleted) { IPAERR("proc_ctx already deleted by user\n"); IPAERR_RL("proc_ctx already deleted by user\n"); return -EINVAL; } Loading Loading @@ -890,12 +890,12 @@ int __ipa_del_hdr(u32 hdr_hdl, bool by_user) entry = ipa_id_find(hdr_hdl); if (entry == NULL) { IPAERR("lookup failed\n"); IPAERR_RL("lookup failed\n"); return -EINVAL; } if (entry->cookie != IPA_HDR_COOKIE) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } Loading @@ -907,7 +907,7 @@ int __ipa_del_hdr(u32 hdr_hdl, bool by_user) htbl->hdr_cnt, entry->offset_entry->offset); if (by_user && entry->user_deleted) { IPAERR("hdr already deleted by user\n"); IPAERR_RL("hdr already deleted by user\n"); return -EINVAL; } Loading Loading @@ -956,12 +956,12 @@ int ipa2_add_hdr(struct ipa_ioc_add_hdr *hdrs) int result = -EFAULT; if (unlikely(!ipa_ctx)) { IPAERR("IPA driver was not initialized\n"); IPAERR_RL("IPA driver was not initialized\n"); return -EINVAL; } if (hdrs == NULL || hdrs->num_hdrs == 0) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } Loading @@ -970,7 +970,7 @@ int ipa2_add_hdr(struct ipa_ioc_add_hdr *hdrs) hdrs->num_hdrs); for (i = 0; i < hdrs->num_hdrs; i++) { if (__ipa_add_hdr(&hdrs->hdr[i])) { IPAERR("failed to add hdr %d\n", i); IPAERR_RL("failed to add hdr %d\n", i); hdrs->hdr[i].status = -1; } else { hdrs->hdr[i].status = 0; Loading Loading @@ -1011,14 +1011,14 @@ int ipa2_del_hdr_by_user(struct ipa_ioc_del_hdr *hdls, bool by_user) } if (hdls == NULL || hdls->num_hdls == 0) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } mutex_lock(&ipa_ctx->lock); for (i = 0; i < hdls->num_hdls; i++) { if (__ipa_del_hdr(hdls->hdl[i].hdl, by_user)) { IPAERR("failed to del hdr %i\n", i); IPAERR_RL("failed to del hdr %i\n", i); hdls->hdl[i].status = -1; } else { hdls->hdl[i].status = 0; Loading Loading @@ -1067,13 +1067,13 @@ int ipa2_add_hdr_proc_ctx(struct ipa_ioc_add_hdr_proc_ctx *proc_ctxs) if (ipa_ctx->ipa_hw_type <= IPA_HW_v2_0 || ipa_ctx->ipa_hw_type == IPA_HW_v2_6L) { IPAERR("Processing context not supported on IPA HW %d\n", IPAERR_RL("Processing context not supported on IPA HW %d\n", ipa_ctx->ipa_hw_type); return -EFAULT; } if (proc_ctxs == NULL || proc_ctxs->num_proc_ctxs == 0) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } Loading @@ -1082,7 +1082,7 @@ int ipa2_add_hdr_proc_ctx(struct ipa_ioc_add_hdr_proc_ctx *proc_ctxs) proc_ctxs->num_proc_ctxs); for (i = 0; i < proc_ctxs->num_proc_ctxs; i++) { if (__ipa_add_hdr_proc_ctx(&proc_ctxs->proc_ctx[i], true)) { IPAERR("failed to add hdr pric ctx %d\n", i); IPAERR_RL("failed to add hdr pric ctx %d\n", i); proc_ctxs->proc_ctx[i].status = -1; } else { proc_ctxs->proc_ctx[i].status = 0; Loading Loading @@ -1127,14 +1127,14 @@ int ipa2_del_hdr_proc_ctx_by_user(struct ipa_ioc_del_hdr_proc_ctx *hdls, } if (hdls == NULL || hdls->num_hdls == 0) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } mutex_lock(&ipa_ctx->lock); for (i = 0; i < hdls->num_hdls; i++) { if (__ipa_del_hdr_proc_ctx(hdls->hdl[i].hdl, true, by_user)) { IPAERR("failed to del hdr %i\n", i); IPAERR_RL("failed to del hdr %i\n", i); hdls->hdl[i].status = -1; } else { hdls->hdl[i].status = 0; Loading Loading @@ -1371,7 +1371,7 @@ int ipa2_get_hdr(struct ipa_ioc_get_hdr *lookup) } if (lookup == NULL) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } mutex_lock(&ipa_ctx->lock); Loading Loading @@ -1458,13 +1458,13 @@ int ipa2_put_hdr(u32 hdr_hdl) entry = ipa_id_find(hdr_hdl); if (entry == NULL) { IPAERR("lookup failed\n"); IPAERR_RL("lookup failed\n"); result = -EINVAL; goto bail; } if (entry->cookie != IPA_HDR_COOKIE) { IPAERR("invalid header entry\n"); IPAERR_RL("invalid header entry\n"); result = -EINVAL; goto bail; } Loading Loading @@ -1492,7 +1492,7 @@ int ipa2_copy_hdr(struct ipa_ioc_copy_hdr *copy) int result = -EFAULT; if (copy == NULL) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } mutex_lock(&ipa_ctx->lock); Loading drivers/platform/msm/ipa/ipa_v2/ipa_i.h +12 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,18 @@ } \ } while (0) #define IPAERR_RL(fmt, args...) \ do { \ pr_err_ratelimited(DRV_NAME " %s:%d " fmt, __func__, \ __LINE__, ## args);\ if (ipa_ctx) { \ IPA_IPC_LOGGING(ipa_ctx->logbuf, \ DRV_NAME " %s:%d " fmt, ## args); \ IPA_IPC_LOGGING(ipa_ctx->logbuf_low, \ DRV_NAME " %s:%d " fmt, ## args); \ } \ } while (0) #define WLAN_AMPDU_TX_EP 15 #define WLAN_PROD_TX_EP 19 #define WLAN1_CONS_RX_EP 14 Loading drivers/platform/msm/ipa/ipa_v2/ipa_intf.c +6 −6 Original line number Diff line number Diff line Loading @@ -274,7 +274,7 @@ int ipa_query_intf_tx_props(struct ipa_ioc_query_intf_tx_props *tx) if (!strncmp(entry->name, tx->name, IPA_RESOURCE_NAME_MAX)) { /* add the entry check */ if (entry->num_tx_props != tx->num_tx_props) { IPAERR("invalid entry number(%u %u)\n", IPAERR_RL("invalid entry number(%u %u)\n", entry->num_tx_props, tx->num_tx_props); mutex_unlock(&ipa_ctx->lock); Loading Loading @@ -315,7 +315,7 @@ int ipa_query_intf_rx_props(struct ipa_ioc_query_intf_rx_props *rx) if (!strncmp(entry->name, rx->name, IPA_RESOURCE_NAME_MAX)) { /* add the entry check */ if (entry->num_rx_props != rx->num_rx_props) { IPAERR("invalid entry number(%u %u)\n", IPAERR_RL("invalid entry number(%u %u)\n", entry->num_rx_props, rx->num_rx_props); mutex_unlock(&ipa_ctx->lock); Loading Loading @@ -356,7 +356,7 @@ int ipa_query_intf_ext_props(struct ipa_ioc_query_intf_ext_props *ext) if (!strcmp(entry->name, ext->name)) { /* add the entry check */ if (entry->num_ext_props != ext->num_ext_props) { IPAERR("invalid entry number(%u %u)\n", IPAERR_RL("invalid entry number(%u %u)\n", entry->num_ext_props, ext->num_ext_props); mutex_unlock(&ipa_ctx->lock); Loading Loading @@ -405,13 +405,13 @@ int ipa2_send_msg(struct ipa_msg_meta *meta, void *buff, if (meta == NULL || (buff == NULL && callback != NULL) || (buff != NULL && callback == NULL)) { IPAERR("invalid param meta=%p buff=%p, callback=%p\n", IPAERR_RL("invalid param meta=%p buff=%p, callback=%p\n", meta, buff, callback); return -EINVAL; } if (meta->msg_type >= IPA_EVENT_MAX_NUM) { IPAERR("unsupported message type %d\n", meta->msg_type); IPAERR_RL("unsupported message type %d\n", meta->msg_type); return -EINVAL; } Loading Loading @@ -634,7 +634,7 @@ int ipa_pull_msg(struct ipa_msg_meta *meta, char *buff, size_t count) int result = -EINVAL; if (meta == NULL || buff == NULL || !count) { IPAERR("invalid param name=%p buff=%p count=%zu\n", IPAERR_RL("invalid param name=%p buff=%p count=%zu\n", meta, buff, count); return result; } Loading Loading
drivers/platform/msm/ipa/ipa_v2/ipa.c +15 −15 Original line number Diff line number Diff line Loading @@ -642,7 +642,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_nat_dma_cmd *)param)->entries != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_nat_dma_cmd *)param)->entries, pre_entry); retval = -EINVAL; Loading Loading @@ -689,7 +689,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_add_hdr *)param)->num_hdrs != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_add_hdr *)param)->num_hdrs, pre_entry); retval = -EINVAL; Loading Loading @@ -728,7 +728,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_del_hdr *)param)->num_hdls != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_del_hdr *)param)->num_hdls, pre_entry); retval = -EINVAL; Loading Loading @@ -768,7 +768,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_add_rt_rule *)param)->num_rules != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_add_rt_rule *)param)-> num_rules, pre_entry); Loading Loading @@ -808,7 +808,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_mdfy_rt_rule *)param)->num_rules != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_mdfy_rt_rule *)param)-> num_rules, pre_entry); Loading Loading @@ -848,7 +848,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_del_rt_rule *)param)->num_hdls != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_del_rt_rule *)param)->num_hdls, pre_entry); retval = -EINVAL; Loading Loading @@ -887,7 +887,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_add_flt_rule *)param)->num_rules != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_add_flt_rule *)param)-> num_rules, pre_entry); Loading Loading @@ -927,7 +927,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_del_flt_rule *)param)->num_hdls != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_del_flt_rule *)param)-> num_hdls, pre_entry); Loading Loading @@ -967,7 +967,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_mdfy_flt_rule *)param)->num_rules != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_mdfy_flt_rule *)param)-> num_rules, pre_entry); Loading Loading @@ -1105,7 +1105,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) if (unlikely(((struct ipa_ioc_query_intf_tx_props *) param)->num_tx_props != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_query_intf_tx_props *) param)->num_tx_props, pre_entry); retval = -EINVAL; Loading Loading @@ -1150,7 +1150,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_query_intf_rx_props *) param)->num_rx_props != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_query_intf_rx_props *) param)->num_rx_props, pre_entry); retval = -EINVAL; Loading Loading @@ -1195,7 +1195,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_query_intf_ext_props *) param)->num_ext_props != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_query_intf_ext_props *) param)->num_ext_props, pre_entry); retval = -EINVAL; Loading Loading @@ -1233,7 +1233,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_msg_meta *)param)->msg_len != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_msg_meta *)param)->msg_len, pre_entry); retval = -EINVAL; Loading Loading @@ -1373,7 +1373,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_add_hdr_proc_ctx *) param)->num_proc_ctxs != pre_entry)) { IPAERR(" prevent memory corruption(%d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_add_hdr_proc_ctx *) param)->num_proc_ctxs, pre_entry); retval = -EINVAL; Loading Loading @@ -1412,7 +1412,7 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) /* add check in case user-space module compromised */ if (unlikely(((struct ipa_ioc_del_hdr_proc_ctx *) param)->num_hdls != pre_entry)) { IPAERR(" prevent memory corruption( %d not match %d)\n", IPAERR_RL("current %d pre %d\n", ((struct ipa_ioc_del_hdr_proc_ctx *)param)-> num_hdls, pre_entry); Loading
drivers/platform/msm/ipa/ipa_v2/ipa_flt.c +23 −23 Original line number Diff line number Diff line Loading @@ -1017,25 +1017,25 @@ static int __ipa_add_flt_rule(struct ipa_flt_tbl *tbl, enum ipa_ip_type ip, if (rule->action != IPA_PASS_TO_EXCEPTION) { if (!rule->eq_attrib_type) { if (!rule->rt_tbl_hdl) { IPAERR("invalid RT tbl\n"); IPAERR_RL("invalid RT tbl\n"); goto error; } rt_tbl = ipa_id_find(rule->rt_tbl_hdl); if (rt_tbl == NULL) { IPAERR("RT tbl not found\n"); IPAERR_RL("RT tbl not found\n"); goto error; } if (rt_tbl->cookie != IPA_RT_TBL_COOKIE) { IPAERR("RT table cookie is invalid\n"); IPAERR_RL("RT table cookie is invalid\n"); goto error; } } else { if (rule->rt_tbl_idx > ((ip == IPA_IP_v4) ? IPA_MEM_PART(v4_modem_rt_index_hi) : IPA_MEM_PART(v6_modem_rt_index_hi))) { IPAERR("invalid RT tbl\n"); IPAERR_RL("invalid RT tbl\n"); goto error; } } Loading Loading @@ -1091,12 +1091,12 @@ static int __ipa_del_flt_rule(u32 rule_hdl) entry = ipa_id_find(rule_hdl); if (entry == NULL) { IPAERR("lookup failed\n"); IPAERR_RL("lookup failed\n"); return -EINVAL; } if (entry->cookie != IPA_FLT_COOKIE) { IPAERR("bad params\n"); IPAERR_RL("bad params\n"); return -EINVAL; } id = entry->id; Loading @@ -1123,12 +1123,12 @@ static int __ipa_mdfy_flt_rule(struct ipa_flt_rule_mdfy *frule, entry = ipa_id_find(frule->rule_hdl); if (entry == NULL) { IPAERR("lookup failed\n"); IPAERR_RL("lookup failed\n"); goto error; } if (entry->cookie != IPA_FLT_COOKIE) { IPAERR("bad params\n"); IPAERR_RL("bad params\n"); goto error; } Loading @@ -1138,25 +1138,25 @@ static int __ipa_mdfy_flt_rule(struct ipa_flt_rule_mdfy *frule, if (frule->rule.action != IPA_PASS_TO_EXCEPTION) { if (!frule->rule.eq_attrib_type) { if (!frule->rule.rt_tbl_hdl) { IPAERR("invalid RT tbl\n"); IPAERR_RL("invalid RT tbl\n"); goto error; } rt_tbl = ipa_id_find(frule->rule.rt_tbl_hdl); if (rt_tbl == NULL) { IPAERR("RT tbl not found\n"); IPAERR_RL("RT tbl not found\n"); goto error; } if (rt_tbl->cookie != IPA_RT_TBL_COOKIE) { IPAERR("RT table cookie is invalid\n"); IPAERR_RL("RT table cookie is invalid\n"); goto error; } } else { if (frule->rule.rt_tbl_idx > ((ip == IPA_IP_v4) ? IPA_MEM_PART(v4_modem_rt_index_hi) : IPA_MEM_PART(v6_modem_rt_index_hi))) { IPAERR("invalid RT tbl\n"); IPAERR_RL("invalid RT tbl\n"); goto error; } } Loading @@ -1180,7 +1180,7 @@ static int __ipa_add_global_flt_rule(enum ipa_ip_type ip, struct ipa_flt_tbl *tbl; if (rule == NULL || rule_hdl == NULL) { IPAERR("bad parms rule=%p rule_hdl=%p\n", rule, rule_hdl); IPAERR_RL("bad parms rule=%p rule_hdl=%p\n", rule, rule_hdl); return -EINVAL; } Loading @@ -1199,14 +1199,14 @@ static int __ipa_add_ep_flt_rule(enum ipa_ip_type ip, enum ipa_client_type ep, int ipa_ep_idx; if (rule == NULL || rule_hdl == NULL || ep >= IPA_CLIENT_MAX) { IPAERR("bad parms rule=%p rule_hdl=%p ep=%d\n", rule, IPAERR_RL("bad parms rule=%p rule_hdl=%p ep=%d\n", rule, rule_hdl, ep); return -EINVAL; } ipa_ep_idx = ipa2_get_ep_mapping(ep); if (ipa_ep_idx == IPA_FLT_TABLE_INDEX_NOT_FOUND) { IPAERR("ep not valid ep=%d\n", ep); IPAERR_RL("ep not valid ep=%d\n", ep); return -EINVAL; } if (ipa_ctx->ep[ipa_ep_idx].valid == 0) Loading @@ -1233,7 +1233,7 @@ int ipa2_add_flt_rule(struct ipa_ioc_add_flt_rule *rules) if (rules == NULL || rules->num_rules == 0 || rules->ip >= IPA_IP_MAX) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } Loading @@ -1251,7 +1251,7 @@ int ipa2_add_flt_rule(struct ipa_ioc_add_flt_rule *rules) rules->rules[i].at_rear, &rules->rules[i].flt_rule_hdl); if (result) { IPAERR("failed to add flt rule %d\n", i); IPAERR_RL("failed to add flt rule %d\n", i); rules->rules[i].status = IPA_FLT_STATUS_OF_ADD_FAILED; } else { rules->rules[i].status = 0; Loading Loading @@ -1284,14 +1284,14 @@ int ipa2_del_flt_rule(struct ipa_ioc_del_flt_rule *hdls) int result; if (hdls == NULL || hdls->num_hdls == 0 || hdls->ip >= IPA_IP_MAX) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } mutex_lock(&ipa_ctx->lock); for (i = 0; i < hdls->num_hdls; i++) { if (__ipa_del_flt_rule(hdls->hdl[i].hdl)) { IPAERR("failed to del rt rule %i\n", i); IPAERR_RL("failed to del rt rule %i\n", i); hdls->hdl[i].status = IPA_FLT_STATUS_OF_DEL_FAILED; } else { hdls->hdl[i].status = 0; Loading Loading @@ -1324,14 +1324,14 @@ int ipa2_mdfy_flt_rule(struct ipa_ioc_mdfy_flt_rule *hdls) int result; if (hdls == NULL || hdls->num_rules == 0 || hdls->ip >= IPA_IP_MAX) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } mutex_lock(&ipa_ctx->lock); for (i = 0; i < hdls->num_rules; i++) { if (__ipa_mdfy_flt_rule(&hdls->rules[i], hdls->ip)) { IPAERR("failed to mdfy rt rule %i\n", i); IPAERR_RL("failed to mdfy rt rule %i\n", i); hdls->rules[i].status = IPA_FLT_STATUS_OF_MDFY_FAILED; } else { hdls->rules[i].status = 0; Loading Loading @@ -1365,7 +1365,7 @@ int ipa2_commit_flt(enum ipa_ip_type ip) int result; if (ip >= IPA_IP_MAX) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } Loading Loading @@ -1401,7 +1401,7 @@ int ipa2_reset_flt(enum ipa_ip_type ip) int id; if (ip >= IPA_IP_MAX) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } Loading
drivers/platform/msm/ipa/ipa_v2/ipa_hdr.c +26 −26 Original line number Diff line number Diff line Loading @@ -558,13 +558,13 @@ static int __ipa_add_hdr_proc_ctx(struct ipa_hdr_proc_ctx_add *proc_ctx, proc_ctx->type, proc_ctx->hdr_hdl); if (!HDR_PROC_TYPE_IS_VALID(proc_ctx->type)) { IPAERR("invalid processing type %d\n", proc_ctx->type); IPAERR_RL("invalid processing type %d\n", proc_ctx->type); return -EINVAL; } hdr_entry = ipa_id_find(proc_ctx->hdr_hdl); if (!hdr_entry || (hdr_entry->cookie != IPA_HDR_COOKIE)) { IPAERR("hdr_hdl is invalid\n"); IPAERR_RL("hdr_hdl is invalid\n"); return -EINVAL; } Loading Loading @@ -592,7 +592,7 @@ static int __ipa_add_hdr_proc_ctx(struct ipa_hdr_proc_ctx_add *proc_ctx, ipa_hdr_proc_ctx_bin_sz[IPA_HDR_PROC_CTX_BIN1]) { bin = IPA_HDR_PROC_CTX_BIN1; } else { IPAERR("unexpected needed len %d\n", needed_len); IPAERR_RL("unexpected needed len %d\n", needed_len); WARN_ON(1); goto bad_len; } Loading @@ -602,7 +602,7 @@ static int __ipa_add_hdr_proc_ctx(struct ipa_hdr_proc_ctx_add *proc_ctx, IPA_MEM_PART(apps_hdr_proc_ctx_size_ddr); if (list_empty(&htbl->head_free_offset_list[bin])) { if (htbl->end + ipa_hdr_proc_ctx_bin_sz[bin] > mem_size) { IPAERR("hdr proc ctx table overflow\n"); IPAERR_RL("hdr proc ctx table overflow\n"); goto bad_len; } Loading Loading @@ -676,12 +676,12 @@ static int __ipa_add_hdr(struct ipa_hdr_add *hdr) gfp_t flag = GFP_KERNEL | (ipa_ctx->use_dma_zone ? GFP_DMA : 0); if (hdr->hdr_len == 0 || hdr->hdr_len > IPA_HDR_MAX_SIZE) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); goto error; } if (!HDR_TYPE_IS_VALID(hdr->type)) { IPAERR("invalid hdr type %d\n", hdr->type); IPAERR_RL("invalid hdr type %d\n", hdr->type); goto error; } Loading Loading @@ -713,7 +713,7 @@ static int __ipa_add_hdr(struct ipa_hdr_add *hdr) else if (hdr->hdr_len <= ipa_hdr_bin_sz[IPA_HDR_BIN4]) bin = IPA_HDR_BIN4; else { IPAERR("unexpected hdr len %d\n", hdr->hdr_len); IPAERR_RL("unexpected hdr len %d\n", hdr->hdr_len); goto bad_hdr_len; } Loading Loading @@ -844,7 +844,7 @@ static int __ipa_del_hdr_proc_ctx(u32 proc_ctx_hdl, entry = ipa_id_find(proc_ctx_hdl); if (!entry || (entry->cookie != IPA_PROC_HDR_COOKIE)) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } Loading @@ -852,7 +852,7 @@ static int __ipa_del_hdr_proc_ctx(u32 proc_ctx_hdl, htbl->proc_ctx_cnt, entry->offset_entry->offset); if (by_user && entry->user_deleted) { IPAERR("proc_ctx already deleted by user\n"); IPAERR_RL("proc_ctx already deleted by user\n"); return -EINVAL; } Loading Loading @@ -890,12 +890,12 @@ int __ipa_del_hdr(u32 hdr_hdl, bool by_user) entry = ipa_id_find(hdr_hdl); if (entry == NULL) { IPAERR("lookup failed\n"); IPAERR_RL("lookup failed\n"); return -EINVAL; } if (entry->cookie != IPA_HDR_COOKIE) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } Loading @@ -907,7 +907,7 @@ int __ipa_del_hdr(u32 hdr_hdl, bool by_user) htbl->hdr_cnt, entry->offset_entry->offset); if (by_user && entry->user_deleted) { IPAERR("hdr already deleted by user\n"); IPAERR_RL("hdr already deleted by user\n"); return -EINVAL; } Loading Loading @@ -956,12 +956,12 @@ int ipa2_add_hdr(struct ipa_ioc_add_hdr *hdrs) int result = -EFAULT; if (unlikely(!ipa_ctx)) { IPAERR("IPA driver was not initialized\n"); IPAERR_RL("IPA driver was not initialized\n"); return -EINVAL; } if (hdrs == NULL || hdrs->num_hdrs == 0) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } Loading @@ -970,7 +970,7 @@ int ipa2_add_hdr(struct ipa_ioc_add_hdr *hdrs) hdrs->num_hdrs); for (i = 0; i < hdrs->num_hdrs; i++) { if (__ipa_add_hdr(&hdrs->hdr[i])) { IPAERR("failed to add hdr %d\n", i); IPAERR_RL("failed to add hdr %d\n", i); hdrs->hdr[i].status = -1; } else { hdrs->hdr[i].status = 0; Loading Loading @@ -1011,14 +1011,14 @@ int ipa2_del_hdr_by_user(struct ipa_ioc_del_hdr *hdls, bool by_user) } if (hdls == NULL || hdls->num_hdls == 0) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } mutex_lock(&ipa_ctx->lock); for (i = 0; i < hdls->num_hdls; i++) { if (__ipa_del_hdr(hdls->hdl[i].hdl, by_user)) { IPAERR("failed to del hdr %i\n", i); IPAERR_RL("failed to del hdr %i\n", i); hdls->hdl[i].status = -1; } else { hdls->hdl[i].status = 0; Loading Loading @@ -1067,13 +1067,13 @@ int ipa2_add_hdr_proc_ctx(struct ipa_ioc_add_hdr_proc_ctx *proc_ctxs) if (ipa_ctx->ipa_hw_type <= IPA_HW_v2_0 || ipa_ctx->ipa_hw_type == IPA_HW_v2_6L) { IPAERR("Processing context not supported on IPA HW %d\n", IPAERR_RL("Processing context not supported on IPA HW %d\n", ipa_ctx->ipa_hw_type); return -EFAULT; } if (proc_ctxs == NULL || proc_ctxs->num_proc_ctxs == 0) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } Loading @@ -1082,7 +1082,7 @@ int ipa2_add_hdr_proc_ctx(struct ipa_ioc_add_hdr_proc_ctx *proc_ctxs) proc_ctxs->num_proc_ctxs); for (i = 0; i < proc_ctxs->num_proc_ctxs; i++) { if (__ipa_add_hdr_proc_ctx(&proc_ctxs->proc_ctx[i], true)) { IPAERR("failed to add hdr pric ctx %d\n", i); IPAERR_RL("failed to add hdr pric ctx %d\n", i); proc_ctxs->proc_ctx[i].status = -1; } else { proc_ctxs->proc_ctx[i].status = 0; Loading Loading @@ -1127,14 +1127,14 @@ int ipa2_del_hdr_proc_ctx_by_user(struct ipa_ioc_del_hdr_proc_ctx *hdls, } if (hdls == NULL || hdls->num_hdls == 0) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } mutex_lock(&ipa_ctx->lock); for (i = 0; i < hdls->num_hdls; i++) { if (__ipa_del_hdr_proc_ctx(hdls->hdl[i].hdl, true, by_user)) { IPAERR("failed to del hdr %i\n", i); IPAERR_RL("failed to del hdr %i\n", i); hdls->hdl[i].status = -1; } else { hdls->hdl[i].status = 0; Loading Loading @@ -1371,7 +1371,7 @@ int ipa2_get_hdr(struct ipa_ioc_get_hdr *lookup) } if (lookup == NULL) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } mutex_lock(&ipa_ctx->lock); Loading Loading @@ -1458,13 +1458,13 @@ int ipa2_put_hdr(u32 hdr_hdl) entry = ipa_id_find(hdr_hdl); if (entry == NULL) { IPAERR("lookup failed\n"); IPAERR_RL("lookup failed\n"); result = -EINVAL; goto bail; } if (entry->cookie != IPA_HDR_COOKIE) { IPAERR("invalid header entry\n"); IPAERR_RL("invalid header entry\n"); result = -EINVAL; goto bail; } Loading Loading @@ -1492,7 +1492,7 @@ int ipa2_copy_hdr(struct ipa_ioc_copy_hdr *copy) int result = -EFAULT; if (copy == NULL) { IPAERR("bad parm\n"); IPAERR_RL("bad parm\n"); return -EINVAL; } mutex_lock(&ipa_ctx->lock); Loading
drivers/platform/msm/ipa/ipa_v2/ipa_i.h +12 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,18 @@ } \ } while (0) #define IPAERR_RL(fmt, args...) \ do { \ pr_err_ratelimited(DRV_NAME " %s:%d " fmt, __func__, \ __LINE__, ## args);\ if (ipa_ctx) { \ IPA_IPC_LOGGING(ipa_ctx->logbuf, \ DRV_NAME " %s:%d " fmt, ## args); \ IPA_IPC_LOGGING(ipa_ctx->logbuf_low, \ DRV_NAME " %s:%d " fmt, ## args); \ } \ } while (0) #define WLAN_AMPDU_TX_EP 15 #define WLAN_PROD_TX_EP 19 #define WLAN1_CONS_RX_EP 14 Loading
drivers/platform/msm/ipa/ipa_v2/ipa_intf.c +6 −6 Original line number Diff line number Diff line Loading @@ -274,7 +274,7 @@ int ipa_query_intf_tx_props(struct ipa_ioc_query_intf_tx_props *tx) if (!strncmp(entry->name, tx->name, IPA_RESOURCE_NAME_MAX)) { /* add the entry check */ if (entry->num_tx_props != tx->num_tx_props) { IPAERR("invalid entry number(%u %u)\n", IPAERR_RL("invalid entry number(%u %u)\n", entry->num_tx_props, tx->num_tx_props); mutex_unlock(&ipa_ctx->lock); Loading Loading @@ -315,7 +315,7 @@ int ipa_query_intf_rx_props(struct ipa_ioc_query_intf_rx_props *rx) if (!strncmp(entry->name, rx->name, IPA_RESOURCE_NAME_MAX)) { /* add the entry check */ if (entry->num_rx_props != rx->num_rx_props) { IPAERR("invalid entry number(%u %u)\n", IPAERR_RL("invalid entry number(%u %u)\n", entry->num_rx_props, rx->num_rx_props); mutex_unlock(&ipa_ctx->lock); Loading Loading @@ -356,7 +356,7 @@ int ipa_query_intf_ext_props(struct ipa_ioc_query_intf_ext_props *ext) if (!strcmp(entry->name, ext->name)) { /* add the entry check */ if (entry->num_ext_props != ext->num_ext_props) { IPAERR("invalid entry number(%u %u)\n", IPAERR_RL("invalid entry number(%u %u)\n", entry->num_ext_props, ext->num_ext_props); mutex_unlock(&ipa_ctx->lock); Loading Loading @@ -405,13 +405,13 @@ int ipa2_send_msg(struct ipa_msg_meta *meta, void *buff, if (meta == NULL || (buff == NULL && callback != NULL) || (buff != NULL && callback == NULL)) { IPAERR("invalid param meta=%p buff=%p, callback=%p\n", IPAERR_RL("invalid param meta=%p buff=%p, callback=%p\n", meta, buff, callback); return -EINVAL; } if (meta->msg_type >= IPA_EVENT_MAX_NUM) { IPAERR("unsupported message type %d\n", meta->msg_type); IPAERR_RL("unsupported message type %d\n", meta->msg_type); return -EINVAL; } Loading Loading @@ -634,7 +634,7 @@ int ipa_pull_msg(struct ipa_msg_meta *meta, char *buff, size_t count) int result = -EINVAL; if (meta == NULL || buff == NULL || !count) { IPAERR("invalid param name=%p buff=%p count=%zu\n", IPAERR_RL("invalid param name=%p buff=%p count=%zu\n", meta, buff, count); return result; } Loading