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