aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2012-01-18 17:13:34 -0500
committerDavid S. Miller <davem@davemloft.net>2012-01-19 12:35:07 -0500
commit3d8fe98f8d5cb303d907d8f94ea6dc1f9a1d8b7a (patch)
tree12152a144b19938b17e112a2dc7d6f1ffb9d158c /drivers/net/ethernet/intel
parentb5417bf8e8952401bca69ded67c30ead484af823 (diff)
ixgbevf: make operations tables const
The arrays of function pointers should be const to make life harder for rootkits. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/ixgbevf.h6
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c2
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/vf.c6
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/vf.h2
4 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
index 74b22ee497e7..9075c1d61039 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
@@ -279,12 +279,12 @@ enum ixgbevf_boards {
279 board_X540_vf, 279 board_X540_vf,
280}; 280};
281 281
282extern struct ixgbevf_info ixgbevf_82599_vf_info; 282extern const struct ixgbevf_info ixgbevf_82599_vf_info;
283extern struct ixgbevf_info ixgbevf_X540_vf_info; 283extern const struct ixgbevf_info ixgbevf_X540_vf_info;
284extern const struct ixgbe_mbx_operations ixgbevf_mbx_ops; 284extern const struct ixgbe_mbx_operations ixgbevf_mbx_ops;
285 285
286/* needed by ethtool.c */ 286/* needed by ethtool.c */
287extern char ixgbevf_driver_name[]; 287extern const char ixgbevf_driver_name[];
288extern const char ixgbevf_driver_version[]; 288extern const char ixgbevf_driver_version[];
289 289
290extern int ixgbevf_up(struct ixgbevf_adapter *adapter); 290extern int ixgbevf_up(struct ixgbevf_adapter *adapter);
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 1cad3b6d2c30..bed411bada21 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -53,7 +53,7 @@
53 53
54#include "ixgbevf.h" 54#include "ixgbevf.h"
55 55
56char ixgbevf_driver_name[] = "ixgbevf"; 56const char ixgbevf_driver_name[] = "ixgbevf";
57static const char ixgbevf_driver_string[] = 57static const char ixgbevf_driver_string[] =
58 "Intel(R) 10 Gigabit PCI Express Virtual Function Network Driver"; 58 "Intel(R) 10 Gigabit PCI Express Virtual Function Network Driver";
59 59
diff --git a/drivers/net/ethernet/intel/ixgbevf/vf.c b/drivers/net/ethernet/intel/ixgbevf/vf.c
index 5c8c23f8346f..d0138d7a31a1 100644
--- a/drivers/net/ethernet/intel/ixgbevf/vf.c
+++ b/drivers/net/ethernet/intel/ixgbevf/vf.c
@@ -402,7 +402,7 @@ static s32 ixgbevf_check_mac_link_vf(struct ixgbe_hw *hw,
402 return 0; 402 return 0;
403} 403}
404 404
405static struct ixgbe_mac_operations ixgbevf_mac_ops = { 405static const struct ixgbe_mac_operations ixgbevf_mac_ops = {
406 .init_hw = ixgbevf_init_hw_vf, 406 .init_hw = ixgbevf_init_hw_vf,
407 .reset_hw = ixgbevf_reset_hw_vf, 407 .reset_hw = ixgbevf_reset_hw_vf,
408 .start_hw = ixgbevf_start_hw_vf, 408 .start_hw = ixgbevf_start_hw_vf,
@@ -416,12 +416,12 @@ static struct ixgbe_mac_operations ixgbevf_mac_ops = {
416 .set_vfta = ixgbevf_set_vfta_vf, 416 .set_vfta = ixgbevf_set_vfta_vf,
417}; 417};
418 418
419struct ixgbevf_info ixgbevf_82599_vf_info = { 419const struct ixgbevf_info ixgbevf_82599_vf_info = {
420 .mac = ixgbe_mac_82599_vf, 420 .mac = ixgbe_mac_82599_vf,
421 .mac_ops = &ixgbevf_mac_ops, 421 .mac_ops = &ixgbevf_mac_ops,
422}; 422};
423 423
424struct ixgbevf_info ixgbevf_X540_vf_info = { 424const struct ixgbevf_info ixgbevf_X540_vf_info = {
425 .mac = ixgbe_mac_X540_vf, 425 .mac = ixgbe_mac_X540_vf,
426 .mac_ops = &ixgbevf_mac_ops, 426 .mac_ops = &ixgbevf_mac_ops,
427}; 427};
diff --git a/drivers/net/ethernet/intel/ixgbevf/vf.h b/drivers/net/ethernet/intel/ixgbevf/vf.h
index 10306b492ee6..d556619a9212 100644
--- a/drivers/net/ethernet/intel/ixgbevf/vf.h
+++ b/drivers/net/ethernet/intel/ixgbevf/vf.h
@@ -167,7 +167,7 @@ struct ixgbevf_hw_stats {
167 167
168struct ixgbevf_info { 168struct ixgbevf_info {
169 enum ixgbe_mac_type mac; 169 enum ixgbe_mac_type mac;
170 struct ixgbe_mac_operations *mac_ops; 170 const struct ixgbe_mac_operations *mac_ops;
171}; 171};
172 172
173#endif /* __IXGBE_VF_H__ */ 173#endif /* __IXGBE_VF_H__ */