aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/et131x/et1310_rx.c
diff options
context:
space:
mode:
authorMark Einon <mark.einon@gmail.com>2011-09-04 11:24:32 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-09-06 16:54:53 -0700
commit412f8e0c52b126c6f54d0626a9dede9438d76c03 (patch)
tree6a9f76a432d3d9fba883b8e2dc3cfdea3319eda2 /drivers/staging/et131x/et1310_rx.c
parent740b7a2cb18206374aabe38c0ec1f1344214ac97 (diff)
staging: et131x: Remove private adapter->linkspeed and use phydev->speed instead
The phy device keeps a note of the link speed, so use that value instead of the driver private one. Also use the phydev defines for link speeds, and remove the driver private ones. adapter->hw_errs was never used, even in the vendor driver, so remove that too. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/et131x/et1310_rx.c')
-rw-r--r--drivers/staging/et131x/et1310_rx.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/staging/et131x/et1310_rx.c b/drivers/staging/et131x/et1310_rx.c
index f50420c582a..c402c5e61e4 100644
--- a/drivers/staging/et131x/et1310_rx.c
+++ b/drivers/staging/et131x/et1310_rx.c
@@ -82,6 +82,7 @@
#include <linux/skbuff.h>
#include <linux/if_arp.h>
#include <linux/ioport.h>
+#include <linux/phy.h>
#include "et1310_phy.h"
#include "et131x_adapter.h"
@@ -724,11 +725,15 @@ void et131x_config_rx_dma_regs(struct et131x_adapter *adapter)
*/
void et131x_set_rx_dma_timer(struct et131x_adapter *adapter)
{
+ struct phy_device *phydev = adapter->phydev;
+
+ if (!phydev)
+ return;
+
/* For version B silicon, we do not use the RxDMA timer for 10 and 100
* Mbits/s line rates. We do not enable and RxDMA interrupt coalescing.
*/
- if ((adapter->linkspeed == TRUEPHY_SPEED_100MBPS) ||
- (adapter->linkspeed == TRUEPHY_SPEED_10MBPS)) {
+ if ((phydev->speed == SPEED_100) || (phydev->speed == SPEED_10)) {
writel(0, &adapter->regs->rxdma.max_pkt_time);
writel(1, &adapter->regs->rxdma.num_pkt_done);
}