From patchwork Fri Jun 17 10:28:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: marcin.krzeminski@nokia.com X-Patchwork-Id: 9183393 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AD35460573 for ; Fri, 17 Jun 2016 10:36:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BB5128386 for ; Fri, 17 Jun 2016 10:36:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9082028399; Fri, 17 Jun 2016 10:36:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0897228396 for ; Fri, 17 Jun 2016 10:36:38 +0000 (UTC) Received: from localhost ([::1]:55550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDr8f-00032l-5a for patchwork-qemu-devel@patchwork.kernel.org; Fri, 17 Jun 2016 06:36:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDr4f-0007O6-9w for qemu-devel@nongnu.org; Fri, 17 Jun 2016 06:32:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDr4a-00033C-9j for qemu-devel@nongnu.org; Fri, 17 Jun 2016 06:32:28 -0400 Received: from mail-db3on0103.outbound.protection.outlook.com ([157.55.234.103]:52268 helo=emea01-db3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDr4Z-00032s-H9 for qemu-devel@nongnu.org; Fri, 17 Jun 2016 06:32:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=vAkhRe6M1s2ZH4sqSPEQIpw2Rcx4mZaNwlSRkwHm5u0=; b=kNn5bGqVnHNyUFuB3Q45QYl4Bi5SbmpL0OxV3tD+d4w6nZSQwPKBQ5/6FDdsWyIlJkLw0riGoLilc8KHq6rITCdgtqqcNyXm9Q3B93gQfPEBQ0QuuJeQK0cA07Em8ezJWbaujMNowNVncnWK9QBlgLnHsUd+t8j8rq1szyKvDY4= Received: from VI1PR07CA0056.eurprd07.prod.outlook.com (2a01:111:e400:5967::24) by AM3PR07MB1059.eurprd07.prod.outlook.com (2a01:111:e400:536e::13) with Microsoft SMTP Server (TLS) id 15.1.506.9; Fri, 17 Jun 2016 10:32:22 +0000 Received: from AM1FFO11FD051.protection.gbl (2a01:111:f400:7e00::128) by VI1PR07CA0056.outlook.office365.com (2a01:111:e400:5967::24) with Microsoft SMTP Server (TLS) id 15.1.523.12 via Frontend Transport; Fri, 17 Jun 2016 10:32:22 +0000 Authentication-Results: spf=pass (sender IP is 131.228.2.241) smtp.mailfrom=nokia.com; nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=pass action=none header.from=nokia.com; Received-SPF: Pass (protection.outlook.com: domain of nokia.com designates 131.228.2.241 as permitted sender) receiver=protection.outlook.com; client-ip=131.228.2.241; helo=mailrelay.int.nokia.com; Received: from mailrelay.int.nokia.com (131.228.2.241) by AM1FFO11FD051.mail.protection.outlook.com (10.174.65.214) with Microsoft SMTP Server (TLS) id 15.1.511.7 via Frontend Transport; Fri, 17 Jun 2016 10:32:21 +0000 Received: from mailrelay.int.nokia.com (localhost [127.0.0.1]) by fihe3nok0735.emea.nsn-net.net (8.14.9/8.14.5) with ESMTP id u5HATIqJ000656 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 17 Jun 2016 13:29:18 +0300 Received: from CNU418C7XK.nsn-intra.net ([10.154.155.220]) by mailrelay.int.nokia.com (8.14.9/8.14.5) with ESMTP id u5HATC38000470; Fri, 17 Jun 2016 13:29:17 +0300 X-HPESVCS-Source-Ip: 10.154.155.220 From: To: Date: Fri, 17 Jun 2016 12:28:32 +0200 Message-ID: <1466159314-28597-9-git-send-email-marcin.krzeminski@nokia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466159314-28597-1-git-send-email-marcin.krzeminski@nokia.com> References: <1466159314-28597-1-git-send-email-marcin.krzeminski@nokia.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:131.228.2.241; IPV:NLI; CTRY:FI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(7916002)(2980300002)(438002)(199003)(189002)(47776003)(48376002)(19580405001)(92566002)(87936001)(2351001)(16796002)(36756003)(229853001)(68736007)(81156014)(19580395003)(586003)(5003940100001)(6806005)(110136002)(33646002)(50986999)(11100500001)(76176999)(97736004)(86362001)(189998001)(81166006)(356003)(50466002)(2950100001)(50226002)(5008740100001)(86152002)(4326007)(2906002)(2876002)(106466001)(8936002)(8676002)(77096005)(53416004); DIR:OUT; SFP:1102; SCL:1; SRVR:AM3PR07MB1059; H:mailrelay.int.nokia.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD051; 1:yoUesDCFe6OKcMF2Nk1RTvbNIF10e77er1Gd9mYEZ1H9UvgJFTKrMi/R9Z6M3JPlHVQYiJWi0DPeQNSY4JmT2ClFbtKVHEd4nRRkfgflMDYwR8CiKr06cWCbIC/UqJI0Rfe26v7YKjk8MyjH9ESOewAgvSV3ED/D7u1vuPO/EEbTy0cGgswT6uliBA1hI7/zYYKDHLbNZUzLcXo3Gm8vja9qutOUttleY1DRNHqlm/GdU7kFN3f8RovMBNgywYcA/cgtN09DdwYZiDi1nL+udsnqifq2unIXyJGONNdhvuWkcc8YQU0bnYaFfBDXOVeHSK8bZjf7q126RRCoTlRCLG3tT53HbMhehPtKLEe7XTrIXOEJmspG/v8wicQX3tzcL1H0E19yAsNfefcdYlNuoGttNtmj1I5Yn5GCZmKpDCkUGvH8vAaMN0kPDs2XerIA MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 47fd07f1-1c03-4790-4296-08d3969aaa7e X-Microsoft-Exchange-Diagnostics: 1; AM3PR07MB1059; 2:NrDF/cF6EnVNMh7l9PjK2bIAmm/UgvPqGV3HUds2kCJ89BUJ1gRG9Itq+1i0vx+EzKViMw71MUQMAqlV4aB7AkS9Kjs+3uDXw7jpx6WBq4EBcORFThbltjbMtN7FylFkSwZLkThHG1rAEMDstNvK8T9ELUJIi2O17PlaFcwDuKcfdRtvorTz3hW2E7gXbb5J; 3:/vfrywnFZOvezlnxxH1h/mOa1ufIZ9bI4F3dL73AVr9K9zoyEnZ+jDj45j7X3AvGLsRF0jt6DRKhbcS19rqGM/6HXBPi0Ao6IDljUYZmMYtxb7N+ykZu6OzWyoxWc22NkGUhrsz6IDvj32QflIWu4uNppEqakbiTP9AjOxQggQnrX5urJqM3NBvjDTkRgVXlUhNLpJSqYqQaK9sYoGZxmzBT58nEexnUytPdnDThi+wdbKm+YkCXF03Hm3ERyl6EZR+xgbERMf2/D7uaAfcFVg==; 25:jvNbnKC21umBIoK+mSdSrEwX3YBhCCwZJSKlMXugEkCyuz6fMIuCoJqUwvH1iW+BOkA/JsyKvxjUV7rhVDRirjmIUNmriuthFSfaLAvo4mqHesOMnp7780mW7w7PkA9PU+G/y42dUDXJayb0rE+TCcs4555onDtUdGRC80TNPKorA3UMKMzeBm8S53YUqEwBTnM7IyW0zZmTBz1LUeZUwNOYbVwDdww4Z8aFc071OYq+Ssg84Q9QytWledVW7St/AQQE0d6JeA1wsuHVDwDiyyB3wtZmRiP8JoF+0lV+cKQMYLK3Yr0Oy8Rx0Nl2g8rcbUrJLxMJGwt40GuuzwFbAhZlDq1vxWVmFmYnGiMTJY5IEPH+TJkst6ZqELiVrJ62hScDEIi+jaagHZ8lNjAKE41YY3QmFUsbzzP1HPbkeDo= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:AM3PR07MB1059; X-Microsoft-Exchange-Diagnostics: 1; AM3PR07MB1059; 20:DLvbDBuMzMZVgoaV3qD73a1WJuoiWNMOuU6XmWviUFtcnDZjtAFF0qa16zNGkx6i3ycPj6cLyTywdPrAMpwZq9ltoClMcpTkYg0k+2yjkxgAeZn0FKCr+DqHhPzUUDFrCY8Jj2mhCoUGW/0LE1pDchJPNzPfmlQIpl9maz6YktO+Ra54ukLdzHX6QBrE+YqjX5Nk9K7b3LKJwMZxhZZ6LD076bVO1ALgCCrPIO/eXo4Eztaoxtc/er6Gjsl0fFh5b1a/iXpcm3GXoIBcqXBxZNOUHaXKPKoqzCYx4VfIN+M102+SPE9EbIEZs3i04G7+ZdJRviuiX+q1ABg0cSsYQ8qNAMdInSn1rqVgIi3Sq4AROZXUxGehoGPPiJJ0A/zYy2lxBJq2nORn181qKKrvxAC5SzMKsfOc87qa9Ar6G6HCvoNL/vRJPrMRKPdmM371APNu3lXR03H1nh5xzN/YfvPpqoQ05a4Xd22wig2x6CSYLPFHXTCqgsJ0wRxGrmaex5sMxMKxLIaEYYzgjoH0pa4RWUMBV0OXN0Pr1tlEhkAxYzDKmHueMQkJG4dViHSWN5mZlZgyapgSW7n12c1/NjKbzbkEoV3EnCkk3wVjJSE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(82608151540597); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(13018025)(13016025)(10201501046)(3002001); SRVR:AM3PR07MB1059; BCL:0; PCL:0; RULEID:; SRVR:AM3PR07MB1059; X-Microsoft-Exchange-Diagnostics: 1; AM3PR07MB1059; 4:xlYTuVdMBsd5CATFCmRFH/SfnKYaNUpVUYZcJIQ3T7peMr32uHvzkurga4MGBiBkgv2DAtaVSgL3jkfy9yXpsRVjHqQF06GSeHIqLwdati3kL39DPswbEpxbMUmlgIA5OtTeCIJjr9oaRTFv8BexC9TmR6A7lDdmQRo3v0KHej1YGGkU9eQpVvy8PlwGVpZt2yaKyq4bRPxPf+viv7eRP5YoDG5u438IJGkRcFoOsMcELd2IfR459jgtScwR5zydnP7et3+5CL/sooiGEwL1O+akctd8t9zgv+24U/OqsytXKbqGyfZzib2aWCzH5K8dzBscE7yX8GWcuI86w4M2n3LlJRHf/Cry0E1cLjSBBqzYIKewN2Zu4NIeh3Ign4UN4SWyfTfJKf8oI1AzdvXrSo9B0VwUjFsaeHvNdVgSH9VamLLYLEVSm/WDPOkjt2kdtUUN7jqruIis1R4LWPTKOQ== X-Forefront-PRVS: 09760A0505 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM3PR07MB1059; 23:P0wi62AHo2VZp40kOARC3wPssKDZjadquUqYSKYBR?= =?us-ascii?Q?0cY0cRBX1ChtCgejHb6X56K4B34JOhQglXomROgc3gBeXlo/NwGv2wgc/daR?= =?us-ascii?Q?MBnrAmwx4cms4FeLuJP6HpIOfwVEqiMSCEDXIZzdoVXeP34KaoGLNUb4vd73?= =?us-ascii?Q?buxBV0uEfBaRSrkIZpWynVghPrwqbTCNiXRi3RhH8O64NVIr+8F3OqwvZMqX?= =?us-ascii?Q?lIGxzCEbqAG5rCXBAuOc1TUgqonyFls9vtjUAyjwESeOQCixChVTaNHbuxsw?= =?us-ascii?Q?WDcquydru8V5yu1fotqnRMBVhbd+fO33eYv7GluqZChZkC40t4H7WyihqYql?= =?us-ascii?Q?VqVvLs5l10luz4WOPaIc5QU5cZIzCoa2lMZdlCDpBvLkA9v2bhGbG0O9jVaE?= =?us-ascii?Q?4XAyOxCgkRbs1BDM3oVDSUtCWtnIKKBeiWSkT+GxbgsHuEe+3srY0lF5DSor?= =?us-ascii?Q?ChujXfI46Vg4VYpL0EwKXt0tGg1kwKT5CV+qUAP4vKj3CanHyaSdnXMeV7jD?= =?us-ascii?Q?pXWL7wF6ZOXWVsL0kffwYalJnirvet945Z/Ybxf01C+iDs67i/jus4H2UDDI?= =?us-ascii?Q?VY0XlFWEYsw65pLvo5Hxu7oYhWZB1fSi9jObsss5wW7fIi76I49RpEKooZh9?= =?us-ascii?Q?r721lO9bKPJcQg4b7Zm1BU6TuV+HNmJ2ph493ajH786HtFg8RVuZeeEsuy7z?= =?us-ascii?Q?NtLxtBuY4TsV/1boULgZkcA6HCPDhJ5Zm/2qBGyV+7emAWJTFhW298sMKyT2?= =?us-ascii?Q?FpmDzm+AfQrmuRXt4QicanScFtlSzmQwbT2OnPQtRf6wkhmuXBHXUJIZVRS8?= =?us-ascii?Q?GFVStIl3kz5cNyDOXpBaaOgtqKB2w0VuM7ILnmYeVdEdwo1J63oEfIWGOHsa?= =?us-ascii?Q?MXLCjIiJZUSpIcPSt750KRRJKT3bJEO31bTDBTV9Gg4WPjWMIiyMdxBedb5X?= =?us-ascii?Q?rz7Gg30unj2dlGwo/DfIESVGu1aeqW9om+RGciOvfy4LGf0EJZmc00PbR1NW?= =?us-ascii?Q?V92bsG/ZLGDkjOQm0fJ6iDReTuDd3rb1C6P+GFM3ThTCa9nxzNDRjOpaTl8B?= =?us-ascii?Q?Mjj7CKZpOPD5mRl+iILQjNNqvMGBArGaGtIPFe6EnKv5KBGxV1Q7yUcxCj0C?= =?us-ascii?Q?cnJH26ZVD4=3D?= X-Microsoft-Exchange-Diagnostics: 1; AM3PR07MB1059; 5:canwEY4pbOGHtVfWP+xzPzj/+4mSj7SFWtHg+huuIiveUsQdQNhCNpRvm5C1hRtGZrbpZCkq8JVJJ5/EoDXjw9AUH55IG6dMw3c0mqrXNy/UEZAJxUYnln/10YXJI8W3IkkmQFcQG/iKyAvo78DsiQ==; 24:H2Fd804piqQfL8ux4jHjt5mRQeyDtYviNfSKpGHbMtIlylynU/rWj0BJwybzmqyEeDfXTuA2kr3bn1qA3yQKgn7d30DxOtS8zWTyrc2HthA=; 7:rAiHi8yEtbuU48+dMjfu/jpor/Vln4Sx3rAo2W4WIWsjpMSLSGY4NrtkmkzRt9kl9ksmK5aVjXeJhewb8hTt4JLG7TdEtwrb6XEI/zmnXthcIlRF+y5xr0Mqh26zF4bNR7QKji0mQOdVHWS6EHfbyFMAfAFFpTkaERKxnITRmLkRMIeEx/LSWsoK1rZ7yNGSvh0WWzxU31ovyBVP/6O/ew== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2016 10:32:21.7343 (UTC) X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0; Ip=[131.228.2.241]; Helo=[mailrelay.int.nokia.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR07MB1059 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 157.55.234.103 Subject: [Qemu-devel] [PATCH v2 08/10] m25p80: Fast read commands family changes. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, crosthwaitepeter@gmail.com, clg@fr.ibm.com, clg@kaod.org, pawel.lenkow@itlen.com, rfsw-patches@mlist.emea.nsn-intra.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Marcin Krzeminski Support for Spansion and Macronix flashes. Additionally Numonyx(Micron) moved from default in fast read commands family. Also moved fast read command decoding to functions. Signed-off-by: Marcin Krzeminski Reviewed-by: Cédric Le Goater --- hw/block/m25p80.c | 145 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 108 insertions(+), 37 deletions(-) diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index 21998db..f40fa99 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -719,6 +719,111 @@ static void reset_memory(Flash *s) DB_PRINT_L(0, "Reset done.\n"); } +static void decode_fast_read_cmd(Flash *s) +{ + s->needed_bytes = get_addr_length(s); + switch (get_man(s)) { + /* Dummy cycles - modeled with bytes writes instead of bits */ + case MAN_NUMONYX: + s->needed_bytes += extract32(s->volatile_cfg, 4, 4); + break; + case MAN_MACRONIX: + if (extract32(s->volatile_cfg, 6, 2) == 1) { + s->needed_bytes += 6; + } else { + s->needed_bytes += 8; + } + break; + case MAN_SPANSION: + s->needed_bytes += extract32(s->spansion_cr2v, + SPANSION_DUMMY_CLK_POS, + SPANSION_DUMMY_CLK_LEN + ); + break; + default: + break; + } + s->pos = 0; + s->len = 0; + s->state = STATE_COLLECTING_DATA; +} + +static void decode_dio_read_cmd(Flash *s) +{ + s->needed_bytes = get_addr_length(s); + /* Dummy cycles modeled with bytes writes instead of bits */ + switch (get_man(s)) { + case MAN_WINBOND: + s->needed_bytes = 4; + break; + case MAN_SPANSION: + s->needed_bytes += extract32(s->spansion_cr2v, + SPANSION_DUMMY_CLK_POS, + SPANSION_DUMMY_CLK_LEN + ); + break; + case MAN_NUMONYX: + s->needed_bytes += extract32(s->volatile_cfg, 4, 4); + break; + case MAN_MACRONIX: + switch (extract32(s->volatile_cfg, 6, 2)) { + case 1: + s->needed_bytes += 6; + break; + case 2: + s->needed_bytes += 8; + break; + default: + s->needed_bytes += 4; + break; + } + break; + default: + break; + } + s->pos = 0; + s->len = 0; + s->state = STATE_COLLECTING_DATA; +} + +static void decode_qio_read_cmd(Flash *s) +{ + s->needed_bytes = get_addr_length(s); + /* Dummy cycles modeled with bytes writes instead of bits */ + switch (get_man(s)) { + case MAN_WINBOND: + s->needed_bytes = 6; + break; + case MAN_SPANSION: + s->needed_bytes += extract32(s->spansion_cr2v, + SPANSION_DUMMY_CLK_POS, + SPANSION_DUMMY_CLK_LEN + ); + break; + case MAN_NUMONYX: + s->needed_bytes += extract32(s->volatile_cfg, 4, 4); + break; + case MAN_MACRONIX: + switch (extract32(s->volatile_cfg, 6, 2)) { + case 1: + s->needed_bytes += 4; + break; + case 2: + s->needed_bytes += 8; + break; + default: + s->needed_bytes += 6; + break; + } + break; + default: + break; + } + s->pos = 0; + s->len = 0; + s->state = STATE_COLLECTING_DATA; +} + static void decode_new_cmd(Flash *s, uint32_t value) { s->cmd_in_progress = value; @@ -756,51 +861,17 @@ static void decode_new_cmd(Flash *s, uint32_t value) case DOR4: case QOR: case QOR4: - s->needed_bytes = get_addr_length(s); - switch (get_man(s)) { - case MAN_NUMONYX: - s->needed_bytes += extract32(s->volatile_cfg, 4, 4); - break; - default: - break; - } - s->pos = 0; - s->len = 0; - s->state = STATE_COLLECTING_DATA; + decode_fast_read_cmd(s); break; case DIOR: case DIOR4: - switch (get_man(s)) { - case MAN_WINBOND: - case MAN_SPANSION: - s->needed_bytes = 4; - break; - default: - s->needed_bytes = get_addr_length(s); - /* Dummy cycles modeled with bytes writes instead of bits */ - s->needed_bytes += extract32(s->volatile_cfg, 4, 4); - } - s->pos = 0; - s->len = 0; - s->state = STATE_COLLECTING_DATA; + decode_dio_read_cmd(s); break; case QIOR: case QIOR4: - switch (get_man(s)) { - case MAN_WINBOND: - case MAN_SPANSION: - s->needed_bytes = 6; - break; - default: - s->needed_bytes = get_addr_length(s); - /* Dummy cycles modeled with bytes writes instead of bits */ - s->needed_bytes += extract32(s->volatile_cfg, 4, 4); - } - s->pos = 0; - s->len = 0; - s->state = STATE_COLLECTING_DATA; + decode_qio_read_cmd(s); break; case WRSR: