Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (42 commits)
cxgb3: fix premature page unmap
ibm_newemac: Fix EMACx_TRTR[TRT] bit shifts
vlan: Fix register_vlan_dev() error path
gro: Fix illegal merging of trailer trash
sungem: Fix Serdes detection.
net: fix mdio section mismatch warning
ppp: fix BUG on non-linear SKB (multilink receive)
ixgbe: Fixing EEH handler to handle more than one error
net: Fix the rollback test in dev_change_name()
Revert "isdn: isdn_ppp: Use SKB list facilities instead of home-grown implementation."
TI Davinci EMAC : Fix Console Hang when bringing the interface down
smsc911x: Fix Console Hang when bringing the interface down.
mISDN: fix error return in HFCmulti_init()
forcedeth: mac address fix
r6040: fix version printing
Bluetooth: Fix regression with L2CAP configuration in Basic Mode
Bluetooth: Select Basic Mode as default for SOCK_SEQPACKET
Bluetooth: Set general bonding security for ACL by default
r8169: Fix receive buffer length when MTU is between 1515 and 1536
can: add the missing netlink get_xstats_size callback
...

+430 -488
+3 -1
MAINTAINERS
··· 4332 4332 4333 4333 RALINK RT2X00 WIRELESS LAN DRIVER 4334 4334 P: rt2x00 project 4335 + M: Ivo van Doorn <IvDoorn@gmail.com> 4336 + M: Gertjan van Wingerde <gwingerde@gmail.com> 4335 4337 L: linux-wireless@vger.kernel.org 4336 4338 L: users@rt2x00.serialmonkey.com (moderated for non-subscribers) 4337 4339 W: http://rt2x00.serialmonkey.com/ ··· 4421 4419 M: Johannes Berg <johannes@sipsolutions.net> 4422 4420 L: linux-wireless@vger.kernel.org 4423 4421 S: Maintained 4424 - F Documentation/rfkill.txt 4422 + F: Documentation/rfkill.txt 4425 4423 F: net/rfkill/ 4426 4424 4427 4425 RISCOM8 DRIVER
+1 -1
drivers/isdn/hardware/mISDN/hfcmulti.c
··· 5481 5481 if (err) { 5482 5482 printk(KERN_ERR "error registering embedded driver: " 5483 5483 "%x\n", err); 5484 - return -err; 5484 + return err; 5485 5485 } 5486 5486 HFC_cnt++; 5487 5487 printk(KERN_INFO "%d devices registered\n", HFC_cnt);
+161 -187
drivers/isdn/i4l/isdn_ppp.c
··· 1535 1535 int sz = ISDN_MAX_CHANNELS*sizeof(ippp_bundle); 1536 1536 if( (isdn_ppp_bundle_arr = kzalloc(sz, GFP_KERNEL)) == NULL ) 1537 1537 return -ENOMEM; 1538 - for (i = 0; i < ISDN_MAX_CHANNELS; i++) { 1538 + for( i = 0; i < ISDN_MAX_CHANNELS; i++ ) 1539 1539 spin_lock_init(&isdn_ppp_bundle_arr[i].lock); 1540 - skb_queue_head_init(&isdn_ppp_bundle_arr[i].frags); 1541 - } 1542 1540 return 0; 1543 1541 } 1544 1542 ··· 1569 1571 if ((lp->netdev->pb = isdn_ppp_mp_bundle_alloc()) == NULL) 1570 1572 return -ENOMEM; 1571 1573 lp->next = lp->last = lp; /* nobody else in a queue */ 1572 - skb_queue_head_init(&lp->netdev->pb->frags); 1574 + lp->netdev->pb->frags = NULL; 1573 1575 lp->netdev->pb->frames = 0; 1574 1576 lp->netdev->pb->seq = UINT_MAX; 1575 1577 } ··· 1581 1583 1582 1584 static u32 isdn_ppp_mp_get_seq( int short_seq, 1583 1585 struct sk_buff * skb, u32 last_seq ); 1584 - static void isdn_ppp_mp_discard(ippp_bundle *mp, struct sk_buff *from, 1585 - struct sk_buff *to); 1586 - static void isdn_ppp_mp_reassembly(isdn_net_dev *net_dev, isdn_net_local *lp, 1587 - struct sk_buff *from, struct sk_buff *to, 1588 - u32 lastseq); 1589 - static void isdn_ppp_mp_free_skb(ippp_bundle *mp, struct sk_buff *skb); 1586 + static struct sk_buff * isdn_ppp_mp_discard( ippp_bundle * mp, 1587 + struct sk_buff * from, struct sk_buff * to ); 1588 + static void isdn_ppp_mp_reassembly( isdn_net_dev * net_dev, isdn_net_local * lp, 1589 + struct sk_buff * from, struct sk_buff * to ); 1590 + static void isdn_ppp_mp_free_skb( ippp_bundle * mp, struct sk_buff * skb ); 1590 1591 static void isdn_ppp_mp_print_recv_pkt( int slot, struct sk_buff * skb ); 1591 1592 1592 1593 static void isdn_ppp_mp_receive(isdn_net_dev * net_dev, isdn_net_local * lp, 1593 - struct sk_buff *skb) 1594 + struct sk_buff *skb) 1594 1595 { 1595 - struct sk_buff *newfrag, *frag, *start, *nextf; 1596 - u32 newseq, minseq, thisseq; 1597 - isdn_mppp_stats *stats; 1598 1596 struct ippp_struct *is; 1597 + isdn_net_local * lpq; 1598 + ippp_bundle * mp; 1599 + isdn_mppp_stats * stats; 1600 + struct sk_buff * newfrag, * frag, * start, *nextf; 1601 + u32 newseq, minseq, thisseq; 1599 1602 unsigned long flags; 1600 - isdn_net_local *lpq; 1601 - ippp_bundle *mp; 1602 1603 int slot; 1603 1604 1604 1605 spin_lock_irqsave(&net_dev->pb->lock, flags); 1605 - mp = net_dev->pb; 1606 - stats = &mp->stats; 1606 + mp = net_dev->pb; 1607 + stats = &mp->stats; 1607 1608 slot = lp->ppp_slot; 1608 1609 if (slot < 0 || slot >= ISDN_MAX_CHANNELS) { 1609 1610 printk(KERN_ERR "%s: lp->ppp_slot(%d)\n", ··· 1613 1616 return; 1614 1617 } 1615 1618 is = ippp_table[slot]; 1616 - if (++mp->frames > stats->max_queue_len) 1619 + if( ++mp->frames > stats->max_queue_len ) 1617 1620 stats->max_queue_len = mp->frames; 1618 - 1621 + 1619 1622 if (is->debug & 0x8) 1620 1623 isdn_ppp_mp_print_recv_pkt(lp->ppp_slot, skb); 1621 1624 1622 - newseq = isdn_ppp_mp_get_seq(is->mpppcfg & SC_IN_SHORT_SEQ, 1623 - skb, is->last_link_seqno); 1625 + newseq = isdn_ppp_mp_get_seq(is->mpppcfg & SC_IN_SHORT_SEQ, 1626 + skb, is->last_link_seqno); 1627 + 1624 1628 1625 1629 /* if this packet seq # is less than last already processed one, 1626 1630 * toss it right away, but check for sequence start case first 1627 1631 */ 1628 - if (mp->seq > MP_LONGSEQ_MAX && (newseq & MP_LONGSEQ_MAXBIT)) { 1632 + if( mp->seq > MP_LONGSEQ_MAX && (newseq & MP_LONGSEQ_MAXBIT) ) { 1629 1633 mp->seq = newseq; /* the first packet: required for 1630 1634 * rfc1990 non-compliant clients -- 1631 1635 * prevents constant packet toss */ ··· 1636 1638 spin_unlock_irqrestore(&mp->lock, flags); 1637 1639 return; 1638 1640 } 1639 - 1641 + 1640 1642 /* find the minimum received sequence number over all links */ 1641 1643 is->last_link_seqno = minseq = newseq; 1642 1644 for (lpq = net_dev->queue;;) { ··· 1657 1659 * packets */ 1658 1660 newfrag = skb; 1659 1661 1660 - /* Insert new fragment into the proper sequence slot. */ 1661 - skb_queue_walk(&mp->frags, frag) { 1662 - if (MP_SEQ(frag) == newseq) { 1663 - isdn_ppp_mp_free_skb(mp, newfrag); 1664 - newfrag = NULL; 1665 - break; 1666 - } 1667 - if (MP_LT(newseq, MP_SEQ(frag))) { 1668 - __skb_queue_before(&mp->frags, frag, newfrag); 1669 - newfrag = NULL; 1670 - break; 1671 - } 1672 - } 1673 - if (newfrag) 1674 - __skb_queue_tail(&mp->frags, newfrag); 1662 + /* if this new fragment is before the first one, then enqueue it now. */ 1663 + if ((frag = mp->frags) == NULL || MP_LT(newseq, MP_SEQ(frag))) { 1664 + newfrag->next = frag; 1665 + mp->frags = frag = newfrag; 1666 + newfrag = NULL; 1667 + } 1675 1668 1676 - frag = skb_peek(&mp->frags); 1677 - start = ((MP_FLAGS(frag) & MP_BEGIN_FRAG) && 1678 - (MP_SEQ(frag) == mp->seq)) ? frag : NULL; 1679 - if (!start) 1680 - goto check_overflow; 1669 + start = MP_FLAGS(frag) & MP_BEGIN_FRAG && 1670 + MP_SEQ(frag) == mp->seq ? frag : NULL; 1681 1671 1682 - /* main fragment traversing loop 1672 + /* 1673 + * main fragment traversing loop 1683 1674 * 1684 1675 * try to accomplish several tasks: 1676 + * - insert new fragment into the proper sequence slot (once that's done 1677 + * newfrag will be set to NULL) 1685 1678 * - reassemble any complete fragment sequence (non-null 'start' 1686 1679 * indicates there is a continguous sequence present) 1687 1680 * - discard any incomplete sequences that are below minseq -- due ··· 1681 1692 * come to complete such sequence and it should be discarded 1682 1693 * 1683 1694 * loop completes when we accomplished the following tasks: 1695 + * - new fragment is inserted in the proper sequence ('newfrag' is 1696 + * set to NULL) 1684 1697 * - we hit a gap in the sequence, so no reassembly/processing is 1685 1698 * possible ('start' would be set to NULL) 1686 1699 * 1687 1700 * algorithm for this code is derived from code in the book 1688 1701 * 'PPP Design And Debugging' by James Carlson (Addison-Wesley) 1689 1702 */ 1690 - skb_queue_walk_safe(&mp->frags, frag, nextf) { 1691 - thisseq = MP_SEQ(frag); 1703 + while (start != NULL || newfrag != NULL) { 1692 1704 1693 - /* check for misplaced start */ 1694 - if (start != frag && (MP_FLAGS(frag) & MP_BEGIN_FRAG)) { 1695 - printk(KERN_WARNING"isdn_mppp(seq %d): new " 1696 - "BEGIN flag with no prior END", thisseq); 1697 - stats->seqerrs++; 1698 - stats->frame_drops++; 1699 - isdn_ppp_mp_discard(mp, start, frag); 1700 - start = frag; 1701 - } else if (MP_LE(thisseq, minseq)) { 1702 - if (MP_FLAGS(frag) & MP_BEGIN_FRAG) 1705 + thisseq = MP_SEQ(frag); 1706 + nextf = frag->next; 1707 + 1708 + /* drop any duplicate fragments */ 1709 + if (newfrag != NULL && thisseq == newseq) { 1710 + isdn_ppp_mp_free_skb(mp, newfrag); 1711 + newfrag = NULL; 1712 + } 1713 + 1714 + /* insert new fragment before next element if possible. */ 1715 + if (newfrag != NULL && (nextf == NULL || 1716 + MP_LT(newseq, MP_SEQ(nextf)))) { 1717 + newfrag->next = nextf; 1718 + frag->next = nextf = newfrag; 1719 + newfrag = NULL; 1720 + } 1721 + 1722 + if (start != NULL) { 1723 + /* check for misplaced start */ 1724 + if (start != frag && (MP_FLAGS(frag) & MP_BEGIN_FRAG)) { 1725 + printk(KERN_WARNING"isdn_mppp(seq %d): new " 1726 + "BEGIN flag with no prior END", thisseq); 1727 + stats->seqerrs++; 1728 + stats->frame_drops++; 1729 + start = isdn_ppp_mp_discard(mp, start,frag); 1730 + nextf = frag->next; 1731 + } 1732 + } else if (MP_LE(thisseq, minseq)) { 1733 + if (MP_FLAGS(frag) & MP_BEGIN_FRAG) 1703 1734 start = frag; 1704 - else { 1735 + else { 1705 1736 if (MP_FLAGS(frag) & MP_END_FRAG) 1706 - stats->frame_drops++; 1707 - __skb_unlink(skb, &mp->frags); 1737 + stats->frame_drops++; 1738 + if( mp->frags == frag ) 1739 + mp->frags = nextf; 1708 1740 isdn_ppp_mp_free_skb(mp, frag); 1741 + frag = nextf; 1709 1742 continue; 1710 - } 1743 + } 1711 1744 } 1712 - 1713 - /* if we have end fragment, then we have full reassembly 1714 - * sequence -- reassemble and process packet now 1745 + 1746 + /* if start is non-null and we have end fragment, then 1747 + * we have full reassembly sequence -- reassemble 1748 + * and process packet now 1715 1749 */ 1716 - if (MP_FLAGS(frag) & MP_END_FRAG) { 1717 - minseq = mp->seq = (thisseq+1) & MP_LONGSEQ_MASK; 1718 - /* Reassemble the packet then dispatch it */ 1719 - isdn_ppp_mp_reassembly(net_dev, lp, start, frag, thisseq); 1750 + if (start != NULL && (MP_FLAGS(frag) & MP_END_FRAG)) { 1751 + minseq = mp->seq = (thisseq+1) & MP_LONGSEQ_MASK; 1752 + /* Reassemble the packet then dispatch it */ 1753 + isdn_ppp_mp_reassembly(net_dev, lp, start, nextf); 1754 + 1755 + start = NULL; 1756 + frag = NULL; 1720 1757 1721 - start = NULL; 1722 - frag = NULL; 1723 - } 1758 + mp->frags = nextf; 1759 + } 1724 1760 1725 1761 /* check if need to update start pointer: if we just 1726 1762 * reassembled the packet and sequence is contiguous ··· 1756 1742 * below low watermark and set start to the next frag or 1757 1743 * clear start ptr. 1758 1744 */ 1759 - if (nextf != (struct sk_buff *)&mp->frags && 1745 + if (nextf != NULL && 1760 1746 ((thisseq+1) & MP_LONGSEQ_MASK) == MP_SEQ(nextf)) { 1761 - /* if we just reassembled and the next one is here, 1762 - * then start another reassembly. 1763 - */ 1764 - if (frag == NULL) { 1747 + /* if we just reassembled and the next one is here, 1748 + * then start another reassembly. */ 1749 + 1750 + if (frag == NULL) { 1765 1751 if (MP_FLAGS(nextf) & MP_BEGIN_FRAG) 1766 - start = nextf; 1767 - else { 1768 - printk(KERN_WARNING"isdn_mppp(seq %d):" 1769 - " END flag with no following " 1770 - "BEGIN", thisseq); 1752 + start = nextf; 1753 + else 1754 + { 1755 + printk(KERN_WARNING"isdn_mppp(seq %d):" 1756 + " END flag with no following " 1757 + "BEGIN", thisseq); 1771 1758 stats->seqerrs++; 1772 1759 } 1773 1760 } 1774 - } else { 1775 - if (nextf != (struct sk_buff *)&mp->frags && 1776 - frag != NULL && 1777 - MP_LT(thisseq, minseq)) { 1761 + 1762 + } else { 1763 + if ( nextf != NULL && frag != NULL && 1764 + MP_LT(thisseq, minseq)) { 1778 1765 /* we've got a break in the sequence 1779 1766 * and we not at the end yet 1780 1767 * and we did not just reassembled ··· 1784 1769 * discard all the frames below low watermark 1785 1770 * and start over */ 1786 1771 stats->frame_drops++; 1787 - isdn_ppp_mp_discard(mp, start, nextf); 1772 + mp->frags = isdn_ppp_mp_discard(mp,start,nextf); 1788 1773 } 1789 1774 /* break in the sequence, no reassembly */ 1790 - start = NULL; 1791 - } 1792 - if (!start) 1793 - break; 1794 - } 1795 - 1796 - check_overflow: 1775 + start = NULL; 1776 + } 1777 + 1778 + frag = nextf; 1779 + } /* while -- main loop */ 1780 + 1781 + if (mp->frags == NULL) 1782 + mp->frags = frag; 1783 + 1797 1784 /* rather straighforward way to deal with (not very) possible 1798 - * queue overflow 1799 - */ 1785 + * queue overflow */ 1800 1786 if (mp->frames > MP_MAX_QUEUE_LEN) { 1801 1787 stats->overflows++; 1802 - skb_queue_walk_safe(&mp->frags, frag, nextf) { 1803 - if (mp->frames <= MP_MAX_QUEUE_LEN) 1804 - break; 1805 - __skb_unlink(frag, &mp->frags); 1806 - isdn_ppp_mp_free_skb(mp, frag); 1788 + while (mp->frames > MP_MAX_QUEUE_LEN) { 1789 + frag = mp->frags->next; 1790 + isdn_ppp_mp_free_skb(mp, mp->frags); 1791 + mp->frags = frag; 1807 1792 } 1808 1793 } 1809 1794 spin_unlock_irqrestore(&mp->lock, flags); 1810 1795 } 1811 1796 1812 - static void isdn_ppp_mp_cleanup(isdn_net_local *lp) 1797 + static void isdn_ppp_mp_cleanup( isdn_net_local * lp ) 1813 1798 { 1814 - struct sk_buff *skb, *tmp; 1815 - 1816 - skb_queue_walk_safe(&lp->netdev->pb->frags, skb, tmp) { 1817 - __skb_unlink(skb, &lp->netdev->pb->frags); 1818 - isdn_ppp_mp_free_skb(lp->netdev->pb, skb); 1799 + struct sk_buff * frag = lp->netdev->pb->frags; 1800 + struct sk_buff * nextfrag; 1801 + while( frag ) { 1802 + nextfrag = frag->next; 1803 + isdn_ppp_mp_free_skb(lp->netdev->pb, frag); 1804 + frag = nextfrag; 1819 1805 } 1806 + lp->netdev->pb->frags = NULL; 1820 1807 } 1821 1808 1822 1809 static u32 isdn_ppp_mp_get_seq( int short_seq, ··· 1855 1838 return seq; 1856 1839 } 1857 1840 1858 - static void isdn_ppp_mp_discard(ippp_bundle *mp, struct sk_buff *from, 1859 - struct sk_buff *to) 1841 + struct sk_buff * isdn_ppp_mp_discard( ippp_bundle * mp, 1842 + struct sk_buff * from, struct sk_buff * to ) 1860 1843 { 1861 - if (from) { 1862 - struct sk_buff *skb, *tmp; 1863 - int freeing = 0; 1864 - 1865 - skb_queue_walk_safe(&mp->frags, skb, tmp) { 1866 - if (skb == to) 1867 - break; 1868 - if (skb == from) 1869 - freeing = 1; 1870 - if (!freeing) 1871 - continue; 1872 - __skb_unlink(skb, &mp->frags); 1873 - isdn_ppp_mp_free_skb(mp, skb); 1844 + if( from ) 1845 + while (from != to) { 1846 + struct sk_buff * next = from->next; 1847 + isdn_ppp_mp_free_skb(mp, from); 1848 + from = next; 1874 1849 } 1875 - } 1850 + return from; 1876 1851 } 1877 1852 1878 - static unsigned int calc_tot_len(struct sk_buff_head *queue, 1879 - struct sk_buff *from, struct sk_buff *to) 1853 + void isdn_ppp_mp_reassembly( isdn_net_dev * net_dev, isdn_net_local * lp, 1854 + struct sk_buff * from, struct sk_buff * to ) 1880 1855 { 1881 - unsigned int tot_len = 0; 1882 - struct sk_buff *skb; 1883 - int found_start = 0; 1884 - 1885 - skb_queue_walk(queue, skb) { 1886 - if (skb == from) 1887 - found_start = 1; 1888 - if (!found_start) 1889 - continue; 1890 - tot_len += skb->len - MP_HEADER_LEN; 1891 - if (skb == to) 1892 - break; 1893 - } 1894 - return tot_len; 1895 - } 1896 - 1897 - /* Reassemble packet using fragments in the reassembly queue from 1898 - * 'from' until 'to', inclusive. 1899 - */ 1900 - static void isdn_ppp_mp_reassembly(isdn_net_dev *net_dev, isdn_net_local *lp, 1901 - struct sk_buff *from, struct sk_buff *to, 1902 - u32 lastseq) 1903 - { 1904 - ippp_bundle *mp = net_dev->pb; 1905 - unsigned int tot_len; 1906 - struct sk_buff *skb; 1856 + ippp_bundle * mp = net_dev->pb; 1907 1857 int proto; 1858 + struct sk_buff * skb; 1859 + unsigned int tot_len; 1908 1860 1909 1861 if (lp->ppp_slot < 0 || lp->ppp_slot >= ISDN_MAX_CHANNELS) { 1910 1862 printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n", 1911 1863 __func__, lp->ppp_slot); 1912 1864 return; 1913 1865 } 1914 - 1915 - tot_len = calc_tot_len(&mp->frags, from, to); 1916 - 1917 - if (MP_FLAGS(from) == (MP_BEGIN_FRAG | MP_END_FRAG)) { 1918 - if (ippp_table[lp->ppp_slot]->debug & 0x40) 1866 + if( MP_FLAGS(from) == (MP_BEGIN_FRAG | MP_END_FRAG) ) { 1867 + if( ippp_table[lp->ppp_slot]->debug & 0x40 ) 1919 1868 printk(KERN_DEBUG "isdn_mppp: reassembly: frame %d, " 1920 - "len %d\n", MP_SEQ(from), from->len); 1869 + "len %d\n", MP_SEQ(from), from->len ); 1921 1870 skb = from; 1922 1871 skb_pull(skb, MP_HEADER_LEN); 1923 - __skb_unlink(skb, &mp->frags); 1924 1872 mp->frames--; 1925 1873 } else { 1926 - struct sk_buff *walk, *tmp; 1927 - int found_start = 0; 1874 + struct sk_buff * frag; 1875 + int n; 1928 1876 1929 - if (ippp_table[lp->ppp_slot]->debug & 0x40) 1877 + for(tot_len=n=0, frag=from; frag != to; frag=frag->next, n++) 1878 + tot_len += frag->len - MP_HEADER_LEN; 1879 + 1880 + if( ippp_table[lp->ppp_slot]->debug & 0x40 ) 1930 1881 printk(KERN_DEBUG"isdn_mppp: reassembling frames %d " 1931 - "to %d, len %d\n", MP_SEQ(from), lastseq, 1932 - tot_len); 1933 - 1934 - skb = dev_alloc_skb(tot_len); 1935 - if (!skb) 1882 + "to %d, len %d\n", MP_SEQ(from), 1883 + (MP_SEQ(from)+n-1) & MP_LONGSEQ_MASK, tot_len ); 1884 + if( (skb = dev_alloc_skb(tot_len)) == NULL ) { 1936 1885 printk(KERN_ERR "isdn_mppp: cannot allocate sk buff " 1937 - "of size %d\n", tot_len); 1886 + "of size %d\n", tot_len); 1887 + isdn_ppp_mp_discard(mp, from, to); 1888 + return; 1889 + } 1938 1890 1939 - found_start = 0; 1940 - skb_queue_walk_safe(&mp->frags, walk, tmp) { 1941 - if (walk == from) 1942 - found_start = 1; 1943 - if (!found_start) 1944 - continue; 1891 + while( from != to ) { 1892 + unsigned int len = from->len - MP_HEADER_LEN; 1945 1893 1946 - if (skb) { 1947 - unsigned int len = walk->len - MP_HEADER_LEN; 1948 - skb_copy_from_linear_data_offset(walk, MP_HEADER_LEN, 1949 - skb_put(skb, len), 1950 - len); 1951 - } 1952 - __skb_unlink(walk, &mp->frags); 1953 - isdn_ppp_mp_free_skb(mp, walk); 1954 - 1955 - if (walk == to) 1956 - break; 1894 + skb_copy_from_linear_data_offset(from, MP_HEADER_LEN, 1895 + skb_put(skb,len), 1896 + len); 1897 + frag = from->next; 1898 + isdn_ppp_mp_free_skb(mp, from); 1899 + from = frag; 1957 1900 } 1958 1901 } 1959 - if (!skb) 1960 - return; 1961 - 1962 1902 proto = isdn_ppp_strip_proto(skb); 1963 1903 isdn_ppp_push_higher(net_dev, lp, skb, proto); 1964 1904 } 1965 1905 1966 - static void isdn_ppp_mp_free_skb(ippp_bundle *mp, struct sk_buff *skb) 1906 + static void isdn_ppp_mp_free_skb(ippp_bundle * mp, struct sk_buff * skb) 1967 1907 { 1968 1908 dev_kfree_skb(skb); 1969 1909 mp->frames--;
+5 -55
drivers/net/can/Kconfig
··· 35 35 arguments "tq", "prop_seg", "phase_seg1", "phase_seg2" and "sjw". 36 36 If unsure, say Y. 37 37 38 - config CAN_SJA1000 39 - depends on CAN_DEV && HAS_IOMEM 40 - tristate "Philips SJA1000" 41 - ---help--- 42 - Driver for the SJA1000 CAN controllers from Philips or NXP 43 - 44 - config CAN_SJA1000_ISA 45 - depends on CAN_SJA1000 && ISA 46 - tristate "ISA Bus based legacy SJA1000 driver" 47 - ---help--- 48 - This driver adds legacy support for SJA1000 chips connected to 49 - the ISA bus using I/O port, memory mapped or indirect access. 50 - 51 - config CAN_SJA1000_PLATFORM 52 - depends on CAN_SJA1000 53 - tristate "Generic Platform Bus based SJA1000 driver" 54 - ---help--- 55 - This driver adds support for the SJA1000 chips connected to 56 - the "platform bus" (Linux abstraction for directly to the 57 - processor attached devices). Which can be found on various 58 - boards from Phytec (http://www.phytec.de) like the PCM027, 59 - PCM038. 60 - 61 - config CAN_SJA1000_OF_PLATFORM 62 - depends on CAN_SJA1000 && PPC_OF 63 - tristate "Generic OF Platform Bus based SJA1000 driver" 64 - ---help--- 65 - This driver adds support for the SJA1000 chips connected to 66 - the OpenFirmware "platform bus" found on embedded systems with 67 - OpenFirmware bindings, e.g. if you have a PowerPC based system 68 - you may want to enable this option. 69 - 70 - config CAN_EMS_PCI 71 - tristate "EMS CPC-PCI, CPC-PCIe and CPC-104P Card" 72 - depends on PCI && CAN_SJA1000 73 - ---help--- 74 - This driver is for the one, two or four channel CPC-PCI, 75 - CPC-PCIe and CPC-104P cards from EMS Dr. Thomas Wuensche 76 - (http://www.ems-wuensche.de). 77 - 78 - config CAN_EMS_USB 79 - tristate "EMS CPC-USB/ARM7 CAN/USB interface" 80 - depends on USB && CAN_DEV 81 - ---help--- 82 - This driver is for the one channel CPC-USB/ARM7 CAN/USB interface 83 - from from EMS Dr. Thomas Wuensche (http://www.ems-wuensche.de). 84 - 85 - config CAN_KVASER_PCI 86 - tristate "Kvaser PCIcanx and Kvaser PCIcan PCI Cards" 87 - depends on PCI && CAN_SJA1000 88 - ---help--- 89 - This driver is for the the PCIcanx and PCIcan cards (1, 2 or 90 - 4 channel) from Kvaser (http://www.kvaser.com). 91 - 92 38 config CAN_AT91 93 39 tristate "Atmel AT91 onchip CAN controller" 94 - depends on CAN && CAN_DEV && ARCH_AT91SAM9263 40 + depends on CAN_DEV && ARCH_AT91SAM9263 95 41 ---help--- 96 42 This is a driver for the SoC CAN controller in Atmel's AT91SAM9263. 43 + 44 + source "drivers/net/can/sja1000/Kconfig" 45 + 46 + source "drivers/net/can/usb/Kconfig" 97 47 98 48 config CAN_DEBUG_DEVICES 99 49 bool "CAN devices debugging messages"
+6
drivers/net/can/dev.c
··· 629 629 return -EMSGSIZE; 630 630 } 631 631 632 + static size_t can_get_xstats_size(const struct net_device *dev) 633 + { 634 + return sizeof(struct can_device_stats); 635 + } 636 + 632 637 static int can_fill_xstats(struct sk_buff *skb, const struct net_device *dev) 633 638 { 634 639 struct can_priv *priv = netdev_priv(dev); ··· 662 657 .changelink = can_changelink, 663 658 .get_size = can_get_size, 664 659 .fill_info = can_fill_info, 660 + .get_xstats_size = can_get_xstats_size, 665 661 .fill_xstats = can_fill_xstats, 666 662 }; 667 663
+47
drivers/net/can/sja1000/Kconfig
··· 1 + menuconfig CAN_SJA1000 2 + tristate "Philips/NXP SJA1000 devices" 3 + depends on CAN_DEV && HAS_IOMEM 4 + 5 + if CAN_SJA1000 6 + 7 + config CAN_SJA1000_ISA 8 + tristate "ISA Bus based legacy SJA1000 driver" 9 + depends on ISA 10 + ---help--- 11 + This driver adds legacy support for SJA1000 chips connected to 12 + the ISA bus using I/O port, memory mapped or indirect access. 13 + 14 + config CAN_SJA1000_PLATFORM 15 + tristate "Generic Platform Bus based SJA1000 driver" 16 + ---help--- 17 + This driver adds support for the SJA1000 chips connected to 18 + the "platform bus" (Linux abstraction for directly to the 19 + processor attached devices). Which can be found on various 20 + boards from Phytec (http://www.phytec.de) like the PCM027, 21 + PCM038. 22 + 23 + config CAN_SJA1000_OF_PLATFORM 24 + tristate "Generic OF Platform Bus based SJA1000 driver" 25 + depends on PPC_OF 26 + ---help--- 27 + This driver adds support for the SJA1000 chips connected to 28 + the OpenFirmware "platform bus" found on embedded systems with 29 + OpenFirmware bindings, e.g. if you have a PowerPC based system 30 + you may want to enable this option. 31 + 32 + config CAN_EMS_PCI 33 + tristate "EMS CPC-PCI, CPC-PCIe and CPC-104P Card" 34 + depends on PCI 35 + ---help--- 36 + This driver is for the one, two or four channel CPC-PCI, 37 + CPC-PCIe and CPC-104P cards from EMS Dr. Thomas Wuensche 38 + (http://www.ems-wuensche.de). 39 + 40 + config CAN_KVASER_PCI 41 + tristate "Kvaser PCIcanx and Kvaser PCIcan PCI Cards" 42 + depends on PCI 43 + ---help--- 44 + This driver is for the the PCIcanx and PCIcan cards (1, 2 or 45 + 4 channel) from Kvaser (http://www.kvaser.com). 46 + 47 + endif
+10
drivers/net/can/usb/Kconfig
··· 1 + menu "CAN USB interfaces" 2 + depends on USB && CAN_DEV 3 + 4 + config CAN_EMS_USB 5 + tristate "EMS CPC-USB/ARM7 CAN/USB interface" 6 + ---help--- 7 + This driver is for the one channel CPC-USB/ARM7 CAN/USB interface 8 + from from EMS Dr. Thomas Wuensche (http://www.ems-wuensche.de). 9 + 10 + endmenu
+2
drivers/net/can/usb/Makefile
··· 3 3 # 4 4 5 5 obj-$(CONFIG_CAN_EMS_USB) += ems_usb.o 6 + 7 + ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG
+2 -2
drivers/net/cxgb3/sge.c
··· 879 879 pci_dma_sync_single_for_cpu(adap->pdev, dma_addr, len, 880 880 PCI_DMA_FROMDEVICE); 881 881 (*sd->pg_chunk.p_cnt)--; 882 - if (!*sd->pg_chunk.p_cnt) 882 + if (!*sd->pg_chunk.p_cnt && sd->pg_chunk.page != fl->pg_chunk.page) 883 883 pci_unmap_page(adap->pdev, 884 884 sd->pg_chunk.mapping, 885 885 fl->alloc_size, ··· 2088 2088 PCI_DMA_FROMDEVICE); 2089 2089 2090 2090 (*sd->pg_chunk.p_cnt)--; 2091 - if (!*sd->pg_chunk.p_cnt) 2091 + if (!*sd->pg_chunk.p_cnt && sd->pg_chunk.page != fl->pg_chunk.page) 2092 2092 pci_unmap_page(adap->pdev, 2093 2093 sd->pg_chunk.mapping, 2094 2094 fl->alloc_size,
-3
drivers/net/davinci_emac.c
··· 2140 2140 u32 status = 0; 2141 2141 u32 num_pkts = 0; 2142 2142 2143 - if (!netif_running(ndev)) 2144 - return 0; 2145 - 2146 2143 /* Check interrupt vectors and call packet processing */ 2147 2144 status = emac_read(EMAC_MACINVECTOR); 2148 2145
+1 -4
drivers/net/forcedeth.c
··· 5821 5821 dev->dev_addr); 5822 5822 dev_printk(KERN_ERR, &pci_dev->dev, 5823 5823 "Please complain to your hardware vendor. Switching to a random MAC.\n"); 5824 - dev->dev_addr[0] = 0x00; 5825 - dev->dev_addr[1] = 0x00; 5826 - dev->dev_addr[2] = 0x6c; 5827 - get_random_bytes(&dev->dev_addr[3], 3); 5824 + random_ether_addr(dev->dev_addr); 5828 5825 } 5829 5826 5830 5827 dprintk(KERN_DEBUG "%s: MAC Address %pM\n",
+2 -2
drivers/net/ibm_newemac/emac.h
··· 263 263 264 264 265 265 /* EMACx_TRTR */ 266 - #define EMAC_TRTR_SHIFT_EMAC4 27 267 - #define EMAC_TRTR_SHIFT 24 266 + #define EMAC_TRTR_SHIFT_EMAC4 24 267 + #define EMAC_TRTR_SHIFT 27 268 268 269 269 /* EMAC specific TX descriptor control fields (write access) */ 270 270 #define EMAC_TX_CTRL_GFCS 0x0200
+1
drivers/net/ixgbe/ixgbe_main.c
··· 5994 5994 } else { 5995 5995 pci_set_master(pdev); 5996 5996 pci_restore_state(pdev); 5997 + pci_save_state(pdev); 5997 5998 5998 5999 pci_wake_from_d3(pdev, false); 5999 6000
+1 -1
drivers/net/phy/mdio-gpio.c
··· 139 139 return NULL; 140 140 } 141 141 142 - static void __devinit mdio_gpio_bus_deinit(struct device *dev) 142 + static void mdio_gpio_bus_deinit(struct device *dev) 143 143 { 144 144 struct mii_bus *bus = dev_get_drvdata(dev); 145 145 struct mdio_gpio_info *bitbang = bus->priv;
+9 -2
drivers/net/ppp_generic.c
··· 1944 1944 } 1945 1945 1946 1946 /* Pull completed packets off the queue and receive them. */ 1947 - while ((skb = ppp_mp_reconstruct(ppp))) 1948 - ppp_receive_nonmp_frame(ppp, skb); 1947 + while ((skb = ppp_mp_reconstruct(ppp))) { 1948 + if (pskb_may_pull(skb, 2)) 1949 + ppp_receive_nonmp_frame(ppp, skb); 1950 + else { 1951 + ++ppp->dev->stats.rx_length_errors; 1952 + kfree_skb(skb); 1953 + ppp_receive_error(ppp); 1954 + } 1955 + } 1949 1956 1950 1957 return; 1951 1958
+1 -1
drivers/net/r6040.c
··· 1085 1085 int bar = 0; 1086 1086 u16 *adrp; 1087 1087 1088 - printk(KERN_INFO "%s\n", version); 1088 + printk("%s\n", version); 1089 1089 1090 1090 err = pci_enable_device(pdev); 1091 1091 if (err)
+2 -2
drivers/net/r8169.c
··· 3243 3243 static void rtl8169_set_rxbufsize(struct rtl8169_private *tp, 3244 3244 struct net_device *dev) 3245 3245 { 3246 - unsigned int mtu = dev->mtu; 3246 + unsigned int max_frame = dev->mtu + VLAN_ETH_HLEN + ETH_FCS_LEN; 3247 3247 3248 - tp->rx_buf_sz = (mtu > RX_BUF_SIZE) ? mtu + ETH_HLEN + 8 : RX_BUF_SIZE; 3248 + tp->rx_buf_sz = (max_frame > RX_BUF_SIZE) ? max_frame : RX_BUF_SIZE; 3249 3249 } 3250 3250 3251 3251 static int rtl8169_open(struct net_device *dev)
+1
drivers/net/s2io.c
··· 3494 3494 3495 3495 /* Restore the PCI state saved during initialization. */ 3496 3496 pci_restore_state(sp->pdev); 3497 + pci_save_state(sp->pdev); 3497 3498 pci_read_config_word(sp->pdev, 0x2, &val16); 3498 3499 if (check_pci_device_id(val16) != (u16)PCI_ANY_ID) 3499 3500 break;
+1 -1
drivers/net/smsc911x.c
··· 986 986 struct net_device *dev = pdata->dev; 987 987 int npackets = 0; 988 988 989 - while (likely(netif_running(dev)) && (npackets < budget)) { 989 + while (npackets < budget) { 990 990 unsigned int pktlength; 991 991 unsigned int pktwords; 992 992 struct sk_buff *skb;
+9 -1
drivers/net/sungem.c
··· 2063 2063 mif_cfg &= ~MIF_CFG_PSELECT; 2064 2064 writel(mif_cfg, gp->regs + MIF_CFG); 2065 2065 } else { 2066 - gp->phy_type = phy_serialink; 2066 + #ifdef CONFIG_SPARC 2067 + const char *p; 2068 + 2069 + p = of_get_property(gp->of_node, "shared-pins", NULL); 2070 + if (p && !strcmp(p, "serdes")) 2071 + gp->phy_type = phy_serdes; 2072 + else 2073 + #endif 2074 + gp->phy_type = phy_serialink; 2067 2075 } 2068 2076 if (gp->phy_type == phy_mii_mdio1 || 2069 2077 gp->phy_type == phy_mii_mdio0) {
-1
drivers/net/wireless/ath/ath5k/base.c
··· 1125 1125 /* configure operational mode */ 1126 1126 ath5k_hw_set_opmode(ah); 1127 1127 1128 - ath5k_hw_set_mcast_filter(ah, 0, 0); 1129 1128 ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "RX filter 0x%x\n", rfilt); 1130 1129 } 1131 1130
+4
drivers/net/wireless/ath/ath5k/led.c
··· 63 63 { ATH_SDEVICE(PCI_VENDOR_ID_AMBIT, 0x0422), ATH_LED(1, 1) }, 64 64 /* E-machines E510 (tuliom@gmail.com) */ 65 65 { ATH_SDEVICE(PCI_VENDOR_ID_AMBIT, 0x0428), ATH_LED(3, 0) }, 66 + /* BenQ Joybook R55v (nowymarluk@wp.pl) */ 67 + { ATH_SDEVICE(PCI_VENDOR_ID_QMI, 0x0100), ATH_LED(1, 0) }, 66 68 /* Acer Extensa 5620z (nekoreeve@gmail.com) */ 67 69 { ATH_SDEVICE(PCI_VENDOR_ID_QMI, 0x0105), ATH_LED(3, 0) }, 68 70 /* Fukato Datacask Jupiter 1014a (mrb74@gmx.at) */ 69 71 { ATH_SDEVICE(PCI_VENDOR_ID_AZWAVE, 0x1026), ATH_LED(3, 0) }, 70 72 /* IBM ThinkPad AR5BXB6 (legovini@spiro.fisica.unipd.it) */ 71 73 { ATH_SDEVICE(PCI_VENDOR_ID_IBM, 0x058a), ATH_LED(1, 0) }, 74 + /* HP Compaq CQ60-206US (ddreggors@jumptv.com) */ 75 + { ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137a), ATH_LED(3, 1) }, 72 76 /* HP Compaq C700 (nitrousnrg@gmail.com) */ 73 77 { ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137b), ATH_LED(3, 1) }, 74 78 /* IBM-specific AR5212 (all others) */
+1 -2
drivers/net/wireless/b43/main.c
··· 4521 4521 { 4522 4522 struct b43_wl *wl = hw_to_b43_wl(hw); 4523 4523 4524 - mutex_lock(&wl->mutex); 4524 + /* FIXME: add locking */ 4525 4525 b43_update_templates(wl); 4526 - mutex_unlock(&wl->mutex); 4527 4526 4528 4527 return 0; 4529 4528 }
+3 -3
drivers/net/wireless/ipw2x00/ipw2100.c
··· 6029 6029 struct ipw2100_priv *priv; 6030 6030 struct net_device *dev; 6031 6031 6032 - dev = alloc_ieee80211(sizeof(struct ipw2100_priv), 0); 6032 + dev = alloc_ieee80211(sizeof(struct ipw2100_priv)); 6033 6033 if (!dev) 6034 6034 return NULL; 6035 6035 priv = libipw_priv(dev); ··· 6342 6342 sysfs_remove_group(&pci_dev->dev.kobj, 6343 6343 &ipw2100_attribute_group); 6344 6344 6345 - free_ieee80211(dev, 0); 6345 + free_ieee80211(dev); 6346 6346 pci_set_drvdata(pci_dev, NULL); 6347 6347 } 6348 6348 ··· 6400 6400 if (dev->base_addr) 6401 6401 iounmap((void __iomem *)dev->base_addr); 6402 6402 6403 - free_ieee80211(dev, 0); 6403 + free_ieee80211(dev); 6404 6404 } 6405 6405 6406 6406 pci_release_regions(pci_dev);
+28 -113
drivers/net/wireless/ipw2x00/ipw2200.c
··· 104 104 static int rtap_iface = 0; /* def: 0 -- do not create rtap interface */ 105 105 #endif 106 106 107 - static struct ieee80211_rate ipw2200_rates[] = { 108 - { .bitrate = 10 }, 109 - { .bitrate = 20, .flags = IEEE80211_RATE_SHORT_PREAMBLE }, 110 - { .bitrate = 55, .flags = IEEE80211_RATE_SHORT_PREAMBLE }, 111 - { .bitrate = 110, .flags = IEEE80211_RATE_SHORT_PREAMBLE }, 112 - { .bitrate = 60 }, 113 - { .bitrate = 90 }, 114 - { .bitrate = 120 }, 115 - { .bitrate = 180 }, 116 - { .bitrate = 240 }, 117 - { .bitrate = 360 }, 118 - { .bitrate = 480 }, 119 - { .bitrate = 540 } 120 - }; 121 - 122 - #define ipw2200_a_rates (ipw2200_rates + 4) 123 - #define ipw2200_num_a_rates 8 124 - #define ipw2200_bg_rates (ipw2200_rates + 0) 125 - #define ipw2200_num_bg_rates 12 126 107 127 108 #ifdef CONFIG_IPW2200_QOS 128 109 static int qos_enable = 0; ··· 8655 8674 * 8656 8675 */ 8657 8676 8677 + static int ipw_wx_get_name(struct net_device *dev, 8678 + struct iw_request_info *info, 8679 + union iwreq_data *wrqu, char *extra) 8680 + { 8681 + struct ipw_priv *priv = libipw_priv(dev); 8682 + mutex_lock(&priv->mutex); 8683 + if (priv->status & STATUS_RF_KILL_MASK) 8684 + strcpy(wrqu->name, "radio off"); 8685 + else if (!(priv->status & STATUS_ASSOCIATED)) 8686 + strcpy(wrqu->name, "unassociated"); 8687 + else 8688 + snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11%c", 8689 + ipw_modes[priv->assoc_request.ieee_mode]); 8690 + IPW_DEBUG_WX("Name: %s\n", wrqu->name); 8691 + mutex_unlock(&priv->mutex); 8692 + return 0; 8693 + } 8694 + 8658 8695 static int ipw_set_channel(struct ipw_priv *priv, u8 channel) 8659 8696 { 8660 8697 if (channel == 0) { ··· 9972 9973 /* Rebase the WE IOCTLs to zero for the handler array */ 9973 9974 #define IW_IOCTL(x) [(x)-SIOCSIWCOMMIT] 9974 9975 static iw_handler ipw_wx_handlers[] = { 9975 - IW_IOCTL(SIOCGIWNAME) = (iw_handler) cfg80211_wext_giwname, 9976 + IW_IOCTL(SIOCGIWNAME) = ipw_wx_get_name, 9976 9977 IW_IOCTL(SIOCSIWFREQ) = ipw_wx_set_freq, 9977 9978 IW_IOCTL(SIOCGIWFREQ) = ipw_wx_get_freq, 9978 9979 IW_IOCTL(SIOCSIWMODE) = ipw_wx_set_mode, ··· 11416 11417 /* Called by register_netdev() */ 11417 11418 static int ipw_net_init(struct net_device *dev) 11418 11419 { 11419 - int i, rc = 0; 11420 11420 struct ipw_priv *priv = libipw_priv(dev); 11421 - const struct libipw_geo *geo = libipw_get_geo(priv->ieee); 11422 - struct wireless_dev *wdev = &priv->ieee->wdev; 11423 11421 mutex_lock(&priv->mutex); 11424 11422 11425 11423 if (ipw_up(priv)) { 11426 - rc = -EIO; 11427 - goto out; 11424 + mutex_unlock(&priv->mutex); 11425 + return -EIO; 11428 11426 } 11429 11427 11430 - memcpy(wdev->wiphy->perm_addr, priv->mac_addr, ETH_ALEN); 11431 - 11432 - /* fill-out priv->ieee->bg_band */ 11433 - if (geo->bg_channels) { 11434 - struct ieee80211_supported_band *bg_band = &priv->ieee->bg_band; 11435 - 11436 - bg_band->band = IEEE80211_BAND_2GHZ; 11437 - bg_band->n_channels = geo->bg_channels; 11438 - bg_band->channels = 11439 - kzalloc(geo->bg_channels * 11440 - sizeof(struct ieee80211_channel), GFP_KERNEL); 11441 - /* translate geo->bg to bg_band.channels */ 11442 - for (i = 0; i < geo->bg_channels; i++) { 11443 - bg_band->channels[i].band = IEEE80211_BAND_2GHZ; 11444 - bg_band->channels[i].center_freq = geo->bg[i].freq; 11445 - bg_band->channels[i].hw_value = geo->bg[i].channel; 11446 - bg_band->channels[i].max_power = geo->bg[i].max_power; 11447 - if (geo->bg[i].flags & LIBIPW_CH_PASSIVE_ONLY) 11448 - bg_band->channels[i].flags |= 11449 - IEEE80211_CHAN_PASSIVE_SCAN; 11450 - if (geo->bg[i].flags & LIBIPW_CH_NO_IBSS) 11451 - bg_band->channels[i].flags |= 11452 - IEEE80211_CHAN_NO_IBSS; 11453 - if (geo->bg[i].flags & LIBIPW_CH_RADAR_DETECT) 11454 - bg_band->channels[i].flags |= 11455 - IEEE80211_CHAN_RADAR; 11456 - /* No equivalent for LIBIPW_CH_80211H_RULES, 11457 - LIBIPW_CH_UNIFORM_SPREADING, or 11458 - LIBIPW_CH_B_ONLY... */ 11459 - } 11460 - /* point at bitrate info */ 11461 - bg_band->bitrates = ipw2200_bg_rates; 11462 - bg_band->n_bitrates = ipw2200_num_bg_rates; 11463 - 11464 - wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = bg_band; 11465 - } 11466 - 11467 - /* fill-out priv->ieee->a_band */ 11468 - if (geo->a_channels) { 11469 - struct ieee80211_supported_band *a_band = &priv->ieee->a_band; 11470 - 11471 - a_band->band = IEEE80211_BAND_5GHZ; 11472 - a_band->n_channels = geo->a_channels; 11473 - a_band->channels = 11474 - kzalloc(geo->a_channels * 11475 - sizeof(struct ieee80211_channel), GFP_KERNEL); 11476 - /* translate geo->bg to a_band.channels */ 11477 - for (i = 0; i < geo->a_channels; i++) { 11478 - a_band->channels[i].band = IEEE80211_BAND_2GHZ; 11479 - a_band->channels[i].center_freq = geo->a[i].freq; 11480 - a_band->channels[i].hw_value = geo->a[i].channel; 11481 - a_band->channels[i].max_power = geo->a[i].max_power; 11482 - if (geo->a[i].flags & LIBIPW_CH_PASSIVE_ONLY) 11483 - a_band->channels[i].flags |= 11484 - IEEE80211_CHAN_PASSIVE_SCAN; 11485 - if (geo->a[i].flags & LIBIPW_CH_NO_IBSS) 11486 - a_band->channels[i].flags |= 11487 - IEEE80211_CHAN_NO_IBSS; 11488 - if (geo->a[i].flags & LIBIPW_CH_RADAR_DETECT) 11489 - a_band->channels[i].flags |= 11490 - IEEE80211_CHAN_RADAR; 11491 - /* No equivalent for LIBIPW_CH_80211H_RULES, 11492 - LIBIPW_CH_UNIFORM_SPREADING, or 11493 - LIBIPW_CH_B_ONLY... */ 11494 - } 11495 - /* point at bitrate info */ 11496 - a_band->bitrates = ipw2200_a_rates; 11497 - a_band->n_bitrates = ipw2200_num_a_rates; 11498 - 11499 - wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = a_band; 11500 - } 11501 - 11502 - set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev); 11503 - 11504 - /* With that information in place, we can now register the wiphy... */ 11505 - if (wiphy_register(wdev->wiphy)) { 11506 - rc = -EIO; 11507 - goto out; 11508 - } 11509 - 11510 - out: 11511 11428 mutex_unlock(&priv->mutex); 11512 - return rc; 11429 + return 0; 11513 11430 } 11514 11431 11515 11432 /* PCI driver stuff */ ··· 11556 11641 if (priv->prom_net_dev) 11557 11642 return -EPERM; 11558 11643 11559 - priv->prom_net_dev = alloc_ieee80211(sizeof(struct ipw_prom_priv), 1); 11644 + priv->prom_net_dev = alloc_ieee80211(sizeof(struct ipw_prom_priv)); 11560 11645 if (priv->prom_net_dev == NULL) 11561 11646 return -ENOMEM; 11562 11647 ··· 11575 11660 11576 11661 rc = register_netdev(priv->prom_net_dev); 11577 11662 if (rc) { 11578 - free_ieee80211(priv->prom_net_dev, 1); 11663 + free_ieee80211(priv->prom_net_dev); 11579 11664 priv->prom_net_dev = NULL; 11580 11665 return rc; 11581 11666 } ··· 11589 11674 return; 11590 11675 11591 11676 unregister_netdev(priv->prom_net_dev); 11592 - free_ieee80211(priv->prom_net_dev, 1); 11677 + free_ieee80211(priv->prom_net_dev); 11593 11678 11594 11679 priv->prom_net_dev = NULL; 11595 11680 } ··· 11617 11702 struct ipw_priv *priv; 11618 11703 int i; 11619 11704 11620 - net_dev = alloc_ieee80211(sizeof(struct ipw_priv), 0); 11705 + net_dev = alloc_ieee80211(sizeof(struct ipw_priv)); 11621 11706 if (net_dev == NULL) { 11622 11707 err = -ENOMEM; 11623 11708 goto out; ··· 11765 11850 pci_disable_device(pdev); 11766 11851 pci_set_drvdata(pdev, NULL); 11767 11852 out_free_ieee80211: 11768 - free_ieee80211(priv->net_dev, 0); 11853 + free_ieee80211(priv->net_dev); 11769 11854 out: 11770 11855 return err; 11771 11856 } ··· 11832 11917 pci_release_regions(pdev); 11833 11918 pci_disable_device(pdev); 11834 11919 pci_set_drvdata(pdev, NULL); 11835 - free_ieee80211(priv->net_dev, 0); 11920 + free_ieee80211(priv->net_dev); 11836 11921 free_firmware(); 11837 11922 } 11838 11923
+2 -6
drivers/net/wireless/ipw2x00/libipw.h
··· 31 31 #include <linux/ieee80211.h> 32 32 33 33 #include <net/lib80211.h> 34 - #include <net/cfg80211.h> 35 34 36 35 #define LIBIPW_VERSION "git-1.1.13" 37 36 ··· 783 784 784 785 struct libipw_device { 785 786 struct net_device *dev; 786 - struct wireless_dev wdev; 787 787 struct libipw_security sec; 788 788 789 789 /* Bookkeeping structures */ 790 790 struct libipw_stats ieee_stats; 791 791 792 792 struct libipw_geo geo; 793 - struct ieee80211_supported_band bg_band; 794 - struct ieee80211_supported_band a_band; 795 793 796 794 /* Probe / Beacon management */ 797 795 struct list_head network_free_list; ··· 1014 1018 } 1015 1019 1016 1020 /* ieee80211.c */ 1017 - extern void free_ieee80211(struct net_device *dev, int monitor); 1018 - extern struct net_device *alloc_ieee80211(int sizeof_priv, int monitor); 1021 + extern void free_ieee80211(struct net_device *dev); 1022 + extern struct net_device *alloc_ieee80211(int sizeof_priv); 1019 1023 extern int libipw_change_mtu(struct net_device *dev, int new_mtu); 1020 1024 1021 1025 extern void libipw_networks_age(struct libipw_device *ieee,
+3 -39
drivers/net/wireless/ipw2x00/libipw_module.c
··· 62 62 MODULE_AUTHOR(DRV_COPYRIGHT); 63 63 MODULE_LICENSE("GPL"); 64 64 65 - struct cfg80211_ops libipw_config_ops = { }; 66 - void *libipw_wiphy_privid = &libipw_wiphy_privid; 67 - 68 65 static int libipw_networks_allocate(struct libipw_device *ieee) 69 66 { 70 67 if (ieee->networks) ··· 140 143 } 141 144 EXPORT_SYMBOL(libipw_change_mtu); 142 145 143 - struct net_device *alloc_ieee80211(int sizeof_priv, int monitor) 146 + struct net_device *alloc_ieee80211(int sizeof_priv) 144 147 { 145 148 struct libipw_device *ieee; 146 149 struct net_device *dev; ··· 157 160 158 161 ieee->dev = dev; 159 162 160 - if (!monitor) { 161 - ieee->wdev.wiphy = wiphy_new(&libipw_config_ops, 0); 162 - if (!ieee->wdev.wiphy) { 163 - LIBIPW_ERROR("Unable to allocate wiphy.\n"); 164 - goto failed_free_netdev; 165 - } 166 - 167 - ieee->dev->ieee80211_ptr = &ieee->wdev; 168 - ieee->wdev.iftype = NL80211_IFTYPE_STATION; 169 - 170 - /* Fill-out wiphy structure bits we know... Not enough info 171 - here to call set_wiphy_dev or set MAC address or channel info 172 - -- have to do that in ->ndo_init... */ 173 - ieee->wdev.wiphy->privid = libipw_wiphy_privid; 174 - 175 - ieee->wdev.wiphy->max_scan_ssids = 1; 176 - ieee->wdev.wiphy->max_scan_ie_len = 0; 177 - ieee->wdev.wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) 178 - | BIT(NL80211_IFTYPE_ADHOC); 179 - } 180 - 181 163 err = libipw_networks_allocate(ieee); 182 164 if (err) { 183 165 LIBIPW_ERROR("Unable to allocate beacon storage: %d\n", err); 184 - goto failed_free_wiphy; 166 + goto failed_free_netdev; 185 167 } 186 168 libipw_networks_initialize(ieee); 187 169 ··· 193 217 194 218 return dev; 195 219 196 - failed_free_wiphy: 197 - if (!monitor) 198 - wiphy_free(ieee->wdev.wiphy); 199 220 failed_free_netdev: 200 221 free_netdev(dev); 201 222 failed: 202 223 return NULL; 203 224 } 204 225 205 - void free_ieee80211(struct net_device *dev, int monitor) 226 + void free_ieee80211(struct net_device *dev) 206 227 { 207 228 struct libipw_device *ieee = netdev_priv(dev); 208 229 209 230 lib80211_crypt_info_free(&ieee->crypt_info); 210 231 211 232 libipw_networks_free(ieee); 212 - 213 - /* free cfg80211 resources */ 214 - if (!monitor) { 215 - wiphy_unregister(ieee->wdev.wiphy); 216 - kfree(ieee->a_band.channels); 217 - kfree(ieee->bg_band.channels); 218 - wiphy_free(ieee->wdev.wiphy); 219 - } 220 - 221 233 free_netdev(dev); 222 234 } 223 235
+1
drivers/net/wireless/iwlwifi/iwl-1000.c
··· 161 161 .max_ll_items = OTP_MAX_LL_ITEMS_1000, 162 162 .shadow_ram_support = false, 163 163 .ht_greenfield_support = true, 164 + .use_rts_for_ht = true, /* use rts/cts protection */ 164 165 }; 165 166
+5
drivers/net/wireless/iwlwifi/iwl-6000.c
··· 175 175 .max_ll_items = OTP_MAX_LL_ITEMS_6x00, 176 176 .shadow_ram_support = true, 177 177 .ht_greenfield_support = true, 178 + .use_rts_for_ht = true, /* use rts/cts protection */ 178 179 }; 179 180 180 181 /* ··· 199 198 .max_ll_items = OTP_MAX_LL_ITEMS_6x00, 200 199 .shadow_ram_support = true, 201 200 .ht_greenfield_support = true, 201 + .use_rts_for_ht = true, /* use rts/cts protection */ 202 202 }; 203 203 204 204 struct iwl_cfg iwl6050_2agn_cfg = { ··· 220 218 .max_ll_items = OTP_MAX_LL_ITEMS_6x00, 221 219 .shadow_ram_support = true, 222 220 .ht_greenfield_support = true, 221 + .use_rts_for_ht = true, /* use rts/cts protection */ 223 222 }; 224 223 225 224 struct iwl_cfg iwl6000_3agn_cfg = { ··· 241 238 .max_ll_items = OTP_MAX_LL_ITEMS_6x00, 242 239 .shadow_ram_support = true, 243 240 .ht_greenfield_support = true, 241 + .use_rts_for_ht = true, /* use rts/cts protection */ 244 242 }; 245 243 246 244 struct iwl_cfg iwl6050_3agn_cfg = { ··· 262 258 .max_ll_items = OTP_MAX_LL_ITEMS_6x00, 263 259 .shadow_ram_support = true, 264 260 .ht_greenfield_support = true, 261 + .use_rts_for_ht = true, /* use rts/cts protection */ 265 262 }; 266 263 267 264 MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
+9
drivers/net/wireless/iwlwifi/iwl-agn-rs.c
··· 418 418 else if (tid == IWL_AGG_ALL_TID) 419 419 for (tid = 0; tid < TID_MAX_LOAD_COUNT; tid++) 420 420 rs_tl_turn_on_agg_for_tid(priv, lq_data, tid, sta); 421 + if (priv->cfg->use_rts_for_ht) { 422 + /* 423 + * switch to RTS/CTS if it is the prefer protection method 424 + * for HT traffic 425 + */ 426 + IWL_DEBUG_HT(priv, "use RTS/CTS protection for HT\n"); 427 + priv->staging_rxon.flags &= ~RXON_FLG_SELF_CTS_EN; 428 + iwlcore_commit_rxon(priv); 429 + } 421 430 } 422 431 423 432 static inline int get_num_of_ant_from_rate(u32 rate_n_flags)
+7 -3
drivers/net/wireless/iwlwifi/iwl-agn.c
··· 116 116 117 117 /* always get timestamp with Rx frame */ 118 118 priv->staging_rxon.flags |= RXON_FLG_TSF2HOST_MSK; 119 - /* allow CTS-to-self if possible. this is relevant only for 120 - * 5000, but will not damage 4965 */ 121 - priv->staging_rxon.flags |= RXON_FLG_SELF_CTS_EN; 122 119 123 120 ret = iwl_check_rxon_cmd(priv); 124 121 if (ret) { ··· 214 217 IWL_ERR(priv, 215 218 "Could not send WEP static key.\n"); 216 219 } 220 + 221 + /* 222 + * allow CTS-to-self if possible for new association. 223 + * this is relevant only for 5000 series and up, 224 + * but will not damage 4965 225 + */ 226 + priv->staging_rxon.flags |= RXON_FLG_SELF_CTS_EN; 217 227 218 228 /* Apply the new configuration 219 229 * RXON assoc doesn't clear the station table in uCode,
+2
drivers/net/wireless/iwlwifi/iwl-core.h
··· 213 213 * @pa_type: used by 6000 series only to identify the type of Power Amplifier 214 214 * @max_ll_items: max number of OTP blocks 215 215 * @shadow_ram_support: shadow support for OTP memory 216 + * @use_rts_for_ht: use rts/cts protection for HT traffic 216 217 * 217 218 * We enable the driver to be backward compatible wrt API version. The 218 219 * driver specifies which APIs it supports (with @ucode_api_max being the ··· 256 255 const bool shadow_ram_support; 257 256 const bool ht_greenfield_support; 258 257 const bool broken_powersave; 258 + bool use_rts_for_ht; 259 259 }; 260 260 261 261 /***************************
+10 -7
drivers/net/wireless/libertas/ethtool.c
··· 169 169 struct lbs_private *priv = dev->ml_priv; 170 170 uint32_t criteria = 0; 171 171 172 - if (priv->wol_criteria == 0xffffffff && wol->wolopts) 173 - return -EOPNOTSUPP; 174 - 175 172 if (wol->wolopts & ~(WAKE_UCAST|WAKE_MCAST|WAKE_BCAST|WAKE_PHY)) 176 173 return -EOPNOTSUPP; 177 174 178 - if (wol->wolopts & WAKE_UCAST) criteria |= EHS_WAKE_ON_UNICAST_DATA; 179 - if (wol->wolopts & WAKE_MCAST) criteria |= EHS_WAKE_ON_MULTICAST_DATA; 180 - if (wol->wolopts & WAKE_BCAST) criteria |= EHS_WAKE_ON_BROADCAST_DATA; 181 - if (wol->wolopts & WAKE_PHY) criteria |= EHS_WAKE_ON_MAC_EVENT; 175 + if (wol->wolopts & WAKE_UCAST) 176 + criteria |= EHS_WAKE_ON_UNICAST_DATA; 177 + if (wol->wolopts & WAKE_MCAST) 178 + criteria |= EHS_WAKE_ON_MULTICAST_DATA; 179 + if (wol->wolopts & WAKE_BCAST) 180 + criteria |= EHS_WAKE_ON_BROADCAST_DATA; 181 + if (wol->wolopts & WAKE_PHY) 182 + criteria |= EHS_WAKE_ON_MAC_EVENT; 183 + if (wol->wolopts == 0) 184 + criteria |= EHS_REMOVE_WAKEUP; 182 185 183 186 return lbs_host_sleep_cfg(priv, criteria, (struct wol_config *)NULL); 184 187 }
+7 -3
drivers/net/wireless/p54/p54usb.c
··· 426 426 static int p54u_firmware_reset_3887(struct ieee80211_hw *dev) 427 427 { 428 428 struct p54u_priv *priv = dev->priv; 429 - u8 buf[4]; 429 + u8 *buf; 430 430 int ret; 431 431 432 - memcpy(&buf, p54u_romboot_3887, sizeof(buf)); 432 + buf = kmalloc(4, GFP_KERNEL); 433 + if (!buf) 434 + return -ENOMEM; 435 + memcpy(buf, p54u_romboot_3887, 4); 433 436 ret = p54u_bulk_msg(priv, P54U_PIPE_DATA, 434 - buf, sizeof(buf)); 437 + buf, 4); 438 + kfree(buf); 435 439 if (ret) 436 440 dev_err(&priv->udev->dev, "(p54usb) unable to jump to " 437 441 "boot ROM (%d)!\n", ret);
+1
drivers/net/wireless/rtl818x/rtl8187_rfkill.c
··· 18 18 #include <net/mac80211.h> 19 19 20 20 #include "rtl8187.h" 21 + #include "rtl8187_rfkill.h" 21 22 22 23 static bool rtl8187_is_radio_enabled(struct rtl8187_priv *priv) 23 24 {
+5 -1
drivers/ssb/scan.c
··· 162 162 static u32 scan_read32(struct ssb_bus *bus, u8 current_coreidx, 163 163 u16 offset) 164 164 { 165 + u32 lo, hi; 166 + 165 167 switch (bus->bustype) { 166 168 case SSB_BUSTYPE_SSB: 167 169 offset += current_coreidx * SSB_CORE_SIZE; ··· 176 174 offset -= 0x800; 177 175 } else 178 176 ssb_pcmcia_switch_segment(bus, 0); 179 - break; 177 + lo = readw(bus->mmio + offset); 178 + hi = readw(bus->mmio + offset + 2); 179 + return lo | (hi << 16); 180 180 case SSB_BUSTYPE_SDIO: 181 181 offset += current_coreidx * SSB_CORE_SIZE; 182 182 return ssb_sdio_scan_read32(bus, offset);
+1 -1
include/linux/isdn_ppp.h
··· 157 157 158 158 typedef struct { 159 159 int mp_mrru; /* unused */ 160 - struct sk_buff_head frags; /* fragments sl list */ 160 + struct sk_buff * frags; /* fragments sl list -- use skb->next */ 161 161 long frames; /* number of frames in the frame list */ 162 162 unsigned int seq; /* last processed packet seq #: any packets 163 163 * with smaller seq # will be dropped
+1 -1
include/net/sctp/structs.h
··· 1980 1980 void sctp_assoc_del_nonprimary_peers(struct sctp_association *, 1981 1981 struct sctp_transport *); 1982 1982 int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *, 1983 - gfp_t); 1983 + sctp_scope_t, gfp_t); 1984 1984 int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *, 1985 1985 struct sctp_cookie*, 1986 1986 gfp_t gfp);
+5 -2
net/8021q/vlan.c
··· 281 281 if (ngrp) 282 282 vlan_gvrp_uninit_applicant(real_dev); 283 283 out_free_group: 284 - if (ngrp) 285 - vlan_group_free(ngrp); 284 + if (ngrp) { 285 + hlist_del_rcu(&ngrp->hlist); 286 + /* Free the group, after all cpu's are done. */ 287 + call_rcu(&ngrp->rcu, vlan_rcu_free); 288 + } 286 289 return err; 287 290 } 288 291
+1
net/bluetooth/hci_conn.c
··· 211 211 conn->type = type; 212 212 conn->mode = HCI_CM_ACTIVE; 213 213 conn->state = BT_OPEN; 214 + conn->auth_type = HCI_AT_GENERAL_BONDING; 214 215 215 216 conn->power_save = 1; 216 217 conn->disc_timeout = HCI_DISCONN_TIMEOUT;
+9 -4
net/bluetooth/l2cap.c
··· 2205 2205 { 2206 2206 struct l2cap_pinfo *pi = l2cap_pi(sk); 2207 2207 struct l2cap_conf_req *req = data; 2208 - struct l2cap_conf_rfc rfc = { .mode = L2CAP_MODE_ERTM }; 2208 + struct l2cap_conf_rfc rfc = { .mode = L2CAP_MODE_BASIC }; 2209 2209 void *ptr = req->data; 2210 2210 2211 2211 BT_DBG("sk %p", sk); ··· 2394 2394 rfc.monitor_timeout = L2CAP_DEFAULT_MONITOR_TO; 2395 2395 2396 2396 pi->conf_state |= L2CAP_CONF_MODE_DONE; 2397 + 2398 + l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC, 2399 + sizeof(rfc), (unsigned long) &rfc); 2400 + 2397 2401 break; 2398 2402 2399 2403 case L2CAP_MODE_STREAMING: ··· 2405 2401 pi->max_pdu_size = rfc.max_pdu_size; 2406 2402 2407 2403 pi->conf_state |= L2CAP_CONF_MODE_DONE; 2404 + 2405 + l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC, 2406 + sizeof(rfc), (unsigned long) &rfc); 2407 + 2408 2408 break; 2409 2409 2410 2410 default: ··· 2417 2409 memset(&rfc, 0, sizeof(rfc)); 2418 2410 rfc.mode = pi->mode; 2419 2411 } 2420 - 2421 - l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC, 2422 - sizeof(rfc), (unsigned long) &rfc); 2423 2412 2424 2413 if (result == L2CAP_CONF_SUCCESS) 2425 2414 pi->conf_state |= L2CAP_CONF_OUTPUT_DONE;
+6 -5
net/core/dev.c
··· 942 942 ret = notifier_to_errno(ret); 943 943 944 944 if (ret) { 945 - if (err) { 946 - printk(KERN_ERR 947 - "%s: name change rollback failed: %d.\n", 948 - dev->name, ret); 949 - } else { 945 + /* err >= 0 after dev_alloc_name() or stores the first errno */ 946 + if (err >= 0) { 950 947 err = ret; 951 948 memcpy(dev->name, oldname, IFNAMSIZ); 952 949 goto rollback; 950 + } else { 951 + printk(KERN_ERR 952 + "%s: name change rollback failed: %d.\n", 953 + dev->name, ret); 953 954 } 954 955 } 955 956
+2 -1
net/core/skbuff.c
··· 2701 2701 2702 2702 NAPI_GRO_CB(skb)->free = 1; 2703 2703 goto done; 2704 - } 2704 + } else if (skb_gro_len(p) != pinfo->gso_size) 2705 + return -E2BIG; 2705 2706 2706 2707 headroom = skb_headroom(p); 2707 2708 nskb = netdev_alloc_skb(p->dev, headroom + skb_gro_offset(p));
+3 -1
net/ipv4/ipmr.c
··· 483 483 return -EINVAL; 484 484 } 485 485 486 - if ((in_dev = __in_dev_get_rtnl(dev)) == NULL) 486 + if ((in_dev = __in_dev_get_rtnl(dev)) == NULL) { 487 + dev_put(dev); 487 488 return -EADDRNOTAVAIL; 489 + } 488 490 IPV4_DEVCONF(in_dev->cnf, MC_FORWARDING)++; 489 491 ip_rt_multicast_event(in_dev); 490 492
+12 -7
net/ipv4/tcp.c
··· 1183 1183 #if TCP_DEBUG 1184 1184 struct sk_buff *skb = skb_peek(&sk->sk_receive_queue); 1185 1185 1186 - WARN_ON(skb && !before(tp->copied_seq, TCP_SKB_CB(skb)->end_seq)); 1186 + WARN(skb && !before(tp->copied_seq, TCP_SKB_CB(skb)->end_seq), 1187 + KERN_INFO "cleanup rbuf bug: copied %X seq %X rcvnxt %X\n", 1188 + tp->copied_seq, TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt); 1187 1189 #endif 1188 1190 1189 1191 if (inet_csk_ack_scheduled(sk)) { ··· 1432 1430 /* Now that we have two receive queues this 1433 1431 * shouldn't happen. 1434 1432 */ 1435 - if (before(*seq, TCP_SKB_CB(skb)->seq)) { 1436 - printk(KERN_INFO "recvmsg bug: copied %X " 1437 - "seq %X\n", *seq, TCP_SKB_CB(skb)->seq); 1433 + if (WARN(before(*seq, TCP_SKB_CB(skb)->seq), 1434 + KERN_INFO "recvmsg bug: copied %X " 1435 + "seq %X rcvnxt %X fl %X\n", *seq, 1436 + TCP_SKB_CB(skb)->seq, tp->rcv_nxt, 1437 + flags)) 1438 1438 break; 1439 - } 1439 + 1440 1440 offset = *seq - TCP_SKB_CB(skb)->seq; 1441 1441 if (tcp_hdr(skb)->syn) 1442 1442 offset--; ··· 1447 1443 if (tcp_hdr(skb)->fin) 1448 1444 goto found_fin_ok; 1449 1445 WARN(!(flags & MSG_PEEK), KERN_INFO "recvmsg bug 2: " 1450 - "copied %X seq %X\n", *seq, 1451 - TCP_SKB_CB(skb)->seq); 1446 + "copied %X seq %X rcvnxt %X fl %X\n", 1447 + *seq, TCP_SKB_CB(skb)->seq, 1448 + tp->rcv_nxt, flags); 1452 1449 } 1453 1450 1454 1451 /* Well, if we have backlog, try to process it now yet. */
+1 -3
net/sctp/associola.c
··· 1485 1485 * local endpoint and the remote peer. 1486 1486 */ 1487 1487 int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *asoc, 1488 - gfp_t gfp) 1488 + sctp_scope_t scope, gfp_t gfp) 1489 1489 { 1490 - sctp_scope_t scope; 1491 1490 int flags; 1492 1491 1493 1492 /* Use scoping rules to determine the subset of addresses from 1494 1493 * the endpoint. 1495 1494 */ 1496 - scope = sctp_scope(&asoc->peer.active_path->ipaddr); 1497 1495 flags = (PF_INET6 == asoc->base.sk->sk_family) ? SCTP_ADDR6_ALLOWED : 0; 1498 1496 if (asoc->peer.ipv4_address) 1499 1497 flags |= SCTP_ADDR4_PEERSUPP;
+9 -6
net/sctp/sm_statefuns.c
··· 384 384 if (!new_asoc) 385 385 goto nomem; 386 386 387 + if (sctp_assoc_set_bind_addr_from_ep(new_asoc, 388 + sctp_scope(sctp_source(chunk)), 389 + GFP_ATOMIC) < 0) 390 + goto nomem_init; 391 + 387 392 /* The call, sctp_process_init(), can fail on memory allocation. */ 388 393 if (!sctp_process_init(new_asoc, chunk->chunk_hdr->type, 389 394 sctp_source(chunk), ··· 405 400 if (err_chunk) 406 401 len = ntohs(err_chunk->chunk_hdr->length) - 407 402 sizeof(sctp_chunkhdr_t); 408 - 409 - if (sctp_assoc_set_bind_addr_from_ep(new_asoc, GFP_ATOMIC) < 0) 410 - goto nomem_init; 411 403 412 404 repl = sctp_make_init_ack(new_asoc, chunk, GFP_ATOMIC, len); 413 405 if (!repl) ··· 1454 1452 if (!new_asoc) 1455 1453 goto nomem; 1456 1454 1455 + if (sctp_assoc_set_bind_addr_from_ep(new_asoc, 1456 + sctp_scope(sctp_source(chunk)), GFP_ATOMIC) < 0) 1457 + goto nomem; 1458 + 1457 1459 /* In the outbound INIT ACK the endpoint MUST copy its current 1458 1460 * Verification Tag and Peers Verification tag into a reserved 1459 1461 * place (local tie-tag and per tie-tag) within the state cookie. ··· 1493 1487 len = ntohs(err_chunk->chunk_hdr->length) - 1494 1488 sizeof(sctp_chunkhdr_t); 1495 1489 } 1496 - 1497 - if (sctp_assoc_set_bind_addr_from_ep(new_asoc, GFP_ATOMIC) < 0) 1498 - goto nomem; 1499 1490 1500 1491 repl = sctp_make_init_ack(new_asoc, chunk, GFP_ATOMIC, len); 1501 1492 if (!repl)
+25 -15
net/sctp/socket.c
··· 1080 1080 err = -ENOMEM; 1081 1081 goto out_free; 1082 1082 } 1083 + 1084 + err = sctp_assoc_set_bind_addr_from_ep(asoc, scope, 1085 + GFP_KERNEL); 1086 + if (err < 0) { 1087 + goto out_free; 1088 + } 1089 + 1083 1090 } 1084 1091 1085 1092 /* Prime the peer's transport structures. */ ··· 1100 1093 addrcnt++; 1101 1094 addr_buf += af->sockaddr_len; 1102 1095 walk_size += af->sockaddr_len; 1103 - } 1104 - 1105 - err = sctp_assoc_set_bind_addr_from_ep(asoc, GFP_KERNEL); 1106 - if (err < 0) { 1107 - goto out_free; 1108 1096 } 1109 1097 1110 1098 /* In case the user of sctp_connectx() wants an association ··· 1276 1274 } 1277 1275 1278 1276 /* 1279 - * New (hopefully final) interface for the API. The option buffer is used 1280 - * both for the returned association id and the addresses. 1277 + * New (hopefully final) interface for the API. 1278 + * We use the sctp_getaddrs_old structure so that use-space library 1279 + * can avoid any unnecessary allocations. The only defferent part 1280 + * is that we store the actual length of the address buffer into the 1281 + * addrs_num structure member. That way we can re-use the existing 1282 + * code. 1281 1283 */ 1282 1284 SCTP_STATIC int sctp_getsockopt_connectx3(struct sock* sk, int len, 1283 1285 char __user *optval, 1284 1286 int __user *optlen) 1285 1287 { 1288 + struct sctp_getaddrs_old param; 1286 1289 sctp_assoc_t assoc_id = 0; 1287 1290 int err = 0; 1288 1291 1289 - if (len < sizeof(assoc_id)) 1292 + if (len < sizeof(param)) 1290 1293 return -EINVAL; 1291 1294 1295 + if (copy_from_user(&param, optval, sizeof(param))) 1296 + return -EFAULT; 1297 + 1292 1298 err = __sctp_setsockopt_connectx(sk, 1293 - (struct sockaddr __user *)(optval + sizeof(assoc_id)), 1294 - len - sizeof(assoc_id), &assoc_id); 1299 + (struct sockaddr __user *)param.addrs, 1300 + param.addr_num, &assoc_id); 1295 1301 1296 1302 if (err == 0 || err == -EINPROGRESS) { 1297 1303 if (copy_to_user(optval, &assoc_id, sizeof(assoc_id))) ··· 1699 1689 goto out_unlock; 1700 1690 } 1701 1691 asoc = new_asoc; 1692 + err = sctp_assoc_set_bind_addr_from_ep(asoc, scope, GFP_KERNEL); 1693 + if (err < 0) { 1694 + err = -ENOMEM; 1695 + goto out_free; 1696 + } 1702 1697 1703 1698 /* If the SCTP_INIT ancillary data is specified, set all 1704 1699 * the association init values accordingly. ··· 1730 1715 /* Prime the peer's transport structures. */ 1731 1716 transport = sctp_assoc_add_peer(asoc, &to, GFP_KERNEL, SCTP_UNKNOWN); 1732 1717 if (!transport) { 1733 - err = -ENOMEM; 1734 - goto out_free; 1735 - } 1736 - err = sctp_assoc_set_bind_addr_from_ep(asoc, GFP_KERNEL); 1737 - if (err < 0) { 1738 1718 err = -ENOMEM; 1739 1719 goto out_free; 1740 1720 }
+2 -1
net/sctp/transport.c
··· 308 308 /* Initialize sk->sk_rcv_saddr, if the transport is the 309 309 * association's active path for getsockname(). 310 310 */ 311 - if (asoc && (transport == asoc->peer.active_path)) 311 + if (asoc && (!asoc->peer.primary_path || 312 + (transport == asoc->peer.active_path))) 312 313 opt->pf->af->to_sk_saddr(&transport->saddr, 313 314 asoc->base.sk); 314 315 } else