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

Configure Feed

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

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

1) VETH_INFO_PEER netlink attribute needs to have it's size validated,
from Thomas Graf.

2) 'poll' module option of bnx2x driver crashes the machine, just remove
it. From Michal Schmidt.

3) ks8851_mll driver reads the irq number from two places, but only
initializes one of them, oops. Use only one location and fix this
problem, from Jan Weitzel.

4) Fix buffer overrun and unicast sterring bugs in mellanox mlx4 driver,
from Eugenia Emantayev.

5) Swapped kcalloc() args in RxRPC and mlx4, from Axel Lin.

6) PHY MDIO device name regression fixes from Florian Fainelli.

7) If the wake event IRQ line is different from the netdevice one, we
have to properly route it to the stmmac interrupt handler. From
Francesco Virlinzi.

8) Fix rwlock lock initialization ordering bug in mac80211, from
Mohammed Shafi Shajakhan.

9) TCP lost_cnt can get out of sync, and in fact go negative, in certain
circumstances. Fix the way we specify what sequence range to operate
on in tcp_sacktag_one() to fix this bug. From Neal Cardwell.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (27 commits)
net/ethernet: ks8851_mll fix irq handling
veth: Enforce minimum size of VETH_INFO_PEER
stmmac: update the driver version to Feb 2012 (v2)
stmmac: move hw init in the probe (v2)
stmmac: request_irq when use an ext wake irq line (v2)
stmmac: do not discard frame on dribbling bit assert
ipheth: Add iPhone 4S
mlx4: add unicast steering entries to resource_tracker
mlx4: fix QP tree trashing
mlx4: fix buffer overrun
3c59x: shorten timer period for slave devices
netpoll: netpoll_poll_dev() should access dev->flags
RxRPC: Fix kcalloc parameters swapped
bnx2x: remove the 'poll' module option
tcp: fix tcp_shifted_skb() adjustment of lost_cnt_hint for FACK
ks8851: Fix NOHZ local_softirq_pending 08 warning
bnx2x: fix bnx2x_storm_stats_update() on big endian
ixp4xx-eth: fix PHY name to match MDIO bus name
octeon: fix PHY name to match MDIO bus name
fec: fix PHY name to match fixed MDIO bus name
...

