From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from a7-10.smtp-out.eu-west-1.amazonses.com (a7-10.smtp-out.eu-west-1.amazonses.com [54.240.7.10]) by mx.groups.io with SMTP id smtpd.web10.12116.1673399879398434111 for ; Tue, 10 Jan 2023 17:17:59 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@ipxe.org header.s=cphpx6z2rfcgehlykjjh3gknqe3hsoe2 header.b=FoZlLKmu; spf=pass (domain: eu-west-1.amazonses.com, ip: 54.240.7.10, mailfrom: 010201859e67bf63-11df6f7a-c226-4f47-a092-dffbe1f7d9e7-000000@eu-west-1.amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=cphpx6z2rfcgehlykjjh3gknqe3hsoe2; d=ipxe.org; t=1673399877; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=SWlIAJrMI8pQo3wbHyZSKfIlpmz9TIpmk05d7VXZ/Xs=; b=FoZlLKmuj+hWLF60AQW9XKikhwajxeyU0kO+3PQQbUvSlEoTKdqRoCrahduFsv0/ 4JNtCLFYqYd5BwQfALXWdASMY3wcLktFv8qL+liMSFXJ0534sCXvkitp4OMoOdi1gN8 cSc40+jfz3sLDZHI2LbVaPyM74fSGxRvJf0dsmieRBGPWozKvCFnI50dyszoRTa44Bm sRnwlOUJiVvAgYnRnmjcKX4jTk4/plyOV4/at9ASgAgwHKSKCrqFBiQ6VaGc73UdD63 bshaNKQA98akC+XJ1OLzZjv2Qh1uWivkA5kEOBisnoKswFOUG/3JnXPrXMYmdtRUGPt cc0ZkLj6Ag== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ihchhvubuqgjsxyuhssfvqohv7z3u4hn; d=amazonses.com; t=1673399877; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=SWlIAJrMI8pQo3wbHyZSKfIlpmz9TIpmk05d7VXZ/Xs=; b=2/1LVKZpz2aK/xzytkwViuQOR+OK0bFAP7wl2qB50KrhOwgjs89hYVEWWWwwjJjO Ical2aAdmO5Osbus6yLOTt4wYBOeKB7kYW3L59/anhAtlI1GGZcplttjviNd8viD06K /EHIlIAzllZh9qRQwlaWeyjJ2AM3O19FCqkHjfj4= Message-ID: <010201859e67bf63-11df6f7a-c226-4f47-a092-dffbe1f7d9e7-000000@eu-west-1.amazonses.com> Date: Wed, 11 Jan 2023 01:17:57 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [edk2-devel] [PATCH 1/3] UsbNetworkPkg/UsbRndis: Add USB RNDIS devices support To: devel@edk2.groups.io, richardho@ami.com Cc: Andrew Fish , Leif Lindholm , Michael D Kinney , Michael Kubacki , Zhiguang Liu , Liming Gao , =?UTF-8?B?VG9ueSBMbyAo576F6YeR5p2+KQ==?= References: <20221208034302.6215-1-richardho@ami.com> From: "Michael Brown" In-Reply-To: <20221208034302.6215-1-richardho@ami.com> X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_DBL_BLOCKED_OPENDNS,URIBL_ZEN_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on blyat.fensystems.co.uk Feedback-ID: 1.eu-west-1.fspj4M/5bzJ9NLRzJP0PaxRwxrpZqiDQJ1IF94CF2TA=:AmazonSES X-SES-Outgoing: 2023.01.11-54.240.7.10 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 08/12/2022 03:44, RichardHo [何明忠] via groups.io wrote: > + case PXE_OPFLAGS_RECEIVE_FILTER_DISABLE: > + if (Cdb->CPBsize != PXE_CPBSIZE_NOT_USED) { > + Cdb->StatFlags = PXE_STATFLAGS_COMMAND_FAILED; > + Cdb->StatCode = PXE_STATCODE_INVALID_CDB; > + } > + > + Nic->CanReceive = TRUE; > + break; This seems to be the only point in the entire driver that ever sets CanReceive = TRUE. The result of this is that the device will be unable to receive unless at least one attempt has been made to *disable* the receive filters. This seems unlikely to be the intended behaviour. It so happens that the combination of MnpDxe and SnpDxe usually *does* make an attempt to disable the receive filters, and so the bug is masked in normal operation. I have added a workaround for this bug to iPXE: https://github.com/ipxe/ipxe/commit/ab1954638 I would suggest fixing your UndiReceiveFilter() function so that the workaround is not necessary. I cannot follow the logic behind the CanReceive flag, so I am unable to suggest a patch, sorry. Thanks, Michael