diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/eepro.c | 50 | ||||
-rw-r--r-- | drivers/net/irda/smsc-ircc2.c | 129 | ||||
-rw-r--r-- | drivers/net/skfp/smt.c | 2 | ||||
-rw-r--r-- | drivers/net/smc91x.h | 12 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/islpci_mgt.c | 2 |
5 files changed, 119 insertions, 76 deletions
diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c index 1ce2c675b8a7..a806dfe54d23 100644 --- a/drivers/net/eepro.c +++ b/drivers/net/eepro.c | |||
@@ -552,8 +552,7 @@ static int __init do_eepro_probe(struct net_device *dev) | |||
552 | { | 552 | { |
553 | unsigned short int WS[32]=WakeupSeq; | 553 | unsigned short int WS[32]=WakeupSeq; |
554 | 554 | ||
555 | if (check_region(WakeupPort, 2)==0) { | 555 | if (request_region(WakeupPort, 2, "eepro wakeup")) { |
556 | |||
557 | if (net_debug>5) | 556 | if (net_debug>5) |
558 | printk(KERN_DEBUG "Waking UP\n"); | 557 | printk(KERN_DEBUG "Waking UP\n"); |
559 | 558 | ||
@@ -563,7 +562,10 @@ static int __init do_eepro_probe(struct net_device *dev) | |||
563 | outb_p(WS[i],WakeupPort); | 562 | outb_p(WS[i],WakeupPort); |
564 | if (net_debug>5) printk(KERN_DEBUG ": %#x ",WS[i]); | 563 | if (net_debug>5) printk(KERN_DEBUG ": %#x ",WS[i]); |
565 | } | 564 | } |
566 | } else printk(KERN_WARNING "Checkregion Failed!\n"); | 565 | |
566 | release_region(WakeupPort, 2); | ||
567 | } else | ||
568 | printk(KERN_WARNING "PnP wakeup region busy!\n"); | ||
567 | } | 569 | } |
568 | #endif | 570 | #endif |
569 | 571 | ||
@@ -705,7 +707,7 @@ static void __init eepro_print_info (struct net_device *dev) | |||
705 | dev->name, (unsigned)dev->base_addr); | 707 | dev->name, (unsigned)dev->base_addr); |
706 | break; | 708 | break; |
707 | case LAN595FX: | 709 | case LAN595FX: |
708 | printk("%s: Intel EtherExpress Pro/10+ ISA\n at %#x,", | 710 | printk("%s: Intel EtherExpress Pro/10+ ISA\n at %#x,", |
709 | dev->name, (unsigned)dev->base_addr); | 711 | dev->name, (unsigned)dev->base_addr); |
710 | break; | 712 | break; |
711 | case LAN595TX: | 713 | case LAN595TX: |
@@ -713,7 +715,7 @@ static void __init eepro_print_info (struct net_device *dev) | |||
713 | dev->name, (unsigned)dev->base_addr); | 715 | dev->name, (unsigned)dev->base_addr); |
714 | break; | 716 | break; |
715 | case LAN595: | 717 | case LAN595: |
716 | printk("%s: Intel 82595-based lan card at %#x,", | 718 | printk("%s: Intel 82595-based lan card at %#x,", |
717 | dev->name, (unsigned)dev->base_addr); | 719 | dev->name, (unsigned)dev->base_addr); |
718 | } | 720 | } |
719 | 721 | ||
@@ -726,7 +728,7 @@ static void __init eepro_print_info (struct net_device *dev) | |||
726 | 728 | ||
727 | if (dev->irq > 2) | 729 | if (dev->irq > 2) |
728 | printk(", IRQ %d, %s.\n", dev->irq, ifmap[dev->if_port]); | 730 | printk(", IRQ %d, %s.\n", dev->irq, ifmap[dev->if_port]); |
729 | else | 731 | else |
730 | printk(", %s.\n", ifmap[dev->if_port]); | 732 | printk(", %s.\n", ifmap[dev->if_port]); |
731 | 733 | ||
732 | if (net_debug > 3) { | 734 | if (net_debug > 3) { |
@@ -756,7 +758,7 @@ static int __init eepro_probe1(struct net_device *dev, int autoprobe) | |||
756 | int err; | 758 | int err; |
757 | 759 | ||
758 | /* Grab the region so we can find another board if autoIRQ fails. */ | 760 | /* Grab the region so we can find another board if autoIRQ fails. */ |
759 | if (!request_region(ioaddr, EEPRO_IO_EXTENT, DRV_NAME)) { | 761 | if (!request_region(ioaddr, EEPRO_IO_EXTENT, DRV_NAME)) { |
760 | if (!autoprobe) | 762 | if (!autoprobe) |
761 | printk(KERN_WARNING "EEPRO: io-port 0x%04x in use \n", | 763 | printk(KERN_WARNING "EEPRO: io-port 0x%04x in use \n", |
762 | ioaddr); | 764 | ioaddr); |
@@ -838,15 +840,15 @@ static int __init eepro_probe1(struct net_device *dev, int autoprobe) | |||
838 | /* Mask off INT number */ | 840 | /* Mask off INT number */ |
839 | int count = lp->word[1] & 7; | 841 | int count = lp->word[1] & 7; |
840 | unsigned irqMask = lp->word[7]; | 842 | unsigned irqMask = lp->word[7]; |
841 | 843 | ||
842 | while (count--) | 844 | while (count--) |
843 | irqMask &= irqMask - 1; | 845 | irqMask &= irqMask - 1; |
844 | 846 | ||
845 | count = ffs(irqMask); | 847 | count = ffs(irqMask); |
846 | 848 | ||
847 | if (count) | 849 | if (count) |
848 | dev->irq = count - 1; | 850 | dev->irq = count - 1; |
849 | 851 | ||
850 | if (dev->irq < 2) { | 852 | if (dev->irq < 2) { |
851 | printk(KERN_ERR " Duh! illegal interrupt vector stored in EEPROM.\n"); | 853 | printk(KERN_ERR " Duh! illegal interrupt vector stored in EEPROM.\n"); |
852 | goto exit; | 854 | goto exit; |
@@ -854,7 +856,7 @@ static int __init eepro_probe1(struct net_device *dev, int autoprobe) | |||
854 | dev->irq = 9; | 856 | dev->irq = 9; |
855 | } | 857 | } |
856 | } | 858 | } |
857 | 859 | ||
858 | dev->open = eepro_open; | 860 | dev->open = eepro_open; |
859 | dev->stop = eepro_close; | 861 | dev->stop = eepro_close; |
860 | dev->hard_start_xmit = eepro_send_packet; | 862 | dev->hard_start_xmit = eepro_send_packet; |
@@ -863,7 +865,7 @@ static int __init eepro_probe1(struct net_device *dev, int autoprobe) | |||
863 | dev->tx_timeout = eepro_tx_timeout; | 865 | dev->tx_timeout = eepro_tx_timeout; |
864 | dev->watchdog_timeo = TX_TIMEOUT; | 866 | dev->watchdog_timeo = TX_TIMEOUT; |
865 | dev->ethtool_ops = &eepro_ethtool_ops; | 867 | dev->ethtool_ops = &eepro_ethtool_ops; |
866 | 868 | ||
867 | /* print boot time info */ | 869 | /* print boot time info */ |
868 | eepro_print_info(dev); | 870 | eepro_print_info(dev); |
869 | 871 | ||
@@ -1047,8 +1049,8 @@ static int eepro_open(struct net_device *dev) | |||
1047 | 1049 | ||
1048 | 1050 | ||
1049 | /* Initialize the RCV and XMT upper and lower limits */ | 1051 | /* Initialize the RCV and XMT upper and lower limits */ |
1050 | outb(lp->rcv_lower_limit >> 8, ioaddr + RCV_LOWER_LIMIT_REG); | 1052 | outb(lp->rcv_lower_limit >> 8, ioaddr + RCV_LOWER_LIMIT_REG); |
1051 | outb(lp->rcv_upper_limit >> 8, ioaddr + RCV_UPPER_LIMIT_REG); | 1053 | outb(lp->rcv_upper_limit >> 8, ioaddr + RCV_UPPER_LIMIT_REG); |
1052 | outb(lp->xmt_lower_limit >> 8, ioaddr + lp->xmt_lower_limit_reg); | 1054 | outb(lp->xmt_lower_limit >> 8, ioaddr + lp->xmt_lower_limit_reg); |
1053 | outb(lp->xmt_upper_limit >> 8, ioaddr + lp->xmt_upper_limit_reg); | 1055 | outb(lp->xmt_upper_limit >> 8, ioaddr + lp->xmt_upper_limit_reg); |
1054 | 1056 | ||
@@ -1065,12 +1067,12 @@ static int eepro_open(struct net_device *dev) | |||
1065 | eepro_clear_int(ioaddr); | 1067 | eepro_clear_int(ioaddr); |
1066 | 1068 | ||
1067 | /* Initialize RCV */ | 1069 | /* Initialize RCV */ |
1068 | outw(lp->rcv_lower_limit, ioaddr + RCV_BAR); | 1070 | outw(lp->rcv_lower_limit, ioaddr + RCV_BAR); |
1069 | lp->rx_start = lp->rcv_lower_limit; | 1071 | lp->rx_start = lp->rcv_lower_limit; |
1070 | outw(lp->rcv_upper_limit | 0xfe, ioaddr + RCV_STOP); | 1072 | outw(lp->rcv_upper_limit | 0xfe, ioaddr + RCV_STOP); |
1071 | 1073 | ||
1072 | /* Initialize XMT */ | 1074 | /* Initialize XMT */ |
1073 | outw(lp->xmt_lower_limit, ioaddr + lp->xmt_bar); | 1075 | outw(lp->xmt_lower_limit, ioaddr + lp->xmt_bar); |
1074 | lp->tx_start = lp->tx_end = lp->xmt_lower_limit; | 1076 | lp->tx_start = lp->tx_end = lp->xmt_lower_limit; |
1075 | lp->tx_last = 0; | 1077 | lp->tx_last = 0; |
1076 | 1078 | ||
@@ -1411,7 +1413,7 @@ set_multicast_list(struct net_device *dev) | |||
1411 | outb(0x08, ioaddr + STATUS_REG); | 1413 | outb(0x08, ioaddr + STATUS_REG); |
1412 | 1414 | ||
1413 | if (i & 0x20) { /* command ABORTed */ | 1415 | if (i & 0x20) { /* command ABORTed */ |
1414 | printk(KERN_NOTICE "%s: multicast setup failed.\n", | 1416 | printk(KERN_NOTICE "%s: multicast setup failed.\n", |
1415 | dev->name); | 1417 | dev->name); |
1416 | break; | 1418 | break; |
1417 | } else if ((i & 0x0f) == 0x03) { /* MC-Done */ | 1419 | } else if ((i & 0x0f) == 0x03) { /* MC-Done */ |
@@ -1512,7 +1514,7 @@ hardware_send_packet(struct net_device *dev, void *buf, short length) | |||
1512 | end = last + (((length + 3) >> 1) << 1) + XMT_HEADER; | 1514 | end = last + (((length + 3) >> 1) << 1) + XMT_HEADER; |
1513 | 1515 | ||
1514 | if (end >= lp->xmt_upper_limit + 2) { /* the transmit buffer is wrapped around */ | 1516 | if (end >= lp->xmt_upper_limit + 2) { /* the transmit buffer is wrapped around */ |
1515 | if ((lp->xmt_upper_limit + 2 - last) <= XMT_HEADER) { | 1517 | if ((lp->xmt_upper_limit + 2 - last) <= XMT_HEADER) { |
1516 | /* Arrrr!!!, must keep the xmt header together, | 1518 | /* Arrrr!!!, must keep the xmt header together, |
1517 | several days were lost to chase this one down. */ | 1519 | several days were lost to chase this one down. */ |
1518 | last = lp->xmt_lower_limit; | 1520 | last = lp->xmt_lower_limit; |
@@ -1643,7 +1645,7 @@ eepro_rx(struct net_device *dev) | |||
1643 | else if (rcv_status & 0x0800) | 1645 | else if (rcv_status & 0x0800) |
1644 | lp->stats.rx_crc_errors++; | 1646 | lp->stats.rx_crc_errors++; |
1645 | 1647 | ||
1646 | printk(KERN_DEBUG "%s: event = %#x, status = %#x, next = %#x, size = %#x\n", | 1648 | printk(KERN_DEBUG "%s: event = %#x, status = %#x, next = %#x, size = %#x\n", |
1647 | dev->name, rcv_event, rcv_status, rcv_next_frame, rcv_size); | 1649 | dev->name, rcv_event, rcv_status, rcv_next_frame, rcv_size); |
1648 | } | 1650 | } |
1649 | 1651 | ||
@@ -1674,10 +1676,10 @@ eepro_transmit_interrupt(struct net_device *dev) | |||
1674 | { | 1676 | { |
1675 | struct eepro_local *lp = netdev_priv(dev); | 1677 | struct eepro_local *lp = netdev_priv(dev); |
1676 | short ioaddr = dev->base_addr; | 1678 | short ioaddr = dev->base_addr; |
1677 | short boguscount = 25; | 1679 | short boguscount = 25; |
1678 | short xmt_status; | 1680 | short xmt_status; |
1679 | 1681 | ||
1680 | while ((lp->tx_start != lp->tx_end) && boguscount--) { | 1682 | while ((lp->tx_start != lp->tx_end) && boguscount--) { |
1681 | 1683 | ||
1682 | outw(lp->tx_start, ioaddr + HOST_ADDRESS_REG); | 1684 | outw(lp->tx_start, ioaddr + HOST_ADDRESS_REG); |
1683 | xmt_status = inw(ioaddr+IO_PORT); | 1685 | xmt_status = inw(ioaddr+IO_PORT); |
@@ -1723,7 +1725,7 @@ static int eepro_ethtool_get_settings(struct net_device *dev, | |||
1723 | { | 1725 | { |
1724 | struct eepro_local *lp = (struct eepro_local *)dev->priv; | 1726 | struct eepro_local *lp = (struct eepro_local *)dev->priv; |
1725 | 1727 | ||
1726 | cmd->supported = SUPPORTED_10baseT_Half | | 1728 | cmd->supported = SUPPORTED_10baseT_Half | |
1727 | SUPPORTED_10baseT_Full | | 1729 | SUPPORTED_10baseT_Full | |
1728 | SUPPORTED_Autoneg; | 1730 | SUPPORTED_Autoneg; |
1729 | cmd->advertising = ADVERTISED_10baseT_Half | | 1731 | cmd->advertising = ADVERTISED_10baseT_Half | |
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c index bbac720cca63..140b7cdb1f7e 100644 --- a/drivers/net/irda/smsc-ircc2.c +++ b/drivers/net/irda/smsc-ircc2.c | |||
@@ -638,21 +638,14 @@ static void smsc_ircc_setup_qos(struct smsc_ircc_cb *self) | |||
638 | */ | 638 | */ |
639 | static void smsc_ircc_init_chip(struct smsc_ircc_cb *self) | 639 | static void smsc_ircc_init_chip(struct smsc_ircc_cb *self) |
640 | { | 640 | { |
641 | int iobase, ir_mode, ctrl, fast; | 641 | int iobase = self->io.fir_base; |
642 | |||
643 | IRDA_ASSERT(self != NULL, return;); | ||
644 | |||
645 | iobase = self->io.fir_base; | ||
646 | ir_mode = IRCC_CFGA_IRDA_SIR_A; | ||
647 | ctrl = 0; | ||
648 | fast = 0; | ||
649 | 642 | ||
650 | register_bank(iobase, 0); | 643 | register_bank(iobase, 0); |
651 | outb(IRCC_MASTER_RESET, iobase + IRCC_MASTER); | 644 | outb(IRCC_MASTER_RESET, iobase + IRCC_MASTER); |
652 | outb(0x00, iobase + IRCC_MASTER); | 645 | outb(0x00, iobase + IRCC_MASTER); |
653 | 646 | ||
654 | register_bank(iobase, 1); | 647 | register_bank(iobase, 1); |
655 | outb(((inb(iobase + IRCC_SCE_CFGA) & 0x87) | ir_mode), | 648 | outb(((inb(iobase + IRCC_SCE_CFGA) & 0x87) | IRCC_CFGA_IRDA_SIR_A), |
656 | iobase + IRCC_SCE_CFGA); | 649 | iobase + IRCC_SCE_CFGA); |
657 | 650 | ||
658 | #ifdef smsc_669 /* Uses pin 88/89 for Rx/Tx */ | 651 | #ifdef smsc_669 /* Uses pin 88/89 for Rx/Tx */ |
@@ -666,10 +659,10 @@ static void smsc_ircc_init_chip(struct smsc_ircc_cb *self) | |||
666 | outb(SMSC_IRCC2_FIFO_THRESHOLD, iobase + IRCC_FIFO_THRESHOLD); | 659 | outb(SMSC_IRCC2_FIFO_THRESHOLD, iobase + IRCC_FIFO_THRESHOLD); |
667 | 660 | ||
668 | register_bank(iobase, 4); | 661 | register_bank(iobase, 4); |
669 | outb((inb(iobase + IRCC_CONTROL) & 0x30) | ctrl, iobase + IRCC_CONTROL); | 662 | outb((inb(iobase + IRCC_CONTROL) & 0x30), iobase + IRCC_CONTROL); |
670 | 663 | ||
671 | register_bank(iobase, 0); | 664 | register_bank(iobase, 0); |
672 | outb(fast, iobase + IRCC_LCR_A); | 665 | outb(0, iobase + IRCC_LCR_A); |
673 | 666 | ||
674 | smsc_ircc_set_sir_speed(self, SMSC_IRCC2_C_IRDA_FALLBACK_SPEED); | 667 | smsc_ircc_set_sir_speed(self, SMSC_IRCC2_C_IRDA_FALLBACK_SPEED); |
675 | 668 | ||
@@ -1556,6 +1549,46 @@ static int ircc_is_receiving(struct smsc_ircc_cb *self) | |||
1556 | } | 1549 | } |
1557 | #endif /* unused */ | 1550 | #endif /* unused */ |
1558 | 1551 | ||
1552 | static int smsc_ircc_request_irq(struct smsc_ircc_cb *self) | ||
1553 | { | ||
1554 | int error; | ||
1555 | |||
1556 | error = request_irq(self->io.irq, smsc_ircc_interrupt, 0, | ||
1557 | self->netdev->name, self->netdev); | ||
1558 | if (error) | ||
1559 | IRDA_DEBUG(0, "%s(), unable to allocate irq=%d, err=%d\n", | ||
1560 | __FUNCTION__, self->io.irq, error); | ||
1561 | |||
1562 | return error; | ||
1563 | } | ||
1564 | |||
1565 | static void smsc_ircc_start_interrupts(struct smsc_ircc_cb *self) | ||
1566 | { | ||
1567 | unsigned long flags; | ||
1568 | |||
1569 | spin_lock_irqsave(&self->lock, flags); | ||
1570 | |||
1571 | self->io.speed = 0; | ||
1572 | smsc_ircc_change_speed(self, SMSC_IRCC2_C_IRDA_FALLBACK_SPEED); | ||
1573 | |||
1574 | spin_unlock_irqrestore(&self->lock, flags); | ||
1575 | } | ||
1576 | |||
1577 | static void smsc_ircc_stop_interrupts(struct smsc_ircc_cb *self) | ||
1578 | { | ||
1579 | int iobase = self->io.fir_base; | ||
1580 | unsigned long flags; | ||
1581 | |||
1582 | spin_lock_irqsave(&self->lock, flags); | ||
1583 | |||
1584 | register_bank(iobase, 0); | ||
1585 | outb(0, iobase + IRCC_IER); | ||
1586 | outb(IRCC_MASTER_RESET, iobase + IRCC_MASTER); | ||
1587 | outb(0x00, iobase + IRCC_MASTER); | ||
1588 | |||
1589 | spin_unlock_irqrestore(&self->lock, flags); | ||
1590 | } | ||
1591 | |||
1559 | 1592 | ||
1560 | /* | 1593 | /* |
1561 | * Function smsc_ircc_net_open (dev) | 1594 | * Function smsc_ircc_net_open (dev) |
@@ -1567,7 +1600,6 @@ static int smsc_ircc_net_open(struct net_device *dev) | |||
1567 | { | 1600 | { |
1568 | struct smsc_ircc_cb *self; | 1601 | struct smsc_ircc_cb *self; |
1569 | char hwname[16]; | 1602 | char hwname[16]; |
1570 | unsigned long flags; | ||
1571 | 1603 | ||
1572 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); | 1604 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); |
1573 | 1605 | ||
@@ -1575,6 +1607,11 @@ static int smsc_ircc_net_open(struct net_device *dev) | |||
1575 | self = netdev_priv(dev); | 1607 | self = netdev_priv(dev); |
1576 | IRDA_ASSERT(self != NULL, return 0;); | 1608 | IRDA_ASSERT(self != NULL, return 0;); |
1577 | 1609 | ||
1610 | if (self->io.suspended) { | ||
1611 | IRDA_DEBUG(0, "%s(), device is suspended\n", __FUNCTION__); | ||
1612 | return -EAGAIN; | ||
1613 | } | ||
1614 | |||
1578 | if (request_irq(self->io.irq, smsc_ircc_interrupt, 0, dev->name, | 1615 | if (request_irq(self->io.irq, smsc_ircc_interrupt, 0, dev->name, |
1579 | (void *) dev)) { | 1616 | (void *) dev)) { |
1580 | IRDA_DEBUG(0, "%s(), unable to allocate irq=%d\n", | 1617 | IRDA_DEBUG(0, "%s(), unable to allocate irq=%d\n", |
@@ -1582,11 +1619,7 @@ static int smsc_ircc_net_open(struct net_device *dev) | |||
1582 | return -EAGAIN; | 1619 | return -EAGAIN; |
1583 | } | 1620 | } |
1584 | 1621 | ||
1585 | spin_lock_irqsave(&self->lock, flags); | 1622 | smsc_ircc_start_interrupts(self); |
1586 | /*smsc_ircc_sir_start(self);*/ | ||
1587 | self->io.speed = 0; | ||
1588 | smsc_ircc_change_speed(self, SMSC_IRCC2_C_IRDA_FALLBACK_SPEED); | ||
1589 | spin_unlock_irqrestore(&self->lock, flags); | ||
1590 | 1623 | ||
1591 | /* Give self a hardware name */ | 1624 | /* Give self a hardware name */ |
1592 | /* It would be cool to offer the chip revision here - Jean II */ | 1625 | /* It would be cool to offer the chip revision here - Jean II */ |
@@ -1639,7 +1672,12 @@ static int smsc_ircc_net_close(struct net_device *dev) | |||
1639 | irlap_close(self->irlap); | 1672 | irlap_close(self->irlap); |
1640 | self->irlap = NULL; | 1673 | self->irlap = NULL; |
1641 | 1674 | ||
1642 | free_irq(self->io.irq, dev); | 1675 | smsc_ircc_stop_interrupts(self); |
1676 | |||
1677 | /* if we are called from smsc_ircc_resume we don't have IRQ reserved */ | ||
1678 | if (!self->io.suspended) | ||
1679 | free_irq(self->io.irq, dev); | ||
1680 | |||
1643 | disable_dma(self->io.dma); | 1681 | disable_dma(self->io.dma); |
1644 | free_dma(self->io.dma); | 1682 | free_dma(self->io.dma); |
1645 | 1683 | ||
@@ -1650,11 +1688,18 @@ static int smsc_ircc_suspend(struct device *dev, pm_message_t state) | |||
1650 | { | 1688 | { |
1651 | struct smsc_ircc_cb *self = dev_get_drvdata(dev); | 1689 | struct smsc_ircc_cb *self = dev_get_drvdata(dev); |
1652 | 1690 | ||
1653 | IRDA_MESSAGE("%s, Suspending\n", driver_name); | ||
1654 | |||
1655 | if (!self->io.suspended) { | 1691 | if (!self->io.suspended) { |
1656 | smsc_ircc_net_close(self->netdev); | 1692 | IRDA_DEBUG(1, "%s, Suspending\n", driver_name); |
1693 | |||
1694 | rtnl_lock(); | ||
1695 | if (netif_running(self->netdev)) { | ||
1696 | netif_device_detach(self->netdev); | ||
1697 | smsc_ircc_stop_interrupts(self); | ||
1698 | free_irq(self->io.irq, self->netdev); | ||
1699 | disable_dma(self->io.dma); | ||
1700 | } | ||
1657 | self->io.suspended = 1; | 1701 | self->io.suspended = 1; |
1702 | rtnl_unlock(); | ||
1658 | } | 1703 | } |
1659 | 1704 | ||
1660 | return 0; | 1705 | return 0; |
@@ -1665,11 +1710,25 @@ static int smsc_ircc_resume(struct device *dev) | |||
1665 | struct smsc_ircc_cb *self = dev_get_drvdata(dev); | 1710 | struct smsc_ircc_cb *self = dev_get_drvdata(dev); |
1666 | 1711 | ||
1667 | if (self->io.suspended) { | 1712 | if (self->io.suspended) { |
1668 | 1713 | IRDA_DEBUG(1, "%s, Waking up\n", driver_name); | |
1669 | smsc_ircc_net_open(self->netdev); | 1714 | |
1715 | rtnl_lock(); | ||
1716 | smsc_ircc_init_chip(self); | ||
1717 | if (netif_running(self->netdev)) { | ||
1718 | if (smsc_ircc_request_irq(self)) { | ||
1719 | /* | ||
1720 | * Don't fail resume process, just kill this | ||
1721 | * network interface | ||
1722 | */ | ||
1723 | unregister_netdevice(self->netdev); | ||
1724 | } else { | ||
1725 | enable_dma(self->io.dma); | ||
1726 | smsc_ircc_start_interrupts(self); | ||
1727 | netif_device_attach(self->netdev); | ||
1728 | } | ||
1729 | } | ||
1670 | self->io.suspended = 0; | 1730 | self->io.suspended = 0; |
1671 | 1731 | rtnl_unlock(); | |
1672 | IRDA_MESSAGE("%s, Waking up\n", driver_name); | ||
1673 | } | 1732 | } |
1674 | return 0; | 1733 | return 0; |
1675 | } | 1734 | } |
@@ -1682,9 +1741,6 @@ static int smsc_ircc_resume(struct device *dev) | |||
1682 | */ | 1741 | */ |
1683 | static int __exit smsc_ircc_close(struct smsc_ircc_cb *self) | 1742 | static int __exit smsc_ircc_close(struct smsc_ircc_cb *self) |
1684 | { | 1743 | { |
1685 | int iobase; | ||
1686 | unsigned long flags; | ||
1687 | |||
1688 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); | 1744 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); |
1689 | 1745 | ||
1690 | IRDA_ASSERT(self != NULL, return -1;); | 1746 | IRDA_ASSERT(self != NULL, return -1;); |
@@ -1694,22 +1750,7 @@ static int __exit smsc_ircc_close(struct smsc_ircc_cb *self) | |||
1694 | /* Remove netdevice */ | 1750 | /* Remove netdevice */ |
1695 | unregister_netdev(self->netdev); | 1751 | unregister_netdev(self->netdev); |
1696 | 1752 | ||
1697 | /* Make sure the irq handler is not exectuting */ | 1753 | smsc_ircc_stop_interrupts(self); |
1698 | spin_lock_irqsave(&self->lock, flags); | ||
1699 | |||
1700 | /* Stop interrupts */ | ||
1701 | iobase = self->io.fir_base; | ||
1702 | register_bank(iobase, 0); | ||
1703 | outb(0, iobase + IRCC_IER); | ||
1704 | outb(IRCC_MASTER_RESET, iobase + IRCC_MASTER); | ||
1705 | outb(0x00, iobase + IRCC_MASTER); | ||
1706 | #if 0 | ||
1707 | /* Reset to SIR mode */ | ||
1708 | register_bank(iobase, 1); | ||
1709 | outb(IRCC_CFGA_IRDA_SIR_A|IRCC_CFGA_TX_POLARITY, iobase + IRCC_SCE_CFGA); | ||
1710 | outb(IRCC_CFGB_IR, iobase + IRCC_SCE_CFGB); | ||
1711 | #endif | ||
1712 | spin_unlock_irqrestore(&self->lock, flags); | ||
1713 | 1754 | ||
1714 | /* Release the PORTS that this driver is using */ | 1755 | /* Release the PORTS that this driver is using */ |
1715 | IRDA_DEBUG(0, "%s(), releasing 0x%03x\n", __FUNCTION__, | 1756 | IRDA_DEBUG(0, "%s(), releasing 0x%03x\n", __FUNCTION__, |
diff --git a/drivers/net/skfp/smt.c b/drivers/net/skfp/smt.c index f17c05cbe44b..99a776a51fb5 100644 --- a/drivers/net/skfp/smt.c +++ b/drivers/net/skfp/smt.c | |||
@@ -1896,7 +1896,7 @@ void smt_swap_para(struct smt_header *sm, int len, int direction) | |||
1896 | 1896 | ||
1897 | static void smt_string_swap(char *data, const char *format, int len) | 1897 | static void smt_string_swap(char *data, const char *format, int len) |
1898 | { | 1898 | { |
1899 | const char *open_paren = 0 ; | 1899 | const char *open_paren = NULL ; |
1900 | int x ; | 1900 | int x ; |
1901 | 1901 | ||
1902 | while (len > 0 && *format) { | 1902 | while (len > 0 && *format) { |
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h index ac9ce6509eee..817f200742c3 100644 --- a/drivers/net/smc91x.h +++ b/drivers/net/smc91x.h | |||
@@ -230,12 +230,12 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg) | |||
230 | #define SMC_CAN_USE_16BIT 1 | 230 | #define SMC_CAN_USE_16BIT 1 |
231 | #define SMC_CAN_USE_32BIT 0 | 231 | #define SMC_CAN_USE_32BIT 0 |
232 | 232 | ||
233 | #define SMC_inb(a, r) inb((a) + (r) - 0xa0000000) | 233 | #define SMC_inb(a, r) inb((u32)a) + (r)) |
234 | #define SMC_inw(a, r) inw((a) + (r) - 0xa0000000) | 234 | #define SMC_inw(a, r) inw(((u32)a) + (r)) |
235 | #define SMC_outb(v, a, r) outb(v, (a) + (r) - 0xa0000000) | 235 | #define SMC_outb(v, a, r) outb(v, ((u32)a) + (r)) |
236 | #define SMC_outw(v, a, r) outw(v, (a) + (r) - 0xa0000000) | 236 | #define SMC_outw(v, a, r) outw(v, ((u32)a) + (r)) |
237 | #define SMC_insw(a, r, p, l) insw((a) + (r) - 0xa0000000, p, l) | 237 | #define SMC_insw(a, r, p, l) insw(((u32)a) + (r), p, l) |
238 | #define SMC_outsw(a, r, p, l) outsw((a) + (r) - 0xa0000000, p, l) | 238 | #define SMC_outsw(a, r, p, l) outsw(((u32)a) + (r), p, l) |
239 | 239 | ||
240 | #define set_irq_type(irq, type) do {} while(0) | 240 | #define set_irq_type(irq, type) do {} while(0) |
241 | 241 | ||
diff --git a/drivers/net/wireless/prism54/islpci_mgt.c b/drivers/net/wireless/prism54/islpci_mgt.c index 4937a5ad4b2c..6a60c5970cb5 100644 --- a/drivers/net/wireless/prism54/islpci_mgt.c +++ b/drivers/net/wireless/prism54/islpci_mgt.c | |||
@@ -137,7 +137,7 @@ islpci_mgmt_rx_fill(struct net_device *ndev) | |||
137 | PCI_DMA_FROMDEVICE); | 137 | PCI_DMA_FROMDEVICE); |
138 | if (!buf->pci_addr) { | 138 | if (!buf->pci_addr) { |
139 | printk(KERN_WARNING | 139 | printk(KERN_WARNING |
140 | "Failed to make memory DMA'able\n."); | 140 | "Failed to make memory DMA'able.\n"); |
141 | return -ENOMEM; | 141 | return -ENOMEM; |
142 | } | 142 | } |
143 | } | 143 | } |