diff --git a/include/uapi/linux/ipa_qmi_service_v01.h b/include/uapi/linux/ipa_qmi_service_v01.h index 88ff85d354ef..c718c2f60b77 100644 --- a/include/uapi/linux/ipa_qmi_service_v01.h +++ b/include/uapi/linux/ipa_qmi_service_v01.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ /* - * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved. */ /* @@ -1798,6 +1798,8 @@ struct ipa_data_usage_quota_info_type_v01 { */ }; /* Type */ +#define IPA_DATA_WARNING_QUOTA + /* Request Message; Master driver sets a data usage quota value on * modem driver */ @@ -1815,6 +1817,21 @@ struct ipa_set_data_usage_quota_req_msg_v01 { * driver. Making this as list for expandability to support more * APNs in future. */ + + /* Optional */ + /* APN Warning List */ + __u8 apn_warning_list_valid; + /* Must be set to true if apn_warning_list is being passed */ + __u32 apn_warning_list_len; + /* Must be set to # of elements in apn_warning_list */ + struct ipa_data_usage_quota_info_type_v01 + apn_warning_list[QMI_IPA_MAX_APN_V01]; + /* The list of APNs on which a data usage warning to be set on modem + * driver. For now, only one APN monitoring is supported on modem + * driver. Making this as list for expandability to support more + * APNs in future. + */ + }; /* Message */ /* Response Message; Master driver sets a data usage on modem driver. */ @@ -1833,8 +1850,16 @@ struct ipa_data_usage_quota_reached_ind_msg_v01 { /* APN Quota List */ struct ipa_data_usage_quota_info_type_v01 apn; /* This message indicates which APN has the previously set quota - * reached. For now, only one APN monitoring is supported on modem - * driver. + * or warning reached. For now, only one APN monitoring is supported + * on modem driver. + */ + /* Optional */ + /* Warning Limit reached indication */ + /* Must be set to true if is_warning_limit is being passed */ + __u8 is_warning_limit_valid; + __u8 is_warning_limit; + /* If set to TRUE, Warning Limit is reached. + * If set to FALSE, Quota Limit is reached. */ }; /* Message */ @@ -1842,14 +1867,23 @@ struct ipa_data_usage_quota_reached_ind_msg_v01 { * the current data usage quota monitoring session. */ struct ipa_stop_data_usage_quota_req_msg_v01 { - /* This element is a placeholder to prevent the declaration of - * an empty struct. DO NOT USE THIS FIELD UNDER ANY CIRCUMSTANCE - */ - char __placeholder; + /* Optional */ + /* Stop monitoring Quota Limit */ + /* Must be set to true if is_quota_limit is being passed */ + __u8 is_quota_limit_valid; + __u8 is_quota_limit; + /* If set to TRUE, Quota Limit will not be monitored */ + + /* Optional */ + /* Stop monitoring Warning Limit */ + /* Must be set to true if is_warning_limit is being passed */ + __u8 is_warning_limit_valid; + __u8 is_warning_limit; + /* If set to TRUE, Warning Limit will not be monitored */ }; /* Message */ /* Response Message; Master driver request modem driver to terminate - * the current quota monitoring session. + * the current quota or warning limit monitoring session. */ struct ipa_stop_data_usage_quota_resp_msg_v01 { /* Mandatory */ @@ -2754,7 +2788,7 @@ struct ipa_bw_change_ind_msg_v01 { #define QMI_IPA_FILTER_INSTALLED_NOTIF_REQ_MAX_MSG_LEN_V01 1899 #define QMI_IPA_FILTER_INSTALLED_NOTIF_RESP_MAX_MSG_LEN_V01 7 #define QMI_IPA_MASTER_DRIVER_INIT_COMPLETE_IND_MAX_MSG_LEN_V01 7 -#define QMI_IPA_DATA_USAGE_QUOTA_REACHED_IND_MAX_MSG_LEN_V01 15 +#define QMI_IPA_DATA_USAGE_QUOTA_REACHED_IND_MAX_MSG_LEN_V01 19 #define QMI_IPA_ENABLE_FORCE_CLEAR_DATAPATH_REQ_MAX_MSG_LEN_V01 37 @@ -2773,9 +2807,9 @@ struct ipa_bw_change_ind_msg_v01 { #define QMI_IPA_GET_DATA_STATS_RESP_MAX_MSG_LEN_V01 2234 #define QMI_IPA_GET_APN_DATA_STATS_REQ_MAX_MSG_LEN_V01 36 #define QMI_IPA_GET_APN_DATA_STATS_RESP_MAX_MSG_LEN_V01 299 -#define QMI_IPA_SET_DATA_USAGE_QUOTA_REQ_MAX_MSG_LEN_V01 100 +#define QMI_IPA_SET_DATA_USAGE_QUOTA_REQ_MAX_MSG_LEN_V01 200 #define QMI_IPA_SET_DATA_USAGE_QUOTA_RESP_MAX_MSG_LEN_V01 7 -#define QMI_IPA_STOP_DATA_USAGE_QUOTA_REQ_MAX_MSG_LEN_V01 0 +#define QMI_IPA_STOP_DATA_USAGE_QUOTA_REQ_MAX_MSG_LEN_V01 8 #define QMI_IPA_STOP_DATA_USAGE_QUOTA_RESP_MAX_MSG_LEN_V01 7 #define QMI_IPA_INIT_MODEM_DRIVER_CMPLT_REQ_MAX_MSG_LEN_V01 4 diff --git a/include/uapi/linux/msm_ipa.h b/include/uapi/linux/msm_ipa.h index 5b921b8df81f..e47c14f7c7f7 100644 --- a/include/uapi/linux/msm_ipa.h +++ b/include/uapi/linux/msm_ipa.h @@ -787,7 +787,20 @@ enum ipa_mac_flt_event { #define IPA_MAC_FLT_EVENT_MAX IPA_MAC_FLT_EVENT_MAX }; -#define IPA_EVENT_MAX_NUM (IPA_MAC_FLT_EVENT_MAX) +enum ipa_sockv5_event { + IPA_SOCKV5_ADD = IPA_MAC_FLT_EVENT_MAX, + IPA_SOCKV5_DEL, + IPA_SOCKV5_EVENT_MAX +#define IPA_SOCKV5_EVENT_MAX IPA_SOCKV5_EVENT_MAX +}; + +enum ipa_warning_limit_event { + IPA_WARNING_LIMIT_REACHED = IPA_SOCKV5_EVENT_MAX, + IPA_WARNING_LIMIT_EVENT_MAX, +#define IPA_WARNING_LIMIT_EVENT_MAX IPA_WARNING_LIMIT_EVENT_MAX +}; + +#define IPA_EVENT_MAX_NUM (IPA_WARNING_LIMIT_EVENT_MAX) #define IPA_EVENT_MAX ((int)IPA_EVENT_MAX_NUM) /** diff --git a/include/uapi/linux/rmnet_ipa_fd_ioctl.h b/include/uapi/linux/rmnet_ipa_fd_ioctl.h index 61132ade6c2c..453507038c2c 100644 --- a/include/uapi/linux/rmnet_ipa_fd_ioctl.h +++ b/include/uapi/linux/rmnet_ipa_fd_ioctl.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ /* - * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved. */ #ifndef _RMNET_IPA_FD_IOCTL_H @@ -36,6 +36,7 @@ #define WAN_IOCTL_ADD_OFFLOAD_CONNECTION 18 #define WAN_IOCTL_RMV_OFFLOAD_CONNECTION 19 #define WAN_IOCTL_GET_WAN_MTU 20 +#define WAN_IOCTL_SET_DATA_QUOTA_WARNING 21 /* User space may not have this defined. */ #ifndef IFNAMSIZ @@ -76,6 +77,33 @@ struct wan_ioctl_set_data_quota { uint8_t set_quota; }; +/** + * struct wan_ioctl_set_data_quota_warning - structure used for + * WAN_IOCTL_SET_DATA_QUOTA_WARNING IOCTL. + * + * @interface_name: Name of the interface on which to set the quota or + * warning. + * @quota_mbytes: Quota (in Mbytes) for the above interface. + * @set_quota: Indicate whether to set the quota/warning (use 1) or + * unset the quota/warning. + * @set_warning: Indicate whether to set the quota/warning (use 1) or + * unset the quota/warning. + * @warning_mbytes: Warning (in Mbytes) for the above interface. + * @set_warning: Indicate whether to set the warning (use 1) or + * unset the warning. + * + * The structure to be used by the user space in order to request + * a quota to be set on a specific interface (by specifying its name). + */ +struct wan_ioctl_set_data_quota_warning { + char interface_name[IFNAMSIZ]; + uint64_t quota_mbytes; + uint8_t set_quota; + uint8_t set_warning; + uint16_t padding2; + uint64_t warning_mbytes; +}; + struct wan_ioctl_set_tether_client_pipe { /* enum of tether interface */ enum ipacm_client_enum ipa_client; @@ -273,4 +301,8 @@ struct wan_ioctl_query_per_client_stats { #define WAN_IOC_GET_WAN_MTU _IOWR(WAN_IOC_MAGIC, \ WAN_IOCTL_GET_WAN_MTU, \ struct ipa_mtu_info *) + +#define WAN_IOC_SET_DATA_QUOTA_WARNING _IOWR(WAN_IOC_MAGIC, \ + WAN_IOCTL_SET_DATA_QUOTA_WARNING, \ + struct wan_ioctl_set_data_quota_warning) #endif /* _RMNET_IPA_FD_IOCTL_H */