Return-path: Received: from mga02.intel.com ([134.134.136.20]:64422 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755393Ab0KPTwX (ORCPT ); Tue, 16 Nov 2010 14:52:23 -0500 Subject: [RFC 1/2] cfg80211: allow using CQM event to notify packet loss From: Johannes Berg To: "linux-wireless@vger.kernel.org" Date: Tue, 16 Nov 2010 11:53:56 -0800 Message-ID: <1289937236.3673.8.camel@jlt3.sipsolutions.net> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Sender: linux-wireless-owner@vger.kernel.org List-ID: RnJvbTogSm9oYW5uZXMgQmVyZyA8am9oYW5uZXMuYmVyZ0BpbnRlbC5jb20+CgpUaGlzIGFkZHMg dGhlIGFiaWxpdHkgZm9yIGRyaXZlcnMgdG8gdXNlIENRTSBldmVudHMKdG8gbm90aWZ5IGFib3V0 IHBhY2tldCBsb3NzIGZvciBzcGVjaWZpYyBzdGF0aW9ucwood2hpY2ggY291bGQgYmUgdGhlIEFQ IGZvciB0aGUgbWFuYWdlZCBtb2RlIGNhc2UpLgpTaW5jZSB0aGUgdGhyZXNob2xkIG1pZ2h0IGJl IGRldGVybWluZWQgYnkgdGhlCmRyaXZlciAoaXQgaXNuJ3QgcGFzc2VkIGluIHJpZ2h0IG5vdykg aXQgd2lsbCBiZQpwYXNzZWQgb3V0IG9mIHRoZSBkcml2ZXIgdG8gdXNlcnNwYWNlIGluIHRoZSBl dmVudC4KClNpZ25lZC1vZmYtYnk6IEpvaGFubmVzIEJlcmcgPGpvaGFubmVzLmJlcmdAaW50ZWwu Y29tPgotLS0KIGluY2x1ZGUvbGludXgvbmw4MDIxMS5oIHwgICAgMyArKysKIGluY2x1ZGUvbmV0 L2NmZzgwMjExLmggIHwgICAxMiArKysrKysrKysrKysKIG5ldC93aXJlbGVzcy9tbG1lLmMgICAg IHwgICAxMiArKysrKysrKysrKysKIG5ldC93aXJlbGVzcy9ubDgwMjExLmMgIHwgICA0NSArKysr KysrKys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