summaryrefslogtreecommitdiffstats
path: root/source4/lib/messaging/irpc.h
blob: bdb1b8fedbff11f575b70a5a43b870827c513919 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* 
   Unix SMB/CIFS implementation.

   Samba internal rpc code - header

   Copyright (C) Andrew Tridgell 2005
   
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.
   
   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.
   
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef IRPC_H
#define IRPC_H

#include "lib/messaging/messaging.h"
#include "librpc/gen_ndr/irpc.h"

/*
  an incoming irpc message
*/
struct irpc_message {
	struct server_id from;
	void *private_data;
	struct irpc_header header;
	struct ndr_pull *ndr;
	bool defer_reply;
	bool no_reply;
	struct messaging_context *msg_ctx;
	struct irpc_list *irpc;
	void *data;
	struct tevent_context *ev;
};

/* don't allow calls to take too long */
#define IRPC_CALL_TIMEOUT	10
/* wait for the calls as long as it takes */
#define IRPC_CALL_TIMEOUT_INF	0


/* the server function type */
typedef NTSTATUS (*irpc_function_t)(struct irpc_message *, void *r);

/* register a server function with the irpc messaging system */
#define IRPC_REGISTER(msg_ctx, pipename, funcname, function, private_data) \
   irpc_register(msg_ctx, &ndr_table_ ## pipename, \
                          NDR_ ## funcname, \
			  (irpc_function_t)function, private_data)

struct ndr_interface_table;

NTSTATUS irpc_register(struct messaging_context *msg_ctx, 
		       const struct ndr_interface_table *table, 
		       int call, irpc_function_t fn, void *private_data);

struct dcerpc_binding_handle *irpc_binding_handle(TALLOC_CTX *mem_ctx,
					struct messaging_context *msg_ctx,
					struct server_id server_id,
					const struct ndr_interface_table *table);
struct dcerpc_binding_handle *irpc_binding_handle_by_name(TALLOC_CTX *mem_ctx,
					struct messaging_context *msg_ctx,
					const char *dest_task,
					const struct ndr_interface_table *table);
void irpc_binding_handle_add_security_token(struct dcerpc_binding_handle *h,
					    struct security_token *token);

NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name);
struct server_id *irpc_servers_byname(struct messaging_context *msg_ctx, TALLOC_CTX *mem_ctx, const char *name);
void irpc_remove_name(struct messaging_context *msg_ctx, const char *name);
NTSTATUS irpc_send_reply(struct irpc_message *m, NTSTATUS status);

#endif

