From patchwork Wed May 20 07:14:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 48786 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4800921411 for ; Wed, 20 May 2015 07:14:30 +0000 (UTC) Received: by laat2 with SMTP id t2sf13936671laa.2 for ; Wed, 20 May 2015 00:14:29 -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:mime-version:in-reply-to:references :date:message-id:from:to:subject:precedence:reply-to:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :content-type:content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=F01kHFPzGZaqJdNTyYCF2rsGhNZiK+htRTytDRYL2tY=; b=bLLmlq5Jvfh3CUOmak9mtNi0gsJtrMwyv0HK17TAZAl9zlXWTmsnp3xsQ9fGvGrH2t CcForCjmqkXAgWJQxNL9ZAWOeUDeo/BeXfA4U+o4BwTQxRlYSxYzuzNX854+K2IXCbqN 6jDefc27gYlJsWtZvSAw6iT/oI5F/zYLTdF8z/d7RZiB8QFeSl/sqjxTyQoYkMacFw5K vIVGrIVNYfs2hnkwhViRymsg4BRQ7lwy065WtOjLaYc8wD6T6sQ51+xgztuUNOmdI3Dn u6A25kOkipB9LOkcpzzrIgy2cT6ltn/QRG13BksEXKZNSEabevgA8TaBZyXY3sJ5UIpu 4YPw== X-Gm-Message-State: ALoCoQnKNNNeP/puYnTKzNFAaT/LEtuycu42kbfO4Xi+7a/CE3VCxe7VSL0d4SNaEhV1yW3paT9T X-Received: by 10.180.7.138 with SMTP id j10mr17317990wia.2.1432106069285; Wed, 20 May 2015 00:14:29 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.131 with SMTP id s3ls143102las.65.gmail; Wed, 20 May 2015 00:14:29 -0700 (PDT) X-Received: by 10.152.184.101 with SMTP id et5mr19247508lac.43.1432106069067; Wed, 20 May 2015 00:14:29 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id qv7si10604247lbb.162.2015.05.20.00.14.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 May 2015 00:14:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by labbd9 with SMTP id bd9so60437899lab.2 for ; Wed, 20 May 2015 00:14:28 -0700 (PDT) X-Received: by 10.152.36.161 with SMTP id r1mr21364574laj.88.1432106068751; Wed, 20 May 2015 00:14:28 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1326173lbb; Wed, 20 May 2015 00:14:27 -0700 (PDT) X-Received: by 10.107.9.223 with SMTP id 92mr15816346ioj.71.1432106066926; Wed, 20 May 2015 00:14:26 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id v12si1141560igd.23.2015.05.20.00.14.25 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 20 May 2015 00:14:26 -0700 (PDT) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YuyCk-0003LF-E8; Wed, 20 May 2015 07:14:14 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YuyCj-0003L6-E4 for edk2-devel@lists.sourceforge.net; Wed, 20 May 2015 07:14:13 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of linaro.org designates 209.85.213.180 as permitted sender) client-ip=209.85.213.180; envelope-from=ard.biesheuvel@linaro.org; helo=mail-ig0-f180.google.com; Received: from mail-ig0-f180.google.com ([209.85.213.180]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YuyCe-0007d6-Uz for edk2-devel@lists.sourceforge.net; Wed, 20 May 2015 07:14:13 +0000 Received: by igbpi8 with SMTP id pi8so95299551igb.1 for ; Wed, 20 May 2015 00:14:03 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.42.170.74 with SMTP id e10mr22278467icz.71.1432106043654; Wed, 20 May 2015 00:14:03 -0700 (PDT) Received: by 10.36.138.69 with HTTP; Wed, 20 May 2015 00:14:03 -0700 (PDT) In-Reply-To: <1431651483-24160-3-git-send-email-hao.a.wu@intel.com> References: <1431651483-24160-1-git-send-email-hao.a.wu@intel.com> <1431651483-24160-3-git-send-email-hao.a.wu@intel.com> Date: Wed, 20 May 2015 09:14:03 +0200 Message-ID: From: Ard Biesheuvel To: "edk2-devel@lists.sourceforge.net" , hao.a.wu@intel.com, ting.ye@intel.com X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1YuyCe-0007d6-Uz Subject: Re: [edk2] [PATCH 2/2] MdePkg: Add WiFi device path definition and its node/text conversion X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 On 15 May 2015 at 02:58, Hao Wu wrote: > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Hao Wu > Reviewed-by: Ye Ting This patch uses UINT8* and CHAR8* interchangeably, which breaks the build on ARM since unqualified CHAR is signed not unsigned. Please fix by adding this patch on top: Regards, Ard. > --- > MdePkg/Include/Protocol/DevicePath.h | 14 ++++++++++ > .../Library/UefiDevicePathLib/DevicePathFromText.c | 31 ++++++++++++++++++++++ > .../Library/UefiDevicePathLib/DevicePathToText.c | 28 +++++++++++++++++++ > 3 files changed, 73 insertions(+) > > diff --git a/MdePkg/Include/Protocol/DevicePath.h b/MdePkg/Include/Protocol/DevicePath.h > index 1dbb1a1..7b9a4e5 100644 > --- a/MdePkg/Include/Protocol/DevicePath.h > +++ b/MdePkg/Include/Protocol/DevicePath.h > @@ -895,6 +895,18 @@ typedef struct { > BLUETOOTH_ADDRESS BD_ADDR; > } BLUETOOTH_DEVICE_PATH; > > +/// > +/// Wi-Fi Device Path SubType. > +/// > +#define MSG_WIFI_DP 0x1C > +typedef struct { > + EFI_DEVICE_PATH_PROTOCOL Header; > + /// > + /// Service set identifier. A 32-byte octets string. > + /// > + UINT8 SSId[32]; > +} WIFI_DEVICE_PATH; > + > // > // Media Device Path > // > @@ -1145,6 +1157,7 @@ typedef union { > NVME_NAMESPACE_DEVICE_PATH NvmeNamespace; > URI_DEVICE_PATH Uri; > BLUETOOTH_DEVICE_PATH Bluetooth; > + WIFI_DEVICE_PATH WiFi; > UFS_DEVICE_PATH Ufs; > SD_DEVICE_PATH Sd; > HARDDRIVE_DEVICE_PATH HardDrive; > @@ -1199,6 +1212,7 @@ typedef union { > NVME_NAMESPACE_DEVICE_PATH *NvmeNamespace; > URI_DEVICE_PATH *Uri; > BLUETOOTH_DEVICE_PATH *Bluetooth; > + WIFI_DEVICE_PATH *WiFi; > UFS_DEVICE_PATH *Ufs; > SD_DEVICE_PATH *Sd; > HARDDRIVE_DEVICE_PATH *HardDrive; > diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c > index 3bccad9..c2aa93c 100644 > --- a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c > +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c > @@ -2770,6 +2770,36 @@ DevPathFromTextBluetooth ( > } > > /** > + Converts a text device path node to Wi-Fi device path structure. > + > + @param TextDeviceNode The input Text device path node. > + > + @return A pointer to the newly-created Wi-Fi device path structure. > + > +**/ > +EFI_DEVICE_PATH_PROTOCOL * > +DevPathFromTextWiFi ( > + IN CHAR16 *TextDeviceNode > + ) > +{ > + CHAR16 *SSIdStr; > + CHAR8 *AsciiStr; > + WIFI_DEVICE_PATH *WiFiDp; > + > + SSIdStr = GetNextParamStr (&TextDeviceNode); > + WiFiDp = (WIFI_DEVICE_PATH *) CreateDeviceNode ( > + MESSAGING_DEVICE_PATH, > + MSG_WIFI_DP, > + (UINT16) sizeof (WIFI_DEVICE_PATH) > + ); > + > + AsciiStr = WiFiDp->SSId; > + StrToAscii (SSIdStr, &AsciiStr); > + > + return (EFI_DEVICE_PATH_PROTOCOL *) WiFiDp; > +} > + > +/** > Converts a text device path node to URI device path structure. > > @param TextDeviceNode The input Text device path node. > @@ -3244,6 +3274,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE mUefiDevicePathLibDevP > {L"Vlan", DevPathFromTextVlan }, > {L"Uri", DevPathFromTextUri }, > {L"Bluetooth", DevPathFromTextBluetooth }, > + {L"WiFi", DevPathFromTextWiFi }, > {L"MediaPath", DevPathFromTextMediaPath }, > {L"HD", DevPathFromTextHD }, > {L"CDROM", DevPathFromTextCDROM }, > diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c > index a4a665b..68b9372 100644 > --- a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c > +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c > @@ -1562,6 +1562,33 @@ DevPathToTextBluetooth ( > } > > /** > + Converts a Wi-Fi device path structure to its string representative. > + > + @param Str The string representative of input device. > + @param DevPath The input device path structure. > + @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation > + of the display node is used, where applicable. If DisplayOnly > + is FALSE, then the longer text representation of the display node > + is used. > + @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text > + representation for a device node can be used, where applicable. > + > +**/ > +VOID > +DevPathToTextWiFi ( > + IN OUT POOL_PRINT *Str, > + IN VOID *DevPath, > + IN BOOLEAN DisplayOnly, > + IN BOOLEAN AllowShortcuts > + ) > +{ > + WIFI_DEVICE_PATH *WiFi; > + > + WiFi = DevPath; > + UefiDevicePathLibCatPrint (Str, L"WiFi(%a)", WiFi->SSId); > +} > + > +/** > Converts a URI device path structure to its string representative. > > @param Str The string representative of input device. > @@ -2021,6 +2048,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED const DEVICE_PATH_TO_TEXT_TABLE mUefiDevicePathLib > {MESSAGING_DEVICE_PATH, MSG_VLAN_DP, DevPathToTextVlan }, > {MESSAGING_DEVICE_PATH, MSG_URI_DP, DevPathToTextUri }, > {MESSAGING_DEVICE_PATH, MSG_BLUETOOTH_DP, DevPathToTextBluetooth }, > + {MESSAGING_DEVICE_PATH, MSG_WIFI_DP, DevPathToTextWiFi }, > {MEDIA_DEVICE_PATH, MEDIA_HARDDRIVE_DP, DevPathToTextHardDrive }, > {MEDIA_DEVICE_PATH, MEDIA_CDROM_DP, DevPathToTextCDROM }, > {MEDIA_DEVICE_PATH, MEDIA_VENDOR_DP, DevPathToTextVendor }, > -- > 1.9.5.msysgit.0 > > > ------------------------------------------------------------------------------ > One dashboard for servers and applications across Physical-Virtual-Cloud > Widest out-of-the-box monitoring support with 50+ applications > Performance metrics, stats and reports that give you Actionable Insights > Deep dive visibility with transaction tracing using APM Insight. > http://ad.doubleclick.net/ddm/clk/290420510;117567292;y > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/edk2-devel ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c index c2aa93cedc5e..ac54b88c9116 100644 --- a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c @@ -2793,7 +2793,7 @@ DevPathFromTextWiFi ( (UINT16) sizeof (WIFI_DEVICE_PATH) ); - AsciiStr = WiFiDp->SSId; + AsciiStr = (CHAR8 *)WiFiDp->SSId; StrToAscii (SSIdStr, &AsciiStr); return (EFI_DEVICE_PATH_PROTOCOL *) WiFiDp;