1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _RMNET_IPA_FD_IOCTL_H 20 #define _RMNET_IPA_FD_IOCTL_H 21 #include <linux/ioctl.h> 22 #include <linux/ipa_qmi_service_v01.h> 23 #include <linux/msm_ipa.h> 24 #define WAN_IOC_MAGIC 0x69 25 #define WAN_IOCTL_ADD_FLT_RULE 0 26 #define WAN_IOCTL_ADD_FLT_INDEX 1 27 #define WAN_IOCTL_VOTE_FOR_BW_MBPS 2 28 #define WAN_IOCTL_POLL_TETHERING_STATS 3 29 #define WAN_IOCTL_SET_DATA_QUOTA 4 30 #define WAN_IOCTL_SET_TETHER_CLIENT_PIPE 5 31 #define WAN_IOCTL_QUERY_TETHER_STATS 6 32 #define WAN_IOCTL_RESET_TETHER_STATS 7 33 #define WAN_IOCTL_QUERY_DL_FILTER_STATS 8 34 #define WAN_IOCTL_ADD_FLT_RULE_EX 9 35 #define WAN_IOCTL_QUERY_TETHER_STATS_ALL 10 36 #define WAN_IOCTL_NOTIFY_WAN_STATE 11 37 #define WAN_IOCTL_ADD_UL_FLT_RULE 12 38 #define WAN_IOCTL_ENABLE_PER_CLIENT_STATS 13 39 #define WAN_IOCTL_QUERY_PER_CLIENT_STATS 14 40 #define WAN_IOCTL_SET_LAN_CLIENT_INFO 15 41 #define WAN_IOCTL_CLEAR_LAN_CLIENT_INFO 16 42 #define WAN_IOCTL_SEND_LAN_CLIENT_MSG 17 43 #ifndef IFNAMSIZ 44 #define IFNAMSIZ 16 45 #endif 46 struct wan_ioctl_poll_tethering_stats { 47 uint64_t polling_interval_secs; 48 uint8_t reset_stats; 49 }; 50 struct wan_ioctl_set_data_quota { 51 char interface_name[IFNAMSIZ]; 52 uint64_t quota_mbytes; 53 uint8_t set_quota; 54 }; 55 struct wan_ioctl_set_tether_client_pipe { 56 enum ipacm_client_enum ipa_client; 57 uint8_t reset_client; 58 uint32_t ul_src_pipe_len; 59 uint32_t ul_src_pipe_list[QMI_IPA_MAX_PIPES_V01]; 60 uint32_t dl_dst_pipe_len; 61 uint32_t dl_dst_pipe_list[QMI_IPA_MAX_PIPES_V01]; 62 }; 63 struct wan_ioctl_query_tether_stats { 64 char upstreamIface[IFNAMSIZ]; 65 char tetherIface[IFNAMSIZ]; 66 enum ipacm_client_enum ipa_client; 67 uint64_t ipv4_tx_packets; 68 uint64_t ipv4_tx_bytes; 69 uint64_t ipv4_rx_packets; 70 uint64_t ipv4_rx_bytes; 71 uint64_t ipv6_tx_packets; 72 uint64_t ipv6_tx_bytes; 73 uint64_t ipv6_rx_packets; 74 uint64_t ipv6_rx_bytes; 75 }; 76 struct wan_ioctl_query_tether_stats_all { 77 char upstreamIface[IFNAMSIZ]; 78 enum ipacm_client_enum ipa_client; 79 uint8_t reset_stats; 80 uint64_t tx_bytes; 81 uint64_t rx_bytes; 82 }; 83 struct wan_ioctl_reset_tether_stats { 84 char upstreamIface[IFNAMSIZ]; 85 uint8_t reset_stats; 86 }; 87 struct wan_ioctl_query_dl_filter_stats { 88 uint8_t reset_stats; 89 struct ipa_get_data_stats_resp_msg_v01 stats_resp; 90 uint32_t index; 91 }; 92 struct wan_ioctl_notify_wan_state { 93 uint8_t up; 94 }; 95 struct wan_ioctl_send_lan_client_msg { 96 struct ipa_lan_client_msg lan_client; 97 enum ipa_per_client_stats_event client_event; 98 }; 99 struct wan_ioctl_lan_client_info { 100 enum ipacm_per_client_device_type device_type; 101 uint8_t mac[IPA_MAC_ADDR_SIZE]; 102 uint8_t client_init; 103 int8_t client_idx; 104 uint8_t hdr_len; 105 enum ipa_client_type ul_src_pipe; 106 }; 107 struct wan_ioctl_per_client_info { 108 uint8_t mac[IPA_MAC_ADDR_SIZE]; 109 uint64_t ipv4_tx_bytes; 110 uint64_t ipv4_rx_bytes; 111 uint64_t ipv6_tx_bytes; 112 uint64_t ipv6_rx_bytes; 113 }; 114 struct wan_ioctl_query_per_client_stats { 115 enum ipacm_per_client_device_type device_type; 116 uint8_t reset_stats; 117 uint8_t disconnect_clnt; 118 uint8_t num_clients; 119 struct wan_ioctl_per_client_info client_info[IPA_MAX_NUM_HW_PATH_CLIENTS]; 120 }; 121 #define WAN_IOC_ADD_FLT_RULE _IOWR(WAN_IOC_MAGIC, WAN_IOCTL_ADD_FLT_RULE, struct ipa_install_fltr_rule_req_msg_v01 *) 122 #define WAN_IOC_ADD_FLT_RULE_INDEX _IOWR(WAN_IOC_MAGIC, WAN_IOCTL_ADD_FLT_INDEX, struct ipa_fltr_installed_notif_req_msg_v01 *) 123 #define WAN_IOC_VOTE_FOR_BW_MBPS _IOWR(WAN_IOC_MAGIC, WAN_IOCTL_VOTE_FOR_BW_MBPS, uint32_t *) 124 #define WAN_IOC_POLL_TETHERING_STATS _IOWR(WAN_IOC_MAGIC, WAN_IOCTL_POLL_TETHERING_STATS, struct wan_ioctl_poll_tethering_stats *) 125 #define WAN_IOC_SET_DATA_QUOTA _IOWR(WAN_IOC_MAGIC, WAN_IOCTL_SET_DATA_QUOTA, struct wan_ioctl_set_data_quota *) 126 #define WAN_IOC_SET_TETHER_CLIENT_PIPE _IOWR(WAN_IOC_MAGIC, WAN_IOCTL_SET_TETHER_CLIENT_PIPE, struct wan_ioctl_set_tether_client_pipe *) 127 #define WAN_IOC_QUERY_TETHER_STATS _IOWR(WAN_IOC_MAGIC, WAN_IOCTL_QUERY_TETHER_STATS, struct wan_ioctl_query_tether_stats *) 128 #define WAN_IOC_RESET_TETHER_STATS _IOWR(WAN_IOC_MAGIC, WAN_IOCTL_RESET_TETHER_STATS, struct wan_ioctl_reset_tether_stats *) 129 #define WAN_IOC_QUERY_DL_FILTER_STATS _IOWR(WAN_IOC_MAGIC, WAN_IOCTL_QUERY_DL_FILTER_STATS, struct wan_ioctl_query_dl_filter_stats *) 130 #define WAN_IOC_ADD_FLT_RULE_EX _IOWR(WAN_IOC_MAGIC, WAN_IOCTL_ADD_FLT_RULE_EX, struct ipa_install_fltr_rule_req_ex_msg_v01 *) 131 #define WAN_IOC_QUERY_TETHER_STATS_ALL _IOWR(WAN_IOC_MAGIC, WAN_IOCTL_QUERY_TETHER_STATS_ALL, struct wan_ioctl_query_tether_stats_all *) 132 #define WAN_IOC_NOTIFY_WAN_STATE _IOWR(WAN_IOC_MAGIC, WAN_IOCTL_NOTIFY_WAN_STATE, struct wan_ioctl_notify_wan_state *) 133 #define WAN_IOC_ADD_UL_FLT_RULE _IOWR(WAN_IOC_MAGIC, WAN_IOCTL_ADD_UL_FLT_RULE, struct ipa_configure_ul_firewall_rules_req_msg_v01 *) 134 #define WAN_IOC_ENABLE_PER_CLIENT_STATS _IOWR(WAN_IOC_MAGIC, WAN_IOCTL_ENABLE_PER_CLIENT_STATS, bool *) 135 #define WAN_IOC_QUERY_PER_CLIENT_STATS _IOWR(WAN_IOC_MAGIC, WAN_IOCTL_QUERY_PER_CLIENT_STATS, struct wan_ioctl_query_per_client_stats *) 136 #define WAN_IOC_SET_LAN_CLIENT_INFO _IOWR(WAN_IOC_MAGIC, WAN_IOCTL_SET_LAN_CLIENT_INFO, struct wan_ioctl_lan_client_info *) 137 #define WAN_IOC_SEND_LAN_CLIENT_MSG _IOWR(WAN_IOC_MAGIC, WAN_IOCTL_SEND_LAN_CLIENT_MSG, struct wan_ioctl_send_lan_client_msg *) 138 #define WAN_IOC_CLEAR_LAN_CLIENT_INFO _IOWR(WAN_IOC_MAGIC, WAN_IOCTL_CLEAR_LAN_CLIENT_INFO, struct wan_ioctl_lan_client_info *) 139 #endif 140 141