Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
hid-core.c File Reference
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/mm.h>
#include <linux/spinlock.h>
#include <asm/unaligned.h>
#include <asm/byteorder.h>
#include <linux/input.h>
#include <linux/wait.h>
#include <linux/vmalloc.h>
#include <linux/sched.h>
#include <linux/semaphore.h>
#include <linux/hid.h>
#include <linux/hiddev.h>
#include <linux/hid-debug.h>
#include <linux/hidraw.h>
#include "hid-ids.h"

Go to the source code of this file.

Data Structures

struct  hid_dynid
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define DRIVER_DESC   "HID core driver"
 
#define DRIVER_LICENSE   "GPL"
 

Functions

 module_param_named (debug, hid_debug, int, 0600)
 
 MODULE_PARM_DESC (debug,"toggle HID debugging messages")
 
 EXPORT_SYMBOL_GPL (hid_debug)
 
 module_param_named (ignore_special_drivers, hid_ignore_special_drivers, int, 0600)
 
 MODULE_PARM_DESC (debug,"Ignore any special drivers and handle all devices by generic driver")
 
struct hid_reporthid_register_report (struct hid_device *device, unsigned type, unsigned id)
 
 EXPORT_SYMBOL_GPL (hid_register_report)
 
int hid_parse_report (struct hid_device *hid, __u8 *start, unsigned size)
 
 EXPORT_SYMBOL_GPL (hid_parse_report)
 
int hid_open_report (struct hid_device *device)
 
 EXPORT_SYMBOL_GPL (hid_open_report)
 
void hid_output_report (struct hid_report *report, __u8 *data)
 
 EXPORT_SYMBOL_GPL (hid_output_report)
 
int hid_set_field (struct hid_field *field, unsigned offset, __s32 value)
 
 EXPORT_SYMBOL_GPL (hid_set_field)
 
int hid_report_raw_event (struct hid_device *hid, int type, u8 *data, int size, int interrupt)
 
 EXPORT_SYMBOL_GPL (hid_report_raw_event)
 
int hid_input_report (struct hid_device *hid, int type, u8 *data, int size, int interrupt)
 
 EXPORT_SYMBOL_GPL (hid_input_report)
 
struct hid_device_idhid_match_id (struct hid_device *hdev, const struct hid_device_id *id)
 
int hid_connect (struct hid_device *hdev, unsigned int connect_mask)
 
 EXPORT_SYMBOL_GPL (hid_connect)
 
void hid_disconnect (struct hid_device *hdev)
 
 EXPORT_SYMBOL_GPL (hid_disconnect)
 
int hid_add_device (struct hid_device *hdev)
 
 EXPORT_SYMBOL_GPL (hid_add_device)
 
struct hid_devicehid_allocate_device (void)
 
 EXPORT_SYMBOL_GPL (hid_allocate_device)
 
void hid_destroy_device (struct hid_device *hdev)
 
 EXPORT_SYMBOL_GPL (hid_destroy_device)
 
int __hid_register_driver (struct hid_driver *hdrv, struct module *owner, const char *mod_name)
 
 EXPORT_SYMBOL_GPL (__hid_register_driver)
 
void hid_unregister_driver (struct hid_driver *hdrv)
 
 EXPORT_SYMBOL_GPL (hid_unregister_driver)
 
int hid_check_keys_pressed (struct hid_device *hid)
 
 EXPORT_SYMBOL_GPL (hid_check_keys_pressed)
 
 module_init (hid_init)
 
 module_exit (hid_exit)
 
 MODULE_AUTHOR ("Andreas Gal")
 
 MODULE_AUTHOR ("Vojtech Pavlik")
 
 MODULE_AUTHOR ("Jiri Kosina")
 
 MODULE_LICENSE (DRIVER_LICENSE)
 

Variables

int hid_debug = 0
 

Macro Definition Documentation

#define DRIVER_DESC   "HID core driver"

Definition at line 45 of file hid-core.c.

#define DRIVER_LICENSE   "GPL"

Definition at line 46 of file hid-core.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 17 of file hid-core.c.

Function Documentation

int __hid_register_driver ( struct hid_driver hdrv,
struct module owner,
const char mod_name 
)

Definition at line 2310 of file hid-core.c.

