From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4864:20::244; helo=mail-lj1-x244.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 17C312194D3B8 for ; Fri, 5 Oct 2018 06:25:29 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id r8-v6so11568090ljc.10 for ; Fri, 05 Oct 2018 06:25:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uybP7Qe1UqGKpXqYuMP39wPRG9VpfoZ3j5O3Fzd/00Q=; b=urU9u7/efIcSj5tdUljymjuxjrF1Rgib+4DkG3O8elPpAagA7+8PMuKkdqvAinu+Jg 2WATB0Tc2aRvISt1L5D8Uafx6aGSzbJ/t7OAHxw2L5yZ42uDiCuAEU3EuZ960vZTIcC9 oUsv9aZq9gLipVRUbPRxNDLjmtVqqLOxhl5ieY1PU1bQV52j1LReUY+btKaOy7IbKLqP jAZw2ayxXY/qlYQwhpMtxPxilP9yaB6wN+CiTV/KNFFCwEaFC5sax831AGrHc3ORqvGm 7CObGRaGJ9oUBlNH94niBaXCitPaFMaWGuglVKgThZyCGVD7iVqdP5Z63mZHI0k0mc3b rQow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uybP7Qe1UqGKpXqYuMP39wPRG9VpfoZ3j5O3Fzd/00Q=; b=C/k/EH1Nb4wUqWjxO/8emrX9xENw5dahFE5OJFh+PgNP3tS4awvFrk5ddopnFDWR3Q jg5hCeCyK/B7JFCKoqb2DDsnI0Ehvhq1lMDn4aXVNLogLgPg8f8ewHr0lL7X+cP6ub4b lYHs1iBuctqiXp5+HYjvs/GLpUORwCM3zDBaYjXanj2+1thrU3m0tUSP/bxVmKcx1U5g oYhni8GXZ8luaWnhWBn0HUBleYtueLU55LyEX+KU/OzSCtw5LpQ5b49phtqm86bt/GqW e7WHw8xfLg33q/PMx8r8Il8jBMI6RIkW7f5Kywihsssl1wHVZ42uZ1jxBjssMVCkzNz/ QHDQ== X-Gm-Message-State: ABuFfoj3MjE7UJO3bPxA6lhPB1GRzE/rdglg+s2I88l386TiyxtOdwyH 4t3+tRhmZ819iNrrRF3tPkmfyeiiMb8= X-Google-Smtp-Source: ACcGV62TDb6VIbhJm8ki1YpSsjNsDsiQHBgcznFwgYYmkJG/JbWAJaHLnDDXrJHRrcWBuRVvWGEWOw== X-Received: by 2002:a2e:7017:: with SMTP id l23-v6mr7292471ljc.160.1538745927960; Fri, 05 Oct 2018 06:25:27 -0700 (PDT) Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id l14-v6sm1836581ljc.68.2018.10.05.06.25.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Oct 2018 06:25:27 -0700 (PDT) From: Marcin Wojtas To: edk2-devel@lists.01.org Cc: feng.tian@intel.com, michael.d.kinney@intel.com, liming.gao@intel.com, leif.lindholm@linaro.org, hao.a.wu@intel.com, ard.biesheuvel@linaro.org, nadavh@marvell.com, mw@semihalf.com, jsd@semihalf.com, tm@semihalf.com Date: Fri, 5 Oct 2018 15:25:08 +0200 Message-Id: <1538745911-22484-2-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1538745911-22484-1-git-send-email-mw@semihalf.com> References: <1538745911-22484-1-git-send-email-mw@semihalf.com> Subject: [PATCH v2 1/4] MdeModulePkg/SdMmcPciHcDxe: Add an optional parameter in NotifyPhase X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Oct 2018 13:25:30 -0000 In order to ensure bigger flexibility in the NotifyPhase routine of the SdMmcOverride protocol, enable using an optional phase-specific data. This will allow to exchange more information between the protocol producer driver and SdMmcPciHcDxe in the newly added callbacks. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas --- MdeModulePkg/Include/Protocol/SdMmcOverride.h | 4 +++- MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c | 12 ++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Include/Protocol/SdMmcOverride.h b/MdeModulePkg/Include/Protocol/SdMmcOverride.h index 0766252..178945f 100644 --- a/MdeModulePkg/Include/Protocol/SdMmcOverride.h +++ b/MdeModulePkg/Include/Protocol/SdMmcOverride.h @@ -63,6 +63,7 @@ EFI_STATUS @param[in] PhaseType The type of operation and whether the hook is invoked right before (pre) or right after (post) + @param[in,out] Data The pointer to a phase-specific data. @retval EFI_SUCCESS The override function completed successfully. @retval EFI_NOT_FOUND The specified controller or slot does not exist. @@ -74,7 +75,8 @@ EFI_STATUS (EFIAPI * EDKII_SD_MMC_NOTIFY_PHASE) ( IN EFI_HANDLE ControllerHandle, IN UINT8 Slot, - IN EDKII_SD_MMC_PHASE_TYPE PhaseType + IN EDKII_SD_MMC_PHASE_TYPE PhaseType, + IN OUT VOID *OptParam ); struct _EDKII_SD_MMC_OVERRIDE { diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c index 25771dc..02eb4ad 100644 --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c @@ -444,7 +444,8 @@ SdMmcHcReset ( Status = mOverride->NotifyPhase ( Private->ControllerHandle, Slot, - EdkiiSdMmcResetPre); + EdkiiSdMmcResetPre, + NULL); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_WARN, "%a: SD/MMC pre reset notifier callback failed - %r\n", @@ -494,7 +495,8 @@ SdMmcHcReset ( Status = mOverride->NotifyPhase ( Private->ControllerHandle, Slot, - EdkiiSdMmcResetPost); + EdkiiSdMmcResetPost, + NULL); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_WARN, "%a: SD/MMC post reset notifier callback failed - %r\n", @@ -1087,7 +1089,8 @@ SdMmcHcInitHost ( Status = mOverride->NotifyPhase ( Private->ControllerHandle, Slot, - EdkiiSdMmcInitHostPre); + EdkiiSdMmcInitHostPre, + NULL); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_WARN, "%a: SD/MMC pre init notifier callback failed - %r\n", @@ -1122,7 +1125,8 @@ SdMmcHcInitHost ( Status = mOverride->NotifyPhase ( Private->ControllerHandle, Slot, - EdkiiSdMmcInitHostPost); + EdkiiSdMmcInitHostPost, + NULL); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_WARN, "%a: SD/MMC post init notifier callback failed - %r\n", -- 2.7.4