msm: ipa: Add QMI messages for moving NAT table

Add interface for receiving QMI request to move
NAT table to DDR or to SRAM and forward request to IPACM.
Add IOCTL for sending indication when move was completed.

Change-Id: Idb886a56586d830664a25371d48d2fac5a5e51c5
Signed-off-by: Amir Levy <alevy@codeaurora.org>
This commit is contained in:
Amir Levy 2021-05-05 09:14:24 +03:00
parent 4917e4483b
commit c1e7bf5f14
3 changed files with 63 additions and 1 deletions

View File

@ -2751,6 +2751,54 @@ struct ipa_bw_change_ind_msg_v01 {
}; /* Message */
#define IPA_BW_CHANGE_IND_MSG_V01_MAX_MSG_LEN 14
enum ipa_move_nat_type_enum_v01 {
QMI_IPA_MOVE_NAT_TO_DDR_V01 = 0,
QMI_IPA_MOVE_NAT_TO_SRAM_V01 = 1,
};
/*
* Request Message; Requestes remote IPA driver to move IPA NAT table
* according to requested direction TO_DDR\TO_SRAM.
*/
struct ipa_move_nat_req_msg_v01 {
enum ipa_move_nat_type_enum_v01 nat_move_direction;
};
#define IPA_MOVE_NAT_REQ_MSG_V01_MAX_MSG_LEN 8
/*
* Response Message; Requestes remote IPA driver to move IPA NAT table
* according to requested direction TO_DDR\TO_SRAM.
*/
struct ipa_move_nat_resp_msg_v01 {
/* Mandatory */
/* Result Code */
struct ipa_qmi_response_type_v01 resp;
/*
* Standard response type.
* Standard response type. Contains the following data members:
* qmi_result_type -- QMI_RESULT_SUCCESS or QMI_RESULT_FAILURE
* qmi_error_type -- Error code. Possible error code values are
* described in the error codes section of each message definition.
*/
}; /* Message */
#define IPA_MOVE_NAT_RESP_MSG_V01_MAX_MSG_LEN 7
/* Indication Message; Indication sent to the Modem IPA driver from
* master IPA driver about NAT table move result.
*/
struct ipa_move_nat_table_complt_ind_msg_v01 {
/* Mandatory */
/* Master driver initialization completion status */
struct ipa_qmi_response_type_v01 nat_table_move_status;
/* Indicates the status of nat table mvoe. If everything went
* as expected, this field is set to SUCCESS. ERROR is set
* otherwise. Extended error info may be used to convey
* additional information about the error
*/
}; /* Message */
#define QMI_IPA_NAT_TABLE_MOVE_COMPLETE_IND_MAX_MSG_LEN_V01 7
/*Service Message Definition*/
#define QMI_IPA_INDICATION_REGISTER_REQ_V01 0x0020
#define QMI_IPA_INDICATION_REGISTER_RESP_V01 0x0020
@ -2806,6 +2854,9 @@ struct ipa_bw_change_ind_msg_v01 {
#define QMI_IPA_REMOVE_OFFLOAD_CONNECTION_REQ_V01 0x0042
#define QMI_IPA_REMOVE_OFFLOAD_CONNECTION_RESP_V01 0x0042
#define QMI_IPA_BW_CHANGE_INDICATION_V01 0x0044
#define QMI_IPA_MOVE_NAT_REQ_V01 0x0046
#define QMI_IPA_MOVE_NAT_RESP_V01 0x0046
#define QMI_IPA_MOVE_NAT_COMPLETE_IND_V01 0x0046
/* add for max length*/
#define QMI_IPA_INIT_MODEM_DRIVER_REQ_MAX_MSG_LEN_V01 186

View File

@ -831,7 +831,13 @@ enum ipa_pkt_threshold_event {
#define IPA_PKT_THRESHOLD_EVENT_MAX IPA_PKT_THRESHOLD_EVENT_MAX
};
#define IPA_EVENT_MAX_NUM (IPA_PKT_THRESHOLD_EVENT_MAX)
enum ipa_move_nat_table_event {
IPA_MOVE_NAT_TABLE = IPA_PKT_THRESHOLD_EVENT_MAX,
IPA_MOVE_NAT_EVENT_MAX
#define IPA_MOVE_NAT_EVENT_MAX IPA_MOVE_NAT_EVENT_MAX
};
#define IPA_EVENT_MAX_NUM (IPA_MOVE_NAT_EVENT_MAX)
#define IPA_EVENT_MAX ((int)IPA_EVENT_MAX_NUM)
/**

View File

@ -37,6 +37,7 @@
#define WAN_IOCTL_RMV_OFFLOAD_CONNECTION 19
#define WAN_IOCTL_GET_WAN_MTU 20
#define WAN_IOCTL_SET_DATA_QUOTA_WARNING 21
#define WAN_IOCTL_NOTIFY_NAT_MOVE_RES 22
/* User space may not have this defined. */
#ifndef IFNAMSIZ
@ -305,4 +306,8 @@ struct wan_ioctl_query_per_client_stats {
#define WAN_IOC_SET_DATA_QUOTA_WARNING _IOWR(WAN_IOC_MAGIC, \
WAN_IOCTL_SET_DATA_QUOTA_WARNING, \
struct wan_ioctl_set_data_quota_warning)
#define WAN_IOC_NOTIFY_NAT_MOVE_RES _IOWR(WAN_IOC_MAGIC, \
WAN_IOCTL_NOTIFY_NAT_MOVE_RES, \
bool)
#endif /* _RMNET_IPA_FD_IOCTL_H */