diff options
author | Frank Praznik <frank.praznik@oh.rr.com> | 2014-02-20 17:36:03 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-02-24 17:38:46 +0100 |
commit | d2d782fccee4f699a35e2d0cdbb2b19bdaec95a4 (patch) | |
tree | ea947847d645a59d102f487b04fe5e63d209d436 /fs/jfs/jfs_discard.c | |
parent | HID: sony: Perform a boundry check on the sixaxis battery level index. (diff) | |
download | linux-d2d782fccee4f699a35e2d0cdbb2b19bdaec95a4.tar.xz linux-d2d782fccee4f699a35e2d0cdbb2b19bdaec95a4.zip |
HID: sony: Prevent duplicate controller connections.
If a Sixaxis or Dualshock 4 controller is connected via USB while already
connected via Bluetooth it will cause duplicate devices to be added to the
input device list.
To prevent this a global list of controllers and their MAC addresses is
maintained and new controllers are checked against this list. If a duplicate
is found, the probe function will exit with -EEXIST.
On USB the MAC is retrieved via a feature report. On Bluetooth neither
controller reports the MAC address in a feature report so the MAC is parsed from
the uniq string. As uniq cannot be guaranteed to be a MAC address in every case
(uHID or the behavior of HIDP changing) a parsing failure will not prevent the
connection.
Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'fs/jfs/jfs_discard.c')
0 files changed, 0 insertions, 0 deletions