net: rmnet_data: Move MAP header definition to UAPI
Expose the MAP header to the rest of the kernel and user space. Useful for making various parts of the kernel MAP aware. Keeping consistency with other networking procols by exposing protocol headers to user space with a header file in UAPI. CRs-Fixed: 681280 Change-Id: Ic7f414f926f68531418725f971ab2b44459f5ea1 Signed-off-by: Harout Hedeshian <harouth@codeaurora.org> [subashab@codeaurora.org: resolve trivial merge conflicts] Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
This commit is contained in:
parent
95106c070a
commit
4d6ec5cecc
7 changed files with 33 additions and 23 deletions
|
@ -288,6 +288,7 @@ header-y += neighbour.h
|
|||
header-y += netconf.h
|
||||
header-y += netdevice.h
|
||||
header-y += net_dropmon.h
|
||||
header-y += net_map.h
|
||||
header-y += netfilter_arp.h
|
||||
header-y += netfilter_bridge.h
|
||||
header-y += netfilter_decnet.h
|
||||
|
|
27
include/uapi/linux/net_map.h
Normal file
27
include/uapi/linux/net_map.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
#ifndef _NET_MAP_H_
|
||||
#define _NET_MAP_H_
|
||||
|
||||
struct rmnet_map_header_s {
|
||||
#ifndef RMNET_USE_BIG_ENDIAN_STRUCTS
|
||||
uint8_t pad_len:6;
|
||||
uint8_t reserved_bit:1;
|
||||
uint8_t cd_bit:1;
|
||||
#else
|
||||
uint8_t cd_bit:1;
|
||||
uint8_t reserved_bit:1;
|
||||
uint8_t pad_len:6;
|
||||
#endif /* RMNET_USE_BIG_ENDIAN_STRUCTS */
|
||||
uint8_t mux_id;
|
||||
uint16_t pkt_len;
|
||||
} __aligned(1);
|
||||
|
||||
#define RMNET_MAP_GET_MUX_ID(Y) (((struct rmnet_map_header_s *)Y->data)->mux_id)
|
||||
#define RMNET_MAP_GET_CD_BIT(Y) (((struct rmnet_map_header_s *)Y->data)->cd_bit)
|
||||
#define RMNET_MAP_GET_PAD(Y) (((struct rmnet_map_header_s *)Y->data)->pad_len)
|
||||
#define RMNET_MAP_GET_CMD_START(Y) ((struct rmnet_map_control_command_s *) \
|
||||
(Y->data + sizeof(struct rmnet_map_header_s)))
|
||||
#define RMNET_MAP_GET_LENGTH(Y) (ntohs( \
|
||||
((struct rmnet_map_header_s *)Y->data)->pkt_len))
|
||||
|
||||
|
||||
#endif /* _NET_MAP_H_ */
|
|
@ -18,6 +18,7 @@
|
|||
#include <linux/netdevice.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/rmnet_data.h>
|
||||
#include <linux/net_map.h>
|
||||
#include "rmnet_data_private.h"
|
||||
#include "rmnet_data_config.h"
|
||||
#include "rmnet_data_vnd.h"
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <linux/spinlock.h>
|
||||
#include <net/pkt_sched.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/net_map.h>
|
||||
#include "rmnet_data_config.h"
|
||||
#include "rmnet_data_handlers.h"
|
||||
#include "rmnet_data_private.h"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* 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
|
||||
|
@ -17,20 +17,6 @@
|
|||
#ifndef _RMNET_MAP_H_
|
||||
#define _RMNET_MAP_H_
|
||||
|
||||
struct rmnet_map_header_s {
|
||||
#ifndef RMNET_USE_BIG_ENDIAN_STRUCTS
|
||||
uint8_t pad_len:6;
|
||||
uint8_t reserved_bit:1;
|
||||
uint8_t cd_bit:1;
|
||||
#else
|
||||
uint8_t cd_bit:1;
|
||||
uint8_t reserved_bit:1;
|
||||
uint8_t pad_len:6;
|
||||
#endif /* RMNET_USE_BIG_ENDIAN_STRUCTS */
|
||||
uint8_t mux_id;
|
||||
uint16_t pkt_len;
|
||||
} __aligned(1);
|
||||
|
||||
struct rmnet_map_control_command_s {
|
||||
uint8_t command_name;
|
||||
#ifndef RMNET_USE_BIG_ENDIAN_STRUCTS
|
||||
|
@ -117,14 +103,6 @@ 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);
|
||||
|
||||
#define RMNET_MAP_GET_MUX_ID(Y) (((struct rmnet_map_header_s *)Y->data)->mux_id)
|
||||
#define RMNET_MAP_GET_CD_BIT(Y) (((struct rmnet_map_header_s *)Y->data)->cd_bit)
|
||||
#define RMNET_MAP_GET_PAD(Y) (((struct rmnet_map_header_s *)Y->data)->pad_len)
|
||||
#define RMNET_MAP_GET_CMD_START(Y) ((struct rmnet_map_control_command_s *) \
|
||||
(Y->data + sizeof(struct rmnet_map_header_s)))
|
||||
#define RMNET_MAP_GET_LENGTH(Y) (ntohs( \
|
||||
((struct rmnet_map_header_s *)Y->data)->pkt_len))
|
||||
|
||||
struct rmnet_map_header_s *rmnet_map_add_map_header(struct sk_buff *skb,
|
||||
int hdrlen);
|
||||
rx_handler_result_t rmnet_map_command(struct sk_buff *skb,
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <linux/skbuff.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/rmnet_data.h>
|
||||
#include <linux/net_map.h>
|
||||
#include <net/pkt_sched.h>
|
||||
#include "rmnet_data_config.h"
|
||||
#include "rmnet_map.h"
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include <linux/rmnet_data.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/net_map.h>
|
||||
#include "rmnet_data_config.h"
|
||||
#include "rmnet_map.h"
|
||||
#include "rmnet_data_private.h"
|
||||
|
|
Loading…
Add table
Reference in a new issue