From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 03 May 2021 14:48:10 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1ldXzd-0003Ep-WC for lore@lore.pengutronix.de; Mon, 03 May 2021 14:48:10 +0200 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ldXzX-0007o1-Km for lore@pengutronix.de; Mon, 03 May 2021 14:48:09 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=piupxw75/EzhSajN7g03RgbF8/3I04ROiA111ufanfE=; b=on1o7yiJH86glhI71ZShZsRM4 ByH/or1RFLz/t/bUtPkUmz9fEsN+IrXqwxppcovAp5Lw5csiOcRDMnxhRWrIE73eEEklCwGS3eWBZ LJKBTCWE2eAVoQKLQYraNgwHxMr1G3/75cmT0ndK8Lxfd1tNAxK12U6Rpd8WsZHFbr8EOc6tI1I0X WGEEpdX26Y7nhukRA+JrrEPIl1WuUsSzmBeeuNzwLkdo7HDcNtTzSnOxnm9Fmd8riNV71OilmMAR9 DlfyCZBGpLmLEyVMOeJnsckNhOVfna1JaDdbiKTeNFQn6Z8wbCLE9bErLSgNlbQIWuaiJzeAiTpOI lnYrHXw3Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ldXxh-00DtJv-P1; Mon, 03 May 2021 12:46:10 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ldXxE-00DtEa-BM for barebox@desiato.infradead.org; Mon, 03 May 2021 12:45:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=bA7OVTlXH9OrLM2c3oFrloAHnel3c6jzdeHY/hocIpI=; b=RAAI79iaPdXWfrWTHA9l/uPdxC B4+1zitBGeqlwMvjYChF1726EmxtQnP+ffKMVlPNcqAYOZTmbRhDz0l5dVjiNHHbpVzl9Ulzg6aQN 6PR6NE9ObTdgOV7zYJpENNwr+k4D803watYL8i7KVeMcTc64YrS+m/bRCS5HXorOcixnT5D0Ic+Ah hwEjCfoWBJLMRJL/ojl189foNjkCWFopuEDX/i9q41bA3uJxWmFQB3XugqUp+L7D+jctaUeJjZr2I 8WzEEfri1xbO0anUZW0q+GDBZI60Ps55hZlEpjuQXHaFUQVqSh/ul+3xB+IKkLpL2UcxZXRhyc5BT TD1TOw6w==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ldXx7-00342b-Hz for barebox@lists.infradead.org; Mon, 03 May 2021 12:45:39 +0000 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ldXwq-00072I-9C; Mon, 03 May 2021 14:45:16 +0200 Received: from afa by dude.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1ldXwp-0000K8-Nx; Mon, 03 May 2021 14:45:15 +0200 From: Ahmad Fatoum To: barebox@lists.infradead.org Cc: Ahmad Fatoum Date: Mon, 3 May 2021 14:45:08 +0200 Message-Id: <20210503124508.856-5-a.fatoum@pengutronix.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210503124508.856-1-a.fatoum@pengutronix.de> References: <20210503124508.856-1-a.fatoum@pengutronix.de> MIME-Version: 1.0 X-BeenThere: barebox@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list 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" X-SA-Exim-Connect-IP: 2001:8b0:10b:1:d65d:64ff:fe57:4e05 X-SA-Exim-Mail-From: barebox-bounces+lore=pengutronix.de@lists.infradead.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.ext.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-3.6 required=4.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Subject: [PATCH v3 4/4] usbgadget: add support for USB mass storage gadget X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on metis.ext.pengutronix.de) VGhpcyBkcml2ZXIgaXMgYmFzZWQgb24gdGhlIGZfbWFzc19zdG9yYWdlIGRyaXZlcnMgaW4gTGlu dXggdjUuMTEgYW5kClUtQm9vdCB2MjAyMS4wMS4KClVubGlrZSB0aGUgVS1Cb290IHZlcnNpb24s IGl0IHJ1bnMgYXN5bmNocm9ub3VzbHkgd2l0aG91dCBibG9ja2luZyB0aGUKYm9vdGxvYWRlciBm cm9tIGRvaW5nIG90aGVyIHRhc2tzLCBsaWtlIGV4cG9ydGluZyBvdGhlciBVU0IgZ2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gtPm5leHQgPSBjb21tb24tPmJ1ZmZoZHM7CisKKwlzbnByaW50Zihjb21tb24tPmlucXVp cnlfc3RyaW5nLCBzaXplb2YgY29tbW9uLT5pbnF1aXJ5X3N0cmluZywKKwkJICIlLThzJS0xNnMl MDR4IiwKKwkJICJMaW51eCAgICIsCisJCSAiRmlsZS1TdG9yZSBHYWRnZXQiLAorCQkgMHhmZmZm KTsKKworCS8qIFNvbWUgcGVyaXBoZXJhbCBjb250cm9sbGVycyBhcmUga25vd24gbm90IHRvIGJl IGFibGUgdG8KKwkgKiBoYWx0IGJ1bGsgZW5kcG9pbnRzIGNvcnJlY3RseS4gIElmIG9uZSBvZiB0 aGVtIGlzIHByZXNlbnQsCisJICogZGlzYWJsZSBzdGFsbHMuCisJICovCisKKwkvKiBJbmZvcm1h dGlvbiAqLworCURCRyhjb21tb24sIEZTR19EUklWRVJfREVTQyAiLCB2ZXJzaW9uOiAiIEZTR19E UklWRVJfVkVSU0lPTiAiXG4iKTsKKwlEQkcoY29tbW9uLCAiTnVtYmVyIG9mIExVTnM9JWRcbiIs IGNvbW1vbi0+bmx1bnMpOworCisJcmV0dXJuIDA7CisKK2Vycm9yX2x1bnM6CisJY29tbW9uLT5u bHVucyA9IGkgKyAxOworZXJyb3JfcmVsZWFzZToKKwljb21tb24tPnN0YXRlID0gRlNHX1NUQVRF X1RFUk1JTkFURUQ7CS8qIFRoZSB0aHJlYWQgaXMgZGVhZCAqLworCWZzZ19jb21tb25fcmVsZWFz ZShjb21tb24pOworY2xvc2U6CisJY2xvc2UoZmQpOworCXJldHVybiByYzsKK30KKworc3RhdGlj IHZvaWQgZnNnX2NvbW1vbl9yZWxlYXNlKHN0cnVjdCBmc2dfY29tbW9uICpjb21tb24pCit7CisJ c3RydWN0IGZzZ19idWZmaGQgKmJoOworCXVuc2lnbmVkIGk7CisKKwkvKiBJZiB0aGUgdGhyZWFk IGlzbid0IGFscmVhZHkgZGVhZCwgdGVsbCBpdCB0byBleGl0IG5vdyAqLworCWlmIChjb21tb24t PnN0YXRlICE9IEZTR19TVEFURV9URVJNSU5BVEVEKSB7CisJCXJhaXNlX2V4Y2VwdGlvbihjb21t b24sIEZTR19TVEFURV9FWElUKTsKKwkJYnRocmVhZF9zdG9wKHRocmVhZF90YXNrKTsKKwkJYnRo cmVhZF9mcmVlKHRocmVhZF90YXNrKTsKKwl9CisKKwliaCA9IGNvbW1vbi0+YnVmZmhkczsKKwlp ID0gRlNHX05VTV9CVUZGRVJTOworCisJZG8geworCQlkbWFfZnJlZShiaC0+YnVmKTsKKwl9IHdo aWxlICgrK2JoLCAtLWkpOworCisJdW1zX2NvdW50ID0gMDsKK30KKworCitzdGF0aWMgdm9pZCBm c2dfdW5iaW5kKHN0cnVjdCB1c2JfY29uZmlndXJhdGlvbiAqYywgc3RydWN0IHVzYl9mdW5jdGlv biAqZikKK3sKKwlzdHJ1Y3QgZnNnX2RldgkJKmZzZyA9IGZzZ19mcm9tX2Z1bmMoZik7CisJc3Ry dWN0IGZzZ19jb21tb24JKmNvbW1vbiA9IGZzZy0+Y29tbW9uOworCWludCBpOworCisJREJHKGZz ZywgInVuYmluZFxuIik7CisKKwlpZiAoZnNnLT5jb21tb24tPmZzZyA9PSBmc2cpIHsKKwkJZnNn LT5jb21tb24tPm5ld19mc2cgPSBOVUxMOworCQlyYWlzZV9leGNlcHRpb24oZnNnLT5jb21tb24s IEZTR19TVEFURV9DT05GSUdfQ0hBTkdFKTsKKworCQlidGhyZWFkX3N0b3AodGhyZWFkX3Rhc2sp OworCQl3aGlsZSAoY29tbW9uLT5mc2cgPT0gZnNnKQorCQkJYnRocmVhZF9yZXNjaGVkdWxlKCk7 CisJfQorCisJdXNiX2ZyZWVfYWxsX2Rlc2NyaXB0b3JzKCZmc2ctPmZ1bmN0aW9uKTsKKworCWZv ciAoaSA9IDA7IGkgPCB1bXNfY291bnQ7IGkrKykKKwkJY2xvc2UodW1zW2ldLmZkKTsKKworCWZz Z19jb21tb25fcmVsZWFzZShmc2ctPm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