msm: ipc: Support multi-platform

Upstream prefers existing drivers be converted to support multiplatform
kernels.  This requires drivers to be located in generic functionality
directories instead of specific mach directories.

Move IPC Router Core and Security drivers to the net/ipc_router location
to support multi-platform.

Move IPC Router SMD & HSIC transport(XPRT) drivers to the drivers/soc/qcom
location.

Change-Id: I770227f66dcb776b26086426f509568f991db757
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
This commit is contained in:
Karthikeyan Ramasubramanian 2014-01-02 12:34:19 -07:00
parent 416e5ce5f9
commit ab9df0516e
30 changed files with 261 additions and 225 deletions

View File

@ -44,10 +44,7 @@ CONFIG_MSM_SMD=y
CONFIG_MSM_PCIE=y
CONFIG_MSM_SMP2P=y
CONFIG_MSM_SMP2P_TEST=y
CONFIG_MSM_IPC_ROUTER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_MSM_IPC_ROUTER_HSIC_XPRT=y
CONFIG_MSM_IPC_ROUTER_SECURITY=y
CONFIG_EXTERNAL_MDM=y
CONFIG_MSM_QMI_INTERFACE=y
CONFIG_MSM_SUBSYSTEM_RESTART=y
CONFIG_MSM_SYSMON_COMM=y
@ -64,6 +61,8 @@ CONFIG_MSM_DLOAD_MODE=y
CONFIG_MSM_JTAG=y
CONFIG_MSM_RUN_QUEUE_STATS=y
CONFIG_MSM_ADSP_LOADER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_MSM_IPC_ROUTER_HSIC_XPRT=y
CONFIG_MSM_OCMEM=y
CONFIG_MSM_OCMEM_LOCAL_POWER_CTRL=y
CONFIG_MSM_OCMEM_DEBUG=y
@ -240,6 +239,8 @@ CONFIG_CFG80211=y
CONFIG_CFG80211_INTERNAL_REGDB=y
CONFIG_RFKILL=y
CONFIG_NFC_QNCI=y
CONFIG_IPC_ROUTER=y
CONFIG_IPC_ROUTER_SECURITY=y
CONFIG_CMA=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y

View File

@ -43,10 +43,7 @@ CONFIG_MSM_SMD=y
CONFIG_MSM_PCIE=y
CONFIG_MSM_SMP2P=y
CONFIG_MSM_SMP2P_TEST=y
CONFIG_MSM_IPC_ROUTER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_MSM_IPC_ROUTER_HSIC_XPRT=y
CONFIG_MSM_IPC_ROUTER_SECURITY=y
CONFIG_EXTERNAL_MDM=y
CONFIG_MSM_QMI_INTERFACE=y
CONFIG_MSM_SUBSYSTEM_RESTART=y
CONFIG_MSM_SYSMON_COMM=y
@ -62,6 +59,8 @@ CONFIG_MSM_MEMORY_DUMP=y
CONFIG_MSM_DLOAD_MODE=y
CONFIG_MSM_RUN_QUEUE_STATS=y
CONFIG_MSM_ADSP_LOADER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_MSM_IPC_ROUTER_HSIC_XPRT=y
CONFIG_MSM_OCMEM=y
CONFIG_MSM_OCMEM_LOCAL_POWER_CTRL=y
CONFIG_MSM_OCMEM_DEBUG=y
@ -242,6 +241,8 @@ CONFIG_CFG80211=y
CONFIG_CFG80211_INTERNAL_REGDB=y
CONFIG_RFKILL=y
CONFIG_NFC_QNCI=y
CONFIG_IPC_ROUTER=y
CONFIG_IPC_ROUTER_SECURITY=y
CONFIG_CMA=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y

View File

@ -43,8 +43,6 @@ CONFIG_MSM_MPM_OF=y
CONFIG_CPU_HAS_L2_PMU=y
CONFIG_MSM_SMD=y
CONFIG_MSM_PCIE=y
CONFIG_MSM_IPC_ROUTER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_MSM_SUBSYSTEM_RESTART=y
CONFIG_MSM_SYSMON_COMM=y
CONFIG_MSM_PIL_FEMTO=y
@ -138,6 +136,7 @@ CONFIG_BRIDGE_EBT_PKTTYPE=m
CONFIG_BRIDGE_EBT_VLAN=m
CONFIG_BRIDGE=y
CONFIG_VLAN_8021Q=y
CONFIG_IPC_ROUTER=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
@ -242,6 +241,7 @@ CONFIG_REMOTE_SPINLOCK_MSM=y
CONFIG_PWM=y
CONFIG_PWM_QPNP=y
CONFIG_MSM_SMEM=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT3_FS=y

View File

