Return-Path: From: "Ge, Ethan" To: Luiz Augusto von Dentz CC: "linux-bluetooth@vger.kernel.org" , "jeremy@goop.org" , Marcel Holtmann Subject: RE: BLE(ATT) mouse doesn't register wakeup source in Linux kernel during BLE mouse connecting Date: Mon, 14 Sep 2015 03:26:50 +0000 Message-ID: <86D221DC0B85F94D9B05B97827669A34064CEC19@PGSMSX106.gar.corp.intel.com> References: <86D221DC0B85F94D9B05B97827669A34064CE519@PGSMSX106.gar.corp.intel.com> In-Reply-To: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 List-ID: SGkgTHVpeg0KDQotLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KRnJvbTogTHVpeiBBdWd1c3Rv IHZvbiBEZW50eiBbbWFpbHRvOmx1aXouZGVudHpAZ21haWwuY29tXSANClNlbnQ6IEZyaWRheSwg U2VwdGVtYmVyIDExLCAyMDE1IDk6MzYgUE0NClRvOiBHZSwgRXRoYW4NCkNjOiBsaW51eC1ibHVl dG9vdGhAdmdlci5rZXJuZWwub3JnOyBqZXJlbXlAZ29vcC5vcmc7IE1hcmNlbCBIb2x0bWFubg0K U3ViamVjdDogUmU6IEJMRShBVFQpIG1vdXNlIGRvZXNuJ3QgcmVnaXN0ZXIgd2FrZXVwIHNvdXJj ZSBpbiBMaW51eCBrZXJuZWwgZHVyaW5nIEJMRSBtb3VzZSBjb25uZWN0aW5nDQoNCkhpIEV0aGFu LA0KDQpPbiBGcmksIFNlcCAxMSwgMjAxNSBhdCAxOjEyIFBNLCBHZSwgRXRoYW4gPGV0aGFuLmdl QGludGVsLmNvbT4gd3JvdGU6DQo+IEhpLA0KPg0KPiBJbiBmaWxlIGRyaXZlcnMvaGlkL2hpZC1p bnB1dC5jLCBmdW5jdGlvbiBoaWRpbnB1dF9zZXR1cF9iYXR0ZXJ5KCkgd2lsbCByZXR1cm4gZHVy aW5nIGNvbm5lY3QgYSBCTEUgbW91c2UgYmVjYXVzZSBvZiBmaWxlZC0+dXNhZ2Ut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