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:

1) Count ttl-dropped frames properly in mac80211, from Bob Copeland.

2) Integer overflow in ktime handling of bcm can code, from Oliver
Hartkopp.

3) Fix RX desc handling wrt. hw checksumming in ravb, from Simon
Horman.

4) Various hash key fixes in hv_netvsc, from Haiyang Zhang.

5) Use after free in ax25, from Eric Dumazet.

6) Several fixes to the SSN support in SCTP, from Xin Long.

7) Do not process frames after a NAPI reschedule in ibmveth, from
Thomas Falcon.

8) Fix NLA_POLICY_NESTED arguments, from Johannes Berg.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (42 commits)
qed: Revert error handling changes.
cfg80211: extend range deviation for DMG
cfg80211: reg: remove warn_on for a normal case
mac80211: Add attribute aligned(2) to struct 'action'
mac80211: don't initiate TDLS connection if station is not associated to AP
nl80211: fix NLA_POLICY_NESTED() arguments
ibmveth: Do not process frames after calling napi_reschedule
net: dev_is_mac_header_xmit() true for ARPHRD_RAWIP
net: usb: asix: ax88772_bind return error when hw_reset fail
MAINTAINERS: Update cavium networking drivers
net/mlx4_core: Fix error handling when initializing CQ bufs in the driver
net/mlx4_core: Add masking for a few queries on HCA caps
sctp: set flow sport from saddr only when it's 0
sctp: set chunk transport correctly when it's a new asoc
sctp: improve the events for sctp stream adding
sctp: improve the events for sctp stream reset
ip_tunnel: Make none-tunnel-dst tunnel port work with lwtunnel
ax25: fix possible use-after-free
sfc: suppress duplicate nvmem partition types in efx_ef10_mtd_probe
hv_netvsc: fix typos in code comments
...

+404 -287
+21 -21
MAINTAINERS
··· 3052 3052 F: include/linux/bcm963xx_tag.h 3053 3053 3054 3054 BROADCOM BNX2 GIGABIT ETHERNET DRIVER 3055 - M: Rasesh Mody <rasesh.mody@cavium.com> 3056 - M: Dept-GELinuxNICDev@cavium.com 3055 + M: Rasesh Mody <rmody@marvell.com> 3056 + M: GR-Linux-NIC-Dev@marvell.com 3057 3057 L: netdev@vger.kernel.org 3058 3058 S: Supported 3059 3059 F: drivers/net/ethernet/broadcom/bnx2.* ··· 3072 3072 F: drivers/scsi/bnx2i/ 3073 3073 3074 3074 BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER 3075 - M: Ariel Elior <ariel.elior@cavium.com> 3076 - M: Sudarsana Kalluru <sudarsana.kalluru@cavium.com> 3077 - M: everest-linux-l2@cavium.com 3075 + M: Ariel Elior <aelior@marvell.com> 3076 + M: Sudarsana Kalluru <skalluru@marvell.com> 3077 + M: GR-everest-linux-l2@marvell.com 3078 3078 L: netdev@vger.kernel.org 3079 3079 S: Supported 3080 3080 F: drivers/net/ethernet/broadcom/bnx2x/ ··· 3249 3249 F: drivers/scsi/bfa/ 3250 3250 3251 3251 BROCADE BNA 10 GIGABIT ETHERNET DRIVER 3252 - M: Rasesh Mody <rasesh.mody@cavium.com> 3253 - M: Sudarsana Kalluru <sudarsana.kalluru@cavium.com> 3254 - M: Dept-GELinuxNICDev@cavium.com 3252 + M: Rasesh Mody <rmody@marvell.com> 3253 + M: Sudarsana Kalluru <skalluru@marvell.com> 3254 + M: GR-Linux-NIC-Dev@marvell.com 3255 3255 L: netdev@vger.kernel.org 3256 3256 S: Supported 3257 3257 F: drivers/net/ethernet/brocade/bna/ ··· 10690 10690 F: drivers/net/netdevsim/* 10691 10691 10692 10692 NETXEN (1/10) GbE SUPPORT 10693 - M: Manish Chopra <manish.chopra@cavium.com> 10694 - M: Rahul Verma <rahul.verma@cavium.com> 10695 - M: Dept-GELinuxNICDev@cavium.com 10693 + M: Manish Chopra <manishc@marvell.com> 10694 + M: Rahul Verma <rahulv@marvell.com> 10695 + M: GR-Linux-NIC-Dev@marvell.com 10696 10696 L: netdev@vger.kernel.org 10697 10697 S: Supported 10698 10698 F: drivers/net/ethernet/qlogic/netxen/ ··· 12476 12476 F: drivers/scsi/qedi/ 12477 12477 12478 12478 QLOGIC QL4xxx ETHERNET DRIVER 12479 - M: Ariel Elior <Ariel.Elior@cavium.com> 12480 - M: everest-linux-l2@cavium.com 12479 + M: Ariel Elior <aelior@marvell.com> 12480 + M: GR-everest-linux-l2@marvell.com 12481 12481 L: netdev@vger.kernel.org 12482 12482 S: Supported 12483 12483 F: drivers/net/ethernet/qlogic/qed/ ··· 12485 12485 F: drivers/net/ethernet/qlogic/qede/ 12486 12486 12487 12487 QLOGIC QL4xxx RDMA DRIVER 12488 - M: Michal Kalderon <Michal.Kalderon@cavium.com> 12489 - M: Ariel Elior <Ariel.Elior@cavium.com> 12488 + M: Michal Kalderon <mkalderon@marvell.com> 12489 + M: Ariel Elior <aelior@marvell.com> 12490 12490 L: linux-rdma@vger.kernel.org 12491 12491 S: Supported 12492 12492 F: drivers/infiniband/hw/qedr/ ··· 12506 12506 F: drivers/scsi/qla2xxx/ 12507 12507 12508 12508 QLOGIC QLA3XXX NETWORK DRIVER 12509 - M: Dept-GELinuxNICDev@cavium.com 12509 + M: GR-Linux-NIC-Dev@marvell.com 12510 12510 L: netdev@vger.kernel.org 12511 12511 S: Supported 12512 12512 F: Documentation/networking/device_drivers/qlogic/LICENSE.qla3xxx ··· 12520 12520 F: drivers/scsi/qla4xxx/ 12521 12521 12522 12522 QLOGIC QLCNIC (1/10)Gb ETHERNET DRIVER 12523 - M: Shahed Shaikh <Shahed.Shaikh@cavium.com> 12524 - M: Manish Chopra <manish.chopra@cavium.com> 12525 - M: Dept-GELinuxNICDev@cavium.com 12523 + M: Shahed Shaikh <shshaikh@marvell.com> 12524 + M: Manish Chopra <manishc@marvell.com> 12525 + M: GR-Linux-NIC-Dev@marvell.com 12526 12526 L: netdev@vger.kernel.org 12527 12527 S: Supported 12528 12528 F: drivers/net/ethernet/qlogic/qlcnic/ 12529 12529 12530 12530 QLOGIC QLGE 10Gb ETHERNET DRIVER 12531 - M: Manish Chopra <manish.chopra@cavium.com> 12532 - M: Dept-GELinuxNICDev@cavium.com 12531 + M: Manish Chopra <manishc@marvell.com> 12532 + M: GR-Linux-NIC-Dev@marvell.com 12533 12533 L: netdev@vger.kernel.org 12534 12534 S: Supported 12535 12535 F: drivers/net/ethernet/qlogic/qlge/
+13 -14
drivers/net/can/dev.c
··· 480 480 struct sk_buff *__can_get_echo_skb(struct net_device *dev, unsigned int idx, u8 *len_ptr) 481 481 { 482 482 struct can_priv *priv = netdev_priv(dev); 483 - struct sk_buff *skb = priv->echo_skb[idx]; 484 - struct canfd_frame *cf; 485 483 486 484 if (idx >= priv->echo_skb_max) { 487 485 netdev_err(dev, "%s: BUG! Trying to access can_priv::echo_skb out of bounds (%u/max %u)\n", ··· 487 489 return NULL; 488 490 } 489 491 490 - if (!skb) { 491 - netdev_err(dev, "%s: BUG! Trying to echo non existing skb: can_priv::echo_skb[%u]\n", 492 - __func__, idx); 493 - return NULL; 492 + if (priv->echo_skb[idx]) { 493 + /* Using "struct canfd_frame::len" for the frame 494 + * length is supported on both CAN and CANFD frames. 495 + */ 496 + struct sk_buff *skb = priv->echo_skb[idx]; 497 + struct canfd_frame *cf = (struct canfd_frame *)skb->data; 498 + u8 len = cf->len; 499 + 500 + *len_ptr = len; 501 + priv->echo_skb[idx] = NULL; 502 + 503 + return skb; 494 504 } 495 505 496 - /* Using "struct canfd_frame::len" for the frame 497 - * length is supported on both CAN and CANFD frames. 498 - */ 499 - cf = (struct canfd_frame *)skb->data; 500 - *len_ptr = cf->len; 501 - priv->echo_skb[idx] = NULL; 502 - 503 - return skb; 506 + return NULL; 504 507 } 505 508 506 509 /*
+2 -2
drivers/net/can/flexcan.c
··· 1106 1106 } 1107 1107 } else { 1108 1108 /* clear and invalidate unused mailboxes first */ 1109 - for (i = FLEXCAN_TX_MB_RESERVED_OFF_FIFO; i <= priv->mb_count; i++) { 1109 + for (i = FLEXCAN_TX_MB_RESERVED_OFF_FIFO; i < priv->mb_count; i++) { 1110 1110 mb = flexcan_get_mb(priv, i); 1111 1111 priv->write(FLEXCAN_MB_CODE_RX_INACTIVE, 1112 1112 &mb->can_ctrl); ··· 1432 1432 gpr_np = of_find_node_by_phandle(phandle); 1433 1433 if (!gpr_np) { 1434 1434 dev_dbg(&pdev->dev, "could not find gpr node by phandle\n"); 1435 - return PTR_ERR(gpr_np); 1435 + return -ENODEV; 1436 1436 } 1437 1437 1438 1438 priv = netdev_priv(dev);
+3 -1
drivers/net/ethernet/altera/altera_tse_main.c
··· 714 714 715 715 phydev = phy_connect(dev, phy_id_fmt, &altera_tse_adjust_link, 716 716 priv->phy_iface); 717 - if (IS_ERR(phydev)) 717 + if (IS_ERR(phydev)) { 718 718 netdev_err(dev, "Could not attach to PHY\n"); 719 + phydev = NULL; 720 + } 719 721 720 722 } else { 721 723 int ret;
+3 -2
drivers/net/ethernet/freescale/dpaa2/Kconfig
··· 9 9 10 10 config FSL_DPAA2_PTP_CLOCK 11 11 tristate "Freescale DPAA2 PTP Clock" 12 - depends on FSL_DPAA2_ETH && POSIX_TIMERS 13 - select PTP_1588_CLOCK 12 + depends on FSL_DPAA2_ETH 13 + imply PTP_1588_CLOCK 14 + default y 14 15 help 15 16 This driver adds support for using the DPAA2 1588 timer module 16 17 as a PTP clock.
+1 -1
drivers/net/ethernet/freescale/fec_main.c
··· 3467 3467 if (ret) 3468 3468 goto failed_clk_ipg; 3469 3469 3470 - fep->reg_phy = devm_regulator_get(&pdev->dev, "phy"); 3470 + fep->reg_phy = devm_regulator_get_optional(&pdev->dev, "phy"); 3471 3471 if (!IS_ERR(fep->reg_phy)) { 3472 3472 ret = regulator_enable(fep->reg_phy); 3473 3473 if (ret) {
-2
drivers/net/ethernet/ibm/ibmveth.c
··· 1313 1313 unsigned long lpar_rc; 1314 1314 u16 mss = 0; 1315 1315 1316 - restart_poll: 1317 1316 while (frames_processed < budget) { 1318 1317 if (!ibmveth_rxq_pending_buffer(adapter)) 1319 1318 break; ··· 1400 1401 napi_reschedule(napi)) { 1401 1402 lpar_rc = h_vio_signal(adapter->vdev->unit_address, 1402 1403 VIO_IRQ_DISABLE); 1403 - goto restart_poll; 1404 1404 } 1405 1405 } 1406 1406
+4 -2
drivers/net/ethernet/mellanox/mlx4/cq.c
··· 306 306 307 307 if (entries_per_copy < entries) { 308 308 for (i = 0; i < entries / entries_per_copy; i++) { 309 - err = copy_to_user(buf, init_ents, PAGE_SIZE); 309 + err = copy_to_user((void __user *)buf, init_ents, PAGE_SIZE) ? 310 + -EFAULT : 0; 310 311 if (err) 311 312 goto out; 312 313 313 314 buf += PAGE_SIZE; 314 315 } 315 316 } else { 316 - err = copy_to_user(buf, init_ents, entries * cqe_size); 317 + err = copy_to_user((void __user *)buf, init_ents, entries * cqe_size) ? 318 + -EFAULT : 0; 317 319 } 318 320 319 321 out:
+46 -29
drivers/net/ethernet/mellanox/mlx4/fw.c
··· 2067 2067 { 2068 2068 struct mlx4_cmd_mailbox *mailbox; 2069 2069 __be32 *outbox; 2070 + u64 qword_field; 2070 2071 u32 dword_field; 2071 - int err; 2072 + u16 word_field; 2072 2073 u8 byte_field; 2074 + int err; 2073 2075 static const u8 a0_dmfs_query_hw_steering[] = { 2074 2076 [0] = MLX4_STEERING_DMFS_A0_DEFAULT, 2075 2077 [1] = MLX4_STEERING_DMFS_A0_DYNAMIC, ··· 2099 2097 2100 2098 /* QPC/EEC/CQC/EQC/RDMARC attributes */ 2101 2099 2102 - MLX4_GET(param->qpc_base, outbox, INIT_HCA_QPC_BASE_OFFSET); 2103 - MLX4_GET(param->log_num_qps, outbox, INIT_HCA_LOG_QP_OFFSET); 2104 - MLX4_GET(param->srqc_base, outbox, INIT_HCA_SRQC_BASE_OFFSET); 2105 - MLX4_GET(param->log_num_srqs, outbox, INIT_HCA_LOG_SRQ_OFFSET); 2106 - MLX4_GET(param->cqc_base, outbox, INIT_HCA_CQC_BASE_OFFSET); 2107 - MLX4_GET(param->log_num_cqs, outbox, INIT_HCA_LOG_CQ_OFFSET); 2108 - MLX4_GET(param->altc_base, outbox, INIT_HCA_ALTC_BASE_OFFSET); 2109 - MLX4_GET(param->auxc_base, outbox, INIT_HCA_AUXC_BASE_OFFSET); 2110 - MLX4_GET(param->eqc_base, outbox, INIT_HCA_EQC_BASE_OFFSET); 2111 - MLX4_GET(param->log_num_eqs, outbox, INIT_HCA_LOG_EQ_OFFSET); 2112 - MLX4_GET(param->num_sys_eqs, outbox, INIT_HCA_NUM_SYS_EQS_OFFSET); 2113 - MLX4_GET(param->rdmarc_base, outbox, INIT_HCA_RDMARC_BASE_OFFSET); 2114 - MLX4_GET(param->log_rd_per_qp, outbox, INIT_HCA_LOG_RD_OFFSET); 2100 + MLX4_GET(qword_field, outbox, INIT_HCA_QPC_BASE_OFFSET); 2101 + param->qpc_base = qword_field & ~((u64)0x1f); 2102 + MLX4_GET(byte_field, outbox, INIT_HCA_LOG_QP_OFFSET); 2103 + param->log_num_qps = byte_field & 0x1f; 2104 + MLX4_GET(qword_field, outbox, INIT_HCA_SRQC_BASE_OFFSET); 2105 + param->srqc_base = qword_field & ~((u64)0x1f); 2106 + MLX4_GET(byte_field, outbox, INIT_HCA_LOG_SRQ_OFFSET); 2107 + param->log_num_srqs = byte_field & 0x1f; 2108 + MLX4_GET(qword_field, outbox, INIT_HCA_CQC_BASE_OFFSET); 2109 + param->cqc_base = qword_field & ~((u64)0x1f); 2110 + MLX4_GET(byte_field, outbox, INIT_HCA_LOG_CQ_OFFSET); 2111 + param->log_num_cqs = byte_field & 0x1f; 2112 + MLX4_GET(qword_field, outbox, INIT_HCA_ALTC_BASE_OFFSET); 2113 + param->altc_base = qword_field; 2114 + MLX4_GET(qword_field, outbox, INIT_HCA_AUXC_BASE_OFFSET); 2115 + param->auxc_base = qword_field; 2116 + MLX4_GET(qword_field, outbox, INIT_HCA_EQC_BASE_OFFSET); 2117 + param->eqc_base = qword_field & ~((u64)0x1f); 2118 + MLX4_GET(byte_field, outbox, INIT_HCA_LOG_EQ_OFFSET); 2119 + param->log_num_eqs = byte_field & 0x1f; 2120 + MLX4_GET(word_field, outbox, INIT_HCA_NUM_SYS_EQS_OFFSET); 2121 + param->num_sys_eqs = word_field & 0xfff; 2122 + MLX4_GET(qword_field, outbox, INIT_HCA_RDMARC_BASE_OFFSET); 2123 + param->rdmarc_base = qword_field & ~((u64)0x1f); 2124 + MLX4_GET(byte_field, outbox, INIT_HCA_LOG_RD_OFFSET); 2125 + param->log_rd_per_qp = byte_field & 0x7; 2115 2126 2116 2127 MLX4_GET(dword_field, outbox, INIT_HCA_FLAGS_OFFSET); 2117 2128 if (dword_field & (1 << INIT_HCA_DEVICE_MANAGED_FLOW_STEERING_EN)) { ··· 2143 2128 /* steering attributes */ 2144 2129 if (param->steering_mode == MLX4_STEERING_MODE_DEVICE_MANAGED) { 2145 2130 MLX4_GET(param->mc_base, outbox, INIT_HCA_FS_BASE_OFFSET); 2146 - MLX4_GET(param->log_mc_entry_sz, outbox, 2147 - INIT_HCA_FS_LOG_ENTRY_SZ_OFFSET); 2148 - MLX4_GET(param->log_mc_table_sz, outbox, 2149 - INIT_HCA_FS_LOG_TABLE_SZ_OFFSET); 2150 - MLX4_GET(byte_field, outbox, 2151 - INIT_HCA_FS_A0_OFFSET); 2131 + MLX4_GET(byte_field, outbox, INIT_HCA_FS_LOG_ENTRY_SZ_OFFSET); 2132 + param->log_mc_entry_sz = byte_field & 0x1f; 2133 + MLX4_GET(byte_field, outbox, INIT_HCA_FS_LOG_TABLE_SZ_OFFSET); 2134 + param->log_mc_table_sz = byte_field & 0x1f; 2135 + MLX4_GET(byte_field, outbox, INIT_HCA_FS_A0_OFFSET); 2152 2136 param->dmfs_high_steer_mode = 2153 2137 a0_dmfs_query_hw_steering[(byte_field >> 6) & 3]; 2154 2138 } else { 2155 2139 MLX4_GET(param->mc_base, outbox, INIT_HCA_MC_BASE_OFFSET); 2156 - MLX4_GET(param->log_mc_entry_sz, outbox, 2157 - INIT_HCA_LOG_MC_ENTRY_SZ_OFFSET); 2158 - MLX4_GET(param->log_mc_hash_sz, outbox, 2159 - INIT_HCA_LOG_MC_HASH_SZ_OFFSET); 2160 - MLX4_GET(param->log_mc_table_sz, outbox, 2161 - INIT_HCA_LOG_MC_TABLE_SZ_OFFSET); 2140 + MLX4_GET(byte_field, outbox, INIT_HCA_LOG_MC_ENTRY_SZ_OFFSET); 2141 + param->log_mc_entry_sz = byte_field & 0x1f; 2142 + MLX4_GET(byte_field, outbox, INIT_HCA_LOG_MC_HASH_SZ_OFFSET); 2143 + param->log_mc_hash_sz = byte_field & 0x1f; 2144 + MLX4_GET(byte_field, outbox, INIT_HCA_LOG_MC_TABLE_SZ_OFFSET); 2145 + param->log_mc_table_sz = byte_field & 0x1f; 2162 2146 } 2163 2147 2164 2148 /* CX3 is capable of extending CQEs/EQEs from 32 to 64 bytes */ ··· 2181 2167 /* TPT attributes */ 2182 2168 2183 2169 MLX4_GET(param->dmpt_base, outbox, INIT_HCA_DMPT_BASE_OFFSET); 2184 - MLX4_GET(param->mw_enabled, outbox, INIT_HCA_TPT_MW_OFFSET); 2185 - MLX4_GET(param->log_mpt_sz, outbox, INIT_HCA_LOG_MPT_SZ_OFFSET); 2170 + MLX4_GET(byte_field, outbox, INIT_HCA_TPT_MW_OFFSET); 2171 + param->mw_enabled = byte_field >> 7; 2172 + MLX4_GET(byte_field, outbox, INIT_HCA_LOG_MPT_SZ_OFFSET); 2173 + param->log_mpt_sz = byte_field & 0x3f; 2186 2174 MLX4_GET(param->mtt_base, outbox, INIT_HCA_MTT_BASE_OFFSET); 2187 2175 MLX4_GET(param->cmpt_base, outbox, INIT_HCA_CMPT_BASE_OFFSET); 2188 2176 2189 2177 /* UAR attributes */ 2190 2178 2191 2179 MLX4_GET(param->uar_page_sz, outbox, INIT_HCA_UAR_PAGE_SZ_OFFSET); 2192 - MLX4_GET(param->log_uar_sz, outbox, INIT_HCA_LOG_UAR_SZ_OFFSET); 2180 + MLX4_GET(byte_field, outbox, INIT_HCA_LOG_UAR_SZ_OFFSET); 2181 + param->log_uar_sz = byte_field & 0xf; 2193 2182 2194 2183 /* phv_check enable */ 2195 2184 MLX4_GET(byte_field, outbox, INIT_HCA_CACHELINE_SZ_OFFSET);
+7 -5
drivers/net/ethernet/renesas/ravb_main.c
··· 343 343 int i; 344 344 345 345 priv->rx_buf_sz = (ndev->mtu <= 1492 ? PKT_BUF_SZ : ndev->mtu) + 346 - ETH_HLEN + VLAN_HLEN; 346 + ETH_HLEN + VLAN_HLEN + sizeof(__sum16); 347 347 348 348 /* Allocate RX and TX skb rings */ 349 349 priv->rx_skb[q] = kcalloc(priv->num_rx_ring[q], ··· 524 524 { 525 525 u8 *hw_csum; 526 526 527 - /* The hardware checksum is 2 bytes appended to packet data */ 528 - if (unlikely(skb->len < 2)) 527 + /* The hardware checksum is contained in sizeof(__sum16) (2) bytes 528 + * appended to packet data 529 + */ 530 + if (unlikely(skb->len < sizeof(__sum16))) 529 531 return; 530 - hw_csum = skb_tail_pointer(skb) - 2; 532 + hw_csum = skb_tail_pointer(skb) - sizeof(__sum16); 531 533 skb->csum = csum_unfold((__force __sum16)get_unaligned_le16(hw_csum)); 532 534 skb->ip_summed = CHECKSUM_COMPLETE; 533 - skb_trim(skb, skb->len - 2); 535 + skb_trim(skb, skb->len - sizeof(__sum16)); 534 536 } 535 537 536 538 /* Packet receive function for Ethernet AVB */
+21 -8
drivers/net/ethernet/sfc/ef10.c
··· 6046 6046 { NVRAM_PARTITION_TYPE_EXPANSION_UEFI, 0, 0, "sfc_uefi" }, 6047 6047 { NVRAM_PARTITION_TYPE_STATUS, 0, 0, "sfc_status" } 6048 6048 }; 6049 + #define EF10_NVRAM_PARTITION_COUNT ARRAY_SIZE(efx_ef10_nvram_types) 6049 6050 6050 6051 static int efx_ef10_mtd_probe_partition(struct efx_nic *efx, 6051 6052 struct efx_mcdi_mtd_partition *part, 6052 - unsigned int type) 6053 + unsigned int type, 6054 + unsigned long *found) 6053 6055 { 6054 6056 MCDI_DECLARE_BUF(inbuf, MC_CMD_NVRAM_METADATA_IN_LEN); 6055 6057 MCDI_DECLARE_BUF(outbuf, MC_CMD_NVRAM_METADATA_OUT_LENMAX); 6056 6058 const struct efx_ef10_nvram_type_info *info; 6057 6059 size_t size, erase_size, outlen; 6060 + int type_idx = 0; 6058 6061 bool protected; 6059 6062 int rc; 6060 6063 6061 - for (info = efx_ef10_nvram_types; ; info++) { 6062 - if (info == 6063 - efx_ef10_nvram_types + ARRAY_SIZE(efx_ef10_nvram_types)) 6064 + for (type_idx = 0; ; type_idx++) { 6065 + if (type_idx == EF10_NVRAM_PARTITION_COUNT) 6064 6066 return -ENODEV; 6067 + info = efx_ef10_nvram_types + type_idx; 6065 6068 if ((type & ~info->type_mask) == info->type) 6066 6069 break; 6067 6070 } ··· 6076 6073 return rc; 6077 6074 if (protected) 6078 6075 return -ENODEV; /* hide it */ 6076 + 6077 + /* If we've already exposed a partition of this type, hide this 6078 + * duplicate. All operations on MTDs are keyed by the type anyway, 6079 + * so we can't act on the duplicate. 6080 + */ 6081 + if (__test_and_set_bit(type_idx, found)) 6082 + return -EEXIST; 6079 6083 6080 6084 part->nvram_type = type; 6081 6085 ··· 6115 6105 static int efx_ef10_mtd_probe(struct efx_nic *efx) 6116 6106 { 6117 6107 MCDI_DECLARE_BUF(outbuf, MC_CMD_NVRAM_PARTITIONS_OUT_LENMAX); 6108 + DECLARE_BITMAP(found, EF10_NVRAM_PARTITION_COUNT); 6118 6109 struct efx_mcdi_mtd_partition *parts; 6119 6110 size_t outlen, n_parts_total, i, n_parts; 6120 6111 unsigned int type; ··· 6144 6133 for (i = 0; i < n_parts_total; i++) { 6145 6134 type = MCDI_ARRAY_DWORD(outbuf, NVRAM_PARTITIONS_OUT_TYPE_ID, 6146 6135 i); 6147 - rc = efx_ef10_mtd_probe_partition(efx, &parts[n_parts], type); 6148 - if (rc == 0) 6149 - n_parts++; 6150 - else if (rc != -ENODEV) 6136 + rc = efx_ef10_mtd_probe_partition(efx, &parts[n_parts], type, 6137 + found); 6138 + if (rc == -EEXIST || rc == -ENODEV) 6139 + continue; 6140 + if (rc) 6151 6141 goto fail; 6142 + n_parts++; 6152 6143 } 6153 6144 6154 6145 rc = efx_mtd_add(efx, &parts[0].common, n_parts, sizeof(*parts));
+1 -14
drivers/net/ethernet/sun/cassini.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 1 + // SPDX-License-Identifier: GPL-2.0+ 2 2 /* cassini.c: Sun Microsystems Cassini(+) ethernet driver. 3 3 * 4 4 * Copyright (C) 2004 Sun Microsystems Inc. 5 5 * Copyright (C) 2003 Adrian Sun (asun@darksunrising.com) 6 - * 7 - * This program is free software; you can redistribute it and/or 8 - * modify it under the terms of the GNU General Public License as 9 - * published by the Free Software Foundation; either version 2 of the 10 - * License, or (at your option) any later version. 11 - * 12 - * This program is distributed in the hope that it will be useful, 13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 - * GNU General Public License for more details. 16 - * 17 - * You should have received a copy of the GNU General Public License 18 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 19 6 * 20 7 * This driver uses the sungem driver (c) David Miller 21 8 * (davem@redhat.com) as its basis.
+1 -14
drivers/net/ethernet/sun/cassini.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 1 + /* SPDX-License-Identifier: GPL-2.0+ */ 2 2 /* $Id: cassini.h,v 1.16 2004/08/17 21:15:16 zaumen Exp $ 3 3 * cassini.h: Definitions for Sun Microsystems Cassini(+) ethernet driver. 4 4 * 5 5 * Copyright (C) 2004 Sun Microsystems Inc. 6 6 * Copyright (c) 2003 Adrian Sun (asun@darksunrising.com) 7 - * 8 - * This program is free software; you can redistribute it and/or 9 - * modify it under the terms of the GNU General Public License as 10 - * published by the Free Software Foundation; either version 2 of the 11 - * License, or (at your option) any later version. 12 - * 13 - * This program is distributed in the hope that it will be useful, 14 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 - * GNU General Public License for more details. 17 - * 18 - * You should have received a copy of the GNU General Public License 19 - * along with this program; if not, see <http://www.gnu.org/licenses/>. 20 7 * 21 8 * vendor id: 0x108E (Sun Microsystems, Inc.) 22 9 * device id: 0xabba (Cassini)
+8 -4
drivers/net/hyperv/hyperv_net.h
··· 144 144 u32 total_data_buflen; 145 145 }; 146 146 147 + #define NETVSC_HASH_KEYLEN 40 148 + 147 149 struct netvsc_device_info { 148 150 unsigned char mac_adr[ETH_ALEN]; 149 151 u32 num_chn; ··· 153 151 u32 recv_sections; 154 152 u32 send_section_size; 155 153 u32 recv_section_size; 154 + 155 + u8 rss_key[NETVSC_HASH_KEYLEN]; 156 156 }; 157 157 158 158 enum rndis_device_state { ··· 163 159 RNDIS_DEV_INITIALIZED, 164 160 RNDIS_DEV_DATAINITIALIZED, 165 161 }; 166 - 167 - #define NETVSC_HASH_KEYLEN 40 168 162 169 163 struct rndis_device { 170 164 struct net_device *ndev; ··· 211 209 void netvsc_channel_cb(void *context); 212 210 int netvsc_poll(struct napi_struct *napi, int budget); 213 211 214 - int rndis_set_subchannel(struct net_device *ndev, struct netvsc_device *nvdev); 212 + int rndis_set_subchannel(struct net_device *ndev, 213 + struct netvsc_device *nvdev, 214 + struct netvsc_device_info *dev_info); 215 215 int rndis_filter_open(struct netvsc_device *nvdev); 216 216 int rndis_filter_close(struct netvsc_device *nvdev); 217 217 struct netvsc_device *rndis_filter_device_add(struct hv_device *dev, ··· 1181 1177 1182 1178 enum rndis_per_pkt_info_interal_type { 1183 1179 RNDIS_PKTINFO_ID = 1, 1184 - /* Add more memebers here */ 1180 + /* Add more members here */ 1185 1181 1186 1182 RNDIS_PKTINFO_MAX 1187 1183 };
+2 -2
drivers/net/hyperv/netvsc.c
··· 84 84 85 85 rdev = nvdev->extension; 86 86 if (rdev) { 87 - ret = rndis_set_subchannel(rdev->ndev, nvdev); 87 + ret = rndis_set_subchannel(rdev->ndev, nvdev, NULL); 88 88 if (ret == 0) { 89 89 netif_device_attach(rdev->ndev); 90 90 } else { ··· 1331 1331 prefetch(hv_get_ring_buffer(rbi) + rbi->priv_read_index); 1332 1332 1333 1333 if (napi_schedule_prep(&nvchan->napi)) { 1334 - /* disable interupts from host */ 1334 + /* disable interrupts from host */ 1335 1335 hv_begin_read(rbi); 1336 1336 1337 1337 __napi_schedule_irqoff(&nvchan->napi);
+91 -52
drivers/net/hyperv/netvsc_drv.c
··· 370 370 { 371 371 int j = 0; 372 372 373 - /* Deal with compund pages by ignoring unused part 373 + /* Deal with compound pages by ignoring unused part 374 374 * of the page. 375 375 */ 376 376 page += (offset >> PAGE_SHIFT); ··· 858 858 } 859 859 } 860 860 861 + /* Alloc struct netvsc_device_info, and initialize it from either existing 862 + * struct netvsc_device, or from default values. 863 + */ 864 + static struct netvsc_device_info *netvsc_devinfo_get 865 + (struct netvsc_device *nvdev) 866 + { 867 + struct netvsc_device_info *dev_info; 868 + 869 + dev_info = kzalloc(sizeof(*dev_info), GFP_ATOMIC); 870 + 871 + if (!dev_info) 872 + return NULL; 873 + 874 + if (nvdev) { 875 + dev_info->num_chn = nvdev->num_chn; 876 + dev_info->send_sections = nvdev->send_section_cnt; 877 + dev_info->send_section_size = nvdev->send_section_size; 878 + dev_info->recv_sections = nvdev->recv_section_cnt; 879 + dev_info->recv_section_size = nvdev->recv_section_size; 880 + 881 + memcpy(dev_info->rss_key, nvdev->extension->rss_key, 882 + NETVSC_HASH_KEYLEN); 883 + } else { 884 + dev_info->num_chn = VRSS_CHANNEL_DEFAULT; 885 + dev_info->send_sections = NETVSC_DEFAULT_TX; 886 + dev_info->send_section_size = NETVSC_SEND_SECTION_SIZE; 887 + dev_info->recv_sections = NETVSC_DEFAULT_RX; 888 + dev_info->recv_section_size = NETVSC_RECV_SECTION_SIZE; 889 + } 890 + 891 + return dev_info; 892 + } 893 + 861 894 static int netvsc_detach(struct net_device *ndev, 862 895 struct netvsc_device *nvdev) 863 896 { ··· 942 909 return PTR_ERR(nvdev); 943 910 944 911 if (nvdev->num_chn > 1) { 945 - ret = rndis_set_subchannel(ndev, nvdev); 912 + ret = rndis_set_subchannel(ndev, nvdev, dev_info); 946 913 947 914 /* if unavailable, just proceed with one queue */ 948 915 if (ret) { ··· 976 943 struct net_device_context *net_device_ctx = netdev_priv(net); 977 944 struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev); 978 945 unsigned int orig, count = channels->combined_count; 979 - struct netvsc_device_info device_info; 946 + struct netvsc_device_info *device_info; 980 947 int ret; 981 948 982 949 /* We do not support separate count for rx, tx, or other */ ··· 995 962 996 963 orig = nvdev->num_chn; 997 964 998 - memset(&device_info, 0, sizeof(device_info)); 999 - device_info.num_chn = count; 1000 - device_info.send_sections = nvdev->send_section_cnt; 1001 - device_info.send_section_size = nvdev->send_section_size; 1002 - device_info.recv_sections = nvdev->recv_section_cnt; 1003 - device_info.recv_section_size = nvdev->recv_section_size; 965 + device_info = netvsc_devinfo_get(nvdev); 966 + 967 + if (!device_info) 968 + return -ENOMEM; 969 + 970 + device_info->num_chn = count; 1004 971 1005 972 ret = netvsc_detach(net, nvdev); 1006 973 if (ret) 1007 - return ret; 974 + goto out; 1008 975 1009 - ret = netvsc_attach(net, &device_info); 976 + ret = netvsc_attach(net, device_info); 1010 977 if (ret) { 1011 - device_info.num_chn = orig; 1012 - if (netvsc_attach(net, &device_info)) 978 + device_info->num_chn = orig; 979 + if (netvsc_attach(net, device_info)) 1013 980 netdev_err(net, "restoring channel setting failed\n"); 1014 981 } 1015 982 983 + out: 984 + kfree(device_info); 1016 985 return ret; 1017 986 } 1018 987 ··· 1083 1048 struct net_device *vf_netdev = rtnl_dereference(ndevctx->vf_netdev); 1084 1049 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); 1085 1050 int orig_mtu = ndev->mtu; 1086 - struct netvsc_device_info device_info; 1051 + struct netvsc_device_info *device_info; 1087 1052 int ret = 0; 1088 1053 1089 1054 if (!nvdev || nvdev->destroy) 1090 1055 return -ENODEV; 1091 1056 1057 + device_info = netvsc_devinfo_get(nvdev); 1058 + 1059 + if (!device_info) 1060 + return -ENOMEM; 1061 + 1092 1062 /* Change MTU of underlying VF netdev first. */ 1093 1063 if (vf_netdev) { 1094 1064 ret = dev_set_mtu(vf_netdev, mtu); 1095 1065 if (ret) 1096 - return ret; 1066 + goto out; 1097 1067 } 1098 - 1099 - memset(&device_info, 0, sizeof(device_info)); 1100 - device_info.num_chn = nvdev->num_chn; 1101 - device_info.send_sections = nvdev->send_section_cnt; 1102 - device_info.send_section_size = nvdev->send_section_size; 1103 - device_info.recv_sections = nvdev->recv_section_cnt; 1104 - device_info.recv_section_size = nvdev->recv_section_size; 1105 1068 1106 1069 ret = netvsc_detach(ndev, nvdev); 1107 1070 if (ret) ··· 1107 1074 1108 1075 ndev->mtu = mtu; 1109 1076 1110 - ret = netvsc_attach(ndev, &device_info); 1111 - if (ret) 1112 - goto rollback; 1077 + ret = netvsc_attach(ndev, device_info); 1078 + if (!ret) 1079 + goto out; 1113 1080 1114 - return 0; 1115 - 1116 - rollback: 1117 1081 /* Attempt rollback to original MTU */ 1118 1082 ndev->mtu = orig_mtu; 1119 1083 1120 - if (netvsc_attach(ndev, &device_info)) 1084 + if (netvsc_attach(ndev, device_info)) 1121 1085 netdev_err(ndev, "restoring mtu failed\n"); 1122 1086 rollback_vf: 1123 1087 if (vf_netdev) 1124 1088 dev_set_mtu(vf_netdev, orig_mtu); 1125 1089 1090 + out: 1091 + kfree(device_info); 1126 1092 return ret; 1127 1093 } 1128 1094 ··· 1706 1674 { 1707 1675 struct net_device_context *ndevctx = netdev_priv(ndev); 1708 1676 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); 1709 - struct netvsc_device_info device_info; 1677 + struct netvsc_device_info *device_info; 1710 1678 struct ethtool_ringparam orig; 1711 1679 u32 new_tx, new_rx; 1712 1680 int ret = 0; ··· 1726 1694 new_rx == orig.rx_pending) 1727 1695 return 0; /* no change */ 1728 1696 1729 - memset(&device_info, 0, sizeof(device_info)); 1730 - device_info.num_chn = nvdev->num_chn; 1731 - device_info.send_sections = new_tx; 1732 - device_info.send_section_size = nvdev->send_section_size; 1733 - device_info.recv_sections = new_rx; 1734 - device_info.recv_section_size = nvdev->recv_section_size; 1697 + device_info = netvsc_devinfo_get(nvdev); 1698 + 1699 + if (!device_info) 1700 + return -ENOMEM; 1701 + 1702 + device_info->send_sections = new_tx; 1703 + device_info->recv_sections = new_rx; 1735 1704 1736 1705 ret = netvsc_detach(ndev, nvdev); 1737 1706 if (ret) 1738 - return ret; 1707 + goto out; 1739 1708 1740 - ret = netvsc_attach(ndev, &device_info); 1709 + ret = netvsc_attach(ndev, device_info); 1741 1710 if (ret) { 1742 - device_info.send_sections = orig.tx_pending; 1743 - device_info.recv_sections = orig.rx_pending; 1711 + device_info->send_sections = orig.tx_pending; 1712 + device_info->recv_sections = orig.rx_pending; 1744 1713 1745 - if (netvsc_attach(ndev, &device_info)) 1714 + if (netvsc_attach(ndev, device_info)) 1746 1715 netdev_err(ndev, "restoring ringparam failed"); 1747 1716 } 1748 1717 1718 + out: 1719 + kfree(device_info); 1749 1720 return ret; 1750 1721 } 1751 1722 ··· 2123 2088 if (!netvsc_dev || rtnl_dereference(net_device_ctx->vf_netdev)) 2124 2089 return NOTIFY_DONE; 2125 2090 2126 - /* if syntihetic interface is a different namespace, 2091 + /* if synthetic interface is a different namespace, 2127 2092 * then move the VF to that namespace; join will be 2128 2093 * done again in that context. 2129 2094 */ ··· 2202 2167 { 2203 2168 struct net_device *net = NULL; 2204 2169 struct net_device_context *net_device_ctx; 2205 - struct netvsc_device_info device_info; 2170 + struct netvsc_device_info *device_info = NULL; 2206 2171 struct netvsc_device *nvdev; 2207 2172 int ret = -ENOMEM; 2208 2173 ··· 2249 2214 netif_set_real_num_rx_queues(net, 1); 2250 2215 2251 2216 /* Notify the netvsc driver of the new device */ 2252 - memset(&device_info, 0, sizeof(device_info)); 2253 - device_info.num_chn = VRSS_CHANNEL_DEFAULT; 2254 - device_info.send_sections = NETVSC_DEFAULT_TX; 2255 - device_info.send_section_size = NETVSC_SEND_SECTION_SIZE; 2256 - device_info.recv_sections = NETVSC_DEFAULT_RX; 2257 - device_info.recv_section_size = NETVSC_RECV_SECTION_SIZE; 2217 + device_info = netvsc_devinfo_get(NULL); 2258 2218 2259 - nvdev = rndis_filter_device_add(dev, &device_info); 2219 + if (!device_info) { 2220 + ret = -ENOMEM; 2221 + goto devinfo_failed; 2222 + } 2223 + 2224 + nvdev = rndis_filter_device_add(dev, device_info); 2260 2225 if (IS_ERR(nvdev)) { 2261 2226 ret = PTR_ERR(nvdev); 2262 2227 netdev_err(net, "unable to add netvsc device (ret %d)\n", ret); 2263 2228 goto rndis_failed; 2264 2229 } 2265 2230 2266 - memcpy(net->dev_addr, device_info.mac_adr, ETH_ALEN); 2231 + memcpy(net->dev_addr, device_info->mac_adr, ETH_ALEN); 2267 2232 2268 2233 /* We must get rtnl lock before scheduling nvdev->subchan_work, 2269 2234 * otherwise netvsc_subchan_work() can get rtnl lock first and wait ··· 2271 2236 * netvsc_probe() can't get rtnl lock and as a result vmbus_onoffer() 2272 2237 * -> ... -> device_add() -> ... -> __device_attach() can't get 2273 2238 * the device lock, so all the subchannels can't be processed -- 2274 - * finally netvsc_subchan_work() hangs for ever. 2239 + * finally netvsc_subchan_work() hangs forever. 2275 2240 */ 2276 2241 rtnl_lock(); 2277 2242 ··· 2301 2266 2302 2267 list_add(&net_device_ctx->list, &netvsc_dev_list); 2303 2268 rtnl_unlock(); 2269 + 2270 + kfree(device_info); 2304 2271 return 0; 2305 2272 2306 2273 register_failed: 2307 2274 rtnl_unlock(); 2308 2275 rndis_filter_device_remove(dev, nvdev); 2309 2276 rndis_failed: 2277 + kfree(device_info); 2278 + devinfo_failed: 2310 2279 free_percpu(net_device_ctx->vf_stats); 2311 2280 no_stats: 2312 2281 hv_set_drvdata(dev, NULL);
+27 -9
drivers/net/hyperv/rndis_filter.c
··· 774 774 return ret; 775 775 } 776 776 777 - int rndis_filter_set_rss_param(struct rndis_device *rdev, 778 - const u8 *rss_key) 777 + static int rndis_set_rss_param_msg(struct rndis_device *rdev, 778 + const u8 *rss_key, u16 flag) 779 779 { 780 780 struct net_device *ndev = rdev->ndev; 781 781 struct rndis_request *request; ··· 804 804 rssp->hdr.type = NDIS_OBJECT_TYPE_RSS_PARAMETERS; 805 805 rssp->hdr.rev = NDIS_RECEIVE_SCALE_PARAMETERS_REVISION_2; 806 806 rssp->hdr.size = sizeof(struct ndis_recv_scale_param); 807 - rssp->flag = 0; 807 + rssp->flag = flag; 808 808 rssp->hashinfo = NDIS_HASH_FUNC_TOEPLITZ | NDIS_HASH_IPV4 | 809 809 NDIS_HASH_TCP_IPV4 | NDIS_HASH_IPV6 | 810 810 NDIS_HASH_TCP_IPV6; ··· 829 829 830 830 wait_for_completion(&request->wait_event); 831 831 set_complete = &request->response_msg.msg.set_complete; 832 - if (set_complete->status == RNDIS_STATUS_SUCCESS) 833 - memcpy(rdev->rss_key, rss_key, NETVSC_HASH_KEYLEN); 834 - else { 832 + if (set_complete->status == RNDIS_STATUS_SUCCESS) { 833 + if (!(flag & NDIS_RSS_PARAM_FLAG_DISABLE_RSS) && 834 + !(flag & NDIS_RSS_PARAM_FLAG_HASH_KEY_UNCHANGED)) 835 + memcpy(rdev->rss_key, rss_key, NETVSC_HASH_KEYLEN); 836 + 837 + } else { 835 838 netdev_err(ndev, "Fail to set RSS parameters:0x%x\n", 836 839 set_complete->status); 837 840 ret = -EINVAL; ··· 843 840 cleanup: 844 841 put_rndis_request(rdev, request); 845 842 return ret; 843 + } 844 + 845 + int rndis_filter_set_rss_param(struct rndis_device *rdev, 846 + const u8 *rss_key) 847 + { 848 + /* Disable RSS before change */ 849 + rndis_set_rss_param_msg(rdev, rss_key, 850 + NDIS_RSS_PARAM_FLAG_DISABLE_RSS); 851 + 852 + return rndis_set_rss_param_msg(rdev, rss_key, 0); 846 853 } 847 854 848 855 static int rndis_filter_query_device_link_status(struct rndis_device *dev, ··· 1134 1121 * This breaks overlap of processing the host message for the 1135 1122 * new primary channel with the initialization of sub-channels. 1136 1123 */ 1137 - int rndis_set_subchannel(struct net_device *ndev, struct netvsc_device *nvdev) 1124 + int rndis_set_subchannel(struct net_device *ndev, 1125 + struct netvsc_device *nvdev, 1126 + struct netvsc_device_info *dev_info) 1138 1127 { 1139 1128 struct nvsp_message *init_packet = &nvdev->channel_init_pkt; 1140 1129 struct net_device_context *ndev_ctx = netdev_priv(ndev); ··· 1176 1161 wait_event(nvdev->subchan_open, 1177 1162 atomic_read(&nvdev->open_chn) == nvdev->num_chn); 1178 1163 1179 - /* ignore failues from setting rss parameters, still have channels */ 1180 - rndis_filter_set_rss_param(rdev, netvsc_hash_key); 1164 + /* ignore failures from setting rss parameters, still have channels */ 1165 + if (dev_info) 1166 + rndis_filter_set_rss_param(rdev, dev_info->rss_key); 1167 + else 1168 + rndis_filter_set_rss_param(rdev, netvsc_hash_key); 1181 1169 1182 1170 netif_set_real_num_tx_queues(ndev, nvdev->num_chn); 1183 1171 netif_set_real_num_rx_queues(ndev, nvdev->num_chn);
+1 -7
drivers/net/phy/asix.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 1 + // SPDX-License-Identifier: GPL-2.0+ 2 2 /* Driver for Asix PHYs 3 3 * 4 4 * Author: Michael Schmitz <schmitzmic@gmail.com> 5 - * 6 - * This program is free software; you can redistribute it and/or modify it 7 - * under the terms of the GNU General Public License as published by the 8 - * Free Software Foundation; either version 2 of the License, or (at your 9 - * option) any later version. 10 - * 11 5 */ 12 6 #include <linux/kernel.h> 13 7 #include <linux/errno.h>
+2 -14
drivers/net/phy/mdio-hisi-femac.c
··· 1 + // SPDX-License-Identifier: GPL-2.0+ 1 2 /* 2 3 * Hisilicon Fast Ethernet MDIO Bus Driver 3 4 * 4 5 * Copyright (c) 2016 HiSilicon Technologies Co., Ltd. 5 - * 6 - * This program is free software; you can redistribute it and/or modify 7 - * it under the terms of the GNU General Public License as published by 8 - * the Free Software Foundation; either version 2 of the License, or 9 - * (at your option) any later version. 10 - * 11 - * This program is distributed in the hope that it will be useful, 12 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 - * GNU General Public License for more details. 15 - * 16 - * You should have received a copy of the GNU General Public License 17 - * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 6 */ 19 7 20 8 #include <linux/clk.h> ··· 151 163 152 164 MODULE_DESCRIPTION("Hisilicon Fast Ethernet MAC MDIO interface driver"); 153 165 MODULE_AUTHOR("Dongpo Li <lidongpo@hisilicon.com>"); 154 - MODULE_LICENSE("GPL v2"); 166 + MODULE_LICENSE("GPL");
+2 -7
drivers/net/phy/rockchip.c
··· 1 + // SPDX-License-Identifier: GPL-2.0+ 1 2 /** 2 3 * drivers/net/phy/rockchip.c 3 4 * ··· 7 6 * Copyright (c) 2017, Fuzhou Rockchip Electronics Co., Ltd 8 7 * 9 8 * David Wu <david.wu@rock-chips.com> 10 - * 11 - * This program is free software; you can redistribute it and/or modify 12 - * it under the terms of the GNU General Public License as published by 13 - * the Free Software Foundation; either version 2 of the License, or 14 - * (at your option) any later version. 15 - * 16 9 */ 17 10 18 11 #include <linux/ethtool.h> ··· 224 229 225 230 MODULE_AUTHOR("David Wu <david.wu@rock-chips.com>"); 226 231 MODULE_DESCRIPTION("Rockchip Ethernet PHY driver"); 227 - MODULE_LICENSE("GPL v2"); 232 + MODULE_LICENSE("GPL");
+7 -2
drivers/net/usb/asix_devices.c
··· 739 739 asix_read_cmd(dev, AX_CMD_STATMNGSTS_REG, 0, 0, 1, &chipcode, 0); 740 740 chipcode &= AX_CHIPCODE_MASK; 741 741 742 - (chipcode == AX_AX88772_CHIPCODE) ? ax88772_hw_reset(dev, 0) : 743 - ax88772a_hw_reset(dev, 0); 742 + ret = (chipcode == AX_AX88772_CHIPCODE) ? ax88772_hw_reset(dev, 0) : 743 + ax88772a_hw_reset(dev, 0); 744 + 745 + if (ret < 0) { 746 + netdev_dbg(dev->net, "Failed to reset AX88772: %d\n", ret); 747 + return ret; 748 + } 744 749 745 750 /* Read PHYID register *AFTER* the PHY was reset properly */ 746 751 phyid = asix_get_phyid(dev);
+5
drivers/net/wireless/mac80211_hwsim.c
··· 2761 2761 BIT(NL80211_CHAN_WIDTH_160); 2762 2762 } 2763 2763 2764 + if (!n_limits) { 2765 + err = -EINVAL; 2766 + goto failed_hw; 2767 + } 2768 + 2764 2769 data->if_combination.n_limits = n_limits; 2765 2770 data->if_combination.max_interfaces = 2048; 2766 2771 data->if_combination.limits = data->if_limits;
+3 -1
drivers/net/wireless/virt_wifi.c
··· 530 530 SET_NETDEV_DEV(dev, &priv->lowerdev->dev); 531 531 dev->ieee80211_ptr = kzalloc(sizeof(*dev->ieee80211_ptr), GFP_KERNEL); 532 532 533 - if (!dev->ieee80211_ptr) 533 + if (!dev->ieee80211_ptr) { 534 + err = -ENOMEM; 534 535 goto remove_handler; 536 + } 535 537 536 538 dev->ieee80211_ptr->iftype = NL80211_IFTYPE_STATION; 537 539 dev->ieee80211_ptr->wiphy = common_wiphy;
+1
include/linux/if_arp.h
··· 54 54 case ARPHRD_IPGRE: 55 55 case ARPHRD_VOID: 56 56 case ARPHRD_NONE: 57 + case ARPHRD_RAWIP: 57 58 return false; 58 59 default: 59 60 return true;
+12
include/net/ax25.h
··· 201 201 202 202 void __ax25_put_route(ax25_route *ax25_rt); 203 203 204 + extern rwlock_t ax25_route_lock; 205 + 206 + static inline void ax25_route_lock_use(void) 207 + { 208 + read_lock(&ax25_route_lock); 209 + } 210 + 211 + static inline void ax25_route_lock_unuse(void) 212 + { 213 + read_unlock(&ax25_route_lock); 214 + } 215 + 204 216 static inline void ax25_put_route(ax25_route *ax25_rt) 205 217 { 206 218 if (refcount_dec_and_test(&ax25_rt->refcount))
+2 -2
net/ax25/ax25_ip.c
··· 114 114 dst = (ax25_address *)(bp + 1); 115 115 src = (ax25_address *)(bp + 8); 116 116 117 + ax25_route_lock_use(); 117 118 route = ax25_get_route(dst, NULL); 118 119 if (route) { 119 120 digipeat = route->digipeat; ··· 207 206 ax25_queue_xmit(skb, dev); 208 207 209 208 put: 210 - if (route) 211 - ax25_put_route(route); 212 209 210 + ax25_route_lock_unuse(); 213 211 return NETDEV_TX_OK; 214 212 } 215 213
+8 -11
net/ax25/ax25_route.c
··· 40 40 #include <linux/export.h> 41 41 42 42 static ax25_route *ax25_route_list; 43 - static DEFINE_RWLOCK(ax25_route_lock); 43 + DEFINE_RWLOCK(ax25_route_lock); 44 44 45 45 void ax25_rt_device_down(struct net_device *dev) 46 46 { ··· 335 335 * Find AX.25 route 336 336 * 337 337 * Only routes with a reference count of zero can be destroyed. 338 + * Must be called with ax25_route_lock read locked. 338 339 */ 339 340 ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev) 340 341 { ··· 343 342 ax25_route *ax25_def_rt = NULL; 344 343 ax25_route *ax25_rt; 345 344 346 - read_lock(&ax25_route_lock); 347 345 /* 348 346 * Bind to the physical interface we heard them on, or the default 349 347 * route if none is found; ··· 364 364 ax25_rt = ax25_def_rt; 365 365 if (ax25_spe_rt != NULL) 366 366 ax25_rt = ax25_spe_rt; 367 - 368 - if (ax25_rt != NULL) 369 - ax25_hold_route(ax25_rt); 370 - 371 - read_unlock(&ax25_route_lock); 372 367 373 368 return ax25_rt; 374 369 } ··· 395 400 ax25_route *ax25_rt; 396 401 int err = 0; 397 402 398 - if ((ax25_rt = ax25_get_route(addr, NULL)) == NULL) 403 + ax25_route_lock_use(); 404 + ax25_rt = ax25_get_route(addr, NULL); 405 + if (!ax25_rt) { 406 + ax25_route_lock_unuse(); 399 407 return -EHOSTUNREACH; 400 - 408 + } 401 409 if ((ax25->ax25_dev = ax25_dev_ax25dev(ax25_rt->dev)) == NULL) { 402 410 err = -EHOSTUNREACH; 403 411 goto put; ··· 435 437 } 436 438 437 439 put: 438 - ax25_put_route(ax25_rt); 439 - 440 + ax25_route_lock_unuse(); 440 441 return err; 441 442 } 442 443
+27
net/can/bcm.c
··· 67 67 */ 68 68 #define MAX_NFRAMES 256 69 69 70 + /* limit timers to 400 days for sending/timeouts */ 71 + #define BCM_TIMER_SEC_MAX (400 * 24 * 60 * 60) 72 + 70 73 /* use of last_frames[index].flags */ 71 74 #define RX_RECV 0x40 /* received data for this element */ 72 75 #define RX_THR 0x80 /* element not been sent due to throttle feature */ ··· 141 138 static inline ktime_t bcm_timeval_to_ktime(struct bcm_timeval tv) 142 139 { 143 140 return ktime_set(tv.tv_sec, tv.tv_usec * NSEC_PER_USEC); 141 + } 142 + 143 + /* check limitations for timeval provided by user */ 144 + static bool bcm_is_invalid_tv(struct bcm_msg_head *msg_head) 145 + { 146 + if ((msg_head->ival1.tv_sec < 0) || 147 + (msg_head->ival1.tv_sec > BCM_TIMER_SEC_MAX) || 148 + (msg_head->ival1.tv_usec < 0) || 149 + (msg_head->ival1.tv_usec >= USEC_PER_SEC) || 150 + (msg_head->ival2.tv_sec < 0) || 151 + (msg_head->ival2.tv_sec > BCM_TIMER_SEC_MAX) || 152 + (msg_head->ival2.tv_usec < 0) || 153 + (msg_head->ival2.tv_usec >= USEC_PER_SEC)) 154 + return true; 155 + 156 + return false; 144 157 } 145 158 146 159 #define CFSIZ(flags) ((flags & CAN_FD_FRAME) ? CANFD_MTU : CAN_MTU) ··· 892 873 if (msg_head->nframes < 1 || msg_head->nframes > MAX_NFRAMES) 893 874 return -EINVAL; 894 875 876 + /* check timeval limitations */ 877 + if ((msg_head->flags & SETTIMER) && bcm_is_invalid_tv(msg_head)) 878 + return -EINVAL; 879 + 895 880 /* check the given can_id */ 896 881 op = bcm_find_op(&bo->tx_ops, msg_head, ifindex); 897 882 if (op) { ··· 1074 1051 if ((msg_head->flags & RX_RTR_FRAME) && 1075 1052 ((msg_head->nframes != 1) || 1076 1053 (!(msg_head->can_id & CAN_RTR_FLAG)))) 1054 + return -EINVAL; 1055 + 1056 + /* check timeval limitations */ 1057 + if ((msg_head->flags & SETTIMER) && bcm_is_invalid_tv(msg_head)) 1077 1058 return -EINVAL; 1078 1059 1079 1060 /* check the given can_id */
+17
net/ipv4/gre_demux.c
··· 25 25 #include <linux/spinlock.h> 26 26 #include <net/protocol.h> 27 27 #include <net/gre.h> 28 + #include <net/erspan.h> 28 29 29 30 #include <net/icmp.h> 30 31 #include <net/route.h> ··· 120 119 hdr_len += 4; 121 120 } 122 121 tpi->hdr_len = hdr_len; 122 + 123 + /* ERSPAN ver 1 and 2 protocol sets GRE key field 124 + * to 0 and sets the configured key in the 125 + * inner erspan header field 126 + */ 127 + if (greh->protocol == htons(ETH_P_ERSPAN) || 128 + greh->protocol == htons(ETH_P_ERSPAN2)) { 129 + struct erspan_base_hdr *ershdr; 130 + 131 + if (!pskb_may_pull(skb, nhs + hdr_len + sizeof(*ershdr))) 132 + return -EINVAL; 133 + 134 + ershdr = (struct erspan_base_hdr *)options; 135 + tpi->key = cpu_to_be32(get_session_id(ershdr)); 136 + } 137 + 123 138 return hdr_len; 124 139 } 125 140 EXPORT_SYMBOL(gre_parse_header);
-9
net/ipv4/ip_gre.c
··· 268 268 int len; 269 269 270 270 itn = net_generic(net, erspan_net_id); 271 - len = gre_hdr_len + sizeof(*ershdr); 272 - 273 - /* Check based hdr len */ 274 - if (unlikely(!pskb_may_pull(skb, len))) 275 - return PACKET_REJECT; 276 271 277 272 iph = ip_hdr(skb); 278 273 ershdr = (struct erspan_base_hdr *)(skb->data + gre_hdr_len); 279 274 ver = ershdr->ver; 280 275 281 - /* The original GRE header does not have key field, 282 - * Use ERSPAN 10-bit session ID as key. 283 - */ 284 - tpi->key = cpu_to_be32(get_session_id(ershdr)); 285 276 tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, 286 277 tpi->flags | TUNNEL_KEY, 287 278 iph->saddr, iph->daddr, tpi->key);
+7 -1
net/ipv4/ip_tunnel.c
··· 644 644 dst = tnl_params->daddr; 645 645 if (dst == 0) { 646 646 /* NBMA tunnel */ 647 + struct ip_tunnel_info *tun_info; 647 648 648 649 if (!skb_dst(skb)) { 649 650 dev->stats.tx_fifo_errors++; 650 651 goto tx_error; 651 652 } 652 653 653 - if (skb->protocol == htons(ETH_P_IP)) { 654 + tun_info = skb_tunnel_info(skb); 655 + if (tun_info && (tun_info->mode & IP_TUNNEL_INFO_TX) && 656 + ip_tunnel_info_af(tun_info) == AF_INET && 657 + tun_info->key.u.ipv4.dst) 658 + dst = tun_info->key.u.ipv4.dst; 659 + else if (skb->protocol == htons(ETH_P_IP)) { 654 660 rt = skb_rtable(skb); 655 661 dst = rt_nexthop(rt, inner_iph->daddr); 656 662 }
+4 -2
net/ipv6/addrconf.c
··· 3495 3495 3496 3496 if (!addrconf_link_ready(dev)) { 3497 3497 /* device is not ready yet. */ 3498 - pr_info("ADDRCONF(NETDEV_UP): %s: link is not ready\n", 3499 - dev->name); 3498 + pr_debug("ADDRCONF(NETDEV_UP): %s: link is not ready\n", 3499 + dev->name); 3500 3500 break; 3501 3501 } 3502 3502 ··· 5120 5120 if (idev) { 5121 5121 err = in6_dump_addrs(idev, skb, cb, s_ip_idx, 5122 5122 &fillargs); 5123 + if (err > 0) 5124 + err = 0; 5123 5125 } 5124 5126 goto put_tgt_net; 5125 5127 }
-4
net/ipv6/ip6_gre.c
··· 534 534 struct ip6_tnl *tunnel; 535 535 u8 ver; 536 536 537 - if (unlikely(!pskb_may_pull(skb, sizeof(*ershdr)))) 538 - return PACKET_REJECT; 539 - 540 537 ipv6h = ipv6_hdr(skb); 541 538 ershdr = (struct erspan_base_hdr *)skb->data; 542 539 ver = ershdr->ver; 543 - tpi->key = cpu_to_be32(get_session_id(ershdr)); 544 540 545 541 tunnel = ip6gre_tunnel_lookup(skb->dev, 546 542 &ipv6h->saddr, &ipv6h->daddr, tpi->key,
+4
net/mac80211/cfg.c
··· 1490 1490 if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) 1491 1491 sta->sta.tdls = true; 1492 1492 1493 + if (sta->sta.tdls && sdata->vif.type == NL80211_IFTYPE_STATION && 1494 + !sdata->u.mgd.associated) 1495 + return -EINVAL; 1496 + 1493 1497 err = sta_apply_parameters(local, sta, params); 1494 1498 if (err) { 1495 1499 sta_info_free(local, sta);
+4 -2
net/mac80211/rx.c
··· 231 231 struct ieee80211_hdr_3addr hdr; 232 232 u8 category; 233 233 u8 action_code; 234 - } __packed action; 234 + } __packed __aligned(2) action; 235 235 236 236 if (!sdata) 237 237 return; ··· 2723 2723 skb_set_queue_mapping(skb, q); 2724 2724 2725 2725 if (!--mesh_hdr->ttl) { 2726 - IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl); 2726 + if (!is_multicast_ether_addr(hdr->addr1)) 2727 + IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, 2728 + dropped_frames_ttl); 2727 2729 goto out; 2728 2730 } 2729 2731
+2 -1
net/sctp/ipv6.c
··· 280 280 281 281 if (saddr) { 282 282 fl6->saddr = saddr->v6.sin6_addr; 283 - fl6->fl6_sport = saddr->v6.sin6_port; 283 + if (!fl6->fl6_sport) 284 + fl6->fl6_sport = saddr->v6.sin6_port; 284 285 285 286 pr_debug("src=%pI6 - ", &fl6->saddr); 286 287 }
+2 -1
net/sctp/protocol.c
··· 440 440 } 441 441 if (saddr) { 442 442 fl4->saddr = saddr->v4.sin_addr.s_addr; 443 - fl4->fl4_sport = saddr->v4.sin_port; 443 + if (!fl4->fl4_sport) 444 + fl4->fl4_sport = saddr->v4.sin_port; 444 445 } 445 446 446 447 pr_debug("%s: dst:%pI4, src:%pI4 - ", __func__, &fl4->daddr,
+8 -3
net/sctp/sm_make_chunk.c
··· 495 495 * 496 496 * [INIT ACK back to where the INIT came from.] 497 497 */ 498 - retval->transport = chunk->transport; 498 + if (chunk->transport) 499 + retval->transport = 500 + sctp_assoc_lookup_paddr(asoc, 501 + &chunk->transport->ipaddr); 499 502 500 503 retval->subh.init_hdr = 501 504 sctp_addto_chunk(retval, sizeof(initack), &initack); ··· 645 642 * 646 643 * [COOKIE ACK back to where the COOKIE ECHO came from.] 647 644 */ 648 - if (retval && chunk) 649 - retval->transport = chunk->transport; 645 + if (retval && chunk && chunk->transport) 646 + retval->transport = 647 + sctp_assoc_lookup_paddr(asoc, 648 + &chunk->transport->ipaddr); 650 649 651 650 return retval; 652 651 }
+25 -33
net/sctp/stream.c
··· 585 585 struct sctp_strreset_outreq *outreq = param.v; 586 586 struct sctp_stream *stream = &asoc->stream; 587 587 __u32 result = SCTP_STRRESET_DENIED; 588 - __u16 i, nums, flags = 0; 589 588 __be16 *str_p = NULL; 590 589 __u32 request_seq; 590 + __u16 i, nums; 591 591 592 592 request_seq = ntohl(outreq->request_seq); 593 593 ··· 615 615 if (!(asoc->strreset_enable & SCTP_ENABLE_RESET_STREAM_REQ)) 616 616 goto out; 617 617 618 + nums = (ntohs(param.p->length) - sizeof(*outreq)) / sizeof(__u16); 619 + str_p = outreq->list_of_streams; 620 + for (i = 0; i < nums; i++) { 621 + if (ntohs(str_p[i]) >= stream->incnt) { 622 + result = SCTP_STRRESET_ERR_WRONG_SSN; 623 + goto out; 624 + } 625 + } 626 + 618 627 if (asoc->strreset_chunk) { 619 628 if (!sctp_chunk_lookup_strreset_param( 620 629 asoc, outreq->response_seq, ··· 646 637 sctp_chunk_put(asoc->strreset_chunk); 647 638 asoc->strreset_chunk = NULL; 648 639 } 649 - 650 - flags = SCTP_STREAM_RESET_INCOMING_SSN; 651 640 } 652 641 653 - nums = (ntohs(param.p->length) - sizeof(*outreq)) / sizeof(__u16); 654 - if (nums) { 655 - str_p = outreq->list_of_streams; 656 - for (i = 0; i < nums; i++) { 657 - if (ntohs(str_p[i]) >= stream->incnt) { 658 - result = SCTP_STRRESET_ERR_WRONG_SSN; 659 - goto out; 660 - } 661 - } 662 - 642 + if (nums) 663 643 for (i = 0; i < nums; i++) 664 644 SCTP_SI(stream, ntohs(str_p[i]))->mid = 0; 665 - } else { 645 + else 666 646 for (i = 0; i < stream->incnt; i++) 667 647 SCTP_SI(stream, i)->mid = 0; 668 - } 669 648 670 649 result = SCTP_STRRESET_PERFORMED; 671 650 672 651 *evp = sctp_ulpevent_make_stream_reset_event(asoc, 673 - flags | SCTP_STREAM_RESET_OUTGOING_SSN, nums, str_p, 674 - GFP_ATOMIC); 652 + SCTP_STREAM_RESET_INCOMING_SSN, nums, str_p, GFP_ATOMIC); 675 653 676 654 out: 677 655 sctp_update_strreset_result(asoc, result); ··· 733 737 sctp_chunk_hold(asoc->strreset_chunk); 734 738 735 739 result = SCTP_STRRESET_PERFORMED; 736 - 737 - *evp = sctp_ulpevent_make_stream_reset_event(asoc, 738 - SCTP_STREAM_RESET_INCOMING_SSN, nums, str_p, GFP_ATOMIC); 739 740 740 741 out: 741 742 sctp_update_strreset_result(asoc, result); ··· 866 873 if (!(asoc->strreset_enable & SCTP_ENABLE_CHANGE_ASSOC_REQ)) 867 874 goto out; 868 875 876 + in = ntohs(addstrm->number_of_streams); 877 + incnt = stream->incnt + in; 878 + if (!in || incnt > SCTP_MAX_STREAM) 879 + goto out; 880 + 881 + if (sctp_stream_alloc_in(stream, incnt, GFP_ATOMIC)) 882 + goto out; 883 + 869 884 if (asoc->strreset_chunk) { 870 885 if (!sctp_chunk_lookup_strreset_param( 871 886 asoc, 0, SCTP_PARAM_RESET_ADD_IN_STREAMS)) { ··· 896 895 asoc->strreset_chunk = NULL; 897 896 } 898 897 } 899 - 900 - in = ntohs(addstrm->number_of_streams); 901 - incnt = stream->incnt + in; 902 - if (!in || incnt > SCTP_MAX_STREAM) 903 - goto out; 904 - 905 - if (sctp_stream_alloc_in(stream, incnt, GFP_ATOMIC)) 906 - goto out; 907 898 908 899 stream->incnt = incnt; 909 900 ··· 966 973 967 974 result = SCTP_STRRESET_PERFORMED; 968 975 969 - *evp = sctp_ulpevent_make_stream_change_event(asoc, 970 - 0, 0, ntohs(addstrm->number_of_streams), GFP_ATOMIC); 971 - 972 976 out: 973 977 sctp_update_strreset_result(asoc, result); 974 978 err: ··· 1026 1036 sout->mid_uo = 0; 1027 1037 } 1028 1038 } 1029 - 1030 - flags = SCTP_STREAM_RESET_OUTGOING_SSN; 1031 1039 } 1040 + 1041 + flags |= SCTP_STREAM_RESET_OUTGOING_SSN; 1032 1042 1033 1043 for (i = 0; i < stream->outcnt; i++) 1034 1044 SCTP_SO(stream, i)->state = SCTP_STREAM_OPEN; ··· 1047 1057 str_p = inreq->list_of_streams; 1048 1058 nums = (ntohs(inreq->param_hdr.length) - sizeof(*inreq)) / 1049 1059 sizeof(__u16); 1060 + 1061 + flags |= SCTP_STREAM_RESET_INCOMING_SSN; 1050 1062 1051 1063 *evp = sctp_ulpevent_make_stream_reset_event(asoc, flags, 1052 1064 nums, str_p, GFP_ATOMIC);
+1 -1
net/wireless/nl80211.c
··· 555 555 }, 556 556 [NL80211_ATTR_TIMEOUT] = NLA_POLICY_MIN(NLA_U32, 1), 557 557 [NL80211_ATTR_PEER_MEASUREMENTS] = 558 - NLA_POLICY_NESTED(NL80211_PMSR_FTM_REQ_ATTR_MAX, 558 + NLA_POLICY_NESTED(NL80211_PMSR_ATTR_MAX, 559 559 nl80211_pmsr_attr_policy), 560 560 }; 561 561
+9 -4
net/wireless/reg.c
··· 1024 1024 } 1025 1025 1026 1026 rtnl_lock(); 1027 - if (WARN_ON(regdb && !IS_ERR(regdb))) { 1028 - /* just restore and free new db */ 1027 + if (regdb && !IS_ERR(regdb)) { 1028 + /* negative case - a bug 1029 + * positive case - can happen due to race in case of multiple cb's in 1030 + * queue, due to usage of asynchronous callback 1031 + * 1032 + * Either case, just restore and free new db. 1033 + */ 1029 1034 } else if (set_error) { 1030 1035 regdb = ERR_PTR(set_error); 1031 1036 } else if (fw) { ··· 1260 1255 * definitions (the "2.4 GHz band", the "5 GHz band" and the "60GHz band"), 1261 1256 * however it is safe for now to assume that a frequency rule should not be 1262 1257 * part of a frequency's band if the start freq or end freq are off by more 1263 - * than 2 GHz for the 2.4 and 5 GHz bands, and by more than 10 GHz for the 1258 + * than 2 GHz for the 2.4 and 5 GHz bands, and by more than 20 GHz for the 1264 1259 * 60 GHz band. 1265 1260 * This resolution can be lowered and should be considered as we add 1266 1261 * regulatory rule support for other "bands". ··· 1275 1270 * with the Channel starting frequency above 45 GHz. 1276 1271 */ 1277 1272 u32 limit = freq_khz > 45 * ONE_GHZ_IN_KHZ ? 1278 - 10 * ONE_GHZ_IN_KHZ : 2 * ONE_GHZ_IN_KHZ; 1273 + 20 * ONE_GHZ_IN_KHZ : 2 * ONE_GHZ_IN_KHZ; 1279 1274 if (abs(freq_khz - freq_range->start_freq_khz) <= limit) 1280 1275 return true; 1281 1276 if (abs(freq_khz - freq_range->end_freq_khz) <= limit)