From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx1.emlix.com ([188.40.240.192]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZIUu-0005G0-Sp for barebox@lists.infradead.org; Thu, 14 May 2020 18:22:27 +0000 Received: from mailer.emlix.com (p5098be52.dip0.t-ipconnect.de [80.152.190.82]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.emlix.com (Postfix) with ESMTPS id 1B0075FE36 for ; Thu, 14 May 2020 20:22:13 +0200 (CEST) From: =?UTF-8?q?Daniel=20Gl=C3=B6ckner?= Date: Thu, 14 May 2020 20:21:54 +0200 Message-Id: <65606e2e80b04a4daab113568ef56a1e6a39e597.1589477005.git.dg@emlix.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH v2 06/10] fastboot: split generic code from USB gadget To: barebox@lists.infradead.org Cc: Edmund Henniges , =?UTF-8?q?Daniel=20Gl=C3=B6ckner?= RnJvbTogRWRtdW5kIEhlbm5pZ2VzIDxlaEBlbWxpeC5jb20+CgpUaGUgZmFzdGJvb3Qgc3BlY2lm aWNhdGlvbiBkZXNjcmliZXMgb3RoZXIgcHJvdG9jb2xzIGJleW9uZCBVU0IuIEFsbG93CnRoZXNl IHRvIHJldXNlIHRoZSBnZW5lcmljIHBhcnRzIG9mIHRoZSBleGlzdGluZyBmYXN0Ym9vdCBjb2Rl IHdoZW4gdGhleQphcmUgaW1wbGVtZW50ZWQuCgpNb3N0IG9mIHRoZSBjaGFuZ2VzIGluIGNvbW1v bi9mYXN0Ym9vdC5jIGFyZSBkdWUgdG8gdGhlIHJlbmFtaW5nIG9mIHN0cnVjdApmX2Zhc3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9PVF9NU0df RkFJTDoKKwkJZmItPmFjdGl2ZSA9IGZhbHNlOworCQlwcl9lcnIoIiVwVlxuIiwgJnZhZik7CisJ CWJyZWFrOworCWNhc2UgRkFTVEJPT1RfTVNHX0lORk86CisJCXByX2luZm8oIiVwVlxuIiwgJnZh Zik7CisJCWJyZWFrOworCWNhc2UgRkFTVEJPT1RfTVNHX0RBVEE6CisJCWJyZWFrOworCX0KKwor CXZhX2VuZChhcCk7CisKKwlpZiAobiA+IDY0KQorCQluID0gNjQ7CisKKwlyZXR1cm4gZmItPndy aXRlKGZiLCBidWYsIG4pOworfQorCitzdGF0aWMgdm9pZCBjYl9yZWJvb3Qoc3RydWN0IGZhc3Ri b290ICpmYiwgY29uc3QgY2hhciAqY21kKQoreworCXJlc3RhcnRfbWFjaGluZSgpOworfQorCitz dGF0aWMgaW50IHN0cmNtcF9sMShjb25zdCBjaGFyICpzMSwgY29uc3QgY2hhciAqczIpCit7CisJ aWYgKCFzMSB8fCAhczIpCisJCXJldHVybiAtMTsKKwlyZXR1cm4gc3RybmNtcChzMSwgczIsIHN0 cmxlbihzMSkpOworfQorCitzdGF0aWMgdm9pZCBjYl9nZXR2YXIoc3RydWN0IGZhc3Rib290ICpm YiwgY29uc3QgY2hhciAqY21kKQoreworCXN0cnVjdCBmYl92YXJpYWJsZSAqdmFyOworCisJcHJf ZGVidWcoImdldHZhcjogXCIlc1wiXG4iLCBjbWQpOworCisJaWYgKCFzdHJjbXBfbDEoY21kLCAi YWxsIikpIHsKKwkJbGlzdF9mb3JfZWFjaF9lbnRyeSh2YXIsICZmYi0+dmFyaWFibGVzLCBsaXN0 KSB7CisJCQlmYXN0Ym9vdF90eF9wcmludChmYiwgRkFTVEJPT1RfTVNHX0lORk8sICIlczogJXMi LAorCQkJCQkgIHZhci0+bmFtZSwgdmFyLT52YWx1ZSk7CisJCX0KKwkJZmFzdGJvb3RfdHhfcHJp bnQoZmIsIEZBU1RCT09UX01TR19PS0FZLCAiIik7CisJCXJldHV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QgbnVtX2NvbW1hbmRzKQoreworCWNvbnN0IHN0cnVjdCBjbWRfZGlzcGF0Y2hfaW5m byAqY21kOworCWludCBpOworCisJY29uc29sZV9jb3VudGRvd25fYWJvcnQoKTsKKworCWZvciAo aSA9IDA7IGkgPCBudW1fY29tbWFuZHM7IGkrKykgeworCQljbWQgPSAmY21kc1tpXTsKKworCQlp ZiAoIXN0cmNtcF9sMShjbWQtPmNtZCwgY21kYnVmKSkgeworCQkJY21kLT5jYihmYiwgY21kYnVm ICsgc3RybGVuKGNtZC0+Y21kKSk7CisKKwkJCXJldHVybjsKKwkJfQorCX0KKworCWZhc3Rib290 X3R4X3ByaW50KGZiLCBGQVNUQk9PVF9NU0dfRkFJTCwgInVua25vd24gY29tbWFuZCAlcyIsCisJ CQkgIGNtZGJ1Zik7Cit9CisKK3N0YXRpYyB2b2lkIGNiX29lbV9nZXRlbnYoc3RydWN0IGZhc3Ri b290ICpmYiwgY29uc3QgY2hhciAqY21kKQoreworCWNvbnN0IGNoYXIgKnZhbHVlOworCisJcHJf ZGVidWcoIiVzOiBcIiVzXCJcbiIsIF9fZnVuY19fLCBjbWQpOworCisJdmFsdWUgPSBnZXRlbnYo Y21kKTsKKworCWZhc3Rib290X3R4X3ByaW50KGZiLCBGQVNUQk9PVF9NU0dfSU5GTywgdmFsdWUg PyB2YWx1ZSA6ICIiKTsKKwlmYXN0Ym9vdF90eF9wcmludChmYiwgRkFTVEJPT1RfTVNHX09LQVks ICIiKTsKK30KKworc3RhdGljIHZvaWQgY2Jfb2VtX3NldGVudihzdHJ1Y3QgZmFzdGJvb3QgKmZi LCBjb25zdCBjaGFyICpjbWQpCit7CisJY2hhciAqdmFyID0geHN0cmR1cChjbWQpOworCWNoYXIg KnZhbHVlOworCWludCByZXQ7CisKKwlwcl9kZWJ1ZygiJXM6IFwiJXNcIlxuIiwgX19mdW5jX18s IGNtZCk7CisKKwl2YWx1ZSA9IHN0cmNocih2YXIsICc9Jyk7CisJaWYgKCF2YWx1Z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