|
@@ -828,6 +828,68 @@ static void ipa3_vlan_l2tp_msg_free_cb(void *buff, u32 len, u32 type)
|
|
|
kfree(buff);
|
|
|
}
|
|
|
|
|
|
+static void ipa3_pdn_config_msg_free_cb(void *buff, u32 len, u32 type)
|
|
|
+{
|
|
|
+ if (!buff) {
|
|
|
+ IPAERR("Null buffer\n");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ kfree(buff);
|
|
|
+}
|
|
|
+
|
|
|
+static int ipa3_send_pdn_config_msg(unsigned long usr_param)
|
|
|
+{
|
|
|
+ int retval;
|
|
|
+ struct ipa_ioc_pdn_config *pdn_info;
|
|
|
+ struct ipa_msg_meta msg_meta;
|
|
|
+ void *buff;
|
|
|
+
|
|
|
+ memset(&msg_meta, 0, sizeof(msg_meta));
|
|
|
+
|
|
|
+ pdn_info = kzalloc(sizeof(struct ipa_ioc_pdn_config),
|
|
|
+ GFP_KERNEL);
|
|
|
+ if (!pdn_info)
|
|
|
+ return -ENOMEM;
|
|
|
+
|
|
|
+ if (copy_from_user((u8 *)pdn_info, (void __user *)usr_param,
|
|
|
+ sizeof(struct ipa_ioc_pdn_config))) {
|
|
|
+ kfree(pdn_info);
|
|
|
+ return -EFAULT;
|
|
|
+ }
|
|
|
+
|
|
|
+ msg_meta.msg_len = sizeof(struct ipa_ioc_pdn_config);
|
|
|
+ buff = pdn_info;
|
|
|
+
|
|
|
+ msg_meta.msg_type = pdn_info->pdn_cfg_type;
|
|
|
+
|
|
|
+ IPADBG("type %d, interface name: %s, enable:%d\n", msg_meta.msg_type,
|
|
|
+ pdn_info->dev_name, pdn_info->enable);
|
|
|
+
|
|
|
+ if (pdn_info->pdn_cfg_type == IPA_PDN_IP_PASSTHROUGH_MODE_CONFIG) {
|
|
|
+ IPADBG("Client MAC %02x:%02x:%02x:%02x:%02x:%02x\n",
|
|
|
+ pdn_info->u.passthrough_cfg.client_mac_addr[0],
|
|
|
+ pdn_info->u.passthrough_cfg.client_mac_addr[1],
|
|
|
+ pdn_info->u.passthrough_cfg.client_mac_addr[2],
|
|
|
+ pdn_info->u.passthrough_cfg.client_mac_addr[3],
|
|
|
+ pdn_info->u.passthrough_cfg.client_mac_addr[4],
|
|
|
+ pdn_info->u.passthrough_cfg.client_mac_addr[5]);
|
|
|
+ }
|
|
|
+
|
|
|
+ retval = ipa3_send_msg(&msg_meta, buff,
|
|
|
+ ipa3_pdn_config_msg_free_cb);
|
|
|
+ if (retval) {
|
|
|
+ IPAERR("ipa3_send_msg failed: %d, msg_type %d\n",
|
|
|
+ retval,
|
|
|
+ msg_meta.msg_type);
|
|
|
+ kfree(buff);
|
|
|
+ return retval;
|
|
|
+ }
|
|
|
+ IPADBG("exit\n");
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
static int ipa3_send_vlan_l2tp_msg(unsigned long usr_param, uint8_t msg_type)
|
|
|
{
|
|
|
int retval;
|
|
@@ -3058,6 +3120,13 @@ static long ipa3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
|
|
(enum ipa_app_clock_vote_type) arg);
|
|
|
break;
|
|
|
|
|
|
+ case IPA_IOC_PDN_CONFIG:
|
|
|
+ if (ipa3_send_pdn_config_msg(arg)) {
|
|
|
+ retval = -EFAULT;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
default:
|
|
|
IPA_ACTIVE_CLIENTS_DEC_SIMPLE();
|
|
|
return -ENOTTY;
|