diff options
author | Subash Abhinov Kasiviswanathan <quic_subashab@quicinc.com> | 2022-05-06 01:39:38 -0700 |
---|---|---|
committer | Subash Abhinov Kasiviswanathan <quic_subashab@quicinc.com> | 2022-06-06 12:45:10 -0600 |
commit | b17551895013963ea9de5179ffb7408dbfa8d484 (patch) | |
tree | 3f479ab30decbcb202522dc1f020925d70e8ebbc | |
parent | 6d889c5e92eeb7c6c609c47b449539424d90ed24 (diff) | |
download | data-kernel-b17551895013963ea9de5179ffb7408dbfa8d484.tar.gz |
core: Add mapv5 command changes
Add support for the new mapv5 command format which has to be
used for commands on default channel on uplink. mapv1 commands need
to be sent on the command channel only on uplink.
Additionally, update the dfc trace print format.
CRs-Fixed: 3214110
Change-Id: Ifed7d90d79b6f17d4104a26907667801f04040ce
Signed-off-by: Subash Abhinov Kasiviswanathan <quic_subashab@quicinc.com>
-rw-r--r-- | core/dfc.h | 12 | ||||
-rw-r--r-- | core/dfc_qmap.c | 48 | ||||
-rw-r--r-- | core/rmnet_qmap.c | 6 |
3 files changed, 47 insertions, 19 deletions
@@ -1,4 +1,5 @@ /* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -248,25 +249,28 @@ TRACE_EVENT(dfc_tx_link_status_ind, TRACE_EVENT(dfc_qmap, - TP_PROTO(const void *data, size_t len, bool in), + TP_PROTO(const void *data, size_t len, bool in, u8 chn), - TP_ARGS(data, len, in), + TP_ARGS(data, len, in, chn), TP_STRUCT__entry( __field(bool, in) __field(size_t, len) __dynamic_array(u8, data, len) + __field(u8, chn) ), TP_fast_assign( __entry->in = in; __entry->len = len; memcpy(__get_dynamic_array(data), data, len); + __entry->chn = chn; ), - TP_printk("%s [%s]", + TP_printk("[0x%02x] %s %s", __entry->chn, __entry->in ? "<--" : "-->", - __print_hex(__get_dynamic_array(data), __entry->len)) + __print_array(__get_dynamic_array(data), __entry->len, + sizeof(u8))) ); TRACE_EVENT(dfc_adjust_grant, diff --git a/core/dfc_qmap.c b/core/dfc_qmap.c index 6412ffc..0c2ff86 100644 --- a/core/dfc_qmap.c +++ b/core/dfc_qmap.c @@ -11,6 +11,7 @@ #include "rmnet_qmi.h" #include "qmi_rmnet.h" #include "dfc.h" +#include "rmnet_map.h" #define QMAP_DFC_VER 1 @@ -91,6 +92,31 @@ struct qmap_dfc_end_marker_cnf { u32 reserved4; } __aligned(1); +struct qmapv5_cmd_hdr { + u8 pad_len:6; + u8 next_hdr:1; + u8 cd_bit:1; + u8 mux_id; + __be16 pkt_len; + struct rmnet_map_v5_csum_header csum_hdr; + u8 cmd_name; + u8 cmd_type:2; + u8 reserved:6; + u16 reserved2; + __be32 tx_id; +} __aligned(1); + +struct qmapv5_dfc_end_marker_cnf { + struct qmapv5_cmd_hdr hdr; + u8 cmd_ver; + u8 reserved; + u8 bearer_id; + u8 reserved2; + u16 reserved3; + __be16 seq_num; + u32 reserved4; +} __aligned(1); + struct qmap_dfc_powersave_req { struct qmap_cmd_hdr hdr; u8 cmd_ver; @@ -254,7 +280,6 @@ static int dfc_qmap_handle_end_marker_req(struct dfc_qmi_data *dfc, return QMAP_CMD_INVALID; cmd = (struct qmap_dfc_end_marker_req *)skb->data; - return dfc_qmap_set_end_marker(dfc, cmd->hdr.mux_id, cmd->bearer_id, ntohs(cmd->seq_num), ntohl(cmd->hdr.tx_id)); @@ -372,19 +397,23 @@ static void dfc_qmap_send_end_marker_cnf(struct qos_info *qos, u16 seq, u32 tx_id) { struct sk_buff *skb; - struct qmap_dfc_end_marker_cnf *em_cnf; - unsigned int len = sizeof(struct qmap_dfc_end_marker_cnf); + struct qmapv5_dfc_end_marker_cnf *em_cnf; + unsigned int len = sizeof(struct qmapv5_dfc_end_marker_cnf); skb = alloc_skb(len, GFP_ATOMIC); if (!skb) return; - em_cnf = (struct qmap_dfc_end_marker_cnf *)skb_put(skb, len); + em_cnf = (struct qmapv5_dfc_end_marker_cnf *)skb_put(skb, len); memset(em_cnf, 0, len); em_cnf->hdr.cd_bit = 1; + em_cnf->hdr.next_hdr = 1; em_cnf->hdr.mux_id = qos->mux_id; - em_cnf->hdr.pkt_len = htons(len - QMAP_HDR_LEN); + em_cnf->hdr.pkt_len = htons(len - + (QMAP_HDR_LEN + + sizeof(struct rmnet_map_v5_csum_header))); + em_cnf->hdr.csum_hdr.header_type = RMNET_MAP_HEADER_TYPE_CSUM_OFFLOAD; em_cnf->hdr.cmd_name = QMAP_DFC_END_MARKER; em_cnf->hdr.cmd_type = QMAP_CMD_ACK; em_cnf->hdr.tx_id = htonl(tx_id); @@ -393,14 +422,7 @@ static void dfc_qmap_send_end_marker_cnf(struct qos_info *qos, em_cnf->bearer_id = bearer->bearer_id; em_cnf->seq_num = htons(seq); - /* This cmd needs to be sent in-band after data on the currnet - * channel. But due to IPA bug, it cannot be sent over LLC so send - * it over QMAP channel if current channel is LLC. - */ - if (bearer->ch_switch.current_ch == RMNET_CH_DEFAULT) - rmnet_qmap_send(skb, bearer->ch_switch.current_ch, true); - else - rmnet_qmap_send(skb, RMNET_CH_CTL, false); + rmnet_qmap_send(skb, bearer->ch_switch.current_ch, true); } static int dfc_qmap_send_powersave(u8 enable, u8 num_bearers, u8 *bearer_id) diff --git a/core/rmnet_qmap.c b/core/rmnet_qmap.c index d838297..8f61f46 100644 --- a/core/rmnet_qmap.c +++ b/core/rmnet_qmap.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -24,7 +25,7 @@ static struct rmnet_ctl_client_if *rmnet_ctl; int rmnet_qmap_send(struct sk_buff *skb, u8 ch, bool flush) { - trace_dfc_qmap(skb->data, skb->len, false); + trace_dfc_qmap(skb->data, skb->len, false, ch); if (ch != RMNET_CH_CTL && real_data_dev) { skb->protocol = htons(ETH_P_MAP); @@ -43,6 +44,7 @@ int rmnet_qmap_send(struct sk_buff *skb, u8 ch, bool flush) return 0; } +EXPORT_SYMBOL(rmnet_qmap_send); static void rmnet_qmap_cmd_handler(struct sk_buff *skb) { @@ -52,7 +54,7 @@ static void rmnet_qmap_cmd_handler(struct sk_buff *skb) if (!skb) return; - trace_dfc_qmap(skb->data, skb->len, true); + trace_dfc_qmap(skb->data, skb->len, true, RMNET_CH_CTL); if (skb->len < sizeof(struct qmap_cmd_hdr)) goto free_skb; |