EXPORT_SYMBOL_GPL ( hid_debug  )
EXPORT_SYMBOL_GPL ( hid_register_report  )
EXPORT_SYMBOL_GPL ( hid_parse_report  )
EXPORT_SYMBOL_GPL ( hid_open_report  )
EXPORT_SYMBOL_GPL ( hid_output_report  )
EXPORT_SYMBOL_GPL ( hid_set_field  )
EXPORT_SYMBOL_GPL ( hid_report_raw_event  )
EXPORT_SYMBOL_GPL ( hid_input_report  )
EXPORT_SYMBOL_GPL ( hid_connect  )
EXPORT_SYMBOL_GPL ( hid_disconnect  )
EXPORT_SYMBOL_GPL ( hid_add_device  )
EXPORT_SYMBOL_GPL ( hid_allocate_device  )
EXPORT_SYMBOL_GPL ( hid_destroy_device  )
EXPORT_SYMBOL_GPL ( __hid_register_driver  )
EXPORT_SYMBOL_GPL ( hid_unregister_driver  )
EXPORT_SYMBOL_GPL ( hid_check_keys_pressed  )
int hid_add_device ( struct hid_device hdev)

Definition at line 2201 of file hid-core.c.

struct hid_device* hid_allocate_device ( void  )
read

hid_allocate_device - allocate new hid device descriptor

Allocate and initialize hid device, so that hid_destroy_device might be used to free it.

New hid_device pointer is returned on success, otherwise ERR_PTR encoded error value.

Definition at line 2260 of file hid-core.c.

int hid_check_keys_pressed ( struct hid_device hid)

Definition at line 2343 of file hid-core.c.

int hid_connect ( struct hid_device hdev,
unsigned int  connect_mask 
)

Definition at line 1361 of file hid-core.c.

void hid_destroy_device ( struct hid_device hdev)

hid_destroy_device - free previously allocated device

: hid device

If you allocate hid_device through hid_allocate_device, you should ever free by this function.

Definition at line 2303 of file hid-core.c.

void hid_disconnect ( struct hid_device hdev)

Definition at line 1449 of file hid-core.c.

int hid_input_report ( struct hid_device hid,
int  type,
u8 data,
int  size,
int  interrupt 
)

hid_input_report - report data from lower layer (usb, bt...)

: hid device : HID report type (HID_*_REPORT) : report contents : size of data parameter : distinguish between interrupt and control transfers

This is data entry for lower layers.

Definition at line 1231 of file hid-core.c.

struct hid_device_id* hid_match_id ( struct hid_device hdev,
const struct hid_device_id id 
)
read

Definition at line 1314 of file hid-core.c.

int hid_open_report ( struct hid_device device)

hid_open_report - open a driver-specific device report

: hid device

Parse a report description into a hid_device structure. Reports are enumerated, fields are attached to these reports. 0 returned on success, otherwise nonzero error value.

This function (or the equivalent hid_parse() macro) should only be called from probe() in drivers, before starting the device.

Definition at line 754 of file hid-core.c.

void hid_output_report ( struct hid_report report,
__u8 data 
)

Definition at line 1112 of file hid-core.c.

int hid_parse_report ( struct hid_device hid,
__u8 start,
unsigned  size 
)

hid_parse_report - parse device report

: hid device : report start : report size

Allocate the device report as read by the bus driver. This function should only be called from parse() in ll drivers.

Definition at line 732 of file hid-core.c.

struct hid_report* hid_register_report ( struct hid_device device,
unsigned  type,
unsigned  id 
)
read

Definition at line 61 of file hid-core.c.

int hid_report_raw_event ( struct hid_device hid,
int  type,
u8 data,
int  size,
int  interrupt 
)

Definition at line 1170 of file hid-core.c.

int hid_set_field ( struct hid_field field,
unsigned  offset,
__s32  value 
)

Definition at line 1131 of file hid-core.c.

void hid_unregister_driver ( struct hid_driver hdrv)

Definition at line 2335 of file hid-core.c.

MODULE_AUTHOR ( "Andreas Gal"  )
MODULE_AUTHOR ( "Vojtech Pavlik"  )
MODULE_AUTHOR ( "Jiri Kosina"  )
module_exit ( hid_exit  )
module_init ( hid_init  )
MODULE_LICENSE ( DRIVER_LICENSE  )
module_param_named ( debug  ,
hid_debug  ,
int  ,
0600   
)
module_param_named ( ignore_special_drivers  ,
hid_ignore_special_drivers  ,
int  ,
0600   
)
MODULE_PARM_DESC ( debug  ,
"toggle HID debugging messages"   
)
MODULE_PARM_DESC ( debug  ,
"Ignore any special drivers and handle all devices by generic driver  
)

Variable Documentation

int hid_debug = 0

Definition at line 48 of file hid-core.c.