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

Configure Feed

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

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

Pull networking fixes from David Miller:
"This is primarily to get those r8169 reverts sorted, but other fixes
have accumulated meanwhile.

1) Revert two r8169 changes to fix suspend/resume for some users,
from Francois Romieu.

2) PCI dma mapping errors in atl1c are not checked for and this cause
hard crashes for some users, from Xiong Huang.

3) In 3.8.x we merged the removal of the EXPERIMENTAL dependency for
'dlm' but the same patch for 'sctp' got lost somewhere, resulting
in the potential for build errors since there are cross
dependencies. From Kees Cook.

4) SCTP's ipv6 socket route validation makes boolean tests
incorrectly, fix from Daniel Borkmann.

5) mac80211 does sizeof(ptr) instead of (sizeof(ptr) * nelem), from
Cong Ding.

6) arp_rcv() can crash on shared non-linear packets, from Eric
Dumazet.

7) Avoid crashes in macvtap by setting ->gso_type consistently in
ixgbe, qlcnic, and bnx2x drivers. From Michael S Tsirkin and
Alexander Duyck.

8) Trinity fuzzer spots infinite loop in __skb_recv_datagram(), fix
from Eric Dumazet.

9) STP protocol frames should use high packet priority, otherwise an
overloaded bridge can get stuck. From Stephen Hemminger.

10) The HTB packet scheduler was converted some time ago to store
internal timestamps in nanoseconds, but we don't convert back into
psched ticks for the user during dumps. Fix from Jiri Pirko.

11) mwl8k channel table doesn't set the .band field properly,
resulting in NULL pointer derefs. Fix from Jonas Gorski.

12) mac80211 doesn't accumulate channels properly during a scan so we
can downgrade heavily to a much less desirable connection speed.
Fix from Johannes Berg.

13) PHY probe failure in stmmac can result in resource leaks and
double MDIO registery later, from Giuseppe CAVALLARO.

14) Correct ipv6 checksumming in ip6t_NPT netfilter module, also fix
address prefix mangling, from YOSHIFUJI Hideaki."

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (27 commits)
net, sctp: remove CONFIG_EXPERIMENTAL
net: sctp: sctp_v6_get_dst: fix boolean test in dst cache
batman-adv: Fix NULL pointer dereference in DAT hash collision avoidance
net/macb: fix race with RX interrupt while doing NAPI
atl1c: add error checking for pci_map_single functions
htb: fix values in opt dump
ixgbe: Only set gso_type to SKB_GSO_TCPV4 as RSC does not support IPv6
net: fix infinite loop in __skb_recv_datagram()
net: qmi_wwan: add Yota / Megafon M100-1 4g modem
mwl8k: fix band for supported channels
bridge: set priority of STP packets
mac80211: fix channel selection bug
arp: fix possible crash in arp_rcv()
bnx2x: set gso_type
qlcnic: set gso_type
ixgbe: fix gso type
stmmac: mdio register has to fail if the phy is not found
stmmac: fix macro used for debugging the xmit
Revert "r8169: enable internal ASPM and clock request settings".
Revert "r8169: enable ALDPS for power saving".
...

