aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2011-09-06 09:49:12 -0400
committerDavid S. Miller <davem@davemloft.net>2011-09-16 19:25:10 -0400
commit815c7db5c809ea3d5735de3131ecdf758b0e14ff (patch)
tree310304287c1671468cdd7ab006eeab4a725a4dda
parent434495c50ea786b89eca7f7af2bac424658a76ee (diff)
ethtool: Clean up definitions of rule location arrays in RX NFC
Correct the description of ethtool_rxnfc::rule_locs; it is an array of currently used locations, not all possible valid locations. Add note that drivers must not use ethtool_rxnfc::rule_locs. The rule_locs argument to ethtool_ops::get_rxnfc is either NULL or a pointer to an array of u32, so change the parameter type accordingly. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c2
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c2
-rw-r--r--drivers/net/ethernet/freescale/gianfar_ethtool.c4
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c5
-rw-r--r--drivers/net/ethernet/sfc/ethtool.c2
-rw-r--r--drivers/net/ethernet/sun/niu.c4
-rw-r--r--drivers/net/vmxnet3/vmxnet3_ethtool.c2
-rw-r--r--include/linux/ethtool.h7
8 files changed, 14 insertions, 14 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
index 767c22983c1..ce14f11c0de 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
@@ -2241,7 +2241,7 @@ static int bnx2x_set_phys_id(struct net_device *dev,
2241} 2241}
2242 2242
2243static int bnx2x_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info, 2243static int bnx2x_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info,
2244 void *rules __always_unused) 2244 u32 *rules __always_unused)
2245{ 2245{
2246 struct bnx2x *bp = netdev_priv(dev); 2246 struct bnx2x *bp = netdev_priv(dev);
2247 2247
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 90b4921cac9..40b395f932c 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -1902,7 +1902,7 @@ static int set_rss_table(struct net_device *dev,
1902} 1902}
1903 1903
1904static int get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info, 1904static int get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info,
1905 void *rules) 1905 u32 *rules)
1906{ 1906{
1907 const struct port_info *pi = netdev_priv(dev); 1907 const struct port_info *pi = netdev_priv(dev);
1908 1908
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c
index 25a8c2adb00..42238301c42 100644
--- a/drivers/net/ethernet/freescale/gianfar_ethtool.c
+++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c
@@ -1712,7 +1712,7 @@ static int gfar_set_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
1712} 1712}
1713 1713
1714static int gfar_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd, 1714static int gfar_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
1715 void *rule_locs) 1715 u32 *rule_locs)
1716{ 1716{
1717 struct gfar_private *priv = netdev_priv(dev); 1717 struct gfar_private *priv = netdev_priv(dev);
1718 int ret = 0; 1718 int ret = 0;
@@ -1728,7 +1728,7 @@ static int gfar_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
1728 ret = gfar_get_cls(priv, cmd); 1728 ret = gfar_get_cls(priv, cmd);
1729 break; 1729 break;
1730 case ETHTOOL_GRXCLSRLALL: 1730 case ETHTOOL_GRXCLSRLALL:
1731 ret = gfar_get_cls_all(priv, cmd, (u32 *) rule_locs); 1731 ret = gfar_get_cls_all(priv, cmd, rule_locs);
1732 break; 1732 break;
1733 default: 1733 default:
1734 ret = -EINVAL; 1734 ret = -EINVAL;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index 11e1d5cd40b..c0003babc06 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -2287,7 +2287,7 @@ static int ixgbe_get_ethtool_fdir_all(struct ixgbe_adapter *adapter,
2287} 2287}
2288 2288
2289static int ixgbe_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, 2289static int ixgbe_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
2290 void *rule_locs) 2290 u32 *rule_locs)
2291{ 2291{
2292 struct ixgbe_adapter *adapter = netdev_priv(dev); 2292 struct ixgbe_adapter *adapter = netdev_priv(dev);
2293 int ret = -EOPNOTSUPP; 2293 int ret = -EOPNOTSUPP;
@@ -2305,8 +2305,7 @@ static int ixgbe_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
2305 ret = ixgbe_get_ethtool_fdir_entry(adapter, cmd); 2305 ret = ixgbe_get_ethtool_fdir_entry(adapter, cmd);
2306 break; 2306 break;
2307 case ETHTOOL_GRXCLSRLALL: 2307 case ETHTOOL_GRXCLSRLALL:
2308 ret = ixgbe_get_ethtool_fdir_all(adapter, cmd, 2308 ret = ixgbe_get_ethtool_fdir_all(adapter, cmd, rule_locs);
2309 (u32 *)rule_locs);
2310 break; 2309 break;
2311 default: 2310 default:
2312 break; 2311 break;
diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c
index 93f1fb99432..9536925f5bd 100644
--- a/drivers/net/ethernet/sfc/ethtool.c
+++ b/drivers/net/ethernet/sfc/ethtool.c
@@ -824,7 +824,7 @@ static int efx_ethtool_reset(struct net_device *net_dev, u32 *flags)
824 824
825static int 825static int
826efx_ethtool_get_rxnfc(struct net_device *net_dev, 826efx_ethtool_get_rxnfc(struct net_device *net_dev,
827 struct ethtool_rxnfc *info, void *rules __always_unused) 827 struct ethtool_rxnfc *info, u32 *rules __always_unused)
828{ 828{
829 struct efx_nic *efx = netdev_priv(net_dev); 829 struct efx_nic *efx = netdev_priv(net_dev);
830 830
diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
index cad58f26c47..5e1e1d2748a 100644
--- a/drivers/net/ethernet/sun/niu.c
+++ b/drivers/net/ethernet/sun/niu.c
@@ -7303,7 +7303,7 @@ static int niu_get_ethtool_tcam_all(struct niu *np,
7303} 7303}
7304 7304
7305static int niu_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd, 7305static int niu_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
7306 void *rule_locs) 7306 u32 *rule_locs)
7307{ 7307{
7308 struct niu *np = netdev_priv(dev); 7308 struct niu *np = netdev_priv(dev);
7309 int ret = 0; 7309 int ret = 0;
@@ -7322,7 +7322,7 @@ static int niu_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
7322 ret = niu_get_ethtool_tcam_entry(np, cmd); 7322 ret = niu_get_ethtool_tcam_entry(np, cmd);
7323 break; 7323 break;
7324 case ETHTOOL_GRXCLSRLALL: 7324 case ETHTOOL_GRXCLSRLALL:
7325 ret = niu_get_ethtool_tcam_all(np, cmd, (u32 *)rule_locs); 7325 ret = niu_get_ethtool_tcam_all(np, cmd, rule_locs);
7326 break; 7326 break;
7327 default: 7327 default:
7328 ret = -EINVAL; 7328 ret = -EINVAL;
diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c
index 27400edeef5..e662cbc8bfb 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethtool.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c
@@ -558,7 +558,7 @@ out:
558 558
559static int 559static int
560vmxnet3_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *info, 560vmxnet3_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *info,
561 void *rules) 561 u32 *rules)
562{ 562{
563 struct vmxnet3_adapter *adapter = netdev_priv(netdev); 563 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
564 switch (info->cmd) { 564 switch (info->cmd) {
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index b5d189367a0..5d4a06accd8 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -479,7 +479,7 @@ struct ethtool_rx_flow_spec {
479 * @data: Command-dependent value 479 * @data: Command-dependent value
480 * @fs: Flow classification rule 480 * @fs: Flow classification rule
481 * @rule_cnt: Number of rules to be affected 481 * @rule_cnt: Number of rules to be affected
482 * @rule_locs: Array of valid rule locations 482 * @rule_locs: Array of used rule locations
483 * 483 *
484 * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating 484 * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating
485 * the fields included in the flow hash, e.g. %RXH_IP_SRC. The following 485 * the fields included in the flow hash, e.g. %RXH_IP_SRC. The following
@@ -497,7 +497,8 @@ struct ethtool_rx_flow_spec {
497 * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the 497 * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the
498 * user buffer for @rule_locs on entry. On return, @data is the size 498 * user buffer for @rule_locs on entry. On return, @data is the size
499 * of the rule table and @rule_locs contains the locations of the 499 * of the rule table and @rule_locs contains the locations of the
500 * defined rules. 500 * defined rules. Drivers must use the second parameter to get_rxnfc()
501 * instead of @rule_locs.
501 * 502 *
502 * For %ETHTOOL_SRXCLSRLINS, @fs specifies the rule to add or update. 503 * For %ETHTOOL_SRXCLSRLINS, @fs specifies the rule to add or update.
503 * @fs.@location specifies the location to use and must not be ignored. 504 * @fs.@location specifies the location to use and must not be ignored.
@@ -939,7 +940,7 @@ struct ethtool_ops {
939 int (*set_priv_flags)(struct net_device *, u32); 940 int (*set_priv_flags)(struct net_device *, u32);
940 int (*get_sset_count)(struct net_device *, int); 941 int (*get_sset_count)(struct net_device *, int);
941 int (*get_rxnfc)(struct net_device *, 942 int (*get_rxnfc)(struct net_device *,
942 struct ethtool_rxnfc *, void *); 943 struct ethtool_rxnfc *, u32 *rule_locs);
943 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); 944 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
944 int (*flash_device)(struct net_device *, struct ethtool_flash *); 945 int (*flash_device)(struct net_device *, struct ethtool_flash *);
945 int (*reset)(struct net_device *, u32 *); 946 int (*reset)(struct net_device *, u32 *);