History log of /linux-master/drivers/staging/ks7010/ks_wlan_net.c
Revision Date Author Comments
# 5f1c7031 08-Jul-2023 Zhang Shurong <zhang_shurong@foxmail.com>

staging: ks7010: potential buffer overflow in ks_wlan_set_encode_ext()

The "exc->key_len" is a u16 that comes from the user. If it's over
IW_ENCODING_TOKEN_MAX (64) that could lead to memory corruption.

Fixes: b121d84882b9 ("staging: ks7010: simplify calls to memcpy()")
Cc: stable <stable@kernel.org>
Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/tencent_5153B668C0283CAA15AA518325346E026A09@qq.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7097dc4e 26-Dec-2022 Xu Panda <xu.panda@zte.com.cn>

staging: ks7010: use strscpy() to instead of strncpy()

The implementation of strscpy() is more robust and safer.
That's now the recommended way to copy NUL-terminated strings.

Signed-off-by: Xu Panda <xu.panda@zte.com.cn>
Signed-off-by: Yang Yang <yang.yang29@zte.com>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/202212261903245548969@zte.com.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8ce25654 08-Nov-2022 Gustavo A. R. Silva <gustavoars@kernel.org>

staging: ks7010: Avoid clashing function prototypes

When built with Control Flow Integrity, function prototypes between
caller and function declaration must match. These mismatches are visible
at compile time with the new -Wcast-function-type-strict in Clang[1].

Fix a total of 27 warnings like these:

drivers/staging/ks7010/ks_wlan_net.c:2415:2: warning: cast from 'int (*)(struct net_device *, struct iw_request_info *, struct iw_point *, char *)' to 'iw_handler' (aka 'int (*)(struct net_device *, struct iw_request_info *, union iwreq_data *, char *)') converts to incompatible function type [-Wcast-function-type-strict]
(iw_handler)ks_wlan_get_firmware_version,/* 3 KS_WLAN_GET_FIRM_VERSION */
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The ks_wlan_net Wireless Extension handler callbacks (iw_handler) use a
union for the data argument. Actually use the union and perform explicit
member selection in the function body instead of having a function
prototype mismatch. There are no resulting binary differences
before/after changes.

These changes were made partly manually and partly with the help of
Coccinelle.

Link: https://reviews.llvm.org/D134831 [1]
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/8d2ceee1248b5a76e9b6c379f578e65482c91168.1667934775.git.gustavoars@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3928f64b 19-Oct-2021 Jakub Kicinski <kuba@kernel.org>

staging: use eth_hw_addr_set() for dev->addr_len cases

Convert all staging drivers from memcpy(... dev->addr_len)
to eth_hw_addr_set():

@@
expression dev, np;
@@
- memcpy(dev->dev_addr, np, dev->addr_len)
+ eth_hw_addr_set(dev, np)

Manually confirmed these are all etherdevices.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20211019171243.1412240-4-kuba@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 349f631d 19-Oct-2021 Jakub Kicinski <kuba@kernel.org>

staging: use eth_hw_addr_set() instead of ether_addr_copy()

Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

Convert staging from ether_addr_copy() to eth_hw_addr_set():

@@
expression dev, np;
@@
- ether_addr_copy(dev->dev_addr, np)
+ eth_hw_addr_set(dev, np)

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20211019171243.1412240-3-kuba@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3c667536 23-Jul-2021 Len Baker <len.baker@gmx.com>

staging/ks7010: Remove all strcpy() uses in favor of strscpy()

strcpy() performs no bounds checking on the destination buffer. This
could result in linear overflows beyond the end of the buffer, leading
to all kinds of misbehaviors. The safe replacement is strscpy().

Signed-off-by: Len Baker <len.baker@gmx.com>
Link: https://lore.kernel.org/r/20210723145122.5746-1-len.baker@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e163b982 02-Mar-2021 Dan Carpenter <dan.carpenter@oracle.com>

staging: ks7010: prevent buffer overflow in ks_wlan_set_scan()

The user can specify a "req->essid_len" of up to 255 but if it's
over IW_ESSID_MAX_SIZE (32) that can lead to memory corruption.

Fixes: 13a9930d15b4 ("staging: ks7010: add driver from Nanonote extra-repository")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/YD4fS8+HmM/Qmrw6@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 29ca39b5 27-Jul-2020 Gustavo A. R. Silva <gustavoars@kernel.org>

staging: ks7010: Use fallthrough pseudo-keyword

Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1].

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20200727190417.GA29944@embeddedor
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 41843ff0 28-Jun-2020 Luc Van Oostenryck <luc.vanoostenryck@gmail.com>

staging: ks7010: fix ks_wlan_start_xmit()'s return type

The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
which is a typedef for an enum type, but the implementation in this
driver returns an 'int'.

Fix this by returning 'netdev_tx_t' in this driver too and
usind 'NETDEV_TX_OK' instead of 0 accordingly.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Link: https://lore.kernel.org/r/20200628183926.74908-1-luc.vanoostenryck@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0290bd29 10-Dec-2019 Michael S. Tsirkin <mst@redhat.com>

netdev: pass the stuck queue to the timeout handler

This allows incrementing the correct timeout statistic without any mess.
Down the road, devices can learn to reset just the specific queue.

The patch was generated with the following script:

use strict;
use warnings;

our $^I = '.bak';

