aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet/be_ethtool.c
diff options
context:
space:
mode:
authorSathya Perla <sathyap@serverengines.com>2009-07-27 18:52:03 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-02 02:06:20 -0400
commit8788fdc2a53cf012a43808877eaa6ac7e3c923b4 (patch)
treeef62e30494ee1aaced18250ddb7295ff0bb28f7a /drivers/net/benet/be_ethtool.c
parent2f6d7c1b34403b97fa57473edcb6749d1db5ace3 (diff)
be2net: get rid of be_ctrl_info struct/abstraction
Currently only the be_ctrl_info struct ptr (instead of adapter) is passed to all the routines in be_cmds.c. Instead pass be_adapter ptr to allow access to all its fields. Merge the contents of struct be_ctrl_info into be_adapter. The resulting code is simpler. Signed-off-by: Sathya Perla <sathyap@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_ethtool.c')
-rw-r--r--drivers/net/benet/be_ethtool.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index f3f0f91e38c4..c480c19200d7 100644
--- a/drivers/net/benet/be_ethtool.c
+++ b/drivers/net/benet/be_ethtool.c
@@ -16,6 +16,7 @@
16 */ 16 */
17 17
18#include "be.h" 18#include "be.h"
19#include "be_cmds.h"
19#include <linux/ethtool.h> 20#include <linux/ethtool.h>
20 21
21struct be_ethtool_stat { 22struct be_ethtool_stat {
@@ -148,7 +149,6 @@ static int
148be_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *coalesce) 149be_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *coalesce)
149{ 150{
150 struct be_adapter *adapter = netdev_priv(netdev); 151 struct be_adapter *adapter = netdev_priv(netdev);
151 struct be_ctrl_info *ctrl = &adapter->ctrl;
152 struct be_eq_obj *rx_eq = &adapter->rx_eq; 152 struct be_eq_obj *rx_eq = &adapter->rx_eq;
153 struct be_eq_obj *tx_eq = &adapter->tx_eq; 153 struct be_eq_obj *tx_eq = &adapter->tx_eq;
154 u32 tx_max, tx_min, tx_cur; 154 u32 tx_max, tx_min, tx_cur;
@@ -176,7 +176,7 @@ be_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *coalesce)
176 if (tx_cur > BE_MAX_EQD) 176 if (tx_cur > BE_MAX_EQD)
177 tx_cur = BE_MAX_EQD; 177 tx_cur = BE_MAX_EQD;
178 if (tx_eq->cur_eqd != tx_cur) { 178 if (tx_eq->cur_eqd != tx_cur) {
179 status = be_cmd_modify_eqd(ctrl, tx_eq->q.id, tx_cur); 179 status = be_cmd_modify_eqd(adapter, tx_eq->q.id, tx_cur);
180 if (!status) 180 if (!status)
181 tx_eq->cur_eqd = tx_cur; 181 tx_eq->cur_eqd = tx_cur;
182 } 182 }
@@ -196,7 +196,8 @@ be_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *coalesce)
196 if (rx_cur > BE_MAX_EQD) 196 if (rx_cur > BE_MAX_EQD)
197 rx_cur = BE_MAX_EQD; 197 rx_cur = BE_MAX_EQD;
198 if (rx_eq->cur_eqd != rx_cur) { 198 if (rx_eq->cur_eqd != rx_cur) {
199 status = be_cmd_modify_eqd(ctrl, rx_eq->q.id, rx_cur); 199 status = be_cmd_modify_eqd(adapter, rx_eq->q.id,
200 rx_cur);
200 if (!status) 201 if (!status)
201 rx_eq->cur_eqd = rx_cur; 202 rx_eq->cur_eqd = rx_cur;
202 } 203 }
@@ -310,8 +311,7 @@ be_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
310{ 311{
311 struct be_adapter *adapter = netdev_priv(netdev); 312 struct be_adapter *adapter = netdev_priv(netdev);
312 313
313 be_cmd_get_flow_control(&adapter->ctrl, &ecmd->tx_pause, 314 be_cmd_get_flow_control(adapter, &ecmd->tx_pause, &ecmd->rx_pause);
314 &ecmd->rx_pause);
315 ecmd->autoneg = 0; 315 ecmd->autoneg = 0;
316} 316}
317 317
@@ -324,7 +324,7 @@ be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
324 if (ecmd->autoneg != 0) 324 if (ecmd->autoneg != 0)
325 return -EINVAL; 325 return -EINVAL;
326 326
327 status = be_cmd_set_flow_control(&adapter->ctrl, ecmd->tx_pause, 327 status = be_cmd_set_flow_control(adapter, ecmd->tx_pause,
328 ecmd->rx_pause); 328 ecmd->rx_pause);
329 if (!status) 329 if (!status)
330 dev_warn(&adapter->pdev->dev, "Pause param set failed.\n"); 330 dev_warn(&adapter->pdev->dev, "Pause param set failed.\n");