diff options
Diffstat (limited to 'drivers/char/isicom.c')
-rw-r--r-- | drivers/char/isicom.c | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c index c837ade1e80b..42171ad001dd 100644 --- a/drivers/char/isicom.c +++ b/drivers/char/isicom.c | |||
@@ -1510,7 +1510,7 @@ static int __devinit reset_card(struct pci_dev *pdev, | |||
1510 | { | 1510 | { |
1511 | struct isi_board *board = pci_get_drvdata(pdev); | 1511 | struct isi_board *board = pci_get_drvdata(pdev); |
1512 | unsigned long base = board->base; | 1512 | unsigned long base = board->base; |
1513 | unsigned int portcount = 0; | 1513 | unsigned int sig, portcount = 0; |
1514 | int retval = 0; | 1514 | int retval = 0; |
1515 | 1515 | ||
1516 | dev_dbg(&pdev->dev, "ISILoad:Resetting Card%d at 0x%lx\n", card + 1, | 1516 | dev_dbg(&pdev->dev, "ISILoad:Resetting Card%d at 0x%lx\n", card + 1, |
@@ -1518,27 +1518,35 @@ static int __devinit reset_card(struct pci_dev *pdev, | |||
1518 | 1518 | ||
1519 | inw(base + 0x8); | 1519 | inw(base + 0x8); |
1520 | 1520 | ||
1521 | mdelay(10); | 1521 | msleep(10); |
1522 | 1522 | ||
1523 | outw(0, base + 0x8); /* Reset */ | 1523 | outw(0, base + 0x8); /* Reset */ |
1524 | 1524 | ||
1525 | msleep(3000); | 1525 | msleep(1000); |
1526 | 1526 | ||
1527 | *signature = inw(base + 0x4) & 0xff; | 1527 | sig = inw(base + 0x4) & 0xff; |
1528 | |||
1529 | if (sig != 0xa5 && sig != 0xbb && sig != 0xcc && sig != 0xdd && | ||
1530 | sig != 0xee) { | ||
1531 | dev_warn(&pdev->dev, "ISILoad:Card%u reset failure (Possible " | ||
1532 | "bad I/O Port Address 0x%lx).\n", card + 1, base); | ||
1533 | dev_dbg(&pdev->dev, "Sig=0x%x\n", sig); | ||
1534 | retval = -EIO; | ||
1535 | goto end; | ||
1536 | } | ||
1537 | |||
1538 | msleep(10); | ||
1528 | 1539 | ||
1529 | portcount = inw(base + 0x2); | 1540 | portcount = inw(base + 0x2); |
1530 | if (!(inw(base + 0xe) & 0x1) || ((portcount != 0) && | 1541 | if (!inw(base + 0xe) & 0x1 || (portcount != 0 && portcount != 4 && |
1531 | (portcount != 4) && (portcount != 8))) { | 1542 | portcount != 8 && portcount != 16)) { |
1532 | dev_dbg(&pdev->dev, "base+0x2=0x%lx, base+0xe=0x%lx\n", | 1543 | dev_err(&pdev->dev, "ISILoad:PCI Card%d reset failure.", |
1533 | inw(base + 0x2), inw(base + 0xe)); | 1544 | card + 1); |
1534 | dev_err(&pdev->dev, "ISILoad:PCI Card%d reset failure " | ||
1535 | "(Possible bad I/O Port Address 0x%lx).\n", | ||
1536 | card + 1, base); | ||
1537 | retval = -EIO; | 1545 | retval = -EIO; |
1538 | goto end; | 1546 | goto end; |
1539 | } | 1547 | } |
1540 | 1548 | ||
1541 | switch (*signature) { | 1549 | switch (sig) { |
1542 | case 0xa5: | 1550 | case 0xa5: |
1543 | case 0xbb: | 1551 | case 0xbb: |
1544 | case 0xdd: | 1552 | case 0xdd: |
@@ -1546,16 +1554,13 @@ static int __devinit reset_card(struct pci_dev *pdev, | |||
1546 | board->shift_count = 12; | 1554 | board->shift_count = 12; |
1547 | break; | 1555 | break; |
1548 | case 0xcc: | 1556 | case 0xcc: |
1557 | case 0xee: | ||
1549 | board->port_count = 16; | 1558 | board->port_count = 16; |
1550 | board->shift_count = 11; | 1559 | board->shift_count = 11; |
1551 | break; | 1560 | break; |
1552 | default: | ||
1553 | dev_warn(&pdev->dev, "ISILoad:Card%d reset failure (Possible " | ||
1554 | "bad I/O Port Address 0x%lx).\n", card + 1, base); | ||
1555 | dev_dbg(&pdev->dev, "Sig=0x%lx\n", signature); | ||
1556 | retval = -EIO; | ||
1557 | } | 1561 | } |
1558 | dev_info(&pdev->dev, "-Done\n"); | 1562 | dev_info(&pdev->dev, "-Done\n"); |
1563 | *signature = sig; | ||
1559 | 1564 | ||
1560 | end: | 1565 | end: |
1561 | return retval; | 1566 | return retval; |