Return-Path: From: "Gu, Chao Jie" To: Luiz Augusto von Dentz CC: "linux-bluetooth@vger.kernel.org" Subject: RE: [PATCH v4 1/3] shared/att.c: Add signed command outgoing and CSRK function Date: Thu, 9 Oct 2014 09:38:27 +0000 Message-ID: <3D02B219753AD44CBDDDE484323B17741130DDF2@SHSMSX104.ccr.corp.intel.com> References: <1412758479-13214-1-git-send-email-chao.jie.gu@intel.com> <1412758479-13214-2-git-send-email-chao.jie.gu@intel.com> <3D02B219753AD44CBDDDE484323B17741130DD22@SHSMSX104.ccr.corp.intel.com> In-Reply-To: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: SGkgTHVpeiwNCj4gPg0KPiA+PiA+IEBAIC03Nyw2ICs3OCwxNiBAQCBzdHJ1Y3QgYnRfYXR0IHsN Cj4gPj4gPiAgICAgICAgIGJ0X2F0dF9kZWJ1Z19mdW5jX3QgZGVidWdfY2FsbGJhY2s7DQo+ID4+ ID4gICAgICAgICBidF9hdHRfZGVzdHJveV9mdW5jX3QgZGVidWdfZGVzdHJveTsNCj4gPj4gPiAg ICAgICAgIHZvaWQgKmRlYnVnX2RhdGE7DQo+ID4+ID4gKw0KPiA+PiA+ICsgICAgICAgc3RydWN0 IGJ0X2NyeXB0byAqY3J5cHRvOw0KPiA+PiA+ICsNCj4gPj4gPiArICAgICAgIGJvb2wgdmFsaWRf bG9jYWxfY3NyazsNCj4gPj4gPiArICAgICAgIHVpbnQ4X3QgbG9jYWxfY3Nya1sxNl07DQo+ID4+ ID4gKyAgICAgICB1aW50MzJfdCBsb2NhbF9zaWduX2NudDsNCj4gPj4gPiArDQo+ID4+ID4gKyAg ICAgICBib29sIHZhbGlkX3JlbW90ZV9jc3JrOw0KPiA+PiA+ICsgICAgICAgdWludDhfdCByZW1v dGVfY3Nya1sxNl07DQo+ID4+ID4gKyAgICAgICB1aW50MzJfdCByZW1vdGVfc2lnbl9jbnQ7DQo+ ID4+DQo+ID4+IE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ICsgICAgICAgICAgICAgICBwZHVfbGVuICs9IEJU X0FUVF9TSUdOQVRVUkVfTEVOOw0KPiA+PiA+DQo+ID4+ID4gICAgICAgICBpZiAobGVuZ3RoICYm IHBkdSkNCj4gPj4gPiAgICAgICAgICAgICAgICAgcGR1X2xlbiArPSBsZW5ndGg7DQo+ID4+ID4g QEAgLTI5MywxNyArMzEwLDMyIEBAIHN0YXRpYyBib29sIGVuY29kZV9wZHUoc3RydWN0IGF0dF9z ZW5kX29wDQo+ID4+ID4gKm9wLCBjb25zdA0KPiA+PiB2b2lkICpwZHUsDQo+ID4+ID4gICAgICAg ICBpZiAocGR1X2xlbiA+IDEpDQo+ID4+ID4gICAgICAgICAgICAgICAgIG1lbWNweShvcC0+cGR1 ICsgMSwgcGR1LCBsZW5ndGgpOw0KPiA+PiA+DQo+ID4+ID4gKyAgICAgICBpZiAob3AtPm9wY29k ZSAmIEFUVF9PUF9TSUdORURfTUFTSykgew0KPiA+PiA+ICsgICAgICAgICAgICAgICBpZiAoYnRf Y3J5cHRvX3NpZ25fYXR0KGF0dC0+Y3J5cHRvLA0KPiA+PiA+ICsgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBhdHQtPmxvY2FsX2NzcmssDQo+ID4+ID4gKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wLT5wZHUsDQo+ID4+ID4gKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgKyBsZW5ndGgsDQo+ID4+ID4gKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dC0+bG9jYWxfc2lnbl9jbnQsDQo+ID4+ ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYoKHVpbnQ4X3QgKikg b3AtPnBkdSlbMSArDQo+ID4+IGxlbmd0aF0pKQ0KPiA+PiA+ICsgICAgICAgICAgICAgICAgICAg ICAgIGF0dC0+bG9jYWxfc2lnbl9j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