diff options
author | Greg Rose <gregory.v.rose@intel.com> | 2012-11-02 01:50:47 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2012-11-15 09:02:20 -0500 |
commit | 92fe0bf7d0169a8a077e76e387d939d974ee3745 (patch) | |
tree | d843239cbd182aff9c453fe9c87799bd3b49fde8 /drivers | |
parent | 7af335cc1491fc24633b6b8d0f249393bb977c75 (diff) |
ixgbevf: Remove checking for mac.ops function pointers
The function pointers will always be set - there is no good reason to
check them. Also just remove get_bus_info() call as the VF has no bus
info to report.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 56 |
1 files changed, 18 insertions, 38 deletions
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index a00168442968..8b8a685df849 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | |||
@@ -1150,9 +1150,6 @@ static int ixgbevf_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | |||
1150 | struct ixgbe_hw *hw = &adapter->hw; | 1150 | struct ixgbe_hw *hw = &adapter->hw; |
1151 | int err; | 1151 | int err; |
1152 | 1152 | ||
1153 | if (!hw->mac.ops.set_vfta) | ||
1154 | return -EOPNOTSUPP; | ||
1155 | |||
1156 | spin_lock_bh(&adapter->mbx_lock); | 1153 | spin_lock_bh(&adapter->mbx_lock); |
1157 | 1154 | ||
1158 | /* add VID to filter table */ | 1155 | /* add VID to filter table */ |
@@ -1181,8 +1178,7 @@ static int ixgbevf_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | |||
1181 | spin_lock_bh(&adapter->mbx_lock); | 1178 | spin_lock_bh(&adapter->mbx_lock); |
1182 | 1179 | ||
1183 | /* remove VID from filter table */ | 1180 | /* remove VID from filter table */ |
1184 | if (hw->mac.ops.set_vfta) | 1181 | err = hw->mac.ops.set_vfta(hw, vid, 0, false); |
1185 | err = hw->mac.ops.set_vfta(hw, vid, 0, false); | ||
1186 | 1182 | ||
1187 | spin_unlock_bh(&adapter->mbx_lock); | 1183 | spin_unlock_bh(&adapter->mbx_lock); |
1188 | 1184 | ||
@@ -1243,8 +1239,7 @@ static void ixgbevf_set_rx_mode(struct net_device *netdev) | |||
1243 | spin_lock_bh(&adapter->mbx_lock); | 1239 | spin_lock_bh(&adapter->mbx_lock); |
1244 | 1240 | ||
1245 | /* reprogram multicast list */ | 1241 | /* reprogram multicast list */ |
1246 | if (hw->mac.ops.update_mc_addr_list) | 1242 | hw->mac.ops.update_mc_addr_list(hw, netdev); |
1247 | hw->mac.ops.update_mc_addr_list(hw, netdev); | ||
1248 | 1243 | ||
1249 | ixgbevf_write_uc_addr_list(netdev); | 1244 | ixgbevf_write_uc_addr_list(netdev); |
1250 | 1245 | ||
@@ -1414,12 +1409,10 @@ static void ixgbevf_up_complete(struct ixgbevf_adapter *adapter) | |||
1414 | 1409 | ||
1415 | spin_lock_bh(&adapter->mbx_lock); | 1410 | spin_lock_bh(&adapter->mbx_lock); |
1416 | 1411 | ||
1417 | if (hw->mac.ops.set_rar) { | 1412 | if (is_valid_ether_addr(hw->mac.addr)) |
1418 | if (is_valid_ether_addr(hw->mac.addr)) | 1413 | hw->mac.ops.set_rar(hw, 0, hw->mac.addr, 0); |
1419 | hw->mac.ops.set_rar(hw, 0, hw->mac.addr, 0); | 1414 | else |
1420 | else | 1415 | hw->mac.ops.set_rar(hw, 0, hw->mac.perm_addr, 0); |
1421 | hw->mac.ops.set_rar(hw, 0, hw->mac.perm_addr, 0); | ||
1422 | } | ||
1423 | 1416 | ||
1424 | spin_unlock_bh(&adapter->mbx_lock); | 1417 | spin_unlock_bh(&adapter->mbx_lock); |
1425 | 1418 | ||
@@ -2201,6 +2194,7 @@ static void ixgbevf_watchdog_task(struct work_struct *work) | |||
2201 | struct ixgbe_hw *hw = &adapter->hw; | 2194 | struct ixgbe_hw *hw = &adapter->hw; |
2202 | u32 link_speed = adapter->link_speed; | 2195 | u32 link_speed = adapter->link_speed; |
2203 | bool link_up = adapter->link_up; | 2196 | bool link_up = adapter->link_up; |
2197 | s32 need_reset; | ||
2204 | 2198 | ||
2205 | adapter->flags |= IXGBE_FLAG_IN_WATCHDOG_TASK; | 2199 | adapter->flags |= IXGBE_FLAG_IN_WATCHDOG_TASK; |
2206 | 2200 | ||
@@ -2208,29 +2202,20 @@ static void ixgbevf_watchdog_task(struct work_struct *work) | |||
2208 | * Always check the link on the watchdog because we have | 2202 | * Always check the link on the watchdog because we have |
2209 | * no LSC interrupt | 2203 | * no LSC interrupt |
2210 | */ | 2204 | */ |
2211 | if (hw->mac.ops.check_link) { | ||
2212 | s32 need_reset; | ||
2213 | 2205 | ||
2214 | spin_lock_bh(&adapter->mbx_lock); | 2206 | spin_lock_bh(&adapter->mbx_lock); |
2215 | 2207 | ||
2216 | need_reset = hw->mac.ops.check_link(hw, &link_speed, | 2208 | need_reset = hw->mac.ops.check_link(hw, &link_speed, &link_up, false); |
2217 | &link_up, false); | ||
2218 | 2209 | ||
2219 | spin_unlock_bh(&adapter->mbx_lock); | 2210 | spin_unlock_bh(&adapter->mbx_lock); |
2220 | 2211 | ||
2221 | if (need_reset) { | 2212 | if (need_reset) { |
2222 | adapter->link_up = link_up; | 2213 | adapter->link_up = link_up; |
2223 | adapter->link_speed = link_speed; | 2214 | adapter->link_speed = link_speed; |
2224 | netif_carrier_off(netdev); | 2215 | netif_carrier_off(netdev); |
2225 | netif_tx_stop_all_queues(netdev); | 2216 | netif_tx_stop_all_queues(netdev); |
2226 | schedule_work(&adapter->reset_task); | 2217 | schedule_work(&adapter->reset_task); |
2227 | goto pf_has_reset; | 2218 | goto pf_has_reset; |
2228 | } | ||
2229 | } else { | ||
2230 | /* always assume link is up, if no check link | ||
2231 | * function */ | ||
2232 | link_speed = IXGBE_LINK_SPEED_10GB_FULL; | ||
2233 | link_up = true; | ||
2234 | } | 2219 | } |
2235 | adapter->link_up = link_up; | 2220 | adapter->link_up = link_up; |
2236 | adapter->link_speed = link_speed; | 2221 | adapter->link_speed = link_speed; |
@@ -3070,8 +3055,7 @@ static int ixgbevf_set_mac(struct net_device *netdev, void *p) | |||
3070 | 3055 | ||
3071 | spin_lock_bh(&adapter->mbx_lock); | 3056 | spin_lock_bh(&adapter->mbx_lock); |
3072 | 3057 | ||
3073 | if (hw->mac.ops.set_rar) | 3058 | hw->mac.ops.set_rar(hw, 0, hw->mac.addr, 0); |
3074 | hw->mac.ops.set_rar(hw, 0, hw->mac.addr, 0); | ||
3075 | 3059 | ||
3076 | spin_unlock_bh(&adapter->mbx_lock); | 3060 | spin_unlock_bh(&adapter->mbx_lock); |
3077 | 3061 | ||
@@ -3396,10 +3380,6 @@ static int __devinit ixgbevf_probe(struct pci_dev *pdev, | |||
3396 | if (err) | 3380 | if (err) |
3397 | goto err_sw_init; | 3381 | goto err_sw_init; |
3398 | 3382 | ||
3399 | /* pick up the PCI bus settings for reporting later */ | ||
3400 | if (hw->mac.ops.get_bus_info) | ||
3401 | hw->mac.ops.get_bus_info(hw); | ||
3402 | |||
3403 | strcpy(netdev->name, "eth%d"); | 3383 | strcpy(netdev->name, "eth%d"); |
3404 | 3384 | ||
3405 | err = register_netdev(netdev); | 3385 | err = register_netdev(netdev); |