1*e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: LGPL-2.0+ WITH Linux-syscall-note */ 25523662eSStephen Chandler Paul /* 35523662eSStephen Chandler Paul * userio: virtual serio device support 45523662eSStephen Chandler Paul * Copyright (C) 2015 Red Hat 55523662eSStephen Chandler Paul * Copyright (C) 2015 Lyude (Stephen Chandler Paul) <cpaul@redhat.com> 65523662eSStephen Chandler Paul * 75523662eSStephen Chandler Paul * This program is free software; you can redistribute it and/or modify it 85523662eSStephen Chandler Paul * under the terms of the GNU Lesser General Public License as published by the 95523662eSStephen Chandler Paul * Free Software Foundation; either version 2 of the License, or (at your 105523662eSStephen Chandler Paul * option) any later version. 115523662eSStephen Chandler Paul * 125523662eSStephen Chandler Paul * This program is distributed in the hope that it will be useful, but WITHOUT 135523662eSStephen Chandler Paul * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 145523662eSStephen Chandler Paul * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 155523662eSStephen Chandler Paul * details. 165523662eSStephen Chandler Paul * 175523662eSStephen Chandler Paul * This is the public header used for user-space communication with the userio 185523662eSStephen Chandler Paul * driver. __attribute__((__packed__)) is used for all structs to keep ABI 195523662eSStephen Chandler Paul * compatibility between all architectures. 205523662eSStephen Chandler Paul */ 215523662eSStephen Chandler Paul 225523662eSStephen Chandler Paul #ifndef _USERIO_H 235523662eSStephen Chandler Paul #define _USERIO_H 245523662eSStephen Chandler Paul 255523662eSStephen Chandler Paul #include <linux/types.h> 265523662eSStephen Chandler Paul 275523662eSStephen Chandler Paul enum userio_cmd_type { 285523662eSStephen Chandler Paul USERIO_CMD_REGISTER = 0, 295523662eSStephen Chandler Paul USERIO_CMD_SET_PORT_TYPE = 1, 305523662eSStephen Chandler Paul USERIO_CMD_SEND_INTERRUPT = 2 315523662eSStephen Chandler Paul }; 325523662eSStephen Chandler Paul 335523662eSStephen Chandler Paul /* 345523662eSStephen Chandler Paul * userio Commands 355523662eSStephen Chandler Paul * All commands sent to /dev/userio are encoded using this structure. The type 365523662eSStephen Chandler Paul * field should contain a USERIO_CMD* value that indicates what kind of command 375523662eSStephen Chandler Paul * is being sent to userio. The data field should contain the accompanying 385523662eSStephen Chandler Paul * argument for the command, if there is one. 395523662eSStephen Chandler Paul */ 405523662eSStephen Chandler Paul struct userio_cmd { 415523662eSStephen Chandler Paul __u8 type; 425523662eSStephen Chandler Paul __u8 data; 435523662eSStephen Chandler Paul } __attribute__((__packed__)); 445523662eSStephen Chandler Paul 455523662eSStephen Chandler Paul #endif /* !_USERIO_H */ 46