diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/depca.c | 3 | ||||
-rw-r--r-- | drivers/net/hamradio/baycom_ser_fdx.c | 6 | ||||
-rw-r--r-- | drivers/net/sis900.c | 44 |
3 files changed, 26 insertions, 27 deletions
diff --git a/drivers/net/depca.c b/drivers/net/depca.c index 5113eef755b9..f3807aaf10aa 100644 --- a/drivers/net/depca.c +++ b/drivers/net/depca.c | |||
@@ -1491,8 +1491,9 @@ static void __init depca_platform_probe (void) | |||
1491 | depca_io_ports[i].device = pldev; | 1491 | depca_io_ports[i].device = pldev; |
1492 | 1492 | ||
1493 | if (platform_device_add(pldev)) { | 1493 | if (platform_device_add(pldev)) { |
1494 | platform_device_put(pldev); | ||
1495 | depca_io_ports[i].device = NULL; | 1494 | depca_io_ports[i].device = NULL; |
1495 | pldev->dev.platform_data = NULL; | ||
1496 | platform_device_put(pldev); | ||
1496 | continue; | 1497 | continue; |
1497 | } | 1498 | } |
1498 | 1499 | ||
diff --git a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/baycom_ser_fdx.c index 59214e74b9cf..30baf6ecfc63 100644 --- a/drivers/net/hamradio/baycom_ser_fdx.c +++ b/drivers/net/hamradio/baycom_ser_fdx.c | |||
@@ -75,12 +75,14 @@ | |||
75 | #include <linux/ioport.h> | 75 | #include <linux/ioport.h> |
76 | #include <linux/string.h> | 76 | #include <linux/string.h> |
77 | #include <linux/init.h> | 77 | #include <linux/init.h> |
78 | #include <asm/uaccess.h> | ||
79 | #include <asm/io.h> | ||
80 | #include <linux/hdlcdrv.h> | 78 | #include <linux/hdlcdrv.h> |
81 | #include <linux/baycom.h> | 79 | #include <linux/baycom.h> |
82 | #include <linux/jiffies.h> | 80 | #include <linux/jiffies.h> |
83 | 81 | ||
82 | #include <asm/uaccess.h> | ||
83 | #include <asm/io.h> | ||
84 | #include <asm/irq.h> | ||
85 | |||
84 | /* --------------------------------------------------------------------- */ | 86 | /* --------------------------------------------------------------------- */ |
85 | 87 | ||
86 | #define BAYCOM_DEBUG | 88 | #define BAYCOM_DEBUG |
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c index b3750f284279..b2a3b19d773a 100644 --- a/drivers/net/sis900.c +++ b/drivers/net/sis900.c | |||
@@ -1755,6 +1755,24 @@ static int sis900_rx(struct net_device *net_dev) | |||
1755 | } else { | 1755 | } else { |
1756 | struct sk_buff * skb; | 1756 | struct sk_buff * skb; |
1757 | 1757 | ||
1758 | pci_unmap_single(sis_priv->pci_dev, | ||
1759 | sis_priv->rx_ring[entry].bufptr, RX_BUF_SIZE, | ||
1760 | PCI_DMA_FROMDEVICE); | ||
1761 | |||
1762 | /* refill the Rx buffer, what if there is not enought | ||
1763 | * memory for new socket buffer ?? */ | ||
1764 | if ((skb = dev_alloc_skb(RX_BUF_SIZE)) == NULL) { | ||
1765 | /* | ||
1766 | * Not enough memory to refill the buffer | ||
1767 | * so we need to recycle the old one so | ||
1768 | * as to avoid creating a memory hole | ||
1769 | * in the rx ring | ||
1770 | */ | ||
1771 | skb = sis_priv->rx_skbuff[entry]; | ||
1772 | sis_priv->stats.rx_dropped++; | ||
1773 | goto refill_rx_ring; | ||
1774 | } | ||
1775 | |||
1758 | /* This situation should never happen, but due to | 1776 | /* This situation should never happen, but due to |
1759 | some unknow bugs, it is possible that | 1777 | some unknow bugs, it is possible that |
1760 | we are working on NULL sk_buff :-( */ | 1778 | we are working on NULL sk_buff :-( */ |
@@ -1768,9 +1786,6 @@ static int sis900_rx(struct net_device *net_dev) | |||
1768 | break; | 1786 | break; |
1769 | } | 1787 | } |
1770 | 1788 | ||
1771 | pci_unmap_single(sis_priv->pci_dev, | ||
1772 | sis_priv->rx_ring[entry].bufptr, RX_BUF_SIZE, | ||
1773 | PCI_DMA_FROMDEVICE); | ||
1774 | /* give the socket buffer to upper layers */ | 1789 | /* give the socket buffer to upper layers */ |
1775 | skb = sis_priv->rx_skbuff[entry]; | 1790 | skb = sis_priv->rx_skbuff[entry]; |
1776 | skb_put(skb, rx_size); | 1791 | skb_put(skb, rx_size); |
@@ -1783,33 +1798,14 @@ static int sis900_rx(struct net_device *net_dev) | |||
1783 | net_dev->last_rx = jiffies; | 1798 | net_dev->last_rx = jiffies; |
1784 | sis_priv->stats.rx_bytes += rx_size; | 1799 | sis_priv->stats.rx_bytes += rx_size; |
1785 | sis_priv->stats.rx_packets++; | 1800 | sis_priv->stats.rx_packets++; |
1786 | 1801 | sis_priv->dirty_rx++; | |
1787 | /* refill the Rx buffer, what if there is not enought | 1802 | refill_rx_ring: |
1788 | * memory for new socket buffer ?? */ | ||
1789 | if ((skb = dev_alloc_skb(RX_BUF_SIZE)) == NULL) { | ||
1790 | /* not enough memory for skbuff, this makes a | ||
1791 | * "hole" on the buffer ring, it is not clear | ||
1792 | * how the hardware will react to this kind | ||
1793 | * of degenerated buffer */ | ||
1794 | if (netif_msg_rx_status(sis_priv)) | ||
1795 | printk(KERN_INFO "%s: Memory squeeze," | ||
1796 | "deferring packet.\n", | ||
1797 | net_dev->name); | ||
1798 | sis_priv->rx_skbuff[entry] = NULL; | ||
1799 | /* reset buffer descriptor state */ | ||
1800 | sis_priv->rx_ring[entry].cmdsts = 0; | ||
1801 | sis_priv->rx_ring[entry].bufptr = 0; | ||
1802 | sis_priv->stats.rx_dropped++; | ||
1803 | sis_priv->cur_rx++; | ||
1804 | break; | ||
1805 | } | ||
1806 | skb->dev = net_dev; | 1803 | skb->dev = net_dev; |
1807 | sis_priv->rx_skbuff[entry] = skb; | 1804 | sis_priv->rx_skbuff[entry] = skb; |
1808 | sis_priv->rx_ring[entry].cmdsts = RX_BUF_SIZE; | 1805 | sis_priv->rx_ring[entry].cmdsts = RX_BUF_SIZE; |
1809 | sis_priv->rx_ring[entry].bufptr = | 1806 | sis_priv->rx_ring[entry].bufptr = |
1810 | pci_map_single(sis_priv->pci_dev, skb->data, | 1807 | pci_map_single(sis_priv->pci_dev, skb->data, |
1811 | RX_BUF_SIZE, PCI_DMA_FROMDEVICE); | 1808 | RX_BUF_SIZE, PCI_DMA_FROMDEVICE); |
1812 | sis_priv->dirty_rx++; | ||
1813 | } | 1809 | } |
1814 | sis_priv->cur_rx++; | 1810 | sis_priv->cur_rx++; |
1815 | entry = sis_priv->cur_rx % NUM_RX_DESC; | 1811 | entry = sis_priv->cur_rx % NUM_RX_DESC; |