Loading drivers/platform/msm/ipa/ipa_v2/ipa.c +25 −4 Original line number Diff line number Diff line Loading @@ -532,7 +532,8 @@ static void ipa_wan_msg_free_cb(void *buff, u32 len, u32 type) kfree(buff); } static int ipa_send_wan_msg(unsigned long usr_param, uint8_t msg_type) static int ipa_send_wan_msg(unsigned long usr_param, uint8_t msg_type, bool is_cache) { int retval; struct ipa_wan_msg *wan_msg; Loading Loading @@ -560,6 +561,25 @@ static int ipa_send_wan_msg(unsigned long usr_param, uint8_t msg_type) return retval; } if (is_cache) { mutex_lock(&ipa_ctx->ipa_cne_evt_lock); /* cache the cne event */ memcpy(&ipa_ctx->ipa_cne_evt_req_cache[ ipa_ctx->num_ipa_cne_evt_req].wan_msg, wan_msg, sizeof(struct ipa_wan_msg)); memcpy(&ipa_ctx->ipa_cne_evt_req_cache[ ipa_ctx->num_ipa_cne_evt_req].msg_meta, &msg_meta, sizeof(struct ipa_msg_meta)); ipa_ctx->num_ipa_cne_evt_req++; ipa_ctx->num_ipa_cne_evt_req %= IPA_MAX_NUM_REQ_CACHE; mutex_unlock(&ipa_ctx->ipa_cne_evt_lock); } return 0; } Loading Loading @@ -1329,21 +1349,21 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) } break; case IPA_IOC_NOTIFY_WAN_UPSTREAM_ROUTE_ADD: retval = ipa_send_wan_msg(arg, WAN_UPSTREAM_ROUTE_ADD); retval = ipa_send_wan_msg(arg, WAN_UPSTREAM_ROUTE_ADD, true); if (retval) { IPAERR("ipa_send_wan_msg failed: %d\n", retval); break; } break; case IPA_IOC_NOTIFY_WAN_UPSTREAM_ROUTE_DEL: retval = ipa_send_wan_msg(arg, WAN_UPSTREAM_ROUTE_DEL); retval = ipa_send_wan_msg(arg, WAN_UPSTREAM_ROUTE_DEL, true); if (retval) { IPAERR("ipa_send_wan_msg failed: %d\n", retval); break; } break; case IPA_IOC_NOTIFY_WAN_EMBMS_CONNECTED: retval = ipa_send_wan_msg(arg, WAN_EMBMS_CONNECT); retval = ipa_send_wan_msg(arg, WAN_EMBMS_CONNECT, false); if (retval) { IPAERR("ipa_send_wan_msg failed: %d\n", retval); break; Loading Loading @@ -4181,6 +4201,7 @@ static int ipa_init(const struct ipa_plat_drv_res *resource_p, mutex_init(&ipa_ctx->lock); mutex_init(&ipa_ctx->nat_mem.lock); mutex_init(&ipa_ctx->ipa_cne_evt_lock); idr_init(&ipa_ctx->ipa_idr); spin_lock_init(&ipa_ctx->idr_lock); Loading drivers/platform/msm/ipa/ipa_v2/ipa_i.h +10 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,8 @@ #define IPA_IPC_LOG_PAGES 50 #define IPA_MAX_NUM_REQ_CACHE 10 #define IPADBG(fmt, args...) \ do { \ pr_debug(DRV_NAME " %s:%d " fmt, __func__, __LINE__, ## args);\ Loading Loading @@ -988,6 +990,11 @@ struct ipacm_client_info { bool uplink; }; struct ipa_cne_evt { struct ipa_wan_msg wan_msg; struct ipa_msg_meta msg_meta; }; /** * struct ipa_context - IPA context * @class: pointer to the struct class Loading Loading @@ -1188,6 +1195,9 @@ struct ipa_context { u32 ipa_rx_min_timeout_usec; u32 ipa_rx_max_timeout_usec; u32 ipa_polling_iteration; struct ipa_cne_evt ipa_cne_evt_req_cache[IPA_MAX_NUM_REQ_CACHE]; int num_ipa_cne_evt_req; struct mutex ipa_cne_evt_lock; }; /** Loading drivers/platform/msm/ipa/ipa_v3/ipa.c +25 −4 Original line number Diff line number Diff line Loading @@ -598,7 +598,8 @@ static void ipa3_wan_msg_free_cb(void *buff, u32 len, u32 type) kfree(buff); } static int ipa3_send_wan_msg(unsigned long usr_param, uint8_t msg_type) static int ipa3_send_wan_msg(unsigned long usr_param, uint8_t msg_type, bool is_cache) { int retval; struct ipa_wan_msg *wan_msg; Loading Loading @@ -626,6 +627,25 @@ static int ipa3_send_wan_msg(unsigned long usr_param, uint8_t msg_type) return retval; } if (is_cache) { mutex_lock(&ipa3_ctx->ipa_cne_evt_lock); /* cache the cne event */ memcpy(&ipa3_ctx->ipa_cne_evt_req_cache[ ipa3_ctx->num_ipa_cne_evt_req].wan_msg, wan_msg, sizeof(struct ipa_wan_msg)); memcpy(&ipa3_ctx->ipa_cne_evt_req_cache[ ipa3_ctx->num_ipa_cne_evt_req].msg_meta, &msg_meta, sizeof(struct ipa_msg_meta)); ipa3_ctx->num_ipa_cne_evt_req++; ipa3_ctx->num_ipa_cne_evt_req %= IPA_MAX_NUM_REQ_CACHE; mutex_unlock(&ipa3_ctx->ipa_cne_evt_lock); } return 0; } Loading Loading @@ -1646,21 +1666,21 @@ static long ipa3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) } break; case IPA_IOC_NOTIFY_WAN_UPSTREAM_ROUTE_ADD: retval = ipa3_send_wan_msg(arg, WAN_UPSTREAM_ROUTE_ADD); retval = ipa3_send_wan_msg(arg, WAN_UPSTREAM_ROUTE_ADD, true); if (retval) { IPAERR("ipa3_send_wan_msg failed: %d\n", retval); break; } break; case IPA_IOC_NOTIFY_WAN_UPSTREAM_ROUTE_DEL: retval = ipa3_send_wan_msg(arg, WAN_UPSTREAM_ROUTE_DEL); retval = ipa3_send_wan_msg(arg, WAN_UPSTREAM_ROUTE_DEL, true); if (retval) { IPAERR("ipa3_send_wan_msg failed: %d\n", retval); break; } break; case IPA_IOC_NOTIFY_WAN_EMBMS_CONNECTED: retval = ipa3_send_wan_msg(arg, WAN_EMBMS_CONNECT); retval = ipa3_send_wan_msg(arg, WAN_EMBMS_CONNECT, false); if (retval) { IPAERR("ipa3_send_wan_msg failed: %d\n", retval); break; Loading Loading @@ -5111,6 +5131,7 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p, mutex_init(&ipa3_ctx->lock); mutex_init(&ipa3_ctx->nat_mem.lock); mutex_init(&ipa3_ctx->q6_proxy_clk_vote_mutex); mutex_init(&ipa3_ctx->ipa_cne_evt_lock); idr_init(&ipa3_ctx->ipa_idr); spin_lock_init(&ipa3_ctx->idr_lock); Loading drivers/platform/msm/ipa/ipa_v3/ipa_i.h +9 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ #define IPA_IPC_LOG_PAGES 50 #define IPA_PM_THRESHOLD_MAX 2 #define IPA_MAX_NUM_REQ_CACHE 10 #define IPADBG(fmt, args...) \ do { \ Loading Loading @@ -1106,6 +1107,11 @@ struct ipa_dma_task_info { struct ipahal_imm_cmd_pyld *cmd_pyld; }; struct ipa_cne_evt { struct ipa_wan_msg wan_msg; struct ipa_msg_meta msg_meta; }; /** * struct ipa3_context - IPA context * @class: pointer to the struct class Loading Loading @@ -1333,6 +1339,9 @@ struct ipa3_context { u32 ipa_tz_unlock_reg_num; struct ipa_tz_unlock_reg_info *ipa_tz_unlock_reg; struct ipa_dma_task_info dma_task_info; struct ipa_cne_evt ipa_cne_evt_req_cache[IPA_MAX_NUM_REQ_CACHE]; int num_ipa_cne_evt_req; struct mutex ipa_cne_evt_lock; }; /** Loading Loading
drivers/platform/msm/ipa/ipa_v2/ipa.c +25 −4 Original line number Diff line number Diff line Loading @@ -532,7 +532,8 @@ static void ipa_wan_msg_free_cb(void *buff, u32 len, u32 type) kfree(buff); } static int ipa_send_wan_msg(unsigned long usr_param, uint8_t msg_type) static int ipa_send_wan_msg(unsigned long usr_param, uint8_t msg_type, bool is_cache) { int retval; struct ipa_wan_msg *wan_msg; Loading Loading @@ -560,6 +561,25 @@ static int ipa_send_wan_msg(unsigned long usr_param, uint8_t msg_type) return retval; } if (is_cache) { mutex_lock(&ipa_ctx->ipa_cne_evt_lock); /* cache the cne event */ memcpy(&ipa_ctx->ipa_cne_evt_req_cache[ ipa_ctx->num_ipa_cne_evt_req].wan_msg, wan_msg, sizeof(struct ipa_wan_msg)); memcpy(&ipa_ctx->ipa_cne_evt_req_cache[ ipa_ctx->num_ipa_cne_evt_req].msg_meta, &msg_meta, sizeof(struct ipa_msg_meta)); ipa_ctx->num_ipa_cne_evt_req++; ipa_ctx->num_ipa_cne_evt_req %= IPA_MAX_NUM_REQ_CACHE; mutex_unlock(&ipa_ctx->ipa_cne_evt_lock); } return 0; } Loading Loading @@ -1329,21 +1349,21 @@ static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) } break; case IPA_IOC_NOTIFY_WAN_UPSTREAM_ROUTE_ADD: retval = ipa_send_wan_msg(arg, WAN_UPSTREAM_ROUTE_ADD); retval = ipa_send_wan_msg(arg, WAN_UPSTREAM_ROUTE_ADD, true); if (retval) { IPAERR("ipa_send_wan_msg failed: %d\n", retval); break; } break; case IPA_IOC_NOTIFY_WAN_UPSTREAM_ROUTE_DEL: retval = ipa_send_wan_msg(arg, WAN_UPSTREAM_ROUTE_DEL); retval = ipa_send_wan_msg(arg, WAN_UPSTREAM_ROUTE_DEL, true); if (retval) { IPAERR("ipa_send_wan_msg failed: %d\n", retval); break; } break; case IPA_IOC_NOTIFY_WAN_EMBMS_CONNECTED: retval = ipa_send_wan_msg(arg, WAN_EMBMS_CONNECT); retval = ipa_send_wan_msg(arg, WAN_EMBMS_CONNECT, false); if (retval) { IPAERR("ipa_send_wan_msg failed: %d\n", retval); break; Loading Loading @@ -4181,6 +4201,7 @@ static int ipa_init(const struct ipa_plat_drv_res *resource_p, mutex_init(&ipa_ctx->lock); mutex_init(&ipa_ctx->nat_mem.lock); mutex_init(&ipa_ctx->ipa_cne_evt_lock); idr_init(&ipa_ctx->ipa_idr); spin_lock_init(&ipa_ctx->idr_lock); Loading
drivers/platform/msm/ipa/ipa_v2/ipa_i.h +10 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,8 @@ #define IPA_IPC_LOG_PAGES 50 #define IPA_MAX_NUM_REQ_CACHE 10 #define IPADBG(fmt, args...) \ do { \ pr_debug(DRV_NAME " %s:%d " fmt, __func__, __LINE__, ## args);\ Loading Loading @@ -988,6 +990,11 @@ struct ipacm_client_info { bool uplink; }; struct ipa_cne_evt { struct ipa_wan_msg wan_msg; struct ipa_msg_meta msg_meta; }; /** * struct ipa_context - IPA context * @class: pointer to the struct class Loading Loading @@ -1188,6 +1195,9 @@ struct ipa_context { u32 ipa_rx_min_timeout_usec; u32 ipa_rx_max_timeout_usec; u32 ipa_polling_iteration; struct ipa_cne_evt ipa_cne_evt_req_cache[IPA_MAX_NUM_REQ_CACHE]; int num_ipa_cne_evt_req; struct mutex ipa_cne_evt_lock; }; /** Loading
drivers/platform/msm/ipa/ipa_v3/ipa.c +25 −4 Original line number Diff line number Diff line Loading @@ -598,7 +598,8 @@ static void ipa3_wan_msg_free_cb(void *buff, u32 len, u32 type) kfree(buff); } static int ipa3_send_wan_msg(unsigned long usr_param, uint8_t msg_type) static int ipa3_send_wan_msg(unsigned long usr_param, uint8_t msg_type, bool is_cache) { int retval; struct ipa_wan_msg *wan_msg; Loading Loading @@ -626,6 +627,25 @@ static int ipa3_send_wan_msg(unsigned long usr_param, uint8_t msg_type) return retval; } if (is_cache) { mutex_lock(&ipa3_ctx->ipa_cne_evt_lock); /* cache the cne event */ memcpy(&ipa3_ctx->ipa_cne_evt_req_cache[ ipa3_ctx->num_ipa_cne_evt_req].wan_msg, wan_msg, sizeof(struct ipa_wan_msg)); memcpy(&ipa3_ctx->ipa_cne_evt_req_cache[ ipa3_ctx->num_ipa_cne_evt_req].msg_meta, &msg_meta, sizeof(struct ipa_msg_meta)); ipa3_ctx->num_ipa_cne_evt_req++; ipa3_ctx->num_ipa_cne_evt_req %= IPA_MAX_NUM_REQ_CACHE; mutex_unlock(&ipa3_ctx->ipa_cne_evt_lock); } return 0; } Loading Loading @@ -1646,21 +1666,21 @@ static long ipa3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) } break; case IPA_IOC_NOTIFY_WAN_UPSTREAM_ROUTE_ADD: retval = ipa3_send_wan_msg(arg, WAN_UPSTREAM_ROUTE_ADD); retval = ipa3_send_wan_msg(arg, WAN_UPSTREAM_ROUTE_ADD, true); if (retval) { IPAERR("ipa3_send_wan_msg failed: %d\n", retval); break; } break; case IPA_IOC_NOTIFY_WAN_UPSTREAM_ROUTE_DEL: retval = ipa3_send_wan_msg(arg, WAN_UPSTREAM_ROUTE_DEL); retval = ipa3_send_wan_msg(arg, WAN_UPSTREAM_ROUTE_DEL, true); if (retval) { IPAERR("ipa3_send_wan_msg failed: %d\n", retval); break; } break; case IPA_IOC_NOTIFY_WAN_EMBMS_CONNECTED: retval = ipa3_send_wan_msg(arg, WAN_EMBMS_CONNECT); retval = ipa3_send_wan_msg(arg, WAN_EMBMS_CONNECT, false); if (retval) { IPAERR("ipa3_send_wan_msg failed: %d\n", retval); break; Loading Loading @@ -5111,6 +5131,7 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p, mutex_init(&ipa3_ctx->lock); mutex_init(&ipa3_ctx->nat_mem.lock); mutex_init(&ipa3_ctx->q6_proxy_clk_vote_mutex); mutex_init(&ipa3_ctx->ipa_cne_evt_lock); idr_init(&ipa3_ctx->ipa_idr); spin_lock_init(&ipa3_ctx->idr_lock); Loading
drivers/platform/msm/ipa/ipa_v3/ipa_i.h +9 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ #define IPA_IPC_LOG_PAGES 50 #define IPA_PM_THRESHOLD_MAX 2 #define IPA_MAX_NUM_REQ_CACHE 10 #define IPADBG(fmt, args...) \ do { \ Loading Loading @@ -1106,6 +1107,11 @@ struct ipa_dma_task_info { struct ipahal_imm_cmd_pyld *cmd_pyld; }; struct ipa_cne_evt { struct ipa_wan_msg wan_msg; struct ipa_msg_meta msg_meta; }; /** * struct ipa3_context - IPA context * @class: pointer to the struct class Loading Loading @@ -1333,6 +1339,9 @@ struct ipa3_context { u32 ipa_tz_unlock_reg_num; struct ipa_tz_unlock_reg_info *ipa_tz_unlock_reg; struct ipa_dma_task_info dma_task_info; struct ipa_cne_evt ipa_cne_evt_req_cache[IPA_MAX_NUM_REQ_CACHE]; int num_ipa_cne_evt_req; struct mutex ipa_cne_evt_lock; }; /** Loading