1/* 2 * 3 * Copyright (c) International Business Machines Corp., 2001 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 13 * the GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 */ 19 20/* 21 * In this header file keep all flags and other 22 * structures that will be needed in both kernel 23 * and user space. Specifically the ioctl flags 24 * will go in here so that in user space a program 25 * can specify flags for the ioctl call. 26 * 27 * author: Kai Zhao 28 * date: 08/25/2003 29 * 30 */ 31 32#define tagp_DRIVER_NAME "ltp agp module" 33#define DEVICE_NAME "/dev/tagp" 34#define TAGP_MAJOR 252 35#define MAG_NUM 'k' 36#ifndef SET_MODULE_OWNER 37#define SET_MODULE_OWNER(dev) ((dev)->owner = THIS_MODULE) 38#endif 39 40/* put ioctl flags here, use the _IO macro which is 41 found in linux/ioctl.h, takes a letter, and an 42 integer */ 43 44#define TEST_PCI_FIND_DEV _IO(MAG_NUM, 1) 45#define TEST_BACKEND_ACQUIRE _IO(MAG_NUM, 2) 46#define TEST_BACKEND_RELEASE _IO(MAG_NUM, 3) 47#define TEST_ALLOC_BRIDGE _IO(MAG_NUM, 4) 48#define TEST_PUT_BRIDGE _IO(MAG_NUM, 5) 49#define TEST_CREATE_AND_FREE_MEMORY _IO(MAG_NUM, 6) 50//#define TEST_FREE_MEMORY _IO(MAG_NUM, 7) 51#define TEST_COPY_INFO _IO(MAG_NUM, 8) 52//#define TEST_ALLOC_MEMORY_AND_BAND_UNBAND _IO(MAG_NUM, 9) 53#define TEST_GET_VERSION _IO(MAG_NUM, 10) 54#define TEST_GENERIC_ENABLE _IO(MAG_NUM, 11) 55#define TEST_NUM_ENTRIES _IO(MAG_NUM, 12) 56#define TEST_GENERIC_CREATE_GATT_TABLE _IO(MAG_NUM, 13) 57#define TEST_GENERIC_FREE_GATT_TABLE _IO(MAG_NUM, 14) 58#define TEST_GENERIC_INSERT_MEMORY _IO(MAG_NUM, 15) 59#define TEST_GENERIC_ALLOC_BY_TYPE _IO(MAG_NUM, 16) 60#define TEST_GENERIC_ALLOC_PAGE _IO(MAG_NUM, 17) 61#define TEST_ENABLE _IO(MAG_NUM, 19) 62#define TEST_GLOBAL_CACHE_FLUSH _IO(MAG_NUM, 20) 63#define TEST_GENERIC_MASK_MEMORY _IO(MAG_NUM, 21) 64 65/* memory between the kernel and user space is 66 seperated, so that if a structure is needed 67 to be passed between kernel and user space 68 a call must be made to copy_to_user or copy 69 from user. Use this structure to streamline 70 that process. For example: A function that 71 writes to a disc takes in a ki_write_t 72 pointer from userspace. In the user space 73 program specify the length of the pointer as 74 in_len, and in_data as the actual structure. */ 75 76struct tagp_interface { 77 int in_len; // input data length 78 caddr_t in_data; // input data 79 int out_rc; // return code from the test 80 int out_len; // output data length 81 caddr_t out_data; // output data 82}; 83 84typedef struct tagp_interface tagp_interface_t; 85 86 87 88 89 90