input_dev 结构体成员注释
2013-03-04 14:26
211 查看
Name
struct input_dev — represents an input device
Synopsis
struct input_dev {
const char * name;//name of the device
const char * phys;//physical path
to the device in the system hierarchy
const char * uniq;//unique identification code
for the device (if device has it)
struct input_id id;//id of the device
(struct input_id)
unsigned long evbit[BITS_TO_LONGS(EV_CNT)];
//bitmap of types of events supported by the device
(EV_KEY, EV_REL, etc.)
unsigned long keybit[BITS_TO_LONGS(KEY_CNT)];
//bitmap of keys/buttons this device has
unsigned long relbit[BITS_TO_LONGS(REL_CNT)];
//bitmap of relative axes
for the device
unsigned long absbit[BITS_TO_LONGS(ABS_CNT)];
//bitmap of absolute axes
for the device
unsigned long mscbit[BITS_TO_LONGS(MSC_CNT)];
//bitmap of miscellaneous events supported by the device
unsigned long ledbit[BITS_TO_LONGS(LED_CNT)];//bitmap
of leds present on the device
unsigned long sndbit[BITS_TO_LONGS(SND_CNT)];//bitmap
of sound effects supported by the device
unsigned long ffbit[BITS_TO_LONGS(FF_CNT)];//bitmap
of force feedback effects supported by the device
unsigned long swbit[BITS_TO_LONGS(SW_CNT)];//bitmap
of switches present on the device
unsigned int keycodemax;//size of keycode table
unsigned int keycodesize;//size of elements
in keycode table
void * keycode;//map of scancodes
to keycodes for this device
/*optional method
to alter current keymap, used
to implement sparse keymaps.
If not supplied default mechanism will be used*/
int (* setkeycode)
(struct input_dev *dev,
int scancode,
int keycode);
/*optional method
to retrieve current keymap.
If not supplied default mechanism will be used*/
int (* getkeycode)
(struct input_dev *dev,
int scancode,
int *keycode);
struct ff_device * ff;//force feedback structure associated with the device
if device supports force feedback effects
unsigned int repeat_key;//stores key code of the last key pressed; used
to implement software autorepeat
struct timer_list timer;//timer
for software autorepeat
int sync;//set
to 1 when there were no new events since last EV_SYNC
int abs[ABS_MAX
+ 1];
//current values
for reports from absolute axes
int rep[REP_MAX
+ 1];//current values
for autorepeat parameters
(delay, rate)
unsigned long key[BITS_TO_LONGS(KEY_CNT)];
//reflects current state of device's keys/buttons
unsigned long led[BITS_TO_LONGS(LED_CNT)];//reflects
current state of device's LEDs
unsigned long snd[BITS_TO_LONGS(SND_CNT)];//reflects
current state of sound effects
unsigned long sw[BITS_TO_LONGS(SW_CNT)];//reflects
current state of device's switches
int absmax[ABS_MAX
+ 1];//maximum values
for events coming from absolute axes
int absmin[ABS_MAX
+ 1];//minimum values
for events coming from absolute axes
int absfuzz[ABS_MAX
+ 1];//describes noisiness
for axes
int absflat[ABS_MAX
+ 1];//size of the center flat position
(used by joydev)
/*this method
is called when the very first user calls input_open_device.
The driver must prepare the device to start generating events
(start polling
thread, request an IRQ, submit URB, etc.)
*/
int (* open)
(struct input_dev *dev);
void (* close)
(struct input_dev *dev);//this method
is called when the very last user calls input_close_device.
/*purges the device. Most commonly used
to get rid of force feedback effects
loaded into the device when disconnecting from it
*/
int (* flush)
(struct input_dev *dev, struct file
*file);
/*event handler
for events sent _to_ the device, like EV_LED
or EV_SND.
The device is expected
to carry out the requested action (turn
on a LED, play sound, etc.)
The call is protected by event_lock
and must not sleep
*/
int (* event)
(struct input_dev *dev, unsigned
int type, unsigned
int code,
int value);
/*input handle that currently has the device grabbed
(via EVIOCGRAB ioctl).
When a handle grabs a device it becomes sole recipient
for all input events coming from the device */
struct input_handle * grab;
/*this spinlock
is is taken when input core receives
and processes a new event
for the device (in input_event). Code that accesses
and/or modifies parameters of a device
(such as keymap or absmin, absmax, absfuzz, etc.)
after device has been registered with input core must take this lock.
*/
spinlock_t event_lock;
struct mutex mutex;
//serializes calls
to open, close
and flush methods
/*stores number of users
(input handlers) that opened this device. It
is used by input_open_device
and input_close_device to make sure that dev->open
is only called when the first user opens device
and dev->close
is called when the very last user closes the device
*/
unsigned int users;
int going_away;
//marks devices that are
in a middle of unregistering
and causes input_open_device*() fail with
-ENODEV.
struct device dev;
//driver model's view of this device
struct list_head h_list;
//list of input handles associated with the device. When accessing the list dev->mutex must be held
struct list_head node;
//used to place the device onto input_dev_list
};
struct input_dev — represents an input device
Synopsis
struct input_dev {
const char * name;//name of the device
const char * phys;//physical path
to the device in the system hierarchy
const char * uniq;//unique identification code
for the device (if device has it)
struct input_id id;//id of the device
(struct input_id)
unsigned long evbit[BITS_TO_LONGS(EV_CNT)];
//bitmap of types of events supported by the device
(EV_KEY, EV_REL, etc.)
unsigned long keybit[BITS_TO_LONGS(KEY_CNT)];
//bitmap of keys/buttons this device has
unsigned long relbit[BITS_TO_LONGS(REL_CNT)];
//bitmap of relative axes
for the device
unsigned long absbit[BITS_TO_LONGS(ABS_CNT)];
//bitmap of absolute axes
for the device
unsigned long mscbit[BITS_TO_LONGS(MSC_CNT)];
//bitmap of miscellaneous events supported by the device
unsigned long ledbit[BITS_TO_LONGS(LED_CNT)];//bitmap
of leds present on the device
unsigned long sndbit[BITS_TO_LONGS(SND_CNT)];//bitmap
of sound effects supported by the device
unsigned long ffbit[BITS_TO_LONGS(FF_CNT)];//bitmap
of force feedback effects supported by the device
unsigned long swbit[BITS_TO_LONGS(SW_CNT)];//bitmap
of switches present on the device
unsigned int keycodemax;//size of keycode table
unsigned int keycodesize;//size of elements
in keycode table
void * keycode;//map of scancodes
to keycodes for this device
/*optional method
to alter current keymap, used
to implement sparse keymaps.
If not supplied default mechanism will be used*/
int (* setkeycode)
(struct input_dev *dev,
int scancode,
int keycode);
/*optional method
to retrieve current keymap.
If not supplied default mechanism will be used*/
int (* getkeycode)
(struct input_dev *dev,
int scancode,
int *keycode);
struct ff_device * ff;//force feedback structure associated with the device
if device supports force feedback effects
unsigned int repeat_key;//stores key code of the last key pressed; used
to implement software autorepeat
struct timer_list timer;//timer
for software autorepeat
int sync;//set
to 1 when there were no new events since last EV_SYNC
int abs[ABS_MAX
+ 1];
//current values
for reports from absolute axes
int rep[REP_MAX
+ 1];//current values
for autorepeat parameters
(delay, rate)
unsigned long key[BITS_TO_LONGS(KEY_CNT)];
//reflects current state of device's keys/buttons
unsigned long led[BITS_TO_LONGS(LED_CNT)];//reflects
current state of device's LEDs
unsigned long snd[BITS_TO_LONGS(SND_CNT)];//reflects
current state of sound effects
unsigned long sw[BITS_TO_LONGS(SW_CNT)];//reflects
current state of device's switches
int absmax[ABS_MAX
+ 1];//maximum values
for events coming from absolute axes
int absmin[ABS_MAX
+ 1];//minimum values
for events coming from absolute axes
int absfuzz[ABS_MAX
+ 1];//describes noisiness
for axes
int absflat[ABS_MAX
+ 1];//size of the center flat position
(used by joydev)
/*this method
is called when the very first user calls input_open_device.
The driver must prepare the device to start generating events
(start polling
thread, request an IRQ, submit URB, etc.)
*/
int (* open)
(struct input_dev *dev);
void (* close)
(struct input_dev *dev);//this method
is called when the very last user calls input_close_device.
/*purges the device. Most commonly used
to get rid of force feedback effects
loaded into the device when disconnecting from it
*/
int (* flush)
(struct input_dev *dev, struct file
*file);
/*event handler
for events sent _to_ the device, like EV_LED
or EV_SND.
The device is expected
to carry out the requested action (turn
on a LED, play sound, etc.)
The call is protected by event_lock
and must not sleep
*/
int (* event)
(struct input_dev *dev, unsigned
int type, unsigned
int code,
int value);
/*input handle that currently has the device grabbed
(via EVIOCGRAB ioctl).
When a handle grabs a device it becomes sole recipient
for all input events coming from the device */
struct input_handle * grab;
/*this spinlock
is is taken when input core receives
and processes a new event
for the device (in input_event). Code that accesses
and/or modifies parameters of a device
(such as keymap or absmin, absmax, absfuzz, etc.)
after device has been registered with input core must take this lock.
*/
spinlock_t event_lock;
struct mutex mutex;
//serializes calls
to open, close
and flush methods
/*stores number of users
(input handlers) that opened this device. It
is used by input_open_device
and input_close_device to make sure that dev->open
is only called when the first user opens device
and dev->close
is called when the very last user closes the device
*/
unsigned int users;
int going_away;
//marks devices that are
in a middle of unregistering
and causes input_open_device*() fail with
-ENODEV.
struct device dev;
//driver model's view of this device
struct list_head h_list;
//list of input handles associated with the device. When accessing the list dev->mutex must be held
struct list_head node;
//used to place the device onto input_dev_list
};
相关文章推荐
- Input_dev结构体分析
- 在触摸屏驱动中,通常在probe函数中会调用input_set_abs_params给设备的input_dev结构体初始化 ,上报点input_mt_sync(input);
- input_dev结构体设计
- task_struck结构体成员注释
- input_dev结构体分析
- >Input_dev结构体-事件支持
- input_dev结构体分析
- input_dev结构体分析
- task_struct结构体中comm成员
- C语言结构体里的成员数组和指针
- 结构体中最后成员为一个数组(长度为零)与一个指针
- Linux输入子系统 input_dev 概述
- linux中结构体成员变量加“点”问题
- 类和结构体的成员
- 第二课:类与对象(内联函数、成员函数重载、类与结构体、this指针)
- 结构体中申明枚举类型成员后,为什么结构体的长度为0
- C语言根据结构体成员变量的地址,得到结构体的地址
- Linux如何查看与/dev/input目录下的event对应的设备
- 计算结构体成员偏移量
- C语言结构体及其成员地址的互算