unsigned long rel_bits[NLONGS(REL_CNT)];
unsigned long abs_bits[NLONGS(ABS_CNT)];
unsigned long led_bits[NLONGS(LED_CNT)];
+ unsigned long msc_bits[NLONGS(MSC_CNT)];
+ unsigned long sw_bits[NLONGS(SW_CNT)];
+ unsigned long rep_bits[NLONGS(REP_CNT)]; /* convenience, always 1 */
+ unsigned long ff_bits[NLONGS(FF_CNT)];
+ unsigned long snd_bits[NLONGS(SND_CNT)];
unsigned long key_values[NLONGS(KEY_CNT)];
struct input_absinfo abs_info[ABS_CNT];
unsigned int mt_slot_vals[MAX_SLOTS][ABS_MT_CNT];
int num_slots; /**< valid slots in mt_slot_vals */
int current_slot;
+ int rep_values[2];
int need_sync;
int grabbed;
if (rc < 0)
goto out;
+ rc = ioctl(fd, EVIOCGBIT(EV_SW, sizeof(dev->sw_bits)), dev->sw_bits);
+ if (rc < 0)
+ goto out;
+
+ rc = ioctl(fd, EVIOCGBIT(EV_MSC, sizeof(dev->msc_bits)), dev->msc_bits);
+ if (rc < 0)
+ goto out;
+
+ rc = ioctl(fd, EVIOCGBIT(EV_FF, sizeof(dev->ff_bits)), dev->ff_bits);
+ if (rc < 0)
+ goto out;
+
+ rc = ioctl(fd, EVIOCGBIT(EV_SND, sizeof(dev->snd_bits)), dev->snd_bits);
+ if (rc < 0)
+ goto out;
+
+ /* rep is a special case, always set it to 1 for both values if EV_REP is set */
+ if (bit_is_set(dev->bits, EV_REP)) {
+ for (i = 0; i < REP_MAX; i++)
+ set_bit(dev->rep_bits, i);
+ rc = ioctl(fd, EVIOCGREP, dev->rep_values);
+ if (rc < 0)
+ goto out;
+ }
+
for (i = ABS_X; i <= ABS_MAX; i++) {
if (bit_is_set(dev->abs_bits, i)) {
struct input_absinfo abs_info;