1219820Sjeff/* SPDX-License-Identifier: GPL-2.0 */
2272407Shselasky/*
3219820Sjeff * Definitions and interface for Linux - z/VM Monitor Stream.
4219820Sjeff *
5219820Sjeff * Copyright IBM Corp. 2003, 2008
6219820Sjeff *
7219820Sjeff * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com>
8219820Sjeff */
9219820Sjeff
10219820Sjeff#define APPLDATA_MAX_REC_SIZE	  4024	/* Maximum size of the */
11219820Sjeff					/* data buffer */
12219820Sjeff#define APPLDATA_MAX_PROCS 100
13219820Sjeff
14219820Sjeff#define APPLDATA_PROC_NAME_LENGTH 16	/* Max. length of /proc name */
15219820Sjeff
16219820Sjeff#define APPLDATA_RECORD_MEM_ID		0x01	/* IDs to identify the */
17219820Sjeff#define APPLDATA_RECORD_OS_ID		0x02	/* individual records, */
18219820Sjeff#define APPLDATA_RECORD_NET_SUM_ID	0x03	/* must be < 256 !     */
19219820Sjeff#define APPLDATA_RECORD_PROC_ID		0x04
20219820Sjeff
21219820Sjeff#define CTL_APPLDATA_TIMER 	2121	/* sysctl IDs, must be unique */
22219820Sjeff#define CTL_APPLDATA_INTERVAL 	2122
23219820Sjeff#define CTL_APPLDATA_MEM	2123
24219820Sjeff#define CTL_APPLDATA_OS		2124
25219820Sjeff#define CTL_APPLDATA_NET_SUM	2125
26219820Sjeff#define CTL_APPLDATA_PROC	2126
27219820Sjeff
28219820Sjeffstruct appldata_ops {
29219820Sjeff	struct list_head list;
30219820Sjeff	struct ctl_table_header *sysctl_header;
31219820Sjeff	struct ctl_table *ctl_table;
32219820Sjeff	int    active;				/* monitoring status */
33219820Sjeff
34324685Shselasky	/* fill in from here */
35324685Shselasky	char name[APPLDATA_PROC_NAME_LENGTH];	/* name of /proc fs node */
36219820Sjeff	unsigned char record_nr;		/* Record Nr. for Product ID */
37219820Sjeff	void (*callback)(void *data);		/* callback function */
38219820Sjeff	void *data;				/* record data */
39272407Shselasky	unsigned int size;			/* size of record */
40219820Sjeff	struct module *owner;			/* THIS_MODULE */
41219820Sjeff	char mod_lvl[2];			/* modification level, EBCDIC */
42219820Sjeff};
43219820Sjeff
44219820Sjeffextern int appldata_register_ops(struct appldata_ops *ops);
45219820Sjeffextern void appldata_unregister_ops(struct appldata_ops *ops);
46219820Sjeffextern int appldata_diag(char record_nr, u16 function, unsigned long buffer,
47292107Shselasky			 u16 length, char *mod_lvl);
48219820Sjeff
49219820Sjeff