my @work = (
["arch/m68k/emu/nfeth.c", "nfeth_tx_timeout"],
["arch/um/drivers/net_kern.c", "uml_net_tx_timeout"],
["arch/um/drivers/vector_kern.c", "vector_net_tx_timeout"],
["arch/xtensa/platforms/iss/network.c", "iss_net_tx_timeout"],
["drivers/char/pcmcia/synclink_cs.c", "hdlcdev_tx_timeout"],
["drivers/infiniband/ulp/ipoib/ipoib_main.c", "ipoib_timeout"],
["drivers/infiniband/ulp/ipoib/ipoib_main.c", "ipoib_timeout"],
["drivers/message/fusion/mptlan.c", "mpt_lan_tx_timeout"],
["drivers/misc/sgi-xp/xpnet.c", "xpnet_dev_tx_timeout"],
["drivers/net/appletalk/cops.c", "cops_timeout"],
["drivers/net/arcnet/arcdevice.h", "arcnet_timeout"],
["drivers/net/arcnet/arcnet.c", "arcnet_timeout"],
["drivers/net/arcnet/com20020.c", "arcnet_timeout"],
["drivers/net/ethernet/3com/3c509.c", "el3_tx_timeout"],
["drivers/net/ethernet/3com/3c515.c", "corkscrew_timeout"],
["drivers/net/ethernet/3com/3c574_cs.c", "el3_tx_timeout"],
["drivers/net/ethernet/3com/3c589_cs.c", "el3_tx_timeout"],
["drivers/net/ethernet/3com/3c59x.c", "vortex_tx_timeout"],
["drivers/net/ethernet/3com/3c59x.c", "vortex_tx_timeout"],
["drivers/net/ethernet/3com/typhoon.c", "typhoon_tx_timeout"],
["drivers/net/ethernet/8390/8390.h", "ei_tx_timeout"],
["drivers/net/ethernet/8390/8390.h", "eip_tx_timeout"],
["drivers/net/ethernet/8390/8390.c", "ei_tx_timeout"],
["drivers/net/ethernet/8390/8390p.c", "eip_tx_timeout"],
["drivers/net/ethernet/8390/ax88796.c", "ax_ei_tx_timeout"],
["drivers/net/ethernet/8390/axnet_cs.c", "axnet_tx_timeout"],
["drivers/net/ethernet/8390/etherh.c", "__ei_tx_timeout"],
["drivers/net/ethernet/8390/hydra.c", "__ei_tx_timeout"],
["drivers/net/ethernet/8390/mac8390.c", "__ei_tx_timeout"],
["drivers/net/ethernet/8390/mcf8390.c", "__ei_tx_timeout"],
["drivers/net/ethernet/8390/lib8390.c", "__ei_tx_timeout"],
["drivers/net/ethernet/8390/ne2k-pci.c", "ei_tx_timeout"],
["drivers/net/ethernet/8390/pcnet_cs.c", "ei_tx_timeout"],
["drivers/net/ethernet/8390/smc-ultra.c", "ei_tx_timeout"],
["drivers/net/ethernet/8390/wd.c", "ei_tx_timeout"],
["drivers/net/ethernet/8390/zorro8390.c", "__ei_tx_timeout"],
["drivers/net/ethernet/adaptec/starfire.c", "tx_timeout"],
["drivers/net/ethernet/agere/et131x.c", "et131x_tx_timeout"],
["drivers/net/ethernet/allwinner/sun4i-emac.c", "emac_timeout"],
["drivers/net/ethernet/alteon/acenic.c", "ace_watchdog"],
["drivers/net/ethernet/amazon/ena/ena_netdev.c", "ena_tx_timeout"],
["drivers/net/ethernet/amd/7990.h", "lance_tx_timeout"],
["drivers/net/ethernet/amd/7990.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/a2065.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/am79c961a.c", "am79c961_timeout"],
["drivers/net/ethernet/amd/amd8111e.c", "amd8111e_tx_timeout"],
["drivers/net/ethernet/amd/ariadne.c", "ariadne_tx_timeout"],
["drivers/net/ethernet/amd/atarilance.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/au1000_eth.c", "au1000_tx_timeout"],
["drivers/net/ethernet/amd/declance.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/lance.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/mvme147.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/ni65.c", "ni65_timeout"],
["drivers/net/ethernet/amd/nmclan_cs.c", "mace_tx_timeout"],
["drivers/net/ethernet/amd/pcnet32.c", "pcnet32_tx_timeout"],
["drivers/net/ethernet/amd/sunlance.c", "lance_tx_timeout"],
["drivers/net/ethernet/amd/xgbe/xgbe-drv.c", "xgbe_tx_timeout"],
["drivers/net/ethernet/apm/xgene-v2/main.c", "xge_timeout"],
["drivers/net/ethernet/apm/xgene/xgene_enet_main.c", "xgene_enet_timeout"],
["drivers/net/ethernet/apple/macmace.c", "mace_tx_timeout"],
["drivers/net/ethernet/atheros/ag71xx.c", "ag71xx_tx_timeout"],
["drivers/net/ethernet/atheros/alx/main.c", "alx_tx_timeout"],
["drivers/net/ethernet/atheros/atl1c/atl1c_main.c", "atl1c_tx_timeout"],
["drivers/net/ethernet/atheros/atl1e/atl1e_main.c", "atl1e_tx_timeout"],
["drivers/net/ethernet/atheros/atlx/atl.c", "atlx_tx_timeout"],
["drivers/net/ethernet/atheros/atlx/atl1.c", "atlx_tx_timeout"],
["drivers/net/ethernet/atheros/atlx/atl2.c", "atl2_tx_timeout"],
["drivers/net/ethernet/broadcom/b44.c", "b44_tx_timeout"],
["drivers/net/ethernet/broadcom/bcmsysport.c", "bcm_sysport_tx_timeout"],
["drivers/net/ethernet/broadcom/bnx2.c", "bnx2_tx_timeout"],
["drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h", "bnx2x_tx_timeout"],
["drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c", "bnx2x_tx_timeout"],
["drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c", "bnx2x_tx_timeout"],
["drivers/net/ethernet/broadcom/bnxt/bnxt.c", "bnxt_tx_timeout"],
["drivers/net/ethernet/broadcom/genet/bcmgenet.c", "bcmgenet_timeout"],
["drivers/net/ethernet/broadcom/sb1250-mac.c", "sbmac_tx_timeout"],
["drivers/net/ethernet/broadcom/tg3.c", "tg3_tx_timeout"],
["drivers/net/ethernet/calxeda/xgmac.c", "xgmac_tx_timeout"],
["drivers/net/ethernet/cavium/liquidio/lio_main.c", "liquidio_tx_timeout"],
["drivers/net/ethernet/cavium/liquidio/lio_vf_main.c", "liquidio_tx_timeout"],
["drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c", "lio_vf_rep_tx_timeout"],
["drivers/net/ethernet/cavium/thunder/nicvf_main.c", "nicvf_tx_timeout"],
["drivers/net/ethernet/cirrus/cs89x0.c", "net_timeout"],
["drivers/net/ethernet/cisco/enic/enic_main.c", "enic_tx_timeout"],
["drivers/net/ethernet/cisco/enic/enic_main.c", "enic_tx_timeout"],
["drivers/net/ethernet/cortina/gemini.c", "gmac_tx_timeout"],
["drivers/net/ethernet/davicom/dm9000.c", "dm9000_timeout"],
["drivers/net/ethernet/dec/tulip/de2104x.c", "de_tx_timeout"],
["drivers/net/ethernet/dec/tulip/tulip_core.c", "tulip_tx_timeout"],
["drivers/net/ethernet/dec/tulip/winbond-840.c", "tx_timeout"],
["drivers/net/ethernet/dlink/dl2k.c", "rio_tx_timeout"],
["drivers/net/ethernet/dlink/sundance.c", "tx_timeout"],
["drivers/net/ethernet/emulex/benet/be_main.c", "be_tx_timeout"],
["drivers/net/ethernet/ethoc.c", "ethoc_tx_timeout"],
["drivers/net/ethernet/faraday/ftgmac100.c", "ftgmac100_tx_timeout"],
["drivers/net/ethernet/fealnx.c", "fealnx_tx_timeout"],
["drivers/net/ethernet/freescale/dpaa/dpaa_eth.c", "dpaa_tx_timeout"],
["drivers/net/ethernet/freescale/fec_main.c", "fec_timeout"],
["drivers/net/ethernet/freescale/fec_mpc52xx.c", "mpc52xx_fec_tx_timeout"],
["drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c", "fs_timeout"],
["drivers/net/ethernet/freescale/gianfar.c", "gfar_timeout"],
["drivers/net/ethernet/freescale/ucc_geth.c", "ucc_geth_timeout"],
["drivers/net/ethernet/fujitsu/fmvj18x_cs.c", "fjn_tx_timeout"],
["drivers/net/ethernet/google/gve/gve_main.c", "gve_tx_timeout"],
["drivers/net/ethernet/hisilicon/hip04_eth.c", "hip04_timeout"],
["drivers/net/ethernet/hisilicon/hix5hd2_gmac.c", "hix5hd2_net_timeout"],
["drivers/net/ethernet/hisilicon/hns/hns_enet.c", "hns_nic_net_timeout"],
["drivers/net/ethernet/hisilicon/hns3/hns3_enet.c", "hns3_nic_net_timeout"],
["drivers/net/ethernet/huawei/hinic/hinic_main.c", "hinic_tx_timeout"],
["drivers/net/ethernet/i825xx/82596.c", "i596_tx_timeout"],
["drivers/net/ethernet/i825xx/ether1.c", "ether1_timeout"],
["drivers/net/ethernet/i825xx/lib82596.c", "i596_tx_timeout"],
["drivers/net/ethernet/i825xx/sun3_82586.c", "sun3_82586_timeout"],
["drivers/net/ethernet/ibm/ehea/ehea_main.c", "ehea_tx_watchdog"],
["drivers/net/ethernet/ibm/emac/core.c", "emac_tx_timeout"],
["drivers/net/ethernet/ibm/emac/core.c", "emac_tx_timeout"],
["drivers/net/ethernet/ibm/ibmvnic.c", "ibmvnic_tx_timeout"],
["drivers/net/ethernet/intel/e100.c", "e100_tx_timeout"],
["drivers/net/ethernet/intel/e1000/e1000_main.c", "e1000_tx_timeout"],
["drivers/net/ethernet/intel/e1000e/netdev.c", "e1000_tx_timeout"],
["drivers/net/ethernet/intel/fm10k/fm10k_netdev.c", "fm10k_tx_timeout"],
["drivers/net/ethernet/intel/i40e/i40e_main.c", "i40e_tx_timeout"],
["drivers/net/ethernet/intel/iavf/iavf_main.c", "iavf_tx_timeout"],
["drivers/net/ethernet/intel/ice/ice_main.c", "ice_tx_timeout"],
["drivers/net/ethernet/intel/ice/ice_main.c", "ice_tx_timeout"],
["drivers/net/ethernet/intel/igb/igb_main.c", "igb_tx_timeout"],
["drivers/net/ethernet/intel/igbvf/netdev.c", "igbvf_tx_timeout"],
["drivers/net/ethernet/intel/ixgb/ixgb_main.c", "ixgb_tx_timeout"],
["drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c", "adapter->netdev->netdev_ops->ndo_tx_timeout(adapter->netdev);"],
["drivers/net/ethernet/intel/ixgbe/ixgbe_main.c", "ixgbe_tx_timeout"],
["drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c", "ixgbevf_tx_timeout"],
["drivers/net/ethernet/jme.c", "jme_tx_timeout"],
["drivers/net/ethernet/korina.c", "korina_tx_timeout"],
["drivers/net/ethernet/lantiq_etop.c", "ltq_etop_tx_timeout"],
["drivers/net/ethernet/marvell/mv643xx_eth.c", "mv643xx_eth_tx_timeout"],
["drivers/net/ethernet/marvell/pxa168_eth.c", "pxa168_eth_tx_timeout"],
["drivers/net/ethernet/marvell/skge.c", "skge_tx_timeout"],
["drivers/net/ethernet/marvell/sky2.c", "sky2_tx_timeout"],
["drivers/net/ethernet/marvell/sky2.c", "sky2_tx_timeout"],
["drivers/net/ethernet/mediatek/mtk_eth_soc.c", "mtk_tx_timeout"],
["drivers/net/ethernet/mellanox/mlx4/en_netdev.c", "mlx4_en_tx_timeout"],
["drivers/net/ethernet/mellanox/mlx4/en_netdev.c", "mlx4_en_tx_timeout"],
["drivers/net/ethernet/mellanox/mlx5/core/en_main.c", "mlx5e_tx_timeout"],
["drivers/net/ethernet/micrel/ks8842.c", "ks8842_tx_timeout"],
["drivers/net/ethernet/micrel/ksz884x.c", "netdev_tx_timeout"],
["drivers/net/ethernet/microchip/enc28j60.c", "enc28j60_tx_timeout"],
["drivers/net/ethernet/microchip/encx24j600.c", "encx24j600_tx_timeout"],
["drivers/net/ethernet/natsemi/sonic.h", "sonic_tx_timeout"],
["drivers/net/ethernet/natsemi/sonic.c", "sonic_tx_timeout"],
["drivers/net/ethernet/natsemi/jazzsonic.c", "sonic_tx_timeout"],
["drivers/net/ethernet/natsemi/macsonic.c", "sonic_tx_timeout"],
["drivers/net/ethernet/natsemi/natsemi.c", "ns_tx_timeout"],
["drivers/net/ethernet/natsemi/ns83820.c", "ns83820_tx_timeout"],
["drivers/net/ethernet/natsemi/xtsonic.c", "sonic_tx_timeout"],
["drivers/net/ethernet/neterion/s2io.h", "s2io_tx_watchdog"],
["drivers/net/ethernet/neterion/s2io.c", "s2io_tx_watchdog"],
["drivers/net/ethernet/neterion/vxge/vxge-main.c", "vxge_tx_watchdog"],
["drivers/net/ethernet/netronome/nfp/nfp_net_common.c", "nfp_net_tx_timeout"],
["drivers/net/ethernet/nvidia/forcedeth.c", "nv_tx_timeout"],
["drivers/net/ethernet/nvidia/forcedeth.c", "nv_tx_timeout"],
["drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c", "pch_gbe_tx_timeout"],
["drivers/net/ethernet/packetengines/hamachi.c", "hamachi_tx_timeout"],
["drivers/net/ethernet/packetengines/yellowfin.c", "yellowfin_tx_timeout"],
["drivers/net/ethernet/pensando/ionic/ionic_lif.c", "ionic_tx_timeout"],
["drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c", "netxen_tx_timeout"],
["drivers/net/ethernet/qlogic/qla3xxx.c", "ql3xxx_tx_timeout"],
["drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c", "qlcnic_tx_timeout"],
["drivers/net/ethernet/qualcomm/emac/emac.c", "emac_tx_timeout"],
["drivers/net/ethernet/qualcomm/qca_spi.c", "qcaspi_netdev_tx_timeout"],
["drivers/net/ethernet/qualcomm/qca_uart.c", "qcauart_netdev_tx_timeout"],
["drivers/net/ethernet/rdc/r6040.c", "r6040_tx_timeout"],
["drivers/net/ethernet/realtek/8139cp.c", "cp_tx_timeout"],
["drivers/net/ethernet/realtek/8139too.c", "rtl8139_tx_timeout"],
["drivers/net/ethernet/realtek/atp.c", "tx_timeout"],
["drivers/net/ethernet/realtek/r8169_main.c", "rtl8169_tx_timeout"],
["drivers/net/ethernet/renesas/ravb_main.c", "ravb_tx_timeout"],
["drivers/net/ethernet/renesas/sh_eth.c", "sh_eth_tx_timeout"],
["drivers/net/ethernet/renesas/sh_eth.c", "sh_eth_tx_timeout"],
["drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c", "sxgbe_tx_timeout"],
["drivers/net/ethernet/seeq/ether3.c", "ether3_timeout"],
["drivers/net/ethernet/seeq/sgiseeq.c", "timeout"],
["drivers/net/ethernet/sfc/efx.c", "efx_watchdog"],
["drivers/net/ethernet/sfc/falcon/efx.c", "ef4_watchdog"],
["drivers/net/ethernet/sgi/ioc3-eth.c", "ioc3_timeout"],
["drivers/net/ethernet/sgi/meth.c", "meth_tx_timeout"],
["drivers/net/ethernet/silan/sc92031.c", "sc92031_tx_timeout"],
["drivers/net/ethernet/sis/sis190.c", "sis190_tx_timeout"],
["drivers/net/ethernet/sis/sis900.c", "sis900_tx_timeout"],
["drivers/net/ethernet/smsc/epic100.c", "epic_tx_timeout"],
["drivers/net/ethernet/smsc/smc911x.c", "smc911x_timeout"],
["drivers/net/ethernet/smsc/smc9194.c", "smc_timeout"],
["drivers/net/ethernet/smsc/smc91c92_cs.c", "smc_tx_timeout"],
["drivers/net/ethernet/smsc/smc91x.c", "smc_timeout"],
["drivers/net/ethernet/stmicro/stmmac/stmmac_main.c", "stmmac_tx_timeout"],
["drivers/net/ethernet/sun/cassini.c", "cas_tx_timeout"],
["drivers/net/ethernet/sun/ldmvsw.c", "sunvnet_tx_timeout_common"],
["drivers/net/ethernet/sun/niu.c", "niu_tx_timeout"],
["drivers/net/ethernet/sun/sunbmac.c", "bigmac_tx_timeout"],
["drivers/net/ethernet/sun/sungem.c", "gem_tx_timeout"],
["drivers/net/ethernet/sun/sunhme.c", "happy_meal_tx_timeout"],
["drivers/net/ethernet/sun/sunqe.c", "qe_tx_timeout"],
["drivers/net/ethernet/sun/sunvnet.c", "sunvnet_tx_timeout_common"],
["drivers/net/ethernet/sun/sunvnet_common.c", "sunvnet_tx_timeout_common"],
["drivers/net/ethernet/sun/sunvnet_common.h", "sunvnet_tx_timeout_common"],
["drivers/net/ethernet/synopsys/dwc-xlgmac-net.c", "xlgmac_tx_timeout"],
["drivers/net/ethernet/ti/cpmac.c", "cpmac_tx_timeout"],
["drivers/net/ethernet/ti/cpsw.c", "cpsw_ndo_tx_timeout"],
["drivers/net/ethernet/ti/cpsw_priv.c", "cpsw_ndo_tx_timeout"],
["drivers/net/ethernet/ti/cpsw_priv.h", "cpsw_ndo_tx_timeout"],
["drivers/net/ethernet/ti/davinci_emac.c", "emac_dev_tx_timeout"],
["drivers/net/ethernet/ti/netcp_core.c", "netcp_ndo_tx_timeout"],
["drivers/net/ethernet/ti/tlan.c", "tlan_tx_timeout"],
["drivers/net/ethernet/toshiba/ps3_gelic_net.h", "gelic_net_tx_timeout"],
["drivers/net/ethernet/toshiba/ps3_gelic_net.c", "gelic_net_tx_timeout"],
["drivers/net/ethernet/toshiba/ps3_gelic_wireless.c", "gelic_net_tx_timeout"],
["drivers/net/ethernet/toshiba/spider_net.c", "spider_net_tx_timeout"],
["drivers/net/ethernet/toshiba/tc35815.c", "tc35815_tx_timeout"],
["drivers/net/ethernet/via/via-rhine.c", "rhine_tx_timeout"],
["drivers/net/ethernet/wiznet/w5100.c", "w5100_tx_timeout"],
["drivers/net/ethernet/wiznet/w5300.c", "w5300_tx_timeout"],
["drivers/net/ethernet/xilinx/xilinx_emaclite.c", "xemaclite_tx_timeout"],
["drivers/net/ethernet/xircom/xirc2ps_cs.c", "xirc_tx_timeout"],
["drivers/net/fjes/fjes_main.c", "fjes_tx_retry"],
["drivers/net/slip/slip.c", "sl_tx_timeout"],
["include/linux/usb/usbnet.h", "usbnet_tx_timeout"],
["drivers/net/usb/aqc111.c", "usbnet_tx_timeout"],
["drivers/net/usb/asix_devices.c", "usbnet_tx_timeout"],
["drivers/net/usb/asix_devices.c", "usbnet_tx_timeout"],
["drivers/net/usb/asix_devices.c", "usbnet_tx_timeout"],
["drivers/net/usb/ax88172a.c", "usbnet_tx_timeout"],
["drivers/net/usb/ax88179_178a.c", "usbnet_tx_timeout"],
["drivers/net/usb/catc.c", "catc_tx_timeout"],
["drivers/net/usb/cdc_mbim.c", "usbnet_tx_timeout"],
["drivers/net/usb/cdc_ncm.c", "usbnet_tx_timeout"],
["drivers/net/usb/dm9601.c", "usbnet_tx_timeout"],
["drivers/net/usb/hso.c", "hso_net_tx_timeout"],
["drivers/net/usb/int51x1.c", "usbnet_tx_timeout"],
["drivers/net/usb/ipheth.c", "ipheth_tx_timeout"],
["drivers/net/usb/kaweth.c", "kaweth_tx_timeout"],
["drivers/net/usb/lan78xx.c", "lan78xx_tx_timeout"],
["drivers/net/usb/mcs7830.c", "usbnet_tx_timeout"],
["drivers/net/usb/pegasus.c", "pegasus_tx_timeout"],
["drivers/net/usb/qmi_wwan.c", "usbnet_tx_timeout"],
["drivers/net/usb/r8152.c", "rtl8152_tx_timeout"],
["drivers/net/usb/rndis_host.c", "usbnet_tx_timeout"],
["drivers/net/usb/rtl8150.c", "rtl8150_tx_timeout"],
["drivers/net/usb/sierra_net.c", "usbnet_tx_timeout"],
["drivers/net/usb/smsc75xx.c", "usbnet_tx_timeout"],
["drivers/net/usb/smsc95xx.c", "usbnet_tx_timeout"],
["drivers/net/usb/sr9700.c", "usbnet_tx_timeout"],
["drivers/net/usb/sr9800.c", "usbnet_tx_timeout"],
["drivers/net/usb/usbnet.c", "usbnet_tx_timeout"],
["drivers/net/vmxnet3/vmxnet3_drv.c", "vmxnet3_tx_timeout"],
["drivers/net/wan/cosa.c", "cosa_net_timeout"],
["drivers/net/wan/farsync.c", "fst_tx_timeout"],
["drivers/net/wan/fsl_ucc_hdlc.c", "uhdlc_tx_timeout"],
["drivers/net/wan/lmc/lmc_main.c", "lmc_driver_timeout"],
["drivers/net/wan/x25_asy.c", "x25_asy_timeout"],
["drivers/net/wimax/i2400m/netdev.c", "i2400m_tx_timeout"],
["drivers/net/wireless/intel/ipw2x00/ipw2100.c", "ipw2100_tx_timeout"],
["drivers/net/wireless/intersil/hostap/hostap_main.c", "prism2_tx_timeout"],
["drivers/net/wireless/intersil/hostap/hostap_main.c", "prism2_tx_timeout"],
["drivers/net/wireless/intersil/hostap/hostap_main.c", "prism2_tx_timeout"],
["drivers/net/wireless/intersil/orinoco/main.c", "orinoco_tx_timeout"],
["drivers/net/wireless/intersil/orinoco/orinoco_usb.c", "orinoco_tx_timeout"],
["drivers/net/wireless/intersil/orinoco/orinoco.h", "orinoco_tx_timeout"],
["drivers/net/wireless/intersil/prism54/islpci_dev.c", "islpci_eth_tx_timeout"],
["drivers/net/wireless/intersil/prism54/islpci_eth.c", "islpci_eth_tx_timeout"],
["drivers/net/wireless/intersil/prism54/islpci_eth.h", "islpci_eth_tx_timeout"],
["drivers/net/wireless/marvell/mwifiex/main.c", "mwifiex_tx_timeout"],
["drivers/net/wireless/quantenna/qtnfmac/core.c", "qtnf_netdev_tx_timeout"],
["drivers/net/wireless/quantenna/qtnfmac/core.h", "qtnf_netdev_tx_timeout"],
["drivers/net/wireless/rndis_wlan.c", "usbnet_tx_timeout"],
["drivers/net/wireless/wl3501_cs.c", "wl3501_tx_timeout"],
["drivers/net/wireless/zydas/zd1201.c", "zd1201_tx_timeout"],
["drivers/s390/net/qeth_core.h", "qeth_tx_timeout"],
["drivers/s390/net/qeth_core_main.c", "qeth_tx_timeout"],
["drivers/s390/net/qeth_l2_main.c", "qeth_tx_timeout"],
["drivers/s390/net/qeth_l2_main.c", "qeth_tx_timeout"],
["drivers/s390/net/qeth_l3_main.c", "qeth_tx_timeout"],
["drivers/s390/net/qeth_l3_main.c", "qeth_tx_timeout"],
["drivers/staging/ks7010/ks_wlan_net.c", "ks_wlan_tx_timeout"],
["drivers/staging/qlge/qlge_main.c", "qlge_tx_timeout"],
["drivers/staging/rtl8192e/rtl8192e/rtl_core.c", "_rtl92e_tx_timeout"],
["drivers/staging/rtl8192u/r8192U_core.c", "tx_timeout"],
["drivers/staging/unisys/visornic/visornic_main.c", "visornic_xmit_timeout"],
["drivers/staging/wlan-ng/p80211netdev.c", "p80211knetdev_tx_timeout"],
["drivers/tty/n_gsm.c", "gsm_mux_net_tx_timeout"],
["drivers/tty/synclink.c", "hdlcdev_tx_timeout"],
["drivers/tty/synclink_gt.c", "hdlcdev_tx_timeout"],
["drivers/tty/synclinkmp.c", "hdlcdev_tx_timeout"],
["net/atm/lec.c", "lec_tx_timeout"],
["net/bluetooth/bnep/netdev.c", "bnep_net_timeout"]
);

