Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 58741
b: refs/heads/master
c: f49343a
h: refs/heads/master
i:
  58739: fa65a4b
v: v3
  • Loading branch information
Alan Cox authored and Jeff Garzik committed Jul 10, 2007
1 parent 0a57add commit 7e5f215
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 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: 44e4925e4601961b9bd1982008a55fce865d318c
refs/heads/master: f49343a54864b98333b98706accba66aa75a0c16
41 changes: 24 additions & 17 deletions trunk/drivers/net/ioc3-eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,13 +352,12 @@ static u64 nic_find(struct ioc3 *ioc3, int *last)

static int nic_init(struct ioc3 *ioc3)
{
const char *type;
const char *unknown = "unknown";
const char *type = unknown;
u8 crc;
u8 serial[6];
int save = 0, i;

type = "unknown";

while (1) {
u64 reg;
reg = nic_find(ioc3, &save);
Expand Down Expand Up @@ -392,7 +391,7 @@ static int nic_init(struct ioc3 *ioc3)
}

printk("Found %s NIC", type);
if (type != "unknown") {
if (type != unknown) {
printk (" registration number %02x:%02x:%02x:%02x:%02x:%02x,"
" CRC %02x", serial[0], serial[1], serial[2],
serial[3], serial[4], serial[5], crc);
Expand Down Expand Up @@ -1103,20 +1102,28 @@ static int ioc3_close(struct net_device *dev)
* MiniDINs; all other subdevices are left swinging in the wind, leave
* them disabled.
*/
static inline int ioc3_is_menet(struct pci_dev *pdev)

static int ioc3_adjacent_is_ioc3(struct pci_dev *pdev, int slot)
{
struct pci_dev *dev = pci_get_slot(pdev->bus, PCI_DEVFN(slot, 0));
int ret = 0;

if (dev) {
if (dev->vendor == PCI_VENDOR_ID_SGI &&
dev->device == PCI_DEVICE_ID_SGI_IOC3)
ret = 1;
pci_dev_put(dev);
}

return ret;
}

static int ioc3_is_menet(struct pci_dev *pdev)
{
struct pci_dev *dev;

return pdev->bus->parent == NULL
&& (dev = pci_find_slot(pdev->bus->number, PCI_DEVFN(0, 0)))
&& dev->vendor == PCI_VENDOR_ID_SGI
&& dev->device == PCI_DEVICE_ID_SGI_IOC3
&& (dev = pci_find_slot(pdev->bus->number, PCI_DEVFN(1, 0)))
&& dev->vendor == PCI_VENDOR_ID_SGI
&& dev->device == PCI_DEVICE_ID_SGI_IOC3
&& (dev = pci_find_slot(pdev->bus->number, PCI_DEVFN(2, 0)))
&& dev->vendor == PCI_VENDOR_ID_SGI
&& dev->device == PCI_DEVICE_ID_SGI_IOC3;
return pdev->bus->parent == NULL &&
ioc3_adjacent_is_ioc3(pdev, 0) &&
ioc3_adjacent_is_ioc3(pdev, 1) &&
ioc3_adjacent_is_ioc3(pdev, 2);
}

#ifdef CONFIG_SERIAL_8250
Expand Down

0 comments on commit 7e5f215

Please sign in to comment.