Loading drivers/platform/msm/ipa/ipa_v2/ipa_debugfs.c +2 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,8 @@ const char *ipa_event_name[] = { __stringify(ADD_BRIDGE_VLAN_MAPPING), __stringify(DEL_BRIDGE_VLAN_MAPPING), __stringify(WLAN_FWR_SSR_BEFORE_SHUTDOWN), __stringify(IPA_GSB_CONNECT), __stringify(IPA_GSB_DISCONNECT), }; const char *ipa_hdr_l2_type_name[] = { Loading drivers/platform/msm/ipa/ipa_v3/ipa.c +83 −0 Original line number Diff line number Diff line Loading @@ -605,6 +605,73 @@ static int ipa3_send_vlan_l2tp_msg(unsigned long usr_param, uint8_t msg_type) return 0; } static void ipa3_gsb_msg_free_cb(void *buff, u32 len, u32 type) { if (!buff) { IPAERR("Null buffer\n"); return; } switch (type) { case IPA_GSB_CONNECT: case IPA_GSB_DISCONNECT: break; default: IPAERR("Wrong type given. buff %pK type %d\n", buff, type); return; } kfree(buff); } static int ipa3_send_gsb_msg(unsigned long usr_param, uint8_t msg_type) { int retval; struct ipa_ioc_gsb_info *gsb_info; struct ipa_msg_meta msg_meta; void *buff; IPADBG("type %d\n", msg_type); memset(&msg_meta, 0, sizeof(msg_meta)); msg_meta.msg_type = msg_type; if ((msg_type == IPA_GSB_CONNECT) || (msg_type == IPA_GSB_DISCONNECT)) { gsb_info = kzalloc(sizeof(struct ipa_ioc_gsb_info), GFP_KERNEL); if (!gsb_info) { IPAERR("no memory\n"); return -ENOMEM; } if (copy_from_user((u8 *)gsb_info, (void __user *)usr_param, sizeof(struct ipa_ioc_gsb_info))) { kfree(gsb_info); return -EFAULT; } msg_meta.msg_len = sizeof(struct ipa_ioc_gsb_info); buff = gsb_info; } else { IPAERR("Unexpected event\n"); return -EFAULT; } retval = ipa3_send_msg(&msg_meta, buff, ipa3_gsb_msg_free_cb); if (retval) { IPAERR("ipa3_send_msg failed: %d, msg_type %d\n", retval, msg_type); kfree(buff); return retval; } IPADBG("exit\n"); return 0; } static long ipa3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { int retval = 0; Loading Loading @@ -1795,6 +1862,22 @@ static long ipa3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = ipa3_resend_wlan_msg(); break; case IPA_IOC_GSB_CONNECT: IPADBG("Got IPA_IOC_GSB_CONNECT\n"); if (ipa3_send_gsb_msg(arg, IPA_GSB_CONNECT)) { retval = -EFAULT; break; } break; case IPA_IOC_GSB_DISCONNECT: IPADBG("Got IPA_IOC_GSB_DISCONNECT\n"); if (ipa3_send_gsb_msg(arg, IPA_GSB_DISCONNECT)) { retval = -EFAULT; break; } break; default: IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return -ENOTTY; Loading drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c +2 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,8 @@ const char *ipa3_event_name[] = { __stringify(ADD_BRIDGE_VLAN_MAPPING), __stringify(DEL_BRIDGE_VLAN_MAPPING), __stringify(WLAN_FWR_SSR_BEFORE_SHUTDOWN), __stringify(IPA_GSB_CONNECT), __stringify(IPA_GSB_DISCONNECT), }; const char *ipa3_hdr_l2_type_name[] = { Loading include/uapi/linux/msm_ipa.h +28 −1 Original line number Diff line number Diff line Loading @@ -100,6 +100,10 @@ #define IPA_IOCTL_GET_VLAN_MODE 58 #define IPA_IOCTL_ADD_BRIDGE_VLAN_MAPPING 59 #define IPA_IOCTL_DEL_BRIDGE_VLAN_MAPPING 60 #define IPA_IOCTL_GSB_CONNECT 61 #define IPA_IOCTL_GSB_DISCONNECT 62 /** * max size of the header to be inserted Loading Loading @@ -526,7 +530,14 @@ enum ipa_wlan_fw_ssr_event { #define IPA_WLAN_FW_SSR_EVENT_MAX IPA_WLAN_FW_SSR_EVENT_MAX }; #define IPA_EVENT_MAX_NUM (IPA_WLAN_FW_SSR_EVENT_MAX) enum ipa_gsb_event { IPA_GSB_CONNECT = IPA_WLAN_FW_SSR_EVENT_MAX, IPA_GSB_DISCONNECT, IPA_GSB_EVENT_MAX, #define IPA_GSB_EVENT_MAX IPA_GSB_EVENT_MAX }; #define IPA_EVENT_MAX_NUM (IPA_GSB_EVENT_MAX) #define IPA_EVENT_MAX ((int)IPA_EVENT_MAX_NUM) /** Loading Loading @@ -1690,6 +1701,14 @@ struct ipa_ioc_l2tp_vlan_mapping_info { char vlan_iface_name[IPA_RESOURCE_NAME_MAX]; }; /** * struct ipa_ioc_gsb_info - connect/disconnect * @name: interface name */ struct ipa_ioc_gsb_info { char name[IPA_RESOURCE_NAME_MAX]; }; /** * struct ipa_msg_meta - Format of the message meta-data. * @msg_type: the type of the message Loading Loading @@ -2102,6 +2121,14 @@ struct ipa_ioc_bridge_vlan_mapping_info { IPA_IOCTL_DEL_BRIDGE_VLAN_MAPPING, \ struct ipa_ioc_bridge_vlan_mapping_info) #define IPA_IOC_GSB_CONNECT _IOWR(IPA_IOC_MAGIC, \ IPA_IOCTL_GSB_CONNECT, \ struct ipa_ioc_gsb_info) #define IPA_IOC_GSB_DISCONNECT _IOWR(IPA_IOC_MAGIC, \ IPA_IOCTL_GSB_DISCONNECT, \ struct ipa_ioc_gsb_info) /* * unique magic number of the Tethering bridge ioctls */ Loading Loading
drivers/platform/msm/ipa/ipa_v2/ipa_debugfs.c +2 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,8 @@ const char *ipa_event_name[] = { __stringify(ADD_BRIDGE_VLAN_MAPPING), __stringify(DEL_BRIDGE_VLAN_MAPPING), __stringify(WLAN_FWR_SSR_BEFORE_SHUTDOWN), __stringify(IPA_GSB_CONNECT), __stringify(IPA_GSB_DISCONNECT), }; const char *ipa_hdr_l2_type_name[] = { Loading
drivers/platform/msm/ipa/ipa_v3/ipa.c +83 −0 Original line number Diff line number Diff line Loading @@ -605,6 +605,73 @@ static int ipa3_send_vlan_l2tp_msg(unsigned long usr_param, uint8_t msg_type) return 0; } static void ipa3_gsb_msg_free_cb(void *buff, u32 len, u32 type) { if (!buff) { IPAERR("Null buffer\n"); return; } switch (type) { case IPA_GSB_CONNECT: case IPA_GSB_DISCONNECT: break; default: IPAERR("Wrong type given. buff %pK type %d\n", buff, type); return; } kfree(buff); } static int ipa3_send_gsb_msg(unsigned long usr_param, uint8_t msg_type) { int retval; struct ipa_ioc_gsb_info *gsb_info; struct ipa_msg_meta msg_meta; void *buff; IPADBG("type %d\n", msg_type); memset(&msg_meta, 0, sizeof(msg_meta)); msg_meta.msg_type = msg_type; if ((msg_type == IPA_GSB_CONNECT) || (msg_type == IPA_GSB_DISCONNECT)) { gsb_info = kzalloc(sizeof(struct ipa_ioc_gsb_info), GFP_KERNEL); if (!gsb_info) { IPAERR("no memory\n"); return -ENOMEM; } if (copy_from_user((u8 *)gsb_info, (void __user *)usr_param, sizeof(struct ipa_ioc_gsb_info))) { kfree(gsb_info); return -EFAULT; } msg_meta.msg_len = sizeof(struct ipa_ioc_gsb_info); buff = gsb_info; } else { IPAERR("Unexpected event\n"); return -EFAULT; } retval = ipa3_send_msg(&msg_meta, buff, ipa3_gsb_msg_free_cb); if (retval) { IPAERR("ipa3_send_msg failed: %d, msg_type %d\n", retval, msg_type); kfree(buff); return retval; } IPADBG("exit\n"); return 0; } static long ipa3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { int retval = 0; Loading Loading @@ -1795,6 +1862,22 @@ static long ipa3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retval = ipa3_resend_wlan_msg(); break; case IPA_IOC_GSB_CONNECT: IPADBG("Got IPA_IOC_GSB_CONNECT\n"); if (ipa3_send_gsb_msg(arg, IPA_GSB_CONNECT)) { retval = -EFAULT; break; } break; case IPA_IOC_GSB_DISCONNECT: IPADBG("Got IPA_IOC_GSB_DISCONNECT\n"); if (ipa3_send_gsb_msg(arg, IPA_GSB_DISCONNECT)) { retval = -EFAULT; break; } break; default: IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); return -ENOTTY; Loading
drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c +2 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,8 @@ const char *ipa3_event_name[] = { __stringify(ADD_BRIDGE_VLAN_MAPPING), __stringify(DEL_BRIDGE_VLAN_MAPPING), __stringify(WLAN_FWR_SSR_BEFORE_SHUTDOWN), __stringify(IPA_GSB_CONNECT), __stringify(IPA_GSB_DISCONNECT), }; const char *ipa3_hdr_l2_type_name[] = { Loading
include/uapi/linux/msm_ipa.h +28 −1 Original line number Diff line number Diff line Loading @@ -100,6 +100,10 @@ #define IPA_IOCTL_GET_VLAN_MODE 58 #define IPA_IOCTL_ADD_BRIDGE_VLAN_MAPPING 59 #define IPA_IOCTL_DEL_BRIDGE_VLAN_MAPPING 60 #define IPA_IOCTL_GSB_CONNECT 61 #define IPA_IOCTL_GSB_DISCONNECT 62 /** * max size of the header to be inserted Loading Loading @@ -526,7 +530,14 @@ enum ipa_wlan_fw_ssr_event { #define IPA_WLAN_FW_SSR_EVENT_MAX IPA_WLAN_FW_SSR_EVENT_MAX }; #define IPA_EVENT_MAX_NUM (IPA_WLAN_FW_SSR_EVENT_MAX) enum ipa_gsb_event { IPA_GSB_CONNECT = IPA_WLAN_FW_SSR_EVENT_MAX, IPA_GSB_DISCONNECT, IPA_GSB_EVENT_MAX, #define IPA_GSB_EVENT_MAX IPA_GSB_EVENT_MAX }; #define IPA_EVENT_MAX_NUM (IPA_GSB_EVENT_MAX) #define IPA_EVENT_MAX ((int)IPA_EVENT_MAX_NUM) /** Loading Loading @@ -1690,6 +1701,14 @@ struct ipa_ioc_l2tp_vlan_mapping_info { char vlan_iface_name[IPA_RESOURCE_NAME_MAX]; }; /** * struct ipa_ioc_gsb_info - connect/disconnect * @name: interface name */ struct ipa_ioc_gsb_info { char name[IPA_RESOURCE_NAME_MAX]; }; /** * struct ipa_msg_meta - Format of the message meta-data. * @msg_type: the type of the message Loading Loading @@ -2102,6 +2121,14 @@ struct ipa_ioc_bridge_vlan_mapping_info { IPA_IOCTL_DEL_BRIDGE_VLAN_MAPPING, \ struct ipa_ioc_bridge_vlan_mapping_info) #define IPA_IOC_GSB_CONNECT _IOWR(IPA_IOC_MAGIC, \ IPA_IOCTL_GSB_CONNECT, \ struct ipa_ioc_gsb_info) #define IPA_IOC_GSB_DISCONNECT _IOWR(IPA_IOC_MAGIC, \ IPA_IOCTL_GSB_DISCONNECT, \ struct ipa_ioc_gsb_info) /* * unique magic number of the Tethering bridge ioctls */ Loading