for my $p (@work) {
my @pair = @$p;
my $file = $pair[0];
my $func = $pair[1];
print STDERR $file , ": ", $func,"\n";
our @ARGV = ($file);
while (<ARGV>) {
if (m/($func\s*\(struct\s+net_device\s+\*[A-Za-z_]?[A-Za-z-0-9_]*)(\))/) {
print STDERR "found $1+$2 in $file\n";
}
if (s/($func\s*\(struct\s+net_device\s+\*[A-Za-z_]?[A-Za-z-0-9_]*)(\))/$1, unsigned int txqueue$2/) {
print STDERR "$func found in $file\n";
}
print;
}
}

where the list of files and functions is simply from:

git grep ndo_tx_timeout, with manual addition of headers
in the rare cases where the function is from a header,
then manually changing the few places which actually
call ndo_tx_timeout.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Heiner Kallweit <hkallweit1@gmail.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Shannon Nelson <snelson@pensando.io>
Reviewed-by: Martin Habets <mhabets@solarflare.com>

changes from v9:
fixup a forward declaration
changes from v9:
more leftovers from v3 change
changes from v8:
fix up a missing direct call to timeout
rebased on net-next
changes from v7:
fixup leftovers from v3 change
changes from v6:
fix typo in rtl driver
changes from v5:
add missing files (allow any net device argument name)
changes from v4:
add a missing driver header
changes from v3:
change queue # to unsigned
Changes from v2:
added headers
Changes from v1:
Fix errors found by kbuild:
generalize the pattern a bit, to pick up
a couple of instances missed by the previous
version.

