Return-Path: MIME-Version: 1.0 Date: Wed, 22 Apr 2009 17:46:43 +0530 Message-ID: <8b5debfa0904220516u591f1cb8v6b04650794f2d20b@mail.gmail.com> Subject: [PATCH][HCIRAW] Initial proposal for hciraw plugin. From: alok barsode To: Marcel Holtmann Cc: linux-bluetooth Content-Type: multipart/mixed; boundary=0016364594ac95b011046823bc4e List-ID: --0016364594ac95b011046823bc4e Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi Marcel, Here are the initial patches for hciraw plugin. I have pulled the IO event stuff from main.c to hciraw.c Let me know what you think. Cheers, Alok. --0016364594ac95b011046823bc4e Content-Type: text/x-diff; charset=US-ASCII; name="0001-Initialing-HCI-raw-socket-plugin-hciraw.patch" Content-Disposition: attachment; filename="0001-Initialing-HCI-raw-socket-plugin-hciraw.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fttzm51v0 RnJvbSA2OGRlNTQxYjRlYjFiODJmZmY4ZmZiNGI2YTQ2OTdmZTAxYTUzN2ExIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBBbG9rIEJhcnNvZGUgPGFsb2suYmFyc29kZUBhemluZ28uY29t PgpEYXRlOiBUdWUsIDIxIEFwciAyMDA5IDIwOjE2OjA0ICswNTMwClN1YmplY3Q6IFtQQVRDSCAx LzRdIEluaXRpYWxpbmcgSENJIHJhdyBzb2NrZXQgcGx1Z2luICJoY2lyYXciLgoKLS0tCiBwbHVn aW5zL01ha2VmaWxlLmFtIHwgICAgNiArKysrKy0KIHBsdWdpbnMvaGNpcmF3LmMgICAgfCAgIDQz ICsrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysKIDIgZmlsZXMgY2hh bmdlZCwgNDggaW5zZXJ0aW9ucygrKSwgMSBkZWxldGlvbnMoLSkKIGNyZWF0ZSBtb2RlIDEwMDY0 NCBwbHVnaW5zL2hjaXJhdy5jCgpkaWZmIC0tZ2l0IGEvcGx1Z2lucy9NYW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MgRk9SIEEgUEFSVElD VUxBUiBQVVJQT1NFLiAgU2VlIHRoZQorICogIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGZv ciBtb3JlIGRldGFpbHMuCisgKgorICogIFlvdSBzaG91bGQgaGF2ZSByZWNlaXZlZCBhIGNvcHkg b2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlCisgKiAgYWxvbmcgd2l0aCB0aGlzIHBy b2dyYW07IGlmIG5vdCwgd3JpdGUgdG8gdGhlIEZyZWUgU29mdHdhcmUKKyAqICBGb3VuZGF0aW9u LCBJbmMuLCA1MSBGcmFua2xpbiBTdCwgRmlmdGggRmxvb3IsIEJvc3RvbiwgTUEgIDAyMTEwLTEz MDEgIFVTQQorICoKKyAqLworCisjaWZkZWYgSEFWRV9DT05GSUdfSAorI2luY2x1ZGUgPGNvbmZp Zy5oPgorI2VuZGlmCisKKyNpbmNsdWRlIDxibHVldG9vdGgvYmx1ZXRvb3RoLmg+CisKKyNpbmNs dWRlICJwbHVnaW4uaCIKKyNpbmNsdWRlICJsb2dnaW5nLmgiCisKK3N0YXRpYyBpbnQgaGNpcmF3 X2luaXQodm9pZCkKK3sKKwlyZXR1cm4gMDsKK30KKworc3RhdGljIHZvaWQgaGNpcmF3X2V4aXQo dm9pZCkKK3sKK30KKworQkxVRVRPT1RIX1BMVUdJTl9ERUZJTkUoaGNpcmF3LCBWRVJTSU9OLAor CQkJQkxVRVRPT1RIX1BMVUdJTl9QUklPUklUWV9ERUZBVUxULCBoY2lyYXdfaW5pdCwgaGNpcmF3 X2V4aXQpCi0tIAoxLjUuNi4zCgo= --0016364594ac95b011046823bc4e Content-Type: text/x-diff; charset=US-ASCII; name="0002-exporting-device_event.patch" Content-Disposition: attachment; filename="0002-exporting-device_event.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fttzm5sw1 RnJvbSBjNjZiMDA1YjE1ZDlkODZjMzYzNDM0ZDNkNzFmOTc0ZDVlMjNlNjl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diff; charset=US-ASCII; name="0003-Using-device_event-to-register-and-setup-already-kno.patch" Content-Disposition: attachment; filename="0003-Using-device_event-to-register-and-setup-already-kno.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fttzm69y2 RnJvbSBiZjU3OWYzNmVjNGYwYjllNzE4YzdkNzNhNDEwZmJmNzM4NDdjMWU0IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBBbG9rIEJhcnNvZGUgPGFsb2suYmFyc29kZUBhemluZ28uY29t PgpEYXRlOiBUdWUsIDIxIEFwciAyMDA5IDIyOjAyOjE2ICswNTMwClN1YmplY3Q6IFtQQVRDSCAz LzRdIFVzaW5nIGRldmljZV9ldmVudCB0byByZWdpc3RlciBhbmQgc2V0dXAgYWxyZWFkeSBrbm93 biBkZXZpY2VzLgoKLS0tCiBzcmMvbWFpbi5jIHwgICAgOSArKystLS0tLS0KIDEgZmlsZXMgY2hh bmdlZCwgMyBpbnNlcnRpb25zKCspLCA2IGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL3NyYy9t YWluLmMgYi9zcmMvbWFpbi5jCmluZGV4IDAyYjRlYmYuLmE1ODg1ZmUgMTAwNjQ0Ci0tLSBhL3Ny Yy9tYWluLmMKKysrIGIvc3JjL21haW4uYwpAQCAtNTI5LDEzICs1MjksMTAgQEAgc3RhdGljIHZv aWQgaW5pdF9hbGxfZGV2aWNlcyhpbnQgY3RsKQogCQlnYm9vbGVhbiBkZXZ1cDsKIAogCQlkZXZ1 cCA9IGhjaV90ZXN0X2JpdChIQ0lfVVAsICZkci0+ZGV2X29wdCk7CisJCWlmICghZGV2dXApCisJ CQlkZXZpY2VfZXZlbnQoSENJX0RFVl9SRUcsIGRyLT5kZXZfaWQpOwogCi0JCWluZm8oIkhDSSBk ZXYgJWQgcmVnaXN0ZXJlZCIsIGRyLT5kZXZfaWQpOwotCQlkZXZpY2VfZGV2cmVnX3NldHVwKGRy LT5kZXZfaWQsIGRldnVwKTsKLQkJaWYgKGRldnVwKSB7Ci0JCQlpbmZvKCJIQ0kgZGV2ICVkIGFs cmVhZHkgdXAiLCBkci0+ZGV2X2lkKTsKLQkJCWRldmljZV9kZXZ1cF9zZXR1cChkci0+ZGV2X2lk KTsKLQkJfQorCQlkZXZpY2VfZXZlbnQoSENJX0RFVl9VUCwgZHItPmRldl9pZCk7CiAJfQogCiAJ Z19mcmVlKGRsKTsKLS0gCjEuNS42LjMKCg== --0016364594ac95b011046823bc4e Content-Type: text/x-diff; charset=US-ASCII; name="0004-Initializing-hci-raw-socket-plugin.-Adding-IO-event.patch" Content-Disposition: attachment; filename="0004-Initializing-hci-raw-socket-plugin.-Adding-IO-event.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_fttzm6ou3 RnJvbSAzYzVjZDhkY2IzOWQxNmJjNGM2MjkyYjU1Y2JlNTk2MWU4N2MwMWU4IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBBbG9rIEJhcnNvZGUgPGFsb2suYmFyc29kZUBhemluZ28uY29t PgpEYXRlOiBXZWQsIDIyIEFwciAyMDA5IDE2OjM0OjA5ICswNTMwClN1YmplY3Q6IFtQQVRDSCA0 LzRdIEluaXRpYWxpemluZyBoY2kgcmF3IHNvY2tldCBwbHVnaW4uIEFkZGluZyBJTyBldmVudCBo YW5kbGluZy4KCi0tLQogcGx1Z2lucy9oY2lyYXcuYyB8ICAxMzUgKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKystCiBzcmMvbWFpbi5jICAgICAgIHwg IDEyMiArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAy IGZpbGVzIGNoYW5nZWQsIDEzNSBpbnNlcnRpb25zKCspLCAxMjIgZGVsZXRpb25zKC0pCgpkaWZm IC0tZ2l0IGEvcGx1Z2lucy9oY2lyYXcuYyBiL3BsdWdpbnMvaGNpcmF3LmMKaW5kZ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