diff options
author | Ajit Khaparde <ajit.khaparde@emulex.com> | 2011-04-06 14:08:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-07 18:04:44 -0400 |
commit | b0060586d23968d66325d775651d92ee830c032f (patch) | |
tree | eec9d0ae244be4f66dd1f03e59293b0f10b3eb87 /drivers/net/benet | |
parent | 4b97291429bf59c09a969184a7d2ebde7287e7eb (diff) |
be2net: use common method to check for sriov function type
Lancer and BE can both use SLI_INTF_REG to check a VF or a PF.
Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet')
-rw-r--r-- | drivers/net/benet/be.h | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index ab5be0545e38..7e2040084654 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h | |||
@@ -458,18 +458,10 @@ static inline u8 is_udp_pkt(struct sk_buff *skb) | |||
458 | 458 | ||
459 | static inline void be_check_sriov_fn_type(struct be_adapter *adapter) | 459 | static inline void be_check_sriov_fn_type(struct be_adapter *adapter) |
460 | { | 460 | { |
461 | u8 data; | ||
462 | u32 sli_intf; | 461 | u32 sli_intf; |
463 | 462 | ||
464 | if (lancer_chip(adapter)) { | 463 | pci_read_config_dword(adapter->pdev, SLI_INTF_REG_OFFSET, &sli_intf); |
465 | pci_read_config_dword(adapter->pdev, SLI_INTF_REG_OFFSET, | 464 | adapter->is_virtfn = (sli_intf & SLI_INTF_FT_MASK) ? 1 : 0; |
466 | &sli_intf); | ||
467 | adapter->is_virtfn = (sli_intf & SLI_INTF_FT_MASK) ? 1 : 0; | ||
468 | } else { | ||
469 | pci_write_config_byte(adapter->pdev, 0xFE, 0xAA); | ||
470 | pci_read_config_byte(adapter->pdev, 0xFE, &data); | ||
471 | adapter->is_virtfn = (data != 0xAA); | ||
472 | } | ||
473 | } | 465 | } |
474 | 466 | ||
475 | static inline void be_vf_eth_addr_generate(struct be_adapter *adapter, u8 *mac) | 467 | static inline void be_vf_eth_addr_generate(struct be_adapter *adapter, u8 *mac) |