diff options
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbevf/vf.c')
| -rw-r--r-- | drivers/net/ethernet/intel/ixgbevf/vf.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/net/ethernet/intel/ixgbevf/vf.c b/drivers/net/ethernet/intel/ixgbevf/vf.c index 21533e300367..74be7411242a 100644 --- a/drivers/net/ethernet/intel/ixgbevf/vf.c +++ b/drivers/net/ethernet/intel/ixgbevf/vf.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /******************************************************************************* | 1 | /******************************************************************************* |
| 2 | 2 | ||
| 3 | Intel 82599 Virtual Function driver | 3 | Intel 82599 Virtual Function driver |
| 4 | Copyright(c) 1999 - 2010 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
| 5 | 5 | ||
| 6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
| @@ -26,6 +26,7 @@ | |||
| 26 | *******************************************************************************/ | 26 | *******************************************************************************/ |
| 27 | 27 | ||
| 28 | #include "vf.h" | 28 | #include "vf.h" |
| 29 | #include "ixgbevf.h" | ||
| 29 | 30 | ||
| 30 | /** | 31 | /** |
| 31 | * ixgbevf_start_hw_vf - Prepare hardware for Tx/Rx | 32 | * ixgbevf_start_hw_vf - Prepare hardware for Tx/Rx |
| @@ -282,6 +283,17 @@ static s32 ixgbevf_set_rar_vf(struct ixgbe_hw *hw, u32 index, u8 *addr, | |||
| 282 | return ret_val; | 283 | return ret_val; |
| 283 | } | 284 | } |
| 284 | 285 | ||
| 286 | static void ixgbevf_write_msg_read_ack(struct ixgbe_hw *hw, | ||
| 287 | u32 *msg, u16 size) | ||
| 288 | { | ||
| 289 | struct ixgbe_mbx_info *mbx = &hw->mbx; | ||
| 290 | u32 retmsg[IXGBE_VFMAILBOX_SIZE]; | ||
| 291 | s32 retval = mbx->ops.write_posted(hw, msg, size); | ||
| 292 | |||
| 293 | if (!retval) | ||
| 294 | mbx->ops.read_posted(hw, retmsg, size); | ||
| 295 | } | ||
| 296 | |||
| 285 | /** | 297 | /** |
| 286 | * ixgbevf_update_mc_addr_list_vf - Update Multicast addresses | 298 | * ixgbevf_update_mc_addr_list_vf - Update Multicast addresses |
| 287 | * @hw: pointer to the HW structure | 299 | * @hw: pointer to the HW structure |
| @@ -293,7 +305,6 @@ static s32 ixgbevf_update_mc_addr_list_vf(struct ixgbe_hw *hw, | |||
| 293 | struct net_device *netdev) | 305 | struct net_device *netdev) |
| 294 | { | 306 | { |
| 295 | struct netdev_hw_addr *ha; | 307 | struct netdev_hw_addr *ha; |
| 296 | struct ixgbe_mbx_info *mbx = &hw->mbx; | ||
| 297 | u32 msgbuf[IXGBE_VFMAILBOX_SIZE]; | 308 | u32 msgbuf[IXGBE_VFMAILBOX_SIZE]; |
| 298 | u16 *vector_list = (u16 *)&msgbuf[1]; | 309 | u16 *vector_list = (u16 *)&msgbuf[1]; |
| 299 | u32 cnt, i; | 310 | u32 cnt, i; |
| @@ -320,7 +331,7 @@ static s32 ixgbevf_update_mc_addr_list_vf(struct ixgbe_hw *hw, | |||
| 320 | vector_list[i++] = ixgbevf_mta_vector(hw, ha->addr); | 331 | vector_list[i++] = ixgbevf_mta_vector(hw, ha->addr); |
| 321 | } | 332 | } |
| 322 | 333 | ||
| 323 | mbx->ops.write_posted(hw, msgbuf, IXGBE_VFMAILBOX_SIZE); | 334 | ixgbevf_write_msg_read_ack(hw, msgbuf, IXGBE_VFMAILBOX_SIZE); |
| 324 | 335 | ||
| 325 | return 0; | 336 | return 0; |
| 326 | } | 337 | } |
| @@ -335,7 +346,6 @@ static s32 ixgbevf_update_mc_addr_list_vf(struct ixgbe_hw *hw, | |||
| 335 | static s32 ixgbevf_set_vfta_vf(struct ixgbe_hw *hw, u32 vlan, u32 vind, | 346 | static s32 ixgbevf_set_vfta_vf(struct ixgbe_hw *hw, u32 vlan, u32 vind, |
| 336 | bool vlan_on) | 347 | bool vlan_on) |
| 337 | { | 348 | { |
| 338 | struct ixgbe_mbx_info *mbx = &hw->mbx; | ||
| 339 | u32 msgbuf[2]; | 349 | u32 msgbuf[2]; |
| 340 | 350 | ||
| 341 | msgbuf[0] = IXGBE_VF_SET_VLAN; | 351 | msgbuf[0] = IXGBE_VF_SET_VLAN; |
| @@ -343,7 +353,9 @@ static s32 ixgbevf_set_vfta_vf(struct ixgbe_hw *hw, u32 vlan, u32 vind, | |||
| 343 | /* Setting the 8 bit field MSG INFO to TRUE indicates "add" */ | 353 | /* Setting the 8 bit field MSG INFO to TRUE indicates "add" */ |
| 344 | msgbuf[0] |= vlan_on << IXGBE_VT_MSGINFO_SHIFT; | 354 | msgbuf[0] |= vlan_on << IXGBE_VT_MSGINFO_SHIFT; |
| 345 | 355 | ||
| 346 | return mbx->ops.write_posted(hw, msgbuf, 2); | 356 | ixgbevf_write_msg_read_ack(hw, msgbuf, 2); |
| 357 | |||
| 358 | return 0; | ||
| 347 | } | 359 | } |
| 348 | 360 | ||
| 349 | /** | 361 | /** |
| @@ -401,7 +413,7 @@ static s32 ixgbevf_check_mac_link_vf(struct ixgbe_hw *hw, | |||
| 401 | return 0; | 413 | return 0; |
| 402 | } | 414 | } |
| 403 | 415 | ||
| 404 | static struct ixgbe_mac_operations ixgbevf_mac_ops = { | 416 | static const struct ixgbe_mac_operations ixgbevf_mac_ops = { |
| 405 | .init_hw = ixgbevf_init_hw_vf, | 417 | .init_hw = ixgbevf_init_hw_vf, |
| 406 | .reset_hw = ixgbevf_reset_hw_vf, | 418 | .reset_hw = ixgbevf_reset_hw_vf, |
| 407 | .start_hw = ixgbevf_start_hw_vf, | 419 | .start_hw = ixgbevf_start_hw_vf, |
| @@ -415,12 +427,12 @@ static struct ixgbe_mac_operations ixgbevf_mac_ops = { | |||
| 415 | .set_vfta = ixgbevf_set_vfta_vf, | 427 | .set_vfta = ixgbevf_set_vfta_vf, |
| 416 | }; | 428 | }; |
| 417 | 429 | ||
| 418 | struct ixgbevf_info ixgbevf_82599_vf_info = { | 430 | const struct ixgbevf_info ixgbevf_82599_vf_info = { |
| 419 | .mac = ixgbe_mac_82599_vf, | 431 | .mac = ixgbe_mac_82599_vf, |
| 420 | .mac_ops = &ixgbevf_mac_ops, | 432 | .mac_ops = &ixgbevf_mac_ops, |
| 421 | }; | 433 | }; |
| 422 | 434 | ||
| 423 | struct ixgbevf_info ixgbevf_X540_vf_info = { | 435 | const struct ixgbevf_info ixgbevf_X540_vf_info = { |
| 424 | .mac = ixgbe_mac_X540_vf, | 436 | .mac = ixgbe_mac_X540_vf, |
| 425 | .mac_ops = &ixgbevf_mac_ops, | 437 | .mac_ops = &ixgbevf_mac_ops, |
| 426 | }; | 438 | }; |
