public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [patch] MdeModulePkg:Generate the correct operational state of the interface.
@ 2017-02-10  3:17 Zhang Lubo
  2017-02-10  3:31 ` Wu, Jiaxin
  2017-02-10  5:41 ` Ye, Ting
  0 siblings, 2 replies; 3+ messages in thread
From: Zhang Lubo @ 2017-02-10  3:17 UTC (permalink / raw)
  To: edk2-devel; +Cc: Santhapur Naveen, Ye Ting, Fu Siyuan, Wu Jiaxin

Currently, When there are more than 9 Ethernet ports available,
'ifconfig -l' is not listing all the ports, only show the ports 0 to 9.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Santhapur Naveen <naveens@amiindia.co.in>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
---
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
index 131b03f..a6a3da8 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
@@ -1490,15 +1490,16 @@ VOID
 Ip4Config2InitIfInfo (
   IN  IP4_SERVICE                    *IpSb,
   OUT EFI_IP4_CONFIG2_INTERFACE_INFO *IfInfo
   )
 {
-  IfInfo->Name[0] = L'e';
-  IfInfo->Name[1] = L't';
-  IfInfo->Name[2] = L'h';
-  IfInfo->Name[3] = (CHAR16) (L'0' + IpSb->Ip4Config2Instance.IfIndex);
-  IfInfo->Name[4] = 0;
+  UnicodeSPrint (
+    IfInfo->Name,
+    EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE,
+    L"eth%x",
+    IpSb->Ip4Config2Instance.IfIndex
+  );
 
   IfInfo->IfType        = IpSb->SnpMode.IfType;
   IfInfo->HwAddressSize = IpSb->SnpMode.HwAddressSize;
   CopyMem (&IfInfo->HwAddress, &IpSb->SnpMode.CurrentAddress, IfInfo->HwAddressSize);
 }
-- 
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch] MdeModulePkg:Generate the correct operational state of the interface.
  2017-02-10  3:17 [patch] MdeModulePkg:Generate the correct operational state of the interface Zhang Lubo
@ 2017-02-10  3:31 ` Wu, Jiaxin
  2017-02-10  5:41 ` Ye, Ting
  1 sibling, 0 replies; 3+ messages in thread
From: Wu, Jiaxin @ 2017-02-10  3:31 UTC (permalink / raw)
  To: Zhang, Lubo, edk2-devel@lists.01.org; +Cc: Ye, Ting, Fu, Siyuan

Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>


> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Zhang Lubo
> Sent: Friday, February 10, 2017 11:18 AM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu,
> Jiaxin <jiaxin.wu@intel.com>
> Subject: [edk2] [patch] MdeModulePkg:Generate the correct operational
> state of the interface.
> 
> Currently, When there are more than 9 Ethernet ports available,
> 'ifconfig -l' is not listing all the ports, only show the ports 0 to 9.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
> Cc: Santhapur Naveen <naveens@amiindia.co.in>
> Cc: Ye Ting <ting.ye@intel.com>
> Cc: Fu Siyuan <siyuan.fu@intel.com>
> Cc: Wu Jiaxin <jiaxin.wu@intel.com>
> ---
>  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c | 11 ++++++--
> ---
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
> b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
> index 131b03f..a6a3da8 100644
> --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
> +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
> @@ -1490,15 +1490,16 @@ VOID
>  Ip4Config2InitIfInfo (
>    IN  IP4_SERVICE                    *IpSb,
>    OUT EFI_IP4_CONFIG2_INTERFACE_INFO *IfInfo
>    )
>  {
> -  IfInfo->Name[0] = L'e';
> -  IfInfo->Name[1] = L't';
> -  IfInfo->Name[2] = L'h';
> -  IfInfo->Name[3] = (CHAR16) (L'0' + IpSb->Ip4Config2Instance.IfIndex);
> -  IfInfo->Name[4] = 0;
> +  UnicodeSPrint (
> +    IfInfo->Name,
> +    EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE,
> +    L"eth%x",
> +    IpSb->Ip4Config2Instance.IfIndex
> +  );
> 
>    IfInfo->IfType        = IpSb->SnpMode.IfType;
>    IfInfo->HwAddressSize = IpSb->SnpMode.HwAddressSize;
>    CopyMem (&IfInfo->HwAddress, &IpSb->SnpMode.CurrentAddress,
> IfInfo->HwAddressSize);
>  }
> --
> 1.9.5.msysgit.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] MdeModulePkg:Generate the correct operational state of the interface.
  2017-02-10  3:17 [patch] MdeModulePkg:Generate the correct operational state of the interface Zhang Lubo
  2017-02-10  3:31 ` Wu, Jiaxin
@ 2017-02-10  5:41 ` Ye, Ting
  1 sibling, 0 replies; 3+ messages in thread
From: Ye, Ting @ 2017-02-10  5:41 UTC (permalink / raw)
  To: Zhang, Lubo, edk2-devel@lists.01.org; +Cc: Fu, Siyuan, Wu, Jiaxin

Reviewed-by: Ye Ting <ting.ye@intel.com> 

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Zhang Lubo
Sent: Friday, February 10, 2017 11:18 AM
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [edk2] [patch] MdeModulePkg:Generate the correct operational state of the interface.

Currently, When there are more than 9 Ethernet ports available, 'ifconfig -l' is not listing all the ports, only show the ports 0 to 9.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Santhapur Naveen <naveens@amiindia.co.in>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
---
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
index 131b03f..a6a3da8 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
@@ -1490,15 +1490,16 @@ VOID
 Ip4Config2InitIfInfo (
   IN  IP4_SERVICE                    *IpSb,
   OUT EFI_IP4_CONFIG2_INTERFACE_INFO *IfInfo
   )
 {
-  IfInfo->Name[0] = L'e';
-  IfInfo->Name[1] = L't';
-  IfInfo->Name[2] = L'h';
-  IfInfo->Name[3] = (CHAR16) (L'0' + IpSb->Ip4Config2Instance.IfIndex);
-  IfInfo->Name[4] = 0;
+  UnicodeSPrint (
+    IfInfo->Name,
+    EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE,
+    L"eth%x",
+    IpSb->Ip4Config2Instance.IfIndex
+  );
 
   IfInfo->IfType        = IpSb->SnpMode.IfType;
   IfInfo->HwAddressSize = IpSb->SnpMode.HwAddressSize;
   CopyMem (&IfInfo->HwAddress, &IpSb->SnpMode.CurrentAddress, IfInfo->HwAddressSize);  }
--
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-10  5:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-10  3:17 [patch] MdeModulePkg:Generate the correct operational state of the interface Zhang Lubo
2017-02-10  3:31 ` Wu, Jiaxin
2017-02-10  5:41 ` Ye, Ting

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox