diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2010-12-02 08:47:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-03 12:08:08 -0500 |
commit | 4833f02a2972b7da4c8a15e1e329db0f984a75d9 (patch) | |
tree | d23e8b733fb02507b6894d632270dcb0435e6890 /drivers/net/sfc/falcon.c | |
parent | 4de92180258ac661bbce0f0065c9c81633ac862b (diff) |
sfc: Move mdio_lock to struct falcon_nic_data
We only have direct access to MDIO on Falcon, so move this out of
struct efx_nic.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/falcon.c')
-rw-r--r-- | drivers/net/sfc/falcon.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index ca59f7e02df4..af62899bb981 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c | |||
@@ -717,6 +717,7 @@ static int falcon_mdio_write(struct net_device *net_dev, | |||
717 | int prtad, int devad, u16 addr, u16 value) | 717 | int prtad, int devad, u16 addr, u16 value) |
718 | { | 718 | { |
719 | struct efx_nic *efx = netdev_priv(net_dev); | 719 | struct efx_nic *efx = netdev_priv(net_dev); |
720 | struct falcon_nic_data *nic_data = efx->nic_data; | ||
720 | efx_oword_t reg; | 721 | efx_oword_t reg; |
721 | int rc; | 722 | int rc; |
722 | 723 | ||
@@ -724,7 +725,7 @@ static int falcon_mdio_write(struct net_device *net_dev, | |||
724 | "writing MDIO %d register %d.%d with 0x%04x\n", | 725 | "writing MDIO %d register %d.%d with 0x%04x\n", |
725 | prtad, devad, addr, value); | 726 | prtad, devad, addr, value); |
726 | 727 | ||
727 | mutex_lock(&efx->mdio_lock); | 728 | mutex_lock(&nic_data->mdio_lock); |
728 | 729 | ||
729 | /* Check MDIO not currently being accessed */ | 730 | /* Check MDIO not currently being accessed */ |
730 | rc = falcon_gmii_wait(efx); | 731 | rc = falcon_gmii_wait(efx); |
@@ -760,7 +761,7 @@ static int falcon_mdio_write(struct net_device *net_dev, | |||
760 | } | 761 | } |
761 | 762 | ||
762 | out: | 763 | out: |
763 | mutex_unlock(&efx->mdio_lock); | 764 | mutex_unlock(&nic_data->mdio_lock); |
764 | return rc; | 765 | return rc; |
765 | } | 766 | } |
766 | 767 | ||
@@ -769,10 +770,11 @@ static int falcon_mdio_read(struct net_device *net_dev, | |||
769 | int prtad, int devad, u16 addr) | 770 | int prtad, int devad, u16 addr) |
770 | { | 771 | { |
771 | struct efx_nic *efx = netdev_priv(net_dev); | 772 | struct efx_nic *efx = netdev_priv(net_dev); |
773 | struct falcon_nic_data *nic_data = efx->nic_data; | ||
772 | efx_oword_t reg; | 774 | efx_oword_t reg; |
773 | int rc; | 775 | int rc; |
774 | 776 | ||
775 | mutex_lock(&efx->mdio_lock); | 777 | mutex_lock(&nic_data->mdio_lock); |
776 | 778 | ||
777 | /* Check MDIO not currently being accessed */ | 779 | /* Check MDIO not currently being accessed */ |
778 | rc = falcon_gmii_wait(efx); | 780 | rc = falcon_gmii_wait(efx); |
@@ -811,7 +813,7 @@ static int falcon_mdio_read(struct net_device *net_dev, | |||
811 | } | 813 | } |
812 | 814 | ||
813 | out: | 815 | out: |
814 | mutex_unlock(&efx->mdio_lock); | 816 | mutex_unlock(&nic_data->mdio_lock); |
815 | return rc; | 817 | return rc; |
816 | } | 818 | } |
817 | 819 | ||
@@ -839,6 +841,7 @@ static int falcon_probe_port(struct efx_nic *efx) | |||
839 | } | 841 | } |
840 | 842 | ||
841 | /* Fill out MDIO structure and loopback modes */ | 843 | /* Fill out MDIO structure and loopback modes */ |
844 | mutex_init(&nic_data->mdio_lock); | ||
842 | efx->mdio.mdio_read = falcon_mdio_read; | 845 | efx->mdio.mdio_read = falcon_mdio_read; |
843 | efx->mdio.mdio_write = falcon_mdio_write; | 846 | efx->mdio.mdio_write = falcon_mdio_write; |
844 | rc = efx->phy_op->probe(efx); | 847 | rc = efx->phy_op->probe(efx); |