• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // tbase.h
2 /*
3  *
4  *   Copyright (c) International Business Machines  Corp., 2001
5  *
6  *   This program is free software;  you can redistribute it and/or modify
7  *   it under the terms of the GNU General Public License as published by
8  *   the Free Software Foundation; either version 2 of the License, or
9  *   (at your option) any later version.
10  *
11  *   This program is distributed in the hope that it will be useful,
12  *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
13  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
14  *   the GNU General Public License for more details.
15  *
16  *   You should have received a copy of the GNU General Public License
17  *   along with this program;  if not, write to the Free Software
18  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 
22 #define TMOD_DRIVER_NAME	"ltp test drivers/base"
23 #define DEVICE_NAME		"/dev/tbase"
24 #define MAG_NUM			'k'
25 
26 /* put ioctl flags here, use the _IO macro which is
27  found in linux/ioctl.h, takes a letter, and an
28  integer */
29 
30 #define TBASEMAJOR      253
31 
32 #define DEV_PROBE		_IO(MAG_NUM, 1)
33 #define REG_DEVICE		_IO(MAG_NUM, 2)
34 #define UNREG_DEVICE		_IO(MAG_NUM, 3)
35 #define BUS_ADD			_IO(MAG_NUM, 4)
36 #define FIND_BUS		_IO(MAG_NUM, 5)
37 #define BUS_REMOVE		_IO(MAG_NUM, 6)
38 #define GET_DRV			_IO(MAG_NUM, 7)
39 #define PUT_DRV			_IO(MAG_NUM, 8)
40 #define DRV_REG			_IO(MAG_NUM, 9)
41 #define DRV_UNREG		_IO(MAG_NUM, 10)
42 #define REG_FIRM		_IO(MAG_NUM, 11)
43 #define CREATE_FILE		_IO(MAG_NUM, 12)
44 #define DEV_SUSPEND		_IO(MAG_NUM, 13)
45 #define DEV_FILE		_IO(MAG_NUM, 14)
46 #define BUS_RESCAN		_IO(TBASEMAJOR, 15)
47 #define BUS_FILE		_IO(MAG_NUM, 16)
48 #define CLASS_REG		_IO(MAG_NUM, 17)
49 #define CLASS_UNREG		_IO(MAG_NUM, 18)
50 #define CLASS_FILE		_IO(MAG_NUM, 19)
51 #define CLASS_GET		_IO(MAG_NUM, 20)
52 #define CLASSDEV_REG		_IO(MAG_NUM, 21)
53 #define CLASSINT_REG		_IO(MAG_NUM, 22)
54 #define SYSDEV_REG		_IO(MAG_NUM, 23)
55 #define SYSDEV_UNREG		_IO(MAG_NUM, 24)
56 #define SYSDEV_CLS_REG		_IO(MAG_NUM, 25)
57 #define SYSDEV_CLS_UNREG	_IO(MAG_NUM, 26)
58 
59 /* interface for passing structures between user
60  space and kernel space easily */
61 
62 struct tmod_interface {
63 	int     in_len;         // input data length
64         caddr_t in_data;        // input data
65         int     out_rc;         // return code from the test
66         int     out_len;        // output data length
67         caddr_t out_data;       // output data
68 };
69 typedef struct tmod_interface tmod_interface_t;
70 
71 
72 
73 
74 
75