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 updates from David Miller:

1) ax88796 does 64-bit divides which causes link errors on ARM, fix
from Arnd Bergmann.

2) Once an improper offload setting is detected on an SKB we don't rate
limit the log message so we can very easily live lock. From Ben
Greear.

3) Openvswitch cannot report vport configuration changes reliably
because it didn't preallocate the netlink notification message
before changing state. From Jesse Gross.

4) The effective UID/GID SCM credentials fix, from Linus.

5) When a user explicitly asks for wireless authentication, cfg80211
isn't told about the AP detachment leaving inconsistent state. Fix
from Johannes Berg.

6) Fix self-MAC checks in batman-adv on multi-mesh nodes, from Antonio
Quartulli.

7) Revert build_skb() change sin IGB driver, can result in memory
corruption. From Alexander Duyck.

8) Fix setting VLANs on virtual functions in IXGBE, from Greg Rose.

9) Fix TSO races in qlcnic driver, from Sritej Velaga.

10) In bnx2x the kernel driver and UNDI firmware can try to program the
chip at the same time, resulting in corruption. Add proper
synchronization. From Dmitry Kravkov.

11) Fix corruption of status block in firmware ram in bxn2x, from Ariel
Elior.

12) Fix load balancing hash regression of bonding driver in forwarding
configurations, from Eric Dumazet.

13) Fix TS ECR regression in TCP by calling tcp_replace_ts_recent() in
all the right spots, from Eric Dumazet.

14) Fix several bonding bugs having to do with address manintainence,
including not removing address when configuration operations
encounter errors, missed locking on the address lists, missing
refcounting on VLAN objects, etc. All from Nikolay Aleksandrov.

15) Add workarounds for firmware bugs in LTE qmi_wwan devices, wherein
the devices fail to add a proper ethernet header while on LTE
networks but otherwise properly do so on 2G and 3G ones. From Bjørn
Mork.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (38 commits)
net: fix incorrect credentials passing
net: rate-limit warn-bad-offload splats.
net: ax88796: avoid 64 bit arithmetic
qlge: Update version to 1.00.00.32.
qlge: Fix ethtool autoneg advertising.
qlge: Fix receive path to drop error frames
net: qmi_wwan: prevent duplicate mac address on link (firmware bug workaround)
net: qmi_wwan: fixup destination address (firmware bug workaround)
net: qmi_wwan: fixup missing ethernet header (firmware bug workaround)
bonding: in bond_mc_swap() bond's mc addr list is walked without lock
bonding: disable netpoll on enslave failure
bonding: primary_slave & curr_active_slave are not cleaned on enslave failure
bonding: vlans don't get deleted on enslave failure
bonding: mc addresses don't get deleted on enslave failure
pkt_sched: fix error return code in fw_change_attrs()
irda: small read past the end of array in debug code
tcp: call tcp_replace_ts_recent() from tcp_ack()
netfilter: xt_rpfilter: skip locally generated broadcast/multicast, too
netfilter: ipset: bitmap:ip,mac: fix listing with timeout
bonding: fix l23 and l34 load balancing in forwarding path
...