@ -42,8 +42,6 @@ CONFIG_MSM_MPM_OF=y
CONFIG_CPU_HAS_L2_PMU=y
CONFIG_MSM_SMD=y
CONFIG_MSM_PCIE=y
CONFIG_MSM_IPC_ROUTER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_MSM_SUBSYSTEM_RESTART=y
CONFIG_MSM_SYSMON_COMM=y
CONFIG_MSM_PIL_FEMTO=y
@ -139,6 +137,7 @@ CONFIG_BRIDGE_EBT_PKTTYPE=m
CONFIG_BRIDGE_EBT_VLAN=m
CONFIG_BRIDGE=y
CONFIG_VLAN_8021Q=y
CONFIG_IPC_ROUTER=y
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
@ -241,6 +240,7 @@ CONFIG_REMOTE_SPINLOCK_MSM=y
CONFIG_PWM=y
CONFIG_PWM_QPNP=y
CONFIG_MSM_SMEM=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT3_FS=y

View File

@ -38,8 +38,6 @@ CONFIG_MSM_SMD=y
CONFIG_MSM_PCIE=y
CONFIG_MSM_SMP2P=y
CONFIG_MSM_SMP2P_TEST=y
CONFIG_MSM_IPC_ROUTER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_MSM_QMI_INTERFACE=y
CONFIG_MSM_SUBSYSTEM_RESTART=y
CONFIG_MSM_SYSMON_COMM=y
@ -168,6 +166,7 @@ CONFIG_RMNET_DATA=y
CONFIG_RMNET_DATA_DEBUG_PKT=y
CONFIG_CFG80211=y
CONFIG_CFG80211_INTERNAL_REGDB=y
CONFIG_IPC_ROUTER=y
CONFIG_CMA=y
CONFIG_MTD=y
CONFIG_MTD_CMDLINE_PARTS=y
@ -299,6 +298,7 @@ CONFIG_CORESIGHT_AUDIO_ETM=y
CONFIG_CORESIGHT_MODEM_ETM=y
CONFIG_CORESIGHT_RPM_ETM=y
CONFIG_MSM_SMEM=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_EXT3_FS=y
CONFIG_VFAT_FS=y
CONFIG_TMPFS=y

View File

@ -40,9 +40,6 @@ CONFIG_CPU_HAS_L2_PMU=y
CONFIG_MSM_SMD=y
CONFIG_MSM_SMP2P=y
CONFIG_MSM_SMP2P_TEST=y
CONFIG_MSM_IPC_ROUTER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_MSM_IPC_ROUTER_SECURITY=y
CONFIG_MSM_QMI_INTERFACE=y
CONFIG_MSM_SUBSYSTEM_RESTART=y
CONFIG_MSM_SYSMON_COMM=y
@ -198,6 +195,8 @@ CONFIG_NET_EMATCH_TEXT=y
CONFIG_NET_CLS_ACT=y
CONFIG_CFG80211=y
CONFIG_RFKILL=y
CONFIG_IPC_ROUTER=y
CONFIG_IPC_ROUTER_SECURITY=y
CONFIG_CMA=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
@ -311,6 +310,7 @@ CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_BACKLIGHT_CLASS_DEVICE=y
# CONFIG_BACKLIGHT_GENERIC is not set
CONFIG_MSM_ADSP_LOADER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_SOC=y

View File

@ -42,8 +42,6 @@ CONFIG_MSM_SMD=y
CONFIG_MSM_BAM_DMUX=y
CONFIG_MSM_SMP2P=y
CONFIG_MSM_SMP2P_TEST=y
CONFIG_MSM_IPC_ROUTER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_MSM_QMI_INTERFACE=y
CONFIG_MSM_SMCMOD=y
CONFIG_MSM_SUBSYSTEM_RESTART=y
@ -60,6 +58,7 @@ CONFIG_MSM_WATCHDOG_V2=y
CONFIG_MSM_MEMORY_DUMP=y
CONFIG_MSM_DLOAD_MODE=y
CONFIG_MSM_ADSP_LOADER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_MSM_OCMEM=y
CONFIG_MSM_OCMEM_LOCAL_POWER_CTRL=y
CONFIG_MSM_OCMEM_DEBUG=y
@ -201,6 +200,7 @@ CONFIG_CFG80211=y
CONFIG_NL80211_TESTMODE=y
CONFIG_CFG80211_INTERNAL_REGDB=y
CONFIG_NFC_QNCI=y
CONFIG_IPC_ROUTER=y
CONFIG_CMA=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y

View File

@ -41,8 +41,6 @@ CONFIG_MSM_SMD=y
CONFIG_MSM_BAM_DMUX=y
CONFIG_MSM_SMP2P=y
CONFIG_MSM_SMP2P_TEST=y
CONFIG_MSM_IPC_ROUTER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_MSM_QMI_INTERFACE=y
CONFIG_MSM_SMCMOD=y
CONFIG_MSM_SUBSYSTEM_RESTART=y
@ -59,6 +57,7 @@ CONFIG_MSM_WATCHDOG_V2=y
CONFIG_MSM_MEMORY_DUMP=y
CONFIG_MSM_DLOAD_MODE=y
CONFIG_MSM_ADSP_LOADER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_MSM_OCMEM=y
CONFIG_MSM_OCMEM_LOCAL_POWER_CTRL=y
CONFIG_MSM_OCMEM_DEBUG=y
@ -201,6 +200,7 @@ CONFIG_CFG80211=y
CONFIG_NL80211_TESTMODE=y
CONFIG_CFG80211_INTERNAL_REGDB=y
CONFIG_NFC_QNCI=y
CONFIG_IPC_ROUTER=y
CONFIG_CMA=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y

