diff options
Diffstat (limited to 'drivers/net/ipa/ipa_endpoint.c')
-rw-r--r-- | drivers/net/ipa/ipa_endpoint.c | 53 |
1 files changed, 10 insertions, 43 deletions
diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index b7efd7c95e9c..b40b711cf4bd 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -42,11 +42,8 @@ /** enum ipa_status_opcode - status element opcode hardware values */ enum ipa_status_opcode { IPA_STATUS_OPCODE_PACKET = 0x01, - IPA_STATUS_OPCODE_NEW_FRAG_RULE = 0x02, IPA_STATUS_OPCODE_DROPPED_PACKET = 0x04, IPA_STATUS_OPCODE_SUSPENDED_PACKET = 0x08, - IPA_STATUS_OPCODE_LOG = 0x10, - IPA_STATUS_OPCODE_DCMP = 0x20, IPA_STATUS_OPCODE_PACKET_2ND_PASS = 0x40, }; @@ -54,13 +51,6 @@ enum ipa_status_opcode { enum ipa_status_exception { /* 0 means no exception */ IPA_STATUS_EXCEPTION_DEAGGR = 0x01, - IPA_STATUS_EXCEPTION_IPTYPE = 0x04, - IPA_STATUS_EXCEPTION_PACKET_LENGTH = 0x08, - IPA_STATUS_EXCEPTION_FRAG_RULE_MISS = 0x10, - IPA_STATUS_EXCEPTION_SW_FILT = 0x20, - /* The meaning of the next value depends on whether the IP version */ - IPA_STATUS_EXCEPTION_NAT = 0x40, /* IPv4 */ - IPA_STATUS_EXCEPTION_IPV6CT = IPA_STATUS_EXCEPTION_NAT, }; /* Status element provided by hardware */ @@ -79,36 +69,9 @@ struct ipa_status { }; /* Field masks for struct ipa_status structure fields */ - -#define IPA_STATUS_SRC_IDX_FMASK GENMASK(4, 0) - #define IPA_STATUS_DST_IDX_FMASK GENMASK(4, 0) - -#define IPA_STATUS_FLAGS1_FLT_LOCAL_FMASK GENMASK(0, 0) -#define IPA_STATUS_FLAGS1_FLT_HASH_FMASK GENMASK(1, 1) -#define IPA_STATUS_FLAGS1_FLT_GLOBAL_FMASK GENMASK(2, 2) -#define IPA_STATUS_FLAGS1_FLT_RET_HDR_FMASK GENMASK(3, 3) -#define IPA_STATUS_FLAGS1_FLT_RULE_ID_FMASK GENMASK(13, 4) -#define IPA_STATUS_FLAGS1_RT_LOCAL_FMASK GENMASK(14, 14) -#define IPA_STATUS_FLAGS1_RT_HASH_FMASK GENMASK(15, 15) -#define IPA_STATUS_FLAGS1_UCP_FMASK GENMASK(16, 16) -#define IPA_STATUS_FLAGS1_RT_TBL_IDX_FMASK GENMASK(21, 17) #define IPA_STATUS_FLAGS1_RT_RULE_ID_FMASK GENMASK(31, 22) -#define IPA_STATUS_FLAGS2_NAT_HIT_FMASK GENMASK_ULL(0, 0) -#define IPA_STATUS_FLAGS2_NAT_ENTRY_IDX_FMASK GENMASK_ULL(13, 1) -#define IPA_STATUS_FLAGS2_NAT_TYPE_FMASK GENMASK_ULL(15, 14) -#define IPA_STATUS_FLAGS2_TAG_INFO_FMASK GENMASK_ULL(63, 16) - -#define IPA_STATUS_FLAGS3_SEQ_NUM_FMASK GENMASK(7, 0) -#define IPA_STATUS_FLAGS3_TOD_CTR_FMASK GENMASK(31, 8) - -#define IPA_STATUS_FLAGS4_HDR_LOCAL_FMASK GENMASK(0, 0) -#define IPA_STATUS_FLAGS4_HDR_OFFSET_FMASK GENMASK(10, 1) -#define IPA_STATUS_FLAGS4_FRAG_HIT_FMASK GENMASK(11, 11) -#define IPA_STATUS_FLAGS4_FRAG_RULE_FMASK GENMASK(15, 12) -#define IPA_STATUS_FLAGS4_HW_SPECIFIC_FMASK GENMASK(31, 16) - #ifdef IPA_VALIDATE static void ipa_endpoint_validate_build(void) @@ -1048,8 +1011,7 @@ static bool ipa_endpoint_skb_build(struct ipa_endpoint *endpoint, } /* The format of a packet status element is the same for several status - * types (opcodes). The NEW_FRAG_RULE, LOG, DCMP (decompression) types - * aren't currently supported + * types (opcodes). Other types aren't currently supported. */ static bool ipa_status_format_packet(enum ipa_status_opcode opcode) { @@ -1086,7 +1048,7 @@ static bool ipa_status_drop_packet(const struct ipa_status *status) { u32 val; - /* Deaggregation exceptions we drop; others we consume */ + /* Deaggregation exceptions we drop; all other types we consume */ if (status->exception) return status->exception == IPA_STATUS_EXCEPTION_DEAGGR; @@ -1432,11 +1394,10 @@ void ipa_endpoint_suspend_one(struct ipa_endpoint *endpoint) if (!(endpoint->ipa->enabled & BIT(endpoint->endpoint_id))) return; - if (!endpoint->toward_ipa) + if (!endpoint->toward_ipa) { ipa_endpoint_replenish_disable(endpoint); - - if (!endpoint->toward_ipa) (void)ipa_endpoint_program_suspend(endpoint, true); + } /* IPA v3.5.1 doesn't use channel stop for suspend */ stop_channel = endpoint->ipa->version != IPA_VERSION_3_5_1; @@ -1471,6 +1432,9 @@ void ipa_endpoint_resume_one(struct ipa_endpoint *endpoint) void ipa_endpoint_suspend(struct ipa *ipa) { + if (!ipa->setup_complete) + return; + if (ipa->modem_netdev) ipa_modem_suspend(ipa->modem_netdev); @@ -1482,6 +1446,9 @@ void ipa_endpoint_suspend(struct ipa *ipa) void ipa_endpoint_resume(struct ipa *ipa) { + if (!ipa->setup_complete) + return; + ipa_endpoint_resume_one(ipa->name_map[IPA_ENDPOINT_AP_COMMAND_TX]); ipa_endpoint_resume_one(ipa->name_map[IPA_ENDPOINT_AP_LAN_RX]); |