Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
drivers/net/hamradio/baycom_ser_fdx build fix
usb-net/pegasus: fix pegasus carrier detection
sis900: Allocate rx replacement buffer before rx operation
[netdrvr] depca: handle platform_device_add() failure

+40 -33
+2 -1
drivers/net/depca.c
··· 1491 1491 depca_io_ports[i].device = pldev; 1492 1492 1493 1493 if (platform_device_add(pldev)) { 1494 - platform_device_put(pldev); 1495 1494 depca_io_ports[i].device = NULL; 1495 + pldev->dev.platform_data = NULL; 1496 + platform_device_put(pldev); 1496 1497 continue; 1497 1498 } 1498 1499
+4 -2
drivers/net/hamradio/baycom_ser_fdx.c
··· 75 75 #include <linux/ioport.h> 76 76 #include <linux/string.h> 77 77 #include <linux/init.h> 78 - #include <asm/uaccess.h> 79 - #include <asm/io.h> 80 78 #include <linux/hdlcdrv.h> 81 79 #include <linux/baycom.h> 82 80 #include <linux/jiffies.h> 81 + 82 + #include <asm/uaccess.h> 83 + #include <asm/io.h> 84 + #include <asm/irq.h> 83 85 84 86 /* --------------------------------------------------------------------- */ 85 87
+20 -24
drivers/net/sis900.c
··· 1755 1755 } else { 1756 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 1776 /* This situation should never happen, but due to 1759 1777 some unknow bugs, it is possible that 1760 1778 we are working on NULL sk_buff :-( */ ··· 1786 1768 break; 1787 1769 } 1788 1770 1789 - pci_unmap_single(sis_priv->pci_dev, 1790 - sis_priv->rx_ring[entry].bufptr, RX_BUF_SIZE, 1791 - PCI_DMA_FROMDEVICE); 1792 1771 /* give the socket buffer to upper layers */ 1793 1772 skb = sis_priv->rx_skbuff[entry]; 1794 1773 skb_put(skb, rx_size); ··· 1798 1783 net_dev->last_rx = jiffies; 1799 1784 sis_priv->stats.rx_bytes += rx_size; 1800 1785 sis_priv->stats.rx_packets++; 1801 - 1802 - /* refill the Rx buffer, what if there is not enought 1803 - * memory for new socket buffer ?? */ 1804 - if ((skb = dev_alloc_skb(RX_BUF_SIZE)) == NULL) { 1805 - /* not enough memory for skbuff, this makes a 1806 - * "hole" on the buffer ring, it is not clear 1807 - * how the hardware will react to this kind 1808 - * of degenerated buffer */ 1809 - if (netif_msg_rx_status(sis_priv)) 1810 - printk(KERN_INFO "%s: Memory squeeze," 1811 - "deferring packet.\n", 1812 - net_dev->name); 1813 - sis_priv->rx_skbuff[entry] = NULL; 1814 - /* reset buffer descriptor state */ 1815 - sis_priv->rx_ring[entry].cmdsts = 0; 1816 - sis_priv->rx_ring[entry].bufptr = 0; 1817 - sis_priv->stats.rx_dropped++; 1818 - sis_priv->cur_rx++; 1819 - break; 1820 - } 1786 + sis_priv->dirty_rx++; 1787 + refill_rx_ring: 1821 1788 skb->dev = net_dev; 1822 1789 sis_priv->rx_skbuff[entry] = skb; 1823 1790 sis_priv->rx_ring[entry].cmdsts = RX_BUF_SIZE; 1824 1791 sis_priv->rx_ring[entry].bufptr = 1825 1792 pci_map_single(sis_priv->pci_dev, skb->data, 1826 1793 RX_BUF_SIZE, PCI_DMA_FROMDEVICE); 1827 - sis_priv->dirty_rx++; 1828 1794 } 1829 1795 sis_priv->cur_rx++; 1830 1796 entry = sis_priv->cur_rx % NUM_RX_DESC;
+12 -5
drivers/usb/net/pegasus.c
··· 316 316 return ret; 317 317 } 318 318 319 + /* Returns 0 on success, error on failure */ 319 320 static int read_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 * regd) 320 321 { 321 322 int i; ··· 848 847 * d[0].NO_CARRIER kicks in only with failed TX. 849 848 * ... so monitoring with MII may be safest. 850 849 */ 851 - if (d[0] & NO_CARRIER) 852 - netif_carrier_off(net); 853 - else 854 - netif_carrier_on(net); 850 + if (pegasus->features & TRUST_LINK_STATUS) { 851 + if (d[5] & LINK_STATUS) 852 + netif_carrier_on(net); 853 + else 854 + netif_carrier_off(net); 855 + } else { 856 + /* Never set carrier _on_ based on ! NO_CARRIER */ 857 + if (d[0] & NO_CARRIER) 858 + netif_carrier_off(net); 859 + } 855 860 856 861 /* bytes 3-4 == rx_lostpkt, reg 2E/2F */ 857 862 pegasus->stats.rx_missed_errors += ((d[3] & 0x7f) << 8) | d[4]; ··· 957 950 pegasus_t *pegasus = netdev_priv(net); 958 951 u16 tmp; 959 952 960 - if (!read_mii_word(pegasus, pegasus->phy, MII_BMSR, &tmp)) 953 + if (read_mii_word(pegasus, pegasus->phy, MII_BMSR, &tmp)) 961 954 return; 962 955 963 956 if (tmp & BMSR_LSTATUS)
+2 -1
drivers/usb/net/pegasus.h
··· 11 11 12 12 #define PEGASUS_II 0x80000000 13 13 #define HAS_HOME_PNA 0x40000000 14 + #define TRUST_LINK_STATUS 0x20000000 14 15 15 16 #define PEGASUS_MTU 1536 16 17 #define RX_SKBS 4 ··· 204 203 PEGASUS_DEV( "Allied Telesyn Int. AT-USB100", VENDOR_ALLIEDTEL, 0xb100, 205 204 DEFAULT_GPIO_RESET | PEGASUS_II ) 206 205 PEGASUS_DEV( "Belkin F5D5050 USB Ethernet", VENDOR_BELKIN, 0x0121, 207 - DEFAULT_GPIO_RESET | PEGASUS_II ) 206 + DEFAULT_GPIO_RESET | PEGASUS_II | TRUST_LINK_STATUS ) 208 207 PEGASUS_DEV( "Billionton USB-100", VENDOR_BILLIONTON, 0x0986, 209 208 DEFAULT_GPIO_RESET ) 210 209 PEGASUS_DEV( "Billionton USBLP-100", VENDOR_BILLIONTON, 0x0987,