diff options
64 files changed, 755 insertions, 265 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 9de961bd1214..2b349ba4add4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -3434,11 +3434,10 @@ L: linuxppc-dev@ozlabs.org | |||
3434 | S: Maintained | 3434 | S: Maintained |
3435 | 3435 | ||
3436 | LINUX FOR POWERPC EMBEDDED MPC5XXX | 3436 | LINUX FOR POWERPC EMBEDDED MPC5XXX |
3437 | P: Sylvain Munaut | ||
3438 | M: tnt@246tNt.com | ||
3439 | P: Grant Likely | 3437 | P: Grant Likely |
3440 | M: grant.likely@secretlab.ca | 3438 | M: grant.likely@secretlab.ca |
3441 | L: linuxppc-dev@ozlabs.org | 3439 | L: linuxppc-dev@ozlabs.org |
3440 | T: git git://git.secretlab.ca/git/linux-2.6.git | ||
3442 | S: Maintained | 3441 | S: Maintained |
3443 | 3442 | ||
3444 | LINUX FOR POWERPC EMBEDDED PPC4XX | 3443 | LINUX FOR POWERPC EMBEDDED PPC4XX |
@@ -3456,6 +3455,7 @@ P: Grant Likely | |||
3456 | M: grant.likely@secretlab.ca | 3455 | M: grant.likely@secretlab.ca |
3457 | W: http://wiki.secretlab.ca/index.php/Linux_on_Xilinx_Virtex | 3456 | W: http://wiki.secretlab.ca/index.php/Linux_on_Xilinx_Virtex |
3458 | L: linuxppc-dev@ozlabs.org | 3457 | L: linuxppc-dev@ozlabs.org |
3458 | T: git git://git.secretlab.ca/git/linux-2.6.git | ||
3459 | S: Maintained | 3459 | S: Maintained |
3460 | 3460 | ||
3461 | LINUX FOR POWERPC EMBEDDED PPC8XX | 3461 | LINUX FOR POWERPC EMBEDDED PPC8XX |
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index cd1b687544f3..f9c40f869c6e 100644 --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c | |||
@@ -382,7 +382,8 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
382 | .icache_bsize = 128, | 382 | .icache_bsize = 128, |
383 | .dcache_bsize = 128, | 383 | .dcache_bsize = 128, |
384 | .machine_check = machine_check_generic, | 384 | .machine_check = machine_check_generic, |
385 | .oprofile_cpu_type = "ppc64/compat-power5+", | 385 | .oprofile_cpu_type = "ppc64/ibm-compat-v1", |
386 | .oprofile_type = PPC_OPROFILE_POWER4, | ||
386 | .platform = "power5+", | 387 | .platform = "power5+", |
387 | }, | 388 | }, |
388 | { /* Power6 */ | 389 | { /* Power6 */ |
@@ -416,7 +417,8 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
416 | .icache_bsize = 128, | 417 | .icache_bsize = 128, |
417 | .dcache_bsize = 128, | 418 | .dcache_bsize = 128, |
418 | .machine_check = machine_check_generic, | 419 | .machine_check = machine_check_generic, |
419 | .oprofile_cpu_type = "ppc64/compat-power6", | 420 | .oprofile_cpu_type = "ppc64/ibm-compat-v1", |
421 | .oprofile_type = PPC_OPROFILE_POWER4, | ||
420 | .platform = "power6", | 422 | .platform = "power6", |
421 | }, | 423 | }, |
422 | { /* 2.06-compliant processor, i.e. Power7 "architected" mode */ | 424 | { /* 2.06-compliant processor, i.e. Power7 "architected" mode */ |
@@ -429,7 +431,8 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
429 | .icache_bsize = 128, | 431 | .icache_bsize = 128, |
430 | .dcache_bsize = 128, | 432 | .dcache_bsize = 128, |
431 | .machine_check = machine_check_generic, | 433 | .machine_check = machine_check_generic, |
432 | .oprofile_cpu_type = "ppc64/compat-power7", | 434 | .oprofile_type = PPC_OPROFILE_POWER4, |
435 | .oprofile_cpu_type = "ppc64/ibm-compat-v1", | ||
433 | .platform = "power7", | 436 | .platform = "power7", |
434 | }, | 437 | }, |
435 | { /* Power7 */ | 438 | { /* Power7 */ |
@@ -1833,8 +1836,10 @@ static void __init setup_cpu_spec(unsigned long offset, struct cpu_spec *s) | |||
1833 | * and, in that case, keep the current value for | 1836 | * and, in that case, keep the current value for |
1834 | * oprofile_cpu_type. | 1837 | * oprofile_cpu_type. |
1835 | */ | 1838 | */ |
1836 | if (old.oprofile_cpu_type == NULL) | 1839 | if (old.oprofile_cpu_type == NULL) { |
1837 | t->oprofile_cpu_type = s->oprofile_cpu_type; | 1840 | t->oprofile_cpu_type = old.oprofile_cpu_type; |
1841 | t->oprofile_type = old.oprofile_type; | ||
1842 | } | ||
1838 | } | 1843 | } |
1839 | 1844 | ||
1840 | *PTRRELOC(&cur_cpu_spec) = &the_cpu_spec; | 1845 | *PTRRELOC(&cur_cpu_spec) = &the_cpu_spec; |
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index fe8041e619ea..b25e9b6516ae 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -254,6 +254,14 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) | |||
254 | brq.data.blocks = req->nr_sectors; | 254 | brq.data.blocks = req->nr_sectors; |
255 | 255 | ||
256 | /* | 256 | /* |
257 | * The block layer doesn't support all sector count | ||
258 | * restrictions, so we need to be prepared for too big | ||
259 | * requests. | ||
260 | */ | ||
261 | if (brq.data.blocks > card->host->max_blk_count) | ||
262 | brq.data.blocks = card->host->max_blk_count; | ||
263 | |||
264 | /* | ||
257 | * After a read error, we redo the request one sector at a time | 265 | * After a read error, we redo the request one sector at a time |
258 | * in order to accurately determine which sectors can be read | 266 | * in order to accurately determine which sectors can be read |
259 | * successfully. | 267 | * successfully. |
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index fa073ab3fa34..264911732756 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -706,7 +706,7 @@ static void mmc_power_up(struct mmc_host *host) | |||
706 | * This delay should be sufficient to allow the power supply | 706 | * This delay should be sufficient to allow the power supply |
707 | * to reach the minimum voltage. | 707 | * to reach the minimum voltage. |
708 | */ | 708 | */ |
709 | mmc_delay(2); | 709 | mmc_delay(10); |
710 | 710 | ||
711 | host->ios.clock = host->f_min; | 711 | host->ios.clock = host->f_min; |
712 | host->ios.power_mode = MMC_POWER_ON; | 712 | host->ios.power_mode = MMC_POWER_ON; |
@@ -716,7 +716,7 @@ static void mmc_power_up(struct mmc_host *host) | |||
716 | * This delay must be at least 74 clock sizes, or 1 ms, or the | 716 | * This delay must be at least 74 clock sizes, or 1 ms, or the |
717 | * time required to reach a stable voltage. | 717 | * time required to reach a stable voltage. |
718 | */ | 718 | */ |
719 | mmc_delay(2); | 719 | mmc_delay(10); |
720 | } | 720 | } |
721 | 721 | ||
722 | static void mmc_power_off(struct mmc_host *host) | 722 | static void mmc_power_off(struct mmc_host *host) |
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index a663429b3d55..36875dcfa492 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -514,6 +514,7 @@ static int __devinit mmci_probe(struct amba_device *dev, void *id) | |||
514 | } | 514 | } |
515 | 515 | ||
516 | host = mmc_priv(mmc); | 516 | host = mmc_priv(mmc); |
517 | host->mmc = mmc; | ||
517 | /* Bits 12 thru 19 is the designer */ | 518 | /* Bits 12 thru 19 is the designer */ |
518 | host->hw_designer = (dev->periphid >> 12) & 0xff; | 519 | host->hw_designer = (dev->periphid >> 12) & 0xff; |
519 | /* Bits 20 thru 23 is the revison */ | 520 | /* Bits 20 thru 23 is the revison */ |
@@ -545,7 +546,6 @@ static int __devinit mmci_probe(struct amba_device *dev, void *id) | |||
545 | host->mclk = clk_get_rate(host->clk); | 546 | host->mclk = clk_get_rate(host->clk); |
546 | DBG(host, "eventual mclk rate: %u Hz\n", host->mclk); | 547 | DBG(host, "eventual mclk rate: %u Hz\n", host->mclk); |
547 | } | 548 | } |
548 | host->mmc = mmc; | ||
549 | host->base = ioremap(dev->res.start, SZ_4K); | 549 | host->base = ioremap(dev->res.start, SZ_4K); |
550 | if (!host->base) { | 550 | if (!host->base) { |
551 | ret = -ENOMEM; | 551 | ret = -ENOMEM; |
diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c index b5c375d94ab3..c643d0fe118f 100644 --- a/drivers/mmc/host/mvsdio.c +++ b/drivers/mmc/host/mvsdio.c | |||
@@ -825,24 +825,23 @@ static int __exit mvsd_remove(struct platform_device *pdev) | |||
825 | } | 825 | } |
826 | 826 | ||
827 | #ifdef CONFIG_PM | 827 | #ifdef CONFIG_PM |
828 | static int mvsd_suspend(struct platform_device *dev, pm_message_t state, | 828 | static int mvsd_suspend(struct platform_device *dev, pm_message_t state) |
829 | u32 level) | ||
830 | { | 829 | { |
831 | struct mmc_host *mmc = platform_get_drvdata(dev); | 830 | struct mmc_host *mmc = platform_get_drvdata(dev); |
832 | int ret = 0; | 831 | int ret = 0; |
833 | 832 | ||
834 | if (mmc && level == SUSPEND_DISABLE) | 833 | if (mmc) |
835 | ret = mmc_suspend_host(mmc, state); | 834 | ret = mmc_suspend_host(mmc, state); |
836 | 835 | ||
837 | return ret; | 836 | return ret; |
838 | } | 837 | } |
839 | 838 | ||
840 | static int mvsd_resume(struct platform_device *dev, u32 level) | 839 | static int mvsd_resume(struct platform_device *dev) |
841 | { | 840 | { |
842 | struct mmc_host *mmc = platform_dev_get_drvdata(dev); | 841 | struct mmc_host *mmc = platform_get_drvdata(dev); |
843 | int ret = 0; | 842 | int ret = 0; |
844 | 843 | ||
845 | if (mmc && level == RESUME_ENABLE) | 844 | if (mmc) |
846 | ret = mmc_resume_host(mmc); | 845 | ret = mmc_resume_host(mmc); |
847 | 846 | ||
848 | return ret; | 847 | return ret; |
diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c index cd37962ec44f..65be27995d5c 100644 --- a/drivers/mmc/host/sdhci-pci.c +++ b/drivers/mmc/host/sdhci-pci.c | |||
@@ -522,8 +522,8 @@ static struct sdhci_pci_slot * __devinit sdhci_pci_probe_slot( | |||
522 | 522 | ||
523 | host = sdhci_alloc_host(&pdev->dev, sizeof(struct sdhci_pci_slot)); | 523 | host = sdhci_alloc_host(&pdev->dev, sizeof(struct sdhci_pci_slot)); |
524 | if (IS_ERR(host)) { | 524 | if (IS_ERR(host)) { |
525 | ret = PTR_ERR(host); | 525 | dev_err(&pdev->dev, "cannot allocate host\n"); |
526 | goto unmap; | 526 | return ERR_PTR(PTR_ERR(host)); |
527 | } | 527 | } |
528 | 528 | ||
529 | slot = sdhci_priv(host); | 529 | slot = sdhci_priv(host); |
@@ -541,7 +541,7 @@ static struct sdhci_pci_slot * __devinit sdhci_pci_probe_slot( | |||
541 | ret = pci_request_region(pdev, bar, mmc_hostname(host->mmc)); | 541 | ret = pci_request_region(pdev, bar, mmc_hostname(host->mmc)); |
542 | if (ret) { | 542 | if (ret) { |
543 | dev_err(&pdev->dev, "cannot request region\n"); | 543 | dev_err(&pdev->dev, "cannot request region\n"); |
544 | return ERR_PTR(ret); | 544 | goto free; |
545 | } | 545 | } |
546 | 546 | ||
547 | addr = pci_resource_start(pdev, bar); | 547 | addr = pci_resource_start(pdev, bar); |
@@ -572,6 +572,8 @@ unmap: | |||
572 | 572 | ||
573 | release: | 573 | release: |
574 | pci_release_region(pdev, bar); | 574 | pci_release_region(pdev, bar); |
575 | |||
576 | free: | ||
575 | sdhci_free_host(host); | 577 | sdhci_free_host(host); |
576 | 578 | ||
577 | return ERR_PTR(ret); | 579 | return ERR_PTR(ret); |
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index f20a834f4309..65c6f996bbd3 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h | |||
@@ -125,7 +125,7 @@ | |||
125 | #define SDHCI_INT_DATA_MASK (SDHCI_INT_DATA_END | SDHCI_INT_DMA_END | \ | 125 | #define SDHCI_INT_DATA_MASK (SDHCI_INT_DATA_END | SDHCI_INT_DMA_END | \ |
126 | SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | \ | 126 | SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | \ |
127 | SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_DATA_CRC | \ | 127 | SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_DATA_CRC | \ |
128 | SDHCI_INT_DATA_END_BIT) | 128 | SDHCI_INT_DATA_END_BIT | SDHCI_ADMA_ERROR) |
129 | #define SDHCI_INT_ALL_MASK ((unsigned int)-1) | 129 | #define SDHCI_INT_ALL_MASK ((unsigned int)-1) |
130 | 130 | ||
131 | #define SDHCI_ACMD12_ERR 0x3C | 131 | #define SDHCI_ACMD12_ERR 0x3C |
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 553a89919778..46d312bedfb8 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -1706,10 +1706,8 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave | |||
1706 | * Called with RTNL | 1706 | * Called with RTNL |
1707 | */ | 1707 | */ |
1708 | int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr) | 1708 | int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr) |
1709 | __releases(&bond->curr_slave_lock) | ||
1710 | __releases(&bond->lock) | ||
1711 | __acquires(&bond->lock) | 1709 | __acquires(&bond->lock) |
1712 | __acquires(&bond->curr_slave_lock) | 1710 | __releases(&bond->lock) |
1713 | { | 1711 | { |
1714 | struct bonding *bond = netdev_priv(bond_dev); | 1712 | struct bonding *bond = netdev_priv(bond_dev); |
1715 | struct sockaddr *sa = addr; | 1713 | struct sockaddr *sa = addr; |
@@ -1745,9 +1743,6 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr) | |||
1745 | } | 1743 | } |
1746 | } | 1744 | } |
1747 | 1745 | ||
1748 | write_unlock_bh(&bond->curr_slave_lock); | ||
1749 | read_unlock(&bond->lock); | ||
1750 | |||
1751 | if (swap_slave) { | 1746 | if (swap_slave) { |
1752 | alb_swap_mac_addr(bond, swap_slave, bond->curr_active_slave); | 1747 | alb_swap_mac_addr(bond, swap_slave, bond->curr_active_slave); |
1753 | alb_fasten_mac_swap(bond, swap_slave, bond->curr_active_slave); | 1748 | alb_fasten_mac_swap(bond, swap_slave, bond->curr_active_slave); |
@@ -1755,16 +1750,15 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr) | |||
1755 | alb_set_slave_mac_addr(bond->curr_active_slave, bond_dev->dev_addr, | 1750 | alb_set_slave_mac_addr(bond->curr_active_slave, bond_dev->dev_addr, |
1756 | bond->alb_info.rlb_enabled); | 1751 | bond->alb_info.rlb_enabled); |
1757 | 1752 | ||
1753 | read_lock(&bond->lock); | ||
1758 | alb_send_learning_packets(bond->curr_active_slave, bond_dev->dev_addr); | 1754 | alb_send_learning_packets(bond->curr_active_slave, bond_dev->dev_addr); |
1759 | if (bond->alb_info.rlb_enabled) { | 1755 | if (bond->alb_info.rlb_enabled) { |
1760 | /* inform clients mac address has changed */ | 1756 | /* inform clients mac address has changed */ |
1761 | rlb_req_update_slave_clients(bond, bond->curr_active_slave); | 1757 | rlb_req_update_slave_clients(bond, bond->curr_active_slave); |
1762 | } | 1758 | } |
1759 | read_unlock(&bond->lock); | ||
1763 | } | 1760 | } |
1764 | 1761 | ||
1765 | read_lock(&bond->lock); | ||
1766 | write_lock_bh(&bond->curr_slave_lock); | ||
1767 | |||
1768 | return 0; | 1762 | return 0; |
1769 | } | 1763 | } |
1770 | 1764 | ||
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 63369b6b14d4..2188a96fc090 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -2213,33 +2213,24 @@ static int bond_slave_info_query(struct net_device *bond_dev, struct ifslave *in | |||
2213 | { | 2213 | { |
2214 | struct bonding *bond = netdev_priv(bond_dev); | 2214 | struct bonding *bond = netdev_priv(bond_dev); |
2215 | struct slave *slave; | 2215 | struct slave *slave; |
2216 | int i, found = 0; | 2216 | int i, res = -ENODEV; |
2217 | |||
2218 | if (info->slave_id < 0) { | ||
2219 | return -ENODEV; | ||
2220 | } | ||
2221 | 2217 | ||
2222 | read_lock(&bond->lock); | 2218 | read_lock(&bond->lock); |
2223 | 2219 | ||
2224 | bond_for_each_slave(bond, slave, i) { | 2220 | bond_for_each_slave(bond, slave, i) { |
2225 | if (i == (int)info->slave_id) { | 2221 | if (i == (int)info->slave_id) { |
2226 | found = 1; | 2222 | res = 0; |
2223 | strcpy(info->slave_name, slave->dev->name); | ||
2224 | info->link = slave->link; | ||
2225 | info->state = slave->state; | ||
2226 | info->link_failure_count = slave->link_failure_count; | ||
2227 | break; | 2227 | break; |
2228 | } | 2228 | } |
2229 | } | 2229 | } |
2230 | 2230 | ||
2231 | read_unlock(&bond->lock); | 2231 | read_unlock(&bond->lock); |
2232 | 2232 | ||
2233 | if (found) { | 2233 | return res; |
2234 | strcpy(info->slave_name, slave->dev->name); | ||
2235 | info->link = slave->link; | ||
2236 | info->state = slave->state; | ||
2237 | info->link_failure_count = slave->link_failure_count; | ||
2238 | } else { | ||
2239 | return -ENODEV; | ||
2240 | } | ||
2241 | |||
2242 | return 0; | ||
2243 | } | 2234 | } |
2244 | 2235 | ||
2245 | /*-------------------------------- Monitoring -------------------------------*/ | 2236 | /*-------------------------------- Monitoring -------------------------------*/ |
@@ -5167,16 +5158,15 @@ int bond_create(char *name, struct bond_params *params) | |||
5167 | up_write(&bonding_rwsem); | 5158 | up_write(&bonding_rwsem); |
5168 | rtnl_unlock(); /* allows sysfs registration of net device */ | 5159 | rtnl_unlock(); /* allows sysfs registration of net device */ |
5169 | res = bond_create_sysfs_entry(netdev_priv(bond_dev)); | 5160 | res = bond_create_sysfs_entry(netdev_priv(bond_dev)); |
5170 | if (res < 0) { | 5161 | if (res < 0) |
5171 | rtnl_lock(); | 5162 | goto out_unreg; |
5172 | down_write(&bonding_rwsem); | ||
5173 | bond_deinit(bond_dev); | ||
5174 | unregister_netdevice(bond_dev); | ||
5175 | goto out_rtnl; | ||
5176 | } | ||
5177 | 5163 | ||
5178 | return 0; | 5164 | return 0; |
5179 | 5165 | ||
5166 | out_unreg: | ||
5167 | rtnl_lock(); | ||
5168 | down_write(&bonding_rwsem); | ||
5169 | unregister_netdevice(bond_dev); | ||
5180 | out_bond: | 5170 | out_bond: |
5181 | bond_deinit(bond_dev); | 5171 | bond_deinit(bond_dev); |
5182 | out_netdev: | 5172 | out_netdev: |
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c index e1bd690ff831..4f68aeb2679a 100644 --- a/drivers/net/cxgb3/t3_hw.c +++ b/drivers/net/cxgb3/t3_hw.c | |||
@@ -3779,7 +3779,7 @@ int t3_prep_adapter(struct adapter *adapter, const struct adapter_info *ai, | |||
3779 | 3779 | ||
3780 | adapter->params.info = ai; | 3780 | adapter->params.info = ai; |
3781 | adapter->params.nports = ai->nports0 + ai->nports1; | 3781 | adapter->params.nports = ai->nports0 + ai->nports1; |
3782 | adapter->params.chan_map = !!ai->nports0 | (!!ai->nports1 << 1); | 3782 | adapter->params.chan_map = (!!ai->nports0) | (!!ai->nports1 << 1); |
3783 | adapter->params.rev = t3_read_reg(adapter, A_PL_REV); | 3783 | adapter->params.rev = t3_read_reg(adapter, A_PL_REV); |
3784 | /* | 3784 | /* |
3785 | * We used to only run the "adapter check task" once a second if | 3785 | * We used to only run the "adapter check task" once a second if |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 6a46ceed9436..b1419e21b46b 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -3738,7 +3738,7 @@ static irqreturn_t e1000_intr(int irq, void *data) | |||
3738 | struct e1000_hw *hw = &adapter->hw; | 3738 | struct e1000_hw *hw = &adapter->hw; |
3739 | u32 rctl, icr = er32(ICR); | 3739 | u32 rctl, icr = er32(ICR); |
3740 | 3740 | ||
3741 | if (unlikely((!icr) || test_bit(__E1000_RESETTING, &adapter->flags))) | 3741 | if (unlikely((!icr) || test_bit(__E1000_DOWN, &adapter->flags))) |
3742 | return IRQ_NONE; /* Not our interrupt */ | 3742 | return IRQ_NONE; /* Not our interrupt */ |
3743 | 3743 | ||
3744 | /* IMS will not auto-mask if INT_ASSERTED is not set, and if it is | 3744 | /* IMS will not auto-mask if INT_ASSERTED is not set, and if it is |
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h index 6e317caf429c..16a41389575a 100644 --- a/drivers/net/ehea/ehea.h +++ b/drivers/net/ehea/ehea.h | |||
@@ -40,7 +40,7 @@ | |||
40 | #include <asm/io.h> | 40 | #include <asm/io.h> |
41 | 41 | ||
42 | #define DRV_NAME "ehea" | 42 | #define DRV_NAME "ehea" |
43 | #define DRV_VERSION "EHEA_0100" | 43 | #define DRV_VERSION "EHEA_0101" |
44 | 44 | ||
45 | /* eHEA capability flags */ | 45 | /* eHEA capability flags */ |
46 | #define DLPAR_PORT_ADD_REM 1 | 46 | #define DLPAR_PORT_ADD_REM 1 |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 604c844d0769..b22dab9153f6 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -545,14 +545,17 @@ static inline struct sk_buff *get_skb_by_index(struct sk_buff **skb_array, | |||
545 | x &= (arr_len - 1); | 545 | x &= (arr_len - 1); |
546 | 546 | ||
547 | pref = skb_array[x]; | 547 | pref = skb_array[x]; |
548 | prefetchw(pref); | 548 | if (pref) { |
549 | prefetchw(pref + EHEA_CACHE_LINE); | 549 | prefetchw(pref); |
550 | 550 | prefetchw(pref + EHEA_CACHE_LINE); | |
551 | pref = (skb_array[x]->data); | 551 | |
552 | prefetch(pref); | 552 | pref = (skb_array[x]->data); |
553 | prefetch(pref + EHEA_CACHE_LINE); | 553 | prefetch(pref); |
554 | prefetch(pref + EHEA_CACHE_LINE * 2); | 554 | prefetch(pref + EHEA_CACHE_LINE); |
555 | prefetch(pref + EHEA_CACHE_LINE * 3); | 555 | prefetch(pref + EHEA_CACHE_LINE * 2); |
556 | prefetch(pref + EHEA_CACHE_LINE * 3); | ||
557 | } | ||
558 | |||
556 | skb = skb_array[skb_index]; | 559 | skb = skb_array[skb_index]; |
557 | skb_array[skb_index] = NULL; | 560 | skb_array[skb_index] = NULL; |
558 | return skb; | 561 | return skb; |
@@ -569,12 +572,14 @@ static inline struct sk_buff *get_skb_by_index_ll(struct sk_buff **skb_array, | |||
569 | x &= (arr_len - 1); | 572 | x &= (arr_len - 1); |
570 | 573 | ||
571 | pref = skb_array[x]; | 574 | pref = skb_array[x]; |
572 | prefetchw(pref); | 575 | if (pref) { |
573 | prefetchw(pref + EHEA_CACHE_LINE); | 576 | prefetchw(pref); |
577 | prefetchw(pref + EHEA_CACHE_LINE); | ||
574 | 578 | ||
575 | pref = (skb_array[x]->data); | 579 | pref = (skb_array[x]->data); |
576 | prefetchw(pref); | 580 | prefetchw(pref); |
577 | prefetchw(pref + EHEA_CACHE_LINE); | 581 | prefetchw(pref + EHEA_CACHE_LINE); |
582 | } | ||
578 | 583 | ||
579 | skb = skb_array[wqe_index]; | 584 | skb = skb_array[wqe_index]; |
580 | skb_array[wqe_index] = NULL; | 585 | skb_array[wqe_index] = NULL; |
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index b3185bf2c158..a400d7115f78 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -393,12 +393,12 @@ struct mv643xx_eth_private { | |||
393 | struct work_struct tx_timeout_task; | 393 | struct work_struct tx_timeout_task; |
394 | 394 | ||
395 | struct napi_struct napi; | 395 | struct napi_struct napi; |
396 | u8 oom; | ||
396 | u8 work_link; | 397 | u8 work_link; |
397 | u8 work_tx; | 398 | u8 work_tx; |
398 | u8 work_tx_end; | 399 | u8 work_tx_end; |
399 | u8 work_rx; | 400 | u8 work_rx; |
400 | u8 work_rx_refill; | 401 | u8 work_rx_refill; |
401 | u8 work_rx_oom; | ||
402 | 402 | ||
403 | int skb_size; | 403 | int skb_size; |
404 | struct sk_buff_head rx_recycle; | 404 | struct sk_buff_head rx_recycle; |
@@ -661,7 +661,7 @@ static int rxq_refill(struct rx_queue *rxq, int budget) | |||
661 | dma_get_cache_alignment() - 1); | 661 | dma_get_cache_alignment() - 1); |
662 | 662 | ||
663 | if (skb == NULL) { | 663 | if (skb == NULL) { |
664 | mp->work_rx_oom |= 1 << rxq->index; | 664 | mp->oom = 1; |
665 | goto oom; | 665 | goto oom; |
666 | } | 666 | } |
667 | 667 | ||
@@ -1255,7 +1255,6 @@ static void mib_counters_update(struct mv643xx_eth_private *mp) | |||
1255 | 1255 | ||
1256 | spin_lock_bh(&mp->mib_counters_lock); | 1256 | spin_lock_bh(&mp->mib_counters_lock); |
1257 | p->good_octets_received += mib_read(mp, 0x00); | 1257 | p->good_octets_received += mib_read(mp, 0x00); |
1258 | p->good_octets_received += (u64)mib_read(mp, 0x04) << 32; | ||
1259 | p->bad_octets_received += mib_read(mp, 0x08); | 1258 | p->bad_octets_received += mib_read(mp, 0x08); |
1260 | p->internal_mac_transmit_err += mib_read(mp, 0x0c); | 1259 | p->internal_mac_transmit_err += mib_read(mp, 0x0c); |
1261 | p->good_frames_received += mib_read(mp, 0x10); | 1260 | p->good_frames_received += mib_read(mp, 0x10); |
@@ -1269,7 +1268,6 @@ static void mib_counters_update(struct mv643xx_eth_private *mp) | |||
1269 | p->frames_512_to_1023_octets += mib_read(mp, 0x30); | 1268 | p->frames_512_to_1023_octets += mib_read(mp, 0x30); |
1270 | p->frames_1024_to_max_octets += mib_read(mp, 0x34); | 1269 | p->frames_1024_to_max_octets += mib_read(mp, 0x34); |
1271 | p->good_octets_sent += mib_read(mp, 0x38); | 1270 | p->good_octets_sent += mib_read(mp, 0x38); |
1272 | p->good_octets_sent += (u64)mib_read(mp, 0x3c) << 32; | ||
1273 | p->good_frames_sent += mib_read(mp, 0x40); | 1271 | p->good_frames_sent += mib_read(mp, 0x40); |
1274 | p->excessive_collision += mib_read(mp, 0x44); | 1272 | p->excessive_collision += mib_read(mp, 0x44); |
1275 | p->multicast_frames_sent += mib_read(mp, 0x48); | 1273 | p->multicast_frames_sent += mib_read(mp, 0x48); |
@@ -2167,8 +2165,10 @@ static int mv643xx_eth_poll(struct napi_struct *napi, int budget) | |||
2167 | 2165 | ||
2168 | mp = container_of(napi, struct mv643xx_eth_private, napi); | 2166 | mp = container_of(napi, struct mv643xx_eth_private, napi); |
2169 | 2167 | ||
2170 | mp->work_rx_refill |= mp->work_rx_oom; | 2168 | if (unlikely(mp->oom)) { |
2171 | mp->work_rx_oom = 0; | 2169 | mp->oom = 0; |
2170 | del_timer(&mp->rx_oom); | ||
2171 | } | ||
2172 | 2172 | ||
2173 | work_done = 0; | 2173 | work_done = 0; |
2174 | while (work_done < budget) { | 2174 | while (work_done < budget) { |
@@ -2182,8 +2182,10 @@ static int mv643xx_eth_poll(struct napi_struct *napi, int budget) | |||
2182 | continue; | 2182 | continue; |
2183 | } | 2183 | } |
2184 | 2184 | ||
2185 | queue_mask = mp->work_tx | mp->work_tx_end | | 2185 | queue_mask = mp->work_tx | mp->work_tx_end | mp->work_rx; |
2186 | mp->work_rx | mp->work_rx_refill; | 2186 | if (likely(!mp->oom)) |
2187 | queue_mask |= mp->work_rx_refill; | ||
2188 | |||
2187 | if (!queue_mask) { | 2189 | if (!queue_mask) { |
2188 | if (mv643xx_eth_collect_events(mp)) | 2190 | if (mv643xx_eth_collect_events(mp)) |
2189 | continue; | 2191 | continue; |
@@ -2204,7 +2206,7 @@ static int mv643xx_eth_poll(struct napi_struct *napi, int budget) | |||
2204 | txq_maybe_wake(mp->txq + queue); | 2206 | txq_maybe_wake(mp->txq + queue); |
2205 | } else if (mp->work_rx & queue_mask) { | 2207 | } else if (mp->work_rx & queue_mask) { |
2206 | work_done += rxq_process(mp->rxq + queue, work_tbd); | 2208 | work_done += rxq_process(mp->rxq + queue, work_tbd); |
2207 | } else if (mp->work_rx_refill & queue_mask) { | 2209 | } else if (!mp->oom && (mp->work_rx_refill & queue_mask)) { |
2208 | work_done += rxq_refill(mp->rxq + queue, work_tbd); | 2210 | work_done += rxq_refill(mp->rxq + queue, work_tbd); |
2209 | } else { | 2211 | } else { |
2210 | BUG(); | 2212 | BUG(); |
@@ -2212,7 +2214,7 @@ static int mv643xx_eth_poll(struct napi_struct *napi, int budget) | |||
2212 | } | 2214 | } |
2213 | 2215 | ||
2214 | if (work_done < budget) { | 2216 | if (work_done < budget) { |
2215 | if (mp->work_rx_oom) | 2217 | if (mp->oom) |
2216 | mod_timer(&mp->rx_oom, jiffies + (HZ / 10)); | 2218 | mod_timer(&mp->rx_oom, jiffies + (HZ / 10)); |
2217 | napi_complete(napi); | 2219 | napi_complete(napi); |
2218 | wrlp(mp, INT_MASK, INT_TX_END | INT_RX | INT_EXT); | 2220 | wrlp(mp, INT_MASK, INT_TX_END | INT_RX | INT_EXT); |
@@ -2372,7 +2374,7 @@ static int mv643xx_eth_open(struct net_device *dev) | |||
2372 | rxq_refill(mp->rxq + i, INT_MAX); | 2374 | rxq_refill(mp->rxq + i, INT_MAX); |
2373 | } | 2375 | } |
2374 | 2376 | ||
2375 | if (mp->work_rx_oom) { | 2377 | if (mp->oom) { |
2376 | mp->rx_oom.expires = jiffies + (HZ / 10); | 2378 | mp->rx_oom.expires = jiffies + (HZ / 10); |
2377 | add_timer(&mp->rx_oom); | 2379 | add_timer(&mp->rx_oom); |
2378 | } | 2380 | } |
diff --git a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c index eb66f658f9d1..7d83896b8c26 100644 --- a/drivers/net/ne2k-pci.c +++ b/drivers/net/ne2k-pci.c | |||
@@ -374,18 +374,17 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev, | |||
374 | dev->ethtool_ops = &ne2k_pci_ethtool_ops; | 374 | dev->ethtool_ops = &ne2k_pci_ethtool_ops; |
375 | NS8390_init(dev, 0); | 375 | NS8390_init(dev, 0); |
376 | 376 | ||
377 | memcpy(dev->dev_addr, SA_prom, 6); | ||
378 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); | ||
379 | |||
377 | i = register_netdev(dev); | 380 | i = register_netdev(dev); |
378 | if (i) | 381 | if (i) |
379 | goto err_out_free_netdev; | 382 | goto err_out_free_netdev; |
380 | 383 | ||
381 | for(i = 0; i < 6; i++) | ||
382 | dev->dev_addr[i] = SA_prom[i]; | ||
383 | printk("%s: %s found at %#lx, IRQ %d, %pM.\n", | 384 | printk("%s: %s found at %#lx, IRQ %d, %pM.\n", |
384 | dev->name, pci_clone_list[chip_idx].name, ioaddr, dev->irq, | 385 | dev->name, pci_clone_list[chip_idx].name, ioaddr, dev->irq, |
385 | dev->dev_addr); | 386 | dev->dev_addr); |
386 | 387 | ||
387 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); | ||
388 | |||
389 | return 0; | 388 | return 0; |
390 | 389 | ||
391 | err_out_free_netdev: | 390 | err_out_free_netdev: |
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index eceadf787a67..bf4af5248cb7 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c | |||
@@ -664,7 +664,7 @@ static int netconsole_netdev_event(struct notifier_block *this, | |||
664 | struct netconsole_target *nt; | 664 | struct netconsole_target *nt; |
665 | struct net_device *dev = ptr; | 665 | struct net_device *dev = ptr; |
666 | 666 | ||
667 | if (!(event == NETDEV_CHANGENAME)) | 667 | if (!(event == NETDEV_CHANGENAME || event == NETDEV_UNREGISTER)) |
668 | goto done; | 668 | goto done; |
669 | 669 | ||
670 | spin_lock_irqsave(&target_list_lock, flags); | 670 | spin_lock_irqsave(&target_list_lock, flags); |
@@ -675,6 +675,15 @@ static int netconsole_netdev_event(struct notifier_block *this, | |||
675 | case NETDEV_CHANGENAME: | 675 | case NETDEV_CHANGENAME: |
676 | strlcpy(nt->np.dev_name, dev->name, IFNAMSIZ); | 676 | strlcpy(nt->np.dev_name, dev->name, IFNAMSIZ); |
677 | break; | 677 | break; |
678 | case NETDEV_UNREGISTER: | ||
679 | if (!nt->enabled) | ||
680 | break; | ||
681 | netpoll_cleanup(&nt->np); | ||
682 | nt->enabled = 0; | ||
683 | printk(KERN_INFO "netconsole: network logging stopped" | ||
684 | ", interface %s unregistered\n", | ||
685 | dev->name); | ||
686 | break; | ||
678 | } | 687 | } |
679 | } | 688 | } |
680 | netconsole_target_put(nt); | 689 | netconsole_target_put(nt); |
diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig index 8ee21030e9ac..dfc6cf765fbd 100644 --- a/drivers/net/usb/Kconfig +++ b/drivers/net/usb/Kconfig | |||
@@ -180,6 +180,20 @@ config USB_NET_CDCETHER | |||
180 | IEEE 802 "local assignment" bit is set in the address, a "usbX" | 180 | IEEE 802 "local assignment" bit is set in the address, a "usbX" |
181 | name is used instead. | 181 | name is used instead. |
182 | 182 | ||
183 | config USB_NET_CDC_EEM | ||
184 | tristate "CDC EEM support" | ||
185 | depends on USB_USBNET && EXPERIMENTAL | ||
186 | help | ||
187 | This option supports devices conforming to the Communication Device | ||
188 | Class (CDC) Ethernet Emulation Model, a specification that's easy to | ||
189 | implement in device firmware. The CDC EEM specifications are available | ||
190 | from <http://www.usb.org/>. | ||
191 | |||
192 | This driver creates an interface named "ethX", where X depends on | ||
193 | what other networking devices you have in use. However, if the | ||
194 | IEEE 802 "local assignment" bit is set in the address, a "usbX" | ||
195 | name is used instead. | ||
196 | |||
183 | config USB_NET_DM9601 | 197 | config USB_NET_DM9601 |
184 | tristate "Davicom DM9601 based USB 1.1 10/100 ethernet devices" | 198 | tristate "Davicom DM9601 based USB 1.1 10/100 ethernet devices" |
185 | depends on USB_USBNET | 199 | depends on USB_USBNET |
diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile index 88a87eeb376a..c8aef62cf2b7 100644 --- a/drivers/net/usb/Makefile +++ b/drivers/net/usb/Makefile | |||
@@ -9,6 +9,7 @@ obj-$(CONFIG_USB_RTL8150) += rtl8150.o | |||
9 | obj-$(CONFIG_USB_HSO) += hso.o | 9 | obj-$(CONFIG_USB_HSO) += hso.o |
10 | obj-$(CONFIG_USB_NET_AX8817X) += asix.o | 10 | obj-$(CONFIG_USB_NET_AX8817X) += asix.o |
11 | obj-$(CONFIG_USB_NET_CDCETHER) += cdc_ether.o | 11 | obj-$(CONFIG_USB_NET_CDCETHER) += cdc_ether.o |
12 | obj-$(CONFIG_USB_NET_CDC_EEM) += cdc_eem.o | ||
12 | obj-$(CONFIG_USB_NET_DM9601) += dm9601.o | 13 | obj-$(CONFIG_USB_NET_DM9601) += dm9601.o |
13 | obj-$(CONFIG_USB_NET_SMSC95XX) += smsc95xx.o | 14 | obj-$(CONFIG_USB_NET_SMSC95XX) += smsc95xx.o |
14 | obj-$(CONFIG_USB_NET_GL620A) += gl620a.o | 15 | obj-$(CONFIG_USB_NET_GL620A) += gl620a.o |
diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c new file mode 100644 index 000000000000..80e01778dd3b --- /dev/null +++ b/drivers/net/usb/cdc_eem.c | |||
@@ -0,0 +1,381 @@ | |||
1 | /* | ||
2 | * USB CDC EEM network interface driver | ||
3 | * Copyright (C) 2009 Oberthur Technologies | ||
4 | * by Omar Laazimani, Olivier Condemine | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #include <linux/module.h> | ||
22 | #include <linux/init.h> | ||
23 | #include <linux/netdevice.h> | ||
24 | #include <linux/etherdevice.h> | ||
25 | #include <linux/ctype.h> | ||
26 | #include <linux/ethtool.h> | ||
27 | #include <linux/workqueue.h> | ||
28 | #include <linux/mii.h> | ||
29 | #include <linux/usb.h> | ||
30 | #include <linux/crc32.h> | ||
31 | #include <linux/usb/cdc.h> | ||
32 | #include <linux/usb/usbnet.h> | ||
33 | |||
34 | |||
35 | /* | ||
36 | * This driver is an implementation of the CDC "Ethernet Emulation | ||
37 | * Model" (EEM) specification, which encapsulates Ethernet frames | ||
38 | * for transport over USB using a simpler USB device model than the | ||
39 | * previous CDC "Ethernet Control Model" (ECM, or "CDC Ethernet"). | ||
40 | * | ||
41 | * For details, see www.usb.org/developers/devclass_docs/CDC_EEM10.pdf | ||
42 | * | ||
43 | * This version has been tested with GIGAntIC WuaoW SIM Smart Card on 2.6.24, | ||
44 | * 2.6.27 and 2.6.30rc2 kernel. | ||
45 | * It has also been validated on Openmoko Om 2008.12 (based on 2.6.24 kernel). | ||
46 | * build on 23-April-2009 | ||
47 | */ | ||
48 | |||
49 | #define EEM_HEAD 2 /* 2 byte header */ | ||
50 | |||
51 | /*-------------------------------------------------------------------------*/ | ||
52 | |||
53 | static void eem_linkcmd_complete(struct urb *urb) | ||
54 | { | ||
55 | dev_kfree_skb(urb->context); | ||
56 | usb_free_urb(urb); | ||
57 | } | ||
58 | |||
59 | static void eem_linkcmd(struct usbnet *dev, struct sk_buff *skb) | ||
60 | { | ||
61 | struct urb *urb; | ||
62 | int status; | ||
63 | |||
64 | urb = usb_alloc_urb(0, GFP_ATOMIC); | ||
65 | if (!urb) | ||
66 | goto fail; | ||
67 | |||
68 | usb_fill_bulk_urb(urb, dev->udev, dev->out, | ||
69 | skb->data, skb->len, eem_linkcmd_complete, skb); | ||
70 | |||
71 | status = usb_submit_urb(urb, GFP_ATOMIC); | ||
72 | if (status) { | ||
73 | usb_free_urb(urb); | ||
74 | fail: | ||
75 | dev_kfree_skb(skb); | ||
76 | devwarn(dev, "link cmd failure\n"); | ||
77 | return; | ||
78 | } | ||
79 | } | ||
80 | |||
81 | static int eem_bind(struct usbnet *dev, struct usb_interface *intf) | ||
82 | { | ||
83 | int status = 0; | ||
84 | |||
85 | status = usbnet_get_endpoints(dev, intf); | ||
86 | if (status < 0) { | ||
87 | usb_set_intfdata(intf, NULL); | ||
88 | usb_driver_release_interface(driver_of(intf), intf); | ||
89 | return status; | ||
90 | } | ||
91 | |||
92 | /* no jumbogram (16K) support for now */ | ||
93 | |||
94 | dev->net->hard_header_len += EEM_HEAD + ETH_FCS_LEN; | ||
95 | |||
96 | return 0; | ||
97 | } | ||
98 | |||
99 | /* | ||
100 | * EEM permits packing multiple Ethernet frames into USB transfers | ||
101 | * (a "bundle"), but for TX we don't try to do that. | ||
102 | */ | ||
103 | static struct sk_buff *eem_tx_fixup(struct usbnet *dev, struct sk_buff *skb, | ||
104 | gfp_t flags) | ||
105 | { | ||
106 | struct sk_buff *skb2 = NULL; | ||
107 | u16 len = skb->len; | ||
108 | u32 crc = 0; | ||
109 | int padlen = 0; | ||
110 | |||
111 | /* When ((len + EEM_HEAD + ETH_FCS_LEN) % dev->maxpacket) is | ||
112 | * zero, stick two bytes of zero length EEM packet on the end. | ||
113 | * Else the framework would add invalid single byte padding, | ||
114 | * since it can't know whether ZLPs will be handled right by | ||
115 | * all the relevant hardware and software. | ||
116 | */ | ||
117 | if (!((len + EEM_HEAD + ETH_FCS_LEN) % dev->maxpacket)) | ||
118 | padlen += 2; | ||
119 | |||
120 | if (!skb_cloned(skb)) { | ||
121 | int headroom = skb_headroom(skb); | ||
122 | int tailroom = skb_tailroom(skb); | ||
123 | |||
124 | if ((tailroom >= ETH_FCS_LEN + padlen) | ||
125 | && (headroom >= EEM_HEAD)) | ||
126 | goto done; | ||
127 | |||
128 | if ((headroom + tailroom) | ||
129 | > (EEM_HEAD + ETH_FCS_LEN + padlen)) { | ||
130 | skb->data = memmove(skb->head + | ||
131 | EEM_HEAD, | ||
132 | skb->data, | ||
133 | skb->len); | ||
134 | skb_set_tail_pointer(skb, len); | ||
135 | goto done; | ||
136 | } | ||
137 | } | ||
138 | |||
139 | skb2 = skb_copy_expand(skb, EEM_HEAD, ETH_FCS_LEN + padlen, flags); | ||
140 | if (!skb2) | ||
141 | return NULL; | ||
142 | |||
143 | dev_kfree_skb_any(skb); | ||
144 | skb = skb2; | ||
145 | |||
146 | done: | ||
147 | /* we don't use the "no Ethernet CRC" option */ | ||
148 | crc = crc32_le(~0, skb->data, skb->len); | ||
149 | crc = ~crc; | ||
150 | |||
151 | put_unaligned_le32(crc, skb_put(skb, 4)); | ||
152 | |||
153 | /* EEM packet header format: | ||
154 | * b0..13: length of ethernet frame | ||
155 | * b14: bmCRC (1 == valid Ethernet CRC) | ||
156 | * b15: bmType (0 == data) | ||
157 | */ | ||
158 | len = skb->len; | ||
159 | put_unaligned_le16(BIT(14) | len, skb_push(skb, 2)); | ||
160 | |||
161 | /* Bundle a zero length EEM packet if needed */ | ||
162 | if (padlen) | ||
163 | put_unaligned_le16(0, skb_put(skb, 2)); | ||
164 | |||
165 | return skb; | ||
166 | } | ||
167 | |||
168 | static int eem_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | ||
169 | { | ||
170 | /* | ||
171 | * Our task here is to strip off framing, leaving skb with one | ||
172 | * data frame for the usbnet framework code to process. But we | ||
173 | * may have received multiple EEM payloads, or command payloads. | ||
174 | * So we must process _everything_ as if it's a header, except | ||
175 | * maybe the last data payload | ||
176 | * | ||
177 | * REVISIT the framework needs updating so that when we consume | ||
178 | * all payloads (the last or only message was a command, or a | ||
179 | * zero length EEM packet) that is not accounted as an rx_error. | ||
180 | */ | ||
181 | do { | ||
182 | struct sk_buff *skb2 = NULL; | ||
183 | u16 header; | ||
184 | u16 len = 0; | ||
185 | |||
186 | /* incomplete EEM header? */ | ||
187 | if (skb->len < EEM_HEAD) | ||
188 | return 0; | ||
189 | |||
190 | /* | ||
191 | * EEM packet header format: | ||
192 | * b0..14: EEM type dependant (Data or Command) | ||
193 | * b15: bmType | ||
194 | */ | ||
195 | header = get_unaligned_le16(skb->data); | ||
196 | skb_pull(skb, EEM_HEAD); | ||
197 | |||
198 | /* | ||
199 | * The bmType bit helps to denote when EEM | ||
200 | * packet is data or command : | ||
201 | * bmType = 0 : EEM data payload | ||
202 | * bmType = 1 : EEM (link) command | ||
203 | */ | ||
204 | if (header & BIT(15)) { | ||
205 | u16 bmEEMCmd; | ||
206 | |||
207 | /* | ||
208 | * EEM (link) command packet: | ||
209 | * b0..10: bmEEMCmdParam | ||
210 | * b11..13: bmEEMCmd | ||
211 | * b14: bmReserved (must be 0) | ||
212 | * b15: 1 (EEM command) | ||
213 | */ | ||
214 | if (header & BIT(14)) { | ||
215 | devdbg(dev, "reserved command %04x\n", header); | ||
216 | continue; | ||
217 | } | ||
218 | |||
219 | bmEEMCmd = (header >> 11) & 0x7; | ||
220 | switch (bmEEMCmd) { | ||
221 | |||
222 | /* Responding to echo requests is mandatory. */ | ||
223 | case 0: /* Echo command */ | ||
224 | len = header & 0x7FF; | ||
225 | |||
226 | /* bogus command? */ | ||
227 | if (skb->len < len) | ||
228 | return 0; | ||
229 | |||
230 | skb2 = skb_clone(skb, GFP_ATOMIC); | ||
231 | if (unlikely(!skb2)) | ||
232 | goto next; | ||
233 | skb_trim(skb2, len); | ||
234 | put_unaligned_le16(BIT(15) | (1 << 11) | len, | ||
235 | skb_push(skb2, 2)); | ||
236 | eem_linkcmd(dev, skb2); | ||
237 | break; | ||
238 | |||
239 | /* | ||
240 | * Host may choose to ignore hints. | ||
241 | * - suspend: peripheral ready to suspend | ||
242 | * - response: suggest N millisec polling | ||
243 | * - response complete: suggest N sec polling | ||
244 | */ | ||
245 | case 2: /* Suspend hint */ | ||
246 | case 3: /* Response hint */ | ||
247 | case 4: /* Response complete hint */ | ||
248 | continue; | ||
249 | |||
250 | /* | ||
251 | * Hosts should never receive host-to-peripheral | ||
252 | * or reserved command codes; or responses to an | ||
253 | * echo command we didn't send. | ||
254 | */ | ||
255 | case 1: /* Echo response */ | ||
256 | case 5: /* Tickle */ | ||
257 | default: /* reserved */ | ||
258 | devwarn(dev, "unexpected link command %d\n", | ||
259 | bmEEMCmd); | ||
260 | continue; | ||
261 | } | ||
262 | |||
263 | } else { | ||
264 | u32 crc, crc2; | ||
265 | int is_last; | ||
266 | |||
267 | /* zero length EEM packet? */ | ||
268 | if (header == 0) | ||
269 | continue; | ||
270 | |||
271 | /* | ||
272 | * EEM data packet header : | ||
273 | * b0..13: length of ethernet frame | ||
274 | * b14: bmCRC | ||
275 | * b15: 0 (EEM data) | ||
276 | */ | ||
277 | len = header & 0x3FFF; | ||
278 | |||
279 | /* bogus EEM payload? */ | ||
280 | if (skb->len < len) | ||
281 | return 0; | ||
282 | |||
283 | /* bogus ethernet frame? */ | ||
284 | if (len < (ETH_HLEN + ETH_FCS_LEN)) | ||
285 | goto next; | ||
286 | |||
287 | /* | ||
288 | * Treat the last payload differently: framework | ||
289 | * code expects our "fixup" to have stripped off | ||
290 | * headers, so "skb" is a data packet (or error). | ||
291 | * Else if it's not the last payload, keep "skb" | ||
292 | * for further processing. | ||
293 | */ | ||
294 | is_last = (len == skb->len); | ||
295 | if (is_last) | ||
296 | skb2 = skb; | ||
297 | else { | ||
298 | skb2 = skb_clone(skb, GFP_ATOMIC); | ||
299 | if (unlikely(!skb2)) | ||
300 | return 0; | ||
301 | } | ||
302 | |||
303 | crc = get_unaligned_le32(skb2->data | ||
304 | + len - ETH_FCS_LEN); | ||
305 | skb_trim(skb2, len - ETH_FCS_LEN); | ||
306 | |||
307 | /* | ||
308 | * The bmCRC helps to denote when the CRC field in | ||
309 | * the Ethernet frame contains a calculated CRC: | ||
310 | * bmCRC = 1 : CRC is calculated | ||
311 | * bmCRC = 0 : CRC = 0xDEADBEEF | ||
312 | */ | ||
313 | if (header & BIT(14)) | ||
314 | crc2 = ~crc32_le(~0, skb2->data, len); | ||
315 | else | ||
316 | crc2 = 0xdeadbeef; | ||
317 | |||
318 | if (is_last) | ||
319 | return crc == crc2; | ||
320 | |||
321 | if (unlikely(crc != crc2)) { | ||
322 | dev->stats.rx_errors++; | ||
323 | dev_kfree_skb_any(skb2); | ||
324 | } else | ||
325 | usbnet_skb_return(dev, skb2); | ||
326 | } | ||
327 | |||
328 | next: | ||
329 | skb_pull(skb, len); | ||
330 | } while (skb->len); | ||
331 | |||
332 | return 1; | ||
333 | } | ||
334 | |||
335 | static const struct driver_info eem_info = { | ||
336 | .description = "CDC EEM Device", | ||
337 | .flags = FLAG_ETHER, | ||
338 | .bind = eem_bind, | ||
339 | .rx_fixup = eem_rx_fixup, | ||
340 | .tx_fixup = eem_tx_fixup, | ||
341 | }; | ||
342 | |||
343 | /*-------------------------------------------------------------------------*/ | ||
344 | |||
345 | static const struct usb_device_id products[] = { | ||
346 | { | ||
347 | USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_EEM, | ||
348 | USB_CDC_PROTO_EEM), | ||
349 | .driver_info = (unsigned long) &eem_info, | ||
350 | }, | ||
351 | { | ||
352 | /* EMPTY == end of list */ | ||
353 | }, | ||
354 | }; | ||
355 | MODULE_DEVICE_TABLE(usb, products); | ||
356 | |||
357 | static struct usb_driver eem_driver = { | ||
358 | .name = "cdc_eem", | ||
359 | .id_table = products, | ||
360 | .probe = usbnet_probe, | ||
361 | .disconnect = usbnet_disconnect, | ||
362 | .suspend = usbnet_suspend, | ||
363 | .resume = usbnet_resume, | ||
364 | }; | ||
365 | |||
366 | |||
367 | static int __init eem_init(void) | ||
368 | { | ||
369 | return usb_register(&eem_driver); | ||
370 | } | ||
371 | module_init(eem_init); | ||
372 | |||
373 | static void __exit eem_exit(void) | ||
374 | { | ||
375 | usb_deregister(&eem_driver); | ||
376 | } | ||
377 | module_exit(eem_exit); | ||
378 | |||
379 | MODULE_AUTHOR("Omar Laazimani <omar.oberthur@gmail.com>"); | ||
380 | MODULE_DESCRIPTION("USB CDC EEM"); | ||
381 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index dc1665326592..5a7283372b53 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c | |||
@@ -941,6 +941,16 @@ static int smsc95xx_reset(struct usbnet *dev) | |||
941 | if (netif_msg_ifup(dev)) | 941 | if (netif_msg_ifup(dev)) |
942 | devdbg(dev, "ID_REV = 0x%08x", read_buf); | 942 | devdbg(dev, "ID_REV = 0x%08x", read_buf); |
943 | 943 | ||
944 | /* Configure GPIO pins as LED outputs */ | ||
945 | write_buf = LED_GPIO_CFG_SPD_LED | LED_GPIO_CFG_LNK_LED | | ||
946 | LED_GPIO_CFG_FDX_LED; | ||
947 | ret = smsc95xx_write_reg(dev, LED_GPIO_CFG, write_buf); | ||
948 | if (ret < 0) { | ||
949 | devwarn(dev, "Failed to write LED_GPIO_CFG register, ret=%d", | ||
950 | ret); | ||
951 | return ret; | ||
952 | } | ||
953 | |||
944 | /* Init Tx */ | 954 | /* Init Tx */ |
945 | write_buf = 0; | 955 | write_buf = 0; |
946 | ret = smsc95xx_write_reg(dev, FLOW, write_buf); | 956 | ret = smsc95xx_write_reg(dev, FLOW, write_buf); |
@@ -1231,6 +1241,11 @@ static const struct usb_device_id products[] = { | |||
1231 | USB_DEVICE(0x0424, 0x9500), | 1241 | USB_DEVICE(0x0424, 0x9500), |
1232 | .driver_info = (unsigned long) &smsc95xx_info, | 1242 | .driver_info = (unsigned long) &smsc95xx_info, |
1233 | }, | 1243 | }, |
1244 | { | ||
1245 | /* SMSC9512/9514 USB Hub & Ethernet Device */ | ||
1246 | USB_DEVICE(0x0424, 0xec00), | ||
1247 | .driver_info = (unsigned long) &smsc95xx_info, | ||
1248 | }, | ||
1234 | { }, /* END */ | 1249 | { }, /* END */ |
1235 | }; | 1250 | }; |
1236 | MODULE_DEVICE_TABLE(usb, products); | 1251 | MODULE_DEVICE_TABLE(usb, products); |
diff --git a/drivers/net/usb/smsc95xx.h b/drivers/net/usb/smsc95xx.h index 66b5c84f302e..86bc44977fbd 100644 --- a/drivers/net/usb/smsc95xx.h +++ b/drivers/net/usb/smsc95xx.h | |||
@@ -99,6 +99,9 @@ | |||
99 | #define PM_CTL_WUPS_MULTI_ (0x00000003) | 99 | #define PM_CTL_WUPS_MULTI_ (0x00000003) |
100 | 100 | ||
101 | #define LED_GPIO_CFG (0x24) | 101 | #define LED_GPIO_CFG (0x24) |
102 | #define LED_GPIO_CFG_SPD_LED (0x01000000) | ||
103 | #define LED_GPIO_CFG_LNK_LED (0x00100000) | ||
104 | #define LED_GPIO_CFG_FDX_LED (0x00010000) | ||
102 | 105 | ||
103 | #define GPIO_CFG (0x28) | 106 | #define GPIO_CFG (0x28) |
104 | 107 | ||
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 9c82a39497e5..4d1d47953fc6 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -616,10 +616,11 @@ static int virtnet_open(struct net_device *dev) | |||
616 | static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd, | 616 | static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd, |
617 | struct scatterlist *data, int out, int in) | 617 | struct scatterlist *data, int out, int in) |
618 | { | 618 | { |
619 | struct scatterlist sg[VIRTNET_SEND_COMMAND_SG_MAX + 2]; | 619 | struct scatterlist *s, sg[VIRTNET_SEND_COMMAND_SG_MAX + 2]; |
620 | struct virtio_net_ctrl_hdr ctrl; | 620 | struct virtio_net_ctrl_hdr ctrl; |
621 | virtio_net_ctrl_ack status = ~0; | 621 | virtio_net_ctrl_ack status = ~0; |
622 | unsigned int tmp; | 622 | unsigned int tmp; |
623 | int i; | ||
623 | 624 | ||
624 | if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ)) { | 625 | if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ)) { |
625 | BUG(); /* Caller should know better */ | 626 | BUG(); /* Caller should know better */ |
@@ -637,7 +638,8 @@ static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd, | |||
637 | sg_init_table(sg, out + in); | 638 | sg_init_table(sg, out + in); |
638 | 639 | ||
639 | sg_set_buf(&sg[0], &ctrl, sizeof(ctrl)); | 640 | sg_set_buf(&sg[0], &ctrl, sizeof(ctrl)); |
640 | memcpy(&sg[1], data, sizeof(struct scatterlist) * (out + in - 2)); | 641 | for_each_sg(data, s, out + in - 2, i) |
642 | sg_set_buf(&sg[i + 1], sg_virt(s), s->length); | ||
641 | sg_set_buf(&sg[out + in - 1], &status, sizeof(status)); | 643 | sg_set_buf(&sg[out + in - 1], &status, sizeof(status)); |
642 | 644 | ||
643 | if (vi->cvq->vq_ops->add_buf(vi->cvq, sg, out, in, vi) != 0) | 645 | if (vi->cvq->vq_ops->add_buf(vi->cvq, sg, out, in, vi) != 0) |
@@ -692,7 +694,7 @@ static void virtnet_set_rx_mode(struct net_device *dev) | |||
692 | promisc = ((dev->flags & IFF_PROMISC) != 0); | 694 | promisc = ((dev->flags & IFF_PROMISC) != 0); |
693 | allmulti = ((dev->flags & IFF_ALLMULTI) != 0); | 695 | allmulti = ((dev->flags & IFF_ALLMULTI) != 0); |
694 | 696 | ||
695 | sg_set_buf(sg, &promisc, sizeof(promisc)); | 697 | sg_init_one(sg, &promisc, sizeof(promisc)); |
696 | 698 | ||
697 | if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_RX, | 699 | if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_RX, |
698 | VIRTIO_NET_CTRL_RX_PROMISC, | 700 | VIRTIO_NET_CTRL_RX_PROMISC, |
@@ -700,7 +702,7 @@ static void virtnet_set_rx_mode(struct net_device *dev) | |||
700 | dev_warn(&dev->dev, "Failed to %sable promisc mode.\n", | 702 | dev_warn(&dev->dev, "Failed to %sable promisc mode.\n", |
701 | promisc ? "en" : "dis"); | 703 | promisc ? "en" : "dis"); |
702 | 704 | ||
703 | sg_set_buf(sg, &allmulti, sizeof(allmulti)); | 705 | sg_init_one(sg, &allmulti, sizeof(allmulti)); |
704 | 706 | ||
705 | if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_RX, | 707 | if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_RX, |
706 | VIRTIO_NET_CTRL_RX_ALLMULTI, | 708 | VIRTIO_NET_CTRL_RX_ALLMULTI, |
@@ -716,6 +718,8 @@ static void virtnet_set_rx_mode(struct net_device *dev) | |||
716 | return; | 718 | return; |
717 | } | 719 | } |
718 | 720 | ||
721 | sg_init_table(sg, 2); | ||
722 | |||
719 | /* Store the unicast list and count in the front of the buffer */ | 723 | /* Store the unicast list and count in the front of the buffer */ |
720 | mac_data->entries = dev->uc_count; | 724 | mac_data->entries = dev->uc_count; |
721 | addr = dev->uc_list; | 725 | addr = dev->uc_list; |
@@ -744,24 +748,24 @@ static void virtnet_set_rx_mode(struct net_device *dev) | |||
744 | kfree(buf); | 748 | kfree(buf); |
745 | } | 749 | } |
746 | 750 | ||
747 | static void virnet_vlan_rx_add_vid(struct net_device *dev, u16 vid) | 751 | static void virtnet_vlan_rx_add_vid(struct net_device *dev, u16 vid) |
748 | { | 752 | { |
749 | struct virtnet_info *vi = netdev_priv(dev); | 753 | struct virtnet_info *vi = netdev_priv(dev); |
750 | struct scatterlist sg; | 754 | struct scatterlist sg; |
751 | 755 | ||
752 | sg_set_buf(&sg, &vid, sizeof(vid)); | 756 | sg_init_one(&sg, &vid, sizeof(vid)); |
753 | 757 | ||
754 | if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_VLAN, | 758 | if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_VLAN, |
755 | VIRTIO_NET_CTRL_VLAN_ADD, &sg, 1, 0)) | 759 | VIRTIO_NET_CTRL_VLAN_ADD, &sg, 1, 0)) |
756 | dev_warn(&dev->dev, "Failed to add VLAN ID %d.\n", vid); | 760 | dev_warn(&dev->dev, "Failed to add VLAN ID %d.\n", vid); |
757 | } | 761 | } |
758 | 762 | ||
759 | static void virnet_vlan_rx_kill_vid(struct net_device *dev, u16 vid) | 763 | static void virtnet_vlan_rx_kill_vid(struct net_device *dev, u16 vid) |
760 | { | 764 | { |
761 | struct virtnet_info *vi = netdev_priv(dev); | 765 | struct virtnet_info *vi = netdev_priv(dev); |
762 | struct scatterlist sg; | 766 | struct scatterlist sg; |
763 | 767 | ||
764 | sg_set_buf(&sg, &vid, sizeof(vid)); | 768 | sg_init_one(&sg, &vid, sizeof(vid)); |
765 | 769 | ||
766 | if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_VLAN, | 770 | if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_VLAN, |
767 | VIRTIO_NET_CTRL_VLAN_DEL, &sg, 1, 0)) | 771 | VIRTIO_NET_CTRL_VLAN_DEL, &sg, 1, 0)) |
@@ -794,8 +798,8 @@ static const struct net_device_ops virtnet_netdev = { | |||
794 | .ndo_set_mac_address = virtnet_set_mac_address, | 798 | .ndo_set_mac_address = virtnet_set_mac_address, |
795 | .ndo_set_rx_mode = virtnet_set_rx_mode, | 799 | .ndo_set_rx_mode = virtnet_set_rx_mode, |
796 | .ndo_change_mtu = virtnet_change_mtu, | 800 | .ndo_change_mtu = virtnet_change_mtu, |
797 | .ndo_vlan_rx_add_vid = virnet_vlan_rx_add_vid, | 801 | .ndo_vlan_rx_add_vid = virtnet_vlan_rx_add_vid, |
798 | .ndo_vlan_rx_kill_vid = virnet_vlan_rx_kill_vid, | 802 | .ndo_vlan_rx_kill_vid = virtnet_vlan_rx_kill_vid, |
799 | #ifdef CONFIG_NET_POLL_CONTROLLER | 803 | #ifdef CONFIG_NET_POLL_CONTROLLER |
800 | .ndo_poll_controller = virtnet_netpoll, | 804 | .ndo_poll_controller = virtnet_netpoll, |
801 | #endif | 805 | #endif |
diff --git a/drivers/net/wireless/ath5k/debug.c b/drivers/net/wireless/ath5k/debug.c index 9770bb3d40f9..4904a07e4b59 100644 --- a/drivers/net/wireless/ath5k/debug.c +++ b/drivers/net/wireless/ath5k/debug.c | |||
@@ -424,7 +424,7 @@ ath5k_debug_dump_bands(struct ath5k_softc *sc) | |||
424 | 424 | ||
425 | for (b = 0; b < IEEE80211_NUM_BANDS; b++) { | 425 | for (b = 0; b < IEEE80211_NUM_BANDS; b++) { |
426 | struct ieee80211_supported_band *band = &sc->sbands[b]; | 426 | struct ieee80211_supported_band *band = &sc->sbands[b]; |
427 | char bname[5]; | 427 | char bname[6]; |
428 | switch (band->band) { | 428 | switch (band->band) { |
429 | case IEEE80211_BAND_2GHZ: | 429 | case IEEE80211_BAND_2GHZ: |
430 | strcpy(bname, "2 GHz"); | 430 | strcpy(bname, "2 GHz"); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index 23644cf884f1..e7c65c4f741b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
@@ -925,11 +925,11 @@ void iwl_bg_scan_completed(struct work_struct *work) | |||
925 | 925 | ||
926 | IWL_DEBUG_SCAN(priv, "SCAN complete scan\n"); | 926 | IWL_DEBUG_SCAN(priv, "SCAN complete scan\n"); |
927 | 927 | ||
928 | ieee80211_scan_completed(priv->hw, false); | ||
929 | |||
928 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 930 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |
929 | return; | 931 | return; |
930 | 932 | ||
931 | ieee80211_scan_completed(priv->hw, false); | ||
932 | |||
933 | /* Since setting the TXPOWER may have been deferred while | 933 | /* Since setting the TXPOWER may have been deferred while |
934 | * performing the scan, fire one off */ | 934 | * performing the scan, fire one off */ |
935 | mutex_lock(&priv->mutex); | 935 | mutex_lock(&priv->mutex); |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 617c4235d971..70a00c8ee42e 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -1694,7 +1694,6 @@ void iwl3945_rx_queue_reset(struct iwl_priv *priv, struct iwl_rx_queue *rxq) | |||
1694 | rxq->free_count = 0; | 1694 | rxq->free_count = 0; |
1695 | spin_unlock_irqrestore(&rxq->lock, flags); | 1695 | spin_unlock_irqrestore(&rxq->lock, flags); |
1696 | } | 1696 | } |
1697 | EXPORT_SYMBOL(iwl3945_rx_queue_reset); | ||
1698 | 1697 | ||
1699 | /* | 1698 | /* |
1700 | * this should be called while priv->lock is locked | 1699 | * this should be called while priv->lock is locked |
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index db91db776508..bebf735cd4bd 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
@@ -2558,6 +2558,11 @@ static int rndis_wext_bind(struct usbnet *usbdev, struct usb_interface *intf) | |||
2558 | mutex_init(&priv->command_lock); | 2558 | mutex_init(&priv->command_lock); |
2559 | spin_lock_init(&priv->stats_lock); | 2559 | spin_lock_init(&priv->stats_lock); |
2560 | 2560 | ||
2561 | /* because rndis_command() sleeps we need to use workqueue */ | ||
2562 | priv->workqueue = create_singlethread_workqueue("rndis_wlan"); | ||
2563 | INIT_WORK(&priv->work, rndis_wext_worker); | ||
2564 | INIT_DELAYED_WORK(&priv->stats_work, rndis_update_wireless_stats); | ||
2565 | |||
2561 | /* try bind rndis_host */ | 2566 | /* try bind rndis_host */ |
2562 | retval = generic_rndis_bind(usbdev, intf, FLAG_RNDIS_PHYM_WIRELESS); | 2567 | retval = generic_rndis_bind(usbdev, intf, FLAG_RNDIS_PHYM_WIRELESS); |
2563 | if (retval < 0) | 2568 | if (retval < 0) |
@@ -2603,16 +2608,17 @@ static int rndis_wext_bind(struct usbnet *usbdev, struct usb_interface *intf) | |||
2603 | disassociate(usbdev, 1); | 2608 | disassociate(usbdev, 1); |
2604 | netif_carrier_off(usbdev->net); | 2609 | netif_carrier_off(usbdev->net); |
2605 | 2610 | ||
2606 | /* because rndis_command() sleeps we need to use workqueue */ | ||
2607 | priv->workqueue = create_singlethread_workqueue("rndis_wlan"); | ||
2608 | INIT_DELAYED_WORK(&priv->stats_work, rndis_update_wireless_stats); | ||
2609 | queue_delayed_work(priv->workqueue, &priv->stats_work, | 2611 | queue_delayed_work(priv->workqueue, &priv->stats_work, |
2610 | round_jiffies_relative(STATS_UPDATE_JIFFIES)); | 2612 | round_jiffies_relative(STATS_UPDATE_JIFFIES)); |
2611 | INIT_WORK(&priv->work, rndis_wext_worker); | ||
2612 | 2613 | ||
2613 | return 0; | 2614 | return 0; |
2614 | 2615 | ||
2615 | fail: | 2616 | fail: |
2617 | cancel_delayed_work_sync(&priv->stats_work); | ||
2618 | cancel_work_sync(&priv->work); | ||
2619 | flush_workqueue(priv->workqueue); | ||
2620 | destroy_workqueue(priv->workqueue); | ||
2621 | |||
2616 | kfree(priv); | 2622 | kfree(priv); |
2617 | return retval; | 2623 | return retval; |
2618 | } | 2624 | } |
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 5a97bcfe03e5..ec7e27d00bc6 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -517,10 +517,10 @@ static int nfs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
517 | 517 | ||
518 | ret = nfs_updatepage(filp, page, 0, pagelen); | 518 | ret = nfs_updatepage(filp, page, 0, pagelen); |
519 | out_unlock: | 519 | out_unlock: |
520 | if (!ret) | ||
521 | return VM_FAULT_LOCKED; | ||
520 | unlock_page(page); | 522 | unlock_page(page); |
521 | if (ret) | 523 | return VM_FAULT_SIGBUS; |
522 | ret = VM_FAULT_SIGBUS; | ||
523 | return ret; | ||
524 | } | 524 | } |
525 | 525 | ||
526 | static struct vm_operations_struct nfs_file_vm_ops = { | 526 | static struct vm_operations_struct nfs_file_vm_ops = { |
diff --git a/fs/proc/array.c b/fs/proc/array.c index 7e4877d9dcb5..725a650bbbb8 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c | |||
@@ -80,6 +80,7 @@ | |||
80 | #include <linux/delayacct.h> | 80 | #include <linux/delayacct.h> |
81 | #include <linux/seq_file.h> | 81 | #include <linux/seq_file.h> |
82 | #include <linux/pid_namespace.h> | 82 | #include <linux/pid_namespace.h> |
83 | #include <linux/ptrace.h> | ||
83 | #include <linux/tracehook.h> | 84 | #include <linux/tracehook.h> |
84 | 85 | ||
85 | #include <asm/pgtable.h> | 86 | #include <asm/pgtable.h> |
@@ -352,6 +353,7 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, | |||
352 | char state; | 353 | char state; |
353 | pid_t ppid = 0, pgid = -1, sid = -1; | 354 | pid_t ppid = 0, pgid = -1, sid = -1; |
354 | int num_threads = 0; | 355 | int num_threads = 0; |
356 | int permitted; | ||
355 | struct mm_struct *mm; | 357 | struct mm_struct *mm; |
356 | unsigned long long start_time; | 358 | unsigned long long start_time; |
357 | unsigned long cmin_flt = 0, cmaj_flt = 0; | 359 | unsigned long cmin_flt = 0, cmaj_flt = 0; |
@@ -364,11 +366,14 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, | |||
364 | 366 | ||
365 | state = *get_task_state(task); | 367 | state = *get_task_state(task); |
366 | vsize = eip = esp = 0; | 368 | vsize = eip = esp = 0; |
369 | permitted = ptrace_may_access(task, PTRACE_MODE_READ); | ||
367 | mm = get_task_mm(task); | 370 | mm = get_task_mm(task); |
368 | if (mm) { | 371 | if (mm) { |
369 | vsize = task_vsize(mm); | 372 | vsize = task_vsize(mm); |
370 | eip = KSTK_EIP(task); | 373 | if (permitted) { |
371 | esp = KSTK_ESP(task); | 374 | eip = KSTK_EIP(task); |
375 | esp = KSTK_ESP(task); | ||
376 | } | ||
372 | } | 377 | } |
373 | 378 | ||
374 | get_task_comm(tcomm, task); | 379 | get_task_comm(tcomm, task); |
@@ -424,7 +429,7 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, | |||
424 | unlock_task_sighand(task, &flags); | 429 | unlock_task_sighand(task, &flags); |
425 | } | 430 | } |
426 | 431 | ||
427 | if (!whole || num_threads < 2) | 432 | if (permitted && (!whole || num_threads < 2)) |
428 | wchan = get_wchan(task); | 433 | wchan = get_wchan(task); |
429 | if (!whole) { | 434 | if (!whole) { |
430 | min_flt = task->min_flt; | 435 | min_flt = task->min_flt; |
@@ -476,7 +481,7 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, | |||
476 | rsslim, | 481 | rsslim, |
477 | mm ? mm->start_code : 0, | 482 | mm ? mm->start_code : 0, |
478 | mm ? mm->end_code : 0, | 483 | mm ? mm->end_code : 0, |
479 | mm ? mm->start_stack : 0, | 484 | (permitted && mm) ? mm->start_stack : 0, |
480 | esp, | 485 | esp, |
481 | eip, | 486 | eip, |
482 | /* The signal information here is obsolete. | 487 | /* The signal information here is obsolete. |
diff --git a/fs/proc/base.c b/fs/proc/base.c index aa763ab00777..fb45615943c2 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -322,7 +322,10 @@ static int proc_pid_wchan(struct task_struct *task, char *buffer) | |||
322 | wchan = get_wchan(task); | 322 | wchan = get_wchan(task); |
323 | 323 | ||
324 | if (lookup_symbol_name(wchan, symname) < 0) | 324 | if (lookup_symbol_name(wchan, symname) < 0) |
325 | return sprintf(buffer, "%lu", wchan); | 325 | if (!ptrace_may_access(task, PTRACE_MODE_READ)) |
326 | return 0; | ||
327 | else | ||
328 | return sprintf(buffer, "%lu", wchan); | ||
326 | else | 329 | else |
327 | return sprintf(buffer, "%s", symname); | 330 | return sprintf(buffer, "%s", symname); |
328 | } | 331 | } |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 1b2e43502ef7..c9efe039dc57 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -472,7 +472,7 @@ static inline void xt_info_rdlock_bh(void) | |||
472 | 472 | ||
473 | local_bh_disable(); | 473 | local_bh_disable(); |
474 | lock = &__get_cpu_var(xt_info_locks); | 474 | lock = &__get_cpu_var(xt_info_locks); |
475 | if (!lock->readers++) | 475 | if (likely(!lock->readers++)) |
476 | spin_lock(&lock->lock); | 476 | spin_lock(&lock->lock); |
477 | } | 477 | } |
478 | 478 | ||
@@ -480,7 +480,7 @@ static inline void xt_info_rdunlock_bh(void) | |||
480 | { | 480 | { |
481 | struct xt_info_lock *lock = &__get_cpu_var(xt_info_locks); | 481 | struct xt_info_lock *lock = &__get_cpu_var(xt_info_locks); |
482 | 482 | ||
483 | if (!--lock->readers) | 483 | if (likely(!--lock->readers)) |
484 | spin_unlock(&lock->lock); | 484 | spin_unlock(&lock->lock); |
485 | local_bh_enable(); | 485 | local_bh_enable(); |
486 | } | 486 | } |
diff --git a/include/linux/usb/cdc.h b/include/linux/usb/cdc.h index 3c86ed25a04c..c24124a42ce5 100644 --- a/include/linux/usb/cdc.h +++ b/include/linux/usb/cdc.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #define USB_CDC_SUBCLASS_DMM 0x09 | 17 | #define USB_CDC_SUBCLASS_DMM 0x09 |
18 | #define USB_CDC_SUBCLASS_MDLM 0x0a | 18 | #define USB_CDC_SUBCLASS_MDLM 0x0a |
19 | #define USB_CDC_SUBCLASS_OBEX 0x0b | 19 | #define USB_CDC_SUBCLASS_OBEX 0x0b |
20 | #define USB_CDC_SUBCLASS_EEM 0x0c | ||
20 | 21 | ||
21 | #define USB_CDC_PROTO_NONE 0 | 22 | #define USB_CDC_PROTO_NONE 0 |
22 | 23 | ||
@@ -28,6 +29,8 @@ | |||
28 | #define USB_CDC_ACM_PROTO_AT_CDMA 6 | 29 | #define USB_CDC_ACM_PROTO_AT_CDMA 6 |
29 | #define USB_CDC_ACM_PROTO_VENDOR 0xff | 30 | #define USB_CDC_ACM_PROTO_VENDOR 0xff |
30 | 31 | ||
32 | #define USB_CDC_PROTO_EEM 7 | ||
33 | |||
31 | /*-------------------------------------------------------------------------*/ | 34 | /*-------------------------------------------------------------------------*/ |
32 | 35 | ||
33 | /* | 36 | /* |
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index 242348bb3766..cec79adbe3ea 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * compatible drivers/servers. */ | 4 | * compatible drivers/servers. */ |
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | #include <linux/virtio_config.h> | 6 | #include <linux/virtio_config.h> |
7 | #include <linux/if_ether.h> | ||
7 | 8 | ||
8 | /* The ID for virtio_net */ | 9 | /* The ID for virtio_net */ |
9 | #define VIRTIO_ID_NET 1 | 10 | #define VIRTIO_ID_NET 1 |
diff --git a/include/net/9p/client.h b/include/net/9p/client.h index 4012e07162e5..e26812274b75 100644 --- a/include/net/9p/client.h +++ b/include/net/9p/client.h | |||
@@ -98,7 +98,6 @@ enum p9_req_status_t { | |||
98 | struct p9_req_t { | 98 | struct p9_req_t { |
99 | int status; | 99 | int status; |
100 | int t_err; | 100 | int t_err; |
101 | u16 flush_tag; | ||
102 | wait_queue_head_t *wq; | 101 | wait_queue_head_t *wq; |
103 | struct p9_fcall *tc; | 102 | struct p9_fcall *tc; |
104 | struct p9_fcall *rc; | 103 | struct p9_fcall *rc; |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index be5bd713d2c9..73aead222b32 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -457,6 +457,7 @@ int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count); | |||
457 | 457 | ||
458 | int hci_register_sysfs(struct hci_dev *hdev); | 458 | int hci_register_sysfs(struct hci_dev *hdev); |
459 | void hci_unregister_sysfs(struct hci_dev *hdev); | 459 | void hci_unregister_sysfs(struct hci_dev *hdev); |
460 | void hci_conn_init_sysfs(struct hci_conn *conn); | ||
460 | void hci_conn_add_sysfs(struct hci_conn *conn); | 461 | void hci_conn_add_sysfs(struct hci_conn *conn); |
461 | void hci_conn_del_sysfs(struct hci_conn *conn); | 462 | void hci_conn_del_sysfs(struct hci_conn *conn); |
462 | 463 | ||
diff --git a/include/net/tcp.h b/include/net/tcp.h index 1b94b9bfe2dc..646dbe3962ea 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <net/ip.h> | 41 | #include <net/ip.h> |
42 | #include <net/tcp_states.h> | 42 | #include <net/tcp_states.h> |
43 | #include <net/inet_ecn.h> | 43 | #include <net/inet_ecn.h> |
44 | #include <net/dst.h> | ||
44 | 45 | ||
45 | #include <linux/seq_file.h> | 46 | #include <linux/seq_file.h> |
46 | 47 | ||
@@ -530,6 +531,17 @@ static inline void tcp_fast_path_check(struct sock *sk) | |||
530 | tcp_fast_path_on(tp); | 531 | tcp_fast_path_on(tp); |
531 | } | 532 | } |
532 | 533 | ||
534 | /* Compute the actual rto_min value */ | ||
535 | static inline u32 tcp_rto_min(struct sock *sk) | ||
536 | { | ||
537 | struct dst_entry *dst = __sk_dst_get(sk); | ||
538 | u32 rto_min = TCP_RTO_MIN; | ||
539 | |||
540 | if (dst && dst_metric_locked(dst, RTAX_RTO_MIN)) | ||
541 | rto_min = dst_metric_rtt(dst, RTAX_RTO_MIN); | ||
542 | return rto_min; | ||
543 | } | ||
544 | |||
533 | /* Compute the actual receive window we are currently advertising. | 545 | /* Compute the actual receive window we are currently advertising. |
534 | * Rcv_nxt can be after the window if our peer push more data | 546 | * Rcv_nxt can be after the window if our peer push more data |
535 | * than the offered window. | 547 | * than the offered window. |
@@ -895,7 +907,7 @@ static inline int tcp_prequeue(struct sock *sk, struct sk_buff *skb) | |||
895 | wake_up_interruptible(sk->sk_sleep); | 907 | wake_up_interruptible(sk->sk_sleep); |
896 | if (!inet_csk_ack_scheduled(sk)) | 908 | if (!inet_csk_ack_scheduled(sk)) |
897 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK, | 909 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK, |
898 | (3 * TCP_RTO_MIN) / 4, | 910 | (3 * tcp_rto_min(sk)) / 4, |
899 | TCP_RTO_MAX); | 911 | TCP_RTO_MAX); |
900 | } | 912 | } |
901 | return 1; | 913 | return 1; |
diff --git a/net/9p/client.c b/net/9p/client.c index 1eb580c38fbb..dd43a8289b0d 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -203,7 +203,6 @@ static struct p9_req_t *p9_tag_alloc(struct p9_client *c, u16 tag) | |||
203 | p9pdu_reset(req->tc); | 203 | p9pdu_reset(req->tc); |
204 | p9pdu_reset(req->rc); | 204 | p9pdu_reset(req->rc); |
205 | 205 | ||
206 | req->flush_tag = 0; | ||
207 | req->tc->tag = tag-1; | 206 | req->tc->tag = tag-1; |
208 | req->status = REQ_STATUS_ALLOC; | 207 | req->status = REQ_STATUS_ALLOC; |
209 | 208 | ||
@@ -324,35 +323,9 @@ static void p9_free_req(struct p9_client *c, struct p9_req_t *r) | |||
324 | */ | 323 | */ |
325 | void p9_client_cb(struct p9_client *c, struct p9_req_t *req) | 324 | void p9_client_cb(struct p9_client *c, struct p9_req_t *req) |
326 | { | 325 | { |
327 | struct p9_req_t *other_req; | ||
328 | unsigned long flags; | ||
329 | |||
330 | P9_DPRINTK(P9_DEBUG_MUX, " tag %d\n", req->tc->tag); | 326 | P9_DPRINTK(P9_DEBUG_MUX, " tag %d\n", req->tc->tag); |
331 | 327 | wake_up(req->wq); | |
332 | if (req->status == REQ_STATUS_ERROR) | 328 | P9_DPRINTK(P9_DEBUG_MUX, "wakeup: %d\n", req->tc->tag); |
333 | wake_up(req->wq); | ||
334 | |||
335 | if (req->flush_tag) { /* flush receive path */ | ||
336 | P9_DPRINTK(P9_DEBUG_9P, "<<< RFLUSH %d\n", req->tc->tag); | ||
337 | spin_lock_irqsave(&c->lock, flags); | ||
338 | other_req = p9_tag_lookup(c, req->flush_tag); | ||
339 | if (other_req->status != REQ_STATUS_FLSH) /* stale flush */ | ||
340 | spin_unlock_irqrestore(&c->lock, flags); | ||
341 | else { | ||
342 | other_req->status = REQ_STATUS_FLSHD; | ||
343 | spin_unlock_irqrestore(&c->lock, flags); | ||
344 | wake_up(other_req->wq); | ||
345 | } | ||
346 | p9_free_req(c, req); | ||
347 | } else { /* normal receive path */ | ||
348 | P9_DPRINTK(P9_DEBUG_MUX, "normal: tag %d\n", req->tc->tag); | ||
349 | spin_lock_irqsave(&c->lock, flags); | ||
350 | if (req->status != REQ_STATUS_FLSHD) | ||
351 | req->status = REQ_STATUS_RCVD; | ||
352 | spin_unlock_irqrestore(&c->lock, flags); | ||
353 | wake_up(req->wq); | ||
354 | P9_DPRINTK(P9_DEBUG_MUX, "wakeup: %d\n", req->tc->tag); | ||
355 | } | ||
356 | } | 329 | } |
357 | EXPORT_SYMBOL(p9_client_cb); | 330 | EXPORT_SYMBOL(p9_client_cb); |
358 | 331 | ||
@@ -486,9 +459,15 @@ static int p9_client_flush(struct p9_client *c, struct p9_req_t *oldreq) | |||
486 | if (IS_ERR(req)) | 459 | if (IS_ERR(req)) |
487 | return PTR_ERR(req); | 460 | return PTR_ERR(req); |
488 | 461 | ||
489 | req->flush_tag = oldtag; | ||
490 | 462 | ||
491 | /* we don't free anything here because RPC isn't complete */ | 463 | /* if we haven't received a response for oldreq, |
464 | remove it from the list. */ | ||
465 | spin_lock(&c->lock); | ||
466 | if (oldreq->status == REQ_STATUS_FLSH) | ||
467 | list_del(&oldreq->req_list); | ||
468 | spin_unlock(&c->lock); | ||
469 | |||
470 | p9_free_req(c, req); | ||
492 | return 0; | 471 | return 0; |
493 | } | 472 | } |
494 | 473 | ||
@@ -509,7 +488,6 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...) | |||
509 | struct p9_req_t *req; | 488 | struct p9_req_t *req; |
510 | unsigned long flags; | 489 | unsigned long flags; |
511 | int sigpending; | 490 | int sigpending; |
512 | int flushed = 0; | ||
513 | 491 | ||
514 | P9_DPRINTK(P9_DEBUG_MUX, "client %p op %d\n", c, type); | 492 | P9_DPRINTK(P9_DEBUG_MUX, "client %p op %d\n", c, type); |
515 | 493 | ||
@@ -546,42 +524,28 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...) | |||
546 | goto reterr; | 524 | goto reterr; |
547 | } | 525 | } |
548 | 526 | ||
549 | /* if it was a flush we just transmitted, return our tag */ | ||
550 | if (type == P9_TFLUSH) | ||
551 | return req; | ||
552 | again: | ||
553 | P9_DPRINTK(P9_DEBUG_MUX, "wait %p tag: %d\n", req->wq, tag); | 527 | P9_DPRINTK(P9_DEBUG_MUX, "wait %p tag: %d\n", req->wq, tag); |
554 | err = wait_event_interruptible(*req->wq, | 528 | err = wait_event_interruptible(*req->wq, |
555 | req->status >= REQ_STATUS_RCVD); | 529 | req->status >= REQ_STATUS_RCVD); |
556 | P9_DPRINTK(P9_DEBUG_MUX, "wait %p tag: %d returned %d (flushed=%d)\n", | 530 | P9_DPRINTK(P9_DEBUG_MUX, "wait %p tag: %d returned %d\n", |
557 | req->wq, tag, err, flushed); | 531 | req->wq, tag, err); |
558 | 532 | ||
559 | if (req->status == REQ_STATUS_ERROR) { | 533 | if (req->status == REQ_STATUS_ERROR) { |
560 | P9_DPRINTK(P9_DEBUG_ERROR, "req_status error %d\n", req->t_err); | 534 | P9_DPRINTK(P9_DEBUG_ERROR, "req_status error %d\n", req->t_err); |
561 | err = req->t_err; | 535 | err = req->t_err; |
562 | } else if (err == -ERESTARTSYS && flushed) { | ||
563 | P9_DPRINTK(P9_DEBUG_MUX, "flushed - going again\n"); | ||
564 | goto again; | ||
565 | } else if (req->status == REQ_STATUS_FLSHD) { | ||
566 | P9_DPRINTK(P9_DEBUG_MUX, "flushed - erestartsys\n"); | ||
567 | err = -ERESTARTSYS; | ||
568 | } | 536 | } |
569 | 537 | ||
570 | if ((err == -ERESTARTSYS) && (c->status == Connected) && (!flushed)) { | 538 | if ((err == -ERESTARTSYS) && (c->status == Connected)) { |
571 | P9_DPRINTK(P9_DEBUG_MUX, "flushing\n"); | 539 | P9_DPRINTK(P9_DEBUG_MUX, "flushing\n"); |
572 | spin_lock_irqsave(&c->lock, flags); | ||
573 | if (req->status == REQ_STATUS_SENT) | ||
574 | req->status = REQ_STATUS_FLSH; | ||
575 | spin_unlock_irqrestore(&c->lock, flags); | ||
576 | sigpending = 1; | 540 | sigpending = 1; |
577 | flushed = 1; | ||
578 | clear_thread_flag(TIF_SIGPENDING); | 541 | clear_thread_flag(TIF_SIGPENDING); |
579 | 542 | ||
580 | if (c->trans_mod->cancel(c, req)) { | 543 | if (c->trans_mod->cancel(c, req)) |
581 | err = p9_client_flush(c, req); | 544 | p9_client_flush(c, req); |
582 | if (err == 0) | 545 | |
583 | goto again; | 546 | /* if we received the response anyway, don't signal error */ |
584 | } | 547 | if (req->status == REQ_STATUS_RCVD) |
548 | err = 0; | ||
585 | } | 549 | } |
586 | 550 | ||
587 | if (sigpending) { | 551 | if (sigpending) { |
@@ -1244,19 +1208,53 @@ struct p9_wstat *p9_client_stat(struct p9_fid *fid) | |||
1244 | ret->name, ret->uid, ret->gid, ret->muid, ret->extension, | 1208 | ret->name, ret->uid, ret->gid, ret->muid, ret->extension, |
1245 | ret->n_uid, ret->n_gid, ret->n_muid); | 1209 | ret->n_uid, ret->n_gid, ret->n_muid); |
1246 | 1210 | ||
1211 | p9_free_req(clnt, req); | ||
1212 | return ret; | ||
1213 | |||
1247 | free_and_error: | 1214 | free_and_error: |
1248 | p9_free_req(clnt, req); | 1215 | p9_free_req(clnt, req); |
1249 | error: | 1216 | error: |
1250 | return ret; | 1217 | kfree(ret); |
1218 | return ERR_PTR(err); | ||
1251 | } | 1219 | } |
1252 | EXPORT_SYMBOL(p9_client_stat); | 1220 | EXPORT_SYMBOL(p9_client_stat); |
1253 | 1221 | ||
1222 | static int p9_client_statsize(struct p9_wstat *wst, int optional) | ||
1223 | { | ||
1224 | int ret; | ||
1225 | |||
1226 | /* size[2] type[2] dev[4] qid[13] */ | ||
1227 | /* mode[4] atime[4] mtime[4] length[8]*/ | ||
1228 | /* name[s] uid[s] gid[s] muid[s] */ | ||
1229 | ret = 2+2+4+13+4+4+4+8+2+2+2+2; | ||
1230 | |||
1231 | if (wst->name) | ||
1232 | ret += strlen(wst->name); | ||
1233 | if (wst->uid) | ||
1234 | ret += strlen(wst->uid); | ||
1235 | if (wst->gid) | ||
1236 | ret += strlen(wst->gid); | ||
1237 | if (wst->muid) | ||
1238 | ret += strlen(wst->muid); | ||
1239 | |||
1240 | if (optional) { | ||
1241 | ret += 2+4+4+4; /* extension[s] n_uid[4] n_gid[4] n_muid[4] */ | ||
1242 | if (wst->extension) | ||
1243 | ret += strlen(wst->extension); | ||
1244 | } | ||
1245 | |||
1246 | return ret; | ||
1247 | } | ||
1248 | |||
1254 | int p9_client_wstat(struct p9_fid *fid, struct p9_wstat *wst) | 1249 | int p9_client_wstat(struct p9_fid *fid, struct p9_wstat *wst) |
1255 | { | 1250 | { |
1256 | int err; | 1251 | int err; |
1257 | struct p9_req_t *req; | 1252 | struct p9_req_t *req; |
1258 | struct p9_client *clnt; | 1253 | struct p9_client *clnt; |
1259 | 1254 | ||
1255 | err = 0; | ||
1256 | clnt = fid->clnt; | ||
1257 | wst->size = p9_client_statsize(wst, clnt->dotu); | ||
1260 | P9_DPRINTK(P9_DEBUG_9P, ">>> TWSTAT fid %d\n", fid->fid); | 1258 | P9_DPRINTK(P9_DEBUG_9P, ">>> TWSTAT fid %d\n", fid->fid); |
1261 | P9_DPRINTK(P9_DEBUG_9P, | 1259 | P9_DPRINTK(P9_DEBUG_9P, |
1262 | " sz=%x type=%x dev=%x qid=%x.%llx.%x\n" | 1260 | " sz=%x type=%x dev=%x qid=%x.%llx.%x\n" |
@@ -1268,10 +1266,8 @@ int p9_client_wstat(struct p9_fid *fid, struct p9_wstat *wst) | |||
1268 | wst->atime, wst->mtime, (unsigned long long)wst->length, | 1266 | wst->atime, wst->mtime, (unsigned long long)wst->length, |
1269 | wst->name, wst->uid, wst->gid, wst->muid, wst->extension, | 1267 | wst->name, wst->uid, wst->gid, wst->muid, wst->extension, |
1270 | wst->n_uid, wst->n_gid, wst->n_muid); | 1268 | wst->n_uid, wst->n_gid, wst->n_muid); |
1271 | err = 0; | ||
1272 | clnt = fid->clnt; | ||
1273 | 1269 | ||
1274 | req = p9_client_rpc(clnt, P9_TWSTAT, "dwS", fid->fid, 0, wst); | 1270 | req = p9_client_rpc(clnt, P9_TWSTAT, "dwS", fid->fid, wst->size, wst); |
1275 | if (IS_ERR(req)) { | 1271 | if (IS_ERR(req)) { |
1276 | err = PTR_ERR(req); | 1272 | err = PTR_ERR(req); |
1277 | goto error; | 1273 | goto error; |
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index c613ed08a5ee..a2a1814c7a8d 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c | |||
@@ -213,8 +213,8 @@ static void p9_conn_cancel(struct p9_conn *m, int err) | |||
213 | spin_unlock_irqrestore(&m->client->lock, flags); | 213 | spin_unlock_irqrestore(&m->client->lock, flags); |
214 | 214 | ||
215 | list_for_each_entry_safe(req, rtmp, &cancel_list, req_list) { | 215 | list_for_each_entry_safe(req, rtmp, &cancel_list, req_list) { |
216 | list_del(&req->req_list); | ||
217 | P9_DPRINTK(P9_DEBUG_ERROR, "call back req %p\n", req); | 216 | P9_DPRINTK(P9_DEBUG_ERROR, "call back req %p\n", req); |
217 | list_del(&req->req_list); | ||
218 | p9_client_cb(m->client, req); | 218 | p9_client_cb(m->client, req); |
219 | } | 219 | } |
220 | } | 220 | } |
@@ -336,7 +336,8 @@ static void p9_read_work(struct work_struct *work) | |||
336 | "mux %p pkt: size: %d bytes tag: %d\n", m, n, tag); | 336 | "mux %p pkt: size: %d bytes tag: %d\n", m, n, tag); |
337 | 337 | ||
338 | m->req = p9_tag_lookup(m->client, tag); | 338 | m->req = p9_tag_lookup(m->client, tag); |
339 | if (!m->req) { | 339 | if (!m->req || (m->req->status != REQ_STATUS_SENT && |
340 | m->req->status != REQ_STATUS_FLSH)) { | ||
340 | P9_DPRINTK(P9_DEBUG_ERROR, "Unexpected packet tag %d\n", | 341 | P9_DPRINTK(P9_DEBUG_ERROR, "Unexpected packet tag %d\n", |
341 | tag); | 342 | tag); |
342 | err = -EIO; | 343 | err = -EIO; |
@@ -361,10 +362,11 @@ static void p9_read_work(struct work_struct *work) | |||
361 | if ((m->req) && (m->rpos == m->rsize)) { /* packet is read in */ | 362 | if ((m->req) && (m->rpos == m->rsize)) { /* packet is read in */ |
362 | P9_DPRINTK(P9_DEBUG_TRANS, "got new packet\n"); | 363 | P9_DPRINTK(P9_DEBUG_TRANS, "got new packet\n"); |
363 | spin_lock(&m->client->lock); | 364 | spin_lock(&m->client->lock); |
365 | if (m->req->status != REQ_STATUS_ERROR) | ||
366 | m->req->status = REQ_STATUS_RCVD; | ||
364 | list_del(&m->req->req_list); | 367 | list_del(&m->req->req_list); |
365 | spin_unlock(&m->client->lock); | 368 | spin_unlock(&m->client->lock); |
366 | p9_client_cb(m->client, m->req); | 369 | p9_client_cb(m->client, m->req); |
367 | |||
368 | m->rbuf = NULL; | 370 | m->rbuf = NULL; |
369 | m->rpos = 0; | 371 | m->rpos = 0; |
370 | m->rsize = 0; | 372 | m->rsize = 0; |
@@ -454,6 +456,7 @@ static void p9_write_work(struct work_struct *work) | |||
454 | req = list_entry(m->unsent_req_list.next, struct p9_req_t, | 456 | req = list_entry(m->unsent_req_list.next, struct p9_req_t, |
455 | req_list); | 457 | req_list); |
456 | req->status = REQ_STATUS_SENT; | 458 | req->status = REQ_STATUS_SENT; |
459 | P9_DPRINTK(P9_DEBUG_TRANS, "move req %p\n", req); | ||
457 | list_move_tail(&req->req_list, &m->req_list); | 460 | list_move_tail(&req->req_list, &m->req_list); |
458 | 461 | ||
459 | m->wbuf = req->tc->sdata; | 462 | m->wbuf = req->tc->sdata; |
@@ -683,12 +686,13 @@ static int p9_fd_cancel(struct p9_client *client, struct p9_req_t *req) | |||
683 | P9_DPRINTK(P9_DEBUG_TRANS, "client %p req %p\n", client, req); | 686 | P9_DPRINTK(P9_DEBUG_TRANS, "client %p req %p\n", client, req); |
684 | 687 | ||
685 | spin_lock(&client->lock); | 688 | spin_lock(&client->lock); |
686 | list_del(&req->req_list); | ||
687 | 689 | ||
688 | if (req->status == REQ_STATUS_UNSENT) { | 690 | if (req->status == REQ_STATUS_UNSENT) { |
691 | list_del(&req->req_list); | ||
689 | req->status = REQ_STATUS_FLSHD; | 692 | req->status = REQ_STATUS_FLSHD; |
690 | ret = 0; | 693 | ret = 0; |
691 | } | 694 | } else if (req->status == REQ_STATUS_SENT) |
695 | req->status = REQ_STATUS_FLSH; | ||
692 | 696 | ||
693 | spin_unlock(&client->lock); | 697 | spin_unlock(&client->lock); |
694 | 698 | ||
diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c index 7fa0eb20b2f6..ac4990041ebb 100644 --- a/net/9p/trans_rdma.c +++ b/net/9p/trans_rdma.c | |||
@@ -295,6 +295,7 @@ handle_recv(struct p9_client *client, struct p9_trans_rdma *rdma, | |||
295 | goto err_out; | 295 | goto err_out; |
296 | 296 | ||
297 | req->rc = c->rc; | 297 | req->rc = c->rc; |
298 | req->status = REQ_STATUS_RCVD; | ||
298 | p9_client_cb(client, req); | 299 | p9_client_cb(client, req); |
299 | 300 | ||
300 | return; | 301 | return; |
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index 2d7781ec663b..bb8579a141a8 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c | |||
@@ -134,6 +134,7 @@ static void req_done(struct virtqueue *vq) | |||
134 | P9_DPRINTK(P9_DEBUG_TRANS, ": rc %p\n", rc); | 134 | P9_DPRINTK(P9_DEBUG_TRANS, ": rc %p\n", rc); |
135 | P9_DPRINTK(P9_DEBUG_TRANS, ": lookup tag %d\n", rc->tag); | 135 | P9_DPRINTK(P9_DEBUG_TRANS, ": lookup tag %d\n", rc->tag); |
136 | req = p9_tag_lookup(chan->client, rc->tag); | 136 | req = p9_tag_lookup(chan->client, rc->tag); |
137 | req->status = REQ_STATUS_RCVD; | ||
137 | p9_client_cb(chan->client, req); | 138 | p9_client_cb(chan->client, req); |
138 | } | 139 | } |
139 | } | 140 | } |
diff --git a/net/atm/br2684.c b/net/atm/br2684.c index 334fcd4a4ea4..3100a8940afc 100644 --- a/net/atm/br2684.c +++ b/net/atm/br2684.c | |||
@@ -549,6 +549,7 @@ static void br2684_setup(struct net_device *netdev) | |||
549 | struct br2684_dev *brdev = BRPRIV(netdev); | 549 | struct br2684_dev *brdev = BRPRIV(netdev); |
550 | 550 | ||
551 | ether_setup(netdev); | 551 | ether_setup(netdev); |
552 | brdev->net_dev = netdev; | ||
552 | 553 | ||
553 | netdev->netdev_ops = &br2684_netdev_ops; | 554 | netdev->netdev_ops = &br2684_netdev_ops; |
554 | 555 | ||
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 375f4b4f7f79..61309b26f271 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -248,6 +248,8 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst) | |||
248 | if (hdev->notify) | 248 | if (hdev->notify) |
249 | hdev->notify(hdev, HCI_NOTIFY_CONN_ADD); | 249 | hdev->notify(hdev, HCI_NOTIFY_CONN_ADD); |
250 | 250 | ||
251 | hci_conn_init_sysfs(conn); | ||
252 | |||
251 | tasklet_enable(&hdev->tx_task); | 253 | tasklet_enable(&hdev->tx_task); |
252 | 254 | ||
253 | return conn; | 255 | return conn; |
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c index b7c51082ddeb..582d8877078c 100644 --- a/net/bluetooth/hci_sysfs.c +++ b/net/bluetooth/hci_sysfs.c | |||
@@ -9,7 +9,7 @@ | |||
9 | struct class *bt_class = NULL; | 9 | struct class *bt_class = NULL; |
10 | EXPORT_SYMBOL_GPL(bt_class); | 10 | EXPORT_SYMBOL_GPL(bt_class); |
11 | 11 | ||
12 | static struct workqueue_struct *bluetooth; | 12 | static struct workqueue_struct *bt_workq; |
13 | 13 | ||
14 | static inline char *link_typetostr(int type) | 14 | static inline char *link_typetostr(int type) |
15 | { | 15 | { |
@@ -89,8 +89,8 @@ static void add_conn(struct work_struct *work) | |||
89 | { | 89 | { |
90 | struct hci_conn *conn = container_of(work, struct hci_conn, work_add); | 90 | struct hci_conn *conn = container_of(work, struct hci_conn, work_add); |
91 | 91 | ||
92 | /* ensure previous add/del is complete */ | 92 | /* ensure previous del is complete */ |
93 | flush_workqueue(bluetooth); | 93 | flush_work(&conn->work_del); |
94 | 94 | ||
95 | if (device_add(&conn->dev) < 0) { | 95 | if (device_add(&conn->dev) < 0) { |
96 | BT_ERR("Failed to register connection device"); | 96 | BT_ERR("Failed to register connection device"); |
@@ -98,27 +98,6 @@ static void add_conn(struct work_struct *work) | |||
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | void hci_conn_add_sysfs(struct hci_conn *conn) | ||
102 | { | ||
103 | struct hci_dev *hdev = conn->hdev; | ||
104 | |||
105 | BT_DBG("conn %p", conn); | ||
106 | |||
107 | conn->dev.type = &bt_link; | ||
108 | conn->dev.class = bt_class; | ||
109 | conn->dev.parent = &hdev->dev; | ||
110 | |||
111 | dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle); | ||
112 | |||
113 | dev_set_drvdata(&conn->dev, conn); | ||
114 | |||
115 | device_initialize(&conn->dev); | ||
116 | |||
117 | INIT_WORK(&conn->work_add, add_conn); | ||
118 | |||
119 | queue_work(bluetooth, &conn->work_add); | ||
120 | } | ||
121 | |||
122 | /* | 101 | /* |
123 | * The rfcomm tty device will possibly retain even when conn | 102 | * The rfcomm tty device will possibly retain even when conn |
124 | * is down, and sysfs doesn't support move zombie device, | 103 | * is down, and sysfs doesn't support move zombie device, |
@@ -134,8 +113,11 @@ static void del_conn(struct work_struct *work) | |||
134 | struct hci_conn *conn = container_of(work, struct hci_conn, work_del); | 113 | struct hci_conn *conn = container_of(work, struct hci_conn, work_del); |
135 | struct hci_dev *hdev = conn->hdev; | 114 | struct hci_dev *hdev = conn->hdev; |
136 | 115 | ||
137 | /* ensure previous add/del is complete */ | 116 | /* ensure previous add is complete */ |
138 | flush_workqueue(bluetooth); | 117 | flush_work(&conn->work_add); |
118 | |||
119 | if (!device_is_registered(&conn->dev)) | ||
120 | return; | ||
139 | 121 | ||
140 | while (1) { | 122 | while (1) { |
141 | struct device *dev; | 123 | struct device *dev; |
@@ -152,16 +134,40 @@ static void del_conn(struct work_struct *work) | |||
152 | hci_dev_put(hdev); | 134 | hci_dev_put(hdev); |
153 | } | 135 | } |
154 | 136 | ||
155 | void hci_conn_del_sysfs(struct hci_conn *conn) | 137 | void hci_conn_init_sysfs(struct hci_conn *conn) |
156 | { | 138 | { |
139 | struct hci_dev *hdev = conn->hdev; | ||
140 | |||
157 | BT_DBG("conn %p", conn); | 141 | BT_DBG("conn %p", conn); |
158 | 142 | ||
159 | if (!device_is_registered(&conn->dev)) | 143 | conn->dev.type = &bt_link; |
160 | return; | 144 | conn->dev.class = bt_class; |
145 | conn->dev.parent = &hdev->dev; | ||
146 | |||
147 | dev_set_drvdata(&conn->dev, conn); | ||
161 | 148 | ||
149 | device_initialize(&conn->dev); | ||
150 | |||
151 | INIT_WORK(&conn->work_add, add_conn); | ||
162 | INIT_WORK(&conn->work_del, del_conn); | 152 | INIT_WORK(&conn->work_del, del_conn); |
153 | } | ||
154 | |||
155 | void hci_conn_add_sysfs(struct hci_conn *conn) | ||
156 | { | ||
157 | struct hci_dev *hdev = conn->hdev; | ||
158 | |||
159 | BT_DBG("conn %p", conn); | ||
160 | |||
161 | dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle); | ||
162 | |||
163 | queue_work(bt_workq, &conn->work_add); | ||
164 | } | ||
165 | |||
166 | void hci_conn_del_sysfs(struct hci_conn *conn) | ||
167 | { | ||
168 | BT_DBG("conn %p", conn); | ||
163 | 169 | ||
164 | queue_work(bluetooth, &conn->work_del); | 170 | queue_work(bt_workq, &conn->work_del); |
165 | } | 171 | } |
166 | 172 | ||
167 | static inline char *host_typetostr(int type) | 173 | static inline char *host_typetostr(int type) |
@@ -438,13 +444,13 @@ void hci_unregister_sysfs(struct hci_dev *hdev) | |||
438 | 444 | ||
439 | int __init bt_sysfs_init(void) | 445 | int __init bt_sysfs_init(void) |
440 | { | 446 | { |
441 | bluetooth = create_singlethread_workqueue("bluetooth"); | 447 | bt_workq = create_singlethread_workqueue("bluetooth"); |
442 | if (!bluetooth) | 448 | if (!bt_workq) |
443 | return -ENOMEM; | 449 | return -ENOMEM; |
444 | 450 | ||
445 | bt_class = class_create(THIS_MODULE, "bluetooth"); | 451 | bt_class = class_create(THIS_MODULE, "bluetooth"); |
446 | if (IS_ERR(bt_class)) { | 452 | if (IS_ERR(bt_class)) { |
447 | destroy_workqueue(bluetooth); | 453 | destroy_workqueue(bt_workq); |
448 | return PTR_ERR(bt_class); | 454 | return PTR_ERR(bt_class); |
449 | } | 455 | } |
450 | 456 | ||
@@ -453,7 +459,7 @@ int __init bt_sysfs_init(void) | |||
453 | 459 | ||
454 | void bt_sysfs_cleanup(void) | 460 | void bt_sysfs_cleanup(void) |
455 | { | 461 | { |
456 | destroy_workqueue(bluetooth); | 462 | destroy_workqueue(bt_workq); |
457 | 463 | ||
458 | class_destroy(bt_class); | 464 | class_destroy(bt_class); |
459 | } | 465 | } |
diff --git a/net/core/dev.c b/net/core/dev.c index 308a7d0c277f..e2e9e4af3ace 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1735,11 +1735,12 @@ u16 skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb) | |||
1735 | { | 1735 | { |
1736 | u32 hash; | 1736 | u32 hash; |
1737 | 1737 | ||
1738 | if (skb_rx_queue_recorded(skb)) { | 1738 | if (skb_rx_queue_recorded(skb)) |
1739 | hash = skb_get_rx_queue(skb); | 1739 | return skb_get_rx_queue(skb) % dev->real_num_tx_queues; |
1740 | } else if (skb->sk && skb->sk->sk_hash) { | 1740 | |
1741 | if (skb->sk && skb->sk->sk_hash) | ||
1741 | hash = skb->sk->sk_hash; | 1742 | hash = skb->sk->sk_hash; |
1742 | } else | 1743 | else |
1743 | hash = skb->protocol; | 1744 | hash = skb->protocol; |
1744 | 1745 | ||
1745 | hash = jhash_1word(hash, skb_tx_hashrnd); | 1746 | hash = jhash_1word(hash, skb_tx_hashrnd); |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index ce6356cd9f71..f091a5a845c1 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -1365,9 +1365,8 @@ static void sock_spd_release(struct splice_pipe_desc *spd, unsigned int i) | |||
1365 | 1365 | ||
1366 | static inline struct page *linear_to_page(struct page *page, unsigned int *len, | 1366 | static inline struct page *linear_to_page(struct page *page, unsigned int *len, |
1367 | unsigned int *offset, | 1367 | unsigned int *offset, |
1368 | struct sk_buff *skb) | 1368 | struct sk_buff *skb, struct sock *sk) |
1369 | { | 1369 | { |
1370 | struct sock *sk = skb->sk; | ||
1371 | struct page *p = sk->sk_sndmsg_page; | 1370 | struct page *p = sk->sk_sndmsg_page; |
1372 | unsigned int off; | 1371 | unsigned int off; |
1373 | 1372 | ||
@@ -1405,13 +1404,14 @@ new_page: | |||
1405 | */ | 1404 | */ |
1406 | static inline int spd_fill_page(struct splice_pipe_desc *spd, struct page *page, | 1405 | static inline int spd_fill_page(struct splice_pipe_desc *spd, struct page *page, |
1407 | unsigned int *len, unsigned int offset, | 1406 | unsigned int *len, unsigned int offset, |
1408 | struct sk_buff *skb, int linear) | 1407 | struct sk_buff *skb, int linear, |
1408 | struct sock *sk) | ||
1409 | { | 1409 | { |
1410 | if (unlikely(spd->nr_pages == PIPE_BUFFERS)) | 1410 | if (unlikely(spd->nr_pages == PIPE_BUFFERS)) |
1411 | return 1; | 1411 | return 1; |
1412 | 1412 | ||
1413 | if (linear) { | 1413 | if (linear) { |
1414 | page = linear_to_page(page, len, &offset, skb); | 1414 | page = linear_to_page(page, len, &offset, skb, sk); |
1415 | if (!page) | 1415 | if (!page) |
1416 | return 1; | 1416 | return 1; |
1417 | } else | 1417 | } else |
@@ -1442,7 +1442,8 @@ static inline void __segment_seek(struct page **page, unsigned int *poff, | |||
1442 | static inline int __splice_segment(struct page *page, unsigned int poff, | 1442 | static inline int __splice_segment(struct page *page, unsigned int poff, |
1443 | unsigned int plen, unsigned int *off, | 1443 | unsigned int plen, unsigned int *off, |
1444 | unsigned int *len, struct sk_buff *skb, | 1444 | unsigned int *len, struct sk_buff *skb, |
1445 | struct splice_pipe_desc *spd, int linear) | 1445 | struct splice_pipe_desc *spd, int linear, |
1446 | struct sock *sk) | ||
1446 | { | 1447 | { |
1447 | if (!*len) | 1448 | if (!*len) |
1448 | return 1; | 1449 | return 1; |
@@ -1465,7 +1466,7 @@ static inline int __splice_segment(struct page *page, unsigned int poff, | |||
1465 | /* the linear region may spread across several pages */ | 1466 | /* the linear region may spread across several pages */ |
1466 | flen = min_t(unsigned int, flen, PAGE_SIZE - poff); | 1467 | flen = min_t(unsigned int, flen, PAGE_SIZE - poff); |
1467 | 1468 | ||
1468 | if (spd_fill_page(spd, page, &flen, poff, skb, linear)) | 1469 | if (spd_fill_page(spd, page, &flen, poff, skb, linear, sk)) |
1469 | return 1; | 1470 | return 1; |
1470 | 1471 | ||
1471 | __segment_seek(&page, &poff, &plen, flen); | 1472 | __segment_seek(&page, &poff, &plen, flen); |
@@ -1481,8 +1482,8 @@ static inline int __splice_segment(struct page *page, unsigned int poff, | |||
1481 | * pipe is full or if we already spliced the requested length. | 1482 | * pipe is full or if we already spliced the requested length. |
1482 | */ | 1483 | */ |
1483 | static int __skb_splice_bits(struct sk_buff *skb, unsigned int *offset, | 1484 | static int __skb_splice_bits(struct sk_buff *skb, unsigned int *offset, |
1484 | unsigned int *len, | 1485 | unsigned int *len, struct splice_pipe_desc *spd, |
1485 | struct splice_pipe_desc *spd) | 1486 | struct sock *sk) |
1486 | { | 1487 | { |
1487 | int seg; | 1488 | int seg; |
1488 | 1489 | ||
@@ -1492,7 +1493,7 @@ static int __skb_splice_bits(struct sk_buff *skb, unsigned int *offset, | |||
1492 | if (__splice_segment(virt_to_page(skb->data), | 1493 | if (__splice_segment(virt_to_page(skb->data), |
1493 | (unsigned long) skb->data & (PAGE_SIZE - 1), | 1494 | (unsigned long) skb->data & (PAGE_SIZE - 1), |
1494 | skb_headlen(skb), | 1495 | skb_headlen(skb), |
1495 | offset, len, skb, spd, 1)) | 1496 | offset, len, skb, spd, 1, sk)) |
1496 | return 1; | 1497 | return 1; |
1497 | 1498 | ||
1498 | /* | 1499 | /* |
@@ -1502,7 +1503,7 @@ static int __skb_splice_bits(struct sk_buff *skb, unsigned int *offset, | |||
1502 | const skb_frag_t *f = &skb_shinfo(skb)->frags[seg]; | 1503 | const skb_frag_t *f = &skb_shinfo(skb)->frags[seg]; |
1503 | 1504 | ||
1504 | if (__splice_segment(f->page, f->page_offset, f->size, | 1505 | if (__splice_segment(f->page, f->page_offset, f->size, |
1505 | offset, len, skb, spd, 0)) | 1506 | offset, len, skb, spd, 0, sk)) |
1506 | return 1; | 1507 | return 1; |
1507 | } | 1508 | } |
1508 | 1509 | ||
@@ -1528,12 +1529,13 @@ int skb_splice_bits(struct sk_buff *skb, unsigned int offset, | |||
1528 | .ops = &sock_pipe_buf_ops, | 1529 | .ops = &sock_pipe_buf_ops, |
1529 | .spd_release = sock_spd_release, | 1530 | .spd_release = sock_spd_release, |
1530 | }; | 1531 | }; |
1532 | struct sock *sk = skb->sk; | ||
1531 | 1533 | ||
1532 | /* | 1534 | /* |
1533 | * __skb_splice_bits() only fails if the output has no room left, | 1535 | * __skb_splice_bits() only fails if the output has no room left, |
1534 | * so no point in going over the frag_list for the error case. | 1536 | * so no point in going over the frag_list for the error case. |
1535 | */ | 1537 | */ |
1536 | if (__skb_splice_bits(skb, &offset, &tlen, &spd)) | 1538 | if (__skb_splice_bits(skb, &offset, &tlen, &spd, sk)) |
1537 | goto done; | 1539 | goto done; |
1538 | else if (!tlen) | 1540 | else if (!tlen) |
1539 | goto done; | 1541 | goto done; |
@@ -1545,14 +1547,13 @@ int skb_splice_bits(struct sk_buff *skb, unsigned int offset, | |||
1545 | struct sk_buff *list = skb_shinfo(skb)->frag_list; | 1547 | struct sk_buff *list = skb_shinfo(skb)->frag_list; |
1546 | 1548 | ||
1547 | for (; list && tlen; list = list->next) { | 1549 | for (; list && tlen; list = list->next) { |
1548 | if (__skb_splice_bits(list, &offset, &tlen, &spd)) | 1550 | if (__skb_splice_bits(list, &offset, &tlen, &spd, sk)) |
1549 | break; | 1551 | break; |
1550 | } | 1552 | } |
1551 | } | 1553 | } |
1552 | 1554 | ||
1553 | done: | 1555 | done: |
1554 | if (spd.nr_pages) { | 1556 | if (spd.nr_pages) { |
1555 | struct sock *sk = skb->sk; | ||
1556 | int ret; | 1557 | int ret; |
1557 | 1558 | ||
1558 | /* | 1559 | /* |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index c96a6bb25430..eec3e6f9956c 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -597,16 +597,6 @@ static void tcp_event_data_recv(struct sock *sk, struct sk_buff *skb) | |||
597 | tcp_grow_window(sk, skb); | 597 | tcp_grow_window(sk, skb); |
598 | } | 598 | } |
599 | 599 | ||
600 | static u32 tcp_rto_min(struct sock *sk) | ||
601 | { | ||
602 | struct dst_entry *dst = __sk_dst_get(sk); | ||
603 | u32 rto_min = TCP_RTO_MIN; | ||
604 | |||
605 | if (dst && dst_metric_locked(dst, RTAX_RTO_MIN)) | ||
606 | rto_min = dst_metric_rtt(dst, RTAX_RTO_MIN); | ||
607 | return rto_min; | ||
608 | } | ||
609 | |||
610 | /* Called to compute a smoothed rtt estimate. The data fed to this | 600 | /* Called to compute a smoothed rtt estimate. The data fed to this |
611 | * routine either comes from timestamps, or from segments that were | 601 | * routine either comes from timestamps, or from segments that were |
612 | * known _not_ to have been retransmitted [see Karn/Partridge | 602 | * known _not_ to have been retransmitted [see Karn/Partridge |
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index fbcbed6cad01..14134193cd17 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -757,6 +757,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
757 | local->hw.conf.long_frame_max_tx_count = 4; | 757 | local->hw.conf.long_frame_max_tx_count = 4; |
758 | local->hw.conf.short_frame_max_tx_count = 7; | 758 | local->hw.conf.short_frame_max_tx_count = 7; |
759 | local->hw.conf.radio_enabled = true; | 759 | local->hw.conf.radio_enabled = true; |
760 | local->user_power_level = -1; | ||
760 | 761 | ||
761 | INIT_LIST_HEAD(&local->interfaces); | 762 | INIT_LIST_HEAD(&local->interfaces); |
762 | mutex_init(&local->iflist_mtx); | 763 | mutex_init(&local->iflist_mtx); |
@@ -909,6 +910,13 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
909 | if (result < 0) | 910 | if (result < 0) |
910 | goto fail_sta_info; | 911 | goto fail_sta_info; |
911 | 912 | ||
913 | result = ieee80211_wep_init(local); | ||
914 | if (result < 0) { | ||
915 | printk(KERN_DEBUG "%s: Failed to initialize wep: %d\n", | ||
916 | wiphy_name(local->hw.wiphy), result); | ||
917 | goto fail_wep; | ||
918 | } | ||
919 | |||
912 | rtnl_lock(); | 920 | rtnl_lock(); |
913 | result = dev_alloc_name(local->mdev, local->mdev->name); | 921 | result = dev_alloc_name(local->mdev, local->mdev->name); |
914 | if (result < 0) | 922 | if (result < 0) |
@@ -930,14 +938,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
930 | goto fail_rate; | 938 | goto fail_rate; |
931 | } | 939 | } |
932 | 940 | ||
933 | result = ieee80211_wep_init(local); | ||
934 | |||
935 | if (result < 0) { | ||
936 | printk(KERN_DEBUG "%s: Failed to initialize wep: %d\n", | ||
937 | wiphy_name(local->hw.wiphy), result); | ||
938 | goto fail_wep; | ||
939 | } | ||
940 | |||
941 | /* add one default STA interface if supported */ | 941 | /* add one default STA interface if supported */ |
942 | if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION)) { | 942 | if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION)) { |
943 | result = ieee80211_if_add(local, "wlan%d", NULL, | 943 | result = ieee80211_if_add(local, "wlan%d", NULL, |
@@ -967,13 +967,13 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
967 | 967 | ||
968 | return 0; | 968 | return 0; |
969 | 969 | ||
970 | fail_wep: | ||
971 | rate_control_deinitialize(local); | ||
972 | fail_rate: | 970 | fail_rate: |
973 | unregister_netdevice(local->mdev); | 971 | unregister_netdevice(local->mdev); |
974 | local->mdev = NULL; | 972 | local->mdev = NULL; |
975 | fail_dev: | 973 | fail_dev: |
976 | rtnl_unlock(); | 974 | rtnl_unlock(); |
975 | ieee80211_wep_free(local); | ||
976 | fail_wep: | ||
977 | sta_info_stop(local); | 977 | sta_info_stop(local); |
978 | fail_sta_info: | 978 | fail_sta_info: |
979 | debugfs_hw_del(local); | 979 | debugfs_hw_del(local); |
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig index 881203c4a142..cb3ad741ebf8 100644 --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig | |||
@@ -837,6 +837,7 @@ config NETFILTER_XT_MATCH_SOCKET | |||
837 | depends on NETFILTER_TPROXY | 837 | depends on NETFILTER_TPROXY |
838 | depends on NETFILTER_XTABLES | 838 | depends on NETFILTER_XTABLES |
839 | depends on NETFILTER_ADVANCED | 839 | depends on NETFILTER_ADVANCED |
840 | depends on !NF_CONNTRACK || NF_CONNTRACK | ||
840 | select NF_DEFRAG_IPV4 | 841 | select NF_DEFRAG_IPV4 |
841 | help | 842 | help |
842 | This option adds a `socket' match, which can be used to match | 843 | This option adds a `socket' match, which can be used to match |
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 173fcc4b050d..0759f32e9dca 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c | |||
@@ -254,7 +254,7 @@ replay: | |||
254 | } | 254 | } |
255 | tp->ops = tp_ops; | 255 | tp->ops = tp_ops; |
256 | tp->protocol = protocol; | 256 | tp->protocol = protocol; |
257 | tp->prio = nprio ? : tcf_auto_prio(*back); | 257 | tp->prio = nprio ? : TC_H_MAJ(tcf_auto_prio(*back)); |
258 | tp->q = q; | 258 | tp->q = q; |
259 | tp->classify = tp_ops->classify; | 259 | tp->classify = tp_ops->classify; |
260 | tp->classid = parent; | 260 | tp->classid = parent; |
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index ba808ef6babb..2fcad7c33eaf 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -3153,7 +3153,7 @@ static int selinux_file_send_sigiotask(struct task_struct *tsk, | |||
3153 | struct fown_struct *fown, int signum) | 3153 | struct fown_struct *fown, int signum) |
3154 | { | 3154 | { |
3155 | struct file *file; | 3155 | struct file *file; |
3156 | u32 sid = current_sid(); | 3156 | u32 sid = task_sid(tsk); |
3157 | u32 perm; | 3157 | u32 perm; |
3158 | struct file_security_struct *fsec; | 3158 | struct file_security_struct *fsec; |
3159 | 3159 | ||
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 63d088f2265f..a2a792c18c40 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c | |||
@@ -249,6 +249,12 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream) | |||
249 | new_hw_ptr = hw_base + pos; | 249 | new_hw_ptr = hw_base + pos; |
250 | } | 250 | } |
251 | } | 251 | } |
252 | /* Skip the jiffies check for hardwares with BATCH flag. | ||
253 | * Such hardware usually just increases the position at each IRQ, | ||
254 | * thus it can't give any strange position. | ||
255 | */ | ||
256 | if (runtime->hw.info & SNDRV_PCM_INFO_BATCH) | ||
257 | goto no_jiffies_check; | ||
252 | hdelta = new_hw_ptr - old_hw_ptr; | 258 | hdelta = new_hw_ptr - old_hw_ptr; |
253 | jdelta = jiffies - runtime->hw_ptr_jiffies; | 259 | jdelta = jiffies - runtime->hw_ptr_jiffies; |
254 | if (((hdelta * HZ) / runtime->rate) > jdelta + HZ/100) { | 260 | if (((hdelta * HZ) / runtime->rate) > jdelta + HZ/100) { |
@@ -272,6 +278,7 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream) | |||
272 | hw_base -= hw_base % runtime->buffer_size; | 278 | hw_base -= hw_base % runtime->buffer_size; |
273 | delta = 0; | 279 | delta = 0; |
274 | } | 280 | } |
281 | no_jiffies_check: | ||
275 | if (delta > runtime->period_size + runtime->period_size / 2) { | 282 | if (delta > runtime->period_size + runtime->period_size / 2) { |
276 | hw_ptr_error(substream, | 283 | hw_ptr_error(substream, |
277 | "Lost interrupts? " | 284 | "Lost interrupts? " |
diff --git a/sound/isa/msnd/msnd.c b/sound/isa/msnd/msnd.c index 906454413ed2..3a1526ae1729 100644 --- a/sound/isa/msnd/msnd.c +++ b/sound/isa/msnd/msnd.c | |||
@@ -438,7 +438,8 @@ static void snd_msnd_capture_reset_queue(struct snd_msnd *chip, | |||
438 | static struct snd_pcm_hardware snd_msnd_playback = { | 438 | static struct snd_pcm_hardware snd_msnd_playback = { |
439 | .info = SNDRV_PCM_INFO_MMAP | | 439 | .info = SNDRV_PCM_INFO_MMAP | |
440 | SNDRV_PCM_INFO_INTERLEAVED | | 440 | SNDRV_PCM_INFO_INTERLEAVED | |
441 | SNDRV_PCM_INFO_MMAP_VALID, | 441 | SNDRV_PCM_INFO_MMAP_VALID | |
442 | SNDRV_PCM_INFO_BATCH, | ||
442 | .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, | 443 | .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, |
443 | .rates = SNDRV_PCM_RATE_8000_48000, | 444 | .rates = SNDRV_PCM_RATE_8000_48000, |
444 | .rate_min = 8000, | 445 | .rate_min = 8000, |
@@ -456,7 +457,8 @@ static struct snd_pcm_hardware snd_msnd_playback = { | |||
456 | static struct snd_pcm_hardware snd_msnd_capture = { | 457 | static struct snd_pcm_hardware snd_msnd_capture = { |
457 | .info = SNDRV_PCM_INFO_MMAP | | 458 | .info = SNDRV_PCM_INFO_MMAP | |
458 | SNDRV_PCM_INFO_INTERLEAVED | | 459 | SNDRV_PCM_INFO_INTERLEAVED | |
459 | SNDRV_PCM_INFO_MMAP_VALID, | 460 | SNDRV_PCM_INFO_MMAP_VALID | |
461 | SNDRV_PCM_INFO_BATCH, | ||
460 | .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, | 462 | .formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE, |
461 | .rates = SNDRV_PCM_RATE_8000_48000, | 463 | .rates = SNDRV_PCM_RATE_8000_48000, |
462 | .rate_min = 8000, | 464 | .rate_min = 8000, |
diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c index a299340519df..ce3f2e90f4d7 100644 --- a/sound/pci/bt87x.c +++ b/sound/pci/bt87x.c | |||
@@ -349,7 +349,8 @@ static struct snd_pcm_hardware snd_bt87x_digital_hw = { | |||
349 | .info = SNDRV_PCM_INFO_MMAP | | 349 | .info = SNDRV_PCM_INFO_MMAP | |
350 | SNDRV_PCM_INFO_INTERLEAVED | | 350 | SNDRV_PCM_INFO_INTERLEAVED | |
351 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 351 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
352 | SNDRV_PCM_INFO_MMAP_VALID, | 352 | SNDRV_PCM_INFO_MMAP_VALID | |
353 | SNDRV_PCM_INFO_BATCH, | ||
353 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 354 | .formats = SNDRV_PCM_FMTBIT_S16_LE, |
354 | .rates = 0, /* set at runtime */ | 355 | .rates = 0, /* set at runtime */ |
355 | .channels_min = 2, | 356 | .channels_min = 2, |
@@ -365,7 +366,8 @@ static struct snd_pcm_hardware snd_bt87x_analog_hw = { | |||
365 | .info = SNDRV_PCM_INFO_MMAP | | 366 | .info = SNDRV_PCM_INFO_MMAP | |
366 | SNDRV_PCM_INFO_INTERLEAVED | | 367 | SNDRV_PCM_INFO_INTERLEAVED | |
367 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 368 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
368 | SNDRV_PCM_INFO_MMAP_VALID, | 369 | SNDRV_PCM_INFO_MMAP_VALID | |
370 | SNDRV_PCM_INFO_BATCH, | ||
369 | .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8, | 371 | .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S8, |
370 | .rates = SNDRV_PCM_RATE_KNOT, | 372 | .rates = SNDRV_PCM_RATE_KNOT, |
371 | .rate_min = ANALOG_CLOCK / CLOCK_DIV_MAX, | 373 | .rate_min = ANALOG_CLOCK / CLOCK_DIV_MAX, |
diff --git a/sound/pci/echoaudio/indigodjx.c b/sound/pci/echoaudio/indigodjx.c index 3482ef69f491..2e44316530a2 100644 --- a/sound/pci/echoaudio/indigodjx.c +++ b/sound/pci/echoaudio/indigodjx.c | |||
@@ -88,6 +88,7 @@ static struct snd_pcm_hardware pcm_hardware_skel = { | |||
88 | .rates = SNDRV_PCM_RATE_32000 | | 88 | .rates = SNDRV_PCM_RATE_32000 | |
89 | SNDRV_PCM_RATE_44100 | | 89 | SNDRV_PCM_RATE_44100 | |
90 | SNDRV_PCM_RATE_48000 | | 90 | SNDRV_PCM_RATE_48000 | |
91 | SNDRV_PCM_RATE_64000 | | ||
91 | SNDRV_PCM_RATE_88200 | | 92 | SNDRV_PCM_RATE_88200 | |
92 | SNDRV_PCM_RATE_96000, | 93 | SNDRV_PCM_RATE_96000, |
93 | .rate_min = 32000, | 94 | .rate_min = 32000, |
diff --git a/sound/pci/echoaudio/indigoiox.c b/sound/pci/echoaudio/indigoiox.c index aebee27a40ff..eb3819f9654a 100644 --- a/sound/pci/echoaudio/indigoiox.c +++ b/sound/pci/echoaudio/indigoiox.c | |||
@@ -89,6 +89,7 @@ static struct snd_pcm_hardware pcm_hardware_skel = { | |||
89 | .rates = SNDRV_PCM_RATE_32000 | | 89 | .rates = SNDRV_PCM_RATE_32000 | |
90 | SNDRV_PCM_RATE_44100 | | 90 | SNDRV_PCM_RATE_44100 | |
91 | SNDRV_PCM_RATE_48000 | | 91 | SNDRV_PCM_RATE_48000 | |
92 | SNDRV_PCM_RATE_64000 | | ||
92 | SNDRV_PCM_RATE_88200 | | 93 | SNDRV_PCM_RATE_88200 | |
93 | SNDRV_PCM_RATE_96000, | 94 | SNDRV_PCM_RATE_96000, |
94 | .rate_min = 32000, | 95 | .rate_min = 32000, |
diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c index 8b79969034be..7cc38a11e997 100644 --- a/sound/pci/korg1212/korg1212.c +++ b/sound/pci/korg1212/korg1212.c | |||
@@ -1238,7 +1238,8 @@ static struct snd_pcm_hardware snd_korg1212_playback_info = | |||
1238 | { | 1238 | { |
1239 | .info = (SNDRV_PCM_INFO_MMAP | | 1239 | .info = (SNDRV_PCM_INFO_MMAP | |
1240 | SNDRV_PCM_INFO_MMAP_VALID | | 1240 | SNDRV_PCM_INFO_MMAP_VALID | |
1241 | SNDRV_PCM_INFO_INTERLEAVED), | 1241 | SNDRV_PCM_INFO_INTERLEAVED | |
1242 | SNDRV_PCM_INFO_BATCH), | ||
1242 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 1243 | .formats = SNDRV_PCM_FMTBIT_S16_LE, |
1243 | .rates = (SNDRV_PCM_RATE_44100 | | 1244 | .rates = (SNDRV_PCM_RATE_44100 | |
1244 | SNDRV_PCM_RATE_48000), | 1245 | SNDRV_PCM_RATE_48000), |
@@ -1258,7 +1259,8 @@ static struct snd_pcm_hardware snd_korg1212_capture_info = | |||
1258 | { | 1259 | { |
1259 | .info = (SNDRV_PCM_INFO_MMAP | | 1260 | .info = (SNDRV_PCM_INFO_MMAP | |
1260 | SNDRV_PCM_INFO_MMAP_VALID | | 1261 | SNDRV_PCM_INFO_MMAP_VALID | |
1261 | SNDRV_PCM_INFO_INTERLEAVED), | 1262 | SNDRV_PCM_INFO_INTERLEAVED | |
1263 | SNDRV_PCM_INFO_BATCH), | ||
1262 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | 1264 | .formats = SNDRV_PCM_FMTBIT_S16_LE, |
1263 | .rates = (SNDRV_PCM_RATE_44100 | | 1265 | .rates = (SNDRV_PCM_RATE_44100 | |
1264 | SNDRV_PCM_RATE_48000), | 1266 | SNDRV_PCM_RATE_48000), |
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c b/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c index 01066c95580e..d057e6489643 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c | |||
@@ -240,7 +240,8 @@ static int pdacf_pcm_prepare(struct snd_pcm_substream *subs) | |||
240 | static struct snd_pcm_hardware pdacf_pcm_capture_hw = { | 240 | static struct snd_pcm_hardware pdacf_pcm_capture_hw = { |
241 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 241 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
242 | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME | | 242 | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME | |
243 | SNDRV_PCM_INFO_MMAP_VALID), | 243 | SNDRV_PCM_INFO_MMAP_VALID | |
244 | SNDRV_PCM_INFO_BATCH), | ||
244 | .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE | | 245 | .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE | |
245 | SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_3BE | | 246 | SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_3BE | |
246 | SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE, | 247 | SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE, |
diff --git a/sound/soc/au1x/dbdma2.c b/sound/soc/au1x/dbdma2.c index 30490a259148..594c6c5b7838 100644 --- a/sound/soc/au1x/dbdma2.c +++ b/sound/soc/au1x/dbdma2.c | |||
@@ -82,7 +82,7 @@ static struct au1xpsc_audio_dmadata *au1xpsc_audio_pcmdma[2]; | |||
82 | /* PCM hardware DMA capabilities - platform specific */ | 82 | /* PCM hardware DMA capabilities - platform specific */ |
83 | static const struct snd_pcm_hardware au1xpsc_pcm_hardware = { | 83 | static const struct snd_pcm_hardware au1xpsc_pcm_hardware = { |
84 | .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | | 84 | .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | |
85 | SNDRV_PCM_INFO_INTERLEAVED, | 85 | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BATCH, |
86 | .formats = AU1XPSC_PCM_FMTS, | 86 | .formats = AU1XPSC_PCM_FMTS, |
87 | .period_bytes_min = AU1XPSC_PERIOD_MIN_BYTES, | 87 | .period_bytes_min = AU1XPSC_PERIOD_MIN_BYTES, |
88 | .period_bytes_max = 4096 * 1024 - 1, | 88 | .period_bytes_max = 4096 * 1024 - 1, |
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index 921b205de28a..df7c8c281d2f 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c | |||
@@ -836,6 +836,12 @@ static DECLARE_TLV_DB_SCALE(analog_tlv, -2400, 200, 0); | |||
836 | static DECLARE_TLV_DB_SCALE(output_tvl, -1200, 600, 1); | 836 | static DECLARE_TLV_DB_SCALE(output_tvl, -1200, 600, 1); |
837 | 837 | ||
838 | /* | 838 | /* |
839 | * Gain control for earpiece amplifier | ||
840 | * 0 dB to 12 dB in 6 dB steps (mute instead of -6) | ||
841 | */ | ||
842 | static DECLARE_TLV_DB_SCALE(output_ear_tvl, -600, 600, 1); | ||
843 | |||
844 | /* | ||
839 | * Capture gain after the ADCs | 845 | * Capture gain after the ADCs |
840 | * from 0 dB to 31 dB in 1 dB steps | 846 | * from 0 dB to 31 dB in 1 dB steps |
841 | */ | 847 | */ |
@@ -900,7 +906,7 @@ static const struct snd_kcontrol_new twl4030_snd_controls[] = { | |||
900 | 4, 3, 0, output_tvl), | 906 | 4, 3, 0, output_tvl), |
901 | 907 | ||
902 | SOC_SINGLE_TLV_TWL4030("Earpiece Playback Volume", | 908 | SOC_SINGLE_TLV_TWL4030("Earpiece Playback Volume", |
903 | TWL4030_REG_EAR_CTL, 4, 3, 0, output_tvl), | 909 | TWL4030_REG_EAR_CTL, 4, 3, 0, output_ear_tvl), |
904 | 910 | ||
905 | /* Common capture gain controls */ | 911 | /* Common capture gain controls */ |
906 | SOC_DOUBLE_R_TLV("TX1 Digital Capture Volume", | 912 | SOC_DOUBLE_R_TLV("TX1 Digital Capture Volume", |
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c index 3b1d0993bed9..0275321ff8ab 100644 --- a/sound/soc/codecs/wm8350.c +++ b/sound/soc/codecs/wm8350.c | |||
@@ -968,7 +968,7 @@ static int wm8350_pcm_trigger(struct snd_pcm_substream *substream, | |||
968 | * required for LRC in master mode. The DACs or ADCs need a | 968 | * required for LRC in master mode. The DACs or ADCs need a |
969 | * valid audio path i.e. pin -> ADC or DAC -> pin before | 969 | * valid audio path i.e. pin -> ADC or DAC -> pin before |
970 | * the LRC will be enabled in master mode. */ | 970 | * the LRC will be enabled in master mode. */ |
971 | if (!master && cmd != SNDRV_PCM_TRIGGER_START) | 971 | if (!master || cmd != SNDRV_PCM_TRIGGER_START) |
972 | return 0; | 972 | return 0; |
973 | 973 | ||
974 | if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { | 974 | if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { |
diff --git a/sound/soc/fsl/mpc5200_psc_i2s.c b/sound/soc/fsl/mpc5200_psc_i2s.c index 3aa729df27b5..1111c710118a 100644 --- a/sound/soc/fsl/mpc5200_psc_i2s.c +++ b/sound/soc/fsl/mpc5200_psc_i2s.c | |||
@@ -504,7 +504,8 @@ static struct snd_soc_dai psc_i2s_dai_template = { | |||
504 | 504 | ||
505 | static const struct snd_pcm_hardware psc_i2s_pcm_hardware = { | 505 | static const struct snd_pcm_hardware psc_i2s_pcm_hardware = { |
506 | .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | | 506 | .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | |
507 | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER, | 507 | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
508 | SNDRV_PCM_INFO_BATCH, | ||
508 | .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_BE | | 509 | .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_BE | |
509 | SNDRV_PCM_FMTBIT_S24_BE | SNDRV_PCM_FMTBIT_S32_BE, | 510 | SNDRV_PCM_FMTBIT_S24_BE | SNDRV_PCM_FMTBIT_S32_BE, |
510 | .rate_min = 8000, | 511 | .rate_min = 8000, |
diff --git a/sound/soc/sh/dma-sh7760.c b/sound/soc/sh/dma-sh7760.c index 0dad3a0bb920..baddb1242c71 100644 --- a/sound/soc/sh/dma-sh7760.c +++ b/sound/soc/sh/dma-sh7760.c | |||
@@ -103,7 +103,8 @@ static struct snd_pcm_hardware camelot_pcm_hardware = { | |||
103 | .info = (SNDRV_PCM_INFO_MMAP | | 103 | .info = (SNDRV_PCM_INFO_MMAP | |
104 | SNDRV_PCM_INFO_INTERLEAVED | | 104 | SNDRV_PCM_INFO_INTERLEAVED | |
105 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 105 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
106 | SNDRV_PCM_INFO_MMAP_VALID), | 106 | SNDRV_PCM_INFO_MMAP_VALID | |
107 | SNDRV_PCM_INFO_BATCH), | ||
107 | .formats = DMABRG_FMTS, | 108 | .formats = DMABRG_FMTS, |
108 | .rates = DMABRG_RATES, | 109 | .rates = DMABRG_RATES, |
109 | .rate_min = 8000, | 110 | .rate_min = 8000, |
diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c index af95ff1e126c..1d2e51b3f918 100644 --- a/sound/sparc/dbri.c +++ b/sound/sparc/dbri.c | |||
@@ -1975,7 +1975,8 @@ static struct snd_pcm_hardware snd_dbri_pcm_hw = { | |||
1975 | .info = SNDRV_PCM_INFO_MMAP | | 1975 | .info = SNDRV_PCM_INFO_MMAP | |
1976 | SNDRV_PCM_INFO_INTERLEAVED | | 1976 | SNDRV_PCM_INFO_INTERLEAVED | |
1977 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 1977 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
1978 | SNDRV_PCM_INFO_MMAP_VALID, | 1978 | SNDRV_PCM_INFO_MMAP_VALID | |
1979 | SNDRV_PCM_INFO_BATCH, | ||
1979 | .formats = SNDRV_PCM_FMTBIT_MU_LAW | | 1980 | .formats = SNDRV_PCM_FMTBIT_MU_LAW | |
1980 | SNDRV_PCM_FMTBIT_A_LAW | | 1981 | SNDRV_PCM_FMTBIT_A_LAW | |
1981 | SNDRV_PCM_FMTBIT_U8 | | 1982 | SNDRV_PCM_FMTBIT_U8 | |
diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c index 9a608fa85155..dd1ab6177840 100644 --- a/sound/usb/usx2y/usbusx2yaudio.c +++ b/sound/usb/usx2y/usbusx2yaudio.c | |||
@@ -870,7 +870,8 @@ static struct snd_pcm_hardware snd_usX2Y_2c = | |||
870 | { | 870 | { |
871 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 871 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
872 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 872 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
873 | SNDRV_PCM_INFO_MMAP_VALID), | 873 | SNDRV_PCM_INFO_MMAP_VALID | |
874 | SNDRV_PCM_INFO_BATCH), | ||
874 | .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_3LE, | 875 | .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_3LE, |
875 | .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000, | 876 | .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000, |
876 | .rate_min = 44100, | 877 | .rate_min = 44100, |