View File

@ -44,8 +44,6 @@ CONFIG_MSM_SMD=y
CONFIG_MSM_BAM_DMUX=y
CONFIG_MSM_SMP2P=y
CONFIG_MSM_SMP2P_TEST=y
CONFIG_MSM_IPC_ROUTER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_MSM_QMI_INTERFACE=y
CONFIG_MSM_SUBSYSTEM_RESTART=y
CONFIG_MSM_SYSMON_COMM=y
@ -61,6 +59,7 @@ CONFIG_MSM_WATCHDOG_V2=y
CONFIG_MSM_MEMORY_DUMP=y
CONFIG_MSM_DLOAD_MODE=y
CONFIG_MSM_ADSP_LOADER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_SENSORS_ADSP=y
CONFIG_MSM_ENABLE_WDOG_DEBUG_CONTROL=y
CONFIG_MSM_BOOT_STATS=y
@ -192,6 +191,7 @@ CONFIG_CFG80211=y
CONFIG_NL80211_TESTMODE=y
CONFIG_CFG80211_INTERNAL_REGDB=y
CONFIG_NFC_QNCI=y
CONFIG_IPC_ROUTER=y
CONFIG_CMA=y
CONFIG_CMA_SIZE_MBYTES=4
CONFIG_BLK_DEV_LOOP=y

View File

@ -41,8 +41,6 @@ CONFIG_MSM_SMD=y
CONFIG_MSM_BAM_DMUX=y
CONFIG_MSM_SMP2P=y
CONFIG_MSM_SMP2P_TEST=y
CONFIG_MSM_IPC_ROUTER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_MSM_QMI_INTERFACE=y
CONFIG_MSM_SUBSYSTEM_RESTART=y
CONFIG_MSM_SYSMON_COMM=y
@ -58,6 +56,7 @@ CONFIG_MSM_WATCHDOG_V2=y
CONFIG_MSM_MEMORY_DUMP=y
CONFIG_MSM_DLOAD_MODE=y
CONFIG_MSM_ADSP_LOADER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_SENSORS_ADSP=y
CONFIG_MSM_ENABLE_WDOG_DEBUG_CONTROL=y
CONFIG_MSM_BOOT_STATS=y
@ -190,6 +189,7 @@ CONFIG_CFG80211=y
CONFIG_NL80211_TESTMODE=y
CONFIG_CFG80211_INTERNAL_REGDB=y
CONFIG_NFC_QNCI=y
CONFIG_IPC_ROUTER=y
CONFIG_CMA=y
CONFIG_CMA_SIZE_MBYTES=4
CONFIG_BLK_DEV_LOOP=y

View File

@ -46,9 +46,6 @@ CONFIG_MSM_SMD=y
CONFIG_MSM_BAM_DMUX=y
CONFIG_MSM_SMP2P=y
CONFIG_MSM_SMP2P_TEST=y
CONFIG_MSM_IPC_ROUTER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_MSM_IPC_ROUTER_SECURITY=y
CONFIG_MSM_QMI_INTERFACE=y
CONFIG_MSM_SUBSYSTEM_RESTART=y
CONFIG_MSM_SYSMON_COMM=y
@ -66,6 +63,7 @@ CONFIG_MSM_WATCHDOG_V2=y
CONFIG_MSM_MEMORY_DUMP=y
CONFIG_MSM_DLOAD_MODE=y
CONFIG_MSM_ADSP_LOADER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_MSM_OCMEM=y
CONFIG_MSM_OCMEM_LOCAL_POWER_CTRL=y
CONFIG_MSM_OCMEM_DEBUG=y
@ -232,6 +230,8 @@ CONFIG_NL80211_TESTMODE=y
CONFIG_CFG80211_INTERNAL_REGDB=y
CONFIG_RFKILL=y
CONFIG_NFC_QNCI=y
CONFIG_IPC_ROUTER=y
CONFIG_IPC_ROUTER_SECURITY=y
CONFIG_CMA=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y

View File

