aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/gianfar_ethtool.c
diff options
context:
space:
mode:
authorSandeep Gopalpet <Sandeep.Kumar@freescale.com>2009-11-02 02:03:09 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-03 02:40:56 -0500
commitf4983704a63b3764418905a77d48105a8cbce97f (patch)
tree959183e305131f60e01f0452e87f1f80a580abea /drivers/net/gianfar_ethtool.c
parenta12f801d4b349bc57622584e70e45a4ccbef53b6 (diff)
gianfar: Introduce logical group support.
This patch introduces the group structure. The elements of this structure are the interrupt lines, their corresponding names, the register memory map. The elements for this group are factored out from the gfar_private structure. The introduction of group structure will help in providing support for newer versions of etsec. Currently, the support is present only for single group and single tx/rx queues. Signed-off-by: Sandeep Gopalpet <Sandeep.Kumar@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/gianfar_ethtool.c')
-rw-r--r--drivers/net/gianfar_ethtool.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/gianfar_ethtool.c b/drivers/net/gianfar_ethtool.c
index 6d0d1714c2f2..c681b414767a 100644
--- a/drivers/net/gianfar_ethtool.c
+++ b/drivers/net/gianfar_ethtool.c
@@ -137,10 +137,11 @@ static void gfar_fill_stats(struct net_device *dev, struct ethtool_stats *dummy,
137{ 137{
138 int i; 138 int i;
139 struct gfar_private *priv = netdev_priv(dev); 139 struct gfar_private *priv = netdev_priv(dev);
140 struct gfar __iomem *regs = priv->gfargrp.regs;
140 u64 *extra = (u64 *) & priv->extra_stats; 141 u64 *extra = (u64 *) & priv->extra_stats;
141 142
142 if (priv->device_flags & FSL_GIANFAR_DEV_HAS_RMON) { 143 if (priv->device_flags & FSL_GIANFAR_DEV_HAS_RMON) {
143 u32 __iomem *rmon = (u32 __iomem *) & priv->regs->rmon; 144 u32 __iomem *rmon = (u32 __iomem *) &regs->rmon;
144 struct gfar_stats *stats = (struct gfar_stats *) buf; 145 struct gfar_stats *stats = (struct gfar_stats *) buf;
145 146
146 for (i = 0; i < GFAR_RMON_LEN; i++) 147 for (i = 0; i < GFAR_RMON_LEN; i++)
@@ -223,7 +224,7 @@ static void gfar_get_regs(struct net_device *dev, struct ethtool_regs *regs, voi
223{ 224{
224 int i; 225 int i;
225 struct gfar_private *priv = netdev_priv(dev); 226 struct gfar_private *priv = netdev_priv(dev);
226 u32 __iomem *theregs = (u32 __iomem *) priv->regs; 227 u32 __iomem *theregs = (u32 __iomem *) priv->gfargrp.regs;
227 u32 *buf = (u32 *) regbuf; 228 u32 *buf = (u32 *) regbuf;
228 229
229 for (i = 0; i < sizeof (struct gfar) / sizeof (u32); i++) 230 for (i = 0; i < sizeof (struct gfar) / sizeof (u32); i++)
@@ -349,6 +350,7 @@ static int gfar_gcoalesce(struct net_device *dev, struct ethtool_coalesce *cvals
349static int gfar_scoalesce(struct net_device *dev, struct ethtool_coalesce *cvals) 350static int gfar_scoalesce(struct net_device *dev, struct ethtool_coalesce *cvals)
350{ 351{
351 struct gfar_private *priv = netdev_priv(dev); 352 struct gfar_private *priv = netdev_priv(dev);
353 struct gfar __iomem *regs = priv->gfargrp.regs;
352 struct gfar_priv_tx_q *tx_queue = NULL; 354 struct gfar_priv_tx_q *tx_queue = NULL;
353 struct gfar_priv_rx_q *rx_queue = NULL; 355 struct gfar_priv_rx_q *rx_queue = NULL;
354 356
@@ -407,13 +409,13 @@ static int gfar_scoalesce(struct net_device *dev, struct ethtool_coalesce *cvals
407 tx_queue->txic = mk_ic_value(cvals->tx_max_coalesced_frames, 409 tx_queue->txic = mk_ic_value(cvals->tx_max_coalesced_frames,
408 gfar_usecs2ticks(priv, cvals->tx_coalesce_usecs)); 410 gfar_usecs2ticks(priv, cvals->tx_coalesce_usecs));
409 411
410 gfar_write(&priv->regs->rxic, 0); 412 gfar_write(&regs->rxic, 0);
411 if (rx_queue->rxcoalescing) 413 if (rx_queue->rxcoalescing)
412 gfar_write(&priv->regs->rxic, rx_queue->rxic); 414 gfar_write(&regs->rxic, rx_queue->rxic);
413 415
414 gfar_write(&priv->regs->txic, 0); 416 gfar_write(&regs->txic, 0);
415 if (tx_queue->txcoalescing) 417 if (tx_queue->txcoalescing)
416 gfar_write(&priv->regs->txic, tx_queue->txic); 418 gfar_write(&regs->txic, tx_queue->txic);
417 419
418 return 0; 420 return 0;
419} 421}