+191 -149
+64 -7
drivers/net/ethernet/atheros/atl1c/atl1c_main.c
··· 21 21 22 22 #include "atl1c.h" 23 23 24 - #define ATL1C_DRV_VERSION "1.0.1.0-NAPI" 24 + #define ATL1C_DRV_VERSION "1.0.1.1-NAPI" 25 25 char atl1c_driver_name[] = "atl1c"; 26 26 char atl1c_driver_version[] = ATL1C_DRV_VERSION; 27 27 ··· 1652 1652 u16 num_alloc = 0; 1653 1653 u16 rfd_next_to_use, next_next; 1654 1654 struct atl1c_rx_free_desc *rfd_desc; 1655 + dma_addr_t mapping; 1655 1656 1656 1657 next_next = rfd_next_to_use = rfd_ring->next_to_use; 1657 1658 if (++next_next == rfd_ring->count) ··· 1679 1678 ATL1C_SET_BUFFER_STATE(buffer_info, ATL1C_BUFFER_BUSY); 1680 1679 buffer_info->skb = skb; 1681 1680 buffer_info->length = adapter->rx_buffer_len; 1682 - buffer_info->dma = pci_map_single(pdev, vir_addr, 1681 + mapping = pci_map_single(pdev, vir_addr, 1683 1682 buffer_info->length, 1684 1683 PCI_DMA_FROMDEVICE); 1684 + if (unlikely(pci_dma_mapping_error(pdev, mapping))) { 1685 + dev_kfree_skb(skb); 1686 + buffer_info->skb = NULL; 1687 + buffer_info->length = 0; 1688 + ATL1C_SET_BUFFER_STATE(buffer_info, ATL1C_BUFFER_FREE); 1689 + netif_warn(adapter, rx_err, adapter->netdev, "RX pci_map_single failed"); 1690 + break; 1691 + } 1692 + buffer_info->dma = mapping; 1685 1693 ATL1C_SET_PCIMAP_TYPE(buffer_info, ATL1C_PCIMAP_SINGLE, 1686 1694 ATL1C_PCIMAP_FROMDEVICE); 1687 1695 rfd_desc->buffer_addr = cpu_to_le64(buffer_info->dma); ··· 2025 2015 return 0; 2026 2016 } 2027 2017 2028 - static void atl1c_tx_map(struct atl1c_adapter *adapter, 2018 + static void atl1c_tx_rollback(struct atl1c_adapter *adpt, 2019 + struct atl1c_tpd_desc *first_tpd, 2020 + enum atl1c_trans_queue type) 2021 + { 2022 + struct atl1c_tpd_ring *tpd_ring = &adpt->tpd_ring[type]; 2023 + struct atl1c_buffer *buffer_info; 2024 + struct atl1c_tpd_desc *tpd; 2025 + u16 first_index, index; 2026 + 2027 + first_index = first_tpd - (struct atl1c_tpd_desc *)tpd_ring->desc; 2028 + index = first_index; 2029 + while (index != tpd_ring->next_to_use) { 2030 + tpd = ATL1C_TPD_DESC(tpd_ring, index); 2031 + buffer_info = &tpd_ring->buffer_info[index]; 2032 + atl1c_clean_buffer(adpt->pdev, buffer_info, 0); 2033 + memset(tpd, 0, sizeof(struct atl1c_tpd_desc)); 2034 + if (++index == tpd_ring->count) 2035 + index = 0; 2036 + } 2037 + tpd_ring->next_to_use = first_index; 2038 + } 2039 + 2040 + static int atl1c_tx_map(struct atl1c_adapter *adapter, 2029 2041 struct sk_buff *skb, struct atl1c_tpd_desc *tpd, 2030 2042 enum atl1c_trans_queue type) 2031 2043 { ··· 2072 2040 buffer_info->length = map_len; 2073 2041 buffer_info->dma = pci_map_single(adapter->pdev, 2074 2042 skb->data, hdr_len, PCI_DMA_TODEVICE); 2075 - ATL1C_SET_BUFFER_STATE(buffer_info, ATL1C_BUFFER_BUSY); 2043 + if (unlikely(pci_dma_mapping_error(adapter->pdev, 2044 + buffer_info->dma))) 2045 + goto err_dma; 2046 + 2076 2047 ATL1C_SET_PCIMAP_TYPE(buffer_info, ATL1C_PCIMAP_SINGLE, 2077 2048 ATL1C_PCIMAP_TODEVICE); 2078 2049 mapped_len += map_len; ··· 2097 2062 buffer_info->dma = 2098 2063 pci_map_single(adapter->pdev, skb->data + mapped_len, 2099 2064 buffer_info->length, PCI_DMA_TODEVICE); 2065 + if (unlikely(pci_dma_mapping_error(adapter->pdev, 2066 + buffer_info->dma))) 2067 + goto err_dma; 2068 + 2100 2069 ATL1C_SET_BUFFER_STATE(buffer_info, ATL1C_BUFFER_BUSY); 2101 2070 ATL1C_SET_PCIMAP_TYPE(buffer_info, ATL1C_PCIMAP_SINGLE, 2102 2071 ATL1C_PCIMAP_TODEVICE); ··· 2122 2083 frag, 0, 2123 2084 buffer_info->length, 2124 2085 DMA_TO_DEVICE); 2086 + if (dma_mapping_error(&adapter->pdev->dev, buffer_info->dma)) 2087 + goto err_dma; 2088 + 2125 2089 ATL1C_SET_BUFFER_STATE(buffer_info, ATL1C_BUFFER_BUSY); 2126 2090 ATL1C_SET_PCIMAP_TYPE(buffer_info, ATL1C_PCIMAP_PAGE, 2127 2091 ATL1C_PCIMAP_TODEVICE); ··· 2137 2095 /* The last buffer info contain the skb address, 2138 2096 so it will be free after unmap */ 2139 2097 buffer_info->skb = skb; 2098 + 2099 + return 0; 2100 + 2101 + err_dma: 2102 + buffer_info->dma = 0; 2103 + buffer_info->length = 0; 2104 + return -1; 2140 2105 } 2141 2106 2142 2107 static void atl1c_tx_queue(struct atl1c_adapter *adapter, struct sk_buff *skb, ··· 2206 2157 if (skb_network_offset(skb) != ETH_HLEN) 2207 2158 tpd->word1 |= 1 << TPD_ETH_TYPE_SHIFT; /* Ethernet frame */ 2208 2159 2209 - atl1c_tx_map(adapter, skb, tpd, type); 2210 - atl1c_tx_queue(adapter, skb, tpd, type); 2160 + if (atl1c_tx_map(adapter, skb, tpd, type) < 0) { 2161 + netif_info(adapter, tx_done, adapter->netdev, 2162 + "tx-skb droppted due to dma error\n"); 2163 + /* roll back tpd/buffer */ 2164 + atl1c_tx_rollback(adapter, tpd, type); 2165 + spin_unlock_irqrestore(&adapter->tx_lock, flags); 2166 + dev_kfree_skb(skb); 2167 + } else { 2168 + atl1c_tx_queue(adapter, skb, tpd, type); 2169 + spin_unlock_irqrestore(&adapter->tx_lock, flags); 2170 + } 2211 2171 2212 - spin_unlock_irqrestore(&adapter->tx_lock, flags); 2213 2172 return NETDEV_TX_OK; 2214 2173 } 2215 2174
+5 -7
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
··· 504 504 skb_shinfo(skb)->gso_size = bnx2x_set_lro_mss(bp, 505 505 tpa_info->parsing_flags, len_on_bd); 506 506 507 - /* set for GRO */ 508 - if (fp->mode == TPA_MODE_GRO) 509 - skb_shinfo(skb)->gso_type = 510 - (GET_FLAG(tpa_info->parsing_flags, 511 - PARSING_FLAGS_OVER_ETHERNET_PROTOCOL) == 512 - PRS_FLAG_OVERETH_IPV6) ? 513 - SKB_GSO_TCPV6 : SKB_GSO_TCPV4; 507 + skb_shinfo(skb)->gso_type = 508 + (GET_FLAG(tpa_info->parsing_flags, 509 + PARSING_FLAGS_OVER_ETHERNET_PROTOCOL) == 510 + PRS_FLAG_OVERETH_IPV6) ? 511 + SKB_GSO_TCPV6 : SKB_GSO_TCPV4; 514 512 } 515 513 516 514
+5
drivers/net/ethernet/cadence/macb.c
··· 693 693 * get notified when new packets arrive. 694 694 */ 695 695 macb_writel(bp, IER, MACB_RX_INT_FLAGS); 696 + 697 + /* Packets received while interrupts were disabled */ 698 + status = macb_readl(bp, RSR); 699 + if (unlikely(status)) 700 + napi_reschedule(napi); 696 701 } 697 702 698 703 /* TODO: Handle errors */
+1
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
··· 1401 1401 /* set gso_size to avoid messing up TCP MSS */ 1402 1402 skb_shinfo(skb)->gso_size = DIV_ROUND_UP((skb->len - hdr_len), 1403 1403 IXGBE_CB(skb)->append_cnt); 1404 + skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4; 1404 1405 } 1405 1406 1406 1407 static void ixgbe_update_rsc_stats(struct ixgbe_ring *rx_ring,
+6 -1
drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
··· 986 986 th->seq = htonl(seq_number); 987 987 length = skb->len; 988 988 989 - if (adapter->flags & QLCNIC_FW_LRO_MSS_CAP) 989 + if (adapter->flags & QLCNIC_FW_LRO_MSS_CAP) { 990 990 skb_shinfo(skb)->gso_size = qlcnic_get_lro_sts_mss(sts_data1); 991 + if (skb->protocol == htons(ETH_P_IPV6)) 992 + skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6; 993 + else 994 + skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4; 995 + } 991 996 992 997 if (vid != 0xffff) 993 998 __vlan_hwaccel_put_tag(skb, vid);
+19 -67
drivers/net/ethernet/realtek/r8169.c
··· 450 450 #define PWM_EN (1 << 22) 451 451 #define RXDV_GATED_EN (1 << 19) 452 452 #define EARLY_TALLY_EN (1 << 16) 453 - #define FORCE_CLK (1 << 15) /* force clock request */ 454 453 }; 455 454 456 455 enum rtl_register_content { ··· 513 514 PMEnable = (1 << 0), /* Power Management Enable */ 514 515 515 516 /* Config2 register p. 25 */ 516 - ClkReqEn = (1 << 7), /* Clock Request Enable */ 517 517 MSIEnable = (1 << 5), /* 8169 only. Reserved in the 8168. */ 518 518 PCI_Clock_66MHz = 0x01, 519 519 PCI_Clock_33MHz = 0x00, ··· 533 535 Spi_en = (1 << 3), 534 536 LanWake = (1 << 1), /* LanWake enable/disable */ 535 537 PMEStatus = (1 << 0), /* PME status can be reset by PCI RST# */ 536 - ASPM_en = (1 << 0), /* ASPM enable */ 537 538 538 539 /* TBICSR p.28 */ 539 540 TBIReset = 0x80000000, ··· 681 684 RTL_FEATURE_WOL = (1 << 0), 682 685 RTL_FEATURE_MSI = (1 << 1), 683 686 RTL_FEATURE_GMII = (1 << 2), 684 - RTL_FEATURE_FW_LOADED = (1 << 3), 685 687 }; 686 688 687 689 struct rtl8169_counters { ··· 2385 2389 struct rtl_fw *rtl_fw = tp->rtl_fw; 2386 2390 2387 2391 /* TODO: release firmware once rtl_phy_write_fw signals failures. */ 2388 - if (!IS_ERR_OR_NULL(rtl_fw)) { 2392 + if (!IS_ERR_OR_NULL(rtl_fw)) 2389 2393 rtl_phy_write_fw(tp, rtl_fw); 2390 - tp->features |= RTL_FEATURE_FW_LOADED; 2391 - } 2392 2394 } 2393 2395 2394 2396 static void rtl_apply_firmware_cond(struct rtl8169_private *tp, u8 reg, u16 val) ··· 2395 2401 netif_warn(tp, hw, tp->dev, "chipset not ready for firmware\n"); 2396 2402 else 2397 2403 rtl_apply_firmware(tp); 2398 - } 2399 - 2400 - static void r810x_aldps_disable(struct rtl8169_private *tp) 2401 - { 2402 - rtl_writephy(tp, 0x1f, 0x0000); 2403 - rtl_writephy(tp, 0x18, 0x0310); 2404 - msleep(100); 2405 - } 2406 - 2407 - static void r810x_aldps_enable(struct rtl8169_private *tp) 2408 - { 2409 - if (!(tp->features & RTL_FEATURE_FW_LOADED)) 2410 - return; 2411 - 2412 - rtl_writephy(tp, 0x1f, 0x0000); 2413 - rtl_writephy(tp, 0x18, 0x8310); 2414 - } 2415 - 2416 - static void r8168_aldps_enable_1(struct rtl8169_private *tp) 2417 - { 2418 - if (!(tp->features & RTL_FEATURE_FW_LOADED)) 2419 - return; 2420 - 2421 - rtl_writephy(tp, 0x1f, 0x0000); 2422 - rtl_w1w0_phy(tp, 0x15, 0x1000, 0x0000); 2423 2404 } 2424 2405 2425 2406 static void rtl8169s_hw_phy_config(struct rtl8169_private *tp) ··· 3187 3218 rtl_w1w0_phy(tp, 0x10, 0x0000, 0x0400); 3188 3219 rtl_writephy(tp, 0x1f, 0x0000); 3189 3220 3190 - r8168_aldps_enable_1(tp); 3191 - 3192 3221 /* Broken BIOS workaround: feed GigaMAC registers with MAC address. */ 3193 3222 rtl_rar_exgmac_set(tp, tp->dev->dev_addr); 3194 3223 } ··· 3261 3294 rtl_writephy(tp, 0x05, 0x8b85); 3262 3295 rtl_w1w0_phy(tp, 0x06, 0x4000, 0x0000); 3263 3296 rtl_writephy(tp, 0x1f, 0x0000); 3264 - 3265 - r8168_aldps_enable_1(tp); 3266 3297 } 3267 3298 3268 3299 static void rtl8168f_2_hw_phy_config(struct rtl8169_private *tp) ··· 3268 3303 rtl_apply_firmware(tp); 3269 3304 3270 3305 rtl8168f_hw_phy_config(tp); 3271 - 3272 - r8168_aldps_enable_1(tp); 3273 3306 } 3274 3307 3275 3308 static void rtl8411_hw_phy_config(struct rtl8169_private *tp) ··· 3365 3402 rtl_w1w0_phy(tp, 0x19, 0x0000, 0x0001); 3366 3403 rtl_w1w0_phy(tp, 0x10, 0x0000, 0x0400); 3367 3404 rtl_writephy(tp, 0x1f, 0x0000); 3368 - 3369 - r8168_aldps_enable_1(tp); 3370 3405 } 3371 3406 3372 3407 static void rtl8168g_1_hw_phy_config(struct rtl8169_private *tp) ··· 3450 3489 }; 3451 3490 3452 3491 /* Disable ALDPS before ram code */ 3453 - r810x_aldps_disable(tp); 3492 + rtl_writephy(tp, 0x1f, 0x0000); 3493 + rtl_writephy(tp, 0x18, 0x0310); 3494 + msleep(100); 3454 3495 3455 3496 rtl_apply_firmware(tp); 3456 3497 3457 3498 rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init)); 3458 - 3459 - r810x_aldps_enable(tp); 3460 3499 } 3461 3500 3462 3501 static void rtl8402_hw_phy_config(struct rtl8169_private *tp) 3463 3502 { 3464 3503 /* Disable ALDPS before setting firmware */ 3465 - r810x_aldps_disable(tp); 3504 + rtl_writephy(tp, 0x1f, 0x0000); 3505 + rtl_writephy(tp, 0x18, 0x0310); 3506 + msleep(20); 3466 3507 3467 3508 rtl_apply_firmware(tp); 3468 3509 ··· 3474 3511 rtl_writephy(tp, 0x10, 0x401f); 3475 3512 rtl_writephy(tp, 0x19, 0x7030); 3476 3513 rtl_writephy(tp, 0x1f, 0x0000); 3477 - 3478 - r810x_aldps_enable(tp); 3479 3514 } 3480 3515 3481 3516 static void rtl8106e_hw_phy_config(struct rtl8169_private *tp) ··· 3486 3525 }; 3487 3526 3488 3527 /* Disable ALDPS before ram code */ 3489 - r810x_aldps_disable(tp); 3528 + rtl_writephy(tp, 0x1f, 0x0000); 3529 + rtl_writephy(tp, 0x18, 0x0310); 3530 + msleep(100); 3490 3531 3491 3532 rtl_apply_firmware(tp); 3492 3533 ··· 3496 3533 rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init)); 3497 3534 3498 3535 rtl_eri_write(tp, 0x1d0, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC); 3499 - 3500 - r810x_aldps_enable(tp); 3501 3536 } 3502 3537 3503 3538 static void rtl_hw_phy_config(struct net_device *dev) ··· 5012 5051 5013 5052 RTL_W8(MaxTxPacketSize, EarlySize); 5014 5053 5054 + rtl_disable_clock_request(pdev); 5055 + 5015 5056 RTL_W32(TxConfig, RTL_R32(TxConfig) | TXCFG_AUTO_FIFO); 5016 5057 RTL_W8(MCU, RTL_R8(MCU) & ~NOW_IS_OOB); 5017 5058 ··· 5022 5059 5023 5060 RTL_W8(DLLPR, RTL_R8(DLLPR) | PFM_EN); 5024 5061 RTL_W32(MISC, RTL_R32(MISC) | PWM_EN); 5025 - RTL_W8(Config5, (RTL_R8(Config5) & ~Spi_en) | ASPM_en); 5026 - RTL_W8(Config2, RTL_R8(Config2) | ClkReqEn); 5062 + RTL_W8(Config5, RTL_R8(Config5) & ~Spi_en); 5027 5063 } 5028 5064 5029 5065 static void rtl_hw_start_8168f(struct rtl8169_private *tp) ··· 5047 5085 5048 5086 RTL_W8(MaxTxPacketSize, EarlySize); 5049 5087 5088 + rtl_disable_clock_request(pdev); 5089 + 5050 5090 RTL_W32(TxConfig, RTL_R32(TxConfig) | TXCFG_AUTO_FIFO); 5051 5091 RTL_W8(MCU, RTL_R8(MCU) & ~NOW_IS_OOB); 5052 5092 RTL_W8(DLLPR, RTL_R8(DLLPR) | PFM_EN); 5053 - RTL_W32(MISC, RTL_R32(MISC) | PWM_EN | FORCE_CLK); 5054 - RTL_W8(Config5, (RTL_R8(Config5) & ~Spi_en) | ASPM_en); 5055 - RTL_W8(Config2, RTL_R8(Config2) | ClkReqEn); 5093 + RTL_W32(MISC, RTL_R32(MISC) | PWM_EN); 5094 + RTL_W8(Config5, RTL_R8(Config5) & ~Spi_en); 5056 5095 } 5057 5096 5058 5097 static void rtl_hw_start_8168f_1(struct rtl8169_private *tp) ··· 5110 5147 rtl_w1w0_eri(tp, 0xdc, ERIAR_MASK_0001, 0x01, 0x00, ERIAR_EXGMAC); 5111 5148 5112 5149 RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); 5113 - RTL_W32(MISC, (RTL_R32(MISC) | FORCE_CLK) & ~RXDV_GATED_EN); 5150 + RTL_W32(MISC, RTL_R32(MISC) & ~RXDV_GATED_EN); 5114 5151 RTL_W8(MaxTxPacketSize, EarlySize); 5115 - RTL_W8(Config5, RTL_R8(Config5) | ASPM_en); 5116 - RTL_W8(Config2, RTL_R8(Config2) | ClkReqEn); 5117 5152 5118 5153 rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC); 5119 5154 rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC); ··· 5327 5366 5328 5367 RTL_W8(MCU, RTL_R8(MCU) | EN_NDP | EN_OOB_RESET); 5329 5368 RTL_W8(DLLPR, RTL_R8(DLLPR) | PFM_EN); 5330 - RTL_W8(Config5, RTL_R8(Config5) | ASPM_en); 5331 - RTL_W8(Config2, RTL_R8(Config2) | ClkReqEn); 5332 - RTL_W32(MISC, RTL_R32(MISC) | FORCE_CLK); 5333 5369 5334 5370 rtl_ephy_init(tp, e_info_8105e_1, ARRAY_SIZE(e_info_8105e_1)); 5335 5371 } ··· 5352 5394 5353 5395 RTL_W32(TxConfig, RTL_R32(TxConfig) | TXCFG_AUTO_FIFO); 5354 5396 RTL_W8(MCU, RTL_R8(MCU) & ~NOW_IS_OOB); 5355 - RTL_W8(Config5, RTL_R8(Config5) | ASPM_en); 5356 - RTL_W8(Config2, RTL_R8(Config2) | ClkReqEn); 5357 - RTL_W32(MISC, RTL_R32(MISC) | FORCE_CLK); 5358 5397 5359 5398 rtl_ephy_init(tp, e_info_8402, ARRAY_SIZE(e_info_8402)); 5360 5399 ··· 5373 5418 /* Force LAN exit from ASPM if Rx/Tx are not idle */ 5374 5419 RTL_W32(FuncEvent, RTL_R32(FuncEvent) | 0x002800); 5375 5420 5376 - RTL_W32(MISC, 5377 - (RTL_R32(MISC) | DISABLE_LAN_EN | FORCE_CLK) & ~EARLY_TALLY_EN); 5378 - RTL_W8(Config5, RTL_R8(Config5) | ASPM_en); 5379 - RTL_W8(Config2, RTL_R8(Config2) | ClkReqEn); 5421 + RTL_W32(MISC, (RTL_R32(MISC) | DISABLE_LAN_EN) & ~EARLY_TALLY_EN); 5380 5422 RTL_W8(MCU, RTL_R8(MCU) | EN_NDP | EN_OOB_RESET); 5381 5423 RTL_W8(DLLPR, RTL_R8(DLLPR) & ~PFM_EN); 5382 5424 }
+1 -1
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 69 69 70 70 #undef STMMAC_XMIT_DEBUG 71 71 /*#define STMMAC_XMIT_DEBUG*/ 72 - #ifdef STMMAC_TX_DEBUG 72 + #ifdef STMMAC_XMIT_DEBUG 73 73 #define TX_DBG(fmt, args...) printk(fmt, ## args) 74 74 #else 75 75 #define TX_DBG(fmt, args...) do { } while (0)
+7 -3
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
··· 188 188 goto bus_register_fail; 189 189 } 190 190 191 - priv->mii = new_bus; 192 - 193 191 found = 0; 194 192 for (addr = 0; addr < PHY_MAX_ADDR; addr++) { 195 193 struct phy_device *phydev = new_bus->phy_map[addr]; ··· 235 237 } 236 238 } 237 239 238 - if (!found) 240 + if (!found) { 239 241 pr_warning("%s: No PHY found\n", ndev->name); 242 + mdiobus_unregister(new_bus); 243 + mdiobus_free(new_bus); 244 + return -ENODEV; 245 + } 246 + 247 + priv->mii = new_bus; 240 248 241 249 return 0; 242 250
+1
drivers/net/usb/qmi_wwan.c
··· 411 411 }, 412 412 413 413 /* 3. Combined interface devices matching on interface number */ 414 + {QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */ 414 415 {QMI_FIXED_INTF(0x12d1, 0x140c, 1)}, /* Huawei E173 */ 415 416 {QMI_FIXED_INTF(0x19d2, 0x0002, 1)}, 416 417 {QMI_FIXED_INTF(0x19d2, 0x0012, 1)},
+18 -18
drivers/net/wireless/mwl8k.c
··· 318 318 #define MWL8K_STA(_sta) ((struct mwl8k_sta *)&((_sta)->drv_priv)) 319 319 320 320 static const struct ieee80211_channel mwl8k_channels_24[] = { 321 - { .center_freq = 2412, .hw_value = 1, }, 322 - { .center_freq = 2417, .hw_value = 2, }, 323 - { .center_freq = 2422, .hw_value = 3, }, 324 - { .center_freq = 2427, .hw_value = 4, }, 325 - { .center_freq = 2432, .hw_value = 5, }, 326 - { .center_freq = 2437, .hw_value = 6, }, 327 - { .center_freq = 2442, .hw_value = 7, }, 328 - { .center_freq = 2447, .hw_value = 8, }, 329 - { .center_freq = 2452, .hw_value = 9, }, 330 - { .center_freq = 2457, .hw_value = 10, }, 331 - { .center_freq = 2462, .hw_value = 11, }, 332 - { .center_freq = 2467, .hw_value = 12, }, 333 - { .center_freq = 2472, .hw_value = 13, }, 334 - { .center_freq = 2484, .hw_value = 14, }, 321 + { .band = IEEE80211_BAND_2GHZ, .center_freq = 2412, .hw_value = 1, }, 322 + { .band = IEEE80211_BAND_2GHZ, .center_freq = 2417, .hw_value = 2, }, 323 + { .band = IEEE80211_BAND_2GHZ, .center_freq = 2422, .hw_value = 3, }, 324 + { .band = IEEE80211_BAND_2GHZ, .center_freq = 2427, .hw_value = 4, }, 325 + { .band = IEEE80211_BAND_2GHZ, .center_freq = 2432, .hw_value = 5, }, 326 + { .band = IEEE80211_BAND_2GHZ, .center_freq = 2437, .hw_value = 6, }, 327 + { .band = IEEE80211_BAND_2GHZ, .center_freq = 2442, .hw_value = 7, }, 328 + { .band = IEEE80211_BAND_2GHZ, .center_freq = 2447, .hw_value = 8, }, 329 + { .band = IEEE80211_BAND_2GHZ, .center_freq = 2452, .hw_value = 9, }, 330 + { .band = IEEE80211_BAND_2GHZ, .center_freq = 2457, .hw_value = 10, }, 331 + { .band = IEEE80211_BAND_2GHZ, .center_freq = 2462, .hw_value = 11, }, 332 + { .band = IEEE80211_BAND_2GHZ, .center_freq = 2467, .hw_value = 12, }, 333 + { .band = IEEE80211_BAND_2GHZ, .center_freq = 2472, .hw_value = 13, }, 334 + { .band = IEEE80211_BAND_2GHZ, .center_freq = 2484, .hw_value = 14, }, 335 335 }; 336 336 337 337 static const struct ieee80211_rate mwl8k_rates_24[] = { ··· 352 352 }; 353 353 354 354 static const struct ieee80211_channel mwl8k_channels_50[] = { 355 - { .center_freq = 5180, .hw_value = 36, }, 356 - { .center_freq = 5200, .hw_value = 40, }, 357 - { .center_freq = 5220, .hw_value = 44, }, 358 - { .center_freq = 5240, .hw_value = 48, }, 355 + { .band = IEEE80211_BAND_5GHZ, .center_freq = 5180, .hw_value = 36, }, 356 + { .band = IEEE80211_BAND_5GHZ, .center_freq = 5200, .hw_value = 40, }, 357 + { .band = IEEE80211_BAND_5GHZ, .center_freq = 5220, .hw_value = 44, }, 358 + { .band = IEEE80211_BAND_5GHZ, .center_freq = 5240, .hw_value = 48, }, 359 359 }; 360 360 361 361 static const struct ieee80211_rate mwl8k_rates_50[] = {
+1 -1
net/batman-adv/distributed-arp-table.c
··· 440 440 /* this is an hash collision with the temporary selected node. Choose 441 441 * the one with the lowest address 442 442 */ 443 - if ((tmp_max == max) && 443 + if ((tmp_max == max) && max_orig_node && 444 444 (batadv_compare_eth(candidate->orig, max_orig_node->orig) > 0)) 445 445 goto out; 446 446
+2
net/bridge/br_stp_bpdu.c
··· 16 16 #include <linux/etherdevice.h> 17 17 #include <linux/llc.h> 18 18 #include <linux/slab.h> 19 + #include <linux/pkt_sched.h> 19 20 #include <net/net_namespace.h> 20 21 #include <net/llc.h> 21 22 #include <net/llc_pdu.h> ··· 41 40 42 41 skb->dev = p->dev; 43 42 skb->protocol = htons(ETH_P_802_2); 43 + skb->priority = TC_PRIO_CONTROL; 44 44 45 45 skb_reserve(skb, LLC_RESERVE); 46 46 memcpy(__skb_put(skb, length), data, length);
+1 -1
net/core/datagram.c
··· 187 187 skb_queue_walk(queue, skb) { 188 188 *peeked = skb->peeked; 189 189 if (flags & MSG_PEEK) { 190 - if (*off >= skb->len) { 190 + if (*off >= skb->len && skb->len) { 191 191 *off -= skb->len; 192 192 continue; 193 193 }
+11 -10
net/ipv4/arp.c
··· 928 928 static int arp_rcv(struct sk_buff *skb, struct net_device *dev, 929 929 struct packet_type *pt, struct net_device *orig_dev) 930 930 { 931 - struct arphdr *arp; 931 + const struct arphdr *arp; 932 + 933 + if (dev->flags & IFF_NOARP || 934 + skb->pkt_type == PACKET_OTHERHOST || 935 + skb->pkt_type == PACKET_LOOPBACK) 936 + goto freeskb; 937 + 938 + skb = skb_share_check(skb, GFP_ATOMIC); 939 + if (!skb) 940 + goto out_of_mem; 932 941 933 942 /* ARP header, plus 2 device addresses, plus 2 IP addresses. */ 934 943 if (!pskb_may_pull(skb, arp_hdr_len(dev))) 935 944 goto freeskb; 936 945 937 946 arp = arp_hdr(skb); 938 - if (arp->ar_hln != dev->addr_len || 939 - dev->flags & IFF_NOARP || 940 - skb->pkt_type == PACKET_OTHERHOST || 941 - skb->pkt_type == PACKET_LOOPBACK || 942 - arp->ar_pln != 4) 947 + if (arp->ar_hln != dev->addr_len || arp->ar_pln != 4) 943 948 goto freeskb; 944 - 945 - skb = skb_share_check(skb, GFP_ATOMIC); 946 - if (skb == NULL) 947 - goto out_of_mem; 948 949 949 950 memset(NEIGH_CB(skb), 0, sizeof(struct neighbour_cb)); 950 951
+14 -4
net/ipv6/netfilter/ip6t_NPT.c
··· 9 9 #include <linux/module.h> 10 10 #include <linux/skbuff.h> 11 11 #include <linux/ipv6.h> 12 + #include <net/ipv6.h> 12 13 #include <linux/netfilter.h> 13 14 #include <linux/netfilter_ipv6.h> 14 15 #include <linux/netfilter_ipv6/ip6t_NPT.h> ··· 19 18 { 20 19 struct ip6t_npt_tginfo *npt = par->targinfo; 21 20 __wsum src_sum = 0, dst_sum = 0; 21 + struct in6_addr pfx; 22 22 unsigned int i; 23 23 24 24 if (npt->src_pfx_len > 64 || npt->dst_pfx_len > 64) 25 + return -EINVAL; 26 + 27 + /* Ensure that LSB of prefix is zero */ 28 + ipv6_addr_prefix(&pfx, &npt->src_pfx.in6, npt->src_pfx_len); 29 + if (!ipv6_addr_equal(&pfx, &npt->src_pfx.in6)) 30 + return -EINVAL; 31 + ipv6_addr_prefix(&pfx, &npt->dst_pfx.in6, npt->dst_pfx_len); 32 + if (!ipv6_addr_equal(&pfx, &npt->dst_pfx.in6)) 25 33 return -EINVAL; 26 34 27 35 for (i = 0; i < ARRAY_SIZE(npt->src_pfx.in6.s6_addr16); i++) { ··· 40 30 (__force __wsum)npt->dst_pfx.in6.s6_addr16[i]); 41 31 } 42 32 43 - npt->adjustment = (__force __sum16) csum_sub(src_sum, dst_sum); 33 + npt->adjustment = ~csum_fold(csum_sub(src_sum, dst_sum)); 44 34 return 0; 45 35 } 46 36 ··· 61 51 62 52 idx = i / 32; 63 53 addr->s6_addr32[idx] &= mask; 64 - addr->s6_addr32[idx] |= npt->dst_pfx.in6.s6_addr32[idx]; 54 + addr->s6_addr32[idx] |= ~mask & npt->dst_pfx.in6.s6_addr32[idx]; 65 55 } 66 56 67 57 if (pfx_len <= 48) ··· 76 66 return false; 77 67 } 78 68 79 - sum = (__force __sum16) csum_add((__force __wsum)addr->s6_addr16[idx], 80 - npt->adjustment); 69 + sum = ~csum_fold(csum_add(csum_unfold((__force __sum16)addr->s6_addr16[idx]), 70 + csum_unfold(npt->adjustment))); 81 71 if (sum == CSUM_MANGLED_0) 82 72 sum = 0; 83 73 *(__force __sum16 *)&addr->s6_addr16[idx] = sum;
+2 -1
net/mac80211/cfg.c
··· 2004 2004 { 2005 2005 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 2006 2006 2007 - memcpy(sdata->vif.bss_conf.mcast_rate, rate, sizeof(rate)); 2007 + memcpy(sdata->vif.bss_conf.mcast_rate, rate, 2008 + sizeof(int) * IEEE80211_NUM_BANDS); 2008 2009 2009 2010 return 0; 2010 2011 }
+7 -4
net/mac80211/mlme.c
··· 3400 3400 3401 3401 ret = 0; 3402 3402 3403 + out: 3403 3404 while (!cfg80211_chandef_usable(sdata->local->hw.wiphy, chandef, 3404 3405 IEEE80211_CHAN_DISABLED)) { 3405 3406 if (WARN_ON(chandef->width == NL80211_CHAN_WIDTH_20_NOHT)) { ··· 3409 3408 goto out; 3410 3409 } 3411 3410 3412 - ret = chandef_downgrade(chandef); 3411 + ret |= chandef_downgrade(chandef); 3413 3412 } 3414 3413 3415 3414 if (chandef->width != vht_chandef.width) 3416 3415 sdata_info(sdata, 3417 - "local regulatory prevented using AP HT/VHT configuration, downgraded\n"); 3416 + "capabilities/regulatory prevented using AP HT/VHT configuration, downgraded\n"); 3418 3417 3419 - out: 3420 3418 WARN_ON_ONCE(!cfg80211_chandef_valid(chandef)); 3421 3419 return ret; 3422 3420 } ··· 3529 3529 */ 3530 3530 ret = ieee80211_vif_use_channel(sdata, &chandef, 3531 3531 IEEE80211_CHANCTX_SHARED); 3532 - while (ret && chandef.width != NL80211_CHAN_WIDTH_20_NOHT) 3532 + while (ret && chandef.width != NL80211_CHAN_WIDTH_20_NOHT) { 3533 3533 ifmgd->flags |= chandef_downgrade(&chandef); 3534 + ret = ieee80211_vif_use_channel(sdata, &chandef, 3535 + IEEE80211_CHANCTX_SHARED); 3536 + } 3534 3537 return ret; 3535 3538 } 3536 3539
+17 -18
net/netfilter/ipvs/ip_vs_proto_sctp.c
··· 61 61 return 1; 62 62 } 63 63 64 + static void sctp_nat_csum(struct sk_buff *skb, sctp_sctphdr_t *sctph, 65 + unsigned int sctphoff) 66 + { 67 + __u32 crc32; 68 + struct sk_buff *iter; 69 + 70 + crc32 = sctp_start_cksum((__u8 *)sctph, skb_headlen(skb) - sctphoff); 71 + skb_walk_frags(skb, iter) 72 + crc32 = sctp_update_cksum((u8 *) iter->data, 73 + skb_headlen(iter), crc32); 74 + sctph->checksum = sctp_end_cksum(crc32); 75 + 76 + skb->ip_summed = CHECKSUM_UNNECESSARY; 77 + } 78 + 64 79 static int 65 80 sctp_snat_handler(struct sk_buff *skb, struct ip_vs_protocol *pp, 66 81 struct ip_vs_conn *cp, struct ip_vs_iphdr *iph) 67 82 { 68 83 sctp_sctphdr_t *sctph; 69 84 unsigned int sctphoff = iph->len; 70 - struct sk_buff *iter; 71 - __be32 crc32; 72 85 73 86 #ifdef CONFIG_IP_VS_IPV6 74 87 if (cp->af == AF_INET6 && iph->fragoffs) ··· 105 92 sctph = (void *) skb_network_header(skb) + sctphoff; 106 93 sctph->source = cp->vport; 107 94 108 - /* Calculate the checksum */ 109 - crc32 = sctp_start_cksum((u8 *) sctph, skb_headlen(skb) - sctphoff); 110 - skb_walk_frags(skb, iter) 111 - crc32 = sctp_update_cksum((u8 *) iter->data, skb_headlen(iter), 112 - crc32); 113 - crc32 = sctp_end_cksum(crc32); 114 - sctph->checksum = crc32; 95 + sctp_nat_csum(skb, sctph, sctphoff); 115 96 116 97 return 1; 117 98 } ··· 116 109 { 117 110 sctp_sctphdr_t *sctph; 118 111 unsigned int sctphoff = iph->len; 119 - struct sk_buff *iter; 120 - __be32 crc32; 121 112 122 113 #ifdef CONFIG_IP_VS_IPV6 123 114 if (cp->af == AF_INET6 && iph->fragoffs) ··· 139 134 sctph = (void *) skb_network_header(skb) + sctphoff; 140 135 sctph->dest = cp->dport; 141 136 142 - /* Calculate the checksum */ 143 - crc32 = sctp_start_cksum((u8 *) sctph, skb_headlen(skb) - sctphoff); 144 - skb_walk_frags(skb, iter) 145 - crc32 = sctp_update_cksum((u8 *) iter->data, skb_headlen(iter), 146 - crc32); 147 - crc32 = sctp_end_cksum(crc32); 148 - sctph->checksum = crc32; 137 + sctp_nat_csum(skb, sctph, sctphoff); 149 138 150 139 return 1; 151 140 }
+2
net/netfilter/ipvs/ip_vs_sync.c
··· 1795 1795 GFP_KERNEL); 1796 1796 if (!tinfo->buf) 1797 1797 goto outtinfo; 1798 + } else { 1799 + tinfo->buf = NULL; 1798 1800 } 1799 1801 tinfo->id = id; 1800 1802
+2 -2
net/sched/sch_htb.c
··· 1135 1135 memset(&opt, 0, sizeof(opt)); 1136 1136 1137 1137 opt.rate.rate = cl->rate.rate_bps >> 3; 1138 - opt.buffer = cl->buffer; 1138 + opt.buffer = PSCHED_NS2TICKS(cl->buffer); 1139 1139 opt.ceil.rate = cl->ceil.rate_bps >> 3; 1140 - opt.cbuffer = cl->cbuffer; 1140 + opt.cbuffer = PSCHED_NS2TICKS(cl->cbuffer); 1141 1141 opt.quantum = cl->quantum; 1142 1142 opt.prio = cl->prio; 1143 1143 opt.level = cl->level;
+2 -2
net/sctp/Kconfig
··· 3 3 # 4 4 5 5 menuconfig IP_SCTP 6 - tristate "The SCTP Protocol (EXPERIMENTAL)" 7 - depends on INET && EXPERIMENTAL 6 + tristate "The SCTP Protocol" 7 + depends on INET 8 8 depends on IPV6 || IPV6=n 9 9 select CRYPTO 10 10 select CRYPTO_HMAC
+3 -2
net/sctp/ipv6.c
··· 326 326 */ 327 327 rcu_read_lock(); 328 328 list_for_each_entry_rcu(laddr, &bp->address_list, list) { 329 - if (!laddr->valid && laddr->state != SCTP_ADDR_SRC) 329 + if (!laddr->valid) 330 330 continue; 331 - if ((laddr->a.sa.sa_family == AF_INET6) && 331 + if ((laddr->state == SCTP_ADDR_SRC) && 332 + (laddr->a.sa.sa_family == AF_INET6) && 332 333 (scope <= sctp_scope(&laddr->a))) { 333 334 bmatchlen = sctp_v6_addr_match_len(daddr, &laddr->a); 334 335 if (!baddr || (matchlen < bmatchlen)) {