@ -45,9 +45,6 @@ CONFIG_MSM_SMD=y
CONFIG_MSM_BAM_DMUX=y
CONFIG_MSM_SMP2P=y
CONFIG_MSM_SMP2P_TEST=y
CONFIG_MSM_IPC_ROUTER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_MSM_IPC_ROUTER_SECURITY=y
CONFIG_MSM_QMI_INTERFACE=y
CONFIG_MSM_SUBSYSTEM_RESTART=y
CONFIG_MSM_SYSMON_COMM=y
@ -65,6 +62,7 @@ CONFIG_MSM_WATCHDOG_V2=y
CONFIG_MSM_MEMORY_DUMP=y
CONFIG_MSM_DLOAD_MODE=y
CONFIG_MSM_ADSP_LOADER=y
CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y
CONFIG_MSM_OCMEM=y
CONFIG_MSM_OCMEM_LOCAL_POWER_CTRL=y
CONFIG_MSM_OCMEM_DEBUG=y
@ -237,6 +235,8 @@ CONFIG_NL80211_TESTMODE=y
CONFIG_CFG80211_INTERNAL_REGDB=y
CONFIG_RFKILL=y
CONFIG_NFC_QNCI=y
CONFIG_IPC_ROUTER=y
CONFIG_IPC_ROUTER_SECURITY=y
CONFIG_CMA=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y

View File

@ -678,44 +678,8 @@ config MSM_SMD_LOGGING
If in doubt, say yes.
config MSM_IPC_ROUTER
depends on NET
default n
bool "MSM IPC Router support"
help
Support for the MSM IPC Router for communication between
the APPs and the MODEM
config MSM_IPC_ROUTER_SMD_XPRT
depends on MSM_SMD
depends on MSM_IPC_ROUTER
default n
bool "MSM SMD XPRT Layer"
help
SMD Transport Layer for IPC Router
config MSM_IPC_ROUTER_HSIC_XPRT
depends on USB_QCOM_IPC_BRIDGE
depends on MSM_IPC_ROUTER
bool "MSM HSIC XPRT Layer"
help
HSIC Transport Layer that enables off-chip communication of
IPC Router. When the HSIC endpoint becomes available, this layer
registers the transport with IPC Router and enable message
exchange.
config MSM_IPC_ROUTER_SECURITY
depends on MSM_IPC_ROUTER
bool "MSM IPC Router Security support"
help
This feature of IPC Router will enforce security rules
configured by a security script from the user-space. IPC Router
once configured with the security rules will ensure that the
sender of the message to a service belongs to the relevant
Linux group as configured by the security script.
config MSM_QMI_INTERFACE
depends on MSM_IPC_ROUTER
depends on IPC_ROUTER
depends on QMI_ENCDEC
default n
bool "MSM QMI Interface Library"

View File

@ -49,11 +49,6 @@ obj-$(CONFIG_MSM_PIL_BCSS) += pil-bcss.o
obj-$(CONFIG_MSM_BAM_DMUX) += bam_dmux.o
obj-$(CONFIG_MSM_SMD_LOGGING) += smem_log.o
obj-y += socinfo.o
obj-$(CONFIG_MSM_IPC_ROUTER_SMD_XPRT) += ipc_router_smd_xprt.o
obj-$(CONFIG_MSM_IPC_ROUTER_HSIC_XPRT) += ipc_router_hsic_xprt.o
obj-$(CONFIG_MSM_IPC_ROUTER) += ipc_router.o
obj-$(CONFIG_MSM_IPC_ROUTER)+= ipc_socket.o
obj-$(CONFIG_MSM_IPC_ROUTER_SECURITY)+= msm_ipc_router_security.o
obj-$(CONFIG_MSM_QMI_INTERFACE) += msm_qmi_interface.o
obj-$(CONFIG_MSM_TEST_QMI_CLIENT) += kernel_test_service_v01.o test_qmi_client.o
obj-$(CONFIG_DEBUG_FS) += smd_rpc_sym.o

View File

@ -28,9 +28,9 @@
#include <linux/workqueue.h>
#include <linux/mutex.h>
#include <linux/hashtable.h>
#include <linux/ipc_router.h>
#include <mach/msm_qmi_interface.h>
#include <mach/msm_ipc_router.h>
#include "msm_qmi_interface_priv.h"

View File

@ -2,6 +2,26 @@
if ARCH_MSM
config MSM_IPC_ROUTER_SMD_XPRT
depends on MSM_SMD
depends on IPC_ROUTER
bool "MSM SMD XPRT Layer"
help
SMD Transport Layer that enables IPC Router communication within
a System-on-Chip(SoC). When the SMD channels become available,
this layer registers a transport with IPC Router and enable
message exchange.
config MSM_IPC_ROUTER_HSIC_XPRT
depends on USB_QCOM_IPC_BRIDGE
depends on IPC_ROUTER
bool "MSM HSIC XPRT Layer"
help
HSIC Transport Layer that enables off-chip communication of
IPC Router. When the HSIC endpoint becomes available, this layer
registers the transport with IPC Router and enable message
exchange.
config MSM_SMEM
depends on REMOTE_SPINLOCK_MSM
bool "MSM Shared Memory (SMEM)"

View File

@ -2,5 +2,7 @@
obj-y += qdsp6v2/
obj-$(CONFIG_MSM_IPC_ROUTER_HSIC_XPRT) += ipc_router_hsic_xprt.o
obj-$(CONFIG_MSM_IPC_ROUTER_SMD_XPRT) += ipc_router_smd_xprt.o
obj-$(CONFIG_MSM_SMEM) += smem.o smem_debug.o
obj-$(CONFIG_MEM_SHARE_QMI_SERVICE) += memshare/

