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

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

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (47 commits)
GRETH: resolve SMP issues and other problems
GRETH: handle frame error interrupts
GRETH: avoid writing bad speed/duplex when setting transfer mode
GRETH: fixed skb buffer memory leak on frame errors
GRETH: GBit transmit descriptor handling optimization
GRETH: fix opening/closing
GRETH: added raw AMBA vendor/device number to match against.
cassini: Fix build bustage on x86.
e1000e: consistent use of Rx/Tx vs. RX/TX/rx/tx in comments/logs
e1000e: update Copyright for 2011
e1000: Avoid unhandled IRQ
r8169: keep firmware in memory.
netdev: tilepro: Use is_unicast_ether_addr helper
etherdevice.h: Add is_unicast_ether_addr function
ks8695net: Use default implementation of ethtool_ops::get_link
ks8695net: Disable non-working ethtool operations
USB CDC NCM: Don't deref NULL in cdc_ncm_rx_fixup() and don't use uninitialized variable.
vxge: Remember to release firmware after upgrading firmware
netdev: bfin_mac: Remove is_multicast_ether_addr use in netdev_for_each_mc_addr
ipsec: update MAX_AH_AUTH_LEN to support sha512
...

+651 -572
+17 -4
Documentation/DocBook/80211.tmpl
··· 268 268 !Finclude/net/mac80211.h ieee80211_ops 269 269 !Finclude/net/mac80211.h ieee80211_alloc_hw 270 270 !Finclude/net/mac80211.h ieee80211_register_hw 271 - !Finclude/net/mac80211.h ieee80211_get_tx_led_name 272 - !Finclude/net/mac80211.h ieee80211_get_rx_led_name 273 - !Finclude/net/mac80211.h ieee80211_get_assoc_led_name 274 - !Finclude/net/mac80211.h ieee80211_get_radio_led_name 275 271 !Finclude/net/mac80211.h ieee80211_unregister_hw 276 272 !Finclude/net/mac80211.h ieee80211_free_hw 277 273 </chapter> ··· 377 381 improve performance. 378 382 </para> 379 383 </partintro> 384 + 385 + <chapter id="led-support"> 386 + <title>LED support</title> 387 + <para> 388 + Mac80211 supports various ways of blinking LEDs. Wherever possible, 389 + device LEDs should be exposed as LED class devices and hooked up to 390 + the appropriate trigger, which will then be triggered appropriately 391 + by mac80211. 392 + </para> 393 + !Finclude/net/mac80211.h ieee80211_get_tx_led_name 394 + !Finclude/net/mac80211.h ieee80211_get_rx_led_name 395 + !Finclude/net/mac80211.h ieee80211_get_assoc_led_name 396 + !Finclude/net/mac80211.h ieee80211_get_radio_led_name 397 + !Finclude/net/mac80211.h ieee80211_tpt_blink 398 + !Finclude/net/mac80211.h ieee80211_tpt_led_trigger_flags 399 + !Finclude/net/mac80211.h ieee80211_create_tpt_led_trigger 400 + </chapter> 380 401 381 402 <chapter id="hardware-crypto-offload"> 382 403 <title>Hardware crypto acceleration</title>
+91 -189
drivers/net/arm/ks8695net.c
··· 854 854 } 855 855 856 856 /** 857 - * ks8695_get_settings - Get device-specific settings. 857 + * ks8695_wan_get_settings - Get device-specific settings. 858 858 * @ndev: The network device to read settings from 859 859 * @cmd: The ethtool structure to read into 860 860 */ 861 861 static int 862 - ks8695_get_settings(struct net_device *ndev, struct ethtool_cmd *cmd) 862 + ks8695_wan_get_settings(struct net_device *ndev, struct ethtool_cmd *cmd) 863 863 { 864 864 struct ks8695_priv *ksp = netdev_priv(ndev); 865 865 u32 ctrl; ··· 870 870 SUPPORTED_TP | SUPPORTED_MII); 871 871 cmd->transceiver = XCVR_INTERNAL; 872 872 873 - /* Port specific extras */ 874 - switch (ksp->dtype) { 875 - case KS8695_DTYPE_HPNA: 876 - cmd->phy_address = 0; 877 - /* not supported for HPNA */ 873 + cmd->advertising = ADVERTISED_TP | ADVERTISED_MII; 874 + cmd->port = PORT_MII; 875 + cmd->supported |= (SUPPORTED_Autoneg | SUPPORTED_Pause); 876 + cmd->phy_address = 0; 877 + 878 + ctrl = readl(ksp->phyiface_regs + KS8695_WMC); 879 + if ((ctrl & WMC_WAND) == 0) { 880 + /* auto-negotiation is enabled */ 881 + cmd->advertising |= ADVERTISED_Autoneg; 882 + if (ctrl & WMC_WANA100F) 883 + cmd->advertising |= ADVERTISED_100baseT_Full; 884 + if (ctrl & WMC_WANA100H) 885 + cmd->advertising |= ADVERTISED_100baseT_Half; 886 + if (ctrl & WMC_WANA10F) 887 + cmd->advertising |= ADVERTISED_10baseT_Full; 888 + if (ctrl & WMC_WANA10H) 889 + cmd->advertising |= ADVERTISED_10baseT_Half; 890 + if (ctrl & WMC_WANAP) 891 + cmd->advertising |= ADVERTISED_Pause; 892 + cmd->autoneg = AUTONEG_ENABLE; 893 + 894 + cmd->speed = (ctrl & WMC_WSS) ? SPEED_100 : SPEED_10; 895 + cmd->duplex = (ctrl & WMC_WDS) ? 896 + DUPLEX_FULL : DUPLEX_HALF; 897 + } else { 898 + /* auto-negotiation is disabled */ 878 899 cmd->autoneg = AUTONEG_DISABLE; 879 900 880 - /* BUG: Erm, dtype hpna implies no phy regs */ 881 - /* 882 - ctrl = readl(KS8695_MISC_VA + KS8695_HMC); 883 - cmd->speed = (ctrl & HMC_HSS) ? SPEED_100 : SPEED_10; 884 - cmd->duplex = (ctrl & HMC_HDS) ? DUPLEX_FULL : DUPLEX_HALF; 885 - */ 886 - return -EOPNOTSUPP; 887 - case KS8695_DTYPE_WAN: 888 - cmd->advertising = ADVERTISED_TP | ADVERTISED_MII; 889 - cmd->port = PORT_MII; 890 - cmd->supported |= (SUPPORTED_Autoneg | SUPPORTED_Pause); 891 - cmd->phy_address = 0; 892 - 893 - ctrl = readl(ksp->phyiface_regs + KS8695_WMC); 894 - if ((ctrl & WMC_WAND) == 0) { 895 - /* auto-negotiation is enabled */ 896 - cmd->advertising |= ADVERTISED_Autoneg; 897 - if (ctrl & WMC_WANA100F) 898 - cmd->advertising |= ADVERTISED_100baseT_Full; 899 - if (ctrl & WMC_WANA100H) 900 - cmd->advertising |= ADVERTISED_100baseT_Half; 901 - if (ctrl & WMC_WANA10F) 902 - cmd->advertising |= ADVERTISED_10baseT_Full; 903 - if (ctrl & WMC_WANA10H) 904 - cmd->advertising |= ADVERTISED_10baseT_Half; 905 - if (ctrl & WMC_WANAP) 906 - cmd->advertising |= ADVERTISED_Pause; 907 - cmd->autoneg = AUTONEG_ENABLE; 908 - 909 - cmd->speed = (ctrl & WMC_WSS) ? SPEED_100 : SPEED_10; 910 - cmd->duplex = (ctrl & WMC_WDS) ? 911 - DUPLEX_FULL : DUPLEX_HALF; 912 - } else { 913 - /* auto-negotiation is disabled */ 914 - cmd->autoneg = AUTONEG_DISABLE; 915 - 916 - cmd->speed = (ctrl & WMC_WANF100) ? 917 - SPEED_100 : SPEED_10; 918 - cmd->duplex = (ctrl & WMC_WANFF) ? 919 - DUPLEX_FULL : DUPLEX_HALF; 920 - } 921 - break; 922 - case KS8695_DTYPE_LAN: 923 - return -EOPNOTSUPP; 901 + cmd->speed = (ctrl & WMC_WANF100) ? 902 + SPEED_100 : SPEED_10; 903 + cmd->duplex = (ctrl & WMC_WANFF) ? 904 + DUPLEX_FULL : DUPLEX_HALF; 924 905 } 925 906 926 907 return 0; 927 908 } 928 909 929 910 /** 930 - * ks8695_set_settings - Set device-specific settings. 911 + * ks8695_wan_set_settings - Set device-specific settings. 931 912 * @ndev: The network device to configure 932 913 * @cmd: The settings to configure 933 914 */ 934 915 static int 935 - ks8695_set_settings(struct net_device *ndev, struct ethtool_cmd *cmd) 916 + ks8695_wan_set_settings(struct net_device *ndev, struct ethtool_cmd *cmd) 936 917 { 937 918 struct ks8695_priv *ksp = netdev_priv(ndev); 938 919 u32 ctrl; ··· 937 956 ADVERTISED_100baseT_Full)) == 0) 938 957 return -EINVAL; 939 958 940 - switch (ksp->dtype) { 941 - case KS8695_DTYPE_HPNA: 942 - /* HPNA does not support auto-negotiation. */ 943 - return -EINVAL; 944 - case KS8695_DTYPE_WAN: 945 - ctrl = readl(ksp->phyiface_regs + KS8695_WMC); 959 + ctrl = readl(ksp->phyiface_regs + KS8695_WMC); 946 960 947 - ctrl &= ~(WMC_WAND | WMC_WANA100F | WMC_WANA100H | 948 - WMC_WANA10F | WMC_WANA10H); 949 - if (cmd->advertising & ADVERTISED_100baseT_Full) 950 - ctrl |= WMC_WANA100F; 951 - if (cmd->advertising & ADVERTISED_100baseT_Half) 952 - ctrl |= WMC_WANA100H; 953 - if (cmd->advertising & ADVERTISED_10baseT_Full) 954 - ctrl |= WMC_WANA10F; 955 - if (cmd->advertising & ADVERTISED_10baseT_Half) 956 - ctrl |= WMC_WANA10H; 961 + ctrl &= ~(WMC_WAND | WMC_WANA100F | WMC_WANA100H | 962 + WMC_WANA10F | WMC_WANA10H); 963 + if (cmd->advertising & ADVERTISED_100baseT_Full) 964 + ctrl |= WMC_WANA100F; 965 + if (cmd->advertising & ADVERTISED_100baseT_Half) 966 + ctrl |= WMC_WANA100H; 967 + if (cmd->advertising & ADVERTISED_10baseT_Full) 968 + ctrl |= WMC_WANA10F; 969 + if (cmd->advertising & ADVERTISED_10baseT_Half) 970 + ctrl |= WMC_WANA10H; 957 971 958 - /* force a re-negotiation */ 959 - ctrl |= WMC_WANR; 960 - writel(ctrl, ksp->phyiface_regs + KS8695_WMC); 961 - break; 962 - case KS8695_DTYPE_LAN: 963 - return -EOPNOTSUPP; 964 - } 965 - 972 + /* force a re-negotiation */ 973 + ctrl |= WMC_WANR; 974 + writel(ctrl, ksp->phyiface_regs + KS8695_WMC); 966 975 } else { 967 - switch (ksp->dtype) { 968 - case KS8695_DTYPE_HPNA: 969 - /* BUG: dtype_hpna implies no phy registers */ 970 - /* 971 - ctrl = __raw_readl(KS8695_MISC_VA + KS8695_HMC); 976 + ctrl = readl(ksp->phyiface_regs + KS8695_WMC); 972 977 973 - ctrl &= ~(HMC_HSS | HMC_HDS); 974 - if (cmd->speed == SPEED_100) 975 - ctrl |= HMC_HSS; 976 - if (cmd->duplex == DUPLEX_FULL) 977 - ctrl |= HMC_HDS; 978 + /* disable auto-negotiation */ 979 + ctrl |= WMC_WAND; 980 + ctrl &= ~(WMC_WANF100 | WMC_WANFF); 978 981 979 - __raw_writel(ctrl, KS8695_MISC_VA + KS8695_HMC); 980 - */ 981 - return -EOPNOTSUPP; 982 - case KS8695_DTYPE_WAN: 983 - ctrl = readl(ksp->phyiface_regs + KS8695_WMC); 982 + if (cmd->speed == SPEED_100) 983 + ctrl |= WMC_WANF100; 984 + if (cmd->duplex == DUPLEX_FULL) 985 + ctrl |= WMC_WANFF; 984 986 985 - /* disable auto-negotiation */ 986 - ctrl |= WMC_WAND; 987 - ctrl &= ~(WMC_WANF100 | WMC_WANFF); 988 - 989 - if (cmd->speed == SPEED_100) 990 - ctrl |= WMC_WANF100; 991 - if (cmd->duplex == DUPLEX_FULL) 992 - ctrl |= WMC_WANFF; 993 - 994 - writel(ctrl, ksp->phyiface_regs + KS8695_WMC); 995 - break; 996 - case KS8695_DTYPE_LAN: 997 - return -EOPNOTSUPP; 998 - } 987 + writel(ctrl, ksp->phyiface_regs + KS8695_WMC); 999 988 } 1000 989 1001 990 return 0; 1002 991 } 1003 992 1004 993 /** 1005 - * ks8695_nwayreset - Restart the autonegotiation on the port. 994 + * ks8695_wan_nwayreset - Restart the autonegotiation on the port. 1006 995 * @ndev: The network device to restart autoneotiation on 1007 996 */ 1008 997 static int 1009 - ks8695_nwayreset(struct net_device *ndev) 998 + ks8695_wan_nwayreset(struct net_device *ndev) 1010 999 { 1011 1000 struct ks8695_priv *ksp = netdev_priv(ndev); 1012 1001 u32 ctrl; 1013 1002 1014 - switch (ksp->dtype) { 1015 - case KS8695_DTYPE_HPNA: 1016 - /* No phy means no autonegotiation on hpna */ 1003 + ctrl = readl(ksp->phyiface_regs + KS8695_WMC); 1004 + 1005 + if ((ctrl & WMC_WAND) == 0) 1006 + writel(ctrl | WMC_WANR, 1007 + ksp->phyiface_regs + KS8695_WMC); 1008 + else 1009 + /* auto-negotiation not enabled */ 1017 1010 return -EINVAL; 1018 - case KS8695_DTYPE_WAN: 1019 - ctrl = readl(ksp->phyiface_regs + KS8695_WMC); 1020 - 1021 - if ((ctrl & WMC_WAND) == 0) 1022 - writel(ctrl | WMC_WANR, 1023 - ksp->phyiface_regs + KS8695_WMC); 1024 - else 1025 - /* auto-negotiation not enabled */ 1026 - return -EINVAL; 1027 - break; 1028 - case KS8695_DTYPE_LAN: 1029 - return -EOPNOTSUPP; 1030 - } 1031 1011 1032 1012 return 0; 1033 1013 } 1034 1014 1035 1015 /** 1036 - * ks8695_get_link - Retrieve link status of network interface 1037 - * @ndev: The network interface to retrive the link status of. 1038 - */ 1039 - static u32 1040 - ks8695_get_link(struct net_device *ndev) 1041 - { 1042 - struct ks8695_priv *ksp = netdev_priv(ndev); 1043 - u32 ctrl; 1044 - 1045 - switch (ksp->dtype) { 1046 - case KS8695_DTYPE_HPNA: 1047 - /* HPNA always has link */ 1048 - return 1; 1049 - case KS8695_DTYPE_WAN: 1050 - /* WAN we can read the PHY for */ 1051 - ctrl = readl(ksp->phyiface_regs + KS8695_WMC); 1052 - return ctrl & WMC_WLS; 1053 - case KS8695_DTYPE_LAN: 1054 - return -EOPNOTSUPP; 1055 - } 1056 - return 0; 1057 - } 1058 - 1059 - /** 1060 - * ks8695_get_pause - Retrieve network pause/flow-control advertising 1016 + * ks8695_wan_get_pause - Retrieve network pause/flow-control advertising 1061 1017 * @ndev: The device to retrieve settings from 1062 1018 * @param: The structure to fill out with the information 1063 1019 */ 1064 1020 static void 1065 - ks8695_get_pause(struct net_device *ndev, struct ethtool_pauseparam *param) 1021 + ks8695_wan_get_pause(struct net_device *ndev, struct ethtool_pauseparam *param) 1066 1022 { 1067 1023 struct ks8695_priv *ksp = netdev_priv(ndev); 1068 1024 u32 ctrl; 1069 1025 1070 - switch (ksp->dtype) { 1071 - case KS8695_DTYPE_HPNA: 1072 - /* No phy link on hpna to configure */ 1073 - return; 1074 - case KS8695_DTYPE_WAN: 1075 - ctrl = readl(ksp->phyiface_regs + KS8695_WMC); 1026 + ctrl = readl(ksp->phyiface_regs + KS8695_WMC); 1076 1027 1077 - /* advertise Pause */ 1078 - param->autoneg = (ctrl & WMC_WANAP); 1028 + /* advertise Pause */ 1029 + param->autoneg = (ctrl & WMC_WANAP); 1079 1030 1080 - /* current Rx Flow-control */ 1081 - ctrl = ks8695_readreg(ksp, KS8695_DRXC); 1082 - param->rx_pause = (ctrl & DRXC_RFCE); 1031 + /* current Rx Flow-control */ 1032 + ctrl = ks8695_readreg(ksp, KS8695_DRXC); 1033 + param->rx_pause = (ctrl & DRXC_RFCE); 1083 1034 1084 - /* current Tx Flow-control */ 1085 - ctrl = ks8695_readreg(ksp, KS8695_DTXC); 1086 - param->tx_pause = (ctrl & DTXC_TFCE); 1087 - break; 1088 - case KS8695_DTYPE_LAN: 1089 - /* The LAN's "phy" is a direct-attached switch */ 1090 - return; 1091 - } 1092 - } 1093 - 1094 - /** 1095 - * ks8695_set_pause - Configure pause/flow-control 1096 - * @ndev: The device to configure 1097 - * @param: The pause parameters to set 1098 - * 1099 - * TODO: Implement this 1100 - */ 1101 - static int 1102 - ks8695_set_pause(struct net_device *ndev, struct ethtool_pauseparam *param) 1103 - { 1104 - return -EOPNOTSUPP; 1035 + /* current Tx Flow-control */ 1036 + ctrl = ks8695_readreg(ksp, KS8695_DTXC); 1037 + param->tx_pause = (ctrl & DTXC_TFCE); 1105 1038 } 1106 1039 1107 1040 /** ··· 1035 1140 static const struct ethtool_ops ks8695_ethtool_ops = { 1036 1141 .get_msglevel = ks8695_get_msglevel, 1037 1142 .set_msglevel = ks8695_set_msglevel, 1038 - .get_settings = ks8695_get_settings, 1039 - .set_settings = ks8695_set_settings, 1040 - .nway_reset = ks8695_nwayreset, 1041 - .get_link = ks8695_get_link, 1042 - .get_pauseparam = ks8695_get_pause, 1043 - .set_pauseparam = ks8695_set_pause, 1143 + .get_drvinfo = ks8695_get_drvinfo, 1144 + }; 1145 + 1146 + static const struct ethtool_ops ks8695_wan_ethtool_ops = { 1147 + .get_msglevel = ks8695_get_msglevel, 1148 + .set_msglevel = ks8695_set_msglevel, 1149 + .get_settings = ks8695_wan_get_settings, 1150 + .set_settings = ks8695_wan_set_settings, 1151 + .nway_reset = ks8695_wan_nwayreset, 1152 + .get_link = ethtool_op_get_link, 1153 + .get_pauseparam = ks8695_wan_get_pause, 1044 1154 .get_drvinfo = ks8695_get_drvinfo, 1045 1155 }; 1046 1156 ··· 1441 1541 1442 1542 /* driver system setup */ 1443 1543 ndev->netdev_ops = &ks8695_netdev_ops; 1444 - SET_ETHTOOL_OPS(ndev, &ks8695_ethtool_ops); 1445 1544 ndev->watchdog_timeo = msecs_to_jiffies(watchdog); 1446 1545 1447 1546 netif_napi_add(ndev, &ksp->napi, ks8695_poll, NAPI_WEIGHT); ··· 1507 1608 if (ksp->phyiface_regs && ksp->link_irq == -1) { 1508 1609 ks8695_init_switch(ksp); 1509 1610 ksp->dtype = KS8695_DTYPE_LAN; 1611 + SET_ETHTOOL_OPS(ndev, &ks8695_ethtool_ops); 1510 1612 } else if (ksp->phyiface_regs && ksp->link_irq != -1) { 1511 1613 ks8695_init_wan_phy(ksp); 1512 1614 ksp->dtype = KS8695_DTYPE_WAN; 1615 + SET_ETHTOOL_OPS(ndev, &ks8695_wan_ethtool_ops); 1513 1616 } else { 1514 1617 /* No initialisation since HPNA does not have a PHY */ 1515 1618 ksp->dtype = KS8695_DTYPE_HPNA; 1619 + SET_ETHTOOL_OPS(ndev, &ks8695_ethtool_ops); 1516 1620 } 1517 1621 1518 1622 /* And bring up the net_device with the net core */
+1 -8
drivers/net/bfin_mac.c
··· 1284 1284 { 1285 1285 u32 emac_hashhi, emac_hashlo; 1286 1286 struct netdev_hw_addr *ha; 1287 - char *addrs; 1288 1287 u32 crc; 1289 1288 1290 1289 emac_hashhi = emac_hashlo = 0; 1291 1290 1292 1291 netdev_for_each_mc_addr(ha, dev) { 1293 - addrs = ha->addr; 1294 - 1295 - /* skip non-multicast addresses */ 1296 - if (!(*addrs & 1)) 1297 - continue; 1298 - 1299 - crc = ether_crc(ETH_ALEN, addrs); 1292 + crc = ether_crc(ETH_ALEN, ha->addr); 1300 1293 crc >>= 26; 1301 1294 1302 1295 if (crc & 0x20)
-1
drivers/net/bna/bnad_ethtool.c
··· 275 275 276 276 ioc_attr = kzalloc(sizeof(*ioc_attr), GFP_KERNEL); 277 277 if (ioc_attr) { 278 - memset(ioc_attr, 0, sizeof(*ioc_attr)); 279 278 spin_lock_irqsave(&bnad->bna_lock, flags); 280 279 bfa_nw_ioc_get_attr(&bnad->bna.device.ioc, ioc_attr); 281 280 spin_unlock_irqrestore(&bnad->bna_lock, flags);
+3 -3
drivers/net/cassini.c
··· 3203 3203 int phy_type = CAS_PHY_MII_MDIO0; /* default phy type */ 3204 3204 int mac_off = 0; 3205 3205 3206 - #if defined(CONFIG_OF) 3206 + #if defined(CONFIG_SPARC) 3207 3207 const unsigned char *addr; 3208 3208 #endif 3209 3209 ··· 3354 3354 if (found & VPD_FOUND_MAC) 3355 3355 goto done; 3356 3356 3357 - #if defined(CONFIG_OF) 3357 + #if defined(CONFIG_SPARC) 3358 3358 addr = of_get_property(cp->of_node, "local-mac-address", NULL); 3359 3359 if (addr != NULL) { 3360 3360 memcpy(dev_addr, addr, 6); ··· 5031 5031 cp->msg_enable = (cassini_debug < 0) ? CAS_DEF_MSG_ENABLE : 5032 5032 cassini_debug; 5033 5033 5034 - #if defined(CONFIG_OF) 5034 + #if defined(CONFIG_SPARC) 5035 5035 cp->of_node = pci_device_to_OF_node(pdev); 5036 5036 #endif 5037 5037
+9 -1
drivers/net/e1000/e1000_main.c
··· 3478 3478 struct e1000_hw *hw = &adapter->hw; 3479 3479 u32 icr = er32(ICR); 3480 3480 3481 - if (unlikely((!icr) || test_bit(__E1000_DOWN, &adapter->flags))) 3481 + if (unlikely((!icr))) 3482 3482 return IRQ_NONE; /* Not our interrupt */ 3483 + 3484 + /* 3485 + * we might have caused the interrupt, but the above 3486 + * read cleared it, and just in case the driver is 3487 + * down there is nothing to do so return handled 3488 + */ 3489 + if (unlikely(test_bit(__E1000_DOWN, &adapter->flags))) 3490 + return IRQ_HANDLED; 3483 3491 3484 3492 if (unlikely(icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC))) { 3485 3493 hw->get_link_status = 1;
+2 -2
drivers/net/e1000e/82571.c
··· 1 1 /******************************************************************************* 2 2 3 3 Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2010 Intel Corporation. 4 + Copyright(c) 1999 - 2011 Intel Corporation. 5 5 6 6 This program is free software; you can redistribute it and/or modify it 7 7 under the terms and conditions of the GNU General Public License, ··· 1310 1310 * apply workaround for hardware errata documented in errata 1311 1311 * docs Fixes issue where some error prone or unreliable PCIe 1312 1312 * completions are occurring, particularly with ASPM enabled. 1313 - * Without fix, issue can cause tx timeouts. 1313 + * Without fix, issue can cause Tx timeouts. 1314 1314 */ 1315 1315 reg = er32(GCR2); 1316 1316 reg |= 1;
+1 -1
drivers/net/e1000e/Makefile
··· 1 1 ################################################################################ 2 2 # 3 3 # Intel PRO/1000 Linux driver 4 - # Copyright(c) 1999 - 2008 Intel Corporation. 4 + # Copyright(c) 1999 - 2011 Intel Corporation. 5 5 # 6 6 # This program is free software; you can redistribute it and/or modify it 7 7 # under the terms and conditions of the GNU General Public License,
+1 -1
drivers/net/e1000e/defines.h
··· 1 1 /******************************************************************************* 2 2 3 3 Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2010 Intel Corporation. 4 + Copyright(c) 1999 - 2011 Intel Corporation. 5 5 6 6 This program is free software; you can redistribute it and/or modify it 7 7 under the terms and conditions of the GNU General Public License,
+1 -1
drivers/net/e1000e/e1000.h
··· 1 1 /******************************************************************************* 2 2 3 3 Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2010 Intel Corporation. 4 + Copyright(c) 1999 - 2011 Intel Corporation. 5 5 6 6 This program is free software; you can redistribute it and/or modify it 7 7 under the terms and conditions of the GNU General Public License,
+1 -1
drivers/net/e1000e/es2lan.c
··· 1 1 /******************************************************************************* 2 2 3 3 Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2010 Intel Corporation. 4 + Copyright(c) 1999 - 2011 Intel Corporation. 5 5 6 6 This program is free software; you can redistribute it and/or modify it 7 7 under the terms and conditions of the GNU General Public License,
+1 -1
drivers/net/e1000e/ethtool.c
··· 1 1 /******************************************************************************* 2 2 3 3 Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2010 Intel Corporation. 4 + Copyright(c) 1999 - 2011 Intel Corporation. 5 5 6 6 This program is free software; you can redistribute it and/or modify it 7 7 under the terms and conditions of the GNU General Public License,
+2 -2
drivers/net/e1000e/hw.h
··· 1 1 /******************************************************************************* 2 2 3 3 Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2010 Intel Corporation. 4 + Copyright(c) 1999 - 2011 Intel Corporation. 5 5 6 6 This program is free software; you can redistribute it and/or modify it 7 7 under the terms and conditions of the GNU General Public License, ··· 102 102 E1000_RDTR = 0x02820, /* Rx Delay Timer - RW */ 103 103 E1000_RXDCTL_BASE = 0x02828, /* Rx Descriptor Control - RW */ 104 104 #define E1000_RXDCTL(_n) (E1000_RXDCTL_BASE + (_n << 8)) 105 - E1000_RADV = 0x0282C, /* RX Interrupt Absolute Delay Timer - RW */ 105 + E1000_RADV = 0x0282C, /* Rx Interrupt Absolute Delay Timer - RW */ 106 106 107 107 /* Convenience macros 108 108 *
+1 -1
drivers/net/e1000e/ich8lan.c
··· 1 1 /******************************************************************************* 2 2 3 3 Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2010 Intel Corporation. 4 + Copyright(c) 1999 - 2011 Intel Corporation. 5 5 6 6 This program is free software; you can redistribute it and/or modify it 7 7 under the terms and conditions of the GNU General Public License,
+10 -10
drivers/net/e1000e/lib.c
··· 1 1 /******************************************************************************* 2 2 3 3 Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2010 Intel Corporation. 4 + Copyright(c) 1999 - 2011 Intel Corporation. 5 5 6 6 This program is free software; you can redistribute it and/or modify it 7 7 under the terms and conditions of the GNU General Public License, ··· 533 533 mac->autoneg_failed = 1; 534 534 return 0; 535 535 } 536 - e_dbg("NOT RXing /C/, disable AutoNeg and force link.\n"); 536 + e_dbg("NOT Rx'ing /C/, disable AutoNeg and force link.\n"); 537 537 538 538 /* Disable auto-negotiation in the TXCW register */ 539 539 ew32(TXCW, (mac->txcw & ~E1000_TXCW_ANE)); ··· 556 556 * and disable forced link in the Device Control register 557 557 * in an attempt to auto-negotiate with our link partner. 558 558 */ 559 - e_dbg("RXing /C/, enable AutoNeg and stop forcing link.\n"); 559 + e_dbg("Rx'ing /C/, enable AutoNeg and stop forcing link.\n"); 560 560 ew32(TXCW, mac->txcw); 561 561 ew32(CTRL, (ctrl & ~E1000_CTRL_SLU)); 562 562 ··· 598 598 mac->autoneg_failed = 1; 599 599 return 0; 600 600 } 601 - e_dbg("NOT RXing /C/, disable AutoNeg and force link.\n"); 601 + e_dbg("NOT Rx'ing /C/, disable AutoNeg and force link.\n"); 602 602 603 603 /* Disable auto-negotiation in the TXCW register */ 604 604 ew32(TXCW, (mac->txcw & ~E1000_TXCW_ANE)); ··· 621 621 * and disable forced link in the Device Control register 622 622 * in an attempt to auto-negotiate with our link partner. 623 623 */ 624 - e_dbg("RXing /C/, enable AutoNeg and stop forcing link.\n"); 624 + e_dbg("Rx'ing /C/, enable AutoNeg and stop forcing link.\n"); 625 625 ew32(TXCW, mac->txcw); 626 626 ew32(CTRL, (ctrl & ~E1000_CTRL_SLU)); 627 627 ··· 800 800 * The possible values of the "fc" parameter are: 801 801 * 0: Flow control is completely disabled 802 802 * 1: Rx flow control is enabled (we can receive pause frames, 803 - * but not send pause frames). 803 + * but not send pause frames). 804 804 * 2: Tx flow control is enabled (we can send pause frames but we 805 - * do not support receiving pause frames). 805 + * do not support receiving pause frames). 806 806 * 3: Both Rx and Tx flow control (symmetric) are enabled. 807 807 */ 808 808 switch (hw->fc.current_mode) { ··· 1031 1031 * The possible values of the "fc" parameter are: 1032 1032 * 0: Flow control is completely disabled 1033 1033 * 1: Rx flow control is enabled (we can receive pause 1034 - * frames but not send pause frames). 1034 + * frames but not send pause frames). 1035 1035 * 2: Tx flow control is enabled (we can send pause frames 1036 - * frames but we do not receive pause frames). 1036 + * frames but we do not receive pause frames). 1037 1037 * 3: Both Rx and Tx flow control (symmetric) is enabled. 1038 1038 * other: No other values should be possible at this point. 1039 1039 */ ··· 1189 1189 } else { 1190 1190 hw->fc.current_mode = e1000_fc_rx_pause; 1191 1191 e_dbg("Flow Control = " 1192 - "RX PAUSE frames only.\r\n"); 1192 + "Rx PAUSE frames only.\r\n"); 1193 1193 } 1194 1194 } 1195 1195 /*
+113 -110
drivers/net/e1000e/netdev.c
··· 1 1 /******************************************************************************* 2 2 3 3 Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2010 Intel Corporation. 4 + Copyright(c) 1999 - 2011 Intel Corporation. 5 5 6 6 This program is free software; you can redistribute it and/or modify it 7 7 under the terms and conditions of the GNU General Public License, ··· 77 77 char *name; 78 78 }; 79 79 80 - #define E1000_RDFH 0x02410 /* Rx Data FIFO Head - RW */ 81 - #define E1000_RDFT 0x02418 /* Rx Data FIFO Tail - RW */ 82 - #define E1000_RDFHS 0x02420 /* Rx Data FIFO Head Saved - RW */ 83 - #define E1000_RDFTS 0x02428 /* Rx Data FIFO Tail Saved - RW */ 84 - #define E1000_RDFPC 0x02430 /* Rx Data FIFO Packet Count - RW */ 80 + #define E1000_RDFH 0x02410 /* Rx Data FIFO Head - RW */ 81 + #define E1000_RDFT 0x02418 /* Rx Data FIFO Tail - RW */ 82 + #define E1000_RDFHS 0x02420 /* Rx Data FIFO Head Saved - RW */ 83 + #define E1000_RDFTS 0x02428 /* Rx Data FIFO Tail Saved - RW */ 84 + #define E1000_RDFPC 0x02430 /* Rx Data FIFO Packet Count - RW */ 85 85 86 - #define E1000_TDFH 0x03410 /* Tx Data FIFO Head - RW */ 87 - #define E1000_TDFT 0x03418 /* Tx Data FIFO Tail - RW */ 88 - #define E1000_TDFHS 0x03420 /* Tx Data FIFO Head Saved - RW */ 89 - #define E1000_TDFTS 0x03428 /* Tx Data FIFO Tail Saved - RW */ 90 - #define E1000_TDFPC 0x03430 /* Tx Data FIFO Packet Count - RW */ 86 + #define E1000_TDFH 0x03410 /* Tx Data FIFO Head - RW */ 87 + #define E1000_TDFT 0x03418 /* Tx Data FIFO Tail - RW */ 88 + #define E1000_TDFHS 0x03420 /* Tx Data FIFO Head Saved - RW */ 89 + #define E1000_TDFTS 0x03428 /* Tx Data FIFO Tail Saved - RW */ 90 + #define E1000_TDFPC 0x03430 /* Tx Data FIFO Packet Count - RW */ 91 91 92 92 static const struct e1000_reg_info e1000_reg_info_tbl[] = { 93 93 ··· 99 99 /* Interrupt Registers */ 100 100 {E1000_ICR, "ICR"}, 101 101 102 - /* RX Registers */ 102 + /* Rx Registers */ 103 103 {E1000_RCTL, "RCTL"}, 104 104 {E1000_RDLEN, "RDLEN"}, 105 105 {E1000_RDH, "RDH"}, ··· 115 115 {E1000_RDFTS, "RDFTS"}, 116 116 {E1000_RDFPC, "RDFPC"}, 117 117 118 - /* TX Registers */ 118 + /* Tx Registers */ 119 119 {E1000_TCTL, "TCTL"}, 120 120 {E1000_TDBAL, "TDBAL"}, 121 121 {E1000_TDBAH, "TDBAH"}, ··· 160 160 break; 161 161 default: 162 162 printk(KERN_INFO "%-15s %08x\n", 163 - reginfo->name, __er32(hw, reginfo->ofs)); 163 + reginfo->name, __er32(hw, reginfo->ofs)); 164 164 return; 165 165 } 166 166 ··· 171 171 printk(KERN_CONT "\n"); 172 172 } 173 173 174 - 175 174 /* 176 - * e1000e_dump - Print registers, tx-ring and rx-ring 175 + * e1000e_dump - Print registers, Tx-ring and Rx-ring 177 176 */ 178 177 static void e1000e_dump(struct e1000_adapter *adapter) 179 178 { ··· 181 182 struct e1000_reg_info *reginfo; 182 183 struct e1000_ring *tx_ring = adapter->tx_ring; 183 184 struct e1000_tx_desc *tx_desc; 184 - struct my_u0 { u64 a; u64 b; } *u0; 185 + struct my_u0 { 186 + u64 a; 187 + u64 b; 188 + } *u0; 185 189 struct e1000_buffer *buffer_info; 186 190 struct e1000_ring *rx_ring = adapter->rx_ring; 187 191 union e1000_rx_desc_packet_split *rx_desc_ps; 188 192 struct e1000_rx_desc *rx_desc; 189 - struct my_u1 { u64 a; u64 b; u64 c; u64 d; } *u1; 193 + struct my_u1 { 194 + u64 a; 195 + u64 b; 196 + u64 c; 197 + u64 d; 198 + } *u1; 190 199 u32 staterr; 191 200 int i = 0; 192 201 ··· 205 198 if (netdev) { 206 199 dev_info(&adapter->pdev->dev, "Net device Info\n"); 207 200 printk(KERN_INFO "Device Name state " 208 - "trans_start last_rx\n"); 201 + "trans_start last_rx\n"); 209 202 printk(KERN_INFO "%-15s %016lX %016lX %016lX\n", 210 - netdev->name, 211 - netdev->state, 212 - netdev->trans_start, 213 - netdev->last_rx); 203 + netdev->name, netdev->state, netdev->trans_start, 204 + netdev->last_rx); 214 205 } 215 206 216 207 /* Print Registers */ ··· 219 214 e1000_regdump(hw, reginfo); 220 215 } 221 216 222 - /* Print TX Ring Summary */ 217 + /* Print Tx Ring Summary */ 223 218 if (!netdev || !netif_running(netdev)) 224 219 goto exit; 225 220 226 - dev_info(&adapter->pdev->dev, "TX Rings Summary\n"); 221 + dev_info(&adapter->pdev->dev, "Tx Ring Summary\n"); 227 222 printk(KERN_INFO "Queue [NTU] [NTC] [bi(ntc)->dma ]" 228 - " leng ntw timestamp\n"); 223 + " leng ntw timestamp\n"); 229 224 buffer_info = &tx_ring->buffer_info[tx_ring->next_to_clean]; 230 225 printk(KERN_INFO " %5d %5X %5X %016llX %04X %3X %016llX\n", 231 - 0, tx_ring->next_to_use, tx_ring->next_to_clean, 232 - (unsigned long long)buffer_info->dma, 233 - buffer_info->length, 234 - buffer_info->next_to_watch, 235 - (unsigned long long)buffer_info->time_stamp); 226 + 0, tx_ring->next_to_use, tx_ring->next_to_clean, 227 + (unsigned long long)buffer_info->dma, 228 + buffer_info->length, 229 + buffer_info->next_to_watch, 230 + (unsigned long long)buffer_info->time_stamp); 236 231 237 - /* Print TX Rings */ 232 + /* Print Tx Ring */ 238 233 if (!netif_msg_tx_done(adapter)) 239 234 goto rx_ring_summary; 240 235 241 - dev_info(&adapter->pdev->dev, "TX Rings Dump\n"); 236 + dev_info(&adapter->pdev->dev, "Tx Ring Dump\n"); 242 237 243 238 /* Transmit Descriptor Formats - DEXT[29] is 0 (Legacy) or 1 (Extended) 244 239 * ··· 268 263 * 63 48 47 40 39 36 35 32 31 24 23 20 19 0 269 264 */ 270 265 printk(KERN_INFO "Tl[desc] [address 63:0 ] [SpeCssSCmCsLen]" 271 - " [bi->dma ] leng ntw timestamp bi->skb " 272 - "<-- Legacy format\n"); 266 + " [bi->dma ] leng ntw timestamp bi->skb " 267 + "<-- Legacy format\n"); 273 268 printk(KERN_INFO "Tc[desc] [Ce CoCsIpceCoS] [MssHlRSCm0Plen]" 274 - " [bi->dma ] leng ntw timestamp bi->skb " 275 - "<-- Ext Context format\n"); 269 + " [bi->dma ] leng ntw timestamp bi->skb " 270 + "<-- Ext Context format\n"); 276 271 printk(KERN_INFO "Td[desc] [address 63:0 ] [VlaPoRSCm1Dlen]" 277 - " [bi->dma ] leng ntw timestamp bi->skb " 278 - "<-- Ext Data format\n"); 272 + " [bi->dma ] leng ntw timestamp bi->skb " 273 + "<-- Ext Data format\n"); 279 274 for (i = 0; tx_ring->desc && (i < tx_ring->count); i++) { 280 275 tx_desc = E1000_TX_DESC(*tx_ring, i); 281 276 buffer_info = &tx_ring->buffer_info[i]; 282 277 u0 = (struct my_u0 *)tx_desc; 283 278 printk(KERN_INFO "T%c[0x%03X] %016llX %016llX %016llX " 284 - "%04X %3X %016llX %p", 285 - (!(le64_to_cpu(u0->b) & (1<<29)) ? 'l' : 286 - ((le64_to_cpu(u0->b) & (1<<20)) ? 'd' : 'c')), i, 279 + "%04X %3X %016llX %p", 280 + (!(le64_to_cpu(u0->b) & (1 << 29)) ? 'l' : 281 + ((le64_to_cpu(u0->b) & (1 << 20)) ? 'd' : 'c')), i, 287 282 (unsigned long long)le64_to_cpu(u0->a), 288 283 (unsigned long long)le64_to_cpu(u0->b), 289 284 (unsigned long long)buffer_info->dma, ··· 301 296 302 297 if (netif_msg_pktdata(adapter) && buffer_info->dma != 0) 303 298 print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS, 304 - 16, 1, phys_to_virt(buffer_info->dma), 305 - buffer_info->length, true); 299 + 16, 1, phys_to_virt(buffer_info->dma), 300 + buffer_info->length, true); 306 301 } 307 302 308 - /* Print RX Rings Summary */ 303 + /* Print Rx Ring Summary */ 309 304 rx_ring_summary: 310 - dev_info(&adapter->pdev->dev, "RX Rings Summary\n"); 305 + dev_info(&adapter->pdev->dev, "Rx Ring Summary\n"); 311 306 printk(KERN_INFO "Queue [NTU] [NTC]\n"); 312 307 printk(KERN_INFO " %5d %5X %5X\n", 0, 313 - rx_ring->next_to_use, rx_ring->next_to_clean); 308 + rx_ring->next_to_use, rx_ring->next_to_clean); 314 309 315 - /* Print RX Rings */ 310 + /* Print Rx Ring */ 316 311 if (!netif_msg_rx_status(adapter)) 317 312 goto exit; 318 313 319 - dev_info(&adapter->pdev->dev, "RX Rings Dump\n"); 314 + dev_info(&adapter->pdev->dev, "Rx Ring Dump\n"); 320 315 switch (adapter->rx_ps_pages) { 321 316 case 1: 322 317 case 2: ··· 334 329 * +-----------------------------------------------------+ 335 330 */ 336 331 printk(KERN_INFO "R [desc] [buffer 0 63:0 ] " 337 - "[buffer 1 63:0 ] " 332 + "[buffer 1 63:0 ] " 338 333 "[buffer 2 63:0 ] [buffer 3 63:0 ] [bi->dma ] " 339 334 "[bi->skb] <-- Ext Pkt Split format\n"); 340 335 /* [Extended] Receive Descriptor (Write-Back) Format ··· 349 344 * 63 48 47 32 31 20 19 0 350 345 */ 351 346 printk(KERN_INFO "RWB[desc] [ck ipid mrqhsh] " 352 - "[vl l0 ee es] " 347 + "[vl l0 ee es] " 353 348 "[ l3 l2 l1 hs] [reserved ] ---------------- " 354 349 "[bi->skb] <-- Ext Rx Write-Back format\n"); 355 350 for (i = 0; i < rx_ring->count; i++) { ··· 357 352 rx_desc_ps = E1000_RX_DESC_PS(*rx_ring, i); 358 353 u1 = (struct my_u1 *)rx_desc_ps; 359 354 staterr = 360 - le32_to_cpu(rx_desc_ps->wb.middle.status_error); 355 + le32_to_cpu(rx_desc_ps->wb.middle.status_error); 361 356 if (staterr & E1000_RXD_STAT_DD) { 362 357 /* Descriptor Done */ 363 358 printk(KERN_INFO "RWB[0x%03X] %016llX " 364 - "%016llX %016llX %016llX " 365 - "---------------- %p", i, 366 - (unsigned long long)le64_to_cpu(u1->a), 367 - (unsigned long long)le64_to_cpu(u1->b), 368 - (unsigned long long)le64_to_cpu(u1->c), 369 - (unsigned long long)le64_to_cpu(u1->d), 370 - buffer_info->skb); 359 + "%016llX %016llX %016llX " 360 + "---------------- %p", i, 361 + (unsigned long long)le64_to_cpu(u1->a), 362 + (unsigned long long)le64_to_cpu(u1->b), 363 + (unsigned long long)le64_to_cpu(u1->c), 364 + (unsigned long long)le64_to_cpu(u1->d), 365 + buffer_info->skb); 371 366 } else { 372 367 printk(KERN_INFO "R [0x%03X] %016llX " 373 - "%016llX %016llX %016llX %016llX %p", i, 374 - (unsigned long long)le64_to_cpu(u1->a), 375 - (unsigned long long)le64_to_cpu(u1->b), 376 - (unsigned long long)le64_to_cpu(u1->c), 377 - (unsigned long long)le64_to_cpu(u1->d), 378 - (unsigned long long)buffer_info->dma, 379 - buffer_info->skb); 368 + "%016llX %016llX %016llX %016llX %p", i, 369 + (unsigned long long)le64_to_cpu(u1->a), 370 + (unsigned long long)le64_to_cpu(u1->b), 371 + (unsigned long long)le64_to_cpu(u1->c), 372 + (unsigned long long)le64_to_cpu(u1->d), 373 + (unsigned long long)buffer_info->dma, 374 + buffer_info->skb); 380 375 381 376 if (netif_msg_pktdata(adapter)) 382 377 print_hex_dump(KERN_INFO, "", ··· 405 400 * 63 48 47 40 39 32 31 16 15 0 406 401 */ 407 402 printk(KERN_INFO "Rl[desc] [address 63:0 ] " 408 - "[vl er S cks ln] [bi->dma ] [bi->skb] " 409 - "<-- Legacy format\n"); 403 + "[vl er S cks ln] [bi->dma ] [bi->skb] " 404 + "<-- Legacy format\n"); 410 405 for (i = 0; rx_ring->desc && (i < rx_ring->count); i++) { 411 406 rx_desc = E1000_RX_DESC(*rx_ring, i); 412 407 buffer_info = &rx_ring->buffer_info[i]; 413 408 u0 = (struct my_u0 *)rx_desc; 414 409 printk(KERN_INFO "Rl[0x%03X] %016llX %016llX " 415 - "%016llX %p", i, 416 - (unsigned long long)le64_to_cpu(u0->a), 417 - (unsigned long long)le64_to_cpu(u0->b), 418 - (unsigned long long)buffer_info->dma, 419 - buffer_info->skb); 410 + "%016llX %p", i, 411 + (unsigned long long)le64_to_cpu(u0->a), 412 + (unsigned long long)le64_to_cpu(u0->b), 413 + (unsigned long long)buffer_info->dma, 414 + buffer_info->skb); 420 415 if (i == rx_ring->next_to_use) 421 416 printk(KERN_CONT " NTU\n"); 422 417 else if (i == rx_ring->next_to_clean) ··· 426 421 427 422 if (netif_msg_pktdata(adapter)) 428 423 print_hex_dump(KERN_INFO, "", 429 - DUMP_PREFIX_ADDRESS, 430 - 16, 1, phys_to_virt(buffer_info->dma), 431 - adapter->rx_buffer_len, true); 424 + DUMP_PREFIX_ADDRESS, 425 + 16, 1, 426 + phys_to_virt(buffer_info->dma), 427 + adapter->rx_buffer_len, true); 432 428 } 433 429 } 434 430 ··· 456 450 * @skb: pointer to sk_buff to be indicated to stack 457 451 **/ 458 452 static void e1000_receive_skb(struct e1000_adapter *adapter, 459 - struct net_device *netdev, 460 - struct sk_buff *skb, 453 + struct net_device *netdev, struct sk_buff *skb, 461 454 u8 status, __le16 vlan) 462 455 { 463 456 skb->protocol = eth_type_trans(skb, netdev); ··· 469 464 } 470 465 471 466 /** 472 - * e1000_rx_checksum - Receive Checksum Offload for 82543 467 + * e1000_rx_checksum - Receive Checksum Offload 473 468 * @adapter: board private structure 474 469 * @status_err: receive descriptor status and error fields 475 470 * @csum: receive descriptor csum field ··· 553 548 adapter->rx_buffer_len, 554 549 DMA_FROM_DEVICE); 555 550 if (dma_mapping_error(&pdev->dev, buffer_info->dma)) { 556 - dev_err(&pdev->dev, "RX DMA map failed\n"); 551 + dev_err(&pdev->dev, "Rx DMA map failed\n"); 557 552 adapter->rx_dma_failed++; 558 553 break; 559 554 } ··· 606 601 ps_page = &buffer_info->ps_pages[j]; 607 602 if (j >= adapter->rx_ps_pages) { 608 603 /* all unused desc entries get hw null ptr */ 609 - rx_desc->read.buffer_addr[j+1] = ~cpu_to_le64(0); 604 + rx_desc->read.buffer_addr[j + 1] = 605 + ~cpu_to_le64(0); 610 606 continue; 611 607 } 612 608 if (!ps_page->page) { ··· 623 617 if (dma_mapping_error(&pdev->dev, 624 618 ps_page->dma)) { 625 619 dev_err(&adapter->pdev->dev, 626 - "RX DMA page map failed\n"); 620 + "Rx DMA page map failed\n"); 627 621 adapter->rx_dma_failed++; 628 622 goto no_buffers; 629 623 } ··· 633 627 * didn't change because each write-back 634 628 * erases this info. 635 629 */ 636 - rx_desc->read.buffer_addr[j+1] = 637 - cpu_to_le64(ps_page->dma); 630 + rx_desc->read.buffer_addr[j + 1] = 631 + cpu_to_le64(ps_page->dma); 638 632 } 639 633 640 634 skb = netdev_alloc_skb_ip_align(netdev, ··· 650 644 adapter->rx_ps_bsize0, 651 645 DMA_FROM_DEVICE); 652 646 if (dma_mapping_error(&pdev->dev, buffer_info->dma)) { 653 - dev_err(&pdev->dev, "RX DMA map failed\n"); 647 + dev_err(&pdev->dev, "Rx DMA map failed\n"); 654 648 adapter->rx_dma_failed++; 655 649 /* cleanup skb */ 656 650 dev_kfree_skb_any(skb); ··· 668 662 * such as IA-64). 669 663 */ 670 664 wmb(); 671 - writel(i<<1, adapter->hw.hw_addr + rx_ring->tail); 665 + writel(i << 1, adapter->hw.hw_addr + rx_ring->tail); 672 666 } 673 667 674 668 i++; ··· 1112 1106 cleaned = 1; 1113 1107 cleaned_count++; 1114 1108 dma_unmap_single(&pdev->dev, buffer_info->dma, 1115 - adapter->rx_ps_bsize0, 1116 - DMA_FROM_DEVICE); 1109 + adapter->rx_ps_bsize0, DMA_FROM_DEVICE); 1117 1110 buffer_info->dma = 0; 1118 1111 1119 - /* see !EOP comment in other rx routine */ 1112 + /* see !EOP comment in other Rx routine */ 1120 1113 if (!(staterr & E1000_RXD_STAT_EOP)) 1121 1114 adapter->flags2 |= FLAG2_IS_DISCARDING; 1122 1115 ··· 2615 2610 } 2616 2611 2617 2612 /** 2618 - * e1000_configure_tx - Configure 8254x Transmit Unit after Reset 2613 + * e1000_configure_tx - Configure Transmit Unit after Reset 2619 2614 * @adapter: board private structure 2620 2615 * 2621 2616 * Configure the Tx unit of the MAC after a reset. ··· 2668 2663 * hthresh = 1 ==> prefetch when one or more available 2669 2664 * pthresh = 0x1f ==> prefetch if internal cache 31 or less 2670 2665 * BEWARE: this seems to work but should be considered first if 2671 - * there are tx hangs or other tx related bugs 2666 + * there are Tx hangs or other Tx related bugs 2672 2667 */ 2673 2668 txdctl |= E1000_TXDCTL_DMA_BURST_ENABLE; 2674 2669 ew32(TXDCTL(0), txdctl); ··· 2882 2877 if (adapter->rx_ps_pages) { 2883 2878 /* this is a 32 byte descriptor */ 2884 2879 rdlen = rx_ring->count * 2885 - sizeof(union e1000_rx_desc_packet_split); 2880 + sizeof(union e1000_rx_desc_packet_split); 2886 2881 adapter->clean_rx = e1000_clean_rx_irq_ps; 2887 2882 adapter->alloc_rx_buf = e1000_alloc_rx_buffers_ps; 2888 2883 } else if (adapter->netdev->mtu > ETH_FRAME_LEN + ETH_FCS_LEN) { ··· 2905 2900 /* 2906 2901 * set the writeback threshold (only takes effect if the RDTR 2907 2902 * is set). set GRAN=1 and write back up to 0x4 worth, and 2908 - * enable prefetching of 0x20 rx descriptors 2903 + * enable prefetching of 0x20 Rx descriptors 2909 2904 * granularity = 01 2910 2905 * wthresh = 04, 2911 2906 * hthresh = 04, ··· 2986 2981 * excessive C-state transition latencies result in 2987 2982 * dropped transactions. 2988 2983 */ 2989 - pm_qos_update_request( 2990 - &adapter->netdev->pm_qos_req, 55); 2984 + pm_qos_update_request(&adapter->netdev->pm_qos_req, 55); 2991 2985 } else { 2992 - pm_qos_update_request( 2993 - &adapter->netdev->pm_qos_req, 2994 - PM_QOS_DEFAULT_VALUE); 2986 + pm_qos_update_request(&adapter->netdev->pm_qos_req, 2987 + PM_QOS_DEFAULT_VALUE); 2995 2988 } 2996 2989 } 2997 2990 ··· 3155 3152 /* lower 16 bits has Rx packet buffer allocation size in KB */ 3156 3153 pba &= 0xffff; 3157 3154 /* 3158 - * the Tx fifo also stores 16 bytes of information about the tx 3155 + * the Tx fifo also stores 16 bytes of information about the Tx 3159 3156 * but don't include ethernet FCS because hardware appends it 3160 3157 */ 3161 3158 min_tx_space = (adapter->max_frame_size + ··· 3178 3175 pba -= min_tx_space - tx_space; 3179 3176 3180 3177 /* 3181 - * if short on Rx space, Rx wins and must trump tx 3178 + * if short on Rx space, Rx wins and must trump Tx 3182 3179 * adjustment or use Early Receive if available 3183 3180 */ 3184 3181 if ((pba < min_rx_space) && ··· 4042 4039 adapter->netdev->name, 4043 4040 adapter->link_speed, 4044 4041 (adapter->link_duplex == FULL_DUPLEX) ? 4045 - "Full Duplex" : "Half Duplex", 4042 + "Full Duplex" : "Half Duplex", 4046 4043 ((ctrl & E1000_CTRL_TFCE) && (ctrl & E1000_CTRL_RFCE)) ? 4047 - "RX/TX" : 4048 - ((ctrl & E1000_CTRL_RFCE) ? "RX" : 4049 - ((ctrl & E1000_CTRL_TFCE) ? "TX" : "None" ))); 4044 + "Rx/Tx" : 4045 + ((ctrl & E1000_CTRL_RFCE) ? "Rx" : 4046 + ((ctrl & E1000_CTRL_TFCE) ? "Tx" : "None"))); 4050 4047 } 4051 4048 4052 4049 static bool e1000e_has_link(struct e1000_adapter *adapter) ··· 4341 4338 /* Force detection of hung controller every watchdog period */ 4342 4339 adapter->detect_tx_hung = 1; 4343 4340 4344 - /* flush partial descriptors to memory before detecting tx hang */ 4341 + /* flush partial descriptors to memory before detecting Tx hang */ 4345 4342 if (adapter->flags2 & FLAG2_DMA_BURST) { 4346 4343 ew32(TIDV, adapter->tx_int_delay | E1000_TIDV_FPD); 4347 4344 ew32(RDTR, adapter->rx_int_delay | E1000_RDTR_FPD); ··· 4532 4529 buffer_info->next_to_watch = i; 4533 4530 buffer_info->dma = dma_map_single(&pdev->dev, 4534 4531 skb->data + offset, 4535 - size, DMA_TO_DEVICE); 4532 + size, DMA_TO_DEVICE); 4536 4533 buffer_info->mapped_as_page = false; 4537 4534 if (dma_mapping_error(&pdev->dev, buffer_info->dma)) 4538 4535 goto dma_error; ··· 4579 4576 } 4580 4577 } 4581 4578 4582 - segs = skb_shinfo(skb)->gso_segs ?: 1; 4579 + segs = skb_shinfo(skb)->gso_segs ? : 1; 4583 4580 /* multiply data chunks by size of headers */ 4584 4581 bytecount = ((segs - 1) * skb_headlen(skb)) + skb->len; 4585 4582 ··· 4591 4588 return count; 4592 4589 4593 4590 dma_error: 4594 - dev_err(&pdev->dev, "TX DMA map failed\n"); 4591 + dev_err(&pdev->dev, "Tx DMA map failed\n"); 4595 4592 buffer_info->dma = 0; 4596 4593 if (count) 4597 4594 count--; 4598 4595 4599 4596 while (count--) { 4600 - if (i==0) 4597 + if (i == 0) 4601 4598 i += tx_ring->count; 4602 4599 i--; 4603 4600 buffer_info = &tx_ring->buffer_info[i]; ··· 6196 6193 int ret; 6197 6194 pr_info("Intel(R) PRO/1000 Network Driver - %s\n", 6198 6195 e1000e_driver_version); 6199 - pr_info("Copyright (c) 1999 - 2010 Intel Corporation.\n"); 6196 + pr_info("Copyright(c) 1999 - 2011 Intel Corporation.\n"); 6200 6197 ret = pci_register_driver(&e1000_driver); 6201 6198 6202 6199 return ret;
+3 -3
drivers/net/e1000e/param.c
··· 1 1 /******************************************************************************* 2 2 3 3 Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2010 Intel Corporation. 4 + Copyright(c) 1999 - 2011 Intel Corporation. 5 5 6 6 This program is free software; you can redistribute it and/or modify it 7 7 under the terms and conditions of the GNU General Public License, ··· 62 62 module_param_array_named(X, X, int, &num_##X, 0); \ 63 63 MODULE_PARM_DESC(X, desc); 64 64 65 - 66 65 /* 67 66 * Transmit Interrupt Delay in units of 1.024 microseconds 68 - * Tx interrupt delay needs to typically be set to something non zero 67 + * Tx interrupt delay needs to typically be set to something non-zero 69 68 * 70 69 * Valid Range: 0-65535 71 70 */ ··· 111 112 #define DEFAULT_ITR 3 112 113 #define MAX_ITR 100000 113 114 #define MIN_ITR 100 115 + 114 116 /* IntMode (Interrupt Mode) 115 117 * 116 118 * Valid Range: 0 - 2
+2 -2
drivers/net/e1000e/phy.c
··· 1 1 /******************************************************************************* 2 2 3 3 Intel PRO/1000 Linux driver 4 - Copyright(c) 1999 - 2010 Intel Corporation. 4 + Copyright(c) 1999 - 2011 Intel Corporation. 5 5 6 6 This program is free software; you can redistribute it and/or modify it 7 7 under the terms and conditions of the GNU General Public License, ··· 640 640 s32 ret_val; 641 641 u16 phy_data; 642 642 643 - /* Enable CRS on TX. This must be set for half-duplex operation. */ 643 + /* Enable CRS on Tx. This must be set for half-duplex operation. */ 644 644 ret_val = e1e_rphy(hw, I82577_CFG_REG, &phy_data); 645 645 if (ret_val) 646 646 goto out;
+4 -6
drivers/net/gianfar.c
··· 434 434 static struct net_device_stats *gfar_get_stats(struct net_device *dev) 435 435 { 436 436 struct gfar_private *priv = netdev_priv(dev); 437 - struct netdev_queue *txq; 438 437 unsigned long rx_packets = 0, rx_bytes = 0, rx_dropped = 0; 439 438 unsigned long tx_packets = 0, tx_bytes = 0; 440 439 int i = 0; ··· 449 450 dev->stats.rx_dropped = rx_dropped; 450 451 451 452 for (i = 0; i < priv->num_tx_queues; i++) { 452 - txq = netdev_get_tx_queue(dev, i); 453 - tx_bytes += txq->tx_bytes; 454 - tx_packets += txq->tx_packets; 453 + tx_bytes += priv->tx_queue[i]->stats.tx_bytes; 454 + tx_packets += priv->tx_queue[i]->stats.tx_packets; 455 455 } 456 456 457 457 dev->stats.tx_bytes = tx_bytes; ··· 2107 2109 } 2108 2110 2109 2111 /* Update transmit stats */ 2110 - txq->tx_bytes += skb->len; 2111 - txq->tx_packets ++; 2112 + tx_queue->stats.tx_bytes += skb->len; 2113 + tx_queue->stats.tx_packets++; 2112 2114 2113 2115 txbdp = txbdp_start = tx_queue->cur_tx; 2114 2116 lstatus = txbdp->lstatus;
+10
drivers/net/gianfar.h
··· 907 907 MQ_MG_MODE 908 908 }; 909 909 910 + /* 911 + * Per TX queue stats 912 + */ 913 + struct tx_q_stats { 914 + unsigned long tx_packets; 915 + unsigned long tx_bytes; 916 + }; 917 + 910 918 /** 911 919 * struct gfar_priv_tx_q - per tx queue structure 912 920 * @txlock: per queue tx spin lock 913 921 * @tx_skbuff:skb pointers 914 922 * @skb_curtx: to be used skb pointer 915 923 * @skb_dirtytx:the last used skb pointer 924 + * @stats: bytes/packets stats 916 925 * @qindex: index of this queue 917 926 * @dev: back pointer to the dev structure 918 927 * @grp: back pointer to the group to which this queue belongs ··· 943 934 struct txbd8 *tx_bd_base; 944 935 struct txbd8 *cur_tx; 945 936 struct txbd8 *dirty_tx; 937 + struct tx_q_stats stats; 946 938 struct net_device *dev; 947 939 struct gfar_priv_grp *grp; 948 940 u16 skb_curtx;
+131 -90
drivers/net/greth.c
··· 1 1 /* 2 2 * Aeroflex Gaisler GRETH 10/100/1G Ethernet MAC. 3 3 * 4 - * 2005-2009 (c) Aeroflex Gaisler AB 4 + * 2005-2010 (c) Aeroflex Gaisler AB 5 5 * 6 6 * This driver supports GRETH 10/100 and GRETH 10/100/1G Ethernet MACs 7 7 * available in the GRLIB VHDL IP core library. ··· 356 356 dev_dbg(&dev->dev, " starting queue\n"); 357 357 netif_start_queue(dev); 358 358 359 + GRETH_REGSAVE(greth->regs->status, 0xFF); 360 + 359 361 napi_enable(&greth->napi); 360 362 361 363 greth_enable_irqs(greth); ··· 373 371 374 372 napi_disable(&greth->napi); 375 373 374 + greth_disable_irqs(greth); 376 375 greth_disable_tx(greth); 376 + greth_disable_rx(greth); 377 377 378 378 netif_stop_queue(dev); 379 379 ··· 392 388 struct greth_private *greth = netdev_priv(dev); 393 389 struct greth_bd *bdp; 394 390 int err = NETDEV_TX_OK; 395 - u32 status, dma_addr; 391 + u32 status, dma_addr, ctrl; 392 + unsigned long flags; 396 393 397 - bdp = greth->tx_bd_base + greth->tx_next; 394 + /* Clean TX Ring */ 395 + greth_clean_tx(greth->netdev); 398 396 399 397 if (unlikely(greth->tx_free <= 0)) { 398 + spin_lock_irqsave(&greth->devlock, flags);/*save from poll/irq*/ 399 + ctrl = GRETH_REGLOAD(greth->regs->control); 400 + /* Enable TX IRQ only if not already in poll() routine */ 401 + if (ctrl & GRETH_RXI) 402 + GRETH_REGSAVE(greth->regs->control, ctrl | GRETH_TXI); 400 403 netif_stop_queue(dev); 404 + spin_unlock_irqrestore(&greth->devlock, flags); 401 405 return NETDEV_TX_BUSY; 402 406 } 403 407 ··· 418 406 goto out; 419 407 } 420 408 409 + bdp = greth->tx_bd_base + greth->tx_next; 421 410 dma_addr = greth_read_bd(&bdp->addr); 422 411 423 412 memcpy((unsigned char *) phys_to_virt(dma_addr), skb->data, skb->len); 424 413 425 414 dma_sync_single_for_device(greth->dev, dma_addr, skb->len, DMA_TO_DEVICE); 426 415 427 - status = GRETH_BD_EN | (skb->len & GRETH_BD_LEN); 416 + status = GRETH_BD_EN | GRETH_BD_IE | (skb->len & GRETH_BD_LEN); 428 417 429 418 /* Wrap around descriptor ring */ 430 419 if (greth->tx_next == GRETH_TXBD_NUM_MASK) { ··· 435 422 greth->tx_next = NEXT_TX(greth->tx_next); 436 423 greth->tx_free--; 437 424 438 - /* No more descriptors */ 439 - if (unlikely(greth->tx_free == 0)) { 440 - 441 - /* Free transmitted descriptors */ 442 - greth_clean_tx(dev); 443 - 444 - /* If nothing was cleaned, stop queue & wait for irq */ 445 - if (unlikely(greth->tx_free == 0)) { 446 - status |= GRETH_BD_IE; 447 - netif_stop_queue(dev); 448 - } 449 - } 450 - 451 425 /* Write descriptor control word and enable transmission */ 452 426 greth_write_bd(&bdp->stat, status); 427 + spin_lock_irqsave(&greth->devlock, flags); /*save from poll/irq*/ 453 428 greth_enable_tx(greth); 429 + spin_unlock_irqrestore(&greth->devlock, flags); 454 430 455 431 out: 456 432 dev_kfree_skb(skb); ··· 452 450 { 453 451 struct greth_private *greth = netdev_priv(dev); 454 452 struct greth_bd *bdp; 455 - u32 status = 0, dma_addr; 453 + u32 status = 0, dma_addr, ctrl; 456 454 int curr_tx, nr_frags, i, err = NETDEV_TX_OK; 455 + unsigned long flags; 457 456 458 457 nr_frags = skb_shinfo(skb)->nr_frags; 459 458 459 + /* Clean TX Ring */ 460 + greth_clean_tx_gbit(dev); 461 + 460 462 if (greth->tx_free < nr_frags + 1) { 463 + spin_lock_irqsave(&greth->devlock, flags);/*save from poll/irq*/ 464 + ctrl = GRETH_REGLOAD(greth->regs->control); 465 + /* Enable TX IRQ only if not already in poll() routine */ 466 + if (ctrl & GRETH_RXI) 467 + GRETH_REGSAVE(greth->regs->control, ctrl | GRETH_TXI); 461 468 netif_stop_queue(dev); 469 + spin_unlock_irqrestore(&greth->devlock, flags); 462 470 err = NETDEV_TX_BUSY; 463 471 goto out; 464 472 } ··· 511 499 greth->tx_skbuff[curr_tx] = NULL; 512 500 bdp = greth->tx_bd_base + curr_tx; 513 501 514 - status = GRETH_TXBD_CSALL; 502 + status = GRETH_TXBD_CSALL | GRETH_BD_EN; 515 503 status |= frag->size & GRETH_BD_LEN; 516 504 517 505 /* Wrap around descriptor ring */ ··· 521 509 /* More fragments left */ 522 510 if (i < nr_frags - 1) 523 511 status |= GRETH_TXBD_MORE; 524 - 525 - /* ... last fragment, check if out of descriptors */ 526 - else if (greth->tx_free - nr_frags - 1 < (MAX_SKB_FRAGS + 1)) { 527 - 528 - /* Enable interrupts and stop queue */ 529 - status |= GRETH_BD_IE; 530 - netif_stop_queue(dev); 531 - } 512 + else 513 + status |= GRETH_BD_IE; /* enable IRQ on last fragment */ 532 514 533 515 greth_write_bd(&bdp->stat, status); 534 516 ··· 542 536 543 537 wmb(); 544 538 545 - /* Enable the descriptors that we configured ... */ 546 - for (i = 0; i < nr_frags + 1; i++) { 547 - bdp = greth->tx_bd_base + greth->tx_next; 548 - greth_write_bd(&bdp->stat, greth_read_bd(&bdp->stat) | GRETH_BD_EN); 549 - greth->tx_next = NEXT_TX(greth->tx_next); 550 - greth->tx_free--; 551 - } 539 + /* Enable the descriptor chain by enabling the first descriptor */ 540 + bdp = greth->tx_bd_base + greth->tx_next; 541 + greth_write_bd(&bdp->stat, greth_read_bd(&bdp->stat) | GRETH_BD_EN); 542 + greth->tx_next = curr_tx; 543 + greth->tx_free -= nr_frags + 1; 552 544 545 + wmb(); 546 + 547 + spin_lock_irqsave(&greth->devlock, flags); /*save from poll/irq*/ 553 548 greth_enable_tx(greth); 549 + spin_unlock_irqrestore(&greth->devlock, flags); 554 550 555 551 return NETDEV_TX_OK; 556 552 557 553 frag_map_error: 558 - /* Unmap SKB mappings that succeeded */ 554 + /* Unmap SKB mappings that succeeded and disable descriptor */ 559 555 for (i = 0; greth->tx_next + i != curr_tx; i++) { 560 556 bdp = greth->tx_bd_base + greth->tx_next + i; 561 557 dma_unmap_single(greth->dev, 562 558 greth_read_bd(&bdp->addr), 563 559 greth_read_bd(&bdp->stat) & GRETH_BD_LEN, 564 560 DMA_TO_DEVICE); 561 + greth_write_bd(&bdp->stat, 0); 565 562 } 566 563 map_error: 567 564 if (net_ratelimit()) ··· 574 565 return err; 575 566 } 576 567 577 - 578 568 static irqreturn_t greth_interrupt(int irq, void *dev_id) 579 569 { 580 570 struct net_device *dev = dev_id; 581 571 struct greth_private *greth; 582 - u32 status; 572 + u32 status, ctrl; 583 573 irqreturn_t retval = IRQ_NONE; 584 574 585 575 greth = netdev_priv(dev); ··· 588 580 /* Get the interrupt events that caused us to be here. */ 589 581 status = GRETH_REGLOAD(greth->regs->status); 590 582 583 + /* Must see if interrupts are enabled also, INT_TX|INT_RX flags may be 584 + * set regardless of whether IRQ is enabled or not. Especially 585 + * important when shared IRQ. 586 + */ 587 + ctrl = GRETH_REGLOAD(greth->regs->control); 588 + 591 589 /* Handle rx and tx interrupts through poll */ 592 - if (status & (GRETH_INT_RX | GRETH_INT_TX)) { 593 - 594 - /* Clear interrupt status */ 595 - GRETH_REGORIN(greth->regs->status, 596 - status & (GRETH_INT_RX | GRETH_INT_TX)); 597 - 590 + if (((status & (GRETH_INT_RE | GRETH_INT_RX)) && (ctrl & GRETH_RXI)) || 591 + ((status & (GRETH_INT_TE | GRETH_INT_TX)) && (ctrl & GRETH_TXI))) { 598 592 retval = IRQ_HANDLED; 599 593 600 594 /* Disable interrupts and schedule poll() */ ··· 620 610 621 611 while (1) { 622 612 bdp = greth->tx_bd_base + greth->tx_last; 613 + GRETH_REGSAVE(greth->regs->status, GRETH_INT_TE | GRETH_INT_TX); 614 + mb(); 623 615 stat = greth_read_bd(&bdp->stat); 624 616 625 617 if (unlikely(stat & GRETH_BD_EN)) ··· 682 670 683 671 /* We only clean fully completed SKBs */ 684 672 bdp_last_frag = greth->tx_bd_base + SKIP_TX(greth->tx_last, nr_frags); 685 - stat = bdp_last_frag->stat; 673 + 674 + GRETH_REGSAVE(greth->regs->status, GRETH_INT_TE | GRETH_INT_TX); 675 + mb(); 676 + stat = greth_read_bd(&bdp_last_frag->stat); 686 677 687 678 if (stat & GRETH_BD_EN) 688 679 break; ··· 717 702 greth->tx_free += nr_frags+1; 718 703 dev_kfree_skb(skb); 719 704 } 720 - if (greth->tx_free > (MAX_SKB_FRAGS + 1)) { 721 - netif_wake_queue(dev); 722 - } 723 - } 724 705 725 - static int greth_pending_packets(struct greth_private *greth) 726 - { 727 - struct greth_bd *bdp; 728 - u32 status; 729 - bdp = greth->rx_bd_base + greth->rx_cur; 730 - status = greth_read_bd(&bdp->stat); 731 - if (status & GRETH_BD_EN) 732 - return 0; 733 - else 734 - return 1; 706 + if (netif_queue_stopped(dev) && (greth->tx_free > (MAX_SKB_FRAGS+1))) 707 + netif_wake_queue(dev); 735 708 } 736 709 737 710 static int greth_rx(struct net_device *dev, int limit) ··· 730 727 int pkt_len; 731 728 int bad, count; 732 729 u32 status, dma_addr; 730 + unsigned long flags; 733 731 734 732 greth = netdev_priv(dev); 735 733 736 734 for (count = 0; count < limit; ++count) { 737 735 738 736 bdp = greth->rx_bd_base + greth->rx_cur; 737 + GRETH_REGSAVE(greth->regs->status, GRETH_INT_RE | GRETH_INT_RX); 738 + mb(); 739 739 status = greth_read_bd(&bdp->stat); 740 - dma_addr = greth_read_bd(&bdp->addr); 741 - bad = 0; 742 740 743 741 if (unlikely(status & GRETH_BD_EN)) { 744 742 break; 745 743 } 744 + 745 + dma_addr = greth_read_bd(&bdp->addr); 746 + bad = 0; 746 747 747 748 /* Check status for errors. */ 748 749 if (unlikely(status & GRETH_RXBD_STATUS)) { ··· 809 802 810 803 dma_sync_single_for_device(greth->dev, dma_addr, MAX_FRAME_SIZE, DMA_FROM_DEVICE); 811 804 805 + spin_lock_irqsave(&greth->devlock, flags); /* save from XMIT */ 812 806 greth_enable_rx(greth); 807 + spin_unlock_irqrestore(&greth->devlock, flags); 813 808 814 809 greth->rx_cur = NEXT_RX(greth->rx_cur); 815 810 } ··· 845 836 int pkt_len; 846 837 int bad, count = 0; 847 838 u32 status, dma_addr; 839 + unsigned long flags; 848 840 849 841 greth = netdev_priv(dev); 850 842 ··· 853 843 854 844 bdp = greth->rx_bd_base + greth->rx_cur; 855 845 skb = greth->rx_skbuff[greth->rx_cur]; 846 + GRETH_REGSAVE(greth->regs->status, GRETH_INT_RE | GRETH_INT_RX); 847 + mb(); 856 848 status = greth_read_bd(&bdp->stat); 857 849 bad = 0; 858 850 ··· 877 865 } 878 866 } 879 867 880 - /* Allocate new skb to replace current */ 881 - newskb = netdev_alloc_skb(dev, MAX_FRAME_SIZE + NET_IP_ALIGN); 882 - 883 - if (!bad && newskb) { 868 + /* Allocate new skb to replace current, not needed if the 869 + * current skb can be reused */ 870 + if (!bad && (newskb=netdev_alloc_skb(dev, MAX_FRAME_SIZE + NET_IP_ALIGN))) { 884 871 skb_reserve(newskb, NET_IP_ALIGN); 885 872 886 873 dma_addr = dma_map_single(greth->dev, ··· 916 905 if (net_ratelimit()) 917 906 dev_warn(greth->dev, "Could not create DMA mapping, dropping packet\n"); 918 907 dev_kfree_skb(newskb); 908 + /* reusing current skb, so it is a drop */ 919 909 dev->stats.rx_dropped++; 920 910 } 911 + } else if (bad) { 912 + /* Bad Frame transfer, the skb is reused */ 913 + dev->stats.rx_dropped++; 921 914 } else { 915 + /* Failed Allocating a new skb. This is rather stupid 916 + * but the current "filled" skb is reused, as if 917 + * transfer failure. One could argue that RX descriptor 918 + * table handling should be divided into cleaning and 919 + * filling as the TX part of the driver 920 + */ 922 921 if (net_ratelimit()) 923 922 dev_warn(greth->dev, "Could not allocate SKB, dropping packet\n"); 923 + /* reusing current skb, so it is a drop */ 924 924 dev->stats.rx_dropped++; 925 925 } 926 926 ··· 942 920 943 921 wmb(); 944 922 greth_write_bd(&bdp->stat, status); 923 + spin_lock_irqsave(&greth->devlock, flags); 945 924 greth_enable_rx(greth); 925 + spin_unlock_irqrestore(&greth->devlock, flags); 946 926 greth->rx_cur = NEXT_RX(greth->rx_cur); 947 927 } 948 928 ··· 956 932 { 957 933 struct greth_private *greth; 958 934 int work_done = 0; 935 + unsigned long flags; 936 + u32 mask, ctrl; 959 937 greth = container_of(napi, struct greth_private, napi); 960 938 961 - if (greth->gbit_mac) { 962 - greth_clean_tx_gbit(greth->netdev); 963 - } else { 964 - greth_clean_tx(greth->netdev); 939 + restart_txrx_poll: 940 + if (netif_queue_stopped(greth->netdev)) { 941 + if (greth->gbit_mac) 942 + greth_clean_tx_gbit(greth->netdev); 943 + else 944 + greth_clean_tx(greth->netdev); 965 945 } 966 946 967 - restart_poll: 968 947 if (greth->gbit_mac) { 969 948 work_done += greth_rx_gbit(greth->netdev, budget - work_done); 970 949 } else { ··· 976 949 977 950 if (work_done < budget) { 978 951 979 - napi_complete(napi); 952 + spin_lock_irqsave(&greth->devlock, flags); 980 953 981 - if (greth_pending_packets(greth)) { 982 - napi_reschedule(napi); 983 - goto restart_poll; 954 + ctrl = GRETH_REGLOAD(greth->regs->control); 955 + if (netif_queue_stopped(greth->netdev)) { 956 + GRETH_REGSAVE(greth->regs->control, 957 + ctrl | GRETH_TXI | GRETH_RXI); 958 + mask = GRETH_INT_RX | GRETH_INT_RE | 959 + GRETH_INT_TX | GRETH_INT_TE; 960 + } else { 961 + GRETH_REGSAVE(greth->regs->control, ctrl | GRETH_RXI); 962 + mask = GRETH_INT_RX | GRETH_INT_RE; 963 + } 964 + 965 + if (GRETH_REGLOAD(greth->regs->status) & mask) { 966 + GRETH_REGSAVE(greth->regs->control, ctrl); 967 + spin_unlock_irqrestore(&greth->devlock, flags); 968 + goto restart_txrx_poll; 969 + } else { 970 + __napi_complete(napi); 971 + spin_unlock_irqrestore(&greth->devlock, flags); 984 972 } 985 973 } 986 974 987 - greth_enable_irqs(greth); 988 975 return work_done; 989 976 } 990 977 ··· 1193 1152 }; 1194 1153 1195 1154 static struct net_device_ops greth_netdev_ops = { 1196 - .ndo_open = greth_open, 1197 - .ndo_stop = greth_close, 1198 - .ndo_start_xmit = greth_start_xmit, 1199 - .ndo_set_mac_address = greth_set_mac_add, 1200 - .ndo_validate_addr = eth_validate_addr, 1155 + .ndo_open = greth_open, 1156 + .ndo_stop = greth_close, 1157 + .ndo_start_xmit = greth_start_xmit, 1158 + .ndo_set_mac_address = greth_set_mac_add, 1159 + .ndo_validate_addr = eth_validate_addr, 1201 1160 }; 1202 1161 1203 1162 static inline int wait_for_mdio(struct greth_private *greth) ··· 1258 1217 struct greth_private *greth = netdev_priv(dev); 1259 1218 struct phy_device *phydev = greth->phy; 1260 1219 unsigned long flags; 1261 - 1262 1220 int status_change = 0; 1221 + u32 ctrl; 1263 1222 1264 1223 spin_lock_irqsave(&greth->devlock, flags); 1265 1224 1266 1225 if (phydev->link) { 1267 1226 1268 1227 if ((greth->speed != phydev->speed) || (greth->duplex != phydev->duplex)) { 1269 - 1270 - GRETH_REGANDIN(greth->regs->control, 1271 - ~(GRETH_CTRL_FD | GRETH_CTRL_SP | GRETH_CTRL_GB)); 1228 + ctrl = GRETH_REGLOAD(greth->regs->control) & 1229 + ~(GRETH_CTRL_FD | GRETH_CTRL_SP | GRETH_CTRL_GB); 1272 1230 1273 1231 if (phydev->duplex) 1274 - GRETH_REGORIN(greth->regs->control, GRETH_CTRL_FD); 1232 + ctrl |= GRETH_CTRL_FD; 1275 1233 1276 - if (phydev->speed == SPEED_100) { 1277 - 1278 - GRETH_REGORIN(greth->regs->control, GRETH_CTRL_SP); 1279 - } 1280 - 1234 + if (phydev->speed == SPEED_100) 1235 + ctrl |= GRETH_CTRL_SP; 1281 1236 else if (phydev->speed == SPEED_1000) 1282 - GRETH_REGORIN(greth->regs->control, GRETH_CTRL_GB); 1237 + ctrl |= GRETH_CTRL_GB; 1283 1238 1239 + GRETH_REGSAVE(greth->regs->control, ctrl); 1284 1240 greth->speed = phydev->speed; 1285 1241 greth->duplex = phydev->duplex; 1286 1242 status_change = 1; ··· 1637 1599 static struct of_device_id greth_of_match[] = { 1638 1600 { 1639 1601 .name = "GAISLER_ETHMAC", 1602 + }, 1603 + { 1604 + .name = "01_01d", 1640 1605 }, 1641 1606 {}, 1642 1607 };
+2
drivers/net/greth.h
··· 23 23 #define GRETH_BD_LEN 0x7FF 24 24 25 25 #define GRETH_TXEN 0x1 26 + #define GRETH_INT_TE 0x2 26 27 #define GRETH_INT_TX 0x8 27 28 #define GRETH_TXI 0x4 28 29 #define GRETH_TXBD_STATUS 0x0001C000 ··· 36 35 #define GRETH_TXBD_ERR_UE 0x4000 37 36 #define GRETH_TXBD_ERR_AL 0x8000 38 37 38 + #define GRETH_INT_RE 0x1 39 39 #define GRETH_INT_RX 0x4 40 40 #define GRETH_RXEN 0x2 41 41 #define GRETH_RXI 0x8
+16 -7
drivers/net/ixgbe/ixgbe_main.c
··· 6667 6667 struct ixgbe_adapter *adapter, 6668 6668 struct ixgbe_ring *tx_ring) 6669 6669 { 6670 - struct net_device *netdev = tx_ring->netdev; 6671 - struct netdev_queue *txq; 6672 6670 unsigned int first; 6673 6671 unsigned int tx_flags = 0; 6674 6672 u8 hdr_len = 0; ··· 6763 6765 /* add the ATR filter if ATR is on */ 6764 6766 if (test_bit(__IXGBE_TX_FDIR_INIT_DONE, &tx_ring->state)) 6765 6767 ixgbe_atr(tx_ring, skb, tx_flags, protocol); 6766 - txq = netdev_get_tx_queue(netdev, tx_ring->queue_index); 6767 - txq->tx_bytes += skb->len; 6768 - txq->tx_packets++; 6769 6768 ixgbe_tx_queue(tx_ring, tx_flags, count, skb->len, hdr_len); 6770 6769 ixgbe_maybe_stop_tx(tx_ring, DESC_NEEDED); 6771 6770 ··· 6920 6925 struct ixgbe_adapter *adapter = netdev_priv(netdev); 6921 6926 int i; 6922 6927 6923 - /* accurate rx/tx bytes/packets stats */ 6924 - dev_txq_stats_fold(netdev, stats); 6925 6928 rcu_read_lock(); 6926 6929 for (i = 0; i < adapter->num_rx_queues; i++) { 6927 6930 struct ixgbe_ring *ring = ACCESS_ONCE(adapter->rx_ring[i]); ··· 6934 6941 } while (u64_stats_fetch_retry_bh(&ring->syncp, start)); 6935 6942 stats->rx_packets += packets; 6936 6943 stats->rx_bytes += bytes; 6944 + } 6945 + } 6946 + 6947 + for (i = 0; i < adapter->num_tx_queues; i++) { 6948 + struct ixgbe_ring *ring = ACCESS_ONCE(adapter->tx_ring[i]); 6949 + u64 bytes, packets; 6950 + unsigned int start; 6951 + 6952 + if (ring) { 6953 + do { 6954 + start = u64_stats_fetch_begin_bh(&ring->syncp); 6955 + packets = ring->stats.packets; 6956 + bytes = ring->stats.bytes; 6957 + } while (u64_stats_fetch_retry_bh(&ring->syncp, start)); 6958 + stats->tx_packets += packets; 6959 + stats->tx_bytes += bytes; 6937 6960 } 6938 6961 } 6939 6962 rcu_read_unlock();
+1 -1
drivers/net/macvtap.c
··· 585 585 rcu_read_lock_bh(); 586 586 vlan = rcu_dereference(q->vlan); 587 587 if (vlan) 588 - netdev_get_tx_queue(vlan->dev, 0)->tx_dropped++; 588 + vlan->dev->stats.tx_dropped++; 589 589 rcu_read_unlock_bh(); 590 590 591 591 return err;
+31 -12
drivers/net/r8169.c
··· 554 554 struct mii_if_info mii; 555 555 struct rtl8169_counters counters; 556 556 u32 saved_wolopts; 557 + 558 + const struct firmware *fw; 557 559 }; 558 560 559 561 MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>"); ··· 1768 1766 } 1769 1767 } 1770 1768 1769 + static void rtl_release_firmware(struct rtl8169_private *tp) 1770 + { 1771 + release_firmware(tp->fw); 1772 + tp->fw = NULL; 1773 + } 1774 + 1775 + static int rtl_apply_firmware(struct rtl8169_private *tp, const char *fw_name) 1776 + { 1777 + const struct firmware **fw = &tp->fw; 1778 + int rc = !*fw; 1779 + 1780 + if (rc) { 1781 + rc = request_firmware(fw, fw_name, &tp->pci_dev->dev); 1782 + if (rc < 0) 1783 + goto out; 1784 + } 1785 + 1786 + /* TODO: release firmware once rtl_phy_write_fw signals failures. */ 1787 + rtl_phy_write_fw(tp, *fw); 1788 + out: 1789 + return rc; 1790 + } 1791 + 1771 1792 static void rtl8169s_hw_phy_config(struct rtl8169_private *tp) 1772 1793 { 1773 1794 static const struct phy_reg phy_reg_init[] = { ··· 2164 2139 { 0x0d, 0xf880 } 2165 2140 }; 2166 2141 void __iomem *ioaddr = tp->mmio_addr; 2167 - const struct firmware *fw; 2168 2142 2169 2143 rtl_writephy_batch(tp, phy_reg_init_0, ARRAY_SIZE(phy_reg_init_0)); 2170 2144 ··· 2227 2203 2228 2204 rtl_writephy(tp, 0x1f, 0x0005); 2229 2205 rtl_writephy(tp, 0x05, 0x001b); 2230 - if (rtl_readphy(tp, 0x06) == 0xbf00 && 2231 - request_firmware(&fw, FIRMWARE_8168D_1, &tp->pci_dev->dev) == 0) { 2232 - rtl_phy_write_fw(tp, fw); 2233 - release_firmware(fw); 2234 - } else { 2206 + if ((rtl_readphy(tp, 0x06) != 0xbf00) || 2207 + (rtl_apply_firmware(tp, FIRMWARE_8168D_1) < 0)) { 2235 2208 netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n"); 2236 2209 } 2237 2210 ··· 2278 2257 { 0x0d, 0xf880 } 2279 2258 }; 2280 2259 void __iomem *ioaddr = tp->mmio_addr; 2281 - const struct firmware *fw; 2282 2260 2283 2261 rtl_writephy_batch(tp, phy_reg_init_0, ARRAY_SIZE(phy_reg_init_0)); 2284 2262 ··· 2332 2312 2333 2313 rtl_writephy(tp, 0x1f, 0x0005); 2334 2314 rtl_writephy(tp, 0x05, 0x001b); 2335 - if (rtl_readphy(tp, 0x06) == 0xb300 && 2336 - request_firmware(&fw, FIRMWARE_8168D_2, &tp->pci_dev->dev) == 0) { 2337 - rtl_phy_write_fw(tp, fw); 2338 - release_firmware(fw); 2339 - } else { 2315 + if ((rtl_readphy(tp, 0x06) != 0xb300) || 2316 + (rtl_apply_firmware(tp, FIRMWARE_8168D_2) < 0)) { 2340 2317 netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n"); 2341 2318 } 2342 2319 ··· 3216 3199 } 3217 3200 3218 3201 cancel_delayed_work_sync(&tp->task); 3202 + 3203 + rtl_release_firmware(tp); 3219 3204 3220 3205 unregister_netdev(dev); 3221 3206
+6 -12
drivers/net/sfc/efx.c
··· 1153 1153 int count; 1154 1154 int cpu; 1155 1155 1156 + if (rss_cpus) 1157 + return rss_cpus; 1158 + 1156 1159 if (unlikely(!zalloc_cpumask_var(&core_mask, GFP_KERNEL))) { 1157 1160 printk(KERN_WARNING 1158 1161 "sfc: RSS disabled due to allocation failure\n"); ··· 1269 1266 efx->legacy_irq = 0; 1270 1267 } 1271 1268 1272 - struct efx_tx_queue * 1273 - efx_get_tx_queue(struct efx_nic *efx, unsigned index, unsigned type) 1274 - { 1275 - unsigned tx_channel_offset = 1276 - separate_tx_channels ? efx->n_channels - efx->n_tx_channels : 0; 1277 - EFX_BUG_ON_PARANOID(index >= efx->n_tx_channels || 1278 - type >= EFX_TXQ_TYPES); 1279 - return &efx->channel[tx_channel_offset + index]->tx_queue[type]; 1280 - } 1281 - 1282 1269 static void efx_set_channels(struct efx_nic *efx) 1283 1270 { 1284 1271 struct efx_channel *channel; 1285 1272 struct efx_tx_queue *tx_queue; 1286 - unsigned tx_channel_offset = 1273 + 1274 + efx->tx_channel_offset = 1287 1275 separate_tx_channels ? efx->n_channels - efx->n_tx_channels : 0; 1288 1276 1289 1277 /* Channel pointers were set in efx_init_struct() but we now 1290 1278 * need to clear them for TX queues in any RX-only channels. */ 1291 1279 efx_for_each_channel(channel, efx) { 1292 - if (channel->channel - tx_channel_offset >= 1280 + if (channel->channel - efx->tx_channel_offset >= 1293 1281 efx->n_tx_channels) { 1294 1282 efx_for_each_channel_tx_queue(tx_queue, channel) 1295 1283 tx_queue->channel = NULL;
+8 -2
drivers/net/sfc/net_driver.h
··· 735 735 unsigned next_buffer_table; 736 736 unsigned n_channels; 737 737 unsigned n_rx_channels; 738 + unsigned tx_channel_offset; 738 739 unsigned n_tx_channels; 739 740 unsigned int rx_buffer_len; 740 741 unsigned int rx_buffer_order; ··· 930 929 _channel = (_channel->channel + 1 < (_efx)->n_channels) ? \ 931 930 (_efx)->channel[_channel->channel + 1] : NULL) 932 931 933 - extern struct efx_tx_queue * 934 - efx_get_tx_queue(struct efx_nic *efx, unsigned index, unsigned type); 932 + static inline struct efx_tx_queue * 933 + efx_get_tx_queue(struct efx_nic *efx, unsigned index, unsigned type) 934 + { 935 + EFX_BUG_ON_PARANOID(index >= efx->n_tx_channels || 936 + type >= EFX_TXQ_TYPES); 937 + return &efx->channel[efx->tx_channel_offset + index]->tx_queue[type]; 938 + } 935 939 936 940 static inline struct efx_tx_queue * 937 941 efx_channel_get_tx_queue(struct efx_channel *channel, unsigned type)
+1 -9
drivers/net/tile/tilepro.c
··· 142 142 MODULE_AUTHOR("Tilera"); 143 143 MODULE_LICENSE("GPL"); 144 144 145 - 146 - #define IS_MULTICAST(mac_addr) \ 147 - (((u8 *)(mac_addr))[0] & 0x01) 148 - 149 - #define IS_BROADCAST(mac_addr) \ 150 - (((u16 *)(mac_addr))[0] == 0xffff) 151 - 152 - 153 145 /* 154 146 * Queue of incoming packets for a specific cpu and device. 155 147 * ··· 787 795 /* 788 796 * FIXME: Implement HW multicast filter. 789 797 */ 790 - if (!IS_MULTICAST(buf) && !IS_BROADCAST(buf)) { 798 + if (is_unicast_ether_addr(buf)) { 791 799 /* Filter packets not for our address. */ 792 800 const u8 *mine = dev->dev_addr; 793 801 filter = compare_ether_addr(mine, buf);
+1 -1
drivers/net/ucc_geth.c
··· 2032 2032 netdev_for_each_mc_addr(ha, dev) { 2033 2033 /* Only support group multicast for now. 2034 2034 */ 2035 - if (!(ha->addr[0] & 1)) 2035 + if (!is_multicast_ether_addr(ha->addr)) 2036 2036 continue; 2037 2037 2038 2038 /* Ask CPM to run CRC and set bit in
+3 -1
drivers/net/usb/cdc_ncm.c
··· 1021 1021 (temp > CDC_NCM_MAX_DATAGRAM_SIZE) || (temp < ETH_HLEN)) { 1022 1022 pr_debug("invalid frame detected (ignored)" 1023 1023 "offset[%u]=%u, length=%u, skb=%p\n", 1024 - x, offset, temp, skb); 1024 + x, offset, temp, skb_in); 1025 1025 if (!x) 1026 1026 goto error; 1027 1027 break; 1028 1028 1029 1029 } else { 1030 1030 skb = skb_clone(skb_in, GFP_ATOMIC); 1031 + if (!skb) 1032 + goto error; 1031 1033 skb->len = temp; 1032 1034 skb->data = ((u8 *)skb_in->data) + offset; 1033 1035 skb_set_tail_pointer(skb, temp);
+1
drivers/net/vxge/vxge-main.c
··· 4120 4120 "hotplug event.\n"); 4121 4121 4122 4122 out: 4123 + release_firmware(fw); 4123 4124 return ret; 4124 4125 } 4125 4126
+3
drivers/net/wireless/ath/ath9k/ar9002_calib.c
··· 954 954 &adc_dc_cal_multi_sample; 955 955 } 956 956 ah->supp_cals = ADC_GAIN_CAL | ADC_DC_CAL | IQ_MISMATCH_CAL; 957 + 958 + if (AR_SREV_9287(ah)) 959 + ah->supp_cals &= ~ADC_GAIN_CAL; 957 960 } 958 961 } 959 962
+4
drivers/net/wireless/ath/ath9k/eeprom_def.c
··· 226 226 eep->baseEepHeader.pwdclkind == 0) 227 227 ah->need_an_top2_fixup = 1; 228 228 229 + if ((common->bus_ops->ath_bus_type == ATH_USB) && 230 + (AR_SREV_9280(ah))) 231 + eep->modalHeader[0].xpaBiasLvl = 0; 232 + 229 233 return 0; 230 234 } 231 235
+1
drivers/net/wireless/ath/ath9k/htc.h
··· 433 433 void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb, 434 434 enum htc_endpoint_id ep_id, bool txok); 435 435 436 + int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv); 436 437 void ath9k_htc_station_work(struct work_struct *work); 437 438 void ath9k_htc_aggr_work(struct work_struct *work); 438 439 void ath9k_ani_work(struct work_struct *work);;
+26 -11
drivers/net/wireless/ath/ath9k/htc_drv_main.c
··· 301 301 302 302 priv->nstations++; 303 303 304 + /* 305 + * Set chainmask etc. on the target. 306 + */ 307 + ret = ath9k_htc_update_cap_target(priv); 308 + if (ret) 309 + ath_dbg(common, ATH_DBG_CONFIG, 310 + "Failed to update capability in target\n"); 311 + 312 + priv->ah->is_monitoring = true; 313 + 304 314 return 0; 305 315 306 316 err_vif: ··· 338 328 } 339 329 340 330 priv->nstations--; 331 + priv->ah->is_monitoring = false; 341 332 342 333 return 0; 343 334 } ··· 430 419 return 0; 431 420 } 432 421 433 - static int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv) 422 + int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv) 434 423 { 435 424 struct ath9k_htc_cap_target tcap; 436 425 int ret; ··· 1197 1186 } 1198 1187 } 1199 1188 1189 + /* 1190 + * Monitor interface should be added before 1191 + * IEEE80211_CONF_CHANGE_CHANNEL is handled. 1192 + */ 1193 + if (changed & IEEE80211_CONF_CHANGE_MONITOR) { 1194 + if (conf->flags & IEEE80211_CONF_MONITOR) { 1195 + if (ath9k_htc_add_monitor_interface(priv)) 1196 + ath_err(common, "Failed to set monitor mode\n"); 1197 + else 1198 + ath_dbg(common, ATH_DBG_CONFIG, 1199 + "HW opmode set to Monitor mode\n"); 1200 + } 1201 + } 1202 + 1200 1203 if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { 1201 1204 struct ieee80211_channel *curchan = hw->conf.channel; 1202 1205 int pos = curchan->hw_value; ··· 1244 1219 if (changed & IEEE80211_CONF_CHANGE_POWER) { 1245 1220 priv->txpowlimit = 2 * conf->power_level; 1246 1221 ath_update_txpow(priv); 1247 - } 1248 - 1249 - if (changed & IEEE80211_CONF_CHANGE_MONITOR) { 1250 - if (conf->flags & IEEE80211_CONF_MONITOR) { 1251 - if (ath9k_htc_add_monitor_interface(priv)) 1252 - ath_err(common, "Failed to set monitor mode\n"); 1253 - else 1254 - ath_dbg(common, ATH_DBG_CONFIG, 1255 - "HW opmode set to Monitor mode\n"); 1256 - } 1257 1222 } 1258 1223 1259 1224 if (changed & IEEE80211_CONF_CHANGE_IDLE) {
+3 -2
drivers/net/wireless/ath/ath9k/hw.c
··· 436 436 437 437 static int ath9k_hw_post_init(struct ath_hw *ah) 438 438 { 439 + struct ath_common *common = ath9k_hw_common(ah); 439 440 int ecode; 440 441 441 - if (!AR_SREV_9271(ah)) { 442 + if (common->bus_ops->ath_bus_type != ATH_USB) { 442 443 if (!ath9k_hw_chip_test(ah)) 443 444 return -ENODEV; 444 445 } ··· 1214 1213 ah->txchainmask = common->tx_chainmask; 1215 1214 ah->rxchainmask = common->rx_chainmask; 1216 1215 1217 - if (!ah->chip_fullsleep) { 1216 + if ((common->bus_ops->ath_bus_type != ATH_USB) && !ah->chip_fullsleep) { 1218 1217 ath9k_hw_abortpcurecv(ah); 1219 1218 if (!ath9k_hw_stopdmarecv(ah)) { 1220 1219 ath_dbg(common, ATH_DBG_XMIT,
+6 -9
drivers/net/wireless/hostap/hostap_cs.c
··· 518 518 hw_priv->link = link; 519 519 520 520 /* 521 - * Make sure the IRQ handler cannot proceed until at least 522 - * dev->base_addr is initialized. 521 + * We enable IRQ here, but IRQ handler will not proceed 522 + * until dev->base_addr is set below. This protect us from 523 + * receive interrupts when driver is not initialized. 523 524 */ 524 - spin_lock_irqsave(&local->irq_init_lock, flags); 525 - 526 525 ret = pcmcia_request_irq(link, prism2_interrupt); 527 526 if (ret) 528 - goto failed_unlock; 527 + goto failed; 529 528 530 529 ret = pcmcia_enable_device(link); 531 530 if (ret) 532 - goto failed_unlock; 531 + goto failed; 533 532 533 + spin_lock_irqsave(&local->irq_init_lock, flags); 534 534 dev->irq = link->irq; 535 535 dev->base_addr = link->resource[0]->start; 536 - 537 536 spin_unlock_irqrestore(&local->irq_init_lock, flags); 538 537 539 538 local->shutdown = 0; ··· 545 546 546 547 return ret; 547 548 548 - failed_unlock: 549 - spin_unlock_irqrestore(&local->irq_init_lock, flags); 550 549 failed: 551 550 kfree(hw_priv); 552 551 prism2_release((u_long)link);
+7
drivers/net/wireless/ipw2x00/ipw2200.c
··· 1973 1973 1974 1974 inta = ipw_read32(priv, IPW_INTA_RW); 1975 1975 inta_mask = ipw_read32(priv, IPW_INTA_MASK_R); 1976 + 1977 + if (inta == 0xFFFFFFFF) { 1978 + /* Hardware disappeared */ 1979 + IPW_WARNING("TASKLET INTA == 0xFFFFFFFF\n"); 1980 + /* Only handle the cached INTA values */ 1981 + inta = 0; 1982 + } 1976 1983 inta &= (IPW_INTA_MASK_ALL & inta_mask); 1977 1984 1978 1985 /* Add any cached INTA values that need to be handled */
+1 -1
drivers/net/wireless/p54/txrx.c
··· 618 618 else 619 619 *burst_possible = false; 620 620 621 - if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) 621 + if (!(info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ)) 622 622 *flags |= P54_HDR_FLAG_DATA_OUT_SEQNR; 623 623 624 624 if (info->flags & IEEE80211_TX_CTL_PSPOLL_RESPONSE)
+10
drivers/ssb/scan.c
··· 420 420 bus->pcicore.dev = dev; 421 421 #endif /* CONFIG_SSB_DRIVER_PCICORE */ 422 422 break; 423 + case SSB_DEV_ETHERNET: 424 + if (bus->bustype == SSB_BUSTYPE_PCI) { 425 + if (bus->host_pci->vendor == PCI_VENDOR_ID_BROADCOM && 426 + (bus->host_pci->device & 0xFF00) == 0x4300) { 427 + /* This is a dangling ethernet core on a 428 + * wireless device. Ignore it. */ 429 + continue; 430 + } 431 + } 432 + break; 423 433 default: 424 434 break; 425 435 }
+11 -7
drivers/vhost/vhost.c
··· 97 97 remove_wait_queue(poll->wqh, &poll->wait); 98 98 } 99 99 100 + static bool vhost_work_seq_done(struct vhost_dev *dev, struct vhost_work *work, 101 + unsigned seq) 102 + { 103 + int left; 104 + spin_lock_irq(&dev->work_lock); 105 + left = seq - work->done_seq; 106 + spin_unlock_irq(&dev->work_lock); 107 + return left <= 0; 108 + } 109 + 100 110 static void vhost_work_flush(struct vhost_dev *dev, struct vhost_work *work) 101 111 { 102 112 unsigned seq; 103 - int left; 104 113 int flushing; 105 114 106 115 spin_lock_irq(&dev->work_lock); 107 116 seq = work->queue_seq; 108 117 work->flushing++; 109 118 spin_unlock_irq(&dev->work_lock); 110 - wait_event(work->done, ({ 111 - spin_lock_irq(&dev->work_lock); 112 - left = seq - work->done_seq <= 0; 113 - spin_unlock_irq(&dev->work_lock); 114 - left; 115 - })); 119 + wait_event(work->done, vhost_work_seq_done(dev, work, seq)); 116 120 spin_lock_irq(&dev->work_lock); 117 121 flushing = --work->flushing; 118 122 spin_unlock_irq(&dev->work_lock);
+11
include/linux/etherdevice.h
··· 99 99 } 100 100 101 101 /** 102 + * is_unicast_ether_addr - Determine if the Ethernet address is unicast 103 + * @addr: Pointer to a six-byte array containing the Ethernet address 104 + * 105 + * Return true if the address is a unicast address. 106 + */ 107 + static inline int is_unicast_ether_addr(const u8 *addr) 108 + { 109 + return !is_multicast_ether_addr(addr); 110 + } 111 + 112 + /** 102 113 * is_valid_ether_addr - Determine if the given Ethernet address is valid 103 114 * @addr: Pointer to a six-byte array containing the Ethernet address 104 115 *
-5
include/linux/netdevice.h
··· 520 520 * please use this field instead of dev->trans_start 521 521 */ 522 522 unsigned long trans_start; 523 - u64 tx_bytes; 524 - u64 tx_packets; 525 - u64 tx_dropped; 526 523 } ____cacheline_aligned_in_smp; 527 524 528 525 static inline int netdev_queue_numa_node_read(const struct netdev_queue *q) ··· 2262 2265 extern void dev_mcast_init(void); 2263 2266 extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, 2264 2267 struct rtnl_link_stats64 *storage); 2265 - extern void dev_txq_stats_fold(const struct net_device *dev, 2266 - struct rtnl_link_stats64 *stats); 2267 2268 2268 2269 extern int netdev_max_backlog; 2269 2270 extern int netdev_tstamp_prequeue;
+15 -5
include/linux/nl80211.h
··· 148 148 * @NL80211_CMD_SET_MPATH: Set mesh path attributes for mesh path to 149 149 * destination %NL80211_ATTR_MAC on the interface identified by 150 150 * %NL80211_ATTR_IFINDEX. 151 + * @NL80211_CMD_NEW_MPATH: Create a new mesh path for the destination given by 152 + * %NL80211_ATTR_MAC via %NL80211_ATTR_MPATH_NEXT_HOP. 153 + * @NL80211_CMD_DEL_MPATH: Delete a mesh path to the destination given by 154 + * %NL80211_ATTR_MAC. 151 155 * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the 152 156 * the interface identified by %NL80211_ATTR_IFINDEX. 153 157 * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC ··· 616 612 * consisting of a nested array. 617 613 * 618 614 * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes). 619 - * @NL80211_ATTR_PLINK_ACTION: action to perform on the mesh peer link. 615 + * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link. 620 616 * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path. 621 617 * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path 622 618 * info given for %NL80211_CMD_GET_MPATH, nested attribute described at ··· 883 879 * See &enum nl80211_key_default_types. 884 880 * 885 881 * @NL80211_ATTR_MESH_SETUP: Optional mesh setup parameters. These cannot be 886 - * changed once the mesh is active. 882 + * changed once the mesh is active. 883 + * @NL80211_ATTR_MESH_CONFIG: Mesh configuration parameters, a nested attribute 884 + * containing attributes from &enum nl80211_meshconf_params. 887 885 * 888 886 * @NL80211_ATTR_MAX: highest attribute number currently defined 889 887 * @__NL80211_ATTR_AFTER_LAST: internal use ··· 1231 1225 * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs) 1232 1226 * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station) 1233 1227 * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station) 1234 - * @__NL80211_STA_INFO_AFTER_LAST: internal 1235 - * @NL80211_STA_INFO_MAX: highest possible station info attribute 1236 1228 * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm) 1237 1229 * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute 1238 1230 * containing info as possible, see &enum nl80211_sta_info_txrate. ··· 1240 1236 * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station) 1241 1237 * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station) 1242 1238 * @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm) 1239 + * @NL80211_STA_INFO_LLID: the station's mesh LLID 1240 + * @NL80211_STA_INFO_PLID: the station's mesh PLID 1241 + * @NL80211_STA_INFO_PLINK_STATE: peer link state for the station 1242 + * @__NL80211_STA_INFO_AFTER_LAST: internal 1243 + * @NL80211_STA_INFO_MAX: highest possible station info attribute 1243 1244 */ 1244 1245 enum nl80211_sta_info { 1245 1246 __NL80211_STA_INFO_INVALID, ··· 1635 1626 * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs) 1636 1627 * that it takes for an HWMP information element to propagate across the mesh 1637 1628 * 1638 - * @NL80211_MESHCONF_ROOTMODE: whether root mode is enabled or not 1629 + * @NL80211_MESHCONF_HWMP_ROOTMODE: whether root mode is enabled or not 1639 1630 * 1640 1631 * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a 1641 1632 * source mesh point for path selection elements. ··· 1687 1678 * element that vendors will use to identify the path selection methods and 1688 1679 * metrics in use. 1689 1680 * 1681 + * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number 1690 1682 * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use 1691 1683 */ 1692 1684 enum nl80211_mesh_setup_params {
+15
include/linux/skbuff.h
··· 255 255 typedef unsigned char *sk_buff_data_t; 256 256 #endif 257 257 258 + #if defined(CONFIG_NF_DEFRAG_IPV4) || defined(CONFIG_NF_DEFRAG_IPV4_MODULE) || \ 259 + defined(CONFIG_NF_DEFRAG_IPV6) || defined(CONFIG_NF_DEFRAG_IPV6_MODULE) 260 + #define NET_SKBUFF_NF_DEFRAG_NEEDED 1 261 + #endif 262 + 258 263 /** 259 264 * struct sk_buff - socket buffer 260 265 * @next: Next buffer in list ··· 367 362 void (*destructor)(struct sk_buff *skb); 368 363 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 369 364 struct nf_conntrack *nfct; 365 + #endif 366 + #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED 370 367 struct sk_buff *nfct_reasm; 371 368 #endif 372 369 #ifdef CONFIG_BRIDGE_NETFILTER ··· 2064 2057 if (nfct) 2065 2058 atomic_inc(&nfct->use); 2066 2059 } 2060 + #endif 2061 + #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED 2067 2062 static inline void nf_conntrack_get_reasm(struct sk_buff *skb) 2068 2063 { 2069 2064 if (skb) ··· 2094 2085 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 2095 2086 nf_conntrack_put(skb->nfct); 2096 2087 skb->nfct = NULL; 2088 + #endif 2089 + #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED 2097 2090 nf_conntrack_put_reasm(skb->nfct_reasm); 2098 2091 skb->nfct_reasm = NULL; 2099 2092 #endif ··· 2112 2101 dst->nfct = src->nfct; 2113 2102 nf_conntrack_get(src->nfct); 2114 2103 dst->nfctinfo = src->nfctinfo; 2104 + #endif 2105 + #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED 2115 2106 dst->nfct_reasm = src->nfct_reasm; 2116 2107 nf_conntrack_get_reasm(src->nfct_reasm); 2117 2108 #endif ··· 2127 2114 { 2128 2115 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 2129 2116 nf_conntrack_put(dst->nfct); 2117 + #endif 2118 + #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED 2130 2119 nf_conntrack_put_reasm(dst->nfct_reasm); 2131 2120 #endif 2132 2121 #ifdef CONFIG_BRIDGE_NETFILTER
+1 -1
include/net/ah.h
··· 4 4 #include <linux/skbuff.h> 5 5 6 6 /* This is the maximum truncated ICV length that we know of. */ 7 - #define MAX_AH_AUTH_LEN 16 7 + #define MAX_AH_AUTH_LEN 64 8 8 9 9 struct crypto_ahash; 10 10
+2
include/net/cfg80211.h
··· 1103 1103 * @change_mpath: change a given mesh path 1104 1104 * @get_mpath: get a mesh path for the given parameters 1105 1105 * @dump_mpath: dump mesh path callback -- resume dump at index @idx 1106 + * @join_mesh: join the mesh network with the specified parameters 1107 + * @leave_mesh: leave the current mesh network 1106 1108 * 1107 1109 * @get_mesh_config: Get the current mesh configuration 1108 1110 *
+14
include/net/mac80211.h
··· 337 337 * @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame 338 338 * @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this 339 339 * frame and selects the maximum number of streams that it can use. 340 + * @IEEE80211_TX_CTL_TX_OFFCHAN: Marks this packet to be transmitted on 341 + * the off-channel channel when a remain-on-channel offload is done 342 + * in hardware -- normal packets still flow and are expected to be 343 + * handled properly by the device. 340 344 * 341 345 * Note: If you have to add new flags to the enumeration, then don't 342 346 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. ··· 1757 1753 * (also see nl80211.h @NL80211_ATTR_WIPHY_ANTENNA_TX). 1758 1754 * 1759 1755 * @get_antenna: Get current antenna configuration from device (tx_ant, rx_ant). 1756 + * 1757 + * @remain_on_channel: Starts an off-channel period on the given channel, must 1758 + * call back to ieee80211_ready_on_channel() when on that channel. Note 1759 + * that normal channel traffic is not stopped as this is intended for hw 1760 + * offload. Frames to transmit on the off-channel channel are transmitted 1761 + * normally except for the %IEEE80211_TX_CTL_TX_OFFCHAN flag. When the 1762 + * duration (which will always be non-zero) expires, the driver must call 1763 + * ieee80211_remain_on_channel_expired(). This callback may sleep. 1764 + * @cancel_remain_on_channel: Requests that an ongoing off-channel period is 1765 + * aborted before it expires. This callback may sleep. 1760 1766 */ 1761 1767 struct ieee80211_ops { 1762 1768 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
-10
include/net/netfilter/ipv6/nf_conntrack_ipv6.h
··· 7 7 extern struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6; 8 8 extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6; 9 9 10 - extern int nf_ct_frag6_init(void); 11 - extern void nf_ct_frag6_cleanup(void); 12 - extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user); 13 - extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb, 14 - struct net_device *in, 15 - struct net_device *out, 16 - int (*okfn)(struct sk_buff *)); 17 - 18 - struct inet_frags_ctl; 19 - 20 10 #include <linux/sysctl.h> 21 11 extern struct ctl_table nf_ct_ipv6_sysctl_table[]; 22 12
+10
include/net/netfilter/ipv6/nf_defrag_ipv6.h
··· 3 3 4 4 extern void nf_defrag_ipv6_enable(void); 5 5 6 + extern int nf_ct_frag6_init(void); 7 + extern void nf_ct_frag6_cleanup(void); 8 + extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user); 9 + extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb, 10 + struct net_device *in, 11 + struct net_device *out, 12 + int (*okfn)(struct sk_buff *)); 13 + 14 + struct inet_frags_ctl; 15 + 6 16 #endif /* _NF_DEFRAG_IPV6_H */
-1
include/net/red.h
··· 97 97 u32 forced_mark; /* Forced marks, qavg > max_thresh */ 98 98 u32 pdrop; /* Drops due to queue limits */ 99 99 u32 other; /* Drops due to drop() calls */ 100 - u32 backlog; 101 100 }; 102 101 103 102 struct red_parms {
+1 -1
net/ax25/af_ax25.c
··· 1392 1392 ax25_cb *ax25; 1393 1393 int err = 0; 1394 1394 1395 - memset(fsa, 0, sizeof(fsa)); 1395 + memset(fsa, 0, sizeof(*fsa)); 1396 1396 lock_sock(sk); 1397 1397 ax25 = ax25_sk(sk); 1398 1398
-29
net/core/dev.c
··· 5523 5523 } 5524 5524 } 5525 5525 5526 - /** 5527 - * dev_txq_stats_fold - fold tx_queues stats 5528 - * @dev: device to get statistics from 5529 - * @stats: struct rtnl_link_stats64 to hold results 5530 - */ 5531 - void dev_txq_stats_fold(const struct net_device *dev, 5532 - struct rtnl_link_stats64 *stats) 5533 - { 5534 - u64 tx_bytes = 0, tx_packets = 0, tx_dropped = 0; 5535 - unsigned int i; 5536 - struct netdev_queue *txq; 5537 - 5538 - for (i = 0; i < dev->num_tx_queues; i++) { 5539 - txq = netdev_get_tx_queue(dev, i); 5540 - spin_lock_bh(&txq->_xmit_lock); 5541 - tx_bytes += txq->tx_bytes; 5542 - tx_packets += txq->tx_packets; 5543 - tx_dropped += txq->tx_dropped; 5544 - spin_unlock_bh(&txq->_xmit_lock); 5545 - } 5546 - if (tx_bytes || tx_packets || tx_dropped) { 5547 - stats->tx_bytes = tx_bytes; 5548 - stats->tx_packets = tx_packets; 5549 - stats->tx_dropped = tx_dropped; 5550 - } 5551 - } 5552 - EXPORT_SYMBOL(dev_txq_stats_fold); 5553 - 5554 5526 /* Convert net_device_stats to rtnl_link_stats64. They have the same 5555 5527 * fields in the same order, with only the type differing. 5556 5528 */ ··· 5566 5594 netdev_stats_to_stats64(storage, ops->ndo_get_stats(dev)); 5567 5595 } else { 5568 5596 netdev_stats_to_stats64(storage, &dev->stats); 5569 - dev_txq_stats_fold(dev, storage); 5570 5597 } 5571 5598 storage->rx_dropped += atomic_long_read(&dev->rx_dropped); 5572 5599 return storage;
+2
net/core/skbuff.c
··· 380 380 } 381 381 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 382 382 nf_conntrack_put(skb->nfct); 383 + #endif 384 + #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED 383 385 nf_conntrack_put_reasm(skb->nfct_reasm); 384 386 #endif 385 387 #ifdef CONFIG_BRIDGE_NETFILTER
+1 -1
net/ethernet/eth.c
··· 351 351 * @sizeof_priv: Size of additional driver-private structure to be allocated 352 352 * for this Ethernet device 353 353 * @txqs: The number of TX queues this device has. 354 - * @txqs: The number of RX queues this device has. 354 + * @rxqs: The number of RX queues this device has. 355 355 * 356 356 * Fill in the fields of the device structure with Ethernet-generic 357 357 * values. Basically does everything except registering the device.
+3
net/ipv6/ip6_output.c
··· 401 401 goto drop; 402 402 } 403 403 404 + if (skb->pkt_type != PACKET_HOST) 405 + goto drop; 406 + 404 407 skb_forward_csum(skb); 405 408 406 409 /*
+7 -1
net/ipv6/netfilter/nf_defrag_ipv6_hooks.c
··· 19 19 20 20 #include <linux/netfilter_ipv6.h> 21 21 #include <linux/netfilter_bridge.h> 22 + #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 22 23 #include <net/netfilter/nf_conntrack.h> 23 24 #include <net/netfilter/nf_conntrack_helper.h> 24 25 #include <net/netfilter/nf_conntrack_l4proto.h> 25 26 #include <net/netfilter/nf_conntrack_l3proto.h> 26 27 #include <net/netfilter/nf_conntrack_core.h> 27 - #include <net/netfilter/nf_conntrack_zones.h> 28 28 #include <net/netfilter/ipv6/nf_conntrack_ipv6.h> 29 + #endif 30 + #include <net/netfilter/nf_conntrack_zones.h> 29 31 #include <net/netfilter/ipv6/nf_defrag_ipv6.h> 30 32 31 33 static enum ip6_defrag_users nf_ct6_defrag_user(unsigned int hooknum, ··· 35 33 { 36 34 u16 zone = NF_CT_DEFAULT_ZONE; 37 35 36 + #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 38 37 if (skb->nfct) 39 38 zone = nf_ct_zone((struct nf_conn *)skb->nfct); 39 + #endif 40 40 41 41 #ifdef CONFIG_BRIDGE_NETFILTER 42 42 if (skb->nf_bridge && ··· 60 56 { 61 57 struct sk_buff *reasm; 62 58 59 + #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 63 60 /* Previously seen (loopback)? */ 64 61 if (skb->nfct && !nf_ct_is_template((struct nf_conn *)skb->nfct)) 65 62 return NF_ACCEPT; 63 + #endif 66 64 67 65 reasm = nf_ct_frag6_gather(skb, nf_ct6_defrag_user(hooknum, skb)); 68 66 /* queued */
+2 -1
net/netfilter/nf_conntrack_netlink.c
··· 972 972 free: 973 973 kfree_skb(skb2); 974 974 out: 975 - return err; 975 + /* this avoids a loop in nfnetlink. */ 976 + return err == -EAGAIN ? -ENOBUFS : err; 976 977 } 977 978 978 979 #ifdef CONFIG_NF_NAT_NEEDED
+21 -5
net/sched/sch_teql.c
··· 59 59 struct net_device *dev; 60 60 struct Qdisc *slaves; 61 61 struct list_head master_list; 62 + unsigned long tx_bytes; 63 + unsigned long tx_packets; 64 + unsigned long tx_errors; 65 + unsigned long tx_dropped; 62 66 }; 63 67 64 68 struct teql_sched_data ··· 278 274 static netdev_tx_t teql_master_xmit(struct sk_buff *skb, struct net_device *dev) 279 275 { 280 276 struct teql_master *master = netdev_priv(dev); 281 - struct netdev_queue *txq = netdev_get_tx_queue(dev, 0); 282 277 struct Qdisc *start, *q; 283 278 int busy; 284 279 int nores; ··· 317 314 __netif_tx_unlock(slave_txq); 318 315 master->slaves = NEXT_SLAVE(q); 319 316 netif_wake_queue(dev); 320 - txq->tx_packets++; 321 - txq->tx_bytes += length; 317 + master->tx_packets++; 318 + master->tx_bytes += length; 322 319 return NETDEV_TX_OK; 323 320 } 324 321 __netif_tx_unlock(slave_txq); ··· 345 342 netif_stop_queue(dev); 346 343 return NETDEV_TX_BUSY; 347 344 } 348 - dev->stats.tx_errors++; 345 + master->tx_errors++; 349 346 350 347 drop: 351 - txq->tx_dropped++; 348 + master->tx_dropped++; 352 349 dev_kfree_skb(skb); 353 350 return NETDEV_TX_OK; 354 351 } ··· 401 398 return 0; 402 399 } 403 400 401 + static struct rtnl_link_stats64 *teql_master_stats64(struct net_device *dev, 402 + struct rtnl_link_stats64 *stats) 403 + { 404 + struct teql_master *m = netdev_priv(dev); 405 + 406 + stats->tx_packets = m->tx_packets; 407 + stats->tx_bytes = m->tx_bytes; 408 + stats->tx_errors = m->tx_errors; 409 + stats->tx_dropped = m->tx_dropped; 410 + return stats; 411 + } 412 + 404 413 static int teql_master_mtu(struct net_device *dev, int new_mtu) 405 414 { 406 415 struct teql_master *m = netdev_priv(dev); ··· 437 422 .ndo_open = teql_master_open, 438 423 .ndo_stop = teql_master_close, 439 424 .ndo_start_xmit = teql_master_xmit, 425 + .ndo_get_stats64 = teql_master_stats64, 440 426 .ndo_change_mtu = teql_master_mtu, 441 427 }; 442 428