Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203448
b: refs/heads/master
c: 344dbf1
h: refs/heads/master
v: v3
  • Loading branch information
Sarveshwar Bandi authored and David S. Miller committed Jul 11, 2010
1 parent d52be55 commit 8bbd721
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1ebed71ae23b0b3c68d2a03e8e1b421efb7f35b0
refs/heads/master: 344dbf1073d1cea179ed0831547cab2b7ea4ea27
12 changes: 11 additions & 1 deletion trunk/drivers/net/benet/be.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,10 @@ struct be_adapter {
u32 vf_if_handle[BE_MAX_VF];
u32 vf_pmac_id[BE_MAX_VF];
u8 base_eq_id;
u8 is_virtfn;
};

#define be_physfn(adapter) (!adapter->pdev->is_virtfn)
#define be_physfn(adapter) (!adapter->is_virtfn)

/* BladeEngine Generation numbers */
#define BE_GEN2 2
Expand Down Expand Up @@ -393,6 +394,15 @@ static inline u8 is_udp_pkt(struct sk_buff *skb)
return val;
}

static inline void be_check_sriov_fn_type(struct be_adapter *adapter)
{
u8 data;

pci_write_config_byte(adapter->pdev, 0xFE, 0xAA);
pci_read_config_byte(adapter->pdev, 0xFE, &data);
adapter->is_virtfn = (data != 0xAA);
}

extern void be_cq_notify(struct be_adapter *adapter, u16 qid, bool arm,
u16 num_popped);
extern void be_link_status_update(struct be_adapter *adapter, bool link_up);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1631,6 +1631,7 @@ static void be_sriov_enable(struct be_adapter *adapter)
{
#ifdef CONFIG_PCI_IOV
int status;
be_check_sriov_fn_type(adapter);
if (be_physfn(adapter) && num_vfs) {
status = pci_enable_sriov(adapter->pdev, num_vfs);
adapter->sriov_enabled = status ? false : true;
Expand Down

0 comments on commit 8bbd721

Please sign in to comment.