Signed-off-by: David S. Miller <davem@davemloft.net>


# 08b9bee6 01-Mar-2019 Wentao Cai <etsai042@gmail.com>

Staging: ks7010: Replace typecast to int

This patch fixes the checkpatch.pl warning:
WARNING: Unnecessary typecast of c90 int constant

Signed-off-by: Wentao Cai <etsai042@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f647b8e1 13-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: replace uint8_t with u8 in ks_wlan_set_rx_gain

In function ks_wlan_set_rx_gain a cast to uint8_t is being used
to assign reception gain. 'rx_gain' field is defined as u8 so
replace the cast to the correct type

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ace98ed0 13-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: replace uint8_t with u8 in ks_wlan_set_tx_gain

In function ks_wlan_set_tx_gain a cast to uint8_t is being used
to assign transmission gain. 'tx_gain' field is defined as u8 so
replace the cast to the correct type.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 255d4e1d 13-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: change uint8_t casts to u8 in ks_wlan_set_rate

There are some casts to uint8_t in ks_wlan_set_rate function to
assign values of the bitrate. Just change it to u8 which is the one
defined for the field 'body' of the struct which is in use.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6d6612de 06-May-2018 Nathan Chancellor <nathan@kernel.org>

staging: ks7010: Remove unnecessary limit checks

uwrq is an unsigned 32-bit integer, it cannot be less than zero.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 203ad5a1 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor ks_get_wireless_stats function

This commit refactor a bit ks_get_wireless_stats using
ternary operator for return code. It also change a comment
to use preferred style.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2d1de1e3 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor ks_wlan_set_mlme function

This commit refactors ks_wlan_set_mlme function changing
switch-case block for more simple if paths improving
readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 81255d86 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor ks_wlan_set_phy_type function

Handle invalid values first and assign good ones at the
end if it is the case. This makes code simplier.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7f3c8bb5 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor ks_wlan_set_sleep_mode function

