Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750919AbWJMIrV (ORCPT ); Fri, 13 Oct 2006 04:47:21 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750941AbWJMIrV (ORCPT ); Fri, 13 Oct 2006 04:47:21 -0400 Received: from bay0-omc1-s24.bay0.hotmail.com ([65.54.246.96]:67 "EHLO bay0-omc1-s24.bay0.hotmail.com") by vger.kernel.org with ESMTP id S1750919AbWJMIrU (ORCPT ); Fri, 13 Oct 2006 04:47:20 -0400 Message-ID: X-Originating-IP: [80.178.89.188] X-Originating-Email: [yan_952@hotmail.com] From: "Burman Yan" To: linux-kernel@vger.kernel.org Subject: [PATCH] HP mobile data protection system driver Date: Fri, 13 Oct 2006 10:47:15 +0200 Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_1a11_3a40_50f4" X-OriginalArrivalTime: 13 Oct 2006 08:47:19.0567 (UTC) FILETIME=[314AC9F0:01C6EEA4] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 31518 Lines: 535 This is a multi-part message in MIME format. ------=_NextPart_000_1a11_3a40_50f4 Content-Type: text/plain; format=flowed Hi, all. I'm new to the list so forgive me in advance for any netiquette mistakes I make. I wrote a driver for the accelerometer chip on HP nc6400 laptop (I think the same chip is present on other NCxxxx models). This driver uses ACPI interface present in the bios and behaves pretty much like hdaps. This is a fully functional version - tested on 2.6.17 and 2.6.18 (not 2.6.19-rc1 since I have a problem with that kernel on my laptop). It applies on 2.6.19-rc1 as well though. I would like your remarks and suggestions on this. Also, should I mail this patch to a kernel maintainer? I could not find a maintainer that looks like the address for this patch. The closest one is the lm_sensors maintainer, but that's probably wrong. Thanks in advance Yan Burman yan_952@hotmail.com _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ ------=_NextPart_000_1a11_3a40_50f4 Content-Type: application/octet-stream; name="mdps.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="mdps.patch" SFAgTW9iaWxlIERhdGEgUHJvdGVjdGlvbiBTeXN0ZW0gM0QgQUNQSSBkcml2 ZXIuIFNpbWlsYXIgdG8gaGRhcHMgaW4gZnVuY3Rpb25hbGl0eS4KCkZvciBj b21tZW50cyBtYWlsIHRvOiB5YW5fOTUyQGhvdG1haWwuY29tCgpkaWZmIC1O cnVicCBsaW51eC0yLjYuMTgub3JpZy9kcml2ZXJzL2h3bW9uL0tjb25maWcg bGludXgtMi42LjE4Lm1kcHMvZHJpdmVycy9od21vbi9LY29uZmlnCi0tLSBs aW51eC0yLjYuMTgub3JpZy9kcml2ZXJzL2h3bW9uL0tjb25maWcJMjAwNi0x MC0xMSAxNDoyMDowOC4wMDAwMDAwMDAgKzAyMDAKKysrIGxpbnV4LTIuNi4x OC5tZHBzL2RyaXZlcnMvaHdtb24vS2NvbmZpZwkyMDA2LTEwLTEzIDA4OjUy OjQyLjAwMDAwMDAwMCArMDIwMApAQCAtNTA3LDYgKzUwNywyMiBAQCBjb25m aWcgU0VOU09SU19IREFQUwogCSAgU2F5IFkgaGVyZSBpZiB5b3UgaGF2ZSBh biBhcHBsaWNhYmxlIGxhcHRvcCBhbmQgd2FudCB0byBleHBlcmllbmNlCiAJ ICB0aGUgYXdlc29tZSBwb3dlciBvZiBoZGFwcy4KIAorY29uZmlnIFNFTlNP UlNfTURQUworICAgICAgICB0cmlzdGF0ZSAiSFAgTW9iaWxlIERhdGEgUHJv dGVjdGlvbiBTeXN0ZW0gM0QgKG1kcHMpIgorICAgICAgICBkZXBlbmRzIG9u IEFDUEkgJiYgSFdNT04gJiYgSU5QVVQgJiYgWDg2CisgICAgICAgIGRlZmF1 bHQgbgorICAgICAgICBoZWxwCisgICAgICAgICAgVGhpcyBkcml2ZXIgcHJv dmlkZXMgc3VwcG9ydCBmb3IgdGhlIEhQIE1vYmlsZSBEYXRhIFByb3RlY3Rp b24gCisgICAgICAgICAg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CitzdHJ1Y3QgYWNwaV9tZHBzCit7CisgICAgICAgIHN0cnVjdCBh Y3BpX2RldmljZSogZGV2aWNlOyAgICAvKiBUaGUgQUNQSSBkZXZpY2UgKi8K KyAgICAgICAgdTMyICAgICAgICAgICAgICAgICBpcnE7ICAgICAgIC8qIElS USBudW1iZXIgKi8KKyAgICAgICAgc3RydWN0IGlucHV0X2RldiogICBpZGV2 OyAgICAgIC8qIGlucHV0IGRldmljZSAqLworICAgICAgICBzdHJ1Y3QgdGFz a19zdHJ1Y3QqIGt0aHJlYWQ7ICAgLyoga3RocmVhZCBmb3IgaW5wdXQgKi8K KyAgICAgICAgaW50ICAgICAgICAgICAgICAgICB4Y2FsaWI7ICAgIC8qIGNh bGlicmF0ZWQgbnVsbCB2YWx1ZSBmb3IgeCAqLworICAgICAgICBpbnQgICAg ICAgICAgICAgICAgIHljYWxpYjsgICAgLyogY2FsaWJyYXRlZCBudWxsIHZh bHVlIGZvciB5ICovCisgICAgICAgIGludCAgICAgICAgICAgICAgICAgaXNf b247ICAgICAvKiB3aGV0aGVyIHRoZSBkZXZpY2UgaXMgb24gb3Igb2ZmICov CisjaWZkZWYgQ09ORklHX1BST0NfRlMKKyAgICAgICAgc3RydWN0IHByb2Nf ZGlyX2VudHJ5ICpkaXI7CisjZW5kaWYKK307CisKK3N0YXRpYyBzdHJ1Y3Qg YWNwaV9tZHBzIG1kcHM7CisKK3N0YXRpYyBpbnQgbWRwc19hZGQoc3RydWN0 IGFjcGlfZGV2aWNlICpkZXZpY2UpOworc3RhdGljIGludCBtZHBzX3JlbW92 ZShzdHJ1Y3QgYWNwaV9kZXZpY2UgKmRldmljZSwgaW50IHR5cGUpOworc3Rh dGljIGludCBtZHBzX3N1c3BlbmQoc3RydWN0IGFjcGlfZGV2aWNlICogZGV2 aWNlLCBpbnQgc3RhdGUpOworc3RhdGljIGludCBtZHBzX3Jlc3VtZShzdHJ1 Y3QgYWNwaV9kZXZpY2UgKiBkZXZpY2UsIGludCBzdGF0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oZSBvcGVyYXRpb24KKyAqIEByZXR1cm4g QUVfT0sgb24gc3VjY2VzcworICovCitzdGF0aWMgYWNwaV9zdGF0dXMgbWRw c19BTFdSKGFjcGlfaGFuZGxlIGhhbmRsZSwgaW50IHJlZywgaW50IHZhbCwK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyog cmV0KQoreworICAgICAgICB1bmlvbiBhY3BpX29iamVjdCBpbl9vYmpbMl07 CisgICAgICAgIHN0cnVjdCBhY3BpX29iamVjdF9saXN0IGFyZ3M7CisKKyAg ICAgICAgYXJncy5jb3VudCAgICAgICAgICAgICAgPSAyOworICAgICAgICBh cmdzLnBvaW50ZXIgICAgICAgICAgICA9IGluX29iajsKKyAgICAgICAgaW5f b2JqWzBdLnR5cGUgICAgICAgICAgPSBBQ1BJX1RZUEVfSU5URUdFUjsKKyAg ICAgICAgaW5fb2JqWzBdLmludGVnZXIudmFsdWUgPSByZWc7CisgICAgICAg IGluX29ialsxXS50eXBlICAgICAgICAgID0gQUNQSV9UWVBFX0lOVEVHRVI7 CisgICAgICAgIGluX29ialsxXS5pbnRlZ2VyLnZhbHVlID0gdmFsOworCisg ICAgICAgIHJldHVybiBhY3BpX2V2YWx1YXRlX2ludGVnZXIoaGFuZGxlLCAi QUxXUiIsICZhcmdzLCByZXQpOworfQorCitzdGF0aWMgaW50IG1kcHNfZ2V0 X3h5KGFjcGlfaGFuZGxlIGhhbmRsZSwgaW50KiB4LCBpbnQqIHkpCit7Cisg ICAgICAgIHVuc2lnbmVkIGxvbmcgeF9sbywgeF9oaSwgeV9sbywgeV9oaTsK KworICAgICAgICBtZHBzX0FMUkQobWRwcy5kZXZpY2UtPmhhbmRsZSwgTURQ U19PVVRYX0wsICZ4X2xvKTsKKyAgICAgICAgbWRwc19BTFJEKG1kcHMuZGV2 aWNlLT5oYW5kbGUsIE1EUFNfT1VUWF9ILCAmeF9oaSk7CisgICAgICAgIG1k cHNfQUxSRChtZHBzLmRldmljZS0+aGFuZGxlLCBNRFBTX09VVFlfTCwgJnlf bG8pOworICAgICAgICBtZHBzX0FMUkQobWRwcy5kZXZpY2UtPmhhbmRsZSwg TURQU19PVVRZX0gsICZ5X2hpKTsKKworICAgICAgICAqeCA9IG1kcHNfZ2x1 ZV9ieXRlcyh4X2hpLCB4X2xvKTsKKyAgICAgICAgKnkgPSBtZHBzX2dsdWVf Ynl0ZXMoeV9oaSwgeV9sbyk7CisKKyAgICAgICAgcmV0dXJuIDA7Cit9CisK K3N0YXRpYyBpbnQgbWRwc19tb3VzZV9rdGhyZWFkKHZvaWQgKmRhdGEpCit7 CisgICAgICAgIGludCB4LCB5OworCisgICAgICAgIHdoaWxlICgha3RocmVh ZF9zaG91bGRfc3RvcCgpKSB7CisgICAgICAgICAgICAgICAgbWRwc19nZXRf eHkobWRwcy5kZXZpY2UtPmhhbmRsZSwgJngsICZ5KTsKKworICAgICAgICAg ICAgICAgIC8vIG5lZWQgdG8gaW52ZXJ0IHRoZSBYIGF4aXMgZm9yIHRoaXMg dG8gbG9vayBuYXR1cmFsCisgICAgICAgICAgICAgICAgaW5wdXRfcmVwb3J0 X2FicyhtZHBzLmlkZXYsIEFCU19YLCAtKHggLSBtZHBzLnhjYWxpYikpOwor ICAgICAgICAgICAgICAgIGlucHV0X3JlcG9ydF9hYnMobWRwcy5pZGV2LCBB QlNfWSwgeSAtIG1kcHMueWNhbGliKTsKKworICAgICAgICAgICAgICAgIGlu cHV0X3N5bmMobWRwcy5pZGV2KTsKKworICAgICAgICAgICAgICAgIG1zbGVl cF9pbnRlcnJ1cHRpYmxlKE1EUFNfUE9MTF9JTlRFUlZBTCk7CisgICAgICAg IH0KKworICAgICAgICByZXR1cm4gMDsKK30KKworc3RhdGljIGlubGluZSBp bnQgbWRwc19wb3dlcm9mZihhY3BpX2hhbmRsZSBoYW5kbGUpCit7CisgICAg ICAgIHVuc2lnbmVkIGxvbmcgcmV0OworICAgICAgICBtZHBzLmlzX29uID0g MDsKKyAgICAgICAgcmV0dXJuIChtZHBzX0FMV1IoaGFuZGxlLCBNRFBTX0NU UkxfUkVHMSwgMHgwMCwgJnJldCkgPT0gQUVfT0spOworfQorCitzdGF0aWMg aW5saW5lIGludCBtZHBzX3Bvd2Vyb24oYWNwaV9oYW5kbGUgaGFuZGxlKQor eworICAgICAgICBtZHBzLmlzX29uID0gMTsKKyAgICAgICAgcmV0dXJuICht ZHBzX19JTkkoaGFuZGxlKSA9PSBBRV9PSyk7Cit9CisKK2ludCBtZHBzX3N1 c3BlbmQoc3RydWN0IGFjcGlfZGV2aWNlICogZGV2aWNlLCBpbnQgc3RhdGUp Cit7CisgICAgICAgIG1kcHNfcG93ZXJvZmYobWRwcy5kZXZpY2UtPmhhbmRs ZSk7CisKKyAgICAgICAgbWRwc19tb3VzZV9kaXNhYmxlKCk7CisKKyAgICAg ICAgcmV0dXJuIDA7Cit9CisKK2ludCBtZHBzX3Jlc3VtZShzdHJ1Y3QgYWNw aV9kZXZpY2UgKiBkZXZpY2UsIGludCBzdGF0ZSkKK3sKKyAgICAgICAgbWRw c19wb3dlcm9uKG1kcHMuZGV2aWNlLT5oYW5kbGUpOworCisgICAgICAgIGlm IChtb3VzZSkKKyAgICAgICAgICAgICAgICBtZHBzX21vdXNlX2VuYWJsZSgp OworCisgICAgICAgIHJldHVybiAwOworfQorCitzdGF0aWMgYWNwaV9zdGF0 dXMKK21kcHNfZ2V0X3Jlc291cmNlKHN0cnVjdCBhY3BpX3Jlc291cmNlICpy ZXNvdXJjZSwgdm9pZCAqY29udGV4dCkKK3sKKyAgICAgICAgaWYgKHJlc291 cmNlLT50eXBlID09IEFDUElfUkVTT1VSQ0VfVFlQRV9FWFRFTkRFRF9JUlEp IHsKKyAgICAgICAgICAgICAgICBzdHJ1Y3QgYWNwaV9yZXNvdXJjZV9leHRl bmRlZF9pcnEqIGlycTsKKyAgICAgICAgICAgICAgICB1MzIqIGRldmljZV9p cnEgPSBjb250ZXh0OworCisgICAgICAgICAgICAgICAgaXJxID0gJnJlc291 cmNlLT5kYXRhLmV4dGVuZGVkX2lycTsKKyAgICAgICAgICAgICAgICAqZGV2 aWNlX2lycSA9IGlycS0+aW50ZXJydXB0c1swXTsKKyAgICAgICAgfQorCisg ICAgICAgIHJldHVybiBBRV9PSzsKK30KKworc3RhdGljIHZvaWQgbWRwc19l bnVtX3Jlc291cmNlcyhzdHJ1Y3QgYWNwaV9kZXZpY2UgKiBkZXZpY2UpCit7 CisgICAgICAgIGFjcGlfc3RhdHVzIHN0YXR1czsKKworICAgICAgICBzdGF0 dXMgPSBhY3BpX3dhbGtfcmVzb3VyY2VzKGRldmljZS0+aGFuZGxlLCBNRVRI T0RfTkFNRV9fQ1JTLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIG1kcHNfZ2V0X3Jlc291cmNlLCAmbWRwcy5pcnEpOworICAgICAg ICBpZiAoQUNQSV9GQUlMVVJFKHN0YXR1cykpCisgICAgICAgICAgICAgICAg cHJpbnRrKEtFUk5fREVCVUcgIm1kcHM6IEVycm9yIGdldHRpbmcgcmVzb3Vy Y2VzXG4iKTsKK30KKworaW50IG1kcHNfYWRkKHN0cnVjdCBhY3BpX2Rldmlj ZSAqZGV2aWNlKQoreworICAgICAgICB1bnNpZ25lZCBsb25nIHZhbDsKKwor ICAgICAgICBpZiAoIWRldmljZSkKKyAgICAgICAgICAgICAgICByZXR1cm4g LUVJTlZBTDsKKworICAgICAgICBtZHBzLmRldmljZSA9IGRldmljZTsKKyAg ICAgICAgc3RyY3B5KGFjcGlfZGV2aWNlX25hbWUoZGV2aWNlKSwgIm1kcHMi KTsKKyAgICAgICAgc3RyY3B5KGFjcGlfZGV2aWNlX2NsYXNzKGRldmljZSks IEFDUElfTURQU19DTEFTUyk7CisgICAgICAgIGFjcGlfZHJpdmVyX2RhdGEo ZGV2aWNlKSA9ICZtZHBzOworCisgICAgICAgIG1kcHNfQUxSRChkZXZpY2Ut PmhhbmRsZSwgTURQU19XSE9fQU1fSSwgJnZhbCk7CisgICAgICAgIGlmICh2 YWwgIT0gTURQU19JRCkgeworICAgICAgICAgICAgICAgIHByaW50ayhLRVJO X0lORk8gIm1kcHM6IEFjY2VsZXJvbWV0ZXIgY2hpcCBub3QgTElTM0xWMDJE e0wsUX1cbiIpOworICAgICAgICAgICAgICAgIHJldHVybiAtRU5PREVWOwor ICAgICAgICB9CisKKyAgICAgICAgbWRwc19lbnVtX3Jlc291cmNlcyhkZXZp Y2UpOworICAgICAgICBtZHBzX2FkZF9mcyhkZXZpY2UpOworICAgICAgICBt ZHBzX3Jlc3VtZShkZXZpY2UsIDMpOworCisjaWZkZWYgQ09ORklHX1BST0Nf RlMKKyAgICAgICAgaWYgKHBvd2VyX29mZikKKyAgICAgICAgICAgICAgICBt ZHBzX3Bvd2Vyb2ZmKG1kcHMuZGV2aWNlLT5oYW5kbGUpOworI2VuZGlmCisK KyAgICAgICAgcmV0dXJuIDA7Cit9CisKK2ludCBtZHBzX3JlbW92ZShzdHJ1 Y3QgYWNwaV9kZXZpY2UgKmRldmljZSwgaW50IHR5cGUpCit7CisgICAgICAg IGlmICghZGV2aWNlKQorICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFM OworCisgICAgICAgIGlmIChtb3VzZSkKKyAgICAgICAgICAgICAgICBtZHBz X21vdXNlX2Rpc2FibGUoKTsKKworICAgICAgICByZXR1cm4gbWRwc19yZW1v dmVfZnMoKTsKK30KKworc3RhdGljIGlubGluZSB2b2lkIG1kcHNfY2FsaWJy YXRlX21vdXNlKHZvaWQpCit7CisgICAgICAgIGludCB4LCB5OworICAgICAg ICBtZHBzX2dldF94eShtZHBzLmRldmljZS0+aGFuZGxlLCAmeCwgJnkpOwor CisgICAgICAgIG1kcHMueGNhbGliID0geDsKKyAgICAgICAgbWRwcy55Y2Fs aWIgPSB5OworfQorCisjaWZkZWYgQ09ORklHX1BST0NfRlMKK3N0YXRpYyBp bnQgbWRwc19wcm9jX3Bvc2l0aW9uX3Nob3coc3RydWN0IHNlcV9maWxlICpz ZXEsIHZvaWQgKnYpCit7CisgICAgICAgIHVuc2lnbmVkIGxvbmcgel9sbywg el9oaTsKKyAgICAgICAgaW50IHgsIHksIHo7CisKKyAgICAgICAgbWRwc19n ZXRfeHkobWRwcy5kZXZpY2UtPmhhbmRsZSwgJngsICZ5KTsKKworICAgICAg ICBtZHBzX0FMUkQobWRwcy5kZXZpY2UtPmhhbmRsZSwgTURQU19PVVRaX0ws ICZ6X2xvKTsKKyAgICAgICAgbWRwc19BTFJEKG1kcHMuZGV2aWNlLT5oYW5k bGUsIE1EUFNfT1VUWl9ILCAmel9oaSk7CisKKyAgICAgICAgeiA9IG1kcHNf Z2x1ZV9ieXRlcyh6X2hpLCB6X2xvKTsKKworICAgICAgICBzZXFfcHJpbnRm KHNlcSwgIiglZCwgJWQsICVkKVxuIiwgeCwgeSwgeik7CisKKyAgICAgICAg cmV0dXJuIDA7Cit9CisKK3N0YXRpYyBpbnQgbWRwc19wcm9jX3N0YXRlX3No b3coc3RydWN0IHNlcV9maWxlICpzZXEsIHZvaWQgKnYpCit7CisgICAgICAg IHNlcV9wdXRzKHNlcSwgKG1kcHMuaXNfb24gPyAib25cbiIgOiAib2ZmXG4i KSk7CisKKyAgICAgICAgcmV0dXJuIDA7Cit9CisKK3N0YXRpYyBpbnQgbWRw c19wcm9jX2NhbGlicmF0ZV9tb3VzZV9zaG93KHN0cnVjdCBzZXFfZmlsZSAq c2VxLCB2b2lkICp2KQoreworICAgICAgICByZXR1cm4gMDsKK30KKworc3Rh dGljIGludCBtZHBzX3Byb2NfbW91c2Vfc2hvdyhzdHJ1Y3Qgc2VxX2ZpbGUg KnNlcSwgdm9pZCAqdikKK3sKKyAgICAgICAgc2VxX3B1dHMoc2VxLCAobW91 c2UgPyAiZW5hYmxlZFxuIiA6ICJkaXNhYmxlZFxuIikpOworCisgICAgICAg IHJldHVybiAwOworfQorCitzdGF0aWMgc3NpemVfdAorbWRwc193cml0ZV9j YWxpYnJhdGVfbW91c2Uoc3RydWN0IGZpbGUgKmZpbGUsIGNvbnN0IGNoYXIg X191c2VyICogYnVmZmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAg c2l6ZV90IGNvdW50LCBsb2ZmX3QgKiBwcG9zKQoreworICAgICAgICBtZHBz X2NhbGlicmF0ZV9tb3VzZSgpOworCisgICAgICAgIHJldHVybiBjb3VudDsK K30KKworc3RhdGljIGludCBtZHBzX3Byb2NfcmF0ZV9zaG93KHN0cnVjdCBz ZXFfZmlsZSAqc2VxLCB2b2lkICp2KQoreworICAgICAgICB1bnNpZ25lZCBs b25nIGN0cmw7CisgICAgICAgIGludCByYXRlID0gMDsKKworICAgICAgICBt ZHBzX0FMUkQobWRwcy5kZXZpY2UtPmhhbmRsZSwgTURQU19DVFJMX1JFRzEs ICZjdHJsKTsKKworICAgICAgICBzd2l0Y2ggKGN0cmwgJiAweDMwKQorICAg ICAgICB7CisgICAgICAgIGNhc2UgMHgwMDoKKyAgICAgICAgICAgICAgICBy YXRlID0gNDA7CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAg Y2FzZSAweDEwOgorICAgICAgICAgICAgICAgIHJhdGUgPSAxNjA7CisgICAg ICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSAweDIwOgorICAg ICAgICAgICAgICAgIHJhdGUgPSA2NDA7CisgICAgICAgICAgICAgICAgYnJl YWs7CisKKyAgICAgICAgY2FzZSAweDMwOgorICAgICAgICAgICAgICAgIHJh dGUgPSAyNTYwOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9 CisKKyAgICAgICAgc2VxX3ByaW50ZihzZXEsICJzYW1wbGluZyByYXRlOlx0 JWRIelxuIiwgcmF0ZSk7CisKKyAgICAgICAgcmV0dXJuIDA7Cit9CisKK3N0 YXRpYyBzc2l6ZV90CittZHBzX3dyaXRlX3N0YXRlKHN0cnVjdCBmaWxlICpm aWxlLCBjb25zdCBjaGFyIF9fdXNlciAqIGJ1ZmZlciwKKyAgICAgICAgICAg ICAgICAgc2l6ZV90IGNvdW50LCBsb2ZmX3QgKiBwcG9zKQoreworICAgICAg ICBjaGFyIHN0YXRlX3N0cmluZ1sxMl0gPSB7ICdcMCcgfTsKKworICAgICAg ICBpZiAoKGNvdW50ID4gc2l6ZW9mKHN0YXRlX3N0cmluZykgLSAxKSkKKyAg ICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKKworICAgICAgICBpZiAo Y29weV9mcm9tX3VzZXIoc3RhdGVfc3RyaW5nLCBidWZmZXIsIGNvdW50KSkK KyAgICAgICAgICAgICAgICByZXR1cm4gLUVGQVVMVDsKKworICAgICAgICBz dGF0ZV9zdHJpbmdbY291bnRdID0gJ1wwJzsKKworICAgICAgICBtZHBzLmlz X29uID0gc2ltcGxlX3N0cnRvdWwoc3RhdGVfc3RyaW5nLCBOVUxMLCAwKTsK KworICAgICAgICBpZiAobWRwcy5pc19vbikKKyAgICAgICAgICAgICAgICBt ZHBzX3Bvd2Vyb24obWRwcy5kZXZpY2UtPmhhbmRsZSk7CisgICAgICAgIGVs c2UKKyAgICAgICAgICAgICAgICBtZHBzX3Bvd2Vyb2ZmKG1kcHMuZGV2aWNl LT5oYW5kbGUpOworCisgICAgICAgIHJldHVybiBjb3VudDsKK30KKworc3Rh dGljIHNzaXplX3QgbWRwc193cml0ZV9tb3VzZShzdHJ1Y3QgZmlsZSAqZmls ZSwgY29uc3QgY2hhciBfX3VzZXIgKiBidWZmZXIsCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHNpemVfdCBjb3VudCwgbG9mZl90ICogcHBv cykKK3sKKyAgICAgICAgY2hhciBzdGF0ZV9zdHJpbmdbMTJdID0geyAnXDAn IH07CisKKyAgICAgICAgaWYgKChjb3VudCA+IHNpemVvZihzdGF0ZV9zdHJp bmcpIC0gMSkpCisgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CisK KyAgICAgICAgaWYgKGNvcHlfZnJvbV91c2VyKHN0YXRlX3N0cmluZywgYnVm ZmVyLCBjb3VudCkpCisgICAgICAgICAgICAgICAgcmV0dXJuIC1FRkFVTFQ7 CisKKyAgICAgICAgc3RhdGVfc3RyaW5nW2NvdW50XSA9ICdcMCc7CisKKyAg ICAgICAgbW91c2UgPSBzaW1wbGVfc3RydG91bChzdGF0ZV9zdHJpbmcsIE5V TEwsIDApOworCisgICAgICAgIGlmIChtb3VzZSkKKyAgICAgICAgICAgICAg ICBtZHBzX21vdXNlX2VuYWJsZSgpOworICAgICAgICBlbHNlCisgICAgICAg ICAgICAgICAgbWRwc19tb3VzZV9kaXNhYmxlKCk7CisKKyAgICAgICAgcmV0 dXJuIGNvdW50OworfQorCitzdGF0aWMgaW50IG1kcHNfcHJvY19wb3NpdGlv bl9vcGVuKHN0cnVjdCBpbm9kZSAqaW5vZGUsIHN0cnVjdCBmaWxlICpmaWxl KQoreworICAgICAgICByZXR1cm4gc2luZ2xlX29wZW4oZmlsZSwgbWRwc19w cm9jX3Bvc2l0aW9uX3Nob3csIE5VTEwpOworfQorCitzdGF0aWMgaW50IG1k cHNfcHJvY19zdGF0ZV9vcGVuKHN0cnVjdCBpbm9kZSAqaW5vZGUsIHN0cnVj dCBmaWxlICpmaWxlKQoreworICAgICAgICByZXR1cm4gc2luZ2xlX29wZW4o ZmlsZSwgbWRwc19wcm9jX3N0YXRlX3Nob3csIE5VTEwpOworfQorCitzdGF0 aWMgaW50IG1kcHNfcHJvY19yYXRlX29wZW4oc3RydWN0IGlub2RlICppbm9k ZSwgc3RydWN0IGZpbGUgKmZpbGUpCit7CisgICAgICAgIHJldHVybiBzaW5n bGVfb3BlbihmaWxlLCBtZHBzX3Byb2NfcmF0ZV9zaG93LCBOVUxMKTsKK30K Kworc3RhdGljIGludCBtZHBzX3Byb2NfbW91c2Vfb3BlbihzdHJ1Y3QgaW5v ZGUgKmlub2RlLCBzdHJ1Y3QgZmlsZSAqZmlsZSkKK3sKKyAgICAgICAgcmV0 dXJuIHNpbmdsZV9vcGVuKGZpbGUsIG1kcHNfcHJvY19tb3VzZV9zaG93LCBO VUxMKTsKK30KKworc3RhdGljIGludCBtZHBzX3Byb2NfY2FsaWJyYXRlX21v dXNlX29wZW4oc3RydWN0IGlub2RlICppbm9kZSwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmaWxlICpmaWxl KQoreworICAgICAgICByZXR1cm4gc2luZ2xlX29wZW4oZmlsZSwgbWRwc19w cm9jX2NhbGlicmF0ZV9tb3VzZV9zaG93LCBOVUxMKTsKK30KKworc3RhdGlj IGNvbnN0IHN0cnVjdCBmaWxlX29wZXJhdGlvbnMgbWRwc19wcm9jX3Bvc2l0 aW9uX2ZvcHMgPQoreworICAgICAgICAub3duZXIgICA9IFRISVNfTU9EVUxF LAorICAgICAgICAub3BlbiAgICA9IG1kcHNfcHJvY19wb3NpdGlvbl9vcGVu LAorICAgICAgICAucmVhZCAgICA9IHNlcV9yZWFkLAorICAgICAgICAubGxz ZWVrICA9IHNlcV9sc2VlaywKKyAgICAgICAgLnJlbGVhc2UgPSBzaW5nbGVf cmVsZWFzZSwKK307CisKK3N0YXRpYyBjb25zdCBzdHJ1Y3QgZmlsZV9vcGVy YXRpb25zIG1kcHNfcHJvY19zdGF0ZV9mb3BzID0KK3sKKyAgICAgICAgLm93 bmVyICAgPSBUSElTX01PRFVMRSwKKyAgICAgICAgLm9wZW4gICAgPSBtZHBz X3Byb2Nfc3RhdGVfb3BlbiwKKyAgICAgICAgLnJlYWQgICAgPSBzZXFfcmVh ZCwKKyAgICAgICAgLndyaXRlICAgPSBtZHBzX3dyaXRlX3N0YXRlLAorICAg ICAgICAubGxzZWVrICA9IHNlcV9sc2VlaywKKyAgICAgICAgLnJlbGVhc2Ug PSBzaW5nbGVfcmVsZWFzZSwKK307CisKK3N0YXRpYyBjb25zdCBzdHJ1Y3Qg ZmlsZV9vcGVyYXRpb25zIG1kcHNfcHJvY19tb3VzZV9mb3BzID0KK3sKKyAg ICAgICAgLm93bmVyICAgPSBUSElTX01PRFVMRSwKKyAgICAgICAgLm9wZW4g ICAgPSBtZHBzX3Byb2NfbW91c2Vfb3BlbiwKKyAgICAgICAgLnJlYWQgICAg PSBzZXFfcmVhZCwKKyAgICAgICAgLndyaXRlICAgPSBtZHBzX3dyaXRlX21v dXNlLAorICAgICAgICAubGxzZWVrICA9IHNlcV9sc2VlaywKKyAgICAgICAg LnJlbGVhc2UgPSBzaW5nbGVfcmVsZWFzZSwKK307CisKK3N0YXRpYyBjb25z dCBzdHJ1Y3QgZmlsZV9vcGVyYXRpb25zIG1kcHNfcHJvY19jYWxpYnJhdGVf bW91c2VfZm9wcyA9Cit7CisgICAgICAgIC5vd25lciAgID0gVEhJU19NT0RV TEUsCisgICAgICAgIC5vcGVuICAgID0gbWRwc19wcm9jX2NhbGlicmF0ZV9t b3VzZV9vcGVuLAorICAgICAgICAud3JpdGUgICA9IG1kcHNfd3JpdGVfY2Fs aWJyYXRlX21vdXNlLAorICAgICAgICAubGxzZWVrICA9IHNlcV9sc2VlaywK KyAgICAgICAgLnJlbGVhc2UgPSBzaW5nbGVfcmVsZWFzZSwKK307CisKK3N0 YXRpYyBjb25zdCBzdHJ1Y3QgZmlsZV9vcGVyYXRpb25zIG1kcHNfcHJvY19y YXRlX2ZvcHMgPQoreworICAgICAgICAub3duZXIgICA9IFRISVNfTU9EVUxF LAorICAgICAgICAub3BlbiAgICA9IG1kcHNfcHJvY19yYXRlX29wZW4sCisg ICAgICAgIC5yZWFkICAgID0gc2VxX3JlYWQsCisgICAgICAgIC5sbHNlZWsg ID0gc2VxX2xzZWVrLAorICAgICAgICAucmVsZWFzZSA9IHNpbmdsZV9yZWxl YXNlLAorfTsKKyNlbmRpZiAvLyBDT05GSUdfUFJPQ0ZTCisKK3ZvaWQgbWRw c19tb3VzZV9lbmFibGUodm9pZCkKK3sKKyAgICAgICAgaWYgKG1kcHMuaWRl dikKKyAgICAgICAgICAgICAgICByZXR1cm47CisKKyAgICAgICAgbWRwcy5p ZGV2ID0gaW5wdXRfYWxsb2NhdGVfZGV2aWNlKCk7CisgICAgICAgIGlmICgh bWRwcy5pZGV2KQorICAgICAgICAgICAgICAgIHJldHVybjsKKworICAgICAg ICBtZHBzX2NhbGlicmF0ZV9tb3VzZSgpOworCisgICAgICAgIG1kcHMuaWRl di0+bmFtZSAgICAgICA9ICJIUCBNb2JpbGUgRGF0YSBQcm90ZWN0aW9uIFN5 c3RlbSI7CisgICAgICAgIG1kcHMuaWRldi0+aWQuYnVzdHlwZSA9IEJVU19J MkM7CisgICAgICAgIG1kcHMuaWRldi0+aWQudmVuZG9yICA9IDA7CisKKyAg ICAgICAgaW5wdXRfc2V0X2Fic19wYXJhbXMobWRwcy5pZGV2LCBBQlNfWCwg LTIwNDgsIDIwNDgsIDMsIDApOworICAgICAgICBpbnB1dF9zZXRfYWJzX3Bh cmFtcyhtZHBzLmlkZXYsIEFCU19ZLCAtMjA0OCwgMjA0OCwgMywgMCk7CisK KyAgICAgICAgc2V0X2JpdChFVl9BQlMsIG1kcHMuaWRldi0+ZXZiaXQpOwor ICAgICAgICBzZXRfYml0KEVWX0tFWSwgbWRwcy5pZGV2LT5ldmJpdCk7Cisg ICAgICAgIHNldF9iaXQoQlROX1RPVUNILCBtZHBzLmlkZXYtPmtleWJpdCk7 CisKKyAgICAgICAgaWYgKGlucHV0X3JlZ2lzdGVyX2RldmljZShtZHBzLmlk ZXYpKSB7CisgICAgICAgICAgICAgICAgaW5wdXRfZnJlZV9kZXZpY2UobWRw cy5pZGV2KTsKKyAgICAgICAgICAgICAgICBtZHBzLmlkZXYgPSBOVUxMOwor ICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAg IG1kcHMua3RocmVhZCA9IGt0aHJlYWRfcnVuKG1kcHNfbW91c2Vfa3RocmVh ZCwgTlVMTCwgImttZHBzIik7CisgICAgICAgIGlmIChJU19FUlIobWRwcy5r dGhyZWFkKSkgeworICAgICAgICAgICAgICAgIGlucHV0X3VucmVnaXN0ZXJf ZGV2aWNlKG1kcHMuaWRldik7CisgICAgICAgICAgICAgICAgbWRwcy5pZGV2 ID0gTlVMTDsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0K KworICAgICAgICBtb3VzZSA9IDE7CisKKyNpZmRlZiBDT05GSUdfUFJPQ19G UworICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RydWN0IHByb2NfZGly X2VudHJ5ICplbnQ7CisgICAgICAgICAgICAgICAgZW50ID0gY3JlYXRlX3By b2NfZW50cnkoImNhbGlicmF0ZV9tb3VzZSIsIFNfSVdVU1IsIG1kcHMuZGly KTsKKyAgICAgICAgICAgICAgICBpZiAoIWVudCkKKyAgICAgICAgICAgICAg ICB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAg ICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgZW50LT5wcm9jX2ZvcHMg PSAmbWRwc19wcm9jX2NhbGlicmF0ZV9tb3VzZV9mb3BzOworICAgICAgICB9 CisjZW5kaWYKK30KKwordm9pZCBtZHBzX21vdXNlX2Rpc2FibGUodm9pZCkK K3sKKyAgICAgICAgaWYgKCFtZHBzLmlkZXYpCisgICAgICAgICAgICAgICAg cmV0dXJuOworCisgICAgICAgIGt0aHJlYWRfc3RvcChtZHBzLmt0aHJlYWQp OworCisgICAgICAgIGlucHV0X3VucmVnaXN0ZXJfZGV2aWNlKG1kcHMuaWRl dik7CisgICAgICAgIG1kcHMuaWRldiA9IE5VTEw7CisKKyNpZmRlZiBDT05G SUdfUFJPQ19GUworICAgICAgICByZW1vdmVfcHJvY19lbnRyeSgiY2FsaWJy YXRlX21vdXNlIiwgbWRwcy5kaXIpOworI2VuZGlmCit9CisKK2ludCBtZHBz X2FkZF9mcyhzdHJ1Y3QgYWNwaV9kZXZpY2UgKmRldmljZSkKK3sKKyNpZmRl ZiBDT05GSUdfUFJPQ19GUworICAgICAgICBzdHJ1Y3QgcHJvY19kaXJfZW50 cnkgKmVudDsKKworICAgICAgICBtZHBzLmRpciA9IHByb2NfbWtkaXIoTURQ U19QUk9DX1JPT1QsIE5VTEwpOworICAgICAgICBpZiAoIW1kcHMuZGlyKQor ICAgICAgICAgICAgICAgIHJldHVybiAtRU5PTUVNOworCisgICAgICAgIGVu dCA9IGNyZWF0ZV9wcm9jX2VudHJ5KCJwb3NpdGlvbiIsIFNfSUZSRUcgfCBT X0lSVUdPLCBtZHBzLmRpcik7CisgICAgICAgIGlmICghZW50KQorICAgICAg ICAgICAgICAgIHJldHVybiAtRU5PTUVNOworCisgICAgICAgIGVudC0+cHJv Y19mb3BzID0gJm1kcHNfcHJvY19wb3NpdGlvbl9mb3BzOworCisgICAgICAg IGVudCA9IGNyZWF0ZV9wcm9jX2VudHJ5KCJzdGF0ZSIsIFNfSUZSRUcgfCBT X0lSVUdPIHwgU19JV1VTUiwgbWRwcy5kaXIpOworICAgICAgICBpZiAoIWVu dCkKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVOT01FTTsKKworICAgICAg ICBlbnQtPnByb2NfZm9wcyA9ICZtZHBzX3Byb2Nfc3RhdGVfZm9wczsKKwor ICAgICAgICBlbnQgPSBjcmVhdGVfcHJvY19lbnRyeSgicmF0ZSIsIFNfSUZS RUcgfCBTX0lSVUdPLCBtZHBzLmRpcik7CisgICAgICAgIGlmICghZW50KQor ICAgICAgICAgICAgICAgIHJldHVybiAtRU5PTUVNOworCisgICAgICAgIGVu dC0+cHJvY19mb3BzID0gJm1kcHNfcHJvY19yYXRlX2ZvcHM7CisKKyAgICAg ICAgZW50ID0gY3JlYXRlX3Byb2NfZW50cnkoIm1vdXNlIiwgU19JRlJFRyB8 IFNfSVJVR08gfCBTX0lXVVNSLCBtZHBzLmRpcik7CisgICAgICAgIGlmICgh ZW50KQorICAgICAgICAgICAgICAgIHJldHVybiAtRU5PTUVNOworCisgICAg ICAgIGVudC0+cHJvY19mb3BzID0gJm1kcHNfcHJvY19tb3VzZV9mb3BzOwor I2VuZGlmCisKKyAgICAgICAgcmV0dXJuIDA7Cit9CisKK2ludCBtZHBzX3Jl bW92ZV9mcyh2b2lkKQoreworI2lmZGVmIENPTkZJR19QUk9DX0ZTCisgICAg ICAgIHJlbW92ZV9wcm9jX2VudHJ5KCJwb3NpdGlvbiIsIG1kcHMuZGlyKTsK KyAgICAgICAgcmVtb3ZlX3Byb2NfZW50cnkoInN0YXRlIiwgbWRwcy5kaXIp OworICAgICAgICByZW1vdmVfcHJvY19lbnRyeSgicmF0ZSIsIG1kcHMuZGly KTsKKyAgICAgICAgcmVtb3ZlX3Byb2NfZW50cnkoIm1vdXNlIiwgbWRwcy5k aXIpOworICAgICAgICByZW1vdmVfcHJvY19lbnRyeShNRFBTX1BST0NfUk9P VCwgTlVMTCk7CisjZW5kaWYKKworICAgICAgICByZXR1cm4gMDsKK30KKwor c3RhdGljIGludCBfX2luaXQgbWRwc19pbml0X21vZHVsZSh2b2lkKQorewor ICAgICAgICBpbnQgcmV0OworICAgICAgICBhY3BpX3N0YXR1cyBzdGF0dXM7 CisgICAgICAgIGFjcGlfaGFuZGxlIGhhbmRsZSA9IDA7CisKKyAgICAgICAg aWYgKGFjcGlfZGlzYWJsZWQpCisgICAgICAgICAgICAgICAgcmV0dXJuIC1F Tk9ERVY7CisKKyAgICAgICAgLy8gZGV2aWNlIGRldGVjdGlvbjogc2VlIGlm IG91ciBkZXZpY2UgaXMgcHJlc2VudAorICAgICAgICBzdGF0dXMgPSBhY3Bp X2dldF9oYW5kbGUoTlVMTCwgIlxcX1NCLkMwMDIuQUNFTCIsICZoYW5kbGUp OworICAgICAgICBpZiAoQUNQSV9GQUlMVVJFKHN0YXR1cykpIHsKKyAgICAg ICAgICAgICAgICBwcmludGsoS0VSTl9JTkZPICJtZHBzOiBIUCBNb2JpbGUg RGF0YSBQcm90ZWN0aW9uIFN5c3RlbSAzRCBkZXZpY2Ugbm90IGZvdW5kXG4i KTsKKyAgICAgICAgICAgICAgICByZXR1cm4gLUVOT0RFVjsKKyAgICAgICAg fQorCisgICAgICAgIHJldCA9IGFjcGlfYnVzX3JlZ2lzdGVyX2RyaXZlcigm bWRwc19kcml2ZXIpOworICAgICAgICBpZiAocmV0IDwgMCkKKyAgICAgICAg ICAgICAgICByZXR1cm4gcmV0OworCisgICAgICAgIHJldHVybiAwOworfQor CitzdGF0aWMgdm9pZCBfX2V4aXQgbWRwc19leGl0X21vZHVsZSh2b2lkKQor eworICAgICAgICBtZHBzX3JlbW92ZShtZHBzLmRldmljZSwgMSk7CisKKyAg ICAgICAgYWNwaV9idXNfdW5yZWdpc3Rlcl9kcml2ZXIoJm1kcHNfZHJpdmVy KTsKK30KKworbW9kdWxlX2luaXQobWRwc19pbml0X21vZHVsZSk7Cittb2R1 bGVfZXhpdChtZHBzX2V4aXRfbW9kdWxlKTsKCg== ------=_NextPart_000_1a11_3a40_50f4-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/