Return-Path: From: Peter Hurley To: Luiz Augusto von Dentz CC: "linux-bluetooth@vger.kernel.org" Date: Wed, 3 Aug 2011 16:53:45 -0400 Subject: Re: [RFC 1/3] Bluetooth: prioritizing data over HCI Message-ID: <1312404825.3358.173.camel@THOR> References: <1312377094-11285-1-git-send-email-luiz.dentz@gmail.com> <1312377094-11285-2-git-send-email-luiz.dentz@gmail.com> <1312388716.3358.58.camel@THOR> In-Reply-To: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: SGkgTHVpeiwNCg0KT24gV2VkLCAyMDExLTA4LTAzIGF0IDEzOjQ5IC0wNDAwLCBMdWl6IEF1Z3Vz dG8gdm9uIERlbnR6IHdyb3RlOg0KPiBIaSBQZXRlciwNCj4gDQo+IE9uIFdlZCwgQXVnIDMsIDIw MTEgYXQgNzoyNSBQTSwgUGV0ZXIgSHVybGV5IDxwZXRlckBodXJsZXlzb2Z0d2FyZS5jb20+IHdy b3RlOg0KPiA+DQo+ID4gSSBiZWxpZXZlIHRoYXQgdGhlIGV4aXN0aW5nIHR4IHNjaGVkdWxlciBp cyBhbHJlYWR5IGluZWZmaWNpZW50IGFuZCB0aGF0DQo+ID4gdGhpcyBhcHByb2FjaCBzaWduaWZp Y2FudGx5IGNvbXBvdW5kcyB0aGF0IGluZWZmaWNpZW5jeS4NCj4gPg0KPiA+IENvbnNpZGVyIHRo ZSBmb2xsb3dpbmcgc2NlbmFyaW9zIHdpdGggNCBBQ0wgY29ubmVjdGlvbnMgKGtleWJvYXJkLA0K PiA+IG1vdXNlLCBwaG9uZSwgaGVhZHNldCk6DQo+ID4NCj4gPiBGb3IgKm9uZSogc2NoZWR1bGVk IEFDTCB0eCBwYWNrZXQsIHRoZSBjb25uZWN0aW9uIGxpc3Qgd2lsbCBiZSBzZWFyY2hlZA0KPiA+ IDM1fjQyIHRpbWVzIC0tIHRoYXQncyAxNDB+MTY4IGNvbm5lY3Rpb24gbGlzdCBub2Rl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WNhdXNlIHRoZXkgc2hhcmUgdGhlDQpzYW1lIHJlc291cmNl IC0tIG5hbWVseSwgdGhlIGFjbF9jbnQuIFdlIGFsc28gbWVyZ2VkIFNDTy9FU0NPIHNjaGVkdWxp bmcNCnRvZ2V0aGVyIGFzIHdlbGwpLg0KDQo+IA0KPiA+PiArDQo+ID4+ICsgICAgICAgICAgICAg ICAgICAgICAgIGlmIChjLT5zdGF0ZSAhPSBCVF9DT05ORUNURUQgJiYgYy0+c3RhdGUgIT0gQlRf Q09ORklHKQ0KPiA+PiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOw0K PiA+Pg0KPiA+PiAtICAgICAgICAgICAgICAgbnVtKys7DQo+ID4+ICsgICAgICAgICAgICAgICAg ICAgICAgIG51bSsrOw0KPiA+Pg0KPiA+PiAtICAgICAgICAgICAgICAgaWYgKGMtPnNlbnQgPCBt aW4pIHsNCj4gPj4gLSAgICAgICAgICAgICAgICAgICAgICAgbWluICA9IGMtPnNlbnQ7DQo+ID4+ IC0gICAgICAgICAgICAgICAgICAgICAgIGNvbm4gPSBjOw0KPiA+PiArICAgICAgICAgICAgICAg ICAgICAgICBpZiAoYy0+c2VudCA8IG1pbikgew0KPiA+PiArICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIG1pbiAgPSBjLT5zZW50Ow0KPiA+PiArICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGNvbm4gPSBjOw0KPiA+PiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpx dWV1ZSA9ICZjLT5kYXRhX3FbaV07DQo+ID4+ICsgICAgICAgICAgICAgICAgICAgICAgIH0NCj4g Pg0KPiA+IFdoeSBwcmVzZXJ2ZSB0aGUgZmFpcm5lc3MgbG9naWM/DQo+IA0KPiBJdCBkb2VzIG5l ZWQgdG8gZmFpciBpZiB0aGVyZSBpcyAyIG9yIG1vcmUgc29ja2V0cyB3aXRoIHRoZSBzYW1lDQo+ IHByaW9yaXR5LC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