diff options
author | Quan Nguyen <qnguyen@apm.com> | 2017-05-10 23:45:00 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-05-16 18:41:08 +0300 |
commit | 8ec7074a6bf74e12f67c0dc90cdaa7969bb49c74 (patch) | |
tree | 7cc89b3e592617ba620121a59817df2c712a7441 /drivers/net/phy/mdio-xgene.h | |
parent | ae1aed95d0255aafdffc48c3a077c7980adc1168 (diff) | |
download | linux-8ec7074a6bf74e12f67c0dc90cdaa7969bb49c74.tar.xz |
drivers: net: phy: xgene: Add lock to protect mac access
This patch,
- refactors mac access routine
- adds lock to protect mac indirect access
Signed-off-by: Quan Nguyen <qnguyen@apm.com>
Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/mdio-xgene.h')
-rw-r--r-- | drivers/net/phy/mdio-xgene.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/phy/mdio-xgene.h b/drivers/net/phy/mdio-xgene.h index 594a11d42401..3c85f3e30baa 100644 --- a/drivers/net/phy/mdio-xgene.h +++ b/drivers/net/phy/mdio-xgene.h @@ -102,6 +102,7 @@ struct xgene_mdio_pdata { void __iomem *mdio_csr_addr; struct mii_bus *mdio_bus; int mdio_id; + spinlock_t mac_lock; /* mac lock */ }; /* Set the specified value into a bit-field defined by its starting position @@ -132,6 +133,8 @@ static inline u64 xgene_enet_get_field_value(int pos, int len, u64 src) #define GET_BIT(field, src) \ xgene_enet_get_field_value(field ## _POS, 1, src) +u32 xgene_mdio_rd_mac(struct xgene_mdio_pdata *pdata, u32 rd_addr); +void xgene_mdio_wr_mac(struct xgene_mdio_pdata *pdata, u32 wr_addr, u32 data); int xgene_mdio_rgmii_read(struct mii_bus *bus, int phy_id, int reg); int xgene_mdio_rgmii_write(struct mii_bus *bus, int phy_id, int reg, u16 data); struct phy_device *xgene_enet_phy_register(struct mii_bus *bus, int phy_addr); |