+544 -393
+51 -25
drivers/net/bonding/bond_main.c
··· 846 846 if (bond->dev->flags & IFF_ALLMULTI) 847 847 dev_set_allmulti(old_active->dev, -1); 848 848 849 + netif_addr_lock_bh(bond->dev); 849 850 netdev_for_each_mc_addr(ha, bond->dev) 850 851 dev_mc_del(old_active->dev, ha->addr); 852 + netif_addr_unlock_bh(bond->dev); 851 853 } 852 854 853 855 if (new_active) { ··· 860 858 if (bond->dev->flags & IFF_ALLMULTI) 861 859 dev_set_allmulti(new_active->dev, 1); 862 860 861 + netif_addr_lock_bh(bond->dev); 863 862 netdev_for_each_mc_addr(ha, bond->dev) 864 863 dev_mc_add(new_active->dev, ha->addr); 864 + netif_addr_unlock_bh(bond->dev); 865 865 } 866 866 } 867 867 ··· 1905 1901 bond_destroy_slave_symlinks(bond_dev, slave_dev); 1906 1902 1907 1903 err_detach: 1904 + if (!USES_PRIMARY(bond->params.mode)) { 1905 + netif_addr_lock_bh(bond_dev); 1906 + bond_mc_list_flush(bond_dev, slave_dev); 1907 + netif_addr_unlock_bh(bond_dev); 1908 + } 1909 + bond_del_vlans_from_slave(bond, slave_dev); 1908 1910 write_lock_bh(&bond->lock); 1909 1911 bond_detach_slave(bond, new_slave); 1912 + if (bond->primary_slave == new_slave) 1913 + bond->primary_slave = NULL; 1910 1914 write_unlock_bh(&bond->lock); 1915 + if (bond->curr_active_slave == new_slave) { 1916 + read_lock(&bond->lock); 1917 + write_lock_bh(&bond->curr_slave_lock); 1918 + bond_change_active_slave(bond, NULL); 1919 + bond_select_active_slave(bond); 1920 + write_unlock_bh(&bond->curr_slave_lock); 1921 + read_unlock(&bond->lock); 1922 + } 1923 + slave_disable_netpoll(new_slave); 1911 1924 1912 1925 err_close: 1913 1926 slave_dev->priv_flags &= ~IFF_BONDING; ··· 3317 3296 */ 3318 3297 static int bond_xmit_hash_policy_l23(struct sk_buff *skb, int count) 3319 3298 { 3320 - struct ethhdr *data = (struct ethhdr *)skb->data; 3321 - struct iphdr *iph; 3322 - struct ipv6hdr *ipv6h; 3299 + const struct ethhdr *data; 3300 + const struct iphdr *iph; 3301 + const struct ipv6hdr *ipv6h; 3323 3302 u32 v6hash; 3324 - __be32 *s, *d; 3303 + const __be32 *s, *d; 3325 3304 3326 3305 if (skb->protocol == htons(ETH_P_IP) && 3327 - skb_network_header_len(skb) >= sizeof(*iph)) { 3306 + pskb_network_may_pull(skb, sizeof(*iph))) { 3328 3307 iph = ip_hdr(skb); 3308 + data = (struct ethhdr *)skb->data; 3329 3309 return ((ntohl(iph->saddr ^ iph->daddr) & 0xffff) ^ 3330 3310 (data->h_dest[5] ^ data->h_source[5])) % count; 3331 3311 } else if (skb->protocol == htons(ETH_P_IPV6) && 3332 - skb_network_header_len(skb) >= sizeof(*ipv6h)) { 3312 + pskb_network_may_pull(skb, sizeof(*ipv6h))) { 3333 3313 ipv6h = ipv6_hdr(skb); 3314 + data = (struct ethhdr *)skb->data; 3334 3315 s = &ipv6h->saddr.s6_addr32[0]; 3335 3316 d = &ipv6h->daddr.s6_addr32[0]; 3336 3317 v6hash = (s[1] ^ d[1]) ^ (s[2] ^ d[2]) ^ (s[3] ^ d[3]); ··· 3351 3328 static int bond_xmit_hash_policy_l34(struct sk_buff *skb, int count) 3352 3329 { 3353 3330 u32 layer4_xor = 0; 3354 - struct iphdr *iph; 3355 - struct ipv6hdr *ipv6h; 3356 - __be32 *s, *d; 3357 - __be16 *layer4hdr; 3331 + const struct iphdr *iph; 3332 + const struct ipv6hdr *ipv6h; 3333 + const __be32 *s, *d; 3334 + const __be16 *l4 = NULL; 3335 + __be16 _l4[2]; 3336 + int noff = skb_network_offset(skb); 3337 + int poff; 3358 3338 3359 3339 if (skb->protocol == htons(ETH_P_IP) && 3360 - skb_network_header_len(skb) >= sizeof(*iph)) { 3340 + pskb_may_pull(skb, noff + sizeof(*iph))) { 3361 3341 iph = ip_hdr(skb); 3362 - if (!ip_is_fragment(iph) && 3363 - (iph->protocol == IPPROTO_TCP || 3364 - iph->protocol == IPPROTO_UDP) && 3365 - (skb_headlen(skb) - skb_network_offset(skb) >= 3366 - iph->ihl * sizeof(u32) + sizeof(*layer4hdr) * 2)) { 3367 - layer4hdr = (__be16 *)((u32 *)iph + iph->ihl); 3368 - layer4_xor = ntohs(*layer4hdr ^ *(layer4hdr + 1)); 3342 + poff = proto_ports_offset(iph->protocol); 3343 + 3344 + if (!ip_is_fragment(iph) && poff >= 0) { 3345 + l4 = skb_header_pointer(skb, noff + (iph->ihl << 2) + poff, 3346 + sizeof(_l4), &_l4); 3347 + if (l4) 3348 + layer4_xor = ntohs(l4[0] ^ l4[1]); 3369 3349 } 3370 3350 return (layer4_xor ^ 3371 3351 ((ntohl(iph->saddr ^ iph->daddr)) & 0xffff)) % count; 3372 3352 } else if (skb->protocol == htons(ETH_P_IPV6) && 3373 - skb_network_header_len(skb) >= sizeof(*ipv6h)) { 3353 + pskb_may_pull(skb, noff + sizeof(*ipv6h))) { 3374 3354 ipv6h = ipv6_hdr(skb); 3375 - if ((ipv6h->nexthdr == IPPROTO_TCP || 3376 - ipv6h->nexthdr == IPPROTO_UDP) && 3377 - (skb_headlen(skb) - skb_network_offset(skb) >= 3378 - sizeof(*ipv6h) + sizeof(*layer4hdr) * 2)) { 3379 - layer4hdr = (__be16 *)(ipv6h + 1); 3380 - layer4_xor = ntohs(*layer4hdr ^ *(layer4hdr + 1)); 3355 + poff = proto_ports_offset(ipv6h->nexthdr); 3356 + if (poff >= 0) { 3357 + l4 = skb_header_pointer(skb, noff + sizeof(*ipv6h) + poff, 3358 + sizeof(_l4), &_l4); 3359 + if (l4) 3360 + layer4_xor = ntohs(l4[0] ^ l4[1]); 3381 3361 } 3382 3362 s = &ipv6h->saddr.s6_addr32[0]; 3383 3363 d = &ipv6h->daddr.s6_addr32[0];
+1 -1
drivers/net/ethernet/8390/ax88796.c
··· 828 828 struct ei_device *ei_local; 829 829 struct ax_device *ax; 830 830 struct resource *irq, *mem, *mem2; 831 - resource_size_t mem_size, mem2_size = 0; 831 + unsigned long mem_size, mem2_size = 0; 832 832 int ret = 0; 833 833 834 834 dev = ax__alloc_ei_netdev(sizeof(struct ax_device));
+5 -2
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
··· 2614 2614 } 2615 2615 } 2616 2616 2617 + /* initialize FW coalescing state machines in RAM */ 2618 + bnx2x_update_coalesce(bp); 2619 + 2617 2620 /* setup the leading queue */ 2618 2621 rc = bnx2x_setup_leading(bp); 2619 2622 if (rc) { ··· 4583 4580 u32 enable_flag = disable ? 0 : (1 << HC_INDEX_DATA_HC_ENABLED_SHIFT); 4584 4581 u32 addr = BAR_CSTRORM_INTMEM + 4585 4582 CSTORM_STATUS_BLOCK_DATA_FLAGS_OFFSET(fw_sb_id, sb_index); 4586 - u16 flags = REG_RD16(bp, addr); 4583 + u8 flags = REG_RD8(bp, addr); 4587 4584 /* clear and set */ 4588 4585 flags &= ~HC_INDEX_DATA_HC_ENABLED; 4589 4586 flags |= enable_flag; 4590 - REG_WR16(bp, addr, flags); 4587 + REG_WR8(bp, addr, flags); 4591 4588 DP(NETIF_MSG_IFUP, 4592 4589 "port %x fw_sb_id %d sb_index %d disable %d\n", 4593 4590 port, fw_sb_id, sb_index, disable);
+4
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
··· 9878 9878 REG_RD(bp, NIG_REG_NIG_INT_STS_CLR_0); 9879 9879 } 9880 9880 } 9881 + if (!CHIP_IS_E1x(bp)) 9882 + /* block FW from writing to host */ 9883 + REG_WR(bp, PGLUE_B_REG_INTERNAL_PFID_ENABLE_MASTER, 0); 9884 + 9881 9885 /* wait until BRB is empty */ 9882 9886 tmp_reg = REG_RD(bp, BRB1_REG_NUM_OF_FULL_BLOCKS); 9883 9887 while (timer_count) {
-8
drivers/net/ethernet/intel/igb/igb.h
··· 284 284 enum e1000_ring_flags_t { 285 285 IGB_RING_FLAG_RX_SCTP_CSUM, 286 286 IGB_RING_FLAG_RX_LB_VLAN_BSWAP, 287 - IGB_RING_FLAG_RX_BUILD_SKB_ENABLED, 288 287 IGB_RING_FLAG_TX_CTX_IDX, 289 288 IGB_RING_FLAG_TX_DETECT_HANG 290 289 }; 291 - 292 - #define ring_uses_build_skb(ring) \ 293 - test_bit(IGB_RING_FLAG_RX_BUILD_SKB_ENABLED, &(ring)->flags) 294 - #define set_ring_build_skb_enabled(ring) \ 295 - set_bit(IGB_RING_FLAG_RX_BUILD_SKB_ENABLED, &(ring)->flags) 296 - #define clear_ring_build_skb_enabled(ring) \ 297 - clear_bit(IGB_RING_FLAG_RX_BUILD_SKB_ENABLED, &(ring)->flags) 298 290 299 291 #define IGB_TXD_DCMD (E1000_ADVTXD_DCMD_EOP | E1000_ADVTXD_DCMD_RS) 300 292
+4 -106
drivers/net/ethernet/intel/igb/igb_main.c
··· 3350 3350 wr32(E1000_RXDCTL(reg_idx), rxdctl); 3351 3351 } 3352 3352 3353 - static void igb_set_rx_buffer_len(struct igb_adapter *adapter, 3354 - struct igb_ring *rx_ring) 3355 - { 3356 - #define IGB_MAX_BUILD_SKB_SIZE \ 3357 - (SKB_WITH_OVERHEAD(IGB_RX_BUFSZ) - \ 3358 - (NET_SKB_PAD + NET_IP_ALIGN + IGB_TS_HDR_LEN)) 3359 - 3360 - /* set build_skb flag */ 3361 - if (adapter->max_frame_size <= IGB_MAX_BUILD_SKB_SIZE) 3362 - set_ring_build_skb_enabled(rx_ring); 3363 - else 3364 - clear_ring_build_skb_enabled(rx_ring); 3365 - } 3366 - 3367 3353 /** 3368 3354 * igb_configure_rx - Configure receive Unit after Reset 3369 3355 * @adapter: board private structure ··· 3369 3383 3370 3384 /* Setup the HW Rx Head and Tail Descriptor Pointers and 3371 3385 * the Base and Length of the Rx Descriptor Ring */ 3372 - for (i = 0; i < adapter->num_rx_queues; i++) { 3373 - struct igb_ring *rx_ring = adapter->rx_ring[i]; 3374 - igb_set_rx_buffer_len(adapter, rx_ring); 3375 - igb_configure_rx_ring(adapter, rx_ring); 3376 - } 3386 + for (i = 0; i < adapter->num_rx_queues; i++) 3387 + igb_configure_rx_ring(adapter, adapter->rx_ring[i]); 3377 3388 } 3378 3389 3379 3390 /** ··· 6186 6203 return igb_can_reuse_rx_page(rx_buffer, page, truesize); 6187 6204 } 6188 6205 6189 - static struct sk_buff *igb_build_rx_buffer(struct igb_ring *rx_ring, 6190 - union e1000_adv_rx_desc *rx_desc) 6191 - { 6192 - struct igb_rx_buffer *rx_buffer; 6193 - struct sk_buff *skb; 6194 - struct page *page; 6195 - void *page_addr; 6196 - unsigned int size = le16_to_cpu(rx_desc->wb.upper.length); 6197 - #if (PAGE_SIZE < 8192) 6198 - unsigned int truesize = IGB_RX_BUFSZ; 6199 - #else 6200 - unsigned int truesize = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) + 6201 - SKB_DATA_ALIGN(NET_SKB_PAD + 6202 - NET_IP_ALIGN + 6203 - size); 6204 - #endif 6205 - 6206 - /* If we spanned a buffer we have a huge mess so test for it */ 6207 - BUG_ON(unlikely(!igb_test_staterr(rx_desc, E1000_RXD_STAT_EOP))); 6208 - 6209 - rx_buffer = &rx_ring->rx_buffer_info[rx_ring->next_to_clean]; 6210 - page = rx_buffer->page; 6211 - prefetchw(page); 6212 - 6213 - page_addr = page_address(page) + rx_buffer->page_offset; 6214 - 6215 - /* prefetch first cache line of first page */ 6216 - prefetch(page_addr + NET_SKB_PAD + NET_IP_ALIGN); 6217 - #if L1_CACHE_BYTES < 128 6218 - prefetch(page_addr + L1_CACHE_BYTES + NET_SKB_PAD + NET_IP_ALIGN); 6219 - #endif 6220 - 6221 - /* build an skb to around the page buffer */ 6222 - skb = build_skb(page_addr, truesize); 6223 - if (unlikely(!skb)) { 6224 - rx_ring->rx_stats.alloc_failed++; 6225 - return NULL; 6226 - } 6227 - 6228 - /* we are reusing so sync this buffer for CPU use */ 6229 - dma_sync_single_range_for_cpu(rx_ring->dev, 6230 - rx_buffer->dma, 6231 - rx_buffer->page_offset, 6232 - IGB_RX_BUFSZ, 6233 - DMA_FROM_DEVICE); 6234 - 6235 - /* update pointers within the skb to store the data */ 6236 - skb_reserve(skb, NET_IP_ALIGN + NET_SKB_PAD); 6237 - __skb_put(skb, size); 6238 - 6239 - /* pull timestamp out of packet data */ 6240 - if (igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TSIP)) { 6241 - igb_ptp_rx_pktstamp(rx_ring->q_vector, skb->data, skb); 6242 - __skb_pull(skb, IGB_TS_HDR_LEN); 6243 - } 6244 - 6245 - if (igb_can_reuse_rx_page(rx_buffer, page, truesize)) { 6246 - /* hand second half of page back to the ring */ 6247 - igb_reuse_rx_page(rx_ring, rx_buffer); 6248 - } else { 6249 - /* we are not reusing the buffer so unmap it */ 6250 - dma_unmap_page(rx_ring->dev, rx_buffer->dma, 6251 - PAGE_SIZE, DMA_FROM_DEVICE); 6252 - } 6253 - 6254 - /* clear contents of buffer_info */ 6255 - rx_buffer->dma = 0; 6256 - rx_buffer->page = NULL; 6257 - 6258 - return skb; 6259 - } 6260 - 6261 6206 static struct sk_buff *igb_fetch_rx_buffer(struct igb_ring *rx_ring, 6262 6207 union e1000_adv_rx_desc *rx_desc, 6263 6208 struct sk_buff *skb) ··· 6601 6690 rmb(); 6602 6691 6603 6692 /* retrieve a buffer from the ring */ 6604 - if (ring_uses_build_skb(rx_ring)) 6605 - skb = igb_build_rx_buffer(rx_ring, rx_desc); 6606 - else 6607 - skb = igb_fetch_rx_buffer(rx_ring, rx_desc, skb); 6693 + skb = igb_fetch_rx_buffer(rx_ring, rx_desc, skb); 6608 6694 6609 6695 /* exit if we failed to retrieve a buffer */ 6610 6696 if (!skb) ··· 6688 6780 return true; 6689 6781 } 6690 6782 6691 - static inline unsigned int igb_rx_offset(struct igb_ring *rx_ring) 6692 - { 6693 - if (ring_uses_build_skb(rx_ring)) 6694 - return NET_SKB_PAD + NET_IP_ALIGN; 6695 - else 6696 - return 0; 6697 - } 6698 - 6699 6783 /** 6700 6784 * igb_alloc_rx_buffers - Replace used receive buffers; packet split 6701 6785 * @adapter: address of board private structure ··· 6714 6814 * Refresh the desc even if buffer_addrs didn't change 6715 6815 * because each write-back erases this info. 6716 6816 */ 6717 - rx_desc->read.pkt_addr = cpu_to_le64(bi->dma + 6718 - bi->page_offset + 6719 - igb_rx_offset(rx_ring)); 6817 + rx_desc->read.pkt_addr = cpu_to_le64(bi->dma + bi->page_offset); 6720 6818 6721 6819 rx_desc++; 6722 6820 bi++;
+6
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
··· 1049 1049 if ((vf >= adapter->num_vfs) || (vlan > 4095) || (qos > 7)) 1050 1050 return -EINVAL; 1051 1051 if (vlan || qos) { 1052 + if (adapter->vfinfo[vf].pf_vlan) 1053 + err = ixgbe_set_vf_vlan(adapter, false, 1054 + adapter->vfinfo[vf].pf_vlan, 1055 + vf); 1056 + if (err) 1057 + goto out; 1052 1058 err = ixgbe_set_vf_vlan(adapter, true, vlan, vf); 1053 1059 if (err) 1054 1060 goto out;
+10 -5
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
··· 1500 1500 } 1501 1501 } while ((adapter->ahw->linkup && ahw->has_link_events) != 1); 1502 1502 1503 + /* Make sure carrier is off and queue is stopped during loopback */ 1504 + if (netif_running(netdev)) { 1505 + netif_carrier_off(netdev); 1506 + netif_stop_queue(netdev); 1507 + } 1508 + 1503 1509 ret = qlcnic_do_lb_test(adapter, mode); 1504 1510 1505 1511 qlcnic_83xx_clear_lb_mode(adapter, mode); ··· 2786 2780 void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data) 2787 2781 { 2788 2782 struct qlcnic_cmd_args cmd; 2783 + struct net_device *netdev = adapter->netdev; 2789 2784 int ret = 0; 2790 2785 2791 2786 qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_GET_STATISTICS); ··· 2796 2789 data = qlcnic_83xx_fill_stats(adapter, &cmd, data, 2797 2790 QLC_83XX_STAT_TX, &ret); 2798 2791 if (ret) { 2799 - dev_info(&adapter->pdev->dev, "Error getting MAC stats\n"); 2792 + netdev_err(netdev, "Error getting Tx stats\n"); 2800 2793 goto out; 2801 2794 } 2802 2795 /* Get MAC stats */ ··· 2806 2799 data = qlcnic_83xx_fill_stats(adapter, &cmd, data, 2807 2800 QLC_83XX_STAT_MAC, &ret); 2808 2801 if (ret) { 2809 - dev_info(&adapter->pdev->dev, 2810 - "Error getting Rx stats\n"); 2802 + netdev_err(netdev, "Error getting MAC stats\n"); 2811 2803 goto out; 2812 2804 } 2813 2805 /* Get Rx stats */ ··· 2816 2810 data = qlcnic_83xx_fill_stats(adapter, &cmd, data, 2817 2811 QLC_83XX_STAT_RX, &ret); 2818 2812 if (ret) 2819 - dev_info(&adapter->pdev->dev, 2820 - "Error getting Tx stats\n"); 2813 + netdev_err(netdev, "Error getting Rx stats\n"); 2821 2814 out: 2822 2815 qlcnic_free_mbx_args(&cmd); 2823 2816 }
+1 -2
drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
··· 358 358 memcpy(&first_desc->eth_addr, skb->data, ETH_ALEN); 359 359 } 360 360 opcode = TX_ETHER_PKT; 361 - if ((adapter->netdev->features & (NETIF_F_TSO | NETIF_F_TSO6)) && 362 - skb_shinfo(skb)->gso_size > 0) { 361 + if (skb_is_gso(skb)) { 363 362 hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); 364 363 first_desc->mss = cpu_to_le16(skb_shinfo(skb)->gso_size); 365 364 first_desc->total_hdr_length = hdr_len;
+1 -1
drivers/net/ethernet/qlogic/qlge/qlge.h
··· 18 18 */ 19 19 #define DRV_NAME "qlge" 20 20 #define DRV_STRING "QLogic 10 Gigabit PCI-E Ethernet Driver " 21 - #define DRV_VERSION "v1.00.00.31" 21 + #define DRV_VERSION "v1.00.00.32" 22 22 23 23 #define WQ_ADDR_ALIGN 0x3 /* 4 byte alignment */ 24 24
+1 -1
drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c
··· 379 379 380 380 ecmd->supported = SUPPORTED_10000baseT_Full; 381 381 ecmd->advertising = ADVERTISED_10000baseT_Full; 382 - ecmd->autoneg = AUTONEG_ENABLE; 383 382 ecmd->transceiver = XCVR_EXTERNAL; 384 383 if ((qdev->link_status & STS_LINK_TYPE_MASK) == 385 384 STS_LINK_TYPE_10GBASET) { 386 385 ecmd->supported |= (SUPPORTED_TP | SUPPORTED_Autoneg); 387 386 ecmd->advertising |= (ADVERTISED_TP | ADVERTISED_Autoneg); 388 387 ecmd->port = PORT_TP; 388 + ecmd->autoneg = AUTONEG_ENABLE; 389 389 } else { 390 390 ecmd->supported |= SUPPORTED_FIBRE; 391 391 ecmd->advertising |= ADVERTISED_FIBRE;
+29 -7
drivers/net/ethernet/qlogic/qlge/qlge_main.c
··· 1434 1434 } 1435 1435 1436 1436 /* Categorizing receive firmware frame errors */ 1437 - static void ql_categorize_rx_err(struct ql_adapter *qdev, u8 rx_err) 1437 + static void ql_categorize_rx_err(struct ql_adapter *qdev, u8 rx_err, 1438 + struct rx_ring *rx_ring) 1438 1439 { 1439 1440 struct nic_stats *stats = &qdev->nic_stats; 1440 1441 1441 1442 stats->rx_err_count++; 1443 + rx_ring->rx_errors++; 1442 1444 1443 1445 switch (rx_err & IB_MAC_IOCB_RSP_ERR_MASK) { 1444 1446 case IB_MAC_IOCB_RSP_ERR_CODE_ERR: ··· 1476 1474 struct bq_desc *lbq_desc = ql_get_curr_lchunk(qdev, rx_ring); 1477 1475 struct napi_struct *napi = &rx_ring->napi; 1478 1476 1477 + /* Frame error, so drop the packet. */ 1478 + if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) { 1479 + ql_categorize_rx_err(qdev, ib_mac_rsp->flags2, rx_ring); 1480 + put_page(lbq_desc->p.pg_chunk.page); 1481 + return; 1482 + } 1479 1483 napi->dev = qdev->ndev; 1480 1484 1481 1485 skb = napi_get_frags(napi); ··· 1536 1528 1537 1529 addr = lbq_desc->p.pg_chunk.va; 1538 1530 prefetch(addr); 1531 + 1532 + /* Frame error, so drop the packet. */ 1533 + if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) { 1534 + ql_categorize_rx_err(qdev, ib_mac_rsp->flags2, rx_ring); 1535 + goto err_out; 1536 + } 1539 1537 1540 1538 /* The max framesize filter on this chip is set higher than 1541 1539 * MTU since FCoE uses 2k frames. ··· 1627 1613 skb_reserve(new_skb, NET_IP_ALIGN); 1628 1614 memcpy(skb_put(new_skb, length), skb->data, length); 1629 1615 skb = new_skb; 1616 + 1617 + /* Frame error, so drop the packet. */ 1618 + if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) { 1619 + ql_categorize_rx_err(qdev, ib_mac_rsp->flags2, rx_ring); 1620 + dev_kfree_skb_any(skb); 1621 + return; 1622 + } 1630 1623 1631 1624 /* loopback self test for ethtool */ 1632 1625 if (test_bit(QL_SELFTEST, &qdev->flags)) { ··· 1940 1919 return; 1941 1920 } 1942 1921 1922 + /* Frame error, so drop the packet. */ 1923 + if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) { 1924 + ql_categorize_rx_err(qdev, ib_mac_rsp->flags2, rx_ring); 1925 + dev_kfree_skb_any(skb); 1926 + return; 1927 + } 1928 + 1943 1929 /* The max framesize filter on this chip is set higher than 1944 1930 * MTU since FCoE uses 2k frames. 1945 1931 */ ··· 2027 1999 IB_MAC_IOCB_RSP_VLAN_MASK)) : 0xffff; 2028 2000 2029 2001 QL_DUMP_IB_MAC_RSP(ib_mac_rsp); 2030 - 2031 - /* Frame error, so drop the packet. */ 2032 - if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) { 2033 - ql_categorize_rx_err(qdev, ib_mac_rsp->flags2); 2034 - return (unsigned long)length; 2035 - } 2036 2002 2037 2003 if (ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HV) { 2038 2004 /* The data and headers are split into
+104
drivers/net/usb/qmi_wwan.c
··· 13 13 #include <linux/module.h> 14 14 #include <linux/netdevice.h> 15 15 #include <linux/ethtool.h> 16 + #include <linux/etherdevice.h> 16 17 #include <linux/mii.h> 17 18 #include <linux/usb.h> 18 19 #include <linux/usb/cdc.h> ··· 51 50 unsigned long unused; 52 51 struct usb_interface *control; 53 52 struct usb_interface *data; 53 + }; 54 + 55 + /* default ethernet address used by the modem */ 56 + static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3}; 57 + 58 + /* Make up an ethernet header if the packet doesn't have one. 59 + * 60 + * A firmware bug common among several devices cause them to send raw 61 + * IP packets under some circumstances. There is no way for the 62 + * driver/host to know when this will happen. And even when the bug 63 + * hits, some packets will still arrive with an intact header. 64 + * 65 + * The supported devices are only capably of sending IPv4, IPv6 and 66 + * ARP packets on a point-to-point link. Any packet with an ethernet 67 + * header will have either our address or a broadcast/multicast 68 + * address as destination. ARP packets will always have a header. 69 + * 70 + * This means that this function will reliably add the appropriate 71 + * header iff necessary, provided our hardware address does not start 72 + * with 4 or 6. 73 + * 74 + * Another common firmware bug results in all packets being addressed 75 + * to 00:a0:c6:00:00:00 despite the host address being different. 76 + * This function will also fixup such packets. 77 + */ 78 + static int qmi_wwan_rx_fixup(struct usbnet *dev, struct sk_buff *skb) 79 + { 80 + __be16 proto; 81 + 82 + /* usbnet rx_complete guarantees that skb->len is at least 83 + * hard_header_len, so we can inspect the dest address without 84 + * checking skb->len 85 + */ 86 + switch (skb->data[0] & 0xf0) { 87 + case 0x40: 88 + proto = htons(ETH_P_IP); 89 + break; 90 + case 0x60: 91 + proto = htons(ETH_P_IPV6); 92 + break; 93 + case 0x00: 94 + if (is_multicast_ether_addr(skb->data)) 95 + return 1; 96 + /* possibly bogus destination - rewrite just in case */ 97 + skb_reset_mac_header(skb); 98 + goto fix_dest; 99 + default: 100 + /* pass along other packets without modifications */ 101 + return 1; 102 + } 103 + if (skb_headroom(skb) < ETH_HLEN) 104 + return 0; 105 + skb_push(skb, ETH_HLEN); 106 + skb_reset_mac_header(skb); 107 + eth_hdr(skb)->h_proto = proto; 108 + memset(eth_hdr(skb)->h_source, 0, ETH_ALEN); 109 + fix_dest: 110 + memcpy(eth_hdr(skb)->h_dest, dev->net->dev_addr, ETH_ALEN); 111 + return 1; 112 + } 113 + 114 + /* very simplistic detection of IPv4 or IPv6 headers */ 115 + static bool possibly_iphdr(const char *data) 116 + { 117 + return (data[0] & 0xd0) == 0x40; 118 + } 119 + 120 + /* disallow addresses which may be confused with IP headers */ 121 + static int qmi_wwan_mac_addr(struct net_device *dev, void *p) 122 + { 123 + int ret; 124 + struct sockaddr *addr = p; 125 + 126 + ret = eth_prepare_mac_addr_change(dev, p); 127 + if (ret < 0) 128 + return ret; 129 + if (possibly_iphdr(addr->sa_data)) 130 + return -EADDRNOTAVAIL; 131 + eth_commit_mac_addr_change(dev, p); 132 + return 0; 133 + } 134 + 135 + static const struct net_device_ops qmi_wwan_netdev_ops = { 136 + .ndo_open = usbnet_open, 137 + .ndo_stop = usbnet_stop, 138 + .ndo_start_xmit = usbnet_start_xmit, 139 + .ndo_tx_timeout = usbnet_tx_timeout, 140 + .ndo_change_mtu = usbnet_change_mtu, 141 + .ndo_set_mac_address = qmi_wwan_mac_addr, 142 + .ndo_validate_addr = eth_validate_addr, 54 143 }; 55 144 56 145 /* using a counter to merge subdriver requests with our own into a combined state */ ··· 320 229 usb_driver_release_interface(driver, info->data); 321 230 } 322 231 232 + /* Never use the same address on both ends of the link, even 233 + * if the buggy firmware told us to. 234 + */ 235 + if (!compare_ether_addr(dev->net->dev_addr, default_modem_addr)) 236 + eth_hw_addr_random(dev->net); 237 + 238 + /* make MAC addr easily distinguishable from an IP header */ 239 + if (possibly_iphdr(dev->net->dev_addr)) { 240 + dev->net->dev_addr[0] |= 0x02; /* set local assignment bit */ 241 + dev->net->dev_addr[0] &= 0xbf; /* clear "IP" bit */ 242 + } 243 + dev->net->netdev_ops = &qmi_wwan_netdev_ops; 323 244 err: 324 245 return status; 325 246 } ··· 410 307 .bind = qmi_wwan_bind, 411 308 .unbind = qmi_wwan_unbind, 412 309 .manage_power = qmi_wwan_manage_power, 310 + .rx_fixup = qmi_wwan_rx_fixup, 413 311 }; 414 312 415 313 #define HUAWEI_VENDOR_ID 0x12D1
+1 -1
drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h
··· 519 519 {0x00008258, 0x00000000}, 520 520 {0x0000825c, 0x40000000}, 521 521 {0x00008260, 0x00080922}, 522 - {0x00008264, 0x9bc00010}, 522 + {0x00008264, 0x9d400010}, 523 523 {0x00008268, 0xffffffff}, 524 524 {0x0000826c, 0x0000ffff}, 525 525 {0x00008270, 0x00000000},
+2 -2
drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c
··· 143 143 u32 sz, i; 144 144 struct channel_detector *cd; 145 145 146 - cd = kmalloc(sizeof(*cd), GFP_KERNEL); 146 + cd = kmalloc(sizeof(*cd), GFP_ATOMIC); 147 147 if (cd == NULL) 148 148 goto fail; 149 149 150 150 INIT_LIST_HEAD(&cd->head); 151 151 cd->freq = freq; 152 152 sz = sizeof(cd->detectors) * dpd->num_radar_types; 153 - cd->detectors = kzalloc(sz, GFP_KERNEL); 153 + cd->detectors = kzalloc(sz, GFP_ATOMIC); 154 154 if (cd->detectors == NULL) 155 155 goto fail; 156 156
+2 -2
drivers/net/wireless/ath/ath9k/dfs_pri_detector.c
··· 218 218 { 219 219 struct pulse_elem *p = pool_get_pulse_elem(); 220 220 if (p == NULL) { 221 - p = kmalloc(sizeof(*p), GFP_KERNEL); 221 + p = kmalloc(sizeof(*p), GFP_ATOMIC); 222 222 if (p == NULL) { 223 223 DFS_POOL_STAT_INC(pulse_alloc_error); 224 224 return false; ··· 299 299 ps.deadline_ts = ps.first_ts + ps.dur; 300 300 new_ps = pool_get_pseq_elem(); 301 301 if (new_ps == NULL) { 302 - new_ps = kmalloc(sizeof(*new_ps), GFP_KERNEL); 302 + new_ps = kmalloc(sizeof(*new_ps), GFP_ATOMIC); 303 303 if (new_ps == NULL) { 304 304 DFS_POOL_STAT_INC(pseq_alloc_error); 305 305 return false;
+1 -1
drivers/net/wireless/ath/ath9k/htc_drv_init.c
··· 796 796 * required version. 797 797 */ 798 798 if (priv->fw_version_major != MAJOR_VERSION_REQ || 799 - priv->fw_version_minor != MINOR_VERSION_REQ) { 799 + priv->fw_version_minor < MINOR_VERSION_REQ) { 800 800 dev_err(priv->dev, "ath9k_htc: Please upgrade to FW version %d.%d\n", 801 801 MAJOR_VERSION_REQ, MINOR_VERSION_REQ); 802 802 return -EINVAL;
+2 -1
drivers/net/wireless/b43/phy_n.c
··· 5165 5165 #endif 5166 5166 #ifdef CONFIG_B43_SSB 5167 5167 case B43_BUS_SSB: 5168 - /* FIXME */ 5168 + ssb_pmu_spuravoid_pllupdate(&dev->dev->sdev->bus->chipco, 5169 + avoid); 5169 5170 break; 5170 5171 #endif 5171 5172 }
+1 -6
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
··· 4128 4128 }, 4129 4129 { 4130 4130 .max = 1, 4131 - .types = BIT(NL80211_IFTYPE_P2P_DEVICE) 4132 - }, 4133 - { 4134 - .max = 1, 4135 4131 .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | 4136 4132 BIT(NL80211_IFTYPE_P2P_GO) 4137 4133 }, ··· 4183 4187 BIT(NL80211_IFTYPE_ADHOC) | 4184 4188 BIT(NL80211_IFTYPE_AP) | 4185 4189 BIT(NL80211_IFTYPE_P2P_CLIENT) | 4186 - BIT(NL80211_IFTYPE_P2P_GO) | 4187 - BIT(NL80211_IFTYPE_P2P_DEVICE); 4190 + BIT(NL80211_IFTYPE_P2P_GO); 4188 4191 wiphy->iface_combinations = brcmf_iface_combos; 4189 4192 wiphy->n_iface_combinations = ARRAY_SIZE(brcmf_iface_combos); 4190 4193 wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz;
+132 -132
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
··· 274 274 } 275 275 } 276 276 277 + /** 278 + * This function frees the WL per-device resources. 279 + * 280 + * This function frees resources owned by the WL device pointed to 281 + * by the wl parameter. 282 + * 283 + * precondition: can both be called locked and unlocked 284 + * 285 + */ 286 + static void brcms_free(struct brcms_info *wl) 287 + { 288 + struct brcms_timer *t, *next; 289 + 290 + /* free ucode data */ 291 + if (wl->fw.fw_cnt) 292 + brcms_ucode_data_free(&wl->ucode); 293 + if (wl->irq) 294 + free_irq(wl->irq, wl); 295 + 296 + /* kill dpc */ 297 + tasklet_kill(&wl->tasklet); 298 + 299 + if (wl->pub) { 300 + brcms_debugfs_detach(wl->pub); 301 + brcms_c_module_unregister(wl->pub, "linux", wl); 302 + } 303 + 304 + /* free common resources */ 305 + if (wl->wlc) { 306 + brcms_c_detach(wl->wlc); 307 + wl->wlc = NULL; 308 + wl->pub = NULL; 309 + } 310 + 311 + /* virtual interface deletion is deferred so we cannot spinwait */ 312 + 313 + /* wait for all pending callbacks to complete */ 314 + while (atomic_read(&wl->callbacks) > 0) 315 + schedule(); 316 + 317 + /* free timers */ 318 + for (t = wl->timers; t; t = next) { 319 + next = t->next; 320 + #ifdef DEBUG 321 + kfree(t->name); 322 + #endif 323 + kfree(t); 324 + } 325 + } 326 + 327 + /* 328 + * called from both kernel as from this kernel module (error flow on attach) 329 + * precondition: perimeter lock is not acquired. 330 + */ 331 + static void brcms_remove(struct bcma_device *pdev) 332 + { 333 + struct ieee80211_hw *hw = bcma_get_drvdata(pdev); 334 + struct brcms_info *wl = hw->priv; 335 + 336 + if (wl->wlc) { 337 + wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, false); 338 + wiphy_rfkill_stop_polling(wl->pub->ieee_hw->wiphy); 339 + ieee80211_unregister_hw(hw); 340 + } 341 + 342 + brcms_free(wl); 343 + 344 + bcma_set_drvdata(pdev, NULL); 345 + ieee80211_free_hw(hw); 346 + } 347 + 348 + /* 349 + * Precondition: Since this function is called in brcms_pci_probe() context, 350 + * no locking is required. 351 + */ 352 + static void brcms_release_fw(struct brcms_info *wl) 353 + { 354 + int i; 355 + for (i = 0; i < MAX_FW_IMAGES; i++) { 356 + release_firmware(wl->fw.fw_bin[i]); 357 + release_firmware(wl->fw.fw_hdr[i]); 358 + } 359 + } 360 + 361 + /* 362 + * Precondition: Since this function is called in brcms_pci_probe() context, 363 + * no locking is required. 364 + */ 365 + static int brcms_request_fw(struct brcms_info *wl, struct bcma_device *pdev) 366 + { 367 + int status; 368 + struct device *device = &pdev->dev; 369 + char fw_name[100]; 370 + int i; 371 + 372 + memset(&wl->fw, 0, sizeof(struct brcms_firmware)); 373 + for (i = 0; i < MAX_FW_IMAGES; i++) { 374 + if (brcms_firmwares[i] == NULL) 375 + break; 376 + sprintf(fw_name, "%s-%d.fw", brcms_firmwares[i], 377 + UCODE_LOADER_API_VER); 378 + status = request_firmware(&wl->fw.fw_bin[i], fw_name, device); 379 + if (status) { 380 + wiphy_err(wl->wiphy, "%s: fail to load firmware %s\n", 381 + KBUILD_MODNAME, fw_name); 382 + return status; 383 + } 384 + sprintf(fw_name, "%s_hdr-%d.fw", brcms_firmwares[i], 385 + UCODE_LOADER_API_VER); 386 + status = request_firmware(&wl->fw.fw_hdr[i], fw_name, device); 387 + if (status) { 388 + wiphy_err(wl->wiphy, "%s: fail to load firmware %s\n", 389 + KBUILD_MODNAME, fw_name); 390 + return status; 391 + } 392 + wl->fw.hdr_num_entries[i] = 393 + wl->fw.fw_hdr[i]->size / (sizeof(struct firmware_hdr)); 394 + } 395 + wl->fw.fw_cnt = i; 396 + status = brcms_ucode_data_init(wl, &wl->ucode); 397 + brcms_release_fw(wl); 398 + return status; 399 + } 400 + 277 401 static void brcms_ops_tx(struct ieee80211_hw *hw, 278 402 struct ieee80211_tx_control *control, 279 403 struct sk_buff *skb) ··· 429 305 spin_unlock_bh(&wl->lock); 430 306 if (!blocked) 431 307 wiphy_rfkill_stop_polling(wl->pub->ieee_hw->wiphy); 308 + 309 + if (!wl->ucode.bcm43xx_bomminor) { 310 + err = brcms_request_fw(wl, wl->wlc->hw->d11core); 311 + if (err) { 312 + brcms_remove(wl->wlc->hw->d11core); 313 + return -ENOENT; 314 + } 315 + } 432 316 433 317 spin_lock_bh(&wl->lock); 434 318 /* avoid acknowledging frames before a non-monitor device is added */ ··· 925 793 wake_up(&wl->tx_flush_wq); 926 794 } 927 795 928 - /* 929 - * Precondition: Since this function is called in brcms_pci_probe() context, 930 - * no locking is required. 931 - */ 932 - static int brcms_request_fw(struct brcms_info *wl, struct bcma_device *pdev) 933 - { 934 - int status; 935 - struct device *device = &pdev->dev; 936 - char fw_name[100]; 937 - int i; 938 - 939 - memset(&wl->fw, 0, sizeof(struct brcms_firmware)); 940 - for (i = 0; i < MAX_FW_IMAGES; i++) { 941 - if (brcms_firmwares[i] == NULL) 942 - break; 943 - sprintf(fw_name, "%s-%d.fw", brcms_firmwares[i], 944 - UCODE_LOADER_API_VER); 945 - status = request_firmware(&wl->fw.fw_bin[i], fw_name, device); 946 - if (status) { 947 - wiphy_err(wl->wiphy, "%s: fail to load firmware %s\n", 948 - KBUILD_MODNAME, fw_name); 949 - return status; 950 - } 951 - sprintf(fw_name, "%s_hdr-%d.fw", brcms_firmwares[i], 952 - UCODE_LOADER_API_VER); 953 - status = request_firmware(&wl->fw.fw_hdr[i], fw_name, device); 954 - if (status) { 955 - wiphy_err(wl->wiphy, "%s: fail to load firmware %s\n", 956 - KBUILD_MODNAME, fw_name); 957 - return status; 958 - } 959 - wl->fw.hdr_num_entries[i] = 960 - wl->fw.fw_hdr[i]->size / (sizeof(struct firmware_hdr)); 961 - } 962 - wl->fw.fw_cnt = i; 963 - return brcms_ucode_data_init(wl, &wl->ucode); 964 - } 965 - 966 - /* 967 - * Precondition: Since this function is called in brcms_pci_probe() context, 968 - * no locking is required. 969 - */ 970 - static void brcms_release_fw(struct brcms_info *wl) 971 - { 972 - int i; 973 - for (i = 0; i < MAX_FW_IMAGES; i++) { 974 - release_firmware(wl->fw.fw_bin[i]); 975 - release_firmware(wl->fw.fw_hdr[i]); 976 - } 977 - } 978 - 979 - /** 980 - * This function frees the WL per-device resources. 981 - * 982 - * This function frees resources owned by the WL device pointed to 983 - * by the wl parameter. 984 - * 985 - * precondition: can both be called locked and unlocked 986 - * 987 - */ 988 - static void brcms_free(struct brcms_info *wl) 989 - { 990 - struct brcms_timer *t, *next; 991 - 992 - /* free ucode data */ 993 - if (wl->fw.fw_cnt) 994 - brcms_ucode_data_free(&wl->ucode); 995 - if (wl->irq) 996 - free_irq(wl->irq, wl); 997 - 998 - /* kill dpc */ 999 - tasklet_kill(&wl->tasklet); 1000 - 1001 - if (wl->pub) { 1002 - brcms_debugfs_detach(wl->pub); 1003 - brcms_c_module_unregister(wl->pub, "linux", wl); 1004 - } 1005 - 1006 - /* free common resources */ 1007 - if (wl->wlc) { 1008 - brcms_c_detach(wl->wlc); 1009 - wl->wlc = NULL; 1010 - wl->pub = NULL; 1011 - } 1012 - 1013 - /* virtual interface deletion is deferred so we cannot spinwait */ 1014 - 1015 - /* wait for all pending callbacks to complete */ 1016 - while (atomic_read(&wl->callbacks) > 0) 1017 - schedule(); 1018 - 1019 - /* free timers */ 1020 - for (t = wl->timers; t; t = next) { 1021 - next = t->next; 1022 - #ifdef DEBUG 1023 - kfree(t->name); 1024 - #endif 1025 - kfree(t); 1026 - } 1027 - } 1028 - 1029 - /* 1030 - * called from both kernel as from this kernel module (error flow on attach) 1031 - * precondition: perimeter lock is not acquired. 1032 - */ 1033 - static void brcms_remove(struct bcma_device *pdev) 1034 - { 1035 - struct ieee80211_hw *hw = bcma_get_drvdata(pdev); 1036 - struct brcms_info *wl = hw->priv; 1037 - 1038 - if (wl->wlc) { 1039 - wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, false); 1040 - wiphy_rfkill_stop_polling(wl->pub->ieee_hw->wiphy); 1041 - ieee80211_unregister_hw(hw); 1042 - } 1043 - 1044 - brcms_free(wl); 1045 - 1046 - bcma_set_drvdata(pdev, NULL); 1047 - ieee80211_free_hw(hw); 1048 - } 1049 - 1050 796 static irqreturn_t brcms_isr(int irq, void *dev_id) 1051 797 { 1052 798 struct brcms_info *wl; ··· 1057 1047 spin_lock_init(&wl->lock); 1058 1048 spin_lock_init(&wl->isr_lock); 1059 1049 1060 - /* prepare ucode */ 1061 - if (brcms_request_fw(wl, pdev) < 0) { 1062 - wiphy_err(wl->wiphy, "%s: Failed to find firmware usually in " 1063 - "%s\n", KBUILD_MODNAME, "/lib/firmware/brcm"); 1064 - brcms_release_fw(wl); 1065 - brcms_remove(pdev); 1066 - return NULL; 1067 - } 1068 - 1069 1050 /* common load-time initialization */ 1070 1051 wl->wlc = brcms_c_attach((void *)wl, pdev, unit, false, &err); 1071 - brcms_release_fw(wl); 1072 1052 if (!wl->wlc) { 1073 1053 wiphy_err(wl->wiphy, "%s: attach() failed with code %d\n", 1074 1054 KBUILD_MODNAME, err);
+29
drivers/ssb/driver_chipcommon_pmu.c
··· 675 675 return 0; 676 676 } 677 677 } 678 + 679 + void ssb_pmu_spuravoid_pllupdate(struct ssb_chipcommon *cc, int spuravoid) 680 + { 681 + u32 pmu_ctl = 0; 682 + 683 + switch (cc->dev->bus->chip_id) { 684 + case 0x4322: 685 + ssb_chipco_pll_write(cc, SSB_PMU1_PLLCTL0, 0x11100070); 686 + ssb_chipco_pll_write(cc, SSB_PMU1_PLLCTL1, 0x1014140a); 687 + ssb_chipco_pll_write(cc, SSB_PMU1_PLLCTL5, 0x88888854); 688 + if (spuravoid == 1) 689 + ssb_chipco_pll_write(cc, SSB_PMU1_PLLCTL2, 0x05201828); 690 + else 691 + ssb_chipco_pll_write(cc, SSB_PMU1_PLLCTL2, 0x05001828); 692 + pmu_ctl = SSB_CHIPCO_PMU_CTL_PLL_UPD; 693 + break; 694 + case 43222: 695 + /* TODO: BCM43222 requires updating PLLs too */ 696 + return; 697 + default: 698 + ssb_printk(KERN_ERR PFX 699 + "Unknown spuravoidance settings for chip 0x%04X, not changing PLL\n", 700 + cc->dev->bus->chip_id); 701 + return; 702 + } 703 + 704 + chipco_set32(cc, SSB_CHIPCO_PMU_CTL, pmu_ctl); 705 + } 706 + EXPORT_SYMBOL_GPL(ssb_pmu_spuravoid_pllupdate);
+2
include/linux/ssb/ssb_driver_chipcommon.h
··· 219 219 #define SSB_CHIPCO_PMU_CTL 0x0600 /* PMU control */ 220 220 #define SSB_CHIPCO_PMU_CTL_ILP_DIV 0xFFFF0000 /* ILP div mask */ 221 221 #define SSB_CHIPCO_PMU_CTL_ILP_DIV_SHIFT 16 222 + #define SSB_CHIPCO_PMU_CTL_PLL_UPD 0x00000400 222 223 #define SSB_CHIPCO_PMU_CTL_NOILPONW 0x00000200 /* No ILP on wait */ 223 224 #define SSB_CHIPCO_PMU_CTL_HTREQEN 0x00000100 /* HT req enable */ 224 225 #define SSB_CHIPCO_PMU_CTL_ALPREQEN 0x00000080 /* ALP req enable */ ··· 668 667 void ssb_pmu_set_ldo_voltage(struct ssb_chipcommon *cc, 669 668 enum ssb_pmu_ldo_volt_id id, u32 voltage); 670 669 void ssb_pmu_set_ldo_paref(struct ssb_chipcommon *cc, bool on); 670 + void ssb_pmu_spuravoid_pllupdate(struct ssb_chipcommon *cc, int spuravoid); 671 671 672 672 #endif /* LINUX_SSB_CHIPCO_H_ */
+2 -1
include/net/irda/irlmp.h
··· 256 256 return (self && self->lap) ? self->lap->daddr : 0; 257 257 } 258 258 259 - extern const char *irlmp_reasons[]; 259 + const char *irlmp_reason_str(LM_REASON reason); 260 + 260 261 extern int sysctl_discovery_timeout; 261 262 extern int sysctl_discovery_slots; 262 263 extern int sysctl_discovery;
+2 -2
include/net/scm.h
··· 56 56 scm->pid = get_pid(pid); 57 57 scm->cred = cred ? get_cred(cred) : NULL; 58 58 scm->creds.pid = pid_vnr(pid); 59 - scm->creds.uid = cred ? cred->euid : INVALID_UID; 60 - scm->creds.gid = cred ? cred->egid : INVALID_GID; 59 + scm->creds.uid = cred ? cred->uid : INVALID_UID; 60 + scm->creds.gid = cred ? cred->gid : INVALID_GID; 61 61 } 62 62 63 63 static __inline__ void scm_destroy_cred(struct scm_cookie *scm)
+4 -1
net/batman-adv/main.c
··· 169 169 atomic_set(&bat_priv->mesh_state, BATADV_MESH_INACTIVE); 170 170 } 171 171 172 - int batadv_is_my_mac(const uint8_t *addr) 172 + int batadv_is_my_mac(struct batadv_priv *bat_priv, const uint8_t *addr) 173 173 { 174 174 const struct batadv_hard_iface *hard_iface; 175 175 176 176 rcu_read_lock(); 177 177 list_for_each_entry_rcu(hard_iface, &batadv_hardif_list, list) { 178 178 if (hard_iface->if_status != BATADV_IF_ACTIVE) 179 + continue; 180 + 181 + if (hard_iface->soft_iface != bat_priv->soft_iface) 179 182 continue; 180 183 181 184 if (batadv_compare_eth(hard_iface->net_dev->dev_addr, addr)) {
+1 -1
net/batman-adv/main.h
··· 162 162 163 163 int batadv_mesh_init(struct net_device *soft_iface); 164 164 void batadv_mesh_free(struct net_device *soft_iface); 165 - int batadv_is_my_mac(const uint8_t *addr); 165 + int batadv_is_my_mac(struct batadv_priv *bat_priv, const uint8_t *addr); 166 166 struct batadv_hard_iface * 167 167 batadv_seq_print_text_primary_if_get(struct seq_file *seq); 168 168 int batadv_batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
+20 -18
net/batman-adv/routing.c
··· 402 402 goto out; 403 403 404 404 /* not for me */ 405 - if (!batadv_is_my_mac(ethhdr->h_dest)) 405 + if (!batadv_is_my_mac(bat_priv, ethhdr->h_dest)) 406 406 goto out; 407 407 408 408 icmp_packet = (struct batadv_icmp_packet_rr *)skb->data; ··· 416 416 } 417 417 418 418 /* packet for me */ 419 - if (batadv_is_my_mac(icmp_packet->dst)) 419 + if (batadv_is_my_mac(bat_priv, icmp_packet->dst)) 420 420 return batadv_recv_my_icmp_packet(bat_priv, skb, hdr_size); 421 421 422 422 /* TTL exceeded */ ··· 548 548 return router; 549 549 } 550 550 551 - static int batadv_check_unicast_packet(struct sk_buff *skb, int hdr_size) 551 + static int batadv_check_unicast_packet(struct batadv_priv *bat_priv, 552 + struct sk_buff *skb, int hdr_size) 552 553 { 553 554 struct ethhdr *ethhdr; 554 555 ··· 568 567 return -1; 569 568 570 569 /* not for me */ 571 - if (!batadv_is_my_mac(ethhdr->h_dest)) 570 + if (!batadv_is_my_mac(bat_priv, ethhdr->h_dest)) 572 571 return -1; 573 572 574 573 return 0; ··· 583 582 char tt_flag; 584 583 size_t packet_size; 585 584 586 - if (batadv_check_unicast_packet(skb, hdr_size) < 0) 585 + if (batadv_check_unicast_packet(bat_priv, skb, hdr_size) < 0) 587 586 return NET_RX_DROP; 588 587 589 588 /* I could need to modify it */ ··· 615 614 case BATADV_TT_RESPONSE: 616 615 batadv_inc_counter(bat_priv, BATADV_CNT_TT_RESPONSE_RX); 617 616 618 - if (batadv_is_my_mac(tt_query->dst)) { 617 + if (batadv_is_my_mac(bat_priv, tt_query->dst)) { 619 618 /* packet needs to be linearized to access the TT 620 619 * changes 621 620 */ ··· 658 657 struct batadv_roam_adv_packet *roam_adv_packet; 659 658 struct batadv_orig_node *orig_node; 660 659 661 - if (batadv_check_unicast_packet(skb, sizeof(*roam_adv_packet)) < 0) 660 + if (batadv_check_unicast_packet(bat_priv, skb, 661 + sizeof(*roam_adv_packet)) < 0) 662 662 goto out; 663 663 664 664 batadv_inc_counter(bat_priv, BATADV_CNT_TT_ROAM_ADV_RX); 665 665 666 666 roam_adv_packet = (struct batadv_roam_adv_packet *)skb->data; 667 667 668 - if (!batadv_is_my_mac(roam_adv_packet->dst)) 668 + if (!batadv_is_my_mac(bat_priv, roam_adv_packet->dst)) 669 669 return batadv_route_unicast_packet(skb, recv_if); 670 670 671 671 /* check if it is a backbone gateway. we don't accept ··· 969 967 * last time) the packet had an updated information or not 970 968 */ 971 969 curr_ttvn = (uint8_t)atomic_read(&bat_priv->tt.vn); 972 - if (!batadv_is_my_mac(unicast_packet->dest)) { 970 + if (!batadv_is_my_mac(bat_priv, unicast_packet->dest)) { 973 971 orig_node = batadv_orig_hash_find(bat_priv, 974 972 unicast_packet->dest); 975 973 /* if it is not possible to find the orig_node representing the ··· 1046 1044 if (is4addr) 1047 1045 hdr_size = sizeof(*unicast_4addr_packet); 1048 1046 1049 - if (batadv_check_unicast_packet(skb, hdr_size) < 0) 1047 + if (batadv_check_unicast_packet(bat_priv, skb, hdr_size) < 0) 1050 1048 return NET_RX_DROP; 1051 1049 1052 1050 if (!batadv_check_unicast_ttvn(bat_priv, skb)) 1053 1051 return NET_RX_DROP; 1054 1052 1055 1053 /* packet for me */ 1056 - if (batadv_is_my_mac(unicast_packet->dest)) { 1054 + if (batadv_is_my_mac(bat_priv, unicast_packet->dest)) { 1057 1055 if (is4addr) { 1058 1056 batadv_dat_inc_counter(bat_priv, 1059 1057 unicast_4addr_packet->subtype); ··· 1090 1088 struct sk_buff *new_skb = NULL; 1091 1089 int ret; 1092 1090 1093 - if (batadv_check_unicast_packet(skb, hdr_size) < 0) 1091 + if (batadv_check_unicast_packet(bat_priv, skb, hdr_size) < 0) 1094 1092 return NET_RX_DROP; 1095 1093 1096 1094 if (!batadv_check_unicast_ttvn(bat_priv, skb)) ··· 1099 1097 unicast_packet = (struct batadv_unicast_frag_packet *)skb->data; 1100 1098 1101 1099 /* packet for me */ 1102 - if (batadv_is_my_mac(unicast_packet->dest)) { 1100 + if (batadv_is_my_mac(bat_priv, unicast_packet->dest)) { 1103 1101 ret = batadv_frag_reassemble_skb(skb, bat_priv, &new_skb); 1104 1102 1105 1103 if (ret == NET_RX_DROP) ··· 1153 1151 goto out; 1154 1152 1155 1153 /* ignore broadcasts sent by myself */ 1156 - if (batadv_is_my_mac(ethhdr->h_source)) 1154 + if (batadv_is_my_mac(bat_priv, ethhdr->h_source)) 1157 1155 goto out; 1158 1156 1159 1157 bcast_packet = (struct batadv_bcast_packet *)skb->data; 1160 1158 1161 1159 /* ignore broadcasts originated by myself */ 1162 - if (batadv_is_my_mac(bcast_packet->orig)) 1160 + if (batadv_is_my_mac(bat_priv, bcast_packet->orig)) 1163 1161 goto out; 1164 1162 1165 1163 if (bcast_packet->header.ttl < 2) ··· 1245 1243 ethhdr = (struct ethhdr *)skb_mac_header(skb); 1246 1244 1247 1245 /* not for me */ 1248 - if (!batadv_is_my_mac(ethhdr->h_dest)) 1246 + if (!batadv_is_my_mac(bat_priv, ethhdr->h_dest)) 1249 1247 return NET_RX_DROP; 1250 1248 1251 1249 /* ignore own packets */ 1252 - if (batadv_is_my_mac(vis_packet->vis_orig)) 1250 + if (batadv_is_my_mac(bat_priv, vis_packet->vis_orig)) 1253 1251 return NET_RX_DROP; 1254 1252 1255 - if (batadv_is_my_mac(vis_packet->sender_orig)) 1253 + if (batadv_is_my_mac(bat_priv, vis_packet->sender_orig)) 1256 1254 return NET_RX_DROP; 1257 1255 1258 1256 switch (vis_packet->vis_type) {
+1 -1
net/batman-adv/translation-table.c
··· 1953 1953 bool batadv_send_tt_response(struct batadv_priv *bat_priv, 1954 1954 struct batadv_tt_query_packet *tt_request) 1955 1955 { 1956 - if (batadv_is_my_mac(tt_request->dst)) { 1956 + if (batadv_is_my_mac(bat_priv, tt_request->dst)) { 1957 1957 /* don't answer backbone gws! */ 1958 1958 if (batadv_bla_is_backbone_gw_orig(bat_priv, tt_request->src)) 1959 1959 return true;
+2 -2
net/batman-adv/vis.c
··· 477 477 478 478 /* Are we the target for this VIS packet? */ 479 479 if (vis_server == BATADV_VIS_TYPE_SERVER_SYNC && 480 - batadv_is_my_mac(vis_packet->target_orig)) 480 + batadv_is_my_mac(bat_priv, vis_packet->target_orig)) 481 481 are_target = 1; 482 482 483 483 spin_lock_bh(&bat_priv->vis.hash_lock); ··· 496 496 batadv_send_list_add(bat_priv, info); 497 497 498 498 /* ... we're not the recipient (and thus need to forward). */ 499 - } else if (!batadv_is_my_mac(packet->target_orig)) { 499 + } else if (!batadv_is_my_mac(bat_priv, packet->target_orig)) { 500 500 batadv_send_list_add(bat_priv, info); 501 501 } 502 502
+3
net/core/dev.c
··· 2148 2148 struct net_device *dev = skb->dev; 2149 2149 const char *driver = ""; 2150 2150 2151 + if (!net_ratelimit()) 2152 + return; 2153 + 2151 2154 if (dev && dev->dev.parent) 2152 2155 driver = dev_driver_string(dev->dev.parent); 2153 2156
+7 -1
net/ipv4/netfilter/ipt_rpfilter.c
··· 66 66 return dev_match; 67 67 } 68 68 69 + static bool rpfilter_is_local(const struct sk_buff *skb) 70 + { 71 + const struct rtable *rt = skb_rtable(skb); 72 + return rt && (rt->rt_flags & RTCF_LOCAL); 73 + } 74 + 69 75 static bool rpfilter_mt(const struct sk_buff *skb, struct xt_action_param *par) 70 76 { 71 77 const struct xt_rpfilter_info *info; ··· 82 76 info = par->matchinfo; 83 77 invert = info->flags & XT_RPFILTER_INVERT; 84 78 85 - if (par->in->flags & IFF_LOOPBACK) 79 + if (rpfilter_is_local(skb)) 86 80 return true ^ invert; 87 81 88 82 iph = ip_hdr(skb);
+31 -33
net/ipv4/tcp_input.c
··· 113 113 #define FLAG_DSACKING_ACK 0x800 /* SACK blocks contained D-SACK info */ 114 114 #define FLAG_NONHEAD_RETRANS_ACKED 0x1000 /* Non-head rexmitted data was ACKed */ 115 115 #define FLAG_SACK_RENEGING 0x2000 /* snd_una advanced to a sacked seq */ 116 + #define FLAG_UPDATE_TS_RECENT 0x4000 /* tcp_replace_ts_recent() */ 116 117 117 118 #define FLAG_ACKED (FLAG_DATA_ACKED|FLAG_SYN_ACKED) 118 119 #define FLAG_NOT_DUP (FLAG_DATA|FLAG_WIN_UPDATE|FLAG_ACKED) ··· 3565 3564 } 3566 3565 } 3567 3566 3567 + static void tcp_store_ts_recent(struct tcp_sock *tp) 3568 + { 3569 + tp->rx_opt.ts_recent = tp->rx_opt.rcv_tsval; 3570 + tp->rx_opt.ts_recent_stamp = get_seconds(); 3571 + } 3572 + 3573 + static void tcp_replace_ts_recent(struct tcp_sock *tp, u32 seq) 3574 + { 3575 + if (tp->rx_opt.saw_tstamp && !after(seq, tp->rcv_wup)) { 3576 + /* PAWS bug workaround wrt. ACK frames, the PAWS discard 3577 + * extra check below makes sure this can only happen 3578 + * for pure ACK frames. -DaveM 3579 + * 3580 + * Not only, also it occurs for expired timestamps. 3581 + */ 3582 + 3583 + if (tcp_paws_check(&tp->rx_opt, 0)) 3584 + tcp_store_ts_recent(tp); 3585 + } 3586 + } 3587 + 3568 3588 /* This routine deals with incoming acks, but not outgoing ones. */ 3569 3589 static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) 3570 3590 { ··· 3628 3606 3629 3607 prior_fackets = tp->fackets_out; 3630 3608 prior_in_flight = tcp_packets_in_flight(tp); 3609 + 3610 + /* ts_recent update must be made after we are sure that the packet 3611 + * is in window. 3612 + */ 3613 + if (flag & FLAG_UPDATE_TS_RECENT) 3614 + tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq); 3631 3615 3632 3616 if (!(flag & FLAG_SLOWPATH) && after(ack, prior_snd_una)) { 3633 3617 /* Window is constant, pure forward advance. ··· 3954 3926 } 3955 3927 EXPORT_SYMBOL(tcp_parse_md5sig_option); 3956 3928 #endif 3957 - 3958 - static inline void tcp_store_ts_recent(struct tcp_sock *tp) 3959 - { 3960 - tp->rx_opt.ts_recent = tp->rx_opt.rcv_tsval; 3961 - tp->rx_opt.ts_recent_stamp = get_seconds(); 3962 - } 3963 - 3964 - static inline void tcp_replace_ts_recent(struct tcp_sock *tp, u32 seq) 3965 - { 3966 - if (tp->rx_opt.saw_tstamp && !after(seq, tp->rcv_wup)) { 3967 - /* PAWS bug workaround wrt. ACK frames, the PAWS discard 3968 - * extra check below makes sure this can only happen 3969 - * for pure ACK frames. -DaveM 3970 - * 3971 - * Not only, also it occurs for expired timestamps. 3972 - */ 3973 - 3974 - if (tcp_paws_check(&tp->rx_opt, 0)) 3975 - tcp_store_ts_recent(tp); 3976 - } 3977 - } 3978 3929 3979 3930 /* Sorry, PAWS as specified is broken wrt. pure-ACKs -DaveM 3980 3931 * ··· 5550 5543 return 0; 5551 5544 5552 5545 step5: 5553 - if (tcp_ack(sk, skb, FLAG_SLOWPATH) < 0) 5546 + if (tcp_ack(sk, skb, FLAG_SLOWPATH | FLAG_UPDATE_TS_RECENT) < 0) 5554 5547 goto discard; 5555 - 5556 - /* ts_recent update must be made after we are sure that the packet 5557 - * is in window. 5558 - */ 5559 - tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq); 5560 5548 5561 5549 tcp_rcv_rtt_measure_ts(sk, skb); 5562 5550 ··· 5988 5986 5989 5987 /* step 5: check the ACK field */ 5990 5988 if (true) { 5991 - int acceptable = tcp_ack(sk, skb, FLAG_SLOWPATH) > 0; 5989 + int acceptable = tcp_ack(sk, skb, FLAG_SLOWPATH | 5990 + FLAG_UPDATE_TS_RECENT) > 0; 5992 5991 5993 5992 switch (sk->sk_state) { 5994 5993 case TCP_SYN_RECV: ··· 6139 6136 break; 6140 6137 } 6141 6138 } 6142 - 6143 - /* ts_recent update must be made after we are sure that the packet 6144 - * is in window. 6145 - */ 6146 - tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq); 6147 6139 6148 6140 /* step 6: check the URG bit */ 6149 6141 tcp_urg(sk, skb, th);
+7 -1
net/ipv6/netfilter/ip6t_rpfilter.c
··· 71 71 return ret; 72 72 } 73 73 74 + static bool rpfilter_is_local(const struct sk_buff *skb) 75 + { 76 + const struct rt6_info *rt = (const void *) skb_dst(skb); 77 + return rt && (rt->rt6i_flags & RTF_LOCAL); 78 + } 79 + 74 80 static bool rpfilter_mt(const struct sk_buff *skb, struct xt_action_param *par) 75 81 { 76 82 const struct xt_rpfilter_info *info = par->matchinfo; ··· 84 78 struct ipv6hdr *iph; 85 79 bool invert = info->flags & XT_RPFILTER_INVERT; 86 80 87 - if (par->in->flags & IFF_LOOPBACK) 81 + if (rpfilter_is_local(skb)) 88 82 return true ^ invert; 89 83 90 84 iph = ipv6_hdr(skb);
+2 -1
net/irda/iriap.c
··· 303 303 { 304 304 struct iriap_cb *self; 305 305 306 - IRDA_DEBUG(4, "%s(), reason=%s\n", __func__, irlmp_reasons[reason]); 306 + IRDA_DEBUG(4, "%s(), reason=%s [%d]\n", __func__, 307 + irlmp_reason_str(reason), reason); 307 308 308 309 self = instance; 309 310
+9 -1
net/irda/irlmp.c
··· 66 66 "LM_LAP_RESET", 67 67 "LM_INIT_DISCONNECT", 68 68 "ERROR, NOT USED", 69 + "UNKNOWN", 69 70 }; 71 + 72 + const char *irlmp_reason_str(LM_REASON reason) 73 + { 74 + reason = min_t(size_t, reason, ARRAY_SIZE(irlmp_reasons) - 1); 75 + return irlmp_reasons[reason]; 76 + } 70 77 71 78 /* 72 79 * Function irlmp_init (void) ··· 754 747 { 755 748 struct lsap_cb *lsap; 756 749 757 - IRDA_DEBUG(1, "%s(), reason=%s\n", __func__, irlmp_reasons[reason]); 750 + IRDA_DEBUG(1, "%s(), reason=%s [%d]\n", __func__, 751 + irlmp_reason_str(reason), reason); 758 752 IRDA_ASSERT(self != NULL, return;); 759 753 IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC, return;); 760 754
+19 -8
net/mac80211/iface.c
··· 78 78 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_TXPOWER); 79 79 } 80 80 81 - u32 ieee80211_idle_off(struct ieee80211_local *local) 81 + static u32 __ieee80211_idle_off(struct ieee80211_local *local) 82 82 { 83 83 if (!(local->hw.conf.flags & IEEE80211_CONF_IDLE)) 84 84 return 0; ··· 87 87 return IEEE80211_CONF_CHANGE_IDLE; 88 88 } 89 89 90 - static u32 ieee80211_idle_on(struct ieee80211_local *local) 90 + static u32 __ieee80211_idle_on(struct ieee80211_local *local) 91 91 { 92 92 if (local->hw.conf.flags & IEEE80211_CONF_IDLE) 93 93 return 0; ··· 98 98 return IEEE80211_CONF_CHANGE_IDLE; 99 99 } 100 100 101 - void ieee80211_recalc_idle(struct ieee80211_local *local) 101 + static u32 __ieee80211_recalc_idle(struct ieee80211_local *local, 102 + bool force_active) 102 103 { 103 104 bool working = false, scanning, active; 104 105 unsigned int led_trig_start = 0, led_trig_stop = 0; 105 106 struct ieee80211_roc_work *roc; 106 - u32 change; 107 107 108 108 lockdep_assert_held(&local->mtx); 109 109 110 - active = !list_empty(&local->chanctx_list) || local->monitors; 110 + active = force_active || 111 + !list_empty(&local->chanctx_list) || 112 + local->monitors; 111 113 112 114 if (!local->ops->remain_on_channel) { 113 115 list_for_each_entry(roc, &local->roc_list, list) { ··· 134 132 ieee80211_mod_tpt_led_trig(local, led_trig_start, led_trig_stop); 135 133 136 134 if (working || scanning || active) 137 - change = ieee80211_idle_off(local); 138 - else 139 - change = ieee80211_idle_on(local); 135 + return __ieee80211_idle_off(local); 136 + return __ieee80211_idle_on(local); 137 + } 138 + 139 + u32 ieee80211_idle_off(struct ieee80211_local *local) 140 + { 141 + return __ieee80211_recalc_idle(local, true); 142 + } 143 + 144 + void ieee80211_recalc_idle(struct ieee80211_local *local) 145 + { 146 + u32 change = __ieee80211_recalc_idle(local, false); 140 147 if (change) 141 148 ieee80211_hw_config(local, change); 142 149 }
+20 -4
net/mac80211/mlme.c
··· 3964 3964 /* prep auth_data so we don't go into idle on disassoc */ 3965 3965 ifmgd->auth_data = auth_data; 3966 3966 3967 - if (ifmgd->associated) 3968 - ieee80211_set_disassoc(sdata, 0, 0, false, NULL); 3967 + if (ifmgd->associated) { 3968 + u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN]; 3969 + 3970 + ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, 3971 + WLAN_REASON_UNSPECIFIED, 3972 + false, frame_buf); 3973 + 3974 + __cfg80211_send_deauth(sdata->dev, frame_buf, 3975 + sizeof(frame_buf)); 3976 + } 3969 3977 3970 3978 sdata_info(sdata, "authenticate with %pM\n", req->bss->bssid); 3971 3979 ··· 4033 4025 4034 4026 mutex_lock(&ifmgd->mtx); 4035 4027 4036 - if (ifmgd->associated) 4037 - ieee80211_set_disassoc(sdata, 0, 0, false, NULL); 4028 + if (ifmgd->associated) { 4029 + u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN]; 4030 + 4031 + ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, 4032 + WLAN_REASON_UNSPECIFIED, 4033 + false, frame_buf); 4034 + 4035 + __cfg80211_send_deauth(sdata->dev, frame_buf, 4036 + sizeof(frame_buf)); 4037 + } 4038 4038 4039 4039 if (ifmgd->auth_data && !ifmgd->auth_data->done) { 4040 4040 err = -EBUSY;
+5 -1
net/netfilter/ipset/ip_set_bitmap_ipmac.c
··· 339 339 nla_put_failure: 340 340 nla_nest_cancel(skb, nested); 341 341 ipset_nest_end(skb, atd); 342 - return -EMSGSIZE; 342 + if (unlikely(id == first)) { 343 + cb->args[2] = 0; 344 + return -EMSGSIZE; 345 + } 346 + return 0; 343 347 } 344 348 345 349 static int
+18 -12
net/openvswitch/datapath.c
··· 1593 1593 return ERR_PTR(-ENOMEM); 1594 1594 1595 1595 retval = ovs_vport_cmd_fill_info(vport, skb, portid, seq, 0, cmd); 1596 - if (retval < 0) { 1597 - kfree_skb(skb); 1598 - return ERR_PTR(retval); 1599 - } 1596 + BUG_ON(retval < 0); 1597 + 1600 1598 return skb; 1601 1599 } 1602 1600 ··· 1724 1726 nla_get_u32(a[OVS_VPORT_ATTR_TYPE]) != vport->ops->type) 1725 1727 err = -EINVAL; 1726 1728 1729 + reply = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); 1730 + if (!reply) { 1731 + err = -ENOMEM; 1732 + goto exit_unlock; 1733 + } 1734 + 1727 1735 if (!err && a[OVS_VPORT_ATTR_OPTIONS]) 1728 1736 err = ovs_vport_set_options(vport, a[OVS_VPORT_ATTR_OPTIONS]); 1729 1737 if (err) 1730 - goto exit_unlock; 1738 + goto exit_free; 1739 + 1731 1740 if (a[OVS_VPORT_ATTR_UPCALL_PID]) 1732 1741 vport->upcall_portid = nla_get_u32(a[OVS_VPORT_ATTR_UPCALL_PID]); 1733 1742 1734 - reply = ovs_vport_cmd_build_info(vport, info->snd_portid, info->snd_seq, 1735 - OVS_VPORT_CMD_NEW); 1736 - if (IS_ERR(reply)) { 1737 - netlink_set_err(sock_net(skb->sk)->genl_sock, 0, 1738 - ovs_dp_vport_multicast_group.id, PTR_ERR(reply)); 1739 - goto exit_unlock; 1740 - } 1743 + err = ovs_vport_cmd_fill_info(vport, reply, info->snd_portid, 1744 + info->snd_seq, 0, OVS_VPORT_CMD_NEW); 1745 + BUG_ON(err < 0); 1741 1746 1742 1747 genl_notify(reply, genl_info_net(info), info->snd_portid, 1743 1748 ovs_dp_vport_multicast_group.id, info->nlhdr, GFP_KERNEL); 1744 1749 1750 + rtnl_unlock(); 1751 + return 0; 1752 + 1753 + exit_free: 1754 + kfree_skb(reply); 1745 1755 exit_unlock: 1746 1756 rtnl_unlock(); 1747 1757 return err;
+1 -1
net/openvswitch/flow.c
··· 795 795 796 796 void ovs_flow_tbl_remove(struct flow_table *table, struct sw_flow *flow) 797 797 { 798 + BUG_ON(table->count == 0); 798 799 hlist_del_rcu(&flow->hash_node[table->node_ver]); 799 800 table->count--; 800 - BUG_ON(table->count < 0); 801 801 } 802 802 803 803 /* The size of the argument for each %OVS_KEY_ATTR_* Netlink attribute. */
+1 -1
net/sched/cls_fw.c
··· 204 204 if (err < 0) 205 205 return err; 206 206 207 - err = -EINVAL; 208 207 if (tb[TCA_FW_CLASSID]) { 209 208 f->res.classid = nla_get_u32(tb[TCA_FW_CLASSID]); 210 209 tcf_bind_filter(tp, &f->res, base); ··· 217 218 } 218 219 #endif /* CONFIG_NET_CLS_IND */ 219 220 221 + err = -EINVAL; 220 222 if (tb[TCA_FW_MASK]) { 221 223 mask = nla_get_u32(tb[TCA_FW_MASK]); 222 224 if (mask != head->mask)