View File

@ -19,12 +19,14 @@
#include <linux/platform_device.h>
#include <linux/types.h>
#include <linux/of.h>
#include <linux/ipc_router_xprt.h>
#include <linux/skbuff.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <mach/ipc_bridge.h>
#include <mach/subsystem_restart.h>
#include "ipc_router.h"
static int msm_ipc_router_hsic_xprt_debug_mask;
module_param_named(debug_mask, msm_ipc_router_hsic_xprt_debug_mask,
int, S_IRUGO | S_IWUSR | S_IWGRP);

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-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
@ -19,13 +19,15 @@
#include <linux/platform_device.h>
#include <linux/types.h>
#include <linux/of.h>
#include <linux/ipc_router_xprt.h>
#include <linux/skbuff.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <mach/msm_smd.h>
#include <mach/subsystem_restart.h>
#include <mach/msm_smsm.h>
#include "ipc_router.h"
static int msm_ipc_router_smd_xprt_debug_mask;
module_param_named(debug_mask, msm_ipc_router_smd_xprt_debug_mask,
int, S_IRUGO | S_IWUSR | S_IWGRP);

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-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
@ -10,8 +10,8 @@
* GNU General Public License for more details.
*/
#ifndef _MSM_IPC_ROUTER_H
#define _MSM_IPC_ROUTER_H
#ifndef _IPC_ROUTER_H
#define _IPC_ROUTER_H
#include <linux/types.h>
#include <linux/socket.h>
@ -129,7 +129,7 @@ struct msm_ipc_port {
void *priv;
};
#ifdef CONFIG_MSM_IPC_ROUTER
#ifdef CONFIG_IPC_ROUTER
/**
* msm_ipc_router_create_port() - Create a IPC Router port/endpoint
* @notify: Callback function to notify any event on the port.

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-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
@ -10,66 +10,23 @@
* GNU General Public License for more details.
*/
#ifndef _ARCH_ARM_MACH_MSM_IPC_ROUTER_H
#define _ARCH_ARM_MACH_MSM_IPC_ROUTER_H
#ifndef _IPC_ROUTER_XPRT_H
#define _IPC_ROUTER_XPRT_H
#include <linux/types.h>
#include <linux/socket.h>
#include <linux/errno.h>
#include <linux/mm.h>
#include <linux/list.h>
#include <linux/platform_device.h>
#include <linux/msm_ipc.h>
#include <net/sock.h>
#include <mach/msm_ipc_router.h>
/* definitions for the R2R wire protcol */
#define IPC_ROUTER_V1 1
/*
* Ambiguous definition but will enable multiplexing IPC_ROUTER_V2 packets
* with an existing alternate transport in user-space, if needed.
*/
#define IPC_ROUTER_V2 3
#define IPC_ROUTER_ADDRESS 0x0000FFFF
#define IPC_ROUTER_NID_LOCAL 1
#define MAX_IPC_PKT_SIZE 66000
#define IPC_ROUTER_DEFAULT_RX_QUOTA 5
#include <linux/ipc_router.h>
#define IPC_ROUTER_XPRT_EVENT_DATA 1
#define IPC_ROUTER_XPRT_EVENT_OPEN 2
#define IPC_ROUTER_XPRT_EVENT_CLOSE 3
#define IPC_ROUTER_INFINITY -1
#define DEFAULT_RCV_TIMEO 0
#define ALIGN_SIZE(x) ((4 - ((x) & 3)) & 3)
#define ALL_SERVICE 0xFFFFFFFF
#define ALL_INSTANCE 0xFFFFFFFF
#define CONTROL_FLAG_CONFIRM_RX 0x1
#define CONTROL_FLAG_OPT_HDR 0x2
#define FRAG_PKT_WRITE_ENABLE 0x1
enum {
CLIENT_PORT,
SERVER_PORT,
CONTROL_PORT,
IRSC_PORT,
};
enum {
NULL_MODE,
SINGLE_LINK_MODE,
MULTI_LINK_MODE,
};
/**
* rr_header_v1 - IPC Router header version 1
* @version: Version information.
@ -135,12 +92,6 @@ struct rr_packet {
uint32_t length;
};
struct msm_ipc_sock {
struct sock sk;
struct msm_ipc_port *port;
void *default_pil;
};
/**
* msm_ipc_router_xprt - Structure to hold XPRT specific information
* @name: Name of the XPRT.
@ -181,49 +132,6 @@ void msm_ipc_router_xprt_notify(struct msm_ipc_router_xprt *xprt,
struct rr_packet *clone_pkt(struct rr_packet *pkt);
void release_pkt(struct rr_packet *pkt);
/**
* msm_ipc_router_create_raw_port() - Create an IPC Router port
* @endpoint: User-space space socket information to be cached.
* @notify: Function to notify incoming events on the port.
* @event: Event ID to be handled.
* @oob_data: Any out-of-band data associated with the event.
* @oob_data_len: Size of the out-of-band data, if valid.
* @priv: Private data registered during the port creation.
* @priv: Private Data to be passed during the event notification.
*
* @return: Valid pointer to port on success, NULL on failure.
*
* This function is used to create an IPC Router port. The port is used for
* communication locally or outside the subsystem.
*/
struct msm_ipc_port *msm_ipc_router_create_raw_port(void *endpoint,
void (*notify)(unsigned event, void *oob_data,
size_t oob_data_len, void *priv),
void *priv);
int msm_ipc_router_send_to(struct msm_ipc_port *src,
struct sk_buff_head *data,
struct msm_ipc_addr *dest);
int msm_ipc_router_read(struct msm_ipc_port *port_ptr,
struct rr_packet **pkt,
size_t buf_len);
int msm_ipc_router_recv_from(struct msm_ipc_port *port_ptr,
struct rr_packet **pkt,
struct msm_ipc_addr *src_addr,
long timeout);
int msm_ipc_router_register_server(struct msm_ipc_port *server_port,
struct msm_ipc_addr *name);
int msm_ipc_router_unregister_server(struct msm_ipc_port *server_port);
int msm_ipc_router_init_sockets(void);
void msm_ipc_router_exit_sockets(void);
void msm_ipc_sync_sec_rule(uint32_t service, uint32_t instance, void *rule);
void msm_ipc_sync_default_sec_rule(void *rule);
int msm_ipc_router_rx_data_wait(struct msm_ipc_port *port_ptr, long timeout);
#if defined CONFIG_MSM_IPC_ROUTER_SMD_XPRT
extern void *msm_ipc_load_default_node(void);
@ -235,5 +143,4 @@ static inline void *msm_ipc_load_default_node(void)
static inline void msm_ipc_unload_default_node(void *pil) { }
#endif
void msm_ipc_router_free_skb(struct sk_buff_head *skb_head);
#endif

