Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290106
b: refs/heads/master
c: 16c7fa7
h: refs/heads/master
v: v3
  • Loading branch information
Matt Carlson authored and David S. Miller committed Feb 13, 2012
1 parent 79f5ce8 commit da48a47
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 31 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: dbe9b92a602b203174a3227a05e69c019eebf91d
refs/heads/master: 16c7fa7dfe9a304ca6d5bdf39aa4a8d315336a07
58 changes: 28 additions & 30 deletions trunk/drivers/net/ethernet/broadcom/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -13847,8 +13847,6 @@ static void __devinit tg3_read_fw_ver(struct tg3 *tp)
tp->fw_ver[TG3_VER_SIZE - 1] = 0;
}

static struct pci_dev * __devinit tg3_find_peer(struct tg3 *);

static inline u32 tg3_rx_ret_ring_size(struct tg3 *tp)
{
if (tg3_flag(tp, LRG_PROD_RING_CAP))
Expand All @@ -13866,6 +13864,34 @@ static DEFINE_PCI_DEVICE_TABLE(tg3_write_reorder_chipsets) = {
{ },
};

static struct pci_dev * __devinit tg3_find_peer(struct tg3 *tp)
{
struct pci_dev *peer;
unsigned int func, devnr = tp->pdev->devfn & ~7;

for (func = 0; func < 8; func++) {
peer = pci_get_slot(tp->pdev->bus, devnr | func);
if (peer && peer != tp->pdev)
break;
pci_dev_put(peer);
}
/* 5704 can be configured in single-port mode, set peer to
* tp->pdev in that case.
*/
if (!peer) {
peer = tp->pdev;
return peer;
}

/*
* We don't need to keep the refcount elevated; there's no way
* to remove one half of this device without removing the other
*/
pci_dev_put(peer);

return peer;
}

static int __devinit tg3_get_invariants(struct tg3 *tp)
{
u32 misc_ctrl_reg;
Expand Down Expand Up @@ -15364,34 +15390,6 @@ static char * __devinit tg3_bus_string(struct tg3 *tp, char *str)
return str;
}

static struct pci_dev * __devinit tg3_find_peer(struct tg3 *tp)
{
struct pci_dev *peer;
unsigned int func, devnr = tp->pdev->devfn & ~7;

for (func = 0; func < 8; func++) {
peer = pci_get_slot(tp->pdev->bus, devnr | func);
if (peer && peer != tp->pdev)
break;
pci_dev_put(peer);
}
/* 5704 can be configured in single-port mode, set peer to
* tp->pdev in that case.
*/
if (!peer) {
peer = tp->pdev;
return peer;
}

/*
* We don't need to keep the refcount elevated; there's no way
* to remove one half of this device without removing the other
*/
pci_dev_put(peer);

return peer;
}

static void __devinit tg3_init_coal(struct tg3 *tp)
{
struct ethtool_coalesce *ec = &tp->coal;
Expand Down

0 comments on commit da48a47

Please sign in to comment.