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

Commit 0a6fdc0f authored by Harout Hedeshian's avatar Harout Hedeshian
Browse files

net: rmnet_data: Add support for guaranteed padding



Added new parameter tail_spacing to
RMNET_NETLINK_SET_LINK_INGRESS_DATA_FORMAT in order to support
an additional fixed padding on packets. Required to support RNDIS
tethering.

CRs-Fixed: 579184
Change-Id: I58bbbfbaa68a28b25a96f52b04165285de9c24ef
Signed-off-by: default avatarHarout Hedeshian <harouth@codeaurora.org>
parent baf64b5d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ struct rmnet_nl_msg_s {
			uint32_t flags;
			uint16_t agg_size;
			uint16_t agg_count;
			uint8_t  tail_spacing;
		} data_format;
		struct {
			uint8_t dev[RMNET_MAX_STR_LEN];
+8 −4
Original line number Diff line number Diff line
@@ -218,9 +218,10 @@ static void _rmnet_netlink_set_link_ingress_data_format
		return;
	}

	resp_rmnet->return_code =
		rmnet_set_ingress_data_format(dev,
					      rmnet_header->data_format.flags);
	resp_rmnet->return_code = rmnet_set_ingress_data_format(
					dev,
					rmnet_header->data_format.flags,
					rmnet_header->data_format.tail_spacing);
	dev_put(dev);
}

@@ -384,6 +385,7 @@ static void _rmnet_netlink_get_link_ingress_data_format
	resp_rmnet->crd = RMNET_NETLINK_MSG_RETURNDATA;
	resp_rmnet->arg_length = RMNET_NL_MSG_SIZE(data_format);
	resp_rmnet->data_format.flags = config->ingress_data_format;
	resp_rmnet->data_format.tail_spacing = config->tail_spacing;
	dev_put(dev);
}

@@ -643,7 +645,8 @@ int rmnet_unassociate_network_device(struct net_device *dev)
 *      - RMNET_CONFIG_UNKNOWN_ERROR net_device private section is null
 */
int rmnet_set_ingress_data_format(struct net_device *dev,
				      uint32_t ingress_data_format)
				  uint32_t ingress_data_format,
				  uint8_t  tail_spacing)
{
	struct rmnet_phys_ep_conf_s *config;
	ASSERT_RTNL();
@@ -659,6 +662,7 @@ int rmnet_set_ingress_data_format(struct net_device *dev,
		return RMNET_CONFIG_INVALID_REQUEST;

	config->ingress_data_format = ingress_data_format;
	config->tail_spacing = tail_spacing;

	return RMNET_CONFIG_OK;
}
+3 −1
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ struct rmnet_phys_ep_conf_s {
	struct sk_buff *agg_skb;
	uint8_t agg_state;
	uint8_t agg_count;
	uint8_t tail_spacing;
};

int rmnet_config_init(void);
@@ -50,7 +51,8 @@ void rmnet_config_exit(void);

int rmnet_unassociate_network_device(struct net_device *dev);
int rmnet_set_ingress_data_format(struct net_device *dev,
				  uint32_t ingress_data_format);
				  uint32_t ingress_data_format,
				  uint8_t  tail_spacing);
int rmnet_set_egress_data_format(struct net_device *dev,
				 uint32_t egress_data_format,
				 uint16_t agg_size,
+3 −1
Original line number Diff line number Diff line
@@ -253,7 +253,9 @@ static rx_handler_result_t _rmnet_map_ingress_handler(struct sk_buff *skb,
	uint16_t len;

	mux_id = RMNET_MAP_GET_MUX_ID(skb);
	len = RMNET_MAP_GET_LENGTH(skb) - RMNET_MAP_GET_PAD(skb);
	len = RMNET_MAP_GET_LENGTH(skb)
			- RMNET_MAP_GET_PAD(skb)
			- config->tail_spacing;

	if (mux_id >= RMNET_DATA_MAX_LOGICAL_EP) {
		LOGD("%s(): Got packet on %s with bad mux id %d\n",
+3 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2014, 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
@@ -108,12 +108,13 @@ struct sk_buff *rmnet_map_deaggregate(struct sk_buff *skb,

	maph = (struct rmnet_map_header_s *) skb->data;
	packet_len = ntohs(maph->pkt_len) + sizeof(struct rmnet_map_header_s);

	if ((((int)skb->len) - ((int)packet_len)) < 0) {
		LOGM("%s(): Got malformed packet. Dropping\n", __func__);
		return 0;
	}

	skbn = skb_copy(skb, GFP_ATOMIC);
	skbn = skb_clone(skb, GFP_ATOMIC);
	if (!skbn)
		return 0;