Return-Path: From: Peter Hurley To: Luiz Augusto von Dentz CC: "linux-bluetooth@vger.kernel.org" Date: Wed, 3 Aug 2011 12:25:16 -0400 Subject: Re: [RFC 1/3] Bluetooth: prioritizing data over HCI Message-ID: <1312388716.3358.58.camel@THOR> References: <1312377094-11285-1-git-send-email-luiz.dentz@gmail.com> <1312377094-11285-2-git-send-email-luiz.dentz@gmail.com> In-Reply-To: <1312377094-11285-2-git-send-email-luiz.dentz@gmail.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: SGkgTHVpeiwNCg0KT24gV2VkLCAyMDExLTA4LTAzIGF0IDA5OjExIC0wNDAwLCBMdWl6IEF1Z3Vz dG8gdm9uIERlbnR6IHdyb3RlOg0KPiBGcm9tOiBMdWl6IEF1Z3VzdG8gdm9uIERlbnR6IDxsdWl6 LnZvbi5kZW50ekBpbnRlbC5jb20+DQo+DQo+IFRoaXMgaW1wbGVtZW50IHByaW9yaXR5IGJhc2Vk IHNjaGVkdWxlciB1c2luZyBza2J1ZmZlciBwcmlvcml0eSBzZXQgdmlhDQo+IFNPX1BSSU9SSVRZ IHNvY2tldCBvcHRpb24uDQo+DQo+IEl0IHJldXNlcyB0aGUgcXVvdGUgY2FsY3VsYXRpb24gZnJv bSBvbGQgc2NoZWR1bGVyLCBidXQgdGhlIGRpZmZlcmVuY2UgaXMNCj4gdGhhdCB0aGUgbnVtYmVy IG9mIGNvbm5lY3Rpb25zIHVzZWQgdG8gY2FsY3VsYXRlIHRoZSBxdW90ZSBpcyBieSBwcmlvcml0 eSwNCj4gc28gdGhlIHF1b3RlIG1heSBub3QgYmUgZGV2aWRlZCBlcXVhbGx5IHBlciBjb25uZWN0 aW9uIGlmIHRoZWlyIHByaW9yaXRpZXMNCj4gYXJlIGRpZmZlcmVudC4NCj4NCj4gVG8gYXZvaWQg c3RhcnZhdGlvbiB0aGUgcHJpb3JpdHkgaXMgcmVjYWxjdWxhdGVkIGluIGEgc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0gMCwgbWluID0gfjA7DQo+ICsgICAgICAgICAgICAgICBz dHJ1Y3QgbGlzdF9oZWFkICpwOw0KPiArICAgICAgICAgICAgICAgaW50IGNudCwgcTsNCj4NCj4g LSAgICAgICAgICAgICAgIGlmIChjLT50eXBlICE9IHR5cGUgfHwgc2tiX3F1ZXVlX2VtcHR5KCZj LT5kYXRhX3EpKQ0KPiAtICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsNCj4gKyAgICAg ICAgICAgICAgIGxpc3RfZm9yX2VhY2gocCwgJmgtPmxpc3QpIHsNCj4gKyAgICAgICAgICAgICAg ICAgICAgICAgc3RydWN0IGhjaV9jb25uICpjOw0KPiArICAgICAgICAgICAgICAgICAgICAgICBj ID0gbGlzdF9lbnRyeShwLCBzdHJ1Y3QgaGNpX2Nvbm4sIGxpc3QpOw0KPg0KPiAtICAgICAgICAg ICAgICAgaWYgKGMtPnN0YXRlICE9IEJUX0NPTk5FQ1RFRCAmJiBjLT5zdGF0ZSAhPSBCVF9DT05G SUcpDQo+IC0gICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOw0KPiArICAgICAgICAgICAg ICAgICAgICAgICBpZiAoYy0+dHlwZSAhPSB0eXBlIHx8IHNrYl9xdWV1ZV9lbXB0eSgmYy0+ZGF0 YV9xW2ldKSkNCj4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsNCg0K SSBiZWxpZXZlIHRoYXQgdGhlIGV4aXN0aW5nIHR4IHNjaGVkdWxlciBpcyBhbHJlYWR5IGluZWZm aWNpZW50IGFuZCB0aGF0DQp0aGlzIGFwcHJvYWNoIHNpZ25pZmljYW50bHkgY29tcG91bmRzIHRo YXQgaW5lZmZpY2llbmN5Lg0KDQpDb25zaWRlciB0aGUgZm9sbG93aW5nIHNjZW5hcmlvcyB3aXRo IDQgQUNMIGNvbm5lY3Rpb25zIChrZXlib2FyZCwNCm1vdXNlLCBwaG9uZSwgaGVhZHNldCk6DQoN CkZv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KPg0KPiAtICAgICAgICAgICAgICAgaWYgKGMt PnNlbnQgPCBtaW4pIHsNCj4gLSAgICAgICAgICAgICAgICAgICAgICAgbWluICA9IGMtPnNlbnQ7 DQo+IC0gICAgICAgICAgICAgICAgICAgICAgIGNvbm4gPSBjOw0KPiArICAgICAgICAgICAgICAg ICAgICAgICBpZiAoYy0+c2VudCA8IG1pbikgew0KPiArICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIG1pbiAgPSBjLT5zZW50Ow0KPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGNvbm4gPSBjOw0KPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpxdWV1ZSA9ICZj LT5kYXRhX3FbaV07DQo+ICsgICAgICAgICAgICAgICAgICAgICAgIH0NCg0KV2h5IHByZXNlcnZl IHRoZSBmYWlybmVzcyBsb2dpYz8NCg0KPiAgICAgICAgICAgICAgICAgfQ0KPiAtICAgICAgIH0N Cj4NCj4gLSAgICAgICBpZiAoY29ubikgew0KPiAtICAgICAgICAgICAgICAgaW50IGNudCwgcTsN Cj4gKyAgICAgICAgICAgICAgIGlmICghY29ubikNCj4gKyAgICAgICAgICAgICAgICAgICAgICAg Y29udGludWU7DQo+DQo+ICAgICAgICAgICAgICAgICBzd2l0Y2ggKGNvbm4tPnR5cGUpIHsNCj4g ICAgICAgICAgICAgICAgIGNhc2UgQUNMX0xJTks6DQo+IEBAIC0yMDk4LDEwICsyMTE5LDEzIEBA IHN0YXRpYyBpbmxpbmUgc3RydWN0IGhjaV9jb25uICpoY2lfbG93X3NlbnQoc3RydWN0IGhjaV9k ZXYgKmhkZXYsIF9fdTggdHlwZSwgaW50DQo+DQo+ICAgICAgICAgICAgICAgICBxID0gY250IC8g bnVtOw0KPiAgICAgICAgICAgICAgICAgKnF1b3RlID0gcSA/IHEgOiAxOw0KPiAtICAgICAgIH0g ZWxzZQ0KPiAtICAgICAgICAgICAgICAgKnF1b3RlID0gMDsNCj4gKyAgICAgICAgICAg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AgICAg ICB3aGlsZSAoaGRldi0+c2NvX2NudCAmJiAoY29ubiA9IGhjaV9sb3dfc2VudChoZGV2LCBTQ09f TElOSywgJnF1b3RlKSkpIHsNCj4gLSAgICAgICAgICAgICAgIHdoaWxlIChxdW90ZS0tICYmIChz a2IgPSBza2JfZGVxdWV1ZSgmY29ubi0+ZGF0YV9xKSkpIHsNCj4gLSAgICAgICAgICAgICAgICAg ICAgICAgQlRfREJHKCJza2IgJXAgbGVuICVkIiwgc2tiLCBza2ItPmxlbik7DQo+ICsgICAgICAg d2hpbGUgKGhkZXYtPnNjb19jbnQgJiYNCj4gKyAgICAgICAgICAgICAgICAgICAgICAgKGNvbm4g PSBoY2lfcHJpb19zZW50KGhkZXYsIFNDT19MSU5LLCAmcXVldWUsICZxdW90ZSkpKSB7DQo+ICsg ICAgICAgICAgICAgICB3aGlsZSAocXVvdGUtLSAmJiAoc2tiID0gc2tiX2RlcXVldWUocXVldWUp KSkgew0KPiArICAgICAgICAgICAgICAgICAgICAgICBCVF9EQkcoImNvbm4gJXAgc2tiICVwIGxl biAlZCBwcmlvcml0eSAldSIsIGNvbm4sIHNrYiwNCj4gKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgc2tiLT5sZW4sIHNrYi0+cHJpb3JpdHkpOw0KPiAgICAg ICAgICAgICAgICAgICAgICAgICBoY2lfc2VuZF9mcmFtZShza2IpOw0KPg0KPiAgICAgICAgICAg ICAgICAgICAgICAgICBjb25uLT5zZW50Kys7DQo+IEBAIC0yMTc5LDEzICsyMjA5LDE2IEBAIHN0 YXRpYyBpbmxpbmUgdm9pZCBoY2lfc2NoZWRfZXNjbyhzdHJ1Y3QgaGNpX2RldiAqaGRldikNCj4g IHsNCj4gICAgICAgICBzdHJ1Y3QgaGNpX2Nvbm4gKmNvbm47DQo+ICAgICAgICAgc3RydWN0IHNr X2J1ZmYgKnNrYjsNCj4gKyAgICAgICBzdHJ1Y3Qgc2tfYnVmZl9oZWFkICpxdWV1ZSA9IE5VTEw7 DQo+ICAgICAgICAgaW50IHF1b3RlOw0KPg0KPiAgICAgICAgIEJUX0RCRygiJXMiLCBoZGV2LT5u YW1lKTsNCj4NCj4gLSAgICAgICB3aGlsZSAoaGRldi0+c2NvX2NudCAmJiAoY29ubiA9IGhjaV9s b3dfc2VudChoZGV2LCBFU0NPX0xJTkssICZxdW90ZSkpKSB7DQo+IC0gICAgICAgICAgICAgICB3 aGlsZSAocXVvdGUtLSAmJiAoc2tiID0gc2tiX2RlcXVldWUoJmNvbm4tPmRhdGFfcSkpKSB7DQo+ IC0gICAgICAgICAgICAgICAgICAgICAgIEJUX0RCRygic2tiICVwIGxlbiAlZCIsIHNrYiwgc2ti LT5sZW4pOw0KPiArICAgICAgIHdoaWxlIChoZGV2LT5zY29fY250ICYmDQo+ICsgICAgICAgICAg ICAgICAgICAgICAgIChjb25uID0gaGNpX3ByaW9fc2VudChoZGV2LCBFU0NPX0xJTkssICZxdWV1 ZSwgJnF1b3RlKSkpIHsNCj4gKyAgICAgICAgICAgICAgIHdoaWxlIChxdW90ZS0tICYmIChza2Ig PSBza2JfZGVxdWV1ZShxdWV1ZSkpKSB7DQo+ICsgICAgICAgICAgICAgICAgICAgICAgIEJUX0RC RygiY29ubiAlcCBza2IgJXAgbGVuICVkIHByaW9yaXR5ICV1IiwgY29ubiwgc2tiLA0KPiArICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBza2ItPmxlbiwgc2ti LT5wcmlvcml0eSk7DQo+ICAgICAgICAgICAgICAgICAgICAgICAgIGhjaV9zZW5kX2ZyYW1lKHNr Yik7DQo+DQo+ICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm4tPnNlbnQrKzsNCj4gQEAgLTIx OTksNiArMjIzMiw3IEBAIHN0YXRpYyBpbmxpbmUgdm9pZCBoY2lfc2NoZWRfbGUoc3RydWN0IGhj aV9kZXYgKmhkZXYpDQo+ICB7DQo+ICAgICAgICAgc3RydWN0IGhjaV9jb25uICpjb25uOw0KPiAg ICAgICAgIHN0cnVjdCBza19idWZmICpza2I7DQo+ICsgICAgICAgc3RydWN0IHNrX2J1ZmZfaGVh ZCAqcXVldWUgPSBOVUxMOw0KPiAgICAgICAgIGludCBxdW90ZSwgY250Ow0KPg0KPiAgICAgICAg IEJUX0RCRygiJXMiLCBoZGV2LT5uYW1lKTsNCj4gQEAgLTIyMTIsOSArMjI0NiwxMCBAQCBzdGF0 aWMgaW5saW5lIHZvaWQgaGNpX3NjaGVkX2xlKHN0cnVjdCBoY2lfZGV2ICpoZGV2KQ0KPiAgICAg ICAgIH0NCj4NCj4gICAgICAgICBjbnQgPSBoZGV2LT5sZV9wa3RzID8gaGRldi0+bGVfY250IDog aGRldi0+YWNsX2NudDsNCj4gLSAgICAgICB3aGlsZSAoY250ICYmIChjb25uID0gaGNpX2xvd19z ZW50KGhkZXYsIExFX0xJTkssICZxdW90ZSkpKSB7DQo+IC0gICAgICAgICAgICAgICB3aGlsZSAo cXVvdGUtLSAmJiAoc2tiID0gc2tiX2RlcXVldWUoJmNvbm4tPmRhdGFfcSkpKSB7DQo+IC0gICAg ICAgICAgICAgICAgICAgICAgIEJUX0RCRygic2tiICVwIGxlbiAlZCIsIHNrYiwgc2tiLT5sZW4p Ow0KPiArICAgICAgIHdoaWxlIChjbnQgJiYgKGNvbm4gPSBoY2lfcHJpb19zZW50KGhkZXYsIExF X0xJTkssICZxdWV1ZSwgJnF1b3RlKSkpIHsNCj4gKyAgICAgICAgICAgICAgIHdoaWxlIChxdW90 ZS0tICYmIChza2IgPSBza2JfZGVxdWV1ZShxdWV1ZSkpKSB7DQo+ICsgICAgICAgICAgICAgICAg ICAgICAgIEJUX0RCRygiY29ubiAlcCBza2IgJXAgbGVuICVkIHByaW9yaXR5ICV1IiwgY29ubiwg c2tiLA0KPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBz a2ItPmxlbiwgc2tiLT5wcmlvcml0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0KPiArICAgICAgIGlmIChtc2ctPm1zZ19m bGFncyAmIE1TR19UUllIQVJEKQ0KPiArICAgICAgICAgICAgICAgcHJpb3JpdHkgPSBIQ0lfUFJJ T19NQVg7DQo+ICsgICAgICAgZWxzZQ0KPiArICAgICAgICAgICAgICAgcHJpb3JpdHkgPSBzay0+ c2tfcHJpb3JpdHk7DQo+ICsNCj4gICAgICAgICBCVF9EQkcoInNvY2sgJXAsIHNrICVwIiwgc29j aywgc2spOw0KPg0KPiAgICAgICAgIGxvY2tfc29jayhzayk7DQo+IEBAIC01OTcsNiArNjAzLDgg QEAgc3RhdGljIGludCByZmNvbW1fc29ja19zZW5kbXNnKHN0cnVjdCBraW9jYiAqaW9jYiwgc3Ry dWN0IHNvY2tldCAqc29jaywNCj4gICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7DQo+ICAg ICAgICAgICAgICAgICB9DQo+DQo+ICsgICAgICAgICAgICAgICBza2ItPnByaW9yaXR5ID0gcHJp b3JpdHk7DQo+ICsNCj4gICAgICAgICAgICAgICAgIGVyciA9IHJmY29tbV9kbGNfc2VuZChkLCBz a2IpOw0KPiAgICAgICAgICAgICAgICAgaWYgKGVyciA8IDApIHsNCj4gICAgICAgICAgICAgICAg ICAgICAgICAga2ZyZWVfc2tiKHNrYik7DQo+IC0tDQo+IDEuNy42DQo+DQo+IC0tDQo+IFRvIHVu c3Vic2NyaWJlIGZyb20gdGhpcyBsaXN0OiBzZW5kIHRoZSBsaW5lICJ1bnN1YnNjcmliZSBsaW51 eC1ibHVldG9vdGgiIGluDQo+IHRoZSBib2R5IG9mIGEgbWVzc2FnZSB0byBtYWpvcmRvbW9Admdl ci5rZXJuZWwub3JnDQo+IE1vcmUgbWFqb3Jkb21vIGluZm8gYXQgIGh0dHA6Ly92Z2VyLmtlcm5l bC5vcmcvbWFqb3Jkb21vLWluZm8uaHRtbA0KDQo=