config HID_BATTERY_STRENGTH
bool "Battery level reporting for HID devices"
- depends on HID
select POWER_SUPPLY
default n
help
config HIDRAW
bool "/dev/hidraw raw HID device support"
- depends on HID
help
Say Y here if you want to support HID devices (from the USB
specification standpoint) that aren't strictly user interface
config UHID
tristate "User-space I/O driver support for HID subsystem"
- depends on HID
default n
help
Say Y here if you want to provide HID I/O Drivers from user-space.
config HID_GENERIC
tristate "Generic HID driver"
- depends on HID
default HID
help
Support for generic devices on the HID bus. This includes most
If unsure, say Y.
menu "Special HID drivers"
- depends on HID
config HID_A4TECH
tristate "A4TECH mice"
- depends on HID
default !EXPERT
help
Support for some A4TECH mice with two scroll wheels.
config HID_ACRUX
tristate "ACRUX game controller support"
- depends on HID
help
Say Y here if you want to enable support for ACRUX game controllers.
config HID_APPLE
tristate "Apple {i,Power,Mac}Books"
- depends on HID
depends on LEDS_CLASS
depends on NEW_LEDS
default !EXPERT
config HID_AUREAL
tristate "Aureal"
- depends on HID
help
Support for Aureal Cy se W-01RN Remote Controller and other Aureal derived remotes.
config HID_BELKIN
tristate "Belkin Flip KVM and Wireless keyboard"
- depends on HID
default !EXPERT
help
Support for Belkin Flip KVM and Wireless keyboard.
config HID_CHERRY
tristate "Cherry Cymotion keyboard"
- depends on HID
default !EXPERT
help
Support for Cherry Cymotion keyboard.
config HID_COUGAR
tristate "Cougar devices"
- depends on HID
help
Support for Cougar devices that are not fully compliant with the
HID standard.
config HID_MACALLY
tristate "Macally devices"
- depends on HID
help
Support for Macally devices that are not fully compliant with the
HID standard.
config HID_CMEDIA
tristate "CMedia audio chips"
- depends on HID
help
Support for CMedia CM6533 HID audio jack controls
and HS100B mute buttons.
config HID_CYPRESS
tristate "Cypress mouse and barcode readers"
- depends on HID
default !EXPERT
help
Support for cypress mouse and barcode readers.
config HID_DRAGONRISE
tristate "DragonRise Inc. game controller"
- depends on HID
help
Say Y here if you have DragonRise Inc. game controllers.
These might be branded as:
config HID_EMS_FF
tristate "EMS Production Inc. force feedback support"
- depends on HID
select INPUT_FF_MEMLESS
help
Say Y here if you want to enable force feedback support for devices by
config HID_ELECOM
tristate "ELECOM HID devices"
- depends on HID
help
Support for ELECOM devices:
- BM084 Bluetooth Mouse
config HID_EZKEY
tristate "Ezkey BTC 8193 keyboard"
- depends on HID
default !EXPERT
help
Support for Ezkey BTC 8193 keyboard.
config HID_GEMBIRD
tristate "Gembird Joypad"
- depends on HID
help
Support for Gembird JPD-DualForce 2.
config HID_GFRM
tristate "Google Fiber TV Box remote control support"
- depends on HID
help
Support for Google Fiber TV Box remote controls
config HID_GLORIOUS
tristate "Glorious PC Gaming Race mice"
- depends on HID
help
Support for Glorious PC Gaming Race mice such as
the Glorious Model O, O- and D.
tristate "Vivaldi Keyboard"
select HID_VIVALDI_COMMON
select INPUT_VIVALDIFMAP
- depends on HID
help
Say Y here if you want to enable support for Vivaldi keyboards.
config HID_KEYTOUCH
tristate "Keytouch HID devices"
- depends on HID
help
Support for Keytouch HID devices not fully compliant with
the specification. Currently supported:
config HID_KYE
tristate "KYE/Genius devices"
- depends on HID
help
Support for KYE/Genius devices not fully compliant with HID standard:
- Ergo Mouse
config HID_WALTOP
tristate "Waltop"
- depends on HID
help
Support for Waltop tablets.
config HID_VIEWSONIC
tristate "ViewSonic/Signotec"
- depends on HID
help
Support for ViewSonic/Signotec PD1011 signature pad.
config HID_XIAOMI
tristate "Xiaomi"
- depends on HID
help
Adds support for side buttons of Xiaomi Mi Dual Mode Wireless
Mouse Silent Edition.
config HID_GYRATION
tristate "Gyration remote control"
- depends on HID
help
Support for Gyration remote control.
config HID_ICADE
tristate "ION iCade arcade controller"
- depends on HID
help
Support for the ION iCade arcade controller to work as a joystick.
config HID_ITE
tristate "ITE devices"
- depends on HID
default !EXPERT
help
Support for ITE devices not fully compliant with HID standard.
config HID_JABRA
tristate "Jabra USB HID Driver"
- depends on HID
help
Support for Jabra USB HID devices.
config HID_TWINHAN
tristate "Twinhan IR remote control"
- depends on HID
help
Support for Twinhan IR remote control.
config HID_KENSINGTON
tristate "Kensington Slimblade Trackball"
- depends on HID
default !EXPERT
help
Support for Kensington Slimblade Trackball.
config HID_LCPOWER
tristate "LC-Power"
- depends on HID
help
Support for LC-Power RC1000MCE RF remote control.
config HID_LED
tristate "Simple RGB LED support"
- depends on HID
depends on LEDS_CLASS
help
Support for simple RGB LED devices. Currently supported are:
config HID_LENOVO
tristate "Lenovo / Thinkpad devices"
- depends on HID
select NEW_LEDS
select LEDS_CLASS
help
config HID_MAGICMOUSE
tristate "Apple Magic Mouse/Trackpad multi-touch support"
- depends on HID
help
Support for the Apple Magic Mouse/Trackpad multi-touch.
config HID_MALTRON
tristate "Maltron L90 keyboard"
- depends on HID
help
Adds support for the volume up, volume down, mute, and play/pause buttons
of the Maltron L90 keyboard.
config HID_MAYFLASH
tristate "Mayflash game controller adapter force feedback"
- depends on HID
select INPUT_FF_MEMLESS
help
Say Y here if you have HJZ Mayflash PS3 game controller adapters
config HID_REDRAGON
tristate "Redragon keyboards"
- depends on HID
default !EXPERT
help
Support for Redragon keyboards that need fix-ups to work properly.
config HID_MICROSOFT
tristate "Microsoft non-fully HID-compliant devices"
- depends on HID
default !EXPERT
select INPUT_FF_MEMLESS
help
config HID_MONTEREY
tristate "Monterey Genius KB29E keyboard"
- depends on HID
default !EXPERT
help
Support for Monterey Genius KB29E.
config HID_MULTITOUCH
tristate "HID Multitouch panels"
- depends on HID
help
Generic support for HID multitouch panels.
config HID_NINTENDO
tristate "Nintendo Joy-Con and Pro Controller support"
- depends on HID
depends on NEW_LEDS
depends on LEDS_CLASS
select POWER_SUPPLY
config HID_ORTEK
tristate "Ortek PKB-1700/WKB-2000/Skycable wireless keyboard and mouse trackpad"
- depends on HID
help
There are certain devices which have LogicalMaximum wrong in the keyboard
usage page of their report descriptor. The most prevailing ones so far
config HID_PANTHERLORD
tristate "Pantherlord/GreenAsia game controller"
- depends on HID
help
Say Y here if you have a PantherLord/GreenAsia based game controller
or adapter.
config HID_PETALYNX
tristate "Petalynx Maxter remote control"
- depends on HID
help
Support for Petalynx Maxter remote control.
config HID_PICOLCD
tristate "PicoLCD (graphic version)"
- depends on HID
help
This provides support for Minibox PicoLCD devices, currently
only the graphical ones are supported.
config HID_PLANTRONICS
tristate "Plantronics USB HID Driver"
- depends on HID
help
Provides HID support for Plantronics USB audio devices.
Correctly maps vendor unique volume up/down HID usages to
config HID_PLAYSTATION
tristate "PlayStation HID Driver"
- depends on HID
depends on LEDS_CLASS_MULTICOLOR
select CRC32
select POWER_SUPPLY
config HID_RAZER
tristate "Razer non-fully HID-compliant devices"
- depends on HID
help
Support for Razer devices that are not fully compliant with the
HID standard.
config HID_PRIMAX
tristate "Primax non-fully HID-compliant devices"
- depends on HID
help
Support for Primax devices that are not fully compliant with the
HID standard.
config HID_SAITEK
tristate "Saitek (Mad Catz) non-fully HID-compliant devices"
- depends on HID
help
Support for Saitek devices that are not fully compliant with the
HID standard.
config HID_SEMITEK
tristate "Semitek USB keyboards"
- depends on HID
help
Support for Semitek USB keyboards that are not fully compliant
with the HID standard.
config HID_SPEEDLINK
tristate "Speedlink VAD Cezanne mouse support"
- depends on HID
help
Support for Speedlink Vicious and Divine Cezanne mouse.
config HID_STEAM
tristate "Steam Controller support"
- depends on HID
select POWER_SUPPLY
help
Say Y here if you have a Steam Controller if you want to use it
config HID_STEELSERIES
tristate "Steelseries SRW-S1 steering wheel support"
- depends on HID
help
Support for Steelseries SRW-S1 steering wheel
config HID_SUNPLUS
tristate "Sunplus wireless desktop"
- depends on HID
help
Support for Sunplus wireless desktop.
config HID_RMI
tristate "Synaptics RMI4 device support"
- depends on HID
select RMI4_CORE
select RMI4_F03
select RMI4_F11
config HID_GREENASIA
tristate "GreenAsia (Product ID 0x12) game controller support"
- depends on HID
help
Say Y here if you have a GreenAsia (Product ID 0x12) based game
controller or adapter.
config HID_SMARTJOYPLUS
tristate "SmartJoy PLUS PS2/USB adapter support"
- depends on HID
help
Support for SmartJoy PLUS PS2/USB adapter, Super Dual Box,
Super Joy Box 3 Pro, Super Dual Box Pro, and Super Joy Box 5 Pro.
config HID_TIVO
tristate "TiVo Slide Bluetooth remote control support"
- depends on HID
help
Say Y if you have a TiVo Slide Bluetooth remote control.
config HID_TOPSEED
tristate "TopSeed Cyberlink, BTC Emprex, Conceptronic remote control support"
- depends on HID
help
Say Y if you have a TopSeed Cyberlink or BTC Emprex or Conceptronic
CLLRCMCE remote control.
config HID_THINGM
tristate "ThingM blink(1) USB RGB LED"
- depends on HID
depends on LEDS_CLASS
select HID_LED
help
config HID_UDRAW_PS3
tristate "THQ PS3 uDraw tablet"
- depends on HID
help
Say Y here if you want to use the THQ uDraw gaming tablet for
the PS3.
config HID_WIIMOTE
tristate "Nintendo Wii / Wii U peripherals"
- depends on HID
depends on LEDS_CLASS
select POWER_SUPPLY
select INPUT_FF_MEMLESS
config HID_XINMO
tristate "Xin-Mo non-fully compliant devices"
- depends on HID
help
Support for Xin-Mo devices that are not fully compliant with the HID
standard. Currently only supports the Xin-Mo Dual Arcade. Say Y here
config HID_ZEROPLUS
tristate "Zeroplus based game controller support"
- depends on HID
help
Say Y here if you have a Zeroplus based game controller.
config HID_ZYDACRON
tristate "Zydacron remote control support"
- depends on HID
help
Support for Zydacron remote control.
config HID_SENSOR_HUB
tristate "HID Sensors framework support"
- depends on HID && HAS_IOMEM
+ depends on HAS_IOMEM
select MFD_CORE
default n
help
config HID_ALPS
tristate "Alps HID device support"
- depends on HID
help
Support for Alps I2C HID touchpads and StickPointer.
Say Y here if you have a Alps touchpads over i2c-hid or usbhid
*/
struct hid_report *hid_register_report(struct hid_device *device,
- unsigned int type, unsigned int id,
+ enum hid_report_type type, unsigned int id,
unsigned int application)
{
struct hid_report_enum *report_enum = device->report_enum + type;
* parsing.
*/
struct hid_report *hid_validate_values(struct hid_device *hid,
- unsigned int type, unsigned int id,
+ enum hid_report_type type, unsigned int id,
unsigned int field_index,
unsigned int report_counts)
{
* DO NOT USE in hid drivers directly, but through hid_hw_request instead.
*/
int __hid_request(struct hid_device *hid, struct hid_report *report,
- int reqtype)
+ enum hid_class_request reqtype)
{
char *buf;
int ret;
}
EXPORT_SYMBOL_GPL(__hid_request);
-int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size,
- int interrupt)
+int hid_report_raw_event(struct hid_device *hid, enum hid_report_type type, u8 *data, u32 size,
+ int interrupt)
{
struct hid_report_enum *report_enum = hid->report_enum + type;
struct hid_report *report;
*
* This is data entry for lower layers.
*/
-int hid_input_report(struct hid_device *hid, int type, u8 *data, u32 size, int interrupt)
+int hid_input_report(struct hid_device *hid, enum hid_report_type type, u8 *data, u32 size,
+ int interrupt)
{
struct hid_report_enum *report_enum;
struct hid_driver *hdrv;
* @reqtype: hid request type
*/
void hid_hw_request(struct hid_device *hdev,
- struct hid_report *report, int reqtype)
+ struct hid_report *report, enum hid_class_request reqtype)
{
if (hdev->ll_driver->request)
return hdev->ll_driver->request(hdev, report, reqtype);
*/
int hid_hw_raw_request(struct hid_device *hdev,
unsigned char reportnum, __u8 *buf,
- size_t len, unsigned char rtype, int reqtype)
+ size_t len, enum hid_report_type rtype, enum hid_class_request reqtype)
{
if (len < 1 || len > HID_MAX_BUFFER_SIZE || !buf)
return -EINVAL;
hid_warn(hdev, "bad device descriptor (%d)\n", ret);
}
+ hdev->id = atomic_inc_return(&id);
+
/* XXX hack, any other cleaner solution after the driver core
* is converted to allow more than 20 bytes as the device name? */
dev_set_name(&hdev->dev, "%04X:%04X:%04X.%04X", hdev->bus,
- hdev->vendor, hdev->product, atomic_inc_return(&id));
+ hdev->vendor, hdev->product, hdev->id);
hid_debug_register(hdev, dev_name(&hdev->dev));
ret = device_add(&hdev->dev);
if (reply[0] != 0xae || reply[1] != 0x15 || reply[2] != 0x01)
return -EIO;
reply[3 + STEAM_SERIAL_LEN] = 0;
- strlcpy(steam->serial_no, reply + 3, sizeof(steam->serial_no));
+ strscpy(steam->serial_no, reply + 3, sizeof(steam->serial_no));
return 0;
}
*/
mutex_lock(&steam->mutex);
if (steam_get_serial(steam) < 0)
- strlcpy(steam->serial_no, "XXXXXXXXXX",
+ strscpy(steam->serial_no, "XXXXXXXXXX",
sizeof(steam->serial_no));
mutex_unlock(&steam->mutex);
client_hdev->version = hdev->version;
client_hdev->type = hdev->type;
client_hdev->country = hdev->country;
- strlcpy(client_hdev->name, hdev->name,
+ strscpy(client_hdev->name, hdev->name,
sizeof(client_hdev->name));
- strlcpy(client_hdev->phys, hdev->phys,
+ strscpy(client_hdev->phys, hdev->phys,
sizeof(client_hdev->phys));
/*
* Since we use the same device info than the real interface to
snprintf(hid->name, sizeof(hid->name), "%s %04X:%04X",
client->name, (u16)hid->vendor, (u16)hid->product);
- strlcpy(hid->phys, dev_name(&client->dev), sizeof(hid->phys));
+ strscpy(hid->phys, dev_name(&client->dev), sizeof(hid->phys));
ihid->quirks = i2c_hid_lookup_quirk(hid->vendor, hid->product);
hid->type = HID_TYPE_USBNONE;
if (dev->manufacturer)
- strlcpy(hid->name, dev->manufacturer, sizeof(hid->name));
+ strscpy(hid->name, dev->manufacturer, sizeof(hid->name));
if (dev->product) {
if (dev->manufacturer)
spin_lock_init(&kbd->leds_lock);
if (dev->manufacturer)
- strlcpy(kbd->name, dev->manufacturer, sizeof(kbd->name));
+ strscpy(kbd->name, dev->manufacturer, sizeof(kbd->name));
if (dev->product) {
if (dev->manufacturer)
mouse->dev = input_dev;
if (dev->manufacturer)
- strlcpy(mouse->name, dev->manufacturer, sizeof(mouse->name));
+ strscpy(mouse->name, dev->manufacturer, sizeof(mouse->name));
if (dev->product) {
if (dev->manufacturer)
} else if (strstr(product_name, "Wacom") ||
strstr(product_name, "wacom") ||
strstr(product_name, "WACOM")) {
- strlcpy(name, product_name, sizeof(name));
+ strscpy(name, product_name, sizeof(name));
} else {
snprintf(name, sizeof(name), "Wacom %s", product_name);
}
if (name[strlen(name)-1] == ' ')
name[strlen(name)-1] = '\0';
} else {
- strlcpy(name, features->name, sizeof(name));
+ strscpy(name, features->name, sizeof(name));
}
snprintf(wacom_wac->name, sizeof(wacom_wac->name), "%s%s",
goto fail;
}
- strlcpy(wacom_wac->name, wacom_wac1->name,
+ strscpy(wacom_wac->name, wacom_wac1->name,
sizeof(wacom_wac->name));
error = wacom_initialize_battery(wacom);
if (error)
#define HID_BAT_ABSOLUTESTATEOFCHARGE 0x00850065
#define HID_VD_ASUS_CUSTOM_MEDIA_KEYS 0xff310076
-/*
- * HID report types --- Ouch! HID spec says 1 2 3!
- */
-
-#define HID_INPUT_REPORT 0
-#define HID_OUTPUT_REPORT 1
-#define HID_FEATURE_REPORT 2
-
-#define HID_REPORT_TYPES 3
/*
* HID connect requests
struct list_head hidinput_list;
struct list_head field_entry_list; /* ordered list of input fields */
unsigned int id; /* id of this report */
- unsigned int type; /* report type */
+ enum hid_report_type type; /* report type */
unsigned int application; /* application usage for this report */
struct hid_field *field[HID_MAX_FIELDS]; /* fields of the report */
struct hid_field_entry *field_entries; /* allocated memory of input field_entry */
struct list_head debug_list;
spinlock_t debug_list_lock;
wait_queue_head_t debug_wait;
+
+ unsigned int id; /* system unique id */
};
#define to_hid_device(pdev) \
extern void hidinput_disconnect(struct hid_device *);
int hid_set_field(struct hid_field *, unsigned, __s32);
-int hid_input_report(struct hid_device *, int type, u8 *, u32, int);
+int hid_input_report(struct hid_device *hid, enum hid_report_type type, u8 *data, u32 size,
+ int interrupt);
struct hid_field *hidinput_get_led_field(struct hid_device *hid);
unsigned int hidinput_count_leds(struct hid_device *hid);
__s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code);
void hid_output_report(struct hid_report *report, __u8 *data);
-int __hid_request(struct hid_device *hid, struct hid_report *rep, int reqtype);
+int __hid_request(struct hid_device *hid, struct hid_report *rep, enum hid_class_request reqtype);
u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags);
struct hid_device *hid_allocate_device(void);
struct hid_report *hid_register_report(struct hid_device *device,
- unsigned int type, unsigned int id,
+ enum hid_report_type type, unsigned int id,
unsigned int application);
int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size);
struct hid_report *hid_validate_values(struct hid_device *hid,
- unsigned int type, unsigned int id,
+ enum hid_report_type type, unsigned int id,
unsigned int field_index,
unsigned int report_counts);
int __must_check hid_hw_open(struct hid_device *hdev);
void hid_hw_close(struct hid_device *hdev);
void hid_hw_request(struct hid_device *hdev,
- struct hid_report *report, int reqtype);
+ struct hid_report *report, enum hid_class_request reqtype);
int hid_hw_raw_request(struct hid_device *hdev,
unsigned char reportnum, __u8 *buf,
- size_t len, unsigned char rtype, int reqtype);
+ size_t len, enum hid_report_type rtype,
+ enum hid_class_request reqtype);
int hid_hw_output_report(struct hid_device *hdev, __u8 *buf, size_t len);
/**
* @reqtype: hid request type
*/
static inline int hid_hw_idle(struct hid_device *hdev, int report, int idle,
- int reqtype)
+ enum hid_class_request reqtype)
{
if (hdev->ll_driver->idle)
return hdev->ll_driver->idle(hdev, report, idle, reqtype);
return DIV_ROUND_UP(report->size, 8) + (report->id > 0);
}
-int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size,
- int interrupt);
+int hid_report_raw_event(struct hid_device *hid, enum hid_report_type type, u8 *data, u32 size,
+ int interrupt);
/* HID quirks API */
unsigned long hid_lookup_quirk(const struct hid_device *hdev);
#define USB_INTERFACE_PROTOCOL_KEYBOARD 1
#define USB_INTERFACE_PROTOCOL_MOUSE 2
+/*
+ * HID report types --- Ouch! HID spec says 1 2 3!
+ */
+
+enum hid_report_type {
+ HID_INPUT_REPORT = 0,
+ HID_OUTPUT_REPORT = 1,
+ HID_FEATURE_REPORT = 2,
+
+ HID_REPORT_TYPES,
+};
+
/*
* HID class requests
*/
-#define HID_REQ_GET_REPORT 0x01
-#define HID_REQ_GET_IDLE 0x02
-#define HID_REQ_GET_PROTOCOL 0x03
-#define HID_REQ_SET_REPORT 0x09
-#define HID_REQ_SET_IDLE 0x0A
-#define HID_REQ_SET_PROTOCOL 0x0B
+enum hid_class_request {
+ HID_REQ_GET_REPORT = 0x01,
+ HID_REQ_GET_IDLE = 0x02,
+ HID_REQ_GET_PROTOCOL = 0x03,
+ HID_REQ_SET_REPORT = 0x09,
+ HID_REQ_SET_IDLE = 0x0A,
+ HID_REQ_SET_PROTOCOL = 0x0B,
+};
/*
* HID class descriptor types