From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 42D3D1A1E43 for ; Wed, 26 Oct 2016 10:40:32 -0700 (PDT) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 45B141B35; Wed, 26 Oct 2016 17:40:31 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-27.phx2.redhat.com [10.3.116.27]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9QHeSqg015484; Wed, 26 Oct 2016 13:40:28 -0400 To: Marcin Wojtas References: <46cc75e7-ea19-a10d-36ea-470d6ef29d62@redhat.com> Cc: edk2-devel@ml01.01.org, "Tian, Feng" , Joe Zhou , Leif Lindholm , nadavh@marvell.com, Neta Zur Hershkovits , "Gao, Liming" , "Kinney, Michael D" From: Laszlo Ersek Message-ID: <77b67c12-5b55-ca28-f829-29a8549cb468@redhat.com> Date: Wed, 26 Oct 2016 19:40:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 26 Oct 2016 17:40:31 +0000 (UTC) Subject: Re: Force reconnect children from within a DXE driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Oct 2016 17:40:32 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 10/26/16 18:02, Marcin Wojtas wrote: > Hi Laszlo, > > Thank you for your help. It worked finally worked. Thanks for the feedback! :) Laszlo > 2016-10-17 19:00 GMT+02:00 Laszlo Ersek : >> On 10/17/16 18:05, Marcin Wojtas wrote: >>> Hi, >>> >>> Short introduction to the problem I'm facing with EDK2: I implemented >>> 'ifconfig' command extension allowing to change interface's MAC >>> address or reset it to the default value. For that I needed to add a >>> couple of helper functions in DxeNetLib, which parse input string and >>> one that calls Snp->StationAddress callback from the NIC driver. >>> >>> The problem is that the drivers associated to interface device >>> comprise a copy of SnpMode, not original pointer. It causes an obvious >>> mismatch, because only the latter got updated with new >>> Snp->Mode->CurrentAddress. I found out that using 'reconnect' command >>> after MAC address change from uefi shell helps and the network can >>> operate properly. >>> >>> Hence I have a question - is there a way to force reconnecting all >>> children drivers from the network controller driver level? I.e. it >>> would be great if it was possible not to be forced to call 'ifconfig' >>> command and then 'reconnect', but call some function(s) e.g. from >>> Snp->StationAddress callback. >> >> I would try this: >> - From the shell command (which is running in the shell application), >> open the SNP interface in exclusive mode. This should either fail (if >> there's already an exclusive open on the interface), or succeed and >> force other drivers to disconnect, recursively. >> - Call Snp->StationAddress to change the MAC. >> - Close the protocol interface. >> - Call gBS->ConnectController() to (re)connect all the drivers, >> recursively, to the handle with the SNP on it. >> >> Thanks >> Laszlo >>