diff options
author | Madalin Bucur <madalin.bucur@freescale.com> | 2013-05-22 15:43:37 (GMT) |
---|---|---|
committer | Fleming Andrew-AFLEMING <AFLEMING@freescale.com> | 2013-07-15 21:45:18 (GMT) |
commit | 80940cee4876d454999dff30ea2f2288c80ac60a (patch) | |
tree | f064a3c973660f1602194d2a2ed4ea0582efe1c1 /drivers/net/ethernet/freescale/fman | |
parent | 77ccf8c1fca27a057038fe824894b18d42a78424 (diff) | |
download | linux-fsl-qoriq-80940cee4876d454999dff30ea2f2288c80ac60a.tar.xz |
fmd: remove reference to dpa_eth in FMD code
The mac handle can be retrieved without involving dpa_eth code.
Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
Change-Id: I2cdd07b99af9150469d9274bff28c6acfcd57bde
Reviewed-on: http://git.am.freescale.net:8181/3073
Reviewed-by: Hamciuc Bogdan-BHAMCIU1 <bogdan.hamciuc@freescale.com>
Reviewed-by: Sovaiala Cristian-Constantin-B39531 <Cristian.Sovaiala@freescale.com>
Reviewed-by: Radulescu Ruxandra Ioana-B05472 <ruxandra.radulescu@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/fman')
-rw-r--r-- | drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm.c | 49 |
1 files changed, 19 insertions, 30 deletions
diff --git a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm.c b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm.c index 3c372a3..f9a8e26 100644 --- a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm.c +++ b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm.c @@ -77,8 +77,6 @@ #include "lnxwrp_fm.h" -#include "dpaa_eth.h" - #define CMP_IOC_DEFINE(def) (IOC_##def != def) /* fm_pcd_ioctls.h === fm_pcd_ext.h assertions */ @@ -4036,39 +4034,30 @@ t_Error LnxwrpFmPortIOCTL(t_LnxWrpFmPortDev *p_LnxWrpFmPortDev, unsigned int cmd if (p_LnxWrpFmPortDev->pcd_owner_params.dev) { - struct net_device *net_dev = dev_get_drvdata(p_LnxWrpFmPortDev->pcd_owner_params.dev); + int id = -1; - if (net_dev) + switch(p_LnxWrpFmPortDev->settings.param.portType) { - struct dpa_priv_s *priv = netdev_priv(net_dev); - - if (priv) - { - struct mac_device *mac_dev = priv->mac_dev; - - if (mac_dev) - { - void *mac_handle = mac_dev->get_mac_handle(mac_dev); - - err = (cmd == FM_PORT_IOC_ADD_RX_HASH_MAC_ADDR) - ? FM_MAC_AddHashMacAddr((t_Handle) mac_handle, (t_EnetAddr*) param) - : FM_MAC_RemoveHashMacAddr((t_Handle) mac_handle, (t_EnetAddr*) param) - ; - } - else - { - err = E_NOT_AVAILABLE; - REPORT_ERROR(MINOR, err, ("Attempt to add/remove hash MAC addr. to/from MAC-less port!")); - } - } - else - /* Not possible, set err nevertheless: */ + case e_FM_PORT_TYPE_RX: + case e_FM_PORT_TYPE_TX: + id = p_LnxWrpFmPortDev->id; + break; + case e_FM_PORT_TYPE_RX_10G: + case e_FM_PORT_TYPE_TX_10G: + id = p_LnxWrpFmPortDev->id + FM_MAX_NUM_OF_1G_MACS; + break; + default: err = E_NOT_AVAILABLE; + REPORT_ERROR(MINOR, err, ("Attempt to add/remove hash MAC addr. to/from MAC-less port!")); } - else + if (id >= 0) { - err = E_NOT_AVAILABLE; - REPORT_ERROR(MINOR, err, ("No net device (and no MAC!) associated to this port!")); + t_LnxWrpFmDev *fm = (t_LnxWrpFmDev *)p_LnxWrpFmPortDev->h_LnxWrpFmDev; + t_Handle mac_handle = fm->macs[id].h_Dev; + + err = (cmd == FM_PORT_IOC_ADD_RX_HASH_MAC_ADDR) + ? FM_MAC_AddHashMacAddr(mac_handle, (t_EnetAddr*) param) + : FM_MAC_RemoveHashMacAddr(mac_handle, (t_EnetAddr*) param); } } else |