Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2fbb3010 authored by Subash Abhinov Kasiviswanathan's avatar Subash Abhinov Kasiviswanathan
Browse files

net: rmnet_data: Stop adding pad bytes for MAPv4 uplink packets



Hardware does not handle pad bytes in egress packets when uplink
aggregation is not enabled. This is due to the translation support
added on hardware for MAPv4.

Change-Id: Ic246a4548561450035d5252221032d72eff44518
Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
parent f81d0b1f
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -480,7 +480,13 @@ static int rmnet_map_egress_handler(struct sk_buff *skb,
		rmnet_stats_ul_checksum(ckresult);
	}

	map_header = rmnet_map_add_map_header(skb, additional_header_length);
	if ((config->egress_data_format & RMNET_EGRESS_FORMAT_MAP_CKSUMV4) &&
	    (!(config->egress_data_format & RMNET_EGRESS_FORMAT_AGGREGATION)))
		map_header = rmnet_map_add_map_header
		(skb, additional_header_length, RMNET_MAP_NO_PAD_BYTES);
	else
		map_header = rmnet_map_add_map_header
		(skb, additional_header_length, RMNET_MAP_ADD_PAD_BYTES);

	if (!map_header) {
		LOGD("%s", "Failed to add MAP header to egress packet");
+4 −1
Original line number Diff line number Diff line
@@ -128,12 +128,15 @@ enum rmnet_map_agg_state_e {
#define RMNET_MAP_COMMAND_UNSUPPORTED 2
#define RMNET_MAP_COMMAND_INVALID     3

#define RMNET_MAP_NO_PAD_BYTES        0
#define RMNET_MAP_ADD_PAD_BYTES       1

uint8_t rmnet_map_demultiplex(struct sk_buff *skb);
struct sk_buff *rmnet_map_deaggregate(struct sk_buff *skb,
				      struct rmnet_phys_ep_conf_s *config);

struct rmnet_map_header_s *rmnet_map_add_map_header(struct sk_buff *skb,
						    int hdrlen);
						    int hdrlen, int pad);
rx_handler_result_t rmnet_map_command(struct sk_buff *skb,
				      struct rmnet_phys_ep_conf_s *config);
void rmnet_map_aggregate(struct sk_buff *skb,
+8 −1
Original line number Diff line number Diff line
@@ -64,6 +64,8 @@ struct agg_work {
 * @skb:        Socket buffer ("packet") to modify
 * @hdrlen:     Number of bytes of header data which should not be included in
 *              MAP length field
 * @pad:        Specify if padding the MAP packet to make it 4 byte aligned is
 *              necessary
 *
 * Padding is calculated and set appropriately in MAP header. Mux ID is
 * initialized to 0.
@@ -76,7 +78,7 @@ struct agg_work {
 * todo: Parameterize skb alignment
 */
struct rmnet_map_header_s *rmnet_map_add_map_header(struct sk_buff *skb,
						    int hdrlen)
						    int hdrlen, int pad)
{
	uint32_t padding, map_datalen;
	uint8_t *padbytes;
@@ -90,6 +92,11 @@ struct rmnet_map_header_s *rmnet_map_add_map_header(struct sk_buff *skb,
			skb_push(skb, sizeof(struct rmnet_map_header_s));
	memset(map_header, 0, sizeof(struct rmnet_map_header_s));

	if (pad == RMNET_MAP_NO_PAD_BYTES) {
		map_header->pkt_len = htons(map_datalen);
		return map_header;
	}

	padding = ALIGN(map_datalen, 4) - map_datalen;

	if (skb_tailroom(skb) < padding)