aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tokenring
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/tokenring')
-rw-r--r--drivers/net/tokenring/3c359.c4
-rw-r--r--drivers/net/tokenring/Kconfig5
-rw-r--r--drivers/net/tokenring/madgemc.c1
-rw-r--r--drivers/net/tokenring/tms380tr.c179
4 files changed, 71 insertions, 118 deletions
diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c
index ef9fdf3652f6..d7c292aa76b1 100644
--- a/drivers/net/tokenring/3c359.c
+++ b/drivers/net/tokenring/3c359.c
@@ -674,15 +674,11 @@ static int xl_open(struct net_device *dev)
674 /* These MUST be on 8 byte boundaries */ 674 /* These MUST be on 8 byte boundaries */
675 xl_priv->xl_tx_ring = kzalloc((sizeof(struct xl_tx_desc) * XL_TX_RING_SIZE) + 7, GFP_DMA | GFP_KERNEL); 675 xl_priv->xl_tx_ring = kzalloc((sizeof(struct xl_tx_desc) * XL_TX_RING_SIZE) + 7, GFP_DMA | GFP_KERNEL);
676 if (xl_priv->xl_tx_ring == NULL) { 676 if (xl_priv->xl_tx_ring == NULL) {
677 printk(KERN_WARNING "%s: Not enough memory to allocate tx buffers.\n",
678 dev->name);
679 free_irq(dev->irq,dev); 677 free_irq(dev->irq,dev);
680 return -ENOMEM; 678 return -ENOMEM;
681 } 679 }
682 xl_priv->xl_rx_ring = kzalloc((sizeof(struct xl_rx_desc) * XL_RX_RING_SIZE) +7, GFP_DMA | GFP_KERNEL); 680 xl_priv->xl_rx_ring = kzalloc((sizeof(struct xl_rx_desc) * XL_RX_RING_SIZE) +7, GFP_DMA | GFP_KERNEL);
683 if (xl_priv->xl_rx_ring == NULL) { 681 if (xl_priv->xl_rx_ring == NULL) {
684 printk(KERN_WARNING "%s: Not enough memory to allocate rx buffers.\n",
685 dev->name);
686 free_irq(dev->irq,dev); 682 free_irq(dev->irq,dev);
687 kfree(xl_priv->xl_tx_ring); 683 kfree(xl_priv->xl_tx_ring);
688 return -ENOMEM; 684 return -ENOMEM;
diff --git a/drivers/net/tokenring/Kconfig b/drivers/net/tokenring/Kconfig
index c7e0149d1514..45550d42b368 100644
--- a/drivers/net/tokenring/Kconfig
+++ b/drivers/net/tokenring/Kconfig
@@ -7,7 +7,6 @@ menuconfig TR
7 bool "Token Ring driver support" 7 bool "Token Ring driver support"
8 depends on NETDEVICES && !UML 8 depends on NETDEVICES && !UML
9 depends on (PCI || ISA || MCA || CCW || PCMCIA) 9 depends on (PCI || ISA || MCA || CCW || PCMCIA)
10 select LLC
11 help 10 help
12 Token Ring is IBM's way of communication on a local network; the 11 Token Ring is IBM's way of communication on a local network; the
13 rest of the world uses Ethernet. To participate on a Token Ring 12 rest of the world uses Ethernet. To participate on a Token Ring
@@ -20,6 +19,10 @@ menuconfig TR
20 19
21if TR 20if TR
22 21
22config WANT_LLC
23 def_bool y
24 select LLC
25
23config PCMCIA_IBMTR 26config PCMCIA_IBMTR
24 tristate "IBM PCMCIA tokenring adapter support" 27 tristate "IBM PCMCIA tokenring adapter support"
25 depends on IBMTR!=y && PCMCIA 28 depends on IBMTR!=y && PCMCIA
diff --git a/drivers/net/tokenring/madgemc.c b/drivers/net/tokenring/madgemc.c
index 6153cfd696b6..1cdc034f6aec 100644
--- a/drivers/net/tokenring/madgemc.c
+++ b/drivers/net/tokenring/madgemc.c
@@ -171,7 +171,6 @@ static int __devinit madgemc_probe(struct device *device)
171 171
172 card = kmalloc(sizeof(struct card_info), GFP_KERNEL); 172 card = kmalloc(sizeof(struct card_info), GFP_KERNEL);
173 if (card==NULL) { 173 if (card==NULL) {
174 printk("madgemc: unable to allocate card struct\n");
175 ret = -ENOMEM; 174 ret = -ENOMEM;
176 goto getout1; 175 goto getout1;
177 } 176 }
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c
index 65e9cf3a71fe..102f896bbc58 100644
--- a/drivers/net/tokenring/tms380tr.c
+++ b/drivers/net/tokenring/tms380tr.c
@@ -1525,10 +1525,8 @@ static void tms380tr_chk_outstanding_cmds(struct net_device *dev)
1525 /* Check if adapter is opened, avoiding COMMAND_REJECT 1525 /* Check if adapter is opened, avoiding COMMAND_REJECT
1526 * interrupt by the adapter! 1526 * interrupt by the adapter!
1527 */ 1527 */
1528 if(tp->AdapterOpenFlag == 0) 1528 if (tp->AdapterOpenFlag == 0) {
1529 { 1529 if (tp->CMDqueue & OC_OPEN) {
1530 if(tp->CMDqueue & OC_OPEN)
1531 {
1532 /* Execute OPEN command */ 1530 /* Execute OPEN command */
1533 tp->CMDqueue ^= OC_OPEN; 1531 tp->CMDqueue ^= OC_OPEN;
1534 1532
@@ -1536,21 +1534,17 @@ static void tms380tr_chk_outstanding_cmds(struct net_device *dev)
1536 tp->scb.Parm[0] = LOWORD(Addr); 1534 tp->scb.Parm[0] = LOWORD(Addr);
1537 tp->scb.Parm[1] = HIWORD(Addr); 1535 tp->scb.Parm[1] = HIWORD(Addr);
1538 tp->scb.CMD = OPEN; 1536 tp->scb.CMD = OPEN;
1539 } 1537 } else
1540 else
1541 /* No OPEN command queued, but adapter closed. Note: 1538 /* No OPEN command queued, but adapter closed. Note:
1542 * We'll try to re-open the adapter in DriverPoll() 1539 * We'll try to re-open the adapter in DriverPoll()
1543 */ 1540 */
1544 return; /* No adapter command issued */ 1541 return; /* No adapter command issued */
1545 } 1542 } else {
1546 else
1547 {
1548 /* Adapter is open; evaluate command queue: try to execute 1543 /* Adapter is open; evaluate command queue: try to execute
1549 * outstanding commands (depending on priority!) CLOSE 1544 * outstanding commands (depending on priority!) CLOSE
1550 * command queued 1545 * command queued
1551 */ 1546 */
1552 if(tp->CMDqueue & OC_CLOSE) 1547 if (tp->CMDqueue & OC_CLOSE) {
1553 {
1554 tp->CMDqueue ^= OC_CLOSE; 1548 tp->CMDqueue ^= OC_CLOSE;
1555 tp->AdapterOpenFlag = 0; 1549 tp->AdapterOpenFlag = 0;
1556 tp->scb.Parm[0] = 0; /* Parm[0], Parm[1] are ignored */ 1550 tp->scb.Parm[0] = 0; /* Parm[0], Parm[1] are ignored */
@@ -1560,109 +1554,70 @@ static void tms380tr_chk_outstanding_cmds(struct net_device *dev)
1560 tp->CMDqueue |= OC_OPEN; /* re-open adapter */ 1554 tp->CMDqueue |= OC_OPEN; /* re-open adapter */
1561 else 1555 else
1562 tp->CMDqueue = 0; /* no more commands */ 1556 tp->CMDqueue = 0; /* no more commands */
1563 } 1557 } else if (tp->CMDqueue & OC_RECEIVE) {
1564 else 1558 tp->CMDqueue ^= OC_RECEIVE;
1565 { 1559 Addr = htonl(((char *)tp->RplHead - (char *)tp) + tp->dmabuffer);
1566 if(tp->CMDqueue & OC_RECEIVE) 1560 tp->scb.Parm[0] = LOWORD(Addr);
1567 { 1561 tp->scb.Parm[1] = HIWORD(Addr);
1568 tp->CMDqueue ^= OC_RECEIVE; 1562 tp->scb.CMD = RECEIVE;
1569 Addr = htonl(((char *)tp->RplHead - (char *)tp) + tp->dmabuffer); 1563 } else if (tp->CMDqueue & OC_TRANSMIT_HALT) {
1570 tp->scb.Parm[0] = LOWORD(Addr); 1564 /* NOTE: TRANSMIT.HALT must be checked
1571 tp->scb.Parm[1] = HIWORD(Addr); 1565 * before TRANSMIT.
1572 tp->scb.CMD = RECEIVE; 1566 */
1573 } 1567 tp->CMDqueue ^= OC_TRANSMIT_HALT;
1574 else 1568 tp->scb.CMD = TRANSMIT_HALT;
1575 { 1569
1576 if(tp->CMDqueue & OC_TRANSMIT_HALT) 1570 /* Parm[0] and Parm[1] are ignored
1577 { 1571 * but should be set to zero!
1578 /* NOTE: TRANSMIT.HALT must be checked 1572 */
1579 * before TRANSMIT. 1573 tp->scb.Parm[0] = 0;
1580 */ 1574 tp->scb.Parm[1] = 0;
1581 tp->CMDqueue ^= OC_TRANSMIT_HALT; 1575 } else if (tp->CMDqueue & OC_TRANSMIT) {
1582 tp->scb.CMD = TRANSMIT_HALT; 1576 /* NOTE: TRANSMIT must be
1583 1577 * checked after TRANSMIT.HALT
1584 /* Parm[0] and Parm[1] are ignored 1578 */
1585 * but should be set to zero! 1579 if (tp->TransmitCommandActive) {
1586 */ 1580 if (!tp->TransmitHaltScheduled) {
1587 tp->scb.Parm[0] = 0; 1581 tp->TransmitHaltScheduled = 1;
1588 tp->scb.Parm[1] = 0; 1582 tms380tr_exec_cmd(dev, OC_TRANSMIT_HALT);
1589 }
1590 else
1591 {
1592 if(tp->CMDqueue & OC_TRANSMIT)
1593 {
1594 /* NOTE: TRANSMIT must be
1595 * checked after TRANSMIT.HALT
1596 */
1597 if(tp->TransmitCommandActive)
1598 {
1599 if(!tp->TransmitHaltScheduled)
1600 {
1601 tp->TransmitHaltScheduled = 1;
1602 tms380tr_exec_cmd(dev, OC_TRANSMIT_HALT) ;
1603 }
1604 tp->TransmitCommandActive = 0;
1605 return;
1606 }
1607
1608 tp->CMDqueue ^= OC_TRANSMIT;
1609 tms380tr_cancel_tx_queue(tp);
1610 Addr = htonl(((char *)tp->TplBusy - (char *)tp) + tp->dmabuffer);
1611 tp->scb.Parm[0] = LOWORD(Addr);
1612 tp->scb.Parm[1] = HIWORD(Addr);
1613 tp->scb.CMD = TRANSMIT;
1614 tp->TransmitCommandActive = 1;
1615 }
1616 else
1617 {
1618 if(tp->CMDqueue & OC_MODIFY_OPEN_PARMS)
1619 {
1620 tp->CMDqueue ^= OC_MODIFY_OPEN_PARMS;
1621 tp->scb.Parm[0] = tp->ocpl.OPENOptions; /* new OPEN options*/
1622 tp->scb.Parm[0] |= ENABLE_FULL_DUPLEX_SELECTION;
1623 tp->scb.Parm[1] = 0; /* is ignored but should be zero */
1624 tp->scb.CMD = MODIFY_OPEN_PARMS;
1625 }
1626 else
1627 {
1628 if(tp->CMDqueue & OC_SET_FUNCT_ADDR)
1629 {
1630 tp->CMDqueue ^= OC_SET_FUNCT_ADDR;
1631 tp->scb.Parm[0] = LOWORD(tp->ocpl.FunctAddr);
1632 tp->scb.Parm[1] = HIWORD(tp->ocpl.FunctAddr);
1633 tp->scb.CMD = SET_FUNCT_ADDR;
1634 }
1635 else
1636 {
1637 if(tp->CMDqueue & OC_SET_GROUP_ADDR)
1638 {
1639 tp->CMDqueue ^= OC_SET_GROUP_ADDR;
1640 tp->scb.Parm[0] = LOWORD(tp->ocpl.GroupAddr);
1641 tp->scb.Parm[1] = HIWORD(tp->ocpl.GroupAddr);
1642 tp->scb.CMD = SET_GROUP_ADDR;
1643 }
1644 else
1645 {
1646 if(tp->CMDqueue & OC_READ_ERROR_LOG)
1647 {
1648 tp->CMDqueue ^= OC_READ_ERROR_LOG;
1649 Addr = htonl(((char *)&tp->errorlogtable - (char *)tp) + tp->dmabuffer);
1650 tp->scb.Parm[0] = LOWORD(Addr);
1651 tp->scb.Parm[1] = HIWORD(Addr);
1652 tp->scb.CMD = READ_ERROR_LOG;
1653 }
1654 else
1655 {
1656 printk(KERN_WARNING "CheckForOutstandingCommand: unknown Command\n");
1657 tp->CMDqueue = 0;
1658 return;
1659 }
1660 }
1661 }
1662 }
1663 }
1664 } 1583 }
1584 tp->TransmitCommandActive = 0;
1585 return;
1665 } 1586 }
1587
1588 tp->CMDqueue ^= OC_TRANSMIT;
1589 tms380tr_cancel_tx_queue(tp);
1590 Addr = htonl(((char *)tp->TplBusy - (char *)tp) + tp->dmabuffer);
1591 tp->scb.Parm[0] = LOWORD(Addr);
1592 tp->scb.Parm[1] = HIWORD(Addr);
1593 tp->scb.CMD = TRANSMIT;
1594 tp->TransmitCommandActive = 1;
1595 } else if (tp->CMDqueue & OC_MODIFY_OPEN_PARMS) {
1596 tp->CMDqueue ^= OC_MODIFY_OPEN_PARMS;
1597 tp->scb.Parm[0] = tp->ocpl.OPENOptions; /* new OPEN options*/
1598 tp->scb.Parm[0] |= ENABLE_FULL_DUPLEX_SELECTION;
1599 tp->scb.Parm[1] = 0; /* is ignored but should be zero */
1600 tp->scb.CMD = MODIFY_OPEN_PARMS;
1601 } else if (tp->CMDqueue & OC_SET_FUNCT_ADDR) {
1602 tp->CMDqueue ^= OC_SET_FUNCT_ADDR;
1603 tp->scb.Parm[0] = LOWORD(tp->ocpl.FunctAddr);
1604 tp->scb.Parm[1] = HIWORD(tp->ocpl.FunctAddr);
1605 tp->scb.CMD = SET_FUNCT_ADDR;
1606 } else if (tp->CMDqueue & OC_SET_GROUP_ADDR) {
1607 tp->CMDqueue ^= OC_SET_GROUP_ADDR;
1608 tp->scb.Parm[0] = LOWORD(tp->ocpl.GroupAddr);
1609 tp->scb.Parm[1] = HIWORD(tp->ocpl.GroupAddr);
1610 tp->scb.CMD = SET_GROUP_ADDR;
1611 } else if (tp->CMDqueue & OC_READ_ERROR_LOG) {
1612 tp->CMDqueue ^= OC_READ_ERROR_LOG;
1613 Addr = htonl(((char *)&tp->errorlogtable - (char *)tp) + tp->dmabuffer);
1614 tp->scb.Parm[0] = LOWORD(Addr);
1615 tp->scb.Parm[1] = HIWORD(Addr);
1616 tp->scb.CMD = READ_ERROR_LOG;
1617 } else {
1618 printk(KERN_WARNING "CheckForOutstandingCommand: unknown Command\n");
1619 tp->CMDqueue = 0;
1620 return;
1666 } 1621 }
1667 } 1622 }
1668 1623