From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lBb6Y-0004ER-D4 for barebox@lists.infradead.org; Mon, 15 Feb 2021 10:27:53 +0000 From: Ahmad Fatoum Date: Mon, 15 Feb 2021 11:27:40 +0100 Message-Id: <20210215102740.30418-4-a.fatoum@pengutronix.de> In-Reply-To: <20210215102740.30418-1-a.fatoum@pengutronix.de> References: <20210215102740.30418-1-a.fatoum@pengutronix.de> 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 3/3] usbgadget: add support for USB mass storage gadget To: barebox@lists.infradead.org Cc: Ahmad Fatoum VGhpcyBkcml2ZXIgaXMgYmFzZWQgb24gdGhlIGZfbWFzc19zdG9yYWdlIGRyaXZlcnMgaW4gTGlu dXggdjUuMTEgYW5kClUtQm9vdCB2MjAyMS4wMS4gTGlrZSB3aXRoIFUtQm9vdCwgaXQncyBpbnZv a2VkIHdpdGggYSBibG9ja2luZyB1bXMKY29tbWFuZC4gRHVyaW5nIHRoaXMgdGltZSwgbm8gb3Ro ZXIgcHJvY2Vzc2luZywgZXhjZXB0IGZvciBwb2xsZXJzLCBpcwpwb3NzaWJsZS4gVGhlIGNvbW1h bmQgY2FuIGJlIGFib3J0ZWQgd2l0aCBjdHJsK2MuCgpUaGUgc3RhdGUgbWFjaGluZSB0byBpbXBs ZW1lbnQgdGhlIG1hc3Mgc3RvcmFnZSBnYWRnZXQgaXMgcXVpdGUKZXh0ZW5zaXZlLCBzbyBpbXBv cnQgdGhlIGZ1bmN0aW9uYWxpdHkgbm93IGFuZCBkZWxheSBtb3ZpbmcgdGhlIHN0YXRlCm1h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ICogTHVrYXN6IE1hamV3c2tpIDxsLm1hamV3c2tpQHNhbXN1bmcuY29t PgorICoKKyAqIENvcHlyaWdodCAoYykgMjAxNSwgTlZJRElBIENPUlBPUkFUSU9OLiBBbGwgcmln aHRzIHJlc2VydmVkLgorICovCisKKyNpbmNsdWRlIDxjb21tb24uaD4KKyNpbmNsdWRlIDxjb21t YW5kLmg+CisjaW5jbHVkZSA8ZXJybm8uaD4KKyNpbmNsdWRlIDxtYWxsb2MuaD4KKyNpbmNsdWRl IDxnZXRvcHQuaD4KKyNpbmNsdWRlIDxmcy5oPgorI2luY2x1ZGUgPHhmdW5jcy5oPgorI2luY2x1 ZGUgPGZpbGUtbGlzdC5oPgorI2luY2x1ZGUgPHVzYi9tYXNzX3N0b3JhZ2UuaD4KKyNpbmNsdWRl IDxsaW51eC9lcnIuaD4KKworc3RhdGljIGludCBkb191c2JfbWFzc19zdG9yYWdlKGludCBhcmdj LCBjaGFyICphcmd2W10pCit7CisJc3RydWN0IGZfdW1zX29wdHMgb3B0czsKKwljaGFyICphcmdz dHI7CisJaW50IHJldDsKKworCWlmIChhcmdjICE9IG9wdGluZCArIDEpCisJCXJldHVybiBDT01N QU5EX0VSUk9SX1VTQUdFOworCisJYXJnc3RyID0gYXJndltvcHRpbmRdOworCisJb3B0cy5maWxl cyA9IGZpbGVfbGlzdF9wYXJzZShhcmdzdHIpOworCWlmIChJU19FUlIob3B0cy5maWxlcykpIHsK KwkJcmV0ID0gUFRSX0VSUihvcHRzLmZpbGVzKTsKKwkJZ290byBvdXQ7CisJfQorCisJcmV0ID0g dXNiX3Vtc19yZWdpc3Rlcigmb3B0cyk7CisKKwlmaWxlX2xpc3RfZnJlZShvcHRzLmZpbGVzKTsK K291dDoKKwlyZXR1cm4gcmV0OworfQorCitCQVJFQk9YX0NNRF9IRUxQX1NUQVJUKHVzYikKK0JB UkVCT1hfQ01EX0hFTFBfVEVYVCgiVHVybidzIHRoZSBVU0IgaG9zdCBpbnRvIGEgVU1TIChVU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tLS0tLS0tLS0tLS0tLS0qLworCitzdGF0 aWMgaW50IGZzZ19tYWluX3RocmVhZCh2b2lkICpjb21tb25fKQoreworCXN0cnVjdCBmc2dfY29t bW9uCSpjb21tb24gPSBjb21tb25fOworCWludCByZXQgPSAwOworCisJLyogVGhlIG1haW4gbG9v cCAqLworCXdoaWxlIChjb21tb24tPnN0YXRlICE9IEZTR19TVEFURV9URVJNSU5BVEVEKSB7CisJ CWlmIChleGNlcHRpb25faW5fcHJvZ3Jlc3MoY29tbW9uKSkgeworCQkJaGFuZGxlX2V4Y2VwdGlv bihjb21tb24pOworCQkJY29udGludWU7CisJCX0KKworCQlpZiAoIWNvbW1vbi0+cnVubmluZykg eworCQkJcmV0ID0gc2xlZXBfdGhyZWFkKGNvbW1vbik7CisJCQlpZiAocmV0KQorCQkJCWJyZWFr OworCQkJY29udGludWU7CisJCX0KKworCQlyZXQgPSBnZXRfbmV4dF9jb21tYW5kKGNvbW1vbik7 CisJCWlmIChyZXQpCisJCQljb250aW51ZTsKKworCQlpZiAoIWV4Y2VwdGlvbl9pbl9wcm9ncmVz cyhjb21tb24pKQorCQkJY29tbW9uLT5zdGF0ZSA9IEZTR19TVEFURV9EQVRBX1BIQVNFOworCisJ CWlmIChkb19zY3NpX2NvbW1hbmQoY29tbW9uKSB8fCBmaW5pc2hfcmVwbHkoY29tbW9uKSkKKwkJ CWNvbnRpbnVlOworCisJCWlmICghZXhjZXB0aW9uX2luX3Byb2dyZXNzKGNvbW1vbikpCisJCQlj b21tb24tPnN0YXRlID0gRlNHX1NUQVRFX1NUQVRVU19QSEFTRTsKKworCQlpZiAoc2VuZF9zdGF0 dXMoY29tbW9uKSkKKwkJCWNvbnRpbnVlOworCisJCWlmICghZXhjZXB0aW9uX2luX3Byb2dyZXNz KGNvbW1vbikpCisJCQljb21tb24tPnN0YXRlID0gRlNHX1NUQVRFX0lETEU7CisJfQorCisJaWYg KHJldCAmJiByZXQgIT0gLUVSRVNUQVJUU1lTKQorCQlwcl93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ycmVjdGx5LiAgSWYgb25lIG9mIHRoZW0gaXMg cHJlc2VudCwKKwkgKiBkaXNhYmxlIHN0YWxscy4KKwkgKi8KKworCS8qIEluZm9ybWF0aW9uICov CisJREJHKGNvbW1vbiwgRlNHX0RSSVZFUl9ERVNDICIsIHZlcnNpb246ICIgRlNHX0RSSVZFUl9W RVJTSU9OICJcbiIpOworCURCRyhjb21tb24sICJOdW1iZXIgb2YgTFVOcz0lZFxuIiwgY29tbW9u LT5ubHVucyk7CisKKwlyZXR1cm4gMDsKKworZXJyb3JfbHVuczoKKwljb21tb24tPm5sdW5zID0g aSArIDE7CitlcnJvcl9yZWxlYXNlOgorCWNvbW1vbi0+c3RhdGUgPSBGU0dfU1RBVEVfVEVSTUlO QVRFRDsJLyogVGhlIHRocmVhZCBpcyBkZWFkICovCisJLyogQ2FsbCBmc2dfY29tbW9uX3JlbGVh c2UoKSBkaXJlY3RseSwgcmVmIG1pZ2h0IGJlIG5vdAorCSAqIGluaXRpYWxpc2VkICovCisJZnNn X2NvbW1vbl9yZWxlYXNlKCZjb21tb24tPnJlZik7CitjbG9zZToKKwljbG9zZShmZCk7CisJcmV0 dXJuIHJjOworfQorCitzdGF0aWMgdm9pZCBmc2dfY29tbW9uX3JlbGVhc2Uoc3RydWN0IGtyZWYg KnJlZikKK3sKKwlzdHJ1Y3QgZnNnX2NvbW1vbiAqY29tbW9uID0gY29udGFpbmVyX29mKHJlZiwg c3RydWN0IGZzZ19jb21tb24sIHJlZik7CisJc3RydWN0IGZzZ19idWZmaGQgKmJoOworCXVuc2ln bmVkIGk7CisKKwkvKiBJZiB0aGUgdGhyZWFkIGlzbid0IGFscmVhZHkgZGVhZCwgdGVsbCBpdCB0 byBleGl0IG5vdyAqLworCWlmIChjb21tb24tPnN0YXRlICE9IEZTR19TVEFURV9URVJNSU5BVEVE KSB7CisJCXJhaXNlX2V4Y2VwdGlvbihjb21tb24sIEZTR19TVEFURV9FWElUKTsKKwkJd2FpdF9m b3JfY29tcGxld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