From patchwork Mon Oct 7 19:39:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Reece R. Pollack" X-Patchwork-Id: 20878 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 80F3A24697 for ; Mon, 7 Oct 2013 19:40:41 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id x20sf14667295qcv.7 for ; Mon, 07 Oct 2013 12:40:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=ia4Po8HjuVVD1JcgYnLAqHBTDP7Q1uyCNz+ZQcuKxmA=; b=gErKpmqM0Mo3w47PKNo7qEH70kFBPhozU6ZRl/5V6oCloVO+jQ5JhGjaHmFPrlFRcc ZPbRCJMi0oHfgszZS72zB21kWaZfSG2euX9HiQt5Wu1BlHEyFs28ufHNC7j1KXxiFpXY StZgBdd8BsFyIPwh/u8CPnG18opzVIJ9deJZPKQR2VPuF5w+5sjQuT4hA7IHAxV3Kamy VeFpjRWc1tsXm7jUtMrjyUaRkFK6dMbFcRQxaxzgs4wgj4JT20L5MfNf1xtjQIyvqzKE HaHKJH/gh5jTF0FSBggitcIUeAWH6arYQ298eV/jRppz/8oViktjeHjHvJuMHLw21Yy7 RgvA== X-Received: by 10.236.56.70 with SMTP id l46mr32333477yhc.2.1381174841353; Mon, 07 Oct 2013 12:40:41 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.35.10 with SMTP id d10ls2440546qej.19.gmail; Mon, 07 Oct 2013 12:40:41 -0700 (PDT) X-Received: by 10.52.98.66 with SMTP id eg2mr2577810vdb.24.1381174841189; Mon, 07 Oct 2013 12:40:41 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id j9si6153028vcg.10.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Oct 2013 12:40:41 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id lf11so3202943vcb.35 for ; Mon, 07 Oct 2013 12:40:41 -0700 (PDT) X-Gm-Message-State: ALoCoQnAMUnGPj2dq+rClAXiSKGHCYhWPP5It5t9q3DcFxJyx+HdmeRi+l23x/tBw6kZ9iwHqMwX X-Received: by 10.52.157.232 with SMTP id wp8mr11400389vdb.4.1381174841096; Mon, 07 Oct 2013 12:40:41 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp149571vcz; Mon, 7 Oct 2013 12:40:40 -0700 (PDT) X-Received: by 10.60.42.203 with SMTP id q11mr2533296oel.54.1381174834957; Mon, 07 Oct 2013 12:40:34 -0700 (PDT) Received: from comal.ext.ti.com (comal.ext.ti.com. [198.47.26.152]) by mx.google.com with ESMTPS id h5si22573737oed.27.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 07 Oct 2013 12:40:34 -0700 (PDT) Received-SPF: neutral (google.com: 198.47.26.152 is neither permitted nor denied by best guess record for domain of x0183204@udx0183204) client-ip=198.47.26.152; Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r97JeUcU029266; Mon, 7 Oct 2013 14:40:30 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id r97JeUSG016831; Mon, 7 Oct 2013 14:40:30 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.2.342.3; Mon, 7 Oct 2013 14:40:30 -0500 Received: from udx0183204 (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id r97JeUeM021412; Mon, 7 Oct 2013 14:40:30 -0500 Received: from x0183204 by udx0183204 with local (Exim 4.80) (envelope-from ) id 1VTGfO-0004Ud-Bw; Mon, 07 Oct 2013 15:40:30 -0400 From: "Reece R. Pollack" To: CC: Olivier Martin , Subject: [PATCH 02/10] MdeModulePkg//ArpDxe: Retrieved SnpMode only after configuring Snp Date: Mon, 7 Oct 2013 15:39:53 -0400 Message-ID: <1381174801-17221-3-git-send-email-reece.pollack@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1381174801-17221-1-git-send-email-reece.pollack@linaro.org> References: <1381174801-17221-1-git-send-email-reece.pollack@linaro.org> MIME-Version: 1.0 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: reece.pollack@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Olivier Martin When Arp driver starts (with ArpDriverBindingStart()), its service will be created and the Mnp child configured (ArpService->Mnp->Configure() called in ArpCreateService()). It is only at this time the Snp protocol will be initialized (at the end of MnpStart()). So, a valid SnpMode could not be expected prior to ArpService->Mnp->Configure(). Signed-off-by: Olivier Martin --- MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c | 33 +++++++++++---------- 1 file changed, 17 insertions(+), 16 deletions(-) mode change 100644 => 100755 MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c b/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c old mode 100644 new mode 100755 index 81ddd62..5cf717f --- a/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c +++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c @@ -103,22 +103,6 @@ ArpCreateService ( } // - // Get the underlayer Snp mode data. - // - Status = ArpService->Mnp->GetModeData (ArpService->Mnp, NULL, &ArpService->SnpMode); - if ((Status != EFI_NOT_STARTED) && EFI_ERROR (Status)) { - goto ERROR_EXIT; - } - - if (ArpService->SnpMode.IfType != NET_IFTYPE_ETHERNET) { - // - // Only support the ethernet. - // - Status = EFI_UNSUPPORTED; - goto ERROR_EXIT; - } - - // // Set the Mnp config parameters. // ArpService->MnpConfigData.ReceivedQueueTimeoutValue = 0; @@ -141,6 +125,23 @@ ArpCreateService ( } // + // Get the underlayer Snp mode data. Must do this after MNP configuration else some parameters + // (e.g. current address) may not be set + // + Status = ArpService->Mnp->GetModeData (ArpService->Mnp, NULL, &ArpService->SnpMode); + if ((Status != EFI_NOT_STARTED) && EFI_ERROR (Status)) { + goto ERROR_EXIT; + } + + if (ArpService->SnpMode.IfType != NET_IFTYPE_ETHERNET) { + // + // Only support the ethernet. + // + Status = EFI_UNSUPPORTED; + goto ERROR_EXIT; + } + + // // Create the event used in the RxToken. // Status = gBS->CreateEvent (