View File

@ -351,6 +351,7 @@ source "net/9p/Kconfig"
source "net/caif/Kconfig"
source "net/ceph/Kconfig"
source "net/nfc/Kconfig"
source "net/ipc_router/Kconfig"
endif # if NET

View File

@ -72,3 +72,4 @@ obj-$(CONFIG_OPENVSWITCH) += openvswitch/
obj-$(CONFIG_VSOCKETS) += vmw_vsock/
obj-$(CONFIG_NET_ACTIVITY_STATS) += activity_stats.o
obj-$(CONFIG_RMNET_DATA) += rmnet_data/
obj-$(CONFIG_IPC_ROUTER) += ipc_router/

25
net/ipc_router/Kconfig Normal file
View File

@ -0,0 +1,25 @@
#
# IPC_ROUTER Configuration
#
menuconfig IPC_ROUTER
bool "IPC Router support"
help
IPC Router provides a connectionless message routing service
between multiple modules within a System-on-Chip(SoC). The
communicating entities can run either in the same processor or
in a different processor within the SoC. The IPC Router has been
designed to route messages of any types and support a broader
network of processors.
If in doubt, say N.
config IPC_ROUTER_SECURITY
depends on IPC_ROUTER
bool "IPC Router Security support"
help
This feature of IPC Router will enforce security rules
configured by a security script from the user-space. IPC Router
once configured with the security rules will ensure that the
sender of the message to a service belongs to the relevant
Linux group as configured by the security script.

7
net/ipc_router/Makefile Normal file
View File

