diff options
author | qctecmdr <qctecmdr@localhost> | 2019-06-25 21:34:59 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-06-25 21:34:58 -0700 |
commit | 73f1219f4c9c68ded269f1622cab05c3046b8b83 (patch) | |
tree | aa4b63a4156e8609fe264add832a83af635c7f8f | |
parent | 30cac35d19bef2d2cf01cd988c1372a404120981 (diff) | |
parent | f44de78e76db84be52ca3e77b903be159ddd3ac5 (diff) |
Merge "QcomModulePkg: Return pointer instead of structure in GetFastbootDeviceData"
-rwxr-xr-x[-rw-r--r--] | QcomModulePkg/Library/FastbootLib/FastbootCmds.c | 32 | ||||
-rwxr-xr-x[-rw-r--r--] | QcomModulePkg/Library/FastbootLib/FastbootMain.c | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | QcomModulePkg/Library/FastbootLib/FastbootMain.h | 4 |
3 files changed, 21 insertions, 21 deletions
diff --git a/QcomModulePkg/Library/FastbootLib/FastbootCmds.c b/QcomModulePkg/Library/FastbootLib/FastbootCmds.c index 2a183df7ae..a53791fe3d 100644..100755 --- a/QcomModulePkg/Library/FastbootLib/FastbootCmds.c +++ b/QcomModulePkg/Library/FastbootLib/FastbootCmds.c @@ -272,14 +272,14 @@ FastbootAck (IN CONST CHAR8 *code, CONST CHAR8 *Reason) if (Reason == NULL) Reason = ""; - AsciiSPrint (GetFastbootDeviceData ().gTxBuffer, MAX_RSP_SIZE, "%a%a", code, + AsciiSPrint (GetFastbootDeviceData ()->gTxBuffer, MAX_RSP_SIZE, "%a%a", code, Reason); - GetFastbootDeviceData ().UsbDeviceProtocol->Send ( - ENDPOINT_OUT, AsciiStrLen (GetFastbootDeviceData ().gTxBuffer), - GetFastbootDeviceData ().gTxBuffer); + GetFastbootDeviceData ()->UsbDeviceProtocol->Send ( + ENDPOINT_OUT, AsciiStrLen (GetFastbootDeviceData ()->gTxBuffer), + GetFastbootDeviceData ()->gTxBuffer); DEBUG ((EFI_D_VERBOSE, "Sending %d:%a\n", - AsciiStrLen (GetFastbootDeviceData ().gTxBuffer), - GetFastbootDeviceData ().gTxBuffer)); + AsciiStrLen (GetFastbootDeviceData ()->gTxBuffer), + GetFastbootDeviceData ()->gTxBuffer)); } VOID @@ -1315,14 +1315,14 @@ CmdDownload (IN CONST CHAR8 *arg, IN VOID *data, IN UINT32 sz) AsciiStrnCpyS (Response + InitStrLen, sizeof (Response) - InitStrLen, NumBytesString, AsciiStrLen (NumBytesString)); - gBS->CopyMem (GetFastbootDeviceData ().gTxBuffer, Response, + gBS->CopyMem (GetFastbootDeviceData ()->gTxBuffer, Response, sizeof (Response)); mState = ExpectDataState; mBytesReceivedSoFar = 0; - GetFastbootDeviceData ().UsbDeviceProtocol->Send ( - ENDPOINT_OUT, sizeof (Response), GetFastbootDeviceData ().gTxBuffer); + GetFastbootDeviceData ()->UsbDeviceProtocol->Send ( + ENDPOINT_OUT, sizeof (Response), GetFastbootDeviceData ()->gTxBuffer); DEBUG ((EFI_D_VERBOSE, "CmdDownload: Send 12 %a\n", - GetFastbootDeviceData ().gTxBuffer)); + GetFastbootDeviceData ()->gTxBuffer)); } #ifdef ENABLE_UPDATE_PARTITIONS_CMDS @@ -2012,7 +2012,7 @@ AcceptData (IN UINT64 Size, IN VOID *Data) FastbootOkayDelay (); mState = ExpectCmdState; } else { - GetFastbootDeviceData ().UsbDeviceProtocol->Send ( + GetFastbootDeviceData ()->UsbDeviceProtocol->Send ( ENDPOINT_IN, GetXfrSize (), (Data + mBytesReceivedSoFar)); DEBUG ((EFI_D_VERBOSE, "AcceptData: Send %d\n", GetXfrSize ())); } @@ -2056,7 +2056,7 @@ FastbootCmdsUnInit (VOID) EFI_STATUS Status; if (mDataBuffer) { - Status = GetFastbootDeviceData ().UsbDeviceProtocol->FreeTransferBuffer ( + Status = GetFastbootDeviceData ()->UsbDeviceProtocol->FreeTransferBuffer ( (VOID *)mDataBuffer); if (Status != EFI_SUCCESS) { DEBUG ((EFI_D_ERROR, "Failed to free up fastboot buffer\n")); @@ -2064,7 +2064,7 @@ FastbootCmdsUnInit (VOID) } } FastbootUnInit (); - GetFastbootDeviceData ().UsbDeviceProtocol->Stop (); + GetFastbootDeviceData ()->UsbDeviceProtocol->Stop (); return EFI_SUCCESS; } @@ -2202,7 +2202,7 @@ FastbootCmdsInit (VOID) } Status = - GetFastbootDeviceData ().UsbDeviceProtocol->AllocateTransferBuffer ( + GetFastbootDeviceData ()->UsbDeviceProtocol->AllocateTransferBuffer ( MaxDownLoadSize, (VOID **)&FastBootBuffer); }while (EFI_ERROR (Status)); @@ -2345,8 +2345,8 @@ STATIC VOID WaitForTransferComplete (VOID) /* Wait for the transfer to complete */ while (1) { - GetFastbootDeviceData ().UsbDeviceProtocol->HandleEvent (&Msg, &PayloadSize, - &Payload); + GetFastbootDeviceData ()->UsbDeviceProtocol->HandleEvent (&Msg, + &PayloadSize, &Payload); if (UsbDeviceEventTransferNotification == Msg) { if (1 == USB_INDEX_TO_EP (Payload.TransferOutcome.EndpointIndex)) { if (USB_ENDPOINT_DIRECTION_IN == diff --git a/QcomModulePkg/Library/FastbootLib/FastbootMain.c b/QcomModulePkg/Library/FastbootLib/FastbootMain.c index edb583fa01..4ba53545d0 100644..100755 --- a/QcomModulePkg/Library/FastbootLib/FastbootMain.c +++ b/QcomModulePkg/Library/FastbootLib/FastbootMain.c @@ -14,7 +14,7 @@ found at **/ -/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -112,9 +112,9 @@ struct { } }; -FastbootDeviceData GetFastbootDeviceData (VOID) +FastbootDeviceData *GetFastbootDeviceData (VOID) { - return Fbd; + return &Fbd; } /* Dummy function needed for event notification callback */ diff --git a/QcomModulePkg/Library/FastbootLib/FastbootMain.h b/QcomModulePkg/Library/FastbootLib/FastbootMain.h index e6085413ce..c528a50505 100644..100755 --- a/QcomModulePkg/Library/FastbootLib/FastbootMain.h +++ b/QcomModulePkg/Library/FastbootLib/FastbootMain.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015,2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2015,2017,2019 The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -52,7 +52,7 @@ typedef struct FasbootDevice { VOID *gTxBuffer; } FastbootDeviceData; -FastbootDeviceData GetFastbootDeviceData (VOID); +FastbootDeviceData *GetFastbootDeviceData (VOID); EFI_STATUS HandleUsbEvents (VOID); EFI_STATUS FastbootUsbDeviceStop (VOID); EFI_STATUS FastbootInitialize (VOID); |