@@ -207,6 +207,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
{
struct e1000_hw *hw = &adapter->hw;
struct e1000_mac_info *mac = &hw->mac;
+ /* cannot be const, see this function */
struct e1000_mac_operations *func = &mac->ops;
u32 swsm = 0;
u32 swsm2 = 0;
@@ -1692,7 +1693,7 @@ static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw)
er32(ICRXDMTC);
}
-static struct e1000_mac_operations e82571_mac_ops = {
+static const struct e1000_mac_operations e82571_mac_ops = {
/* .check_mng_mode: mac type dependent */
/* .check_for_link: media type dependent */
.id_led_init = e1000e_id_led_init,
@@ -379,7 +379,7 @@ struct e1000_info {
u32 pba;
u32 max_hw_frame_size;
s32 (*get_variants)(struct e1000_adapter *);
- struct e1000_mac_operations *mac_ops;
+ const struct e1000_mac_operations *mac_ops;
struct e1000_phy_operations *phy_ops;
struct e1000_nvm_operations *nvm_ops;
};
@@ -202,6 +202,7 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)
{
struct e1000_hw *hw = &adapter->hw;
struct e1000_mac_info *mac = &hw->mac;
+ /* cannot be const, see this function */
struct e1000_mac_operations *func = &mac->ops;
/* Set media type */
@@ -1369,7 +1370,7 @@ static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw)
er32(ICRXDMTC);
}
-static struct e1000_mac_operations es2_mac_ops = {
+static const struct e1000_mac_operations es2_mac_ops = {
.id_led_init = e1000e_id_led_init,
.check_mng_mode = e1000e_check_mng_mode_generic,
/* check_for_link dependent on media type */
@@ -791,6 +791,7 @@ struct e1000_nvm_operations {
};
struct e1000_mac_info {
+ /* cannot be const, see drivers/net/e1000e/ich8lan.c:e1000_init_mac_params_ich8lan */
struct e1000_mac_operations ops;
u8 addr[6];
@@ -3291,7 +3291,7 @@ static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw)
}
}
-static struct e1000_mac_operations ich8_mac_ops = {
+static const struct e1000_mac_operations ich8_mac_ops = {
.id_led_init = e1000e_id_led_init,
.check_mng_mode = e1000_check_mng_mode_ich8lan,
.check_for_link = e1000_check_for_copper_link_ich8lan,
@@ -1585,7 +1585,7 @@ u16 igb_rxpbs_adjust_82580(u32 data)
return ret_val;
}
-static struct e1000_mac_operations e1000_mac_ops_82575 = {
+static const struct e1000_mac_operations e1000_mac_ops_82575 = {
.init_hw = igb_init_hw_82575,
.check_for_link = igb_check_for_link_82575,
.rar_set = igb_rar_set,
@@ -324,7 +324,7 @@ struct e1000_nvm_operations {
struct e1000_info {
s32 (*get_invariants)(struct e1000_hw *);
- struct e1000_mac_operations *mac_ops;
+ const struct e1000_mac_operations *mac_ops;
struct e1000_phy_operations *phy_ops;
struct e1000_nvm_operations *nvm_ops;
};
@@ -332,6 +332,7 @@ struct e1000_info {
extern const struct e1000_info e1000_82575_info;
struct e1000_mac_info {
+ /* cannot be const, see drivers/net/igb/e1000_82575.c:igb_get_invariants_82575 */
struct e1000_mac_operations ops;
u8 addr[6];
@@ -189,6 +189,7 @@ struct e1000_mac_operations {
};
struct e1000_mac_info {
+ /* cannot be const, see drivers/net/igbvf/vf.c:e1000_init_mac_params_vf */
struct e1000_mac_operations ops;
u8 addr[6];
u8 perm_addr[6];