Files
kernel/include/linux/miscdevice.h
T

112 lines
3.2 KiB
C
Raw Normal View History

/* SPDX-License-Identifier: GPL-2.0 */
2005-04-16 15:20:36 -07:00
#ifndef _LINUX_MISCDEVICE_H
#define _LINUX_MISCDEVICE_H
#include <linux/major.h>
#include <linux/list.h>
#include <linux/types.h>
#include <linux/device.h>
2005-04-16 15:20:36 -07:00
/*
* These allocations are managed by device@lanana.org. If you need
* an entry that is not assigned here, it can be moved and
* reassigned or dynamically set if a fixed value is not justified.
*/
2008-11-26 12:03:54 +01:00
#define PSMOUSE_MINOR 1
2014-02-18 02:27:24 -03:00
#define MS_BUSMOUSE_MINOR 2 /* unused */
#define ATIXL_BUSMOUSE_MINOR 3 /* unused */
2008-11-26 12:03:54 +01:00
/*#define AMIGAMOUSE_MINOR 4 FIXME OBSOLETE */
2014-02-18 02:27:24 -03:00
#define ATARIMOUSE_MINOR 5 /* unused */
#define SUN_MOUSE_MINOR 6 /* unused */
#define APOLLO_MOUSE_MINOR 7 /* unused */
#define PC110PAD_MINOR 9 /* unused */
2008-11-26 12:03:54 +01:00
/*#define ADB_MOUSE_MINOR 10 FIXME OBSOLETE */
2005-04-16 15:20:36 -07:00
#define WATCHDOG_MINOR 130 /* Watchdog timer */
#define TEMP_MINOR 131 /* Temperature Sensor */
#define APM_MINOR_DEV 134
2008-11-26 12:03:54 +01:00
#define RTC_MINOR 135
2020-02-26 23:43:21 +01:00
/*#define EFI_RTC_MINOR 136 was EFI Time services */
2014-02-18 02:19:26 -03:00
#define VHCI_MINOR 137
2008-11-26 12:03:54 +01:00
#define SUN_OPENPROM_MINOR 139
2014-02-18 02:27:24 -03:00
#define DMAPI_MINOR 140 /* unused */
2008-11-26 12:03:54 +01:00
#define NVRAM_MINOR 144
#define SBUS_FLASH_MINOR 152
2008-11-26 12:03:54 +01:00
#define SGI_MMTIMER 153
#define PMU_MINOR 154
2014-02-18 02:27:24 -03:00
#define STORE_QUEUE_MINOR 155 /* unused */
#define LCD_MINOR 156
#define AC_MINOR 157
#define BUTTON_MINOR 158 /* Major 10, Minor 158, /dev/nwbutton */
#define NWFLASH_MINOR 160 /* MAJOR is 10 - miscdevice */
#define ENVCTRL_MINOR 162
2008-11-26 12:03:54 +01:00
#define I2O_MINOR 166
#define UCTRL_MINOR 174
#define AGPGART_MINOR 175
#define TOSH_MINOR_DEV 181
#define HWRNG_MINOR 183
2005-04-16 15:20:36 -07:00
#define MICROCODE_MINOR 184
#define KEYPAD_MINOR 185
#define IRNET_MINOR 187
#define D7S_MINOR 193
2013-12-19 10:17:11 -07:00
#define VFIO_MINOR 196
#define PXA3XX_GCU_MINOR 197
2008-11-26 12:03:54 +01:00
#define TUN_MINOR 200
2013-09-09 20:18:27 +02:00
#define CUSE_MINOR 203
2008-11-26 12:03:54 +01:00
#define MWAVE_MINOR 219 /* ACP/Mwave Modem */
#define MPT_MINOR 220
#define MPT2SAS_MINOR 221
#define MPT3SAS_MINOR 222
#define UINPUT_MINOR 223
#define MISC_MCELOG_MINOR 227
2008-11-26 12:03:54 +01:00
#define HPET_MINOR 228
#define FUSE_MINOR 229
#define SNAPSHOT_MINOR 231
2008-11-26 12:03:54 +01:00
#define KVM_MINOR 232
#define BTRFS_MINOR 234
#define AUTOFS_MINOR 235
2010-08-12 04:14:05 +01:00
#define MAPPER_CTRL_MINOR 236
#define LOOP_CTRL_MINOR 237
2012-01-11 19:30:38 +00:00
#define VHOST_NET_MINOR 238
2013-09-09 18:33:54 +02:00
#define UHID_MINOR 239
2015-10-24 13:10:29 -07:00
#define USERIO_MINOR 240
2017-05-10 10:19:18 -04:00
#define VHOST_VSOCK_MINOR 241
2019-10-24 19:40:42 +02:00
#define RFKILL_MINOR 242
2008-11-26 12:03:54 +01:00
#define MISC_DYNAMIC_MINOR 255
2005-04-16 15:20:36 -07:00
struct device;
2015-02-02 15:44:54 +01:00
struct attribute_group;
2005-04-16 15:20:36 -07:00
struct miscdevice {
int minor;
const char *name;
2006-03-28 01:56:41 -08:00
const struct file_operations *fops;
2005-04-16 15:20:36 -07:00
struct list_head list;
struct device *parent;
struct device *this_device;
2015-02-02 15:44:54 +01:00
const struct attribute_group **groups;
const char *nodename;
2011-07-26 04:47:38 -04:00
umode_t mode;
2005-04-16 15:20:36 -07:00
};
extern int misc_register(struct miscdevice *misc);
2015-07-30 15:59:57 -07:00
extern void misc_deregister(struct miscdevice *misc);
2005-04-16 15:20:36 -07:00
2016-10-22 18:36:05 -04:00
/*
* Helper macro for drivers that don't do anything special in the initcall.
* This helps to eliminate boilerplate code.
2016-10-22 18:36:05 -04:00
*/
#define builtin_misc_device(__misc_device) \
builtin_driver(__misc_device, misc_register)
/*
* Helper macro for drivers that don't do anything special in module init / exit
* call. This helps to eliminate boilerplate code.
*/
#define module_misc_device(__misc_device) \
module_driver(__misc_device, misc_register, misc_deregister)
2005-04-16 15:20:36 -07:00
#define MODULE_ALIAS_MISCDEV(minor) \
MODULE_ALIAS("char-major-" __stringify(MISC_MAJOR) \
"-" __stringify(minor))
#endif