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

Commit c924a35d authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "net: rmnet_data: Fix QMAP ACK's to work with DL checksum offload"

parents 093c5aec a0526444
Loading
Loading
Loading
Loading
+21 −3
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2016, The Linux Foundation. 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
@@ -103,6 +103,7 @@ static uint8_t rmnet_map_do_flow_control(struct sk_buff *skb,
 * rmnet_map_send_ack() - Send N/ACK message for MAP commands
 * @skb: Socket buffer containing the MAP command message
 * @type: N/ACK message selector
 * @config: Physical end-point configuration of ingress device
 *
 * skb is modified to contain the message type selector. The message is then
 * transmitted on skb->dev. Note that this function grabs global Tx lock on
@@ -112,7 +113,8 @@ static uint8_t rmnet_map_do_flow_control(struct sk_buff *skb,
 *      - void
 */
static void rmnet_map_send_ack(struct sk_buff *skb,
			       unsigned char type)
			       unsigned char type,
			       struct rmnet_phys_ep_conf_s *config)
{
	struct rmnet_map_control_command_s *cmd;
	int xmit_status;
@@ -120,6 +122,22 @@ static void rmnet_map_send_ack(struct sk_buff *skb,
	if (unlikely(!skb))
		BUG();

	skb->protocol = htons(ETH_P_MAP);

	if ((config->ingress_data_format & RMNET_INGRESS_FORMAT_MAP_CKSUMV3) ||
	    (config->ingress_data_format & RMNET_INGRESS_FORMAT_MAP_CKSUMV4)) {
		if (unlikely(skb->len < (sizeof(struct rmnet_map_header_s) +
		    + RMNET_MAP_GET_LENGTH(skb)
		    + sizeof(struct rmnet_map_dl_checksum_trailer_s)))) {
			rmnet_stats_dl_checksum(
			  RMNET_MAP_CHECKSUM_ERR_BAD_BUFFER);
			return;
		}

		skb_trim(skb, skb->len -
			 sizeof(struct rmnet_map_dl_checksum_trailer_s));
	}

	cmd = RMNET_MAP_GET_CMD_START(skb);
	cmd->cmd_type = type & 0x03;

@@ -172,6 +190,6 @@ rx_handler_result_t rmnet_map_command(struct sk_buff *skb,
		rc = RMNET_MAP_COMMAND_UNSUPPORTED;
		break;
	}
	rmnet_map_send_ack(skb, rc);
	rmnet_map_send_ack(skb, rc, config);
	return RX_HANDLER_CONSUMED;
}