+213 -192
+1 -1
drivers/net/ethernet/3com/3c59x.c
··· 1842 1842 ok = 1; 1843 1843 } 1844 1844 1845 - if (!netif_carrier_ok(dev)) 1845 + if (dev->flags & IFF_SLAVE || !netif_carrier_ok(dev)) 1846 1846 next_tick = 5*HZ; 1847 1847 1848 1848 if (vp->medialock)
+1 -1
drivers/net/ethernet/broadcom/bcm63xx_enet.c
··· 797 797 if (priv->has_phy) { 798 798 /* connect to PHY */ 799 799 snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, 800 - priv->mac_id ? "1" : "0", priv->phy_id); 800 + priv->mii_bus->id, priv->phy_id); 801 801 802 802 phydev = phy_connect(dev, phy_id, bcm_enet_adjust_phy_link, 0, 803 803 PHY_INTERFACE_MODE_MII);
+1 -16
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
··· 117 117 module_param(dropless_fc, int, 0); 118 118 MODULE_PARM_DESC(dropless_fc, " Pause on exhausted host ring"); 119 119 120 - static int poll; 121 - module_param(poll, int, 0); 122 - MODULE_PARM_DESC(poll, " Use polling (for debug)"); 123 - 124 120 static int mrrs = -1; 125 121 module_param(mrrs, int, 0); 126 122 MODULE_PARM_DESC(mrrs, " Force Max Read Req Size (0..3) (for debug)"); ··· 4830 4834 4831 4835 static void bnx2x_timer(unsigned long data) 4832 4836 { 4833 - u8 cos; 4834 4837 struct bnx2x *bp = (struct bnx2x *) data; 4835 4838 4836 4839 if (!netif_running(bp->dev)) 4837 4840 return; 4838 - 4839 - if (poll) { 4840 - struct bnx2x_fastpath *fp = &bp->fp[0]; 4841 - 4842 - for_each_cos_in_tx_queue(fp, cos) 4843 - bnx2x_tx_int(bp, &fp->txdata[cos]); 4844 - bnx2x_rx_int(fp, 1000); 4845 - } 4846 4841 4847 4842 if (!BP_NOMCP(bp)) { 4848 4843 int mb_idx = BP_FW_MB_IDX(bp); ··· 10050 10063 static int __devinit bnx2x_init_bp(struct bnx2x *bp) 10051 10064 { 10052 10065 int func; 10053 - int timer_interval; 10054 10066 int rc; 10055 10067 10056 10068 mutex_init(&bp->port.phy_mutex); ··· 10125 10139 bp->tx_ticks = (50 / BNX2X_BTR) * BNX2X_BTR; 10126 10140 bp->rx_ticks = (25 / BNX2X_BTR) * BNX2X_BTR; 10127 10141 10128 - timer_interval = (CHIP_REV_IS_SLOW(bp) ? 5*HZ : HZ); 10129 - bp->current_interval = (poll ? poll : timer_interval); 10142 + bp->current_interval = CHIP_REV_IS_SLOW(bp) ? 5*HZ : HZ; 10130 10143 10131 10144 init_timer(&bp->timer); 10132 10145 bp->timer.expires = jiffies + bp->current_interval;
+4 -4
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
··· 1081 1081 estats->rx_stat_ifhcinbadoctets_lo); 1082 1082 1083 1083 ADD_64(fstats->total_bytes_received_hi, 1084 - tfunc->rcv_error_bytes.hi, 1084 + le32_to_cpu(tfunc->rcv_error_bytes.hi), 1085 1085 fstats->total_bytes_received_lo, 1086 - tfunc->rcv_error_bytes.lo); 1086 + le32_to_cpu(tfunc->rcv_error_bytes.lo)); 1087 1087 1088 1088 memcpy(estats, &(fstats->total_bytes_received_hi), 1089 1089 sizeof(struct host_func_stats) - 2*sizeof(u32)); 1090 1090 1091 1091 ADD_64(estats->error_bytes_received_hi, 1092 - tfunc->rcv_error_bytes.hi, 1092 + le32_to_cpu(tfunc->rcv_error_bytes.hi), 1093 1093 estats->error_bytes_received_lo, 1094 - tfunc->rcv_error_bytes.lo); 1094 + le32_to_cpu(tfunc->rcv_error_bytes.lo)); 1095 1095 1096 1096 ADD_64(estats->etherstatsoverrsizepkts_hi, 1097 1097 estats->rx_stat_dot3statsframestoolong_hi,
+1 -1
drivers/net/ethernet/freescale/fec.c
··· 986 986 printk(KERN_INFO 987 987 "%s: no PHY, assuming direct connection to switch\n", 988 988 ndev->name); 989 - strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); 989 + strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); 990 990 phy_id = 0; 991 991 } 992 992
+3 -2
drivers/net/ethernet/mellanox/mlx4/eq.c
··· 815 815 int err; 816 816 int i; 817 817 818 - priv->eq_table.uar_map = kcalloc(sizeof *priv->eq_table.uar_map, 819 - mlx4_num_eq_uar(dev), GFP_KERNEL); 818 + priv->eq_table.uar_map = kcalloc(mlx4_num_eq_uar(dev), 819 + sizeof *priv->eq_table.uar_map, 820 + GFP_KERNEL); 820 821 if (!priv->eq_table.uar_map) { 821 822 err = -ENOMEM; 822 823 goto err_out_free;
+13 -8
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
··· 73 73 struct list_head list; 74 74 u8 gid[16]; 75 75 enum mlx4_protocol prot; 76 + enum mlx4_steer_type steer; 76 77 }; 77 78 78 79 enum res_qp_states { ··· 375 374 376 375 ret->com.res_id = id; 377 376 ret->com.state = RES_QP_RESERVED; 377 + ret->local_qpn = id; 378 378 INIT_LIST_HEAD(&ret->mcg_list); 379 379 spin_lock_init(&ret->mcg_spl); 380 380 ··· 2481 2479 } 2482 2480 2483 2481 static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp, 2484 - u8 *gid, enum mlx4_protocol prot) 2482 + u8 *gid, enum mlx4_protocol prot, 2483 + enum mlx4_steer_type steer) 2485 2484 { 2486 2485 struct res_gid *res; 2487 2486 int err; ··· 2498 2495 } else { 2499 2496 memcpy(res->gid, gid, 16); 2500 2497 res->prot = prot; 2498 + res->steer = steer; 2501 2499 list_add_tail(&res->list, &rqp->mcg_list); 2502 2500 err = 0; 2503 2501 } ··· 2508 2504 } 2509 2505 2510 2506 static int rem_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp, 2511 - u8 *gid, enum mlx4_protocol prot) 2507 + u8 *gid, enum mlx4_protocol prot, 2508 + enum mlx4_steer_type steer) 2512 2509 { 2513 2510 struct res_gid *res; 2514 2511 int err; 2515 2512 2516 2513 spin_lock_irq(&rqp->mcg_spl); 2517 2514 res = find_gid(dev, slave, rqp, gid); 2518 - if (!res || res->prot != prot) 2515 + if (!res || res->prot != prot || res->steer != steer) 2519 2516 err = -EINVAL; 2520 2517 else { 2521 2518 list_del(&res->list); ··· 2543 2538 int attach = vhcr->op_modifier; 2544 2539 int block_loopback = vhcr->in_modifier >> 31; 2545 2540 u8 steer_type_mask = 2; 2546 - enum mlx4_steer_type type = gid[7] & steer_type_mask; 2541 + enum mlx4_steer_type type = (gid[7] & steer_type_mask) >> 1; 2547 2542 2548 2543 qpn = vhcr->in_modifier & 0xffffff; 2549 2544 err = get_res(dev, slave, qpn, RES_QP, &rqp); ··· 2552 2547 2553 2548 qp.qpn = qpn; 2554 2549 if (attach) { 2555 - err = add_mcg_res(dev, slave, rqp, gid, prot); 2550 + err = add_mcg_res(dev, slave, rqp, gid, prot, type); 2556 2551 if (err) 2557 2552 goto ex_put; 2558 2553 ··· 2561 2556 if (err) 2562 2557 goto ex_rem; 2563 2558 } else { 2564 - err = rem_mcg_res(dev, slave, rqp, gid, prot); 2559 + err = rem_mcg_res(dev, slave, rqp, gid, prot, type); 2565 2560 if (err) 2566 2561 goto ex_put; 2567 2562 err = mlx4_qp_detach_common(dev, &qp, gid, prot, type); ··· 2572 2567 2573 2568 ex_rem: 2574 2569 /* ignore error return below, already in error */ 2575 - err1 = rem_mcg_res(dev, slave, rqp, gid, prot); 2570 + err1 = rem_mcg_res(dev, slave, rqp, gid, prot, type); 2576 2571 ex_put: 2577 2572 put_res(dev, slave, qpn, RES_QP); 2578 2573 ··· 2611 2606 list_for_each_entry_safe(rgid, tmp, &rqp->mcg_list, list) { 2612 2607 qp.qpn = rqp->local_qpn; 2613 2608 err = mlx4_qp_detach_common(dev, &qp, rgid->gid, rgid->prot, 2614 - MLX4_MC_STEER); 2609 + rgid->steer); 2615 2610 list_del(&rgid->list); 2616 2611 kfree(rgid); 2617 2612 }
+1 -1
drivers/net/ethernet/micrel/ks8851.c
··· 583 583 ks8851_dbg_dumpkkt(ks, rxpkt); 584 584 585 585 skb->protocol = eth_type_trans(skb, ks->netdev); 586 - netif_rx(skb); 586 + netif_rx_ni(skb); 587 587 588 588 ks->netdev->stats.rx_packets++; 589 589 ks->netdev->stats.rx_bytes += rxlen;
+6 -8
drivers/net/ethernet/micrel/ks8851_mll.c
··· 394 394 * @msg_enable : The message flags controlling driver output (see ethtool). 395 395 * @frame_cnt : number of frames received. 396 396 * @bus_width : i/o bus width. 397 - * @irq : irq number assigned to this device. 398 397 * @rc_rxqcr : Cached copy of KS_RXQCR. 399 398 * @rc_txcr : Cached copy of KS_TXCR. 400 399 * @rc_ier : Cached copy of KS_IER. ··· 440 441 u32 msg_enable; 441 442 u32 frame_cnt; 442 443 int bus_width; 443 - int irq; 444 444 445 445 u16 rc_rxqcr; 446 446 u16 rc_txcr; ··· 905 907 netif_dbg(ks, ifup, ks->netdev, "%s - entry\n", __func__); 906 908 907 909 /* reset the HW */ 908 - err = request_irq(ks->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, netdev); 910 + err = request_irq(netdev->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, netdev); 909 911 910 912 if (err) { 911 - pr_err("Failed to request IRQ: %d: %d\n", ks->irq, err); 913 + pr_err("Failed to request IRQ: %d: %d\n", netdev->irq, err); 912 914 return err; 913 915 } 914 916 ··· 953 955 954 956 /* set powermode to soft power down to save power */ 955 957 ks_set_powermode(ks, PMECR_PM_SOFTDOWN); 956 - free_irq(ks->irq, netdev); 958 + free_irq(netdev->irq, netdev); 957 959 mutex_unlock(&ks->lock); 958 960 return 0; 959 961 } ··· 1543 1545 if (!ks->hw_addr_cmd) 1544 1546 goto err_ioremap1; 1545 1547 1546 - ks->irq = platform_get_irq(pdev, 0); 1548 + netdev->irq = platform_get_irq(pdev, 0); 1547 1549 1548 - if (ks->irq < 0) { 1549 - err = ks->irq; 1550 + if (netdev->irq < 0) { 1551 + err = netdev->irq; 1550 1552 goto err_get_irq; 1551 1553 } 1552 1554
+2 -2
drivers/net/ethernet/octeon/octeon_mgmt.c
··· 670 670 static int octeon_mgmt_init_phy(struct net_device *netdev) 671 671 { 672 672 struct octeon_mgmt *p = netdev_priv(netdev); 673 - char phy_id[20]; 673 + char phy_id[MII_BUS_ID_SIZE + 3]; 674 674 675 675 if (octeon_is_simulation()) { 676 676 /* No PHYs in the simulator. */ ··· 678 678 return 0; 679 679 } 680 680 681 - snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "0", p->port); 681 + snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "mdio-octeon-0", p->port); 682 682 683 683 p->phydev = phy_connect(netdev, phy_id, octeon_mgmt_adjust_link, 0, 684 684 PHY_INTERFACE_MODE_MII);
+1
drivers/net/ethernet/stmicro/stmmac/common.h
··· 67 67 unsigned long ipc_csum_error; 68 68 unsigned long rx_collision; 69 69 unsigned long rx_crc; 70 + unsigned long dribbling_bit; 70 71 unsigned long rx_length; 71 72 unsigned long rx_mii; 72 73 unsigned long rx_multicast;
+1 -1
drivers/net/ethernet/stmicro/stmmac/enh_desc.c
··· 201 201 202 202 if (unlikely(p->des01.erx.dribbling)) { 203 203 CHIP_DBG(KERN_ERR "GMAC RX: dribbling error\n"); 204 - ret = discard_frame; 204 + x->dribbling_bit++; 205 205 } 206 206 if (unlikely(p->des01.erx.sa_filter_fail)) { 207 207 CHIP_DBG(KERN_ERR "GMAC RX : Source Address filter fail\n");
+1 -1
drivers/net/ethernet/stmicro/stmmac/norm_desc.c
··· 104 104 ret = discard_frame; 105 105 } 106 106 if (unlikely(p->des01.rx.dribbling)) 107 - ret = discard_frame; 107 + x->dribbling_bit++; 108 108 109 109 if (unlikely(p->des01.rx.length_error)) { 110 110 x->rx_length++;
+3 -2
drivers/net/ethernet/stmicro/stmmac/stmmac.h
··· 21 21 *******************************************************************************/ 22 22 23 23 #define STMMAC_RESOURCE_NAME "stmmaceth" 24 - #define DRV_MODULE_VERSION "Dec_2011" 24 + #define DRV_MODULE_VERSION "Feb_2012" 25 25 #include <linux/stmmac.h> 26 26 #include <linux/phy.h> 27 27 #include "common.h" ··· 97 97 int stmmac_suspend(struct net_device *ndev); 98 98 int stmmac_dvr_remove(struct net_device *ndev); 99 99 struct stmmac_priv *stmmac_dvr_probe(struct device *device, 100 - struct plat_stmmacenet_data *plat_dat); 100 + struct plat_stmmacenet_data *plat_dat, 101 + void __iomem *addr);
+6 -1
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
··· 47 47 offsetof(struct stmmac_priv, xstats.m)} 48 48 49 49 static const struct stmmac_stats stmmac_gstrings_stats[] = { 50 + /* Transmit errors */ 50 51 STMMAC_STAT(tx_underflow), 51 52 STMMAC_STAT(tx_carrier), 52 53 STMMAC_STAT(tx_losscarrier), 53 54 STMMAC_STAT(vlan_tag), 54 55 STMMAC_STAT(tx_deferred), 55 56 STMMAC_STAT(tx_vlan), 56 - STMMAC_STAT(rx_vlan), 57 57 STMMAC_STAT(tx_jabber), 58 58 STMMAC_STAT(tx_frame_flushed), 59 59 STMMAC_STAT(tx_payload_error), 60 60 STMMAC_STAT(tx_ip_header_error), 61 + /* Receive errors */ 61 62 STMMAC_STAT(rx_desc), 62 63 STMMAC_STAT(sa_filter_fail), 63 64 STMMAC_STAT(overflow_error), 64 65 STMMAC_STAT(ipc_csum_error), 65 66 STMMAC_STAT(rx_collision), 66 67 STMMAC_STAT(rx_crc), 68 + STMMAC_STAT(dribbling_bit), 67 69 STMMAC_STAT(rx_length), 68 70 STMMAC_STAT(rx_mii), 69 71 STMMAC_STAT(rx_multicast), ··· 75 73 STMMAC_STAT(sa_rx_filter_fail), 76 74 STMMAC_STAT(rx_missed_cntr), 77 75 STMMAC_STAT(rx_overflow_cntr), 76 + STMMAC_STAT(rx_vlan), 77 + /* Tx/Rx IRQ errors */ 78 78 STMMAC_STAT(tx_undeflow_irq), 79 79 STMMAC_STAT(tx_process_stopped_irq), 80 80 STMMAC_STAT(tx_jabber_irq), ··· 86 82 STMMAC_STAT(rx_watchdog_irq), 87 83 STMMAC_STAT(tx_early_irq), 88 84 STMMAC_STAT(fatal_bus_error_irq), 85 + /* Extra info */ 89 86 STMMAC_STAT(threshold), 90 87 STMMAC_STAT(tx_pkt_n), 91 88 STMMAC_STAT(rx_pkt_n),
+107 -98
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 241 241 case 1000: 242 242 if (likely(priv->plat->has_gmac)) 243 243 ctrl &= ~priv->hw->link.port; 244 - stmmac_hw_fix_mac_speed(priv); 244 + stmmac_hw_fix_mac_speed(priv); 245 245 break; 246 246 case 100: 247 247 case 10: ··· 785 785 u32 uid = ((hwid & 0x0000ff00) >> 8); 786 786 u32 synid = (hwid & 0x000000ff); 787 787 788 - pr_info("STMMAC - user ID: 0x%x, Synopsys ID: 0x%x\n", 788 + pr_info("stmmac - user ID: 0x%x, Synopsys ID: 0x%x\n", 789 789 uid, synid); 790 790 791 791 return synid; ··· 869 869 return hw_cap; 870 870 } 871 871 872 - /** 873 - * stmmac_mac_device_setup 874 - * @dev : device pointer 875 - * Description: this is to attach the GMAC or MAC 10/100 876 - * main core structures that will be completed during the 877 - * open step. 878 - */ 879 - static int stmmac_mac_device_setup(struct net_device *dev) 880 - { 881 - struct stmmac_priv *priv = netdev_priv(dev); 882 - 883 - struct mac_device_info *device; 884 - 885 - if (priv->plat->has_gmac) 886 - device = dwmac1000_setup(priv->ioaddr); 887 - else 888 - device = dwmac100_setup(priv->ioaddr); 889 - 890 - if (!device) 891 - return -ENOMEM; 892 - 893 - priv->hw = device; 894 - priv->hw->ring = &ring_mode_ops; 895 - 896 - if (device_can_wakeup(priv->device)) { 897 - priv->wolopts = WAKE_MAGIC; /* Magic Frame as default */ 898 - enable_irq_wake(priv->wol_irq); 899 - } 900 - 901 - return 0; 902 - } 903 - 904 872 static void stmmac_check_ether_addr(struct stmmac_priv *priv) 905 873 { 906 874 /* verify if the MAC address is valid, in case of failures it ··· 898 930 struct stmmac_priv *priv = netdev_priv(dev); 899 931 int ret; 900 932 901 - /* MAC HW device setup */ 902 - ret = stmmac_mac_device_setup(dev); 903 - if (ret < 0) 904 - return ret; 905 - 906 933 stmmac_check_ether_addr(priv); 907 - 908 - stmmac_verify_args(); 909 - 910 - /* Override with kernel parameters if supplied XXX CRS XXX 911 - * this needs to have multiple instances */ 912 - if ((phyaddr >= 0) && (phyaddr <= 31)) 913 - priv->plat->phy_addr = phyaddr; 914 934 915 935 /* MDIO bus Registration */ 916 936 ret = stmmac_mdio_register(dev); ··· 932 976 goto open_error; 933 977 } 934 978 935 - stmmac_get_synopsys_id(priv); 936 - 937 - priv->hw_cap_support = stmmac_get_hw_features(priv); 938 - 939 - if (priv->hw_cap_support) { 940 - pr_info(" Support DMA HW capability register"); 941 - 942 - /* We can override some gmac/dma configuration fields: e.g. 943 - * enh_desc, tx_coe (e.g. that are passed through the 944 - * platform) with the values from the HW capability 945 - * register (if supported). 946 - */ 947 - priv->plat->enh_desc = priv->dma_cap.enh_desc; 948 - priv->plat->tx_coe = priv->dma_cap.tx_coe; 949 - priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up; 950 - 951 - /* By default disable wol on magic frame if not supported */ 952 - if (!priv->dma_cap.pmt_magic_frame) 953 - priv->wolopts &= ~WAKE_MAGIC; 954 - 955 - } else 956 - pr_info(" No HW DMA feature register supported"); 957 - 958 - /* Select the enhnaced/normal descriptor structures */ 959 - stmmac_selec_desc_mode(priv); 960 - 961 - /* PMT module is not integrated in all the MAC devices. */ 962 - if (priv->plat->pmt) { 963 - pr_info(" Remote wake-up capable\n"); 964 - device_set_wakeup_capable(priv->device, 1); 965 - } 966 - 967 - priv->rx_coe = priv->hw->mac->rx_coe(priv->ioaddr); 968 - if (priv->rx_coe) 969 - pr_info(" Checksum Offload Engine supported\n"); 970 - if (priv->plat->tx_coe) 971 - pr_info(" Checksum insertion supported\n"); 972 - 973 979 /* Create and initialize the TX/RX descriptors chains. */ 974 980 priv->dma_tx_size = STMMAC_ALIGN(dma_txsize); 975 981 priv->dma_rx_size = STMMAC_ALIGN(dma_rxsize); ··· 948 1030 949 1031 /* Copy the MAC addr into the HW */ 950 1032 priv->hw->mac->set_umac_addr(priv->ioaddr, dev->dev_addr, 0); 1033 + 951 1034 /* If required, perform hw setup of the bus. */ 952 1035 if (priv->plat->bus_setup) 953 1036 priv->plat->bus_setup(priv->ioaddr); 1037 + 954 1038 /* Initialize the MAC Core */ 955 1039 priv->hw->mac->core_init(priv->ioaddr); 956 - 957 - netdev_update_features(dev); 958 1040 959 1041 /* Request the IRQ lines */ 960 1042 ret = request_irq(dev->irq, stmmac_interrupt, ··· 963 1045 pr_err("%s: ERROR: allocating the IRQ %d (error: %d)\n", 964 1046 __func__, dev->irq, ret); 965 1047 goto open_error; 1048 + } 1049 + 1050 + /* Request the Wake IRQ in case of another line is used for WoL */ 1051 + if (priv->wol_irq != dev->irq) { 1052 + ret = request_irq(priv->wol_irq, stmmac_interrupt, 1053 + IRQF_SHARED, dev->name, dev); 1054 + if (unlikely(ret < 0)) { 1055 + pr_err("%s: ERROR: allocating the ext WoL IRQ %d " 1056 + "(error: %d)\n", __func__, priv->wol_irq, ret); 1057 + goto open_error_wolirq; 1058 + } 966 1059 } 967 1060 968 1061 /* Enable the MAC Rx/Tx */ ··· 991 1062 #ifdef CONFIG_STMMAC_DEBUG_FS 992 1063 ret = stmmac_init_fs(dev); 993 1064 if (ret < 0) 994 - pr_warning("\tFailed debugFS registration"); 1065 + pr_warning("%s: failed debugFS registration\n", __func__); 995 1066 #endif 996 1067 /* Start the ball rolling... */ 997 1068 DBG(probe, DEBUG, "%s: DMA RX/TX processes started...\n", dev->name); ··· 1001 1072 #ifdef CONFIG_STMMAC_TIMER 1002 1073 priv->tm->timer_start(tmrate); 1003 1074 #endif 1075 + 1004 1076 /* Dump DMA/MAC registers */ 1005 1077 if (netif_msg_hw(priv)) { 1006 1078 priv->hw->mac->dump_regs(priv->ioaddr); ··· 1016 1086 netif_start_queue(dev); 1017 1087 1018 1088 return 0; 1089 + 1090 + open_error_wolirq: 1091 + free_irq(dev->irq, dev); 1019 1092 1020 1093 open_error: 1021 1094 #ifdef CONFIG_STMMAC_TIMER ··· 1060 1127 1061 1128 /* Free the IRQ lines */ 1062 1129 free_irq(dev->irq, dev); 1130 + if (priv->wol_irq != dev->irq) 1131 + free_irq(priv->wol_irq, dev); 1063 1132 1064 1133 /* Stop TX/RX DMA and clear the descriptors */ 1065 1134 priv->hw->dma->stop_tx(priv->ioaddr); ··· 1724 1789 }; 1725 1790 1726 1791 /** 1792 + * stmmac_hw_init - Init the MAC device 1793 + * @priv : pointer to the private device structure. 1794 + * Description: this function detects which MAC device 1795 + * (GMAC/MAC10-100) has to attached, checks the HW capability 1796 + * (if supported) and sets the driver's features (for example 1797 + * to use the ring or chaine mode or support the normal/enh 1798 + * descriptor structure). 1799 + */ 1800 + static int stmmac_hw_init(struct stmmac_priv *priv) 1801 + { 1802 + int ret = 0; 1803 + struct mac_device_info *mac; 1804 + 1805 + /* Identify the MAC HW device */ 1806 + if (priv->plat->has_gmac) 1807 + mac = dwmac1000_setup(priv->ioaddr); 1808 + else 1809 + mac = dwmac100_setup(priv->ioaddr); 1810 + if (!mac) 1811 + return -ENOMEM; 1812 + 1813 + priv->hw = mac; 1814 + 1815 + /* To use the chained or ring mode */ 1816 + priv->hw->ring = &ring_mode_ops; 1817 + 1818 + /* Get and dump the chip ID */ 1819 + stmmac_get_synopsys_id(priv); 1820 + 1821 + /* Get the HW capability (new GMAC newer than 3.50a) */ 1822 + priv->hw_cap_support = stmmac_get_hw_features(priv); 1823 + if (priv->hw_cap_support) { 1824 + pr_info(" DMA HW capability register supported"); 1825 + 1826 + /* We can override some gmac/dma configuration fields: e.g. 1827 + * enh_desc, tx_coe (e.g. that are passed through the 1828 + * platform) with the values from the HW capability 1829 + * register (if supported). 1830 + */ 1831 + priv->plat->enh_desc = priv->dma_cap.enh_desc; 1832 + priv->plat->tx_coe = priv->dma_cap.tx_coe; 1833 + priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up; 1834 + } else 1835 + pr_info(" No HW DMA feature register supported"); 1836 + 1837 + /* Select the enhnaced/normal descriptor structures */ 1838 + stmmac_selec_desc_mode(priv); 1839 + 1840 + priv->rx_coe = priv->hw->mac->rx_coe(priv->ioaddr); 1841 + if (priv->rx_coe) 1842 + pr_info(" RX Checksum Offload Engine supported\n"); 1843 + if (priv->plat->tx_coe) 1844 + pr_info(" TX Checksum insertion supported\n"); 1845 + 1846 + if (priv->plat->pmt) { 1847 + pr_info(" Wake-Up On Lan supported\n"); 1848 + device_set_wakeup_capable(priv->device, 1); 1849 + } 1850 + 1851 + return ret; 1852 + } 1853 + 1854 + /** 1727 1855 * stmmac_dvr_probe 1728 1856 * @device: device pointer 1729 1857 * Description: this is the main probe function used to 1730 1858 * call the alloc_etherdev, allocate the priv structure. 1731 1859 */ 1732 1860 struct stmmac_priv *stmmac_dvr_probe(struct device *device, 1733 - struct plat_stmmacenet_data *plat_dat) 1861 + struct plat_stmmacenet_data *plat_dat, 1862 + void __iomem *addr) 1734 1863 { 1735 1864 int ret = 0; 1736 1865 struct net_device *ndev = NULL; ··· 1814 1815 1815 1816 ether_setup(ndev); 1816 1817 1817 - ndev->netdev_ops = &stmmac_netdev_ops; 1818 1818 stmmac_set_ethtool_ops(ndev); 1819 + priv->pause = pause; 1820 + priv->plat = plat_dat; 1821 + priv->ioaddr = addr; 1822 + priv->dev->base_addr = (unsigned long)addr; 1819 1823 1820 - ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; 1824 + /* Verify driver arguments */ 1825 + stmmac_verify_args(); 1826 + 1827 + /* Override with kernel parameters if supplied XXX CRS XXX 1828 + * this needs to have multiple instances */ 1829 + if ((phyaddr >= 0) && (phyaddr <= 31)) 1830 + priv->plat->phy_addr = phyaddr; 1831 + 1832 + /* Init MAC and get the capabilities */ 1833 + stmmac_hw_init(priv); 1834 + 1835 + ndev->netdev_ops = &stmmac_netdev_ops; 1836 + 1837 + ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 1838 + NETIF_F_RXCSUM; 1821 1839 ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA; 1822 1840 ndev->watchdog_timeo = msecs_to_jiffies(watchdog); 1823 1841 #ifdef STMMAC_VLAN_TAG_USED ··· 1846 1830 if (flow_ctrl) 1847 1831 priv->flow_ctrl = FLOW_AUTO; /* RX/TX pause on */ 1848 1832 1849 - priv->pause = pause; 1850 - priv->plat = plat_dat; 1851 1833 netif_napi_add(ndev, &priv->napi, stmmac_poll, 64); 1852 1834 1853 1835 spin_lock_init(&priv->lock); ··· 1853 1839 1854 1840 ret = register_netdev(ndev); 1855 1841 if (ret) { 1856 - pr_err("%s: ERROR %i registering the device\n", 1857 - __func__, ret); 1842 + pr_err("%s: ERROR %i registering the device\n", __func__, ret); 1858 1843 goto error; 1859 1844 } 1860 - 1861 - DBG(probe, DEBUG, "%s: Scatter/Gather: %s - HW checksums: %s\n", 1862 - ndev->name, (ndev->features & NETIF_F_SG) ? "on" : "off", 1863 - (ndev->features & NETIF_F_IP_CSUM) ? "on" : "off"); 1864 1845 1865 1846 return priv; 1866 1847
+2 -4
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
··· 96 96 97 97 stmmac_default_data(); 98 98 99 - priv = stmmac_dvr_probe(&(pdev->dev), &plat_dat); 99 + priv = stmmac_dvr_probe(&(pdev->dev), &plat_dat, addr); 100 100 if (!priv) { 101 - pr_err("%s: main drivr probe failed", __func__); 101 + pr_err("%s: main driver probe failed", __func__); 102 102 goto err_out; 103 103 } 104 - priv->ioaddr = addr; 105 - priv->dev->base_addr = (unsigned long)addr; 106 104 priv->dev->irq = pdev->irq; 107 105 priv->wol_irq = pdev->irq; 108 106
+11 -14
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
··· 59 59 goto out_release_region; 60 60 } 61 61 plat_dat = pdev->dev.platform_data; 62 - priv = stmmac_dvr_probe(&(pdev->dev), plat_dat); 63 - if (!priv) { 64 - pr_err("%s: main drivr probe failed", __func__); 65 - goto out_unmap; 62 + 63 + /* Custom initialisation (if needed)*/ 64 + if (plat_dat->init) { 65 + ret = plat_dat->init(pdev); 66 + if (unlikely(ret)) 67 + goto out_unmap; 66 68 } 67 69 68 - priv->ioaddr = addr; 69 - /* Set the I/O base addr */ 70 - priv->dev->base_addr = (unsigned long)addr; 70 + priv = stmmac_dvr_probe(&(pdev->dev), plat_dat, addr); 71 + if (!priv) { 72 + pr_err("%s: main driver probe failed", __func__); 73 + goto out_unmap; 74 + } 71 75 72 76 /* Get the MAC information */ 73 77 priv->dev->irq = platform_get_irq_byname(pdev, "macirq"); ··· 95 91 priv->wol_irq = priv->dev->irq; 96 92 97 93 platform_set_drvdata(pdev, priv->dev); 98 - 99 - /* Custom initialisation */ 100 - if (priv->plat->init) { 101 - ret = priv->plat->init(pdev); 102 - if (unlikely(ret)) 103 - goto out_unmap; 104 - } 105 94 106 95 pr_debug("STMMAC platform driver registration completed"); 107 96
+2 -2
drivers/net/ethernet/ti/cpmac.c
··· 1122 1122 pdata = pdev->dev.platform_data; 1123 1123 1124 1124 if (external_switch || dumb_switch) { 1125 - strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */ 1125 + strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); /* fixed phys bus */ 1126 1126 phy_id = pdev->id; 1127 1127 } else { 1128 1128 for (phy_id = 0; phy_id < PHY_MAX_ADDR; phy_id++) { ··· 1138 1138 if (phy_id == PHY_MAX_ADDR) { 1139 1139 dev_err(&pdev->dev, "no PHY present, falling back " 1140 1140 "to switch on MDIO bus 0\n"); 1141 - strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */ 1141 + strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); /* fixed phys bus */ 1142 1142 phy_id = pdev->id; 1143 1143 } 1144 1144
+2 -1
drivers/net/ethernet/xscale/ixp4xx_eth.c
··· 1416 1416 __raw_writel(DEFAULT_CORE_CNTRL, &port->regs->core_control); 1417 1417 udelay(50); 1418 1418 1419 - snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, "0", plat->phy); 1419 + snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, 1420 + mdio_bus->id, plat->phy); 1420 1421 port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0, 1421 1422 PHY_INTERFACE_MODE_MII); 1422 1423 if (IS_ERR(port->phydev)) {
+5
drivers/net/usb/ipheth.c
··· 60 60 #define USB_PRODUCT_IPHONE_3GS 0x1294 61 61 #define USB_PRODUCT_IPHONE_4 0x1297 62 62 #define USB_PRODUCT_IPHONE_4_VZW 0x129c 63 + #define USB_PRODUCT_IPHONE_4S 0x12a0 63 64 64 65 #define IPHETH_USBINTF_CLASS 255 65 66 #define IPHETH_USBINTF_SUBCLASS 253 ··· 102 101 IPHETH_USBINTF_PROTO) }, 103 102 { USB_DEVICE_AND_INTERFACE_INFO( 104 103 USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4_VZW, 104 + IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, 105 + IPHETH_USBINTF_PROTO) }, 106 + { USB_DEVICE_AND_INTERFACE_INFO( 107 + USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4S, 105 108 IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, 106 109 IPHETH_USBINTF_PROTO) }, 107 110 { }
+3 -1
drivers/net/veth.c
··· 422 422 unregister_netdevice_queue(peer, head); 423 423 } 424 424 425 - static const struct nla_policy veth_policy[VETH_INFO_MAX + 1]; 425 + static const struct nla_policy veth_policy[VETH_INFO_MAX + 1] = { 426 + [VETH_INFO_PEER] = { .len = sizeof(struct ifinfomsg) }, 427 + }; 426 428 427 429 static struct rtnl_link_ops veth_link_ops = { 428 430 .kind = DRV_NAME,
+2 -2
drivers/net/wireless/rtlwifi/pci.c
··· 1501 1501 return err; 1502 1502 } 1503 1503 1504 - return 1; 1504 + return 0; 1505 1505 } 1506 1506 1507 1507 static int rtl_pci_start(struct ieee80211_hw *hw) ··· 1870 1870 } 1871 1871 1872 1872 /* Init PCI sw */ 1873 - err = !rtl_pci_init(hw, pdev); 1873 + err = rtl_pci_init(hw, pdev); 1874 1874 if (err) { 1875 1875 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1876 1876 ("Failed to init PCI.\n"));
+1 -1
net/core/netpoll.c
··· 194 194 195 195 poll_napi(dev); 196 196 197 - if (dev->priv_flags & IFF_SLAVE) { 197 + if (dev->flags & IFF_SLAVE) { 198 198 if (dev->npinfo) { 199 199 struct net_device *bond_dev = dev->master; 200 200 struct sk_buff *skb;
+29 -16
net/ipv4/tcp_input.c
··· 1307 1307 return in_sack; 1308 1308 } 1309 1309 1310 - static u8 tcp_sacktag_one(const struct sk_buff *skb, struct sock *sk, 1311 - struct tcp_sacktag_state *state, 1310 + /* Mark the given newly-SACKed range as such, adjusting counters and hints. */ 1311 + static u8 tcp_sacktag_one(struct sock *sk, 1312 + struct tcp_sacktag_state *state, u8 sacked, 1313 + u32 start_seq, u32 end_seq, 1312 1314 int dup_sack, int pcount) 1313 1315 { 1314 1316 struct tcp_sock *tp = tcp_sk(sk); 1315 - u8 sacked = TCP_SKB_CB(skb)->sacked; 1316 1317 int fack_count = state->fack_count; 1317 1318 1318 1319 /* Account D-SACK for retransmitted packet. */ 1319 1320 if (dup_sack && (sacked & TCPCB_RETRANS)) { 1320 1321 if (tp->undo_marker && tp->undo_retrans && 1321 - after(TCP_SKB_CB(skb)->end_seq, tp->undo_marker)) 1322 + after(end_seq, tp->undo_marker)) 1322 1323 tp->undo_retrans--; 1323 1324 if (sacked & TCPCB_SACKED_ACKED) 1324 1325 state->reord = min(fack_count, state->reord); 1325 1326 } 1326 1327 1327 1328 /* Nothing to do; acked frame is about to be dropped (was ACKed). */ 1328 - if (!after(TCP_SKB_CB(skb)->end_seq, tp->snd_una)) 1329 + if (!after(end_seq, tp->snd_una)) 1329 1330 return sacked; 1330 1331 1331 1332 if (!(sacked & TCPCB_SACKED_ACKED)) { ··· 1345 1344 /* New sack for not retransmitted frame, 1346 1345 * which was in hole. It is reordering. 1347 1346 */ 1348 - if (before(TCP_SKB_CB(skb)->seq, 1347 + if (before(start_seq, 1349 1348 tcp_highest_sack_seq(tp))) 1350 1349 state->reord = min(fack_count, 1351 1350 state->reord); 1352 1351 1353 1352 /* SACK enhanced F-RTO (RFC4138; Appendix B) */ 1354 - if (!after(TCP_SKB_CB(skb)->end_seq, tp->frto_highmark)) 1353 + if (!after(end_seq, tp->frto_highmark)) 1355 1354 state->flag |= FLAG_ONLY_ORIG_SACKED; 1356 1355 } 1357 1356 ··· 1369 1368 1370 1369 /* Lost marker hint past SACKed? Tweak RFC3517 cnt */ 1371 1370 if (!tcp_is_fack(tp) && (tp->lost_skb_hint != NULL) && 1372 - before(TCP_SKB_CB(skb)->seq, 1373 - TCP_SKB_CB(tp->lost_skb_hint)->seq)) 1371 + before(start_seq, TCP_SKB_CB(tp->lost_skb_hint)->seq)) 1374 1372 tp->lost_cnt_hint += pcount; 1375 1373 1376 1374 if (fack_count > tp->fackets_out) ··· 1388 1388 return sacked; 1389 1389 } 1390 1390 1391 + /* Shift newly-SACKed bytes from this skb to the immediately previous 1392 + * already-SACKed sk_buff. Mark the newly-SACKed bytes as such. 1393 + */ 1391 1394 static int tcp_shifted_skb(struct sock *sk, struct sk_buff *skb, 1392 1395 struct tcp_sacktag_state *state, 1393 1396 unsigned int pcount, int shifted, int mss, ··· 1398 1395 { 1399 1396 struct tcp_sock *tp = tcp_sk(sk); 1400 1397 struct sk_buff *prev = tcp_write_queue_prev(sk, skb); 1398 + u32 start_seq = TCP_SKB_CB(skb)->seq; /* start of newly-SACKed */ 1399 + u32 end_seq = start_seq + shifted; /* end of newly-SACKed */ 1401 1400 1402 1401 BUG_ON(!pcount); 1403 1402 1404 - if (skb == tp->lost_skb_hint) 1403 + /* Adjust hint for FACK. Non-FACK is handled in tcp_sacktag_one(). */ 1404 + if (tcp_is_fack(tp) && (skb == tp->lost_skb_hint)) 1405 1405 tp->lost_cnt_hint += pcount; 1406 1406 1407 1407 TCP_SKB_CB(prev)->end_seq += shifted; ··· 1430 1424 skb_shinfo(skb)->gso_type = 0; 1431 1425 } 1432 1426 1433 - /* We discard results */ 1434 - tcp_sacktag_one(skb, sk, state, dup_sack, pcount); 1427 + /* Adjust counters and hints for the newly sacked sequence range but 1428 + * discard the return value since prev is already marked. 1429 + */ 1430 + tcp_sacktag_one(sk, state, TCP_SKB_CB(skb)->sacked, 1431 + start_seq, end_seq, dup_sack, pcount); 1435 1432 1436 1433 /* Difference in this won't matter, both ACKed by the same cumul. ACK */ 1437 1434 TCP_SKB_CB(prev)->sacked |= (TCP_SKB_CB(skb)->sacked & TCPCB_EVER_RETRANS); ··· 1673 1664 break; 1674 1665 1675 1666 if (in_sack) { 1676 - TCP_SKB_CB(skb)->sacked = tcp_sacktag_one(skb, sk, 1677 - state, 1678 - dup_sack, 1679 - tcp_skb_pcount(skb)); 1667 + TCP_SKB_CB(skb)->sacked = 1668 + tcp_sacktag_one(sk, 1669 + state, 1670 + TCP_SKB_CB(skb)->sacked, 1671 + TCP_SKB_CB(skb)->seq, 1672 + TCP_SKB_CB(skb)->end_seq, 1673 + dup_sack, 1674 + tcp_skb_pcount(skb)); 1680 1675 1681 1676 if (!before(TCP_SKB_CB(skb)->seq, 1682 1677 tcp_highest_sack_seq(tp)))
+2 -2
net/mac80211/main.c
··· 910 910 wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n", 911 911 result); 912 912 913 + ieee80211_led_init(local); 914 + 913 915 rtnl_lock(); 914 916 915 917 result = ieee80211_init_rate_ctrl_alg(local, ··· 932 930 } 933 931 934 932 rtnl_unlock(); 935 - 936 - ieee80211_led_init(local); 937 933 938 934 local->network_latency_notifier.notifier_call = 939 935 ieee80211_max_network_latency;
+2 -2
net/rxrpc/ar-key.c
··· 232 232 if (toklen <= (n_parts + 1) * 4) 233 233 return -EINVAL; 234 234 235 - princ->name_parts = kcalloc(sizeof(char *), n_parts, GFP_KERNEL); 235 + princ->name_parts = kcalloc(n_parts, sizeof(char *), GFP_KERNEL); 236 236 if (!princ->name_parts) 237 237 return -ENOMEM; 238 238 ··· 355 355 356 356 _debug("n_elem %d", n_elem); 357 357 358 - td = kcalloc(sizeof(struct krb5_tagged_data), n_elem, 358 + td = kcalloc(n_elem, sizeof(struct krb5_tagged_data), 359 359 GFP_KERNEL); 360 360 if (!td) 361 361 return -ENOMEM;