diff options
| author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-18 13:24:36 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-18 13:24:36 -0400 |
| commit | 485cf925d8b7a6b3c62fe5f1e167f2d0d4edf32a (patch) | |
| tree | 57798f48123a62dd1801f039b676b06913e34e72 | |
| parent | 31bdc5dc7666aa2fe04c626cea30fe3c20cf481c (diff) | |
| parent | 3fd8f9e4b6c184d03d340bc86630f700de967fa8 (diff) | |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (24 commits)
[NETFILTER]: xt_connlimit needs to depend on nf_conntrack
[NETFILTER]: ipt_iprange.h must #include <linux/types.h>
[IrDA]: Fix IrDA build failure
[ATM]: nicstar needs virt_to_bus
[NET]: move __dev_addr_discard adjacent to dev_addr_discard for readability
[NET]: merge dev_unicast_discard and dev_mc_discard into one
[NET]: move dev_mc_discard from dev_mcast.c to dev.c
[NETLINK]: negative groups in netlink_setsockopt
[PPPOL2TP]: Reset meta-data in xmit function
[PPPOL2TP]: Fix use-after-free
[PKT_SCHED]: Some typo fixes in net/sched/Kconfig
[XFRM]: Fix crash introduced by struct dst_entry reordering
[TCP]: remove unused argument to cong_avoid op
[ATM]: [idt77252] Rename CONFIG_ATM_IDT77252_SEND_IDLE to not resemble a Kconfig variable
[ATM]: [drivers] ioremap balanced with iounmap
[ATM]: [lanai] sram_test_word() must be __devinit
[ATM]: [nicstar] Replace C code with call to ARRAY_SIZE() macro.
[ATM]: Eliminate dead config variable CONFIG_BR2684_FAST_TRANS.
[ATM]: Replacing kmalloc/memset combination with kzalloc.
[NET]: gen_estimator deadlock fix
...
43 files changed, 232 insertions, 173 deletions
diff --git a/drivers/atm/Kconfig b/drivers/atm/Kconfig index bb4ae6281491..bed9f58c2d5a 100644 --- a/drivers/atm/Kconfig +++ b/drivers/atm/Kconfig | |||
| @@ -172,7 +172,7 @@ config ATM_ZATM_DEBUG | |||
| 172 | 172 | ||
| 173 | config ATM_NICSTAR | 173 | config ATM_NICSTAR |
| 174 | tristate "IDT 77201 (NICStAR) (ForeRunnerLE)" | 174 | tristate "IDT 77201 (NICStAR) (ForeRunnerLE)" |
| 175 | depends on PCI && !64BIT | 175 | depends on PCI && !64BIT && VIRT_TO_BUS |
| 176 | help | 176 | help |
| 177 | The NICStAR chipset family is used in a large number of ATM NICs for | 177 | The NICStAR chipset family is used in a large number of ATM NICs for |
| 178 | 25 and for 155 Mbps, including IDT cards and the Fore ForeRunnerLE | 178 | 25 and for 155 Mbps, including IDT cards and the Fore ForeRunnerLE |
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c index 77637e780d41..41b2204ebc6e 100644 --- a/drivers/atm/eni.c +++ b/drivers/atm/eni.c | |||
| @@ -1738,7 +1738,8 @@ static int __devinit eni_do_init(struct atm_dev *dev) | |||
| 1738 | printk(KERN_ERR KERN_ERR DEV_LABEL "(itf %d): bad " | 1738 | printk(KERN_ERR KERN_ERR DEV_LABEL "(itf %d): bad " |
| 1739 | "magic - expected 0x%x, got 0x%x\n",dev->number, | 1739 | "magic - expected 0x%x, got 0x%x\n",dev->number, |
| 1740 | ENI155_MAGIC,(unsigned) readl(&eprom->magic)); | 1740 | ENI155_MAGIC,(unsigned) readl(&eprom->magic)); |
| 1741 | return -EINVAL; | 1741 | error = -EINVAL; |
| 1742 | goto unmap; | ||
| 1742 | } | 1743 | } |
| 1743 | } | 1744 | } |
| 1744 | eni_dev->phy = base+PHY_BASE; | 1745 | eni_dev->phy = base+PHY_BASE; |
| @@ -1765,17 +1766,27 @@ static int __devinit eni_do_init(struct atm_dev *dev) | |||
| 1765 | printk(")\n"); | 1766 | printk(")\n"); |
| 1766 | printk(KERN_ERR DEV_LABEL "(itf %d): ERROR - wrong id 0x%x\n", | 1767 | printk(KERN_ERR DEV_LABEL "(itf %d): ERROR - wrong id 0x%x\n", |
| 1767 | dev->number,(unsigned) eni_in(MID_RES_ID_MCON)); | 1768 | dev->number,(unsigned) eni_in(MID_RES_ID_MCON)); |
| 1768 | return -EINVAL; | 1769 | error = -EINVAL; |
| 1770 | goto unmap; | ||
| 1769 | } | 1771 | } |
| 1770 | error = eni_dev->asic ? get_esi_asic(dev) : get_esi_fpga(dev,base); | 1772 | error = eni_dev->asic ? get_esi_asic(dev) : get_esi_fpga(dev,base); |
| 1771 | if (error) return error; | 1773 | if (error) |
| 1774 | goto unmap; | ||
| 1772 | for (i = 0; i < ESI_LEN; i++) | 1775 | for (i = 0; i < ESI_LEN; i++) |
| 1773 | printk("%s%02X",i ? "-" : "",dev->esi[i]); | 1776 | printk("%s%02X",i ? "-" : "",dev->esi[i]); |
| 1774 | printk(")\n"); | 1777 | printk(")\n"); |
| 1775 | printk(KERN_NOTICE DEV_LABEL "(itf %d): %s,%s\n",dev->number, | 1778 | printk(KERN_NOTICE DEV_LABEL "(itf %d): %s,%s\n",dev->number, |
| 1776 | eni_in(MID_RES_ID_MCON) & 0x200 ? "ASIC" : "FPGA", | 1779 | eni_in(MID_RES_ID_MCON) & 0x200 ? "ASIC" : "FPGA", |
| 1777 | media_name[eni_in(MID_RES_ID_MCON) & DAUGTHER_ID]); | 1780 | media_name[eni_in(MID_RES_ID_MCON) & DAUGTHER_ID]); |
| 1778 | return suni_init(dev); | 1781 | |
| 1782 | error = suni_init(dev); | ||
| 1783 | if (error) | ||
| 1784 | goto unmap; | ||
| 1785 | out: | ||
| 1786 | return error; | ||
| 1787 | unmap: | ||
| 1788 | iounmap(base); | ||
| 1789 | goto out; | ||
| 1779 | } | 1790 | } |
| 1780 | 1791 | ||
| 1781 | 1792 | ||
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c index 38b688f9f6a9..737cea49f872 100644 --- a/drivers/atm/firestream.c +++ b/drivers/atm/firestream.c | |||
| @@ -1710,7 +1710,7 @@ static int __devinit fs_init (struct fs_dev *dev) | |||
| 1710 | /* This bit is documented as "RESERVED" */ | 1710 | /* This bit is documented as "RESERVED" */ |
| 1711 | if (isr & ISR_INIT_ERR) { | 1711 | if (isr & ISR_INIT_ERR) { |
| 1712 | printk (KERN_ERR "Error initializing the FS... \n"); | 1712 | printk (KERN_ERR "Error initializing the FS... \n"); |
| 1713 | return 1; | 1713 | goto unmap; |
| 1714 | } | 1714 | } |
| 1715 | if (isr & ISR_INIT) { | 1715 | if (isr & ISR_INIT) { |
| 1716 | fs_dprintk (FS_DEBUG_INIT, "Ha! Initialized OK!\n"); | 1716 | fs_dprintk (FS_DEBUG_INIT, "Ha! Initialized OK!\n"); |
| @@ -1723,7 +1723,7 @@ static int __devinit fs_init (struct fs_dev *dev) | |||
| 1723 | 1723 | ||
| 1724 | if (!to) { | 1724 | if (!to) { |
| 1725 | printk (KERN_ERR "timeout initializing the FS... \n"); | 1725 | printk (KERN_ERR "timeout initializing the FS... \n"); |
| 1726 | return 1; | 1726 | goto unmap; |
| 1727 | } | 1727 | } |
| 1728 | 1728 | ||
| 1729 | /* XXX fix for fs155 */ | 1729 | /* XXX fix for fs155 */ |
| @@ -1803,7 +1803,7 @@ static int __devinit fs_init (struct fs_dev *dev) | |||
| 1803 | if (!dev->atm_vccs) { | 1803 | if (!dev->atm_vccs) { |
| 1804 | printk (KERN_WARNING "Couldn't allocate memory for VCC buffers. Woops!\n"); | 1804 | printk (KERN_WARNING "Couldn't allocate memory for VCC buffers. Woops!\n"); |
| 1805 | /* XXX Clean up..... */ | 1805 | /* XXX Clean up..... */ |
| 1806 | return 1; | 1806 | goto unmap; |
| 1807 | } | 1807 | } |
| 1808 | 1808 | ||
| 1809 | dev->tx_inuse = kzalloc (dev->nchannels / 8 /* bits/byte */ , GFP_KERNEL); | 1809 | dev->tx_inuse = kzalloc (dev->nchannels / 8 /* bits/byte */ , GFP_KERNEL); |
| @@ -1813,7 +1813,7 @@ static int __devinit fs_init (struct fs_dev *dev) | |||
| 1813 | if (!dev->tx_inuse) { | 1813 | if (!dev->tx_inuse) { |
| 1814 | printk (KERN_WARNING "Couldn't allocate memory for tx_inuse bits!\n"); | 1814 | printk (KERN_WARNING "Couldn't allocate memory for tx_inuse bits!\n"); |
| 1815 | /* XXX Clean up..... */ | 1815 | /* XXX Clean up..... */ |
| 1816 | return 1; | 1816 | goto unmap; |
| 1817 | } | 1817 | } |
| 1818 | /* -- RAS1 : FS155 and 50 differ. Default (0) should be OK for both */ | 1818 | /* -- RAS1 : FS155 and 50 differ. Default (0) should be OK for both */ |
| 1819 | /* -- RAS2 : FS50 only: Default is OK. */ | 1819 | /* -- RAS2 : FS50 only: Default is OK. */ |
| @@ -1840,7 +1840,7 @@ static int __devinit fs_init (struct fs_dev *dev) | |||
| 1840 | if (request_irq (dev->irq, fs_irq, IRQF_SHARED, "firestream", dev)) { | 1840 | if (request_irq (dev->irq, fs_irq, IRQF_SHARED, "firestream", dev)) { |
| 1841 | printk (KERN_WARNING "couldn't get irq %d for firestream.\n", pci_dev->irq); | 1841 | printk (KERN_WARNING "couldn't get irq %d for firestream.\n", pci_dev->irq); |
| 1842 | /* XXX undo all previous stuff... */ | 1842 | /* XXX undo all previous stuff... */ |
| 1843 | return 1; | 1843 | goto unmap; |
| 1844 | } | 1844 | } |
| 1845 | fs_dprintk (FS_DEBUG_INIT, "Grabbed irq %d for dev at %p.\n", dev->irq, dev); | 1845 | fs_dprintk (FS_DEBUG_INIT, "Grabbed irq %d for dev at %p.\n", dev->irq, dev); |
| 1846 | 1846 | ||
| @@ -1890,6 +1890,9 @@ static int __devinit fs_init (struct fs_dev *dev) | |||
| 1890 | 1890 | ||
| 1891 | func_exit (); | 1891 | func_exit (); |
| 1892 | return 0; | 1892 | return 0; |
| 1893 | unmap: | ||
| 1894 | iounmap(dev->base); | ||
| 1895 | return 1; | ||
| 1893 | } | 1896 | } |
| 1894 | 1897 | ||
| 1895 | static int __devinit firestream_init_one (struct pci_dev *pci_dev, | 1898 | static int __devinit firestream_init_one (struct pci_dev *pci_dev, |
| @@ -2012,6 +2015,7 @@ static void __devexit firestream_remove_one (struct pci_dev *pdev) | |||
| 2012 | for (i=0;i < FS_NR_RX_QUEUES;i++) | 2015 | for (i=0;i < FS_NR_RX_QUEUES;i++) |
| 2013 | free_queue (dev, &dev->rx_rq[i]); | 2016 | free_queue (dev, &dev->rx_rq[i]); |
| 2014 | 2017 | ||
| 2018 | iounmap(dev->base); | ||
| 2015 | fs_dprintk (FS_DEBUG_ALLOC, "Free fs-dev: %p\n", dev); | 2019 | fs_dprintk (FS_DEBUG_ALLOC, "Free fs-dev: %p\n", dev); |
| 2016 | nxtdev = dev->next; | 2020 | nxtdev = dev->next; |
| 2017 | kfree (dev); | 2021 | kfree (dev); |
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c index 8f995ce8d73b..f8b1700f4c16 100644 --- a/drivers/atm/idt77252.c +++ b/drivers/atm/idt77252.c | |||
| @@ -65,7 +65,7 @@ static char const rcsid[] = | |||
| 65 | static unsigned int vpibits = 1; | 65 | static unsigned int vpibits = 1; |
| 66 | 66 | ||
| 67 | 67 | ||
| 68 | #define CONFIG_ATM_IDT77252_SEND_IDLE 1 | 68 | #define ATM_IDT77252_SEND_IDLE 1 |
| 69 | 69 | ||
| 70 | 70 | ||
| 71 | /* | 71 | /* |
| @@ -3404,7 +3404,7 @@ init_card(struct atm_dev *dev) | |||
| 3404 | conf = SAR_CFG_TX_FIFO_SIZE_9 | /* Use maximum fifo size */ | 3404 | conf = SAR_CFG_TX_FIFO_SIZE_9 | /* Use maximum fifo size */ |
| 3405 | SAR_CFG_RXSTQ_SIZE_8k | /* Receive Status Queue is 8k */ | 3405 | SAR_CFG_RXSTQ_SIZE_8k | /* Receive Status Queue is 8k */ |
| 3406 | SAR_CFG_IDLE_CLP | /* Set CLP on idle cells */ | 3406 | SAR_CFG_IDLE_CLP | /* Set CLP on idle cells */ |
| 3407 | #ifndef CONFIG_ATM_IDT77252_SEND_IDLE | 3407 | #ifndef ATM_IDT77252_SEND_IDLE |
| 3408 | SAR_CFG_NO_IDLE | /* Do not send idle cells */ | 3408 | SAR_CFG_NO_IDLE | /* Do not send idle cells */ |
| 3409 | #endif | 3409 | #endif |
| 3410 | 0; | 3410 | 0; |
| @@ -3541,7 +3541,7 @@ init_card(struct atm_dev *dev) | |||
| 3541 | printk("%s: Linkrate on ATM line : %u bit/s, %u cell/s.\n", | 3541 | printk("%s: Linkrate on ATM line : %u bit/s, %u cell/s.\n", |
| 3542 | card->name, linkrate, card->link_pcr); | 3542 | card->name, linkrate, card->link_pcr); |
| 3543 | 3543 | ||
| 3544 | #ifdef CONFIG_ATM_IDT77252_SEND_IDLE | 3544 | #ifdef ATM_IDT77252_SEND_IDLE |
| 3545 | card->utopia_pcr = card->link_pcr; | 3545 | card->utopia_pcr = card->link_pcr; |
| 3546 | #else | 3546 | #else |
| 3547 | card->utopia_pcr = (160000000 / 8 / 54); | 3547 | card->utopia_pcr = (160000000 / 8 / 54); |
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index 0e2c1ae650e7..55fd1b4543fd 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c | |||
| @@ -552,8 +552,8 @@ static inline void sram_write(const struct lanai_dev *lanai, | |||
| 552 | writel(val, sram_addr(lanai, offset)); | 552 | writel(val, sram_addr(lanai, offset)); |
| 553 | } | 553 | } |
| 554 | 554 | ||
| 555 | static int __init sram_test_word( | 555 | static int __devinit sram_test_word(const struct lanai_dev *lanai, |
| 556 | const struct lanai_dev *lanai, int offset, u32 pattern) | 556 | int offset, u32 pattern) |
| 557 | { | 557 | { |
| 558 | u32 readback; | 558 | u32 readback; |
| 559 | sram_write(lanai, pattern, offset); | 559 | sram_write(lanai, pattern, offset); |
diff --git a/drivers/atm/nicstarmac.c b/drivers/atm/nicstarmac.c index 480947f4e01e..842e26c45557 100644 --- a/drivers/atm/nicstarmac.c +++ b/drivers/atm/nicstarmac.c | |||
| @@ -134,7 +134,7 @@ nicstar_read_eprom_status( virt_addr_t base ) | |||
| 134 | /* Send read instruction */ | 134 | /* Send read instruction */ |
| 135 | val = NICSTAR_REG_READ( base, NICSTAR_REG_GENERAL_PURPOSE ) & 0xFFFFFFF0; | 135 | val = NICSTAR_REG_READ( base, NICSTAR_REG_GENERAL_PURPOSE ) & 0xFFFFFFF0; |
| 136 | 136 | ||
| 137 | for (i=0; i<sizeof rdsrtab/sizeof rdsrtab[0]; i++) | 137 | for (i=0; i<ARRAY_SIZE(rdsrtab); i++) |
| 138 | { | 138 | { |
| 139 | NICSTAR_REG_WRITE( base, NICSTAR_REG_GENERAL_PURPOSE, | 139 | NICSTAR_REG_WRITE( base, NICSTAR_REG_GENERAL_PURPOSE, |
| 140 | (val | rdsrtab[i]) ); | 140 | (val | rdsrtab[i]) ); |
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index d23861c8658c..a729da061bbb 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
| @@ -54,8 +54,8 @@ | |||
| 54 | 54 | ||
| 55 | #define DRV_MODULE_NAME "bnx2" | 55 | #define DRV_MODULE_NAME "bnx2" |
| 56 | #define PFX DRV_MODULE_NAME ": " | 56 | #define PFX DRV_MODULE_NAME ": " |
| 57 | #define DRV_MODULE_VERSION "1.6.2" | 57 | #define DRV_MODULE_VERSION "1.6.3" |
| 58 | #define DRV_MODULE_RELDATE "July 6, 2007" | 58 | #define DRV_MODULE_RELDATE "July 16, 2007" |
| 59 | 59 | ||
| 60 | #define RUN_AT(x) (jiffies + (x)) | 60 | #define RUN_AT(x) (jiffies + (x)) |
| 61 | 61 | ||
| @@ -126,91 +126,102 @@ static struct pci_device_id bnx2_pci_tbl[] = { | |||
| 126 | 126 | ||
| 127 | static struct flash_spec flash_table[] = | 127 | static struct flash_spec flash_table[] = |
| 128 | { | 128 | { |
| 129 | #define BUFFERED_FLAGS (BNX2_NV_BUFFERED | BNX2_NV_TRANSLATE) | ||
| 130 | #define NONBUFFERED_FLAGS (BNX2_NV_WREN) | ||
| 129 | /* Slow EEPROM */ | 131 | /* Slow EEPROM */ |
| 130 | {0x00000000, 0x40830380, 0x009f0081, 0xa184a053, 0xaf000400, | 132 | {0x00000000, 0x40830380, 0x009f0081, 0xa184a053, 0xaf000400, |
| 131 | 1, SEEPROM_PAGE_BITS, SEEPROM_PAGE_SIZE, | 133 | BUFFERED_FLAGS, SEEPROM_PAGE_BITS, SEEPROM_PAGE_SIZE, |
| 132 | SEEPROM_BYTE_ADDR_MASK, SEEPROM_TOTAL_SIZE, | 134 | SEEPROM_BYTE_ADDR_MASK, SEEPROM_TOTAL_SIZE, |
| 133 | "EEPROM - slow"}, | 135 | "EEPROM - slow"}, |
| 134 | /* Expansion entry 0001 */ | 136 | /* Expansion entry 0001 */ |
| 135 | {0x08000002, 0x4b808201, 0x00050081, 0x03840253, 0xaf020406, | 137 | {0x08000002, 0x4b808201, 0x00050081, 0x03840253, 0xaf020406, |
| 136 | 0, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE, | 138 | NONBUFFERED_FLAGS, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE, |
| 137 | SAIFUN_FLASH_BYTE_ADDR_MASK, 0, | 139 | SAIFUN_FLASH_BYTE_ADDR_MASK, 0, |
| 138 | "Entry 0001"}, | 140 | "Entry 0001"}, |
| 139 | /* Saifun SA25F010 (non-buffered flash) */ | 141 | /* Saifun SA25F010 (non-buffered flash) */ |
| 140 | /* strap, cfg1, & write1 need updates */ | 142 | /* strap, cfg1, & write1 need updates */ |
| 141 | {0x04000001, 0x47808201, 0x00050081, 0x03840253, 0xaf020406, | 143 | {0x04000001, 0x47808201, 0x00050081, 0x03840253, 0xaf020406, |
| 142 | 0, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE, | 144 | NONBUFFERED_FLAGS, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE, |
| 143 | SAIFUN_FLASH_BYTE_ADDR_MASK, SAIFUN_FLASH_BASE_TOTAL_SIZE*2, | 145 | SAIFUN_FLASH_BYTE_ADDR_MASK, SAIFUN_FLASH_BASE_TOTAL_SIZE*2, |
| 144 | "Non-buffered flash (128kB)"}, | 146 | "Non-buffered flash (128kB)"}, |
| 145 | /* Saifun SA25F020 (non-buffered flash) */ | 147 | /* Saifun SA25F020 (non-buffered flash) */ |
| 146 | /* strap, cfg1, & write1 need updates */ | 148 | /* strap, cfg1, & write1 need updates */ |
| 147 | {0x0c000003, 0x4f808201, 0x00050081, 0x03840253, 0xaf020406, | 149 | {0x0c000003, 0x4f808201, 0x00050081, 0x03840253, 0xaf020406, |
| 148 | 0, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE, | 150 | NONBUFFERED_FLAGS, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE, |
| 149 | SAIFUN_FLASH_BYTE_ADDR_MASK, SAIFUN_FLASH_BASE_TOTAL_SIZE*4, | 151 | SAIFUN_FLASH_BYTE_ADDR_MASK, SAIFUN_FLASH_BASE_TOTAL_SIZE*4, |
| 150 | "Non-buffered flash (256kB)"}, | 152 | "Non-buffered flash (256kB)"}, |
| 151 | /* Expansion entry 0100 */ | 153 | /* Expansion entry 0100 */ |
| 152 | {0x11000000, 0x53808201, 0x00050081, 0x03840253, 0xaf020406, | 154 | {0x11000000, 0x53808201, 0x00050081, 0x03840253, 0xaf020406, |
| 153 | 0, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE, | 155 | NONBUFFERED_FLAGS, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE, |
| 154 | SAIFUN_FLASH_BYTE_ADDR_MASK, 0, | 156 | SAIFUN_FLASH_BYTE_ADDR_MASK, 0, |
| 155 | "Entry 0100"}, | 157 | "Entry 0100"}, |
| 156 | /* Entry 0101: ST M45PE10 (non-buffered flash, TetonII B0) */ | 158 | /* Entry 0101: ST M45PE10 (non-buffered flash, TetonII B0) */ |
| 157 | {0x19000002, 0x5b808201, 0x000500db, 0x03840253, 0xaf020406, | 159 | {0x19000002, 0x5b808201, 0x000500db, 0x03840253, 0xaf020406, |
| 158 | 0, ST_MICRO_FLASH_PAGE_BITS, ST_MICRO_FLASH_PAGE_SIZE, | 160 | NONBUFFERED_FLAGS, ST_MICRO_FLASH_PAGE_BITS, ST_MICRO_FLASH_PAGE_SIZE, |
| 159 | ST_MICRO_FLASH_BYTE_ADDR_MASK, ST_MICRO_FLASH_BASE_TOTAL_SIZE*2, | 161 | ST_MICRO_FLASH_BYTE_ADDR_MASK, ST_MICRO_FLASH_BASE_TOTAL_SIZE*2, |
| 160 | "Entry 0101: ST M45PE10 (128kB non-bufferred)"}, | 162 | "Entry 0101: ST M45PE10 (128kB non-bufferred)"}, |
| 161 | /* Entry 0110: ST M45PE20 (non-buffered flash)*/ | 163 | /* Entry 0110: ST M45PE20 (non-buffered flash)*/ |
| 162 | {0x15000001, 0x57808201, 0x000500db, 0x03840253, 0xaf020406, | 164 | {0x15000001, 0x57808201, 0x000500db, 0x03840253, 0xaf020406, |
| 163 | 0, ST_MICRO_FLASH_PAGE_BITS, ST_MICRO_FLASH_PAGE_SIZE, | 165 | NONBUFFERED_FLAGS, ST_MICRO_FLASH_PAGE_BITS, ST_MICRO_FLASH_PAGE_SIZE, |
| 164 | ST_MICRO_FLASH_BYTE_ADDR_MASK, ST_MICRO_FLASH_BASE_TOTAL_SIZE*4, | 166 | ST_MICRO_FLASH_BYTE_ADDR_MASK, ST_MICRO_FLASH_BASE_TOTAL_SIZE*4, |
| 165 | "Entry 0110: ST M45PE20 (256kB non-bufferred)"}, | 167 | "Entry 0110: ST M45PE20 (256kB non-bufferred)"}, |
| 166 | /* Saifun SA25F005 (non-buffered flash) */ | 168 | /* Saifun SA25F005 (non-buffered flash) */ |
| 167 | /* strap, cfg1, & write1 need updates */ | 169 | /* strap, cfg1, & write1 need updates */ |
| 168 | {0x1d000003, 0x5f808201, 0x00050081, 0x03840253, 0xaf020406, | 170 | {0x1d000003, 0x5f808201, 0x00050081, 0x03840253, 0xaf020406, |
| 169 | 0, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE, | 171 | NONBUFFERED_FLAGS, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE, |
| 170 | SAIFUN_FLASH_BYTE_ADDR_MASK, SAIFUN_FLASH_BASE_TOTAL_SIZE, | 172 | SAIFUN_FLASH_BYTE_ADDR_MASK, SAIFUN_FLASH_BASE_TOTAL_SIZE, |
| 171 | "Non-buffered flash (64kB)"}, | 173 | "Non-buffered flash (64kB)"}, |
| 172 | /* Fast EEPROM */ | 174 | /* Fast EEPROM */ |
| 173 | {0x22000000, 0x62808380, 0x009f0081, 0xa184a053, 0xaf000400, | 175 | {0x22000000, 0x62808380, 0x009f0081, 0xa184a053, 0xaf000400, |
| 174 | 1, SEEPROM_PAGE_BITS, SEEPROM_PAGE_SIZE, | 176 | BUFFERED_FLAGS, SEEPROM_PAGE_BITS, SEEPROM_PAGE_SIZE, |
| 175 | SEEPROM_BYTE_ADDR_MASK, SEEPROM_TOTAL_SIZE, | 177 | SEEPROM_BYTE_ADDR_MASK, SEEPROM_TOTAL_SIZE, |
| 176 | "EEPROM - fast"}, | 178 | "EEPROM - fast"}, |
| 177 | /* Expansion entry 1001 */ | 179 | /* Expansion entry 1001 */ |
| 178 | {0x2a000002, 0x6b808201, 0x00050081, 0x03840253, 0xaf020406, | 180 | {0x2a000002, 0x6b808201, 0x00050081, 0x03840253, 0xaf020406, |
| 179 | 0, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE, | 181 | NONBUFFERED_FLAGS, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE, |
| 180 | SAIFUN_FLASH_BYTE_ADDR_MASK, 0, | 182 | SAIFUN_FLASH_BYTE_ADDR_MASK, 0, |
| 181 | "Entry 1001"}, | 183 | "Entry 1001"}, |
| 182 | /* Expansion entry 1010 */ | 184 | /* Expansion entry 1010 */ |
| 183 | {0x26000001, 0x67808201, 0x00050081, 0x03840253, 0xaf020406, | 185 | {0x26000001, 0x67808201, 0x00050081, 0x03840253, 0xaf020406, |
| 184 | 0, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE, | 186 | NONBUFFERED_FLAGS, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE, |
| 185 | SAIFUN_FLASH_BYTE_ADDR_MASK, 0, | 187 | SAIFUN_FLASH_BYTE_ADDR_MASK, 0, |
| 186 | "Entry 1010"}, | 188 | "Entry 1010"}, |
| 187 | /* ATMEL AT45DB011B (buffered flash) */ | 189 | /* ATMEL AT45DB011B (buffered flash) */ |
| 188 | {0x2e000003, 0x6e808273, 0x00570081, 0x68848353, 0xaf000400, | 190 | {0x2e000003, 0x6e808273, 0x00570081, 0x68848353, 0xaf000400, |
| 189 | 1, BUFFERED_FLASH_PAGE_BITS, BUFFERED_FLASH_PAGE_SIZE, | 191 | BUFFERED_FLAGS, BUFFERED_FLASH_PAGE_BITS, BUFFERED_FLASH_PAGE_SIZE, |
| 190 | BUFFERED_FLASH_BYTE_ADDR_MASK, BUFFERED_FLASH_TOTAL_SIZE, | 192 | BUFFERED_FLASH_BYTE_ADDR_MASK, BUFFERED_FLASH_TOTAL_SIZE, |
| 191 | "Buffered flash (128kB)"}, | 193 | "Buffered flash (128kB)"}, |
| 192 | /* Expansion entry 1100 */ | 194 | /* Expansion entry 1100 */ |
| 193 | {0x33000000, 0x73808201, 0x00050081, 0x03840253, 0xaf020406, | 195 | {0x33000000, 0x73808201, 0x00050081, 0x03840253, 0xaf020406, |
| 194 | 0, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE, | 196 | NONBUFFERED_FLAGS, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE, |
| 195 | SAIFUN_FLASH_BYTE_ADDR_MASK, 0, | 197 | SAIFUN_FLASH_BYTE_ADDR_MASK, 0, |
| 196 | "Entry 1100"}, | 198 | "Entry 1100"}, |
| 197 | /* Expansion entry 1101 */ | 199 | /* Expansion entry 1101 */ |
| 198 | {0x3b000002, 0x7b808201, 0x00050081, 0x03840253, 0xaf020406, | 200 | {0x3b000002, 0x7b808201, 0x00050081, 0x03840253, 0xaf020406, |
| 199 | 0, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE, | 201 | NONBUFFERED_FLAGS, SAIFUN_FLASH_PAGE_BITS, SAIFUN_FLASH_PAGE_SIZE, |
| 200 | SAIFUN_FLASH_BYTE_ADDR_MASK, 0, | 202 | SAIFUN_FLASH_BYTE_ADDR_MASK, 0, |
| 201 | "Entry 1101"}, | 203 | "Entry 1101"}, |
| 202 | /* Ateml Expansion entry 1110 */ | 204 | /* Ateml Expansion entry 1110 */ |
| 203 | {0x37000001, 0x76808273, 0x00570081, 0x68848353, 0xaf000400, | 205 | {0x37000001, 0x76808273, 0x00570081, 0x68848353, 0xaf000400, |
| 204 | 1, BUFFERED_FLASH_PAGE_BITS, BUFFERED_FLASH_PAGE_SIZE, | 206 | BUFFERED_FLAGS, BUFFERED_FLASH_PAGE_BITS, BUFFERED_FLASH_PAGE_SIZE, |
| 205 | BUFFERED_FLASH_BYTE_ADDR_MASK, 0, | 207 | BUFFERED_FLASH_BYTE_ADDR_MASK, 0, |
| 206 | "Entry 1110 (Atmel)"}, | 208 | "Entry 1110 (Atmel)"}, |
| 207 | /* ATMEL AT45DB021B (buffered flash) */ | 209 | /* ATMEL AT45DB021B (buffered flash) */ |
| 208 | {0x3f000003, 0x7e808273, 0x00570081, 0x68848353, 0xaf000400, | 210 | {0x3f000003, 0x7e808273, 0x00570081, 0x68848353, 0xaf000400, |
| 209 | 1, BUFFERED_FLASH_PAGE_BITS, BUFFERED_FLASH_PAGE_SIZE, | 211 | BUFFERED_FLAGS, BUFFERED_FLASH_PAGE_BITS, BUFFERED_FLASH_PAGE_SIZE, |
| 210 | BUFFERED_FLASH_BYTE_ADDR_MASK, BUFFERED_FLASH_TOTAL_SIZE*2, | 212 | BUFFERED_FLASH_BYTE_ADDR_MASK, BUFFERED_FLASH_TOTAL_SIZE*2, |
| 211 | "Buffered flash (256kB)"}, | 213 | "Buffered flash (256kB)"}, |
| 212 | }; | 214 | }; |
| 213 | 215 | ||
| 216 | static struct flash_spec flash_5709 = { | ||
| 217 | .flags = BNX2_NV_BUFFERED, | ||
| 218 | .page_bits = BCM5709_FLASH_PAGE_BITS, | ||
| 219 | .page_size = BCM5709_FLASH_PAGE_SIZE, | ||
| 220 | .addr_mask = BCM5709_FLASH_BYTE_ADDR_MASK, | ||
| 221 | .total_size = BUFFERED_FLASH_TOTAL_SIZE*2, | ||
| 222 | .name = "5709 Buffered flash (256kB)", | ||
| 223 | }; | ||
| 224 | |||
| 214 | MODULE_DEVICE_TABLE(pci, bnx2_pci_tbl); | 225 | MODULE_DEVICE_TABLE(pci, bnx2_pci_tbl); |
| 215 | 226 | ||
| 216 | static inline u32 bnx2_tx_avail(struct bnx2 *bp) | 227 | static inline u32 bnx2_tx_avail(struct bnx2 *bp) |
| @@ -3289,7 +3300,7 @@ bnx2_enable_nvram_write(struct bnx2 *bp) | |||
| 3289 | val = REG_RD(bp, BNX2_MISC_CFG); | 3300 | val = REG_RD(bp, BNX2_MISC_CFG); |
| 3290 | REG_WR(bp, BNX2_MISC_CFG, val | BNX2_MISC_CFG_NVM_WR_EN_PCI); | 3301 | REG_WR(bp, BNX2_MISC_CFG, val | BNX2_MISC_CFG_NVM_WR_EN_PCI); |
| 3291 | 3302 | ||
| 3292 | if (!bp->flash_info->buffered) { | 3303 | if (bp->flash_info->flags & BNX2_NV_WREN) { |
| 3293 | int j; | 3304 | int j; |
| 3294 | 3305 | ||
| 3295 | REG_WR(bp, BNX2_NVM_COMMAND, BNX2_NVM_COMMAND_DONE); | 3306 | REG_WR(bp, BNX2_NVM_COMMAND, BNX2_NVM_COMMAND_DONE); |
| @@ -3349,7 +3360,7 @@ bnx2_nvram_erase_page(struct bnx2 *bp, u32 offset) | |||
| 3349 | u32 cmd; | 3360 | u32 cmd; |
| 3350 | int j; | 3361 | int j; |
| 3351 | 3362 | ||
| 3352 | if (bp->flash_info->buffered) | 3363 | if (bp->flash_info->flags & BNX2_NV_BUFFERED) |
| 3353 | /* Buffered flash, no erase needed */ | 3364 | /* Buffered flash, no erase needed */ |
| 3354 | return 0; | 3365 | return 0; |
| 3355 | 3366 | ||
| @@ -3392,8 +3403,8 @@ bnx2_nvram_read_dword(struct bnx2 *bp, u32 offset, u8 *ret_val, u32 cmd_flags) | |||
| 3392 | /* Build the command word. */ | 3403 | /* Build the command word. */ |
| 3393 | cmd = BNX2_NVM_COMMAND_DOIT | cmd_flags; | 3404 | cmd = BNX2_NVM_COMMAND_DOIT | cmd_flags; |
| 3394 | 3405 | ||
| 3395 | /* Calculate an offset of a buffered flash. */ | 3406 | /* Calculate an offset of a buffered flash, not needed for 5709. */ |
| 3396 | if (bp->flash_info->buffered) { | 3407 | if (bp->flash_info->flags & BNX2_NV_TRANSLATE) { |
| 3397 | offset = ((offset / bp->flash_info->page_size) << | 3408 | offset = ((offset / bp->flash_info->page_size) << |
| 3398 | bp->flash_info->page_bits) + | 3409 | bp->flash_info->page_bits) + |
| 3399 | (offset % bp->flash_info->page_size); | 3410 | (offset % bp->flash_info->page_size); |
| @@ -3439,8 +3450,8 @@ bnx2_nvram_write_dword(struct bnx2 *bp, u32 offset, u8 *val, u32 cmd_flags) | |||
| 3439 | /* Build the command word. */ | 3450 | /* Build the command word. */ |
| 3440 | cmd = BNX2_NVM_COMMAND_DOIT | BNX2_NVM_COMMAND_WR | cmd_flags; | 3451 | cmd = BNX2_NVM_COMMAND_DOIT | BNX2_NVM_COMMAND_WR | cmd_flags; |
| 3441 | 3452 | ||
| 3442 | /* Calculate an offset of a buffered flash. */ | 3453 | /* Calculate an offset of a buffered flash, not needed for 5709. */ |
| 3443 | if (bp->flash_info->buffered) { | 3454 | if (bp->flash_info->flags & BNX2_NV_TRANSLATE) { |
| 3444 | offset = ((offset / bp->flash_info->page_size) << | 3455 | offset = ((offset / bp->flash_info->page_size) << |
| 3445 | bp->flash_info->page_bits) + | 3456 | bp->flash_info->page_bits) + |
| 3446 | (offset % bp->flash_info->page_size); | 3457 | (offset % bp->flash_info->page_size); |
| @@ -3478,15 +3489,19 @@ static int | |||
| 3478 | bnx2_init_nvram(struct bnx2 *bp) | 3489 | bnx2_init_nvram(struct bnx2 *bp) |
| 3479 | { | 3490 | { |
| 3480 | u32 val; | 3491 | u32 val; |
| 3481 | int j, entry_count, rc; | 3492 | int j, entry_count, rc = 0; |
| 3482 | struct flash_spec *flash; | 3493 | struct flash_spec *flash; |
| 3483 | 3494 | ||
| 3495 | if (CHIP_NUM(bp) == CHIP_NUM_5709) { | ||
| 3496 | bp->flash_info = &flash_5709; | ||
| 3497 | goto get_flash_size; | ||
| 3498 | } | ||
| 3499 | |||
| 3484 | /* Determine the selected interface. */ | 3500 | /* Determine the selected interface. */ |
| 3485 | val = REG_RD(bp, BNX2_NVM_CFG1); | 3501 | val = REG_RD(bp, BNX2_NVM_CFG1); |
| 3486 | 3502 | ||
| 3487 | entry_count = sizeof(flash_table) / sizeof(struct flash_spec); | 3503 | entry_count = sizeof(flash_table) / sizeof(struct flash_spec); |
| 3488 | 3504 | ||
| 3489 | rc = 0; | ||
| 3490 | if (val & 0x40000000) { | 3505 | if (val & 0x40000000) { |
| 3491 | 3506 | ||
| 3492 | /* Flash interface has been reconfigured */ | 3507 | /* Flash interface has been reconfigured */ |
| @@ -3542,6 +3557,7 @@ bnx2_init_nvram(struct bnx2 *bp) | |||
| 3542 | return -ENODEV; | 3557 | return -ENODEV; |
| 3543 | } | 3558 | } |
| 3544 | 3559 | ||
| 3560 | get_flash_size: | ||
| 3545 | val = REG_RD_IND(bp, bp->shmem_base + BNX2_SHARED_HW_CFG_CONFIG2); | 3561 | val = REG_RD_IND(bp, bp->shmem_base + BNX2_SHARED_HW_CFG_CONFIG2); |
| 3546 | val &= BNX2_SHARED_HW_CFG2_NVM_SIZE_MASK; | 3562 | val &= BNX2_SHARED_HW_CFG2_NVM_SIZE_MASK; |
| 3547 | if (val) | 3563 | if (val) |
| @@ -3706,7 +3722,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
| 3706 | buf = align_buf; | 3722 | buf = align_buf; |
| 3707 | } | 3723 | } |
| 3708 | 3724 | ||
| 3709 | if (bp->flash_info->buffered == 0) { | 3725 | if (!(bp->flash_info->flags & BNX2_NV_BUFFERED)) { |
| 3710 | flash_buffer = kmalloc(264, GFP_KERNEL); | 3726 | flash_buffer = kmalloc(264, GFP_KERNEL); |
| 3711 | if (flash_buffer == NULL) { | 3727 | if (flash_buffer == NULL) { |
| 3712 | rc = -ENOMEM; | 3728 | rc = -ENOMEM; |
| @@ -3739,7 +3755,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
| 3739 | bnx2_enable_nvram_access(bp); | 3755 | bnx2_enable_nvram_access(bp); |
| 3740 | 3756 | ||
| 3741 | cmd_flags = BNX2_NVM_COMMAND_FIRST; | 3757 | cmd_flags = BNX2_NVM_COMMAND_FIRST; |
| 3742 | if (bp->flash_info->buffered == 0) { | 3758 | if (!(bp->flash_info->flags & BNX2_NV_BUFFERED)) { |
| 3743 | int j; | 3759 | int j; |
| 3744 | 3760 | ||
| 3745 | /* Read the whole page into the buffer | 3761 | /* Read the whole page into the buffer |
| @@ -3767,7 +3783,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
| 3767 | /* Loop to write back the buffer data from page_start to | 3783 | /* Loop to write back the buffer data from page_start to |
| 3768 | * data_start */ | 3784 | * data_start */ |
| 3769 | i = 0; | 3785 | i = 0; |
| 3770 | if (bp->flash_info->buffered == 0) { | 3786 | if (!(bp->flash_info->flags & BNX2_NV_BUFFERED)) { |
| 3771 | /* Erase the page */ | 3787 | /* Erase the page */ |
| 3772 | if ((rc = bnx2_nvram_erase_page(bp, page_start)) != 0) | 3788 | if ((rc = bnx2_nvram_erase_page(bp, page_start)) != 0) |
| 3773 | goto nvram_write_end; | 3789 | goto nvram_write_end; |
| @@ -3791,7 +3807,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
| 3791 | /* Loop to write the new data from data_start to data_end */ | 3807 | /* Loop to write the new data from data_start to data_end */ |
| 3792 | for (addr = data_start; addr < data_end; addr += 4, i += 4) { | 3808 | for (addr = data_start; addr < data_end; addr += 4, i += 4) { |
| 3793 | if ((addr == page_end - 4) || | 3809 | if ((addr == page_end - 4) || |
| 3794 | ((bp->flash_info->buffered) && | 3810 | ((bp->flash_info->flags & BNX2_NV_BUFFERED) && |
| 3795 | (addr == data_end - 4))) { | 3811 | (addr == data_end - 4))) { |
| 3796 | 3812 | ||
| 3797 | cmd_flags |= BNX2_NVM_COMMAND_LAST; | 3813 | cmd_flags |= BNX2_NVM_COMMAND_LAST; |
| @@ -3808,7 +3824,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
| 3808 | 3824 | ||
| 3809 | /* Loop to write back the buffer data from data_end | 3825 | /* Loop to write back the buffer data from data_end |
| 3810 | * to page_end */ | 3826 | * to page_end */ |
| 3811 | if (bp->flash_info->buffered == 0) { | 3827 | if (!(bp->flash_info->flags & BNX2_NV_BUFFERED)) { |
| 3812 | for (addr = data_end; addr < page_end; | 3828 | for (addr = data_end; addr < page_end; |
| 3813 | addr += 4, i += 4) { | 3829 | addr += 4, i += 4) { |
| 3814 | 3830 | ||
| @@ -4107,7 +4123,7 @@ bnx2_init_chip(struct bnx2 *bp) | |||
| 4107 | if (CHIP_NUM(bp) == CHIP_NUM_5708) | 4123 | if (CHIP_NUM(bp) == CHIP_NUM_5708) |
| 4108 | REG_WR(bp, BNX2_HC_STATS_TICKS, 0); | 4124 | REG_WR(bp, BNX2_HC_STATS_TICKS, 0); |
| 4109 | else | 4125 | else |
| 4110 | REG_WR(bp, BNX2_HC_STATS_TICKS, bp->stats_ticks & 0xffff00); | 4126 | REG_WR(bp, BNX2_HC_STATS_TICKS, bp->stats_ticks); |
| 4111 | REG_WR(bp, BNX2_HC_STAT_COLLECT_TICKS, 0xbb8); /* 3ms */ | 4127 | REG_WR(bp, BNX2_HC_STAT_COLLECT_TICKS, 0xbb8); /* 3ms */ |
| 4112 | 4128 | ||
| 4113 | if (CHIP_ID(bp) == CHIP_ID_5706_A1) | 4129 | if (CHIP_ID(bp) == CHIP_ID_5706_A1) |
| @@ -4127,10 +4143,6 @@ bnx2_init_chip(struct bnx2 *bp) | |||
| 4127 | 4143 | ||
| 4128 | REG_WR(bp, BNX2_HC_ATTN_BITS_ENABLE, STATUS_ATTN_EVENTS); | 4144 | REG_WR(bp, BNX2_HC_ATTN_BITS_ENABLE, STATUS_ATTN_EVENTS); |
| 4129 | 4145 | ||
| 4130 | if (REG_RD_IND(bp, bp->shmem_base + BNX2_PORT_FEATURE) & | ||
| 4131 | BNX2_PORT_FEATURE_ASF_ENABLED) | ||
| 4132 | bp->flags |= ASF_ENABLE_FLAG; | ||
| 4133 | |||
| 4134 | /* Initialize the receive filter. */ | 4146 | /* Initialize the receive filter. */ |
| 4135 | bnx2_set_rx_mode(bp->dev); | 4147 | bnx2_set_rx_mode(bp->dev); |
| 4136 | 4148 | ||
| @@ -5786,8 +5798,9 @@ bnx2_set_coalesce(struct net_device *dev, struct ethtool_coalesce *coal) | |||
| 5786 | if (bp->stats_ticks != 0 && bp->stats_ticks != USEC_PER_SEC) | 5798 | if (bp->stats_ticks != 0 && bp->stats_ticks != USEC_PER_SEC) |
| 5787 | bp->stats_ticks = USEC_PER_SEC; | 5799 | bp->stats_ticks = USEC_PER_SEC; |
| 5788 | } | 5800 | } |
| 5789 | if (bp->stats_ticks > 0xffff00) bp->stats_ticks = 0xffff00; | 5801 | if (bp->stats_ticks > BNX2_HC_STATS_TICKS_HC_STAT_TICKS) |
| 5790 | bp->stats_ticks &= 0xffff00; | 5802 | bp->stats_ticks = BNX2_HC_STATS_TICKS_HC_STAT_TICKS; |
| 5803 | bp->stats_ticks &= BNX2_HC_STATS_TICKS_HC_STAT_TICKS; | ||
| 5791 | 5804 | ||
| 5792 | if (netif_running(bp->dev)) { | 5805 | if (netif_running(bp->dev)) { |
| 5793 | bnx2_netif_stop(bp); | 5806 | bnx2_netif_stop(bp); |
| @@ -6629,6 +6642,18 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
| 6629 | if (i != 2) | 6642 | if (i != 2) |
| 6630 | bp->fw_version[j++] = '.'; | 6643 | bp->fw_version[j++] = '.'; |
| 6631 | } | 6644 | } |
| 6645 | if (REG_RD_IND(bp, bp->shmem_base + BNX2_PORT_FEATURE) & | ||
| 6646 | BNX2_PORT_FEATURE_ASF_ENABLED) { | ||
| 6647 | bp->flags |= ASF_ENABLE_FLAG; | ||
| 6648 | |||
| 6649 | for (i = 0; i < 30; i++) { | ||
| 6650 | reg = REG_RD_IND(bp, bp->shmem_base + | ||
| 6651 | BNX2_BC_STATE_CONDITION); | ||
| 6652 | if (reg & BNX2_CONDITION_MFW_RUN_MASK) | ||
| 6653 | break; | ||
| 6654 | msleep(10); | ||
| 6655 | } | ||
| 6656 | } | ||
| 6632 | reg = REG_RD_IND(bp, bp->shmem_base + BNX2_BC_STATE_CONDITION); | 6657 | reg = REG_RD_IND(bp, bp->shmem_base + BNX2_BC_STATE_CONDITION); |
| 6633 | reg &= BNX2_CONDITION_MFW_RUN_MASK; | 6658 | reg &= BNX2_CONDITION_MFW_RUN_MASK; |
| 6634 | if (reg != BNX2_CONDITION_MFW_RUN_UNKNOWN && | 6659 | if (reg != BNX2_CONDITION_MFW_RUN_UNKNOWN && |
| @@ -6672,7 +6697,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
| 6672 | bp->rx_ticks_int = 18; | 6697 | bp->rx_ticks_int = 18; |
| 6673 | bp->rx_ticks = 18; | 6698 | bp->rx_ticks = 18; |
| 6674 | 6699 | ||
| 6675 | bp->stats_ticks = 1000000 & 0xffff00; | 6700 | bp->stats_ticks = USEC_PER_SEC & BNX2_HC_STATS_TICKS_HC_STAT_TICKS; |
| 6676 | 6701 | ||
| 6677 | bp->timer_interval = HZ; | 6702 | bp->timer_interval = HZ; |
| 6678 | bp->current_interval = HZ; | 6703 | bp->current_interval = HZ; |
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index d8cd1afeb23d..102adfe1e923 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h | |||
| @@ -6433,6 +6433,11 @@ struct sw_bd { | |||
| 6433 | #define ST_MICRO_FLASH_PAGE_SIZE 256 | 6433 | #define ST_MICRO_FLASH_PAGE_SIZE 256 |
| 6434 | #define ST_MICRO_FLASH_BASE_TOTAL_SIZE 65536 | 6434 | #define ST_MICRO_FLASH_BASE_TOTAL_SIZE 65536 |
| 6435 | 6435 | ||
| 6436 | #define BCM5709_FLASH_PAGE_BITS 8 | ||
| 6437 | #define BCM5709_FLASH_PHY_PAGE_SIZE (1 << BCM5709_FLASH_PAGE_BITS) | ||
| 6438 | #define BCM5709_FLASH_BYTE_ADDR_MASK (BCM5709_FLASH_PHY_PAGE_SIZE-1) | ||
| 6439 | #define BCM5709_FLASH_PAGE_SIZE 256 | ||
| 6440 | |||
| 6436 | #define NVRAM_TIMEOUT_COUNT 30000 | 6441 | #define NVRAM_TIMEOUT_COUNT 30000 |
| 6437 | 6442 | ||
| 6438 | 6443 | ||
| @@ -6449,7 +6454,10 @@ struct flash_spec { | |||
| 6449 | u32 config2; | 6454 | u32 config2; |
| 6450 | u32 config3; | 6455 | u32 config3; |
| 6451 | u32 write1; | 6456 | u32 write1; |
| 6452 | u32 buffered; | 6457 | u32 flags; |
| 6458 | #define BNX2_NV_BUFFERED 0x00000001 | ||
| 6459 | #define BNX2_NV_TRANSLATE 0x00000002 | ||
| 6460 | #define BNX2_NV_WREN 0x00000004 | ||
| 6453 | u32 page_bits; | 6461 | u32 page_bits; |
| 6454 | u32 page_size; | 6462 | u32 page_size; |
| 6455 | u32 addr_mask; | 6463 | u32 addr_mask; |
diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c index 5891a0fbdc8b..f87176055d0e 100644 --- a/drivers/net/pppol2tp.c +++ b/drivers/net/pppol2tp.c | |||
| @@ -824,6 +824,7 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh | |||
| 824 | struct pppol2tp_session *session; | 824 | struct pppol2tp_session *session; |
| 825 | struct pppol2tp_tunnel *tunnel; | 825 | struct pppol2tp_tunnel *tunnel; |
| 826 | struct udphdr *uh; | 826 | struct udphdr *uh; |
| 827 | unsigned int len; | ||
| 827 | 828 | ||
| 828 | error = -ENOTCONN; | 829 | error = -ENOTCONN; |
| 829 | if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED)) | 830 | if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED)) |
| @@ -912,14 +913,15 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh | |||
| 912 | } | 913 | } |
| 913 | 914 | ||
| 914 | /* Queue the packet to IP for output */ | 915 | /* Queue the packet to IP for output */ |
| 916 | len = skb->len; | ||
| 915 | error = ip_queue_xmit(skb, 1); | 917 | error = ip_queue_xmit(skb, 1); |
| 916 | 918 | ||
| 917 | /* Update stats */ | 919 | /* Update stats */ |
| 918 | if (error >= 0) { | 920 | if (error >= 0) { |
| 919 | tunnel->stats.tx_packets++; | 921 | tunnel->stats.tx_packets++; |
| 920 | tunnel->stats.tx_bytes += skb->len; | 922 | tunnel->stats.tx_bytes += len; |
| 921 | session->stats.tx_packets++; | 923 | session->stats.tx_packets++; |
| 922 | session->stats.tx_bytes += skb->len; | 924 | session->stats.tx_bytes += len; |
| 923 | } else { | 925 | } else { |
| 924 | tunnel->stats.tx_errors++; | 926 | tunnel->stats.tx_errors++; |
| 925 | session->stats.tx_errors++; | 927 | session->stats.tx_errors++; |
| @@ -958,6 +960,7 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb) | |||
| 958 | __wsum csum = 0; | 960 | __wsum csum = 0; |
| 959 | struct sk_buff *skb2 = NULL; | 961 | struct sk_buff *skb2 = NULL; |
| 960 | struct udphdr *uh; | 962 | struct udphdr *uh; |
| 963 | unsigned int len; | ||
| 961 | 964 | ||
| 962 | if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED)) | 965 | if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED)) |
| 963 | goto abort; | 966 | goto abort; |
| @@ -1046,18 +1049,25 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb) | |||
| 1046 | printk("\n"); | 1049 | printk("\n"); |
| 1047 | } | 1050 | } |
| 1048 | 1051 | ||
| 1052 | memset(&(IPCB(skb2)->opt), 0, sizeof(IPCB(skb2)->opt)); | ||
| 1053 | IPCB(skb2)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED | | ||
| 1054 | IPSKB_REROUTED); | ||
| 1055 | nf_reset(skb2); | ||
| 1056 | |||
| 1049 | /* Get routing info from the tunnel socket */ | 1057 | /* Get routing info from the tunnel socket */ |
| 1058 | dst_release(skb2->dst); | ||
| 1050 | skb2->dst = sk_dst_get(sk_tun); | 1059 | skb2->dst = sk_dst_get(sk_tun); |
| 1051 | 1060 | ||
| 1052 | /* Queue the packet to IP for output */ | 1061 | /* Queue the packet to IP for output */ |
| 1062 | len = skb2->len; | ||
| 1053 | rc = ip_queue_xmit(skb2, 1); | 1063 | rc = ip_queue_xmit(skb2, 1); |
| 1054 | 1064 | ||
| 1055 | /* Update stats */ | 1065 | /* Update stats */ |
| 1056 | if (rc >= 0) { | 1066 | if (rc >= 0) { |
| 1057 | tunnel->stats.tx_packets++; | 1067 | tunnel->stats.tx_packets++; |
| 1058 | tunnel->stats.tx_bytes += skb2->len; | 1068 | tunnel->stats.tx_bytes += len; |
| 1059 | session->stats.tx_packets++; | 1069 | session->stats.tx_packets++; |
| 1060 | session->stats.tx_bytes += skb2->len; | 1070 | session->stats.tx_bytes += len; |
| 1061 | } else { | 1071 | } else { |
| 1062 | tunnel->stats.tx_errors++; | 1072 | tunnel->stats.tx_errors++; |
| 1063 | session->stats.tx_errors++; | 1073 | session->stats.tx_errors++; |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index da7a13c97eb8..9820ca1e45e2 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -1098,10 +1098,8 @@ extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all | |||
| 1098 | extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly); | 1098 | extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly); |
| 1099 | extern int dev_mc_sync(struct net_device *to, struct net_device *from); | 1099 | extern int dev_mc_sync(struct net_device *to, struct net_device *from); |
| 1100 | extern void dev_mc_unsync(struct net_device *to, struct net_device *from); | 1100 | extern void dev_mc_unsync(struct net_device *to, struct net_device *from); |
| 1101 | extern void dev_mc_discard(struct net_device *dev); | ||
| 1102 | extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *addr, int alen, int all); | 1101 | extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *addr, int alen, int all); |
| 1103 | extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly); | 1102 | extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly); |
| 1104 | extern void __dev_addr_discard(struct dev_addr_list **list); | ||
| 1105 | extern void dev_set_promiscuity(struct net_device *dev, int inc); | 1103 | extern void dev_set_promiscuity(struct net_device *dev, int inc); |
| 1106 | extern void dev_set_allmulti(struct net_device *dev, int inc); | 1104 | extern void dev_set_allmulti(struct net_device *dev, int inc); |
| 1107 | extern void netdev_state_change(struct net_device *dev); | 1105 | extern void netdev_state_change(struct net_device *dev); |
diff --git a/include/linux/netfilter_ipv4/ipt_iprange.h b/include/linux/netfilter_ipv4/ipt_iprange.h index 34ab0fb736e2..a92fefc3c7ec 100644 --- a/include/linux/netfilter_ipv4/ipt_iprange.h +++ b/include/linux/netfilter_ipv4/ipt_iprange.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #ifndef _IPT_IPRANGE_H | 1 | #ifndef _IPT_IPRANGE_H |
| 2 | #define _IPT_IPRANGE_H | 2 | #define _IPT_IPRANGE_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 4 | #define IPRANGE_SRC 0x01 /* Match source IP address */ | 6 | #define IPRANGE_SRC 0x01 /* Match source IP address */ |
| 5 | #define IPRANGE_DST 0x02 /* Match destination IP address */ | 7 | #define IPRANGE_DST 0x02 /* Match destination IP address */ |
| 6 | #define IPRANGE_SRC_INV 0x10 /* Negate the condition */ | 8 | #define IPRANGE_SRC_INV 0x10 /* Negate the condition */ |
diff --git a/include/net/tcp.h b/include/net/tcp.h index a8af9ae00177..8b404b1ef7c8 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
| @@ -652,8 +652,7 @@ struct tcp_congestion_ops { | |||
| 652 | /* lower bound for congestion window (optional) */ | 652 | /* lower bound for congestion window (optional) */ |
| 653 | u32 (*min_cwnd)(const struct sock *sk); | 653 | u32 (*min_cwnd)(const struct sock *sk); |
| 654 | /* do new cwnd calculation (required) */ | 654 | /* do new cwnd calculation (required) */ |
| 655 | void (*cong_avoid)(struct sock *sk, u32 ack, | 655 | void (*cong_avoid)(struct sock *sk, u32 ack, u32 in_flight, int good_ack); |
| 656 | u32 rtt, u32 in_flight, int good_ack); | ||
| 657 | /* call before changing ca_state (optional) */ | 656 | /* call before changing ca_state (optional) */ |
| 658 | void (*set_state)(struct sock *sk, u8 new_state); | 657 | void (*set_state)(struct sock *sk, u8 new_state); |
| 659 | /* call when cwnd event occurs (optional) */ | 658 | /* call when cwnd event occurs (optional) */ |
| @@ -684,8 +683,7 @@ extern void tcp_slow_start(struct tcp_sock *tp); | |||
| 684 | 683 | ||
| 685 | extern struct tcp_congestion_ops tcp_init_congestion_ops; | 684 | extern struct tcp_congestion_ops tcp_init_congestion_ops; |
| 686 | extern u32 tcp_reno_ssthresh(struct sock *sk); | 685 | extern u32 tcp_reno_ssthresh(struct sock *sk); |
| 687 | extern void tcp_reno_cong_avoid(struct sock *sk, u32 ack, | 686 | extern void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 in_flight, int flag); |
| 688 | u32 rtt, u32 in_flight, int flag); | ||
| 689 | extern u32 tcp_reno_min_cwnd(const struct sock *sk); | 687 | extern u32 tcp_reno_min_cwnd(const struct sock *sk); |
| 690 | extern struct tcp_congestion_ops tcp_reno; | 688 | extern struct tcp_congestion_ops tcp_reno; |
| 691 | 689 | ||
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index ae959e950174..a5f80bfbaaa4 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
| @@ -585,7 +585,6 @@ static inline int xfrm_sec_ctx_match(struct xfrm_sec_ctx *s1, struct xfrm_sec_ct | |||
| 585 | struct xfrm_dst | 585 | struct xfrm_dst |
| 586 | { | 586 | { |
| 587 | union { | 587 | union { |
| 588 | struct xfrm_dst *next; | ||
| 589 | struct dst_entry dst; | 588 | struct dst_entry dst; |
| 590 | struct rtable rt; | 589 | struct rtable rt; |
| 591 | struct rt6_info rt6; | 590 | struct rt6_info rt6; |
diff --git a/net/atm/br2684.c b/net/atm/br2684.c index faa6aaf67563..c0f6861eefe3 100644 --- a/net/atm/br2684.c +++ b/net/atm/br2684.c | |||
| @@ -460,11 +460,7 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb) | |||
| 460 | skb_pull(skb, plen); | 460 | skb_pull(skb, plen); |
| 461 | skb_set_mac_header(skb, -ETH_HLEN); | 461 | skb_set_mac_header(skb, -ETH_HLEN); |
| 462 | skb->pkt_type = PACKET_HOST; | 462 | skb->pkt_type = PACKET_HOST; |
| 463 | #ifdef CONFIG_BR2684_FAST_TRANS | ||
| 464 | skb->protocol = ((u16 *) skb->data)[-1]; | ||
| 465 | #else /* some protocols might require this: */ | ||
| 466 | skb->protocol = br_type_trans(skb, net_dev); | 463 | skb->protocol = br_type_trans(skb, net_dev); |
| 467 | #endif /* CONFIG_BR2684_FAST_TRANS */ | ||
| 468 | #else | 464 | #else |
| 469 | skb_pull(skb, plen - ETH_HLEN); | 465 | skb_pull(skb, plen - ETH_HLEN); |
| 470 | skb->protocol = eth_type_trans(skb, net_dev); | 466 | skb->protocol = eth_type_trans(skb, net_dev); |
diff --git a/net/core/dev.c b/net/core/dev.c index 13a0d9f6da54..6357f54c8ff7 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -2715,20 +2715,6 @@ int __dev_addr_add(struct dev_addr_list **list, int *count, | |||
| 2715 | return 0; | 2715 | return 0; |
| 2716 | } | 2716 | } |
| 2717 | 2717 | ||
| 2718 | void __dev_addr_discard(struct dev_addr_list **list) | ||
| 2719 | { | ||
| 2720 | struct dev_addr_list *tmp; | ||
| 2721 | |||
| 2722 | while (*list != NULL) { | ||
| 2723 | tmp = *list; | ||
| 2724 | *list = tmp->next; | ||
| 2725 | if (tmp->da_users > tmp->da_gusers) | ||
| 2726 | printk("__dev_addr_discard: address leakage! " | ||
| 2727 | "da_users=%d\n", tmp->da_users); | ||
| 2728 | kfree(tmp); | ||
| 2729 | } | ||
| 2730 | } | ||
| 2731 | |||
| 2732 | /** | 2718 | /** |
| 2733 | * dev_unicast_delete - Release secondary unicast address. | 2719 | * dev_unicast_delete - Release secondary unicast address. |
| 2734 | * @dev: device | 2720 | * @dev: device |
| @@ -2777,11 +2763,30 @@ int dev_unicast_add(struct net_device *dev, void *addr, int alen) | |||
| 2777 | } | 2763 | } |
| 2778 | EXPORT_SYMBOL(dev_unicast_add); | 2764 | EXPORT_SYMBOL(dev_unicast_add); |
| 2779 | 2765 | ||
| 2780 | static void dev_unicast_discard(struct net_device *dev) | 2766 | static void __dev_addr_discard(struct dev_addr_list **list) |
| 2767 | { | ||
| 2768 | struct dev_addr_list *tmp; | ||
| 2769 | |||
| 2770 | while (*list != NULL) { | ||
| 2771 | tmp = *list; | ||
| 2772 | *list = tmp->next; | ||
| 2773 | if (tmp->da_users > tmp->da_gusers) | ||
| 2774 | printk("__dev_addr_discard: address leakage! " | ||
| 2775 | "da_users=%d\n", tmp->da_users); | ||
| 2776 | kfree(tmp); | ||
| 2777 | } | ||
| 2778 | } | ||
| 2779 | |||
| 2780 | static void dev_addr_discard(struct net_device *dev) | ||
| 2781 | { | 2781 | { |
| 2782 | netif_tx_lock_bh(dev); | 2782 | netif_tx_lock_bh(dev); |
| 2783 | |||
| 2783 | __dev_addr_discard(&dev->uc_list); | 2784 | __dev_addr_discard(&dev->uc_list); |
| 2784 | dev->uc_count = 0; | 2785 | dev->uc_count = 0; |
| 2786 | |||
| 2787 | __dev_addr_discard(&dev->mc_list); | ||
| 2788 | dev->mc_count = 0; | ||
| 2789 | |||
| 2785 | netif_tx_unlock_bh(dev); | 2790 | netif_tx_unlock_bh(dev); |
| 2786 | } | 2791 | } |
| 2787 | 2792 | ||
| @@ -3739,8 +3744,7 @@ void unregister_netdevice(struct net_device *dev) | |||
| 3739 | /* | 3744 | /* |
| 3740 | * Flush the unicast and multicast chains | 3745 | * Flush the unicast and multicast chains |
| 3741 | */ | 3746 | */ |
| 3742 | dev_unicast_discard(dev); | 3747 | dev_addr_discard(dev); |
| 3743 | dev_mc_discard(dev); | ||
| 3744 | 3748 | ||
| 3745 | if (dev->uninit) | 3749 | if (dev->uninit) |
| 3746 | dev->uninit(dev); | 3750 | dev->uninit(dev); |
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c index 235a2a8a0d05..99aece1aeccf 100644 --- a/net/core/dev_mcast.c +++ b/net/core/dev_mcast.c | |||
| @@ -177,18 +177,6 @@ void dev_mc_unsync(struct net_device *to, struct net_device *from) | |||
| 177 | } | 177 | } |
| 178 | EXPORT_SYMBOL(dev_mc_unsync); | 178 | EXPORT_SYMBOL(dev_mc_unsync); |
| 179 | 179 | ||
| 180 | /* | ||
| 181 | * Discard multicast list when a device is downed | ||
| 182 | */ | ||
| 183 | |||
| 184 | void dev_mc_discard(struct net_device *dev) | ||
| 185 | { | ||
| 186 | netif_tx_lock_bh(dev); | ||
| 187 | __dev_addr_discard(&dev->mc_list); | ||
| 188 | dev->mc_count = 0; | ||
| 189 | netif_tx_unlock_bh(dev); | ||
| 190 | } | ||
| 191 | |||
| 192 | #ifdef CONFIG_PROC_FS | 180 | #ifdef CONFIG_PROC_FS |
| 193 | static void *dev_mc_seq_start(struct seq_file *seq, loff_t *pos) | 181 | static void *dev_mc_seq_start(struct seq_file *seq, loff_t *pos) |
| 194 | { | 182 | { |
diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c index cc84d8d8a3c7..590a767b029c 100644 --- a/net/core/gen_estimator.c +++ b/net/core/gen_estimator.c | |||
| @@ -79,27 +79,27 @@ | |||
| 79 | 79 | ||
| 80 | struct gen_estimator | 80 | struct gen_estimator |
| 81 | { | 81 | { |
| 82 | struct gen_estimator *next; | 82 | struct list_head list; |
| 83 | struct gnet_stats_basic *bstats; | 83 | struct gnet_stats_basic *bstats; |
| 84 | struct gnet_stats_rate_est *rate_est; | 84 | struct gnet_stats_rate_est *rate_est; |
| 85 | spinlock_t *stats_lock; | 85 | spinlock_t *stats_lock; |
| 86 | unsigned interval; | ||
| 87 | int ewma_log; | 86 | int ewma_log; |
| 88 | u64 last_bytes; | 87 | u64 last_bytes; |
| 89 | u32 last_packets; | 88 | u32 last_packets; |
| 90 | u32 avpps; | 89 | u32 avpps; |
| 91 | u32 avbps; | 90 | u32 avbps; |
| 91 | struct rcu_head e_rcu; | ||
| 92 | }; | 92 | }; |
| 93 | 93 | ||
| 94 | struct gen_estimator_head | 94 | struct gen_estimator_head |
| 95 | { | 95 | { |
| 96 | struct timer_list timer; | 96 | struct timer_list timer; |
| 97 | struct gen_estimator *list; | 97 | struct list_head list; |
| 98 | }; | 98 | }; |
| 99 | 99 | ||
| 100 | static struct gen_estimator_head elist[EST_MAX_INTERVAL+1]; | 100 | static struct gen_estimator_head elist[EST_MAX_INTERVAL+1]; |
| 101 | 101 | ||
| 102 | /* Estimator array lock */ | 102 | /* Protects against NULL dereference */ |
| 103 | static DEFINE_RWLOCK(est_lock); | 103 | static DEFINE_RWLOCK(est_lock); |
| 104 | 104 | ||
| 105 | static void est_timer(unsigned long arg) | 105 | static void est_timer(unsigned long arg) |
| @@ -107,13 +107,17 @@ static void est_timer(unsigned long arg) | |||
| 107 | int idx = (int)arg; | 107 | int idx = (int)arg; |
| 108 | struct gen_estimator *e; | 108 | struct gen_estimator *e; |
| 109 | 109 | ||
| 110 | read_lock(&est_lock); | 110 | rcu_read_lock(); |
| 111 | for (e = elist[idx].list; e; e = e->next) { | 111 | list_for_each_entry_rcu(e, &elist[idx].list, list) { |
| 112 | u64 nbytes; | 112 | u64 nbytes; |
| 113 | u32 npackets; | 113 | u32 npackets; |
| 114 | u32 rate; | 114 | u32 rate; |
| 115 | 115 | ||
| 116 | spin_lock(e->stats_lock); | 116 | spin_lock(e->stats_lock); |
| 117 | read_lock(&est_lock); | ||
| 118 | if (e->bstats == NULL) | ||
| 119 | goto skip; | ||
| 120 | |||
| 117 | nbytes = e->bstats->bytes; | 121 | nbytes = e->bstats->bytes; |
| 118 | npackets = e->bstats->packets; | 122 | npackets = e->bstats->packets; |
| 119 | rate = (nbytes - e->last_bytes)<<(7 - idx); | 123 | rate = (nbytes - e->last_bytes)<<(7 - idx); |
| @@ -125,12 +129,14 @@ static void est_timer(unsigned long arg) | |||
| 125 | e->last_packets = npackets; | 129 | e->last_packets = npackets; |
| 126 | e->avpps += ((long)rate - (long)e->avpps) >> e->ewma_log; | 130 | e->avpps += ((long)rate - (long)e->avpps) >> e->ewma_log; |
| 127 | e->rate_est->pps = (e->avpps+0x1FF)>>10; | 131 | e->rate_est->pps = (e->avpps+0x1FF)>>10; |
| 132 | skip: | ||
| 133 | read_unlock(&est_lock); | ||
| 128 | spin_unlock(e->stats_lock); | 134 | spin_unlock(e->stats_lock); |
| 129 | } | 135 | } |
| 130 | 136 | ||
| 131 | if (elist[idx].list != NULL) | 137 | if (!list_empty(&elist[idx].list)) |
| 132 | mod_timer(&elist[idx].timer, jiffies + ((HZ<<idx)/4)); | 138 | mod_timer(&elist[idx].timer, jiffies + ((HZ<<idx)/4)); |
| 133 | read_unlock(&est_lock); | 139 | rcu_read_unlock(); |
| 134 | } | 140 | } |
| 135 | 141 | ||
| 136 | /** | 142 | /** |
| @@ -147,12 +153,17 @@ static void est_timer(unsigned long arg) | |||
| 147 | * &rate_est with the statistics lock grabed during this period. | 153 | * &rate_est with the statistics lock grabed during this period. |
| 148 | * | 154 | * |
| 149 | * Returns 0 on success or a negative error code. | 155 | * Returns 0 on success or a negative error code. |
| 156 | * | ||
| 157 | * NOTE: Called under rtnl_mutex | ||
| 150 | */ | 158 | */ |
| 151 | int gen_new_estimator(struct gnet_stats_basic *bstats, | 159 | int gen_new_estimator(struct gnet_stats_basic *bstats, |
| 152 | struct gnet_stats_rate_est *rate_est, spinlock_t *stats_lock, struct rtattr *opt) | 160 | struct gnet_stats_rate_est *rate_est, |
| 161 | spinlock_t *stats_lock, | ||
| 162 | struct rtattr *opt) | ||
| 153 | { | 163 | { |
| 154 | struct gen_estimator *est; | 164 | struct gen_estimator *est; |
| 155 | struct gnet_estimator *parm = RTA_DATA(opt); | 165 | struct gnet_estimator *parm = RTA_DATA(opt); |
| 166 | int idx; | ||
| 156 | 167 | ||
| 157 | if (RTA_PAYLOAD(opt) < sizeof(*parm)) | 168 | if (RTA_PAYLOAD(opt) < sizeof(*parm)) |
| 158 | return -EINVAL; | 169 | return -EINVAL; |
| @@ -164,7 +175,7 @@ int gen_new_estimator(struct gnet_stats_basic *bstats, | |||
| 164 | if (est == NULL) | 175 | if (est == NULL) |
| 165 | return -ENOBUFS; | 176 | return -ENOBUFS; |
| 166 | 177 | ||
| 167 | est->interval = parm->interval + 2; | 178 | idx = parm->interval + 2; |
| 168 | est->bstats = bstats; | 179 | est->bstats = bstats; |
| 169 | est->rate_est = rate_est; | 180 | est->rate_est = rate_est; |
| 170 | est->stats_lock = stats_lock; | 181 | est->stats_lock = stats_lock; |
| @@ -174,20 +185,25 @@ int gen_new_estimator(struct gnet_stats_basic *bstats, | |||
| 174 | est->last_packets = bstats->packets; | 185 | est->last_packets = bstats->packets; |
| 175 | est->avpps = rate_est->pps<<10; | 186 | est->avpps = rate_est->pps<<10; |
| 176 | 187 | ||
| 177 | est->next = elist[est->interval].list; | 188 | if (!elist[idx].timer.function) { |
| 178 | if (est->next == NULL) { | 189 | INIT_LIST_HEAD(&elist[idx].list); |
| 179 | init_timer(&elist[est->interval].timer); | 190 | setup_timer(&elist[idx].timer, est_timer, idx); |
| 180 | elist[est->interval].timer.data = est->interval; | ||
| 181 | elist[est->interval].timer.expires = jiffies + ((HZ<<est->interval)/4); | ||
| 182 | elist[est->interval].timer.function = est_timer; | ||
| 183 | add_timer(&elist[est->interval].timer); | ||
| 184 | } | 191 | } |
| 185 | write_lock_bh(&est_lock); | 192 | |
| 186 | elist[est->interval].list = est; | 193 | if (list_empty(&elist[idx].list)) |
| 187 | write_unlock_bh(&est_lock); | 194 | mod_timer(&elist[idx].timer, jiffies + ((HZ<<idx)/4)); |
| 195 | |||
| 196 | list_add_rcu(&est->list, &elist[idx].list); | ||
| 188 | return 0; | 197 | return 0; |
| 189 | } | 198 | } |
| 190 | 199 | ||
| 200 | static void __gen_kill_estimator(struct rcu_head *head) | ||
| 201 | { | ||
| 202 | struct gen_estimator *e = container_of(head, | ||
| 203 | struct gen_estimator, e_rcu); | ||
| 204 | kfree(e); | ||
| 205 | } | ||
| 206 | |||
| 191 | /** | 207 | /** |
| 192 | * gen_kill_estimator - remove a rate estimator | 208 | * gen_kill_estimator - remove a rate estimator |
| 193 | * @bstats: basic statistics | 209 | * @bstats: basic statistics |
| @@ -195,31 +211,32 @@ int gen_new_estimator(struct gnet_stats_basic *bstats, | |||
| 195 | * | 211 | * |
| 196 | * Removes the rate estimator specified by &bstats and &rate_est | 212 | * Removes the rate estimator specified by &bstats and &rate_est |
| 197 | * and deletes the timer. | 213 | * and deletes the timer. |
| 214 | * | ||
| 215 | * NOTE: Called under rtnl_mutex | ||
| 198 | */ | 216 | */ |
| 199 | void gen_kill_estimator(struct gnet_stats_basic *bstats, | 217 | void gen_kill_estimator(struct gnet_stats_basic *bstats, |
| 200 | struct gnet_stats_rate_est *rate_est) | 218 | struct gnet_stats_rate_est *rate_est) |
| 201 | { | 219 | { |
| 202 | int idx; | 220 | int idx; |
| 203 | struct gen_estimator *est, **pest; | 221 | struct gen_estimator *e, *n; |
| 204 | 222 | ||
| 205 | for (idx=0; idx <= EST_MAX_INTERVAL; idx++) { | 223 | for (idx=0; idx <= EST_MAX_INTERVAL; idx++) { |
| 206 | int killed = 0; | 224 | |
| 207 | pest = &elist[idx].list; | 225 | /* Skip non initialized indexes */ |
| 208 | while ((est=*pest) != NULL) { | 226 | if (!elist[idx].timer.function) |
| 209 | if (est->rate_est != rate_est || est->bstats != bstats) { | 227 | continue; |
| 210 | pest = &est->next; | 228 | |
| 229 | list_for_each_entry_safe(e, n, &elist[idx].list, list) { | ||
| 230 | if (e->rate_est != rate_est || e->bstats != bstats) | ||
| 211 | continue; | 231 | continue; |
| 212 | } | ||
| 213 | 232 | ||
| 214 | write_lock_bh(&est_lock); | 233 | write_lock_bh(&est_lock); |
| 215 | *pest = est->next; | 234 | e->bstats = NULL; |
| 216 | write_unlock_bh(&est_lock); | 235 | write_unlock_bh(&est_lock); |
| 217 | 236 | ||
| 218 | kfree(est); | 237 | list_del_rcu(&e->list); |
| 219 | killed++; | 238 | call_rcu(&e->e_rcu, __gen_kill_estimator); |
| 220 | } | 239 | } |
| 221 | if (killed && elist[idx].list == NULL) | ||
| 222 | del_timer(&elist[idx].timer); | ||
| 223 | } | 240 | } |
| 224 | } | 241 | } |
| 225 | 242 | ||
diff --git a/net/ipv4/tcp_bic.c b/net/ipv4/tcp_bic.c index dd9ef65ad3ff..519de091a94d 100644 --- a/net/ipv4/tcp_bic.c +++ b/net/ipv4/tcp_bic.c | |||
| @@ -137,7 +137,7 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd) | |||
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | static void bictcp_cong_avoid(struct sock *sk, u32 ack, | 139 | static void bictcp_cong_avoid(struct sock *sk, u32 ack, |
| 140 | u32 seq_rtt, u32 in_flight, int data_acked) | 140 | u32 in_flight, int data_acked) |
| 141 | { | 141 | { |
| 142 | struct tcp_sock *tp = tcp_sk(sk); | 142 | struct tcp_sock *tp = tcp_sk(sk); |
| 143 | struct bictcp *ca = inet_csk_ca(sk); | 143 | struct bictcp *ca = inet_csk_ca(sk); |
diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c index 1260e52ad772..55fca1820c34 100644 --- a/net/ipv4/tcp_cong.c +++ b/net/ipv4/tcp_cong.c | |||
| @@ -324,8 +324,7 @@ EXPORT_SYMBOL_GPL(tcp_slow_start); | |||
| 324 | /* This is Jacobson's slow start and congestion avoidance. | 324 | /* This is Jacobson's slow start and congestion avoidance. |
| 325 | * SIGCOMM '88, p. 328. | 325 | * SIGCOMM '88, p. 328. |
| 326 | */ | 326 | */ |
| 327 | void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 rtt, u32 in_flight, | 327 | void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 in_flight, int flag) |
| 328 | int flag) | ||
| 329 | { | 328 | { |
| 330 | struct tcp_sock *tp = tcp_sk(sk); | 329 | struct tcp_sock *tp = tcp_sk(sk); |
| 331 | 330 | ||
diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c index ebfaac2f9f46..d17da30d82d6 100644 --- a/net/ipv4/tcp_cubic.c +++ b/net/ipv4/tcp_cubic.c | |||
| @@ -270,7 +270,7 @@ static inline void measure_delay(struct sock *sk) | |||
| 270 | } | 270 | } |
| 271 | 271 | ||
| 272 | static void bictcp_cong_avoid(struct sock *sk, u32 ack, | 272 | static void bictcp_cong_avoid(struct sock *sk, u32 ack, |
| 273 | u32 seq_rtt, u32 in_flight, int data_acked) | 273 | u32 in_flight, int data_acked) |
| 274 | { | 274 | { |
| 275 | struct tcp_sock *tp = tcp_sk(sk); | 275 | struct tcp_sock *tp = tcp_sk(sk); |
| 276 | struct bictcp *ca = inet_csk_ca(sk); | 276 | struct bictcp *ca = inet_csk_ca(sk); |
diff --git a/net/ipv4/tcp_highspeed.c b/net/ipv4/tcp_highspeed.c index 43d624e5043c..14a073d8b60f 100644 --- a/net/ipv4/tcp_highspeed.c +++ b/net/ipv4/tcp_highspeed.c | |||
| @@ -109,7 +109,7 @@ static void hstcp_init(struct sock *sk) | |||
| 109 | tp->snd_cwnd_clamp = min_t(u32, tp->snd_cwnd_clamp, 0xffffffff/128); | 109 | tp->snd_cwnd_clamp = min_t(u32, tp->snd_cwnd_clamp, 0xffffffff/128); |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | static void hstcp_cong_avoid(struct sock *sk, u32 adk, u32 rtt, | 112 | static void hstcp_cong_avoid(struct sock *sk, u32 adk, |
| 113 | u32 in_flight, int data_acked) | 113 | u32 in_flight, int data_acked) |
| 114 | { | 114 | { |
| 115 | struct tcp_sock *tp = tcp_sk(sk); | 115 | struct tcp_sock *tp = tcp_sk(sk); |
diff --git a/net/ipv4/tcp_htcp.c b/net/ipv4/tcp_htcp.c index 4ba4a7ae0a85..632c05a75883 100644 --- a/net/ipv4/tcp_htcp.c +++ b/net/ipv4/tcp_htcp.c | |||
| @@ -225,7 +225,7 @@ static u32 htcp_recalc_ssthresh(struct sock *sk) | |||
| 225 | return max((tp->snd_cwnd * ca->beta) >> 7, 2U); | 225 | return max((tp->snd_cwnd * ca->beta) >> 7, 2U); |
| 226 | } | 226 | } |
| 227 | 227 | ||
| 228 | static void htcp_cong_avoid(struct sock *sk, u32 ack, u32 rtt, | 228 | static void htcp_cong_avoid(struct sock *sk, u32 ack, s32 rtt, |
| 229 | u32 in_flight, int data_acked) | 229 | u32 in_flight, int data_acked) |
| 230 | { | 230 | { |
| 231 | struct tcp_sock *tp = tcp_sk(sk); | 231 | struct tcp_sock *tp = tcp_sk(sk); |
diff --git a/net/ipv4/tcp_hybla.c b/net/ipv4/tcp_hybla.c index e5be35117223..b3e55cf56171 100644 --- a/net/ipv4/tcp_hybla.c +++ b/net/ipv4/tcp_hybla.c | |||
| @@ -85,7 +85,7 @@ static inline u32 hybla_fraction(u32 odds) | |||
| 85 | * o Give cwnd a new value based on the model proposed | 85 | * o Give cwnd a new value based on the model proposed |
| 86 | * o remember increments <1 | 86 | * o remember increments <1 |
| 87 | */ | 87 | */ |
| 88 | static void hybla_cong_avoid(struct sock *sk, u32 ack, u32 rtt, | 88 | static void hybla_cong_avoid(struct sock *sk, u32 ack, |
| 89 | u32 in_flight, int flag) | 89 | u32 in_flight, int flag) |
| 90 | { | 90 | { |
| 91 | struct tcp_sock *tp = tcp_sk(sk); | 91 | struct tcp_sock *tp = tcp_sk(sk); |
| @@ -103,7 +103,7 @@ static void hybla_cong_avoid(struct sock *sk, u32 ack, u32 rtt, | |||
| 103 | return; | 103 | return; |
| 104 | 104 | ||
| 105 | if (!ca->hybla_en) | 105 | if (!ca->hybla_en) |
| 106 | return tcp_reno_cong_avoid(sk, ack, rtt, in_flight, flag); | 106 | return tcp_reno_cong_avoid(sk, ack, in_flight, flag); |
| 107 | 107 | ||
| 108 | if (ca->rho == 0) | 108 | if (ca->rho == 0) |
| 109 | hybla_recalc_param(sk); | 109 | hybla_recalc_param(sk); |
diff --git a/net/ipv4/tcp_illinois.c b/net/ipv4/tcp_illinois.c index b2b2256d3b84..cc5de6f69d46 100644 --- a/net/ipv4/tcp_illinois.c +++ b/net/ipv4/tcp_illinois.c | |||
| @@ -258,7 +258,7 @@ static void tcp_illinois_state(struct sock *sk, u8 new_state) | |||
| 258 | /* | 258 | /* |
| 259 | * Increase window in response to successful acknowledgment. | 259 | * Increase window in response to successful acknowledgment. |
| 260 | */ | 260 | */ |
| 261 | static void tcp_illinois_cong_avoid(struct sock *sk, u32 ack, u32 rtt, | 261 | static void tcp_illinois_cong_avoid(struct sock *sk, u32 ack, |
| 262 | u32 in_flight, int flag) | 262 | u32 in_flight, int flag) |
| 263 | { | 263 | { |
| 264 | struct tcp_sock *tp = tcp_sk(sk); | 264 | struct tcp_sock *tp = tcp_sk(sk); |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 4e5884ac8f29..fec8a7a4dbaf 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
| @@ -2323,11 +2323,11 @@ static inline void tcp_ack_update_rtt(struct sock *sk, const int flag, | |||
| 2323 | tcp_ack_no_tstamp(sk, seq_rtt, flag); | 2323 | tcp_ack_no_tstamp(sk, seq_rtt, flag); |
| 2324 | } | 2324 | } |
| 2325 | 2325 | ||
| 2326 | static void tcp_cong_avoid(struct sock *sk, u32 ack, u32 rtt, | 2326 | static void tcp_cong_avoid(struct sock *sk, u32 ack, |
| 2327 | u32 in_flight, int good) | 2327 | u32 in_flight, int good) |
| 2328 | { | 2328 | { |
| 2329 | const struct inet_connection_sock *icsk = inet_csk(sk); | 2329 | const struct inet_connection_sock *icsk = inet_csk(sk); |
| 2330 | icsk->icsk_ca_ops->cong_avoid(sk, ack, rtt, in_flight, good); | 2330 | icsk->icsk_ca_ops->cong_avoid(sk, ack, in_flight, good); |
| 2331 | tcp_sk(sk)->snd_cwnd_stamp = tcp_time_stamp; | 2331 | tcp_sk(sk)->snd_cwnd_stamp = tcp_time_stamp; |
| 2332 | } | 2332 | } |
| 2333 | 2333 | ||
| @@ -2826,11 +2826,11 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag) | |||
| 2826 | /* Advance CWND, if state allows this. */ | 2826 | /* Advance CWND, if state allows this. */ |
| 2827 | if ((flag & FLAG_DATA_ACKED) && !frto_cwnd && | 2827 | if ((flag & FLAG_DATA_ACKED) && !frto_cwnd && |
| 2828 | tcp_may_raise_cwnd(sk, flag)) | 2828 | tcp_may_raise_cwnd(sk, flag)) |
| 2829 | tcp_cong_avoid(sk, ack, seq_rtt, prior_in_flight, 0); | 2829 | tcp_cong_avoid(sk, ack, prior_in_flight, 0); |
| 2830 | tcp_fastretrans_alert(sk, prior_snd_una, prior_packets, flag); | 2830 | tcp_fastretrans_alert(sk, prior_snd_una, prior_packets, flag); |
| 2831 | } else { | 2831 | } else { |
| 2832 | if ((flag & FLAG_DATA_ACKED) && !frto_cwnd) | 2832 | if ((flag & FLAG_DATA_ACKED) && !frto_cwnd) |
| 2833 | tcp_cong_avoid(sk, ack, seq_rtt, prior_in_flight, 1); | 2833 | tcp_cong_avoid(sk, ack, prior_in_flight, 1); |
| 2834 | } | 2834 | } |
| 2835 | 2835 | ||
| 2836 | if ((flag & FLAG_FORWARD_PROGRESS) || !(flag&FLAG_NOT_DUP)) | 2836 | if ((flag & FLAG_FORWARD_PROGRESS) || !(flag&FLAG_NOT_DUP)) |
diff --git a/net/ipv4/tcp_lp.c b/net/ipv4/tcp_lp.c index e49836ce012e..80e140e3ec2d 100644 --- a/net/ipv4/tcp_lp.c +++ b/net/ipv4/tcp_lp.c | |||
| @@ -115,13 +115,12 @@ static void tcp_lp_init(struct sock *sk) | |||
| 115 | * Will only call newReno CA when away from inference. | 115 | * Will only call newReno CA when away from inference. |
| 116 | * From TCP-LP's paper, this will be handled in additive increasement. | 116 | * From TCP-LP's paper, this will be handled in additive increasement. |
| 117 | */ | 117 | */ |
| 118 | static void tcp_lp_cong_avoid(struct sock *sk, u32 ack, u32 rtt, u32 in_flight, | 118 | static void tcp_lp_cong_avoid(struct sock *sk, u32 ack, u32 in_flight, int flag) |
| 119 | int flag) | ||
| 120 | { | 119 | { |
| 121 | struct lp *lp = inet_csk_ca(sk); | 120 | struct lp *lp = inet_csk_ca(sk); |
| 122 | 121 | ||
| 123 | if (!(lp->flag & LP_WITHIN_INF)) | 122 | if (!(lp->flag & LP_WITHIN_INF)) |
| 124 | tcp_reno_cong_avoid(sk, ack, rtt, in_flight, flag); | 123 | tcp_reno_cong_avoid(sk, ack, in_flight, flag); |
| 125 | } | 124 | } |
| 126 | 125 | ||
| 127 | /** | 126 | /** |
diff --git a/net/ipv4/tcp_scalable.c b/net/ipv4/tcp_scalable.c index 4624501e9680..be27a33a1c68 100644 --- a/net/ipv4/tcp_scalable.c +++ b/net/ipv4/tcp_scalable.c | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | #define TCP_SCALABLE_AI_CNT 50U | 15 | #define TCP_SCALABLE_AI_CNT 50U |
| 16 | #define TCP_SCALABLE_MD_SCALE 3 | 16 | #define TCP_SCALABLE_MD_SCALE 3 |
| 17 | 17 | ||
| 18 | static void tcp_scalable_cong_avoid(struct sock *sk, u32 ack, u32 rtt, | 18 | static void tcp_scalable_cong_avoid(struct sock *sk, u32 ack, |
| 19 | u32 in_flight, int flag) | 19 | u32 in_flight, int flag) |
| 20 | { | 20 | { |
| 21 | struct tcp_sock *tp = tcp_sk(sk); | 21 | struct tcp_sock *tp = tcp_sk(sk); |
diff --git a/net/ipv4/tcp_vegas.c b/net/ipv4/tcp_vegas.c index e218a51ceced..914e0307f7af 100644 --- a/net/ipv4/tcp_vegas.c +++ b/net/ipv4/tcp_vegas.c | |||
| @@ -163,13 +163,13 @@ void tcp_vegas_cwnd_event(struct sock *sk, enum tcp_ca_event event) | |||
| 163 | EXPORT_SYMBOL_GPL(tcp_vegas_cwnd_event); | 163 | EXPORT_SYMBOL_GPL(tcp_vegas_cwnd_event); |
| 164 | 164 | ||
| 165 | static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, | 165 | static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, |
| 166 | u32 seq_rtt, u32 in_flight, int flag) | 166 | u32 in_flight, int flag) |
| 167 | { | 167 | { |
| 168 | struct tcp_sock *tp = tcp_sk(sk); | 168 | struct tcp_sock *tp = tcp_sk(sk); |
| 169 | struct vegas *vegas = inet_csk_ca(sk); | 169 | struct vegas *vegas = inet_csk_ca(sk); |
| 170 | 170 | ||
| 171 | if (!vegas->doing_vegas_now) | 171 | if (!vegas->doing_vegas_now) |
| 172 | return tcp_reno_cong_avoid(sk, ack, seq_rtt, in_flight, flag); | 172 | return tcp_reno_cong_avoid(sk, ack, in_flight, flag); |
| 173 | 173 | ||
| 174 | /* The key players are v_beg_snd_una and v_beg_snd_nxt. | 174 | /* The key players are v_beg_snd_una and v_beg_snd_nxt. |
| 175 | * | 175 | * |
| @@ -228,7 +228,7 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, | |||
| 228 | /* We don't have enough RTT samples to do the Vegas | 228 | /* We don't have enough RTT samples to do the Vegas |
| 229 | * calculation, so we'll behave like Reno. | 229 | * calculation, so we'll behave like Reno. |
| 230 | */ | 230 | */ |
| 231 | tcp_reno_cong_avoid(sk, ack, seq_rtt, in_flight, flag); | 231 | tcp_reno_cong_avoid(sk, ack, in_flight, flag); |
| 232 | } else { | 232 | } else { |
| 233 | u32 rtt, target_cwnd, diff; | 233 | u32 rtt, target_cwnd, diff; |
| 234 | 234 | ||
diff --git a/net/ipv4/tcp_veno.c b/net/ipv4/tcp_veno.c index ec854cc5fad5..7a55ddf86032 100644 --- a/net/ipv4/tcp_veno.c +++ b/net/ipv4/tcp_veno.c | |||
| @@ -115,13 +115,13 @@ static void tcp_veno_cwnd_event(struct sock *sk, enum tcp_ca_event event) | |||
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, | 117 | static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, |
| 118 | u32 seq_rtt, u32 in_flight, int flag) | 118 | u32 in_flight, int flag) |
| 119 | { | 119 | { |
| 120 | struct tcp_sock *tp = tcp_sk(sk); | 120 | struct tcp_sock *tp = tcp_sk(sk); |
| 121 | struct veno *veno = inet_csk_ca(sk); | 121 | struct veno *veno = inet_csk_ca(sk); |
| 122 | 122 | ||
| 123 | if (!veno->doing_veno_now) | 123 | if (!veno->doing_veno_now) |
| 124 | return tcp_reno_cong_avoid(sk, ack, seq_rtt, in_flight, flag); | 124 | return tcp_reno_cong_avoid(sk, ack, in_flight, flag); |
| 125 | 125 | ||
| 126 | /* limited by applications */ | 126 | /* limited by applications */ |
| 127 | if (!tcp_is_cwnd_limited(sk, in_flight)) | 127 | if (!tcp_is_cwnd_limited(sk, in_flight)) |
| @@ -132,7 +132,7 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, | |||
| 132 | /* We don't have enough rtt samples to do the Veno | 132 | /* We don't have enough rtt samples to do the Veno |
| 133 | * calculation, so we'll behave like Reno. | 133 | * calculation, so we'll behave like Reno. |
| 134 | */ | 134 | */ |
| 135 | tcp_reno_cong_avoid(sk, ack, seq_rtt, in_flight, flag); | 135 | tcp_reno_cong_avoid(sk, ack, in_flight, flag); |
| 136 | } else { | 136 | } else { |
| 137 | u32 rtt, target_cwnd; | 137 | u32 rtt, target_cwnd; |
| 138 | 138 | ||
diff --git a/net/ipv4/tcp_yeah.c b/net/ipv4/tcp_yeah.c index 545ed237ab53..c04b7c6ec702 100644 --- a/net/ipv4/tcp_yeah.c +++ b/net/ipv4/tcp_yeah.c | |||
| @@ -70,7 +70,7 @@ static void tcp_yeah_pkts_acked(struct sock *sk, u32 pkts_acked, ktime_t last) | |||
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | static void tcp_yeah_cong_avoid(struct sock *sk, u32 ack, | 72 | static void tcp_yeah_cong_avoid(struct sock *sk, u32 ack, |
| 73 | u32 seq_rtt, u32 in_flight, int flag) | 73 | u32 in_flight, int flag) |
| 74 | { | 74 | { |
| 75 | struct tcp_sock *tp = tcp_sk(sk); | 75 | struct tcp_sock *tp = tcp_sk(sk); |
| 76 | struct yeah *yeah = inet_csk_ca(sk); | 76 | struct yeah *yeah = inet_csk_ca(sk); |
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index dcd7e325b283..4c670cf6aefa 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c | |||
| @@ -2567,7 +2567,7 @@ int __init irsock_init(void) | |||
| 2567 | * Remove IrDA protocol | 2567 | * Remove IrDA protocol |
| 2568 | * | 2568 | * |
| 2569 | */ | 2569 | */ |
| 2570 | void __exit irsock_cleanup(void) | 2570 | void irsock_cleanup(void) |
| 2571 | { | 2571 | { |
| 2572 | sock_unregister(PF_IRDA); | 2572 | sock_unregister(PF_IRDA); |
| 2573 | proto_unregister(&irda_proto); | 2573 | proto_unregister(&irda_proto); |
diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c index 7b5def1ea633..435b563d29a6 100644 --- a/net/irda/irda_device.c +++ b/net/irda/irda_device.c | |||
| @@ -95,14 +95,14 @@ int __init irda_device_init( void) | |||
| 95 | return 0; | 95 | return 0; |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | static void __exit leftover_dongle(void *arg) | 98 | static void leftover_dongle(void *arg) |
| 99 | { | 99 | { |
| 100 | struct dongle_reg *reg = arg; | 100 | struct dongle_reg *reg = arg; |
| 101 | IRDA_WARNING("IrDA: Dongle type %x not unregistered\n", | 101 | IRDA_WARNING("IrDA: Dongle type %x not unregistered\n", |
| 102 | reg->type); | 102 | reg->type); |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | void __exit irda_device_cleanup(void) | 105 | void irda_device_cleanup(void) |
| 106 | { | 106 | { |
| 107 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__); | 107 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__); |
| 108 | 108 | ||
diff --git a/net/irda/iriap.c b/net/irda/iriap.c index 774eb707940c..ee3889fa49ab 100644 --- a/net/irda/iriap.c +++ b/net/irda/iriap.c | |||
| @@ -153,7 +153,7 @@ int __init iriap_init(void) | |||
| 153 | * Initializes the IrIAP layer, called by the module cleanup code in | 153 | * Initializes the IrIAP layer, called by the module cleanup code in |
| 154 | * irmod.c | 154 | * irmod.c |
| 155 | */ | 155 | */ |
| 156 | void __exit iriap_cleanup(void) | 156 | void iriap_cleanup(void) |
| 157 | { | 157 | { |
| 158 | irlmp_unregister_service(service_handle); | 158 | irlmp_unregister_service(service_handle); |
| 159 | 159 | ||
diff --git a/net/irda/irlap.c b/net/irda/irlap.c index 2fc9f518f89d..3d76aafdb2e5 100644 --- a/net/irda/irlap.c +++ b/net/irda/irlap.c | |||
| @@ -95,7 +95,7 @@ int __init irlap_init(void) | |||
| 95 | return 0; | 95 | return 0; |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | void __exit irlap_cleanup(void) | 98 | void irlap_cleanup(void) |
| 99 | { | 99 | { |
| 100 | IRDA_ASSERT(irlap != NULL, return;); | 100 | IRDA_ASSERT(irlap != NULL, return;); |
| 101 | 101 | ||
diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c index 24a5e3f23778..7efa930ed684 100644 --- a/net/irda/irlmp.c +++ b/net/irda/irlmp.c | |||
| @@ -116,7 +116,7 @@ int __init irlmp_init(void) | |||
| 116 | * Remove IrLMP layer | 116 | * Remove IrLMP layer |
| 117 | * | 117 | * |
| 118 | */ | 118 | */ |
| 119 | void __exit irlmp_cleanup(void) | 119 | void irlmp_cleanup(void) |
| 120 | { | 120 | { |
| 121 | /* Check for main structure */ | 121 | /* Check for main structure */ |
| 122 | IRDA_ASSERT(irlmp != NULL, return;); | 122 | IRDA_ASSERT(irlmp != NULL, return;); |
diff --git a/net/irda/irproc.c b/net/irda/irproc.c index d6f9aba5b9dc..181cb51b48a8 100644 --- a/net/irda/irproc.c +++ b/net/irda/irproc.c | |||
| @@ -84,7 +84,7 @@ void __init irda_proc_register(void) | |||
| 84 | * Unregister irda entry in /proc file system | 84 | * Unregister irda entry in /proc file system |
| 85 | * | 85 | * |
| 86 | */ | 86 | */ |
| 87 | void __exit irda_proc_unregister(void) | 87 | void irda_proc_unregister(void) |
| 88 | { | 88 | { |
| 89 | int i; | 89 | int i; |
| 90 | 90 | ||
diff --git a/net/irda/irsysctl.c b/net/irda/irsysctl.c index 2e968e7d8fea..957e04feb0f7 100644 --- a/net/irda/irsysctl.c +++ b/net/irda/irsysctl.c | |||
| @@ -287,7 +287,7 @@ int __init irda_sysctl_register(void) | |||
| 287 | * Unregister our sysctl interface | 287 | * Unregister our sysctl interface |
| 288 | * | 288 | * |
| 289 | */ | 289 | */ |
| 290 | void __exit irda_sysctl_unregister(void) | 290 | void irda_sysctl_unregister(void) |
| 291 | { | 291 | { |
| 292 | unregister_sysctl_table(irda_table_header); | 292 | unregister_sysctl_table(irda_table_header); |
| 293 | } | 293 | } |
diff --git a/net/irda/irttp.c b/net/irda/irttp.c index 7f50832a2cd5..3d7ab03fb131 100644 --- a/net/irda/irttp.c +++ b/net/irda/irttp.c | |||
| @@ -109,7 +109,7 @@ int __init irttp_init(void) | |||
| 109 | * Called by module destruction/cleanup code | 109 | * Called by module destruction/cleanup code |
| 110 | * | 110 | * |
| 111 | */ | 111 | */ |
| 112 | void __exit irttp_cleanup(void) | 112 | void irttp_cleanup(void) |
| 113 | { | 113 | { |
| 114 | /* Check for main structure */ | 114 | /* Check for main structure */ |
| 115 | IRDA_ASSERT(irttp->magic == TTP_MAGIC, return;); | 115 | IRDA_ASSERT(irttp->magic == TTP_MAGIC, return;); |
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig index 3ac39f1ec775..3599770a2473 100644 --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig | |||
| @@ -436,6 +436,7 @@ config NETFILTER_XT_MATCH_CONNBYTES | |||
| 436 | config NETFILTER_XT_MATCH_CONNLIMIT | 436 | config NETFILTER_XT_MATCH_CONNLIMIT |
| 437 | tristate '"connlimit" match support"' | 437 | tristate '"connlimit" match support"' |
| 438 | depends on NETFILTER_XTABLES | 438 | depends on NETFILTER_XTABLES |
| 439 | depends on NF_CONNTRACK | ||
| 439 | ---help--- | 440 | ---help--- |
| 440 | This match allows you to match against the number of parallel | 441 | This match allows you to match against the number of parallel |
| 441 | connections to a server per client IP address (or address block). | 442 | connections to a server per client IP address (or address block). |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index a3c8e692f493..641cfbc278d8 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
| @@ -1012,13 +1012,14 @@ static int netlink_setsockopt(struct socket *sock, int level, int optname, | |||
| 1012 | { | 1012 | { |
| 1013 | struct sock *sk = sock->sk; | 1013 | struct sock *sk = sock->sk; |
| 1014 | struct netlink_sock *nlk = nlk_sk(sk); | 1014 | struct netlink_sock *nlk = nlk_sk(sk); |
| 1015 | int val = 0, err; | 1015 | unsigned int val = 0; |
| 1016 | int err; | ||
| 1016 | 1017 | ||
| 1017 | if (level != SOL_NETLINK) | 1018 | if (level != SOL_NETLINK) |
| 1018 | return -ENOPROTOOPT; | 1019 | return -ENOPROTOOPT; |
| 1019 | 1020 | ||
| 1020 | if (optlen >= sizeof(int) && | 1021 | if (optlen >= sizeof(int) && |
| 1021 | get_user(val, (int __user *)optval)) | 1022 | get_user(val, (unsigned int __user *)optval)) |
| 1022 | return -EFAULT; | 1023 | return -EFAULT; |
| 1023 | 1024 | ||
| 1024 | switch (optname) { | 1025 | switch (optname) { |
diff --git a/net/sched/Kconfig b/net/sched/Kconfig index d3f7c3f9407a..8a74cac0be8c 100644 --- a/net/sched/Kconfig +++ b/net/sched/Kconfig | |||
| @@ -97,7 +97,7 @@ config NET_SCH_ATM | |||
| 97 | select classes of this queuing discipline. Each class maps | 97 | select classes of this queuing discipline. Each class maps |
| 98 | the flow(s) it is handling to a given virtual circuit. | 98 | the flow(s) it is handling to a given virtual circuit. |
| 99 | 99 | ||
| 100 | See the top of <file:net/sched/sch_atm.c>) for more details. | 100 | See the top of <file:net/sched/sch_atm.c> for more details. |
| 101 | 101 | ||
| 102 | To compile this code as a module, choose M here: the | 102 | To compile this code as a module, choose M here: the |
| 103 | module will be called sch_atm. | 103 | module will be called sch_atm. |
| @@ -137,7 +137,7 @@ config NET_SCH_SFQ | |||
| 137 | tristate "Stochastic Fairness Queueing (SFQ)" | 137 | tristate "Stochastic Fairness Queueing (SFQ)" |
| 138 | ---help--- | 138 | ---help--- |
| 139 | Say Y here if you want to use the Stochastic Fairness Queueing (SFQ) | 139 | Say Y here if you want to use the Stochastic Fairness Queueing (SFQ) |
| 140 | packet scheduling algorithm . | 140 | packet scheduling algorithm. |
| 141 | 141 | ||
| 142 | See the top of <file:net/sched/sch_sfq.c> for more details. | 142 | See the top of <file:net/sched/sch_sfq.c> for more details. |
| 143 | 143 | ||
| @@ -306,7 +306,7 @@ config NET_CLS_RSVP6 | |||
| 306 | is important for real time data such as streaming sound or video. | 306 | is important for real time data such as streaming sound or video. |
| 307 | 307 | ||
| 308 | Say Y here if you want to be able to classify outgoing packets based | 308 | Say Y here if you want to be able to classify outgoing packets based |
| 309 | on their RSVP requests and you are using the IPv6. | 309 | on their RSVP requests and you are using the IPv6 protocol. |
| 310 | 310 | ||
| 311 | To compile this code as a module, choose M here: the | 311 | To compile this code as a module, choose M here: the |
| 312 | module will be called cls_rsvp6. | 312 | module will be called cls_rsvp6. |
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c index 417ec8fb7f1a..ddc4f2c54379 100644 --- a/net/sched/sch_atm.c +++ b/net/sched/sch_atm.c | |||
| @@ -292,13 +292,12 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent, | |||
| 292 | } | 292 | } |
| 293 | } | 293 | } |
| 294 | DPRINTK("atm_tc_change: new id %x\n", classid); | 294 | DPRINTK("atm_tc_change: new id %x\n", classid); |
| 295 | flow = kmalloc(sizeof(struct atm_flow_data) + hdr_len, GFP_KERNEL); | 295 | flow = kzalloc(sizeof(struct atm_flow_data) + hdr_len, GFP_KERNEL); |
| 296 | DPRINTK("atm_tc_change: flow %p\n", flow); | 296 | DPRINTK("atm_tc_change: flow %p\n", flow); |
| 297 | if (!flow) { | 297 | if (!flow) { |
| 298 | error = -ENOBUFS; | 298 | error = -ENOBUFS; |
| 299 | goto err_out; | 299 | goto err_out; |
| 300 | } | 300 | } |
| 301 | memset(flow, 0, sizeof(*flow)); | ||
| 302 | flow->filter_list = NULL; | 301 | flow->filter_list = NULL; |
| 303 | if (!(flow->q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, classid))) | 302 | if (!(flow->q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, classid))) |
| 304 | flow->q = &noop_qdisc; | 303 | flow->q = &noop_qdisc; |
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 157bfbd250ba..b48f06fc9fd9 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
| @@ -2141,7 +2141,7 @@ int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *first, | |||
| 2141 | if (last == first) | 2141 | if (last == first) |
| 2142 | break; | 2142 | break; |
| 2143 | 2143 | ||
| 2144 | last = last->u.next; | 2144 | last = (struct xfrm_dst *)last->u.dst.next; |
| 2145 | last->child_mtu_cached = mtu; | 2145 | last->child_mtu_cached = mtu; |
| 2146 | } | 2146 | } |
| 2147 | 2147 | ||