This commit refactors ks_wlan_set_sleep_mode function
avoiding to use switch-case statement ans using simple
if logic to handle invalid values first. This simplifies
data paths as well as improves readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 97d173c6 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use ether_addr_copy in ks_wlan_net_start

Instead of use memcpy for copying ethernet addresses, use
ether_addr_copy that do the same.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3ec51bb2 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use ether_addr_copy in ks_wlan_set_mac_address

Use ether_addr_copy to copy ethernet address instad of using
memcpy in ks_wlan_set_mac_address function.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d96f3a7c 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: change type for rsn_enabled in wpa_status struct

Field rsn_enabled included in wpa_status struct is declared as
unsigned int but it is only be set using 0 and 1 values and
in conditional if code is just being used as a boolean. Change
its type to be a boolean.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1c800aab 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: move two preprocessor definitions to ks_wlan.h

In ks_wlan_translate_scan function there are two preprocessor
definitions:

- RSN_INFO_ELEM_ID
- GENERIC_INFO_ELEM_ID

These can be moved to common ks_wlan.h because they can be used
in get_current_ap function instead of use hardcoded values.
GENERIC_INFO_ELEM_ID has been renamed to WPA_INFO_ELEM_ID which
is more clear.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a0a954b1 03-May-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: add SPDX identifiers to all files

It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Fix up the all of the staging ks7010 files to have a proper SPDX
identifier, based on the license text in the file itself. The SPDX
identifier is a legally binding shorthand, which can be used instead of
the full boiler plate text.

Extra GPL text wording can be removed as it is no longer needed at all.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# bcb53e8a 25-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor ks_wlan_translate_scan function

This commit refactors ks_wlan_translate_scan function with
the following changes:

- reorder local variables
- use ether_addr_copy to copy ethernet addresses
- change style in 'current_ev' variable assignments
- make use of some ternaries avoiding if-else code
- use preferred style for comments
- extract common code into a new ks_wlan_add_leader_event
function

After this changes readability has been improved.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 55b56be2 25-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: avoid blank line between declarations in ks_wlan_get_aplist

This commit removes a blank line which is included between
declarations and it has not sense at all.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 77b948df 25-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use ether_addr_copy in ks_wlan_get_aplist

Use ether_addr_copy to copy ethernet addresses instead of
using custom memcpy for that.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1df964ac 25-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: avoid if-else condition in ks_wlan_get_power

The if-else code in ks_wlan_get_power function is not needed
at all and can be achieved with a simple boolean assignation.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f3b0bd23 25-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: avoid an 'else' in ks_wlan_set_power

Change if logic to handle invalid case for operation_mode
at first avoiding an 'else' path.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# afa10db0 25-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use ether_addr_copy in ks_wlan_get_wap

Use ether_addr_copy to copy ethernet addresses instead
of a custom memcpy. This improves readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 90db5912 25-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor ks_wlan_set_wap function

Make use of ether_addr_copy instead of memcpy for copying
ethernet address data in ks_wlan_set_wap function and avoid
an 'else' just changing if logic to check invalid values first.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 60d4125d 25-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: align values in frequency_list array

To avoid a long line align values in static array
frequency_list array.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b8cbbc12 25-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use ether_addr_copy in ks_wlan_set_encode_ext

Instead of manually memcpy ethernet addresses use ether_addr_copy
function for this purpose.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 092f239e 25-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor ks_wlan_set_pmksa function

This commit cleans a bit ks_wlan_set_pmksa function removing
nonsense comments as well as make use of ether_addr_* family
functions written to not do manually things that were being
here. Minor single if brackets has been removed also.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# bf338a90 25-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor ks_wlan_set_cts_mode function

This commit refactors ks_wlan_set_cts_mode function to
handle invalid values first and then assign the good
one changing a bit logic to use a ternary operator.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8521b4e6 25-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor ks_wlan_set_preamble function

Change if logic to handle invalid values first and just
assign at the end the valid one if it is the case.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c8712580 25-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor ks_wlan_set_power_mgmt function

This commit change logic to simplify conditional paths in
ks_wlan_set_power_mgmt function. It handles invalid's first
and just finally assign a valid value.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7a2cc8db 25-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor ks_wlan_set_scan_type function

This commit changes logic to handle invalid values first
and just assign valid ones afterwards.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 25ee63eb 25-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor ks_wlan_set_beacon_lost function

Change if condition to handle invalid value first and
avoid nonsense else's path improving readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 07335253 24-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use ether_addr_copy() instead of custom copy

In order to achieve ethernet address copies, ether_addr_copy()
function exists. So just use it and avoid the byte by byte copy.
This increase readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f4455942 24-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: remove duplicated ks_wlan_handler_def declaration

This declaration is declared twice so just remove this one because
the other one is the one which contains static struct initializers.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 92c1552c 24-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: remove WPS definition conditional code

WPS definition was defined by default in ks_wlan.h header
file. So it makes no sense to have conditional preprocessor
stuff along the code about this.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e83cfca1 24-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: fix line exceding 80 characters in ks_wlan_get_range

Avoid very long if condition just changing its style. This makes
checkpatch script not complains about this line.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ca946972 24-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor ks_wlan_get_mode function

Avoid the use of switch-case block which is not necessary
at all and just use a ternary operator to achieve this.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1e4c7fb3 24-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor ks_wlan_set_mode function

Most cases which are being handled in the switch-case of
ks_wlan_set_mode function are just returning EINVAL. Avoid
the use of switch-case stament and just use a simple if
to handle those. This decrease LOC as well as improves
readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b58e1dda 24-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: remove some duplicated definitions in ks_wlan_net.c

This definitions are in linux/wireless.h header so it is not
necessary at all to have this compatibility stuff duplicated here.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5dfd0cfe 23-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: remove KSC_OPNOTSUPP related code

This commit reviews KSC_OPNOTSUPP related code. The
preprocessor KSC_OPNOTSUPP is defined by default so
related wext functions are not being used. Just clean
code removing all of this stuff.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 18e76e23 23-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: use IW_HANDLER macro in ks_wlan_handler

This commit make use of IW_HANDLER to set wext operations
of the device. Using this, comments are not neccessary anymore
and also NULL entries so readability is clearly increased.
In order to avoid casting because of the use of a different
prototype in all related functions, those which are affected
have been updated also to make use of the union iwreq_data
as third parameter updating code accordly.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d892cc1c 23-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: change name and type for device_open_status field

This commit changes type for device_open_status field of ks_wlan_private
structure from int to bool. This variable is only be set to 1
on ks_wlan_net_start and set to 0 on ks_wlan_net_stop. For this
purpose it is not necessary at all to use an integer because a bool
is enough. This also renames field name from device_open_status to
is_device_open.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5e8779dc 18-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: align comments in ks_wlan_private_handler

This commit align comment inside ks_wlan_private_handler
WEXT private driver operations. This improves readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8a4e6ab3 18-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: review includes of ks_wlan_net.c file

This commit reviews really needed includes in ks_wlan_net.c
source file. It removes those which are not needed at all.
It also reorder the remaining ones in alphabetical order.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6519967b 18-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor ks_wlan_set_wps_enable function

This commit refactors ks_wlan_set_wps_enable function to
improve readability handling the error first to avoid an
'else'.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 86357f79 18-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor ks_wlan_set_tx_gain function

This commit refactors ks_wlan_set_rx_gain function to
improve readability:
- error condition is handling the error to avoid an 'else'
- ternary operator is used to clean if-else block assignment.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6cb3e606 18-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor ks_wlan_set_rx_gain function

This commit refactors ks_wlan_set_rx_gain function to
improve readability:
- error condition is handling the error to avoid an 'else'
- ternary operator is used to clean if-else block assignment.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9dbeb16a 18-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: change if-else condition assignment to use ternary operator

This commit changes an if-else block used to just assign a
variable to use a ternary operator to do the same improving
readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6cf070d2 18-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: refactor ks_wlan_set_encode function

This commit refactors ks_wlan_set_encode function to improve
readability. It just removes level indentation in some paths
as well as removes not needed conditions paths which was
checked before. Changes are as follows:

- (dwrq->length > MAX_KEY_SIZE) check has been moved to the top.
- extra check about (dwrq->length > 0) inside an if block where
that was the condition to enter inside it has been removed.
- (dwrq->flags & IW_ENCODE_NOKEY) check has been turned to avoid
one level indentation.
- extra check (index >= 0) && (index < 4) has been removed. In
the top of the file invalid index values are being checked
so it has no sense to check that again.
- remove commented line.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# fffe8bec 18-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: remove auxiliar zeros buffer in ks_wlan_get_encode

