All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH 0/2] Convert ixgbe/i40e to use eth_platform_get_mac_address
@ 2016-01-13  3:32 Sowmini Varadhan
  2016-01-13  3:32 ` [Intel-wired-lan] [PATCH 1/2] ixgbe: use eth_platform_get_mac_address() Sowmini Varadhan
  2016-01-13  3:32 ` [Intel-wired-lan] [PATCH 2/2] i40e: " Sowmini Varadhan
  0 siblings, 2 replies; 6+ messages in thread
From: Sowmini Varadhan @ 2016-01-13  3:32 UTC (permalink / raw)
  To: intel-wired-lan

Commit c7f5d105495a ("net: Add eth_platform_get_mac_address()
helper.") provides a consolidation path for platforms like SPARC
to implement arch specific code to extract the MAC address
from Open Firmware, IDPROM etc.

This patchset converts ixgbe and i40e to use eth_platform_get_mac_address()

Sowmini Varadhan (2):
  ixgbe: use eth_platform_get_mac_address()
  i40e: use eth_platform_get_mac_address()

 drivers/net/ethernet/intel/i40e/i40e_main.c   |   19 +-------------
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |   35 +-----------------------
 2 files changed, 3 insertions(+), 51 deletions(-)


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

* [Intel-wired-lan] [PATCH 1/2] ixgbe: use eth_platform_get_mac_address()
  2016-01-13  3:32 [Intel-wired-lan] [PATCH 0/2] Convert ixgbe/i40e to use eth_platform_get_mac_address Sowmini Varadhan
@ 2016-01-13  3:32 ` Sowmini Varadhan
  2016-01-29 18:24   ` Schmitt, Phillip J
  2016-01-13  3:32 ` [Intel-wired-lan] [PATCH 2/2] i40e: " Sowmini Varadhan
  1 sibling, 1 reply; 6+ messages in thread
From: Sowmini Varadhan @ 2016-01-13  3:32 UTC (permalink / raw)
  To: intel-wired-lan

This commit converts commit c762dff24c06 ("ixgbe: Look up MAC address in
Open Firmware or IDPROM") to use eth_platform_get_mac_address()
added by commit c7f5d105495a ("net: Add eth_platform_get_mac_address()
helper.")

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |   35 +-----------------------
 1 files changed, 2 insertions(+), 33 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index c4003a8..fedaa50 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -52,15 +52,6 @@
 #include <scsi/fc/fc_fcoe.h>
 #include <net/vxlan.h>
 
-#ifdef CONFIG_OF
-#include <linux/of_net.h>
-#endif
-
-#ifdef CONFIG_SPARC
-#include <asm/idprom.h>
-#include <asm/prom.h>
-#endif
-
 #include "ixgbe.h"
 #include "ixgbe_common.h"
 #include "ixgbe_dcb_82599.h"
@@ -8801,29 +8792,6 @@ int ixgbe_wol_supported(struct ixgbe_adapter *adapter, u16 device_id,
 }
 
 /**
- * ixgbe_get_platform_mac_addr - Look up MAC address in Open Firmware / IDPROM
- * @adapter: Pointer to adapter struct
- */
-static void ixgbe_get_platform_mac_addr(struct ixgbe_adapter *adapter)
-{
-#ifdef CONFIG_OF
-	struct device_node *dp = pci_device_to_OF_node(adapter->pdev);
-	struct ixgbe_hw *hw = &adapter->hw;
-	const unsigned char *addr;
-
-	addr = of_get_mac_address(dp);
-	if (addr) {
-		ether_addr_copy(hw->mac.perm_addr, addr);
-		return;
-	}
-#endif /* CONFIG_OF */
-
-#ifdef CONFIG_SPARC
-	ether_addr_copy(hw->mac.perm_addr, idprom->id_ethaddr);
-#endif /* CONFIG_SPARC */
-}
-
-/**
  * ixgbe_probe - Device Initialization Routine
  * @pdev: PCI device information struct
  * @ent: entry in ixgbe_pci_tbl
@@ -9104,7 +9072,8 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		goto err_sw_init;
 	}
 
-	ixgbe_get_platform_mac_addr(adapter);
+	eth_platform_get_mac_address(&adapter->pdev->dev,
+				     adapter->hw.mac.perm_addr);
 
 	memcpy(netdev->dev_addr, hw->mac.perm_addr, netdev->addr_len);
 
-- 
1.7.1


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

* [Intel-wired-lan] [PATCH 2/2] i40e: use eth_platform_get_mac_address()
  2016-01-13  3:32 [Intel-wired-lan] [PATCH 0/2] Convert ixgbe/i40e to use eth_platform_get_mac_address Sowmini Varadhan
  2016-01-13  3:32 ` [Intel-wired-lan] [PATCH 1/2] ixgbe: use eth_platform_get_mac_address() Sowmini Varadhan
@ 2016-01-13  3:32 ` Sowmini Varadhan
  2016-01-13 18:02   ` Nelson, Shannon
  2016-01-13 19:28   ` Bowers, AndrewX
  1 sibling, 2 replies; 6+ messages in thread
From: Sowmini Varadhan @ 2016-01-13  3:32 UTC (permalink / raw)
  To: intel-wired-lan

This commit converts commit b499ffb0a22c ("i40e: Look up MAC address in
Open Firmware or IDPROM") to use eth_platform_get_mac_address()
added by commit c7f5d105495a ("net: Add eth_platform_get_mac_address()
helper.")

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c |   19 +------------------
 1 files changed, 1 insertions(+), 18 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index bb4612c..65220aa 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -28,11 +28,6 @@
 #include <linux/of_net.h>
 #include <linux/pci.h>
 
-#ifdef CONFIG_SPARC
-#include <asm/idprom.h>
-#include <asm/prom.h>
-#endif
-
 /* Local includes */
 #include "i40e.h"
 #include "i40e_diag.h"
@@ -10543,21 +10538,9 @@ static void i40e_print_features(struct i40e_pf *pf)
  **/
 static void i40e_get_platform_mac_addr(struct pci_dev *pdev, struct i40e_pf *pf)
 {
-	struct device_node *dp = pci_device_to_OF_node(pdev);
-	const unsigned char *addr;
-	u8 *mac_addr = pf->hw.mac.addr;
-
 	pf->flags &= ~I40E_FLAG_PF_MAC;
-	addr = of_get_mac_address(dp);
-	if (addr) {
-		ether_addr_copy(mac_addr, addr);
+	if (!eth_platform_get_mac_address(&pdev->dev, pf->hw.mac.addr))
 		pf->flags |= I40E_FLAG_PF_MAC;
-#ifdef CONFIG_SPARC
-	} else {
-		ether_addr_copy(mac_addr, idprom->id_ethaddr);
-		pf->flags |= I40E_FLAG_PF_MAC;
-#endif /* CONFIG_SPARC */
-	}
 }
 
 /**
-- 
1.7.1


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

* [Intel-wired-lan] [PATCH 2/2] i40e: use eth_platform_get_mac_address()
  2016-01-13  3:32 ` [Intel-wired-lan] [PATCH 2/2] i40e: " Sowmini Varadhan
@ 2016-01-13 18:02   ` Nelson, Shannon
  2016-01-13 19:28   ` Bowers, AndrewX
  1 sibling, 0 replies; 6+ messages in thread
From: Nelson, Shannon @ 2016-01-13 18:02 UTC (permalink / raw)
  To: intel-wired-lan

> From: Sowmini Varadhan [mailto:sowmini.varadhan at oracle.com]
> 
> This commit converts commit b499ffb0a22c ("i40e: Look up MAC address in
> Open Firmware or IDPROM") to use eth_platform_get_mac_address()
> added by commit c7f5d105495a ("net: Add eth_platform_get_mac_address()
> helper.")
> 
> Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c |   19 +------------------
>  1 files changed, 1 insertions(+), 18 deletions(-)

Much nicer - thanks Dave and Sowmini!
sln


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

* [Intel-wired-lan] [PATCH 2/2] i40e: use eth_platform_get_mac_address()
  2016-01-13  3:32 ` [Intel-wired-lan] [PATCH 2/2] i40e: " Sowmini Varadhan
  2016-01-13 18:02   ` Nelson, Shannon
@ 2016-01-13 19:28   ` Bowers, AndrewX
  1 sibling, 0 replies; 6+ messages in thread
From: Bowers, AndrewX @ 2016-01-13 19:28 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Sowmini Varadhan
> Sent: Tuesday, January 12, 2016 7:33 PM
> To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>; Brandeburg, Jesse
> <jesse.brandeburg@intel.com>; Nelson, Shannon
> <shannon.nelson@intel.com>; Wyborny, Carolyn
> <carolyn.wyborny@intel.com>; Skidmore, Donald C
> <donald.c.skidmore@intel.com>; Allan, Bruce W <bruce.w.allan@intel.com>;
> Ronciak, John <john.ronciak@intel.com>; Williams, Mitch A
> <mitch.a.williams@intel.com>; intel-wired-lan at lists.osuosl.org
> Cc: sowmini.varadhan at oracle.com; davem at davemloft.net
> Subject: [Intel-wired-lan] [PATCH 2/2] i40e: use
> eth_platform_get_mac_address()
> 
> This commit converts commit b499ffb0a22c ("i40e: Look up MAC address in
> Open Firmware or IDPROM") to use eth_platform_get_mac_address()
> added by commit c7f5d105495a ("net: Add eth_platform_get_mac_address()
> helper.")
> 
> Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c |   19 +------------------
>  1 files changed, 1 insertions(+), 18 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Patch code changes correctly applied, MAC address lookup works correctly

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

* [Intel-wired-lan] [PATCH 1/2] ixgbe: use eth_platform_get_mac_address()
  2016-01-13  3:32 ` [Intel-wired-lan] [PATCH 1/2] ixgbe: use eth_platform_get_mac_address() Sowmini Varadhan
@ 2016-01-29 18:24   ` Schmitt, Phillip J
  0 siblings, 0 replies; 6+ messages in thread
From: Schmitt, Phillip J @ 2016-01-29 18:24 UTC (permalink / raw)
  To: intel-wired-lan



> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Sowmini Varadhan
> Sent: Tuesday, January 12, 2016 7:32 PM
> To: Kirsher, Jeffrey T; Brandeburg, Jesse; Nelson, Shannon; Wyborny, Carolyn;
> Skidmore, Donald C; Allan, Bruce W; Ronciak, John; Williams, Mitch A; intel-
> wired-lan at lists.osuosl.org
> Cc: sowmini.varadhan at oracle.com; davem at davemloft.net
> Subject: [Intel-wired-lan] [PATCH 1/2] ixgbe: use
> eth_platform_get_mac_address()
> 
> This commit converts commit c762dff24c06 ("ixgbe: Look up MAC address in
> Open Firmware or IDPROM") to use eth_platform_get_mac_address() added by
> commit c7f5d105495a ("net: Add eth_platform_get_mac_address()
> helper.")
> 
> Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>

I don't have any SPARC systems to test this on.
I've tested to check that this patch doesn't seem to break anything on X86_64 systems.
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>




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

end of thread, other threads:[~2016-01-29 18:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-13  3:32 [Intel-wired-lan] [PATCH 0/2] Convert ixgbe/i40e to use eth_platform_get_mac_address Sowmini Varadhan
2016-01-13  3:32 ` [Intel-wired-lan] [PATCH 1/2] ixgbe: use eth_platform_get_mac_address() Sowmini Varadhan
2016-01-29 18:24   ` Schmitt, Phillip J
2016-01-13  3:32 ` [Intel-wired-lan] [PATCH 2/2] i40e: " Sowmini Varadhan
2016-01-13 18:02   ` Nelson, Shannon
2016-01-13 19:28   ` Bowers, AndrewX

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.