@ -0,0 +1,7 @@
#
# Makefile for the Linux IPC_ROUTER
#
obj-$(CONFIG_IPC_ROUTER) := ipc_router_core.o
obj-$(CONFIG_IPC_ROUTER) += ipc_router_socket.o
obj-$(CONFIG_IPC_ROUTER_SECURITY) += ipc_router_security.o

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-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
@ -29,16 +29,17 @@
#include <linux/debugfs.h>
#include <linux/rwsem.h>
#include <linux/ipc_logging.h>
#include <linux/uaccess.h>
#include <linux/ipc_router.h>
#include <linux/ipc_router_xprt.h>
#include <asm/uaccess.h>
#include <asm/byteorder.h>
#include <mach/smem_log.h>
#include <mach/subsystem_notif.h>
#include <mach/msm_ipc_router.h>
#include "ipc_router.h"
#include "msm_ipc_router_security.h"
#include "ipc_router_private.h"
#include "ipc_router_security.h"
enum {
SMEM_LOG = 1U << 0,
@ -106,8 +107,7 @@ static DECLARE_RWSEM(control_ports_lock_lha5);
static struct list_head local_ports[LP_HASH_SIZE];
static DECLARE_RWSEM(local_ports_lock_lha2);
/*
* Server info is organized as a hash table. The server's service ID is
/* Server info is organized as a hash table. The server's service ID is
* used to index into the hash table. The instance ID of most of the servers
* are 1 or 2. The service IDs are well distributed compared to the instance
* IDs and hence choosing service ID to index into this hash table optimizes
@ -967,9 +967,8 @@ static struct msm_ipc_port *msm_ipc_router_lookup_local_port(uint32_t port_id)
struct msm_ipc_port *port_ptr;
list_for_each_entry(port_ptr, &local_ports[key], list) {
if (port_ptr->this_port.port_id == port_id) {
if (port_ptr->this_port.port_id == port_id)
return port_ptr;
}
}
return NULL;
}
@ -1780,8 +1779,7 @@ void msm_ipc_sync_sec_rule(uint32_t service, uint32_t instance, void *rule)
instance != ALL_INSTANCE)
continue;
/*
* If the rule applies to all instances and if the specific
/* If the rule applies to all instances and if the specific
* instance of a service has a rule synchronized already,
* do not apply the rule for that specific instance.
*/
@ -1868,8 +1866,7 @@ static int process_hello_msg(struct msm_ipc_router_xprt_info *xprt_info,
}
xprt_info->initialized = 1;
/*
* Send list of servers from the local node and from nodes
/* Send list of servers from the local node and from nodes
* outside the mesh network in which this XPRT is part of.
*/
down_read(&server_list_lock_lha2);
@ -1962,8 +1959,7 @@ static int process_new_server_msg(struct msm_ipc_router_xprt_info *xprt_info,
}
up_write(&routing_table_lock_lha3);
/*
* If the service does not exist already in the database, create and
/* If the service does not exist already in the database, create and
* store the service info. Create a remote port structure in which
* the service is hosted and cache the security rule for the service
* in that remote port structure.
@ -2000,8 +1996,7 @@ static int process_new_server_msg(struct msm_ipc_router_xprt_info *xprt_info,
}
up_write(&server_list_lock_lha2);
/*
* Relay the new server message to other subsystems that do not belong
/* Relay the new server message to other subsystems that do not belong
* to the cluster from which this message is received. Notify the
* local clients waiting for this service.
*/
@ -2442,9 +2437,8 @@ static int msm_ipc_router_write_pkt(struct msm_ipc_port *src,
}
update_comm_mode_info(&src->mode_info, xprt_info);
RAW_HDR("[w rr_h] "
"ver=%i,type=%s,src_nid=%08x,src_port_id=%08x,"
"control_flag=%i,size=%3i,dst_pid=%08x,dst_cid=%08x\n",
RAW_HDR(
"[w rr_h] ver=%i,type=%s,src_nid=%08x,src_port_id=%08x,control_flag=%i,size=%3i,dst_pid=%08x,dst_cid=%08x\n",
hdr->version, type_to_str(hdr->type),
hdr->src_node_id, hdr->src_port_id,
hdr->control_flag, hdr->size,
@ -2836,8 +2830,7 @@ int msm_ipc_router_close_port(struct msm_ipc_port *port_ptr)
broadcast_ctl_msg_locally(&msg);
}
/*
* Server port could have been a client port earlier.
/* Server port could have been a client port earlier.
* Send REMOVE_CLIENT message in either case.
*/
RR("x REMOVE_CLIENT id=%d:%08x\n",
@ -3047,10 +3040,12 @@ static int dump_servers(char *buf, int max)
list_for_each_entry(server_port,
&server->server_port_list,
list) {
i += scnprintf(buf + i, max - i, "Service: "
"0x%08x\n", server->name.service);
i += scnprintf(buf + i, max - i, "Instance: "
"0x%08x\n", server->name.instance);
i += scnprintf(buf + i, max - i,
"Service: 0x%08x\n",
server->name.service);
i += scnprintf(buf + i, max - i,
"Instance: 0x%08x\n",
server->name.instance);
i += scnprintf(buf + i, max - i,
"Node_id: 0x%08x\n",
server_port->server_addr.node_id);

View File

@ -0,0 +1,117 @@
/* Copyright (c) 2011-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
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _IPC_ROUTER_PRIVATE_H
#define _IPC_ROUTER_PRIVATE_H
#include <linux/types.h>
#include <linux/socket.h>
#include <linux/errno.h>
#include <linux/mm.h>
#include <linux/list.h>
#include <linux/platform_device.h>
#include <linux/msm_ipc.h>
#include <linux/ipc_router.h>
#include <linux/ipc_router_xprt.h>
#include <net/sock.h>
/* definitions for the R2R wire protcol */
#define IPC_ROUTER_V1 1
/*
* Ambiguous definition but will enable multiplexing IPC_ROUTER_V2 packets
* with an existing alternate transport in user-space, if needed.
*/
#define IPC_ROUTER_V2 3
#define IPC_ROUTER_ADDRESS 0x0000FFFF
#define IPC_ROUTER_NID_LOCAL 1
#define MAX_IPC_PKT_SIZE 66000
#define IPC_ROUTER_DEFAULT_RX_QUOTA 5
#define IPC_ROUTER_INFINITY -1
#define DEFAULT_RCV_TIMEO 0
#define ALIGN_SIZE(x) ((4 - ((x) & 3)) & 3)
#define ALL_SERVICE 0xFFFFFFFF
#define ALL_INSTANCE 0xFFFFFFFF
#define CONTROL_FLAG_CONFIRM_RX 0x1
#define CONTROL_FLAG_OPT_HDR 0x2
enum {
CLIENT_PORT,
SERVER_PORT,
CONTROL_PORT,
IRSC_PORT,
};
enum {
NULL_MODE,
SINGLE_LINK_MODE,
MULTI_LINK_MODE,
};
struct msm_ipc_sock {
struct sock sk;
struct msm_ipc_port *port;
void *default_pil;
};
/**
* msm_ipc_router_create_raw_port() - Create an IPC Router port
* @endpoint: User-space space socket information to be cached.
* @notify: Function to notify incoming events on the port.
* @event: Event ID to be handled.
* @oob_data: Any out-of-band data associated with the event.
* @oob_data_len: Size of the out-of-band data, if valid.
* @priv: Private data registered during the port creation.
* @priv: Private Data to be passed during the event notification.
*
* @return: Valid pointer to port on success, NULL on failure.
*
* This function is used to create an IPC Router port. The port is used for
* communication locally or outside the subsystem.
*/
struct msm_ipc_port *msm_ipc_router_create_raw_port(void *endpoint,
void (*notify)(unsigned event, void *oob_data,
size_t oob_data_len, void *priv),
void *priv);
int msm_ipc_router_send_to(struct msm_ipc_port *src,
struct sk_buff_head *data,
struct msm_ipc_addr *dest);
int msm_ipc_router_read(struct msm_ipc_port *port_ptr,
struct rr_packet **pkt,
size_t buf_len);
int msm_ipc_router_recv_from(struct msm_ipc_port *port_ptr,
struct rr_packet **pkt,
struct msm_ipc_addr *src_addr,
long timeout);
int msm_ipc_router_register_server(struct msm_ipc_port *server_port,
struct msm_ipc_addr *name);
int msm_ipc_router_unregister_server(struct msm_ipc_port *server_port);
int msm_ipc_router_init_sockets(void);
void msm_ipc_router_exit_sockets(void);
void msm_ipc_sync_sec_rule(uint32_t service, uint32_t instance, void *rule);
void msm_ipc_sync_default_sec_rule(void *rule);
int msm_ipc_router_rx_data_wait(struct msm_ipc_port *port_ptr, long timeout);
void msm_ipc_router_free_skb(struct sk_buff_head *skb_head);
#endif

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-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
@ -23,12 +23,11 @@
#include <linux/kernel.h>
#include <linux/msm_ipc.h>
#include <linux/rwsem.h>
#include <asm/uaccess.h>
#include <linux/uaccess.h>
#include <net/sock.h>
#include "ipc_router.h"
#include "msm_ipc_router_security.h"
#include "ipc_router_private.h"
#include "ipc_router_security.h"
#define IRSC_COMPLETION_TIMEOUT_MS 30000
#define SEC_RULES_HASH_SZ 32

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-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
@ -10,14 +10,14 @@
* GNU General Public License for more details.
*/
#ifndef _MSM_IPC_ROUTER_SECURITY_H
#define _MSM_IPC_ROUTER_SECURITY_H
#ifndef _IPC_ROUTER_SECURITY_H
#define _IPC_ROUTER_SECURITY_H
#include <linux/types.h>
#include <linux/socket.h>
#include <linux/errno.h>
#ifdef CONFIG_MSM_IPC_ROUTER_SECURITY
#ifdef CONFIG_IPC_ROUTER_SECURITY
#include <linux/android_aid.h>
/**

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-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
@ -26,16 +26,14 @@
#include <linux/slab.h>
#include <linux/kmemleak.h>
#include <linux/ipc_logging.h>
#include <asm/string.h>
#include <asm/atomic.h>
#include <linux/string.h>
#include <linux/atomic.h>
#include <linux/ipc_router.h>
#include <net/sock.h>
#include <mach/msm_ipc_router.h>
#include "ipc_router.h"
#include "msm_ipc_router_security.h"
#include "ipc_router_private.h"
#include "ipc_router_security.h"
#define msm_ipc_sk(sk) ((struct msm_ipc_sock *)(sk))
#define msm_ipc_sk_port(sk) ((struct msm_ipc_port *)(msm_ipc_sk(sk)->port))
@ -84,8 +82,7 @@ static void msm_ipc_router_ipc_log(uint8_t tran,
{
struct qmi_header *hdr = (struct qmi_header *)ipc_buf->data;
/*
* IPC Logging format is as below:-
/* IPC Logging format is as below:-
* <Name>(Name of the User Space Process):
* <PID> (PID of the user space process) :
* <TID> (TID of the user space thread) :