This commit removes the local buffer zeros in ks_wlan_get_encode
function. It also refactors related conditions in order to fill
'extra' output parameter of the function. Originally this zeros
is just memset to zeros and only being used if drw->length is
truncated to zero because of priv->reg.wep_key[index].size is
greater than 16 chars. In those cases the final if statement is
just using zeros but it is using memcpy with a length of zero
bytes which has no sense. Instead of that just handle the good
case copying from the same source the number of bytes of
priv->reg.wep_key[index].size. If it is zero the final 'extra'
parameter won't be copied at all because the number of bytes to
copy will be zero. With this change the code gets simplified.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9b512431 06-Apr-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: remove nosense #if 1 directive

This commit removes #if 1 directive from code to
improve readability. It is always true, so it makes
no sense to have it there.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e9f83033 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove unnecessary casts in 'struct ks_wlan_handler_def'.

The casts used when initializing members of this data structure mirror
the types the variables already have. Remove the casts.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8102f61d 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Change 'device_open_status' to a bool.

The 'device_open_status' member of 'struct ks_wlan_private' is only
ever set to zero or one, so it makes more sense for it to be a bool
instead of an int.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 582475a2 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Rename ks_wlan_set_multicast_list()

All of the net_device_ops callbacks are named after their counterparts
in the kernel's 'struct net_device_ops', except
ks_wlan_set_multicast_list(). Rename it to ks_wlan_set_rx_mode() for
greater consistency.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b7402474 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct pmk_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct pmk_t' with 'struct pmk'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8b76eb09 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct wpa_key_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct wpa_key_t' with 'struct wpa_key'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 01d391d4 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove trailing _t from 'struct local_ap_t'.

The "_t" suffix is not needed for structure names in this driver, and is a
reflection of an older typedef system that is no longer in place. Replace
all occurences of 'struct local_ap_t' with 'struct local_ap'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5312af9e 31-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Use the ARRAY_SIZE() macro to calculate array sizes.

This macro, provided in 'linux/kernel.h', will calculate the size
more succinctly than a division operation.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f40cd66b 28-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Change mac_address_valid to a bool instead of int.

'mac_address_valid' is only ever assigned 0 or 1, so it makes more sense
to use a bool type for this variable.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 019ec785 28-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Remove unecessary cast.

The driver casts '&ks_wlan_handler_def' to 'struct iw_handler_def *',
but it is already of that type.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c0a2a254 28-Mar-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: remove some dead code from ks_wlan_set_essid function

This commit removes death code which is not being used at all. The
statements which are contained inside the else block of preprocessor
#if 1 directive are no sense. Also remove #if 1 preprocessor stuff
just because it is just true and being executed always.
This change improves a bit readability of ks_wlan_set_essid function.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5259b329 15-Mar-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: replace DPRINTK traces in favour of netdev_*

This commit removes custom defined DPRINTK macro and replaces all the
associated debug and other traces for preferred ones netdev_*.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7acf4002 15-Mar-2018 Sergio Paracuellos <sergio.paracuellos@gmail.com>

staging: ks7010: remove useless DPRINTK traces

This commit removes some useless traces in some source files

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c468d584 28-Feb-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: ks7010: Replace local capability constants with kernel constants.

This driver defined constants BSS_CAP_* to represent WLAN capability
codes; however, these constants are already defined in the header
'linux/ieee80211.h' as WLAN_CAPABILITY_*. This change removes the locally
defined constants and substitutes the kernel's constants.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Reviewed-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0a20a614 13-Dec-2017 SUNIL KALLUR RAMEGOWDA <kallur.sunil@gmail.com>

Staging: ks7010: ks_wlan_net: Fixing coding style warning

Removing the extra spaces before tabs, checkpatch:
WARNING: please, no space before tabs

Signed-off-by: SUNIL KALLUR RAMEGOWDA <kallur.sunil@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8a81f749 24-Oct-2017 Kees Cook <keescook@chromium.org>

staging: ks7010: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Tobin C. Harding" <me@tobin.cc>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 583d6a93 12-Oct-2017 Gustavo A. R. Silva <garsilva@embeddedor.com>

staging: ks7010: ks_wlan_net: mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 1364489
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7b379dba 02-Jul-2017 Janusz Lisiecki <janusz.lisiecki@gmail.com>

staging: ks7010: Fix cast to restricted __le16 in ks_wlan_net.c

This patch fixes the following Sparse warnings in ks_wlan_net.c:
drivers/staging/ks7010/ks_wlan_net.c:1359:24: warning: cast to restricted __le16
link_ap_info_t structure field 'capability' has native order and is used everywhere
in the code in such way (i.e get_ap_information, get_current_ap). Both sides of
assignment are u16 (native order) so 'le16_to_cpu' is not needed and wrong.

Signed-off-by: Janusz Lisiecki <janusz.lisiecki@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a9cbe2ad 28-Jun-2017 Colin Ian King <colin.king@canonical.com>

staging: ks7010: fix spelling mistake: "errror" -> "error"

Trivial fix to spelling mistake in netdev_err message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 93270634 29-Apr-2017 Janusz Lisiecki <janusz.lisiecki@gmail.com>

staging: ks7010: avoid CamelCase in fields of struct local_gain_t

Replace CamelCase fields of struct with underscores to comply
with the standard kernel coding style

Signed-off-by: Janusz Lisiecki <janusz.lisiecki@gmail.com>
Reviewed-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2b0d92b2 26-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: remove cast from netdev_priv()

The returned pointer from netdev_priv() (void *) does not need to be
cast.

Remove unnecessary cast of void * returned by netdev_priv().

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8fb8e05c 26-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: make abbreviation mgmt uniform

Driver currently uses abbreviations 'mgt' and 'mngmt' for
'management'. Also 'power' is sometimes abbreviated to 'pow' and other
times not. It makes the code easier to read and easier to modify if
one abbreviation is used throughout the driver. 'mgmt' is widely
accepted as an abbreviation of 'management'. 'power' can be spelled
out in full, the extra two characters aids readability without an
excessive cost.

Make abbreviation of 'management' uniform across the driver, function
names, preprocessor defined constants, and enumeration types.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0e24eb8a 26-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: abstract connection status

Host interface connection status is handled using a 32 bit type. Top
byte is used as for FORCE_DISCONNECT status, low bits are used for
connect/disconnect status. Driver masks and checks integers to
ascertain status. If functions are defined to do the masking and
equality check then the details of how the status integer is used are
abstracted away. This makes the code easier to read. Also future
updates to the status handling will be easier because the code is in
one place.