pan class='column1'>| | All platforms currently use the "MCFTMR" DMA timer rather than the PIT timer, so drop the MCFPIT code. Cc: Huan Wang <alison.wang@nxp.com> Cc: Angelo Dureghello <angelo@sysam.it> Cc: TsiChung Liew <Tsi-Chung.Liew@nxp.com> Cc: Wolfgang Wegner <w.wegner@astro-kom.de> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Angelo Dureghello <angelo@sysam.it> * configs: purge unneeded fec definesAngelo Durgehello2020-01-1016-104/+17 | | | | | | Remove unneeded fec-related defines after fec moved as dm. Signed-off-by: Angelo Durgehello <angelo.dureghello@timesys.com> * Merge branch 'next' of https://gitlab.denx.de/u-boot/custodians/u-boot-mpc83xxTom Rini2020-01-097-11/+0 |\ | | | | | | - A small PR with MC8309 fixes from Rasmus. | * powerpc: mpc83xx: convert CONFIG_FSL_ELBC to KconfigRasmus Villemoes2020-01-087-11/+0 | | | | | | | | | | | | | | | | This complements commit 068789773d0 which did the conversion for mpc85xx. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Mario Six <mario.six@gdsys.cc> * | Merge tag 'dm-pull-8jan20' of git://git.denx.de/u-boot-dmTom Rini2020-01-098-254/+354 |\ \ | | | | | | | | | dm: Increased separation of ofdata_to_platdata() and probe methods | * | log: Include missing header for log.hSean Anderson2020-01-071-0/+1 | | | | | | | | | | | | | | | | | | | | | log.h references cmd_tbl_t but command.h was not included Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> | * | Include missing headers for fdt_support.hSean Anderson2020-01-071-0/+1 | | | | | | | | | | | | | | | | | | | | | fdt_support.h is missing declarations for bd_t. Including asm/u-boot.h pulls in the definition. Signed-off-by: Sean Anderson <seanga2@gmail.com> | * | dm: devres: Add a new OFDATA phaseSimon Glass2020-01-071-1/+2 | | | | | | | | | | | | | | | | | | | | | Since the ofdata_to_platdata() method can allocate resources, add it as a new devres phase. Signed-off-by: Simon Glass <sjg@chromium.org> | * | dm: devres: Add testsSimon Glass2020-01-071-0/+20 | | | | | | | | | | | | | | | | | | | | | The devres functionality has very few users in U-Boot, but it still should have tests. Add a few basic tests of the main functions. Signed-off-by: Simon Glass <sjg@chromium.org> | * | dm: test: Add a test driver for devresSimon Glass2020-01-072-0/+10 | | | | | | | | | | | | | | | | | | | | | Add a driver which does devres allocations so that we can write tests for devres. Signed-off-by: Simon Glass <sjg@chromium.org> | * | dm: devres: Convert to use loggingSimon Glass2020-01-071-0/+1 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present when CONFIG_DEBUG_DEVRES is enabled, U-Boot prints log messages to the console with every devres allocation/free event. This causes most tests to fail since the console output is not as expected. In particular this prevents us from adding a device to sandbox which uses devres in its bind method. Move devres over to use U-Boot's logging feature instead, and add a new category for devres. Signed-off-by: Simon Glass <sjg@chromium.org> | * | test: Add functions to find the amount of allocated memorySimon Glass2020-01-071-0/+16 | | | | | | | | | | | | | | | | | | | | | | | | | | | The malloc() implementations provides a way of finding out the approximate amount of memory that is allocated. Add helper functions to make it easier to access this and see changes over time. This is useful for tests that want to check if memory has been allocated or freed. Signed-off-by: Simon Glass <sjg@chromium.org> | * | dm: devres: Create a new devres header fileSimon Glass2020-01-072-254/+270 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present these functions are lumped in with the core device functions. They have their own #ifdef to control their availability, so it seems better to split them out. Move them into their own header file. Signed-off-by: Simon Glass <sjg@chromium.org> | * | dm: core: Add a new flag to track platform dataSimon Glass2020-01-071-0/+3 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to avoid allocating platform data twice. This could happen if device_probe() is called after device_ofdata_to_platdata() for the same device. Add a flag to track whether device_ofdata_to_platdata() has been called on a device. Check the flag to make sure it doesn't happen twice, and clear the flag when the data is freed. Signed-off-by: Simon Glass <sjg@chromium.org> | * | dm: core: Export a new function to read platdataSimon Glass2020-01-071-0/+16 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new internal function, device_ofdata_to_platdata() to handle allocating private space associated with each device and reading the platform data from the device tree. Call this new function from device_probe(). Signed-off-by: Simon Glass <sjg@chromium.org> | * | dm: core: Add a comment for DM_FLAG_OF_PLATDATASimon Glass2020-01-071-0/+1 | | | | | | | | | | | | | | | | | | This flag is missing a comment. Add one. Signed-off-by: Simon Glass <sjg@chromium.org> | * | common: Add a noisy assert()Simon Glass2020-01-071-0/+14 | |/ | | | | | | | | | | | | | | | | | | Some U-Boot code uses BUG_ON() and WARN_ON() macros. These use __FILE__ which can include quite a large path, depending on how U-Boot is built. The existing assert() is only checked if DEBUG is enabled. Add a new one which is always checked, and prints a (smaller) error in that case. Signed-off-by: Simon Glass <sjg@chromium.org> * | Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini2020-01-091-1/+5 |\ \ | | | | | | | | | - DFU updates | * | dfu: Add optional timeout parameterAndy Shevchenko2020-01-071-0/+5 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the `dfu` command is called from the U-Boot environment, it now accepts an optional parameter that specifies a timeout (in seconds). If a DFU connection is not made within that time the `dfu` command exits (as it would if Ctrl+C was pressed). If the timeout is left empty or being zero the `dfu` command behaves as it does now. This is useful for allowing U-Boot to check to see if anything wants to upload new firmware before continuing to boot. The patch is based on the commit https://github.com/01org/edison-u-boot/commit/5e966ccc3c65c18c9783741fa04e0c45e021780c by Sebastien Colleur, which has been heavily reworked due to U-Boot changes in the past. Signed-off-by: Brad Campbell <bradjc5@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> | * | dfu: Drop unused prototype of dfu_trigger_reset()Andy Shevchenko2020-01-071-1/+0 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the commit 1cc03c5c53c0 ("dfu: Provide means to find difference between dfu-util -e and -R") the dangling ptototype appeared. Remove it here. Fixes: 1cc03c5c53c0 ("dfu: Provide means to find difference between dfu-util -e and -R") Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Stephen Warren <swarren@nvidia.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Lukasz Majewski <lukma@denx.de> * | | Merge tag 'efi-2020-04-rc1' of ↵Tom Rini2020-01-08