From mboxrd@z Thu Jan 1 00:00:00 1970 From: Frank Praznik Subject: Re: [PATCH 0/6] HID: Add a stable method for retrieving the client MAC address of a HID device Date: Fri, 31 Jan 2014 15:04:47 -0500 Message-ID: <52EC01DF.6050309@oh.rr.com> References: <1391189573-2591-1-git-send-email-frank.praznik@oh.rr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.120]:42571 "EHLO cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932913AbaAaUEu (ORCPT ); Fri, 31 Jan 2014 15:04:50 -0500 In-Reply-To: Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Benjamin Tissoires , Frank Praznik Cc: linux-input , Jiri Kosina , David Herrmann On 1/31/2014 14:10, Benjamin Tissoires wrote: > Hi Frank, > > just a quick review: > > On Fri, Jan 31, 2014 at 12:32 PM, Frank Praznik wrote: >> Currently there is no reliable way for a device module or hidraw application to >> retrieve the client MAC address of the associated wireless device. This series >> of patches adds a stable way of retrieving this information. > Well, if I look at the uevent of a Bluetooth mouse I have: > > $ cat /sys/devices/pci0000\:00/0000\:00\:14.0/usb3/3-2/3-2\:1.0/bluetooth/hci0/hci0\:43/0005\:046D\:B00D.001F/uevent > DRIVER=hid-generic > HID_ID=0005:0000046D:0000B00D > HID_NAME=Ultrathin Touch Mouse > HID_PHYS=00:10:60:ea:df:ae > HID_UNIQ=00:1f:20:96:33:47 > MODALIAS=hid:b0005g0001v0000046Dp0000B00D > > I would say that HID_UNIQ is the client MAC address set by hidp, no? > So you don't need to duplicate the info by adding a new field in > hid_device. > In a patch I recently submitted I was using the UNIQ field for retrieving a Bluetooth device MAC address and was warned against it because "UNIQ is a way to provide unique identifiers for devices, but it's not guaranteed to stay the same". HIDP happens to store the MAC in the UNIQ data, but there is no guarantee that it will always be there. With these patches you can be completely sure that the data in client_addr is the client device MAC address.