Driver currently uses the CONNECT_STATUS and DISCONNECT_STATUS as
values, as apposed to opaque values. Because of this driver code
checks for equality with CONNECT_STATUS and DISCONNECT_STATUS as
apposed to negating a single check (ie 'foo != CONNECT_STATUS). In
order to maintain the current functionality we define two separate
functions is_connect_status() and is_disconnect_status().

Add functions to abstract the status integer check. Update all sites
that do the check manually to use the newly defined functions.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 055da4f9 17-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix complete_handler

complete_handler() takes void * types as parameters. void * parameters are then
cast to struct types. Call sites for this function either pass in NULL
or pointers to the struct types cast to void *. This casting is
unnecessary and can be removed.

Struct tx_device_buffer (which contains a pointer member to the
complete_handler() function) has as member 'ks_wlan_priv *priv' this is
unnecessary, we always have a pointer to this struct there is no need
to store it here.

The complete_handler can be more clearly defined by using struct
pointer types instead of void * types. The code is currently
unnecessarily complex, storing and passing extraneous pointer
parameters.

Remove unnecessary parameters, unnecessary casting to/from 'void
*'. Fix all call sites involving complete_handler().

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ba932876 09-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix checkpatch UNNECESSARY_ELSE

Checkpatch emits WARNING: else is not generally useful after a break
or return. Two warnings of this type are emitted for this code block,
in both cases 'else' statements are unnecessary.

Remove unnecessary 'else' statements, reduce indentation in subsequent
code.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8f0ef774 09-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix checkpatch PARENTHESIS_ALIGNMENT

Checkpatch emits CHECK: Alignment should match open parenthesis.

Align argument to open parenthesis.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3da1b237 09-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: utilize local variable

Function contains a local pointer variable defined to a memory location
within a structure. This memory location is later used by
dereferencing the struct instead of using the local pointer. The code
is cleaner if all references of the same memory location use the
local variable.

Utilize existing local pointer variable instead of dereferencing
struct.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b121d848 09-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: simplify calls to memcpy()

Function uses overly complex calls to memcpy(). Code may be simplified
by the use of a local variable. Code sometimes uses explicit address
of initial array element and sometimes does not. Uniformity aids
readability. If array pointers are explicit it aids readability further.

Simplify calls to memcpy(). Add local pointer variable, define it to
the correct memory location. Use newly defined variable in calls to
memcpy(). Be uniform in use of explicit address of first element of
array (&foo[0]).

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9ff19a6e 09-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: move null check before dereference

Function parameter is cast to a local pointer which is then
dereferenced before it is checked to be non-NULL.

Move pointer null check to be before the pointer is dereferenced.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# dc59ef2a 09-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix multi-way decision

Multi-way decision contains two anomalies.

Firstly, a local variable is defined to be the inverse truth variable
of a struct member. This local variable is used as the conditional to
the multi-way decision. This is unnecessary, the same logic can be
expressed using the struct member directly.

Secondly, there are four branches in the multi-way decision, two of
which can never be executed. This is dead code.

Remove unnecessary local variable. Remove two branches of multi-way
decision statement that can never be executed.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 03b02449 09-Apr-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: rename identifier rc to ret

Driver uses identifier 'rc' to hold the value for error return
code. The rest of the driver predominately uses 'ret' for this
purpose. It is easier to follow the code if one name is used for one
task.

Rename identifier 'rc' to 'ret'.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 310e916f 21-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: add explicit check to 'size' variables

When checking the value of a variable that holds a 0 an explicit check
is good style. i.e

- if (!size)
+ if (size == 0)

Update checks on 'numerical' variables to use explicit checks.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b5ca039a 21-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: add explicit check to memcmp() calls

Calls to functions memcmp() and strcmp() are more clearly readable
when the return value is explicitly checked. i.e

if (memcmp(foo, bar, size) == 0)

Modify driver to use an explicit check on the value returned by
memcmp().

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1770ae9d 20-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: rename return value identifier

Driver uses multiple identifier names for the same task (retval, ret,
rc). It would be easier to read the code if a single task is
identified with a single name. 'ret' is the most common return value
identifier name found in the kernel tree, following the principle of
least surprise using 'ret' is a decent choice.

Rename rc -> ret
Rename retval -> ret

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1e765f31 20-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: remove zero comparison

Comparison, equal to zero, is redundant

'if (foo == 0)' is equal to 'if (!foo)'

Typical kernel coding style is to use the shorter form.

Remove unnecessary zero comparison.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 13b05e46 20-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: return directly on error

Function uses goto label with no clean up code. In this case we
should just return directly.

Remove goto statement, return directly on error.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 44c3cd5e 20-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix checkpatch PARENTHESIS_ALIGNMENT

Checkpatch emits CHECK: Alignment should match open parenthesis.

Fix alignment to open parenthesis in line with kernel coding style.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 44f2bf55 20-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix checkpatch LINE_SPACING

Checkpatch emits CHECK: Please use a blank line after
function/struct/union/enum declarations.

Add blank line after function definition.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6cdd6538 14-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: remove dead code

Driver has dead code compiled out using preprocessor directives. TODO
file asks for these not to be removed - ignore this.

Remove dead code. Remove 'do not remove #if 0/1 ...' from TODO file.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f160bc20 14-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: remove superfluous comments

Driver uses custom function comment format. These comments are on
functions with internal likage. Comment string /*--------/* adds
nothing to the driver. Comment 'Wireless Handler' does not have allot
of meaning.

Remove superfluous function comments. Leave comments that add meaning.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# aa6ca807 14-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: remove custom return values

Driver code uses custom return values (often positive) to signal error
condition instead of using standard kernel error codes.

Replace custom return values with standard kernel error codes.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7bb6313d 14-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix off by one error

Bug introduced in commit 7676b72 by Tobin C. Harding.

Remove equals sign from comparison, fixing off by one error.

Fixes: 7676b72428e8 ("staging: ks7010: move comparison to right hand side")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 902f49ca 13-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: refactor, whitespace only

Code may be refactored to take advantage of previous patches which
reduced the level of indentation. Function parameter line breaks can
be adjusted in line with kernel coding standards.

Refactor layout of function call parameters. Make whitespace changes
only.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f0a4c596 13-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: reduce level of indentation

Checkpatch emits WARNING: Too many leading tabs - consider code
refactoring. One level of indentation may be removed by inverting an
if statement conditional (and returning if new conditional evaluates
to true). Code contains switch statement that also contains multiple
layers of indentation. Indentation may be reduced by breaking out of
the case statement in multiple places instead of guarding code with
if/else statements.

Invert conditional. Return original error code if new conditional
evaluates to true. Break out of case blocks instead of using
if/else. Do not modify program logic.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f0b7d3a6 13-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix checkpatch memset warning

Checkpatch emits WARNING: single byte memset is suspicious. Swapped
2nd/3rd argument? Call site in question is correct but is an unusual
use of memset() to zero a single byte. The same can be achieved by
assigning 0 directly to the memory location.

Dereference pointer and assign 0 to that memory location. Use '\0' to
make explicit that it is a char pointer.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ad1e187f 13-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: remove unnecessary cast

Return value from kmalloc() does not require a cast.

Remove unnecessary cast.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 44dc9c86 13-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: remove unnecessary else statement

Checkpatch emits WARNING: else is not generally useful after a break
or return. Two warnings of this type are emitted, both are the result
of a else statement after a return statement. The 'else' can safely be
removed.

Remove unnecessary else statement.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7676b724 13-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: move comparison to right hand side

Checkpatch emits WARNING: Comparisons should place the constant on the
right side of the test.

Move constant to right hand side of test, modify operator to ensure
logic is maintained.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e00b9bb3 13-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: remove multiple assignment

Checkpatch emits CHECK: multiple assignments should be avoided.

Move multiple assignment onto separate lines. Fix comment to use more
natural English.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b5492d65 13-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: remove dead code

Checkpatch emits CHECK: Alignment should match open parenthesis. This
is due to commented out code.

Remove commented out (dead) code.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a359491a 13-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix logical line continuation

Checkpatch emits CHECK: Logical continuations should be on the
previous line.

Move logical continuation to previous line.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 64068bc3 13-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix checkpatch BLOCK_COMMENT_STYLE

Checkpatch emits block comments warnings.

Change comments blocks to be inline with kernel coding style for
networking code.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 03d55ab9 13-Mar-2017 Tobin C. Harding <me@tobin.cc>

staging: ks7010: fix checkpatch SPACING

Checkpatch emits over 100 instances of CHECK: No space is necessary
after a cast.

Remove unnecessary space.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 184eb0c5 11-Mar-2017 Shiva Kerdel <shiva@exdev.nl>

Staging: ks7010: ks_*: Use preferred 'u8' kernel type over 'uint8_t'

Fix prefer kernel type 'u8' over 'uint8_t' checks.

Signed-off-by: Shiva Kerdel <shiva@exdev.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# be046617 01-Mar-2017 Arushi Singhal <arushisinghal19971997@gmail.com>

staging: ks7010: Unnecessary parentheses removed and improved coding style.

Unnecessary parentheses are removed as reported by checkpatch.pl
to make coder nicer and to improve readability.
Also coding style is improved as it's often nicer to read if
&(foo[0]) is converted to foo like:
memcpy(&(ap->bssid[0]), &(ap_info->bssid[0]), ETH_ALEN);
memcpy(ap->bssid, ap_info->bssid, ETH_ALEN);

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8f4d00cd 17-Feb-2017 Shiva Kerdel <shiva@exdev.nl>

Staging: ks7010: ks_*: Braces should be used on all arms of these statements

Braces should be used on all arms of these statements (CHECK)..

Signed-off-by: Shiva Kerdel <shiva@exdev.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# db224d31 16-Feb-2017 Shiva Kerdel <shiva@exdev.nl>

Staging: ks7010: Add required and preferred spaces around operators

Spaces should be added around operators to improve readability
and are required in some cases.

Signed-off-by: Shiva Kerdel <shiva@exdev.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d9eb4861 16-Feb-2017 Shiva Kerdel <shiva@exdev.nl>

Staging: ks7010: ks*: Remove redundant blank lines

Multiple blank lines shouldn't be used.

Signed-off-by: Shiva Kerdel <shiva@exdev.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# fac103e0 10-Feb-2017 Shiva Kerdel <shiva@exdev.nl>

Staging: ks7010: ks_*: Removed blank lines before and after braces.

Removing unnecessary blank lines around braces to solve CHECKS.

Signed-off-by: Shiva Kerdel <shiva@exdev.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9a8936d6 14-Jan-2017 David Wittman <dwittman@gmail.com>

staging: ks7010: Fix brace style issue in ks_wlan_net.c

This change fixes a checkpatch error for "that open brace { should be
on the previous line" as well as a related spacing warning.

Signed-off-by: David Wittman <dwittman@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f416e264 03-Dec-2016 Yamanappagouda Patil <goudapatilk@gmail.com>

staging: ks7010: fixed 'space prohibited after that *' erros.

Fixed checkpatch.pl errors related to "space prohibited after that '*'
or '&'" in ks_wlan_net.c file.

Signed-off-by: Yamanappagouda Patil <goudapatilk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# fe497530 03-Dec-2016 Yamanappagouda Patil <goudapatilk@gmail.com>

staging: ks7010: Fixed 'missing blank line after declaration' warnings.

Fixed checkpatch.pl warnings 'Missing blank line after declaration'
in ks_wlan_net.c file.

Signed-off-by: Yamanappagouda Patil <goudapatilk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e0d64815 24-Nov-2016 Yamanappagouda Patil <goudapatilk@gmail.com>

Staging: ks7010: Fixed {} brace warnings for single statement blocks.

Fixed checkpatch.pl warnings related to {} brace warnings for single
statement blocks.

Signed-off-by: Yamanappagouda Patil <goudapatilk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0371fa4f 18-Oct-2016 Wei Yongjun <weiyongjun1@huawei.com>

staging: ks7010: ks_wlan_net: Use setup_timer instead of init_timer and data fields

Use setup_timer function instead of initializing timer with the function
and data fields

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# acefb645 13-Oct-2016 Sabitha George <sabitha.george@gmail.com>

staging: ks7010: Fixes warning :do not add new typedefs

Fixes checkpatch.pl warning: do not add new typedefs in
ks_wlan_net.c

Signed-off-by: Sabitha George <sabitha.george@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 96268418 10-Oct-2016 Sabitha George <sabitha.george@gmail.com>

staging: ks7010: Fixes error "foo * bar should be foo *bar"

Fixes checkpatch warning on ks_wlan_net.c:
foo * bar should be foo *bar

Signed-off-by: Sabitha George <sabitha.george@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 99a751c7 10-Oct-2016 Sabitha George <sabitha.george@gmail.com>

staging: ks7010: Replace asm/uaccess.h and asm/atomic.h

Replaces inclusion of asm/uaccess.h with linux/uaccess.h
and asm/atomic.h with linux/atomic.h in ks_wlan_net.c

Signed-off-by: Sabitha George <sabitha.george@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e33c759a 07-Oct-2016 Ebru Akagunduz <ebru.akagunduz@gmail.com>

staging: ks7010: remove unnecessary else statement

This patch removes else statement which is not
usefull after a return. Issue found by checkpatch.pl.

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7a98abcc 06-Oct-2016 Pontus Fuchs <pontus.fuchs@gmail.com>

staging: ks7010: Use printk format specifier for MAC addresses

Convert to %pM instead of custom code.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6b750fac 04-Oct-2016 Muraru Mihaela <mihaela.muraru21@gmail.com>

Staging: ks7010: fix brace coding style issue

This is a patch to the ks_wlan_net.c file that fixes up a brace coding
style warning found by checkpatch.pl tool, by deleting the unnecessary braces for single statement blocks.

Signed-off-by: Muraru Mihaela <mihaela.muraru21@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 03806ab3 26-Sep-2016 Georgiana Rodica Chelu <georgiana.chelu93@gmail.com>

staging: ks7010: ks_wlan_net: Use netdev_info instead of printk

Pass the net_device structure to print_hif_event function
in order to use netdev_info instead of printk.

Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c8be6461 26-Sep-2016 Georgiana Rodica Chelu <georgiana.chelu93@gmail.com>

staging: ks7010: ks_wlan_net: Use netdev_ instead of printk

The checkpatch.pl script found the following warning:

WARNING: printk() should include KERN_ facility level

After adding the KERN_ facility level to printk(), the script showed
another warning:

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then
dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...

The warning is similar for KERN_ERR and KERN_DEBUG. In conclusion,
use netdev_info(), netdev_err() or netdev_dbg() when there is
a netdev device.

Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7a4abee9 24-Sep-2016 Georgiana Rodica Chelu <georgiana.chelu93@gmail.com>

staging: ks7010: ks_wlan_net: Remove return statement from void function

Remove the return statement from the end of a void function
to clean up the code.

Issue found by checkpatch.pl script.

Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 55adb7bf 23-Sep-2016 Georgiana Rodica Chelu <georgiana.chelu93@gmail.com>

staging: ks7010: ks_wlan_net: Remove unnecessary variable used to store return value

Remove unneeded code in order to make clear
that the function returns 0(success) in all cases.

Done using returnvar.cocci script.

Signed-off-by: Georgiana Rodica Chelu <georgiana.chelu93@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e4e8d968 23-Sep-2016 Baoyou Xie <baoyou.xie@linaro.org>

Staging: ks7010: remove unused function in ks_wlan_net.c

We get 1 warning when building kernel with W=1:
drivers/staging/ks7010/ks_wlan_net.c:3520:5: warning: no previous prototype for 'ks_wlan_reset' [-Wmissing-prototypes]

In fact, these functions are unused in
ks_wlan_net.c, but should be removed.

So this patch removes the unused function.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2751bc91 17-Sep-2016 Bhumika Goyal <bhumirks@gmail.com>

Staging: ks7010: Remove extern keyword from function declaration

Remove extern specifier from function declaration as they have
it by default. Also move extern declaration from .c files to
their respective header file 'ks_hostif.h'. Coccinelle was used
to remove extern and other changes were done by hand.
Script:
@@
identifier func;
type T;
@@
- extern
T func(...);

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 30b48e2d 16-Sep-2016 Bhumika Goyal <bhumirks@gmail.com>

Staging: ks7010: Replace memset with eth_zero_addr

Use eth_zero_addr to assign zero address to the given address array
instead of memset when the second argument in memset is address
of zero. Coccinelle was used to do the replacement and add the
header file linux/etherdevice.h if not already present.
Script:
@header@
@@
#include <linux/etherdevice.h>

@r1@
expression e;
@@

-memset(e,0,ETH_ALEN);
+eth_zero_addr(e);

@includeheader depends on r1 && !header@
@@
+ #include <linux/etherdevice.h>
#include <...>

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e30ed33d 15-Sep-2016 Wei Yongjun <weiyongjun1@huawei.com>

staging: ks7010: remove unused including <linux/version.h>

Remove including <linux/version.h> that don't need it.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c7e65f4d 12-Sep-2016 sayli karnik <karniksayli1995@gmail.com>

staging: ks7010: Remove the explicit NULL comparison

The patch removes the explicit null comparisons entirely for the ks7010 driver.
This was detected by checkpatch.pl

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8defffb2 07-Sep-2016 Colin Ian King <colin.king@canonical.com>

staging: ks7010: avoid dereferencing packet if it is null

Updating tx_bytes from packet->len if packet is null will cause
a null pointer dereference, so only update tx_bytes if it packet
is not null.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 453e102d 14-Jun-2016 Dan Carpenter <dan.carpenter@oracle.com>

staging: ks7010: remove bogus NULL checks

enc->rx_seq[] and enc->key[] are arrays, not pointers and they can't be
NULL. Let's remove these NULL checks.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 516a4f04 17-Jun-2016 Wolfram Sang <wsa@kernel.org>

staging: ks7010: drop private handler for driver version

We are upstream now, we don't need seperate driver versioning.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c5d9a030 30-May-2016 Wolfram Sang <wsa+renesas@sang-engineering.com>

staging: ks7010: cleanup file headers

Remove svn-ids and fix typos in the licence declaration. Add my
copyright to the sdio code which I worked on mainly.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4e66308e 30-May-2016 Wolfram Sang <wsa+renesas@sang-engineering.com>

staging: ks7010: adapt to new trans_start handling

trans_start is gone from netdevice, so use the new helper function to
set the mark.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1df65547 30-May-2016 Wolfram Sang <wsa+renesas@sang-engineering.com>

staging: ks7010: indent ks_wlan_net.c

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# feedcf1a 30-May-2016 Wolfram Sang <wsa+renesas@sang-engineering.com>

staging: ks7010: remove unecessary typedef

Let's simply specify the struct to keep in sync with kernel coding
style.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 564efd79 30-May-2016 Wolfram Sang <wsa+renesas@sang-engineering.com>

staging: ks7010: delete seperate debug header

Move the one debug macro to the generic wlan header.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 72bf7500 30-May-2016 Wolfram Sang <wsa+renesas@sang-engineering.com>

staging: ks7010: remove code for old kernel versions

No need to be backwards compatible.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4ab27401 30-May-2016 Wolfram Sang <wsa+renesas@sang-engineering.com>

staging: ks7010: remove checks for WIRELESS_EXT version

We are by far newer than that anyhow.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 13a9930d 30-May-2016 Wolfram Sang <wsa+renesas@sang-engineering.com>

staging: ks7010: add driver from Nanonote extra-repository

See the TODO for details where this driver came from. Only a few minor
changes were made to make the driver suitable for staging:

* updated Kconfig help text and dependencies
* added TODO
* removed two __DATE__ and __TIME__ printouts to allow reproducible builds
* added to staging main Kconfig + Makefile

Tested on a Renesas Salvator-X board with a Spectec SDW-823 card. I
could connect to a WPA-protected network.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>